jamespot-react-core 1.2.44 → 1.2.46
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/{628.73265f7fde405adcd2c9.chunk.js → 664.98a9c8b95abdc89137ee.chunk.js} +240 -240
- package/build/664.98a9c8b95abdc89137ee.chunk.js.map +1 -0
- package/build/app.bundle.js +234 -231
- package/build/app.bundle.js.map +1 -1
- package/build/src/components/calendar/CalendarWrapper.d.ts +1 -1
- package/build/src/registry/ext-component-list.d.ts +1 -0
- package/build/src/utils/types.d.ts +1 -0
- package/package.json +4 -4
- package/build/628.73265f7fde405adcd2c9.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([[664],{664:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>T,AddReportModal:()=>Z,Audience:()=>L,Avatar:()=>x,CalendarToolbar:()=>ho,CalendarWrapper:()=>Co,CommentsBloc:()=>Jn,DisplayForm:()=>R,Editor:()=>el,EditorsPortal:()=>Wl,Empty:()=>Sl,FullPageLayout:()=>Ml,JRCInputTinyMCEWithExt:()=>zl,JRCInputTinyMCEWithExtRaw:()=>Dl,MarkdownModal:()=>bt,ModalAudience:()=>Rl,ModalSchedule:()=>Ql,TwoColLayout:()=>Zl,WidgetList:()=>xe,WidgetWrapperCore:()=>Rn});var n=i(211),o=i(594),l=i(196),s=i.n(l),a=i(493),r=i(98),d=i(685),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;
|
|
@@ -32,7 +32,7 @@
|
|
|
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)($,{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"),
|
|
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"),N=u.j.getLazyComponent("Typography"),P=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,179 +48,13 @@
|
|
|
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"}
|
|
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`
|
|
61
|
-
margin-bottom: 24px;
|
|
62
|
-
`,s().div`
|
|
63
|
-
margin-bottom: 4px;
|
|
64
|
-
`,s().div`
|
|
65
|
-
position: absolute;
|
|
66
|
-
background-color: ${e=>e.isActive?"rgba(0,0,0,.1)":"transparent"};
|
|
67
|
-
inset: 0;
|
|
68
|
-
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
69
|
-
flex: 1;
|
|
70
|
-
display: flex;
|
|
71
|
-
overflow: hidden;
|
|
72
|
-
`),ye=s().div`
|
|
73
|
-
flex-direction: row;
|
|
74
|
-
display: flex;
|
|
75
|
-
min-height: 60px;
|
|
76
|
-
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
77
|
-
`,be=s().div`
|
|
78
|
-
width: 60px;
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: center;
|
|
81
|
-
justify-content: center;
|
|
82
|
-
`,Ce=s().div`
|
|
83
|
-
flex: 1;
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
`,ve=s().div`
|
|
88
|
-
position: relative;
|
|
89
|
-
overflow: hidden;
|
|
90
|
-
top: 0px;
|
|
91
|
-
width: ${460}px;
|
|
92
|
-
`,we=s().div`
|
|
93
|
-
position: absolute;
|
|
94
|
-
top: 0;
|
|
95
|
-
${e=>"left"===e.position?"left: 0px;":""}
|
|
96
|
-
${e=>"right"===e.position?"right: -1000px;":""}
|
|
97
|
-
width: ${440}px;
|
|
98
|
-
bottom: 00px;
|
|
99
|
-
display: flex;
|
|
100
|
-
background-color: ${e=>e.theme.color.white};
|
|
101
|
-
flex-direction: row;
|
|
102
|
-
transition: all 0.4s;
|
|
103
|
-
box-shadow: -4px 0px 20px 0px #00000017;
|
|
104
|
-
|
|
105
|
-
&.animate {
|
|
106
|
-
right: 0px;
|
|
107
|
-
}
|
|
108
|
-
`,Le=s().div`
|
|
109
|
-
flex: 1;
|
|
110
|
-
display: flex;
|
|
111
|
-
flex-direction: column;
|
|
112
|
-
padding: 12px;
|
|
113
|
-
overflow: auto;
|
|
114
|
-
margin-bottom: 12px;
|
|
115
|
-
position: relative;
|
|
116
|
-
`,Ee=s().div`
|
|
117
|
-
flex: 1;
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
`,ke=s().div`
|
|
121
|
-
position: absolute;
|
|
122
|
-
inset: 0;
|
|
123
|
-
background-color: rgba(255, 255, 255, 0.8);
|
|
124
|
-
display: flex;
|
|
125
|
-
align-items: center;
|
|
126
|
-
justify-content: center;
|
|
127
|
-
`,_e=s().div`
|
|
128
|
-
position: absolute;
|
|
129
|
-
inset: 0;
|
|
130
|
-
background-color: ${e=>e.theme.color.white};
|
|
131
|
-
padding: ${e=>e.theme.space.md}px;
|
|
132
|
-
`,We=s().div`
|
|
133
|
-
width: ${50}px;
|
|
134
|
-
padding-top: 60px;
|
|
135
|
-
display: flex;
|
|
136
|
-
flex-direction: column;
|
|
137
|
-
border-right: 1px solid ${e=>e.theme.color.grey2};
|
|
138
|
-
`,Se=s().button`
|
|
139
|
-
border-radius: 4px;
|
|
140
|
-
cursor: pointer;
|
|
141
|
-
height: 42px;
|
|
142
|
-
margin: 4px;
|
|
143
|
-
width: 42px;
|
|
144
|
-
display: flex;
|
|
145
|
-
align-items: center;
|
|
146
|
-
justify-content: center;
|
|
147
|
-
background-color: ${e=>e.isActive?e.theme.color.grey2:e.theme.color.white};
|
|
148
|
-
|
|
149
|
-
${(0,r.DashedFocusBorder)()}
|
|
150
|
-
|
|
151
|
-
&:hover {
|
|
152
|
-
background-color: ${e=>e.theme.color.grey2};
|
|
153
|
-
}
|
|
154
|
-
`,qe=(s().div`
|
|
155
|
-
display: flex;
|
|
156
|
-
border: 1px solid ${e=>e.theme.color.grey1};
|
|
157
|
-
border-radius: ${8}px;
|
|
158
|
-
margin-bottom: 24px;
|
|
159
|
-
input {
|
|
160
|
-
width: 100%;
|
|
161
|
-
border: 0;
|
|
162
|
-
height: ${50}px;
|
|
163
|
-
margin: 0;
|
|
164
|
-
}
|
|
165
|
-
`,s().div`
|
|
166
|
-
display: flex;
|
|
167
|
-
flex-direction: row;
|
|
168
|
-
padding: 12px;
|
|
169
|
-
background-color: ${e=>e.theme.color.grey0};
|
|
170
|
-
border-radius: 8px;
|
|
171
|
-
margin-bottom: 4px;
|
|
172
|
-
`,s().div`
|
|
173
|
-
display: flex;
|
|
174
|
-
flex: 1;
|
|
175
|
-
align-items: center;
|
|
176
|
-
`,s().div`
|
|
177
|
-
width: 40px;
|
|
178
|
-
display: flex;
|
|
179
|
-
justify-content: center;
|
|
180
|
-
align-items: center;
|
|
181
|
-
`,s().div`
|
|
182
|
-
flex-direction: row;
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
`,s().div`
|
|
186
|
-
flex: 1;
|
|
187
|
-
display: flex;
|
|
188
|
-
align-items: center;
|
|
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`
|
|
190
|
-
margin-left: 2px;
|
|
191
|
-
margin-right: 2px;
|
|
192
|
-
margin-bottom: 8px;
|
|
193
|
-
font-size: 14px;
|
|
194
|
-
width: 100%;
|
|
195
|
-
min-height: 20px;
|
|
196
|
-
`,tt=s().fieldset`
|
|
197
|
-
margin: 12px 0px !important;
|
|
198
|
-
width: 100% !important;
|
|
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`
|
|
200
|
-
position: absolute;
|
|
201
|
-
inset: 0;
|
|
202
|
-
pointer-events: none;
|
|
203
|
-
z-index: 1;
|
|
204
|
-
`,Ct=s().div`
|
|
205
|
-
flex: 1;
|
|
206
|
-
display: flex;
|
|
207
|
-
margin-top: ${90}px;
|
|
208
|
-
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
209
|
-
`,vt=s().div`
|
|
210
|
-
flex: 1;
|
|
211
|
-
display: flex;
|
|
212
|
-
flex-direction: row;
|
|
213
|
-
pointer-events: none;
|
|
214
|
-
`,wt=s().div`
|
|
215
|
-
width: ${440}px;
|
|
216
|
-
pointer-events: none;
|
|
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`
|
|
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},{signal:v.signal,format:"raw-list"});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)(N,{variant:l?"h3":"h2",children:(0,n.jsx)(P,{label:p?.title,length:40})}),h&&(0,n.jsxs)(N,{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})]})})};var ee=i(737),te=i(282),ie=i(789);const ne=s().div`
|
|
218
52
|
display: flex;
|
|
219
53
|
flex-direction: row;
|
|
220
54
|
flex-wrap: wrap;
|
|
221
55
|
gap: 10px;
|
|
222
56
|
justify-content: center;
|
|
223
|
-
`,
|
|
57
|
+
`,oe=s().div`
|
|
224
58
|
border: 1px solid ${e=>e.theme.color.grey2};
|
|
225
59
|
border-radius: 8px;
|
|
226
60
|
cursor: pointer;
|
|
@@ -245,7 +79,7 @@
|
|
|
245
79
|
opacity: 1;
|
|
246
80
|
}
|
|
247
81
|
}
|
|
248
|
-
`,
|
|
82
|
+
`,le=s().div`
|
|
249
83
|
border: 2px solid ${e=>e.theme.color.primary};
|
|
250
84
|
height: ${e=>e.open?e.height:"54"}px;
|
|
251
85
|
border-radius: 8px;
|
|
@@ -255,14 +89,14 @@
|
|
|
255
89
|
transition: height 0.4s;
|
|
256
90
|
overflow: hidden;
|
|
257
91
|
flex-direction: column;
|
|
258
|
-
`,
|
|
92
|
+
`,se=s().div`
|
|
259
93
|
display: flex;
|
|
260
94
|
flex-direction: row;
|
|
261
95
|
flex-wrap: wrap;
|
|
262
96
|
justify-content: center;
|
|
263
97
|
gap: 10px;
|
|
264
98
|
${e=>e.column&&"flex-direction: column;"}
|
|
265
|
-
`,
|
|
99
|
+
`,ae=s().div`
|
|
266
100
|
min-height: 50px;
|
|
267
101
|
display: flex;
|
|
268
102
|
justify-content: center;
|
|
@@ -272,7 +106,7 @@
|
|
|
272
106
|
&:hover {
|
|
273
107
|
background-color: ${e=>e.theme.color.grey0};
|
|
274
108
|
}
|
|
275
|
-
`,
|
|
109
|
+
`,re=s().button`
|
|
276
110
|
display: flex;
|
|
277
111
|
align-items: center;
|
|
278
112
|
padding: ${e=>e.parentIsColumn?"36px 16px":"0 10px"};
|
|
@@ -293,48 +127,48 @@
|
|
|
293
127
|
}
|
|
294
128
|
|
|
295
129
|
${(0,r.DashedFocusBorder)()}
|
|
296
|
-
`,
|
|
130
|
+
`,de=s().div`
|
|
297
131
|
display: flex;
|
|
298
132
|
flex-direction: ${e=>"row"===e.direction?"row":"column"};
|
|
299
133
|
align-items: ${e=>"row"===e.direction?"center":"flex-start"};
|
|
300
134
|
justify-content: ${e=>"row"===e.direction?"flex-start":"center"};
|
|
301
135
|
flex: 1;
|
|
302
136
|
${e=>e.gap&&`gap:${e.gap}px`}
|
|
303
|
-
`,
|
|
137
|
+
`,ce=u.j.getLazyComponent("Button"),ue=u.j.getLazyComponent("ModalLayout"),ge=u.j.getLazyComponent("ModalContent"),me=u.j.getLazyComponent("Tooltip"),pe=u.j.getLazyComponent("IconButton"),xe=({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)(ue,{...m,children:(0,n.jsx)(ge,{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)(se,{column:!0,children:u.map((e,t)=>(0,n.jsx)(re,{open:!0,full:!0,parentIsColumn:!0,index:t,onClick:()=>p(e.name),children:(0,n.jsxs)(de,{direction:"row",gap:12,children:[(0,n.jsx)("img",{src:e.img}),(0,n.jsxs)(de,{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)(ne,{children:u.map((e,t)=>(0,n.jsxs)(oe,{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)(ce,{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)(ne,{children:u.map((e,t)=>(0,n.jsxs)(oe,{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)(he,{widgets:u,onClick:p}):(0,n.jsx)(n.Fragment,{}),"comment"===e&&"edit"===t?(0,n.jsx)(fe,{onClick:()=>{c(!0)}}):(0,n.jsx)(n.Fragment,{})]})},he=({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)(le,{open:i,height:r,children:[(0,n.jsx)(ae,{onClick:()=>l(!i),children:s.formatMessage({id:"WIDGET_Add_Widget"})}),(0,n.jsx)(se,{children:e.map((e,o)=>(0,n.jsxs)(re,{open:i,index:o,onClick:()=>t(e.name),children:[(0,n.jsx)("img",{src:e.img}),s.formatMessage({id:e.label})]},e.name))})]})})},fe=({onClick:e})=>{const t=(0,a.useIntl)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(me,{description:t.formatMessage({id:"COMMENT_Add_Widget"}),children:(0,n.jsx)(pe,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})})})},je=()=>{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 ye=i(802),be=i(704),Ce=i(892);const ve=u.j.getLazyComponent("InputFileAdvancedRaw"),we=s().div`
|
|
304
138
|
width: 0;
|
|
305
139
|
height: 0;
|
|
306
140
|
overflow: hidden;
|
|
307
|
-
`,
|
|
141
|
+
`,Le=({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)(we,{children:(0,n.jsx)(ve,{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]))}})})]})},Ee=u.j.getLazyComponent("WidgetAttachment"),ke=u.j.getLazyComponent("WidgetEmptyInplace"),_e=u.j.getLazyComponent("FileViewer"),We=s().div`
|
|
308
142
|
flex: 1;
|
|
309
|
-
`,
|
|
143
|
+
`,Se=({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),be.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)(We,{children:["view"!==i?(0,n.jsx)(Ee,{files:r,onClick:()=>{},onError:m}):(0,n.jsx)(_e,{files:r,openWithOptions:h,children:e=>(0,n.jsx)(Ee,{files:r.map(e=>({...e,uri:(0,E.resolveFilePath)(e)})),onClick:t=>e(t),onError:m})}),t&&"view"!==i&&(0,n.jsx)(Le,{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)(ke,{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,{})},qe=u.j.getLazyComponent("WidgetButton"),Me=s().div`
|
|
310
144
|
display: flex;
|
|
311
145
|
flex: 1;
|
|
312
146
|
justify-content: center;
|
|
313
147
|
align-items: center;
|
|
314
|
-
`,
|
|
148
|
+
`,Ae=s().div`
|
|
315
149
|
pointer-events: ${e=>e.clickable?"all":"none"};
|
|
316
150
|
cursor: pointer;
|
|
317
151
|
display: flex;
|
|
318
152
|
flex: 1;
|
|
319
153
|
justify-content: center;
|
|
320
154
|
align-items: center;
|
|
321
|
-
`,
|
|
155
|
+
`,Te=({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)(Me,{onClick:()=>{"edit"===t&&i(d.cr.slice.actions.registerEditor({uniqid:l,name:e.name}))},children:(0,n.jsx)(Ae,{clickable:"edit"!==t,children:(0,n.jsx)(qe,{text:s,url:a,target:r,color:u,backgroundColor:g,buttonSize:m,borderRadius:p,variant:x})})})},Ie=u.j.getLazyComponent("WidgetArticleGallery"),ze=u.j.getLazyComponent("WidgetEmptyInplace"),Ge=u.j.getLazyComponent("FileViewer"),De=s().button`
|
|
322
156
|
cursor: pointer;
|
|
323
|
-
`,
|
|
157
|
+
`,Ve=({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),be.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)(Ie,{files:s,maxWidth:800,gap:e.content.gap??"10",column:e.content.column??"3",onClick:()=>{}}):(0,n.jsx)(Ge,{files:s,openWithOptions:[],children:t=>(0,n.jsx)(De,{children:(0,n.jsx)(Ie,{files:s,maxWidth:600,gap:e.content.gap??"10",column:e.content.column??"3",onClick:e=>t(e)})})}),t&&"edit"===i?(0,n.jsx)(Le,{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)(ze,{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,{})},$e=s().div`
|
|
324
158
|
padding: ${e=>e.theme.space.md}px;
|
|
325
159
|
padding-right: 0px;
|
|
326
|
-
`,
|
|
160
|
+
`,Fe=s().div`
|
|
327
161
|
text-align: ${e=>e.textAlign};
|
|
328
162
|
font-size: ${e=>e.fontSize}px;
|
|
329
163
|
font-weight: ${e=>e.fontWeight};
|
|
330
164
|
color: ${e=>e.color};
|
|
331
|
-
`,
|
|
165
|
+
`,Re=({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),be.shallowEqual);return(0,n.jsx)(n.Fragment,{children:s&&"string"==typeof s.title&&0!==s.title.length&&(0,n.jsx)($e,{children:(0,n.jsx)(Fe,{textAlign:t,fontSize:i,fontWeight:o,color:l,children:s.title})})})},Oe=s().div`
|
|
332
166
|
background-color: ${e=>e.backroundColor};
|
|
333
|
-
`,
|
|
167
|
+
`,Be=s().div`
|
|
334
168
|
display: flex;
|
|
335
169
|
flex-direction: row;
|
|
336
170
|
align-items: center;
|
|
337
|
-
`,
|
|
171
|
+
`,He=(s().div`
|
|
338
172
|
padding: ${e=>e.theme.space.sm}px ${e=>e.theme.space.md}px;
|
|
339
173
|
color: ${e=>e.theme.color.grey4};
|
|
340
174
|
`,s().div`
|
|
@@ -343,28 +177,28 @@
|
|
|
343
177
|
flex-direction: row;
|
|
344
178
|
gap: ${e=>e.theme.space.xs}px;
|
|
345
179
|
align-items: center;
|
|
346
|
-
`),
|
|
180
|
+
`),Ue=({uniqid:e,dropdown:t,subHeader:i})=>{const s=(0,l.useTheme)(),a=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),be.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)(Oe,{backroundColor:r.backgroundColor,children:(0,n.jsxs)(Be,{children:[(0,n.jsxs)(He,{children:[(0,n.jsx)(Re,{uniqid:e,fontWeight:r.fontWeight,fontSize:r.fontSize,textAlign:r.textAlign,color:r.color}),i&&i(r.color)]}),t&&t()]})})},Ne=s().div`
|
|
347
181
|
flex-direction: column;
|
|
348
182
|
display: flex;
|
|
349
183
|
flex: 1;
|
|
350
|
-
`,
|
|
184
|
+
`,Pe=s().div`
|
|
351
185
|
position: relative;
|
|
352
186
|
display: flex;
|
|
353
187
|
flex: 1;
|
|
354
|
-
`,
|
|
188
|
+
`,Ye=s().div`
|
|
355
189
|
overflow: auto;
|
|
356
190
|
position: absolute;
|
|
357
191
|
inset: 0;
|
|
358
|
-
`,
|
|
192
|
+
`,Qe=({header:e,scrollable:t,footer:i})=>(0,n.jsxs)(Ne,{children:[e&&e(),(0,n.jsx)(Pe,{children:(0,n.jsx)(Ye,{children:t&&t()})}),i&&i()]}),Je=s().div`
|
|
359
193
|
display: flex;
|
|
360
194
|
flex-direction: column;
|
|
361
|
-
`,
|
|
195
|
+
`,Ke=({uniqid:e,children:t})=>{const i=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),be.shallowEqual),l=(0,o.useMemo)(()=>({padding:i&&i.padding?`${i.padding}px`:"0px"}),[i]);return(0,n.jsx)(Je,{style:{padding:l.padding},children:t})},Xe=s().div`
|
|
362
196
|
position: absolute;
|
|
363
197
|
inset: 0;
|
|
364
198
|
display: flex;
|
|
365
199
|
justify-content: center;
|
|
366
200
|
align-items: center;
|
|
367
|
-
`,
|
|
201
|
+
`,Ze=u.j.getLazyComponent("WidgetLuccaAbsence"),et=u.j.getLazyComponent("Loader"),tt=({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)(Xe,{children:(0,n.jsx)(et,{size:"m"})}):l?(0,n.jsx)(Xe,{children:(0,n.jsx)(a.FormattedMessage,{id:"WIDGET_Lucca_Absence_Url_Error"})}):(0,n.jsx)(Qe,{header:()=>(0,n.jsx)(Ue,{uniqid:e}),scrollable:()=>(0,n.jsx)(Ke,{uniqid:e,children:(0,n.jsx)(Ze,{list:t})})})},it=u.j.getLazyComponent("WidgetImage"),nt=u.j.getLazyComponent("FileViewer"),ot=u.j.getLazyComponent("WidgetEmptyInplace"),lt=s().div`
|
|
368
202
|
position: absolute;
|
|
369
203
|
inset: 0;
|
|
370
204
|
background-color: rgba(0, 0, 0, 0.4);
|
|
@@ -377,16 +211,16 @@
|
|
|
377
211
|
&:hover {
|
|
378
212
|
opacity: 1;
|
|
379
213
|
}
|
|
380
|
-
`,
|
|
214
|
+
`,st=s().button`
|
|
381
215
|
cursor: pointer;
|
|
382
|
-
`,
|
|
216
|
+
`,at={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},rt=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},dt=({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),be.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?rt(r.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:r.uri}))},[r]),(0,n.jsxs)(n.Fragment,{children:["edit"!==l&&(0,n.jsx)(nt,{files:[{...at,...r,path:p,mimetype:"image/png"}],openWithOptions:[],children:e=>(0,n.jsx)(st,{onClick:()=>e(r?.id??0),children:(0,n.jsx)(it,{maxWidth:t??600,uri:p,useFilter:u??!1})})}),"edit"===l&&(0,n.jsxs)(n.Fragment,{children:[void 0!==p&&(0,n.jsx)(it,{maxWidth:t??600,uri:p,useFilter:u??!1}),i&&(0,n.jsx)(Le,{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)(lt,{children:h.formatMessage({id:"ARTICLE_Widget_Image_Change"})}):(0,n.jsx)(ot,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})})]})]})},ct=u.j.getLazyComponent("FileViewer"),ut=u.j.getLazyComponent("WidgetEmptyInplace"),gt=u.j.getLazyComponent("WidgetSlider"),mt=s().div`
|
|
383
217
|
flex: 1;
|
|
384
218
|
display: flex;
|
|
385
219
|
flex-direction: row;
|
|
386
220
|
min-height: 60px;
|
|
387
221
|
align-items: center;
|
|
388
222
|
width: ${e=>e.maxWidth}px;
|
|
389
|
-
`,
|
|
223
|
+
`,pt={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},xt=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},ht=({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),be.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)=>({...pt,id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:pt.mimetype,path:e.file&&e.file.uri?(0,E.formatImgUrl)({size:"fitx1200",uri:e.file.uri,from:"imagecache",timestamp:e.file&&e.file.dateModified?xt(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?xt(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)(mt,{maxWidth:u&&u<r?u:r,children:[(0,n.jsx)(ct,{files:p,openWithOptions:[],children:i=>(0,n.jsx)(gt,{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)(ut,{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 ft=i(850);const jt=u.j.getLazyComponent("InputTextareaRaw"),yt=u.j.getLazyComponent("Modal"),bt=({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)(yt,{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(ft.xI.parse(s,{async:!1}).replace(/<br>/g,"<br><br>")),d()}}],children:(0,n.jsx)(jt,{value:s,onChange:e=>r(e.target.value),height:"400px"})})},Ct=u.j.getLazyComponent("WidgetArticleText"),vt=s().div`
|
|
390
224
|
width: 100%;
|
|
391
225
|
cursor: text;
|
|
392
226
|
|
|
@@ -397,20 +231,20 @@
|
|
|
397
231
|
a {
|
|
398
232
|
word-wrap: break-word;
|
|
399
233
|
}
|
|
400
|
-
`,
|
|
234
|
+
`,wt=({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),be.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}=je(),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,ye.X)(h,s,w),[h,w,s]);return m?(0,n.jsx)(n.Fragment,{}):(0,n.jsxs)(vt,{children:[(0,n.jsx)(Ct,{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)(bt,{onInsert:y,open:j,close:b})]})},Lt=u.j.getLazyComponent("WidgetArticleTitle"),Et=s().div`
|
|
401
235
|
flex: 1;
|
|
402
236
|
display: flex;
|
|
403
237
|
flex-direction: row;
|
|
404
238
|
align-items: center;
|
|
405
239
|
cursor: text;
|
|
406
|
-
`,
|
|
240
|
+
`,kt=s().div`
|
|
407
241
|
display: flex;
|
|
408
242
|
flex-direction: row;
|
|
409
243
|
border-radius: 8px;
|
|
410
244
|
overflow: hidden;
|
|
411
245
|
margin: 4px;
|
|
412
246
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
413
|
-
`,
|
|
247
|
+
`,_t=s().button`
|
|
414
248
|
display: flex;
|
|
415
249
|
width: 40px;
|
|
416
250
|
height: 40px;
|
|
@@ -422,18 +256,18 @@
|
|
|
422
256
|
&:hover {
|
|
423
257
|
background-color: ${e=>e.theme.color.grey1};
|
|
424
258
|
}
|
|
425
|
-
`,
|
|
259
|
+
`,Wt=({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),be.shallowEqual);return(0,o.useEffect)(()=>{g(d.x0.slice.actions.setWidgetState({uniqid:s,empty:!a||0===a.length}))},[a]),(0,n.jsxs)(Et,{children:[(0,n.jsx)(Lt,{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)(St,{heading:u,onClick:e=>{g((0,d.vR)(s,{heading:e}))}}):(0,n.jsx)(n.Fragment,{})]})},St=({heading:e="h1",onClick:t})=>(0,n.jsx)(kt,{children:["h1","h2","h3","h4"].map((i,o)=>(0,n.jsx)(_t,{isActive:e===i,onClick:()=>t(i),children:i},o))});var qt=i(554);const Mt=u.j.getLazyComponent("Button"),At=u.j.getLazyComponent("ModalLayout"),Tt=u.j.getLazyComponent("ModalContent"),It=u.j.getLazyComponent("IconButton"),zt=(s().button`
|
|
426
260
|
padding: ${e=>e.theme.space.md}px;
|
|
427
261
|
`,s().div`
|
|
428
262
|
padding: ${e=>e.theme.space.md}px;
|
|
429
263
|
display: flex;
|
|
430
264
|
flex-direction: row-reverse;
|
|
431
|
-
`),
|
|
265
|
+
`),Gt=({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)(It,{iconSize:14,onClick:()=>u(!0),icon:"icon-trash"}),r&&(0,n.jsxs)(At,{enableClickAwayCloseModal:!0,open:r,closeHandler:()=>u(!1),children:[(0,n.jsx)(Tt,{overflow:"scroll",title:s.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1),children:s.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})}),(0,n.jsx)(zt,{children:(0,n.jsx)(Mt,{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"})))}})})]})]})},Dt=s().div`
|
|
432
266
|
display: flex;
|
|
433
267
|
flex: 1;
|
|
434
268
|
flex-direction: row;
|
|
435
269
|
border-top: 1px solid ${e=>e.theme.color.grey1};
|
|
436
|
-
`,
|
|
270
|
+
`,Vt=s().button`
|
|
437
271
|
display: flex;
|
|
438
272
|
flex: 1;
|
|
439
273
|
justify-content: center;
|
|
@@ -442,21 +276,21 @@
|
|
|
442
276
|
&:hover {
|
|
443
277
|
background-color: ${e=>e.theme.color.grey0};
|
|
444
278
|
}
|
|
445
|
-
|
|
279
|
+
`,$t=({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),be.shallowEqual),m=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,t),be.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)(Dt,{children:[(0,n.jsx)(Vt,{onClick:s??h,children:r.formatMessage({id:"WIDGET_Set_Widget"})}),x&&(0,n.jsx)(Gt,{id:g.id,type:g.type,uniqid:t})]}):(0,n.jsx)(n.Fragment,{})},Ft=u.j.getLazyComponent("Button"),Rt=u.j.getLazyComponent("InputText"),Ot=s().div`
|
|
446
280
|
padding: ${e=>e.theme.space.md}px;
|
|
447
281
|
display: flex;
|
|
448
282
|
flex-direction: row;
|
|
449
283
|
fieldset {
|
|
450
284
|
margin: 0.2rem !important;
|
|
451
285
|
}
|
|
452
|
-
`,
|
|
286
|
+
`,Bt=({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)(Ot,{children:[(0,n.jsx)(Rt,{name:"label",control:d,placeholder:e,width:"100%"}),(0,n.jsx)(Ft,{label:i.formatMessage({id:"GLOBAL_Confirm"}),disabled:!s.length,onClick:()=>{t(s),r(""),g()}})]})},Ht=u.j.getLazyComponent("Loader"),Ut=s().div`
|
|
453
287
|
position: absolute;
|
|
454
288
|
inset: 0;
|
|
455
289
|
display: flex;
|
|
456
290
|
justify-content: center;
|
|
457
291
|
align-items: center;
|
|
458
292
|
background-color: rgba(255, 255, 255, 0.4);
|
|
459
|
-
`,
|
|
293
|
+
`,Nt=()=>(0,n.jsx)(Ut,{children:(0,n.jsx)(Ht,{size:"m"})}),Pt=u.j.getLazyComponent("WidgetCheckList"),Yt=u.j.getLazyComponent("WidgetCheckListEditor"),Qt=u.j.getLazyComponent("FileViewer"),Jt=(s().div`
|
|
460
294
|
display: flex;
|
|
461
295
|
flex-direction: row;
|
|
462
296
|
justify-content: space-between;
|
|
@@ -470,9 +304,9 @@
|
|
|
470
304
|
display: flex;
|
|
471
305
|
gap: 14px;
|
|
472
306
|
padding: 16px;
|
|
473
|
-
`),
|
|
307
|
+
`),Kt=s().div`
|
|
474
308
|
position: relative;
|
|
475
|
-
`,
|
|
309
|
+
`,Xt=({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,be.shallowEqual),w=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e.uniqid),be.shallowEqual),L=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,u),be.shallowEqual),_=(0,c.GV)(t=>d.x0.selectors.selectAllWidgetRTObject(t,e.uniqid),be.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)(Jt,{children:(0,n.jsx)(Yt,{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)(qt.M,{useRT:()=>{(0,Ce.AW)(e.uniqid)},children:j&&(0,n.jsx)(Qt,{files:G,openWithOptions:[],children:t=>(0,n.jsxs)(Kt,{children:[(0,n.jsx)(Pt,{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)(Bt,{handleClick:z,placeholder:s.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),S&&p&&(0,n.jsx)($t,{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)(Nt,{})]},e.uniqid)})})},Zt=(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},ei=u.j.getLazyComponent("Button"),ti=u.j.getLazyComponent("WidgetTable"),ii=u.j.getLazyComponent("Loader"),ni=(s().div``,s().div`
|
|
476
310
|
position: absolute;
|
|
477
311
|
inset: 0;
|
|
478
312
|
display: flex;
|
|
@@ -480,7 +314,7 @@
|
|
|
480
314
|
justify-content: center;
|
|
481
315
|
align-items: center;
|
|
482
316
|
gap: ${e=>e.theme.space.md}px;
|
|
483
|
-
`),
|
|
317
|
+
`),oi=({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,Ce.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)(()=>Zt(g,v),[g,v]);return 0!==g.length||j||"edit"!==h?j?(0,n.jsx)(ni,{children:(0,n.jsx)(ii,{})}):(0,n.jsx)(n.Fragment,{children:j||0!==b.length||"edit"===h?(0,n.jsx)(ti,{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)(ni,{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)(ni,{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)(ei,{label:"GLOBAL_Settings"})]})})},li=u.j.getLazyComponent("Button"),si=u.j.getLazyComponent("WidgetTable"),ai=u.j.getLazyComponent("Loader"),ri=(s().div``,s().div`
|
|
484
318
|
position: absolute;
|
|
485
319
|
inset: 0;
|
|
486
320
|
display: flex;
|
|
@@ -488,21 +322,21 @@
|
|
|
488
322
|
justify-content: center;
|
|
489
323
|
align-items: center;
|
|
490
324
|
gap: ${e=>e.theme.space.md}px;
|
|
491
|
-
`),
|
|
325
|
+
`),di=({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)(()=>Zt(g,v),[g,v]);return 0!==g.length||j||"edit"!==h?j?(0,n.jsx)(ri,{children:(0,n.jsx)(ai,{})}):(0,n.jsx)(n.Fragment,{children:j||0!==b.length||"edit"===h?(0,n.jsx)(si,{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)(ri,{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)(ri,{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)(li,{label:"GLOBAL_Settings"})]})})},ci=s().div`
|
|
492
326
|
padding: ${e=>e.theme.space.md}px;
|
|
493
|
-
`,
|
|
327
|
+
`,ui=s().a`
|
|
494
328
|
cursor: pointer;
|
|
495
329
|
color: ${e=>e.theme.color.secondary};
|
|
496
|
-
`,
|
|
330
|
+
`,gi=s().div`
|
|
497
331
|
display: flex;
|
|
498
332
|
justify-content: center;
|
|
499
333
|
align-items: center;
|
|
500
|
-
`,
|
|
334
|
+
`,mi=({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),be.shallowEqual),u=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,t),be.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)(ci,{children:(0,n.jsx)(gi,{children:(0,n.jsx)(ui,{onClick:m,children:l.formatMessage({id:"WIDGET_Presence_Closing"})})})})})},pi=u.j.getLazyComponent("WidgetPresence"),xi=u.j.getLazyComponent("ModalUserList"),hi=s().div`
|
|
501
335
|
display: flex;
|
|
502
336
|
flex: 1;
|
|
503
337
|
position: relative;
|
|
504
338
|
flex-direction: column;
|
|
505
|
-
`,
|
|
339
|
+
`,fi=(s().div`
|
|
506
340
|
position: absolute;
|
|
507
341
|
inset: 0;
|
|
508
342
|
background-color: rgba(255, 255, 255, 0.7);
|
|
@@ -519,24 +353,24 @@
|
|
|
519
353
|
align-items: center;
|
|
520
354
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
521
355
|
margin: ${e=>e.theme.space.sm}px;
|
|
522
|
-
`),
|
|
356
|
+
`),ji=({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),be.shallowEqual),W=(0,c.GV)(e=>d.x0.selectors.selectAllWidgetRTObject(e,m),be.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)(qt.M,{useRT:()=>{(0,Ce.AW)(e.uniqid)},children:(0,n.jsxs)(hi,{children:[(0,n.jsx)(pi,{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)(fi,{children:i.formatMessage({id:"WIDGET_Presence_Is_Closed"})}),u&&!g&&(0,n.jsx)(mi,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&(0,n.jsx)($t,{uniqid:e.uniqid,name:e.name,mode:t}),h&&(0,n.jsx)(Nt,{}),(0,n.jsx)(xi,{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)}})]})})},yi=u.j.getLazyComponent("WidgetQuickSurvey"),bi=u.j.getLazyComponent("WidgetQuickSurveyEditor"),Ci=u.j.getLazyComponent("ModalUserList"),vi=u.j.getLazyComponent("FileViewer"),wi=s().div`
|
|
523
357
|
width: 100%;
|
|
524
358
|
display: flex;
|
|
525
359
|
flex-direction: column;
|
|
526
360
|
gap: 14px;
|
|
527
361
|
${e=>e.withPadding&&"padding: 0 12px;"}
|
|
528
362
|
padding-top: 16px;
|
|
529
|
-
`,
|
|
363
|
+
`,Li=({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,be.shallowEqual),_=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e.uniqid),be.shallowEqual),W=(0,c.GV)(e=>d.x0.selectors.selectWidgetObjectRights(e,r),be.shallowEqual),S=(0,c.GV)(t=>d.x0.selectors.selectAllWidgetRTObject(t,e.uniqid),be.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)(wi,{withPadding:!0,children:(0,n.jsx)(bi,{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)(qt.M,{useRT:()=>{(0,Ce.AW)(e.uniqid)},children:(0,n.jsxs)(wi,{children:[(0,n.jsx)(vi,{files:$,openWithOptions:[],children:t=>(0,n.jsx)(yi,{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)(Bt,{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)($t,{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)(Nt,{}),(0,n.jsx)(Ci,{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})}})]})})},Ei=u.j.getLazyComponent("ModalLayout"),ki=u.j.getLazyComponent("ModalContent"),_i=u.j.getLazyComponent("Button"),Wi=u.j.getLazyComponent("InputText"),Si=u.j.getLazyComponent("InputNumber"),qi=u.j.getLazyComponent("InputSelectExtended"),Mi=u.j.getLazyComponent("InputPassword"),Ai=u.j.getLazyComponent("Typography"),Ti=u.j.getLazyComponent("Loader"),Ii=s().div`
|
|
530
364
|
display: flex;
|
|
531
365
|
flex-direction: column;
|
|
532
366
|
opacity: ${e=>e.isLocked?".4":"1.0"};
|
|
533
|
-
`,
|
|
367
|
+
`,zi=s().div`
|
|
534
368
|
position: absolute;
|
|
535
369
|
inset: 0;
|
|
536
370
|
display: flex;
|
|
537
371
|
justify-content: center;
|
|
538
372
|
align-items: center;
|
|
539
|
-
`,
|
|
373
|
+
`,Gi=s().div`
|
|
540
374
|
background-color: ${e=>e.theme.color.orange};
|
|
541
375
|
color: ${e=>e.theme.color.white};
|
|
542
376
|
padding: ${e=>e.theme.space.sm}px;
|
|
@@ -544,67 +378,67 @@
|
|
|
544
378
|
display: flex;
|
|
545
379
|
justify-content: center;
|
|
546
380
|
align-items: center;
|
|
547
|
-
`,
|
|
381
|
+
`,Di=s().div`
|
|
548
382
|
margin-bottom: ${e=>e.theme.space.md}px;
|
|
549
|
-
`,
|
|
383
|
+
`,Vi={username:"",password:"",hostname:"",imapPort:993,imapConnectionSecurity:E.ImapConnection.NONE,imapMailbox:"",cardDavAddressBook:"",calDavCalendar:"",provider:""},$i=()=>{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:Vi,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)(zi,{children:(0,n.jsx)(_i,{label:e.formatMessage({id:"Office_Set_Configuration"}),onClick:()=>s(!0)})}),(0,n.jsx)(Ei,{open:l,radius:"small",closeHandler:L,children:(0,n.jsx)(ki,{overflow:"scroll",title:e.formatMessage({id:"Office_Set_Configuration"}),onClickIconClose:L,children:u?(0,n.jsx)(Ti,{size:"s"}):(0,n.jsxs)(n.Fragment,{children:[0===y.length&&(0,n.jsx)(Gi,{children:e.formatMessage({id:"Office_No_Providers"})}),(0,n.jsxs)(Ii,{isLocked:0===y.length,children:[_&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(Di,{children:[(0,n.jsx)(Ai,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_Provider"})}),(0,n.jsx)(Fi,{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)(Di,{children:[(0,n.jsx)(Ai,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Settings"})}),(0,n.jsx)(Wi,{control:m,name:"hostname",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Hostname"}),rules:{required:!0}}),(0,n.jsx)(Wi,{control:m,name:"username",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Username"}),rules:{required:!0}}),(0,n.jsx)(Mi,{control:m,name:"password",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_Password"}),rules:{required:!0}})]}),(0,n.jsxs)(Di,{children:[(0,n.jsx)(Ai,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_IMap_Mailbox"})}),(0,n.jsx)(Si,{control:m,name:"imapPort",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Port"}),rules:{required:!0}}),(0,n.jsx)(Fi,{label:"OfficeHook_Conf_Select_Connection_Security",initialValue:v[0],options:v,handleChange:e=>x("imapConnectionSecurity",e)}),(0,n.jsx)(Wi,{control:m,name:"imapMailbox",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_IMap_Mailbox"}),rules:{required:!0}})]}),(0,n.jsxs)(Di,{children:[(0,n.jsx)(Ai,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_CalDav_Calendar"})}),(0,n.jsx)(Wi,{control:m,name:"calDavCalendar",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CalDav_Calendar"}),rules:{required:!0}})]}),(0,n.jsxs)(Di,{children:[(0,n.jsx)(Ai,{size:"l",children:(0,n.jsx)(a.FormattedMessage,{id:"OfficeHook_Conf_CardDav_Address_Book"})}),(0,n.jsx)(Wi,{control:m,name:"cardDavAddressBook",width:"400",placeholder:e.formatMessage({id:"OfficeHook_Conf_CardDav_Address_Book"}),rules:{required:!0}})]})]}),(0,n.jsx)(_i,{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()}))}})]})})})]})},Fi=({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)(qi,{label:e,name:"provider",options:i??[],getValue:e=>e.value,getLabel:"label",getSearch:"label",control:s,rules:{required:!0}})},Ri=u.j.getLazyComponent("ButtonDropdown"),Oi=u.j.getLazyComponent("Tooltip"),Bi=s().div`
|
|
550
384
|
margin-right: ${e=>e.theme.space.sm}px;
|
|
551
385
|
button {
|
|
552
386
|
background: ${e=>e.theme.color.white};
|
|
553
387
|
}
|
|
554
|
-
`,
|
|
388
|
+
`,Hi=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const o=(0,a.useIntl)(),l=(0,be.useDispatch)(),s=[{label:o.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{l(d.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(Vi).finally(i)}}];return(0,n.jsx)(Ue,{uniqid:e,dropdown:()=>t&&(0,n.jsx)(Bi,{children:(0,n.jsx)(Oi,{position:"left",description:o.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,n.jsx)(Ri,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})})})},Ui=u.j.getLazyComponent("WidgetContactCardDav"),Ni=({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),be.shallowEqual),[h,f]=(0,o.useState)([]),j=(0,o.useCallback)((e,t)=>{e&&400===e.error&&k().office.setConfiguration(Vi),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)(Qe,{header:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Hi,{uniqid:l,isConfigurationValid:void 0!==a&&!0===a,handleLogout:()=>j(void 0,!0)})}),scrollable:()=>(0,n.jsxs)(Ke,{uniqid:l,children:[a&&(0,n.jsx)(Ui,{contactCardList:h}),void 0===a&&(0,n.jsx)(n.Fragment,{}),void 0!==a&&!1===a&&"view"===t&&(0,n.jsx)($i,{})]})})},Pi=u.j.getLazyComponent("ButtonDropdown"),Yi=u.j.getLazyComponent("Tooltip"),Qi=s().div`
|
|
555
389
|
margin-right: ${e=>e.theme.space.sm}px;
|
|
556
390
|
button {
|
|
557
391
|
background: ${e=>e.theme.color.white};
|
|
558
392
|
}
|
|
559
|
-
`,
|
|
393
|
+
`,Ji=({uniqid:e,isConfigurationValid:t=!1,handleLogout:i})=>{const o=(0,a.useIntl)(),l=(0,be.useDispatch)(),s=[{label:o.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{l(d.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(Vi).finally(i)}}];return(0,n.jsx)(Ue,{uniqid:e,dropdown:()=>t&&(0,n.jsx)(Qi,{children:(0,n.jsx)(Yi,{position:"left",description:o.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,n.jsx)(Pi,{small:!0,smallOpenDirection:"left",options:s,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})})})},Ki=u.j.getLazyComponent("WidgetCalendarCalDav"),Xi=({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),be.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(Vi),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)(Qe,{header:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(Ji,{uniqid:l,isConfigurationValid:void 0!==a&&!0===a,handleLogout:()=>y(void 0,!0)})}),scrollable:()=>(0,n.jsxs)(Ke,{uniqid:l,children:[a&&(0,n.jsx)(Ki,{calendarListEvent:f}),void 0===a&&(0,n.jsx)(n.Fragment,{}),void 0!==a&&!1===a&&"view"===t&&(0,n.jsx)($i,{})]})})},Zi=u.j.getLazyComponent("ButtonDropdown"),en=u.j.getLazyComponent("Tooltip"),tn=s().div`
|
|
560
394
|
margin-right: ${e=>e.theme.space.sm}px;
|
|
561
395
|
button {
|
|
562
396
|
background: ${e=>e.theme.color.white};
|
|
563
397
|
}
|
|
564
|
-
`,
|
|
398
|
+
`,nn=s().div`
|
|
565
399
|
font-size: ${e=>e.theme.size.sm+4}px;
|
|
566
400
|
color: ${e=>e.color};
|
|
567
|
-
`,
|
|
401
|
+
`,on=({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),be.shallowEqual),r=[{label:o.formatMessage({id:"WIDGET_Prompt_Logout"}),onClick:()=>{l(d.x0.slice.actions.setWidgetState({uniqid:e,loading:!0})),k().office.setConfiguration(Vi).finally(i)}}];return(0,n.jsx)(Ue,{uniqid:e,dropdown:()=>t&&(0,n.jsx)(tn,{children:(0,n.jsx)(en,{position:"left",description:o.formatMessage({id:"WIDGET_Prompt_Dropdown"}),children:(0,n.jsx)(Zi,{small:!0,smallOpenDirection:"left",options:r,icon:"icon-cogwheel",label:"",color:"primary",variant:"outlined"})})}),subHeader:e=>t&&0!==s&&(0,n.jsxs)(nn,{color:e,children:["(",o.formatMessage({id:"WIDGET_Email_IMAP_Unread_Emails"},{count:s}),")"]})})},ln=u.j.getLazyComponent("WidgetEmailsImap"),sn=({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),be.shallowEqual),j=(0,o.useCallback)((e,t)=>{e&&400===e.error&&k().office.setConfiguration(Vi),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)(Qe,{header:()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(on,{uniqid:l,isConfigurationValid:void 0!==a&&!0===a,handleLogout:()=>j(void 0,!0)})}),scrollable:()=>(0,n.jsxs)(Ke,{uniqid:l,children:[void 0===a&&(0,n.jsx)(n.Fragment,{}),void 0!==a&&!1===a&&"view"===t&&(0,n.jsx)($i,{}),a&&(0,n.jsx)(ln,{emailList:m})]})})},an=u.j.getLazyComponent("Html"),rn=s().div`
|
|
568
402
|
padding: ${e=>e.theme.space.md}px;
|
|
569
403
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
570
|
-
`,
|
|
404
|
+
`,dn=({uniqid:e})=>{const t=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),be.shallowEqual),i=(0,l.useTheme)(),s=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),be.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)(rn,{style:{color:a.color,backgroundColor:a.backgroundColor,fontSize:a.fontSize,fontWeight:a.fontWeight,textAlign:a.textAlign},children:(0,n.jsx)(an,{as:"span",__html:r})}):(0,n.jsx)(n.Fragment,{})},cn=u.j.getLazyComponent("InputText"),un=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),l=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e)?.title,be.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)(cn,{name:"widgetTitle",control:s,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},gn=u.j.getLazyComponent("Button"),mn=u.j.getLazyComponent("ModalLayout"),pn=u.j.getLazyComponent("ModalContent"),xn=u.j.getLazyComponent("IconButton"),hn=s().div`
|
|
571
405
|
padding: ${e=>e.theme.space.md}px;
|
|
572
406
|
display: flex;
|
|
573
407
|
flex-direction: row-reverse;
|
|
574
|
-
`,
|
|
408
|
+
`,fn=s().div`
|
|
575
409
|
flex: 1;
|
|
576
410
|
display: flex;
|
|
577
411
|
flex-direction: row;
|
|
578
412
|
gap: ${e=>e.theme.space.sm}px;
|
|
579
413
|
padding: ${e=>e.theme.space.sm}px;
|
|
580
414
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
581
|
-
`,
|
|
415
|
+
`,jn=s().div`
|
|
582
416
|
flex: 1;
|
|
583
417
|
display: flex;
|
|
584
418
|
fieldset:first-of-type {
|
|
585
419
|
margin: 0px !important;
|
|
586
420
|
}
|
|
587
|
-
`,
|
|
421
|
+
`,yn=s().div`
|
|
588
422
|
display: flex;
|
|
589
423
|
gap: ${e=>e.theme.space.sm}px;
|
|
590
|
-
`,
|
|
424
|
+
`,bn=({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)(fn,{children:[(0,n.jsx)(jn,{children:(0,n.jsx)(un,{uniqid:e})}),(0,n.jsxs)(yn,{children:[(0,n.jsx)(xn,{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)(xn,{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)(mn,{enableClickAwayCloseModal:!0,open:r,closeHandler:()=>u(!1),children:[(0,n.jsx)(pn,{overflow:"scroll",title:s.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1),children:s.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})}),(0,n.jsx)(hn,{children:(0,n.jsx)(gn,{label:s.formatMessage({id:"GLOBAL_Confirm"}),onClick:m})})]})]})},Cn=s().div`
|
|
591
425
|
position: absolute;
|
|
592
426
|
inset: 0;
|
|
593
427
|
display: flex;
|
|
594
428
|
align-items: center;
|
|
595
429
|
justify-content: center;
|
|
596
430
|
color: ${e=>e.theme.color.orange};
|
|
597
|
-
`,
|
|
431
|
+
`,vn=({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)(Cn,{children:o.formatMessage({id:"WIDGET_Missing_License"},{label:"label"in i?i.label:""})}):(0,n.jsx)(n.Fragment,{children:e})},wn=s().div`
|
|
598
432
|
display: flex;
|
|
599
433
|
flex: 1;
|
|
600
434
|
flex-direction: column;
|
|
601
|
-
`,
|
|
435
|
+
`,Ln=({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)(Te,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetArticleGalleryType)(e)?(0,n.jsx)(Ve,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetLuccaAbsenceType)(e)?(0,n.jsx)(wn,{children:(0,n.jsx)(vn,{name:"LuccaAbsenceHook",children:(0,n.jsx)(tt,{uniqid:e.uniqid})})}):(0,E.ensureWidgetArticleAttachmentType)(e)?(0,n.jsx)(Se,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetArticleImageType)(e)?(0,n.jsx)(dt,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetArticleSliderType)(e)?(0,n.jsx)(ht,{widget:e,inplace:i,mode:o,width:t??800}):(0,E.ensureWidgetArticleTitleType)(e)?(0,n.jsx)(Wt,{widget:e,inplace:i,mode:o,dataCy:r}):(0,E.ensureWidgetArticleTextType)(e)?(0,n.jsx)(wt,{widget:e,inplace:i,mode:o}):(0,E.ensureWidgetExcelDatasourceTableType)(e)?(0,n.jsxs)(wn,{children:[(0,n.jsx)(dn,{uniqid:e.uniqid}),(0,n.jsx)(di,{...e.content,uniqid:e.uniqid,mode:o})]}):(0,E.ensureWidgetDatasourceTableType)(e)?(0,n.jsxs)(wn,{children:[(0,n.jsx)(dn,{uniqid:e.uniqid}),(0,n.jsx)(oi,{...e.content,uniqid:e.uniqid,mode:o})]}):(0,E.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?(0,n.jsxs)(wn,{children:["edit"===o?(0,n.jsx)(bn,{name:e.name,uniqid:e.uniqid}):(0,n.jsx)(dn,{uniqid:e.uniqid}),(0,n.jsx)(Xt,{widget:e,inplace:i,mode:o,onWidgetUpdate:l})]}):(0,E.ensureWidgetPresenceType)(e)?(0,n.jsxs)(wn,{children:["edit"===o?(0,n.jsx)(bn,{name:e.name,uniqid:e.uniqid}):(0,n.jsx)(dn,{uniqid:e.uniqid}),(0,n.jsx)(ji,{widget:e,inplace:i,mode:o})]}):(0,E.ensureWidgetQuickSurveyType)(e)?(0,n.jsxs)(wn,{children:["edit"===o?(0,n.jsx)(bn,{name:e.name,uniqid:e.uniqid}):(0,n.jsx)(dn,{uniqid:e.uniqid}),(0,n.jsx)(Li,{widget:e,inplace:i,mode:o})]}):(0,E.ensureWidgetCalendarCalDavType)(e)?(0,n.jsx)(wn,{children:(0,n.jsx)(vn,{name:"OfficeHook",children:(0,n.jsx)(Xi,{widget:e,inplace:i,mode:o,levelFallback:a})})}):(0,E.ensureWidgetContactCardDavType)(e)?(0,n.jsx)(wn,{children:(0,n.jsx)(vn,{name:"OfficeHook",children:(0,n.jsx)(Ni,{widget:e,inplace:i,mode:o,levelFallback:a})})}):(0,E.ensureWidgetEmailsImapType)(e)?(0,n.jsx)(wn,{children:(0,n.jsx)(vn,{name:"OfficeHook",children:(0,n.jsx)(sn,{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,")"]})},En=s().div`
|
|
602
436
|
position: absolute;
|
|
603
437
|
inset: 0;
|
|
604
438
|
opacity: ${e=>e.opacity};
|
|
605
439
|
background-color: ${e=>e.backgroundColor};
|
|
606
440
|
pointer-events: ${e=>e.pointerEvents};
|
|
607
|
-
`,
|
|
441
|
+
`,kn=u.j.getLazyComponent("DoubleClick"),_n=({uniqid:e,mode:t})=>{const i=(0,c.GV)(t=>t.widgets.ids[e].widget.layers,be.shallowEqual);return(0,n.jsx)(n.Fragment,{children:i?.map((e,t)=>(0,n.jsx)(Wn,{uniqid:e,mode:"edit"},t))})},Wn=({uniqid:e,mode:t})=>{const i=(0,c.GV)(t=>t.widgets.layers[e]);return"view"===t?(0,n.jsx)(En,{opacity:1,backgroundColor:"transparent",pointerEvents:"none",children:i.widgets.map((e,t)=>(0,n.jsx)(Sn,{layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"},t))}):(0,n.jsx)(En,{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)(Sn,{layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"},t))})},Sn=({uniqid:e,layerId:t,mode:i})=>{const o=(0,c.jL)(),l=(0,c.GV)(t=>t.widgets.ids[e],be.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)(On,{uniqid:e,widget:l,mode:i,inplace:!0,context:"article"})}):(0,n.jsx)(qn,{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)(kn,{onDoubleTap:()=>((e,t)=>{o(d.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(l.widget.uniqid,l.widget.name),children:(0,n.jsx)(On,{uniqid:e,widget:l,mode:i,inplace:!0,context:"article"})})}):(0,n.jsx)(n.Fragment,{})},qn=({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})},Mn=u.j.getLazyComponent("Loader"),An=({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)(Mn,{})}):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,{})},Tn=u.j.getLazyComponent("Html"),In=s().button`
|
|
608
442
|
position: absolute;
|
|
609
443
|
inset: 0;
|
|
610
444
|
display: flex;
|
|
@@ -622,10 +456,10 @@
|
|
|
622
456
|
}
|
|
623
457
|
|
|
624
458
|
${(0,r.DashedFocusBorder)()}
|
|
625
|
-
`,
|
|
459
|
+
`,zn=({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)(In,{onClick:s,children:(0,n.jsx)(Tn,{__html:`${l.formatMessage({id:"WIDGET_Set_Widget"})} <b>${l.formatMessage({id:r.label})}</b>`})})},Gn=s().div`
|
|
626
460
|
display: flex;
|
|
627
461
|
flex-direction: column;
|
|
628
|
-
`,
|
|
462
|
+
`,Dn=({uniqid:e,onClick:t,children:i})=>{const s=(0,l.useTheme)(),a=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),be.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)(Gn,{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})},Vn=u.j.getLazyComponent("WidgetIcon"),$n=s().a`
|
|
629
463
|
position: absolute;
|
|
630
464
|
top: 0;
|
|
631
465
|
right: 0;
|
|
@@ -641,21 +475,21 @@
|
|
|
641
475
|
background-color: rgba(0, 0, 0, 0.1);
|
|
642
476
|
color: ${e=>e.color?e.color:e.theme.color.black};
|
|
643
477
|
}
|
|
644
|
-
`,
|
|
478
|
+
`,Fn=({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,be.shallowEqual),a=(0,c.GV)(t=>d.x0.selectors.selectWidgetWrapperStyle(t,e),be.shallowEqual);return(0,n.jsx)($n,{href:i,target:"_blank",color:String(a.color)??void 0,rel:"noreferrer","aria-label":l.label,children:(0,n.jsx)(Vn,{count:s,img:l.img,label:l.label,maxValue:999})})},Rn=({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],be.shallowEqual),f=(0,c.GV)(e=>e.widgets.currentEditableWidgetId,be.shallowEqual),j=(0,c.GV)(t=>t.widgets.currentEditableWidgetId===e,be.shallowEqual),{isComponentVisible:y,setIsComponentVisible:b}=(0,Ce.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)(Dn,{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)(Ln,{dataCy:m,width:a,widget:{...x.widget,...x.title&&{title:x.title}},inplace:l,mode:s,levelFallback:(e,t)=>e<=2&&(0,n.jsx)(Fn,{uniqid:i.widget.uniqid,name:i.widget.name,level:e,url:t})}),(0,n.jsx)(_n,{uniqid:e,mode:s}),(0,n.jsx)(An,{name:x.widget.name,uniqid:x.widget.uniqid,inplace:l})]}):(0,n.jsxs)(Dn,{uniqid:e,onClick:C,children:[(0,n.jsx)(Ln,{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)(Fn,{uniqid:i.widget.uniqid,name:i.widget.name,level:e,url:t})}),(0,n.jsx)(_n,{uniqid:e,mode:s}),"edit"===s&&(0,n.jsx)(zn,{uniqid:e,name:i.widget.name}),(0,n.jsx)(An,{name:x.widget.name,uniqid:x.widget.uniqid,inplace:l})]})},On=Rn,Bn=s().div`
|
|
645
479
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
646
480
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
647
481
|
background-color: ${e=>e.theme.color.white};
|
|
648
482
|
overflow: hidden;
|
|
649
|
-
`,
|
|
483
|
+
`,Hn=u.j.getLazyComponent("Message"),Un=({widgets:e})=>{const t=(0,a.useIntl)(),i=(0,c.GV)(d.x0.selectors.selectFlushedWidgets,be.shallowEqual);return(0,n.jsx)(n.Fragment,{children:e.filter(e=>!i.includes(e.widget.uniqid)).map(e=>e&&e.widget&&(0,n.jsx)(Bn,{children:(0,n.jsx)(On,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>(0,n.jsx)(Hn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})},e.widget.uniqid))})},Nn=u.j.getLazyComponent("Message"),Pn=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,be.shallowEqual);return(0,n.jsx)(n.Fragment,{children:i.filter(e=>!u.includes(e.widget.uniqid)).map(e=>e&&(0,n.jsx)(Bn,{children:(0,n.jsx)(On,{uniqid:e.widget.uniqid,widgetObject:o,widget:e,inplace:l,mode:s,onWidgetUpdate:r,cannotDisplayComponent:e=>(0,n.jsx)(Nn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})}),context:"comment"})},e.widget.uniqid))})},Yn=u.j.getLazyComponent("JRCCommentsBloc"),Qn=s().div`
|
|
650
484
|
display: flex;
|
|
651
485
|
flex-direction: column;
|
|
652
486
|
gap: 4px;
|
|
653
487
|
flex: 1;
|
|
654
488
|
width: 100%;
|
|
655
489
|
margin-top: 10px;
|
|
656
|
-
`,
|
|
490
|
+
`,Jn=({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}=je();(0,te.A)(e),((e,t)=>{const i=(0,c.jL)(),n=(0,o.useMemo)(()=>ie.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]),N=(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.jsx)(Qn,{children:(0,n.jsx)(Yn,{canComment:i,loading:f,token:x,comments:q,onComment:N,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)(xe,{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)(Un,{widgets:y}),existingWidgetsWrapperComponent:(e,t,i,o=!0)=>(0,n.jsx)(Pn,{comment:e,widgets:t,mode:i,inplace:o,handleWidgetUpdate:H,handleWidgetRemove:U}),currentUser:w,tinyMCEConfig:{commonOptions:{...E,toolbar:_.commentsToolbar},mentionsQueries:(0,ye.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})})})}),O&&(0,n.jsx)(bt,{onInsert:$,open:V,close:F}),G&&(0,n.jsx)(Z,{onClose:()=>D(null),...G})]})},Kn=s().li`
|
|
657
491
|
list-style: none;
|
|
658
|
-
`,
|
|
492
|
+
`,Xn=s().a`
|
|
659
493
|
display: flex;
|
|
660
494
|
align-items: center;
|
|
661
495
|
gap: ${({theme:e})=>e.space.sm}px;
|
|
@@ -670,16 +504,182 @@
|
|
|
670
504
|
background-color: ${({theme:e})=>e.color.grey1};
|
|
671
505
|
color: ${({theme:e})=>e.font.color};
|
|
672
506
|
}
|
|
673
|
-
`,
|
|
507
|
+
`,Zn=u.j.getLazyComponent("Icon"),eo=u.j.getLazyComponent("FlexBox"),to=u.j.getLazyComponent("Typography"),io=u.j.getLazyComponent("DropDown"),no=()=>{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)(eo,{y:"center",children:[(0,n.jsx)(Zn,{name:"icon-"+o.icon,variant:"circle",color:o.color,size:40}),(0,n.jsx)(to,{variant:"h1",size:"xl",weight:"medium",children:o.label}),(s||i)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(to,{size:"xl",color:"grey4",children:"/"}),(0,n.jsx)(io,{withBorder:!0,borderColor:"grey3",trigger:(0,n.jsxs)(eo,{y:"center",gap:e.space.xs,children:[(0,n.jsx)(to,{size:"xl",color:"grey4",children:t.formatMessage({id:"CALENDAR_Agenda"})}),(0,n.jsx)(Zn,{name:"icon-chevron-down",color:"grey4",size:16})]}),dropdown:()=>(0,n.jsxs)(eo,{direction:"column",gap:e.space.sm,as:"ul",children:[s&&(0,n.jsx)(Kn,{children:(0,n.jsxs)(Xn,{href:s.url,children:[(0,n.jsx)(Zn,{name:"icon-"+s.icon,size:25,variant:"circle",color:s.color}),(0,n.jsx)(to,{size:"l",children:s.label})]})}),i&&(0,n.jsx)(Kn,{children:(0,n.jsxs)(Xn,{href:i.url,children:[(0,n.jsx)(Zn,{name:"icon-"+i.icon,size:25,variant:"circle",color:i.color}),(0,n.jsx)(to,{size:"l",children:i.label})]})})]})})]})]}):null},oo=u.j.getLazyComponent("Typography"),lo=u.j.getLazyComponent("FlexBox"),so=u.j.getLazyComponent("ButtonDropdown"),ao=u.j.getLazyComponent("DropDown"),ro=u.j.getLazyComponent("IconButton"),co=u.j.getLazyComponent("InputSelectRaw"),uo=u.j.getLazyComponent("InputCheckboxRaw"),go=u.j.getLazyComponent("StyledHref"),mo=s()(oo)`
|
|
508
|
+
text-transform: capitalize;
|
|
509
|
+
margin-right: ${({theme:e})=>e.space.md}px;
|
|
510
|
+
`,po=s().div`
|
|
511
|
+
max-width: 200px;
|
|
512
|
+
display: flex;
|
|
513
|
+
align-items: center;
|
|
514
|
+
`,xo=s().div`
|
|
515
|
+
padding: 0 ${({theme:e})=>e.space.md}px;
|
|
516
|
+
`,ho=({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)(lo,{y:"center",children:["list"!==t.value&&(0,n.jsxs)(o.Fragment,{children:[(0,n.jsx)(mo,{size:"l",weight:"medium",children:e}),(0,n.jsxs)(lo,{children:[(0,n.jsx)(ro,{icon:"icon-chevron-left",onClick:()=>l?.prev(),color:"grey5"}),(0,n.jsx)(ro,{icon:"icon-chevron-right",onClick:()=>l?.next(),color:"grey5"})]}),(0,n.jsx)(ro,{icon:"icon-calendar",onClick:()=>l?.today(),tooltip:{description:"CALENDAR_Today",position:"bottom"},color:"grey5"})]}),(0,n.jsx)(po,{children:(0,n.jsx)(co,{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)(so,{noMargin:!0,color:"primary",icon:"icon-plus",label:p.formatMessage({id:"GLOBAL_Add"}),options:C}),(0,n.jsx)(ao,{trigger:(0,n.jsx)(ro,{"aria-label":p.formatMessage({id:"GLOBAL_Filter"}),colorVariant:"light",icon:"icon-filter",badgeNumber:y.length}),dropdown:()=>(0,n.jsx)(xo,{children:(0,n.jsxs)(lo,{direction:"column",children:[(0,n.jsx)(oo,{weight:"medium",color:"primary",children:p.formatMessage({id:"GLOBAL_Filter"})}),(0,n.jsx)(uo,{labelPosition:"before",checkboxMode:"checkbox",direction:"column",onChange:e=>{b(e),r({types:e})},options:v,value:y,name:"0"}),(0,n.jsx)(go,{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)(so,{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)}]})]})},fo=u.j.getLazyComponent("Calendar"),jo=s().div`
|
|
674
517
|
margin-bottom: ${({theme:e})=>e.space.md}px;
|
|
675
|
-
`,
|
|
518
|
+
`,yo=s().div`
|
|
676
519
|
height: 54px;
|
|
677
520
|
display: flex;
|
|
678
521
|
align-items: center;
|
|
679
522
|
justify-content: space-between;
|
|
680
523
|
${({view:e,theme:t})=>"list"===e&&`border-bottom: 1px solid ${t.color.grey2};`}
|
|
681
524
|
padding: 0 ${({theme:e})=>e.space.md}px;
|
|
682
|
-
`,
|
|
525
|
+
`,bo=[{label:"CALENDAR_dayGridMonth",value:"dayGridMonth"},{label:"CALENDAR_timeGridWeek",value:"timeGridWeek"},{label:"CALENDAR_timeGridDay",value:"timeGridDay"},{label:"CALENDAR_listWeek",value:"list"}],Co=({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,ee.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)(()=>bo.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)(yo,{view:G.value,children:[l&&(0,n.jsx)(no,{}),s&&!y&&(0,n.jsx)(ho,{label:h,isLoading:y,view:G,calendarApi:w,viewsOptions:z,navigateWithQuery:V,setView:D,setCreationType:U,setExportModalOpen:q})]}),(0,n.jsx)(fo,{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)(jo,{children:(0,n.jsx)(Jn,{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})]})},vo=(s().div`
|
|
526
|
+
margin-bottom: 24px;
|
|
527
|
+
`,s().div`
|
|
528
|
+
margin-bottom: 4px;
|
|
529
|
+
`,s().div`
|
|
530
|
+
position: absolute;
|
|
531
|
+
background-color: ${e=>e.isActive?"rgba(0,0,0,.1)":"transparent"};
|
|
532
|
+
inset: 0;
|
|
533
|
+
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
534
|
+
flex: 1;
|
|
535
|
+
display: flex;
|
|
536
|
+
overflow: hidden;
|
|
537
|
+
`),wo=s().div`
|
|
538
|
+
flex-direction: row;
|
|
539
|
+
display: flex;
|
|
540
|
+
min-height: 60px;
|
|
541
|
+
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
542
|
+
`,Lo=s().div`
|
|
543
|
+
width: 60px;
|
|
544
|
+
display: flex;
|
|
545
|
+
align-items: center;
|
|
546
|
+
justify-content: center;
|
|
547
|
+
`,Eo=s().div`
|
|
548
|
+
flex: 1;
|
|
549
|
+
display: flex;
|
|
550
|
+
align-items: center;
|
|
551
|
+
justify-content: center;
|
|
552
|
+
`,ko=s().div`
|
|
553
|
+
position: relative;
|
|
554
|
+
overflow: hidden;
|
|
555
|
+
top: 0px;
|
|
556
|
+
width: ${460}px;
|
|
557
|
+
`,_o=s().div`
|
|
558
|
+
position: absolute;
|
|
559
|
+
top: 0;
|
|
560
|
+
${e=>"left"===e.position?"left: 0px;":""}
|
|
561
|
+
${e=>"right"===e.position?"right: -1000px;":""}
|
|
562
|
+
width: ${440}px;
|
|
563
|
+
bottom: 00px;
|
|
564
|
+
display: flex;
|
|
565
|
+
background-color: ${e=>e.theme.color.white};
|
|
566
|
+
flex-direction: row;
|
|
567
|
+
transition: all 0.4s;
|
|
568
|
+
box-shadow: -4px 0px 20px 0px #00000017;
|
|
569
|
+
|
|
570
|
+
&.animate {
|
|
571
|
+
right: 0px;
|
|
572
|
+
}
|
|
573
|
+
`,Wo=s().div`
|
|
574
|
+
flex: 1;
|
|
575
|
+
display: flex;
|
|
576
|
+
flex-direction: column;
|
|
577
|
+
padding: 12px;
|
|
578
|
+
overflow: auto;
|
|
579
|
+
margin-bottom: 12px;
|
|
580
|
+
position: relative;
|
|
581
|
+
`,So=s().div`
|
|
582
|
+
flex: 1;
|
|
583
|
+
display: flex;
|
|
584
|
+
flex-direction: column;
|
|
585
|
+
`,qo=s().div`
|
|
586
|
+
position: absolute;
|
|
587
|
+
inset: 0;
|
|
588
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
589
|
+
display: flex;
|
|
590
|
+
align-items: center;
|
|
591
|
+
justify-content: center;
|
|
592
|
+
`,Mo=s().div`
|
|
593
|
+
position: absolute;
|
|
594
|
+
inset: 0;
|
|
595
|
+
background-color: ${e=>e.theme.color.white};
|
|
596
|
+
padding: ${e=>e.theme.space.md}px;
|
|
597
|
+
`,Ao=s().div`
|
|
598
|
+
width: ${50}px;
|
|
599
|
+
padding-top: 60px;
|
|
600
|
+
display: flex;
|
|
601
|
+
flex-direction: column;
|
|
602
|
+
border-right: 1px solid ${e=>e.theme.color.grey2};
|
|
603
|
+
`,To=s().button`
|
|
604
|
+
border-radius: 4px;
|
|
605
|
+
cursor: pointer;
|
|
606
|
+
height: 42px;
|
|
607
|
+
margin: 4px;
|
|
608
|
+
width: 42px;
|
|
609
|
+
display: flex;
|
|
610
|
+
align-items: center;
|
|
611
|
+
justify-content: center;
|
|
612
|
+
background-color: ${e=>e.isActive?e.theme.color.grey2:e.theme.color.white};
|
|
613
|
+
|
|
614
|
+
${(0,r.DashedFocusBorder)()}
|
|
615
|
+
|
|
616
|
+
&:hover {
|
|
617
|
+
background-color: ${e=>e.theme.color.grey2};
|
|
618
|
+
}
|
|
619
|
+
`,Io=(s().div`
|
|
620
|
+
display: flex;
|
|
621
|
+
border: 1px solid ${e=>e.theme.color.grey1};
|
|
622
|
+
border-radius: ${8}px;
|
|
623
|
+
margin-bottom: 24px;
|
|
624
|
+
input {
|
|
625
|
+
width: 100%;
|
|
626
|
+
border: 0;
|
|
627
|
+
height: ${50}px;
|
|
628
|
+
margin: 0;
|
|
629
|
+
}
|
|
630
|
+
`,s().div`
|
|
631
|
+
display: flex;
|
|
632
|
+
flex-direction: row;
|
|
633
|
+
padding: 12px;
|
|
634
|
+
background-color: ${e=>e.theme.color.grey0};
|
|
635
|
+
border-radius: 8px;
|
|
636
|
+
margin-bottom: 4px;
|
|
637
|
+
`,s().div`
|
|
638
|
+
display: flex;
|
|
639
|
+
flex: 1;
|
|
640
|
+
align-items: center;
|
|
641
|
+
`,s().div`
|
|
642
|
+
width: 40px;
|
|
643
|
+
display: flex;
|
|
644
|
+
justify-content: center;
|
|
645
|
+
align-items: center;
|
|
646
|
+
`,s().div`
|
|
647
|
+
flex-direction: row;
|
|
648
|
+
display: flex;
|
|
649
|
+
align-items: center;
|
|
650
|
+
`,s().div`
|
|
651
|
+
flex: 1;
|
|
652
|
+
display: flex;
|
|
653
|
+
align-items: center;
|
|
654
|
+
`,u.j.getLazyComponent("Button")),zo=u.j.getLazyComponent("Icon"),Go=({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)(wo,{children:[(0,n.jsx)(Lo,{}),(0,n.jsx)(Eo,{children:"Popup"}),(0,n.jsx)(Lo,{children:(0,n.jsx)(To,{onClick:()=>{t(d.cr.slice.actions.flushEditorPopup({uniqid:e}))},children:(0,n.jsx)(zo,{name:"icon-times",color:"grey2",size:26.75})})})]}),(0,n.jsx)("div",{style:{flex:1,display:"flex"},children:i.view}),(0,n.jsx)(wo,{children:(0,n.jsx)(Io,{onClick:()=>{t(d.cr.slice.actions.flushEditorPopup({uniqid:e}))},children:"Save"})})]}):(0,n.jsx)(n.Fragment,{})};var Do=i(59);const Vo=u.j.getLazyComponent("WidgetArticleTitleEditor"),$o=u.j.getLazyComponent("WidgetArticleTextEditor"),Fo=u.j.getLazyComponent("WidgetArticleGalleryEditor"),Ro=u.j.getLazyComponent("WidgetArticleAttachmentEditor"),Oo=u.j.getLazyComponent("WidgetArticleSliderEditor"),Bo=u.j.getLazyComponent("WidgetArticleImageEditor"),Ho=u.j.getLazyComponent("WidgetButtonEditor"),Uo=u.j.getLazyComponent("WidgetCheckListEditor"),No=u.j.getLazyComponent("WidgetQuickSurveyEditor"),Po=u.j.getLazyComponent("WidgetDatasourceTableEditor"),Yo=u.j.getLazyComponent("WidgetExcelDatasourceTableEditor"),Qo=u.j.getLazyComponent("WidgetPresenceEditor"),Jo=u.j.getLazyComponent("WidgetLuccaAbsenceEditor"),Ko=u.j.getLazyComponent("WidgetEmailsImapEditor"),Xo=u.j.getLazyComponent("WidgetContactCardDavEditor"),Zo=u.j.getLazyComponent("WidgetCalendarCalDavEditor"),el=({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),be.shallowEqual),l=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e)?.onSave,be.shallowEqual),s=e=>d.qn.selectors.selectHook(Do.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)(Ho,{...m.content,onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:()=>a({})}):(0,E.ensureWidgetArticleGalleryType)(m)?(0,n.jsx)(Fo,{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)(Ro,{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)(Jo,{}):(0,E.ensureWidgetArticleImageType)(m)?(0,n.jsx)(Bo,{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)(Oo,{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)(Vo,{onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,content:m.content,onOpen:g}):(0,E.ensureWidgetArticleTextType)(m)?(0,n.jsx)($o,{onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,content:m.content}):(0,E.ensureWidgetPresenceType)(m)?(0,n.jsx)(Qo,{onChange:i=>{t((0,d.vR)(e,i,!1))},onSave:a,onStateChange:u,...m.content}):(0,E.ensureWidgetCheckListType)(m)?(0,n.jsx)(Uo,{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)(No,{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)(Yo,{...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)(Ko,{}):(0,E.ensureWidgetContactCardDavType)(m)?(0,n.jsx)(Xo,{}):(0,E.ensureWidgetCalendarCalDavType)(m)?(0,n.jsx)(Zo,{}):(0,E.ensureWidgetDatasourceTableType)(m)?(0,n.jsx)(Po,{...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},tl=u.j.getLazyComponent("Icon"),il=({uniqid:e,position:t})=>{const i=(0,c.jL)(),o=(0,l.useTheme)();return(0,n.jsx)(Lo,{children:(0,n.jsx)(To,{onClick:()=>{i(d.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))},children:(0,n.jsx)(tl,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:o.color.lavender,size:26.75})})})},nl=u.j.getLazyComponent("InputColorRaw"),ol=s().label`
|
|
655
|
+
margin-left: 2px;
|
|
656
|
+
margin-right: 2px;
|
|
657
|
+
margin-bottom: 8px;
|
|
658
|
+
font-size: 14px;
|
|
659
|
+
width: 100%;
|
|
660
|
+
min-height: 20px;
|
|
661
|
+
`,ll=s().fieldset`
|
|
662
|
+
margin: 12px 0px !important;
|
|
663
|
+
width: 100% !important;
|
|
664
|
+
`,sl=({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)(ll,{children:[(0,n.jsx)(ol,{children:(0,n.jsx)(a.FormattedMessage,{id:e})}),(0,n.jsx)(nl,{palettes:s,label:e,initialValue:t??o.color.primary,name:"background-color",onChange:i})]})},al=u.j.getLazyComponent("InputNumber"),rl=({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)(al,{label:e,name:"value",width:"100%",control:s,placeholder:l.formatMessage({id:e})})},dl=u.j.getLazyComponent("InputSelectExtended"),cl=({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)(dl,{options:t,label:e,getValue:e=>e.value,getLabel:"label",getSearch:"label",rules:{required:l},hideDeleteIcon:!0,required:l,control:r,name:"select"})},ul=u.j.getLazyComponent("InputText"),gl=({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),be.shallowEqual),u=(0,l.useTheme)(),g=(0,c.GV)(t=>d.x0.selectors.selectWidgetTitleStyle(t,e),be.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)(ul,{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)(sl,{label:"STYLE_Text_Color",initialValue:x.color,handleChange:e=>h("color",e)}),(0,n.jsx)(sl,{label:"STYLE_Background_Color",initialValue:x.backgroundColor,handleChange:e=>h("background-color",e)}),(0,n.jsx)(rl,{label:"STYLE_Text_Size",initialValue:x.fontSize,handleChange:e=>h("font-size",e)}),(0,n.jsx)(cl,{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)(cl,{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,{})},ml=u.j.getLazyComponent("Loader"),pl=({uniqid:e})=>{const t=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e),be.shallowEqual)?.busy;return(0,n.jsx)(n.Fragment,{children:t&&(0,n.jsx)(qo,{children:(0,n.jsx)(ml,{size:"l"})})})},xl=({uniqid:e})=>{const t=(0,a.useIntl)(),i=(0,c.GV)(t=>d.x0.selectors.selectWidgetState(t,e),be.shallowEqual)?.locked;return i?(0,n.jsx)(Mo,{children:t.formatMessage({id:"INTRANET_Panel_Change_Off"})}):(0,n.jsx)(n.Fragment,{})},hl=u.j.getLazyComponent("Button"),fl=({uniqid:e,mode:t})=>{const i=(0,a.useIntl)(),o=(0,c.jL)(),l=(0,c.GV)(t=>d.x0.selectors.selectWidget(t,e),be.shallowEqual),s=(0,c.GV)(t=>d.x0.selectors.selectWidgetObjectUri(t,e),be.shallowEqual);return(0,n.jsx)(hl,{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"})})},jl=({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),be.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)(sl,{label:"STYLE_Background_Color",initialValue:u.backgroundColor,handleChange:e=>g("background-color",e)}),(0,n.jsx)(sl,{label:"STYLE_Text_Color",initialValue:u.color,handleChange:e=>g("color",e)}),(0,n.jsx)("hr",{}),(0,n.jsx)(rl,{label:"STYLE_Padding",initialValue:u.padding,handleChange:e=>g("padding",String(e))}),(0,n.jsx)(rl,{label:"STYLE_Radius",initialValue:u.borderRadius,handleChange:e=>g("border-radius",String(e))}),(0,n.jsx)(cl,{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)(sl,{label:"STYLE_Border_Color",initialValue:u.borderColor,handleChange:e=>g("border-color",e)}),"string"==typeof u.borderStyle&&"none"!==u.borderStyle&&(0,n.jsx)(rl,{label:"STYLE_Border_Width",initialValue:u.borderWidth,handleChange:e=>g("border-width",e)})]})},yl=({uniqid:e})=>{const t=(0,c.jL)(),i=(0,a.useIntl)(),l=(0,c.GV)(t=>d.cr.selectors.selectEditor(t,e),be.shallowEqual),s=d.x0.definition(l?.name),r=(0,c.GV)(t=>d.x0.selectors.selectWidgetLevel(t,e),be.shallowEqual),u=(0,o.useCallback)(i=>{t(d.x0.slice.actions.updateWidgetWrapper({uniqid:e,level:Number(i)}))},[e,t]);return(0,n.jsx)(cl,{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)):[])})},bl=["widget-presence","widget-quick-survey","widget-check-list","widget-emails-imap","widget-contact-cardDav","widget-calendar-calDav"],Cl=u.j.getLazyComponent("Icon"),vl=u.j.getLazyComponent("Tooltip"),wl=({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),be.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)(ko,{children:[(0,n.jsxs)(_o,{ref:u,position:t,children:[(0,n.jsx)(Ao,{children:x.filter(e=>e.enable).map(e=>(0,n.jsx)(To,{isActive:f&&f.name===e.name,onClick:()=>j(e),children:(0,n.jsx)(vl,{position:"left",description:e.label,children:(0,n.jsx)(Cl,{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)(wo,{children:[(0,n.jsx)(il,{uniqid:e,position:g.position}),(0,n.jsx)(Eo,{children:(0,n.jsx)("h3",{children:f?f.label:i.formatMessage({id:m.label})})}),(0,n.jsx)(Lo,{children:(0,n.jsx)(To,{onClick:()=>{s(d.cr.slice.actions.flushEditor({uniqid:e}))},children:(0,n.jsx)(Cl,{name:"icon-times",color:r.color.lavender,size:26.75})})})]}),(0,n.jsxs)(Wo,{children:[(0,n.jsxs)(So,{children:[f&&"widget-settings"===f.name&&m.panel.useEditor&&(0,n.jsx)(el,{uniqid:g.uniqid}),f&&"widget-title"===f.name&&m.panel.useWrapper&&(0,n.jsx)(gl,{uniqid:g.uniqid}),f&&"widget-selection"===f.name&&(0,n.jsx)(jl,{uniqid:e}),f&&"widget-level"===f.name&&p&&(0,n.jsx)(yl,{uniqid:e})]}),(0,n.jsx)(pl,{uniqid:e}),(0,n.jsx)(xl,{uniqid:e}),bl.includes(g.name)&&(0,n.jsx)(fl,{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,{})},Ll=s().div`
|
|
665
|
+
position: absolute;
|
|
666
|
+
inset: 0;
|
|
667
|
+
pointer-events: none;
|
|
668
|
+
z-index: 1;
|
|
669
|
+
`,El=s().div`
|
|
670
|
+
flex: 1;
|
|
671
|
+
display: flex;
|
|
672
|
+
margin-top: ${90}px;
|
|
673
|
+
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
674
|
+
`,kl=s().div`
|
|
675
|
+
flex: 1;
|
|
676
|
+
display: flex;
|
|
677
|
+
flex-direction: row;
|
|
678
|
+
pointer-events: none;
|
|
679
|
+
`,_l=s().div`
|
|
680
|
+
width: ${440}px;
|
|
681
|
+
pointer-events: none;
|
|
682
|
+
`,Wl=()=>{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,be.shallowEqual);return(0,n.jsx)(Ll,{className:"editor-portal-wrapper",children:t.map(e=>(0,n.jsx)(vo,{isActive:!1,children:(0,n.jsx)(kl,{children:"left"===e.position?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(wl,{uniqid:e.uniqid,position:e.position}),(0,n.jsx)(El,{isActive:void 0!==e.popup,children:(0,n.jsx)(Go,{uniqid:e.uniqid})}),(0,n.jsx)(_l,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_l,{}),(0,n.jsx)(El,{isActive:void 0!==e.popup,children:(0,n.jsx)(Go,{uniqid:e.uniqid})}),(0,n.jsx)(wl,{uniqid:e.uniqid,position:e.position})]})})},e.uniqid))})},Sl=()=>(0,n.jsx)(n.Fragment,{}),ql=u.j.getLazyComponent("Container"),Ml=()=>(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(n.Fragment,{}),children:(0,n.jsx)(ql,{backgroundColor:"white",mode:"fluid",flexDirection:"column",children:(0,n.jsx)(ee.Outlet,{})})});var Al=i(910);const Tl=()=>{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}},Il=u.j.getLazyComponent("InputTinyMCE"),zl=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}=Tl(),{open:p,onInsert:x,close:h,ext:f,isActive:j}=je(),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,ye.X)(r,s,b),[r,b,s]),v=(0,o.useMemo)(()=>Al.p9,[]);return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)(Il,{commonOptions:v,additionalExtensions:y,mentionsQueries:C,...e}),m&&(0,n.jsx)(T,{query:u}),j&&(0,n.jsx)(bt,{onInsert:x,open:p,close:h})]})},Gl=u.j.getLazyComponent("InputTinyMCERaw"),Dl=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}=Tl(),{open:p,onInsert:x,close:h,ext:f,isActive:j}=je(),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,ye.X)(r,s,b),[r,b,s]),v=(0,o.useMemo)(()=>Al.p9,[]);return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)(Gl,{commonOptions:v,additionalExtensions:y,mentionsQueries:C,...e}),m&&(0,n.jsx)(T,{query:u}),j&&(0,n.jsx)(bt,{onInsert:x,open:p,close:h})]})},Vl=u.j.getLazyComponent("InputAudience"),$l=u.j.getLazyComponent("Message"),Fl=u.j.getLazyComponent("Modal"),Rl=({open:e,closeHandler:t,title:i,control:o,warningMessage:l,onSubmit:s,name:r="publishTo"})=>{const d=(0,a.useIntl)();return(0,n.jsxs)(Fl,{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)($l,{variant:"warning",message:l??d.formatMessage({id:"FORM_Audience_Empty"})}),(0,n.jsx)(Vl,{asyncPromise:e=>k().audience.autocomplete(e),searchable:!0,control:o,multiple:!0,placeholder:d.formatMessage({id:"GLOBAL_Audience"}),name:r})]})};var Ol=i(831);const Bl=u.j.getLazyComponent("ModalForm"),Hl=u.j.getLazyComponent("InputDateTime"),Ul=u.j.getLazyComponent("InputTextRaw"),Nl=u.j.getLazyComponent("FlexBox"),Pl=u.j.getLazyComponent("IconButton"),Yl=s().div`
|
|
683
683
|
margin-bottom: ${({theme:e})=>e.space.xs}px;
|
|
684
|
-
`,
|
|
685
|
-
//# sourceMappingURL=
|
|
684
|
+
`,Ql=({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,Ol.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)(Bl,{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)(Hl,{rules:{required:!0},label:"GLOBAL_Scheduled_Date",control:g.control,name:"scheduleDate"}),(0,n.jsxs)(Nl,{y:"flex-end",children:[(0,n.jsx)(Ul,{label:l.formatMessage({id:"GLOBAL_Permalink"}),value:x,onChange:()=>null,margin:"0",width:"100%"}),(0,n.jsx)(Yl,{children:(0,n.jsx)(Pl,{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"})}))})}})})]})]})},Jl=u.j.getLazyComponent("Container"),Kl=u.j.getLazyComponent("AppColumn"),Xl=u.j.getLazyComponent("MainColumn");function Zl({extensionRoute:e,routes:t,description:i,mode:l="center",mainColumnProps:s}){const r=(0,a.useIntl)(),{pathname:d}=(0,ee.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,ee.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)(Jl,{mode:l,children:[(0,n.jsx)(Kl,{mode:l,description:i,tabs:m,activeTab:u||""}),(0,n.jsx)(Xl,{mode:l,flex:!0,...s,children:(0,n.jsx)(ee.Outlet,{})})]})})}}}]);
|
|
685
|
+
//# sourceMappingURL=664.98a9c8b95abdc89137ee.chunk.js.map
|