jamespot-react-core 1.1.148 → 1.1.149
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/524.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[524],{524:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>Gt,CommentsBloc:()=>Ne,DisplayForm:()=>Yt,EditorsPortal:()=>Rt,Empty:()=>Pe,JRCInputTinyMCEWithExt:()=>Bt,JRCInputTinyMCEWithExtRaw:()=>Ut,TwoColLayout:()=>Ye,WidgetList:()=>q,WidgetWrapperCore:()=>Me});var n=i(
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[524],{524:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>Gt,CommentsBloc:()=>Ne,DisplayForm:()=>Yt,EditorsPortal:()=>Rt,Empty:()=>Pe,JRCInputTinyMCEWithExt:()=>Bt,JRCInputTinyMCEWithExtRaw:()=>Ut,TwoColLayout:()=>Ye,WidgetList:()=>q,WidgetWrapperCore:()=>Me});var n=i(759),l=i(115),r=i(537),o=i(6),a=i.n(o),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;
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
flex: 1;
|
|
216
216
|
width: 100%;
|
|
217
217
|
margin-top: 10px;
|
|
218
|
-
`,Ne=({articleId:e,variant:t="inline"})=>{var i;const o=(0,d.useIntl)(),g=(0,m.useTheme)(),p=(0,u.useDispatch)(),[f,E]=(0,c.useState)(),[y,v]=(0,c.useState)(!1),[h,w]=(0,c.useState)([]),[x,C]=(0,c.useState)(!1),b=(0,u.useSelector)(l.EK.selectors.get),k=(0,u.useSelector)(l.$L.selectors.selectWidgets),L=(0,u.useSelector)(l.zh.selectors.selectTinyMCECommonOptions),W=(0,u.useSelector)(l.Hn.selectors.selectAll),S=(0,u.useSelector)(l.t4.selectors.selectPlatformConfig),$=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"OnlyOfficeHook"))),M=(0,u.useSelector)((t=>l.sv.selectors.commentList(t,e))),I=(0,u.useSelector)((e=>l.ew.selectors.selectHook(e,"DriveHook"))),A=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"FileBankHook"))),O=(0,u.useSelector)((e=>l.ew.selectors.selectHook(e,"WidgetHook")));(e=>{const t=(0,u.useDispatch)(),i=(0,c.useMemo)((()=>n.default.socket),[
|
|
218
|
+
`,Ne=({articleId:e,variant:t="inline"})=>{var i;const o=(0,d.useIntl)(),g=(0,m.useTheme)(),p=(0,u.useDispatch)(),[f,E]=(0,c.useState)(),[y,v]=(0,c.useState)(!1),[h,w]=(0,c.useState)([]),[x,C]=(0,c.useState)(!1),b=(0,u.useSelector)(l.EK.selectors.get),k=(0,u.useSelector)(l.$L.selectors.selectWidgets),L=(0,u.useSelector)(l.zh.selectors.selectTinyMCECommonOptions),W=(0,u.useSelector)(l.Hn.selectors.selectAll),S=(0,u.useSelector)(l.t4.selectors.selectPlatformConfig),$=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"OnlyOfficeHook"))),M=(0,u.useSelector)((t=>l.sv.selectors.commentList(t,e))),I=(0,u.useSelector)((e=>l.ew.selectors.selectHook(e,"DriveHook"))),A=(0,u.useSelector)((e=>l.Mx.selectors.selectById(e,"FileBankHook"))),O=(0,u.useSelector)((e=>l.ew.selectors.selectHook(e,"WidgetHook")));(e=>{const t=(0,u.useDispatch)(),i=(0,c.useMemo)((()=>n.default.socket),[]),r=(0,c.useMemo)((()=>l.sv.getCommentRTHandlers(t,e)),[t,e]);(0,c.useEffect)((()=>(r.forEach((e=>{i.onMessage(e.namespace,e.function,e.handler)})),()=>{r.forEach((e=>{i.offMessage(e.namespace,e.function,e.handler)}))})),[r,i])})(e),((e,t)=>{const i=(0,u.useDispatch)(),r=(0,c.useMemo)((()=>n.default.socket),[]),o=(0,c.useMemo)((()=>l.sv.getCommentsLikeRTHandlers(i,e,t)),[i,e,t]);(0,c.useEffect)((()=>(o.forEach((e=>{r.onMessage(e.namespace,e.function,e.handler)})),()=>{o.forEach((e=>{r.offMessage(e.namespace,e.function,e.handler)}))})),[o,r])})(null==M?void 0:M.list.map((e=>e.id)),e);const T=(0,c.useCallback)((e=>{p(l.FN.actions.error({label:null!=e?e:o.formatMessage({id:"GLOBAL_Error"})}))}),[p,o]),F=()=>{p(l.sv.actions.fetchComments({idArticle:e})),j()},j=(0,c.useCallback)((()=>{f||x||(C(!0),a().network.token().then((e=>{E(e.result),C(!1)})).catch((e=>{T(e.errorMsg)})))}),[T,f,x]),_=(0,c.useCallback)((t=>Ue(void 0,void 0,void 0,(function*(){if(f){v(!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([])})),j()}catch(e){T(e.errorMsg)}finally{v(!1)}}}))),[e,p,j,T,f,k,h]);return(0,c.useEffect)((()=>{j()}),[j]),(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(He,null,s().createElement(r.JRCCommentsBloc,{loading:y,token:f,comments:null==M?void 0:M.list,onComment:_,onCommentUpdate:t=>Ue(void 0,void 0,void 0,(function*(){var i,n;const r=null==M?void 0:M.list.find((e=>e.id===t.idComment));if(r)return a().article.updateComment({idComment:t.idComment,description:null!==(n=null!==(i=t.description)&&void 0!==i?i:r.description)&&void 0!==n?n:void 0,token:t.token,widgets:t.widgets}).then((()=>{p(l.sv.actions.fetchComments({idArticle:e})),j()})).catch((e=>{T(e.errorMsg)}))})),onCommentDelete:e=>Ue(void 0,void 0,void 0,(function*(){a().article.deleteComment(e).catch(T)})),isWidgetActive:!!((null==O?void 0:O.isActive)&&(null==O?void 0:O.create)&&(null===(i=null==O?void 0:O.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&&e.widget&&s().createElement("div",{key:e.widget.uniqid},s().createElement(Ie,{uniqid:e.widget.uniqid,widget:e,inplace:!0,mode:"edit",onRemove:e=>w(h.filter((t=>t.widget.uniqid!==e)))}))))),existingWidgetsWrapperComponent:(t,i,n,r=!0,o,c=!1,d=!1)=>s().createElement(s().Fragment,null,null==i?void 0:i.map((i=>i&&s().createElement("div",{key:i.widget.uniqid},s().createElement(Ie,{uniqid:i.widget.uniqid,widgetObject:t,commentId:o,widget:i,inplace:r,mode:n,editRight:c,deleteRight:d,onWidgetUpdate:F,onRemove:t=>{a().widget.removeWidget({id:o,type:"comment",uniqid:t}).then((()=>{p(l.sv.actions.fetchComments({idArticle:e})),j()})).catch((e=>{T(e.errorMsg)}))}}))))),currentUser:b,tinyMCEConfig:{commonOptions:L,mentionsQueries:(0,n.getTinyMCEMentionsQueries)(W,g,T)},onError:T,highlightFields:S.userHighlightFields,userAccountStatus:S.userAccountStatus,userModel:W.find((e=>"user"===e.type)),isWedocActive:!!$,onGetHashError:e=>p(l.FN.actions.error({label:null!=e?e:o.formatMessage({id:"GLOBAL_Error"})})),activeDrives:J.debug.UploadFromDrives?[...A&&I?["fileBank"]:[],...l.ew.utils.buildDrivesArrayFromObject(null==I?void 0:I.drives)]:[],socialActionAdd:({targetId:e,targetType:t,type:i})=>a().socialAction.add({targetType:t,targetId:e,type:i}),deleteFile:e=>Ue(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}),s().createElement(Be,null))))},Pe=()=>c.createElement(c.Fragment,null);var Ve=i(248);const Qe=n.default.registry.getLazyComponent("Container"),Ke=n.default.registry.getLazyComponent("AppColumn"),Xe=n.default.registry.getLazyComponent("MainColumn");function Ye({extensionRoute:e,routes:t,description:i,mode:n="center"}){var l;const r=(0,d.useIntl)(),{pathname:o}=(0,Ve.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: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 c.useEffect((()=>{const t=a.find((t=>{var i;return`/ng/rr/${e}/${t.path}`===o||(null===(i=t.paths)||void 0===i?void 0:i.reduce(((t,i)=>{const n=`/ng/rr/${e}/${i}`,l=null!==(0,Ve.matchPath)(n,o);return t||l}),!1))}));t&&u(t.key)}),[o,a,e]),c.createElement(c.Suspense,{fallback:c.createElement(c.Fragment,null)},c.createElement(Qe,{mode:n},c.createElement(Ke,{mode:n,description:i,tabs:m,activeTab:s||""}),c.createElement(Xe,{mode:n},c.createElement(Ve.Outlet,null))))}g().div`
|
|
219
219
|
margin-bottom: 24px;
|
|
220
220
|
`,g().div`
|
|
221
221
|
margin-bottom: 4px;
|