@e-llm-studio/requirement-ai 0.0.76 → 0.0.77

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),o=require("react/jsx-runtime"),e=require("react"),l=require("./ContentBlock.module.css.js"),t=require("../../../../icons/CheckIcon.js"),i=require("../../../../icons/PencilIcon.js"),d=require("../../../../icons/TrashIcon.js"),c=require("../../UserStoryApprovalContext.js"),v=require("../../../RequirementAIWrapper/RequirementAIWrapper.js"),a=function(a){var s,u,r,p,g,_,m,S,f,y,b,x,k,C,B,h,j,I,A,N,T,q,w,D,E,R,M,W,z,U,V,F,P,H,L,O,G,J,K,Q,X,Y,Z,$,nn,on,en,ln,tn,dn,cn,vn,an,sn,un,rn,pn,gn,_n,mn,Sn,fn,yn,bn,xn,kn,Cn,Bn,hn,jn,In,An,Nn,Tn,qn,wn,Dn,En,Rn,Mn,Wn=a.segment,zn=a.segmentIndex,Un=a.isSubFeature,Vn=void 0!==Un&&Un,Fn=a.onSaveContent,Pn=a.onApproveContent,Hn=a.onDeleteContent,Ln=a.EditorComponent,On=a.ViewerComponent,Gn=c.useUserStoryApprovalScreen(),Jn=Gn.currentContentId,Kn=Gn.handleUpdateContentId,Qn=Gn.isDisabled,Xn=Gn.isEditingSegment,Yn=Gn.setIsEditingSegment,Zn=Gn.config,$n=Gn.labels,no=Gn.showNotification,oo=v.useRequirementAI(),eo=oo.customStyles,lo=oo.customIcons,to=e.useState(!1),io=to[0],co=to[1],vo=e.useRef(Wn.content),ao=e.useRef(null),so=e.useState(0),uo=so[0],ro=so[1],po=Wn.contentId===Jn,go=e.useCallback(function(){if(ao.current){var n=ao.current;n.style.scrollMarginTop="".concat(90,"px"),n.scrollIntoView({behavior:"smooth",block:"start"})}},[]),_o=e.useCallback(function(){if(ao.current){var n=ao.current;n.style.scrollMarginBottom="".concat(90,"px"),n.scrollIntoView({behavior:"smooth",block:"end"})}},[]);e.useEffect(function(){if(po&&ao.current&&!io){var n=setTimeout(function(){_o()},200);return function(){return clearTimeout(n)}}},[Jn,po,io,_o]),e.useEffect(function(){if(0!==uo){var n=setTimeout(function(){go()},150);return function(){return clearTimeout(n)}}},[uo,go]),e.useEffect(function(){vo.current=Wn.content},[Wn.content]);var mo=e.useCallback(function(){vo.current=Wn.content,co(!0),Yn(!0),ro(function(n){return n+1})},[Wn.content,Yn]),So=e.useCallback(function(){vo.current=Wn.content,co(!1),Yn(!1)},[Wn.content,Yn]),fo=e.useCallback(function(n,o){vo.current=o},[]),yo=e.useCallback(function(){var n=vo.current;(null==n?void 0:n.trim())?(co(!1),Yn(!1),Fn(zn,n)):no("warn","Warning!",$n.emptyContentWarning,3e3)},[zn,Fn,Yn,no,$n.emptyContentWarning]),bo=e.useCallback(function(){Pn(zn),Kn(Wn.contentId)},[zn,Wn.contentId,Pn,Kn]),xo=e.useCallback(function(){null==Hn||Hn(zn)},[zn,Hn]),ko=[l.default.container,po?l.default.containerActive:l.default.containerDefault].join(" "),Co=null===(r=null===(u=null===(s=null==eo?void 0:eo.approvalScreen)||void 0===s?void 0:s.body)||void 0===u?void 0:u.contentSegment)||void 0===r?void 0:r.contentBlock,Bo=po?(null==Co?void 0:Co.currentSegementContainer)||{boxShadow:"0px 4px 14.3px 0px rgba(151, 71, 255, 0.3), 0px -4px 34.7px 0px rgba(51, 210, 255, 0.05)"}:(null==Co?void 0:Co.containerDefault)||{};return o.jsxs("div",n.__assign({className:ko,style:Bo,ref:ao},{children:[Wn.isApproved&&o.jsxs("div",n.__assign({className:l.default.approvedBadge,style:n.__assign({},null===(m=null===(_=null===(g=null===(p=null==eo?void 0:eo.approvalScreen)||void 0===p?void 0:p.body)||void 0===g?void 0:g.contentSegment)||void 0===_?void 0:_.contentBlock)||void 0===m?void 0:m.approvedBadge)},{children:[o.jsx("span",{children:$n.approved}),o.jsx(t.CheckIcon,{size:16,color:null===(b=null===(y=null===(f=null===(S=null==eo?void 0:eo.approvalScreen)||void 0===S?void 0:S.body)||void 0===f?void 0:f.contentSegment)||void 0===y?void 0:y.contentBlock)||void 0===b?void 0:b.checkIconColor})]})),o.jsx("div",n.__assign({className:l.default.contentArea,style:n.__assign({},null===(B=null===(C=null===(k=null===(x=null==eo?void 0:eo.approvalScreen)||void 0===x?void 0:x.body)||void 0===k?void 0:k.contentSegment)||void 0===C?void 0:C.contentBlock)||void 0===B?void 0:B.contentArea)},{children:io&&Ln?o.jsx(Ln,{minHeight:"100%",height:"100%",type:"string",value:Wn.content||"",handleUpdateState:fo,doNotShowBorderInViewMode:!1,mode:"edit"}):On?o.jsx(On,{message:Wn.content||"",scenario:"approving",customStyles:n.__assign({},null===(h=null==eo?void 0:eo.userStoryScreenStyles)||void 0===h?void 0:h.userStoryContentStyles),customIcons:n.__assign({},null==lo?void 0:lo.userStoryIcons)}):o.jsx("div",{className:l.default.contentFallback,dangerouslySetInnerHTML:{__html:Wn.content||""}})})),io?o.jsxs("div",n.__assign({className:l.default.editActionsContainer,style:n.__assign({},null===(bn=null===(yn=null===(fn=null===(Sn=null==eo?void 0:eo.approvalScreen)||void 0===Sn?void 0:Sn.body)||void 0===fn?void 0:fn.contentSegment)||void 0===yn?void 0:yn.contentBlock)||void 0===bn?void 0:bn.editActionsContainer)},{children:[o.jsx("button",n.__assign({onClick:So,className:l.default.outlineButton,style:n.__assign(n.__assign({},null===(Bn=null===(Cn=null===(kn=null===(xn=null==eo?void 0:eo.approvalScreen)||void 0===xn?void 0:xn.body)||void 0===kn?void 0:kn.contentSegment)||void 0===Cn?void 0:Cn.contentBlock)||void 0===Bn?void 0:Bn.outlineButton),null===(An=null===(In=null===(jn=null===(hn=null==eo?void 0:eo.approvalScreen)||void 0===hn?void 0:hn.body)||void 0===jn?void 0:jn.contentSegment)||void 0===In?void 0:In.contentBlock)||void 0===An?void 0:An.cancelButton)},{children:$n.cancel})),o.jsx("button",n.__assign({onClick:yo,className:l.default.outlineButton,style:n.__assign(n.__assign({},null===(wn=null===(qn=null===(Tn=null===(Nn=null==eo?void 0:eo.approvalScreen)||void 0===Nn?void 0:Nn.body)||void 0===Tn?void 0:Tn.contentSegment)||void 0===qn?void 0:qn.contentBlock)||void 0===wn?void 0:wn.outlineButton),null===(Mn=null===(Rn=null===(En=null===(Dn=null==eo?void 0:eo.approvalScreen)||void 0===Dn?void 0:Dn.body)||void 0===En?void 0:En.contentSegment)||void 0===Rn?void 0:Rn.contentBlock)||void 0===Mn?void 0:Mn.saveButton)},{children:$n.save}))]})):o.jsx("div",n.__assign({className:l.default.actionsContainer,style:n.__assign({},null===(N=null===(A=null===(I=null===(j=null==eo?void 0:eo.approvalScreen)||void 0===j?void 0:j.body)||void 0===I?void 0:I.contentSegment)||void 0===A?void 0:A.contentBlock)||void 0===N?void 0:N.actionsContainer)},{children:o.jsxs("div",n.__assign({className:l.default.actionsRow,style:n.__assign({},null===(D=null===(w=null===(q=null===(T=null==eo?void 0:eo.approvalScreen)||void 0===T?void 0:T.body)||void 0===q?void 0:q.contentSegment)||void 0===w?void 0:w.contentBlock)||void 0===D?void 0:D.actionsRow)},{children:[!Xn&&Zn.allowEditing&&o.jsxs("button",n.__assign({onClick:mo,className:l.default.actionButton,style:n.__assign({},null===(W=null===(M=null===(R=null===(E=null==eo?void 0:eo.approvalScreen)||void 0===E?void 0:E.body)||void 0===R?void 0:R.contentSegment)||void 0===M?void 0:M.contentBlock)||void 0===W?void 0:W.actionButton)},{children:[o.jsx("span",n.__assign({className:l.default.actionText,style:n.__assign({},null===(F=null===(V=null===(U=null===(z=null==eo?void 0:eo.approvalScreen)||void 0===z?void 0:z.body)||void 0===U?void 0:U.contentSegment)||void 0===V?void 0:V.contentBlock)||void 0===F?void 0:F.actionText)},{children:$n.correctMe})),o.jsx(i.PencilIcon,{size:16,color:(null===(O=null===(L=null===(H=null===(P=null==eo?void 0:eo.approvalScreen)||void 0===P?void 0:P.body)||void 0===H?void 0:H.contentSegment)||void 0===L?void 0:L.contentBlock)||void 0===O?void 0:O.pencilIcon)||"#5928ED"})]})),!Wn.isApproved&&o.jsxs("button",n.__assign({disabled:Qn,onClick:bo,style:n.__assign({},null===(Q=null===(K=null===(J=null===(G=null==eo?void 0:eo.approvalScreen)||void 0===G?void 0:G.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.contentBlock)||void 0===Q?void 0:Q.approveButton),className:"".concat(l.default.actionButton," ").concat(Qn?l.default.actionDisabled:"")},{children:[o.jsx("span",n.__assign({className:(null==Co?void 0:Co.approveText)?"":Qn?l.default.actionTextDisabled:l.default.actionText,style:n.__assign({},null==Co?void 0:Co.approveText)},{children:$n.approve})),o.jsx("span",n.__assign({style:n.__assign({},null===($=null===(Z=null===(Y=null===(X=null==eo?void 0:eo.approvalScreen)||void 0===X?void 0:X.body)||void 0===Y?void 0:Y.contentSegment)||void 0===Z?void 0:Z.contentBlock)||void 0===$?void 0:$.approveIconStyle)},{children:o.jsx(t.CheckIcon,{size:16,color:Qn?(null===(ln=null===(en=null===(on=null===(nn=null==eo?void 0:eo.approvalScreen)||void 0===nn?void 0:nn.body)||void 0===on?void 0:on.contentSegment)||void 0===en?void 0:en.contentBlock)||void 0===ln?void 0:ln.disableApproveIconColor)||"#9CA3AF":(null===(vn=null===(cn=null===(dn=null===(tn=null==eo?void 0:eo.approvalScreen)||void 0===tn?void 0:tn.body)||void 0===dn?void 0:dn.contentSegment)||void 0===cn?void 0:cn.contentBlock)||void 0===vn?void 0:vn.approveIconColor)||"#5928ED"})}))]})),Vn&&Zn.allowDeletion&&o.jsxs("button",n.__assign({onClick:xo,className:l.default.deleteButton,style:n.__assign({},null===(rn=null===(un=null===(sn=null===(an=null==eo?void 0:eo.approvalScreen)||void 0===an?void 0:an.body)||void 0===sn?void 0:sn.contentSegment)||void 0===un?void 0:un.contentBlock)||void 0===rn?void 0:rn.deleteButton)},{children:[o.jsx("span",{children:$n.delete}),o.jsx(d.TrashIcon,{size:16,color:(null===(mn=null===(_n=null===(gn=null===(pn=null==eo?void 0:eo.approvalScreen)||void 0===pn?void 0:pn.body)||void 0===gn?void 0:gn.contentSegment)||void 0===_n?void 0:_n.contentBlock)||void 0===mn?void 0:mn.deleteIconColor)||"#ed3f28"})]}))]}))}))]}))};exports.ContentBlock=a,exports.default=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),o=require("react/jsx-runtime"),e=require("react"),l=require("./ContentBlock.module.css.js"),t=require("../../../../icons/CheckIcon.js"),i=require("../../../../icons/PencilIcon.js"),d=require("../../../../icons/TrashIcon.js"),c=require("../../UserStoryApprovalContext.js"),v=require("../../../RequirementAIWrapper/RequirementAIWrapper.js"),a=function(a){var s,u,r,p,g,_,S,m,y,b,f,x,k,C,B,h,j,I,A,N,q,T,w,D,E,R,M,W,z,U,F,P,V,H,L,O,G,J,K,Q,X,Y,Z,$,nn,on,en,ln,tn,dn,cn,vn,an,sn,un,rn,pn,gn,_n,Sn,mn,yn,bn,fn,xn,kn,Cn,Bn,hn,jn,In,An,Nn,qn,Tn,wn,Dn,En,Rn,Mn,Wn=a.segment,zn=a.segmentIndex,Un=a.isSubFeature,Fn=void 0!==Un&&Un,Pn=a.onSaveContent,Vn=a.onApproveContent,Hn=a.onDeleteContent,Ln=a.EditorComponent,On=a.ViewerComponent,Gn=c.useUserStoryApprovalScreen(),Jn=Gn.currentContentId,Kn=Gn.handleUpdateContentId,Qn=Gn.isDisabled,Xn=Gn.isEditingSegment,Yn=Gn.setIsEditingSegment,Zn=Gn.config,$n=Gn.labels,no=Gn.showNotification,oo=v.useRequirementAI(),eo=oo.customStyles,lo=oo.customIcons,to=e.useState(!1),io=to[0],co=to[1],vo=e.useRef(Wn.content),ao=e.useRef(null),so=e.useState(0),uo=so[0],ro=so[1],po=Wn.contentId===Jn,go=e.useCallback(function(){if(ao.current){var n=ao.current;n.style.scrollMarginTop="".concat(90,"px"),n.scrollIntoView({behavior:"smooth",block:"start"})}},[]);e.useEffect(function(){if(0!==uo){var n=setTimeout(function(){go()},150);return function(){return clearTimeout(n)}}},[uo,go]),e.useEffect(function(){vo.current=Wn.content},[Wn.content]);var _o=e.useCallback(function(){vo.current=Wn.content,co(!0),Yn(!0),ro(function(n){return n+1})},[Wn.content,Yn]),So=e.useCallback(function(){vo.current=Wn.content,co(!1),Yn(!1)},[Wn.content,Yn]),mo=e.useCallback(function(n,o){vo.current=o},[]),yo=e.useCallback(function(){var n=vo.current;(null==n?void 0:n.trim())?(co(!1),Yn(!1),Pn(zn,n)):no("warn","Warning!",$n.emptyContentWarning,3e3)},[zn,Pn,Yn,no,$n.emptyContentWarning]),bo=e.useCallback(function(){Vn(zn),Kn(Wn.contentId)},[zn,Wn.contentId,Vn,Kn]),fo=e.useCallback(function(){null==Hn||Hn(zn)},[zn,Hn]),xo=[l.default.container,po?l.default.containerActive:l.default.containerDefault].join(" "),ko=null===(r=null===(u=null===(s=null==eo?void 0:eo.approvalScreen)||void 0===s?void 0:s.body)||void 0===u?void 0:u.contentSegment)||void 0===r?void 0:r.contentBlock,Co=po?(null==ko?void 0:ko.currentSegementContainer)||{boxShadow:"0px 4px 14.3px 0px rgba(151, 71, 255, 0.3), 0px -4px 34.7px 0px rgba(51, 210, 255, 0.05)"}:(null==ko?void 0:ko.containerDefault)||{};return o.jsxs("div",n.__assign({className:xo,style:Co,ref:ao},{children:[Wn.isApproved&&o.jsxs("div",n.__assign({className:l.default.approvedBadge,style:n.__assign({},null===(S=null===(_=null===(g=null===(p=null==eo?void 0:eo.approvalScreen)||void 0===p?void 0:p.body)||void 0===g?void 0:g.contentSegment)||void 0===_?void 0:_.contentBlock)||void 0===S?void 0:S.approvedBadge)},{children:[o.jsx("span",{children:$n.approved}),o.jsx(t.CheckIcon,{size:16,color:null===(f=null===(b=null===(y=null===(m=null==eo?void 0:eo.approvalScreen)||void 0===m?void 0:m.body)||void 0===y?void 0:y.contentSegment)||void 0===b?void 0:b.contentBlock)||void 0===f?void 0:f.checkIconColor})]})),o.jsx("div",n.__assign({className:l.default.contentArea,style:n.__assign({},null===(B=null===(C=null===(k=null===(x=null==eo?void 0:eo.approvalScreen)||void 0===x?void 0:x.body)||void 0===k?void 0:k.contentSegment)||void 0===C?void 0:C.contentBlock)||void 0===B?void 0:B.contentArea)},{children:io&&Ln?o.jsx(Ln,{minHeight:"100%",height:"100%",type:"string",value:Wn.content||"",handleUpdateState:mo,doNotShowBorderInViewMode:!1,mode:"edit"}):On?o.jsx(On,{message:Wn.content||"",scenario:"approving",customStyles:n.__assign({},null===(h=null==eo?void 0:eo.userStoryScreenStyles)||void 0===h?void 0:h.userStoryContentStyles),customIcons:n.__assign({},null==lo?void 0:lo.userStoryIcons)}):o.jsx("div",{className:l.default.contentFallback,dangerouslySetInnerHTML:{__html:Wn.content||""}})})),io?o.jsxs("div",n.__assign({className:l.default.editActionsContainer,style:n.__assign({},null===(fn=null===(bn=null===(yn=null===(mn=null==eo?void 0:eo.approvalScreen)||void 0===mn?void 0:mn.body)||void 0===yn?void 0:yn.contentSegment)||void 0===bn?void 0:bn.contentBlock)||void 0===fn?void 0:fn.editActionsContainer)},{children:[o.jsx("button",n.__assign({onClick:So,className:l.default.outlineButton,style:n.__assign(n.__assign({},null===(Bn=null===(Cn=null===(kn=null===(xn=null==eo?void 0:eo.approvalScreen)||void 0===xn?void 0:xn.body)||void 0===kn?void 0:kn.contentSegment)||void 0===Cn?void 0:Cn.contentBlock)||void 0===Bn?void 0:Bn.outlineButton),null===(An=null===(In=null===(jn=null===(hn=null==eo?void 0:eo.approvalScreen)||void 0===hn?void 0:hn.body)||void 0===jn?void 0:jn.contentSegment)||void 0===In?void 0:In.contentBlock)||void 0===An?void 0:An.cancelButton)},{children:$n.cancel})),o.jsx("button",n.__assign({onClick:yo,className:l.default.outlineButton,style:n.__assign(n.__assign({},null===(wn=null===(Tn=null===(qn=null===(Nn=null==eo?void 0:eo.approvalScreen)||void 0===Nn?void 0:Nn.body)||void 0===qn?void 0:qn.contentSegment)||void 0===Tn?void 0:Tn.contentBlock)||void 0===wn?void 0:wn.outlineButton),null===(Mn=null===(Rn=null===(En=null===(Dn=null==eo?void 0:eo.approvalScreen)||void 0===Dn?void 0:Dn.body)||void 0===En?void 0:En.contentSegment)||void 0===Rn?void 0:Rn.contentBlock)||void 0===Mn?void 0:Mn.saveButton)},{children:$n.save}))]})):o.jsx("div",n.__assign({className:l.default.actionsContainer,style:n.__assign({},null===(N=null===(A=null===(I=null===(j=null==eo?void 0:eo.approvalScreen)||void 0===j?void 0:j.body)||void 0===I?void 0:I.contentSegment)||void 0===A?void 0:A.contentBlock)||void 0===N?void 0:N.actionsContainer)},{children:o.jsxs("div",n.__assign({className:l.default.actionsRow,style:n.__assign({},null===(D=null===(w=null===(T=null===(q=null==eo?void 0:eo.approvalScreen)||void 0===q?void 0:q.body)||void 0===T?void 0:T.contentSegment)||void 0===w?void 0:w.contentBlock)||void 0===D?void 0:D.actionsRow)},{children:[!Xn&&Zn.allowEditing&&o.jsxs("button",n.__assign({onClick:_o,className:l.default.actionButton,style:n.__assign({},null===(W=null===(M=null===(R=null===(E=null==eo?void 0:eo.approvalScreen)||void 0===E?void 0:E.body)||void 0===R?void 0:R.contentSegment)||void 0===M?void 0:M.contentBlock)||void 0===W?void 0:W.actionButton)},{children:[o.jsx("span",n.__assign({className:l.default.actionText,style:n.__assign({},null===(P=null===(F=null===(U=null===(z=null==eo?void 0:eo.approvalScreen)||void 0===z?void 0:z.body)||void 0===U?void 0:U.contentSegment)||void 0===F?void 0:F.contentBlock)||void 0===P?void 0:P.actionText)},{children:$n.correctMe})),o.jsx(i.PencilIcon,{size:16,color:(null===(O=null===(L=null===(H=null===(V=null==eo?void 0:eo.approvalScreen)||void 0===V?void 0:V.body)||void 0===H?void 0:H.contentSegment)||void 0===L?void 0:L.contentBlock)||void 0===O?void 0:O.pencilIcon)||"#5928ED"})]})),!Wn.isApproved&&o.jsxs("button",n.__assign({disabled:Qn,onClick:bo,style:n.__assign({},null===(Q=null===(K=null===(J=null===(G=null==eo?void 0:eo.approvalScreen)||void 0===G?void 0:G.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.contentBlock)||void 0===Q?void 0:Q.approveButton),className:"".concat(l.default.actionButton," ").concat(Qn?l.default.actionDisabled:"")},{children:[o.jsx("span",n.__assign({className:(null==ko?void 0:ko.approveText)?"":Qn?l.default.actionTextDisabled:l.default.actionText,style:n.__assign({},null==ko?void 0:ko.approveText)},{children:$n.approve})),o.jsx("span",n.__assign({style:n.__assign({},null===($=null===(Z=null===(Y=null===(X=null==eo?void 0:eo.approvalScreen)||void 0===X?void 0:X.body)||void 0===Y?void 0:Y.contentSegment)||void 0===Z?void 0:Z.contentBlock)||void 0===$?void 0:$.approveIconStyle)},{children:o.jsx(t.CheckIcon,{size:16,color:Qn?(null===(ln=null===(en=null===(on=null===(nn=null==eo?void 0:eo.approvalScreen)||void 0===nn?void 0:nn.body)||void 0===on?void 0:on.contentSegment)||void 0===en?void 0:en.contentBlock)||void 0===ln?void 0:ln.disableApproveIconColor)||"#9CA3AF":(null===(vn=null===(cn=null===(dn=null===(tn=null==eo?void 0:eo.approvalScreen)||void 0===tn?void 0:tn.body)||void 0===dn?void 0:dn.contentSegment)||void 0===cn?void 0:cn.contentBlock)||void 0===vn?void 0:vn.approveIconColor)||"#5928ED"})}))]})),Fn&&Zn.allowDeletion&&o.jsxs("button",n.__assign({onClick:fo,className:l.default.deleteButton,style:n.__assign({},null===(rn=null===(un=null===(sn=null===(an=null==eo?void 0:eo.approvalScreen)||void 0===an?void 0:an.body)||void 0===sn?void 0:sn.contentSegment)||void 0===un?void 0:un.contentBlock)||void 0===rn?void 0:rn.deleteButton)},{children:[o.jsx("span",{children:$n.delete}),o.jsx(d.TrashIcon,{size:16,color:(null===(Sn=null===(_n=null===(gn=null===(pn=null==eo?void 0:eo.approvalScreen)||void 0===pn?void 0:pn.body)||void 0===gn?void 0:gn.contentSegment)||void 0===_n?void 0:_n.contentBlock)||void 0===Sn?void 0:Sn.deleteIconColor)||"#ed3f28"})]}))]}))}))]}))};exports.ContentBlock=a,exports.default=a;
2
2
  //# sourceMappingURL=ContentBlock.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),r=require("react"),t=require("../UserStoryPicker.context.js"),n=require("./Badge.js"),a=require("./CardProceedButton.js"),o=require("../lib/CustomTooltip.js");function i(r){var t=r.filled;return s.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:s.jsx("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"})}))}function l(){return s.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:s.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function c(){return s.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:s.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function d(e){try{var s=e.split(" "),r=s[0],t=s[1],n=void 0===t?"00:00:00":t,a=r.split("/"),o=a[0],i=a[1],l=a[2];if(!o||!i||!l)return e;var c=Number(l)+2e3,d="".concat(c,"-").concat(i,"-").concat(o,"T").concat(n),u=new Date(d);return isNaN(u.getTime())?e:u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(s){return e}}exports.UserStoryCard=function(u){var p,_,j,h=this,m=u.story,v=u.className,x=u.style,f=u.headerStyle,g=u.titleStyle,y=u.descriptionStyle,w=u.metaStyle,S=t.useUSPContext(),N=S.state,k=S.dispatch,C=S.classNames,b=S.renderProps,B=S.onStorySelect,L=S.onFavoriteToggle,T=S.adapter,F=S.disableTooltip,I=S.tooltipClassName,P=N.selectedStoryId===m.user_story_id,q=r.useState(!1),M=q[0],U=q[1],A=r.useState(null!==(p=m.isFavorite)&&void 0!==p&&p),D=A[0],E=A[1],R=r.useState(!1),V=R[0],W=R[1],H=r.useState(!1),O=H[0],Z=H[1],z=r.useCallback(function(e){e.stopPropagation(),Z(function(e){return!e})},[]),Y=O?m.description:(null!==(j=null===(_=m.description)||void 0===_?void 0:_.length)&&void 0!==j?j:0)>100?m.description.slice(0,100):m.description,G=m.description.length>100;if(r.useEffect(function(){var e;E(null!==(e=m.isFavorite)&&void 0!==e&&e)},[m.isFavorite]),r.useEffect(function(){if(V){var e=window.setTimeout(function(){W(!1)},600);return function(){return window.clearTimeout(e)}}},[V]),b.renderStoryCard)return s.jsx(s.Fragment,{children:b.renderStoryCard(m,{isSelected:P})});var J=r.useCallback(function(){k({type:"SELECT_STORY",payload:P?null:m.user_story_id}),P||null==B||B(m)},[k,P,m,B]),K=r.useCallback(function(s){return e.__awaiter(h,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:return s.stopPropagation(),E(r=!D),r&&W(!0),null==L||L(m,r),t={user_story_title_id:m.storyId,is_favorite:r},[4,T.markFavorite(t)];case 1:return e.sent()||(E(!r),r&&W(!1),null==L||L(m,!r)),[2]}})})},[D,m,L,T]),Q=["usp-card usp-card--story",M&&"usp-card--hovered",V&&"usp-card--favorite-bounce",C.card,v].filter(Boolean).join(" ");return s.jsxs("div",e.__assign({className:Q,style:x,onClick:J,onMouseEnter:function(){return U(!0)},onMouseLeave:function(){return U(!1)},role:"option","aria-selected":P},{children:[s.jsxs("div",e.__assign({className:["usp-card__header",C.cardHeader].filter(Boolean).join(" "),style:f},{children:[s.jsx("span",e.__assign({className:"usp-card__icon"},{children:b.renderBookmarkIcon?b.renderBookmarkIcon():s.jsx(l,{})})),""!==m.storyId&&s.jsxs("span",e.__assign({className:["usp-card__id",C.cardId].filter(Boolean).join(" ")},{children:[m.storyId,":"]})),s.jsx(o.default,e.__assign({content:m.title,placement:"top",disabled:F,contentClassName:I},{children:s.jsx("span",e.__assign({className:["usp-card__title",C.cardTitle].filter(Boolean).join(" "),style:g},{children:m.title}))})),m.isNew&&s.jsx(n.Badge,{type:"new"}),s.jsx("div",e.__assign({className:"usp-card__actions"},{children:s.jsx(o.default,e.__assign({content:D?"Remove from Shortlist":"Add to Shortlist",placement:"top",disabled:F,contentClassName:I},{children:s.jsxs("button",e.__assign({type:"button",className:["usp-card__heart",D&&"usp-card__heart--active",V&&"usp-card__heart--burst"].filter(Boolean).join(" "),onClick:K,"aria-label":D?"Remove from Shortlist":"Add to Shortlist","aria-pressed":D},{children:[s.jsx(i,{filled:D}),s.jsxs("span",e.__assign({className:"usp-card__heart-burst","aria-hidden":"true"},{children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}))]}))}))}))]})),s.jsxs("div",e.__assign({className:["usp-card__project-name",C.cardProjectName].filter(Boolean).join(" ")},{children:[b.renderFolderIcon?b.renderFolderIcon():s.jsx(c,{}),m.projectName]})),s.jsx("div",e.__assign({className:["usp-card-userstory-description",!m.description&&"usp-card__description--empty",C.cardDescription].filter(Boolean).join(" "),style:y},{children:m.description?s.jsxs(s.Fragment,{children:[Y,G&&s.jsx("button",e.__assign({onClick:z,className:["usp-card-moreButton",C.cardViewMore].filter(Boolean).join(" "),"aria-label":O?"Show less":"Show more"},{children:O?"less":"..."}))]}):s.jsx("span",e.__assign({className:"usp-card__description--placeholder"},{children:"No Description available"}))})),s.jsx("div",e.__assign({className:"usp-card__meta",style:w},{children:s.jsxs("span",e.__assign({className:["usp-card__date",C.cardDate].filter(Boolean).join(" ")},{children:["Last Updated: ",d(m.lastUpdated)]}))})),s.jsx(a.CardProceedButton,{story:m})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),r=require("react"),t=require("../UserStoryPicker.context.js"),n=require("./Badge.js"),a=require("./CardProceedButton.js"),o=require("../lib/CustomTooltip.js");function i(r){var t=r.filled;return s.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:s.jsx("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"})}))}function l(){return s.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:s.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function c(){return s.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:s.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function d(e){try{var s=e.split(" "),r=s[0],t=s[1],n=void 0===t?"00:00:00":t,a=r.split("/"),o=a[0],i=a[1],l=a[2];if(!o||!i||!l)return e;var c=Number(l)+2e3,d="".concat(c,"-").concat(i,"-").concat(o,"T").concat(n),u=new Date(d);return isNaN(u.getTime())?e:u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(s){return e}}exports.UserStoryCard=function(u){var p,_,j,h=this,m=u.story,v=u.className,x=u.style,f=u.headerStyle,g=u.titleStyle,y=u.descriptionStyle,w=u.metaStyle,S=t.useUSPContext(),N=S.state,k=S.dispatch,C=S.classNames,b=S.renderProps,B=S.onStorySelect,L=S.onFavoriteToggle,T=S.adapter,F=S.disableTooltip,I=S.tooltipClassName,P=N.selectedStoryId===m.user_story_id,q=r.useState(!1),M=q[0],U=q[1],A=r.useState(null!==(p=m.isFavorite)&&void 0!==p&&p),D=A[0],E=A[1],R=r.useState(!1),V=R[0],W=R[1],H=r.useState(!1),O=H[0],Z=H[1],z=r.useCallback(function(e){e.stopPropagation(),Z(function(e){return!e})},[]),Y=O?m.description:(null!==(j=null===(_=m.description)||void 0===_?void 0:_.length)&&void 0!==j?j:0)>100?m.description.slice(0,100):m.description,G=m.description.length>100;if(r.useEffect(function(){var e;E(null!==(e=m.isFavorite)&&void 0!==e&&e)},[m.isFavorite]),r.useEffect(function(){if(V){var e=window.setTimeout(function(){W(!1)},600);return function(){return window.clearTimeout(e)}}},[V]),b.renderStoryCard)return s.jsx(s.Fragment,{children:b.renderStoryCard(m,{isSelected:P})});var J=r.useCallback(function(){k({type:"SELECT_STORY",payload:P?null:m.user_story_id}),P||null==B||B(m)},[k,P,m,B]),K=r.useCallback(function(s){return e.__awaiter(h,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:return s.stopPropagation(),E(r=!D),r&&W(!0),null==L||L(m,r),t={user_story_title_id:m.storyId,user_story_id:m.user_story_id,is_favorite:r},[4,T.markFavorite(t)];case 1:return e.sent()||(E(!r),r&&W(!1),null==L||L(m,!r)),[2]}})})},[D,m,L,T]),Q=["usp-card usp-card--story",M&&"usp-card--hovered",V&&"usp-card--favorite-bounce",C.card,v].filter(Boolean).join(" ");return s.jsxs("div",e.__assign({className:Q,style:x,onClick:J,onMouseEnter:function(){return U(!0)},onMouseLeave:function(){return U(!1)},role:"option","aria-selected":P},{children:[s.jsxs("div",e.__assign({className:["usp-card__header",C.cardHeader].filter(Boolean).join(" "),style:f},{children:[s.jsx("span",e.__assign({className:"usp-card__icon"},{children:b.renderBookmarkIcon?b.renderBookmarkIcon():s.jsx(l,{})})),""!==m.storyId&&s.jsxs("span",e.__assign({className:["usp-card__id",C.cardId].filter(Boolean).join(" ")},{children:[m.storyId,":"]})),s.jsx(o.default,e.__assign({content:m.title,placement:"top",disabled:F,contentClassName:I},{children:s.jsx("span",e.__assign({className:["usp-card__title",C.cardTitle].filter(Boolean).join(" "),style:g},{children:m.title}))})),m.isNew&&s.jsx(n.Badge,{type:"new"}),s.jsx("div",e.__assign({className:"usp-card__actions"},{children:s.jsx(o.default,e.__assign({content:D?"Remove from Shortlist":"Add to Shortlist",placement:"top",disabled:F,contentClassName:I},{children:s.jsxs("button",e.__assign({type:"button",className:["usp-card__heart",D&&"usp-card__heart--active",V&&"usp-card__heart--burst"].filter(Boolean).join(" "),onClick:K,"aria-label":D?"Remove from Shortlist":"Add to Shortlist","aria-pressed":D},{children:[s.jsx(i,{filled:D}),s.jsxs("span",e.__assign({className:"usp-card__heart-burst","aria-hidden":"true"},{children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}))]}))}))}))]})),s.jsxs("div",e.__assign({className:["usp-card__project-name",C.cardProjectName].filter(Boolean).join(" ")},{children:[b.renderFolderIcon?b.renderFolderIcon():s.jsx(c,{}),m.projectName]})),s.jsx("div",e.__assign({className:["usp-card-userstory-description",!m.description&&"usp-card__description--empty",C.cardDescription].filter(Boolean).join(" "),style:y},{children:m.description?s.jsxs(s.Fragment,{children:[Y,G&&s.jsx("button",e.__assign({onClick:z,className:["usp-card-moreButton",C.cardViewMore].filter(Boolean).join(" "),"aria-label":O?"Show less":"Show more"},{children:O?"less":"..."}))]}):s.jsx("span",e.__assign({className:"usp-card__description--placeholder"},{children:"No Description available"}))})),s.jsx("div",e.__assign({className:"usp-card__meta",style:w},{children:s.jsxs("span",e.__assign({className:["usp-card__date",C.cardDate].filter(Boolean).join(" ")},{children:["Last Updated: ",d(m.lastUpdated)]}))})),s.jsx(a.CardProceedButton,{story:m})]}))};
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsxs as n,jsx as l}from"react/jsx-runtime";import{useState as e,useRef as t,useCallback as i,useEffect as d}from"react";import v from"./ContentBlock.module.css.js";import{CheckIcon as c}from"../../../../icons/CheckIcon.js";import{PencilIcon as r}from"../../../../icons/PencilIcon.js";import{TrashIcon as u}from"../../../../icons/TrashIcon.js";import{useUserStoryApprovalScreen as a}from"../../UserStoryApprovalContext.js";import{useRequirementAI as s}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";var p=function(p){var m,S,y,g,b,f,B,h,k,C,I,x,N,A,T,w,D,j,E,M,W,z,R,V,F,U,q,H,_,L,P,G,J,K,O,Q,X,Y,Z,$,oo,no,lo,eo,to,io,vo,co,ro,uo,ao,so,po,mo,So,yo,go,bo,fo,Bo,ho,ko,Co,Io,xo,No,Ao,To,wo,Do,jo,Eo,Mo,Wo,zo,Ro,Vo,Fo,Uo,qo,Ho=p.segment,_o=p.segmentIndex,Lo=p.isSubFeature,Po=void 0!==Lo&&Lo,Go=p.onSaveContent,Jo=p.onApproveContent,Ko=p.onDeleteContent,Oo=p.EditorComponent,Qo=p.ViewerComponent,Xo=a(),Yo=Xo.currentContentId,Zo=Xo.handleUpdateContentId,$o=Xo.isDisabled,on=Xo.isEditingSegment,nn=Xo.setIsEditingSegment,ln=Xo.config,en=Xo.labels,tn=Xo.showNotification,dn=s(),vn=dn.customStyles,cn=dn.customIcons,rn=e(!1),un=rn[0],an=rn[1],sn=t(Ho.content),pn=t(null),mn=e(0),Sn=mn[0],yn=mn[1],gn=Ho.contentId===Yo,bn=i(function(){if(pn.current){var o=pn.current;o.style.scrollMarginTop="".concat(90,"px"),o.scrollIntoView({behavior:"smooth",block:"start"})}},[]),fn=i(function(){if(pn.current){var o=pn.current;o.style.scrollMarginBottom="".concat(90,"px"),o.scrollIntoView({behavior:"smooth",block:"end"})}},[]);d(function(){if(gn&&pn.current&&!un){var o=setTimeout(function(){fn()},200);return function(){return clearTimeout(o)}}},[Yo,gn,un,fn]),d(function(){if(0!==Sn){var o=setTimeout(function(){bn()},150);return function(){return clearTimeout(o)}}},[Sn,bn]),d(function(){sn.current=Ho.content},[Ho.content]);var Bn=i(function(){sn.current=Ho.content,an(!0),nn(!0),yn(function(o){return o+1})},[Ho.content,nn]),hn=i(function(){sn.current=Ho.content,an(!1),nn(!1)},[Ho.content,nn]),kn=i(function(o,n){sn.current=n},[]),Cn=i(function(){var o=sn.current;(null==o?void 0:o.trim())?(an(!1),nn(!1),Go(_o,o)):tn("warn","Warning!",en.emptyContentWarning,3e3)},[_o,Go,nn,tn,en.emptyContentWarning]),In=i(function(){Jo(_o),Zo(Ho.contentId)},[_o,Ho.contentId,Jo,Zo]),xn=i(function(){null==Ko||Ko(_o)},[_o,Ko]),Nn=[v.container,gn?v.containerActive:v.containerDefault].join(" "),An=null===(y=null===(S=null===(m=null==vn?void 0:vn.approvalScreen)||void 0===m?void 0:m.body)||void 0===S?void 0:S.contentSegment)||void 0===y?void 0:y.contentBlock,Tn=gn?(null==An?void 0:An.currentSegementContainer)||{boxShadow:"0px 4px 14.3px 0px rgba(151, 71, 255, 0.3), 0px -4px 34.7px 0px rgba(51, 210, 255, 0.05)"}:(null==An?void 0:An.containerDefault)||{};return n("div",o({className:Nn,style:Tn,ref:pn},{children:[Ho.isApproved&&n("div",o({className:v.approvedBadge,style:o({},null===(B=null===(f=null===(b=null===(g=null==vn?void 0:vn.approvalScreen)||void 0===g?void 0:g.body)||void 0===b?void 0:b.contentSegment)||void 0===f?void 0:f.contentBlock)||void 0===B?void 0:B.approvedBadge)},{children:[l("span",{children:en.approved}),l(c,{size:16,color:null===(I=null===(C=null===(k=null===(h=null==vn?void 0:vn.approvalScreen)||void 0===h?void 0:h.body)||void 0===k?void 0:k.contentSegment)||void 0===C?void 0:C.contentBlock)||void 0===I?void 0:I.checkIconColor})]})),l("div",o({className:v.contentArea,style:o({},null===(T=null===(A=null===(N=null===(x=null==vn?void 0:vn.approvalScreen)||void 0===x?void 0:x.body)||void 0===N?void 0:N.contentSegment)||void 0===A?void 0:A.contentBlock)||void 0===T?void 0:T.contentArea)},{children:un&&Oo?l(Oo,{minHeight:"100%",height:"100%",type:"string",value:Ho.content||"",handleUpdateState:kn,doNotShowBorderInViewMode:!1,mode:"edit"}):Qo?l(Qo,{message:Ho.content||"",scenario:"approving",customStyles:o({},null===(w=null==vn?void 0:vn.userStoryScreenStyles)||void 0===w?void 0:w.userStoryContentStyles),customIcons:o({},null==cn?void 0:cn.userStoryIcons)}):l("div",{className:v.contentFallback,dangerouslySetInnerHTML:{__html:Ho.content||""}})})),un?n("div",o({className:v.editActionsContainer,style:o({},null===(Io=null===(Co=null===(ko=null===(ho=null==vn?void 0:vn.approvalScreen)||void 0===ho?void 0:ho.body)||void 0===ko?void 0:ko.contentSegment)||void 0===Co?void 0:Co.contentBlock)||void 0===Io?void 0:Io.editActionsContainer)},{children:[l("button",o({onClick:hn,className:v.outlineButton,style:o(o({},null===(To=null===(Ao=null===(No=null===(xo=null==vn?void 0:vn.approvalScreen)||void 0===xo?void 0:xo.body)||void 0===No?void 0:No.contentSegment)||void 0===Ao?void 0:Ao.contentBlock)||void 0===To?void 0:To.outlineButton),null===(Eo=null===(jo=null===(Do=null===(wo=null==vn?void 0:vn.approvalScreen)||void 0===wo?void 0:wo.body)||void 0===Do?void 0:Do.contentSegment)||void 0===jo?void 0:jo.contentBlock)||void 0===Eo?void 0:Eo.cancelButton)},{children:en.cancel})),l("button",o({onClick:Cn,className:v.outlineButton,style:o(o({},null===(Ro=null===(zo=null===(Wo=null===(Mo=null==vn?void 0:vn.approvalScreen)||void 0===Mo?void 0:Mo.body)||void 0===Wo?void 0:Wo.contentSegment)||void 0===zo?void 0:zo.contentBlock)||void 0===Ro?void 0:Ro.outlineButton),null===(qo=null===(Uo=null===(Fo=null===(Vo=null==vn?void 0:vn.approvalScreen)||void 0===Vo?void 0:Vo.body)||void 0===Fo?void 0:Fo.contentSegment)||void 0===Uo?void 0:Uo.contentBlock)||void 0===qo?void 0:qo.saveButton)},{children:en.save}))]})):l("div",o({className:v.actionsContainer,style:o({},null===(M=null===(E=null===(j=null===(D=null==vn?void 0:vn.approvalScreen)||void 0===D?void 0:D.body)||void 0===j?void 0:j.contentSegment)||void 0===E?void 0:E.contentBlock)||void 0===M?void 0:M.actionsContainer)},{children:n("div",o({className:v.actionsRow,style:o({},null===(V=null===(R=null===(z=null===(W=null==vn?void 0:vn.approvalScreen)||void 0===W?void 0:W.body)||void 0===z?void 0:z.contentSegment)||void 0===R?void 0:R.contentBlock)||void 0===V?void 0:V.actionsRow)},{children:[!on&&ln.allowEditing&&n("button",o({onClick:Bn,className:v.actionButton,style:o({},null===(H=null===(q=null===(U=null===(F=null==vn?void 0:vn.approvalScreen)||void 0===F?void 0:F.body)||void 0===U?void 0:U.contentSegment)||void 0===q?void 0:q.contentBlock)||void 0===H?void 0:H.actionButton)},{children:[l("span",o({className:v.actionText,style:o({},null===(G=null===(P=null===(L=null===(_=null==vn?void 0:vn.approvalScreen)||void 0===_?void 0:_.body)||void 0===L?void 0:L.contentSegment)||void 0===P?void 0:P.contentBlock)||void 0===G?void 0:G.actionText)},{children:en.correctMe})),l(r,{size:16,color:(null===(Q=null===(O=null===(K=null===(J=null==vn?void 0:vn.approvalScreen)||void 0===J?void 0:J.body)||void 0===K?void 0:K.contentSegment)||void 0===O?void 0:O.contentBlock)||void 0===Q?void 0:Q.pencilIcon)||"#5928ED"})]})),!Ho.isApproved&&n("button",o({disabled:$o,onClick:In,style:o({},null===($=null===(Z=null===(Y=null===(X=null==vn?void 0:vn.approvalScreen)||void 0===X?void 0:X.body)||void 0===Y?void 0:Y.contentSegment)||void 0===Z?void 0:Z.contentBlock)||void 0===$?void 0:$.approveButton),className:"".concat(v.actionButton," ").concat($o?v.actionDisabled:"")},{children:[l("span",o({className:(null==An?void 0:An.approveText)?"":$o?v.actionTextDisabled:v.actionText,style:o({},null==An?void 0:An.approveText)},{children:en.approve})),l("span",o({style:o({},null===(eo=null===(lo=null===(no=null===(oo=null==vn?void 0:vn.approvalScreen)||void 0===oo?void 0:oo.body)||void 0===no?void 0:no.contentSegment)||void 0===lo?void 0:lo.contentBlock)||void 0===eo?void 0:eo.approveIconStyle)},{children:l(c,{size:16,color:$o?(null===(co=null===(vo=null===(io=null===(to=null==vn?void 0:vn.approvalScreen)||void 0===to?void 0:to.body)||void 0===io?void 0:io.contentSegment)||void 0===vo?void 0:vo.contentBlock)||void 0===co?void 0:co.disableApproveIconColor)||"#9CA3AF":(null===(so=null===(ao=null===(uo=null===(ro=null==vn?void 0:vn.approvalScreen)||void 0===ro?void 0:ro.body)||void 0===uo?void 0:uo.contentSegment)||void 0===ao?void 0:ao.contentBlock)||void 0===so?void 0:so.approveIconColor)||"#5928ED"})}))]})),Po&&ln.allowDeletion&&n("button",o({onClick:xn,className:v.deleteButton,style:o({},null===(yo=null===(So=null===(mo=null===(po=null==vn?void 0:vn.approvalScreen)||void 0===po?void 0:po.body)||void 0===mo?void 0:mo.contentSegment)||void 0===So?void 0:So.contentBlock)||void 0===yo?void 0:yo.deleteButton)},{children:[l("span",{children:en.delete}),l(u,{size:16,color:(null===(Bo=null===(fo=null===(bo=null===(go=null==vn?void 0:vn.approvalScreen)||void 0===go?void 0:go.body)||void 0===bo?void 0:bo.contentSegment)||void 0===fo?void 0:fo.contentBlock)||void 0===Bo?void 0:Bo.deleteIconColor)||"#ed3f28"})]}))]}))}))]}))};export{p as ContentBlock,p as default};
1
+ import{__assign as o}from"tslib";import{jsxs as n,jsx as l}from"react/jsx-runtime";import{useState as e,useRef as t,useCallback as i,useEffect as d}from"react";import v from"./ContentBlock.module.css.js";import{CheckIcon as c}from"../../../../icons/CheckIcon.js";import{PencilIcon as r}from"../../../../icons/PencilIcon.js";import{TrashIcon as u}from"../../../../icons/TrashIcon.js";import{useUserStoryApprovalScreen as a}from"../../UserStoryApprovalContext.js";import{useRequirementAI as s}from"../../../RequirementAIWrapper/RequirementAIWrapper.js";var p=function(p){var m,S,y,g,b,B,f,h,k,C,I,x,N,A,w,T,D,j,E,W,z,M,R,F,U,V,q,H,_,L,P,G,J,K,O,Q,X,Y,Z,$,oo,no,lo,eo,to,io,vo,co,ro,uo,ao,so,po,mo,So,yo,go,bo,Bo,fo,ho,ko,Co,Io,xo,No,Ao,wo,To,Do,jo,Eo,Wo,zo,Mo,Ro,Fo,Uo,Vo,qo,Ho=p.segment,_o=p.segmentIndex,Lo=p.isSubFeature,Po=void 0!==Lo&&Lo,Go=p.onSaveContent,Jo=p.onApproveContent,Ko=p.onDeleteContent,Oo=p.EditorComponent,Qo=p.ViewerComponent,Xo=a(),Yo=Xo.currentContentId,Zo=Xo.handleUpdateContentId,$o=Xo.isDisabled,on=Xo.isEditingSegment,nn=Xo.setIsEditingSegment,ln=Xo.config,en=Xo.labels,tn=Xo.showNotification,dn=s(),vn=dn.customStyles,cn=dn.customIcons,rn=e(!1),un=rn[0],an=rn[1],sn=t(Ho.content),pn=t(null),mn=e(0),Sn=mn[0],yn=mn[1],gn=Ho.contentId===Yo,bn=i(function(){if(pn.current){var o=pn.current;o.style.scrollMarginTop="".concat(90,"px"),o.scrollIntoView({behavior:"smooth",block:"start"})}},[]);d(function(){if(0!==Sn){var o=setTimeout(function(){bn()},150);return function(){return clearTimeout(o)}}},[Sn,bn]),d(function(){sn.current=Ho.content},[Ho.content]);var Bn=i(function(){sn.current=Ho.content,an(!0),nn(!0),yn(function(o){return o+1})},[Ho.content,nn]),fn=i(function(){sn.current=Ho.content,an(!1),nn(!1)},[Ho.content,nn]),hn=i(function(o,n){sn.current=n},[]),kn=i(function(){var o=sn.current;(null==o?void 0:o.trim())?(an(!1),nn(!1),Go(_o,o)):tn("warn","Warning!",en.emptyContentWarning,3e3)},[_o,Go,nn,tn,en.emptyContentWarning]),Cn=i(function(){Jo(_o),Zo(Ho.contentId)},[_o,Ho.contentId,Jo,Zo]),In=i(function(){null==Ko||Ko(_o)},[_o,Ko]),xn=[v.container,gn?v.containerActive:v.containerDefault].join(" "),Nn=null===(y=null===(S=null===(m=null==vn?void 0:vn.approvalScreen)||void 0===m?void 0:m.body)||void 0===S?void 0:S.contentSegment)||void 0===y?void 0:y.contentBlock,An=gn?(null==Nn?void 0:Nn.currentSegementContainer)||{boxShadow:"0px 4px 14.3px 0px rgba(151, 71, 255, 0.3), 0px -4px 34.7px 0px rgba(51, 210, 255, 0.05)"}:(null==Nn?void 0:Nn.containerDefault)||{};return n("div",o({className:xn,style:An,ref:pn},{children:[Ho.isApproved&&n("div",o({className:v.approvedBadge,style:o({},null===(f=null===(B=null===(b=null===(g=null==vn?void 0:vn.approvalScreen)||void 0===g?void 0:g.body)||void 0===b?void 0:b.contentSegment)||void 0===B?void 0:B.contentBlock)||void 0===f?void 0:f.approvedBadge)},{children:[l("span",{children:en.approved}),l(c,{size:16,color:null===(I=null===(C=null===(k=null===(h=null==vn?void 0:vn.approvalScreen)||void 0===h?void 0:h.body)||void 0===k?void 0:k.contentSegment)||void 0===C?void 0:C.contentBlock)||void 0===I?void 0:I.checkIconColor})]})),l("div",o({className:v.contentArea,style:o({},null===(w=null===(A=null===(N=null===(x=null==vn?void 0:vn.approvalScreen)||void 0===x?void 0:x.body)||void 0===N?void 0:N.contentSegment)||void 0===A?void 0:A.contentBlock)||void 0===w?void 0:w.contentArea)},{children:un&&Oo?l(Oo,{minHeight:"100%",height:"100%",type:"string",value:Ho.content||"",handleUpdateState:hn,doNotShowBorderInViewMode:!1,mode:"edit"}):Qo?l(Qo,{message:Ho.content||"",scenario:"approving",customStyles:o({},null===(T=null==vn?void 0:vn.userStoryScreenStyles)||void 0===T?void 0:T.userStoryContentStyles),customIcons:o({},null==cn?void 0:cn.userStoryIcons)}):l("div",{className:v.contentFallback,dangerouslySetInnerHTML:{__html:Ho.content||""}})})),un?n("div",o({className:v.editActionsContainer,style:o({},null===(Io=null===(Co=null===(ko=null===(ho=null==vn?void 0:vn.approvalScreen)||void 0===ho?void 0:ho.body)||void 0===ko?void 0:ko.contentSegment)||void 0===Co?void 0:Co.contentBlock)||void 0===Io?void 0:Io.editActionsContainer)},{children:[l("button",o({onClick:fn,className:v.outlineButton,style:o(o({},null===(wo=null===(Ao=null===(No=null===(xo=null==vn?void 0:vn.approvalScreen)||void 0===xo?void 0:xo.body)||void 0===No?void 0:No.contentSegment)||void 0===Ao?void 0:Ao.contentBlock)||void 0===wo?void 0:wo.outlineButton),null===(Eo=null===(jo=null===(Do=null===(To=null==vn?void 0:vn.approvalScreen)||void 0===To?void 0:To.body)||void 0===Do?void 0:Do.contentSegment)||void 0===jo?void 0:jo.contentBlock)||void 0===Eo?void 0:Eo.cancelButton)},{children:en.cancel})),l("button",o({onClick:kn,className:v.outlineButton,style:o(o({},null===(Ro=null===(Mo=null===(zo=null===(Wo=null==vn?void 0:vn.approvalScreen)||void 0===Wo?void 0:Wo.body)||void 0===zo?void 0:zo.contentSegment)||void 0===Mo?void 0:Mo.contentBlock)||void 0===Ro?void 0:Ro.outlineButton),null===(qo=null===(Vo=null===(Uo=null===(Fo=null==vn?void 0:vn.approvalScreen)||void 0===Fo?void 0:Fo.body)||void 0===Uo?void 0:Uo.contentSegment)||void 0===Vo?void 0:Vo.contentBlock)||void 0===qo?void 0:qo.saveButton)},{children:en.save}))]})):l("div",o({className:v.actionsContainer,style:o({},null===(W=null===(E=null===(j=null===(D=null==vn?void 0:vn.approvalScreen)||void 0===D?void 0:D.body)||void 0===j?void 0:j.contentSegment)||void 0===E?void 0:E.contentBlock)||void 0===W?void 0:W.actionsContainer)},{children:n("div",o({className:v.actionsRow,style:o({},null===(F=null===(R=null===(M=null===(z=null==vn?void 0:vn.approvalScreen)||void 0===z?void 0:z.body)||void 0===M?void 0:M.contentSegment)||void 0===R?void 0:R.contentBlock)||void 0===F?void 0:F.actionsRow)},{children:[!on&&ln.allowEditing&&n("button",o({onClick:Bn,className:v.actionButton,style:o({},null===(H=null===(q=null===(V=null===(U=null==vn?void 0:vn.approvalScreen)||void 0===U?void 0:U.body)||void 0===V?void 0:V.contentSegment)||void 0===q?void 0:q.contentBlock)||void 0===H?void 0:H.actionButton)},{children:[l("span",o({className:v.actionText,style:o({},null===(G=null===(P=null===(L=null===(_=null==vn?void 0:vn.approvalScreen)||void 0===_?void 0:_.body)||void 0===L?void 0:L.contentSegment)||void 0===P?void 0:P.contentBlock)||void 0===G?void 0:G.actionText)},{children:en.correctMe})),l(r,{size:16,color:(null===(Q=null===(O=null===(K=null===(J=null==vn?void 0:vn.approvalScreen)||void 0===J?void 0:J.body)||void 0===K?void 0:K.contentSegment)||void 0===O?void 0:O.contentBlock)||void 0===Q?void 0:Q.pencilIcon)||"#5928ED"})]})),!Ho.isApproved&&n("button",o({disabled:$o,onClick:Cn,style:o({},null===($=null===(Z=null===(Y=null===(X=null==vn?void 0:vn.approvalScreen)||void 0===X?void 0:X.body)||void 0===Y?void 0:Y.contentSegment)||void 0===Z?void 0:Z.contentBlock)||void 0===$?void 0:$.approveButton),className:"".concat(v.actionButton," ").concat($o?v.actionDisabled:"")},{children:[l("span",o({className:(null==Nn?void 0:Nn.approveText)?"":$o?v.actionTextDisabled:v.actionText,style:o({},null==Nn?void 0:Nn.approveText)},{children:en.approve})),l("span",o({style:o({},null===(eo=null===(lo=null===(no=null===(oo=null==vn?void 0:vn.approvalScreen)||void 0===oo?void 0:oo.body)||void 0===no?void 0:no.contentSegment)||void 0===lo?void 0:lo.contentBlock)||void 0===eo?void 0:eo.approveIconStyle)},{children:l(c,{size:16,color:$o?(null===(co=null===(vo=null===(io=null===(to=null==vn?void 0:vn.approvalScreen)||void 0===to?void 0:to.body)||void 0===io?void 0:io.contentSegment)||void 0===vo?void 0:vo.contentBlock)||void 0===co?void 0:co.disableApproveIconColor)||"#9CA3AF":(null===(so=null===(ao=null===(uo=null===(ro=null==vn?void 0:vn.approvalScreen)||void 0===ro?void 0:ro.body)||void 0===uo?void 0:uo.contentSegment)||void 0===ao?void 0:ao.contentBlock)||void 0===so?void 0:so.approveIconColor)||"#5928ED"})}))]})),Po&&ln.allowDeletion&&n("button",o({onClick:In,className:v.deleteButton,style:o({},null===(yo=null===(So=null===(mo=null===(po=null==vn?void 0:vn.approvalScreen)||void 0===po?void 0:po.body)||void 0===mo?void 0:mo.contentSegment)||void 0===So?void 0:So.contentBlock)||void 0===yo?void 0:yo.deleteButton)},{children:[l("span",{children:en.delete}),l(u,{size:16,color:(null===(fo=null===(Bo=null===(bo=null===(go=null==vn?void 0:vn.approvalScreen)||void 0===go?void 0:go.body)||void 0===bo?void 0:bo.contentSegment)||void 0===Bo?void 0:Bo.contentBlock)||void 0===fo?void 0:fo.deleteIconColor)||"#ed3f28"})]}))]}))}))]}))};export{p as ContentBlock,p as default};
2
2
  //# sourceMappingURL=ContentBlock.js.map
@@ -1,2 +1,2 @@
1
- import{__awaiter as e,__generator as r,__assign as t}from"tslib";import{jsx as o,Fragment as n,jsxs as i}from"react/jsx-runtime";import{useState as a,useCallback as s,useEffect as l}from"react";import{useUSPContext as c}from"../UserStoryPicker.context.js";import{Badge as d}from"./Badge.js";import{CardProceedButton as u}from"./CardProceedButton.js";import p from"../lib/CustomTooltip.js";function m(e){var r=e.filled;return o("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:o("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"})}))}function h(){return o("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:o("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function v(){return o("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:o("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function f(e){try{var r=e.split(" "),t=r[0],o=r[1],n=void 0===o?"00:00:00":o,i=t.split("/"),a=i[0],s=i[1],l=i[2];if(!a||!s||!l)return e;var c=Number(l)+2e3,d="".concat(c,"-").concat(s,"-").concat(a,"T").concat(n),u=new Date(d);return isNaN(u.getTime())?e:u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(r){return e}}function _(_){var y,w,N,k=this,S=_.story,j=_.className,g=_.style,B=_.headerStyle,b=_.titleStyle,C=_.descriptionStyle,L=_.metaStyle,T=c(),x=T.state,I=T.dispatch,F=T.classNames,P=T.renderProps,A=T.onStorySelect,D=T.onFavoriteToggle,M=T.adapter,U=T.disableTooltip,E=T.tooltipClassName,R=x.selectedStoryId===S.user_story_id,V=a(!1),W=V[0],H=V[1],Z=a(null!==(y=S.isFavorite)&&void 0!==y&&y),z=Z[0],O=Z[1],Y=a(!1),q=Y[0],G=Y[1],J=a(!1),K=J[0],Q=J[1],X=s(function(e){e.stopPropagation(),Q(function(e){return!e})},[]),$=K?S.description:(null!==(N=null===(w=S.description)||void 0===w?void 0:w.length)&&void 0!==N?N:0)>100?S.description.slice(0,100):S.description,ee=S.description.length>100;if(l(function(){var e;O(null!==(e=S.isFavorite)&&void 0!==e&&e)},[S.isFavorite]),l(function(){if(q){var e=window.setTimeout(function(){G(!1)},600);return function(){return window.clearTimeout(e)}}},[q]),P.renderStoryCard)return o(n,{children:P.renderStoryCard(S,{isSelected:R})});var re=s(function(){I({type:"SELECT_STORY",payload:R?null:S.user_story_id}),R||null==A||A(S)},[I,R,S,A]),te=s(function(t){return e(k,void 0,void 0,function(){var e,o;return r(this,function(r){switch(r.label){case 0:return t.stopPropagation(),O(e=!z),e&&G(!0),null==D||D(S,e),o={user_story_title_id:S.storyId,is_favorite:e},[4,M.markFavorite(o)];case 1:return r.sent()||(O(!e),e&&G(!1),null==D||D(S,!e)),[2]}})})},[z,S,D,M]),oe=["usp-card usp-card--story",W&&"usp-card--hovered",q&&"usp-card--favorite-bounce",F.card,j].filter(Boolean).join(" ");return i("div",t({className:oe,style:g,onClick:re,onMouseEnter:function(){return H(!0)},onMouseLeave:function(){return H(!1)},role:"option","aria-selected":R},{children:[i("div",t({className:["usp-card__header",F.cardHeader].filter(Boolean).join(" "),style:B},{children:[o("span",t({className:"usp-card__icon"},{children:P.renderBookmarkIcon?P.renderBookmarkIcon():o(h,{})})),""!==S.storyId&&i("span",t({className:["usp-card__id",F.cardId].filter(Boolean).join(" ")},{children:[S.storyId,":"]})),o(p,t({content:S.title,placement:"top",disabled:U,contentClassName:E},{children:o("span",t({className:["usp-card__title",F.cardTitle].filter(Boolean).join(" "),style:b},{children:S.title}))})),S.isNew&&o(d,{type:"new"}),o("div",t({className:"usp-card__actions"},{children:o(p,t({content:z?"Remove from Shortlist":"Add to Shortlist",placement:"top",disabled:U,contentClassName:E},{children:i("button",t({type:"button",className:["usp-card__heart",z&&"usp-card__heart--active",q&&"usp-card__heart--burst"].filter(Boolean).join(" "),onClick:te,"aria-label":z?"Remove from Shortlist":"Add to Shortlist","aria-pressed":z},{children:[o(m,{filled:z}),i("span",t({className:"usp-card__heart-burst","aria-hidden":"true"},{children:[o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{})]}))]}))}))}))]})),i("div",t({className:["usp-card__project-name",F.cardProjectName].filter(Boolean).join(" ")},{children:[P.renderFolderIcon?P.renderFolderIcon():o(v,{}),S.projectName]})),o("div",t({className:["usp-card-userstory-description",!S.description&&"usp-card__description--empty",F.cardDescription].filter(Boolean).join(" "),style:C},{children:S.description?i(n,{children:[$,ee&&o("button",t({onClick:X,className:["usp-card-moreButton",F.cardViewMore].filter(Boolean).join(" "),"aria-label":K?"Show less":"Show more"},{children:K?"less":"..."}))]}):o("span",t({className:"usp-card__description--placeholder"},{children:"No Description available"}))})),o("div",t({className:"usp-card__meta",style:L},{children:i("span",t({className:["usp-card__date",F.cardDate].filter(Boolean).join(" ")},{children:["Last Updated: ",f(S.lastUpdated)]}))})),o(u,{story:S})]}))}export{_ as UserStoryCard};
1
+ import{__awaiter as e,__generator as r,__assign as t}from"tslib";import{jsx as o,Fragment as n,jsxs as i}from"react/jsx-runtime";import{useState as a,useCallback as s,useEffect as l}from"react";import{useUSPContext as c}from"../UserStoryPicker.context.js";import{Badge as d}from"./Badge.js";import{CardProceedButton as u}from"./CardProceedButton.js";import p from"../lib/CustomTooltip.js";function m(e){var r=e.filled;return o("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:o("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"})}))}function h(){return o("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:o("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function v(){return o("svg",t({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:o("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function f(e){try{var r=e.split(" "),t=r[0],o=r[1],n=void 0===o?"00:00:00":o,i=t.split("/"),a=i[0],s=i[1],l=i[2];if(!a||!s||!l)return e;var c=Number(l)+2e3,d="".concat(c,"-").concat(s,"-").concat(a,"T").concat(n),u=new Date(d);return isNaN(u.getTime())?e:u.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(r){return e}}function _(_){var y,w,N,k=this,S=_.story,j=_.className,g=_.style,B=_.headerStyle,b=_.titleStyle,C=_.descriptionStyle,L=_.metaStyle,T=c(),x=T.state,I=T.dispatch,F=T.classNames,P=T.renderProps,A=T.onStorySelect,D=T.onFavoriteToggle,M=T.adapter,U=T.disableTooltip,E=T.tooltipClassName,R=x.selectedStoryId===S.user_story_id,V=a(!1),W=V[0],H=V[1],Z=a(null!==(y=S.isFavorite)&&void 0!==y&&y),z=Z[0],O=Z[1],Y=a(!1),q=Y[0],G=Y[1],J=a(!1),K=J[0],Q=J[1],X=s(function(e){e.stopPropagation(),Q(function(e){return!e})},[]),$=K?S.description:(null!==(N=null===(w=S.description)||void 0===w?void 0:w.length)&&void 0!==N?N:0)>100?S.description.slice(0,100):S.description,ee=S.description.length>100;if(l(function(){var e;O(null!==(e=S.isFavorite)&&void 0!==e&&e)},[S.isFavorite]),l(function(){if(q){var e=window.setTimeout(function(){G(!1)},600);return function(){return window.clearTimeout(e)}}},[q]),P.renderStoryCard)return o(n,{children:P.renderStoryCard(S,{isSelected:R})});var re=s(function(){I({type:"SELECT_STORY",payload:R?null:S.user_story_id}),R||null==A||A(S)},[I,R,S,A]),te=s(function(t){return e(k,void 0,void 0,function(){var e,o;return r(this,function(r){switch(r.label){case 0:return t.stopPropagation(),O(e=!z),e&&G(!0),null==D||D(S,e),o={user_story_title_id:S.storyId,user_story_id:S.user_story_id,is_favorite:e},[4,M.markFavorite(o)];case 1:return r.sent()||(O(!e),e&&G(!1),null==D||D(S,!e)),[2]}})})},[z,S,D,M]),oe=["usp-card usp-card--story",W&&"usp-card--hovered",q&&"usp-card--favorite-bounce",F.card,j].filter(Boolean).join(" ");return i("div",t({className:oe,style:g,onClick:re,onMouseEnter:function(){return H(!0)},onMouseLeave:function(){return H(!1)},role:"option","aria-selected":R},{children:[i("div",t({className:["usp-card__header",F.cardHeader].filter(Boolean).join(" "),style:B},{children:[o("span",t({className:"usp-card__icon"},{children:P.renderBookmarkIcon?P.renderBookmarkIcon():o(h,{})})),""!==S.storyId&&i("span",t({className:["usp-card__id",F.cardId].filter(Boolean).join(" ")},{children:[S.storyId,":"]})),o(p,t({content:S.title,placement:"top",disabled:U,contentClassName:E},{children:o("span",t({className:["usp-card__title",F.cardTitle].filter(Boolean).join(" "),style:b},{children:S.title}))})),S.isNew&&o(d,{type:"new"}),o("div",t({className:"usp-card__actions"},{children:o(p,t({content:z?"Remove from Shortlist":"Add to Shortlist",placement:"top",disabled:U,contentClassName:E},{children:i("button",t({type:"button",className:["usp-card__heart",z&&"usp-card__heart--active",q&&"usp-card__heart--burst"].filter(Boolean).join(" "),onClick:te,"aria-label":z?"Remove from Shortlist":"Add to Shortlist","aria-pressed":z},{children:[o(m,{filled:z}),i("span",t({className:"usp-card__heart-burst","aria-hidden":"true"},{children:[o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{}),o("span",{})]}))]}))}))}))]})),i("div",t({className:["usp-card__project-name",F.cardProjectName].filter(Boolean).join(" ")},{children:[P.renderFolderIcon?P.renderFolderIcon():o(v,{}),S.projectName]})),o("div",t({className:["usp-card-userstory-description",!S.description&&"usp-card__description--empty",F.cardDescription].filter(Boolean).join(" "),style:C},{children:S.description?i(n,{children:[$,ee&&o("button",t({onClick:X,className:["usp-card-moreButton",F.cardViewMore].filter(Boolean).join(" "),"aria-label":K?"Show less":"Show more"},{children:K?"less":"..."}))]}):o("span",t({className:"usp-card__description--placeholder"},{children:"No Description available"}))})),o("div",t({className:"usp-card__meta",style:L},{children:i("span",t({className:["usp-card__date",F.cardDate].filter(Boolean).join(" ")},{children:["Last Updated: ",f(S.lastUpdated)]}))})),o(u,{story:S})]}))}export{_ as UserStoryCard};
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAA2B,cAAc,EAAE,aAAa,EAAE,MAAM,+EAA+E,CAAC;AAEvJ,QAAA,MAAM,iBAAiB,+CA89DtB,CAAC;AAiVF,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAoH7C,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAoK3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,YACrB,cAAc,EAAE,GAAG,aAAa,EAAE;;;;;CA0B5C,CAAC;AAGF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAA2B,cAAc,EAAE,aAAa,EAAE,MAAM,+EAA+E,CAAC;AAEvJ,QAAA,MAAM,iBAAiB,+CA8tEtB,CAAC;AAiVF,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAoH7C,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAoV3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,YACrB,cAAc,EAAE,GAAG,aAAa,EAAE;;;;;CA0B5C,CAAC;AAGF,eAAe,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/UserStoryImport/components/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AA2ED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,SAAS,GACV,EAAE,qBAAqB,2CA+OvB"}
1
+ {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../src/features/UserStoryImport/components/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACvC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AA2ED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,SAAS,EACT,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,SAAS,GACV,EAAE,qBAAqB,2CAgPvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.76",
3
+ "version": "0.0.77",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",