@e-llm-studio/requirement-ai 0.0.252 → 0.0.253
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/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("showdown"),o=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),r=require("../../utils/userstory-approval.utils.js"),a=require("../../hooks/useApprovalStatus.js"),i=require("./components/ContentSegment/ContentSegment.js"),s=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),u=require("../../icons/CheckIcon.js"),c=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),h=require("../story-screen/BigEnoughPanel.js"),m=require("../../icons/BigEnoughIcon.js"),y=require("@mui/material"),f=require("../../utils/helpers.js"),g=require("../../utils/user-story.utils.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(l);const A={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},C={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},x=Object.assign(({artifactTitleIds:l,config:i={},callbacks:s={},labels:u={},isDisabled:c=!1,children:v,classNames:p,selectedArtifactId:h})=>{var m;const{userStory:y,customStyles:f}=o.useRequirementAI(),g={...A,...i},b={...C,...u},[I,x]=t.useState([]),[j,w]=t.useState(""),[E,k]=t.useState(""),[U,N]=t.useState(!1),[q,T]=t.useState(!0),B=t.useRef(void 0),F=t.useCallback((e,t,l,o)=>{s.onShowNotification?s.onShowNotification(e,t,l,o):console.log(`[${e.toUpperCase()}] ${t}: ${l}`)},[s]),D=t.useCallback(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),M=t.useMemo(()=>{const e=I.findIndex(e=>e.artifactId===j);return e>=0?e:0},[I,j]),R=I[M];t.useEffect(()=>{B.current=R},[R]),t.useEffect(()=>{var e;if(!(null==y?void 0:y.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===y.length&&T(!1),y.length>0&&!j&&w(h||y[0].artifactId);const t=n.createUserStoriesForApproval(n.cloneUserStories(y));x(t)},[y,h]),t.useEffect(()=>{h&&h!==j&&w(h)},[h,j]),t.useEffect(()=>{if(!R)return;const e=r.getFirstNonApprovedSegmentId(R,"");k(e)},[null==R?void 0:R.artifactId]);const P=t.useCallback((e,t)=>{x(l=>{const o=[...l];if("APPROVED"===t.approval_status&&"APPROVED"!==l[e].approval_status){const e=r.getFirstUnapprovedStoryId(l,t.artifactId);e&&w(e)}return o[e]=t,o})},[]),_=t.useCallback(e=>{const t=B.current;if(!t)return;const l=r.getFirstNonApprovedSegmentId(t,e);"NA"!==l&&(k(""),setTimeout(()=>{k(l)},0))},[]);a.useApprovalStatus({userStoryForApproval:I,selectedUserStoryForApproval:R,userStoryIndex:M,callbacks:s,labels:b,onSaveUserStory:P});const z={height:g.containerHeight,...g.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},O={userStoryForApproval:I,setUserStoryForApproval:x,selectedStoryArtifactId:j,setSelectedStoryArtifactId:w,selectedUserStoryIndex:M,selectedUserStoryForApproval:R,currentContentId:E,setCurrentContentId:k,isEditingSegment:U,setIsEditingSegment:N,isSidebarExpanded:q,setIsSidebarExpanded:T,artifactTitleIds:l,config:g,labels:b,callbacks:s,isDisabled:c,handleSaveUserStory:P,handleUpdateContentId:_,showNotification:F,scrollToElement:D};return e.jsx(S.UserStoryApprovalScreenContext.Provider,{value:O,children:e.jsx("div",{className:`${d.default.container} ${(null==p?void 0:p.container)||""}`,style:{...z,...null===(m=null==f?void 0:f.approvalScreen)||void 0===m?void 0:m.wrapperContainer},children:v})})},{Sidebar:({Component:t,config:l,className:o})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingSegment:s,artifactTitleIds:d}=S.useUserStoryApprovalScreen();return t?e.jsx(t,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e.jsx(v.ApprovalSidebar,{config:l,className:o})},SidebarToggle:({OpenIcon:t,CloseIcon:l,className:o=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=S.useUserStoryApprovalScreen(),a=t||p.SidebarOpenIcon,i=l||p.SidebarCloseIcon;return e.jsx("div",{className:`${d.default.sidebarToggleWrapper} ${o}`,children:e.jsx("button",{onClick:()=>r(e=>!e),className:d.default.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:n?e.jsx(i,{}):e.jsx(a,{})})})},Content:({children:l,ButtonComponent:n,hideApproveAll:a=!1,pageTitle:i="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:b,handleOpenSendDialog:A,pageDescription:C="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var x,j,w,E,k,U,N,q,T,B,F,D,M,R,P,_,z,O,W,L,$,V,H,G,Y,J,K,Q,X,Z,ee;const{selectedUserStoryForApproval:te,selectedUserStoryIndex:le,artifactTitleIds:oe,labels:ne,config:re,isDisabled:ae,isEditingSegment:ie,handleSaveUserStory:se,setCurrentContentId:de,showNotification:ue}=S.useUserStoryApprovalScreen(),{userStory:ce,setUserStory:ve}=o.useRequirementAI(),pe=ce[0],[Se,he]=t.useState(null),me=()=>{he(null)},ye=t.useRef(null),[fe,ge]=t.useState(!1),{customStyles:be,customIcons:Ie}=o.useRequirementAI(),Ae=null==be?void 0:be.userStoryCardStyles,[Ce,xe]=t.useState(!1),je=t.useCallback(()=>{if(!te)return;if(ie)return void ue("warn","Warning!",ne.unsavedChangesWarning,3e3);const e=r.approveAllSegments(te);se(le,e),de("")},[te,le,ie,ne,se,de,ue]);if(!te)return null;const we=oe[le]||"",Ee="APPROVED"===te.approval_status,ke=null!=(null==te?void 0:te.big_enough)&&!Number.isNaN(te.big_enough)&&!!(null==te?void 0:te.big_enough_decision_factors);return e.jsxs("div",{className:d.default.content,style:{...null===(j=null===(x=null==be?void 0:be.approvalScreen)||void 0===x?void 0:x.content)||void 0===j?void 0:j.content},"data-lsc-ui-page-title":i,"data-lsc-ui-page-description":C,children:[e.jsxs("div",{className:d.default.header,style:{...null===(k=null===(E=null===(w=null==be?void 0:be.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===k?void 0:k.header},children:[e.jsxs("div",{className:d.default.headerLeft,style:{...null===(N=null===(U=null==be?void 0:be.approvalScreen)||void 0===U?void 0:U.content)||void 0===N?void 0:N.headerLeft},children:[e.jsxs("div",{className:d.default.headerMeta,style:{...null===(B=null===(T=null===(q=null==be?void 0:be.approvalScreen)||void 0===q?void 0:q.body)||void 0===T?void 0:T.contentSegment)||void 0===B?void 0:B.headerMeta},children:[e.jsx(c.BookmarkIcon,{size:16,color:(null===(M=null===(D=null===(F=null==be?void 0:be.approvalScreen)||void 0===F?void 0:F.body)||void 0===D?void 0:D.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),e.jsx("h2",{className:d.default.headerArtifactId,style:{...null===(_=null===(P=null===(R=null==be?void 0:be.approvalScreen)||void 0===R?void 0:R.body)||void 0===P?void 0:P.contentSegment)||void 0===_?void 0:_.headerArtifactId},children:we})]}),e.jsx("p",{className:d.default.headerTitle,style:{...null===(W=null===(O=null===(z=null==be?void 0:be.approvalScreen)||void 0===z?void 0:z.body)||void 0===O?void 0:O.contentSegment)||void 0===W?void 0:W.headerTitle},children:null==te?void 0:te.title})]}),e.jsxs("div",{className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===($=null===(L=null==be?void 0:be.approvalScreen)||void 0===L?void 0:L.BigEnoughStyles)||void 0===$?void 0:$.containerStyle,children:[ke&&e.jsx("button",{className:d.default.developerEffortButton,style:null===(H=null===(V=null==be?void 0:be.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles)||void 0===H?void 0:H.buttonStyle,onClick:()=>xe(!Ce),children:e.jsx(m.default,{color:null===(Y=null===(G=null==be?void 0:be.approvalScreen)||void 0===G?void 0:G.BigEnoughStyles)||void 0===Y?void 0:Y.iconColor,size:null===(K=null===(J=null==be?void 0:be.approvalScreen)||void 0===J?void 0:J.BigEnoughStyles)||void 0===K?void 0:K.iconSize})}),v&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:d.default.iconButton,style:null==Ae?void 0:Ae.iconButton,onClick:e=>{he(e.currentTarget)},children:e.jsx(p.ExternalLink,{size:16})}),e.jsxs(y.Menu,{id:"user-story-share-menu",anchorEl:Se,open:!!Se,onClose:()=>he(null),style:null==Ae?void 0:Ae.userStoryShareMenu,children:[e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{ge(!0),b&&(await Promise.all([b("pdf"),b("doc")]),ge(!1))},children:e.jsxs("div",{ref:ye,className:d.default.menuItemContent,style:null==Ae?void 0:Ae.menuItemContent,children:[e.jsx(p.Download,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Download"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{let e=pe;e={...pe,value:`${g.replaceTitleSection(null==pe?void 0:pe.value,pe.title)}`},null==A||A(!0,[e],pe.artifactId),me()},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Share2,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Send"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{const e=(new I.default.Converter).makeHtml(f.formatMarkdown(pe.value)||pe.value),t=function(e){const t=(new I.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(f.formatMarkdown(pe.value)||pe.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{me()}},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Copy,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Copy"})]})})]})]}),!a&&re.showApproveAllButton&&e.jsx("div",{className:d.default.headerRight,children:Ee?e.jsx(s.ApprovalBadge,{status:"APPROVED",label:ne.approved}):n?e.jsx(n,{type:"fill",onClick:je,isDisable:ae,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ne.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:e.jsxs("div",{className:d.default.approveAllContent,children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})}):e.jsxs("button",{onClick:je,disabled:ae,className:d.default.approveAllButtonDefault,style:{...null===(X=null===(Q=null==be?void 0:be.approvalScreen)||void 0===Q?void 0:Q.content)||void 0===X?void 0:X.approveAllButtonDefault},children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})]})]}),Ce&&ke&&e.jsx("div",{className:d.default.bigEnoughWrapper,children:e.jsx(h.BigEnoughPanel,{customIcons:null==Ie?void 0:Ie.userStoryIcons,customStyles:null===(Z=null==be?void 0:be.approvalScreen)||void 0===Z?void 0:Z.aiReasoningCitaionStyles,currentUserStory:te,panelStyles:null===(ee=null==be?void 0:be.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles,showPanel:Ce})}),l]})},Body:({children:l,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u=!1})=>{var c,v,p;const{selectedUserStoryForApproval:h,selectedUserStoryIndex:m,artifactTitleIds:y,handleSaveUserStory:f}=S.useUserStoryApprovalScreen(),{customStyles:g}=o.useRequirementAI(),b=t.useCallback(e=>{f(m,e)},[m,f]),I=t.useCallback((e,t)=>{var l;if(!h)return;const o={...h,sub_features:null===(l=h.sub_features)||void 0===l?void 0:l.map((l,o)=>o===e?t:l)};f(m,o)},[h,m,f]),A=t.useCallback(e=>{var t;if(!h)return;const l={...h,sub_features:null===(t=h.sub_features)||void 0===t?void 0:t.filter((t,l)=>l!==e)};f(m,l)},[h,m,f]);if(!h)return null;const C=y[m]||"";return e.jsxs("div",{className:d.default.body,style:{...null===(v=null===(c=null==g?void 0:g.approvalScreen)||void 0===c?void 0:c.body)||void 0===v?void 0:v.container},children:[e.jsx(i.ContentSegment,{userStoryForApproval:h,artifactTitleId:C,onSaveMainStoryContent:b,EditorComponent:n,ViewerComponent:r}),null===(p=h.sub_features)||void 0===p?void 0:p.map((t,l)=>e.jsx(i.ContentSegment,{userStoryForApproval:t,artifactTitleId:`${C} - ${String.fromCharCode(65+l)}`,isSubFeature:!0,subFeatureIndex:l,onSaveSubFeature:I,onDeleteSubFeature:A,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u},t.artifactId)),l]})}});exports.default=x;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("showdown"),o=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),r=require("../../utils/userstory-approval.utils.js"),a=require("../../hooks/useApprovalStatus.js"),i=require("./components/ContentSegment/ContentSegment.js"),s=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),u=require("../../icons/CheckIcon.js"),c=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),h=require("../story-screen/BigEnoughPanel.js"),m=require("../../icons/BigEnoughIcon.js"),y=require("@mui/material"),f=require("../../utils/helpers.js"),g=require("../../utils/user-story.utils.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=b(l);const x={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},A={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},C=Object.assign(({artifactTitleIds:l,config:i={},callbacks:s={},labels:u={},isDisabled:c=!1,disabledReason:v="",children:p,classNames:h,selectedArtifactId:m})=>{var y;const{userStory:f,customStyles:g}=o.useRequirementAI(),b={...x,...i},I={...A,...u},[C,j]=t.useState([]),[w,E]=t.useState(""),[k,U]=t.useState(""),[N,q]=t.useState(!1),[T,B]=t.useState(!0),F=t.useRef(void 0),D=t.useCallback((e,t,l,o)=>{s.onShowNotification?s.onShowNotification(e,t,l,o):console.log(`[${e.toUpperCase()}] ${t}: ${l}`)},[s]),M=t.useCallback(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),R=t.useMemo(()=>{const e=C.findIndex(e=>e.artifactId===w);return e>=0?e:0},[C,w]),P=C[R];t.useEffect(()=>{F.current=P},[P]),t.useEffect(()=>{var e;if(!(null==f?void 0:f.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===f.length&&B(!1),f.length>0&&!w&&E(m||f[0].artifactId);const t=n.createUserStoriesForApproval(n.cloneUserStories(f));j(t)},[f,m]),t.useEffect(()=>{m&&m!==w&&E(m)},[m,w]),t.useEffect(()=>{if(!P)return;const e=r.getFirstNonApprovedSegmentId(P,"");U(e)},[null==P?void 0:P.artifactId]);const _=t.useCallback((e,t)=>{j(l=>{const o=[...l];if("APPROVED"===t.approval_status&&"APPROVED"!==l[e].approval_status){const e=r.getFirstUnapprovedStoryId(l,t.artifactId);e&&E(e)}return o[e]=t,o})},[]),z=t.useCallback(e=>{const t=F.current;if(!t)return;const l=r.getFirstNonApprovedSegmentId(t,e);"NA"!==l&&(U(""),setTimeout(()=>{U(l)},0))},[]);a.useApprovalStatus({userStoryForApproval:C,selectedUserStoryForApproval:P,userStoryIndex:R,callbacks:s,labels:I,onSaveUserStory:_});const O={height:b.containerHeight,...b.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},W={userStoryForApproval:C,setUserStoryForApproval:j,selectedStoryArtifactId:w,setSelectedStoryArtifactId:E,selectedUserStoryIndex:R,selectedUserStoryForApproval:P,currentContentId:k,setCurrentContentId:U,isEditingSegment:N,setIsEditingSegment:q,isSidebarExpanded:T,setIsSidebarExpanded:B,artifactTitleIds:l,config:b,labels:I,callbacks:s,isDisabled:c,disabledReason:v,handleSaveUserStory:_,handleUpdateContentId:z,showNotification:D,scrollToElement:M};return e.jsx(S.UserStoryApprovalScreenContext.Provider,{value:W,children:e.jsx("div",{className:`${d.default.container} ${(null==h?void 0:h.container)||""}`,style:{...O,...null===(y=null==g?void 0:g.approvalScreen)||void 0===y?void 0:y.wrapperContainer},children:p})})},{Sidebar:({Component:t,config:l,className:o})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingSegment:s,artifactTitleIds:d}=S.useUserStoryApprovalScreen();return t?e.jsx(t,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:a,userStoryForApproval:i,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e.jsx(v.ApprovalSidebar,{config:l,className:o})},SidebarToggle:({OpenIcon:t,CloseIcon:l,className:o=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=S.useUserStoryApprovalScreen(),a=t||p.SidebarOpenIcon,i=l||p.SidebarCloseIcon;return e.jsx("div",{className:`${d.default.sidebarToggleWrapper} ${o}`,children:e.jsx("button",{onClick:()=>r(e=>!e),className:d.default.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:n?e.jsx(i,{}):e.jsx(a,{})})})},Content:({children:l,ButtonComponent:n,hideApproveAll:a=!1,pageTitle:i="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:b,handleOpenSendDialog:x,pageDescription:A="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var C,j,w,E,k,U,N,q,T,B,F,D,M,R,P,_,z,O,W,L,$,V,H,G,Y,J,K,Q,X,Z,ee;const{selectedUserStoryForApproval:te,selectedUserStoryIndex:le,artifactTitleIds:oe,labels:ne,config:re,isDisabled:ae,disabledReason:ie,isEditingSegment:se,handleSaveUserStory:de,setCurrentContentId:ue,showNotification:ce}=S.useUserStoryApprovalScreen(),{userStory:ve,setUserStory:pe}=o.useRequirementAI(),Se=ve[0],[he,me]=t.useState(null),ye=()=>{me(null)},fe=t.useRef(null),[ge,be]=t.useState(!1),{customStyles:Ie,customIcons:xe}=o.useRequirementAI(),Ae=null==Ie?void 0:Ie.userStoryCardStyles,[Ce,je]=t.useState(!1),we=t.useCallback(()=>{if(!te)return;if(se)return void ce("warn","Warning!",ne.unsavedChangesWarning,3e3);const e=r.approveAllSegments(te);de(le,e),ue("")},[te,le,se,ne,de,ue,ce]);if(!te)return null;const Ee=oe[le]||"",ke="APPROVED"===te.approval_status,Ue=ae?ie:"",Ne=null!=(null==te?void 0:te.big_enough)&&!Number.isNaN(te.big_enough)&&!!(null==te?void 0:te.big_enough_decision_factors);return e.jsxs("div",{className:d.default.content,style:{...null===(j=null===(C=null==Ie?void 0:Ie.approvalScreen)||void 0===C?void 0:C.content)||void 0===j?void 0:j.content},"data-lsc-ui-page-title":i,"data-lsc-ui-page-description":A,children:[e.jsxs("div",{className:d.default.header,style:{...null===(k=null===(E=null===(w=null==Ie?void 0:Ie.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===k?void 0:k.header},children:[e.jsxs("div",{className:d.default.headerLeft,style:{...null===(N=null===(U=null==Ie?void 0:Ie.approvalScreen)||void 0===U?void 0:U.content)||void 0===N?void 0:N.headerLeft},children:[e.jsxs("div",{className:d.default.headerMeta,style:{...null===(B=null===(T=null===(q=null==Ie?void 0:Ie.approvalScreen)||void 0===q?void 0:q.body)||void 0===T?void 0:T.contentSegment)||void 0===B?void 0:B.headerMeta},children:[e.jsx(c.BookmarkIcon,{size:16,color:(null===(M=null===(D=null===(F=null==Ie?void 0:Ie.approvalScreen)||void 0===F?void 0:F.body)||void 0===D?void 0:D.contentSegment)||void 0===M?void 0:M.bookMarkColor)||"#8C8C8C"}),e.jsx("h2",{className:d.default.headerArtifactId,style:{...null===(_=null===(P=null===(R=null==Ie?void 0:Ie.approvalScreen)||void 0===R?void 0:R.body)||void 0===P?void 0:P.contentSegment)||void 0===_?void 0:_.headerArtifactId},children:Ee})]}),e.jsx("p",{className:d.default.headerTitle,style:{...null===(W=null===(O=null===(z=null==Ie?void 0:Ie.approvalScreen)||void 0===z?void 0:z.body)||void 0===O?void 0:O.contentSegment)||void 0===W?void 0:W.headerTitle},children:null==te?void 0:te.title})]}),e.jsxs("div",{className:null===d.default||void 0===d.default?void 0:d.default.containerStyle,style:null===($=null===(L=null==Ie?void 0:Ie.approvalScreen)||void 0===L?void 0:L.BigEnoughStyles)||void 0===$?void 0:$.containerStyle,children:[Ne&&e.jsx("button",{className:d.default.developerEffortButton,style:null===(H=null===(V=null==Ie?void 0:Ie.approvalScreen)||void 0===V?void 0:V.BigEnoughStyles)||void 0===H?void 0:H.buttonStyle,onClick:()=>je(!Ce),children:e.jsx(m.default,{color:null===(Y=null===(G=null==Ie?void 0:Ie.approvalScreen)||void 0===G?void 0:G.BigEnoughStyles)||void 0===Y?void 0:Y.iconColor,size:null===(K=null===(J=null==Ie?void 0:Ie.approvalScreen)||void 0===J?void 0:J.BigEnoughStyles)||void 0===K?void 0:K.iconSize})}),v&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:d.default.iconButton,style:null==Ae?void 0:Ae.iconButton,onClick:e=>{me(e.currentTarget)},children:e.jsx(p.ExternalLink,{size:16})}),e.jsxs(y.Menu,{id:"user-story-share-menu",anchorEl:he,open:!!he,onClose:()=>me(null),style:null==Ae?void 0:Ae.userStoryShareMenu,children:[e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{be(!0),b&&(await Promise.all([b("pdf"),b("doc")]),be(!1))},children:e.jsxs("div",{ref:fe,className:d.default.menuItemContent,style:null==Ae?void 0:Ae.menuItemContent,children:[e.jsx(p.Download,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Download"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{let e=Se;e={...Se,value:`${g.replaceTitleSection(null==Se?void 0:Se.value,Se.title)}`},null==x||x(!0,[e],Se.artifactId),ye()},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Share2,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Send"})]})}),e.jsx(y.MenuItem,{style:null==Ae?void 0:Ae.userStoryMenuItem,onClick:async()=>{const e=(new I.default.Converter).makeHtml(f.formatMarkdown(Se.value)||Se.value),t=function(e){const t=(new I.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(f.formatMarkdown(Se.value)||Se.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{ye()}},children:e.jsxs("div",{style:null==Ae?void 0:Ae.menuItemContent,className:d.default.menuItemContentPadded,children:[e.jsx(p.Copy,{size:16,color:null==Ae?void 0:Ae.menuIconColor}),e.jsx("p",{style:null==Ae?void 0:Ae.menuLabel,children:"Copy"})]})})]})]}),!a&&re.showApproveAllButton&&e.jsx("div",{className:d.default.headerRight,children:ke?e.jsx(s.ApprovalBadge,{status:"APPROVED",label:ne.approved}):n?e.jsx(y.Tooltip,{title:Ue,children:e.jsx("span",{children:e.jsx(n,{type:"fill",onClick:we,isDisable:ae,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ne.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:e.jsxs("div",{className:d.default.approveAllContent,children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})})}):e.jsx(y.Tooltip,{title:Ue,children:e.jsx("span",{children:e.jsxs("button",{onClick:we,disabled:ae,className:d.default.approveAllButtonDefault,style:{...null===(X=null===(Q=null==Ie?void 0:Ie.approvalScreen)||void 0===Q?void 0:Q.content)||void 0===X?void 0:X.approveAllButtonDefault},children:[e.jsx(u.CheckIcon,{size:16,color:"white"}),e.jsx("span",{children:ne.approveAll})]})})})})]})]}),Ce&&Ne&&e.jsx("div",{className:d.default.bigEnoughWrapper,children:e.jsx(h.BigEnoughPanel,{customIcons:null==xe?void 0:xe.userStoryIcons,customStyles:null===(Z=null==Ie?void 0:Ie.approvalScreen)||void 0===Z?void 0:Z.aiReasoningCitaionStyles,currentUserStory:te,panelStyles:null===(ee=null==Ie?void 0:Ie.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles,showPanel:Ce})}),l]})},Body:({children:l,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u=!1})=>{var c,v,p;const{selectedUserStoryForApproval:h,selectedUserStoryIndex:m,artifactTitleIds:y,handleSaveUserStory:f}=S.useUserStoryApprovalScreen(),{customStyles:g}=o.useRequirementAI(),b=t.useCallback(e=>{f(m,e)},[m,f]),I=t.useCallback((e,t)=>{var l;if(!h)return;const o={...h,sub_features:null===(l=h.sub_features)||void 0===l?void 0:l.map((l,o)=>o===e?t:l)};f(m,o)},[h,m,f]),x=t.useCallback(e=>{var t;if(!h)return;const l={...h,sub_features:null===(t=h.sub_features)||void 0===t?void 0:t.filter((t,l)=>l!==e)};f(m,l)},[h,m,f]);if(!h)return null;const A=y[m]||"";return e.jsxs("div",{className:d.default.body,style:{...null===(v=null===(c=null==g?void 0:g.approvalScreen)||void 0===c?void 0:c.body)||void 0===v?void 0:v.container},children:[e.jsx(i.ContentSegment,{userStoryForApproval:h,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:n,ViewerComponent:r}),null===(p=h.sub_features)||void 0===p?void 0:p.map((t,l)=>e.jsx(i.ContentSegment,{userStoryForApproval:t,artifactTitleId:`${A} - ${String.fromCharCode(65+l)}`,isSubFeature:!0,subFeatureIndex:l,onSaveSubFeature:I,onDeleteSubFeature:x,EditorComponent:n,ViewerComponent:r,handleDownloadUserStory:a,handleOpenSendDialog:s,showShareIcon:u},t.artifactId)),l]})}});exports.default=C;
|
|
2
2
|
//# sourceMappingURL=UserStoryApprovalScreen.js.map
|
package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{useState as l,useRef as n,useCallback as r,useMemo as i,useEffect as a}from"react";import s from"showdown";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as u}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as v,getFirstUnapprovedStoryId as p,approveAllSegments as m}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as h}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as y}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as f}from"../../icons/CheckIcon.js";import{BookmarkIcon as b}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as I}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as C,Download as A,Share2 as w,Copy as E,SidebarOpenIcon as N,SidebarCloseIcon as U}from"lucide-react";import{UserStoryApprovalScreenContext as x,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as k}from"../story-screen/BigEnoughPanel.js";import B from"../../icons/BigEnoughIcon.js";import{Menu as D,MenuItem as F}from"@mui/material";import{formatMarkdown as j}from"../../utils/helpers.js";import{replaceTitleSection as P}from"../../utils/user-story.utils.js";const M={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},_={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},R=Object.assign(({artifactTitleIds:o,config:t={},callbacks:s={},labels:m={},isDisabled:S=!1,children:y,classNames:f,selectedArtifactId:b})=>{var I;const{userStory:C,customStyles:A}=d(),w={...M,...t},E={..._,...m},[N,U]=l([]),[T,k]=l(""),[B,D]=l(""),[F,j]=l(!1),[P,R]=l(!0),z=n(void 0),W=r((e,o,t,l)=>{s.onShowNotification?s.onShowNotification(e,o,t,l):console.log(`[${e.toUpperCase()}] ${o}: ${t}`)},[s]),$=r(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),L=i(()=>{const e=N.findIndex(e=>e.artifactId===T);return e>=0?e:0},[N,T]),O=N[L];a(()=>{z.current=O},[O]),a(()=>{var e;if(!(null==C?void 0:C.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===C.length&&R(!1),C.length>0&&!T&&k(b||C[0].artifactId);const o=c(u(C));U(o)},[C,b]),a(()=>{b&&b!==T&&k(b)},[b,T]),a(()=>{if(!O)return;const e=v(O,"");D(e)},[null==O?void 0:O.artifactId]);const V=r((e,o)=>{U(t=>{const l=[...t];if("APPROVED"===o.approval_status&&"APPROVED"!==t[e].approval_status){const e=p(t,o.artifactId);e&&k(e)}return l[e]=o,l})},[]),q=r(e=>{const o=z.current;if(!o)return;const t=v(o,e);"NA"!==t&&(D(""),setTimeout(()=>{D(t)},0))},[]);h({userStoryForApproval:N,selectedUserStoryForApproval:O,userStoryIndex:L,callbacks:s,labels:E,onSaveUserStory:V});const H={height:w.containerHeight,...w.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},G={userStoryForApproval:N,setUserStoryForApproval:U,selectedStoryArtifactId:T,setSelectedStoryArtifactId:k,selectedUserStoryIndex:L,selectedUserStoryForApproval:O,currentContentId:B,setCurrentContentId:D,isEditingSegment:F,setIsEditingSegment:j,isSidebarExpanded:P,setIsSidebarExpanded:R,artifactTitleIds:o,config:w,labels:E,callbacks:s,isDisabled:S,handleSaveUserStory:V,handleUpdateContentId:q,showNotification:W,scrollToElement:$};return e(x.Provider,{value:G,children:e("div",{className:`${g.container} ${(null==f?void 0:f.container)||""}`,style:{...H,...null===(I=null==A?void 0:A.approvalScreen)||void 0===I?void 0:I.wrapperContainer},children:y})})},{Sidebar:({Component:o,config:t,className:l})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingSegment:s,artifactTitleIds:d}=T();return o?e(o,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e(I,{config:t,className:l})},SidebarToggle:({OpenIcon:o,CloseIcon:t,className:l=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=T(),i=o||N,a=t||U;return e("div",{className:`${g.sidebarToggleWrapper} ${l}`,children:e("button",{onClick:()=>r(e=>!e),className:g.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:e(n?a:i,{})})})},Content:({children:i,ButtonComponent:a,hideApproveAll:c=!1,pageTitle:u="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:p,handleOpenSendDialog:h,pageDescription:S="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var I,N,U,x,M,_,R,z,W,$,L,O,V,q,H,G,Y,J,K,Q,X,Z,ee,oe,te,le,ne,re,ie,ae,se;const{selectedUserStoryForApproval:de,selectedUserStoryIndex:ce,artifactTitleIds:ue,labels:ve,config:pe,isDisabled:me,isEditingSegment:he,handleSaveUserStory:Se,setCurrentContentId:ye,showNotification:ge}=T(),{userStory:fe,setUserStory:be}=d(),Ie=fe[0],[Ce,Ae]=l(null),we=()=>{Ae(null)},Ee=n(null),[Ne,Ue]=l(!1),{customStyles:xe,customIcons:Te}=d(),ke=null==xe?void 0:xe.userStoryCardStyles,[Be,De]=l(!1),Fe=r(()=>{if(!de)return;if(he)return void ge("warn","Warning!",ve.unsavedChangesWarning,3e3);const e=m(de);Se(ce,e),ye("")},[de,ce,he,ve,Se,ye,ge]);if(!de)return null;const je=ue[ce]||"",Pe="APPROVED"===de.approval_status,Me=null!=(null==de?void 0:de.big_enough)&&!Number.isNaN(de.big_enough)&&!!(null==de?void 0:de.big_enough_decision_factors);return o("div",{className:g.content,style:{...null===(N=null===(I=null==xe?void 0:xe.approvalScreen)||void 0===I?void 0:I.content)||void 0===N?void 0:N.content},"data-lsc-ui-page-title":u,"data-lsc-ui-page-description":S,children:[o("div",{className:g.header,style:{...null===(M=null===(x=null===(U=null==xe?void 0:xe.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===M?void 0:M.header},children:[o("div",{className:g.headerLeft,style:{...null===(R=null===(_=null==xe?void 0:xe.approvalScreen)||void 0===_?void 0:_.content)||void 0===R?void 0:R.headerLeft},children:[o("div",{className:g.headerMeta,style:{...null===($=null===(W=null===(z=null==xe?void 0:xe.approvalScreen)||void 0===z?void 0:z.body)||void 0===W?void 0:W.contentSegment)||void 0===$?void 0:$.headerMeta},children:[e(b,{size:16,color:(null===(V=null===(O=null===(L=null==xe?void 0:xe.approvalScreen)||void 0===L?void 0:L.body)||void 0===O?void 0:O.contentSegment)||void 0===V?void 0:V.bookMarkColor)||"#8C8C8C"}),e("h2",{className:g.headerArtifactId,style:{...null===(G=null===(H=null===(q=null==xe?void 0:xe.approvalScreen)||void 0===q?void 0:q.body)||void 0===H?void 0:H.contentSegment)||void 0===G?void 0:G.headerArtifactId},children:je})]}),e("p",{className:g.headerTitle,style:{...null===(K=null===(J=null===(Y=null==xe?void 0:xe.approvalScreen)||void 0===Y?void 0:Y.body)||void 0===J?void 0:J.contentSegment)||void 0===K?void 0:K.headerTitle},children:null==de?void 0:de.title})]}),o("div",{className:null==g?void 0:g.containerStyle,style:null===(X=null===(Q=null==xe?void 0:xe.approvalScreen)||void 0===Q?void 0:Q.BigEnoughStyles)||void 0===X?void 0:X.containerStyle,children:[Me&&e("button",{className:g.developerEffortButton,style:null===(ee=null===(Z=null==xe?void 0:xe.approvalScreen)||void 0===Z?void 0:Z.BigEnoughStyles)||void 0===ee?void 0:ee.buttonStyle,onClick:()=>De(!Be),children:e(B,{color:null===(te=null===(oe=null==xe?void 0:xe.approvalScreen)||void 0===oe?void 0:oe.BigEnoughStyles)||void 0===te?void 0:te.iconColor,size:null===(ne=null===(le=null==xe?void 0:xe.approvalScreen)||void 0===le?void 0:le.BigEnoughStyles)||void 0===ne?void 0:ne.iconSize})}),v&&o(t,{children:[e("button",{className:g.iconButton,style:null==ke?void 0:ke.iconButton,onClick:e=>{Ae(e.currentTarget)},children:e(C,{size:16})}),o(D,{id:"user-story-share-menu",anchorEl:Ce,open:!!Ce,onClose:()=>Ae(null),style:null==ke?void 0:ke.userStoryShareMenu,children:[e(F,{style:null==ke?void 0:ke.userStoryMenuItem,onClick:async()=>{Ue(!0),p&&(await Promise.all([p("pdf"),p("doc")]),Ue(!1))},children:o("div",{ref:Ee,className:g.menuItemContent,style:null==ke?void 0:ke.menuItemContent,children:[e(A,{size:16,color:null==ke?void 0:ke.menuIconColor}),e("p",{style:null==ke?void 0:ke.menuLabel,children:"Download"})]})}),e(F,{style:null==ke?void 0:ke.userStoryMenuItem,onClick:async()=>{let e=Ie;e={...Ie,value:`${P(null==Ie?void 0:Ie.value,Ie.title)}`},null==h||h(!0,[e],Ie.artifactId),we()},children:o("div",{style:null==ke?void 0:ke.menuItemContent,className:g.menuItemContentPadded,children:[e(w,{size:16,color:null==ke?void 0:ke.menuIconColor}),e("p",{style:null==ke?void 0:ke.menuLabel,children:"Send"})]})}),e(F,{style:null==ke?void 0:ke.userStoryMenuItem,onClick:async()=>{const e=(new s.Converter).makeHtml(j(Ie.value)||Ie.value),o=function(e){const o=(new s.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(j(Ie.value)||Ie.value),t=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([t]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{we()}},children:o("div",{style:null==ke?void 0:ke.menuItemContent,className:g.menuItemContentPadded,children:[e(E,{size:16,color:null==ke?void 0:ke.menuIconColor}),e("p",{style:null==ke?void 0:ke.menuLabel,children:"Copy"})]})})]})]}),!c&&pe.showApproveAllButton&&e("div",{className:g.headerRight,children:Pe?e(y,{status:"APPROVED",label:ve.approved}):a?e(a,{type:"fill",onClick:Fe,isDisable:me,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:ve.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:o("div",{className:g.approveAllContent,children:[e(f,{size:16,color:"white"}),e("span",{children:ve.approveAll})]})}):o("button",{onClick:Fe,disabled:me,className:g.approveAllButtonDefault,style:{...null===(ie=null===(re=null==xe?void 0:xe.approvalScreen)||void 0===re?void 0:re.content)||void 0===ie?void 0:ie.approveAllButtonDefault},children:[e(f,{size:16,color:"white"}),e("span",{children:ve.approveAll})]})})]})]}),Be&&Me&&e("div",{className:g.bigEnoughWrapper,children:e(k,{customIcons:null==Te?void 0:Te.userStoryIcons,customStyles:null===(ae=null==xe?void 0:xe.approvalScreen)||void 0===ae?void 0:ae.aiReasoningCitaionStyles,currentUserStory:de,panelStyles:null===(se=null==xe?void 0:xe.approvalScreen)||void 0===se?void 0:se.BigEnoughStyles,showPanel:Be})}),i]})},Body:({children:t,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s=!1})=>{var c,u,v;const{selectedUserStoryForApproval:p,selectedUserStoryIndex:m,artifactTitleIds:h,handleSaveUserStory:y}=T(),{customStyles:f}=d(),b=r(e=>{y(m,e)},[m,y]),I=r((e,o)=>{var t;if(!p)return;const l={...p,sub_features:null===(t=p.sub_features)||void 0===t?void 0:t.map((t,l)=>l===e?o:t)};y(m,l)},[p,m,y]),C=r(e=>{var o;if(!p)return;const t={...p,sub_features:null===(o=p.sub_features)||void 0===o?void 0:o.filter((o,t)=>t!==e)};y(m,t)},[p,m,y]);if(!p)return null;const A=h[m]||"";return o("div",{className:g.body,style:{...null===(u=null===(c=null==f?void 0:f.approvalScreen)||void 0===c?void 0:c.body)||void 0===u?void 0:u.container},children:[e(S,{userStoryForApproval:p,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:l,ViewerComponent:n}),null===(v=p.sub_features)||void 0===v?void 0:v.map((o,t)=>e(S,{userStoryForApproval:o,artifactTitleId:`${A} - ${String.fromCharCode(65+t)}`,isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:I,onDeleteSubFeature:C,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s},o.artifactId)),t]})}});export{R as default};
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{useState as l,useRef as n,useCallback as r,useMemo as i,useEffect as a}from"react";import s from"showdown";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as u}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as v,getFirstUnapprovedStoryId as p,approveAllSegments as m}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as h}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as y}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as f}from"../../icons/CheckIcon.js";import{BookmarkIcon as b}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as I}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{ExternalLink as C,Download as A,Share2 as w,Copy as E,SidebarOpenIcon as N,SidebarCloseIcon as U}from"lucide-react";import{UserStoryApprovalScreenContext as x,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";import{BigEnoughPanel as k}from"../story-screen/BigEnoughPanel.js";import B from"../../icons/BigEnoughIcon.js";import{Menu as D,MenuItem as F,Tooltip as j}from"@mui/material";import{formatMarkdown as P}from"../../utils/helpers.js";import{replaceTitleSection as R}from"../../utils/user-story.utils.js";const M={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},_={approveAll:"Approve All",approved:"Approved",approve:"Approve",correctMe:"Correct Me",delete:"Delete",save:"Save",cancel:"Cancel",savingArtifact:"Saving Artifact...",artifactSavedTitle:"Artifact Saved Successfully",artifactSavedMessage:"Your changes have been saved.",saveFailedTitle:"Failed to Save the Artifact",saveFailedMessage:"An error occurred while saving your changes.",emptyContentWarning:"Saving empty content is not allowed",unsavedChangesWarning:"Please save the updated changes to proceed with Approve All"},z=Object.assign(({artifactTitleIds:o,config:t={},callbacks:s={},labels:m={},isDisabled:S=!1,disabledReason:y="",children:f,classNames:b,selectedArtifactId:I})=>{var C;const{userStory:A,customStyles:w}=d(),E={...M,...t},N={..._,...m},[U,T]=l([]),[k,B]=l(""),[D,F]=l(""),[j,P]=l(!1),[R,z]=l(!0),W=n(void 0),$=r((e,o,t,l)=>{s.onShowNotification?s.onShowNotification(e,o,t,l):console.log(`[${e.toUpperCase()}] ${o}: ${t}`)},[s]),L=r(e=>{s.onScrollToElement?s.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[s]),O=i(()=>{const e=U.findIndex(e=>e.artifactId===k);return e>=0?e:0},[U,k]),V=U[O];a(()=>{W.current=V},[V]),a(()=>{var e;if(!(null==A?void 0:A.length))return;null===(e=s.onInitialize)||void 0===e||e.call(s),1===A.length&&z(!1),A.length>0&&!k&&B(I||A[0].artifactId);const o=c(u(A));T(o)},[A,I]),a(()=>{I&&I!==k&&B(I)},[I,k]),a(()=>{if(!V)return;const e=v(V,"");F(e)},[null==V?void 0:V.artifactId]);const q=r((e,o)=>{T(t=>{const l=[...t];if("APPROVED"===o.approval_status&&"APPROVED"!==t[e].approval_status){const e=p(t,o.artifactId);e&&B(e)}return l[e]=o,l})},[]),H=r(e=>{const o=W.current;if(!o)return;const t=v(o,e);"NA"!==t&&(F(""),setTimeout(()=>{F(t)},0))},[]);h({userStoryForApproval:U,selectedUserStoryForApproval:V,userStoryIndex:O,callbacks:s,labels:N,onSaveUserStory:q});const G={height:E.containerHeight,...E.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}},Y={userStoryForApproval:U,setUserStoryForApproval:T,selectedStoryArtifactId:k,setSelectedStoryArtifactId:B,selectedUserStoryIndex:O,selectedUserStoryForApproval:V,currentContentId:D,setCurrentContentId:F,isEditingSegment:j,setIsEditingSegment:P,isSidebarExpanded:R,setIsSidebarExpanded:z,artifactTitleIds:o,config:E,labels:N,callbacks:s,isDisabled:S,disabledReason:y,handleSaveUserStory:q,handleUpdateContentId:H,showNotification:$,scrollToElement:L};return e(x.Provider,{value:Y,children:e("div",{className:`${g.container} ${(null==b?void 0:b.container)||""}`,style:{...G,...null===(C=null==w?void 0:w.approvalScreen)||void 0===C?void 0:C.wrapperContainer},children:f})})},{Sidebar:({Component:o,config:t,className:l})=>{const{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingSegment:s,artifactTitleIds:d}=T();return o?e(o,{isSidebarExpanded:n,selectedStoryArtifactId:r,setSelectedStoryArtifactId:i,userStoryForApproval:a,isEditingAnUserStorySegment:s,artifactTitleIds:d}):e(I,{config:t,className:l})},SidebarToggle:({OpenIcon:o,CloseIcon:t,className:l=""})=>{const{isSidebarExpanded:n,setIsSidebarExpanded:r}=T(),i=o||N,a=t||U;return e("div",{className:`${g.sidebarToggleWrapper} ${l}`,children:e("button",{onClick:()=>r(e=>!e),className:g.sidebarToggleBtn,"aria-label":n?"Collapse sidebar":"Expand sidebar",type:"button",children:e(n?a:i,{})})})},Content:({children:i,ButtonComponent:a,hideApproveAll:c=!1,pageTitle:u="Review Generated Requirements",showShareIcon:v=!1,handleDownloadUserStory:p,handleOpenSendDialog:h,pageDescription:S="This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements."})=>{var I,N,U,x,M,_,z,W,$,L,O,V,q,H,G,Y,J,K,Q,X,Z,ee,oe,te,le,ne,re,ie,ae,se,de;const{selectedUserStoryForApproval:ce,selectedUserStoryIndex:ue,artifactTitleIds:ve,labels:pe,config:me,isDisabled:he,disabledReason:Se,isEditingSegment:ye,handleSaveUserStory:ge,setCurrentContentId:fe,showNotification:be}=T(),{userStory:Ie,setUserStory:Ce}=d(),Ae=Ie[0],[we,Ee]=l(null),Ne=()=>{Ee(null)},Ue=n(null),[xe,Te]=l(!1),{customStyles:ke,customIcons:Be}=d(),De=null==ke?void 0:ke.userStoryCardStyles,[Fe,je]=l(!1),Pe=r(()=>{if(!ce)return;if(ye)return void be("warn","Warning!",pe.unsavedChangesWarning,3e3);const e=m(ce);ge(ue,e),fe("")},[ce,ue,ye,pe,ge,fe,be]);if(!ce)return null;const Re=ve[ue]||"",Me="APPROVED"===ce.approval_status,_e=he?Se:"",ze=null!=(null==ce?void 0:ce.big_enough)&&!Number.isNaN(ce.big_enough)&&!!(null==ce?void 0:ce.big_enough_decision_factors);return o("div",{className:g.content,style:{...null===(N=null===(I=null==ke?void 0:ke.approvalScreen)||void 0===I?void 0:I.content)||void 0===N?void 0:N.content},"data-lsc-ui-page-title":u,"data-lsc-ui-page-description":S,children:[o("div",{className:g.header,style:{...null===(M=null===(x=null===(U=null==ke?void 0:ke.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===M?void 0:M.header},children:[o("div",{className:g.headerLeft,style:{...null===(z=null===(_=null==ke?void 0:ke.approvalScreen)||void 0===_?void 0:_.content)||void 0===z?void 0:z.headerLeft},children:[o("div",{className:g.headerMeta,style:{...null===(L=null===($=null===(W=null==ke?void 0:ke.approvalScreen)||void 0===W?void 0:W.body)||void 0===$?void 0:$.contentSegment)||void 0===L?void 0:L.headerMeta},children:[e(b,{size:16,color:(null===(q=null===(V=null===(O=null==ke?void 0:ke.approvalScreen)||void 0===O?void 0:O.body)||void 0===V?void 0:V.contentSegment)||void 0===q?void 0:q.bookMarkColor)||"#8C8C8C"}),e("h2",{className:g.headerArtifactId,style:{...null===(Y=null===(G=null===(H=null==ke?void 0:ke.approvalScreen)||void 0===H?void 0:H.body)||void 0===G?void 0:G.contentSegment)||void 0===Y?void 0:Y.headerArtifactId},children:Re})]}),e("p",{className:g.headerTitle,style:{...null===(Q=null===(K=null===(J=null==ke?void 0:ke.approvalScreen)||void 0===J?void 0:J.body)||void 0===K?void 0:K.contentSegment)||void 0===Q?void 0:Q.headerTitle},children:null==ce?void 0:ce.title})]}),o("div",{className:null==g?void 0:g.containerStyle,style:null===(Z=null===(X=null==ke?void 0:ke.approvalScreen)||void 0===X?void 0:X.BigEnoughStyles)||void 0===Z?void 0:Z.containerStyle,children:[ze&&e("button",{className:g.developerEffortButton,style:null===(oe=null===(ee=null==ke?void 0:ke.approvalScreen)||void 0===ee?void 0:ee.BigEnoughStyles)||void 0===oe?void 0:oe.buttonStyle,onClick:()=>je(!Fe),children:e(B,{color:null===(le=null===(te=null==ke?void 0:ke.approvalScreen)||void 0===te?void 0:te.BigEnoughStyles)||void 0===le?void 0:le.iconColor,size:null===(re=null===(ne=null==ke?void 0:ke.approvalScreen)||void 0===ne?void 0:ne.BigEnoughStyles)||void 0===re?void 0:re.iconSize})}),v&&o(t,{children:[e("button",{className:g.iconButton,style:null==De?void 0:De.iconButton,onClick:e=>{Ee(e.currentTarget)},children:e(C,{size:16})}),o(D,{id:"user-story-share-menu",anchorEl:we,open:!!we,onClose:()=>Ee(null),style:null==De?void 0:De.userStoryShareMenu,children:[e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{Te(!0),p&&(await Promise.all([p("pdf"),p("doc")]),Te(!1))},children:o("div",{ref:Ue,className:g.menuItemContent,style:null==De?void 0:De.menuItemContent,children:[e(A,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Download"})]})}),e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{let e=Ae;e={...Ae,value:`${R(null==Ae?void 0:Ae.value,Ae.title)}`},null==h||h(!0,[e],Ae.artifactId),Ne()},children:o("div",{style:null==De?void 0:De.menuItemContent,className:g.menuItemContentPadded,children:[e(w,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Send"})]})}),e(F,{style:null==De?void 0:De.userStoryMenuItem,onClick:async()=>{const e=(new s.Converter).makeHtml(P(Ae.value)||Ae.value),o=function(e){const o=(new s.Converter).makeHtml(e),t=document.createElement("div");return t.innerHTML=o,t.textContent||t.innerText||""}(P(Ae.value)||Ae.value),t=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([t]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Ne()}},children:o("div",{style:null==De?void 0:De.menuItemContent,className:g.menuItemContentPadded,children:[e(E,{size:16,color:null==De?void 0:De.menuIconColor}),e("p",{style:null==De?void 0:De.menuLabel,children:"Copy"})]})})]})]}),!c&&me.showApproveAllButton&&e("div",{className:g.headerRight,children:Me?e(y,{status:"APPROVED",label:pe.approved}):e(j,a?{title:_e,children:e("span",{children:e(a,{type:"fill",onClick:Pe,isDisable:he,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:pe.approveAll,lscUIDescription:"Clicks this button to approve all generated requirements on the page in a single action.",lscUIWhenToApply:"Apply when the user wants to accept all requirements without reviewing them individually, or when they say phrases like 'approve everything', 'finalize all', 'accept all', or 'this looks good, approve all'."},children:o("div",{className:g.approveAllContent,children:[e(f,{size:16,color:"white"}),e("span",{children:pe.approveAll})]})})})}:{title:_e,children:e("span",{children:o("button",{onClick:Pe,disabled:he,className:g.approveAllButtonDefault,style:{...null===(ae=null===(ie=null==ke?void 0:ke.approvalScreen)||void 0===ie?void 0:ie.content)||void 0===ae?void 0:ae.approveAllButtonDefault},children:[e(f,{size:16,color:"white"}),e("span",{children:pe.approveAll})]})})})})]})]}),Fe&&ze&&e("div",{className:g.bigEnoughWrapper,children:e(k,{customIcons:null==Be?void 0:Be.userStoryIcons,customStyles:null===(se=null==ke?void 0:ke.approvalScreen)||void 0===se?void 0:se.aiReasoningCitaionStyles,currentUserStory:ce,panelStyles:null===(de=null==ke?void 0:ke.approvalScreen)||void 0===de?void 0:de.BigEnoughStyles,showPanel:Fe})}),i]})},Body:({children:t,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s=!1})=>{var c,u,v;const{selectedUserStoryForApproval:p,selectedUserStoryIndex:m,artifactTitleIds:h,handleSaveUserStory:y}=T(),{customStyles:f}=d(),b=r(e=>{y(m,e)},[m,y]),I=r((e,o)=>{var t;if(!p)return;const l={...p,sub_features:null===(t=p.sub_features)||void 0===t?void 0:t.map((t,l)=>l===e?o:t)};y(m,l)},[p,m,y]),C=r(e=>{var o;if(!p)return;const t={...p,sub_features:null===(o=p.sub_features)||void 0===o?void 0:o.filter((o,t)=>t!==e)};y(m,t)},[p,m,y]);if(!p)return null;const A=h[m]||"";return o("div",{className:g.body,style:{...null===(u=null===(c=null==f?void 0:f.approvalScreen)||void 0===c?void 0:c.body)||void 0===u?void 0:u.container},children:[e(S,{userStoryForApproval:p,artifactTitleId:A,onSaveMainStoryContent:b,EditorComponent:l,ViewerComponent:n}),null===(v=p.sub_features)||void 0===v?void 0:v.map((o,t)=>e(S,{userStoryForApproval:o,artifactTitleId:`${A} - ${String.fromCharCode(65+t)}`,isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:I,onDeleteSubFeature:C,EditorComponent:l,ViewerComponent:n,handleDownloadUserStory:i,handleOpenSendDialog:a,showShareIcon:s},o.artifactId)),t]})}});export{z as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryApprovalScreen.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;AAUvJ,QAAA,MAAM,iBAAiB,+
|
|
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;AAUvJ,QAAA,MAAM,iBAAiB,+CAwtFtB,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"}
|
|
@@ -21,6 +21,7 @@ export interface UserStoryApprovalScreenContextType {
|
|
|
21
21
|
labels: Required<UserStoryApprovalScreenLabels>;
|
|
22
22
|
callbacks: UserStoryApprovalScreenCallbacks;
|
|
23
23
|
isDisabled: boolean;
|
|
24
|
+
disabledReason: string;
|
|
24
25
|
handleSaveUserStory: (index: number, updatedUserStory: IUserStoryForApproval) => void;
|
|
25
26
|
handleUpdateContentId: (contentId: string) => void;
|
|
26
27
|
showNotification: (type: NotificationType, title: string, message: string, duration?: number) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryApprovalContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,gCAAgC,EAChC,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAEjD,oBAAoB,EAAE,qBAAqB,EAAE,CAAC;IAC9C,uBAAuB,EAAE,KAAK,CAAC,QAAQ,CACrC,KAAK,CAAC,cAAc,CAAC,qBAAqB,EAAE,CAAC,CAC9C,CAAC;IAGF,uBAAuB,EAAE,MAAM,CAAC;IAChC,0BAA0B,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,4BAA4B,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAGhE,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAGlE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAGnE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAGpE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAG3B,MAAM,EAAE,QAAQ,CAAC,6BAA6B,CAAC,CAAC;IAChD,MAAM,EAAE,QAAQ,CAAC,6BAA6B,CAAC,CAAC;IAGhD,SAAS,EAAE,gCAAgC,CAAC;IAG5C,UAAU,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserStoryApprovalContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalContext.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,gCAAgC,EAChC,gBAAgB,EACjB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAEjD,oBAAoB,EAAE,qBAAqB,EAAE,CAAC;IAC9C,uBAAuB,EAAE,KAAK,CAAC,QAAQ,CACrC,KAAK,CAAC,cAAc,CAAC,qBAAqB,EAAE,CAAC,CAC9C,CAAC;IAGF,uBAAuB,EAAE,MAAM,CAAC;IAChC,0BAA0B,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,4BAA4B,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAGhE,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAGlE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAGnE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IAGpE,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAG3B,MAAM,EAAE,QAAQ,CAAC,6BAA6B,CAAC,CAAC;IAChD,MAAM,EAAE,QAAQ,CAAC,6BAA6B,CAAC,CAAC;IAGhD,SAAS,EAAE,gCAAgC,CAAC;IAG5C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IAGvB,mBAAmB,EAAE,CACnB,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,qBAAqB,KACpC,IAAI,CAAC;IACV,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAGnD,gBAAgB,EAAE,CAChB,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,KACd,IAAI,CAAC;IACV,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,8BAA8B,oEACqB,CAAC;AAEjE,eAAO,MAAM,0BAA0B,QACjC,kCAQH,CAAC"}
|
|
@@ -14,6 +14,8 @@ interface RootProps {
|
|
|
14
14
|
labels?: Partial<UserStoryApprovalScreenLabels>;
|
|
15
15
|
/** Whether interactions are disabled (maps to original gapData === null) */
|
|
16
16
|
isDisabled?: boolean;
|
|
17
|
+
/** Tooltip message to show when interactions are disabled */
|
|
18
|
+
disabledReason?: string;
|
|
17
19
|
/** Children components */
|
|
18
20
|
children: React.ReactNode;
|
|
19
21
|
/** Custom class names */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryApprovalScreen.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EAEjC,qBAAqB,EACrB,UAAU,EACX,MAAM,sCAAsC,CAAC;AA4E9C,UAAU,SAAS;IACjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,mEAAmE;IACnE,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"UserStoryApprovalScreen.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,6BAA6B,EAC7B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EAEjC,qBAAqB,EACrB,UAAU,EACX,MAAM,sCAAsC,CAAC;AA4E9C,UAAU,SAAS;IACjB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,6BAA6B,CAAC;IACvC,mEAAmE;IACnE,SAAS,CAAC,EAAE,gCAAgC,CAAC;IAC7C,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAChD,4EAA4E;IAC5E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB;IACzB,UAAU,CAAC,EAAE,iCAAiC,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AA6OD,UAAU,YAAY;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkCD,UAAU,kBAAkB;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,mDAAmD;IACnD,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2BD,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,wDAAwD;IACxD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAqVD,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CACrB,eAAe,EAAE,OAAO,EACxB,eAAe,EAAE,UAAU,EAAE,EAC7B,UAAU,EAAE,MAAM,EAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,aAAa,CAAC,EAAE,OAAO,KACpB,IAAI,CAAC;IACV,aAAa,CAAC,EAAC,OAAO,CAAC;CACxB;AAmGD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|