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