jamespot-react-components 1.0.232 → 1.0.233
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.
|
@@ -3253,6 +3253,18 @@
|
|
|
3253
3253
|
&:last-child {
|
|
3254
3254
|
margin-bottom: 0;
|
|
3255
3255
|
}
|
|
3256
|
+
|
|
3257
|
+
animation: ${({pending:e})=>e?"pendingAnimation 1.5s infinite":"none"};
|
|
3258
|
+
|
|
3259
|
+
@keyframes pendingAnimation {
|
|
3260
|
+
0%, 100% {
|
|
3261
|
+
opacity: 0.3;
|
|
3262
|
+
}
|
|
3263
|
+
50% {
|
|
3264
|
+
opacity: 0.7;
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3256
3268
|
`,aU=Bx.div`
|
|
3257
3269
|
display: flex;
|
|
3258
3270
|
align-items: center;
|
|
@@ -3360,7 +3372,7 @@
|
|
|
3360
3372
|
margin-bottom: 24px;
|
|
3361
3373
|
`,CU=Bx.div`
|
|
3362
3374
|
margin-top: ${({theme:e})=>e.space.sm}px;
|
|
3363
|
-
`,kU=({isFocused:e,comment:t,token:n,tinyMCEConfig:r,onCommentUpdate:o,onCommentDelete:i,onError:a,highlightFields:l,userModel:s,userAccountStatus:c,isWedocActive:u,isWidgetActive:d,getAccessHash:p,onGetHashError:f,deleteFile:m,existingWidgetsWrapperComponent:h,activeDrives:g,handlers:v,socialQuestion:y,articleId:b})=>{var w;const x=Lx(),E=bl(),[C,k]=(0,_.useState)(),[S,A]=(0,_.useState)(!1),[O,R]=(0,_.useState)(!1),[T,I]=(0,_.useState)(!1),[j,D]=(0,_.useState)(!1),[P,L]=(0,_.useState)(!1),[M,B]=(0,_.useState)(t.description),[F,N]=(0,_.useState)(!1),[$,z]=(0,_.useState)(!1),[H,U]=(0,_.useState)(!0),[V,W]=(0,_.useState)(!1),[G,q]=(0,_.useState)(),[Y,J]=(0,_.useState)(),K=(0,_.useRef)(null),Z=(0,_.useRef)(null),X=t._actions?Object.values(t._actions):void 0,Q=OT(),ee=(0,_.useCallback)((e=>{const t=new Date(e),n=new Date,r=n.getTime()-t.getTime();return r<6e4?E.formatMessage({id:"COMMENT_Just_Now"}):r<36e5?E.formatMessage({id:"COMMENT_Minutes_Ago"},{minutes:Math.round(r/6e4)}):r<864e5&&t.getDate()===n.getDate()?`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`:r<26784e5&&t.getMonth()===n.getMonth()?`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}`:`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}),[E]),te=(0,_.useCallback)((()=>{n&&M&&(N(!0),o({idComment:t.id,description:M,token:n}).then((()=>{L(!1),N(!1)})))}),[n,t,M,o]),ne=(0,_.useCallback)((()=>{N(!0),i(t.id).then((()=>{D(!1),N(!1),y&&y.responseId===t.id&&y.onUnselectResponse()})).catch((e=>{a&&a(e.errorMsg)}))}),[t.id,i,a,y]),re=()=>{W(!1),q(void 0),J(void 0)};(0,_.useEffect)((()=>{k(ee(t.dateCreation));const e=setInterval((()=>{k(ee(t.dateCreation))}),6e4);return()=>clearInterval(e)}),[t,ee]),(0,_.useEffect)((()=>{U(null!==Z.current&&null!==K.current&&K.current.clientHeight>Z.current.clientHeight);const e=new ResizeObserver((()=>{U(null!==Z.current&&null!==K.current&&K.current.clientHeight>Z.current.clientHeight)}));return K.current&&e.observe(K.current),()=>{e.disconnect()}}),[t]);const oe=(0,_.useCallback)((e=>new Promise(((t,r)=>{n&&m(e).then((()=>{te(),t()})).catch((e=>{a&&a(e.errorMsg),r()}))}))),[m,a,n,te]),ie=(0,_.useMemo)((()=>{if(t._widgets)return h(t,t._widgets,"view",!0)}),[t,h]),ae=(0,_.useCallback)((()=>{y&&v.questionAnswer.selectResponse({idResponse:t.id,idQuestion:b},{signal:Q.signal}).then((()=>{y.onSelectResponse(t.id)})).catch((e=>{a&&!Q.signal.aborted&&a(e.errorMsg)}))}),[Q.signal,b,t.id,v.questionAnswer,a,y]),le=(0,_.useCallback)((()=>{y&&v.questionAnswer.unselectResponse({idQuestion:b},{signal:Q.signal}).then((()=>{y.onUnselectResponse()})).catch((e=>{a&&!Q.signal.aborted&&a(e.errorMsg)}))}),[Q.signal,b,v.questionAnswer,a,y]);return _.createElement(oU,null,_.createElement(iU,{focused:e,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1)},_.createElement($U,null,_.createElement(GR,{href:t._user._url},_.createElement(qj,{uri:t._user.uri,size:5,variant:"circle"}))),_.createElement(sU,null,P&&n?_.createElement(rU,{comment:t,loading:F,token:n,activeDrives:g,commentContent:M,setCommentContent:B,tinyMCEConfig:r,updateComment:te,handlers:v,closeEditMode:()=>L(!1),deleteFile:m,onError:a}):_.createElement(sU,null,_.createElement(uT,{x:"space-between"},_.createElement(aU,null,_.createElement(QH,{uri:t._user.uri,onError:a,handlers:{user:v.user}},_.createElement(lU,null,_.createElement(GR,{href:t._user._url},t._user.title),9===t._user.level&&1===c&&_.createElement(nE,{isMargin:!1,color:x.color.primary,size:14,name:"icon-fs-shield"}))),_.createElement(qR,{size:"s",color:"grey4","aria-hidden":!0},"•"),_.createElement(BR,{position:"right",description:E.formatDate(t.dateCreation,{year:"2-digit",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},_.createElement(qR,{color:"grey4"},C))),(t._right.update||t._right.delete||(null==y?void 0:y.canSelectResponse))&&_.createElement(_.Fragment,null,_.createElement(cU,{onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1)},_.createElement($H,{withBorder:!0,onToggle:e=>I(e),trigger:_.createElement(dU,null,_.createElement(nE,{name:"icon-cogwheel",size:12,color:S||T?O||T?x.color.grey4:x.color.grey3:x.color.white})),dropdown:e=>_.createElement(_.Fragment,null,t._right.update&&_.createElement(uU,{onClick:()=>{e(),L(!0)}},E.formatMessage({id:"GLOBAL_Edit"})),t._right.delete&&_.createElement(uU,{onClick:()=>{e(),D(!0)}},E.formatMessage({id:"GLOBAL_Delete"})),(null==y?void 0:y.responseId)===t.id&&(null==y?void 0:y.canSelectResponse)&&_.createElement(uU,{onClick:()=>{e(),le()}},E.formatMessage({id:"COMMENT_Unselect_Response"}))),align:"right"})),_.createElement(BB,{buttons:[{color:"cancel",clickHandler:()=>D(!1),children:_.createElement(ms,{id:"GLOBAL_Cancel"})},{color:"danger",clickHandler:ne,children:_.createElement(ms,{id:"GLOBAL_Delete"}),loading:F}],open:j,closeHandler:()=>D(!1),title:E.formatMessage({id:"GLOBAL_Delete"})},E.formatMessage({id:"COMMENT_Delete_Comment"})))),l&&s&&_.createElement(HH,{user:t._user,highlightFields:l,userModel:s}),y&&_.createElement(_.Fragment,null,y.responseId===t.id&&_.createElement(CU,null,_.createElement($M,{variant:"success",message:E.formatMessage({id:"COMMENT_Chosen_Response"})})),!y.isResolved&&y.canSelectResponse&&_.createElement(CU,null,_.createElement(UR,{onClick:ae,size:"s",label:E.formatMessage({id:"COMMENT_Choose_Response"}),dataCy:"questionAnswers-select-response-button"}))),_.createElement(fU,{ref:Z,isDeployed:$},_.createElement(hB,{ref:K,__html:null!==(w=t.description)&&void 0!==w?w:void 0}),d&&_.createElement(mU,null,t._widgets&&ie)),H&&($?_.createElement(hU,{onClick:()=>z(!1)},E.formatMessage({id:"GLOBAL_See_Less"})):_.createElement(gU,null,_.createElement(hU,{onClick:()=>z(!0)},E.formatMessage({id:"GLOBAL_See_More"})))),t._attachedFiles&&t._attachedFiles.length>0&&_.createElement(pU,null,_.createElement(FM,{files:t._attachedFiles,onError:f,isWedocActive:u,getAccessHash:p,onDelete:t._right.update&&n?oe:void 0})),X&&X.length>0&&_.createElement(vU,null,X.map(((e,n)=>_.createElement(bU,{key:n},_.createElement(yU,{onClick:()=>{return n=e.struct.type,void(e.isActive?v.socialAction.remove({targetId:t.id,targetType:t.type,type:n}).catch((e=>{a&&a(e.errorMsg)})):v.socialAction.add({targetId:t.id,targetType:t.type,type:n}).catch((e=>{a&&a(e.errorMsg)})));var n}},_.createElement(wU,{className:"icon-"+e.class+(e.isActive?"-on":""),isActive:e.isActive}),_.createElement(qR,{size:"s",color:e.isActive?"primary":"grey4"},e.label)),e.stats.total>0&&_.createElement(qR,{size:"s"},_.createElement(xU,{onClick:()=>{return n=e.struct.type,r=e.label,J(r),W(!0),void v.socialAction.getUsers({targetId:t.id,targetType:t.type,type:n}).then((e=>{q(e.result)})).catch((e=>{a&&a(e.errorMsg)}));var n,r}},e.stats.total))))))))),_.createElement(rM,{variant:"fixed-height",maxHeight:"800px",open:V,closeHandler:re},_.createElement(RM,{overflow:"scroll",onClickIconClose:re,title:Y+(G?` (${G.length})`:"")},G?_.createElement(EU,null,G.map(((e,t)=>_.createElement(uT,{key:`visitor-${t}`,y:"center",gap:24},_.createElement(qj,{size:5,uri:e.uri}),_.createElement(GR,{href:e._url},_.createElement(qR,null,e.title)))))):_.createElement(gE,{size:"l"}))))},SU=Bx.div`
|
|
3375
|
+
`,kU=({isFocused:e,comment:t,token:n,tinyMCEConfig:r,onCommentUpdate:o,onCommentDelete:i,onError:a,highlightFields:l,userModel:s,userAccountStatus:c,isWedocActive:u,isWidgetActive:d,getAccessHash:p,onGetHashError:f,deleteFile:m,existingWidgetsWrapperComponent:h,activeDrives:g,handlers:v,socialQuestion:y,articleId:b})=>{var w;const x=Lx(),E=bl(),[C,k]=(0,_.useState)(),[S,A]=(0,_.useState)(!1),[O,R]=(0,_.useState)(!1),[T,I]=(0,_.useState)(!1),[j,D]=(0,_.useState)(!1),[P,L]=(0,_.useState)(!1),[M,B]=(0,_.useState)(t.description),[F,N]=(0,_.useState)(!1),[$,z]=(0,_.useState)(!1),[H,U]=(0,_.useState)(!0),[V,W]=(0,_.useState)(!1),[G,q]=(0,_.useState)(),[Y,J]=(0,_.useState)(),K=(0,_.useRef)(null),Z=(0,_.useRef)(null),X=t._actions?Object.values(t._actions):void 0,Q=OT(),ee=(0,_.useCallback)((e=>{const t=new Date(e),n=new Date,r=n.getTime()-t.getTime();return r<6e4?E.formatMessage({id:"COMMENT_Just_Now"}):r<36e5?E.formatMessage({id:"COMMENT_Minutes_Ago"},{minutes:Math.round(r/6e4)}):r<864e5&&t.getDate()===n.getDate()?`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`:r<26784e5&&t.getMonth()===n.getMonth()?`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}`:`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}),[E]),te=(0,_.useCallback)((()=>{n&&M&&(N(!0),o({idComment:t.id,description:M,token:n}).then((()=>{L(!1),N(!1)})))}),[n,t,M,o]),ne=(0,_.useCallback)((()=>{N(!0),i(t.id).then((()=>{D(!1),N(!1),y&&y.responseId===t.id&&y.onUnselectResponse()})).catch((e=>{a&&a(e.errorMsg)}))}),[t.id,i,a,y]),re=()=>{W(!1),q(void 0),J(void 0)};(0,_.useEffect)((()=>{k(ee(t.dateCreation));const e=setInterval((()=>{k(ee(t.dateCreation))}),6e4);return()=>clearInterval(e)}),[t,ee]),(0,_.useEffect)((()=>{U(null!==Z.current&&null!==K.current&&K.current.clientHeight>Z.current.clientHeight);const e=new ResizeObserver((()=>{U(null!==Z.current&&null!==K.current&&K.current.clientHeight>Z.current.clientHeight)}));return K.current&&e.observe(K.current),()=>{e.disconnect()}}),[t]);const oe=(0,_.useCallback)((e=>new Promise(((t,r)=>{n&&m(e).then((()=>{te(),t()})).catch((e=>{a&&a(e.errorMsg),r()}))}))),[m,a,n,te]),ie=(0,_.useMemo)((()=>{if(t._widgets)return h(t,t._widgets,"view",!0)}),[t,h]),ae=(0,_.useCallback)((()=>{y&&v.questionAnswer.selectResponse({idResponse:t.id,idQuestion:b},{signal:Q.signal}).then((()=>{y.onSelectResponse(t.id)})).catch((e=>{a&&!Q.signal.aborted&&a(e.errorMsg)}))}),[Q.signal,b,t.id,v.questionAnswer,a,y]),le=(0,_.useCallback)((()=>{y&&v.questionAnswer.unselectResponse({idQuestion:b},{signal:Q.signal}).then((()=>{y.onUnselectResponse()})).catch((e=>{a&&!Q.signal.aborted&&a(e.errorMsg)}))}),[Q.signal,b,v.questionAnswer,a,y]);return _.createElement(oU,null,_.createElement(iU,{pending:t.pending,focused:e,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1)},_.createElement($U,null,_.createElement(GR,{href:t._user._url},_.createElement(qj,{uri:t._user.uri,size:5,variant:"circle"}))),_.createElement(sU,null,P&&n?_.createElement(rU,{comment:t,loading:F,token:n,activeDrives:g,commentContent:M,setCommentContent:B,tinyMCEConfig:r,updateComment:te,handlers:v,closeEditMode:()=>L(!1),deleteFile:m,onError:a}):_.createElement(sU,null,_.createElement(uT,{x:"space-between"},_.createElement(aU,null,_.createElement(QH,{uri:t._user.uri,onError:a,handlers:{user:v.user}},_.createElement(lU,null,_.createElement(GR,{href:t._user._url},t._user.title),9===t._user.level&&1===c&&_.createElement(nE,{isMargin:!1,color:x.color.primary,size:14,name:"icon-fs-shield"}))),_.createElement(qR,{size:"s",color:"grey4","aria-hidden":!0},"•"),_.createElement(BR,{position:"right",description:E.formatDate(t.dateCreation,{year:"2-digit",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},_.createElement(qR,{color:"grey4"},C))),(t._right.update||t._right.delete||(null==y?void 0:y.canSelectResponse))&&_.createElement(_.Fragment,null,_.createElement(cU,{onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1)},_.createElement($H,{withBorder:!0,onToggle:e=>I(e),trigger:_.createElement(dU,null,_.createElement(nE,{name:"icon-cogwheel",size:12,color:S||T?O||T?x.color.grey4:x.color.grey3:x.color.white})),dropdown:e=>_.createElement(_.Fragment,null,t._right.update&&_.createElement(uU,{onClick:()=>{e(),L(!0)}},E.formatMessage({id:"GLOBAL_Edit"})),t._right.delete&&_.createElement(uU,{onClick:()=>{e(),D(!0)}},E.formatMessage({id:"GLOBAL_Delete"})),(null==y?void 0:y.responseId)===t.id&&(null==y?void 0:y.canSelectResponse)&&_.createElement(uU,{onClick:()=>{e(),le()}},E.formatMessage({id:"COMMENT_Unselect_Response"}))),align:"right"})),_.createElement(BB,{buttons:[{color:"cancel",clickHandler:()=>D(!1),children:_.createElement(ms,{id:"GLOBAL_Cancel"})},{color:"danger",clickHandler:ne,children:_.createElement(ms,{id:"GLOBAL_Delete"}),loading:F}],open:j,closeHandler:()=>D(!1),title:E.formatMessage({id:"GLOBAL_Delete"})},E.formatMessage({id:"COMMENT_Delete_Comment"})))),l&&s&&_.createElement(HH,{user:t._user,highlightFields:l,userModel:s}),y&&_.createElement(_.Fragment,null,y.responseId===t.id&&_.createElement(CU,null,_.createElement($M,{variant:"success",message:E.formatMessage({id:"COMMENT_Chosen_Response"})})),!y.isResolved&&y.canSelectResponse&&_.createElement(CU,null,_.createElement(UR,{onClick:ae,size:"s",label:E.formatMessage({id:"COMMENT_Choose_Response"}),dataCy:"questionAnswers-select-response-button"}))),_.createElement(fU,{ref:Z,isDeployed:$},_.createElement(hB,{ref:K,__html:null!==(w=t.description)&&void 0!==w?w:void 0}),d&&_.createElement(mU,null,t._widgets&&ie)),H&&($?_.createElement(hU,{onClick:()=>z(!1)},E.formatMessage({id:"GLOBAL_See_Less"})):_.createElement(gU,null,_.createElement(hU,{onClick:()=>z(!0)},E.formatMessage({id:"GLOBAL_See_More"})))),t._attachedFiles&&t._attachedFiles.length>0&&_.createElement(pU,null,_.createElement(FM,{files:t._attachedFiles,onError:f,isWedocActive:u,getAccessHash:p,onDelete:t._right.update&&n?oe:void 0})),X&&X.length>0&&_.createElement(vU,null,X.map(((e,n)=>_.createElement(bU,{key:n},_.createElement(yU,{onClick:()=>{return n=e.struct.type,void(e.isActive?v.socialAction.remove({targetId:t.id,targetType:t.type,type:n}).catch((e=>{a&&a(e.errorMsg)})):v.socialAction.add({targetId:t.id,targetType:t.type,type:n}).catch((e=>{a&&a(e.errorMsg)})));var n}},_.createElement(wU,{className:"icon-"+e.class+(e.isActive?"-on":""),isActive:e.isActive}),_.createElement(qR,{size:"s",color:e.isActive?"primary":"grey4"},e.label)),e.stats.total>0&&_.createElement(qR,{size:"s"},_.createElement(xU,{onClick:()=>{return n=e.struct.type,r=e.label,J(r),W(!0),void v.socialAction.getUsers({targetId:t.id,targetType:t.type,type:n}).then((e=>{q(e.result)})).catch((e=>{a&&a(e.errorMsg)}));var n,r}},e.stats.total))))))))),_.createElement(rM,{variant:"fixed-height",maxHeight:"800px",open:V,closeHandler:re},_.createElement(RM,{overflow:"scroll",onClickIconClose:re,title:Y+(G?` (${G.length})`:"")},G?_.createElement(EU,null,G.map(((e,t)=>_.createElement(uT,{key:`visitor-${t}`,y:"center",gap:24},_.createElement(qj,{size:5,uri:e.uri}),_.createElement(GR,{href:e._url},_.createElement(qR,null,e.title)))))):_.createElement(gE,{size:"l"}))))},SU=Bx.div`
|
|
3364
3376
|
padding: 18px 0 12px 0;
|
|
3365
3377
|
`,AU=Bx.div`
|
|
3366
3378
|
padding: 8px 12px;
|