jamespot-react-core 1.1.156 → 1.1.157
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/335.bundle.js +476 -0
- package/build/335.bundle.js.map +1 -0
- package/build/app.bundle.js +231 -199
- package/build/app.bundle.js.map +1 -1
- package/build/src/components/Audience.d.ts +10 -0
- package/build/src/components/modals/ModalAudience.d.ts +2 -1
- package/build/src/components/widgets/wrapper/utils.d.ts +1 -1
- package/build/src/registry/core-component-list.d.ts +1 -0
- package/build/src/registry/coreComponents.d.ts +1 -0
- package/build/src/registry/ext-component-list.d.ts +1 -0
- package/package.json +4 -4
- package/build/517.bundle.js +0 -457
- package/build/517.bundle.js.map +0 -1
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[335],{335:(e,t,n)=>{n.r(t),n.d(t,{AIModal:()=>v,Audience:()=>p,Avatar:()=>u,CommentsBloc:()=>ut,DisplayForm:()=>bt,EditorsPortal:()=>gn,Empty:()=>pn,JRCInputTinyMCEWithExt:()=>En,JRCInputTinyMCEWithExtRaw:()=>yn,ModalAudience:()=>hn,TwoColLayout:()=>wn,WidgetList:()=>I,WidgetWrapperCore:()=>Qe});var i=n(363),l=n.n(i),o=n(754),r=n.n(o),a=n(181),s=n(161),c=n(794),d=n(855);const u=e=>{var t;const n=(0,o.useTheme)(),i=(0,d.useSelector)(c.Zc.selectors.selectNetworkPublic);return e.uri===(null==i?void 0:i.uri)?l().createElement(s.JRCIcon,{name:"icon-fs-wall",size:8*(null!==(t=e.size)&&void 0!==t?t:3),color:n.color.primary,variant:"circle"}):l().createElement(s.JRCAvatar,Object.assign({},e))},m=r().div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
margin-bottom: 24px;
|
|
6
|
+
`,g=r().a`
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 40px;
|
|
12
|
+
height: 40px;
|
|
13
|
+
border-radius: 40px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
color: ${e=>e.theme.color.white};
|
|
16
|
+
background-color: ${e=>e.theme.color.lavender};
|
|
17
|
+
border: 4px solid ${e=>e.theme.color.white};
|
|
18
|
+
margin-left: ${e=>e.overlap?"-18px":"0"};
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
`,p=({audience:e,limit:t=2})=>{const n=(0,a.useIntl)(),r=(0,o.useTheme)(),[c,d]=(0,i.useState)(!1);return l().createElement(l().Fragment,null,l().createElement(s.JRCFlexBox,null,[...e].splice(0,t).map(((e,t)=>l().createElement(g,{overlap:0!==t,href:e._url,target:"_blank",key:e.id},l().createElement(s.JRCTooltip,{description:void 0===e.title?" ":e.title,position:"left"},l().createElement(u,{uri:e.uri,size:4,variant:"circle",alt:"image",timestamp:e.dateModified?s.Utils.date.strToTimestamp(e.dateModified):void 0,focusable:!0}))))),e.length>t&&l().createElement(g,{onClick:()=>d(!0),overlap:!0},"+",e.length-t)),e.length>t&&l().createElement(s.JRCModalLayout,{closeHandler:()=>d(!1),enableClickAwayCloseModal:!0,open:c,variant:"fixed-height",maxHeight:"800px"},l().createElement(s.JRCModalContent,{title:n.formatMessage({id:"GLOBAL_Audience"}),overflow:"scroll",onClickIconClose:()=>d(!1)},l().createElement(m,null,e.map(((e,t)=>l().createElement(s.JRCFlexBox,{key:`audience-${t}`,y:"center",gap:r.space.l},l().createElement(u,{size:5,uri:`${e.type}/${e.id}`}),l().createElement(s.JRCStyledHref,{href:`${e.type}/${e.id}`},l().createElement(s.JRCTypography,null,e.title)))))))))};var f=n(6),E=n.n(f);const y=r().div`
|
|
21
|
+
padding: ${e=>e.theme.space.md}px;
|
|
22
|
+
`,h={response:void 0,loading:!0,error:void 0},v=({query:e})=>{const t=(0,a.useIntl)(),[n,r]=(0,i.useState)(h),c=(0,o.useTheme)(),d=(0,i.useCallback)((e=>{r(h),E().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void r({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const n=e.result.text;r({error:void 0,loading:!1,response:n})})).catch((e=>{r({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[t]);return(0,i.useEffect)((()=>{e&&e.text.trim().length>0&&d(e)}),[e,d]),l().createElement(s.JRCModalLayout,{zIndex:c.zIndex.tinyMCEModal,open:!!e,closeHandler:()=>{null==e||e.reject()}},l().createElement(s.JRCModalContent,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&d(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>n.response&&(null==e?void 0:e.resolve(n.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}],isFull:!0},l().createElement(y,null,n.loading&&l().createElement(l().Fragment,null,l().createElement(s.JRCLoader,null),l().createElement(s.JRCTypography,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!n.loading&&n.error&&l().createElement("p",null,n.error),!n.loading&&n.response&&l().createElement("p",null,n.response))))};var b=n(291);const C=r().div`
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: row;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
`,x=r().div`
|
|
29
|
+
border: 1px solid ${e=>e.theme.color.grey2};
|
|
30
|
+
border-radius: 8px;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
padding: 12px;
|
|
33
|
+
position: relative;
|
|
34
|
+
opacity: ${e=>e.available?"1":".4"};
|
|
35
|
+
pointer-events: ${e=>e.available?"all":"none"};
|
|
36
|
+
|
|
37
|
+
.show-on-hover {
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
align-items: center;
|
|
43
|
+
display: flex;
|
|
44
|
+
opacity: 0;
|
|
45
|
+
background-color: #ffffffe6;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
.show-on-hover {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,w=r().div`
|
|
54
|
+
border: 2px solid ${e=>e.theme.color.primary};
|
|
55
|
+
height: ${e=>e.open?"320":"54"}px;
|
|
56
|
+
border-radius: 8px;
|
|
57
|
+
display: flex;
|
|
58
|
+
justify-content: top;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
transition: height 0.4s;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
`,W=r().div`
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
gap: 10px;
|
|
69
|
+
`,k=r().div`
|
|
70
|
+
min-height: 50px;
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
align-items: center;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
color: ${e=>e.theme.color.primary};
|
|
76
|
+
&:hover {
|
|
77
|
+
background-color: ${e=>e.theme.color.grey0};
|
|
78
|
+
}
|
|
79
|
+
`,L=r().button`
|
|
80
|
+
height: 72px;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
padding: 0 10px;
|
|
84
|
+
gap: 10px;
|
|
85
|
+
width: 40%;
|
|
86
|
+
border: 1px solid ${e=>e.theme.color.grey2};
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
transition: opacity 0.4s ease ${e=>40*e.index}ms;
|
|
89
|
+
opacity: ${e=>e.open?1:0};
|
|
90
|
+
img {
|
|
91
|
+
width: 40px;
|
|
92
|
+
}
|
|
93
|
+
${e=>e.full&&"flex: 1"}
|
|
94
|
+
`,S=r().div`
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: ${e=>"row"===e.direction?"row":"column"};
|
|
97
|
+
align-items: ${e=>"row"===e.direction?"center":"flex-start"};
|
|
98
|
+
justify-content: ${e=>"row"===e.direction?"flex-start":"center"};
|
|
99
|
+
flex: 1;
|
|
100
|
+
${e=>e.gap&&`gap:${e.gap}px`}
|
|
101
|
+
`,q=b.default.registry.getLazyComponent("Button"),$=b.default.registry.getLazyComponent("ModalLayout"),A=b.default.registry.getLazyComponent("ModalContent"),T=b.default.registry.getLazyComponent("Tooltip"),M=b.default.registry.getLazyComponent("IconButton"),I=({mode:e,view:t,children:n,namespace:i="default",onChange:o})=>{const[r,s]=l().useState(!1),d=function(e){switch(e){case"widget-article-image":return[c.$L.definition(f.WidgetsName.ArticleTitle),c.$L.definition(f.WidgetsName.ArticleButton)];case"comment":return[c.$L.definition(f.WidgetsName.CheckList)];default:return[c.$L.definition(f.WidgetsName.ArticleTitle),c.$L.definition(f.WidgetsName.ArticleText),c.$L.definition(f.WidgetsName.ArticleImage),c.$L.definition(f.WidgetsName.ArticleButton),c.$L.definition(f.WidgetsName.ArticleSlider),c.$L.definition(f.WidgetsName.ArticleAttachment)]}}(i),u=(0,a.useIntl)(),m={open:r,portalId:"react-modal",variant:"full-height",closeHandler:()=>s(!1)},g=e=>{o(c.$L.factory(e)),s(!1)};return l().createElement(l().Fragment,null,l().createElement($,Object.assign({},m),l().createElement(A,{onClickIconClose:m.closeHandler,buttons:"comment"===e?[{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Close"}),color:"cancel",clickHandler:()=>s(!1)}]:void 0,title:u.formatMessage({id:"WIDGET_Builder"})},"comment"===e?l().createElement(W,null,d.map(((e,t)=>l().createElement(L,{key:e.name,open:!0,full:!0,index:t,onClick:()=>g(e.name)},l().createElement(S,{direction:"row",gap:12},l().createElement("img",{src:e.img}),l().createElement(S,{direction:"column"},l().createElement("h3",null,u.formatMessage({id:e.label})),l().createElement("p",null,u.formatMessage({id:e.description})))))))):l().createElement(C,null,d.map(((e,t)=>l().createElement(x,{key:t,onClick:()=>g(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},u.formatMessage({id:e.label})))))))),"custom"===e&&n?l().createElement("div",{onClick:()=>s(!0)},n):l().createElement(l().Fragment,null),"button"===e&&"edit"===t?l().createElement(q,{onClick:()=>s(!0),variant:"outlined",minWidth:"100%"},u.formatMessage({id:"WIDGET_Add_Widget"})):l().createElement(l().Fragment,null),"gallery"===e&&"edit"===t?l().createElement(C,null,d.map(((e,t)=>l().createElement(x,{key:t,onClick:()=>g(e.name),available:e.available},l().createElement("img",{src:e.img}),l().createElement("div",{className:"show-on-hover"},u.formatMessage({id:e.label})))))):l().createElement(l().Fragment,null),"article"===e&&"edit"===t?l().createElement(O,{widgets:d,onClick:g}):l().createElement(l().Fragment,null),"comment"===e&&"edit"===t?l().createElement(_,{onClick:()=>{s(!0)}}):l().createElement(l().Fragment,null))},O=({widgets:e,onClick:t})=>{const[n,i]=l().useState(!1),o=(0,a.useIntl)();return l().createElement(l().Fragment,null,l().createElement(w,{open:n},l().createElement(k,{onClick:()=>i(!n)},o.formatMessage({id:"WIDGET_Add_Widget"})),l().createElement(W,null,e.map(((e,i)=>l().createElement(L,{key:e.name,open:n,index:i,onClick:()=>t(e.name)},l().createElement("img",{src:e.img}),o.formatMessage({id:e.label})))))))},_=({onClick:e})=>{const t=(0,a.useIntl)();return l().createElement(l().Fragment,null,l().createElement(T,{description:t.formatMessage({id:"COMMENT_Add_Widget"})},l().createElement(M,{bg:"grey1",bgHover:"grey2",color:"grey5",iconSize:22,onClick:()=>{e()},icon:"icon-fs-puzzle"})))},F=r().div`
|
|
102
|
+
flex: 1;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
min-height: 60px;
|
|
106
|
+
align-items: center;
|
|
107
|
+
`,R=({widget:e})=>{const{url:t,keys:n,order:i,orderBy:o}=e.content,[r,a]=l().useState([]);return l().useEffect((()=>{t&&function(e){return"string"==typeof e&&0!==e.length&&e.startsWith("https://")}(t)?fetch(t,{method:"POST",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{Array.isArray(e.result)||console.warn("resposne must be an array"),a(e.result)})):console.warn(`${t} is not a valid url`)}),[t]),l().createElement(F,null,l().createElement(s.JRCWidgetApi,{data:r,keys:null!=n?n:[],order:null!=i?i:"",orderBy:null!=o?o:"asc"}))};var j=n(5);const D=(e,t)=>{const n=[];return e.filter((e=>e.isVisible)).forEach((e=>{const i=t.find((t=>t.name===e.name));i&&n.push(i)})),n},z=b.default.registry.getLazyComponent("WidgetTable"),B=b.default.registry.getLazyComponent("Loader"),G=(r().div``,r().div`
|
|
108
|
+
position: absolute;
|
|
109
|
+
inset: 0;
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: ${e=>e.theme.space.md}px;
|
|
115
|
+
`),H=r().div`
|
|
116
|
+
position: absolute;
|
|
117
|
+
inset: 0;
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: row;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: ${e=>e.theme.space.md}px;
|
|
123
|
+
color: ${e=>e.theme.color.primary};
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
opacity: 0;
|
|
126
|
+
border: 1px solid ${e=>e.theme.color.primary};
|
|
127
|
+
&:hover {
|
|
128
|
+
background-color: ${e=>e.theme.color.grey2};
|
|
129
|
+
opacity: 0.9;
|
|
130
|
+
}
|
|
131
|
+
`,N=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:d,tableRowColor:u,tableRowTextColor:m,tableColumnsData:g=[],tableBorderRadius:p,tableSizedColumns:y,tableSizedColumnsWidth:h,mode:v})=>{const b=(0,a.useIntl)(),C=(0,j.TL)(),[x,w]=(0,i.useState)(!1),[W,k]=(0,i.useState)(!1),[L,S]=(0,i.useState)([]),[q,$]=(0,i.useState)([]),[A,T]=(0,i.useState)({order:"ascending",name:"unknown"}),M=(0,i.useMemo)((()=>c.$L.definition(f.WidgetsName.DatasourceTable)),[]);(0,i.useEffect)((()=>{void 0!==t&&0!==g.length&&0===q.length&&(k(!0),E().datasource.get(t,f.Format.VIEW).then((e=>{$(e.result.model),S(e.result.data),T(e.result.sort)})).finally((()=>k(!1))))}),[t,g,q]),(0,i.useEffect)((()=>{t||$([])}),[t]);const I=(0,i.useCallback)((()=>{C(c.Wq.slice.actions.flushAllEditor()),C(c.Wq.slice.actions.registerEditor({uniqid:e,name:f.WidgetsName.DatasourceTable}))}),[C,e]);(0,i.useEffect)((()=>{"view"!==v&&"preview"!==v||C(c.Wq.slice.actions.flushAllEditor())}),[v,C]),(0,i.useEffect)((()=>{x||t||"edit"!==v||(I(),w(!0))}),[C,e,x,t,I,v]);const O=(0,i.useMemo)((()=>D(g,q)),[g,q]);return 0!==g.length||W||"edit"!==v?W?l().createElement(G,null,l().createElement(B,null)):l().createElement(l().Fragment,null,W||0!==L.length?l().createElement(z,{rows:L,columns:O,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:d,tableRowColor:u,tableRowTextColor:m,tableBorderRadius:p,tableColumnsData:g,tableSizedColumns:y,tableSizedColumnsWidth:h,tableDefaultSortOrder:A.order,tableDefaultSortName:A.name}):l().createElement(G,null,l().createElement("img",{src:`/img/fast-intranet/${f.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})),"edit"===v?l().createElement(H,{onClick:I},l().createElement(s.JRCHtml,{__html:`${b.formatMessage({id:"WIDGET_Set_Widget"})} <b>${b.formatMessage({id:M.label})}</b>`})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null,l().createElement(G,{onClick:I},l().createElement("img",{src:`/img/fast-intranet/${f.WidgetsName.DatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:M.label}),l().createElement(s.JRCButton,{label:"GLOBAL_Settings"})),l().createElement(H,{onClick:I},l().createElement(s.JRCHtml,{__html:`${b.formatMessage({id:"WIDGET_Set_Widget"})} <b>${b.formatMessage({id:M.label})}</b>`})))},U=r().div`
|
|
132
|
+
width: 0;
|
|
133
|
+
height: 0;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
`,P=({children:e,initialFiles:t,initialClick:n,multiple:i,accept:o,onUploadStart:r,onUploadEnd:a,onUploadSuccess:u})=>{const m=l().useRef(null),g=(0,d.useSelector)(c.$L.selectors.selectToken),[p,f]=l().useState(0),[E,y]=l().useState(t);return l().useEffect((()=>{var e;n&&(null===(e=m.current)||void 0===e||e.click())}),[n]),l().useEffect((()=>{t.length!==E.length&&y(t)}),[t]),l().useEffect((()=>{u(E)}),[E]),l().useEffect((()=>{0===p&&a()}),[p]),l().createElement(l().Fragment,null,l().createElement("div",{onClick:()=>{var e;n&&(null===(e=m.current)||void 0===e||e.click())}},e),l().createElement(U,null,l().createElement(s.JRCInputFileAdvancedRaw,{ref:m,id:"widget-upload-file",name:"editorFiles",content:"",accept:o,multiple:i,token:g,onUploadStart:e=>{void 0!==e&&f((t=>t+e)),"function"==typeof r&&0!==e&&r()},onUploadSuccess:e=>{void 0!==e&&(f((e=>void 0!==e?e-1:0)),y((t=>i?[...t,e]:[e])))}})))},V=b.default.registry.getLazyComponent("WidgetAttachment"),Q=b.default.registry.getLazyComponent("FileViewer"),K=r().div`
|
|
136
|
+
flex: 1;
|
|
137
|
+
`,Z=({widget:e,inplace:t,mode:n})=>{const o=(0,a.useIntl)(),{uniqid:r}=e,{files:u}=e.content,m=(0,d.useDispatch)(),g=(0,d.useSelector)((e=>c.$L.selectors.isActive(e,r)),d.shallowEqual),p=e=>{m(c.FN.actions.error({label:null!=e?e:o.formatMessage({id:"GLOBAL_Error"})}))};(0,i.useEffect)((()=>{m(c.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),(0,i.useEffect)((()=>{m(c.$L.slice.actions.setWidgetState({uniqid:r,empty:!u||0===u.length}))}),[u]);const f=(0,d.useSelector)((e=>c.Mx.selectors.selectById(e,"OnlyOfficeHook"))),y=[{label:o.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&E().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const n=t.result;((e,t,n)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,n)})).catch((()=>{m(c.FN.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],h=f?[{condition:e=>["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.mimetype),options:y}]:[];return void 0!==u?l().createElement(K,null,"view"!==n?l().createElement(V,{files:u,onClick:()=>{},onError:p}):l().createElement(Q,{files:u,openWithOptions:h},(e=>l().createElement(V,{files:u,onClick:t=>e(t),onError:p}))),t&&"view"!==n&&l().createElement(P,{initialFiles:u,initialClick:g,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&m((0,c.O5)(r,{files:e}))},onUploadStart:()=>{m(c.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{m(c.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},"edit"===n?l().createElement(s.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):l().createElement(l().Fragment,null))):l().createElement(l().Fragment,null)},X=r().div`
|
|
138
|
+
display: flex;
|
|
139
|
+
flex: 1;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
align-items: center;
|
|
142
|
+
`,Y=r().div`
|
|
143
|
+
pointer-events: ${e=>e.clickable?"all":"none"};
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
display: flex;
|
|
146
|
+
flex: 1;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
align-items: center;
|
|
149
|
+
`,ee=({widget:e,mode:t})=>{const n=(0,d.useDispatch)(),{uniqid:o}=e,{text:r,url:a,target:u,color:m,backgroundColor:g,buttonSize:p,borderRadius:f,variant:E}=e.content;return(0,i.useEffect)((()=>{n(c.$L.slice.actions.setWidgetState({uniqid:o,empty:!r||0===r.length}))}),[r]),l().createElement(X,{onClick:()=>{"edit"===t&&n(c.Wq.slice.actions.registerEditor({uniqid:o,name:e.name}))}},l().createElement(Y,{clickable:"edit"!==t},l().createElement(s.JRCWidgetButton,{text:r,url:a,target:u,color:m,backgroundColor:g,buttonSize:p,borderRadius:f,variant:E})))},te=b.default.registry.getLazyComponent("WidgetArticleGallery"),ne=b.default.registry.getLazyComponent("FileViewer"),ie=r().button`
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
`,le=({widget:e,inplace:t,mode:n})=>{var i,o;const{uniqid:r}=e,{files:a}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.$L.selectors.isActive(e,r)),d.shallowEqual);return l().useEffect((()=>{u(c.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),void 0!==a?l().createElement(l().Fragment,null,"edit"===n?l().createElement(te,{files:a,maxWidth:800,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(o=e.content.column)&&void 0!==o?o:"3",onClick:()=>{}}):l().createElement(ne,{files:a,openWithOptions:[]},(t=>{var n,i;return l().createElement(ie,null,l().createElement(te,{files:a,maxWidth:600,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(i=e.content.column)&&void 0!==i?i:"3",onClick:e=>t(e)}))})),t&&"edit"===n?l().createElement(P,{initialFiles:a,initialClick:m,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&u((0,c.O5)(r,{files:e}))},onUploadStart:()=>{u(c.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{u(c.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},l().createElement(s.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},oe=b.default.registry.getLazyComponent("WidgetImage"),re=b.default.registry.getLazyComponent("FileViewer"),ae=r().div`
|
|
152
|
+
position: absolute;
|
|
153
|
+
inset: 0;
|
|
154
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
155
|
+
pointer-event: none;
|
|
156
|
+
display: flex;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
align-items: center;
|
|
159
|
+
opacity: 0;
|
|
160
|
+
color: ${e=>e.theme.color.white};
|
|
161
|
+
&:hover {
|
|
162
|
+
opacity: 1;
|
|
163
|
+
}
|
|
164
|
+
`,se=r().button`
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
`,ce={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},de=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},ue=({widget:e,width:t,inplace:n,mode:o})=>{const{uniqid:r}=e,{file:u,useFilter:m}=e.content,g=(0,d.useDispatch)(),p=(0,d.useSelector)((e=>c.$L.selectors.isActive(e,r)),d.shallowEqual),[E,y]=(0,i.useState)(void 0),h=(0,a.useIntl)();return(0,i.useEffect)((()=>{g(c.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),(0,i.useEffect)((()=>{g(c.$L.slice.actions.setWidgetState({uniqid:r,empty:!u}))}),[u]),(0,i.useEffect)((()=>{u&&y((0,f.formatImgUrl)({timestamp:u.dateModified?de(u.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:u.uri}))}),[u]),l().createElement(l().Fragment,null,"edit"===o?void 0!==E?l().createElement(oe,{maxWidth:null!=t?t:600,uri:E,useFilter:null!=m&&m}):l().createElement(l().Fragment,null):l().createElement(re,{files:[Object.assign(Object.assign({},ce),{path:E,mimetype:"image/png"})],openWithOptions:[]},(e=>l().createElement(se,{onClick:()=>e(0)},l().createElement(oe,{maxWidth:null!=t?t:600,uri:E,useFilter:null!=m&&m})))),n&&"edit"===o?l().createElement(P,{initialFiles:[],initialClick:p,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&g((0,c.O5)(r,{file:e[0]}))},onUploadStart:()=>{g(c.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{g(c.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},void 0!==u?l().createElement(ae,null,h.formatMessage({id:"ARTICLE_Widget_Image_Change"})):l().createElement(s.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):l().createElement(l().Fragment,null))},me=b.default.registry.getLazyComponent("FileViewer"),ge=r().div`
|
|
167
|
+
flex: 1;
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: row;
|
|
170
|
+
min-height: 60px;
|
|
171
|
+
align-items: center;
|
|
172
|
+
width: ${e=>e.maxWidth}px;
|
|
173
|
+
`,pe={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},fe=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},Ee=({widget:e,mode:t,width:n})=>{const{uniqid:o}=e,r=(0,j.TL)(),a=(0,d.useSelector)((e=>c.$L.selectors.isActive(e,o)),d.shallowEqual),u=null!=n?n:600,[m,g]=(0,i.useState)(void 0),p=(0,i.useRef)(null),E=(0,i.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},pe),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:pe.mimetype,path:(0,f.formatImgUrl)({size:"fitx1200",uri:e.file?e.file.uri:"",from:"imagecache",timestamp:e.file&&e.file.dateModified?fe(e.file.dateModified):Date.now()})})))]:[]),[e.content.slides]),y=(0,i.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,f.formatImgUrl)({timestamp:e.file.dateModified?fe(e.file.dateModified):Date.now(),size:`fitx${m&&m<u?m:u}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,m,u]);(0,i.useEffect)((()=>{a&&"edit"===t&&r(c.Wq.slice.actions.registerEditor({uniqid:o,name:e.name}))}),[a]),(0,i.useEffect)((()=>{const e=()=>{p.current&&g(p.current?p.current.offsetWidth:u)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[p]),(0,i.useEffect)((()=>{g(p.current?p.current.offsetWidth:u)}),[p]),(0,i.useEffect)((()=>{r(c.$L.slice.actions.setWidgetState({uniqid:o,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const h=(0,i.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),v=(0,i.useCallback)((()=>{r(c.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[r,e.uniqid,e.name]);return void 0===m?l().createElement("div",{ref:p,style:{width:"100%"}}):l().createElement(ge,{maxWidth:m&&m<u?m:u},l().createElement(me,{files:E,openWithOptions:[]},(n=>{var i,a;return l().createElement(s.JRCWidgetSlider,{slides:y,maxWidth:m&&m<u?m:u,useDots:null===(i=e.content.useDots)||void 0===i||i,loop:null!==(a=e.content.loop)&&void 0!==a&&a,startAt:0,onClickSlide:i=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[i];t&&t.file&&n(t.file.id)}}else r(c.Wq.slice.actions.registerEditor({uniqid:o,name:e.name}))}})})),h?l().createElement(s.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:v}):l().createElement(l().Fragment,null))},ye=b.default.registry.getLazyComponent("WidgetArticleText"),he=r().div`
|
|
174
|
+
cursor: text;
|
|
175
|
+
p {
|
|
176
|
+
word-wrap: break-word;
|
|
177
|
+
}
|
|
178
|
+
a {
|
|
179
|
+
word-wrap: break-word;
|
|
180
|
+
}
|
|
181
|
+
`,ve=({widget:e,mode:t})=>{const{uniqid:n}=e,r=(0,o.useTheme)(),{text:s}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.$L.selectors.isActive(e,n)),d.shallowEqual),g=(0,d.useSelector)((e=>{var t;return null===(t=c.$L.selectors.selectWidgetState(e,n))||void 0===t?void 0:t.busy})),p=(0,d.useSelector)(c.$L.selectors.selectToken),f=(0,d.useSelector)(c.zh.selectors.selectTinyMCECommonOptions),E=(0,d.useSelector)(c.Hn.selectors.selectAll),y=(0,a.useIntl)(),h=(0,i.useCallback)((e=>{u(c.FN.actions.error({label:null!=e?e:y.formatMessage({id:"GLOBAL_Error"})}))}),[u,y]);(0,i.useEffect)((()=>{u(c.$L.slice.actions.setWidgetState({uniqid:n,empty:!s||0===s.length}))}),[s]);const v=(0,i.useMemo)((()=>(0,b.getTinyMCEMentionsQueries)(E,r,h)),[E,h,r]);return g?l().createElement(l().Fragment,null):l().createElement(he,null,l().createElement(ye,{autoFocus:m,text:null!=s?s:"",token:"edit"===t&&void 0!==p?p:"",tinyMCECommonOptions:"edit"===t&&f?{tinymceScriptSrc:"https://ecosysteme.jamespot.pro/js/tinymce/tinymce.min.js",commonOptions:f,mentionsQueries:v}:void 0,mode:t,onChange:e=>{u((0,c.O5)(n,{text:e}))}}))},be=b.default.registry.getLazyComponent("WidgetArticleTitle"),Ce=r().div`
|
|
182
|
+
flex: 1;
|
|
183
|
+
display: flex;
|
|
184
|
+
flex-direction: row;
|
|
185
|
+
align-items: center;
|
|
186
|
+
cursor: text;
|
|
187
|
+
`,xe=r().div`
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: row;
|
|
190
|
+
border-radius: 8px;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
margin: 4px;
|
|
193
|
+
border: 1px solid ${e=>e.theme.color.grey1};
|
|
194
|
+
`,we=r().button`
|
|
195
|
+
display: flex;
|
|
196
|
+
width: 40px;
|
|
197
|
+
height: 40px;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
align-items: center;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
opacity: ${e=>e.isActive?"1.0":".8"};
|
|
202
|
+
background-color: ${e=>e.isActive?e.theme.color.grey1:e.theme.color.white};
|
|
203
|
+
&:hover {
|
|
204
|
+
background-color: ${e=>e.theme.color.grey1};
|
|
205
|
+
}
|
|
206
|
+
`,We=({widget:e,inplace:t,mode:n})=>{const{uniqid:o}=e,{text:r,color:a,heading:s}=e.content,u=(0,d.useDispatch)(),m=(0,d.useSelector)((e=>c.$L.selectors.isActive(e,o)),d.shallowEqual);return(0,i.useEffect)((()=>{u(c.$L.slice.actions.setWidgetState({uniqid:o,empty:!r||0===r.length}))}),[r]),l().createElement(Ce,null,l().createElement(be,{text:r,color:a,heading:s,autoFocus:m,inplace:t,mode:n,onChange:e=>{u((0,c.O5)(o,{text:e}))}}),m&&"edit"===n?l().createElement(ke,{heading:s,onClick:e=>{u((0,c.O5)(o,{heading:e}))}}):l().createElement(l().Fragment,null))},ke=({heading:e="h1",onClick:t})=>l().createElement(xe,null,["h1","h2","h3","h4"].map(((n,i)=>l().createElement(we,{key:i,isActive:e===n,onClick:()=>t(n)},n)))),Le=J.react.registry.getLazyComponent("WidgetCheckList"),Se=J.react.registry.getLazyComponent("WidgetCheckListEditor"),qe=J.react.registry.getLazyComponent("Typography"),$e=(r().div`
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-direction: row;
|
|
209
|
+
justify-content: space-between;
|
|
210
|
+
align-items: center;
|
|
211
|
+
border: ${e=>e.border?`1px solid ${e.theme.color.grey2}`:"none"};
|
|
212
|
+
min-height: 24px;
|
|
213
|
+
border-radius: 4px;
|
|
214
|
+
padding: 4px 8px;
|
|
215
|
+
`,r().div`
|
|
216
|
+
display: flex;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
align-items: center;
|
|
219
|
+
border: 1px solid ${e=>e.theme.color.grey1};
|
|
220
|
+
border-bottom-left-radius: 4px;
|
|
221
|
+
border-bottom-right-radius: 4px;
|
|
222
|
+
padding: 4px;
|
|
223
|
+
margin-bottom: 8px;
|
|
224
|
+
|
|
225
|
+
div:first-child {
|
|
226
|
+
margin: 0 auto;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
div:last-child {
|
|
230
|
+
align-self: flex-end;
|
|
231
|
+
}
|
|
232
|
+
`),Ae=r().div`
|
|
233
|
+
width: 100%;
|
|
234
|
+
flex: 1;
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-direction: column;
|
|
237
|
+
align-items: flex-start;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
gap: 8px;
|
|
240
|
+
`,Te=r().div`
|
|
241
|
+
display: flex;
|
|
242
|
+
gap: 14px;
|
|
243
|
+
padding: 10px 10px 0 10px;
|
|
244
|
+
border-radius: 8px;
|
|
245
|
+
background-color: ${({theme:e})=>e.color.white};
|
|
246
|
+
border: 1px solid ${e=>e.theme.color.grey2};
|
|
247
|
+
`,Me=r().div`
|
|
248
|
+
width: 100%;
|
|
249
|
+
padding-bottom: 12px;
|
|
250
|
+
border-bottom: ${e=>e.border?`1px solid ${e.theme.color.grey1}`:0};
|
|
251
|
+
`,Ie=({widget:e,commentId:t,inplace:n,mode:o,editRight:r,deleteRight:u,onRemove:m,onWidgetUpdate:g})=>{const p=(0,a.useIntl)(),{uniqid:y,content:h}=e,v=(0,d.useDispatch)(),[b,C]=(0,i.useState)(),[x,w]=(0,i.useState)(!1),[W,k]=(0,i.useState)(),[L,S]=(0,i.useState)(!1),q=(0,d.useSelector)((e=>c.$L.selectors.selectWidget(e,y))),$=(0,d.useSelector)(c.EK.selectors.get),A=(0,i.useCallback)((e=>{v(c.FN.actions.error({label:null!=e?e:p.formatMessage({id:"GLOBAL_Error"})}))}),[v,p]),T=e=>{v(c.$L.slice.actions.updateWidgetWrapper(Object.assign({},e)))},M=()=>{v(c.$L.slice.actions.flushWidget({uniqid:y})),m&&m(y),w(!1)},I=t=>{v(c.Wq.slice.actions.flushAllEditor()),v(c.$L.slice.actions.setToken({token:t})),v(c.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:f.WidgetsName.CheckList}))};return(0,i.useEffect)((()=>{var t;const n=null===(t=e.content.arr)||void 0===t?void 0:t.map((e=>{var t,n,i;return Object.assign(Object.assign(Object.assign({text:null!==(t=e.title)&&void 0!==t?t:"",checked:null!==(n=e.value)&&void 0!==n&&n},e.links&&{links:e.links}),e.user&&{user:null!==(i=e.user)&&void 0!==i?i:void 0}),e.id&&{id:e.id,mimetype:"image/png"})}));C(n)}),[e.content.arr,h]),(0,i.useEffect)((()=>{W||L||(S(!0),E().network.token().then((e=>{k(e.result),S(!1)})).catch((e=>{A(e.errorMsg)})))}),[A,W,L]),"edit"===o&&n?l().createElement(l().Fragment,null,l().createElement(Te,null,l().createElement(Ae,null,l().createElement(Me,{border:!0},l().createElement("label",null,p.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Title"})),l().createElement(s.JRCInputTextRaw,{id:p.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Title"}),required:!0,placeholder:p.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Title"}),type:"text",value:null==q?void 0:q.title,onChange:e=>{const{value:t}=e.target;T({uniqid:y,title:t})},margin:"2px",width:"100%"})),l().createElement(Se,{token:W,uniqid:y,content:h,onChangeContent:(e,t)=>{v((0,c.O5)(e,t))},onChangeWrapper:T,openEditorPanel:I,onRemoveWidget:M})))):l().createElement(l().Fragment,null,b&&l().createElement("div",{key:e.uniqid,style:{width:"100%"}},l().createElement(Le,{title:null==q?void 0:q.title,limit:10,initialEntries:b,onFileClick:()=>{},onItemCheckListChange:(n,i)=>((e,n,i)=>{if(!t)return;const l={arr:null==i?void 0:i.map((e=>{var t,n;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({title:e.text},e.id&&{id:e.id}),e.links&&{links:e.links}),e.mimetype&&{mimetypes:e.mimetype}),$&&e.checked&&{user:{id:null!==(n=null===(t=e.user)||void 0===t?void 0:t.id)&&void 0!==n?n:$.id,mainType:"user",type:"user"}}),e.checked&&{value:e.checked})}))};v((0,c.O5)(e,l)),E().widget.checkListRespond({id:t,type:"comment",idUser:null==$?void 0:$.id,uniqid:e,index:n}).then((()=>{g&&g()})).catch((e=>{A(e.message)}))})(e.uniqid,n,i)}),r&&l().createElement(l().Fragment,null,l().createElement($e,null,l().createElement("div",{style:{cursor:"pointer"},onClick:()=>{W?I(W):A(p.formatMessage({id:"GLOBAL_Error"}))}},l().createElement(qe,{size:"s"},p.formatMessage({id:"COMMENT_WIDGET_Configure"}))),u&&l().createElement("div",null,l().createElement(s.JRCIconButton,{iconSize:14,onClick:()=>w(!0),icon:"icon-trash"})))),l().createElement(s.JRCModal,{buttons:[{color:"cancel",clickHandler:()=>w(!1),children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Cancel"})},{color:"danger",clickHandler:M,children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Delete"})}],open:x,closeHandler:()=>w(!1),title:p.formatMessage({id:"GLOBAL_Delete"})},p.formatMessage({id:"COMMENT_WIDGET_Delete_Widget"}))))},Oe=b.default.registry.getLazyComponent("WidgetTable"),_e=b.default.registry.getLazyComponent("Loader"),Fe=(r().div``,r().div`
|
|
252
|
+
position: absolute;
|
|
253
|
+
inset: 0;
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-direction: column;
|
|
256
|
+
justify-content: center;
|
|
257
|
+
align-items: center;
|
|
258
|
+
gap: ${e=>e.theme.space.md}px;
|
|
259
|
+
`),Re=r().div`
|
|
260
|
+
position: absolute;
|
|
261
|
+
inset: 0;
|
|
262
|
+
display: flex;
|
|
263
|
+
flex-direction: row;
|
|
264
|
+
justify-content: center;
|
|
265
|
+
align-items: center;
|
|
266
|
+
gap: ${e=>e.theme.space.md}px;
|
|
267
|
+
color: ${e=>e.theme.color.primary};
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
opacity: 0;
|
|
270
|
+
border: 1px solid ${e=>e.theme.color.primary};
|
|
271
|
+
&:hover {
|
|
272
|
+
background-color: ${e=>e.theme.color.grey2};
|
|
273
|
+
opacity: 0.9;
|
|
274
|
+
}
|
|
275
|
+
`,je=({uniqid:e,uri:t,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:d,tableRowColor:u,tableRowTextColor:m,tableColumnsData:g=[],tableBorderRadius:p,tableSizedColumns:y,tableSizedColumnsWidth:h,mode:v})=>{const b=(0,a.useIntl)(),C=(0,j.TL)(),[x,w]=(0,i.useState)(!1),[W,k]=(0,i.useState)(!1),[L,S]=(0,i.useState)([]),[q,$]=(0,i.useState)([]),A=(0,i.useMemo)((()=>c.$L.definition(f.WidgetsName.ExcelDatasourceTable)),[]);(0,i.useEffect)((()=>{void 0!==t&&0!==g.length&&0===q.length&&(k(!0),E().datasource.get(t,f.Format.VIEW).then((e=>{$(e.result.model),S(e.result.data)})).finally((()=>k(!1))))}),[t,g,q]),(0,i.useEffect)((()=>{t||$([])}),[t]);const T=(0,i.useCallback)((()=>{C(c.Wq.slice.actions.flushAllEditor()),C(c.Wq.slice.actions.registerEditor({uniqid:e,name:f.WidgetsName.ExcelDatasourceTable}))}),[C,e]);(0,i.useEffect)((()=>{"view"!==v&&"preview"!==v||C(c.Wq.slice.actions.flushAllEditor())}),[v,C]),(0,i.useEffect)((()=>{x||t||"edit"!==v||(T(),w(!0))}),[C,e,x,t,T,v]);const M=(0,i.useMemo)((()=>D(g,q)),[g,q]);return 0!==g.length||W||"edit"!==v?W?l().createElement(Fe,null,l().createElement(_e,null)):l().createElement(l().Fragment,null,W||0!==L.length?l().createElement(Oe,{rows:L,columns:M,limit:n,tableHeadColor:o,tableHeadTextColor:r,tableHeadIconColor:d,tableRowColor:u,tableRowTextColor:m,tableBorderRadius:p,tableColumnsData:g,tableSizedColumns:y,tableSizedColumnsWidth:h}):l().createElement(Fe,null,l().createElement("img",{src:`/img/fast-intranet/${f.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:"WIDGET_Datasource_No_Results"})),"edit"===v?l().createElement(Re,{onClick:T},l().createElement(s.JRCHtml,{__html:`${b.formatMessage({id:"WIDGET_Set_Widget"})} <b>${b.formatMessage({id:A.label})}</b>`})):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null,l().createElement(Fe,{onClick:T},l().createElement("img",{src:`/img/fast-intranet/${f.WidgetsName.ExcelDatasourceTable}.png`,alt:""}),l().createElement(a.FormattedMessage,{id:A.label}),l().createElement(s.JRCButton,{label:"GLOBAL_Settings"})),l().createElement(Re,{onClick:T},l().createElement(s.JRCHtml,{__html:`${b.formatMessage({id:"WIDGET_Set_Widget"})} <b>${b.formatMessage({id:A.label})}</b>`})))},De=({widget:e,commentId:t,width:n,inplace:i=!1,mode:o="view",editRight:r,deleteRight:a,onWidgetUpdate:s,onRemove:c})=>{const{name:d}=e;return(0,f.ensureWidgetArticleButtonType)(e)?l().createElement(ee,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetArticleGalleryType)(e)?l().createElement(le,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetArticleAttachmentType)(e)?l().createElement(Z,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetArticleImageType)(e)?l().createElement(ue,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetApiType)(e)?l().createElement(R,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetArticleSliderType)(e)?l().createElement(Ee,{widget:e,inplace:i,mode:o,width:null!=n?n:800}):(0,f.ensureWidgetArticleTitleType)(e)?l().createElement(We,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetArticleTextType)(e)?l().createElement(ve,{widget:e,inplace:i,mode:o}):(0,f.ensureWidgetExcelDatasourceTableType)(e)?l().createElement(je,Object.assign({},e.content,{uniqid:e.uniqid,mode:o})):(0,f.ensureWidgetDatasourceTableType)(e)?l().createElement(N,Object.assign({},e.content,{uniqid:e.uniqid,mode:o})):(0,f.ensureWidgetCheckListType)(e)?l().createElement(Ie,{widget:e,commentId:t,inplace:i,mode:o,editRight:null!=r&&r,deleteRight:null!=a&&a,onRemove:c,onWidgetUpdate:s}):l().createElement(l().Fragment,null,"cannot display widget (",d,")")},ze=r().div`
|
|
276
|
+
position: absolute;
|
|
277
|
+
inset: 0;
|
|
278
|
+
opacity: ${e=>e.opacity};
|
|
279
|
+
background-color: ${e=>e.backgroundColor};
|
|
280
|
+
pointer-events: ${e=>e.pointerEvents};
|
|
281
|
+
`,Be=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,null==n?void 0:n.map(((e,t)=>l().createElement(Je,{uniqid:e,key:t,mode:"edit"}))))},Je=({uniqid:e,mode:t})=>{const n=(0,d.useSelector)((t=>t.widgets.layers[e]));return"view"===t?l().createElement(ze,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},n.widgets.map(((e,t)=>l().createElement(Ge,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):l().createElement(ze,{opacity:n.visible?1:0,backgroundColor:n.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:n.locked?"none":"all"},n.widgets.map(((e,t)=>l().createElement(Ge,{key:t,layerId:n.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},Ge=({uniqid:e,layerId:t,mode:n})=>{const i=(0,d.useDispatch)(),o=(0,d.useSelector)((t=>t.widgets.ids[e]),d.shallowEqual),r=(0,d.useSelector)((e=>e.widgets.layers[t]));return o&&r&&r.position?"view"===n?l().createElement("div",{style:{position:"absolute",top:r.position.y,left:r.position.x}},l().createElement(Ke,{uniqid:e,widget:o,mode:n,inplace:!0})):l().createElement(He,{position:{x:r.position.x,y:r.position.y},onMouseUp:e=>{(r.position&&r.position.x!==e.x||r.position&&r.position.y!==e.y)&&(e=>{i(c.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},l().createElement(s.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{i(c.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(o.widget.uniqid,o.widget.name)},l().createElement(Ke,{uniqid:e,widget:o,mode:n,inplace:!0}))):l().createElement(l().Fragment,null)},He=({position:e,children:t,onMouseUp:n})=>{const[o,r]=l().useState(!1),[a,s]=l().useState({x:0,y:0}),[c,d]=l().useState({x:0,y:0}),[u,m]=l().useState({x:e.x,y:e.y}),g=l().useRef(null),p=(0,i.useCallback)((e=>{r(!0),g.current&&(s({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),f=l().useCallback((e=>{if(o&&g.current){const t=c.x+(e.clientX-a.x),n=c.y+(e.clientY-a.y);m({x:t,y:n})}}),[a.x,a.y,o,c.x,c.y]),E=(0,i.useCallback)((()=>{r(!1),n({x:u.x,y:u.y})}),[u.x,u.y,n]);return l().useEffect((()=>(document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E)})),[f,E]),l().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},Ne=b.default.registry.getLazyComponent("Loader"),Ue=({name:e,uniqid:t,inplace:n})=>{const i=(0,d.useSelector)((e=>c.$L.selectors.selectWidgetState(e,t))),o=c.$L.definition(e);return(null==i?void 0:i.loading)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement(Ne,null)):(null==i?void 0:i.hover)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==i?void 0:i.initialized)&&n||(null==i?void 0:i.initialized)||n?l().createElement(l().Fragment,null):l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,1)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},l().createElement("img",{src:o.img}))};var Pe=n(769);r().div`
|
|
282
|
+
height: 0;
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
`,r().div`
|
|
285
|
+
color: ${e=>e.theme.color.grey3};
|
|
286
|
+
font-style: italic;
|
|
287
|
+
`,r().div`
|
|
288
|
+
display: flex;
|
|
289
|
+
flex: 1;
|
|
290
|
+
width: 100%;
|
|
291
|
+
border: 0;
|
|
292
|
+
min-height: ${50}px;
|
|
293
|
+
margin: 0;
|
|
294
|
+
align-items: center;
|
|
295
|
+
border-radius: ${8}px;
|
|
296
|
+
padding: 8px;
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
gap: 10px;
|
|
299
|
+
color: ${e=>e.color?e.color:e.theme.font.color};
|
|
300
|
+
transition: opacity 0.4s;
|
|
301
|
+
|
|
302
|
+
&:hover {
|
|
303
|
+
img {
|
|
304
|
+
filter: grayscale(0);
|
|
305
|
+
opacity: 1;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
img {
|
|
310
|
+
filter: grayscale(1);
|
|
311
|
+
opacity: 0.4;
|
|
312
|
+
}
|
|
313
|
+
`,r().div`
|
|
314
|
+
position: absolute;
|
|
315
|
+
inset: 0;
|
|
316
|
+
display: flex;
|
|
317
|
+
flex: 1;
|
|
318
|
+
justify-content: center;
|
|
319
|
+
align-items: center;
|
|
320
|
+
min-height: 200px;
|
|
321
|
+
`;const Ve=r().div`
|
|
322
|
+
display: flex;
|
|
323
|
+
`,Qe=({uniqid:e,widgetObject:t,commentId:n,widget:o,inplace:r=!0,mode:a,width:s,editRight:u,deleteRight:m,onWidgetUpdate:g,onRemove:p})=>{const E=(0,d.useDispatch)(),y=(0,d.useSelector)((t=>c.$L.selectors.selectWidget(t,e))),h=(0,d.useSelector)((t=>t.widgets.editableMap[e]),d.shallowEqual),v=(0,d.useSelector)((e=>e.widgets.currentEditableWidgetId),d.shallowEqual),b=(0,d.useSelector)((t=>t.widgets.currentEditableWidgetId===e),d.shallowEqual),{ref:C,isComponentVisible:x,setIsComponentVisible:w}=(0,Pe.I)(!1);if((0,i.useEffect)((()=>{t&&E(c.$L.slice.actions.registerWidgetObject({uniqid:e,object:t}))}),[]),(0,i.useEffect)((()=>{o&&E(c.$L.slice.actions.registerWidget({uniqid:e,widget:o}))}),[]),(0,i.useEffect)((()=>{x||e===v&&E(c.$L.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[x]),(0,i.useEffect)((()=>{x!==b&&w(b)}),[b]),void 0===y)return l().createElement(l().Fragment,null,"This widget cannot be displayed");const W=y.widget,k=()=>{"edit"===a?L():(0,f.ensureWidgetArticleButtonType)(W)&&"link"===W.content.openingType&&W.content.openingTypeLink&&window.open(W.content.openingTypeLink.url,W.content.openingTypeLink.target)},L=()=>{if("view"===a)return;const{widget:e}=y;E(c.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return r&&"view"!==a?l().createElement(Ve,{ref:C,onClick:()=>{w(!0),h&&(E(c.$L.slice.actions.setEditableIndex({index:h.index})),E(c.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},l().createElement(De,{width:s,widget:y.widget,inplace:r,mode:a,onClick:k,onRemove:p}),l().createElement(Be,{uniqid:e,mode:a}),l().createElement(Ue,{name:y.widget.name,uniqid:y.widget.uniqid,inplace:r})):l().createElement(Ve,{onClick:L},l().createElement(De,{widget:Object.assign(Object.assign({},y.widget),y.title&&{title:y.title}),commentId:n,inplace:r,mode:a,width:s,onClick:k,editRight:u,deleteRight:m,onWidgetUpdate:g,onRemove:p}),l().createElement(Be,{uniqid:e,mode:a}),l().createElement(Ue,{name:y.widget.name,uniqid:y.widget.uniqid,inplace:r}))},Ke=Qe;var Ze,Xe=n(533),Ye=new Uint8Array(16);function et(){if(!Ze&&!(Ze="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ze(Ye)}const tt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var nt=[],it=0;it<256;++it)nt.push((it+256).toString(16).substr(1));const lt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(nt[e[t+0]]+nt[e[t+1]]+nt[e[t+2]]+nt[e[t+3]]+"-"+nt[e[t+4]]+nt[e[t+5]]+"-"+nt[e[t+6]]+nt[e[t+7]]+"-"+nt[e[t+8]]+nt[e[t+9]]+"-"+nt[e[t+10]]+nt[e[t+11]]+nt[e[t+12]]+nt[e[t+13]]+nt[e[t+14]]+nt[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&tt.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n},ot=function(e,t,n){var i=(e=e||{}).random||(e.rng||et)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var l=0;l<16;++l)t[n+l]=i[l];return t}return lt(i)},rt=J.react.registry.getLazyComponent("EditorsPortal"),at=J.react.registry.getLazyComponent("ThemeProvider"),st=()=>{const e=document.getElementById("react-portals"),t=(0,i.useMemo)((()=>e&&(e=>{let t=document.getElementById("react-portals");return t||(t=document.createElement("div"),t.id=ot(),e.appendChild(t)),t})(e)),[e]);return t?(0,Xe.createPortal)(l().createElement(at,null,l().createElement(rt,null)),t):null};var ct=function(e,t,n,i){return new(n||(n=Promise))((function(l,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function a(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}s((i=i.apply(e,t||[])).next())}))};const dt=r().div`
|
|
324
|
+
display: flex;
|
|
325
|
+
flex-direction: column;
|
|
326
|
+
gap: 4px;
|
|
327
|
+
flex: 1;
|
|
328
|
+
width: 100%;
|
|
329
|
+
margin-top: 10px;
|
|
330
|
+
`,ut=({articleId:e,variant:t="inline"})=>{var n;const r=(0,a.useIntl)(),u=(0,o.useTheme)(),m=(0,d.useDispatch)(),[g,p]=(0,i.useState)(),[f,y]=(0,i.useState)(!1),[h,v]=(0,i.useState)([]),[C,x]=(0,i.useState)(!1),w=(0,d.useSelector)(c.EK.selectors.get),W=(0,d.useSelector)(c.$L.selectors.selectWidgets),k=(0,d.useSelector)(c.zh.selectors.selectTinyMCECommonOptions),L=(0,d.useSelector)(c.Hn.selectors.selectAll),S=(0,d.useSelector)(c.t4.selectors.selectPlatformConfig),q=(0,d.useSelector)((e=>c.Mx.selectors.selectById(e,"OnlyOfficeHook"))),$=(0,d.useSelector)((t=>c.sv.selectors.commentList(t,e))),A=(0,d.useSelector)((e=>c.ew.selectors.selectHook(e,"DriveHook"))),T=(0,d.useSelector)((e=>c.Mx.selectors.selectById(e,"FileBankHook"))),M=(0,d.useSelector)((e=>c.ew.selectors.selectHook(e,"WidgetHook")));(e=>{const t=(0,d.useDispatch)(),n=(0,i.useMemo)((()=>b.default.socket),[]),l=(0,i.useMemo)((()=>c.sv.getCommentRTHandlers(t,e)),[t,e]);(0,i.useEffect)((()=>(l.forEach((e=>{n.onMessage(e.namespace,e.function,e.handler)})),()=>{l.forEach((e=>{n.offMessage(e.namespace,e.function,e.handler)}))})),[l,n])})(e),((e,t)=>{const n=(0,d.useDispatch)(),l=(0,i.useMemo)((()=>b.default.socket),[]),o=(0,i.useMemo)((()=>c.sv.getCommentsLikeRTHandlers(n,e,t)),[n,e,t]);(0,i.useEffect)((()=>(o.forEach((e=>{l.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{l.offMessage(e.namespace,e.function,e.handler)}))})),[o,l])})(null==$?void 0:$.list.map((e=>e.id)),e);const O=(0,i.useCallback)((e=>{m(c.FN.actions.error({label:null!=e?e:r.formatMessage({id:"GLOBAL_Error"})}))}),[m,r]),_=()=>{m(c.sv.actions.fetchComments({idArticle:e})),F()},F=(0,i.useCallback)((()=>{g||C||(x(!0),E().network.token().then((e=>{p(e.result),x(!1)})).catch((e=>{O(e.errorMsg)})))}),[O,g,C]),R=(0,i.useCallback)((t=>ct(void 0,void 0,void 0,(function*(){if(g){y(!0);const n=Object.keys(W).map((e=>(null==h?void 0:h.some((t=>t.widget.uniqid===e)))?W[e]:null)).filter((e=>null!==e));try{yield E().article.addComment(Object.assign(Object.assign({},t),{widgets:n,token:g,idArticle:e})).then((()=>{h.forEach((e=>{m(c.$L.slice.actions.flushWidget({uniqid:e.widget.uniqid}))})),v([])})),F()}catch(e){O(e.errorMsg)}finally{y(!1)}}}))),[e,m,F,O,g,W,h]);return(0,i.useEffect)((()=>{F()}),[F]),(0,i.useEffect)((()=>(m(c.sv.actions.fetchComments({idArticle:e})),()=>{m(c.sv.actions.discardComments({idArticle:e}))})),[]),l().createElement(l().Fragment,null,k&&l().createElement(l().Fragment,null,l().createElement(dt,null,l().createElement(s.JRCCommentsBloc,{loading:f,token:g,comments:null==$?void 0:$.list,onComment:R,onCommentUpdate:t=>ct(void 0,void 0,void 0,(function*(){var n,i;const l=null==$?void 0:$.list.find((e=>e.id===t.idComment));if(l)return E().article.updateComment({idComment:t.idComment,description:null!==(i=null!==(n=t.description)&&void 0!==n?n:l.description)&&void 0!==i?i:void 0,token:t.token,widgets:t.widgets}).then((()=>{m(c.sv.actions.fetchComments({idArticle:e})),F()})).catch((e=>{O(e.errorMsg)}))})),onCommentDelete:e=>ct(void 0,void 0,void 0,(function*(){E().article.deleteComment(e).catch(O)})),isWidgetActive:!!((null==M?void 0:M.isActive)&&(null==M?void 0:M.create)&&(null===(n=null==M?void 0:M.autorize)||void 0===n?void 0:n.includes("comment"))),widgetListComponent:l().createElement(I,{mode:"comment",namespace:"comment",onChange:e=>{v([...h,e]),m(c.$L.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e}))},view:"edit"}),newWidgetsWrapperComponent:l().createElement(l().Fragment,null,h.map((e=>e&&e.widget&&l().createElement("div",{key:e.widget.uniqid},l().createElement(Ke,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",onRemove:e=>v(h.filter((t=>t.widget.uniqid!==e)))}))))),existingWidgetsWrapperComponent:(t,n,i,o=!0,r,a=!1,s=!1)=>l().createElement(l().Fragment,null,null==n?void 0:n.map((n=>n&&l().createElement("div",{key:n.widget.uniqid},l().createElement(Ke,{uniqid:n.widget.uniqid,widgetObject:t,commentId:r,widget:n,inplace:o,mode:i,editRight:a,deleteRight:s,onWidgetUpdate:_,onRemove:t=>{E().widget.removeWidget({id:r,type:"comment",uniqid:t}).then((()=>{m(c.sv.actions.fetchComments({idArticle:e})),F()})).catch((e=>{O(e.errorMsg)}))}}))))),currentUser:w,tinyMCEConfig:{commonOptions:k,mentionsQueries:(0,b.getTinyMCEMentionsQueries)(L,u,O)},onError:O,highlightFields:S.userHighlightFields,userAccountStatus:S.userAccountStatus,userModel:L.find((e=>"user"===e.type)),isWedocActive:!!q,onGetHashError:e=>m(c.FN.actions.error({label:null!=e?e:r.formatMessage({id:"GLOBAL_Error"})})),activeDrives:J.debug.UploadFromDrives?[...T&&A?["fileBank"]:[],...c.ew.utils.buildDrivesArrayFromObject(null==A?void 0:A.drives)]:[],socialActionAdd:({targetId:e,targetType:t,type:n})=>E().socialAction.add({targetType:t,targetId:e,type:n}),deleteFile:e=>ct(void 0,void 0,void 0,(function*(){g&&(yield E().file.deleteFile(e,"attachment",g))})),fetchUser:e=>E().user.get(e),fetchUserFields:(e,t)=>E().user.getFields(e,t),fetchSocialActionUserList:({targetId:e,targetType:t,type:n})=>E().socialAction.getUsers({targetType:t,targetId:e,type:n}),removeLike:({targetId:e,targetType:t,type:n})=>E().socialAction.remove({targetType:t,targetId:e,type:n}),variant:t}),l().createElement(st,null))))};var mt=n(230),gt=n(561),pt=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(i=Object.getOwnPropertySymbols(e);l<i.length;l++)t.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(e,i[l])&&(n[i[l]]=e[i[l]])}return n};const ft=o.css`
|
|
331
|
+
height: 100%;
|
|
332
|
+
display: flex;
|
|
333
|
+
flex-direction: column;
|
|
334
|
+
justify-content: space-between;
|
|
335
|
+
`,Et=r().div`
|
|
336
|
+
${({stretch:e})=>e&&ft}
|
|
337
|
+
`,yt=r().form`
|
|
338
|
+
${({stretch:e})=>e&&ft}
|
|
339
|
+
`,ht=i.forwardRef(((e,t)=>e.onSubmit?i.createElement(yt,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):i.createElement(Et,{stretch:e.stretch,ref:t},e.children))),vt=r().div`
|
|
340
|
+
${e=>e.stretch&&"\n flex: 1;\n"}
|
|
341
|
+
`,bt=i.forwardRef(((e,t)=>{const n=i.useRef(null),[l,o]=(0,gt.GF)(e.fields,e.type,e.forceMandatory),r=(0,mt.useForm)({defaultValues:Object.assign(Object.assign({},o),e.defaultValues),criteriaMode:"all"}),{handleSubmit:a,control:s,reset:c}=r,d=pt(r,["handleSubmit","control","reset"]),u=(0,i.useCallback)((e=>{const t={};return Object.keys(e).forEach((n=>{var i;const o=null===(i=l.find((e=>e.name===n)))||void 0===i?void 0:i.widget;switch(null==o?void 0:o.type){case"audience":t[n]=e[n].map((e=>e.uri)).join(",");break;case"taxonomy":t[n]=e[n].map((e=>e.title)).join(",");break;default:t[n]=e[n]}})),t}),[l]);return i.useImperativeHandle(t,(()=>Object.assign(Object.assign({},d),{handleSubmit:a,control:s,reset:()=>{var e;null===(e=null==n?void 0:n.current)||void 0===e||e.scrollTo(0,0),c()},getFormattedValues:()=>u(d.getValues())})),[]),i.createElement(ht,{stretch:e.stretch,onSubmit:e.onSubmit?a(e.onSubmit):void 0,ref:n},i.createElement(vt,{stretch:e.stretch},l.map((t=>{var{Input:n}=t,l=pt(t,["Input"]);return i.createElement(n,Object.assign({key:l.name,control:s},l,{dataCy:`${e.dataCy}-${l.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(s)),e.buttons)})),Ct=(r().div`
|
|
342
|
+
margin-bottom: 24px;
|
|
343
|
+
`,r().div`
|
|
344
|
+
margin-bottom: 4px;
|
|
345
|
+
`,r().div`
|
|
346
|
+
position: absolute;
|
|
347
|
+
background-color: ${e=>e.isActive?"rgba(0,0,0,.1)":"transparent"};
|
|
348
|
+
inset: 0;
|
|
349
|
+
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
350
|
+
flex: 1;
|
|
351
|
+
display: flex;
|
|
352
|
+
overflow: hidden;
|
|
353
|
+
`),xt=r().div`
|
|
354
|
+
flex-direction: row;
|
|
355
|
+
display: flex;
|
|
356
|
+
min-height: 60px;
|
|
357
|
+
border-bottom: 1px solid ${e=>e.theme.color.grey2};
|
|
358
|
+
`,wt=r().div`
|
|
359
|
+
width: 60px;
|
|
360
|
+
display: flex;
|
|
361
|
+
align-items: center;
|
|
362
|
+
justify-content: center;
|
|
363
|
+
`,Wt=r().div`
|
|
364
|
+
flex: 1;
|
|
365
|
+
display: flex;
|
|
366
|
+
align-items: center;
|
|
367
|
+
justify-content: center;
|
|
368
|
+
`,kt=r().div`
|
|
369
|
+
position: relative;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
top: 91px;
|
|
372
|
+
width: ${460}px;
|
|
373
|
+
`,Lt=r().div`
|
|
374
|
+
position: absolute;
|
|
375
|
+
top: 0;
|
|
376
|
+
${e=>"left"===e.position?"left: 0px;":""}
|
|
377
|
+
${e=>"right"===e.position?"right: -1000px;":""}
|
|
378
|
+
width: ${440}px;
|
|
379
|
+
bottom: 90px;
|
|
380
|
+
display: flex;
|
|
381
|
+
background-color: ${e=>e.theme.color.white};
|
|
382
|
+
flex-direction: row;
|
|
383
|
+
transition: all 0.4s;
|
|
384
|
+
box-shadow: -4px 0px 20px 0px #00000017;
|
|
385
|
+
|
|
386
|
+
&.animate {
|
|
387
|
+
right: 0px;
|
|
388
|
+
}
|
|
389
|
+
`,St=r().div`
|
|
390
|
+
flex: 1;
|
|
391
|
+
display: flex;
|
|
392
|
+
flex-direction: row;
|
|
393
|
+
padding: 12px;
|
|
394
|
+
overflow: auto;
|
|
395
|
+
margin-bottom: 12px;
|
|
396
|
+
`,qt=r().div`
|
|
397
|
+
position: absolute;
|
|
398
|
+
inset: 0;
|
|
399
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
400
|
+
display: flex;
|
|
401
|
+
align-items: center;
|
|
402
|
+
justify-content: center;
|
|
403
|
+
`,$t=r().div`
|
|
404
|
+
width: ${50}px;
|
|
405
|
+
padding-top: 60px;
|
|
406
|
+
display: flex;
|
|
407
|
+
flex-direction: column;
|
|
408
|
+
border-right: 1px solid ${e=>e.theme.color.grey2};
|
|
409
|
+
`,At=r().button`
|
|
410
|
+
border-radius: 4px;
|
|
411
|
+
cursor: pointer;
|
|
412
|
+
height: 42px;
|
|
413
|
+
margin: 4px;
|
|
414
|
+
width: 42px;
|
|
415
|
+
display: flex;
|
|
416
|
+
align-items: center;
|
|
417
|
+
justify-content: center;
|
|
418
|
+
background-color: ${e=>e.isActive?e.theme.color.grey1:e.theme.color.white};
|
|
419
|
+
&:hover {
|
|
420
|
+
background-color: ${e=>e.theme.color.grey1};
|
|
421
|
+
}
|
|
422
|
+
`,Tt=(r().div`
|
|
423
|
+
display: flex;
|
|
424
|
+
border: 1px solid ${e=>e.theme.color.grey1};
|
|
425
|
+
border-radius: ${8}px;
|
|
426
|
+
margin-bottom: 24px;
|
|
427
|
+
input {
|
|
428
|
+
width: 100%;
|
|
429
|
+
border: 0;
|
|
430
|
+
height: ${50}px;
|
|
431
|
+
margin: 0;
|
|
432
|
+
}
|
|
433
|
+
`,r().div`
|
|
434
|
+
display: flex;
|
|
435
|
+
flex-direction: row;
|
|
436
|
+
padding: 12px;
|
|
437
|
+
background-color: ${e=>e.theme.color.grey0};
|
|
438
|
+
border-radius: 8px;
|
|
439
|
+
margin-bottom: 4px;
|
|
440
|
+
`),Mt=r().div`
|
|
441
|
+
display: flex;
|
|
442
|
+
flex: 1;
|
|
443
|
+
align-items: center;
|
|
444
|
+
`,It=r().div`
|
|
445
|
+
width: 40px;
|
|
446
|
+
display: flex;
|
|
447
|
+
justify-content: center;
|
|
448
|
+
align-items: center;
|
|
449
|
+
`,Ot=(r().div`
|
|
450
|
+
flex-direction: row;
|
|
451
|
+
display: flex;
|
|
452
|
+
align-items: center;
|
|
453
|
+
`,r().div`
|
|
454
|
+
flex: 1;
|
|
455
|
+
display: flex;
|
|
456
|
+
align-items: center;
|
|
457
|
+
`,({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>c.Wq.selectors.selectEditor(t,e)));return n&&n.popup&&n.view?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",backgroundColor:"white",marginTop:90}},l().createElement(xt,null,l().createElement(wt,null),l().createElement(Wt,null,"Popup"),l().createElement(wt,null,l().createElement(At,{onClick:()=>{t(c.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},l().createElement(s.JRCIcon,{name:"icon-times",color:"grey2"})))),l().createElement("div",{style:{flex:1,display:"flex"}},n.view),l().createElement(xt,null,l().createElement(s.JRCButton,{onClick:()=>{t(c.Wq.slice.actions.flushEditorPopup({uniqid:e}))}},"Save"))):l().createElement(l().Fragment,null)});const _t=b.default.registry.getLazyComponent("WidgetArticleTitleEditor"),Ft=b.default.registry.getLazyComponent("WidgetArticleTextEditor"),Rt=b.default.registry.getLazyComponent("WidgetArticleGalleryEditor"),jt=b.default.registry.getLazyComponent("WidgetArticleAttachmentEditor"),Dt=b.default.registry.getLazyComponent("WidgetArticleSliderEditor"),zt=b.default.registry.getLazyComponent("WidgetArticleImageEditor"),Bt=b.default.registry.getLazyComponent("WidgetButtonEditor"),Jt=b.default.registry.getLazyComponent("WidgetApiEditor"),Gt=b.default.registry.getLazyComponent("WidgetCheckListEditor"),Ht=b.default.registry.getLazyComponent("WidgetDatasourceTableEditor"),Nt=b.default.registry.getLazyComponent("WidgetExcelDatasourceTableEditor"),Ut=({uniqid:e})=>{var t,n,i,o,r,s,u,m;const g=(0,a.useIntl)(),p=(0,d.useDispatch)(),y=(0,d.useSelector)(c.$L.selectors.selectToken),h=(0,d.useSelector)((t=>c.$L.selectors.selectWidget(t,e)),d.shallowEqual),v=(0,d.useSelector)((t=>c.$L.selectors.selectWidgetObject(t,e)),d.shallowEqual),C=t=>{h&&p(c.$L.slice.actions.updateWidget({uniqid:e,content:t})),p(c.Wq.slice.actions.flushEditor({uniqid:e}))},x=(t,n)=>{p(void 0!==n?c.$L.slice.actions.setWidgetState(Object.assign({uniqid:n},t)):c.$L.slice.actions.setWidgetState(Object.assign({uniqid:e},t)))},w=t=>{p(c.Wq.slice.actions.registerEditorPopup({uniqid:e,view:t}))},W=null==h?void 0:h.widget;if(!W)return null;if((0,f.ensureWidgetArticleButtonType)(W))return l().createElement(Bt,Object.assign({},W.content,{onChange:t=>{p((0,c.O5)(e,t,!1))},onSave:()=>C({})}));if((0,f.ensureWidgetArticleGalleryType)(W))return l().createElement(Rt,{token:y,content:W.content,onChange:t=>p((0,c.O5)(e,t,!1)),onSave:C,onStateChange:x});if((0,f.ensureWidgetArticleAttachmentType)(W))return l().createElement(jt,{token:y,content:W.content,onChange:t=>{p((0,c.O5)(e,t,!1))},onSave:C,onStateChange:x,onOpen:w});if((0,f.ensureWidgetArticleImageType)(W))return l().createElement(zt,{content:W.content,token:y,onChange:t=>{p((0,c.O5)(e,t,!1))},onSave:C,onStateChange:x});if((0,f.ensureWidgetApiType)(W))return l().createElement(Jt,{onChange:t=>p((0,c.O5)(e,t,!1)),provider:e=>{return t=void 0,n=void 0,l=function*(){return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>e.result))},new((i=void 0)||(i=Promise))((function(e,o){function r(e){try{s(l.next(e))}catch(e){o(e)}}function a(e){try{s(l.throw(e))}catch(e){o(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,a)}s((l=l.apply(t,n||[])).next())}));var t,n,i,l},initialUrl:null!==(t=W.content.url)&&void 0!==t?t:"",order:null!==(n=W.content.order)&&void 0!==n?n:"",orderBy:null!==(i=W.content.orderBy)&&void 0!==i?i:"asc"});if((0,f.ensureWidgetArticleSliderType)(W))return void 0!==y?l().createElement(Dt,{slides:null!==(o=W.content.slides)&&void 0!==o?o:[],loop:null!==(r=W.content.loop)&&void 0!==r&&r,useDots:null===(s=W.content.useDots)||void 0===s||s,onChange:t=>{p((0,c.O5)(e,t,!1))},token:y,onSave:C}):l().createElement(l().Fragment,null,"Token is mandatory");if((0,f.ensureWidgetArticleTitleType)(W))return l().createElement(_t,{onChange:t=>{p((0,c.O5)(e,t,!1))},onSave:C,content:W.content,onOpen:w});if((0,f.ensureWidgetArticleTextType)(W))return l().createElement(Ft,{onChange:t=>{p((0,c.O5)(e,t,!1))},onSave:C,content:W.content});if((0,f.ensureWidgetCheckListType)(W))return l().createElement(Gt,{token:y,uniqid:W.uniqid,content:W.content,onChangeContent:(e,t)=>{p((0,c.O5)(e,t,!1))},onChangeWrapper:e=>{p(c.$L.slice.actions.updateWidgetWrapper(Object.assign({},e)))},onSave:(e,t)=>{var n;void 0!==(n=v)&&void 0!==n.id&&void 0!==n.type?E().widget.updateWidget({id:v.id,uniqid:e,type:v.type,title:h.title,content:t}).then((()=>{C(t)})).catch((e=>{var t;p(c.FN.actions.error({label:null!==(t=e.errorMsg)&&void 0!==t?t:g.formatMessage({id:"GLOBAL_Error"})}))})):C(t)}});if((0,f.ensureWidgetExcelDatasourceTableType)(W))return l().createElement(Nt,Object.assign({},W.content,{uri:W.content.uri,limit:null!==(u=W.content.limit)&&void 0!==u?u:20,onSave:C,onChange:(t,n)=>p((0,c.O5)(e,t,null!=n&&n)),onStateChange:x,onError:e=>{p(c.FN.actions.error({label:e}))}}));if((0,f.ensureWidgetDatasourceTableType)(W)){const t=c.Mx.selectors.selectById(b.default.store.getState(),"StudioHook"),n=c.Mx.selectors.selectById(b.default.store.getState(),"FileBankHook");return l().createElement(Ht,Object.assign({},W.content,{uri:W.content.uri,limit:null!==(m=W.content.limit)&&void 0!==m?m:20,editorAppDependencies:{useStudio:!!t,useFileBank:!!n},onSave:C,onChange:(t,n)=>p((0,c.O5)(e,t,null!=n&&n)),onStateChange:x,onError:e=>{p(c.FN.actions.error({label:e}))}}))}return l().createElement(l().Fragment,null,"cannot display editor")},Pt=({uniqid:e})=>{var t;const n=(0,d.useDispatch)(),i=(0,a.useIntl)(),o=null===(t=(0,d.useSelector)((t=>c.$L.selectors.selectWidget(t,e))))||void 0===t?void 0:t.widget,r=(null==o?void 0:o.content)&&"widgets"in o.content&&o.content.widgets?o.content.widgets:[];return l().createElement("div",{style:{flex:1}},l().createElement(Vt,{uniqid:e}),o?r.map(((t,a)=>{const d=c.$L.definition(t.widget.name);return l().createElement("div",{key:a},l().createElement(Tt,null,l().createElement(Mt,{onClick:()=>((e,t)=>{n(c.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(t.widget.uniqid,t.widget.name)},i.formatMessage({id:d.label})),l().createElement(It,{onClick:()=>{n(c.$L.slice.actions.updateWidget({uniqid:e,content:Object.assign(Object.assign({},o.content),{widgets:[...r.filter(((e,t)=>t!==a)).map((e=>((0,f.ensureWidgetWrapperProps)(e)||console.error("Zozod",e),e)))]})}))}},l().createElement(s.JRCIcon,{name:"icon-trash"}))))})):l().createElement(l().Fragment,null))},Vt=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.ids[e].widget.layers),d.shallowEqual);return l().createElement(l().Fragment,null,l().createElement(s.BETA_JRCDragAndDrop,{onDrag:()=>{},renderEl:(e,t)=>l().createElement(Xt,{uniqid:e,key:t}),elms:n||[]}),l().createElement(I,{namespace:"default",onChange:n=>{t(c.$L.slice.actions.registerLayer({uniqid:e,widget:n}))},mode:"button"}))},Qt=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.$L.slice.actions.updateLayer({uniqid:e,props:{locked:!n.locked}}))}},l().createElement(s.JRCIcon,{name:n.locked?"icon-lock":"icon-unlock"}))},Kt=({uniqid:e})=>{const t=(0,d.useDispatch)(),n=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement("div",{onClick:()=>{t(c.$L.slice.actions.updateLayer({uniqid:e,props:{visible:!n.visible}}))}},l().createElement(s.JRCIcon,{name:n.visible?"icon-eye":"icon-eye-slash"}))},Zt=({uniqid:e,layerId:t})=>{const n=(0,d.useDispatch)();return l().createElement("div",{onClick:()=>{n(c.$L.slice.actions.flushLayer({uniqid:e,layerId:t}))}},l().createElement(s.JRCIcon,{name:"icon-trash"}))},Xt=({uniqid:e})=>{const t=(0,d.useSelector)((t=>t.widgets.layers[e]));return l().createElement(l().Fragment,null,t.title,t.widgets.map(((n,i)=>{const o=c.$L.definition(n.widget.name);return l().createElement("div",{style:{flexDirection:"row",display:"flex"},key:i},l().createElement("div",{style:{flex:1,alignItems:"center"}},o.label),l().createElement(Qt,{uniqid:e}),l().createElement(Kt,{uniqid:e}),l().createElement(Zt,{uniqid:n.widget.uniqid,layerId:t.uniqid}))})))},Yt=b.default.registry.getLazyComponent("Button"),en=({uniqid:e})=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),i=(0,d.useSelector)((t=>c.$L.selectors.selectWidget(t,e))),[o,r]=l().useState(null==i?void 0:i.title),{control:u,watch:m}=(0,mt.useForm)({defaultValues:{text:null!=o?o:""},criteriaMode:"all"});return l().useEffect((()=>{const e=m((e=>{r(e.text)}));return()=>e.unsubscribe()}),[m]),i?l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between"}},l().createElement(s.JRCInputText,{name:"text",control:u,placeholder:t.formatMessage({id:"WIDGET_Title"})}),l().createElement(Yt,{onClick:()=>{void 0!==o&&(n(c.$L.slice.actions.updateWidgetWrapper({uniqid:e,title:o})),n(c.Wq.slice.actions.flushEditor({uniqid:e})))},minWidth:"100%"},t.formatMessage({id:"GLOBAL_Save"}))):l().createElement(l().Fragment,null,"No wrapper")},tn=b.default.registry.getLazyComponent("Loader"),nn=({uniqid:e})=>{var t;const n=null===(t=(0,d.useSelector)((t=>c.$L.selectors.selectWidgetState(t,e))))||void 0===t?void 0:t.busy;return l().createElement(l().Fragment,null,n&&l().createElement(qt,null,l().createElement(tn,{size:"l"})))},ln=b.default.registry.getLazyComponent("Icon"),on=({uniqid:e,position:t})=>{const n=(0,d.useDispatch)();return l().createElement(wt,null,l().createElement(At,{onClick:()=>{n(c.Wq.slice.actions.setEditorPosition({uniqid:e,position:"left"===t?"right":"left"}))}},l().createElement(ln,{name:"left"===t?"icon-angle-right":"icon-angle-left",color:"grey2"})))},rn=({uniqid:e,children:t})=>{var n;return(null===(n=(0,d.useSelector)((t=>c.$L.selectors.selectWidgetState(t,e))))||void 0===n?void 0:n.initialized)?t:l().createElement(l().Fragment,null)},an=b.default.registry.getLazyComponent("Icon"),sn=({uniqid:e,position:t})=>{const n=(0,a.useIntl)(),o=(0,d.useDispatch)(),r=(0,i.useRef)(null),s=(0,d.useSelector)((t=>c.Wq.selectors.selectEditor(t,e)),d.shallowEqual),u=c.$L.definition(null==s?void 0:s.name),[m,g]=l().useState("default");return(0,i.useEffect)((()=>{setTimeout((()=>{r&&r.current&&(r.current.className=r.current.className+" animate")}),0)}),[]),s?l().createElement(kt,null,l().createElement(Lt,{ref:r,position:t},(u.panel.useWrapper||u.panel.useEditor||u.panel.useWidgets)&&l().createElement($t,null,u.panel.useWrapper?l().createElement(At,{isActive:"wrapper"===m,onClick:()=>g("wrapper")},l().createElement(an,{name:"icon-font",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useEditor?l().createElement(At,{isActive:"default"===m,onClick:()=>g("default")},l().createElement(an,{name:"icon-pen",color:"grey2"})):l().createElement(l().Fragment,null),u.panel.useWidgets?l().createElement(rn,{uniqid:e},l().createElement(At,{isActive:"widgets"===m,onClick:()=>g("widgets")},l().createElement(an,{name:"icon-sliders",color:"grey2"}))):l().createElement(l().Fragment,null)),l().createElement("div",{style:{flex:1,display:"flex",flexDirection:"column"}},l().createElement(xt,null,l().createElement(on,{uniqid:e,position:s.position}),l().createElement(Wt,null,n.formatMessage({id:u.label})),l().createElement(wt,null,l().createElement(At,{onClick:()=>{o(c.Wq.slice.actions.flushEditor({uniqid:e}))}},l().createElement(an,{name:"icon-times",color:"grey2"})))),l().createElement(St,null,"default"===m&&u.panel.useEditor?l().createElement(Ut,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"wrapper"===m&&u.panel.useWrapper?l().createElement(en,{uniqid:s.uniqid}):l().createElement(l().Fragment,null),"widgets"===m&&u.panel.useWidgets?l().createElement(Pt,{uniqid:e,namespace:u.name}):l().createElement(l().Fragment,null),l().createElement(nn,{uniqid:e})))),(null==s?void 0:s.popup)?l().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"#000",opacity:".7"}}):l().createElement(l().Fragment,null)):l().createElement(l().Fragment,null)},cn=r().div`
|
|
458
|
+
position: absolute;
|
|
459
|
+
inset: 0;
|
|
460
|
+
pointer-events: none;
|
|
461
|
+
z-index: 1;
|
|
462
|
+
`,dn=r().div`
|
|
463
|
+
flex: 1;
|
|
464
|
+
display: flex;
|
|
465
|
+
margintop: ${90}px;
|
|
466
|
+
pointer-events: ${e=>e.isActive?"all":"none"};
|
|
467
|
+
`,un=r().div`
|
|
468
|
+
flex: 1;
|
|
469
|
+
display: flex;
|
|
470
|
+
flex-direction: row;
|
|
471
|
+
pointer-events: none;
|
|
472
|
+
`,mn=r().div`
|
|
473
|
+
width: ${440}px;
|
|
474
|
+
pointer-events: none;
|
|
475
|
+
`,gn=()=>{const e=(0,d.useSelector)(c.Wq.selectors.selectEditors,d.shallowEqual);return l().createElement(cn,{className:"editor-portal-wrapper"},e.map(((e,t)=>"left"===e.position?l().createElement(Ct,{isActive:!1,key:t},l().createElement(un,null,l().createElement(sn,{uniqid:e.uniqid,position:e.position}),l().createElement(dn,{isActive:void 0!==e.popup},l().createElement(Ot,{uniqid:e.uniqid})),l().createElement(mn,null))):l().createElement(Ct,{isActive:!1,key:t},l().createElement(un,null,l().createElement(mn,null),l().createElement(dn,{isActive:void 0!==e.popup},l().createElement(Ot,{uniqid:e.uniqid})),l().createElement(sn,{uniqid:e.uniqid,position:e.position}))))))},pn=()=>i.createElement(i.Fragment,null),fn=()=>{const[e,t]=(0,i.useState)(),n=(0,a.useIntl)(),l=(0,i.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:n=>{e.reject(n),t(void 0)},resolve:n=>{e.resolve(n),t(void 0)}}))}),[]),o=(0,i.useCallback)(((e,t)=>new Promise(((n,i)=>{l({reject:i,resolve:n,text:e,capability:t})}))),[l]),r=(0,i.useMemo)((()=>({develop:e=>o(e,"develop"),summarize:e=>o(e,"summarize"),tldr:e=>o(e,"tldr"),en:e=>o(e,"en"),es:e=>o(e,"es"),formal:e=>o(e,"formal"),funny:e=>o(e,"funny")})),[o]);return[e,(0,i.useMemo)((()=>s.JTinyMCEExtensionsBuilders.jia(r,n)),[n,r])]},En=e=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),r=(0,o.useTheme)(),u=(0,d.useSelector)(c.Hn.selectors.selectAll),[m,g]=fn(),p=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),f=(0,i.useMemo)((()=>p?[g]:[]),[g,p]),E=(0,i.useCallback)((e=>{n(c.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),y=(0,i.useMemo)((()=>(0,b.getTinyMCEMentionsQueries)(u,r,E)),[u,E,r]),h=(0,i.useMemo)((()=>b.default.tinymceCommonOptions),[]);return l().createElement(l().Fragment,null,h&&l().createElement(s.JRCInputTinyMCE,Object.assign({commonOptions:h,additionalExtensions:f,mentionsQueries:y},e)),l().createElement(v,{query:m}))},yn=e=>{const t=(0,a.useIntl)(),n=(0,d.useDispatch)(),r=(0,o.useTheme)(),u=(0,d.useSelector)(c.Hn.selectors.selectAll),[m,g]=fn(),p=(0,i.useMemo)((()=>{var e,t;return(null===(t=null===(e=J.hooks)||void 0===e?void 0:e.JIAHook)||void 0===t?void 0:t.isActive)&&J.debug.JIABETA}),[]),f=(0,i.useMemo)((()=>p?[g]:[]),[g,p]),E=(0,i.useCallback)((e=>{n(c.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[n,t]),y=(0,i.useMemo)((()=>(0,b.getTinyMCEMentionsQueries)(u,r,E)),[u,E,r]),h=(0,i.useMemo)((()=>b.default.tinymceCommonOptions),[]);return l().createElement(l().Fragment,null,h&&l().createElement(s.JRCInputTinyMCERaw,Object.assign({commonOptions:h,additionalExtensions:f,mentionsQueries:y},e)),l().createElement(v,{query:m}))},hn=({open:e,closeHandler:t,title:n,control:i,warningMessage:o,onSubmit:r,name:u="publishTo"})=>{const m=(0,a.useIntl)(),g=(0,d.useSelector)(c.Zc.selectors.selectNetworkPublic);return l().createElement(s.JRCModal,{open:e,closeHandler:t,title:null!=n?n:m.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:l().createElement(a.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),r()}}]},l().createElement(s.JRCMessage,{variant:"warning",message:null!=o?o:m.formatMessage({id:"FORM_Audience_Empty"})}),l().createElement(s.JRCInputAudience,{asyncPromise:e=>E().audience.autocomplete(e),searchable:!0,control:i,multiple:!0,placeholder:m.formatMessage({id:"GLOBAL_Audience"}),name:u,defaultCustomOptions:g?[{uri:g.uri,title:g.title,resetOptions:!0,icon:"icon-fs-wall"}]:[]}))};var vn=n(248);const bn=b.default.registry.getLazyComponent("Container"),Cn=b.default.registry.getLazyComponent("AppColumn"),xn=b.default.registry.getLazyComponent("MainColumn");function wn({extensionRoute:e,routes:t,description:n,mode:l="center"}){var o;const r=(0,a.useIntl)(),{pathname:s}=(0,vn.useLocation)(),c=(0,i.useMemo)((()=>Object.values(t)),[t]),[d,u]=i.useState(null===(o=null==c?void 0:c[0])||void 0===o?void 0:o.key),m=c.map((t=>Object.assign(Object.assign({},t),{label:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0})));return i.useEffect((()=>{const t=c.find((t=>{var n;return`/ng/rr/${e}/${t.path}`===s||(null===(n=t.paths)||void 0===n?void 0:n.reduce(((t,n)=>{const i=`/ng/rr/${e}/${n}`,l=null!==(0,vn.matchPath)(i,s);return t||l}),!1))}));t&&u(t.key)}),[s,c,e]),i.createElement(i.Suspense,{fallback:i.createElement(i.Fragment,null)},i.createElement(bn,{mode:l},i.createElement(Cn,{mode:l,description:n,tabs:m,activeTab:d||""}),i.createElement(xn,{mode:l},i.createElement(vn.Outlet,null))))}}}]);
|
|
476
|
+
//# sourceMappingURL=335.bundle.js.map
|