jamespot-react-core 1.2.36 → 1.2.38
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/{899.2369fb7deb9e32081419.chunk.js → 899.cbd54a39addba66f4090.chunk.js} +2 -2
- package/build/{899.2369fb7deb9e32081419.chunk.js.map → 899.cbd54a39addba66f4090.chunk.js.map} +1 -1
- package/build/app.bundle.js +75 -75
- package/build/app.bundle.js.map +1 -1
- package/build/src/Router.d.ts +0 -1
- package/build/src/utils/router.d.ts +3 -2
- package/build/src/utils/types.d.ts +3 -0
- package/package.json +4 -4
- package/build/src/initReactCore.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[899],{899:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>A,AddReportModal:()=>Z,Audience:()=>E,Avatar:()=>x,CommentsBloc:()=>sl,DisplayForm:()=>R,Editor:()=>De,EditorsPortal:()=>ut,Empty:()=>al,FullPageLayout:()=>cl,JRCInputTinyMCEWithExt:()=>pl,JRCInputTinyMCEWithExtRaw:()=>hl,MarkdownModal:()=>qi,ModalAudience:()=>bl,TwoColLayout:()=>El,WidgetList:()=>Lt,WidgetWrapperCore:()=>Ko});var n=i(211),o=i(594),l=i(196),s=i.n(l),a=i(493),r=i(
|
|
1
|
+
"use strict";(self.webpackChunkReactCore=self.webpackChunkReactCore||[]).push([[899],{899:(e,t,i)=>{i.r(t),i.d(t,{AIModal:()=>A,AddReportModal:()=>Z,Audience:()=>E,Avatar:()=>x,CommentsBloc:()=>sl,DisplayForm:()=>R,Editor:()=>De,EditorsPortal:()=>ut,Empty:()=>al,FullPageLayout:()=>cl,JRCInputTinyMCEWithExt:()=>pl,JRCInputTinyMCEWithExtRaw:()=>hl,MarkdownModal:()=>qi,ModalAudience:()=>bl,TwoColLayout:()=>El,WidgetList:()=>Lt,WidgetWrapperCore:()=>Ko});var n=i(211),o=i(594),l=i(196),s=i.n(l),a=i(493),r=i(180),d=i(556),c=i(815),u=i(423);const g=u.j.getLazyComponent("Icon"),m=u.j.getLazyComponent("JRCAvatar"),p=s().span`
|
|
2
2
|
${r.SROnly}
|
|
3
3
|
`,x=e=>{const t=(0,l.useTheme)(),i=(0,a.useIntl)(),o=(0,c.GV)(d.Bx.selectors.selectNetworkPublic);return e.uri===o?.uri?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g,{name:"icon-fs-wall",size:8*(e.size??3),color:t.color.primary,variant:"circle"}),(0,n.jsx)(p,{children:i.formatMessage({id:"NETWORK_Public"})})]}):(0,n.jsx)(m,{...e})},h=u.j.getLazyComponent("FlexBox"),f=u.j.getLazyComponent("ModalContent"),j=u.j.getLazyComponent("ModalLayout"),y=u.j.getLazyComponent("StyledHref"),b=u.j.getLazyComponent("Tooltip"),C=u.j.getLazyComponent("Typography"),v=s().div`
|
|
4
4
|
display: flex;
|
|
@@ -645,4 +645,4 @@
|
|
|
645
645
|
width: 100%;
|
|
646
646
|
margin-top: 10px;
|
|
647
647
|
`,sl=({articleId:e,variant:t="inline",canComment:i,commentType:s="comment",socialQuestion:r,articleUri:u})=>{const g=(0,a.useIntl)(),m=(0,l.useTheme)(),p=(0,c.jL)(),[x,h]=(0,o.useState)(),[f,j]=(0,o.useState)(!1),[y,b]=(0,o.useState)([]),[C,v]=(0,o.useState)(!1),w=(0,c.GV)(d.xJ.selectors.get),E=(0,c.GV)(d.x0.selectors.selectWidgets),L=(0,c.GV)(d.sU.selectors.selectTinyMCECommonOptions),W=(0,c.GV)(d.sU.selectors.selectTinyMCEExtendedOptions),_=(0,c.GV)(d.Kx.selectors.selectAll),q=(0,c.GV)(d.OD.selectors.selectPlatformConfig),S=(0,c.GV)(t=>d.Mw.selectors.commentList(t,e)),M=(0,c.GV)(e=>d.qn.selectors.selectHook(e,"DriveHook")),T=(0,c.GV)(e=>d.lg.selectors.selectById(e,"FileBankHook")),A=(0,c.GV)(e=>d.qn.selectors.selectHook(e,"WidgetHook")),[I,z]=(0,o.useState)(r),[G,D]=(0,o.useState)(null),{open:V,onInsert:F,close:$,ext:R,isActive:O}=_t();(0,ee.A)(e),((e,t)=>{const i=(0,c.jL)(),n=(0,o.useMemo)(()=>te.A,[]),l=(0,o.useMemo)(()=>d.Mw.getCommentsLikeRTHandlers(i,e,t),[i,e,t]);(0,o.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])})(S.map(e=>e.id),e);const B=(0,o.useCallback)(e=>{p(d.y8.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})}))},[p,g]),H=()=>{p(d.Mw.actions.fetchComments({idArticle:e})),U()},U=(0,o.useCallback)(()=>{x||C||(v(!0),k().network.token().then(e=>{h(e.result),v(!1),p(d.x0.slice.actions.setToken({token:e.result}))}).catch(e=>{B(e.errorMsg)}))},[B,x,C,p]),P=(0,o.useCallback)(async t=>{if(x){j(!0);const i=Object.keys(E).map(e=>y?.some(t=>t.widget.uniqid===e)?E[e]:null).filter(e=>null!==e);try{await k().article.addComment({...t,widgets:i,token:x,idArticle:e,type:s}).then(()=>{b([])}),U()}catch(e){throw B(e.errorMsg),e}finally{j(!1)}}},[e,s,U,B,x,E,y]);return(0,o.useEffect)(()=>{U()},[U]),(0,o.useEffect)(()=>{p(d.Mw.actions.fetchComments({idArticle:e}))},[e,p]),(0,o.useEffect)(()=>{S&&S.forEach(e=>{e._widgets?.forEach(t=>{p(d.x0.slice.actions.registerWidgetObject({uniqid:t.widget.uniqid,object:e})),p(d.x0.slice.actions.registerWidgetObjectRights({uniqid:t.widget.uniqid,rights:e._right}))})})},[S,p]),(0,n.jsxs)(n.Fragment,{children:[L&&W&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(ll,{children:[(0,n.jsx)(ol,{canComment:i,loading:f,token:x,comments:S,onComment:P,onCommentUpdate:async t=>{const i=S.find(e=>e.id===t.idComment);if(i)return k().article.updateComment({idComment:t.idComment,description:t.description??i.description??void 0,token:t.token,widgets:t.widgets}).then(()=>{p(d.Mw.actions.fetchComments({idArticle:e})),U()}).catch(e=>{B(e.errorMsg)})},onCommentDelete:async t=>{p(d.Mw.actions.deleteComment({idComment:t,idArticle:e}))},isWidgetActive:!(!A?.isActive||!A?.autorize?.includes("comment")),canCreateWidget:!!(A?.isActive&&A?.create&&A?.autorize?.includes("comment")),widgetListComponent:(0,n.jsx)(Lt,{mode:"comment",namespace:"comment",onChange:e=>{b([e]),p(d.x0.slice.actions.registerWidget({uniqid:e.widget.uniqid,widget:e,context:"comment"})),h(void 0),U()},view:"edit"}),newWidgetsWrapperComponent:(0,n.jsx)(tl,{widgets:y}),existingWidgetsWrapperComponent:(e,t,i,o=!0)=>(0,n.jsx)(nl,{comment:e,widgets:t,mode:i,inplace:o,handleWidgetUpdate:H,handleWidgetRemove:U}),currentUser:w,tinyMCEConfig:{commonOptions:{...L,toolbar:W.commentsToolbar},mentionsQueries:(0,qt.X)(_,m,B)},onError:B,highlightFields:q.userHighlightFields,userAccountStatus:q.userAccountStatus,userModel:_.find(e=>"user"===e.type),onGetHashError:e=>p(d.y8.actions.error({label:e??g.formatMessage({id:"GLOBAL_Error"})})),activeDrives:[...T&&M?["fileBank"]:[],...d.qn.utils.buildDrivesArrayFromObject(M?.drives)],variant:t,handlers:{drive:k().drive,filebank:k().filebank,file:k().file,user:k().user,global:k().global,questionAnswer:k().questionAnswer},socialQuestion:I?{...I,onSelectResponse:e=>{z({...I,responseId:e,isResolved:!0})},onUnselectResponse:()=>{z({...I,responseId:void 0,isResolved:!1})}}:void 0,articleId:e,additionalExtensions:[R],onReport:t=>D({articleId:e,commentUri:t,articleUri:u})}),(0,n.jsx)(gt,{})]})}),O&&(0,n.jsx)(qi,{onInsert:F,open:V,close:$}),G&&(0,n.jsx)(Z,{onClose:()=>D(null),...G})]})},al=()=>(0,n.jsx)(n.Fragment,{});var rl=i(737);const dl=u.j.getLazyComponent("Container"),cl=()=>(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(n.Fragment,{}),children:(0,n.jsx)(dl,{backgroundColor:"white",mode:"fluid",flexDirection:"column",children:(0,n.jsx)(rl.Outlet,{})})});var ul=i(910);const gl=()=>{const[e,t]=(0,o.useState)(),i=(0,a.useIntl)(),n=(0,o.useMemo)(()=>J.hooks?.MagicWandHook?.isActive&&J.hooks?.MagicWandHook?.menuItems&&J.hooks.MagicWandHook.menuItems.length,[]),l=(0,o.useCallback)(e=>{t({...e,reject:i=>{e.reject(i),t(void 0)},resolve:i=>{e.resolve(i),t(void 0)}})},[]),s=(0,o.useCallback)((e,t)=>new Promise((i,n)=>{l({reject:n,resolve:i,text:e,capability:t})}),[l]),d=(0,o.useMemo)(()=>({develop:e=>s(e,"develop"),summarize:e=>s(e,"summarize"),tldr:e=>s(e,"tldr"),en:e=>s(e,"en"),es:e=>s(e,"es"),formal:e=>s(e,"formal"),funny:e=>s(e,"funny")}),[s]);return{query:e,ext:(0,o.useMemo)(()=>r.JTinyMCEExtensionsBuilders.jia(d,i),[i,d]),isActive:n}},ml=u.j.getLazyComponent("InputTinyMCE"),pl=e=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),s=(0,l.useTheme)(),r=(0,c.GV)(d.Kx.selectors.selectAll),{query:u,ext:g,isActive:m}=gl(),{open:p,onInsert:x,close:h,ext:f,isActive:j}=_t(),y=(0,o.useMemo)(()=>[...j?[f]:[],...m?[g]:[]],[g,f,m,j]),b=(0,o.useCallback)(e=>{i(d.y8.actions.error({label:e??t.formatMessage({id:"GLOBAL_Error"})}))},[i,t]),C=(0,o.useMemo)(()=>(0,qt.X)(r,s,b),[r,b,s]),v=(0,o.useMemo)(()=>ul.p9,[]);return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)(ml,{commonOptions:v,additionalExtensions:y,mentionsQueries:C,...e}),m&&(0,n.jsx)(A,{query:u}),j&&(0,n.jsx)(qi,{onInsert:x,open:p,close:h})]})},xl=u.j.getLazyComponent("InputTinyMCERaw"),hl=e=>{const t=(0,a.useIntl)(),i=(0,c.jL)(),s=(0,l.useTheme)(),r=(0,c.GV)(d.Kx.selectors.selectAll),{query:u,ext:g,isActive:m}=gl(),{open:p,onInsert:x,close:h,ext:f,isActive:j}=_t(),y=(0,o.useMemo)(()=>[...j?[f]:[],...m?[g]:[]],[g,f,m,j]),b=(0,o.useCallback)(e=>{i(d.y8.actions.error({label:e??t.formatMessage({id:"GLOBAL_Error"})}))},[i,t]),C=(0,o.useMemo)(()=>(0,qt.X)(r,s,b),[r,b,s]),v=(0,o.useMemo)(()=>ul.p9,[]);return(0,n.jsxs)(n.Fragment,{children:[v&&(0,n.jsx)(xl,{commonOptions:v,additionalExtensions:y,mentionsQueries:C,...e}),m&&(0,n.jsx)(A,{query:u}),j&&(0,n.jsx)(qi,{onInsert:x,open:p,close:h})]})},fl=u.j.getLazyComponent("InputAudience"),jl=u.j.getLazyComponent("Message"),yl=u.j.getLazyComponent("Modal"),bl=({open:e,closeHandler:t,title:i,control:o,warningMessage:l,onSubmit:s,name:r="publishTo"})=>{const d=(0,a.useIntl)();return(0,n.jsxs)(yl,{open:e,closeHandler:t,title:i??d.formatMessage({id:"GLOBAL_Audience"}),buttons:[{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Cancel"}),color:"cancel",clickHandler:()=>t()},{children:(0,n.jsx)(a.FormattedMessage,{id:"GLOBAL_Continue"}),color:"danger",clickHandler:()=>{t(),s()}}],children:[(0,n.jsx)(jl,{variant:"warning",message:l??d.formatMessage({id:"FORM_Audience_Empty"})}),(0,n.jsx)(fl,{asyncPromise:e=>k().audience.autocomplete(e),searchable:!0,control:o,multiple:!0,placeholder:d.formatMessage({id:"GLOBAL_Audience"}),name:r})]})},Cl=u.j.getLazyComponent("Container"),vl=u.j.getLazyComponent("AppColumn"),wl=u.j.getLazyComponent("MainColumn");function El({extensionRoute:e,routes:t,description:i,mode:l="center",mainColumnProps:s}){const r=(0,a.useIntl)(),{pathname:d}=(0,rl.useLocation)(),c=(0,o.useMemo)(()=>Object.values(t),[t]),[u,g]=(0,o.useState)(c?.[0]?.key),m=c.map(t=>({...t,label:r.formatMessage({id:t.label}),href:t.absolutePath?t.path:`/ng/rr/${e}/${t.path}`,group:t.group?r.formatMessage({id:t.group}):void 0}));return(0,o.useEffect)(()=>{const t=c.find(t=>`/ng/rr/${e}/${t.path}`===d||t.paths?.reduce((t,i)=>{const n=`/ng/rr/${e}/${i}`,o=null!==(0,rl.matchPath)(n,d);return t||o},!1));t&&g(t.key)},[d,c,e]),(0,n.jsx)(o.Suspense,{fallback:(0,n.jsx)(n.Fragment,{}),children:(0,n.jsxs)(Cl,{mode:l,children:[(0,n.jsx)(vl,{mode:l,description:i,tabs:m,activeTab:u||""}),(0,n.jsx)(wl,{mode:l,flex:!0,...s,children:(0,n.jsx)(rl.Outlet,{})})]})})}}}]);
|
|
648
|
-
//# sourceMappingURL=899.
|
|
648
|
+
//# sourceMappingURL=899.cbd54a39addba66f4090.chunk.js.map
|