jamespot-react-core 1.1.144 → 1.1.146
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/{624.bundle.js → 977.bundle.js} +17 -17
- package/build/977.bundle.js.map +1 -0
- package/build/app.bundle.js +359 -364
- package/build/app.bundle.js.map +1 -1
- package/build/src/ReactCore.d.ts +1 -0
- package/build/src/components/CommentsBloc.d.ts +4 -2
- package/build/src/displayer/components/inputs/Radio.d.ts +1 -1
- package/build/src/hooks/useCommentRT.d.ts +2 -0
- package/build/src/hooks/useCommentsLikeRT.d.ts +2 -0
- package/build/src/utils/types.d.ts +2 -0
- package/package.json +7 -4
- package/build/624.bundle.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[977],{977:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>St,CommentsBloc:()=>Oe,DisplayForm:()=>jt,EditorsPortal:()=>Ct,Empty:()=>Me,JRCInputTinyMCEWithExt:()=>Wt,JRCInputTinyMCEWithExtRaw:()=>$t,TwoColLayout:()=>De,WidgetList:()=>q,WidgetWrapperCore:()=>We});var n=i(888),l=i(694),o=i(143),r=i(6),a=i.n(r),c=i(363),s=i.n(c),d=i(181),u=i(855),m=i(754),g=i.n(m);const p=g().div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
4
|
flex-wrap: wrap;
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
flex-direction: row;
|
|
84
84
|
min-height: 60px;
|
|
85
85
|
align-items: center;
|
|
86
|
-
`,I=({widget:e})=>{const{url:t,keys:i,order:n,orderBy:l}=e.content,[r,a]=s().useState([]);return s().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]),s().createElement($,null,s().createElement(o.JRCWidgetApi,{data:r,keys:null!=i?i:[],order:null!=n?n:"",orderBy:null!=l?l:"asc"}))},
|
|
86
|
+
`,I=({widget:e})=>{const{url:t,keys:i,order:n,orderBy:l}=e.content,[r,a]=s().useState([]);return s().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]),s().createElement($,null,s().createElement(o.JRCWidgetApi,{data:r,keys:null!=i?i:[],order:null!=n?n:"",orderBy:null!=l?l:"asc"}))},A=g().div`
|
|
87
87
|
width: 0;
|
|
88
88
|
height: 0;
|
|
89
89
|
overflow: hidden;
|
|
90
|
-
`,
|
|
90
|
+
`,O=({children:e,initialFiles:t,initialClick:i,multiple:n,accept:r,onUploadStart:a,onUploadEnd:c,onUploadSuccess:d})=>{const m=s().useRef(null),g=(0,u.useSelector)(l.$L.selectors.selectToken),[p,f]=s().useState(0),[E,v]=s().useState(t);return s().useEffect((()=>{var e;i&&(null===(e=m.current)||void 0===e||e.click())}),[i]),s().useEffect((()=>{t.length!==E.length&&v(t)}),[t]),s().useEffect((()=>{d(E)}),[E]),s().useEffect((()=>{0===p&&c()}),[p]),s().createElement(s().Fragment,null,s().createElement("div",{onClick:()=>{var e;i&&(null===(e=m.current)||void 0===e||e.click())}},e),s().createElement(A,null,s().createElement(o.JRCInputFileAdvancedRaw,{ref:m,id:"widget-upload-file",name:"editorFiles",content:"",accept:r,multiple:n,token:g,onUploadStart:e=>{void 0!==e&&f((t=>t+e)),"function"==typeof a&&0!==e&&a()},onUploadSuccess:e=>{void 0!==e&&(f((e=>void 0!==e?e-1:0)),v((t=>n?[...t,e]:[e])))}})))},M=n.default.registry.getLazyComponent("WidgetAttachment"),F=n.default.registry.getLazyComponent("FileViewer"),_=g().div`
|
|
91
91
|
flex: 1;
|
|
92
|
-
`,T=({widget:e,inplace:t,mode:i})=>{const n=(0,d.useIntl)(),{uniqid:r}=e,{files:m}=e.content,g=(0,u.useDispatch)(),p=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,r)),u.shallowEqual),f=e=>{g(l.FN.actions.error({label:null!=e?e:n.formatMessage({id:"GLOBAL_Error"})}))};(0,c.useEffect)((()=>{g(l.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),(0,c.useEffect)((()=>{g(l.$L.slice.actions.setWidgetState({uniqid:r,empty:!m||0===m.length}))}),[m]);const E=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"OnlyOfficeHook"))),v=[{label:n.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&a().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const i=t.result;((e,t,i)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,i)})).catch((()=>{g(l.FN.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],y=E?[{condition:e=>["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.mimetype),options:v}]:[];return void 0!==m?s().createElement(_,null,"view"!==i?s().createElement(M,{files:m,onClick:()=>{},onError:f}):s().createElement(F,{files:m,openWithOptions:y},(e=>s().createElement(M,{files:m,onClick:t=>e(t),onError:f}))),t&&"view"!==i&&s().createElement(
|
|
92
|
+
`,T=({widget:e,inplace:t,mode:i})=>{const n=(0,d.useIntl)(),{uniqid:r}=e,{files:m}=e.content,g=(0,u.useDispatch)(),p=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,r)),u.shallowEqual),f=e=>{g(l.FN.actions.error({label:null!=e?e:n.formatMessage({id:"GLOBAL_Error"})}))};(0,c.useEffect)((()=>{g(l.$L.slice.actions.setWidgetState({uniqid:r,mounted:!0}))}),[]),(0,c.useEffect)((()=>{g(l.$L.slice.actions.setWidgetState({uniqid:r,empty:!m||0===m.length}))}),[m]);const E=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"OnlyOfficeHook"))),v=[{label:n.formatMessage({id:"WIDGET_Open_With_Wedoc"}),onClick:e=>{e&&a().object.getAccessHash(`fileArticle/${e.id}`).then((t=>{if(""===t.result)throw new Error("result empty");const i=t.result;((e,t,i)=>{window.open(function(e,t){return`/ng/rr/file/${e}/${t}`}(e,t),void 0)})(e.id,i)})).catch((()=>{g(l.FN.actions.error({label:"WIDGET_Open_Failed"},6e3))}))}}],y=E?[{condition:e=>["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"].includes(e.mimetype),options:v}]:[];return void 0!==m?s().createElement(_,null,"view"!==i?s().createElement(M,{files:m,onClick:()=>{},onError:f}):s().createElement(F,{files:m,openWithOptions:y},(e=>s().createElement(M,{files:m,onClick:t=>e(t),onError:f}))),t&&"view"!==i&&s().createElement(O,{initialFiles:m,initialClick:p,multiple:!0,accept:"*",onUploadSuccess:e=>{Array.isArray(e)&&g((0,l.O5)(r,{files:e}))},onUploadStart:()=>{g(l.$L.slice.actions.setWidgetState({uniqid:r,loading:!0}))},onUploadEnd:()=>{g(l.$L.slice.actions.setWidgetState({uniqid:r,loading:!1}))}},"edit"===i?s().createElement(o.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Attachment_Empty_Label",description:"WIDGET_Article_Attachment_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}}):s().createElement(s().Fragment,null))):s().createElement(s().Fragment,null)},j=g().div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 1;
|
|
95
95
|
justify-content: center;
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
align-items: center;
|
|
104
104
|
`,R=({widget:e,mode:t})=>{const i=(0,u.useDispatch)(),{uniqid:n}=e,{text:r,url:a,target:d,color:m,backgroundColor:g,buttonSize:p,borderRadius:f,variant:E}=e.content;return(0,c.useEffect)((()=>{i(l.$L.slice.actions.setWidgetState({uniqid:n,empty:!r||0===r.length}))}),[r]),s().createElement(j,{onClick:()=>{"edit"===t&&i(l.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}},s().createElement(D,{clickable:"edit"!==t},s().createElement(o.JRCWidgetButton,{text:r,url:a,target:d,color:m,backgroundColor:g,buttonSize:p,borderRadius:f,variant:E})))},z=n.default.registry.getLazyComponent("WidgetArticleGallery"),U=n.default.registry.getLazyComponent("FileViewer"),B=g().button`
|
|
105
105
|
cursor: pointer;
|
|
106
|
-
`,G=({widget:e,inplace:t,mode:i})=>{var n,r;const{uniqid:a}=e,{files:c}=e.content,d=(0,u.useDispatch)(),m=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,a)),u.shallowEqual);return s().useEffect((()=>{d(l.$L.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),void 0!==c?s().createElement(s().Fragment,null,"edit"===i?s().createElement(z,{files:c,maxWidth:800,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(r=e.content.column)&&void 0!==r?r:"3",onClick:()=>{}}):s().createElement(U,{files:c,openWithOptions:[]},(t=>{var i,n;return s().createElement(B,null,s().createElement(z,{files:c,maxWidth:600,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(n=e.content.column)&&void 0!==n?n:"3",onClick:e=>t(e)}))})),t&&"edit"===i?s().createElement(
|
|
106
|
+
`,G=({widget:e,inplace:t,mode:i})=>{var n,r;const{uniqid:a}=e,{files:c}=e.content,d=(0,u.useDispatch)(),m=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,a)),u.shallowEqual);return s().useEffect((()=>{d(l.$L.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),void 0!==c?s().createElement(s().Fragment,null,"edit"===i?s().createElement(z,{files:c,maxWidth:800,gap:null!==(n=e.content.gap)&&void 0!==n?n:"10",column:null!==(r=e.content.column)&&void 0!==r?r:"3",onClick:()=>{}}):s().createElement(U,{files:c,openWithOptions:[]},(t=>{var i,n;return s().createElement(B,null,s().createElement(z,{files:c,maxWidth:600,gap:null!==(i=e.content.gap)&&void 0!==i?i:"10",column:null!==(n=e.content.column)&&void 0!==n?n:"3",onClick:e=>t(e)}))})),t&&"edit"===i?s().createElement(O,{initialFiles:c,initialClick:m,accept:"image/png, image/jpeg, image/jpg",multiple:!0,onUploadSuccess:e=>{Array.isArray(e)&&d((0,l.O5)(a,{files:e}))},onUploadStart:()=>{d(l.$L.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{d(l.$L.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},s().createElement(o.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Gallery_Empty_Label",description:"WIDGET_Article_Gallery_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):s().createElement(s().Fragment,null)):s().createElement(s().Fragment,null)},H=n.default.registry.getLazyComponent("WidgetImage"),N=n.default.registry.getLazyComponent("FileViewer"),P=g().div`
|
|
107
107
|
position: absolute;
|
|
108
108
|
inset: 0;
|
|
109
109
|
background-color: rgba(0, 0, 0, 0.4);
|
|
@@ -118,14 +118,14 @@
|
|
|
118
118
|
}
|
|
119
119
|
`,V=g().button`
|
|
120
120
|
cursor: pointer;
|
|
121
|
-
`,Q={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},K=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},X=({widget:e,width:t,inplace:i,mode:n})=>{const{uniqid:a}=e,{file:m,useFilter:g}=e.content,p=(0,u.useDispatch)(),f=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,a)),u.shallowEqual),[E,v]=(0,c.useState)(void 0),y=(0,d.useIntl)();return(0,c.useEffect)((()=>{p(l.$L.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,c.useEffect)((()=>{p(l.$L.slice.actions.setWidgetState({uniqid:a,empty:!m}))}),[m]),(0,c.useEffect)((()=>{m&&v((0,r.formatImgUrl)({timestamp:m.dateModified?K(m.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:m.uri}))}),[m]),s().createElement(s().Fragment,null,"edit"===n?void 0!==E?s().createElement(H,{maxWidth:null!=t?t:600,uri:E,useFilter:null!=g&&g}):s().createElement(s().Fragment,null):s().createElement(N,{files:[Object.assign(Object.assign({},Q),{path:E,mimetype:"image/png"})],openWithOptions:[]},(e=>s().createElement(V,{onClick:()=>e(0)},s().createElement(H,{maxWidth:null!=t?t:600,uri:E,useFilter:null!=g&&g})))),i&&"edit"===n?s().createElement(
|
|
121
|
+
`,Q={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},K=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},X=({widget:e,width:t,inplace:i,mode:n})=>{const{uniqid:a}=e,{file:m,useFilter:g}=e.content,p=(0,u.useDispatch)(),f=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,a)),u.shallowEqual),[E,v]=(0,c.useState)(void 0),y=(0,d.useIntl)();return(0,c.useEffect)((()=>{p(l.$L.slice.actions.setWidgetState({uniqid:a,mounted:!0}))}),[]),(0,c.useEffect)((()=>{p(l.$L.slice.actions.setWidgetState({uniqid:a,empty:!m}))}),[m]),(0,c.useEffect)((()=>{m&&v((0,r.formatImgUrl)({timestamp:m.dateModified?K(m.dateModified):Date.now(),from:"imagecache",size:"fitx1200",uri:m.uri}))}),[m]),s().createElement(s().Fragment,null,"edit"===n?void 0!==E?s().createElement(H,{maxWidth:null!=t?t:600,uri:E,useFilter:null!=g&&g}):s().createElement(s().Fragment,null):s().createElement(N,{files:[Object.assign(Object.assign({},Q),{path:E,mimetype:"image/png"})],openWithOptions:[]},(e=>s().createElement(V,{onClick:()=>e(0)},s().createElement(H,{maxWidth:null!=t?t:600,uri:E,useFilter:null!=g&&g})))),i&&"edit"===n?s().createElement(O,{initialFiles:[],initialClick:f,accept:"image/png, image/jpeg, image/jpg",multiple:!1,onUploadSuccess:e=>{Array.isArray(e)&&void 0!==e[0]&&p((0,l.O5)(a,{file:e[0]}))},onUploadStart:()=>{p(l.$L.slice.actions.setWidgetState({uniqid:a,loading:!0}))},onUploadEnd:()=>{p(l.$L.slice.actions.setWidgetState({uniqid:a,loading:!1}))}},void 0!==m?s().createElement(P,null,y.formatMessage({id:"ARTICLE_Widget_Image_Change"})):s().createElement(o.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Image_Empty_Label",description:"WIDGET_Article_Image_Empty_Description",url:"widget-article-image-placeholder.png",onClick:()=>{}})):s().createElement(s().Fragment,null))};var Y=i(5);const Z=n.default.registry.getLazyComponent("FileViewer"),ee=g().div`
|
|
122
122
|
flex: 1;
|
|
123
123
|
display: flex;
|
|
124
124
|
flex-direction: row;
|
|
125
125
|
min-height: 60px;
|
|
126
126
|
align-items: center;
|
|
127
127
|
width: ${e=>e.maxWidth}px;
|
|
128
|
-
`,te={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},ie=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},ne=({widget:e,mode:t,width:i})=>{const{uniqid:n}=e,a=(0,Y.TL)(),d=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,n)),u.shallowEqual),m=null!=i?i:600,[g,p]=(0,c.useState)(void 0),f=(0,c.useRef)(null),E=(0,c.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},te),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:te.mimetype,path:(0,r.formatImgUrl)({size:"fitx1200",uri:e.file?e.file.uri:"",from:"imagecache",timestamp:e.file&&e.file.dateModified?ie(e.file.dateModified):Date.now()})})))]:[]),[e.content.slides]),v=(0,c.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,r.formatImgUrl)({timestamp:e.file.dateModified?ie(e.file.dateModified):Date.now(),size:`fitx${g&&g<m?g:m}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,g]);(0,c.useEffect)((()=>{d&&"edit"===t&&a(l.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}),[d])
|
|
128
|
+
`,te={id:0,type:"",title:"",uri:"",mimetype:"application/octet-stream",mainType:"",dateCreation:"",dateModified:"",_url:"",size:10},ie=e=>{if(e){const t=Date.parse(e);if(!isNaN(t))return new Date(t).getTime()/1e3}},ne=({widget:e,mode:t,width:i})=>{const{uniqid:n}=e,a=(0,Y.TL)(),d=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,n)),u.shallowEqual),m=null!=i?i:600,[g,p]=(0,c.useState)(void 0),f=(0,c.useRef)(null),E=(0,c.useMemo)((()=>e.content.slides?[...e.content.slides.map(((e,t)=>Object.assign(Object.assign({},te),{id:e.file?e.file.id:t,mimetype:e.file?e.file.mimetype:te.mimetype,path:(0,r.formatImgUrl)({size:"fitx1200",uri:e.file?e.file.uri:"",from:"imagecache",timestamp:e.file&&e.file.dateModified?ie(e.file.dateModified):Date.now()})})))]:[]),[e.content.slides]),v=(0,c.useMemo)((()=>void 0!==e.content.slides?[...e.content.slides.map((e=>e.file?Object.assign(Object.assign({},e),{uri:(0,r.formatImgUrl)({timestamp:e.file.dateModified?ie(e.file.dateModified):Date.now(),size:`fitx${g&&g<m?g:m}`,from:"imagecache",uri:e.file.uri})}):Object.assign(Object.assign({},e),{uri:""})))]:[]),[e.content.slides,g,m]);(0,c.useEffect)((()=>{d&&"edit"===t&&a(l.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}),[d]),(0,c.useEffect)((()=>{const e=()=>{f.current&&p(f.current?f.current.offsetWidth:m)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[f]),(0,c.useEffect)((()=>{p(f.current?f.current.offsetWidth:m)}),[f]),(0,c.useEffect)((()=>{a(l.$L.slice.actions.setWidgetState({uniqid:n,empty:!e.content.slides||0===e.content.slides.length}))}),[e.content.slides]);const y=(0,c.useMemo)((()=>"edit"===t&&Array.isArray(e.content.slides)&&0===e.content.slides.length),[e.content.slides,t]),h=(0,c.useCallback)((()=>{a(l.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))}),[a,e.uniqid,e.name]);return void 0===g?s().createElement("div",{ref:f,style:{width:"100%"}}):s().createElement(ee,{maxWidth:g&&g<m?g:m},s().createElement(Z,{files:E,openWithOptions:[]},(i=>{var r,c;return s().createElement(o.JRCWidgetSlider,{slides:v,maxWidth:g&&g<m?g:m,useDots:null===(r=e.content.useDots)||void 0===r||r,loop:null!==(c=e.content.loop)&&void 0!==c&&c,startAt:0,onClickSlide:o=>{if("edit"!==t){if(e.content.slides){const t=e.content.slides[o];t&&t.file&&i(t.file.id)}}else a(l.Wq.slice.actions.registerEditor({uniqid:n,name:e.name}))}})})),y?s().createElement(o.JRCWidgetEmptyInplace,{label:"WIDGET_Article_Slider_Empty_Label",description:"WIDGET_Article_Slider_Empty_Description",url:"widget-article-image-placeholder.png",onClick:h}):s().createElement(s().Fragment,null))},le=n.default.registry.getLazyComponent("WidgetArticleText"),oe=g().div`
|
|
129
129
|
cursor: text;
|
|
130
130
|
p {
|
|
131
131
|
word-wrap: break-word;
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
a {
|
|
134
134
|
word-wrap: break-word;
|
|
135
135
|
}
|
|
136
|
-
`,re=({widget:e,mode:t})=>{const{uniqid:i}=e,o=(0,m.useTheme)(),{text:r
|
|
136
|
+
`,re=({widget:e,mode:t})=>{const{uniqid:i}=e,o=(0,m.useTheme)(),{text:r}=e.content,a=(0,u.useDispatch)(),g=(0,u.useSelector)((e=>l.$L.selectors.isActive(e,i)),u.shallowEqual),p=(0,u.useSelector)((e=>{var t;return null===(t=l.$L.selectors.selectWidgetState(e,i))||void 0===t?void 0:t.busy})),f=(0,u.useSelector)(l.$L.selectors.selectToken),E=(0,u.useSelector)(l.zh.selectors.selectTinyMCECommonOptions),v=(0,u.useSelector)(l.Hn.selectors.selectAll),y=(0,d.useIntl)(),h=(0,c.useCallback)((e=>{a(l.FN.actions.error({label:null!=e?e:y.formatMessage({id:"GLOBAL_Error"})}))}),[a,y]);(0,c.useEffect)((()=>{a(l.$L.slice.actions.setWidgetState({uniqid:i,empty:!r||0===r.length}))}),[r]);const w=(0,c.useMemo)((()=>(0,n.getTinyMCEMentionsQueries)(v,o,h)),[v,h,o]);return p?s().createElement(s().Fragment,null):s().createElement(oe,null,s().createElement(le,{autoFocus:g,text:null!=r?r:"",token:"edit"===t&&void 0!==f?f:"",tinyMCECommonOptions:"edit"===t&&E?{tinymceScriptSrc:"https://ecosysteme.jamespot.pro/js/tinymce/tinymce.min.js",commonOptions:E,mentionsQueries:w}:void 0,mode:t,onChange:e=>{a((0,l.O5)(i,{text:e}))}}))},ae=n.default.registry.getLazyComponent("WidgetArticleTitle"),ce=g().div`
|
|
137
137
|
flex: 1;
|
|
138
138
|
display: flex;
|
|
139
139
|
flex-direction: row;
|
|
@@ -183,20 +183,20 @@
|
|
|
183
183
|
div:last-child {
|
|
184
184
|
align-self: flex-end;
|
|
185
185
|
}
|
|
186
|
-
`),ye=({widget:e,commentId:t,inplace:i,mode:n,editRight:r,deleteRight:m,onRemove:g,onWidgetUpdate:p})=>{const f=(0,d.useIntl)(),{uniqid:E,content:v}=e,y=(0,u.useDispatch)(),h=(0,c.useRef)(!0),[w,x]=(0,c.useState)(),[b,C]=(0,c.useState)(!1),[k,L]=(0,c.useState)(!1),[q,S]=(0,c.useState)(null),[W,$]=(0,c.useState)({label:f.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Uri_Same_Page"}),value:"_self"}),[I,
|
|
186
|
+
`),ye=({widget:e,commentId:t,inplace:i,mode:n,editRight:r,deleteRight:m,onRemove:g,onWidgetUpdate:p})=>{const f=(0,d.useIntl)(),{uniqid:E,content:v}=e,y=(0,u.useDispatch)(),h=(0,c.useRef)(!0),[w,x]=(0,c.useState)(),[b,C]=(0,c.useState)(!1),[k,L]=(0,c.useState)(!1),[q,S]=(0,c.useState)(null),[W,$]=(0,c.useState)({label:f.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Uri_Same_Page"}),value:"_self"}),[I,A]=(0,c.useState)(""),O=(0,u.useSelector)(l.EK.selectors.get),M=(0,u.useSelector)((e=>l.$L.selectors.selectWidgetContent(e,E))),F=()=>{const e={arr:[...(null==M?void 0:M.arr)||[],{title:f.formatMessage({id:"COMMENT_WIDGET_CHECKLIST_Add_New_Task"}),value:!1}]};y((0,l.O5)(E,e))},_=(0,c.useCallback)((()=>ge(void 0,void 0,void 0,(function*(){return yield(e=>ge(void 0,void 0,void 0,(function*(){var t;const i=null===(t=e.content.arr)||void 0===t?void 0:t.map((e=>ge(void 0,void 0,void 0,(function*(){let t;var i;let n;if(e.id&&(t=yield(i=e.id,ge(void 0,void 0,void 0,(function*(){return a().file.get(i).then((e=>e.result))})))),e.user){const{result:t}=yield a().user.get(`${e.user.type}/${e.user.id}`);n=t}return Object.assign(Object.assign(Object.assign({id:e.id||void 0,text:e.title||"",value:e.value||!1},t&&{uri:t._url?t._url:"",mimeType:t.mimetype}),e.links&&{links:e.links}),n&&{user:n})}))));return yield Promise.all(i||[])})))(e)})).then((e=>{const t=e.map((e=>{var t,i,n,l;return{text:null!==(t=e.text)&&void 0!==t?t:"",checked:null!==(i=e.value)&&void 0!==i&&i,links:null!==(n=e.links)&&void 0!==n?n:[],user:null!==(l=e.user)&&void 0!==l?l:void 0}}));return x(t),t})).catch((e=>{if(!h.current)return null;throw e}))),[e]);return(0,c.useEffect)((()=>(_(),()=>{h.current=!1})),[v]),"edit"===n?i?s().createElement(fe,{widget:e,handleTitleChange:e=>{y(l.$L.slice.actions.updateWidgetWrapper({uniqid:E,title:e}))},handleItemChange:(e,t)=>{var i;const n={arr:null===(i=null==M?void 0:M.arr)||void 0===i?void 0:i.map(((i,n)=>n!==e?i:Object.assign({},t)))};y((0,l.O5)(E,n))},handleNewItem:F,handleRemoveItem:e=>{var t;const i={arr:[...null!==(t=null==M?void 0:M.arr)&&void 0!==t?t:[]].splice(e,1)};y((0,l.O5)(E,i))},handleAddUri:e=>{S(e),C(!0)},handleRemoveUri:(e,t)=>{var i;const n={arr:[...(null===(i=null==M?void 0:M.arr)||void 0===i?void 0:i.map(((i,n)=>{var l;if(n!==t)return i;const o=null===(l=i.links)||void 0===l?void 0:l.filter(((t,i)=>i!==e));return Object.assign(Object.assign({},i),{links:o})})))||[]]};y((0,l.O5)(E,n))},handleSwapItems:e=>{y((0,l.O5)(E,e))},openUriModal:b,handleCloseModal:()=>{C(!1),S(null)},currentModalID:q,selectValue:W,setSelectValue:$,newUri:I,setNewUri:A}):null:s().createElement(s().Fragment,null,w&&s().createElement("div",{key:e.uniqid,style:{width:"100%"}},s().createElement(pe,{title:e.title,limit:10,initialEntries:w,onFileClick:()=>{},onNewItem:()=>F(),onItemCheckListChange:(i,n)=>((e,i,n)=>{if(!t)return;const o={arr:null==n?void 0:n.map((e=>{var t,i;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}),O&&e.checked&&{user:{id:null!==(i=null===(t=e.user)||void 0===t?void 0:t.id)&&void 0!==i?i:O.id,mainType:"user",type:"user"}}),e.checked&&{value:e.checked})}))};y((0,l.O5)(e,o)),a().widget.checkListRespond({id:t,type:"comment",idUser:null==O?void 0:O.id,uniqid:e,index:i}).then((()=>{p&&p()})).catch((e=>{var t;t=e.message,y(l.FN.actions.error({label:null!=t?t:f.formatMessage({id:"GLOBAL_Error"})}))}))})(e.uniqid,i,n)}),r&&s().createElement(ve,null,r&&s().createElement("div",null,s().createElement(Ee,{size:"s"})),m&&s().createElement("div",null,s().createElement(o.JRCIconButton,{iconSize:14,onClick:()=>L(!0),icon:"icon-trash"}))),s().createElement(o.JRCModal,{buttons:[{color:"cancel",clickHandler:()=>L(!1),children:s().createElement(d.FormattedMessage,{id:"GLOBAL_Cancel"})},{color:"danger",clickHandler:()=>{y(l.$L.slice.actions.flushWidget({uniqid:E})),g&&g(E),L(!1)},children:s().createElement(d.FormattedMessage,{id:"GLOBAL_Delete"})}],open:k,closeHandler:()=>L(!1),title:f.formatMessage({id:"GLOBAL_Delete"})},f.formatMessage({id:"COMMENT_WIDGET_Delete_Widget"}))))},he=({widget:e,commentId:t,width:i,inplace:n=!1,mode:l="view",editRight:o,deleteRight:r,onWidgetUpdate:a,onRemove:c})=>{const{name:d}=e;switch(d){default:return s().createElement(s().Fragment,null,"cannot display widget (",d,")");case"widget-check-list":return s().createElement(ye,{widget:e,commentId:t,inplace:n,mode:l,editRight:null!=o&&o,deleteRight:null!=r&&r,onRemove:c,onWidgetUpdate:a});case"widget-article-button":return s().createElement(R,{widget:e,inplace:n,mode:l});case"widget-article-gallery":return s().createElement(G,{widget:e,inplace:n,mode:l});case"widget-article-attachment":return s().createElement(T,{widget:e,inplace:n,mode:l});case"widget-article-image":return s().createElement(X,{widget:e,inplace:n,mode:l,width:null!=i?i:800});case"widget-api":return s().createElement(I,{widget:e,inplace:n,mode:l});case"widget-article-slider":return s().createElement(ne,{widget:e,inplace:n,mode:l,width:null!=i?i:800});case"widget-article-title":return s().createElement(ue,{widget:e,inplace:n,mode:l});case"widget-article-text":return s().createElement(re,{widget:e,inplace:n,mode:l})}},we=g().div`
|
|
187
187
|
position: absolute;
|
|
188
188
|
inset: 0;
|
|
189
189
|
opacity: ${e=>e.opacity};
|
|
190
190
|
background-color: ${e=>e.backgroundColor};
|
|
191
191
|
pointer-events: ${e=>e.pointerEvents};
|
|
192
|
-
`,xe=({uniqid:e,mode:t})=>{const i=(0,u.useSelector)((t=>t.widgets.ids[e].widget.layers),u.shallowEqual);return s().createElement(s().Fragment,null,null==i?void 0:i.map(((e,t)=>s().createElement(be,{uniqid:e,key:t,mode:"edit"}))))},be=({uniqid:e,mode:t})=>{const i=(0,u.useSelector)((t=>t.widgets.layers[e]));return"view"===t?s().createElement(we,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},i.widgets.map(((e,t)=>s().createElement(Ce,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):s().createElement(we,{opacity:i.visible?1:0,backgroundColor:i.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:i.locked?"none":"all"},i.widgets.map(((e,t)=>s().createElement(Ce,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},Ce=({uniqid:e,layerId:t,mode:i})=>{const n=(0,u.useDispatch)(),r=(0,u.useSelector)((t=>t.widgets.ids[e]),u.shallowEqual),a=(0,u.useSelector)((e=>e.widgets.layers[t]));return r&&a&&a.position?"view"===i?s().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},s().createElement($e,{uniqid:e,widget:r,mode:i,inplace:!0})):s().createElement(ke,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{n(l.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},s().createElement(o.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{n(l.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(r.widget.uniqid,r.widget.name)},s().createElement($e,{uniqid:e,widget:r,mode:i,inplace:!0}))):s().createElement(s().Fragment,null)},ke=({position:e,children:t,onMouseUp:i})=>{const[n,l]=s().useState(!1),[o,r]=s().useState({x:0,y:0}),[a,
|
|
192
|
+
`,xe=({uniqid:e,mode:t})=>{const i=(0,u.useSelector)((t=>t.widgets.ids[e].widget.layers),u.shallowEqual);return s().createElement(s().Fragment,null,null==i?void 0:i.map(((e,t)=>s().createElement(be,{uniqid:e,key:t,mode:"edit"}))))},be=({uniqid:e,mode:t})=>{const i=(0,u.useSelector)((t=>t.widgets.layers[e]));return"view"===t?s().createElement(we,{opacity:1,backgroundColor:"transparent",pointerEvents:"none"},i.widgets.map(((e,t)=>s().createElement(Ce,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"view"})))):s().createElement(we,{opacity:i.visible?1:0,backgroundColor:i.visible?"rgba(255,255,255,.1)":"transparent",pointerEvents:i.locked?"none":"all"},i.widgets.map(((e,t)=>s().createElement(Ce,{key:t,layerId:i.uniqid,uniqid:e.widget.uniqid,mode:"edit"}))))},Ce=({uniqid:e,layerId:t,mode:i})=>{const n=(0,u.useDispatch)(),r=(0,u.useSelector)((t=>t.widgets.ids[e]),u.shallowEqual),a=(0,u.useSelector)((e=>e.widgets.layers[t]));return r&&a&&a.position?"view"===i?s().createElement("div",{style:{position:"absolute",top:a.position.y,left:a.position.x}},s().createElement($e,{uniqid:e,widget:r,mode:i,inplace:!0})):s().createElement(ke,{position:{x:a.position.x,y:a.position.y},onMouseUp:e=>{(a.position&&a.position.x!==e.x||a.position&&a.position.y!==e.y)&&(e=>{n(l.$L.slice.actions.updateLayer({uniqid:t,props:{position:e}}))})(e)}},s().createElement(o.BETA_JRCDoubleClick,{onDoubleTap:()=>((e,t)=>{n(l.Wq.slice.actions.registerEditor({uniqid:e,name:t}))})(r.widget.uniqid,r.widget.name)},s().createElement($e,{uniqid:e,widget:r,mode:i,inplace:!0}))):s().createElement(s().Fragment,null)},ke=({position:e,children:t,onMouseUp:i})=>{const[n,l]=s().useState(!1),[o,r]=s().useState({x:0,y:0}),[a,d]=s().useState({x:0,y:0}),[u,m]=s().useState({x:e.x,y:e.y}),g=s().useRef(null),p=(0,c.useCallback)((e=>{l(!0),g.current&&(r({x:e.nativeEvent.clientX,y:e.nativeEvent.clientY}),d({x:u.x,y:u.y}))}),[u.x,u.y]),f=s().useCallback((e=>{if(n&&g.current){const t=a.x+(e.clientX-o.x),i=a.y+(e.clientY-o.y);m({x:t,y:i})}}),[o.x,o.y,n,a.x,a.y]),E=(0,c.useCallback)((()=>{l(!1),i({x:u.x,y:u.y})}),[u.x,u.y,i]);return s().useEffect((()=>(document.addEventListener("mousemove",f),document.addEventListener("mouseup",E),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",E)})),[f,E]),s().createElement("div",{style:{position:"absolute",top:u.y,left:u.x},ref:g,onMouseDown:p},t)},Le=n.default.registry.getLazyComponent("Loader"),qe=({name:e,uniqid:t,inplace:i})=>{const n=(0,u.useSelector)((e=>l.$L.selectors.selectWidgetState(e,t))),o=l.$L.definition(e);return(null==n?void 0:n.loading)?s().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},s().createElement(Le,null)):(null==n?void 0:n.hover)?s().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,.7)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}}):!(null==n?void 0:n.initialized)&&i||(null==n?void 0:n.initialized)||i?s().createElement(s().Fragment,null):s().createElement("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(255,255,255,1)",display:"flex",flex:1,justifyContent:"center",alignItems:"center"}},s().createElement("img",{src:o.img}))};var Se=i(769);const We=({uniqid:e,commentId:t,widget:i,inplace:n=!0,mode:o,width:r,editRight:a,deleteRight:d,onWidgetUpdate:m,onRemove:g})=>{const p=(0,u.useDispatch)(),f=(0,u.useSelector)((t=>l.$L.selectors.selectWidget(t,e))),E=(0,u.useSelector)((t=>t.widgets.editableMap[e]),u.shallowEqual),v=(0,u.useSelector)((e=>e.widgets.currentEditableWidgetId),u.shallowEqual),y=(0,u.useSelector)((t=>t.widgets.currentEditableWidgetId===e),u.shallowEqual),{ref:h,isComponentVisible:w,setIsComponentVisible:x}=(0,Se.I)(!1);if((0,c.useEffect)((()=>{i&&p(l.$L.slice.actions.registerWidget({uniqid:e,widget:i}))}),[]),(0,c.useEffect)((()=>{w||e===v&&p(l.$L.slice.actions.setEditableWidgetId({uniqid:void 0}))}),[w]),(0,c.useEffect)((()=>{w!==y&&x(y)}),[y]),void 0===f)return s().createElement(s().Fragment,null,"This widget cannot be displayed");const b=()=>{"edit"===o?C():"widget-article-button"===f.widget.name&&"link"===f.widget.content.openingType&&f.widget.content.openingTypeLink&&window.open(f.widget.content.openingTypeLink.url,f.widget.content.openingTypeLink.target)},C=()=>{if("view"===o)return;const{widget:e}=f;p(l.Wq.slice.actions.registerEditor({uniqid:e.uniqid,name:e.name}))};return n&&"view"!==o?s().createElement("div",{ref:h,onClick:()=>{x(!0),E&&(p(l.$L.slice.actions.setEditableIndex({index:E.index})),p(l.$L.slice.actions.setEditableWidgetId({uniqid:e})))}},s().createElement(he,{width:r,widget:f.widget,inplace:n,mode:o,onClick:b}),s().createElement(xe,{uniqid:e,mode:o}),s().createElement(qe,{name:f.widget.name,uniqid:f.widget.uniqid,inplace:n})):s().createElement("div",{onClick:C},s().createElement(he,{widget:Object.assign(Object.assign({},f.widget),f.title&&{title:f.title}),commentId:t,inplace:n,mode:o,width:r,onClick:b,editRight:a,deleteRight:d,onWidgetUpdate:m,onRemove:g}),s().createElement(xe,{uniqid:e,mode:o}),s().createElement(qe,{name:f.widget.name,uniqid:f.widget.uniqid,inplace:n}))},$e=We;var Ie=function(e,t,i,n){return new(i||(i=Promise))((function(l,o){function r(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?l(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}c((n=n.apply(e,t||[])).next())}))};const Ae=g().div`
|
|
193
193
|
display: flex;
|
|
194
194
|
flex-direction: column;
|
|
195
195
|
gap: 4px;
|
|
196
196
|
flex: 1;
|
|
197
197
|
width: 100%;
|
|
198
198
|
margin-top: 10px;
|
|
199
|
-
`,
|
|
199
|
+
`,Oe=({articleId:e,variant:t="inline"})=>{var i;const r=(0,d.useIntl)(),g=(0,m.useTheme)(),p=(0,u.useDispatch)(),[f,E]=(0,c.useState)(),[v,y]=(0,c.useState)(!1),[h,w]=(0,c.useState)([]),[x,b]=(0,c.useState)(!1),C=(0,u.useSelector)(l.EK.selectors.get),k=(0,u.useSelector)(l.$L.selectors.selectWidgets),L=(0,u.useSelector)(l.zh.selectors.selectTinyMCECommonOptions),S=(0,u.useSelector)(l.Hn.selectors.selectAll),W=(0,u.useSelector)(l.t4.selectors.selectPlatformConfig),$=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"OnlyOfficeHook"))),I=(0,u.useSelector)((t=>l.sv.selectors.commentList(t,e))),A=(0,u.useSelector)((e=>l.ew.selectors.selectHook(e,"DriveHook"))),O=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"FileBankHook"))),M=(0,u.useSelector)((e=>l.ew.selectors.selectHook(e,"WidgetHook")));(e=>{const t=(0,u.useDispatch)(),i=(0,c.useMemo)((()=>n.default.socket),[n.default.socket]),o=(0,c.useMemo)((()=>l.sv.getCommentRTHandlers(t,e)),[t,e]);(0,c.useEffect)((()=>(o.forEach((e=>{i.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{i.offMessage(e.namespace,e.function,e.handler)}))})),[o,i])})(e),((e,t)=>{const i=(0,u.useDispatch)(),o=(0,c.useMemo)((()=>n.default.socket),[n.default.socket]),r=(0,c.useMemo)((()=>l.sv.getCommentsLikeRTHandlers(i,e,t)),[i,e,t]);(0,c.useEffect)((()=>(r.forEach((e=>{o.onMessage(e.namespace,e.function,e.handler)})),()=>{r.forEach((e=>{o.offMessage(e.namespace,e.function,e.handler)}))})),[r,o])})(null==I?void 0:I.list.map((e=>e.id)),e);const F=(0,c.useCallback)((e=>{p(l.FN.actions.error({label:null!=e?e:r.formatMessage({id:"GLOBAL_Error"})}))}),[p,r]),_=()=>{p(l.sv.actions.fetchComments({idArticle:e})),T()},T=(0,c.useCallback)((()=>{f||x||(b(!0),a().network.token().then((e=>{E(e.result),b(!1)})).catch((e=>{F(e.errorMsg)})))}),[F,f,x]),j=(0,c.useCallback)((t=>Ie(void 0,void 0,void 0,(function*(){if(f){y(!0);const i=Object.keys(k).map((e=>(null==h?void 0:h.some((t=>t.widget.uniqid===e)))?k[e]:null)).filter((e=>null!==e));try{yield a().article.addComment(Object.assign(Object.assign({},t),{widgets:i,token:f,idArticle:e})).then((()=>{h.forEach((e=>{p(l.$L.slice.actions.flushWidget({uniqid:e.widget.uniqid}))})),w([])})),T()}catch(e){F(e.errorMsg)}finally{y(!1)}}}))),[e,p,T,F,f,k,h]);return(0,c.useEffect)((()=>{T()}),[T]),(0,c.useEffect)((()=>(p(l.sv.actions.fetchComments({idArticle:e})),()=>{p(l.sv.actions.discardComments({idArticle:e}))})),[]),s().createElement(s().Fragment,null,L&&s().createElement(s().Fragment,null,s().createElement(Ae,null,s().createElement(o.JRCCommentsBloc,{loading:v,token:f,comments:null==I?void 0:I.list,onComment:j,onCommentUpdate:t=>Ie(void 0,void 0,void 0,(function*(){var i,n;const o=null==I?void 0:I.list.find((e=>e.id===t.idComment));if(o)return a().article.updateComment({idComment:t.idComment,description:null!==(n=null!==(i=t.description)&&void 0!==i?i:o.description)&&void 0!==n?n:void 0,token:t.token,widgets:t.widgets}).then((()=>{p(l.sv.actions.fetchComments({idArticle:e})),T()})).catch((e=>{F(e.errorMsg)}))})),onCommentDelete:e=>Ie(void 0,void 0,void 0,(function*(){a().article.deleteComment(e).catch(F)})),isWidgetActive:!!((null==M?void 0:M.isActive)&&(null==M?void 0:M.create)&&(null===(i=null==M?void 0:M.autorize)||void 0===i?void 0:i.includes("comment"))),widgetListComponent:s().createElement(q,{mode:"comment",namespace:"comment",onChange:e=>{w([...h,e]),p(l.$L.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e}))},view:"edit"}),newWidgetsWrapperComponent:s().createElement(s().Fragment,null,h.map((e=>e&&s().createElement("div",{key:e.widget.uniqid},s().createElement($e,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit"}))))),existingWidgetsWrapperComponent:(t,i,n=!0,o,r=!1,c=!1)=>s().createElement(s().Fragment,null,null==t?void 0:t.map((t=>t&&s().createElement("div",{key:t.widget.uniqid},s().createElement($e,{uniqid:t.widget.uniqid,commentId:o,widget:t,inplace:n,mode:i,editRight:r,deleteRight:c,onWidgetUpdate:_,onRemove:t=>{a().widget.removeWidget({id:o,type:"comment",uniqid:t}).then((()=>{p(l.sv.actions.fetchComments({idArticle:e})),T()})).catch((e=>{F(e.errorMsg)}))}}))))),currentUser:C,tinyMCEConfig:{commonOptions:L,mentionsQueries:(0,n.getTinyMCEMentionsQueries)(S,g,F)},onError:F,highlightFields:W.userHighlightFields,userAccountStatus:W.userAccountStatus,userModel:S.find((e=>"user"===e.type)),isWedocActive:!!$,onGetHashError:e=>p(l.FN.actions.error({label:null!=e?e:r.formatMessage({id:"GLOBAL_Error"})})),activeDrives:J.debug.UploadFromDrives?[...O&&A?["fileBank"]:[],...l.ew.utils.buildDrivesArrayFromObject(null==A?void 0:A.drives)]:[],socialActionAdd:({targetId:e,targetType:t,type:i})=>a().socialAction.add({targetType:t,targetId:e,type:i}),deleteFile:e=>Ie(void 0,void 0,void 0,(function*(){f&&(yield a().file.deleteFile(e,"attachment",f))})),fetchUser:e=>a().user.get(e),fetchUserFields:(e,t)=>a().user.getFields(e,t),fetchSocialActionUserList:({targetId:e,targetType:t,type:i})=>a().socialAction.getUsers({targetType:t,targetId:e,type:i}),removeLike:({targetId:e,targetType:t,type:i})=>a().socialAction.remove({targetType:t,targetId:e,type:i}),variant:t}))))},Me=()=>c.createElement(c.Fragment,null);var Fe=i(248);const _e=n.default.registry.getLazyComponent("Container"),Te=n.default.registry.getLazyComponent("AppColumn"),je=n.default.registry.getLazyComponent("MainColumn");function De({extensionRoute:e,routes:t,description:i,mode:n="center"}){var l;const o=(0,d.useIntl)(),{pathname:r}=(0,Fe.useLocation)(),a=(0,c.useMemo)((()=>Object.values(t)),[t]),[s,u]=c.useState(null===(l=null==a?void 0:a[0])||void 0===l?void 0:l.key),m=a.map((t=>Object.assign(Object.assign({},t),{label:o.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?o.formatMessage({id:t.group}):void 0})));return c.useEffect((()=>{const t=a.find((t=>r===`/ng/rr/${e}/${t.path}`));t&&u(t.key)}),[r,a,e]),c.createElement(c.Suspense,{fallback:c.createElement(c.Fragment,null)},c.createElement(_e,{mode:n},c.createElement(Te,{mode:n,description:i,tabs:m,activeTab:s||""}),c.createElement(je,{mode:n},c.createElement(Fe.Outlet,null))))}g().div`
|
|
200
200
|
margin-bottom: 24px;
|
|
201
201
|
`,g().div`
|
|
202
202
|
margin-bottom: 4px;
|
|
@@ -313,18 +313,18 @@
|
|
|
313
313
|
`,bt=g().div`
|
|
314
314
|
width: ${440}px;
|
|
315
315
|
pointer-events: none;
|
|
316
|
-
`,Ct=()=>{const e=(0,u.useSelector)(l.Wq.selectors.selectEditors);return s().createElement(ht,null,e.map(((e,t)=>"left"===e.position?s().createElement(Re,{isActive:!1,key:t},s().createElement(xt,null,s().createElement(Et,{uniqid:e.uniqid}),s().createElement(wt,{isActive:void 0!==e.popup},s().createElement(Ke,{uniqid:e.uniqid})),s().createElement(bt,null))):s().createElement(Re,{isActive:!1,key:t},s().createElement(xt,null,s().createElement(bt,null),s().createElement(wt,{isActive:void 0!==e.popup},s().createElement(Ke,{uniqid:e.uniqid})),s().createElement(Et,{uniqid:e.uniqid}))))))},kt=()=>{const[e,t]=(0,c.useState)(),i=(0,d.useIntl)(),n=(0,c.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}}))}),[]),l=(e,t)=>new Promise(((i,l)=>{n({reject:l,resolve:i,text:e,capability:t})})),r=(0,c.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")})),[]);return[e,(0,c.useMemo)((()=>o.JTinyMCEExtensionsBuilders.jia(r,i)),[])]},Lt=g().div`
|
|
316
|
+
`,Ct=()=>{const e=(0,u.useSelector)(l.Wq.selectors.selectEditors);return s().createElement(ht,null,e.map(((e,t)=>"left"===e.position?s().createElement(Re,{isActive:!1,key:t},s().createElement(xt,null,s().createElement(Et,{uniqid:e.uniqid}),s().createElement(wt,{isActive:void 0!==e.popup},s().createElement(Ke,{uniqid:e.uniqid})),s().createElement(bt,null))):s().createElement(Re,{isActive:!1,key:t},s().createElement(xt,null,s().createElement(bt,null),s().createElement(wt,{isActive:void 0!==e.popup},s().createElement(Ke,{uniqid:e.uniqid})),s().createElement(Et,{uniqid:e.uniqid}))))))},kt=()=>{const[e,t]=(0,c.useState)(),i=(0,d.useIntl)(),n=(0,c.useCallback)((e=>{t(Object.assign(Object.assign({},e),{reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}}))}),[]),l=(0,c.useCallback)(((e,t)=>new Promise(((i,l)=>{n({reject:l,resolve:i,text:e,capability:t})}))),[n]),r=(0,c.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[e,(0,c.useMemo)((()=>o.JTinyMCEExtensionsBuilders.jia(r,i)),[i,r])]},Lt=g().div`
|
|
317
317
|
padding: ${e=>e.theme.space.md}px;
|
|
318
|
-
`,qt={response:void 0,loading:!0,error:void 0},St=({query:e})=>{const t=(0,d.useIntl)(),[i,n]=(0,c.useState)(qt),l=(0,c.useCallback)((e=>{n(qt),a().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void n({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const i=e.result.text;n({error:void 0,loading:!1,response:i})})).catch((e=>{n({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[]);return(0,c.useEffect)((()=>{e&&e.text.trim().length>0&&l(e)}),[e]),s().createElement(o.JRCModalLayout,{zIndex:50010,open:!!e,closeHandler:()=>{null==e||e.reject()}},s().createElement(o.JRCModalContent,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&l(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>i.response&&(null==e?void 0:e.resolve(i.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}],isFull:!0},s().createElement(Lt,null,i.loading&&s().createElement(s().Fragment,null,s().createElement(o.JRCLoader,null),s().createElement(o.JRCTypography,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!i.loading&&i.error&&s().createElement("p",null,i.error),!i.loading&&i.response&&s().createElement("p",null,i.response))))},Wt=e=>{const t=(0,d.useIntl)(),i=(0,u.useDispatch)(),r=(0,m.useTheme)(),a=(0,u.useSelector)(l.Hn.selectors.selectAll),[g,p]=kt(),f=(0,c.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}),[]),E=(0,c.useMemo)((()=>f?[p]:[]),[p,f]),v=(0,c.useCallback)((e=>{i(l.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[]),y=(0,c.useMemo)((()=>(0,n.getTinyMCEMentionsQueries)(a,r,v)),[]),h=(0,c.useMemo)((()=>n.default.tinymceCommonOptions),[
|
|
318
|
+
`,qt={response:void 0,loading:!0,error:void 0},St=({query:e})=>{const t=(0,d.useIntl)(),[i,n]=(0,c.useState)(qt),l=(0,c.useCallback)((e=>{n(qt),a().jia.textEnhancement({text:e.text,capacity:e.capability}).then((e=>{if(e.error)return void n({error:`${t.formatMessage({id:"JIA_ERROR_AI_CALL"})}${e.errorMsg&&": "+e.errorMsg}`,loading:!1,response:void 0});const i=e.result.text;n({error:void 0,loading:!1,response:i})})).catch((e=>{n({error:t.formatMessage({id:"JIA_ERROR_AI_CALL"}),loading:!1,response:void 0})}))}),[t]);return(0,c.useEffect)((()=>{e&&e.text.trim().length>0&&l(e)}),[e,l]),s().createElement(o.JRCModalLayout,{zIndex:50010,open:!!e,closeHandler:()=>{null==e||e.reject()}},s().createElement(o.JRCModalContent,{overflow:"scroll",buttons:[{children:t.formatMessage({id:"GLOBAL_Try_Again"}),clickHandler:()=>{e&&l(e)}},{children:t.formatMessage({id:"GLOBAL_Validation"}),clickHandler:()=>i.response&&(null==e?void 0:e.resolve(i.response))},{children:t.formatMessage({id:"GLOBAL_Cancel"}),clickHandler:()=>null==e?void 0:e.reject()}],isFull:!0},s().createElement(Lt,null,i.loading&&s().createElement(s().Fragment,null,s().createElement(o.JRCLoader,null),s().createElement(o.JRCTypography,{align:"center"},t.formatMessage({id:"JIA_WAITING_WARNIG"}))),!i.loading&&i.error&&s().createElement("p",null,i.error),!i.loading&&i.response&&s().createElement("p",null,i.response))))},Wt=e=>{const t=(0,d.useIntl)(),i=(0,u.useDispatch)(),r=(0,m.useTheme)(),a=(0,u.useSelector)(l.Hn.selectors.selectAll),[g,p]=kt(),f=(0,c.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}),[]),E=(0,c.useMemo)((()=>f?[p]:[]),[p,f]),v=(0,c.useCallback)((e=>{i(l.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[i,t]),y=(0,c.useMemo)((()=>(0,n.getTinyMCEMentionsQueries)(a,r,v)),[a,v,r]),h=(0,c.useMemo)((()=>n.default.tinymceCommonOptions),[]);return s().createElement(s().Fragment,null,h&&s().createElement(o.JRCInputTinyMCE,Object.assign({commonOptions:h,additionalExtensions:E,mentionsQueries:y},e)),s().createElement(St,{query:g}))},$t=e=>{const t=(0,d.useIntl)(),i=(0,u.useDispatch)(),r=(0,m.useTheme)(),a=(0,u.useSelector)(l.Hn.selectors.selectAll),[g,p]=kt(),f=(0,c.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}),[]),E=(0,c.useMemo)((()=>f?[p]:[]),[p,f]),v=(0,c.useCallback)((e=>{i(l.FN.actions.error({label:null!=e?e:t.formatMessage({id:"GLOBAL_Error"})}))}),[i,t]),y=(0,c.useMemo)((()=>(0,n.getTinyMCEMentionsQueries)(a,r,v)),[a,v,r]),h=(0,c.useMemo)((()=>n.default.tinymceCommonOptions),[]);return s().createElement(s().Fragment,null,h&&s().createElement(o.JRCInputTinyMCERaw,Object.assign({commonOptions:h,additionalExtensions:E,mentionsQueries:y},e)),s().createElement(St,{query:g}))};var It=i(603),At=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(n=Object.getOwnPropertySymbols(e);l<n.length;l++)t.indexOf(n[l])<0&&Object.prototype.propertyIsEnumerable.call(e,n[l])&&(i[n[l]]=e[n[l]])}return i};const Ot=m.css`
|
|
319
319
|
height: 100%;
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
justify-content: space-between;
|
|
323
323
|
`,Mt=g().div`
|
|
324
|
-
${({stretch:e})=>e&&
|
|
324
|
+
${({stretch:e})=>e&&Ot}
|
|
325
325
|
`,Ft=g().form`
|
|
326
|
-
${({stretch:e})=>e&&
|
|
326
|
+
${({stretch:e})=>e&&Ot}
|
|
327
327
|
`,_t=c.forwardRef(((e,t)=>e.onSubmit?c.createElement(Ft,{stretch:e.stretch,onSubmit:e.onSubmit,ref:t},e.children):c.createElement(Mt,{stretch:e.stretch,ref:t},e.children))),Tt=g().div`
|
|
328
328
|
${e=>e.stretch&&"\n flex: 1;\n"}
|
|
329
|
-
`,jt=c.forwardRef(((e,t)=>{const i=c.useRef(null),[n,l]=(0,It.GF)(e.fields,e.type),o=(0,mt.useForm)({defaultValues:Object.assign(Object.assign({},l),e.defaultValues),criteriaMode:"all"}),{handleSubmit:r,control:a,reset:s}=o,d=
|
|
330
|
-
//# sourceMappingURL=
|
|
329
|
+
`,jt=c.forwardRef(((e,t)=>{const i=c.useRef(null),[n,l]=(0,It.GF)(e.fields,e.type),o=(0,mt.useForm)({defaultValues:Object.assign(Object.assign({},l),e.defaultValues),criteriaMode:"all"}),{handleSubmit:r,control:a,reset:s}=o,d=At(o,["handleSubmit","control","reset"]);return c.useImperativeHandle(t,(()=>Object.assign(Object.assign({},d),{handleSubmit:r,control:a,reset:()=>{var e;null===(e=null==i?void 0:i.current)||void 0===e||e.scrollTo(0,0),s()}})),[]),c.createElement(_t,{stretch:e.stretch,onSubmit:e.onSubmit?r(e.onSubmit):void 0,ref:i},c.createElement(Tt,{stretch:e.stretch},n.map((t=>{var{Input:i}=t,n=At(t,["Input"]);return c.createElement(i,Object.assign({key:n.name,control:a},n,{dataCy:`${e.dataCy}-${n.name}`,readOnly:e.readOnly}))})),e.extraInputs&&e.extraInputs(a)),e.buttons)}))}}]);
|
|
330
|
+
//# sourceMappingURL=977.bundle.js.map
|