jamespot-react-core 1.1.178 → 1.1.179
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/235.bundle.js +49 -40
- package/build/235.bundle.js.map +1 -1
- package/build/app.bundle.js +34 -43
- package/build/app.bundle.js.map +1 -1
- package/build/src/components/widgets/wrapper/JRCWidgetPresenceWrapper.d.ts +1 -0
- package/build/src/components/widgets/wrapper/JRCWidgetPresenceWrapperClosing.d.ts +3 -7
- package/package.json +2 -2
package/build/235.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[235],{235:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>O,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[235],{235:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>O,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>En,DisplayForm:()=>kn,EditorsPortal:()=>Wi,Empty:()=>Si,JRCInputTinyMCEWithExt:()=>Ti,JRCInputTinyMCEWithExtRaw:()=>Oi,ModalAudience:()=>zi,TwoColLayout:()=>Gi,WidgetList:()=>X,WidgetWrapperCore:()=>rn});var i=n(594),l=n.n(i),o=n(196),r=n.n(o),a=n(493),s=n(101),c=n(85),d=n(704),u=n(737);const m=u.default.registry.getLazyComponent("JRCAvatar"),g=u.default.registry.getLazyComponent("Icon"),p=e=>{var t;const n=(0,o.useTheme)(),i=(0,d.useSelector)(c.Bx.selectors.selectNetworkPublic);return e.uri===(null==i?void 0:i.uri)?l().createElement(g,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}):l().createElement(m,Object.assign({},e))},f=u.default.registry.getLazyComponent("FlexBox"),E=u.default.registry.getLazyComponent("ModalContent"),y=u.default.registry.getLazyComponent("ModalLayout"),h=u.default.registry.getLazyComponent("StyledHref"),v=u.default.registry.getLazyComponent("Tooltip"),b=u.default.registry.getLazyComponent("Typography"),x=r().div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
a {
|
|
157
157
|
word-wrap: break-word;
|
|
158
158
|
}
|
|
159
|
-
`,De=({widget:e,mode:t})=>{const{uniqid:n}=e,r=(0,o.useTheme)(),{text:s}=e.content,m=(0,d.useDispatch)(),g=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,n)),d.shallowEqual),p=(0,d.useSelector)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),f=(0,d.useSelector)(c.x0.selectors.selectToken),E=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),y=(0,d.useSelector)(c.Kx.selectors.selectAll),h=(0,a.useIntl)(),v=(0,i.useCallback)((e=>{m(c.y8.actions.error({label:null!=e?e:h.formatMessage({id:"GLOBAL_Error"})}))}),[m,h]);(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const b=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(y,r,v)),[y,v,r]);return p?l().createElement(l().Fragment,null):l().createElement(ze,null,l().createElement(je,{autoFocus:g,text:null!=s?s:"",token:"edit"===t&&void 0!==f?f:"",tinyMCECommonOptions:"edit"===t&&E?{
|
|
159
|
+
`,De=({widget:e,mode:t})=>{const{uniqid:n}=e,r=(0,o.useTheme)(),{text:s}=e.content,m=(0,d.useDispatch)(),g=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,n)),d.shallowEqual),p=(0,d.useSelector)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),f=(0,d.useSelector)(c.x0.selectors.selectToken),E=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),y=(0,d.useSelector)(c.Kx.selectors.selectAll),h=(0,a.useIntl)(),v=(0,i.useCallback)((e=>{m(c.y8.actions.error({label:null!=e?e:h.formatMessage({id:"GLOBAL_Error"})}))}),[m,h]);(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const b=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(y,r,v)),[y,v,r]);return p?l().createElement(l().Fragment,null):l().createElement(ze,null,l().createElement(je,{autoFocus:g,text:null!=s?s:"",token:"edit"===t&&void 0!==f?f:"",tinyMCECommonOptions:"edit"===t&&E?{commonOptions:E,mentionsQueries:b}:void 0,mode:t,onChange:e=>{m((0,c.vR)(n,{text:e}))}}))},$e=u.default.registry.getLazyComponent("WidgetArticleTitle"),Re=r().div`
|
|
160
160
|
flex: 1;
|
|
161
161
|
display: flex;
|
|
162
162
|
flex-direction: row;
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
display: flex;
|
|
289
289
|
justify-content: center;
|
|
290
290
|
align-items: center;
|
|
291
|
-
`,Wt=({mode:e,uniqid:t,
|
|
291
|
+
`,Wt=({mode:e,uniqid:t,content:n})=>{const o=(0,a.useIntl)(),r=(0,d.useDispatch)(),s=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectUri(e,t)),d.shallowEqual),u=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),d.shallowEqual),m=(0,i.useMemo)((()=>!(!u||!u.update)),[u]),g=(0,i.useCallback)((()=>{if("edit"===e||!m||!s)return;const i=Object.assign(Object.assign({},n),{isClosed:!0});q().widget.updateWidget({uri:s,uniqid:t,content:i,v2:!0}).then((()=>r(c.x0.slice.actions.updateWidget({uniqid:t,content:i})))).catch((()=>r(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}),[e,t,m,s,n,r]);return l().createElement(l().Fragment,null,m&&!n.isClosed&&l().createElement(wt,null,l().createElement(qt,null,l().createElement(kt,{onClick:g},o.formatMessage({id:"WIDGET_Presence_Closing"})))))},St=u.default.registry.getLazyComponent("WidgetPresence"),Lt=u.default.registry.getLazyComponent("ModalUserList"),At=r().div`
|
|
292
292
|
display: flex;
|
|
293
293
|
flex: 1;
|
|
294
294
|
position: relative;
|
|
@@ -301,41 +301,50 @@
|
|
|
301
301
|
flex: 1;
|
|
302
302
|
justify-content: center;
|
|
303
303
|
align-items: center;
|
|
304
|
-
`,
|
|
304
|
+
`,r().div`
|
|
305
|
+
flex: 1;
|
|
306
|
+
display: flex;
|
|
307
|
+
padding: ${e=>e.theme.space.md}px;
|
|
308
|
+
border: 1px dashed ${e=>e.theme.color.orange};
|
|
309
|
+
justify-content: center;
|
|
310
|
+
align-center: center;
|
|
311
|
+
border-radius: ${e=>e.theme.space.sm}px;
|
|
312
|
+
margin: ${e=>e.theme.space.sm}px;
|
|
313
|
+
`),Mt=({widget:e,mode:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),{limit:r,limitValue:s,closing:m,isClosed:g}=e.content,{uniqid:p}=e,[f,E]=(0,i.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[y,h]=(0,i.useState)(!1),[v]=(0,i.useState)(new AbortController),[b,x]=(0,i.useState)(!1),[C,w]=(0,i.useState)(),[k,W]=(0,i.useState)(),S=(0,i.useRef)(v),L=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectUri(e,p)),d.shallowEqual),A=(0,d.useSelector)((e=>c.x0.selectors.selectAllWidgetRTObject(e,p)),d.shallowEqual),T=(0,i.useCallback)((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[o]),M=(0,i.useMemo)((()=>!(r&&s&&f.userAvailableTotal>=s)),[r,s,f.userAvailableTotal]),O=(0,i.useMemo)((()=>m&&g||"edit"===t),[m,g,t]),I=(0,i.useCallback)((()=>{L&&!O&&(M?(h(!0),q().widget.presenceCancel({uri:L,uniqid:p}).catch(T).finally((()=>h(!1)))):o(c.y8.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))}),[o,p,T,L,M,O]),_=(0,i.useCallback)((e=>{L&&!O&&(h(!0),q().widget.presenceRespond({uri:L,uniqid:p,value:e},S.current.signal).catch(T).finally((()=>h(!1))))}),[L,p,T,O]),j=(0,i.useCallback)((()=>{"edit"!==t&&L&&(h(!0),q().widget.presenceGetResponse({uri:L,uniqid:p},S.current.signal).then((e=>{E(e.result)})).catch((e=>!e.aborted&&T())).finally((()=>h(!1))))}),[L,T,p,t]),z=(e,t)=>{L&&q().widget.presenceGetResponseUserList({uri:L,uniqid:p,index:e,page:t,limit:8},S.current.signal).then((e=>{W(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&T))},D=(0,i.useCallback)((()=>{L&&(h(!0),q().widget.getWidget({uri:L,uniqid:p}).then((e=>{o((0,c.vR)(p,e.result))})).catch((e=>!e.aborted&&T)).finally((()=>h(!1))))}),[o,T,L,p]);return(0,i.useEffect)((()=>()=>{S&&S.current&&S.current.abort()}),[]),(0,i.useEffect)((()=>{j()}),[j]),(0,i.useEffect)((()=>{if(!Array.isArray(A))return;const e=A.at(-1);e&&L&&e.object.uri===L&&e.uniqid===p&&("widget-presence-response"===e.fn&&j(),"widget-update"===e.fn&&D())}),[A,j,p,L,D]),l().createElement(u.RTProvider,{useRT:()=>{(0,te.AW)(e.uniqid)}},l().createElement(At,null,l().createElement(St,{limit:r,limitValue:s,userAvailableList:f.userAvailableList,userUnavailableList:f.userUnavailableList,userValue:f.userValue,userAvailableTotal:null==f?void 0:f.userAvailableTotal,userUnavailableTotal:null==f?void 0:f.userUnavailableTotal,isClosed:m&&g,handleClickAvailable:()=>1===f.userValue?I():_(1),handleClickUnavailable:()=>0===f.userValue?I():_(0),handleOpenUsersModal:e=>{W({limit:0,page:0,data:[],cnt:0}),w(e),z(e),x(!0)}}),m&&g&&l().createElement(Tt,null,n.formatMessage({id:"WIDGET_Presence_Is_Closed"})),m&&!g&&l().createElement(Wt,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&l().createElement(Ye,{uniqid:e.uniqid,name:e.name,mode:t}),y&&l().createElement(Ze,null),l().createElement(Lt,{open:b,usersList:k,title:1===C?n.formatMessage({id:"WIDGET_Presence_On"}):n.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:x,onClose:()=>{W({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{z(null!=C?C:0,e)}})))},Ot=u.default.registry.getLazyComponent("WidgetQuickSurvey"),It=u.default.registry.getLazyComponent("WidgetQuickSurveyEditor"),_t=u.default.registry.getLazyComponent("ModalUserList"),jt=r().div`
|
|
305
314
|
width: 100%;
|
|
306
315
|
display: flex;
|
|
307
316
|
flex-direction: column;
|
|
308
317
|
gap: 14px;
|
|
309
318
|
${e=>e.withPadding&&"padding: 0 12px;"}
|
|
310
319
|
padding-top: 16px;
|
|
311
|
-
`,
|
|
320
|
+
`,zt=({widget:e,inplace:t,mode:n})=>{var o,r,m;const g=(0,a.useIntl)(),p=(0,d.useDispatch)(),{uniqid:f,content:E}=e,[y,h]=(0,i.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(!1),[w,W]=(0,i.useState)(),[S,L]=(0,i.useState)(),[A]=(0,i.useState)(new AbortController),T=(0,i.useRef)(A),M=(0,d.useSelector)(c.x0.selectors.selectToken,d.shallowEqual),O=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),d.shallowEqual),I=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,f)),d.shallowEqual),_=(0,d.useSelector)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),d.shallowEqual),j=(0,i.useCallback)(((e,t)=>{p((0,c.vR)(e,t))}),[p]),z=t=>{p(c.cr.slice.actions.flushAllEditor()),p(c.x0.slice.actions.setToken({token:t})),p(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:k.WidgetsName.QuickSurvey}))},D=(0,i.useCallback)((()=>p(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[p]),$=(0,i.useCallback)((e=>{"edit"!==n&&O&&(C(!0),q().widget.quickSurveyGetResponse({uri:O,uniqid:e},T.current.signal).then((e=>{h(e.result)})).catch((e=>!e.aborted&&D)).finally((()=>C(!1))))}),[D,O,n]),R=(0,i.useCallback)((()=>{O&&(C(!0),q().widget.getWidget({uri:O,uniqid:f},T.current.signal).then((e=>{j(f,e.result.content)})).catch((e=>!e.aborted&&D)).finally((()=>C(!1))))}),[f,D,O,j]),F=()=>{if(O&&E.closing){const e=Object.assign(Object.assign({},E),{isClosed:!0});q().widget.updateWidget({uri:O,uniqid:f,content:e}).catch((()=>{D()}))}},G=t=>{(t=>{"edit"!==n&&O&&(C(!0),q().widget.quickSurveyRespond({uri:O,index:t,multi:E.multi?1:0,uniqid:f},T.current.signal).then((()=>{$(e.uniqid)})).catch((e=>!e.aborted&&D)).finally((()=>C(!1))))})(t)},B=(e,t)=>{O&&q().widget.quickSurveyGetResponseUserList({uri:O,uniqid:f,index:e,page:t,limit:8},T.current.signal).then((e=>{L(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&D))},U=(0,i.useMemo)((()=>I&&I.update),[I]);(0,i.useEffect)((()=>{$(e.uniqid)}),[$,e.uniqid]),(0,i.useEffect)((()=>{if(!Array.isArray(_))return;const t=_.at(-1);t&&O&&t.object.uri===O&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&$(e.uniqid),"widget-update"===t.fn&&R())}),[_,O,e.uniqid,R,$]);const H=(0,i.useMemo)((()=>{if(!Array.isArray(E.arr))return[];const e=[];return E.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[E]);return(0,i.useEffect)((()=>{M||"edit"!==n||q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,M,p]),"edit"===n&&t?l().createElement(jt,{withPadding:!0},l().createElement(It,{token:M,uniqid:f,content:e.content,onChangeContent:j,onChangeWrapper:e=>{p(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:e=>j(f,e),inplace:t})):l().createElement(u.RTProvider,{useRT:()=>{(0,te.AW)(e.uniqid)}},l().createElement(jt,null,l().createElement(s.JRCFileViewer,{files:H,openWithOptions:[]},(t=>{var n,i,o,r,a,s,c;return l().createElement(Ot,{limit:null!==(n=y.totalResponse)&&void 0!==n?n:0,values:null!==(i=E.arr)&&void 0!==i?i:[],userResponses:y.userResponses,userHasAlreadyVoted:y.userLoggedResponses.length>0,canCloseSurvey:null!==(o=e.content.closing)&&void 0!==o&&o,isClosed:null!==(r=e.content.isClosed)&&void 0!==r&&r,open:null!==(a=e.content.open)&&void 0!==a&&a,anonymize:null!==(s=e.content.anonymize)&&void 0!==s&&s,seeResponseAfter:null!==(c=e.content.seeResponseAfter)&&void 0!==c&&c,canUpdate:U,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:F,handleProgressBarClick:G,setOpenUsersModal:e=>{W(e),B(e),b(!0)}})})),E.open&&l().createElement(nt,{handleClick:e=>{var t;if(!O)return;const n=Object.assign(Object.assign({},E),{arr:[...null!==(t=E.arr)&&void 0!==t?t:[],{title:e}]});q().widget.quickSurveyAddEnty({uri:O,uniqid:f,label:e}).then((()=>{p(c.x0.slice.actions.updateWidget({uniqid:f,content:n}))})).catch(D)},placeholder:g.formatMessage({id:"FIELDS_Add_Option"})}),U&&l().createElement(Ye,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!U},mode:n,handleOpenEditor:()=>{M?z(M):(C(!0),q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result})),z(e.result)})).finally((()=>C(!1))))}}),x&&l().createElement(Ze,null),l().createElement(_t,{open:v,usersList:S,title:null!==(m=null===(r=null===(o=E.arr)||void 0===o?void 0:o[null!=w?w:0])||void 0===r?void 0:r.title)&&void 0!==m?m:"",setOpen:b,handleLoadUsersList:e=>{B(null!=w?w:0,e)},onClose:()=>{L({limit:0,page:0,data:[],cnt:0})}})))},Dt=r().div`
|
|
312
321
|
padding: ${e=>e.theme.space.md}px;
|
|
313
322
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
314
|
-
|
|
323
|
+
`,$t=({uniqid:e})=>{var t;const n=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual);return l().createElement(l().Fragment,null,n&&"string"==typeof n.title&&0!==n.title.length&&l().createElement(Dt,null,l().createElement(s.JRCHtml,{__html:null!==(t=n.title)&&void 0!==t?t:""})))},Rt=({uniqid:e})=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>{var n;return null===(n=c.x0.selectors.selectWidget(t,e))||void 0===n?void 0:n.title}),d.shallowEqual),{control:r,watch:u}=(0,et.useForm)({defaultValues:{widgetTitle:o},criteriaMode:"all"});return(0,i.useEffect)((()=>{const t=u((t=>{n(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))}));return()=>t.unsubscribe()}),[u,n,e]),l().createElement(s.JRCInputText,{name:"widgetTitle",control:r,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},Ft=u.default.registry.getLazyComponent("Button"),Gt=u.default.registry.getLazyComponent("ModalLayout"),Bt=u.default.registry.getLazyComponent("ModalContent"),Ut=r().div`
|
|
315
324
|
padding: ${e=>e.theme.space.md}px;
|
|
316
325
|
display: flex;
|
|
317
326
|
flex-direction: row-reverse;
|
|
318
|
-
`,
|
|
327
|
+
`,Ht=r().div`
|
|
319
328
|
flex: 1;
|
|
320
329
|
display: flex;
|
|
321
330
|
flex-direction: row;
|
|
322
331
|
gap: ${e=>e.theme.space.sm}px;
|
|
323
332
|
padding: ${e=>e.theme.space.sm}px;
|
|
324
333
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
325
|
-
`,
|
|
334
|
+
`,Nt=r().div`
|
|
326
335
|
flex: 1;
|
|
327
336
|
display: flex;
|
|
328
337
|
fieldset:first-of-type {
|
|
329
338
|
margin: 0px !important;
|
|
330
339
|
}
|
|
331
|
-
`,
|
|
340
|
+
`,Pt=r().div`
|
|
332
341
|
display: flex;
|
|
333
342
|
gap: ${e=>e.theme.space.sm}px;
|
|
334
|
-
`,
|
|
343
|
+
`,Jt=({uniqid:e,name:t,handleOpenEditor:n})=>{const o=(0,Se.jL)(),r=(0,a.useIntl)(),[d,u]=(0,i.useState)(!1),m=(0,i.useCallback)((()=>{o(c.cr.slice.actions.registerEditor({uniqid:e,name:t,mode:"edit"}))}),[e,o,t]),g=(0,i.useCallback)((()=>{o(c.x0.slice.actions.flushWidget({uniqid:e}))}),[e,o]);return l().createElement(l().Fragment,null,l().createElement(Ht,null,l().createElement(Nt,null,l().createElement(Rt,{uniqid:e})),l().createElement(Pt,null,l().createElement(s.JRCIconButton,{icon:"icon-pencil",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:null!=n?n:m,title:r.formatMessage({id:"BUTTON_Title_Open_Edit_Panel"})}),l().createElement(s.JRCIconButton,{icon:"icon-trash",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:()=>u(!0),title:r.formatMessage({id:"BUTTON_Title_Open_Remove_Widget"})}))),d&&l().createElement(Gt,{enableClickAwayCloseModal:!0,open:d,closeHandler:()=>u(!1)},l().createElement(Bt,{overflow:"scroll",title:r.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1)},r.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(Ut,null,l().createElement(Ft,{label:r.formatMessage({id:"GLOBAL_Confirm"}),onClick:g}))))},Vt=r().div`
|
|
335
344
|
display: flex;
|
|
336
345
|
flex: 1;
|
|
337
346
|
flex-direction: column;
|
|
338
|
-
`,
|
|
347
|
+
`,Qt=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:o,cannotDisplayComponent:r})=>{const{name:a}=e;return(0,k.ensureWidgetArticleButtonType)(e)?l().createElement(ge,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleGalleryType)(e)?l().createElement(he,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleAttachmentType)(e)?l().createElement(ce,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleImageType)(e)?l().createElement(We,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleSliderType)(e)?l().createElement(_e,{widget:e,inplace:n,mode:i,width:null!=t?t:800}):(0,k.ensureWidgetArticleTitleType)(e)?l().createElement(Be,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleTextType)(e)?l().createElement(De,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetExcelDatasourceTableType)(e)?l().createElement(Vt,null,l().createElement($t,{uniqid:e.uniqid}),l().createElement(Ct,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetDatasourceTableType)(e)?l().createElement(Vt,null,l().createElement($t,{uniqid:e.uniqid}),l().createElement(ft,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?l().createElement(Vt,null,"edit"===i?l().createElement(Jt,{name:e.name,uniqid:e.uniqid}):l().createElement($t,{uniqid:e.uniqid}),l().createElement(at,{widget:e,inplace:n,mode:i,onWidgetUpdate:o})):(0,k.ensureWidgetPresenceType)(e)?l().createElement(Vt,null,"edit"===i?l().createElement(Jt,{name:e.name,uniqid:e.uniqid}):l().createElement($t,{uniqid:e.uniqid}),l().createElement(Mt,{widget:e,inplace:n,mode:i})):(0,k.ensureWidgetQuickSurveyType)(e)?l().createElement(Vt,null,"edit"===i?l().createElement(Jt,{name:e.name,uniqid:e.uniqid}):l().createElement($t,{uniqid:e.uniqid}),l().createElement(zt,{widget:e,inplace:n,mode:i})):r?l().createElement(l().Fragment,null,r(a)):l().createElement(l().Fragment,null,"cannot display widget (",a,")")},Kt=(r().div`
|
|
339
348
|
height: 0;
|
|
340
349
|
overflow: hidden;
|
|
341
350
|
`,r().div`
|
|
@@ -377,36 +386,36 @@
|
|
|
377
386
|
min-height: 200px;
|
|
378
387
|
`,r().div`
|
|
379
388
|
display: flex;
|
|
380
|
-
`),
|
|
389
|
+
`),Yt=r().div`
|
|
381
390
|
position: absolute;
|
|
382
391
|
inset: 0;
|
|
383
392
|
opacity: ${e=>e.opacity};
|
|
384
393
|
background-color: ${e=>e.backgroundColor};
|
|
385
394
|
pointer-events: ${e=>e.pointerEvents};
|
|
386
|
-
`,
|
|
395
|
+
`,Xt=u.default.registry.getLazyComponent("DoubleClick"),Zt=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(en,{uniqid:e,key:t,mode:"edit"}))))},en=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(Yt,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(tn,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(Yt,{opacity:n.visible?1:0,backgroundColor:n.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:n.locked?"none":"all"},n.widgets.map(((e,t)=>l().createElement(tn,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},tn=({uniqid:e,layerId:t,mode:n})=>{const i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>t.widgets.ids[e]),d.shallowEqual),r=(0,d.useSelector)((e=>e.widgets.layers[t]));return o&&r&&r.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:r.position.y,left:r.position.x}},l().createElement(an,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(nn,{position:{x:r.position.x,y:r.position.y},onMouseUp:e=>{(r.position&&r.position.x!==e.x||r.position&&r.position.y!==e.y)&&(e=>{i(c.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(Xt,{onDoubleTap:()=>((e,t)=>{i(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(an,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},nn=({position:e,children:t,onMouseUp:n})=>{const[o,r]=l().useState(!1),[a,s]=l().useState({x:0,y:0}),[c,d]=l().useState({x:0,y:0}),[u,m]=l().useState({x:e.x,y:e.y}),g=l().useRef(null),p=(0,i.useCallback)((e=>{r(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),f=l().useCallback((e=>{if(o&&g.current){const t=c.x+(e.clientX-a.x),n=c.y+(e.clientY-a.y);m({x:t,y:n})}}),[a.x,a.y,o,c.x,c.y]),E=(0,i.useCallback)((()=>{r(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return l().useEffect((()=>(document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E)})),[f,E]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},ln=u.default.registry.getLazyComponent("Loader"),on=({name:e,uniqid:t,inplace:n})=>{const i=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetState(e,t))),o=c.x0.definition(e);return(null==i?void 0:i.loading)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement(ln,null)):(null==i?void 0:i.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==i?void 0:i.initialized)&&n||(null==i?void 0:i.initialized)||n?l().createElement(l().Fragment,null):l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,1)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement("img",{src:o.img}))},rn=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:r,width:a,onWidgetUpdate:s,cannotDisplayComponent:u})=>{const m=(0,d.useDispatch)(),g=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),p=(0,d.useSelector)((t=>t.widgets.editableMap[e]),d.shallowEqual),f=(0,d.useSelector)((e=>e.widgets.currentEditableWidgetId),d.shallowEqual),E=(0,d.useSelector)((t=>t.widgets.currentEditableWidgetId===e),d.shallowEqual),{ref:y,isComponentVisible:h,setIsComponentVisible:v}=(0,te.xv)(!1);if((0,i.useEffect)((()=>{t&&m(c.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{n&&m(c.x0.slice.actions.registerWidget({uniqid:e,widget:n}))}),[]),(0,i.useEffect)((()=>{h||e===f&&m(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[h]),(0,i.useEffect)((()=>{h!==E&&v(E)}),[E]),void 0===g)return l().createElement(l().Fragment,null,"This widget cannot be displayed");const b=g.widget,x=()=>{"edit"===r?C():(0,k.ensureWidgetArticleButtonType)(b)&&"link"===b.content.openingType&&b.content.openingTypeLink&&window.open(b.content.openingTypeLink.url,b.content.openingTypeLink.target)},C=()=>{if("view"===r)return;const{widget:e}=g;m(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return o&&"view"!==r?l().createElement(Kt,{ref:y,onClick:()=>{v(!0),p&&(m(c.x0.slice.actions.setEditableIndex({index:p.index})),m(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(Qt,{width:a,widget:Object.assign(Object.assign({},g.widget),g.title&&{title:g.title}),inplace:o,mode:r,onClick:x}),l().createElement(Zt,{uniqid:e,mode:r}),l().createElement(on,{name:g.widget.name,uniqid:g.widget.uniqid,inplace:o})):l().createElement(Kt,{onClick:C},l().createElement(Qt,{widget:Object.assign(Object.assign({},g.widget),g.title&&{title:g.title}),inplace:o,mode:r,width:a,onClick:x,onWidgetUpdate:s,cannotDisplayComponent:u}),l().createElement(Zt,{uniqid:e,mode:r}),l().createElement(on,{name:g.widget.name,uniqid:g.widget.uniqid,inplace:o}))},an=rn,sn=r().div`
|
|
387
396
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
388
397
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
389
398
|
background-color: ${e=>e.theme.color.white};
|
|
390
399
|
overflow: hidden;
|
|
391
|
-
`,
|
|
400
|
+
`,cn=u.default.registry.getLazyComponent("Message"),dn=({widgets:e})=>{const t=(0,a.useIntl)(),n=(0,d.useSelector)(c.x0.selectors.selectFlushedWidgets,d.shallowEqual);return l().createElement(l().Fragment,null,e.filter((e=>!n.includes(e.widget.uniqid))).map((e=>e&&e.widget&&l().createElement(sn,{key:e.widget.uniqid},l().createElement(an,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>l().createElement(cn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))},un=u.default.registry.getLazyComponent("Message"),mn=e=>{const t=(0,a.useIntl)(),{widgets:n,comment:i,inplace:o,mode:r,handleWidgetUpdate:s}=e,u=(0,d.useSelector)(c.x0.selectors.selectFlushedWidgets,d.shallowEqual);return l().createElement(l().Fragment,null,n.filter((e=>!u.includes(e.widget.uniqid))).map((e=>e&&l().createElement(sn,{key:e.widget.uniqid},l().createElement(an,{uniqid:e.widget.uniqid,widgetObject:i,widget:e,inplace:o,mode:r,onWidgetUpdate:s,cannotDisplayComponent:e=>l().createElement(un,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))};var gn=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function a(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}s((i=i.apply(e,t||[])).next())}))};const pn=u.default.registry.getLazyComponent("JRCCommentsBloc"),fn=r().div`
|
|
392
401
|
display: flex;
|
|
393
402
|
flex-direction: column;
|
|
394
403
|
gap: 4px;
|
|
395
404
|
flex: 1;
|
|
396
405
|
width: 100%;
|
|
397
406
|
margin-top: 10px;
|
|
398
|
-
`,
|
|
407
|
+
`,En=({articleId:e,variant:t="inline",canComment:n,commentType:r="comment",socialQuestion:s})=>{var m;const g=(0,a.useIntl)(),p=(0,o.useTheme)(),f=(0,d.useDispatch)(),[E,y]=(0,i.useState)(),[h,v]=(0,i.useState)(!1),[b,x]=(0,i.useState)([]),[C,w]=(0,i.useState)(!1),k=(0,d.useSelector)(c.xJ.selectors.get),W=(0,d.useSelector)(c.x0.selectors.selectWidgets),S=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),L=(0,d.useSelector)(c.sU.selectors.selectTinyMCEExtendedOptions),A=(0,d.useSelector)(c.Kx.selectors.selectAll),T=(0,d.useSelector)(c.OD.selectors.selectPlatformConfig),M=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"OnlyOfficeHook"))),O=(0,d.useSelector)((t=>c.Mw.selectors.commentList(t,e))),_=(0,d.useSelector)((e=>c.qn.selectors.selectHook(e,"DriveHook"))),j=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"FileBankHook"))),z=(0,d.useSelector)((e=>c.qn.selectors.selectHook(e,"WidgetHook"))),[D,R]=(0,i.useState)(s);(0,I.A)(e),((e,t)=>{const n=(0,d.useDispatch)(),l=(0,i.useMemo)((()=>u.default.socket),[]),o=(0,i.useMemo)((()=>c.Mw.getCommentsLikeRTHandlers(n,e,t)),[n,e,t]);(0,i.useEffect)((()=>(o.forEach((e=>{l.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{l.offMessage(e.namespace,e.function,e.handler)}))})),[o,l])})(null==O?void 0:O.list.map((e=>e.id)),e);const F=(0,i.useCallback)((e=>{f(c.y8.actions.error({label:null!=e?e:g.formatMessage({id:"GLOBAL_Error"})}))}),[f,g]),G=()=>{f(c.Mw.actions.fetchComments({idArticle:e})),B()},B=(0,i.useCallback)((()=>{E||C||(w(!0),q().network.token().then((e=>{y(e.result),w(!1),f(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{F(e.errorMsg)})))}),[F,E,C,f]),U=(0,i.useCallback)((t=>gn(void 0,void 0,void 0,(function*(){if(E){v(!0);const n=Object.keys(W).map((e=>(null==b?void 0:b.some((t=>t.widget.uniqid===e)))?W[e]:null)).filter((e=>null!==e));try{yield q().article.addComment(Object.assign(Object.assign({},t),{widgets:n,token:E,idArticle:e,type:r})).then((()=>{x([])})),B()}catch(e){F(e.errorMsg)}finally{v(!1)}}}))),[e,r,B,F,E,W,b]);return(0,i.useEffect)((()=>{B()}),[B]),(0,i.useEffect)((()=>{f(c.Mw.actions.fetchComments({idArticle:e}))}),[e,f]),(0,i.useEffect)((()=>{O&&O.list&&O.list.forEach((e=>{var t;null===(t=e._widgets)||void 0===t||t.forEach((t=>{f(c.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),f(c.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))}))}))}),[O,f]),l().createElement(l().Fragment,null,S&&L&&l().createElement(l().Fragment,null,l().createElement(fn,null,l().createElement(pn,{canComment:n,loading:h,token:E,comments:null==O?void 0:O.list,onComment:U,onCommentUpdate:t=>gn(void 0,void 0,void 0,(function*(){var n,i;const l=null==O?void 0:O.list.find((e=>e.id===t.idComment));if(l)return q().article.updateComment({idComment:t.idComment,description:null!==(i=null!==(n=t.description)&&void 0!==n?n:l.description)&&void 0!==i?i:void 0,token:t.token,widgets:t.widgets}).then((()=>{f(c.Mw.actions.fetchComments({idArticle:e})),B()})).catch((e=>{F(e.errorMsg)}))})),onCommentDelete:e=>gn(void 0,void 0,void 0,(function*(){q().article.deleteComment(e).catch(F)})),isWidgetActive:!!((null==z?void 0:z.isActive)&&(null==z?void 0:z.create)&&(null===(m=null==z?void 0:z.autorize)||void 0===m?void 0:m.includes("comment"))),widgetListComponent:l().createElement(X,{mode:"comment",namespace:"comment",onChange:e=>{x([e]),f(c.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e})),y(void 0),B()},view:"edit"}),newWidgetsWrapperComponent:l().createElement(dn,{widgets:b}),existingWidgetsWrapperComponent:(e,t,n,i=!0)=>l().createElement(mn,{comment:e,widgets:t,mode:n,inplace:i,handleWidgetUpdate:G,handleWidgetRemove:B}),currentUser:k,tinyMCEConfig:{commonOptions:Object.assign(Object.assign({},S),{toolbar:L.commentsToolbar}),mentionsQueries:(0,u.getTinyMCEMentionsQueries)(A,p,F)},onError:F,highlightFields:T.userHighlightFields,userAccountStatus:T.userAccountStatus,userModel:A.find((e=>"user"===e.type)),isWedocActive:!!M,onGetHashError:e=>f(c.y8.actions.error({label:null!=e?e:g.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...j&&_?["fileBank"]:[],...c.qn.utils.buildDrivesArrayFromObject(null==_?void 0:_.drives)],variant:t,handlers:{drive:q().drive,filebank:q().filebank,file:q().file,user:q().user,socialAction:q().socialAction,questionAnswer:q().questionAnswer},socialQuestion:D?Object.assign(Object.assign({},D),{onSelectResponse:e=>{R(Object.assign(Object.assign({},D),{responseId:e,isResolved:!0}))},onUnselectResponse:()=>{R(Object.assign(Object.assign({},D),{responseId:void 0,isResolved:!1}))}}):void 0,articleId:e}),l().createElement($,null))))};var yn=n(749),hn=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]])}return n};const vn=o.css`
|
|
399
408
|
height: 100%;
|
|
400
409
|
display: flex;
|
|
401
410
|
flex-direction: column;
|
|
402
411
|
justify-content: space-between;
|
|
403
|
-
`,
|
|
404
|
-
${({stretch:e})=>e&&
|
|
405
|
-
`,
|
|
406
|
-
${({stretch:e})=>e&&
|
|
407
|
-
`,
|
|
412
|
+
`,bn=r().div`
|
|
413
|
+
${({stretch:e})=>e&&vn}
|
|
414
|
+
`,xn=r().form`
|
|
415
|
+
${({stretch:e})=>e&&vn}
|
|
416
|
+
`,Cn=i.forwardRef(((e,t)=>e.onSubmit?i.createElement(xn,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):i.createElement(bn,{stretch:e.stretch,ref:t},e.children))),wn=r().div`
|
|
408
417
|
${e=>e.stretch&&"\n flex: 1;\n"}
|
|
409
|
-
`,
|
|
418
|
+
`,kn=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,o]=(0,yn.SC)(e.fields,e.type,e.forceMandatory),r=(0,et.useForm)({defaultValues:Object.assign(Object.assign({},o),e.defaultValues),criteriaMode:"all"}),{handleSubmit:a,control:s,reset:c}=r,d=hn(r,["handleSubmit","control","reset"]),u=(0,i.useCallback)((e=>{const t={};return Object.keys(e).forEach((n=>{var i;const o=null===(i=l.find((e=>e.name===n)))||void 0===i?void 0:i.widget;switch(null==o?void 0:o.type){case"audience":t[n]=e[n].map((e=>e.uri)).join(",");break;case"taxonomy":t[n]=e[n].map((e=>e.title)).join(",");break;case"toggle":t[n]=e[n]?"1":"0";break;default:t[n]=e[n]}})),t}),[l]);return i.useImperativeHandle(t,(()=>Object.assign(Object.assign({},d),{handleSubmit:a,control:s,reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),c()},getFormattedValues:()=>u(d.getValues())})),[]),i.createElement(Cn,{stretch:e.stretch,onSubmit:e.onSubmit?a(e.onSubmit):void 0,ref:n},i.createElement(wn,{stretch:e.stretch},l.map((t=>{var{Input:n}=t,l=hn(t,["Input"]);return i.createElement(n,Object.assign({key:l.name,control:s},l,{dataCy:`${e.dataCy}-${l.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(s)),e.buttons)})),qn=(r().div`
|
|
410
419
|
margin-bottom: 24px;
|
|
411
420
|
`,r().div`
|
|
412
421
|
margin-bottom: 4px;
|
|
@@ -418,27 +427,27 @@
|
|
|
418
427
|
flex: 1;
|
|
419
428
|
display: flex;
|
|
420
429
|
overflow: hidden;
|
|
421
|
-
`),
|
|
430
|
+
`),Wn=r().div`
|
|
422
431
|
flex-direction: row;
|
|
423
432
|
display: flex;
|
|
424
433
|
min-height: 60px;
|
|
425
434
|
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
426
|
-
`,
|
|
435
|
+
`,Sn=r().div`
|
|
427
436
|
width: 60px;
|
|
428
437
|
display: flex;
|
|
429
438
|
align-items: center;
|
|
430
439
|
justify-content: center;
|
|
431
|
-
`,
|
|
440
|
+
`,Ln=r().div`
|
|
432
441
|
flex: 1;
|
|
433
442
|
display: flex;
|
|
434
443
|
align-items: center;
|
|
435
444
|
justify-content: center;
|
|
436
|
-
`,
|
|
445
|
+
`,An=r().div`
|
|
437
446
|
position: relative;
|
|
438
447
|
overflow: hidden;
|
|
439
448
|
top: 91px;
|
|
440
449
|
width: ${460}px;
|
|
441
|
-
`,
|
|
450
|
+
`,Tn=r().div`
|
|
442
451
|
position: absolute;
|
|
443
452
|
top: 0;
|
|
444
453
|
${e=>"left"===e.position?"left: 0px;":""}
|
|
@@ -454,7 +463,7 @@
|
|
|
454
463
|
&.animate {
|
|
455
464
|
right: 0px;
|
|
456
465
|
}
|
|
457
|
-
`,
|
|
466
|
+
`,Mn=r().div`
|
|
458
467
|
flex: 1;
|
|
459
468
|
display: flex;
|
|
460
469
|
flex-direction: column;
|
|
@@ -462,25 +471,25 @@
|
|
|
462
471
|
overflow: auto;
|
|
463
472
|
margin-bottom: 12px;
|
|
464
473
|
position: relative;
|
|
465
|
-
`,
|
|
474
|
+
`,On=r().div`
|
|
466
475
|
position: absolute;
|
|
467
476
|
inset: 0;
|
|
468
477
|
background-color: rgba(255, 255, 255, 0.8);
|
|
469
478
|
display: flex;
|
|
470
479
|
align-items: center;
|
|
471
480
|
justify-content: center;
|
|
472
|
-
`,
|
|
481
|
+
`,In=r().div`
|
|
473
482
|
position: absolute;
|
|
474
483
|
inset: 0;
|
|
475
484
|
background-color: ${e=>e.theme.color.white};
|
|
476
485
|
padding: ${e=>e.theme.space.md}px;
|
|
477
|
-
`,
|
|
486
|
+
`,_n=r().div`
|
|
478
487
|
width: ${50}px;
|
|
479
488
|
padding-top: 60px;
|
|
480
489
|
display: flex;
|
|
481
490
|
flex-direction: column;
|
|
482
491
|
border-right: 1px solid ${e=>e.theme.color.grey2};
|
|
483
|
-
`,
|
|
492
|
+
`,jn=r().button`
|
|
484
493
|
border-radius: 4px;
|
|
485
494
|
cursor: pointer;
|
|
486
495
|
height: 42px;
|
|
@@ -493,7 +502,7 @@
|
|
|
493
502
|
&:hover {
|
|
494
503
|
background-color: ${e=>e.theme.color.grey1};
|
|
495
504
|
}
|
|
496
|
-
`,
|
|
505
|
+
`,zn=(r().div`
|
|
497
506
|
display: flex;
|
|
498
507
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
499
508
|
border-radius: ${8}px;
|
|
@@ -511,16 +520,16 @@
|
|
|
511
520
|
background-color: ${e=>e.theme.color.grey0};
|
|
512
521
|
border-radius: 8px;
|
|
513
522
|
margin-bottom: 4px;
|
|
514
|
-
`),
|
|
523
|
+
`),Dn=r().div`
|
|
515
524
|
display: flex;
|
|
516
525
|
flex: 1;
|
|
517
526
|
align-items: center;
|
|
518
|
-
|
|
527
|
+
`,$n=r().div`
|
|
519
528
|
width: 40px;
|
|
520
529
|
display: flex;
|
|
521
530
|
justify-content: center;
|
|
522
531
|
align-items: center;
|
|
523
|
-
|
|
532
|
+
`,Rn=(r().div`
|
|
524
533
|
flex-direction: row;
|
|
525
534
|
display: flex;
|
|
526
535
|
align-items: center;
|
|
@@ -528,23 +537,23 @@
|
|
|
528
537
|
flex: 1;
|
|
529
538
|
display: flex;
|
|
530
539
|
align-items: center;
|
|
531
|
-
`,u.default.registry.getLazyComponent("Button")),Rn=u.default.registry.getLazyComponent("Icon"),Fn=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(qn,null,l().createElement(Wn,null),l().createElement(Sn,null,"Popup"),l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(Rn,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(qn,null,l().createElement($n,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)},Gn=u.default.registry.getLazyComponent("WidgetArticleTitleEditor"),Bn=u.default.registry.getLazyComponent("WidgetArticleTextEditor"),Un=u.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),Hn=u.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),Nn=u.default.registry.getLazyComponent("WidgetArticleSliderEditor"),Pn=u.default.registry.getLazyComponent("WidgetArticleImageEditor"),Jn=u.default.registry.getLazyComponent("WidgetButtonEditor"),Vn=u.default.registry.getLazyComponent("WidgetCheckListEditor"),Qn=u.default.registry.getLazyComponent("WidgetQuickSurveyEditor"),Kn=u.default.registry.getLazyComponent("WidgetDatasourceTableEditor"),Yn=u.default.registry.getLazyComponent("WidgetExcelDatasourceTableEditor"),Xn=u.default.registry.getLazyComponent("WidgetPresenceEditor"),Zn=({uniqid:e})=>{var t,n,i,o,r;const a=(0,d.useDispatch)(),s=(0,d.useSelector)(c.x0.selectors.selectToken),m=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),g=(0,d.useSelector)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),d.shallowEqual),p=e=>{var t;return null===(t=c.qn.selectors.selectHook(u.default.store.getState(),e))||void 0===t?void 0:t.isActive},f=t=>{m&&a(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),a(c.cr.slice.actions.flushEditor({uniqid:e})),g&&g(t)},E=(t,n)=>{a(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},y=t=>{a(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},h=null==m?void 0:m.widget;return h?(0,k.ensureWidgetArticleButtonType)(h)?l().createElement(Jn,Object.assign({},h.content,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:()=>f({})})):(0,k.ensureWidgetArticleGalleryType)(h)?l().createElement(Un,{token:s,content:h.content,onChange:t=>a((0,c.vR)(e,t,!1)),onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleAttachmentType)(h)?l().createElement(Hn,{token:s,content:h.content,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E,onOpen:y}):(0,k.ensureWidgetArticleImageType)(h)?l().createElement(Pn,{content:h.content,token:s,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleSliderType)(h)?void 0!==s?l().createElement(Nn,{slides:null!==(t=h.content.slides)&&void 0!==t?t:[],loop:null!==(n=h.content.loop)&&void 0!==n&&n,useDots:null===(i=h.content.useDots)||void 0===i||i,onChange:t=>{a((0,c.vR)(e,t,!1))},token:s,onSave:f}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(h)?l().createElement(Gn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content,onOpen:y}):(0,k.ensureWidgetArticleTextType)(h)?l().createElement(Bn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content}):(0,k.ensureWidgetPresenceType)(h)?l().createElement(Xn,Object.assign({onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E},h.content)):(0,k.ensureWidgetCheckListType)(h)?l().createElement(Vn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(h)?l().createElement(Qn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(h)?l().createElement(Yn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(o=h.content.limit)&&void 0!==o?o:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,filebank:q().filebank,wedoc:q().wedoc},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>a(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetDatasourceTableType)(h)?l().createElement(Kn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(r=h.content.limit)&&void 0!==r?r:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,application:q().application,filebank:q().filebank},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>{a(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},ei=u.default.registry.getLazyComponent("Icon"),ti=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ei,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},ni=u.default.registry.getLazyComponent("BETA_DragAndDrop"),ii=u.default.registry.getLazyComponent("Icon"),li=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,a.useIntl)(),o=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,r=(null==o?void 0:o.content)&&"widgets"in o.content&&o.content.widgets?o.content.widgets:[];return l().createElement("div",{style:{flex:1}},l().createElement(oi,{uniqid:e}),o?r.map(((t,a)=>{const s=c.x0.definition(t.widget.name);return l().createElement("div",{key:a},l().createElement(jn,null,l().createElement(zn,{onClick:()=>((e,t)=>{n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(t.widget.uniqid,t.widget.name)},i.formatMessage({id:s.label})),l().createElement(Dn,{onClick:()=>{n(c.x0.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},o.content),{widgets:[...r.filter(((e,t)=>t!==a)).map((e=>((0,k.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(ii,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},oi=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(ni,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(ci,{uniqid:e,key:t}),elms:n||[]}),l().createElement(X,{namespace:"default",onChange:n=>{t(c.x0.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},ri=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(ii,{name:n.locked?"icon-lock":"icon-unlock"}))},ai=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(ii,{name:n.visible?"icon-eye":"icon-eye-slash"}))},si=({uniqid:e,layerId:t})=>{const n=(0,d.useDispatch)();return l().createElement("div",{onClick:()=>{n(c.x0.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(ii,{name:"icon-trash"}))},ci=({uniqid:e})=>{const t=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=c.x0.definition(n.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:i},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(ri,{uniqid:e}),l().createElement(ai,{uniqid:e}),l().createElement(si,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},di=u.default.registry.getLazyComponent("InputText"),ui=({uniqid:e})=>{var t;const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),{control:r,watch:s}=(0,et.useForm)({defaultValues:{text:null!==(t=null==o?void 0:o.title.replace(/&/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});return l().useEffect((()=>{const t=s((t=>{i(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[s,e,i]),o?l().createElement(di,{name:"text",width:"100%",control:r,placeholder:n.formatMessage({id:"WIDGET_Title"})}):l().createElement(l().Fragment,null)},mi=u.default.registry.getLazyComponent("Loader"),gi=({uniqid:e})=>{var t;const n=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(Mn,null,l().createElement(mi,{size:"l"})))},pi=({uniqid:e,children:t})=>{var n;return(null===(n=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e))))||void 0===n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},fi=({uniqid:e})=>{var t;const n=(0,a.useIntl)();return(null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(On,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Ei=u.default.registry.getLazyComponent("Button"),yi=({uniqid:e,mode:t})=>{const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),r=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),d.shallowEqual);return l().createElement(Ei,{onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;r&&o&&l&&("view"==t&&q().widget.updateWidget({uri:r,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},hi=u.default.registry.getLazyComponent("Icon"),vi=["widget-presence","widget-quick-survey","widget-check-list"],bi=({uniqid:e,position:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),r=(0,i.useRef)(null),s=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)),d.shallowEqual),u=c.x0.definition(null==s?void 0:s.name),[m,g]=l().useState("default");return(0,i.useEffect)((()=>{setTimeout((()=>{r&&r.current&&(r.current.className=r.current.className+" animate")}),0)}),[]),s?l().createElement(Ln,null,l().createElement(An,{ref:r,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement(In,null,u.panel.useWrapper?l().createElement(_n,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(hi,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(_n,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(hi,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(pi,{uniqid:e},l().createElement(_n,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(hi,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(qn,null,l().createElement(ti,{uniqid:e,position:s.position}),l().createElement(Sn,null,n.formatMessage({id:u.label})),l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{o(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(hi,{name:"icon-times",color:"grey2"})))),l().createElement(Tn,null,"default"===m&&u.panel.useEditor?l().createElement(Zn,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(ui,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(li,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(gi,{uniqid:e}),l().createElement(fi,{uniqid:e}),vi.includes(s.name)&&l().createElement(yi,{uniqid:e,mode:s.mode})))),(null==s?void 0:s.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},xi=r().div`
|
|
540
|
+
`,u.default.registry.getLazyComponent("Button")),Fn=u.default.registry.getLazyComponent("Icon"),Gn=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(Wn,null,l().createElement(Sn,null),l().createElement(Ln,null,"Popup"),l().createElement(Sn,null,l().createElement(jn,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(Fn,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(Wn,null,l().createElement(Rn,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)},Bn=u.default.registry.getLazyComponent("WidgetArticleTitleEditor"),Un=u.default.registry.getLazyComponent("WidgetArticleTextEditor"),Hn=u.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),Nn=u.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),Pn=u.default.registry.getLazyComponent("WidgetArticleSliderEditor"),Jn=u.default.registry.getLazyComponent("WidgetArticleImageEditor"),Vn=u.default.registry.getLazyComponent("WidgetButtonEditor"),Qn=u.default.registry.getLazyComponent("WidgetCheckListEditor"),Kn=u.default.registry.getLazyComponent("WidgetQuickSurveyEditor"),Yn=u.default.registry.getLazyComponent("WidgetDatasourceTableEditor"),Xn=u.default.registry.getLazyComponent("WidgetExcelDatasourceTableEditor"),Zn=u.default.registry.getLazyComponent("WidgetPresenceEditor"),ei=({uniqid:e})=>{var t,n,i,o,r;const a=(0,d.useDispatch)(),s=(0,d.useSelector)(c.x0.selectors.selectToken),m=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),g=(0,d.useSelector)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),d.shallowEqual),p=e=>{var t;return null===(t=c.qn.selectors.selectHook(u.default.store.getState(),e))||void 0===t?void 0:t.isActive},f=t=>{m&&a(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),a(c.cr.slice.actions.flushEditor({uniqid:e})),g&&g(t)},E=(t,n)=>{a(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},y=t=>{a(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},h=null==m?void 0:m.widget;return h?(0,k.ensureWidgetArticleButtonType)(h)?l().createElement(Vn,Object.assign({},h.content,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:()=>f({})})):(0,k.ensureWidgetArticleGalleryType)(h)?l().createElement(Hn,{token:s,content:h.content,onChange:t=>a((0,c.vR)(e,t,!1)),onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleAttachmentType)(h)?l().createElement(Nn,{token:s,content:h.content,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E,onOpen:y}):(0,k.ensureWidgetArticleImageType)(h)?l().createElement(Jn,{content:h.content,token:s,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleSliderType)(h)?void 0!==s?l().createElement(Pn,{slides:null!==(t=h.content.slides)&&void 0!==t?t:[],loop:null!==(n=h.content.loop)&&void 0!==n&&n,useDots:null===(i=h.content.useDots)||void 0===i||i,onChange:t=>{a((0,c.vR)(e,t,!1))},token:s,onSave:f}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(h)?l().createElement(Bn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content,onOpen:y}):(0,k.ensureWidgetArticleTextType)(h)?l().createElement(Un,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content}):(0,k.ensureWidgetPresenceType)(h)?l().createElement(Zn,Object.assign({onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E},h.content)):(0,k.ensureWidgetCheckListType)(h)?l().createElement(Qn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(h)?l().createElement(Kn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(h)?l().createElement(Xn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(o=h.content.limit)&&void 0!==o?o:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,filebank:q().filebank,wedoc:q().wedoc},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>a(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetDatasourceTableType)(h)?l().createElement(Yn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(r=h.content.limit)&&void 0!==r?r:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,application:q().application,filebank:q().filebank},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>{a(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},ti=u.default.registry.getLazyComponent("Icon"),ni=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(Sn,null,l().createElement(jn,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ti,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},ii=u.default.registry.getLazyComponent("BETA_DragAndDrop"),li=u.default.registry.getLazyComponent("Icon"),oi=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,a.useIntl)(),o=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,r=(null==o?void 0:o.content)&&"widgets"in o.content&&o.content.widgets?o.content.widgets:[];return l().createElement("div",{style:{flex:1}},l().createElement(ri,{uniqid:e}),o?r.map(((t,a)=>{const s=c.x0.definition(t.widget.name);return l().createElement("div",{key:a},l().createElement(zn,null,l().createElement(Dn,{onClick:()=>((e,t)=>{n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(t.widget.uniqid,t.widget.name)},i.formatMessage({id:s.label})),l().createElement($n,{onClick:()=>{n(c.x0.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},o.content),{widgets:[...r.filter(((e,t)=>t!==a)).map((e=>((0,k.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(li,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},ri=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(ii,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(di,{uniqid:e,key:t}),elms:n||[]}),l().createElement(X,{namespace:"default",onChange:n=>{t(c.x0.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},ai=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(li,{name:n.locked?"icon-lock":"icon-unlock"}))},si=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(li,{name:n.visible?"icon-eye":"icon-eye-slash"}))},ci=({uniqid:e,layerId:t})=>{const n=(0,d.useDispatch)();return l().createElement("div",{onClick:()=>{n(c.x0.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(li,{name:"icon-trash"}))},di=({uniqid:e})=>{const t=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=c.x0.definition(n.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:i},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(ai,{uniqid:e}),l().createElement(si,{uniqid:e}),l().createElement(ci,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},ui=u.default.registry.getLazyComponent("InputText"),mi=({uniqid:e})=>{var t;const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),{control:r,watch:s}=(0,et.useForm)({defaultValues:{text:null!==(t=null==o?void 0:o.title.replace(/&/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});return l().useEffect((()=>{const t=s((t=>{i(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[s,e,i]),o?l().createElement(ui,{name:"text",width:"100%",control:r,placeholder:n.formatMessage({id:"WIDGET_Title"})}):l().createElement(l().Fragment,null)},gi=u.default.registry.getLazyComponent("Loader"),pi=({uniqid:e})=>{var t;const n=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(On,null,l().createElement(gi,{size:"l"})))},fi=({uniqid:e,children:t})=>{var n;return(null===(n=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e))))||void 0===n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},Ei=({uniqid:e})=>{var t;const n=(0,a.useIntl)();return(null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(In,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},yi=u.default.registry.getLazyComponent("Button"),hi=({uniqid:e,mode:t})=>{const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),r=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),d.shallowEqual);return l().createElement(yi,{onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;r&&o&&l&&("view"==t&&q().widget.updateWidget({uri:r,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},vi=u.default.registry.getLazyComponent("Icon"),bi=["widget-presence","widget-quick-survey","widget-check-list"],xi=({uniqid:e,position:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),r=(0,i.useRef)(null),s=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)),d.shallowEqual),u=c.x0.definition(null==s?void 0:s.name),[m,g]=l().useState("default");return(0,i.useEffect)((()=>{setTimeout((()=>{r&&r.current&&(r.current.className=r.current.className+" animate")}),0)}),[]),s?l().createElement(An,null,l().createElement(Tn,{ref:r,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement(_n,null,u.panel.useWrapper?l().createElement(jn,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(vi,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(jn,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(vi,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(fi,{uniqid:e},l().createElement(jn,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(vi,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(Wn,null,l().createElement(ni,{uniqid:e,position:s.position}),l().createElement(Ln,null,n.formatMessage({id:u.label})),l().createElement(Sn,null,l().createElement(jn,{onClick:()=>{o(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(vi,{name:"icon-times",color:"grey2"})))),l().createElement(Mn,null,"default"===m&&u.panel.useEditor?l().createElement(ei,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(mi,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(oi,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(pi,{uniqid:e}),l().createElement(Ei,{uniqid:e}),bi.includes(s.name)&&l().createElement(hi,{uniqid:e,mode:s.mode})))),(null==s?void 0:s.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},Ci=r().div`
|
|
532
541
|
position: absolute;
|
|
533
542
|
inset: 0;
|
|
534
543
|
pointer-events: none;
|
|
535
544
|
z-index: 1;
|
|
536
|
-
`,
|
|
545
|
+
`,wi=r().div`
|
|
537
546
|
flex: 1;
|
|
538
547
|
display: flex;
|
|
539
548
|
margintop: ${90}px;
|
|
540
549
|
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
541
|
-
`,
|
|
550
|
+
`,ki=r().div`
|
|
542
551
|
flex: 1;
|
|
543
552
|
display: flex;
|
|
544
553
|
flex-direction: row;
|
|
545
554
|
pointer-events: none;
|
|
546
|
-
`,
|
|
555
|
+
`,qi=r().div`
|
|
547
556
|
width: ${440}px;
|
|
548
557
|
pointer-events: none;
|
|
549
|
-
`,
|
|
558
|
+
`,Wi=()=>{const e=(0,d.useSelector)(c.cr.selectors.selectEditors,d.shallowEqual);return l().createElement(Ci,{className:"editor-portal-wrapper"},e.map(((e,t)=>"left"===e.position?l().createElement(qn,{isActive:!1,key:t},l().createElement(ki,null,l().createElement(xi,{uniqid:e.uniqid,position:e.position}),l().createElement(wi,{isActive:void 0!==e.popup},l().createElement(Gn,{uniqid:e.uniqid})),l().createElement(qi,null))):l().createElement(qn,{isActive:!1,key:t},l().createElement(ki,null,l().createElement(qi,null),l().createElement(wi,{isActive:void 0!==e.popup},l().createElement(Gn,{uniqid:e.uniqid})),l().createElement(xi,{uniqid:e.uniqid,position:e.position}))))))},Si=()=>i.createElement(i.Fragment,null),Li=()=>{const[e,t]=(0,i.useState)(),n=(0,a.useIntl)(),l=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),o=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{l({reject:i,resolve:n,text:e,capability:t})}))),[l]),r=(0,i.useMemo)((()=>({develop:e=>o(e,"develop"),summarize:e=>o(e,"summarize"),tldr:e=>o(e,"tldr"),en:e=>o(e,"en"),es:e=>o(e,"es"),formal:e=>o(e,"formal"),funny:e=>o(e,"funny")})),[o]);return[e,(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(r,n)),[n,r])]},Ai=u.default.registry.getLazyComponent("InputTinyMCE"),Ti=e=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),r=(0,o.useTheme)(),s=(0,d.useSelector)(c.Kx.selectors.selectAll),[m,g]=Li(),p=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),f=(0,i.useMemo)((()=>p?[g]:[]),[g,p]),E=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),y=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(s,r,E)),[s,E,r]),h=(0,i.useMemo)((()=>u.default.tinymceCommonOptions),[]);return l().createElement(l().Fragment,null,h&&l().createElement(Ai,Object.assign({commonOptions:h,additionalExtensions:f,mentionsQueries:y},e)),l().createElement(O,{query:m}))},Mi=u.default.registry.getLazyComponent("InputTinyMCERaw"),Oi=e=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),r=(0,o.useTheme)(),s=(0,d.useSelector)(c.Kx.selectors.selectAll),[m,g]=Li(),p=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),f=(0,i.useMemo)((()=>p?[g]:[]),[g,p]),E=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),y=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(s,r,E)),[s,E,r]),h=(0,i.useMemo)((()=>u.default.tinymceCommonOptions),[]);return l().createElement(l().Fragment,null,h&&l().createElement(Mi,Object.assign({commonOptions:h,additionalExtensions:f,mentionsQueries:y},e)),l().createElement(O,{query:m}))},Ii=u.default.registry.getLazyComponent("InputAudience"),_i=u.default.registry.getLazyComponent("Message"),ji=u.default.registry.getLazyComponent("Modal"),zi=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:r,name:s="publishTo"})=>{const u=(0,a.useIntl)(),m=(0,d.useSelector)(c.Bx.selectors.selectNetworkPublic);return l().createElement(ji,{open:e,closeHandler:t,title:null!=n?n:u.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),r()}}]},l().createElement(_i,{variant:"warning",message:null!=o?o:u.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(Ii,{asyncPromise:e=>q().audience.autocomplete(e),searchable:!0,control:i,multiple:!0,placeholder:u.formatMessage({id:"GLOBAL_Audience"}),name:s,defaultCustomOptions:m?[{uri:m.uri,title:m.title,resetOptions:!0,icon:"icon-fs-wall"}]:[]}))};var Di=n(118);const $i=u.default.registry.getLazyComponent("Container"),Ri=u.default.registry.getLazyComponent("AppColumn"),Fi=u.default.registry.getLazyComponent("MainColumn");function Gi({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const r=(0,a.useIntl)(),{pathname:s}=(0,Di.useLocation)(),c=(0,i.useMemo)((()=>Object.values(t)),[t]),[d,u]=i.useState(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.key),m=c.map((t=>Object.assign(Object.assign({},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 i.useEffect((()=>{const t=c.find((t=>{var n;return`/ng/rr/${e}/${t.path}`===s||(null===(n=t.paths)||void 0===n?void 0:n.reduce(((t,n)=>{const i=`/ng/rr/${e}/${n}`,l=null!==(0,Di.matchPath)(i,s);return t||l}),!1))}));t&&u(t.key)}),[s,c,e]),i.createElement(i.Suspense,{fallback:i.createElement(i.Fragment,null)},i.createElement($i,{mode:l},i.createElement(Ri,{mode:l,description:n,tabs:m,activeTab:d||""}),i.createElement(Fi,{mode:l,flex:!0},i.createElement(Di.Outlet,null))))}}}]);
|
|
550
559
|
//# sourceMappingURL=235.bundle.js.map
|