jamespot-react-core 1.1.177 → 1.1.178
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/235.bundle.js +83 -83
- package/build/235.bundle.js.map +1 -1
- package/build/app.bundle.js +136 -78
- package/build/app.bundle.js.map +1 -1
- package/package.json +4 -4
package/build/235.bundle.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[235],{235:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>O,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>fn,DisplayForm:()=>wn,EditorsPortal:()=>qi,Empty:()=>Wi,JRCInputTinyMCEWithExt:()=>Ai,JRCInputTinyMCEWithExtRaw:()=>Mi,ModalAudience:()=>ji,TwoColLayout:()=>Fi,WidgetList:()=>X,WidgetWrapperCore:()=>
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[235],{235:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>O,Audience:()=>w,Avatar:()=>p,CommentsBloc:()=>fn,DisplayForm:()=>wn,EditorsPortal:()=>qi,Empty:()=>Wi,JRCInputTinyMCEWithExt:()=>Ai,JRCInputTinyMCEWithExtRaw:()=>Mi,ModalAudience:()=>ji,TwoColLayout:()=>Fi,WidgetList:()=>X,WidgetWrapperCore:()=>on});var i=n(594),l=n.n(i),o=n(196),r=n.n(o),a=n(493),s=n(902),c=n(85),d=n(704),u=n(737);const m=u.default.registry.getLazyComponent("JRCAvatar"),g=u.default.registry.getLazyComponent("Icon"),p=e=>{var t;const n=(0,o.useTheme)(),i=(0,d.useSelector)(c.Bx.selectors.selectNetworkPublic);return e.uri===(null==i?void 0:i.uri)?l().createElement(g,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}):l().createElement(m,Object.assign({},e))},f=u.default.registry.getLazyComponent("FlexBox"),E=u.default.registry.getLazyComponent("ModalContent"),y=u.default.registry.getLazyComponent("ModalLayout"),h=u.default.registry.getLazyComponent("StyledHref"),v=u.default.registry.getLazyComponent("Tooltip"),b=u.default.registry.getLazyComponent("Typography"),x=r().div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
5
5
|
margin-bottom: 24px;
|
|
6
|
-
`,C=
|
|
6
|
+
`,C=r().a`
|
|
7
7
|
display: flex;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
align-items: center;
|
|
@@ -17,15 +17,15 @@
|
|
|
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,a.useIntl)(),
|
|
20
|
+
`,w=({audience:e,limit:t=2})=>{const n=(0,a.useIntl)(),r=(0,o.useTheme)(),[c,d]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(f,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(y,{closeHandler:()=>d(!1),enableClickAwayCloseModal:!0,open:c,variant:"fixed-height",maxHeight:"800px"},l().createElement(E,{title:n.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>d(!1)},l().createElement(x,null,e.map(((e,t)=>l().createElement(f,{key:`audience-${t}`,y:"center",gap:r.space.l},l().createElement(p,{size:5,uri:`${e.type}/${e.id}`}),l().createElement(h,{href:`${e.type}/${e.id}`},l().createElement(b,null,e.title)))))))))};var k=n(833),q=n.n(k);const W=u.default.registry.getLazyComponent("Loader"),S=u.default.registry.getLazyComponent("ModalContent"),L=u.default.registry.getLazyComponent("ModalLayout"),A=u.default.registry.getLazyComponent("Typography"),T=r().div`
|
|
21
21
|
padding: ${e=>e.theme.space.md}px;
|
|
22
|
-
`,M={response:void 0,loading:!0,error:void 0},O=({query:e})=>{const t=(0,a.useIntl)(),[n,
|
|
22
|
+
`,M={response:void 0,loading:!0,error:void 0},O=({query:e})=>{const t=(0,a.useIntl)(),[n,r]=(0,i.useState)(M),s=(0,o.useTheme)(),c=(0,i.useCallback)((e=>{r(M),q().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void r({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const n=e.result.text;r({error:void 0,loading:!1,response:n})})).catch((e=>{r({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(L,{zIndex:s.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{null==e||e.reject()}},l().createElement(S,{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(T,null,n.loading&&l().createElement(l().Fragment,null,l().createElement(W,null),l().createElement(A,{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);var _=n(206),j=n(743);const z=u.default.registry.getLazyComponent("EditorsPortal"),D=u.default.registry.getLazyComponent("ThemeProvider"),$=()=>{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,j.A)(),e.appendChild(t)),t})(e)),[e]);return t?(0,_.createPortal)(l().createElement(D,null,l().createElement(z,null)),t):null},R=r().div`
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: row;
|
|
25
25
|
flex-wrap: wrap;
|
|
26
26
|
gap: 10px;
|
|
27
27
|
justify-content: center;
|
|
28
|
-
`,F=
|
|
28
|
+
`,F=r().div`
|
|
29
29
|
border: 1px solid ${e=>e.theme.color.grey2};
|
|
30
30
|
border-radius: 8px;
|
|
31
31
|
cursor: pointer;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
opacity: 1;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
`,G=
|
|
53
|
+
`,G=r().div`
|
|
54
54
|
border: 2px solid ${e=>e.theme.color.primary};
|
|
55
55
|
height: ${e=>e.open?e.height:"54"}px;
|
|
56
56
|
border-radius: 8px;
|
|
@@ -60,14 +60,14 @@
|
|
|
60
60
|
transition: height 0.4s;
|
|
61
61
|
overflow: hidden;
|
|
62
62
|
flex-direction: column;
|
|
63
|
-
`,B=
|
|
63
|
+
`,B=r().div`
|
|
64
64
|
display: flex;
|
|
65
65
|
flex-direction: row;
|
|
66
66
|
flex-wrap: wrap;
|
|
67
67
|
justify-content: center;
|
|
68
68
|
gap: 10px;
|
|
69
69
|
${e=>e.column&&"flex-direction: column;"}
|
|
70
|
-
`,U=
|
|
70
|
+
`,U=r().div`
|
|
71
71
|
min-height: 50px;
|
|
72
72
|
display: flex;
|
|
73
73
|
justify-content: center;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
&:hover {
|
|
78
78
|
background-color: ${e=>e.theme.color.grey0};
|
|
79
79
|
}
|
|
80
|
-
`,H=
|
|
80
|
+
`,H=r().button`
|
|
81
81
|
display: flex;
|
|
82
82
|
align-items: center;
|
|
83
83
|
padding: ${e=>e.parentIsColumn?"36px 16px":"0 10px"};
|
|
@@ -98,34 +98,34 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
${(0,s.DashedFocusBorder)()}
|
|
101
|
-
`,N=
|
|
101
|
+
`,N=r().div`
|
|
102
102
|
display: flex;
|
|
103
103
|
flex-direction: ${e=>"row"===e.direction?"row":"column"};
|
|
104
104
|
align-items: ${e=>"row"===e.direction?"center":"flex-start"};
|
|
105
105
|
justify-content: ${e=>"row"===e.direction?"flex-start":"center"};
|
|
106
106
|
flex: 1;
|
|
107
107
|
${e=>e.gap&&`gap:${e.gap}px`}
|
|
108
|
-
`,P=u.default.registry.getLazyComponent("Button"),V=u.default.registry.getLazyComponent("ModalLayout"),Q=u.default.registry.getLazyComponent("ModalContent"),K=u.default.registry.getLazyComponent("Tooltip"),Y=u.default.registry.getLazyComponent("IconButton"),X=({mode:e,view:t,children:n,namespace:i="default",onChange:
|
|
108
|
+
`,P=u.default.registry.getLazyComponent("Button"),V=u.default.registry.getLazyComponent("ModalLayout"),Q=u.default.registry.getLazyComponent("ModalContent"),K=u.default.registry.getLazyComponent("Tooltip"),Y=u.default.registry.getLazyComponent("IconButton"),X=({mode:e,view:t,children:n,namespace:i="default",onChange:o})=>{const[r,s]=l().useState(!1),d=function(e){switch(e){case"widget-article-image":return[c.x0.definition(k.WidgetsName.ArticleTitle),c.x0.definition(k.WidgetsName.ArticleButton)];case"comment":return[c.x0.definition(k.WidgetsName.CheckList),c.x0.definition(k.WidgetsName.Presence),c.x0.definition(k.WidgetsName.QuickSurvey)];default:return[c.x0.definition(k.WidgetsName.ArticleTitle),c.x0.definition(k.WidgetsName.ArticleText),c.x0.definition(k.WidgetsName.ArticleImage),c.x0.definition(k.WidgetsName.ArticleButton),c.x0.definition(k.WidgetsName.ArticleSlider),c.x0.definition(k.WidgetsName.ArticleAttachment),c.x0.definition(k.WidgetsName.Presence)]}}(i),u=(0,a.useIntl)(),m={open:r,portalId:"react-modal",variant:"full-height",closeHandler:()=>s(!1)},g=e=>{o(c.x0.factory(e)),s(!1)};return l().createElement(l().Fragment,null,l().createElement(V,Object.assign({},m),l().createElement(Q,{onClickIconClose:m.closeHandler,buttons:"comment"===e?[{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Close"}),color:"cancel",clickHandler:()=>s(!1)}]:void 0,title:u.formatMessage({id:"WIDGET_Builder"})},"comment"===e?l().createElement(B,{column:!0},d.map(((e,t)=>l().createElement(H,{key:e.name,open:!0,full:!0,parentIsColumn:!0,index:t,onClick:()=>g(e.name)},l().createElement(N,{direction:"row",gap:12},l().createElement("img",{src:e.img}),l().createElement(N,{direction:"column"},l().createElement("h3",null,u.formatMessage({id:e.label})),l().createElement("p",null,u.formatMessage({id:e.description})))))))):l().createElement(R,null,d.map(((e,t)=>l().createElement(F,{key:t,onClick:()=>g(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},u.formatMessage({id:e.label})))))))),"custom"===e&&n?l().createElement("div",{onClick:()=>s(!0)},n):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(P,{onClick:()=>s(!0),variant:"outlined",minWidth:"100%"},u.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(R,null,d.map(((e,t)=>l().createElement(F,{key:t,onClick:()=>g(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},u.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e&&"edit"===t?l().createElement(Z,{widgets:d,onClick:g}):l().createElement(l().Fragment,null),"comment"===e&&"edit"===t?l().createElement(ee,{onClick:()=>{s(!0)}}):l().createElement(l().Fragment,null))},Z=({widgets:e,onClick:t})=>{const[n,o]=l().useState(!1),r=(0,a.useIntl)(),s=(0,i.useMemo)((()=>80*Math.ceil(e.length/2)+50+10),[e]);return l().createElement(l().Fragment,null,l().createElement(G,{open:n,height:s},l().createElement(U,{onClick:()=>o(!n)},r.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(B,null,e.map(((e,i)=>l().createElement(H,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},l().createElement("img",{src:e.img}),r.formatMessage({id:e.label})))))))},ee=({onClick:e})=>{const t=(0,a.useIntl)();return l().createElement(l().Fragment,null,l().createElement(K,{description:t.formatMessage({id:"COMMENT_Add_Widget"})},l().createElement(Y,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})))};var te=n(876);const ne=u.default.registry.getLazyComponent("InputFileAdvancedRaw"),ie=r().div`
|
|
109
109
|
width: 0;
|
|
110
110
|
height: 0;
|
|
111
111
|
overflow: hidden;
|
|
112
|
-
`,le=({children:e,initialFiles:t,initialClick:n,multiple:i,accept:
|
|
112
|
+
`,le=({children:e,initialFiles:t,initialClick:n,multiple:i,accept:o,onUploadStart:r,onUploadEnd:a,onUploadSuccess:s})=>{const u=l().useRef(null),m=(0,d.useSelector)(c.x0.selectors.selectToken),[g,p]=l().useState(0),[f,E]=l().useState(t);return l().useEffect((()=>{var e;n&&(null===(e=u.current)||void 0===e||e.click())}),[n]),l().useEffect((()=>{t.length!==f.length&&E(t)}),[t]),l().useEffect((()=>{s(f)}),[f]),l().useEffect((()=>{0===g&&a()}),[g]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;n&&(null===(e=u.current)||void 0===e||e.click())}},e),l().createElement(ie,null,l().createElement(ne,{ref:u,id:"widget-upload-file",name:"editorFiles",content:"",accept:o,multiple:i,token:m,onUploadStart:e=>{void 0!==e&&p((t=>t+e)),"function"==typeof r&&0!==e&&r()},onUploadSuccess:e=>{void 0!==e&&(p((e=>void 0!==e?e-1:0)),E((t=>i?[...t,e]:[e])))}})))},oe=u.default.registry.getLazyComponent("WidgetAttachment"),re=u.default.registry.getLazyComponent("WidgetEmptyInplace"),ae=u.default.registry.getLazyComponent("FileViewer"),se=r().div`
|
|
113
113
|
flex: 1;
|
|
114
|
-
`,ce=({widget:e,inplace:t,mode:n})=>{const
|
|
114
|
+
`,ce=({widget:e,inplace:t,mode:n})=>{const o=(0,a.useIntl)(),{uniqid:r}=e,{files:s}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,r)),d.shallowEqual),g=e=>{u(c.y8.actions.error({label:null!=e?e:o.formatMessage({id:"GLOBAL_Error"})}))};(0,i.useEffect)((()=>{u(c.x0.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),(0,i.useEffect)((()=>{u(c.x0.slice.actions.setWidgetState({uniqid:r,empty:!s||0===s.length}))}),[s]);const p=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"OnlyOfficeHook"))),f=[{label:o.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&q().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const n=t.result;((e,t)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,n)})).catch((()=>{u(c.y8.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],E=p?[{condition:e=>["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.mimetype),options:f}]:[];return void 0!==s?l().createElement(se,null,"view"!==n?l().createElement(oe,{files:s,onClick:()=>{},onError:g}):l().createElement(ae,{files:s,openWithOptions:E},(e=>l().createElement(oe,{files:s,onClick:t=>e(t),onError:g}))),t&&"view"!==n&&l().createElement(le,{initialFiles:s,initialClick:m,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&u((0,c.vR)(r,{files:e}))},onUploadStart:()=>{u(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{u(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},"edit"===n?l().createElement(re,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):l().createElement(l().Fragment,null))):l().createElement(l().Fragment,null)},de=u.default.registry.getLazyComponent("WidgetButton"),ue=r().div`
|
|
115
115
|
display: flex;
|
|
116
116
|
flex: 1;
|
|
117
117
|
justify-content: center;
|
|
118
118
|
align-items: center;
|
|
119
|
-
`,me=
|
|
119
|
+
`,me=r().div`
|
|
120
120
|
pointer-events: ${e=>e.clickable?"all":"none"};
|
|
121
121
|
cursor: pointer;
|
|
122
122
|
display: flex;
|
|
123
123
|
flex: 1;
|
|
124
124
|
justify-content: center;
|
|
125
125
|
align-items: center;
|
|
126
|
-
`,ge=({widget:e,mode:t})=>{const n=(0,d.useDispatch)(),{uniqid:
|
|
126
|
+
`,ge=({widget:e,mode:t})=>{const n=(0,d.useDispatch)(),{uniqid:o}=e,{text:r,url:a,target:s,color:u,backgroundColor:m,buttonSize:g,borderRadius:p,variant:f}=e.content;return(0,i.useEffect)((()=>{n(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!r||0===r.length}))}),[r]),l().createElement(ue,{onClick:()=>{"edit"===t&&n(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}},l().createElement(me,{clickable:"edit"!==t},l().createElement(de,{text:r,url:a,target:s,color:u,backgroundColor:m,buttonSize:g,borderRadius:p,variant:f})))},pe=u.default.registry.getLazyComponent("WidgetArticleGallery"),fe=u.default.registry.getLazyComponent("WidgetEmptyInplace"),Ee=u.default.registry.getLazyComponent("FileViewer"),ye=r().button`
|
|
127
127
|
cursor: pointer;
|
|
128
|
-
`,he=({widget:e,inplace:t,mode:n})=>{var i,
|
|
128
|
+
`,he=({widget:e,inplace:t,mode:n})=>{var i,o;const{uniqid:r}=e,{files:a}=e.content,s=(0,d.useDispatch)(),u=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,r)),d.shallowEqual);return l().useEffect((()=>{s(c.x0.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),void 0!==a?l().createElement(l().Fragment,null,"edit"===n?l().createElement(pe,{files:a,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(Ee,{files:a,openWithOptions:[]},(t=>{var n,i;return l().createElement(ye,null,l().createElement(pe,{files:a,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(le,{initialFiles:a,initialClick:u,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&s((0,c.vR)(r,{files:e}))},onUploadStart:()=>{s(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{s(c.x0.slice.actions.setWidgetState({uniqid:r,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)},ve=u.default.registry.getLazyComponent("WidgetImage"),be=u.default.registry.getLazyComponent("FileViewer"),xe=u.default.registry.getLazyComponent("WidgetEmptyInplace"),Ce=r().div`
|
|
129
129
|
position: absolute;
|
|
130
130
|
inset: 0;
|
|
131
131
|
background-color: rgba(0, 0, 0, 0.4);
|
|
@@ -138,16 +138,16 @@
|
|
|
138
138
|
&:hover {
|
|
139
139
|
opacity: 1;
|
|
140
140
|
}
|
|
141
|
-
`,we=
|
|
141
|
+
`,we=r().button`
|
|
142
142
|
cursor: pointer;
|
|
143
|
-
`,ke={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},qe=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:
|
|
143
|
+
`,ke={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},qe=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:r}=e,{file:s,useFilter:u}=e.content,m=(0,d.useDispatch)(),g=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,r)),d.shallowEqual),[p,f]=(0,i.useState)(void 0),E=(0,a.useIntl)();return(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:r,empty:!s}))}),[s]),(0,i.useEffect)((()=>{s&&f((0,k.formatImgUrl)({timestamp:s.dateModified?qe(s.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:s.uri}))}),[s]),l().createElement(l().Fragment,null,"edit"===o?void 0!==p?l().createElement(ve,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=u&&u}):l().createElement(l().Fragment,null):l().createElement(be,{files:[Object.assign(Object.assign({},ke),{path:p,mimetype:"image/png"})],openWithOptions:[]},(e=>l().createElement(we,{onClick:()=>e(0)},l().createElement(ve,{maxWidth:null!=t?t:600,uri:p,useFilter:null!=u&&u})))),n&&"edit"===o?l().createElement(le,{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)(r,{file:e[0]}))},onUploadStart:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{m(c.x0.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},void 0!==s?l().createElement(Ce,null,E.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(xe,{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.default.registry.getLazyComponent("FileViewer"),Ae=u.default.registry.getLazyComponent("WidgetEmptyInplace"),Te=u.default.registry.getLazyComponent("WidgetSlider"),Me=r().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
|
-
`,Oe={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},Ie=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},_e=({widget:e,mode:t,width:n})=>{const{uniqid:
|
|
150
|
+
`,Oe={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},Ie=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},_e=({widget:e,mode:t,width:n})=>{const{uniqid:o}=e,r=(0,Se.jL)(),a=(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({},Oe),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:Oe.mimetype,path:(0,k.formatImgUrl)({size:"fitx1200",uri:e.file?e.file.uri:"",from:"imagecache",timestamp:e.file&&e.file.dateModified?Ie(e.file.dateModified):Date.now()})})))]:[]),[e.content.slides]),f=(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?Ie(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)((()=>{a&&"edit"===t&&r(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}),[a]),(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)((()=>{r(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const E=(0,i.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),y=(0,i.useCallback)((()=>{r(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[r,e.uniqid,e.name]);return void 0===u?l().createElement("div",{ref:g,style:{width:"100%"}}):l().createElement(Me,{maxWidth:u&&u<s?u:s},l().createElement(Le,{files:p,openWithOptions:[]},(n=>{var i,a;return l().createElement(Te,{slides:f,maxWidth:u&&u<s?u:s,useDots:null===(i=e.content.useDots)||void 0===i||i,loop:null!==(a=e.content.loop)&&void 0!==a&&a,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 r(c.cr.slice.actions.registerEditor({uniqid:o,name:e.name}))}})})),E?l().createElement(Ae,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:y}):l().createElement(l().Fragment,null))},je=u.default.registry.getLazyComponent("WidgetArticleText"),ze=r().div`
|
|
151
151
|
width: 100%;
|
|
152
152
|
cursor: text;
|
|
153
153
|
p {
|
|
@@ -156,20 +156,20 @@
|
|
|
156
156
|
a {
|
|
157
157
|
word-wrap: break-word;
|
|
158
158
|
}
|
|
159
|
-
`,De=({widget:e,mode:t})=>{const{uniqid:n}=e,
|
|
159
|
+
`,De=({widget:e,mode:t})=>{const{uniqid:n}=e,r=(0,o.useTheme)(),{text:s}=e.content,m=(0,d.useDispatch)(),g=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,n)),d.shallowEqual),p=(0,d.useSelector)((e=>{var t;return null===(t=c.x0.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),f=(0,d.useSelector)(c.x0.selectors.selectToken),E=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),y=(0,d.useSelector)(c.Kx.selectors.selectAll),h=(0,a.useIntl)(),v=(0,i.useCallback)((e=>{m(c.y8.actions.error({label:null!=e?e:h.formatMessage({id:"GLOBAL_Error"})}))}),[m,h]);(0,i.useEffect)((()=>{m(c.x0.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const b=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(y,r,v)),[y,v,r]);return p?l().createElement(l().Fragment,null):l().createElement(ze,null,l().createElement(je,{autoFocus:g,text:null!=s?s:"",token:"edit"===t&&void 0!==f?f:"",tinyMCECommonOptions:"edit"===t&&E?{tinymceScriptSrc:"https://ecosysteme.jamespot.pro/js/tinymce/tinymce.min.js",commonOptions:E,mentionsQueries:b}:void 0,mode:t,onChange:e=>{m((0,c.vR)(n,{text:e}))}}))},$e=u.default.registry.getLazyComponent("WidgetArticleTitle"),Re=r().div`
|
|
160
160
|
flex: 1;
|
|
161
161
|
display: flex;
|
|
162
162
|
flex-direction: row;
|
|
163
163
|
align-items: center;
|
|
164
164
|
cursor: text;
|
|
165
|
-
`,Fe=
|
|
165
|
+
`,Fe=r().div`
|
|
166
166
|
display: flex;
|
|
167
167
|
flex-direction: row;
|
|
168
168
|
border-radius: 8px;
|
|
169
169
|
overflow: hidden;
|
|
170
170
|
margin: 4px;
|
|
171
171
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
172
|
-
`,Ge=
|
|
172
|
+
`,Ge=r().button`
|
|
173
173
|
display: flex;
|
|
174
174
|
width: 40px;
|
|
175
175
|
height: 40px;
|
|
@@ -181,18 +181,18 @@
|
|
|
181
181
|
&:hover {
|
|
182
182
|
background-color: ${e=>e.theme.color.grey1};
|
|
183
183
|
}
|
|
184
|
-
`,Be=({widget:e,inplace:t,mode:n})=>{const{uniqid:
|
|
184
|
+
`,Be=({widget:e,inplace:t,mode:n})=>{const{uniqid:o}=e,{text:r,color:a,heading:s}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.x0.selectors.isActive(e,o)),d.shallowEqual);return(0,i.useEffect)((()=>{u(c.x0.slice.actions.setWidgetState({uniqid:o,empty:!r||0===r.length}))}),[r]),l().createElement(Re,null,l().createElement($e,{text:r,color:a,heading:s,autoFocus:m,inplace:t,mode:n,onChange:e=>{u((0,c.vR)(o,{text:e}))}}),m&&"edit"===n?l().createElement(Ue,{heading:s,onClick:e=>{u((0,c.vR)(o,{heading:e}))}}):l().createElement(l().Fragment,null))},Ue=({heading:e="h1",onClick:t})=>l().createElement(Fe,null,["h1","h2","h3","h4"].map(((n,i)=>l().createElement(Ge,{key:i,isActive:e===n,onClick:()=>t(n)},n)))),He=u.default.registry.getLazyComponent("Button"),Ne=u.default.registry.getLazyComponent("ModalLayout"),Pe=u.default.registry.getLazyComponent("ModalContent"),Je=(r().button`
|
|
185
185
|
padding: ${e=>e.theme.space.md}px;
|
|
186
|
-
`,
|
|
186
|
+
`,r().div`
|
|
187
187
|
padding: ${e=>e.theme.space.md}px;
|
|
188
188
|
display: flex;
|
|
189
189
|
flex-direction: row-reverse;
|
|
190
|
-
`),Ve=({id:e,type:t,uniqid:n})=>{const
|
|
190
|
+
`),Ve=({id:e,type:t,uniqid:n})=>{const o=(0,d.useDispatch)(),r=(0,a.useIntl)(),[u,m]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(s.JRCIconButton,{iconSize:14,onClick:()=>m(!0),icon:"icon-trash"}),u&&l().createElement(Ne,{enableClickAwayCloseModal:!0,open:u,closeHandler:()=>m(!1)},l().createElement(Pe,{overflow:"scroll",title:r.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>m(!1)},r.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(Je,null,l().createElement(He,{label:r.formatMessage({id:"GLOBAL_Confirm"}),onClick:()=>{q().widget.removeWidget({id:e,type:t,uniqid:n}).then((()=>{o(c.x0.slice.actions.flushWidget({uniqid:n}))})).catch((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}}))))},Qe=r().div`
|
|
191
191
|
display: flex;
|
|
192
192
|
flex: 1;
|
|
193
193
|
flex-direction: row;
|
|
194
194
|
border-top: 1px solid ${e=>e.theme.color.grey1};
|
|
195
|
-
`,Ke=
|
|
195
|
+
`,Ke=r().button`
|
|
196
196
|
display: flex;
|
|
197
197
|
flex: 1;
|
|
198
198
|
justify-content: center;
|
|
@@ -201,21 +201,21 @@
|
|
|
201
201
|
&:hover {
|
|
202
202
|
background-color: ${e=>e.theme.color.grey0};
|
|
203
203
|
}
|
|
204
|
-
`,Ye=({name:e,uniqid:t,mode:n,collaborationRights:
|
|
204
|
+
`,Ye=({name:e,uniqid:t,mode:n,collaborationRights:o,handleOpenEditor:r})=>{const s=(0,a.useIntl)(),u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObject(e,t)),d.shallowEqual),g=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),d.shallowEqual),p=(0,i.useMemo)((()=>m&&g&&g.update||o&&o.update),[m,g,o]),f=(0,i.useMemo)((()=>m&&g&&g.delete),[m,g]),E=(0,i.useCallback)((()=>{u(c.cr.slice.actions.registerEditor({uniqid:t,name:e,mode:n}))}),[t,u,e,n]);return p&&(0,k.ensureWidgetObjectHasMinimumProperties)(m)?l().createElement(Qe,null,l().createElement(Ke,{onClick:null!=r?r:E},s.formatMessage({id:"WIDGET_Set_Widget"})),f&&l().createElement(Ve,{id:m.id,type:m.type,uniqid:t})):l().createElement(l().Fragment,null)},Xe=r().div`
|
|
205
205
|
position: absolute;
|
|
206
206
|
inset: 0;
|
|
207
207
|
display: flex;
|
|
208
208
|
justify-content: center;
|
|
209
209
|
align-items: center;
|
|
210
210
|
background-color: rgba(255, 255, 255, 0.4);
|
|
211
|
-
`,Ze=()=>l().createElement(Xe,null,l().createElement(s.JRCLoader,{size:"m"}));var et=n(655);const tt=
|
|
211
|
+
`,Ze=()=>l().createElement(Xe,null,l().createElement(s.JRCLoader,{size:"m"}));var et=n(655);const tt=r().div`
|
|
212
212
|
padding: ${e=>e.theme.space.md}px;
|
|
213
213
|
display: flex;
|
|
214
214
|
flex-direction: row;
|
|
215
215
|
fieldset {
|
|
216
216
|
margin: 0.2rem !important;
|
|
217
217
|
}
|
|
218
|
-
`,nt=({placeholder:e,handleClick:t})=>{const n=(0,a.useIntl)(),
|
|
218
|
+
`,nt=({placeholder:e,handleClick:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),[r,c]=(0,i.useState)(""),{control:u,watch:m,reset:g}=(0,et.useForm)({defaultValues:{label:r},criteriaMode:"all"});return(0,i.useEffect)((()=>{const e=m((e=>{var t;c(null!==(t=e.label)&&void 0!==t?t:"")}));return()=>e.unsubscribe()}),[m,o]),l().createElement(tt,null,l().createElement(s.JRCInputText,{name:"label",control:u,placeholder:e,width:"100%"}),l().createElement(s.JRCButton,{label:n.formatMessage({id:"GLOBAL_Confirm"}),disabled:!r.length,onClick:()=>{t(r),c(""),g()}}))},it=u.default.registry.getLazyComponent("WidgetCheckList"),lt=u.default.registry.getLazyComponent("WidgetCheckListEditor"),ot=(r().div`
|
|
219
219
|
display: flex;
|
|
220
220
|
flex-direction: row;
|
|
221
221
|
justify-content: space-between;
|
|
@@ -224,14 +224,14 @@
|
|
|
224
224
|
min-height: 24px;
|
|
225
225
|
border-radius: 4px;
|
|
226
226
|
padding: 4px 8px;
|
|
227
|
-
`,
|
|
227
|
+
`,r().div`
|
|
228
228
|
width: 100%;
|
|
229
229
|
display: flex;
|
|
230
230
|
gap: 14px;
|
|
231
231
|
padding: 16px;
|
|
232
|
-
`),
|
|
232
|
+
`),rt=r().div`
|
|
233
233
|
position: relative;
|
|
234
|
-
`,at=({widget:e,inplace:t,mode:n,onWidgetUpdate:
|
|
234
|
+
`,at=({widget:e,inplace:t,mode:n,onWidgetUpdate:o})=>{const r=(0,a.useIntl)(),{uniqid:m,content:g}=e,p=(0,d.useDispatch)(),[f,E]=(0,i.useState)(),[y,h]=(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]),W=(0,i.useMemo)((()=>x&&x.administrate),[x]),S=(0,i.useCallback)((e=>{p(c.y8.actions.error({label:null!=e?e:r.formatMessage({id:"GLOBAL_Error"})}))}),[p,r]),L=(0,i.useCallback)(((e,t)=>{p((0,c.vR)(e,t))}),[p]),A=(0,i.useCallback)((()=>{b&&(h(!0),q().widget.getWidget({uri:b,uniqid:m}).then((e=>{(0,k.ensureWidgetCheckListType)(e.result)&&L(m,e.result.content)})).catch((e=>!e.aborted&&S)).finally((()=>h(!1))))}),[m,S,b,L]),T=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"})}));E(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||A())}),[C,e.uniqid,b,S,p,A]);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((()=>L(e.uniqid,n))).catch((e=>S(e.errorMsg)))},O=(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(ot,null,l().createElement(lt,{token:v,uniqid:m,content:g,inplace:t,onChangeContent:L,onChangeWrapper:e=>{p(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>p((0,c.vR)(e.uniqid,t))})):l().createElement(u.RTProvider,{useRT:()=>{(0,te.AW)(e.uniqid)}},f&&l().createElement(s.JRCFileViewer,{files:O,openWithOptions:[]},(t=>l().createElement(rt,{key:e.uniqid},l().createElement(it,{limit:10,initialEntries:f,onFileClick:e=>e.id&&t(e.id),onItemCheckListChange:t=>((e,t)=>{b&&(y||(h(!0),q().widget.checkListRespond({uri:b,uniqid:e,index:t}).then((()=>{o&&o()})).catch((e=>{S(e.message),h(!1)}))))})(e.uniqid,t)}),g.edit&&l().createElement(nt,{handleClick:M,placeholder:r.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"})}),W&&v&&l().createElement(Ye,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!(!g.edit&&!w)},mode:n,handleOpenEditor:()=>{v?T(v):(h(!0),q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result})),T(e.result)})).finally((()=>h(!1))))}}),y&&l().createElement(Ze,null)))))},st=(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},ct=u.default.registry.getLazyComponent("WidgetTable"),dt=u.default.registry.getLazyComponent("Loader"),ut=u.default.registry.getLazyComponent("Button"),mt=u.default.registry.getLazyComponent("Html"),gt=(r().div``,r().div`
|
|
235
235
|
position: absolute;
|
|
236
236
|
inset: 0;
|
|
237
237
|
display: flex;
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
justify-content: center;
|
|
240
240
|
align-items: center;
|
|
241
241
|
gap: ${e=>e.theme.space.md}px;
|
|
242
|
-
`),pt=
|
|
242
|
+
`),pt=r().div`
|
|
243
243
|
position: absolute;
|
|
244
244
|
inset: 0;
|
|
245
245
|
display: flex;
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
background-color: ${e=>e.theme.color.grey2};
|
|
256
256
|
opacity: 0.9;
|
|
257
257
|
}
|
|
258
|
-
`,ft=({uniqid:e,uri:t,limit:n,tableHeadColor:
|
|
258
|
+
`,ft=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:f,mode:E})=>{const y=(0,a.useIntl)(),h=(0,Se.jL)(),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(!1),[w,W]=(0,i.useState)([]),[S,L]=(0,i.useState)([]),[A,T]=(0,i.useState)({order:"ascending",name:"unknown"}),[M,O]=(0,i.useState)(void 0),[I,_]=(0,i.useState)(""),j=(0,i.useMemo)((()=>c.x0.definition(k.WidgetsName.DatasourceTable)),[]),z=(0,i.useMemo)((()=>"studio"===M?[{type:[I]}]:[]),[M,I]),D=(0,i.useMemo)((()=>"doc"===M?[I]:[]),[M,I]),{rtLastObject:$}=(0,te.YL)(z,D),R=(0,i.useCallback)((()=>{t&&(C(!0),q().datasource.get(t,k.Format.VIEW).then((e=>{L(e.result.model),W(e.result.data),T(e.result.sort),O(e.result.datasource.datasourceType),_(e.result.datasource.datasourceIdentifier)})).finally((()=>C(!1))))}),[t]);(0,i.useEffect)((()=>{void 0!==t&&0!==m.length&&0===S.length&&R()}),[t,m,S,R]),(0,i.useEffect)((()=>{$&&R()}),[$,R]),(0,i.useEffect)((()=>{t||L([])}),[t]);const F=(0,i.useCallback)((()=>{h(c.cr.slice.actions.flushAllEditor()),setTimeout((()=>{h(c.cr.slice.actions.registerEditor({uniqid:e,name:k.WidgetsName.DatasourceTable}))}),0)}),[h,e]);(0,i.useEffect)((()=>{"view"!==E&&"preview"!==E||h(c.cr.slice.actions.flushAllEditor())}),[E,h]),(0,i.useEffect)((()=>{v||t||"edit"!==E||(F(),b(!0))}),[h,e,v,t,F,E]);const G=(0,i.useMemo)((()=>st(m,S)),[m,S]);return 0!==m.length||x||"edit"!==E?x?l().createElement(gt,null,l().createElement(dt,null)):l().createElement(l().Fragment,null,x||0!==w.length?l().createElement(ct,{rows:w,columns:G,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:f,tableDefaultSortOrder:A.order,tableDefaultSortName:A.name}):l().createElement(gt,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})),"edit"===E?l().createElement(pt,{onClick:F},l().createElement(mt,{__html:`${y.formatMessage({id:"WIDGET_Set_Widget"})} <b>${y.formatMessage({id:j.label})}</b>`})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null,l().createElement(gt,{onClick:F},l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:j.label}),l().createElement(ut,{label:"GLOBAL_Settings"})),l().createElement(pt,{onClick:F},l().createElement(mt,{__html:`${y.formatMessage({id:"WIDGET_Set_Widget"})} <b>${y.formatMessage({id:j.label})}</b>`})))},Et=u.default.registry.getLazyComponent("WidgetTable"),yt=u.default.registry.getLazyComponent("Loader"),ht=u.default.registry.getLazyComponent("Button"),vt=u.default.registry.getLazyComponent("Html"),bt=(r().div``,r().div`
|
|
259
259
|
position: absolute;
|
|
260
260
|
inset: 0;
|
|
261
261
|
display: flex;
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
justify-content: center;
|
|
264
264
|
align-items: center;
|
|
265
265
|
gap: ${e=>e.theme.space.md}px;
|
|
266
|
-
`),xt=
|
|
266
|
+
`),xt=r().div`
|
|
267
267
|
position: absolute;
|
|
268
268
|
inset: 0;
|
|
269
269
|
display: flex;
|
|
@@ -279,21 +279,21 @@
|
|
|
279
279
|
background-color: ${e=>e.theme.color.grey2};
|
|
280
280
|
opacity: 0.9;
|
|
281
281
|
}
|
|
282
|
-
`,Ct=({uniqid:e,uri:t,limit:n,tableHeadColor:
|
|
282
|
+
`,Ct=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableColumnsData:m=[],tableBorderRadius:g,tableSizedColumns:p,tableSizedColumnsWidth:f,mode:E})=>{const y=(0,a.useIntl)(),h=(0,Se.jL)(),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(!1),[w,W]=(0,i.useState)([]),[S,L]=(0,i.useState)([]),A=(0,i.useMemo)((()=>c.x0.definition(k.WidgetsName.ExcelDatasourceTable)),[]);(0,i.useEffect)((()=>{void 0!==t&&0!==m.length&&0===S.length&&(C(!0),q().datasource.get(t,k.Format.VIEW).then((e=>{L(e.result.model),W(e.result.data)})).finally((()=>C(!1))))}),[t,m,S]),(0,i.useEffect)((()=>{t||L([])}),[t]);const T=(0,i.useCallback)((()=>{h(c.cr.slice.actions.flushAllEditor()),setTimeout((()=>h(c.cr.slice.actions.registerEditor({uniqid:e,name:k.WidgetsName.ExcelDatasourceTable}))),0)}),[h,e]);(0,i.useEffect)((()=>{"view"!==E&&"preview"!==E||h(c.cr.slice.actions.flushAllEditor())}),[E,h]),(0,i.useEffect)((()=>{v||t||"edit"!==E||(T(),b(!0))}),[h,e,v,t,T,E]);const M=(0,i.useMemo)((()=>st(m,S)),[m,S]);return 0!==m.length||x||"edit"!==E?x?l().createElement(bt,null,l().createElement(yt,null)):l().createElement(l().Fragment,null,x||0!==w.length?l().createElement(Et,{rows:w,columns:M,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:s,tableRowColor:d,tableRowTextColor:u,tableBorderRadius:g,tableColumnsData:m,tableSizedColumns:p,tableSizedColumnsWidth:f}):l().createElement(bt,null,l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})),"edit"===E?l().createElement(xt,{onClick:T},l().createElement(vt,{__html:`${y.formatMessage({id:"WIDGET_Set_Widget"})} <b>${y.formatMessage({id:A.label})}</b>`})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null,l().createElement(bt,{onClick:T},l().createElement("img",{src:`/img/fast-intranet/${k.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:A.label}),l().createElement(ht,{label:"GLOBAL_Settings"})),l().createElement(xt,{onClick:T},l().createElement(vt,{__html:`${y.formatMessage({id:"WIDGET_Set_Widget"})} <b>${y.formatMessage({id:A.label})}</b>`})))},wt=r().div`
|
|
283
283
|
padding: ${e=>e.theme.space.md}px;
|
|
284
|
-
`,kt=
|
|
284
|
+
`,kt=r().a`
|
|
285
285
|
cursor: pointer;
|
|
286
286
|
color: ${e=>e.theme.color.secondary};
|
|
287
|
-
`,qt=
|
|
287
|
+
`,qt=r().div`
|
|
288
288
|
display: flex;
|
|
289
289
|
justify-content: center;
|
|
290
290
|
align-items: center;
|
|
291
|
-
`,Wt=({mode:e,uniqid:t,isClosed:n})=>{const
|
|
291
|
+
`,Wt=({mode:e,uniqid:t,isClosed:n})=>{const o=(0,a.useIntl)(),r=(0,d.useDispatch)(),s=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectUri(e,t)),d.shallowEqual),u=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,t)),d.shallowEqual),m=(0,i.useMemo)((()=>!(!u||!u.update)),[u]),g=(0,i.useCallback)((()=>{if("edit"===e||!m||!s)return;const i={isClosed:!n};q().widget.updateWidget({uri:s,uniqid:t,content:i,v2:!0}).then((()=>r(c.x0.slice.actions.updateWidget({uniqid:t,content:i})))).catch((()=>r(c.y8.actions.error({label:"WIDGET_Presence_Error"}))))}),[n,e,t,m,s,r]);return l().createElement(l().Fragment,null,m&&l().createElement(wt,null,l().createElement(qt,null,l().createElement(kt,{onClick:g},o.formatMessage({id:"WIDGET_Presence_Closing"})))))},St=u.default.registry.getLazyComponent("WidgetPresence"),Lt=u.default.registry.getLazyComponent("ModalUserList"),At=r().div`
|
|
292
292
|
display: flex;
|
|
293
293
|
flex: 1;
|
|
294
294
|
position: relative;
|
|
295
295
|
flex-direction: column;
|
|
296
|
-
`,Tt=(
|
|
296
|
+
`,Tt=(r().div`
|
|
297
297
|
position: absolute;
|
|
298
298
|
inset: 0;
|
|
299
299
|
background-color: rgba(255, 255, 255, 0.7);
|
|
@@ -301,47 +301,47 @@
|
|
|
301
301
|
flex: 1;
|
|
302
302
|
justify-content: center;
|
|
303
303
|
align-items: center;
|
|
304
|
-
`,({widget:e,mode:t})=>{const n=(0,a.useIntl)(),
|
|
304
|
+
`,({widget:e,mode:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),{limit:r,limitValue:s,closing:m,isClosed:g}=e.content,{uniqid:p}=e,[f,E]=(0,i.useState)({userValue:-1,userAvailableList:[],userUnavailableList:[],userAvailableTotal:0,userUnavailableTotal:0}),[y,h]=(0,i.useState)(!1),[v]=(0,i.useState)(new AbortController),[b,x]=(0,i.useState)(!1),[C,w]=(0,i.useState)(),[W,S]=(0,i.useState)(),L=(0,i.useRef)(v),A=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectUri(e,p)),d.shallowEqual),T=(0,d.useSelector)((e=>c.x0.selectors.selectAllWidgetRTObject(e,p)),d.shallowEqual),M=(0,i.useCallback)((()=>o(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[o]),O=(0,i.useMemo)((()=>!(r&&s&&f.userAvailableTotal>=s)),[r,s,f.userAvailableTotal]),I=(0,i.useMemo)((()=>m&&g||"edit"===t),[m,g,t]),_=(0,i.useCallback)((()=>{A&&!I&&(O?(h(!0),q().widget.presenceCancel({uri:A,uniqid:p}).catch(M).finally((()=>h(!1)))):o(c.y8.actions.error({label:"WIDGET_Presence_Limit_Response_Error"})))}),[o,p,M,A,O,I]),j=(0,i.useCallback)((e=>{A&&!I&&(h(!0),q().widget.presenceRespond({uri:A,uniqid:p,value:e},L.current.signal).catch(M).finally((()=>h(!1))))}),[A,p,M,I]),z=(0,i.useCallback)((()=>{"edit"!==t&&A&&(h(!0),q().widget.presenceGetResponse({uri:A,uniqid:p},L.current.signal).then((e=>{E(e.result)})).catch((e=>!e.aborted&&M())).finally((()=>h(!1))))}),[A,M,p,t]),D=(e,t)=>{A&&q().widget.presenceGetResponseUserList({uri:A,uniqid:p,index:e,page:t,limit:8},L.current.signal).then((e=>{S(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&M))},$=(0,i.useCallback)((()=>{A&&(h(!0),q().widget.getWidget({uri:A,uniqid:p}).then((e=>{(0,k.ensureWidgetPresenceType)(e.result)&&o((0,c.vR)(p,e.result))})).catch((e=>!e.aborted&&M)).finally((()=>h(!1))))}),[o,M,A,p]);return(0,i.useEffect)((()=>()=>{L&&L.current&&L.current.abort()}),[]),(0,i.useEffect)((()=>{z()}),[z]),(0,i.useEffect)((()=>{if(!Array.isArray(T))return;const e=T.at(-1);e&&A&&e.object.uri===A&&e.uniqid===p&&("widget-presence-response"===e.fn&&z(),"widget-update"===e.fn&&$())}),[T,z,p,A,$]),l().createElement(u.RTProvider,{useRT:()=>{(0,te.AW)(e.uniqid)}},l().createElement(At,null,l().createElement(St,{limit:r,limitValue:s,userAvailableList:f.userAvailableList,userUnavailableList:f.userUnavailableList,userValue:f.userValue,userAvailableTotal:null==f?void 0:f.userAvailableTotal,userUnavailableTotal:null==f?void 0:f.userUnavailableTotal,isClosed:m&&g,handleClickAvailable:()=>1===f.userValue?_():j(1),handleClickUnavailable:()=>0===f.userValue?_():j(0),handleOpenUsersModal:e=>{S({limit:0,page:0,data:[],cnt:0}),w(e),D(e),x(!0)}}),m&&!g&&l().createElement(Wt,{mode:t,uniqid:e.uniqid,isClosed:g}),"view"===t&&l().createElement(Ye,{uniqid:e.uniqid,name:e.name,mode:t}),y&&l().createElement(Ze,null),l().createElement(Lt,{open:b,usersList:W,title:1===C?n.formatMessage({id:"WIDGET_Presence_On"}):n.formatMessage({id:"WIDGET_Presence_Off"}),setOpen:x,onClose:()=>{S({limit:0,page:0,data:[],cnt:0})},handleLoadUsersList:e=>{D(null!=C?C:0,e)}})))}),Mt=u.default.registry.getLazyComponent("WidgetQuickSurvey"),Ot=u.default.registry.getLazyComponent("WidgetQuickSurveyEditor"),It=u.default.registry.getLazyComponent("ModalUserList"),_t=r().div`
|
|
305
305
|
width: 100%;
|
|
306
306
|
display: flex;
|
|
307
307
|
flex-direction: column;
|
|
308
308
|
gap: 14px;
|
|
309
309
|
${e=>e.withPadding&&"padding: 0 12px;"}
|
|
310
310
|
padding-top: 16px;
|
|
311
|
-
`,jt=({widget:e,inplace:t,mode:n})=>{var r,
|
|
311
|
+
`,jt=({widget:e,inplace:t,mode:n})=>{var o,r,m;const g=(0,a.useIntl)(),p=(0,d.useDispatch)(),{uniqid:f,content:E}=e,[y,h]=(0,i.useState)({userResponses:[],totalRespondent:0,totalResponse:0,userLoggedResponses:[]}),[v,b]=(0,i.useState)(!1),[x,C]=(0,i.useState)(!1),[w,W]=(0,i.useState)(),[S,L]=(0,i.useState)(),[A]=(0,i.useState)(new AbortController),T=(0,i.useRef)(A),M=(0,d.useSelector)(c.x0.selectors.selectToken,d.shallowEqual),O=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e.uniqid)),d.shallowEqual),I=(0,d.useSelector)((e=>c.x0.selectors.selectWidgetObjectRights(e,f)),d.shallowEqual),_=(0,d.useSelector)((t=>c.x0.selectors.selectAllWidgetRTObject(t,e.uniqid)),d.shallowEqual),j=(0,i.useCallback)(((e,t)=>{p((0,c.vR)(e,t))}),[p]),z=t=>{p(c.cr.slice.actions.flushAllEditor()),p(c.x0.slice.actions.setToken({token:t})),p(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:k.WidgetsName.QuickSurvey}))},D=(0,i.useCallback)((()=>p(c.y8.actions.error({label:"WIDGET_Presence_Error"}))),[p]),$=(0,i.useCallback)((e=>{"edit"!==n&&O&&(C(!0),q().widget.quickSurveyGetResponse({uri:O,uniqid:e},T.current.signal).then((e=>{h(e.result)})).catch((e=>!e.aborted&&D)).finally((()=>C(!1))))}),[D,O,n]),R=(0,i.useCallback)((()=>{O&&(C(!0),q().widget.getWidget({uri:O,uniqid:f},T.current.signal).then((e=>{j(f,e.result.content)})).catch((e=>!e.aborted&&D)).finally((()=>C(!1))))}),[f,D,O,j]),F=()=>{if(O&&E.closing){const e=Object.assign(Object.assign({},E),{isClosed:!0});q().widget.updateWidget({uri:O,uniqid:f,content:e}).catch((()=>{D()}))}},G=t=>{(t=>{"edit"!==n&&O&&(C(!0),q().widget.quickSurveyRespond({uri:O,index:t,multi:E.multi?1:0,uniqid:f},T.current.signal).then((()=>{$(e.uniqid)})).catch((e=>!e.aborted&&D)).finally((()=>C(!1))))})(t)},B=(e,t)=>{O&&q().widget.quickSurveyGetResponseUserList({uri:O,uniqid:f,index:e,page:t,limit:8},T.current.signal).then((e=>{L(Object.assign(Object.assign({},e.result),{data:[...e.result.data],cnt:e.result.cnt}))})).catch((e=>!e.aborted&&D))},U=(0,i.useMemo)((()=>I&&I.update),[I]);(0,i.useEffect)((()=>{$(e.uniqid)}),[$,e.uniqid]),(0,i.useEffect)((()=>{if(!Array.isArray(_))return;const t=_.at(-1);t&&O&&t.object.uri===O&&t.uniqid===e.uniqid&&("widget-quick-survey-response"===t.fn&&$(e.uniqid),"widget-update"===t.fn&&R())}),[_,O,e.uniqid,R,$]);const H=(0,i.useMemo)((()=>{if(!Array.isArray(E.arr))return[];const e=[];return E.arr.forEach((t=>{t.file&&e.push(t.file)})),e}),[E]);return(0,i.useEffect)((()=>{M||"edit"!==n||q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result}))}))}),[n,M,p]),"edit"===n&&t?l().createElement(_t,{withPadding:!0},l().createElement(Ot,{token:M,uniqid:f,content:e.content,onChangeContent:j,onChangeWrapper:e=>{p(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:e=>j(f,e),inplace:t})):l().createElement(u.RTProvider,{useRT:()=>{(0,te.AW)(e.uniqid)}},l().createElement(_t,null,l().createElement(s.JRCFileViewer,{files:H,openWithOptions:[]},(t=>{var n,i,o,r,a,s,c;return l().createElement(Mt,{limit:null!==(n=y.totalResponse)&&void 0!==n?n:0,values:null!==(i=E.arr)&&void 0!==i?i:[],userResponses:y.userResponses,userHasAlreadyVoted:y.userLoggedResponses.length>0,canCloseSurvey:null!==(o=e.content.closing)&&void 0!==o&&o,isClosed:null!==(r=e.content.isClosed)&&void 0!==r&&r,open:null!==(a=e.content.open)&&void 0!==a&&a,anonymize:null!==(s=e.content.anonymize)&&void 0!==s&&s,seeResponseAfter:null!==(c=e.content.seeResponseAfter)&&void 0!==c&&c,canUpdate:U,handleClickFile:e=>e.id&&t(e.id),handleCloseSurvey:F,handleProgressBarClick:G,setOpenUsersModal:e=>{W(e),B(e),b(!0)}})})),E.open&&l().createElement(nt,{handleClick:e=>{var t;if(!O)return;const n=Object.assign(Object.assign({},E),{arr:[...null!==(t=E.arr)&&void 0!==t?t:[],{title:e}]});q().widget.quickSurveyAddEnty({uri:O,uniqid:f,label:e}).then((()=>{p(c.x0.slice.actions.updateWidget({uniqid:f,content:n}))})).catch(D)},placeholder:g.formatMessage({id:"FIELDS_Add_Option"})}),U&&l().createElement(Ye,{uniqid:e.uniqid,name:e.name,collaborationRights:{update:!!U},mode:n,handleOpenEditor:()=>{M?z(M):(C(!0),q().network.token().then((e=>{p(c.x0.slice.actions.setToken({token:e.result})),z(e.result)})).finally((()=>C(!1))))}}),x&&l().createElement(Ze,null),l().createElement(It,{open:v,usersList:S,title:null!==(m=null===(r=null===(o=E.arr)||void 0===o?void 0:o[null!=w?w:0])||void 0===r?void 0:r.title)&&void 0!==m?m:"",setOpen:b,handleLoadUsersList:e=>{B(null!=w?w:0,e)},onClose:()=>{L({limit:0,page:0,data:[],cnt:0})}})))},zt=r().div`
|
|
312
312
|
padding: ${e=>e.theme.space.md}px;
|
|
313
313
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
314
|
-
`,Dt=({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(zt,null,l().createElement(s.JRCHtml,{__html:null!==(t=n.title)&&void 0!==t?t:""})))},$t=({uniqid:e})=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),
|
|
314
|
+
`,Dt=({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(zt,null,l().createElement(s.JRCHtml,{__html:null!==(t=n.title)&&void 0!==t?t:""})))},$t=({uniqid:e})=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>{var n;return null===(n=c.x0.selectors.selectWidget(t,e))||void 0===n?void 0:n.title}),d.shallowEqual),{control:r,watch:u}=(0,et.useForm)({defaultValues:{widgetTitle:o},criteriaMode:"all"});return(0,i.useEffect)((()=>{const t=u((t=>{n(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.widgetTitle}))}));return()=>t.unsubscribe()}),[u,n,e]),l().createElement(s.JRCInputText,{name:"widgetTitle",control:r,placeholder:t.formatMessage({id:"GLOBAL_Title"}),width:"100%",margin:"0"})},Rt=u.default.registry.getLazyComponent("Button"),Ft=u.default.registry.getLazyComponent("ModalLayout"),Gt=u.default.registry.getLazyComponent("ModalContent"),Bt=r().div`
|
|
315
315
|
padding: ${e=>e.theme.space.md}px;
|
|
316
316
|
display: flex;
|
|
317
317
|
flex-direction: row-reverse;
|
|
318
|
-
`,Ut=
|
|
318
|
+
`,Ut=r().div`
|
|
319
319
|
flex: 1;
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: row;
|
|
322
322
|
gap: ${e=>e.theme.space.sm}px;
|
|
323
323
|
padding: ${e=>e.theme.space.sm}px;
|
|
324
324
|
border-bottom: 1px solid ${e=>e.theme.color.grey1};
|
|
325
|
-
`,Ht=
|
|
325
|
+
`,Ht=r().div`
|
|
326
326
|
flex: 1;
|
|
327
327
|
display: flex;
|
|
328
328
|
fieldset:first-of-type {
|
|
329
329
|
margin: 0px !important;
|
|
330
330
|
}
|
|
331
|
-
`,Nt=
|
|
331
|
+
`,Nt=r().div`
|
|
332
332
|
display: flex;
|
|
333
333
|
gap: ${e=>e.theme.space.sm}px;
|
|
334
|
-
`,Pt=({uniqid:e,name:t,handleOpenEditor:n})=>{const
|
|
334
|
+
`,Pt=({uniqid:e,name:t,handleOpenEditor:n})=>{const o=(0,Se.jL)(),r=(0,a.useIntl)(),[d,u]=(0,i.useState)(!1),m=(0,i.useCallback)((()=>{o(c.cr.slice.actions.registerEditor({uniqid:e,name:t,mode:"edit"}))}),[e,o,t]),g=(0,i.useCallback)((()=>{o(c.x0.slice.actions.flushWidget({uniqid:e}))}),[e,o]);return l().createElement(l().Fragment,null,l().createElement(Ut,null,l().createElement(Ht,null,l().createElement($t,{uniqid:e})),l().createElement(Nt,null,l().createElement(s.JRCIconButton,{icon:"icon-pencil",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:null!=n?n:m,title:r.formatMessage({id:"BUTTON_Title_Open_Edit_Panel"})}),l().createElement(s.JRCIconButton,{icon:"icon-trash",bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:14,onClick:()=>u(!0),title:r.formatMessage({id:"BUTTON_Title_Open_Remove_Widget"})}))),d&&l().createElement(Ft,{enableClickAwayCloseModal:!0,open:d,closeHandler:()=>u(!1)},l().createElement(Gt,{overflow:"scroll",title:r.formatMessage({id:"WIDGET_Remove_Widget"}),onClickIconClose:()=>u(!1)},r.formatMessage({id:"WIDGET_Delete_Widget_Confirmation"})),l().createElement(Bt,null,l().createElement(Rt,{label:r.formatMessage({id:"GLOBAL_Confirm"}),onClick:g}))))},Jt=r().div`
|
|
335
335
|
display: flex;
|
|
336
336
|
flex: 1;
|
|
337
337
|
flex-direction: column;
|
|
338
|
-
`,Vt=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:
|
|
338
|
+
`,Vt=({widget:e,width:t,inplace:n=!1,mode:i="view",onWidgetUpdate:o,cannotDisplayComponent:r})=>{const{name:a}=e;return(0,k.ensureWidgetArticleButtonType)(e)?l().createElement(ge,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleGalleryType)(e)?l().createElement(he,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleAttachmentType)(e)?l().createElement(ce,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleImageType)(e)?l().createElement(We,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleSliderType)(e)?l().createElement(_e,{widget:e,inplace:n,mode:i,width:null!=t?t:800}):(0,k.ensureWidgetArticleTitleType)(e)?l().createElement(Be,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetArticleTextType)(e)?l().createElement(De,{widget:e,inplace:n,mode:i}):(0,k.ensureWidgetExcelDatasourceTableType)(e)?l().createElement(Jt,null,l().createElement(Dt,{uniqid:e.uniqid}),l().createElement(Ct,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetDatasourceTableType)(e)?l().createElement(Jt,null,l().createElement(Dt,{uniqid:e.uniqid}),l().createElement(ft,Object.assign({},e.content,{uniqid:e.uniqid,mode:i}))):(0,k.ensureWidgetCheckListType)(e,"widget-check-list"===e.name)?l().createElement(Jt,null,"edit"===i?l().createElement(Pt,{name:e.name,uniqid:e.uniqid}):l().createElement(Dt,{uniqid:e.uniqid}),l().createElement(at,{widget:e,inplace:n,mode:i,onWidgetUpdate:o})):(0,k.ensureWidgetPresenceType)(e)?l().createElement(Jt,null,"edit"===i?l().createElement(Pt,{name:e.name,uniqid:e.uniqid}):l().createElement(Dt,{uniqid:e.uniqid}),l().createElement(Tt,{widget:e,inplace:n,mode:i})):(0,k.ensureWidgetQuickSurveyType)(e)?l().createElement(Jt,null,"edit"===i?l().createElement(Pt,{name:e.name,uniqid:e.uniqid}):l().createElement(Dt,{uniqid:e.uniqid}),l().createElement(jt,{widget:e,inplace:n,mode:i})):r?l().createElement(l().Fragment,null,r(a)):l().createElement(l().Fragment,null,"cannot display widget (",a,")")},Qt=(r().div`
|
|
339
339
|
height: 0;
|
|
340
340
|
overflow: hidden;
|
|
341
|
-
`,
|
|
341
|
+
`,r().div`
|
|
342
342
|
color: ${e=>e.theme.color.grey3};
|
|
343
343
|
font-style: italic;
|
|
344
|
-
`,
|
|
344
|
+
`,r().div`
|
|
345
345
|
display: flex;
|
|
346
346
|
flex: 1;
|
|
347
347
|
width: 100%;
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
filter: grayscale(1);
|
|
368
368
|
opacity: 0.4;
|
|
369
369
|
}
|
|
370
|
-
`,
|
|
370
|
+
`,r().div`
|
|
371
371
|
position: absolute;
|
|
372
372
|
inset: 0;
|
|
373
373
|
display: flex;
|
|
@@ -375,42 +375,42 @@
|
|
|
375
375
|
justify-content: center;
|
|
376
376
|
align-items: center;
|
|
377
377
|
min-height: 200px;
|
|
378
|
-
`,
|
|
378
|
+
`,r().div`
|
|
379
379
|
display: flex;
|
|
380
|
-
`),Kt=
|
|
380
|
+
`),Kt=r().div`
|
|
381
381
|
position: absolute;
|
|
382
382
|
inset: 0;
|
|
383
383
|
opacity: ${e=>e.opacity};
|
|
384
384
|
background-color: ${e=>e.backgroundColor};
|
|
385
385
|
pointer-events: ${e=>e.pointerEvents};
|
|
386
|
-
`,Yt=u.default.registry.getLazyComponent("DoubleClick"),Xt=({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(Zt,{uniqid:e,key:t,mode:"edit"}))))},Zt=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(Kt,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(en,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(Kt,{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(en,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},en=({uniqid:e,layerId:t,mode:n})=>{const i=(0,d.useDispatch)(),
|
|
386
|
+
`,Yt=u.default.registry.getLazyComponent("DoubleClick"),Xt=({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(Zt,{uniqid:e,key:t,mode:"edit"}))))},Zt=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(Kt,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(en,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(Kt,{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(en,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},en=({uniqid:e,layerId:t,mode:n})=>{const i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>t.widgets.ids[e]),d.shallowEqual),r=(0,d.useSelector)((e=>e.widgets.layers[t]));return o&&r&&r.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:r.position.y,left:r.position.x}},l().createElement(rn,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(tn,{position:{x:r.position.x,y:r.position.y},onMouseUp:e=>{(r.position&&r.position.x!==e.x||r.position&&r.position.y!==e.y)&&(e=>{i(c.x0.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(Yt,{onDoubleTap:()=>((e,t)=>{i(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(rn,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},tn=({position:e,children:t,onMouseUp:n})=>{const[o,r]=l().useState(!1),[a,s]=l().useState({x:0,y:0}),[c,d]=l().useState({x:0,y:0}),[u,m]=l().useState({x:e.x,y:e.y}),g=l().useRef(null),p=(0,i.useCallback)((e=>{r(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),f=l().useCallback((e=>{if(o&&g.current){const t=c.x+(e.clientX-a.x),n=c.y+(e.clientY-a.y);m({x:t,y:n})}}),[a.x,a.y,o,c.x,c.y]),E=(0,i.useCallback)((()=>{r(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return l().useEffect((()=>(document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E)})),[f,E]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},nn=u.default.registry.getLazyComponent("Loader"),ln=({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(nn,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}))},on=({uniqid:e,widgetObject:t,widget:n,inplace:o=!0,mode:r,width:a,onWidgetUpdate:s,cannotDisplayComponent:u})=>{const m=(0,d.useDispatch)(),g=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),p=(0,d.useSelector)((t=>t.widgets.editableMap[e]),d.shallowEqual),f=(0,d.useSelector)((e=>e.widgets.currentEditableWidgetId),d.shallowEqual),E=(0,d.useSelector)((t=>t.widgets.currentEditableWidgetId===e),d.shallowEqual),{ref:y,isComponentVisible:h,setIsComponentVisible:v}=(0,te.xv)(!1);if((0,i.useEffect)((()=>{t&&m(c.x0.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{n&&m(c.x0.slice.actions.registerWidget({uniqid:e,widget:n}))}),[]),(0,i.useEffect)((()=>{h||e===f&&m(c.x0.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[h]),(0,i.useEffect)((()=>{h!==E&&v(E)}),[E]),void 0===g)return l().createElement(l().Fragment,null,"This widget cannot be displayed");const b=g.widget,x=()=>{"edit"===r?C():(0,k.ensureWidgetArticleButtonType)(b)&&"link"===b.content.openingType&&b.content.openingTypeLink&&window.open(b.content.openingTypeLink.url,b.content.openingTypeLink.target)},C=()=>{if("view"===r)return;const{widget:e}=g;m(c.cr.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return o&&"view"!==r?l().createElement(Qt,{ref:y,onClick:()=>{v(!0),p&&(m(c.x0.slice.actions.setEditableIndex({index:p.index})),m(c.x0.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(Vt,{width:a,widget:Object.assign(Object.assign({},g.widget),g.title&&{title:g.title}),inplace:o,mode:r,onClick:x}),l().createElement(Xt,{uniqid:e,mode:r}),l().createElement(ln,{name:g.widget.name,uniqid:g.widget.uniqid,inplace:o})):l().createElement(Qt,{onClick:C},l().createElement(Vt,{widget:Object.assign(Object.assign({},g.widget),g.title&&{title:g.title}),inplace:o,mode:r,width:a,onClick:x,onWidgetUpdate:s,cannotDisplayComponent:u}),l().createElement(Xt,{uniqid:e,mode:r}),l().createElement(ln,{name:g.widget.name,uniqid:g.widget.uniqid,inplace:o}))},rn=on,an=r().div`
|
|
387
387
|
border-radius: ${e=>e.theme.space.sm}px;
|
|
388
388
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
389
389
|
background-color: ${e=>e.theme.color.white};
|
|
390
390
|
overflow: hidden;
|
|
391
|
-
`,sn=u.default.registry.getLazyComponent("Message"),cn=({widgets:e})=>{const t=(0,a.useIntl)(),n=(0,d.useSelector)(c.x0.selectors.selectFlushedWidgets,d.shallowEqual);return l().createElement(l().Fragment,null,e.filter((e=>!n.includes(e.widget.uniqid))).map((e=>e&&e.widget&&l().createElement(an,{key:e.widget.uniqid},l().createElement(
|
|
391
|
+
`,sn=u.default.registry.getLazyComponent("Message"),cn=({widgets:e})=>{const t=(0,a.useIntl)(),n=(0,d.useSelector)(c.x0.selectors.selectFlushedWidgets,d.shallowEqual);return l().createElement(l().Fragment,null,e.filter((e=>!n.includes(e.widget.uniqid))).map((e=>e&&e.widget&&l().createElement(an,{key:e.widget.uniqid},l().createElement(rn,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",cannotDisplayComponent:e=>l().createElement(sn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))},dn=u.default.registry.getLazyComponent("Message"),un=e=>{const t=(0,a.useIntl)(),{widgets:n,comment:i,inplace:o,mode:r,handleWidgetUpdate:s}=e,u=(0,d.useSelector)(c.x0.selectors.selectFlushedWidgets,d.shallowEqual);return l().createElement(l().Fragment,null,n.filter((e=>!u.includes(e.widget.uniqid))).map((e=>e&&l().createElement(an,{key:e.widget.uniqid},l().createElement(rn,{uniqid:e.widget.uniqid,widgetObject:i,widget:e,inplace:o,mode:r,onWidgetUpdate:s,cannotDisplayComponent:e=>l().createElement(dn,{variant:"info",message:t.formatMessage({id:"WIDGET_Cannot_Display"},{widget:e})})})))))};var mn=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function a(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}s((i=i.apply(e,t||[])).next())}))};const gn=u.default.registry.getLazyComponent("JRCCommentsBloc"),pn=r().div`
|
|
392
392
|
display: flex;
|
|
393
393
|
flex-direction: column;
|
|
394
394
|
gap: 4px;
|
|
395
395
|
flex: 1;
|
|
396
396
|
width: 100%;
|
|
397
397
|
margin-top: 10px;
|
|
398
|
-
`,fn=({articleId:e,variant:t="inline",canComment:n,commentType:
|
|
398
|
+
`,fn=({articleId:e,variant:t="inline",canComment:n,commentType:r="comment",socialQuestion:s})=>{var m;const g=(0,a.useIntl)(),p=(0,o.useTheme)(),f=(0,d.useDispatch)(),[E,y]=(0,i.useState)(),[h,v]=(0,i.useState)(!1),[b,x]=(0,i.useState)([]),[C,w]=(0,i.useState)(!1),k=(0,d.useSelector)(c.xJ.selectors.get),W=(0,d.useSelector)(c.x0.selectors.selectWidgets),S=(0,d.useSelector)(c.sU.selectors.selectTinyMCECommonOptions),L=(0,d.useSelector)(c.sU.selectors.selectTinyMCEExtendedOptions),A=(0,d.useSelector)(c.Kx.selectors.selectAll),T=(0,d.useSelector)(c.OD.selectors.selectPlatformConfig),M=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"OnlyOfficeHook"))),O=(0,d.useSelector)((t=>c.Mw.selectors.commentList(t,e))),_=(0,d.useSelector)((e=>c.qn.selectors.selectHook(e,"DriveHook"))),j=(0,d.useSelector)((e=>c.lg.selectors.selectById(e,"FileBankHook"))),z=(0,d.useSelector)((e=>c.qn.selectors.selectHook(e,"WidgetHook"))),[D,R]=(0,i.useState)(s);(0,I.A)(e),((e,t)=>{const n=(0,d.useDispatch)(),l=(0,i.useMemo)((()=>u.default.socket),[]),o=(0,i.useMemo)((()=>c.Mw.getCommentsLikeRTHandlers(n,e,t)),[n,e,t]);(0,i.useEffect)((()=>(o.forEach((e=>{l.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{l.offMessage(e.namespace,e.function,e.handler)}))})),[o,l])})(null==O?void 0:O.list.map((e=>e.id)),e);const F=(0,i.useCallback)((e=>{f(c.y8.actions.error({label:null!=e?e:g.formatMessage({id:"GLOBAL_Error"})}))}),[f,g]),G=()=>{f(c.Mw.actions.fetchComments({idArticle:e})),B()},B=(0,i.useCallback)((()=>{E||C||(w(!0),q().network.token().then((e=>{y(e.result),w(!1),f(c.x0.slice.actions.setToken({token:e.result}))})).catch((e=>{F(e.errorMsg)})))}),[F,E,C,f]),U=(0,i.useCallback)((t=>mn(void 0,void 0,void 0,(function*(){if(E){v(!0);const n=Object.keys(W).map((e=>(null==b?void 0:b.some((t=>t.widget.uniqid===e)))?W[e]:null)).filter((e=>null!==e));try{yield q().article.addComment(Object.assign(Object.assign({},t),{widgets:n,token:E,idArticle:e,type:r})).then((()=>{x([])})),B()}catch(e){F(e.errorMsg)}finally{v(!1)}}}))),[e,r,B,F,E,W,b]);return(0,i.useEffect)((()=>{B()}),[B]),(0,i.useEffect)((()=>{f(c.Mw.actions.fetchComments({idArticle:e}))}),[e,f]),(0,i.useEffect)((()=>{O&&O.list&&O.list.forEach((e=>{var t;null===(t=e._widgets)||void 0===t||t.forEach((t=>{f(c.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),f(c.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))}))}))}),[O,f]),l().createElement(l().Fragment,null,S&&L&&l().createElement(l().Fragment,null,l().createElement(pn,null,l().createElement(gn,{canComment:n,loading:h,token:E,comments:null==O?void 0:O.list,onComment:U,onCommentUpdate:t=>mn(void 0,void 0,void 0,(function*(){var n,i;const l=null==O?void 0:O.list.find((e=>e.id===t.idComment));if(l)return q().article.updateComment({idComment:t.idComment,description:null!==(i=null!==(n=t.description)&&void 0!==n?n:l.description)&&void 0!==i?i:void 0,token:t.token,widgets:t.widgets}).then((()=>{f(c.Mw.actions.fetchComments({idArticle:e})),B()})).catch((e=>{F(e.errorMsg)}))})),onCommentDelete:e=>mn(void 0,void 0,void 0,(function*(){q().article.deleteComment(e).catch(F)})),isWidgetActive:!!((null==z?void 0:z.isActive)&&(null==z?void 0:z.create)&&(null===(m=null==z?void 0:z.autorize)||void 0===m?void 0:m.includes("comment"))),widgetListComponent:l().createElement(X,{mode:"comment",namespace:"comment",onChange:e=>{x([e]),f(c.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e})),y(void 0),B()},view:"edit"}),newWidgetsWrapperComponent:l().createElement(cn,{widgets:b}),existingWidgetsWrapperComponent:(e,t,n,i=!0)=>l().createElement(un,{comment:e,widgets:t,mode:n,inplace:i,handleWidgetUpdate:G,handleWidgetRemove:B}),currentUser:k,tinyMCEConfig:{commonOptions:Object.assign(Object.assign({},S),{toolbar:L.commentsToolbar}),mentionsQueries:(0,u.getTinyMCEMentionsQueries)(A,p,F)},onError:F,highlightFields:T.userHighlightFields,userAccountStatus:T.userAccountStatus,userModel:A.find((e=>"user"===e.type)),isWedocActive:!!M,onGetHashError:e=>f(c.y8.actions.error({label:null!=e?e:g.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...j&&_?["fileBank"]:[],...c.qn.utils.buildDrivesArrayFromObject(null==_?void 0:_.drives)],variant:t,handlers:{drive:q().drive,filebank:q().filebank,file:q().file,user:q().user,socialAction:q().socialAction,questionAnswer:q().questionAnswer},socialQuestion:D?Object.assign(Object.assign({},D),{onSelectResponse:e=>{R(Object.assign(Object.assign({},D),{responseId:e,isResolved:!0}))},onUnselectResponse:()=>{R(Object.assign(Object.assign({},D),{responseId:void 0,isResolved:!1}))}}):void 0,articleId:e}),l().createElement($,null))))};var En=n(749),yn=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 hn=o.css`
|
|
399
399
|
height: 100%;
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
justify-content: space-between;
|
|
403
|
-
`,vn=
|
|
403
|
+
`,vn=r().div`
|
|
404
404
|
${({stretch:e})=>e&&hn}
|
|
405
|
-
`,bn=
|
|
405
|
+
`,bn=r().form`
|
|
406
406
|
${({stretch:e})=>e&&hn}
|
|
407
|
-
`,xn=i.forwardRef(((e,t)=>e.onSubmit?i.createElement(bn,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):i.createElement(vn,{stretch:e.stretch,ref:t},e.children))),Cn=
|
|
407
|
+
`,xn=i.forwardRef(((e,t)=>e.onSubmit?i.createElement(bn,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):i.createElement(vn,{stretch:e.stretch,ref:t},e.children))),Cn=r().div`
|
|
408
408
|
${e=>e.stretch&&"\n flex: 1;\n"}
|
|
409
|
-
`,wn=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,
|
|
409
|
+
`,wn=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,o]=(0,En.SC)(e.fields,e.type,e.forceMandatory),r=(0,et.useForm)({defaultValues:Object.assign(Object.assign({},o),e.defaultValues),criteriaMode:"all"}),{handleSubmit:a,control:s,reset:c}=r,d=yn(r,["handleSubmit","control","reset"]),u=(0,i.useCallback)((e=>{const t={};return Object.keys(e).forEach((n=>{var i;const o=null===(i=l.find((e=>e.name===n)))||void 0===i?void 0:i.widget;switch(null==o?void 0:o.type){case"audience":t[n]=e[n].map((e=>e.uri)).join(",");break;case"taxonomy":t[n]=e[n].map((e=>e.title)).join(",");break;case"toggle":t[n]=e[n]?"1":"0";break;default:t[n]=e[n]}})),t}),[l]);return i.useImperativeHandle(t,(()=>Object.assign(Object.assign({},d),{handleSubmit:a,control:s,reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),c()},getFormattedValues:()=>u(d.getValues())})),[]),i.createElement(xn,{stretch:e.stretch,onSubmit:e.onSubmit?a(e.onSubmit):void 0,ref:n},i.createElement(Cn,{stretch:e.stretch},l.map((t=>{var{Input:n}=t,l=yn(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)})),kn=(r().div`
|
|
410
410
|
margin-bottom: 24px;
|
|
411
|
-
`,
|
|
411
|
+
`,r().div`
|
|
412
412
|
margin-bottom: 4px;
|
|
413
|
-
`,
|
|
413
|
+
`,r().div`
|
|
414
414
|
position: absolute;
|
|
415
415
|
background-color: ${e=>e.isActive?"rgba(0,0,0,.1)":"transparent"};
|
|
416
416
|
inset: 0;
|
|
@@ -418,27 +418,27 @@
|
|
|
418
418
|
flex: 1;
|
|
419
419
|
display: flex;
|
|
420
420
|
overflow: hidden;
|
|
421
|
-
`),qn=
|
|
421
|
+
`),qn=r().div`
|
|
422
422
|
flex-direction: row;
|
|
423
423
|
display: flex;
|
|
424
424
|
min-height: 60px;
|
|
425
425
|
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
426
|
-
`,Wn=
|
|
426
|
+
`,Wn=r().div`
|
|
427
427
|
width: 60px;
|
|
428
428
|
display: flex;
|
|
429
429
|
align-items: center;
|
|
430
430
|
justify-content: center;
|
|
431
|
-
`,Sn=
|
|
431
|
+
`,Sn=r().div`
|
|
432
432
|
flex: 1;
|
|
433
433
|
display: flex;
|
|
434
434
|
align-items: center;
|
|
435
435
|
justify-content: center;
|
|
436
|
-
`,Ln=
|
|
436
|
+
`,Ln=r().div`
|
|
437
437
|
position: relative;
|
|
438
438
|
overflow: hidden;
|
|
439
439
|
top: 91px;
|
|
440
440
|
width: ${460}px;
|
|
441
|
-
`,An=
|
|
441
|
+
`,An=r().div`
|
|
442
442
|
position: absolute;
|
|
443
443
|
top: 0;
|
|
444
444
|
${e=>"left"===e.position?"left: 0px;":""}
|
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
&.animate {
|
|
455
455
|
right: 0px;
|
|
456
456
|
}
|
|
457
|
-
`,Tn=
|
|
457
|
+
`,Tn=r().div`
|
|
458
458
|
flex: 1;
|
|
459
459
|
display: flex;
|
|
460
460
|
flex-direction: column;
|
|
@@ -462,25 +462,25 @@
|
|
|
462
462
|
overflow: auto;
|
|
463
463
|
margin-bottom: 12px;
|
|
464
464
|
position: relative;
|
|
465
|
-
`,Mn=
|
|
465
|
+
`,Mn=r().div`
|
|
466
466
|
position: absolute;
|
|
467
467
|
inset: 0;
|
|
468
468
|
background-color: rgba(255, 255, 255, 0.8);
|
|
469
469
|
display: flex;
|
|
470
470
|
align-items: center;
|
|
471
471
|
justify-content: center;
|
|
472
|
-
`,On=
|
|
472
|
+
`,On=r().div`
|
|
473
473
|
position: absolute;
|
|
474
474
|
inset: 0;
|
|
475
475
|
background-color: ${e=>e.theme.color.white};
|
|
476
476
|
padding: ${e=>e.theme.space.md}px;
|
|
477
|
-
`,In=
|
|
477
|
+
`,In=r().div`
|
|
478
478
|
width: ${50}px;
|
|
479
479
|
padding-top: 60px;
|
|
480
480
|
display: flex;
|
|
481
481
|
flex-direction: column;
|
|
482
482
|
border-right: 1px solid ${e=>e.theme.color.grey2};
|
|
483
|
-
`,_n=
|
|
483
|
+
`,_n=r().button`
|
|
484
484
|
border-radius: 4px;
|
|
485
485
|
cursor: pointer;
|
|
486
486
|
height: 42px;
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
&:hover {
|
|
494
494
|
background-color: ${e=>e.theme.color.grey1};
|
|
495
495
|
}
|
|
496
|
-
`,jn=(
|
|
496
|
+
`,jn=(r().div`
|
|
497
497
|
display: flex;
|
|
498
498
|
border: 1px solid ${e=>e.theme.color.grey1};
|
|
499
499
|
border-radius: ${8}px;
|
|
@@ -504,47 +504,47 @@
|
|
|
504
504
|
height: ${50}px;
|
|
505
505
|
margin: 0;
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
507
|
+
`,r().div`
|
|
508
508
|
display: flex;
|
|
509
509
|
flex-direction: row;
|
|
510
510
|
padding: 12px;
|
|
511
511
|
background-color: ${e=>e.theme.color.grey0};
|
|
512
512
|
border-radius: 8px;
|
|
513
513
|
margin-bottom: 4px;
|
|
514
|
-
`),zn=
|
|
514
|
+
`),zn=r().div`
|
|
515
515
|
display: flex;
|
|
516
516
|
flex: 1;
|
|
517
517
|
align-items: center;
|
|
518
|
-
`,Dn=
|
|
518
|
+
`,Dn=r().div`
|
|
519
519
|
width: 40px;
|
|
520
520
|
display: flex;
|
|
521
521
|
justify-content: center;
|
|
522
522
|
align-items: center;
|
|
523
|
-
`,$n=(
|
|
523
|
+
`,$n=(r().div`
|
|
524
524
|
flex-direction: row;
|
|
525
525
|
display: flex;
|
|
526
526
|
align-items: center;
|
|
527
|
-
`,
|
|
527
|
+
`,r().div`
|
|
528
528
|
flex: 1;
|
|
529
529
|
display: flex;
|
|
530
530
|
align-items: center;
|
|
531
|
-
`,u.default.registry.getLazyComponent("Button")),Rn=u.default.registry.getLazyComponent("Icon"),Fn=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(qn,null,l().createElement(Wn,null),l().createElement(Sn,null,"Popup"),l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(Rn,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(qn,null,l().createElement($n,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)},Gn=u.default.registry.getLazyComponent("WidgetArticleTitleEditor"),Bn=u.default.registry.getLazyComponent("WidgetArticleTextEditor"),Un=u.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),Hn=u.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),Nn=u.default.registry.getLazyComponent("WidgetArticleSliderEditor"),Pn=u.default.registry.getLazyComponent("WidgetArticleImageEditor"),Jn=u.default.registry.getLazyComponent("WidgetButtonEditor"),Vn=u.default.registry.getLazyComponent("WidgetCheckListEditor"),Qn=u.default.registry.getLazyComponent("WidgetQuickSurveyEditor"),Kn=u.default.registry.getLazyComponent("WidgetDatasourceTableEditor"),Yn=u.default.registry.getLazyComponent("WidgetExcelDatasourceTableEditor"),Xn=u.default.registry.getLazyComponent("WidgetPresenceEditor"),Zn=({uniqid:e})=>{var t,n,i,r,o;const a=(0,d.useDispatch)(),s=(0,d.useSelector)(c.x0.selectors.selectToken),m=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),g=(0,d.useSelector)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),d.shallowEqual),p=e=>{var t;return null===(t=c.qn.selectors.selectHook(u.default.store.getState(),e))||void 0===t?void 0:t.isActive},f=t=>{m&&a(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),a(c.cr.slice.actions.flushEditor({uniqid:e})),g&&g(t)},E=(t,n)=>{a(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},y=t=>{a(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},h=null==m?void 0:m.widget;return h?(0,k.ensureWidgetArticleButtonType)(h)?l().createElement(Jn,Object.assign({},h.content,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:()=>f({})})):(0,k.ensureWidgetArticleGalleryType)(h)?l().createElement(Un,{token:s,content:h.content,onChange:t=>a((0,c.vR)(e,t,!1)),onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleAttachmentType)(h)?l().createElement(Hn,{token:s,content:h.content,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E,onOpen:y}):(0,k.ensureWidgetArticleImageType)(h)?l().createElement(Pn,{content:h.content,token:s,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleSliderType)(h)?void 0!==s?l().createElement(Nn,{slides:null!==(t=h.content.slides)&&void 0!==t?t:[],loop:null!==(n=h.content.loop)&&void 0!==n&&n,useDots:null===(i=h.content.useDots)||void 0===i||i,onChange:t=>{a((0,c.vR)(e,t,!1))},token:s,onSave:f}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(h)?l().createElement(Gn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content,onOpen:y}):(0,k.ensureWidgetArticleTextType)(h)?l().createElement(Bn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content}):(0,k.ensureWidgetPresenceType)(h)?l().createElement(Xn,Object.assign({onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E},h.content)):(0,k.ensureWidgetCheckListType)(h)?l().createElement(Vn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(h)?l().createElement(Qn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(h)?l().createElement(Yn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(r=h.content.limit)&&void 0!==r?r:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,filebank:q().filebank,wedoc:q().wedoc},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>a(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetDatasourceTableType)(h)?l().createElement(Kn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(o=h.content.limit)&&void 0!==o?o:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,application:q().application,filebank:q().filebank},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>{a(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},ei=u.default.registry.getLazyComponent("Icon"),ti=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ei,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},ni=u.default.registry.getLazyComponent("BETA_DragAndDrop"),ii=u.default.registry.getLazyComponent("Icon"),li=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,a.useIntl)(),r=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,o=(null==r?void 0:r.content)&&"widgets"in r.content&&r.content.widgets?r.content.widgets:[];return l().createElement("div",{style:{flex:1}},l().createElement(ri,{uniqid:e}),r?o.map(((t,a)=>{const s=c.x0.definition(t.widget.name);return l().createElement("div",{key:a},l().createElement(jn,null,l().createElement(zn,{onClick:()=>((e,t)=>{n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(t.widget.uniqid,t.widget.name)},i.formatMessage({id:s.label})),l().createElement(Dn,{onClick:()=>{n(c.x0.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},r.content),{widgets:[...o.filter(((e,t)=>t!==a)).map((e=>((0,k.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(ii,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},ri=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(ni,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(ci,{uniqid:e,key:t}),elms:n||[]}),l().createElement(X,{namespace:"default",onChange:n=>{t(c.x0.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},oi=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(ii,{name:n.locked?"icon-lock":"icon-unlock"}))},ai=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(ii,{name:n.visible?"icon-eye":"icon-eye-slash"}))},si=({uniqid:e,layerId:t})=>{const n=(0,d.useDispatch)();return l().createElement("div",{onClick:()=>{n(c.x0.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(ii,{name:"icon-trash"}))},ci=({uniqid:e})=>{const t=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const r=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"}},r.label),l().createElement(oi,{uniqid:e}),l().createElement(ai,{uniqid:e}),l().createElement(si,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},di=u.default.registry.getLazyComponent("InputText"),ui=({uniqid:e})=>{var t;const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),r=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),{control:o,watch:s}=(0,et.useForm)({defaultValues:{text:null!==(t=null==r?void 0:r.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]),r?l().createElement(di,{name:"text",width:"100%",control:o,placeholder:n.formatMessage({id:"WIDGET_Title"})}):l().createElement(l().Fragment,null)},mi=u.default.registry.getLazyComponent("Loader"),gi=({uniqid:e})=>{var t;const n=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(Mn,null,l().createElement(mi,{size:"l"})))},pi=({uniqid:e,children:t})=>{var n;return(null===(n=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e))))||void 0===n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},fi=({uniqid:e})=>{var t;const n=(0,a.useIntl)();return(null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(On,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Ei=u.default.registry.getLazyComponent("Button"),yi=({uniqid:e,mode:t})=>{const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),r=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),d.shallowEqual);return l().createElement(Ei,{onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=r&&r.widget&&r.widget.content;o&&r&&l&&("view"==t&&q().widget.updateWidget({uri:o,uniqid:e,title:r.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},hi=u.default.registry.getLazyComponent("Icon"),vi=["widget-presence","widget-quick-survey","widget-check-list"],bi=({uniqid:e,position:t})=>{const n=(0,a.useIntl)(),r=(0,d.useDispatch)(),o=(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((()=>{o&&o.current&&(o.current.className=o.current.className+" animate")}),0)}),[]),s?l().createElement(Ln,null,l().createElement(An,{ref:o,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement(In,null,u.panel.useWrapper?l().createElement(_n,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(hi,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(_n,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(hi,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(pi,{uniqid:e},l().createElement(_n,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(hi,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(qn,null,l().createElement(ti,{uniqid:e,position:s.position}),l().createElement(Sn,null,n.formatMessage({id:u.label})),l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{r(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(hi,{name:"icon-times",color:"grey2"})))),l().createElement(Tn,null,"default"===m&&u.panel.useEditor?l().createElement(Zn,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(ui,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(li,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(gi,{uniqid:e}),l().createElement(fi,{uniqid:e}),vi.includes(s.name)&&l().createElement(yi,{uniqid:e,mode:s.mode})))),(null==s?void 0:s.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},xi=o().div`
|
|
531
|
+
`,u.default.registry.getLazyComponent("Button")),Rn=u.default.registry.getLazyComponent("Icon"),Fn=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(qn,null,l().createElement(Wn,null),l().createElement(Sn,null,"Popup"),l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(Rn,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(qn,null,l().createElement($n,{onClick:()=>{t(c.cr.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)},Gn=u.default.registry.getLazyComponent("WidgetArticleTitleEditor"),Bn=u.default.registry.getLazyComponent("WidgetArticleTextEditor"),Un=u.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),Hn=u.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),Nn=u.default.registry.getLazyComponent("WidgetArticleSliderEditor"),Pn=u.default.registry.getLazyComponent("WidgetArticleImageEditor"),Jn=u.default.registry.getLazyComponent("WidgetButtonEditor"),Vn=u.default.registry.getLazyComponent("WidgetCheckListEditor"),Qn=u.default.registry.getLazyComponent("WidgetQuickSurveyEditor"),Kn=u.default.registry.getLazyComponent("WidgetDatasourceTableEditor"),Yn=u.default.registry.getLazyComponent("WidgetExcelDatasourceTableEditor"),Xn=u.default.registry.getLazyComponent("WidgetPresenceEditor"),Zn=({uniqid:e})=>{var t,n,i,o,r;const a=(0,d.useDispatch)(),s=(0,d.useSelector)(c.x0.selectors.selectToken),m=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),g=(0,d.useSelector)((t=>{var n;return null===(n=c.cr.selectors.selectEditor(t,e))||void 0===n?void 0:n.onSave}),d.shallowEqual),p=e=>{var t;return null===(t=c.qn.selectors.selectHook(u.default.store.getState(),e))||void 0===t?void 0:t.isActive},f=t=>{m&&a(c.x0.slice.actions.updateWidget({uniqid:e,content:t})),a(c.cr.slice.actions.flushEditor({uniqid:e})),g&&g(t)},E=(t,n)=>{a(void 0!==n?c.x0.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.x0.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},y=t=>{a(c.cr.slice.actions.registerEditorPopup({uniqid:e,view:t}))},h=null==m?void 0:m.widget;return h?(0,k.ensureWidgetArticleButtonType)(h)?l().createElement(Jn,Object.assign({},h.content,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:()=>f({})})):(0,k.ensureWidgetArticleGalleryType)(h)?l().createElement(Un,{token:s,content:h.content,onChange:t=>a((0,c.vR)(e,t,!1)),onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleAttachmentType)(h)?l().createElement(Hn,{token:s,content:h.content,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E,onOpen:y}):(0,k.ensureWidgetArticleImageType)(h)?l().createElement(Pn,{content:h.content,token:s,onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E}):(0,k.ensureWidgetArticleSliderType)(h)?void 0!==s?l().createElement(Nn,{slides:null!==(t=h.content.slides)&&void 0!==t?t:[],loop:null!==(n=h.content.loop)&&void 0!==n&&n,useDots:null===(i=h.content.useDots)||void 0===i||i,onChange:t=>{a((0,c.vR)(e,t,!1))},token:s,onSave:f}):l().createElement(l().Fragment,null,"Token is mandatory"):(0,k.ensureWidgetArticleTitleType)(h)?l().createElement(Gn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content,onOpen:y}):(0,k.ensureWidgetArticleTextType)(h)?l().createElement(Bn,{onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,content:h.content}):(0,k.ensureWidgetPresenceType)(h)?l().createElement(Xn,Object.assign({onChange:t=>{a((0,c.vR)(e,t,!1))},onSave:f,onStateChange:E},h.content)):(0,k.ensureWidgetCheckListType)(h)?l().createElement(Vn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetQuickSurveyType)(h)?l().createElement(Qn,{token:s,uniqid:h.uniqid,content:h.content,onChangeContent:(e,t)=>{a((0,c.vR)(e,t,!1))},onChangeWrapper:e=>{a(c.x0.slice.actions.updateWidgetWrapper(Object.assign({},e)))},handleChange:t=>a((0,c.vR)(e,t,!1))}):(0,k.ensureWidgetExcelDatasourceTableType)(h)?l().createElement(Yn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(o=h.content.limit)&&void 0!==o?o:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,filebank:q().filebank,wedoc:q().wedoc},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>a(c.y8.actions.error({label:e}))})):(0,k.ensureWidgetDatasourceTableType)(h)?l().createElement(Kn,Object.assign({},h.content,{uri:h.content.uri,limit:null!==(r=h.content.limit)&&void 0!==r?r:20,hook:{isActive:p},handlers:{jamespot:{datasource:q().datasource,network:q().network,application:q().application,filebank:q().filebank},handleStart:()=>E({busy:!0}),handleCatch:e=>a(c.y8.actions.error({label:e.errorMsg})),handleFinally:()=>E({busy:!1})},onSave:f,onChange:(t,n)=>a((0,c.vR)(e,t,null!=n&&n)),onStateChange:E,onError:e=>{a(c.y8.actions.error({label:e}))}})):l().createElement(l().Fragment,null,"cannot display editor"):null},ei=u.default.registry.getLazyComponent("Icon"),ti=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{n(c.cr.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ei,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},ni=u.default.registry.getLazyComponent("BETA_DragAndDrop"),ii=u.default.registry.getLazyComponent("Icon"),li=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,a.useIntl)(),o=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,r=(null==o?void 0:o.content)&&"widgets"in o.content&&o.content.widgets?o.content.widgets:[];return l().createElement("div",{style:{flex:1}},l().createElement(oi,{uniqid:e}),o?r.map(((t,a)=>{const s=c.x0.definition(t.widget.name);return l().createElement("div",{key:a},l().createElement(jn,null,l().createElement(zn,{onClick:()=>((e,t)=>{n(c.cr.slice.actions.registerEditor({uniqid:e,name:t}))})(t.widget.uniqid,t.widget.name)},i.formatMessage({id:s.label})),l().createElement(Dn,{onClick:()=>{n(c.x0.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},o.content),{widgets:[...r.filter(((e,t)=>t!==a)).map((e=>((0,k.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(ii,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},oi=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(ni,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(ci,{uniqid:e,key:t}),elms:n||[]}),l().createElement(X,{namespace:"default",onChange:n=>{t(c.x0.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},ri=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(ii,{name:n.locked?"icon-lock":"icon-unlock"}))},ai=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.x0.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(ii,{name:n.visible?"icon-eye":"icon-eye-slash"}))},si=({uniqid:e,layerId:t})=>{const n=(0,d.useDispatch)();return l().createElement("div",{onClick:()=>{n(c.x0.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(ii,{name:"icon-trash"}))},ci=({uniqid:e})=>{const t=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=c.x0.definition(n.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:i},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(ri,{uniqid:e}),l().createElement(ai,{uniqid:e}),l().createElement(si,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},di=u.default.registry.getLazyComponent("InputText"),ui=({uniqid:e})=>{var t;const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e))),{control:r,watch:s}=(0,et.useForm)({defaultValues:{text:null!==(t=null==o?void 0:o.title.replace(/&/g,"&"))&&void 0!==t?t:""},criteriaMode:"all"});return l().useEffect((()=>{const t=s((t=>{i(c.x0.slice.actions.updateWidgetWrapper({uniqid:e,title:t.text}))}));return()=>t.unsubscribe()}),[s,e,i]),o?l().createElement(di,{name:"text",width:"100%",control:r,placeholder:n.formatMessage({id:"WIDGET_Title"})}):l().createElement(l().Fragment,null)},mi=u.default.registry.getLazyComponent("Loader"),gi=({uniqid:e})=>{var t;const n=null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(Mn,null,l().createElement(mi,{size:"l"})))},pi=({uniqid:e,children:t})=>{var n;return(null===(n=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e))))||void 0===n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},fi=({uniqid:e})=>{var t;const n=(0,a.useIntl)();return(null===(t=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetState(t,e)),d.shallowEqual))||void 0===t?void 0:t.locked)?l().createElement(On,null,n.formatMessage({id:"INTRANET_Panel_Change_Off"})):l().createElement(l().Fragment,null)},Ei=u.default.registry.getLazyComponent("Button"),yi=({uniqid:e,mode:t})=>{const n=(0,a.useIntl)(),i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>c.x0.selectors.selectWidget(t,e)),d.shallowEqual),r=(0,d.useSelector)((t=>c.x0.selectors.selectWidgetObjectUri(t,e)),d.shallowEqual);return l().createElement(Ei,{onClick:()=>{i(c.cr.slice.actions.flushEditor({uniqid:e}));const l=o&&o.widget&&o.widget.content;r&&o&&l&&("view"==t&&q().widget.updateWidget({uri:r,uniqid:e,title:o.title,content:l,v2:!0}).catch((e=>{var t;i(c.y8.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:n.formatMessage({id:"GLOBAL_Error"})}))})),"edit"===t&&i(c.x0.slice.actions.updateWidget({uniqid:e,content:l})))}},n.formatMessage({id:"GLOBAL_Save"}))},hi=u.default.registry.getLazyComponent("Icon"),vi=["widget-presence","widget-quick-survey","widget-check-list"],bi=({uniqid:e,position:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),r=(0,i.useRef)(null),s=(0,d.useSelector)((t=>c.cr.selectors.selectEditor(t,e)),d.shallowEqual),u=c.x0.definition(null==s?void 0:s.name),[m,g]=l().useState("default");return(0,i.useEffect)((()=>{setTimeout((()=>{r&&r.current&&(r.current.className=r.current.className+" animate")}),0)}),[]),s?l().createElement(Ln,null,l().createElement(An,{ref:r,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement(In,null,u.panel.useWrapper?l().createElement(_n,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(hi,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(_n,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(hi,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(pi,{uniqid:e},l().createElement(_n,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(hi,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",width:"390px"}},l().createElement(qn,null,l().createElement(ti,{uniqid:e,position:s.position}),l().createElement(Sn,null,n.formatMessage({id:u.label})),l().createElement(Wn,null,l().createElement(_n,{onClick:()=>{o(c.cr.slice.actions.flushEditor({uniqid:e}))}},l().createElement(hi,{name:"icon-times",color:"grey2"})))),l().createElement(Tn,null,"default"===m&&u.panel.useEditor?l().createElement(Zn,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(ui,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(li,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(gi,{uniqid:e}),l().createElement(fi,{uniqid:e}),vi.includes(s.name)&&l().createElement(yi,{uniqid:e,mode:s.mode})))),(null==s?void 0:s.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},xi=r().div`
|
|
532
532
|
position: absolute;
|
|
533
533
|
inset: 0;
|
|
534
534
|
pointer-events: none;
|
|
535
535
|
z-index: 1;
|
|
536
|
-
`,Ci=
|
|
536
|
+
`,Ci=r().div`
|
|
537
537
|
flex: 1;
|
|
538
538
|
display: flex;
|
|
539
539
|
margintop: ${90}px;
|
|
540
540
|
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
541
|
-
`,wi=
|
|
541
|
+
`,wi=r().div`
|
|
542
542
|
flex: 1;
|
|
543
543
|
display: flex;
|
|
544
544
|
flex-direction: row;
|
|
545
545
|
pointer-events: none;
|
|
546
|
-
`,ki=
|
|
546
|
+
`,ki=r().div`
|
|
547
547
|
width: ${440}px;
|
|
548
548
|
pointer-events: none;
|
|
549
|
-
`,qi=()=>{const e=(0,d.useSelector)(c.cr.selectors.selectEditors,d.shallowEqual);return l().createElement(xi,{className:"editor-portal-wrapper"},e.map(((e,t)=>"left"===e.position?l().createElement(kn,{isActive:!1,key:t},l().createElement(wi,null,l().createElement(bi,{uniqid:e.uniqid,position:e.position}),l().createElement(Ci,{isActive:void 0!==e.popup},l().createElement(Fn,{uniqid:e.uniqid})),l().createElement(ki,null))):l().createElement(kn,{isActive:!1,key:t},l().createElement(wi,null,l().createElement(ki,null),l().createElement(Ci,{isActive:void 0!==e.popup},l().createElement(Fn,{uniqid:e.uniqid})),l().createElement(bi,{uniqid:e.uniqid,position:e.position}))))))},Wi=()=>i.createElement(i.Fragment,null),Si=()=>{const[e,t]=(0,i.useState)(),n=(0,a.useIntl)(),l=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),
|
|
549
|
+
`,qi=()=>{const e=(0,d.useSelector)(c.cr.selectors.selectEditors,d.shallowEqual);return l().createElement(xi,{className:"editor-portal-wrapper"},e.map(((e,t)=>"left"===e.position?l().createElement(kn,{isActive:!1,key:t},l().createElement(wi,null,l().createElement(bi,{uniqid:e.uniqid,position:e.position}),l().createElement(Ci,{isActive:void 0!==e.popup},l().createElement(Fn,{uniqid:e.uniqid})),l().createElement(ki,null))):l().createElement(kn,{isActive:!1,key:t},l().createElement(wi,null,l().createElement(ki,null),l().createElement(Ci,{isActive:void 0!==e.popup},l().createElement(Fn,{uniqid:e.uniqid})),l().createElement(bi,{uniqid:e.uniqid,position:e.position}))))))},Wi=()=>i.createElement(i.Fragment,null),Si=()=>{const[e,t]=(0,i.useState)(),n=(0,a.useIntl)(),l=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),o=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{l({reject:i,resolve:n,text:e,capability:t})}))),[l]),r=(0,i.useMemo)((()=>({develop:e=>o(e,"develop"),summarize:e=>o(e,"summarize"),tldr:e=>o(e,"tldr"),en:e=>o(e,"en"),es:e=>o(e,"es"),formal:e=>o(e,"formal"),funny:e=>o(e,"funny")})),[o]);return[e,(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(r,n)),[n,r])]},Li=u.default.registry.getLazyComponent("InputTinyMCE"),Ai=e=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),r=(0,o.useTheme)(),s=(0,d.useSelector)(c.Kx.selectors.selectAll),[m,g]=Si(),p=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),f=(0,i.useMemo)((()=>p?[g]:[]),[g,p]),E=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),y=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(s,r,E)),[s,E,r]),h=(0,i.useMemo)((()=>u.default.tinymceCommonOptions),[]);return l().createElement(l().Fragment,null,h&&l().createElement(Li,Object.assign({commonOptions:h,additionalExtensions:f,mentionsQueries:y},e)),l().createElement(O,{query:m}))},Ti=u.default.registry.getLazyComponent("InputTinyMCERaw"),Mi=e=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),r=(0,o.useTheme)(),s=(0,d.useSelector)(c.Kx.selectors.selectAll),[m,g]=Si(),p=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),f=(0,i.useMemo)((()=>p?[g]:[]),[g,p]),E=(0,i.useCallback)((e=>{n(c.y8.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),y=(0,i.useMemo)((()=>(0,u.getTinyMCEMentionsQueries)(s,r,E)),[s,E,r]),h=(0,i.useMemo)((()=>u.default.tinymceCommonOptions),[]);return l().createElement(l().Fragment,null,h&&l().createElement(Ti,Object.assign({commonOptions:h,additionalExtensions:f,mentionsQueries:y},e)),l().createElement(O,{query:m}))},Oi=u.default.registry.getLazyComponent("InputAudience"),Ii=u.default.registry.getLazyComponent("Message"),_i=u.default.registry.getLazyComponent("Modal"),ji=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:r,name:s="publishTo"})=>{const u=(0,a.useIntl)(),m=(0,d.useSelector)(c.Bx.selectors.selectNetworkPublic);return l().createElement(_i,{open:e,closeHandler:t,title:null!=n?n:u.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),r()}}]},l().createElement(Ii,{variant:"warning",message:null!=o?o:u.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(Oi,{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 zi=n(118);const Di=u.default.registry.getLazyComponent("Container"),$i=u.default.registry.getLazyComponent("AppColumn"),Ri=u.default.registry.getLazyComponent("MainColumn");function Fi({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const r=(0,a.useIntl)(),{pathname:s}=(0,zi.useLocation)(),c=(0,i.useMemo)((()=>Object.values(t)),[t]),[d,u]=i.useState(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.key),m=c.map((t=>Object.assign(Object.assign({},t),{label:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0})));return i.useEffect((()=>{const t=c.find((t=>{var n;return`/ng/rr/${e}/${t.path}`===s||(null===(n=t.paths)||void 0===n?void 0:n.reduce(((t,n)=>{const i=`/ng/rr/${e}/${n}`,l=null!==(0,zi.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(Di,{mode:l},i.createElement($i,{mode:l,description:n,tabs:m,activeTab:d||""}),i.createElement(Ri,{mode:l,flex:!0},i.createElement(zi.Outlet,null))))}}}]);
|
|
550
550
|
//# sourceMappingURL=235.bundle.js.map
|