jamespot-react-core 1.1.182 → 1.1.183
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/{201.bundle.js → 201.566cb5eca92385626a48.chunk.js} +1 -1
- package/build/201.566cb5eca92385626a48.chunk.js.map +1 -0
- package/build/{724.bundle.js → 724.4e810912c9eacc41e4bb.chunk.js} +23 -23
- package/build/724.4e810912c9eacc41e4bb.chunk.js.map +1 -0
- package/build/app.bundle.js +410 -408
- package/build/app.bundle.js.map +1 -1
- package/package.json +2 -2
- package/build/201.bundle.js.map +0 -1
- package/build/724.bundle.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[724],{724:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>T,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>qn,DisplayForm:()=>In,EditorsPortal:()=>
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[724],{724:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>T,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>qn,DisplayForm:()=>In,EditorsPortal:()=>Di,Empty:()=>zi,JRCInputTinyMCEWithExt:()=>Gi,JRCInputTinyMCEWithExtRaw:()=>Ui,MarkdownModal:()=>Fe,ModalAudience:()=>Vi,TwoColLayout:()=>Yi,WidgetList:()=>Z,WidgetWrapperCore:()=>pn});var i=n(594),l=n.n(i),o=n(196),a=n.n(o),r=n(493),s=n(137),c=n(939),d=n(704),u=n(455);const m=u.O.getLazyComponent("JRCAvatar"),g=u.O.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))},E=u.O.getLazyComponent("FlexBox"),f=u.O.getLazyComponent("ModalContent"),h=u.O.getLazyComponent("ModalLayout"),y=u.O.getLazyComponent("StyledHref"),v=u.O.getLazyComponent("Tooltip"),b=u.O.getLazyComponent("Typography"),x=a().div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
border: 4px solid ${e=>e.theme.color.white};
|
|
18
18
|
margin-left: ${e=>e.overlap?"-18px":"0"};
|
|
19
19
|
cursor: pointer;
|
|
20
|
-
`,w=({audience:e,limit:t=2})=>{const n=(0,r.useIntl)(),a=(0,o.useTheme)(),[c,d]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(E,null,[...e].splice(0,t).map(((e,t)=>l().createElement(C,{overlap:0!==t,href:e._url,target:"_blank",key:e.id},l().createElement(v,{description:void 0===e.title?" ":e.title,position:"left"},l().createElement(p,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?s.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0}))))),e.length>t&&l().createElement(C,{onClick:()=>d(!0),overlap:!0},"+",e.length-t)),e.length>t&&l().createElement(h,{closeHandler:()=>d(!1),enableClickAwayCloseModal:!0,open:c,variant:"fixed-height",maxHeight:"800px"},l().createElement(f,{title:n.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>d(!1)},l().createElement(
|
|
20
|
+
`,w=({audience:e,limit:t=2})=>{const n=(0,r.useIntl)(),a=(0,o.useTheme)(),[c,d]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(E,null,[...e].splice(0,t).map(((e,t)=>l().createElement(C,{overlap:0!==t,href:e._url,target:"_blank",key:e.id},l().createElement(v,{description:void 0===e.title?" ":e.title,position:"left"},l().createElement(p,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?s.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0}))))),e.length>t&&l().createElement(C,{onClick:()=>d(!0),overlap:!0},"+",e.length-t)),e.length>t&&l().createElement(h,{closeHandler:()=>d(!1),enableClickAwayCloseModal:!0,open:c,variant:"fixed-height",maxHeight:"800px"},l().createElement(f,{title:n.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>d(!1)},l().createElement(x,null,e.map(((e,t)=>l().createElement(E,{key:`audience-${t}`,y:"center",gap:a.space.l},l().createElement(p,{size:5,uri:`${e.type}/${e.id}`}),l().createElement(y,{href:`${e.type}/${e.id}`},l().createElement(b,null,e.title)))))))))};var k=n(833),q=n.n(k);const O=u.O.getLazyComponent("Loader"),W=u.O.getLazyComponent("ModalContent"),S=u.O.getLazyComponent("ModalLayout"),L=u.O.getLazyComponent("Typography"),A=a().div`
|
|
21
21
|
padding: ${e=>e.theme.space.md}px;
|
|
22
|
-
`,M={response:void 0,loading:!0,error:void 0},T=({query:e})=>{const t=(0,r.useIntl)(),[n,a]=(0,i.useState)(M),s=(0,o.useTheme)(),c=(0,i.useCallback)((e=>{a(M),q().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void a({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const n=e.result.text;a({error:void 0,loading:!1,response:n})})).catch((e=>{a({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[t]);return(0,i.useEffect)((()=>{e&&e.text.trim().length>0&&c(e)}),[e,c]),l().createElement(S,{zIndex:s.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{null==e||e.reject()}},l().createElement(
|
|
22
|
+
`,M={response:void 0,loading:!0,error:void 0},T=({query:e})=>{const t=(0,r.useIntl)(),[n,a]=(0,i.useState)(M),s=(0,o.useTheme)(),c=(0,i.useCallback)((e=>{a(M),q().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void a({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const n=e.result.text;a({error:void 0,loading:!1,response:n})})).catch((e=>{a({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[t]);return(0,i.useEffect)((()=>{e&&e.text.trim().length>0&&c(e)}),[e,c]),l().createElement(S,{zIndex:s.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{null==e||e.reject()}},l().createElement(W,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&c(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>n.response&&(null==e?void 0:e.resolve(n.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}],isFull:!0},l().createElement(A,null,n.loading&&l().createElement(l().Fragment,null,l().createElement(O,null),l().createElement(L,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!n.loading&&n.error&&l().createElement("p",null,n.error),!n.loading&&n.response&&l().createElement("p",null,n.response))))};var I=n(690),_=n(746);var j=n(206),D=n(743);const z=u.O.getLazyComponent("EditorsPortal"),$=u.O.getLazyComponent("ThemeProvider"),R=()=>{const e=document.getElementById("react-portals"),t=(0,i.useMemo)((()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=(0,D.A)(),e.appendChild(t)),t})(e)),[e]);return t?(0,j.createPortal)(l().createElement($,null,l().createElement(z,null)),t):null},F=a().div`
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: row;
|
|
25
25
|
flex-wrap: wrap;
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
align-items: center;
|
|
126
126
|
`,pe=({widget:e,mode:t})=>{const n=(0,d.useDispatch)(),{uniqid:o}=e,{text:a,url:r,target:s,color:u,backgroundColor:m,buttonSize:g,borderRadius:p,variant:E}=e.content;return(0,i.useEffect)((()=>{n(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!a||0===a.length}))}),[a]),l().createElement(me,{onClick:()=>{"edit"===t&&n(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}},l().createElement(ge,{clickable:"edit"!==t},l().createElement(ue,{text:a,url:r,target:s,color:u,backgroundColor:m,buttonSize:g,borderRadius:p,variant:E})))},Ee=u.O.getLazyComponent("WidgetArticleGallery"),fe=u.O.getLazyComponent("WidgetEmptyInplace"),he=u.O.getLazyComponent("FileViewer"),ye=a().button`
|
|
127
127
|
cursor: pointer;
|
|
128
|
-
`,ve=({widget:e,inplace:t,mode:n})=>{var i,o;const{uniqid:a}=e,{files:r}=e.content,s=(0,d.useDispatch)(),u=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,a)),d.shallowEqual);return l().useEffect((()=>{s(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),void 0!==r?l().createElement(l().Fragment,null,"edit"===n?l().createElement(Ee,{files:r,maxWidth:800,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(o=e.content.column)&&void 0!==o?o:"3",onClick:()=>{}}):l().createElement(he,{files:r,openWithOptions:[]},(t=>{var n,i;return l().createElement(ye,null,l().createElement(Ee,{files:r,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)}))})),t&&"edit"===n?l().createElement(oe,{initialFiles:r,initialClick:u,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&s((0,c.vR)(a,{files:e}))},onUploadStart:()=>{s(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{s(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},l().createElement(fe,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},
|
|
128
|
+
`,ve=({widget:e,inplace:t,mode:n})=>{var i,o;const{uniqid:a}=e,{files:r}=e.content,s=(0,d.useDispatch)(),u=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,a)),d.shallowEqual);return l().useEffect((()=>{s(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),void 0!==r?l().createElement(l().Fragment,null,"edit"===n?l().createElement(Ee,{files:r,maxWidth:800,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(o=e.content.column)&&void 0!==o?o:"3",onClick:()=>{}}):l().createElement(he,{files:r,openWithOptions:[]},(t=>{var n,i;return l().createElement(ye,null,l().createElement(Ee,{files:r,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)}))})),t&&"edit"===n?l().createElement(oe,{initialFiles:r,initialClick:u,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&s((0,c.vR)(a,{files:e}))},onUploadStart:()=>{s(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{s(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},l().createElement(fe,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},be=u.O.getLazyComponent("WidgetImage"),xe=u.O.getLazyComponent("FileViewer"),Ce=u.O.getLazyComponent("WidgetEmptyInplace"),we=a().div`
|
|
129
129
|
position: absolute;
|
|
130
130
|
inset: 0;
|
|
131
131
|
background-color: rgba(0, 0, 0, 0.4);
|
|
@@ -140,14 +140,14 @@
|
|
|
140
140
|
}
|
|
141
141
|
`,ke=a().button`
|
|
142
142
|
cursor: pointer;
|
|
143
|
-
`,qe={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},
|
|
143
|
+
`,qe={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},Oe=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},We=({widget:e,width:t,inplace:n,mode:o})=>{const{uniqid:a}=e,{file:s,useFilter:u}=e.content,m=(0,d.useDispatch)(),g=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,a)),d.shallowEqual),[p,E]=(0,i.useState)(void 0),f=(0,r.useIntl)();return(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,empty:!s}))}),[s]),(0,i.useEffect)((()=>{s&&E((0,k.formatImgUrl)({timestamp:s.dateModified?Oe(s.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:s.uri}))}),[s]),l().createElement(l().Fragment,null,"edit"===o?void 0!==p?l().createElement(be,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=u&&u}):l().createElement(l().Fragment,null):l().createElement(xe,{files:[Object.assign(Object.assign({},qe),{path:p,mimetype:"image/png"})],openWithOptions:[]},(e=>l().createElement(ke,{onClick:()=>e(0)},l().createElement(be,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=u&&u})))),n&&"edit"===o?l().createElement(oe,{initialFiles:[],initialClick:g,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&m((0,c.vR)(a,{file:e[0]}))},onUploadStart:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},void 0!==s?l().createElement(we,null,f.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(Ce,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null))};var Se=n(750);const Le=u.O.getLazyComponent("FileViewer"),Ae=u.O.getLazyComponent("WidgetEmptyInplace"),Me=u.O.getLazyComponent("WidgetSlider"),Te=a().div`
|
|
144
144
|
flex: 1;
|
|
145
145
|
display: flex;
|
|
146
146
|
flex-direction: row;
|
|
147
147
|
min-height: 60px;
|
|
148
148
|
align-items: center;
|
|
149
149
|
width: ${e=>e.maxWidth}px;
|
|
150
|
-
`,Ie={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},_e=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},je=({widget:e,mode:t,width:n})=>{const{uniqid:o}=e,a=(0,Se.jL)(),r=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,o)),d.shallowEqual),s=null!=n?n:600,[u,m]=(0,i.useState)(void 0),g=(0,i.useRef)(null),p=(0,i.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},Ie),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Ie.mimetype,path:(0,k.formatImgUrl)({size:"fitx1200",uri:e.file?e.file.uri:"",from:"imagecache",timestamp:e.file&&e.file.dateModified?_e(e.file.dateModified):Date.now()})})))]:[]),[e.content.slides]),E=(0,i.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,k.formatImgUrl)({timestamp:e.file.dateModified?_e(e.file.dateModified):Date.now(),size:`fitx${u&&u<s?u:s}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,u,s]);(0,i.useEffect)((()=>{r&&"edit"===t&&a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}),[r]),(0,i.useEffect)((()=>{const e=()=>{g.current&&m(g.current?g.current.offsetWidth:s)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[g]),(0,i.useEffect)((()=>{m(g.current?g.current.offsetWidth:s)}),[g]),(0,i.useEffect)((()=>{a(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const f=(0,i.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),h=(0,i.useCallback)((()=>{a(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[a,e.uniqid,e.name]);return void 0===u?l().createElement("div",{ref:g,style:{width:"100%"}}):l().createElement(Te,{maxWidth:u&&u<s?u:s},l().createElement(Le,{files:p,openWithOptions:[]},(n=>{var i,r;return l().createElement(Me,{slides:E,maxWidth:u&&u<s?u:s,useDots:null===(i=e.content.useDots)||void 0===i||i,loop:null!==(r=e.content.loop)&&void 0!==r&&r,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&n(t.file.id)}}else a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}})})),f?l().createElement(Ae,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:h}):l().createElement(l().Fragment,null))};var
|
|
150
|
+
`,Ie={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},_e=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},je=({widget:e,mode:t,width:n})=>{const{uniqid:o}=e,a=(0,Se.jL)(),r=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,o)),d.shallowEqual),s=null!=n?n:600,[u,m]=(0,i.useState)(void 0),g=(0,i.useRef)(null),p=(0,i.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},Ie),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Ie.mimetype,path:(0,k.formatImgUrl)({size:"fitx1200",uri:e.file?e.file.uri:"",from:"imagecache",timestamp:e.file&&e.file.dateModified?_e(e.file.dateModified):Date.now()})})))]:[]),[e.content.slides]),E=(0,i.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,k.formatImgUrl)({timestamp:e.file.dateModified?_e(e.file.dateModified):Date.now(),size:`fitx${u&&u<s?u:s}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,u,s]);(0,i.useEffect)((()=>{r&&"edit"===t&&a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}),[r]),(0,i.useEffect)((()=>{const e=()=>{g.current&&m(g.current?g.current.offsetWidth:s)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[g]),(0,i.useEffect)((()=>{m(g.current?g.current.offsetWidth:s)}),[g]),(0,i.useEffect)((()=>{a(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const f=(0,i.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),h=(0,i.useCallback)((()=>{a(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[a,e.uniqid,e.name]);return void 0===u?l().createElement("div",{ref:g,style:{width:"100%"}}):l().createElement(Te,{maxWidth:u&&u<s?u:s},l().createElement(Le,{files:p,openWithOptions:[]},(n=>{var i,r;return l().createElement(Me,{slides:E,maxWidth:u&&u<s?u:s,useDots:null===(i=e.content.useDots)||void 0===i||i,loop:null!==(r=e.content.loop)&&void 0!==r&&r,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&n(t.file.id)}}else a(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}})})),f?l().createElement(Ae,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:h}):l().createElement(l().Fragment,null))};var De=n(912),ze=n(201);const $e=u.O.getLazyComponent("InputTextareaRaw"),Re=u.O.getLazyComponent("Modal"),Fe=({onInsert:e,open:t,close:n})=>{const o=(0,r.useIntl)(),[a,s]=l().useState(""),c=(0,i.useCallback)((()=>{s(""),n()}),[n]);return l().createElement(Re,{title:o.formatMessage({id:"TINY_MCE_Insert_Markdown"}),open:t,closeHandler:c,enableClickAwayCloseModal:!0,buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:c},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Insert"}),color:"valid",disabled:!a,clickHandler:()=>{e(ze.xI.parse(a,{async:!1}).replace(/<br>/g,"<br><br>")),c()}}]},l().createElement($e,{value:a,onChange:e=>s(e.target.value),height:"400px"}))},Ge=()=>{const e=(0,r.useIntl)(),[t,n]=(0,i.useState)(!1),[l,o]=(0,i.useState)();return{open:t,onInsert:e=>{null==l||l.execCommand("InsertHTML",!1,e)},close:()=>n(!1),ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.markdown((e=>{o(e),n(!0)}),e)),[e]),isActive:!0}},Be=De.default.registry.getLazyComponent("WidgetArticleText"),Ue=a().div`
|
|
151
151
|
width: 100%;
|
|
152
152
|
cursor: text;
|
|
153
153
|
p {
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
a {
|
|
157
157
|
word-wrap: break-word;
|
|
158
158
|
}
|
|
159
|
-
`,He=({widget:e,mode:t})=>{const{uniqid:n}=e,a=(0,o.useTheme)(),{text:s}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,n)),d.shallowEqual),g=(0,d.useSelector)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),p=(0,d.useSelector)(c.x0.selectors.selectToken),E=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),f=(0,d.useSelector)(c.Kx.selectors.selectAll),h=(0,r.useIntl)(),{open:y,onInsert:v,close:
|
|
159
|
+
`,He=({widget:e,mode:t})=>{const{uniqid:n}=e,a=(0,o.useTheme)(),{text:s}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,n)),d.shallowEqual),g=(0,d.useSelector)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),p=(0,d.useSelector)(c.x0.selectors.selectToken),E=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),f=(0,d.useSelector)(c.Kx.selectors.selectAll),h=(0,r.useIntl)(),{open:y,onInsert:v,close:b,ext:x,isActive:C}=Ge(),w=(0,i.useCallback)((e=>{u(c.y8.actions.error({label:null!=e?e:h.formatMessage({id:"GLOBAL_Error"})}))}),[u,h]);(0,i.useEffect)((()=>{u(c.x0.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const k=(0,i.useMemo)((()=>(0,De.getTinyMCEMentionsQueries)(f,a,w)),[f,w,a]);return g?l().createElement(l().Fragment,null):l().createElement(Ue,null,l().createElement(Be,{autoFocus:m,text:null!=s?s:"",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t&&E?{commonOptions:E,mentionsQueries:k}:void 0,mode:t,onChange:e=>{u((0,c.vR)(n,{text:e}))},additionalExtensions:[x]}),C&&l().createElement(Fe,{onInsert:v,open:y,close:b}))},Ne=u.O.getLazyComponent("WidgetArticleTitle"),Pe=a().div`
|
|
160
160
|
flex: 1;
|
|
161
161
|
display: flex;
|
|
162
162
|
flex-direction: row;
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
padding: 16px;
|
|
232
232
|
`),pt=a().div`
|
|
233
233
|
position: relative;
|
|
234
|
-
`,Et=({widget:e,inplace:t,mode:n,onWidgetUpdate:o})=>{const
|
|
234
|
+
`,Et=({widget:e,inplace:t,mode:n,onWidgetUpdate:o})=>{var a;const u=(0,r.useIntl)(),{uniqid:m,content:g}=e,p=(0,d.useDispatch)(),[E,f]=(0,i.useState)(),[h,y]=(0,i.useState)(!1),v=(0,d.useSelector)(c.x0.selectors.selectToken,d.shallowEqual),b=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),d.shallowEqual),x=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,m)),d.shallowEqual),C=(0,d.useSelector)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),d.shallowEqual),w=(0,i.useMemo)((()=>x&&x.update),[x]),O=(0,i.useMemo)((()=>x&&x.administrate),[x]),W=(0,i.useCallback)((e=>{p(c.y8.actions.error({label:null!=e?e:u.formatMessage({id:"GLOBAL_Error"})}))}),[p,u]),S=(0,i.useCallback)(((e,t)=>{p((0,c.vR)(e,t))}),[p]),L=(0,i.useCallback)((()=>{b&&(y(!0),q().widget.getWidget({uri:b,uniqid:m}).then((e=>{(0,k.ensureWidgetCheckListType)(e.result)&&S(m,e.result.content)})).catch((e=>!e.aborted&&W)).finally((()=>y(!1))))}),[m,W,b,S]),A=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.CheckList,mode:n}))};(0,i.useEffect)((()=>{v||"edit"!==n||q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,v,p]),(0,i.useEffect)((()=>{var t;const n=null===(t=e.content.arr)||void 0===t?void 0:t.map((e=>{var t,n,i,l;return Object.assign(Object.assign(Object.assign({text:null!==(t=e.title)&&void 0!==t?t:"",file:null!==(n=e.file)&&void 0!==n?n:void 0,checked:null!==(i=e.value)&&void 0!==i&&i},e.links&&{links:e.links}),e.user&&{user:null!==(l=e.user)&&void 0!==l?l:void 0}),e.id&&{id:e.id,mimetype:"image/png"})}));f(n)}),[e.content.arr,g]),(0,i.useEffect)((()=>{if(!Array.isArray(C))return;const t=C.at(-1);t&&b&&t.object.uri===b&&t.uniqid===e.uniqid&&("check-list-response"!==t.fn&&"widget-update"!==t.fn||L())}),[C,e.uniqid,b,W,p,L]);const M=t=>{if(!e.content.arr||!b)return;const n=Object.assign(Object.assign({},e.content),{arr:[...e.content.arr,{title:t,value:!1}]});q().widget.updateWidget({uri:b,uniqid:e.uniqid,content:n,v2:!0}).then((()=>S(e.uniqid,n))).catch((e=>W(e.errorMsg)))},T=(0,i.useMemo)((()=>{if(!Array.isArray(g.arr))return[];const e=[];return g.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[g]);return"edit"===n&&t?l().createElement(gt,null,l().createElement(mt,{token:v,uniqid:m,content:Object.assign(Object.assign({},g),{arr:null===(a=g.arr)||void 0===a?void 0:a.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),inplace:t,onChangeContent:S,onChangeWrapper:e=>{p(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>p((0,c.vR)(e.uniqid,t))})):l().createElement(dt.M,{useRT:()=>{(0,ne.AW)(e.uniqid)}},E&&l().createElement(s.JRCFileViewer,{files:T,openWithOptions:[]},(t=>l().createElement(pt,{key:e.uniqid},l().createElement(ut,{limit:10,initialEntries:E,onFileClick:e=>e.id&&t(e.id),onItemCheckListChange:t=>((e,t)=>{b&&(h||(y(!0),q().widget.checkListRespond({uri:b,uniqid:e,index:t}).then((()=>{o&&o()})).catch((e=>{W(e.message),y(!1)}))))})(e.uniqid,t)}),g.edit&&l().createElement(ct,{handleClick:M,placeholder:u.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),O&&v&&l().createElement(lt,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!(!g.edit&&!w)},mode:n,handleOpenEditor:()=>{v?A(v):(y(!0),q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result})),A(e.result)})).finally((()=>y(!1))))}}),h&&l().createElement(at,null)))))},ft=(e,t)=>{const n=[];return e.filter((e=>e.isVisible)).forEach((e=>{const i=t.find((t=>t.name===e.name));i&&n.push(i)})),n},ht=u.O.getLazyComponent("Button"),yt=u.O.getLazyComponent("Html"),vt=u.O.getLazyComponent("WidgetTable"),bt=u.O.getLazyComponent("Loader"),xt=(a().div``,a().div`
|
|
235
235
|
position: absolute;
|
|
236
236
|
inset: 0;
|
|
237
237
|
display: flex;
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
background-color: ${e=>e.theme.color.grey2};
|
|
256
256
|
opacity: 0.9;
|
|
257
257
|
}
|
|
258
|
-
`,wt=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:a,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:E,mode:f})=>{const h=(0,r.useIntl)(),y=(0,Se.jL)(),[v,
|
|
258
|
+
`,wt=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:a,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:E,mode:f})=>{const h=(0,r.useIntl)(),y=(0,Se.jL)(),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(!1),[w,O]=(0,i.useState)([]),[W,S]=(0,i.useState)([]),[L,A]=(0,i.useState)({order:"ascending",name:"unknown"}),[M,T]=(0,i.useState)(void 0),[I,_]=(0,i.useState)(""),j=(0,i.useMemo)((()=>c.x0.definition(k.WidgetsName.DatasourceTable)),[]),D=(0,i.useMemo)((()=>"studio"===M?[{type:[I]}]:[]),[M,I]),z=(0,i.useMemo)((()=>"doc"===M?[I]:[]),[M,I]),{rtLastObject:$}=(0,ne.YL)(D,z),R=(0,i.useCallback)((()=>{t&&(C(!0),q().datasource.get(t,k.Format.VIEW).then((e=>{S(e.result.model),O(e.result.data),A(e.result.sort),T(e.result.datasource.datasourceType),_(e.result.datasource.datasourceIdentifier)})).finally((()=>C(!1))))}),[t]);(0,i.useEffect)((()=>{void 0!==t&&0!==m.length&&0===W.length&&R()}),[t,m,W,R]),(0,i.useEffect)((()=>{$&&R()}),[$,R]),(0,i.useEffect)((()=>{t||S([])}),[t]);const F=(0,i.useCallback)((()=>{y(c.cr.slice.actions.flushAllEditor()),setTimeout((()=>{y(c.cr.slice.actions.registerEditor({uniqid:e,name:k.WidgetsName.DatasourceTable}))}),0)}),[y,e]);(0,i.useEffect)((()=>{"view"!==f&&"preview"!==f||y(c.cr.slice.actions.flushAllEditor())}),[f,y]),(0,i.useEffect)((()=>{v||t||"edit"!==f||(F(),b(!0))}),[y,e,v,t,F,f]);const G=(0,i.useMemo)((()=>ft(m,W)),[m,W]);return 0!==m.length||x||"edit"!==f?x?l().createElement(xt,null,l().createElement(bt,null)):l().createElement(l().Fragment,null,x||0!==w.length?l().createElement(vt,{rows:w,columns:G,limit:n,tableHeadColor:o,tableHeadTextColor:a,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:E,tableDefaultSortOrder:L.order,tableDefaultSortName:L.name}):l().createElement(xt,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})),"edit"===f?l().createElement(Ct,{onClick:F},l().createElement(yt,{__html:`${h.formatMessage({id:"WIDGET_Set_Widget"})} <b>${h.formatMessage({id:j.label})}</b>`})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null,l().createElement(xt,{onClick:F},l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:j.label}),l().createElement(ht,{label:"GLOBAL_Settings"})),l().createElement(Ct,{onClick:F},l().createElement(yt,{__html:`${h.formatMessage({id:"WIDGET_Set_Widget"})} <b>${h.formatMessage({id:j.label})}</b>`})))},kt=u.O.getLazyComponent("Button"),qt=u.O.getLazyComponent("Html"),Ot=u.O.getLazyComponent("WidgetTable"),Wt=u.O.getLazyComponent("Loader"),St=(a().div``,a().div`
|
|
259
259
|
position: absolute;
|
|
260
260
|
inset: 0;
|
|
261
261
|
display: flex;
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
background-color: ${e=>e.theme.color.grey2};
|
|
280
280
|
opacity: 0.9;
|
|
281
281
|
}
|
|
282
|
-
`,At=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:a,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:E,mode:f})=>{const h=(0,r.useIntl)(),y=(0,Se.jL)(),[v,
|
|
282
|
+
`,At=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:a,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:E,mode:f})=>{const h=(0,r.useIntl)(),y=(0,Se.jL)(),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(!1),[w,O]=(0,i.useState)([]),[W,S]=(0,i.useState)([]),L=(0,i.useMemo)((()=>c.x0.definition(k.WidgetsName.ExcelDatasourceTable)),[]);(0,i.useEffect)((()=>{void 0!==t&&0!==m.length&&0===W.length&&(C(!0),q().datasource.get(t,k.Format.VIEW).then((e=>{S(e.result.model),O(e.result.data)})).finally((()=>C(!1))))}),[t,m,W]),(0,i.useEffect)((()=>{t||S([])}),[t]);const A=(0,i.useCallback)((()=>{y(c.cr.slice.actions.flushAllEditor()),setTimeout((()=>y(c.cr.slice.actions.registerEditor({uniqid:e,name:k.WidgetsName.ExcelDatasourceTable}))),0)}),[y,e]);(0,i.useEffect)((()=>{"view"!==f&&"preview"!==f||y(c.cr.slice.actions.flushAllEditor())}),[f,y]),(0,i.useEffect)((()=>{v||t||"edit"!==f||(A(),b(!0))}),[y,e,v,t,A,f]);const M=(0,i.useMemo)((()=>ft(m,W)),[m,W]);return 0!==m.length||x||"edit"!==f?x?l().createElement(St,null,l().createElement(Wt,null)):l().createElement(l().Fragment,null,x||0!==w.length?l().createElement(Ot,{rows:w,columns:M,limit:n,tableHeadColor:o,tableHeadTextColor:a,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:E}):l().createElement(St,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})),"edit"===f?l().createElement(Lt,{onClick:A},l().createElement(qt,{__html:`${h.formatMessage({id:"WIDGET_Set_Widget"})} <b>${h.formatMessage({id:L.label})}</b>`})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null,l().createElement(St,{onClick:A},l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(r.FormattedMessage,{id:L.label}),l().createElement(kt,{label:"GLOBAL_Settings"})),l().createElement(Lt,{onClick:A},l().createElement(qt,{__html:`${h.formatMessage({id:"WIDGET_Set_Widget"})} <b>${h.formatMessage({id:L.label})}</b>`})))},Mt=a().div`
|
|
283
283
|
padding: ${e=>e.theme.space.md}px;
|
|
284
284
|
`,Tt=a().a`
|
|
285
285
|
cursor: pointer;
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
display: flex;
|
|
289
289
|
justify-content: center;
|
|
290
290
|
align-items: center;
|
|
291
|
-
`,_t=({mode:e,uniqid:t,content:n})=>{const o=(0,r.useIntl)(),a=(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((()=>a(c.x0.slice.actions.updateWidget({uniqid:t,content:i})))).catch((()=>a(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}),[e,t,m,s,n,a]);return l().createElement(l().Fragment,null,m&&!n.isClosed&&l().createElement(Mt,null,l().createElement(It,null,l().createElement(Tt,{onClick:g},o.formatMessage({id:"WIDGET_Presence_Closing"})))))},jt=u.O.getLazyComponent("WidgetPresence"),
|
|
291
|
+
`,_t=({mode:e,uniqid:t,content:n})=>{const o=(0,r.useIntl)(),a=(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((()=>a(c.x0.slice.actions.updateWidget({uniqid:t,content:i})))).catch((()=>a(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}),[e,t,m,s,n,a]);return l().createElement(l().Fragment,null,m&&!n.isClosed&&l().createElement(Mt,null,l().createElement(It,null,l().createElement(Tt,{onClick:g},o.formatMessage({id:"WIDGET_Presence_Closing"})))))},jt=u.O.getLazyComponent("WidgetPresence"),Dt=u.O.getLazyComponent("ModalUserList"),zt=a().div`
|
|
292
292
|
display: flex;
|
|
293
293
|
flex: 1;
|
|
294
294
|
position: relative;
|
|
@@ -310,14 +310,14 @@
|
|
|
310
310
|
align-items: center;
|
|
311
311
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
312
312
|
margin: ${e=>e.theme.space.sm}px;
|
|
313
|
-
`),Rt=({widget:e,mode:t})=>{const n=(0,r.useIntl)(),o=(0,d.useDispatch)(),{limit:a,limitValue:s,closing:u,isClosed:m}=e.content,{uniqid:g}=e,[p,E]=(0,i.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[f,h]=(0,i.useState)(!1),[y]=(0,i.useState)(new AbortController),[v,
|
|
313
|
+
`),Rt=({widget:e,mode:t})=>{const n=(0,r.useIntl)(),o=(0,d.useDispatch)(),{limit:a,limitValue:s,closing:u,isClosed:m}=e.content,{uniqid:g}=e,[p,E]=(0,i.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[f,h]=(0,i.useState)(!1),[y]=(0,i.useState)(new AbortController),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(),[w,k]=(0,i.useState)(),O=(0,i.useRef)(y),W=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectUri(e,g)),d.shallowEqual),S=(0,d.useSelector)((e=>c.x0.selectors.selectAllWidgetRTObject(e,g)),d.shallowEqual),L=(0,i.useCallback)((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[o]),A=(0,i.useMemo)((()=>!(a&&s&&p.userAvailableTotal>=s)),[a,s,p.userAvailableTotal]),M=(0,i.useMemo)((()=>u&&m||"edit"===t),[u,m,t]),T=(0,i.useCallback)((()=>{W&&!M&&(A?(h(!0),q().widget.presenceCancel({uri:W,uniqid:g}).catch(L).finally((()=>h(!1)))):o(c.y8.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))}),[o,g,L,W,A,M]),I=(0,i.useCallback)((e=>{W&&!M&&(h(!0),q().widget.presenceRespond({uri:W,uniqid:g,value:e},O.current.signal).catch(L).finally((()=>h(!1))))}),[W,g,L,M]),_=(0,i.useCallback)((()=>{"edit"!==t&&W&&(h(!0),q().widget.presenceGetResponse({uri:W,uniqid:g},O.current.signal).then((e=>{E(e.result)})).catch((e=>!e.aborted&&L())).finally((()=>h(!1))))}),[W,L,g,t]),j=(e,t)=>{W&&q().widget.presenceGetResponseUserList({uri:W,uniqid:g,index:e,page:t,limit:8},O.current.signal).then((e=>{k(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&L))},D=(0,i.useCallback)((()=>{W&&(h(!0),q().widget.getWidget({uri:W,uniqid:g}).then((e=>{o((0,c.vR)(g,e.result))})).catch((e=>!e.aborted&&L)).finally((()=>h(!1))))}),[o,L,W,g]);return(0,i.useEffect)((()=>{const e=O.current;return()=>{e.abort()}}),[]),(0,i.useEffect)((()=>{_()}),[_]),(0,i.useEffect)((()=>{if(!Array.isArray(S))return;const e=S.at(-1);e&&W&&e.object.uri===W&&e.uniqid===g&&("widget-presence-response"===e.fn&&_(),"widget-update"===e.fn&&D())}),[S,_,g,W,D]),l().createElement(dt.M,{useRT:()=>{(0,ne.AW)(e.uniqid)}},l().createElement(zt,null,l().createElement(jt,{limit:a,limitValue:s,userAvailableList:p.userAvailableList,userUnavailableList:p.userUnavailableList,userValue:p.userValue,userAvailableTotal:null==p?void 0:p.userAvailableTotal,userUnavailableTotal:null==p?void 0:p.userUnavailableTotal,isClosed:u&&m,handleClickAvailable:()=>1===p.userValue?T():I(1),handleClickUnavailable:()=>0===p.userValue?T():I(0),handleOpenUsersModal:e=>{k({limit:0,page:0,data:[],cnt:0}),C(e),j(e),b(!0)}}),u&&m&&l().createElement($t,null,n.formatMessage({id:"WIDGET_Presence_Is_Closed"})),u&&!m&&l().createElement(_t,{mode:t,uniqid:e.uniqid,content:e.content}),"view"===t&&l().createElement(lt,{uniqid:e.uniqid,name:e.name,mode:t}),f&&l().createElement(at,null),l().createElement(Dt,{open:v,usersList:w,title:1===x?n.formatMessage({id:"WIDGET_Presence_On"}):n.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:b,onClose:()=>{k({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{j(null!=x?x:0,e)}})))},Ft=u.O.getLazyComponent("WidgetQuickSurvey"),Gt=u.O.getLazyComponent("WidgetQuickSurveyEditor"),Bt=u.O.getLazyComponent("ModalUserList"),Ut=a().div`
|
|
314
314
|
width: 100%;
|
|
315
315
|
display: flex;
|
|
316
316
|
flex-direction: column;
|
|
317
317
|
gap: 14px;
|
|
318
318
|
${e=>e.withPadding&&"padding: 0 12px;"}
|
|
319
319
|
padding-top: 16px;
|
|
320
|
-
`,Ht=({widget:e,inplace:t,mode:n})=>{var o,a,u;const m=(0,r.useIntl)(),g=(0,d.useDispatch)(),{uniqid:p,content:E}=e,[f,h]=(0,i.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[y,v]=(0,i.useState)(!1),[x
|
|
320
|
+
`,Ht=({widget:e,inplace:t,mode:n})=>{var o,a,u;const m=(0,r.useIntl)(),g=(0,d.useDispatch)(),{uniqid:p,content:E}=e,[f,h]=(0,i.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[y,v]=(0,i.useState)(!1),[b,x]=(0,i.useState)(!1),[C,w]=(0,i.useState)(),[O,W]=(0,i.useState)(),[S]=(0,i.useState)(new AbortController),L=(0,i.useRef)(S),A=(0,d.useSelector)(c.x0.selectors.selectToken,d.shallowEqual),M=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),d.shallowEqual),T=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,p)),d.shallowEqual),I=(0,d.useSelector)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),d.shallowEqual),_=(0,i.useCallback)(((e,t)=>{g((0,c.vR)(e,t))}),[g]),j=t=>{g(c.cr.slice.actions.flushAllEditor()),g(c.x0.slice.actions.setToken({token:t})),g(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:k.WidgetsName.QuickSurvey}))},D=(0,i.useCallback)((()=>g(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[g]),z=(0,i.useCallback)((e=>{"edit"!==n&&M&&(x(!0),q().widget.quickSurveyGetResponse({uri:M,uniqid:e},L.current.signal).then((e=>{h(e.result)})).catch((e=>!e.aborted&&D)).finally((()=>x(!1))))}),[D,M,n]),$=(0,i.useCallback)((()=>{M&&(x(!0),q().widget.getWidget({uri:M,uniqid:p},L.current.signal).then((e=>{_(p,e.result.content)})).catch((e=>!e.aborted&&D)).finally((()=>x(!1))))}),[p,D,M,_]),R=()=>{if(M&&E.closing){const e=Object.assign(Object.assign({},E),{isClosed:!0});q().widget.updateWidget({uri:M,uniqid:p,content:e}).catch((()=>{D()}))}},F=t=>{(t=>{"edit"!==n&&M&&(x(!0),q().widget.quickSurveyRespond({uri:M,index:t,multi:E.multi?1:0,uniqid:p},L.current.signal).then((()=>{z(e.uniqid)})).catch((e=>!e.aborted&&D)).finally((()=>x(!1))))})(t)},G=(e,t)=>{M&&q().widget.quickSurveyGetResponseUserList({uri:M,uniqid:p,index:e,page:t,limit:8},L.current.signal).then((e=>{W(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&D))},B=(0,i.useMemo)((()=>T&&T.update),[T]);(0,i.useEffect)((()=>{z(e.uniqid)}),[z,e.uniqid]),(0,i.useEffect)((()=>{if(!Array.isArray(I))return;const t=I.at(-1);t&&M&&t.object.uri===M&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&z(e.uniqid),"widget-update"===t.fn&&$())}),[I,M,e.uniqid,$,z]);const U=(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)((()=>{A||"edit"!==n||q().network.token().then((e=>{g(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,A,g]),"edit"===n&&t?l().createElement(Ut,{withPadding:!0},l().createElement(Gt,{token:A,uniqid:p,content:e.content,onChangeContent:_,onChangeWrapper:e=>{g(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:e=>_(p,e),inplace:t})):l().createElement(dt.M,{useRT:()=>{(0,ne.AW)(e.uniqid)}},l().createElement(Ut,null,l().createElement(s.JRCFileViewer,{files:U,openWithOptions:[]},(t=>{var n,i,o,a,r,s,c;return l().createElement(Ft,{limit:null!==(n=f.totalResponse)&&void 0!==n?n:0,values:null!==(i=E.arr)&&void 0!==i?i:[],userResponses:f.userResponses,userHasAlreadyVoted:f.userLoggedResponses.length>0,canCloseSurvey:null!==(o=e.content.closing)&&void 0!==o&&o,isClosed:null!==(a=e.content.isClosed)&&void 0!==a&&a,open:null!==(r=e.content.open)&&void 0!==r&&r,anonymize:null!==(s=e.content.anonymize)&&void 0!==s&&s,seeResponseAfter:null!==(c=e.content.seeResponseAfter)&&void 0!==c&&c,canUpdate:B,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:R,handleProgressBarClick:F,setOpenUsersModal:e=>{w(e),G(e),v(!0)}})})),E.open&&l().createElement(ct,{handleClick:e=>{var t;if(!M)return;const n=Object.assign(Object.assign({},E),{arr:[...null!==(t=E.arr)&&void 0!==t?t:[],{title:e}]});q().widget.quickSurveyAddEnty({uri:M,uniqid:p,label:e}).then((()=>{g(c.x0.slice.actions.updateWidget({uniqid:p,content:n}))})).catch(D)},placeholder:m.formatMessage({id:"FIELDS_Add_Option"})}),B&&l().createElement(lt,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!B},mode:n,handleOpenEditor:()=>{A?j(A):(x(!0),q().network.token().then((e=>{g(c.x0.slice.actions.setToken({token:e.result})),j(e.result)})).finally((()=>x(!1))))}}),b&&l().createElement(at,null),l().createElement(Bt,{open:y,usersList:O,title:null!==(u=null===(a=null===(o=E.arr)||void 0===o?void 0:o[null!=C?C:0])||void 0===a?void 0:a.title)&&void 0!==u?u:"",setOpen:v,handleLoadUsersList:e=>{G(null!=C?C:0,e)},onClose:()=>{W({limit:0,page:0,data:[],cnt:0})}})))},Nt=a().div`
|
|
321
321
|
padding: ${e=>e.theme.space.md}px;
|
|
322
322
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
323
323
|
`,Pt=({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(Nt,null,l().createElement(s.JRCHtml,{__html:null!==(t=n.title)&&void 0!==t?t:""})))},Vt=({uniqid:e})=>{const t=(0,r.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:a,watch:u}=(0,rt.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:a,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},Jt=u.O.getLazyComponent("Button"),Qt=u.O.getLazyComponent("ModalLayout"),Kt=u.O.getLazyComponent("ModalContent"),Xt=a().div`
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
display: flex;
|
|
345
345
|
flex: 1;
|
|
346
346
|
flex-direction: column;
|
|
347
|
-
`,ln=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:o,cannotDisplayComponent:a})=>{const{name:r}=e;return(0,k.ensureWidgetArticleButtonType)(e)?l().createElement(pe,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleGalleryType)(e)?l().createElement(ve,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleAttachmentType)(e)?l().createElement(de,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleImageType)(e)?l().createElement(
|
|
347
|
+
`,ln=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:o,cannotDisplayComponent:a})=>{const{name:r}=e;return(0,k.ensureWidgetArticleButtonType)(e)?l().createElement(pe,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleGalleryType)(e)?l().createElement(ve,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleAttachmentType)(e)?l().createElement(de,{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(je,{widget:e,inplace:n,mode:i,width:null!=t?t:800}):(0,k.ensureWidgetArticleTitleType)(e)?l().createElement(Qe,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleTextType)(e)?l().createElement(He,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetExcelDatasourceTableType)(e)?l().createElement(nn,null,l().createElement(Pt,{uniqid:e.uniqid}),l().createElement(At,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetDatasourceTableType)(e)?l().createElement(nn,null,l().createElement(Pt,{uniqid:e.uniqid}),l().createElement(wt,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?l().createElement(nn,null,"edit"===i?l().createElement(tn,{name:e.name,uniqid:e.uniqid}):l().createElement(Pt,{uniqid:e.uniqid}),l().createElement(Et,{widget:e,inplace:n,mode:i,onWidgetUpdate:o})):(0,k.ensureWidgetPresenceType)(e)?l().createElement(nn,null,"edit"===i?l().createElement(tn,{name:e.name,uniqid:e.uniqid}):l().createElement(Pt,{uniqid:e.uniqid}),l().createElement(Rt,{widget:e,inplace:n,mode:i})):(0,k.ensureWidgetQuickSurveyType)(e)?l().createElement(nn,null,"edit"===i?l().createElement(tn,{name:e.name,uniqid:e.uniqid}):l().createElement(Pt,{uniqid:e.uniqid}),l().createElement(Ht,{widget:e,inplace:n,mode:i})):a?l().createElement(l().Fragment,null,a(r)):l().createElement(l().Fragment,null,"cannot display widget (",r,")")},on=(a().div`
|
|
348
348
|
height: 0;
|
|
349
349
|
overflow: hidden;
|
|
350
350
|
`,a().div`
|
|
@@ -392,19 +392,19 @@
|
|
|
392
392
|
opacity: ${e=>e.opacity};
|
|
393
393
|
background-color: ${e=>e.backgroundColor};
|
|
394
394
|
pointer-events: ${e=>e.pointerEvents};
|
|
395
|
-
`,rn=u.O.getLazyComponent("DoubleClick"),sn=({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(cn,{uniqid:e,key:t,mode:"edit"}))))},cn=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(an,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(dn,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(an,{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(dn,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},dn=({uniqid:e,layerId:t,mode:n})=>{const i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>t.widgets.ids[e]),d.shallowEqual),a=(0,d.useSelector)((e=>e.widgets.layers[t]));return o&&a&&a.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},l().createElement(En,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(un,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{i(c.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(rn,{onDoubleTap:()=>((e,t)=>{i(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(En,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},un=({position:e,children:t,onMouseUp:n})=>{const[o,a]=l().useState(!1),[r,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=>{a(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),E=l().useCallback((e=>{if(o&&g.current){const t=c.x+(e.clientX-r.x),n=c.y+(e.clientY-r.y);m({x:t,y:n})}}),[r.x,r.y,o,c.x,c.y]),f=(0,i.useCallback)((()=>{a(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return l().useEffect((()=>(document.addEventListener("mousemove",E),document.addEventListener("mouseup",f),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",f)})),[E,f]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},mn=u.O.getLazyComponent("Loader"),gn=({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(mn,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}))},pn=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:a,width:r,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),E=(0,d.useSelector)((e=>e.widgets.currentEditableWidgetId),d.shallowEqual),f=(0,d.useSelector)((t=>t.widgets.currentEditableWidgetId===e),d.shallowEqual),{ref:h,isComponentVisible:y,setIsComponentVisible:v}=(0,ne.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)((()=>{y||e===E&&m(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[y]),(0,i.useEffect)((()=>{y!==f&&v(f)}),[f]),void 0===g)return l().createElement(l().Fragment,null,"This widget cannot be displayed");const
|
|
395
|
+
`,rn=u.O.getLazyComponent("DoubleClick"),sn=({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(cn,{uniqid:e,key:t,mode:"edit"}))))},cn=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(an,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(dn,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(an,{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(dn,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},dn=({uniqid:e,layerId:t,mode:n})=>{const i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>t.widgets.ids[e]),d.shallowEqual),a=(0,d.useSelector)((e=>e.widgets.layers[t]));return o&&a&&a.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},l().createElement(En,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(un,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{i(c.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(rn,{onDoubleTap:()=>((e,t)=>{i(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(En,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},un=({position:e,children:t,onMouseUp:n})=>{const[o,a]=l().useState(!1),[r,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=>{a(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),E=l().useCallback((e=>{if(o&&g.current){const t=c.x+(e.clientX-r.x),n=c.y+(e.clientY-r.y);m({x:t,y:n})}}),[r.x,r.y,o,c.x,c.y]),f=(0,i.useCallback)((()=>{a(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return l().useEffect((()=>(document.addEventListener("mousemove",E),document.addEventListener("mouseup",f),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",f)})),[E,f]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},mn=u.O.getLazyComponent("Loader"),gn=({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(mn,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}))},pn=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:a,width:r,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),E=(0,d.useSelector)((e=>e.widgets.currentEditableWidgetId),d.shallowEqual),f=(0,d.useSelector)((t=>t.widgets.currentEditableWidgetId===e),d.shallowEqual),{ref:h,isComponentVisible:y,setIsComponentVisible:v}=(0,ne.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)((()=>{y||e===E&&m(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[y]),(0,i.useEffect)((()=>{y!==f&&v(f)}),[f]),void 0===g)return l().createElement(l().Fragment,null,"This widget cannot be displayed");const b=g.widget,x=()=>{"edit"===a?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"===a)return;const{widget:e}=g;m(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return o&&"view"!==a?l().createElement(on,{ref:h,onClick:()=>{v(!0),p&&(m(c.x0.slice.actions.setEditableIndex({index:p.index})),m(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(ln,{width:r,widget:Object.assign(Object.assign({},g.widget),g.title&&{title:g.title}),inplace:o,mode:a,onClick:x}),l().createElement(sn,{uniqid:e,mode:a}),l().createElement(gn,{name:g.widget.name,uniqid:g.widget.uniqid,inplace:o})):l().createElement(on,{onClick:C},l().createElement(ln,{widget:Object.assign(Object.assign({},g.widget),g.title&&{title:g.title}),inplace:o,mode:a,width:r,onClick:x,onWidgetUpdate:s,cannotDisplayComponent:u}),l().createElement(sn,{uniqid:e,mode:a}),l().createElement(gn,{name:g.widget.name,uniqid:g.widget.uniqid,inplace:o}))},En=pn,fn=a().div`
|
|
396
396
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
397
397
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
398
398
|
background-color: ${e=>e.theme.color.white};
|
|
399
399
|
overflow: hidden;
|
|
400
|
-
`,hn=u.O.getLazyComponent("Message"),yn=({widgets:e})=>{const t=(0,r.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(fn,{key:e.widget.uniqid},l().createElement(En,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>l().createElement(hn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))},vn=u.O.getLazyComponent("Message"),
|
|
400
|
+
`,hn=u.O.getLazyComponent("Message"),yn=({widgets:e})=>{const t=(0,r.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(fn,{key:e.widget.uniqid},l().createElement(En,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>l().createElement(hn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))},vn=u.O.getLazyComponent("Message"),bn=e=>{const t=(0,r.useIntl)(),{widgets:n,comment:i,inplace:o,mode:a,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(fn,{key:e.widget.uniqid},l().createElement(En,{uniqid:e.widget.uniqid,widgetObject:i,widget:e,inplace:o,mode:a,onWidgetUpdate:s,cannotDisplayComponent:e=>l().createElement(vn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))};var xn=n(730),Cn=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function r(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(a,r)}s((i=i.apply(e,t||[])).next())}))};const wn=u.O.getLazyComponent("JRCCommentsBloc"),kn=a().div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: column;
|
|
403
403
|
gap: 4px;
|
|
404
404
|
flex: 1;
|
|
405
405
|
width: 100%;
|
|
406
406
|
margin-top: 10px;
|
|
407
|
-
`,qn=({articleId:e,variant:t="inline",canComment:n,commentType:a="comment",socialQuestion:s})=>{var u;const m=(0,r.useIntl)(),g=(0,o.useTheme)(),p=(0,d.useDispatch)(),[E,f]=(0,i.useState)(),[h,y]=(0,i.useState)(!1),[v,
|
|
407
|
+
`,qn=({articleId:e,variant:t="inline",canComment:n,commentType:a="comment",socialQuestion:s})=>{var u;const m=(0,r.useIntl)(),g=(0,o.useTheme)(),p=(0,d.useDispatch)(),[E,f]=(0,i.useState)(),[h,y]=(0,i.useState)(!1),[v,b]=(0,i.useState)([]),[x,C]=(0,i.useState)(!1),w=(0,d.useSelector)(c.xJ.selectors.get),k=(0,d.useSelector)(c.x0.selectors.selectWidgets),O=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),W=(0,d.useSelector)(c.sU.selectors.selectTinyMCEExtendedOptions),S=(0,d.useSelector)(c.Kx.selectors.selectAll),L=(0,d.useSelector)(c.OD.selectors.selectPlatformConfig),A=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"OnlyOfficeHook"))),M=(0,d.useSelector)((t=>c.Mw.selectors.commentList(t,e))),T=(0,d.useSelector)((e=>c.qn.selectors.selectHook(e,"DriveHook"))),j=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"FileBankHook"))),D=(0,d.useSelector)((e=>c.qn.selectors.selectHook(e,"WidgetHook"))),[z,$]=(0,i.useState)(s),{open:F,onInsert:G,close:B,ext:U,isActive:H}=Ge();(0,I.A)(e),((e,t)=>{const n=(0,d.useDispatch)(),l=(0,i.useMemo)((()=>_.A),[]),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])})(M.map((e=>e.id)),e);const N=(0,i.useCallback)((e=>{p(c.y8.actions.error({label:null!=e?e:m.formatMessage({id:"GLOBAL_Error"})}))}),[p,m]),P=()=>{p(c.Mw.actions.fetchComments({idArticle:e})),V()},V=(0,i.useCallback)((()=>{E||x||(C(!0),q().network.token().then((e=>{f(e.result),C(!1),p(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{N(e.errorMsg)})))}),[N,E,x,p]),J=(0,i.useCallback)((t=>Cn(void 0,void 0,void 0,(function*(){if(E){y(!0);const n=Object.keys(k).map((e=>(null==v?void 0:v.some((t=>t.widget.uniqid===e)))?k[e]:null)).filter((e=>null!==e));try{yield q().article.addComment(Object.assign(Object.assign({},t),{widgets:n,token:E,idArticle:e,type:a})).then((()=>{b([])})),V()}catch(e){N(e.errorMsg)}finally{y(!1)}}}))),[e,a,V,N,E,k,v]);return(0,i.useEffect)((()=>{V()}),[V]),(0,i.useEffect)((()=>{p(c.Mw.actions.fetchComments({idArticle:e}))}),[e,p]),(0,i.useEffect)((()=>{M&&M.forEach((e=>{var t;null===(t=e._widgets)||void 0===t||t.forEach((t=>{p(c.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),p(c.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))}))}))}),[M,p]),l().createElement(l().Fragment,null,O&&W&&l().createElement(l().Fragment,null,l().createElement(kn,null,l().createElement(wn,{canComment:n,loading:h,token:E,comments:M,onComment:J,onCommentUpdate:t=>Cn(void 0,void 0,void 0,(function*(){var n,i;const l=M.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((()=>{p(c.Mw.actions.fetchComments({idArticle:e})),V()})).catch((e=>{N(e.errorMsg)}))})),onCommentDelete:e=>Cn(void 0,void 0,void 0,(function*(){q().article.deleteComment(e).catch(N)})),isWidgetActive:!!((null==D?void 0:D.isActive)&&(null==D?void 0:D.create)&&(null===(u=null==D?void 0:D.autorize)||void 0===u?void 0:u.includes("comment"))),widgetListComponent:l().createElement(Z,{mode:"comment",namespace:"comment",onChange:e=>{b([e]),p(c.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e})),f(void 0),V()},view:"edit"}),newWidgetsWrapperComponent:l().createElement(yn,{widgets:v}),existingWidgetsWrapperComponent:(e,t,n,i=!0)=>l().createElement(bn,{comment:e,widgets:t,mode:n,inplace:i,handleWidgetUpdate:P,handleWidgetRemove:V}),currentUser:w,tinyMCEConfig:{commonOptions:Object.assign(Object.assign({},O),{toolbar:W.commentsToolbar}),mentionsQueries:(0,xn.X)(S,g,N)},onError:N,highlightFields:L.userHighlightFields,userAccountStatus:L.userAccountStatus,userModel:S.find((e=>"user"===e.type)),isWedocActive:!!A,onGetHashError:e=>p(c.y8.actions.error({label:null!=e?e:m.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...j&&T?["fileBank"]:[],...c.qn.utils.buildDrivesArrayFromObject(null==T?void 0:T.drives)],variant:t,handlers:{drive:q().drive,filebank:q().filebank,file:q().file,user:q().user,socialAction:q().socialAction,questionAnswer:q().questionAnswer},socialQuestion:z?Object.assign(Object.assign({},z),{onSelectResponse:e=>{$(Object.assign(Object.assign({},z),{responseId:e,isResolved:!0}))},onUnselectResponse:()=>{$(Object.assign(Object.assign({},z),{responseId:void 0,isResolved:!1}))}}):void 0,articleId:e,additionalExtensions:[U]}),l().createElement(R,null))),H&&l().createElement(Fe,{onInsert:G,open:F,close:B}))};var On=n(749),Wn=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 Sn=o.css`
|
|
408
408
|
height: 100%;
|
|
409
409
|
display: flex;
|
|
410
410
|
flex-direction: column;
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
${({stretch:e})=>e&&Sn}
|
|
416
416
|
`,Mn=i.forwardRef(((e,t)=>e.onSubmit?i.createElement(An,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):i.createElement(Ln,{stretch:e.stretch,ref:t},e.children))),Tn=a().div`
|
|
417
417
|
${e=>e.stretch&&"\n flex: 1;\n"}
|
|
418
|
-
`,In=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,o]=(0,
|
|
418
|
+
`,In=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,o]=(0,On.SC)(e.fields,e.type,e.forceMandatory),a=(0,rt.useForm)({defaultValues:Object.assign(Object.assign({},o),e.defaultValues),criteriaMode:"all"}),{handleSubmit:r,control:s,reset:c}=a,d=Wn(a,["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:r,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(Mn,{stretch:e.stretch,onSubmit:e.onSubmit?r(e.onSubmit):void 0,ref:n},i.createElement(Tn,{stretch:e.stretch},l.map((t=>{var{Input:n}=t,l=Wn(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)})),_n=(a().div`
|
|
419
419
|
margin-bottom: 24px;
|
|
420
420
|
`,a().div`
|
|
421
421
|
margin-bottom: 4px;
|
|
@@ -432,12 +432,12 @@
|
|
|
432
432
|
display: flex;
|
|
433
433
|
min-height: 60px;
|
|
434
434
|
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
435
|
-
`,
|
|
435
|
+
`,Dn=a().div`
|
|
436
436
|
width: 60px;
|
|
437
437
|
display: flex;
|
|
438
438
|
align-items: center;
|
|
439
439
|
justify-content: center;
|
|
440
|
-
`,
|
|
440
|
+
`,zn=a().div`
|
|
441
441
|
flex: 1;
|
|
442
442
|
display: flex;
|
|
443
443
|
align-items: center;
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
flex: 1;
|
|
538
538
|
display: flex;
|
|
539
539
|
align-items: center;
|
|
540
|
-
`,u.O.getLazyComponent("Button")),Qn=u.O.getLazyComponent("Icon"),Kn=({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(jn,null,l().createElement(zn,null),l().createElement(Dn,null,"Popup"),l().createElement(zn,null,l().createElement(Hn,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(Qn,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(jn,null,l().createElement(Jn,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var Xn=n(320);const Yn=u.O.getLazyComponent("WidgetArticleTitleEditor"),Zn=u.O.getLazyComponent("WidgetArticleTextEditor"),ei=u.O.getLazyComponent("WidgetArticleGalleryEditor"),ti=u.O.getLazyComponent("WidgetArticleAttachmentEditor"),ni=u.O.getLazyComponent("WidgetArticleSliderEditor"),ii=u.O.getLazyComponent("WidgetArticleImageEditor"),li=u.O.getLazyComponent("WidgetButtonEditor"),oi=u.O.getLazyComponent("WidgetCheckListEditor"),ai=u.O.getLazyComponent("WidgetQuickSurveyEditor"),ri=u.O.getLazyComponent("WidgetDatasourceTableEditor"),si=u.O.getLazyComponent("WidgetExcelDatasourceTableEditor"),ci=u.O.getLazyComponent("WidgetPresenceEditor"),di=({uniqid:e})=>{var t,n,i,o,a;const r=(0,d.useDispatch)(),s=(0,d.useSelector)(c.x0.selectors.selectToken),u=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),m=(0,d.useSelector)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),d.shallowEqual),g=e=>{var t;return null===(t=c.qn.selectors.selectHook(Xn.M.getState(),e))||void 0===t?void 0:t.isActive},p=t=>{u&&r(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),r(c.cr.slice.actions.flushEditor({uniqid:e})),m&&m(t)},E=(t,n)=>{r(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},f=t=>{r(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},h=null==u?void 0:u.widget;return h?(0,k.ensureWidgetArticleButtonType)(h)?l().createElement(li,Object.assign({},h.content,{onChange:t=>{r((0,c.vR)(e,t,!1))},onSave:()=>p({})})):(0,k.ensureWidgetArticleGalleryType)(h)?l().createElement(ei,{token:s,content:h.content,onChange:t=>r((0,c.vR)(e,t,!1)),onSave:p,onStateChange:E}):(0,k.ensureWidgetArticleAttachmentType)(h)?l().createElement(ti,{token:s,content:h.content,onChange:t=>{r((0,c.vR)(e,t,!1))},onSave:p,onStateChange:E,onOpen:f}):(0,k.ensureWidgetArticleImageType)(h)?l().createElement(ii,{content:h.content,token:s,onChange:t=>{r((0,c.vR)(e,t,!1))},onSave:p,onStateChange:E}):(0,k.ensureWidgetArticleSliderType)(h)?void 0!==s?l().createElement(ni,{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=>{r((0,c.vR)(e,t,!1))},token:s,onSave:p}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(h)?l().createElement(Yn,{onChange:t=>{r((0,c.vR)(e,t,!1))},onSave:p,content:h.content,onOpen:f}):(0,k.ensureWidgetArticleTextType)(h)?l().createElement(Zn,{onChange:t=>{r((0,c.vR)(e,t,!1))},onSave:p,content:h.content}):(0,k.ensureWidgetPresenceType)(h)?l().createElement(ci,Object.assign({onChange:t=>{r((0,c.vR)(e,t,!1))},onSave:p,onStateChange:E},h.content)):(0,k.ensureWidgetCheckListType)(h)?l().createElement(oi,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{r((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{r(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>r((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(h)?l().createElement(ai,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{r((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{r(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>r((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(h)?l().createElement(si,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(o=h.content.limit)&&void 0!==o?o:20,hook:{isActive:g},handlers:{jamespot:{datasource:q().datasource,network:q().network,filebank:q().filebank,wedoc:q().wedoc},handleStart:()=>E({busy:!0}),handleCatch:e=>r(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:p,onChange:(t,n)=>r((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>r(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetDatasourceTableType)(h)?l().createElement(ri,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(a=h.content.limit)&&void 0!==a?a:20,hook:{isActive:g},handlers:{jamespot:{datasource:q().datasource,network:q().network,application:q().application,filebank:q().filebank},handleStart:()=>E({busy:!0}),handleCatch:e=>r(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:p,onChange:(t,n)=>r((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>{r(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},ui=u.O.getLazyComponent("Icon"),mi=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(zn,null,l().createElement(Hn,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ui,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},gi=u.O.getLazyComponent("BETA_DragAndDrop"),pi=u.O.getLazyComponent("Icon"),Ei=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,r.useIntl)(),o=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,a=(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(fi,{uniqid:e}),o?a.map(((t,r)=>{const s=c.x0.definition(t.widget.name);return l().createElement("div",{key:r},l().createElement(Nn,null,l().createElement(Pn,{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(Vn,{onClick:()=>{n(c.x0.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},o.content),{widgets:[...a.filter(((e,t)=>t!==r)).map((e=>((0,k.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(pi,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},fi=({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(gi,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(xi,{uniqid:e,key:t}),elms:n||[]}),l().createElement(Z,{namespace:"default",onChange:n=>{t(c.x0.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},hi=({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(pi,{name:n.locked?"icon-lock":"icon-unlock"}))},yi=({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(pi,{name:n.visible?"icon-eye":"icon-eye-slash"}))},vi=({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(pi,{name:"icon-trash"}))},xi=({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(hi,{uniqid:e}),l().createElement(yi,{uniqid:e}),l().createElement(vi,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},bi=u.O.getLazyComponent("InputText"),Ci=({uniqid:e})=>{var t;const n=(0,r.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),{control:a,watch:s}=(0,rt.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(bi,{name:"text",width:"100%",control:a,placeholder:n.formatMessage({id:"WIDGET_Title"})}):l().createElement(l().Fragment,null)},wi=u.O.getLazyComponent("Loader"),ki=({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(Gn,null,l().createElement(wi,{size:"l"})))},qi=({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)},Wi=({uniqid:e})=>{var t;const n=(0,r.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(Bn,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Oi=u.O.getLazyComponent("Button"),Si=({uniqid:e,mode:t})=>{const n=(0,r.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),a=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),d.shallowEqual);return l().createElement(Oi,{onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;a&&o&&l&&("view"==t&&q().widget.updateWidget({uri:a,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"}))},Li=["widget-presence","widget-quick-survey","widget-check-list"],Ai=u.O.getLazyComponent("Icon"),Mi=({uniqid:e,position:t})=>{const n=(0,r.useIntl)(),o=(0,d.useDispatch)(),a=(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((()=>{a&&a.current&&(a.current.className=a.current.className+" animate")}),0)}),[]),s?l().createElement($n,null,l().createElement(Rn,{ref:a,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement(Un,null,u.panel.useWrapper?l().createElement(Hn,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(Ai,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(Hn,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(Ai,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(qi,{uniqid:e},l().createElement(Hn,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(Ai,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(jn,null,l().createElement(mi,{uniqid:e,position:s.position}),l().createElement(Dn,null,n.formatMessage({id:u.label})),l().createElement(zn,null,l().createElement(Hn,{onClick:()=>{o(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(Ai,{name:"icon-times",color:"grey2"})))),l().createElement(Fn,null,"default"===m&&u.panel.useEditor?l().createElement(di,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(Ci,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(Ei,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(ki,{uniqid:e}),l().createElement(Wi,{uniqid:e}),Li.includes(s.name)&&l().createElement(Si,{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)},Ti=a().div`
|
|
540
|
+
`,u.O.getLazyComponent("Button")),Qn=u.O.getLazyComponent("Icon"),Kn=({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(jn,null,l().createElement(Dn,null),l().createElement(zn,null,"Popup"),l().createElement(Dn,null,l().createElement(Hn,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(Qn,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(jn,null,l().createElement(Jn,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)};var Xn=n(320);const Yn=u.O.getLazyComponent("WidgetArticleTitleEditor"),Zn=u.O.getLazyComponent("WidgetArticleTextEditor"),ei=u.O.getLazyComponent("WidgetArticleGalleryEditor"),ti=u.O.getLazyComponent("WidgetArticleAttachmentEditor"),ni=u.O.getLazyComponent("WidgetArticleSliderEditor"),ii=u.O.getLazyComponent("WidgetArticleImageEditor"),li=u.O.getLazyComponent("WidgetButtonEditor"),oi=u.O.getLazyComponent("WidgetCheckListEditor"),ai=u.O.getLazyComponent("WidgetQuickSurveyEditor"),ri=u.O.getLazyComponent("WidgetDatasourceTableEditor"),si=u.O.getLazyComponent("WidgetExcelDatasourceTableEditor"),ci=u.O.getLazyComponent("WidgetPresenceEditor"),di=({uniqid:e})=>{var t,n,i,o,a,r;const u=(0,d.useDispatch)(),m=(0,d.useSelector)(c.x0.selectors.selectToken),g=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),p=(0,d.useSelector)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),d.shallowEqual),E=e=>{var t;return null===(t=c.qn.selectors.selectHook(Xn.M.getState(),e))||void 0===t?void 0:t.isActive},f=t=>{g&&u(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),u(c.cr.slice.actions.flushEditor({uniqid:e})),p&&p(t)},h=(t,n)=>{u(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=>{u(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},v=null==g?void 0:g.widget;return v?(0,k.ensureWidgetArticleButtonType)(v)?l().createElement(li,Object.assign({},v.content,{onChange:t=>{u((0,c.vR)(e,t,!1))},onSave:()=>f({})})):(0,k.ensureWidgetArticleGalleryType)(v)?l().createElement(ei,{token:m,content:v.content,onChange:t=>u((0,c.vR)(e,t,!1)),onSave:f,onStateChange:h}):(0,k.ensureWidgetArticleAttachmentType)(v)?l().createElement(ti,{token:m,content:v.content,onChange:t=>{u((0,c.vR)(e,t,!1))},onSave:f,onStateChange:h,onOpen:y}):(0,k.ensureWidgetArticleImageType)(v)?l().createElement(ii,{content:v.content,token:m,onChange:t=>{u((0,c.vR)(e,t,!1))},onSave:f,onStateChange:h}):(0,k.ensureWidgetArticleSliderType)(v)?void 0!==m?l().createElement(ni,{slides:null!==(t=v.content.slides)&&void 0!==t?t:[],loop:null!==(n=v.content.loop)&&void 0!==n&&n,useDots:null===(i=v.content.useDots)||void 0===i||i,onChange:t=>{u((0,c.vR)(e,t,!1))},token:m,onSave:f}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(v)?l().createElement(Yn,{onChange:t=>{u((0,c.vR)(e,t,!1))},onSave:f,content:v.content,onOpen:y}):(0,k.ensureWidgetArticleTextType)(v)?l().createElement(Zn,{onChange:t=>{u((0,c.vR)(e,t,!1))},onSave:f,content:v.content}):(0,k.ensureWidgetPresenceType)(v)?l().createElement(ci,Object.assign({onChange:t=>{u((0,c.vR)(e,t,!1))},onSave:f,onStateChange:h},v.content)):(0,k.ensureWidgetCheckListType)(v)?l().createElement(oi,{token:m,uniqid:v.uniqid,content:Object.assign(Object.assign({},v.content),{arr:null===(o=v.content.arr)||void 0===o?void 0:o.map((e=>Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))}),onChangeContent:(e,t)=>{u((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{u(c.x0.slice.actions.updateWidgetWrapper(Object.assign(Object.assign({},e),{title:s.Utils.html.htmlDecodeSpecialChars(e.title)})))},handleChange:t=>u((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(v)?l().createElement(ai,{token:m,uniqid:v.uniqid,content:v.content,onChangeContent:(e,t)=>{u((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{u(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>u((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(v)?l().createElement(si,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(a=v.content.limit)&&void 0!==a?a:20,hook:{isActive:E},handlers:{jamespot:{datasource:q().datasource,network:q().network,filebank:q().filebank,wedoc:q().wedoc},handleStart:()=>h({busy:!0}),handleCatch:e=>u(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:f,onChange:(t,n)=>u((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>u(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetDatasourceTableType)(v)?l().createElement(ri,Object.assign({},v.content,{uri:v.content.uri,limit:null!==(r=v.content.limit)&&void 0!==r?r:20,hook:{isActive:E},handlers:{jamespot:{datasource:q().datasource,network:q().network,application:q().application,filebank:q().filebank},handleStart:()=>h({busy:!0}),handleCatch:e=>u(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>h({busy:!1})},onSave:f,onChange:(t,n)=>u((0,c.vR)(e,t,null!=n&&n)),onStateChange:h,onError:e=>{u(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},ui=u.O.getLazyComponent("Icon"),mi=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(Dn,null,l().createElement(Hn,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ui,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},gi=u.O.getLazyComponent("BETA_DragAndDrop"),pi=u.O.getLazyComponent("Icon"),Ei=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,r.useIntl)(),o=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,a=(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(fi,{uniqid:e}),o?a.map(((t,r)=>{const s=c.x0.definition(t.widget.name);return l().createElement("div",{key:r},l().createElement(Nn,null,l().createElement(Pn,{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(Vn,{onClick:()=>{n(c.x0.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},o.content),{widgets:[...a.filter(((e,t)=>t!==r)).map((e=>((0,k.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(pi,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},fi=({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(gi,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(bi,{uniqid:e,key:t}),elms:n||[]}),l().createElement(Z,{namespace:"default",onChange:n=>{t(c.x0.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},hi=({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(pi,{name:n.locked?"icon-lock":"icon-unlock"}))},yi=({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(pi,{name:n.visible?"icon-eye":"icon-eye-slash"}))},vi=({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(pi,{name:"icon-trash"}))},bi=({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(hi,{uniqid:e}),l().createElement(yi,{uniqid:e}),l().createElement(vi,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},xi=u.O.getLazyComponent("InputText"),Ci=({uniqid:e})=>{var t;const n=(0,r.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),{control:a,watch:s}=(0,rt.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(xi,{name:"text",width:"100%",control:a,placeholder:n.formatMessage({id:"WIDGET_Title"})}):l().createElement(l().Fragment,null)},wi=u.O.getLazyComponent("Loader"),ki=({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(Gn,null,l().createElement(wi,{size:"l"})))},qi=({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)},Oi=({uniqid:e})=>{var t;const n=(0,r.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(Bn,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Wi=u.O.getLazyComponent("Button"),Si=({uniqid:e,mode:t})=>{const n=(0,r.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),a=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),d.shallowEqual);return l().createElement(Wi,{onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;a&&o&&l&&("view"==t&&q().widget.updateWidget({uri:a,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"}))},Li=["widget-presence","widget-quick-survey","widget-check-list"],Ai=u.O.getLazyComponent("Icon"),Mi=({uniqid:e,position:t})=>{const n=(0,r.useIntl)(),o=(0,d.useDispatch)(),a=(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((()=>{a&&a.current&&(a.current.className=a.current.className+" animate")}),0)}),[]),s?l().createElement($n,null,l().createElement(Rn,{ref:a,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement(Un,null,u.panel.useWrapper?l().createElement(Hn,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(Ai,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(Hn,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(Ai,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(qi,{uniqid:e},l().createElement(Hn,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(Ai,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(jn,null,l().createElement(mi,{uniqid:e,position:s.position}),l().createElement(zn,null,n.formatMessage({id:u.label})),l().createElement(Dn,null,l().createElement(Hn,{onClick:()=>{o(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(Ai,{name:"icon-times",color:"grey2"})))),l().createElement(Fn,null,"default"===m&&u.panel.useEditor?l().createElement(di,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(Ci,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(Ei,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(ki,{uniqid:e}),l().createElement(Oi,{uniqid:e}),Li.includes(s.name)&&l().createElement(Si,{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)},Ti=a().div`
|
|
541
541
|
position: absolute;
|
|
542
542
|
inset: 0;
|
|
543
543
|
pointer-events: none;
|
|
@@ -555,5 +555,5 @@
|
|
|
555
555
|
`,ji=a().div`
|
|
556
556
|
width: ${440}px;
|
|
557
557
|
pointer-events: none;
|
|
558
|
-
`,
|
|
559
|
-
//# sourceMappingURL=724.
|
|
558
|
+
`,Di=()=>{const e=(0,d.useSelector)(c.cr.selectors.selectEditors,d.shallowEqual);return l().createElement(Ti,{className:"editor-portal-wrapper"},e.map(((e,t)=>"left"===e.position?l().createElement(_n,{isActive:!1,key:t},l().createElement(_i,null,l().createElement(Mi,{uniqid:e.uniqid,position:e.position}),l().createElement(Ii,{isActive:void 0!==e.popup},l().createElement(Kn,{uniqid:e.uniqid})),l().createElement(ji,null))):l().createElement(_n,{isActive:!1,key:t},l().createElement(_i,null,l().createElement(ji,null),l().createElement(Ii,{isActive:void 0!==e.popup},l().createElement(Kn,{uniqid:e.uniqid})),l().createElement(Mi,{uniqid:e.uniqid,position:e.position}))))))},zi=()=>i.createElement(i.Fragment,null);var $i=n(286);const Ri=()=>{const[e,t]=(0,i.useState)(),n=(0,r.useIntl)(),l=(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}),[]),o=(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)}}))}),[]),a=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{o({reject:i,resolve:n,text:e,capability:t})}))),[o]),c=(0,i.useMemo)((()=>({develop:e=>a(e,"develop"),summarize:e=>a(e,"summarize"),tldr:e=>a(e,"tldr"),en:e=>a(e,"en"),es:e=>a(e,"es"),formal:e=>a(e,"formal"),funny:e=>a(e,"funny")})),[a]);return{query:e,ext:(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(c,n)),[n,c]),isActive:l}},Fi=u.O.getLazyComponent("InputTinyMCE"),Gi=e=>{const t=(0,r.useIntl)(),n=(0,d.useDispatch)(),a=(0,o.useTheme)(),s=(0,d.useSelector)(c.Kx.selectors.selectAll),{query:u,ext:m,isActive:g}=Ri(),{open:p,onInsert:E,close:f,ext:h,isActive:y}=Ge(),v=(0,i.useMemo)((()=>[...y?[h]:[],...g?[m]:[]]),[m,h,g,y]),b=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),x=(0,i.useMemo)((()=>(0,xn.X)(s,a,b)),[s,b,a]),C=(0,i.useMemo)((()=>$i.p9),[]);return l().createElement(l().Fragment,null,C&&l().createElement(Fi,Object.assign({commonOptions:C,additionalExtensions:v,mentionsQueries:x},e)),g&&l().createElement(T,{query:u}),y&&l().createElement(Fe,{onInsert:E,open:p,close:f}))},Bi=u.O.getLazyComponent("InputTinyMCERaw"),Ui=e=>{const t=(0,r.useIntl)(),n=(0,d.useDispatch)(),a=(0,o.useTheme)(),s=(0,d.useSelector)(c.Kx.selectors.selectAll),{query:u,ext:m,isActive:g}=Ri(),{open:p,onInsert:E,close:f,ext:h,isActive:y}=Ge(),v=(0,i.useMemo)((()=>[...y?[h]:[],...g?[m]:[]]),[m,h,g,y]),b=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),x=(0,i.useMemo)((()=>(0,xn.X)(s,a,b)),[s,b,a]),C=(0,i.useMemo)((()=>$i.p9),[]);return l().createElement(l().Fragment,null,C&&l().createElement(Bi,Object.assign({commonOptions:C,additionalExtensions:v,mentionsQueries:x},e)),g&&l().createElement(T,{query:u}),y&&l().createElement(Fe,{onInsert:E,open:p,close:f}))},Hi=u.O.getLazyComponent("InputAudience"),Ni=u.O.getLazyComponent("Message"),Pi=u.O.getLazyComponent("Modal"),Vi=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:a,name:s="publishTo"})=>{const u=(0,r.useIntl)(),m=(0,d.useSelector)(c.Bx.selectors.selectNetworkPublic);return l().createElement(Pi,{open:e,closeHandler:t,title:null!=n?n:u.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(r.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),a()}}]},l().createElement(Ni,{variant:"warning",message:null!=o?o:u.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(Hi,{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 Ji=n(737);const Qi=u.O.getLazyComponent("Container"),Ki=u.O.getLazyComponent("AppColumn"),Xi=u.O.getLazyComponent("MainColumn");function Yi({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const a=(0,r.useIntl)(),{pathname:s}=(0,Ji.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:a.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?a.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,Ji.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(Qi,{mode:l},i.createElement(Ki,{mode:l,description:n,tabs:m,activeTab:d||""}),i.createElement(Xi,{mode:l,flex:!0},i.createElement(Ji.Outlet,null))))}}}]);
|
|
559
|
+
//# sourceMappingURL=724.4e810912c9eacc41e4bb.chunk.js.map
|