@e-llm-studio/requirement-ai 0.0.51 → 0.0.52

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.
Files changed (17) hide show
  1. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  4. package/dist/cjs/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  5. package/dist/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js +1 -1
  6. package/dist/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.js +1 -1
  7. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  8. package/dist/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js +1 -1
  9. package/dist/types/src/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.d.ts +2 -0
  10. package/dist/types/src/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.d.ts.map +1 -1
  11. package/dist/types/src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.d.ts +2 -0
  12. package/dist/types/src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.d.ts.map +1 -1
  13. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +4 -2
  14. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  15. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts +2 -0
  16. package/dist/types/src/features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.d.ts.map +1 -1
  17. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),o=require("./components/StoryNode/StoryNode.js"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("./GapRiskSidebar.module.css.js"),d=n.createContext(null),t=function(){var i=n.useContext(d);if(!i)throw new Error("GapRiskSidebar compound components must be used within <GapRiskSidebar.Root>");return i},r=function(i){return{title:i.title,artifactTitleID:i.artifactTitleID,id:i.id,display_items:i.gap_items||i.risk_items||{critical:[],warning:[],recommendation:[]},sub_feature:(i.sub_feature||[]).map(r)}};var u=Object.assign(function(s){var o,l,t=s.storyDetails,r=s.type,u=s.isSidebarExpanded,c=s.onToggleSidebar,v=s.defaultExpanded,g=void 0===v||v,p=s.onClickStoryNodeCallback,_=s.isProcessingGapItems,m=s.onClickAiReasoning,S=s.handleFixRisk,b=s.handleHighlightGapContent,y=s.customStyles,h=s.customIcons,C=s.sidebarWidth,I=s.headerTitle,f=s.children,x=function(){try{return a.useRequirementAI()}catch(i){return null}}(),k=n.useState(g),N=k[0],j=k[1],G=void 0!==u,R=G?u:N,T=n.useCallback(function(i){var e="function"==typeof i?i(R):i;G?null==c||c(e):j(e)},[G,R,c]),W=n.useMemo(function(){var e,n,s,o,a,l,d,t,r,u,c,v,g;return i.__assign(i.__assign(i.__assign({},null===(e=null==x?void 0:x.customStyles)||void 0===e?void 0:e.gapSidebar),y),{gapRiskSidebar:i.__assign(i.__assign({},null===(s=null===(n=null==x?void 0:x.customStyles)||void 0===n?void 0:n.gapSidebar)||void 0===s?void 0:s.gapRiskSidebar),null==y?void 0:y.gapRiskSidebar),noGapsFound:i.__assign(i.__assign({},null===(a=null===(o=null==x?void 0:x.customStyles)||void 0===o?void 0:o.gapSidebar)||void 0===a?void 0:a.noGapsFound),null==y?void 0:y.noGapsFound),storyNode:i.__assign(i.__assign({},null===(d=null===(l=null==x?void 0:x.customStyles)||void 0===l?void 0:l.gapSidebar)||void 0===d?void 0:d.storyNode),null==y?void 0:y.storyNode),riskSidebarCategorySection:i.__assign(i.__assign({},null===(r=null===(t=null==x?void 0:x.customStyles)||void 0===t?void 0:t.gapSidebar)||void 0===r?void 0:r.riskSidebarCategorySection),null==y?void 0:y.riskSidebarCategorySection),riskCategorySection:i.__assign(i.__assign({},null===(c=null===(u=null==x?void 0:x.customStyles)||void 0===u?void 0:u.gapSidebar)||void 0===c?void 0:c.riskCategorySection),null==y?void 0:y.riskCategorySection),gapItem:i.__assign(i.__assign({},null===(g=null===(v=null==x?void 0:x.customStyles)||void 0===v?void 0:v.gapSidebar)||void 0===g?void 0:g.gapItem),null==y?void 0:y.gapItem)})},[null===(o=null==x?void 0:x.customStyles)||void 0===o?void 0:o.gapSidebar,y]),q=n.useMemo(function(){var e,n,s,o,a,l;return{icons:i.__assign(i.__assign({},null===(n=null===(e=null==x?void 0:x.customIcons)||void 0===e?void 0:e.gapSidebarIcons)||void 0===n?void 0:n.icons),null==h?void 0:h.icons),iconSizes:i.__assign(i.__assign({},null===(o=null===(s=null==x?void 0:x.customIcons)||void 0===s?void 0:s.gapSidebarIcons)||void 0===o?void 0:o.iconSizes),null==h?void 0:h.iconSizes),iconColors:i.__assign(i.__assign({},null===(l=null===(a=null==x?void 0:x.customIcons)||void 0===a?void 0:a.gapSidebarIcons)||void 0===l?void 0:l.iconColors),null==h?void 0:h.iconColors)}},[null===(l=null==x?void 0:x.customIcons)||void 0===l?void 0:l.gapSidebarIcons,h]),E={isSidebarExpanded:R,setIsSidebarExpanded:T,storyDetails:t,type:r,isProcessingGapItems:_,onClickStoryNodeCallback:p,onClickAiReasoning:m,handleFixRisk:S,handleHighlightGapContent:b,mergedStyles:W,mergedIcons:q,sidebarWidth:C,headerTitle:I};return e.jsx(d.Provider,i.__assign({value:E},{children:f}))},{Panel:function(a){var d,u,c,v,g=a.className,p=void 0===g?"":g,_=a.style,m=t(),S=m.isSidebarExpanded,b=m.storyDetails,y=m.type,h=m.isProcessingGapItems,C=m.onClickStoryNodeCallback,I=m.onClickAiReasoning,f=m.handleFixRisk,x=m.handleHighlightGapContent,k=m.mergedStyles,N=m.mergedIcons,j=m.sidebarWidth,G=void 0===j?320:j,R=m.headerTitle,T=void 0===R?"Generated User Stories":R,W=k.gapRiskSidebar,q=(null===(d=N.icons)||void 0===d?void 0:d.menuIcon)||s.Menu,E=n.useMemo(function(){return b.map(r)},[b]),F="number"==typeof G?"".concat(G,"px"):G;return e.jsx("div",i.__assign({className:"".concat(l.default.sidebarContainer," ").concat(S?l.default.sidebarExpanded:l.default.sidebarCollapsed," ").concat(p),style:i.__assign(i.__assign(i.__assign(i.__assign({},S?{width:F,minWidth:F}:{}),null==W?void 0:W.container),S?{}:null==W?void 0:W.containerCollapsed),_)},{children:e.jsxs("div",i.__assign({className:l.default.sidebarInnerWrapper,style:i.__assign({minWidth:F},null==W?void 0:W.innerWrapper)},{children:[e.jsxs("div",i.__assign({className:l.default.header,style:null==W?void 0:W.header},{children:[e.jsx(q,{className:l.default.headerMenuIcon,style:i.__assign({color:null===(u=N.iconColors)||void 0===u?void 0:u.menuIcon,width:null===(c=N.iconSizes)||void 0===c?void 0:c.menuIcon,height:null===(v=N.iconSizes)||void 0===v?void 0:v.menuIcon},null==W?void 0:W.headerMenuIcon)}),e.jsx("h2",i.__assign({className:l.default.headerTitle,style:null==W?void 0:W.headerTitle},{children:T}))]})),e.jsx("div",i.__assign({className:l.default.storyList,style:null==W?void 0:W.storyList},{children:E.map(function(n){return e.jsx("div",i.__assign({className:l.default.storyItemWrapper,style:null==W?void 0:W.storyItemWrapper},{children:e.jsx(o.default,{story:n,onClickStoryNodeCallback:C,type:y,isProcessingGapItems:h,onClickAiReasoning:I,handleFixRisk:f,handleHighlightGapContent:x,customStyles:k,customIcons:N})}),n.artifactTitleID)})}))]}))}))},Toggle:function(n){var o=n.OpenIcon,a=n.CloseIcon,d=n.className,r=void 0===d?"":d,u=t(),c=u.isSidebarExpanded,v=u.setIsSidebarExpanded,g=o||s.SidebarOpenIcon,p=a||s.SidebarCloseIcon;return e.jsx("div",i.__assign({className:"".concat(l.default.sidebarToggleWrapper," ").concat(r)},{children:e.jsx("button",i.__assign({onClick:function(){return v(function(i){return!i})},className:l.default.sidebarToggleBtn,"aria-label":c?"Collapse sidebar":"Expand sidebar",type:"button"},{children:c?e.jsx(p,{}):e.jsx(g,{})}))}))}});exports.NoGapsFound=function(n){var o=n.styles,a=n.CheckCircleIcon,d=n.iconColor,t=n.iconSize,r=a||s.CheckCircle2;return e.jsxs("div",i.__assign({className:l.default.noGapsContainer,style:null==o?void 0:o.container},{children:[e.jsx("p",i.__assign({className:l.default.noGapsText,style:null==o?void 0:o.text},{children:"No Gaps Found"})),e.jsx(r,{className:l.default.noGapsIcon,style:i.__assign({color:d,width:t,height:t},null==o?void 0:o.icon)})]}))},exports.default=u,exports.useGapRiskSidebar=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),o=require("./components/StoryNode/StoryNode.js"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),l=require("./GapRiskSidebar.module.css.js"),t=n.createContext(null),d=function(){var e=n.useContext(t);if(!e)throw new Error("GapRiskSidebar compound components must be used within <GapRiskSidebar.Root>");return e},r=function(e){return{title:e.title,artifactTitleID:e.artifactTitleID,id:e.id,display_items:e.gap_items||e.risk_items||{critical:[],warning:[],recommendation:[]},sub_feature:(e.sub_feature||[]).map(r)}};var u=Object.assign(function(s){var o,l,d=s.storyDetails,r=s.type,u=s.isSidebarExpanded,c=s.onToggleSidebar,v=s.defaultExpanded,g=void 0===v||v,p=s.onClickStoryNodeCallback,_=s.isProcessingGapItems,S=s.onClickAiReasoning,m=s.handleFixRisk,y=s.handleHighlightGapContent,b=s.customStyles,h=s.customIcons,C=s.sidebarWidth,I=s.headerTitle,f=s.onSelectStory,x=s.children,k=function(){try{return a.useRequirementAI()}catch(e){return null}}(),N=n.useState(g),j=N[0],G=N[1],R=void 0!==u,T=R?u:j,W=n.useCallback(function(e){var i="function"==typeof e?e(T):e;R?null==c||c(i):G(i)},[R,T,c]),q=n.useMemo(function(){var i,n,s,o,a,l,t,d,r,u,c,v,g;return e.__assign(e.__assign(e.__assign({},null===(i=null==k?void 0:k.customStyles)||void 0===i?void 0:i.gapSidebar),b),{gapRiskSidebar:e.__assign(e.__assign({},null===(s=null===(n=null==k?void 0:k.customStyles)||void 0===n?void 0:n.gapSidebar)||void 0===s?void 0:s.gapRiskSidebar),null==b?void 0:b.gapRiskSidebar),noGapsFound:e.__assign(e.__assign({},null===(a=null===(o=null==k?void 0:k.customStyles)||void 0===o?void 0:o.gapSidebar)||void 0===a?void 0:a.noGapsFound),null==b?void 0:b.noGapsFound),storyNode:e.__assign(e.__assign({},null===(t=null===(l=null==k?void 0:k.customStyles)||void 0===l?void 0:l.gapSidebar)||void 0===t?void 0:t.storyNode),null==b?void 0:b.storyNode),riskSidebarCategorySection:e.__assign(e.__assign({},null===(r=null===(d=null==k?void 0:k.customStyles)||void 0===d?void 0:d.gapSidebar)||void 0===r?void 0:r.riskSidebarCategorySection),null==b?void 0:b.riskSidebarCategorySection),riskCategorySection:e.__assign(e.__assign({},null===(c=null===(u=null==k?void 0:k.customStyles)||void 0===u?void 0:u.gapSidebar)||void 0===c?void 0:c.riskCategorySection),null==b?void 0:b.riskCategorySection),gapItem:e.__assign(e.__assign({},null===(g=null===(v=null==k?void 0:k.customStyles)||void 0===v?void 0:v.gapSidebar)||void 0===g?void 0:g.gapItem),null==b?void 0:b.gapItem)})},[null===(o=null==k?void 0:k.customStyles)||void 0===o?void 0:o.gapSidebar,b]),E=n.useMemo(function(){var i,n,s,o,a,l;return{icons:e.__assign(e.__assign({},null===(n=null===(i=null==k?void 0:k.customIcons)||void 0===i?void 0:i.gapSidebarIcons)||void 0===n?void 0:n.icons),null==h?void 0:h.icons),iconSizes:e.__assign(e.__assign({},null===(o=null===(s=null==k?void 0:k.customIcons)||void 0===s?void 0:s.gapSidebarIcons)||void 0===o?void 0:o.iconSizes),null==h?void 0:h.iconSizes),iconColors:e.__assign(e.__assign({},null===(l=null===(a=null==k?void 0:k.customIcons)||void 0===a?void 0:a.gapSidebarIcons)||void 0===l?void 0:l.iconColors),null==h?void 0:h.iconColors)}},[null===(l=null==k?void 0:k.customIcons)||void 0===l?void 0:l.gapSidebarIcons,h]),F={isSidebarExpanded:T,setIsSidebarExpanded:W,storyDetails:d,type:r,isProcessingGapItems:_,onClickStoryNodeCallback:p,onClickAiReasoning:S,handleFixRisk:m,handleHighlightGapContent:y,mergedStyles:q,mergedIcons:E,sidebarWidth:C,headerTitle:I,onSelectStory:f};return i.jsx(t.Provider,e.__assign({value:F},{children:x}))},{Panel:function(a){var t,u,c,v,g=a.className,p=void 0===g?"":g,_=a.style,S=d(),m=S.isSidebarExpanded,y=S.storyDetails,b=S.type,h=S.isProcessingGapItems,C=S.onClickStoryNodeCallback,I=S.onClickAiReasoning,f=S.handleFixRisk,x=S.handleHighlightGapContent,k=S.mergedStyles,N=S.mergedIcons,j=S.sidebarWidth,G=void 0===j?320:j,R=S.headerTitle,T=void 0===R?"Generated User Stories":R,W=S.onSelectStory,q=k.gapRiskSidebar,E=(null===(t=N.icons)||void 0===t?void 0:t.menuIcon)||s.Menu,F=n.useMemo(function(){return y.map(r)},[y]),w="number"==typeof G?"".concat(G,"px"):G;return i.jsx("div",e.__assign({className:"".concat(l.default.sidebarContainer," ").concat(m?l.default.sidebarExpanded:l.default.sidebarCollapsed," ").concat(p),style:e.__assign(e.__assign(e.__assign(e.__assign({},m?{width:w,minWidth:w}:{}),null==q?void 0:q.container),m?{}:null==q?void 0:q.containerCollapsed),_)},{children:i.jsxs("div",e.__assign({className:l.default.sidebarInnerWrapper,style:e.__assign({minWidth:w},null==q?void 0:q.innerWrapper)},{children:[i.jsxs("div",e.__assign({className:l.default.header,style:null==q?void 0:q.header},{children:[i.jsx(E,{className:l.default.headerMenuIcon,style:e.__assign({color:null===(u=N.iconColors)||void 0===u?void 0:u.menuIcon,width:null===(c=N.iconSizes)||void 0===c?void 0:c.menuIcon,height:null===(v=N.iconSizes)||void 0===v?void 0:v.menuIcon},null==q?void 0:q.headerMenuIcon)}),i.jsx("h2",e.__assign({className:l.default.headerTitle,style:null==q?void 0:q.headerTitle},{children:T}))]})),i.jsx("div",e.__assign({className:l.default.storyList,style:null==q?void 0:q.storyList},{children:F.map(function(n){return i.jsx("div",e.__assign({className:l.default.storyItemWrapper,style:null==q?void 0:q.storyItemWrapper},{children:i.jsx(o.default,{story:n,onClickStoryNodeCallback:C,type:b,isProcessingGapItems:h,onClickAiReasoning:I,handleFixRisk:f,handleHighlightGapContent:x,customStyles:k,customIcons:N,onSelectStory:W})}),n.artifactTitleID)})}))]}))}))},Toggle:function(n){var o=n.OpenIcon,a=n.CloseIcon,t=n.className,r=void 0===t?"":t,u=d(),c=u.isSidebarExpanded,v=u.setIsSidebarExpanded,g=o||s.SidebarOpenIcon,p=a||s.SidebarCloseIcon;return i.jsx("div",e.__assign({className:"".concat(l.default.sidebarToggleWrapper," ").concat(r)},{children:i.jsx("button",e.__assign({onClick:function(){return v(function(e){return!e})},className:l.default.sidebarToggleBtn,"aria-label":c?"Collapse sidebar":"Expand sidebar",type:"button"},{children:c?i.jsx(p,{}):i.jsx(g,{})}))}))}});exports.NoGapsFound=function(n){var o=n.styles,a=n.CheckCircleIcon,t=n.iconColor,d=n.iconSize,r=a||s.CheckCircle2;return i.jsxs("div",e.__assign({className:l.default.noGapsContainer,style:null==o?void 0:o.container},{children:[i.jsx("p",e.__assign({className:l.default.noGapsText,style:null==o?void 0:o.text},{children:"No Gaps Found"})),i.jsx(r,{className:l.default.noGapsIcon,style:e.__assign({color:t,width:d,height:d},null==o?void 0:o.icon)})]}))},exports.default=u,exports.useGapRiskSidebar=d;
2
2
  //# sourceMappingURL=GapRiskSidebar.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),l=require("lucide-react"),o=require("@mui/material"),s=require("uuid"),t=require("../RiskSidebarCategorySection/RiskSidebarCategorySection.js"),a=require("../RiskCategorySection/RiskCategorySection.js"),d=require("./StoryNode.module.css.js"),r=function(i){var e,n,l,o,s,t,a,d=(null===(n=null===(e=i.display_items)||void 0===e?void 0:e.critical)||void 0===n?void 0:n.length)||0,c=(null===(o=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===o?void 0:o.length)||0,u=(null===(t=null===(s=i.display_items)||void 0===s?void 0:s.recommendation)||void 0===t?void 0:t.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var v=0,g=i.sub_feature;v<g.length;v++){var m=g[v],h=r(m);d+=h.critical,c+=h.warning,u+=h.recommendation}return{critical:d,warning:c,recommendation:u}};function c(n,t,a,r){for(var c,u=[],v=/<learned>(.*?)<\/learned>/g,g=0,m=0,h=t||l.Info;null!==(c=v.exec(n));){c[0];var p=c[1],_=c.index;_>g&&u.push(e.jsx("span",{children:n.slice(g,_)},"text-pre-".concat(m++))),u.push(e.jsx(o.Tooltip,i.__assign({title:p,placement:"top"},{children:e.jsx(h,{size:r||16,className:d.default.infoIcon,style:{color:a,width:r,height:r}})}),"tooltip-".concat(s.v4()))),g=v.lastIndex}return g<(null==n?void 0:n.length)&&u.push(e.jsx("span",{children:n.slice(g)},"text-post-".concat(m++))),u}var u=function(s){var v,g,m,h,p,_,y,f,C,x,I,j,S,k,b,w,R,N,G,q,z,W,F,P,H=s.story,A=s.depth,M=void 0===A?0:A,T=s.onClickStoryNodeCallback,L=s.type,O=s.isProcessingGapItems,B=s.onClickAiReasoning,D=s.handleFixRisk,E=s.handleHighlightGapContent,J=s.customStyles,K=s.customIcons,Q=n.useState(0===M),U=Q[0],V=Q[1],X=n.useState(!1),Y=X[0],Z=X[1],$=null==J?void 0:J.storyNode,ii=(null===(v=null==K?void 0:K.icons)||void 0===v?void 0:v.bookmarkIcon)||l.Bookmark,ei=(null===(g=null==K?void 0:K.icons)||void 0===g?void 0:g.chevronDownIcon)||l.ChevronDown,ni=(null===(m=null==K?void 0:K.icons)||void 0===m?void 0:m.chevronRightIcon)||l.ChevronRight,li=n.useMemo(function(){return H.display_items.critical.length>0?"Critical":H.display_items.warning.length>0?"Warning":H.display_items.recommendation.length>0?"Suggestion":null},[H.display_items,L]),oi=n.useMemo(function(){return r(H)},[H]),si=0===((null===(p=null===(h=H.display_items)||void 0===h?void 0:h.critical)||void 0===p?void 0:p.length)||0)+((null===(y=null===(_=H.display_items)||void 0===_?void 0:_.warning)||void 0===y?void 0:y.length)||0)+((null===(C=null===(f=H.display_items)||void 0===f?void 0:f.recommendation)||void 0===C?void 0:C.length)||0);return e.jsxs("div",i.__assign({className:"".concat(d.default.container," ").concat(M>0?d.default.nestedContainer:""),style:i.__assign(i.__assign({},null==$?void 0:$.container),M>0?null==$?void 0:$.nestedContainer:{})},{children:[e.jsxs("div",i.__assign({onClick:function(){V(!U),null==T||T()},className:d.default.headerRow,style:i.__assign(i.__assign({},null==$?void 0:$.headerRow),Y?null==$?void 0:$.headerRowHover:{}),onMouseEnter:function(){return Z(!0)},onMouseLeave:function(){return Z(!1)}},{children:[e.jsx("div",i.__assign({className:d.default.chevronWrapper,style:null==$?void 0:$.chevronWrapper},{children:U?e.jsx(ei,{className:d.default.chevronIcon,style:{color:null===(x=null==K?void 0:K.iconColors)||void 0===x?void 0:x.chevronIcon,width:null===(I=null==K?void 0:K.iconSizes)||void 0===I?void 0:I.chevronIcon,height:null===(j=null==K?void 0:K.iconSizes)||void 0===j?void 0:j.chevronIcon}}):e.jsx(ni,{className:d.default.chevronIcon,style:{color:null===(S=null==K?void 0:K.iconColors)||void 0===S?void 0:S.chevronIcon,width:null===(k=null==K?void 0:K.iconSizes)||void 0===k?void 0:k.chevronIcon,height:null===(b=null==K?void 0:K.iconSizes)||void 0===b?void 0:b.chevronIcon}})})),e.jsxs("div",i.__assign({className:d.default.headerContent,style:null==$?void 0:$.headerContent},{children:[e.jsxs("div",i.__assign({className:d.default.artifactIdRow,style:null==$?void 0:$.artifactIdRow},{children:[e.jsx(ii,{className:d.default.bookmarkIcon,style:{color:null===(w=null==K?void 0:K.iconColors)||void 0===w?void 0:w.bookmarkIcon,width:null===(R=null==K?void 0:K.iconSizes)||void 0===R?void 0:R.bookmarkIcon,height:null===(N=null==K?void 0:K.iconSizes)||void 0===N?void 0:N.bookmarkIcon}}),e.jsx("span",i.__assign({style:null==$?void 0:$.artifactIdText},{children:H.artifactTitleID}))]})),e.jsx(o.Tooltip,i.__assign({title:c(H.title,null===(G=null==K?void 0:K.icons)||void 0===G?void 0:G.infoIcon,null===(q=null==K?void 0:K.iconColors)||void 0===q?void 0:q.infoIcon,null===(z=null==K?void 0:K.iconSizes)||void 0===z?void 0:z.infoIcon),arrow:!0},{children:e.jsx("h3",i.__assign({className:d.default.title,style:i.__assign(i.__assign({},null==$?void 0:$.title),Y?null==$?void 0:$.titleHover:{})},{children:c(H.title,null===(W=null==K?void 0:K.icons)||void 0===W?void 0:W.infoIcon,null===(F=null==K?void 0:K.iconColors)||void 0===F?void 0:F.infoIcon,null===(P=null==K?void 0:K.iconSizes)||void 0===P?void 0:P.infoIcon)}))})),!U&&e.jsx("div",i.__assign({className:d.default.collapsedSummary,style:null==$?void 0:$.collapsedSummary},{children:(0===M||oi.critical+oi.warning+oi.recommendation>0)&&e.jsxs(e.Fragment,{children:[e.jsx("span",i.__assign({className:d.default.summaryLabel,style:null==$?void 0:$.summaryLabel},{children:"Gap"===L?"Gaps : ":"Risks : "})),e.jsxs("div",i.__assign({className:d.default.summaryBadgesContainer,style:null==$?void 0:$.summaryBadgesContainer},{children:[oi.critical>0&&e.jsx(t.default,{title:"Critical",length:oi.critical,badgeColorClass:"critical",customStyles:J}),oi.warning>0&&e.jsx(t.default,{title:"Warning",length:oi.warning,badgeColorClass:"warning",customStyles:J}),oi.recommendation>0&&e.jsx(t.default,{title:"JAS",length:oi.recommendation,badgeColorClass:"suggestion",customStyles:J})]}))]})}))]}))]})),U&&e.jsxs("div",i.__assign({className:d.default.expandedContent,style:null==$?void 0:$.expandedContent},{children:[e.jsx("div",i.__assign({className:d.default.expandedInnerPadding,style:null==$?void 0:$.expandedInnerPadding},{children:!si&&e.jsxs("div",i.__assign({className:d.default.itemsContainer,style:null==$?void 0:$.itemsContainer},{children:[e.jsx(a.default,{title:"Critical",items:H.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===li,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Warning",items:H.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===li,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Suggestion",items:H.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===li,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K})]}))})),H.sub_feature&&H.sub_feature.length>0&&e.jsx("div",i.__assign({className:d.default.subFeaturesWrapper,style:null==$?void 0:$.subFeaturesWrapper},{children:H.sub_feature.map(function(i,n){return e.jsx(u,{story:i,depth:M+1,onClickStoryNodeCallback:T,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K},n)})}))]}))]}))};exports.default=u,exports.replaceLearnedTagsWithInfo=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("react"),l=require("lucide-react"),o=require("@mui/material"),s=require("uuid"),t=require("../RiskSidebarCategorySection/RiskSidebarCategorySection.js"),a=require("../RiskCategorySection/RiskCategorySection.js"),d=require("./StoryNode.module.css.js"),r=function(i){var e,n,l,o,s,t,a,d=(null===(n=null===(e=i.display_items)||void 0===e?void 0:e.critical)||void 0===n?void 0:n.length)||0,c=(null===(o=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===o?void 0:o.length)||0,u=(null===(t=null===(s=i.display_items)||void 0===s?void 0:s.recommendation)||void 0===t?void 0:t.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var v=0,g=i.sub_feature;v<g.length;v++){var m=g[v],h=r(m);d+=h.critical,c+=h.warning,u+=h.recommendation}return{critical:d,warning:c,recommendation:u}};function c(n,t,a,r){for(var c,u=[],v=/<learned>(.*?)<\/learned>/g,g=0,m=0,h=t||l.Info;null!==(c=v.exec(n));){c[0];var p=c[1],_=c.index;_>g&&u.push(e.jsx("span",{children:n.slice(g,_)},"text-pre-".concat(m++))),u.push(e.jsx(o.Tooltip,i.__assign({title:p,placement:"top"},{children:e.jsx(h,{size:r||16,className:d.default.infoIcon,style:{color:a,width:r,height:r}})}),"tooltip-".concat(s.v4()))),g=v.lastIndex}return g<(null==n?void 0:n.length)&&u.push(e.jsx("span",{children:n.slice(g)},"text-post-".concat(m++))),u}var u=function(s){var v,g,m,h,p,_,y,f,C,x,I,S,j,k,b,w,R,N,G,q,z,W,A,F,P=s.story,H=s.depth,M=void 0===H?0:H,T=s.onClickStoryNodeCallback,L=s.type,O=s.isProcessingGapItems,B=s.onClickAiReasoning,D=s.handleFixRisk,E=s.handleHighlightGapContent,J=s.customStyles,K=s.customIcons,Q=s.onSelectStory,U=s.rootArtifactId,V=void 0===U?P.id:U,X=n.useState(0===M),Y=X[0],Z=X[1],$=n.useState(!1),ii=$[0],ei=$[1],ni=null==J?void 0:J.storyNode,li=(null===(v=null==K?void 0:K.icons)||void 0===v?void 0:v.bookmarkIcon)||l.Bookmark,oi=(null===(g=null==K?void 0:K.icons)||void 0===g?void 0:g.chevronDownIcon)||l.ChevronDown,si=(null===(m=null==K?void 0:K.icons)||void 0===m?void 0:m.chevronRightIcon)||l.ChevronRight,ti=n.useMemo(function(){return P.display_items.critical.length>0?"Critical":P.display_items.warning.length>0?"Warning":P.display_items.recommendation.length>0?"Suggestion":null},[P.display_items,L]),ai=n.useMemo(function(){return r(P)},[P]),di=0===((null===(p=null===(h=P.display_items)||void 0===h?void 0:h.critical)||void 0===p?void 0:p.length)||0)+((null===(y=null===(_=P.display_items)||void 0===_?void 0:_.warning)||void 0===y?void 0:y.length)||0)+((null===(C=null===(f=P.display_items)||void 0===f?void 0:f.recommendation)||void 0===C?void 0:C.length)||0);return e.jsxs("div",i.__assign({className:"".concat(d.default.container," ").concat(M>0?d.default.nestedContainer:""),style:i.__assign(i.__assign({},null==ni?void 0:ni.container),M>0?null==ni?void 0:ni.nestedContainer:{})},{children:[e.jsxs("div",i.__assign({onClick:function(){Z(!Y),null==T||T(),null==Q||Q(V)},className:d.default.headerRow,style:i.__assign(i.__assign({},null==ni?void 0:ni.headerRow),ii?null==ni?void 0:ni.headerRowHover:{}),onMouseEnter:function(){return ei(!0)},onMouseLeave:function(){return ei(!1)}},{children:[e.jsx("div",i.__assign({className:d.default.chevronWrapper,style:null==ni?void 0:ni.chevronWrapper},{children:Y?e.jsx(oi,{className:d.default.chevronIcon,style:{color:null===(x=null==K?void 0:K.iconColors)||void 0===x?void 0:x.chevronIcon,width:null===(I=null==K?void 0:K.iconSizes)||void 0===I?void 0:I.chevronIcon,height:null===(S=null==K?void 0:K.iconSizes)||void 0===S?void 0:S.chevronIcon}}):e.jsx(si,{className:d.default.chevronIcon,style:{color:null===(j=null==K?void 0:K.iconColors)||void 0===j?void 0:j.chevronIcon,width:null===(k=null==K?void 0:K.iconSizes)||void 0===k?void 0:k.chevronIcon,height:null===(b=null==K?void 0:K.iconSizes)||void 0===b?void 0:b.chevronIcon}})})),e.jsxs("div",i.__assign({className:d.default.headerContent,style:null==ni?void 0:ni.headerContent},{children:[e.jsxs("div",i.__assign({className:d.default.artifactIdRow,style:null==ni?void 0:ni.artifactIdRow},{children:[e.jsx(li,{className:d.default.bookmarkIcon,style:{color:null===(w=null==K?void 0:K.iconColors)||void 0===w?void 0:w.bookmarkIcon,width:null===(R=null==K?void 0:K.iconSizes)||void 0===R?void 0:R.bookmarkIcon,height:null===(N=null==K?void 0:K.iconSizes)||void 0===N?void 0:N.bookmarkIcon}}),e.jsx("span",i.__assign({style:null==ni?void 0:ni.artifactIdText},{children:P.artifactTitleID}))]})),e.jsx(o.Tooltip,i.__assign({title:c(P.title,null===(G=null==K?void 0:K.icons)||void 0===G?void 0:G.infoIcon,null===(q=null==K?void 0:K.iconColors)||void 0===q?void 0:q.infoIcon,null===(z=null==K?void 0:K.iconSizes)||void 0===z?void 0:z.infoIcon),arrow:!0},{children:e.jsx("h3",i.__assign({className:d.default.title,style:i.__assign(i.__assign({},null==ni?void 0:ni.title),ii?null==ni?void 0:ni.titleHover:{})},{children:c(P.title,null===(W=null==K?void 0:K.icons)||void 0===W?void 0:W.infoIcon,null===(A=null==K?void 0:K.iconColors)||void 0===A?void 0:A.infoIcon,null===(F=null==K?void 0:K.iconSizes)||void 0===F?void 0:F.infoIcon)}))})),!Y&&e.jsx("div",i.__assign({className:d.default.collapsedSummary,style:null==ni?void 0:ni.collapsedSummary},{children:(0===M||ai.critical+ai.warning+ai.recommendation>0)&&e.jsxs(e.Fragment,{children:[e.jsx("span",i.__assign({className:d.default.summaryLabel,style:null==ni?void 0:ni.summaryLabel},{children:"Gap"===L?"Gaps : ":"Risks : "})),e.jsxs("div",i.__assign({className:d.default.summaryBadgesContainer,style:null==ni?void 0:ni.summaryBadgesContainer},{children:[ai.critical>0&&e.jsx(t.default,{title:"Critical",length:ai.critical,badgeColorClass:"critical",customStyles:J}),ai.warning>0&&e.jsx(t.default,{title:"Warning",length:ai.warning,badgeColorClass:"warning",customStyles:J}),ai.recommendation>0&&e.jsx(t.default,{title:"JAS",length:ai.recommendation,badgeColorClass:"suggestion",customStyles:J})]}))]})}))]}))]})),Y&&e.jsxs("div",i.__assign({className:d.default.expandedContent,style:null==ni?void 0:ni.expandedContent},{children:[e.jsx("div",i.__assign({className:d.default.expandedInnerPadding,style:null==ni?void 0:ni.expandedInnerPadding},{children:!di&&e.jsxs("div",i.__assign({className:d.default.itemsContainer,style:null==ni?void 0:ni.itemsContainer},{children:[e.jsx(a.default,{title:"Critical",items:P.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===ti,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Warning",items:P.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===ti,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K}),e.jsx(a.default,{title:"Suggestion",items:P.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===ti,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K})]}))})),P.sub_feature&&P.sub_feature.length>0&&e.jsx("div",i.__assign({className:d.default.subFeaturesWrapper,style:null==ni?void 0:ni.subFeaturesWrapper},{children:P.sub_feature.map(function(i,n){return e.jsx(u,{story:i,depth:M+1,onClickStoryNodeCallback:T,type:L,isProcessingGapItems:O,onClickAiReasoning:B,handleFixRisk:D,handleHighlightGapContent:E,customStyles:J,customIcons:K,onSelectStory:Q,rootArtifactId:V},n)})}))]}))]}))};exports.default=u,exports.replaceLearnedTagsWithInfo=c;
2
2
  //# sourceMappingURL=StoryNode.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("showdown"),o=require("@mui/material"),i=require("uuid"),a=require("./UserStoryCard.module.css.js"),l=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=y(s);function m(n){for(var s,a=[],l=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=l.exec(n));){var c=s[1],f=s.index;f>u&&a.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),a.push(t.jsx(o.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(r.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(i.v4()))),u=l.lastIndex}return u<(null==n?void 0:n.length)&&a.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),a}var h=function(n){var s,o=n.displayName,i=v.useRequirementAI().customStyles,l=null===(s=null==i?void 0:i.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return t.jsxs("div",e.__assign({className:a.default.displayName,style:null==l?void 0:l.wrapper},{children:[t.jsx(r.Bookmark,{className:a.default.displayNameIcon,style:null==l?void 0:l.displayNameIcon}),t.jsxs("span",e.__assign({style:null==l?void 0:l.label},{children:[o,":"]}))]}))},S=function(s){var i,y,p=s.isUserStoryCurrentlyUpdated,x=s.artifactId,g=s.artifactTitleId,j=s.parentUserStory,I=s.currentUserStory,C=s.onUserStoryChange,w=s.parentIndex,U=s.currentIndex,N=s.enableDownload,b=s.isDiffEditReviewMode,D=s.showUserStoryDiff,M=s.handleDownloadUserStory,k=s.handleOpenSendDialog,q=s.updateUserStoryArtifact,B=v.useRequirementAI(),A=B.searchQueryList,R=B.citations,T=B.customStyles,E=null==T?void 0:T.userStoryCardStyles,L=null===(i=null==T?void 0:T.userStoryScreenStyles)||void 0===i?void 0:i.userStoryContentStyles,P=n.useState(e.__assign(e.__assign({},structuredClone(I)),{value:l.formatMarkdown(I.value)||""})),W=P[0],z=P[1],O=n.useState({userStory:!1}),H=O[0],F=O[1],V=v.useRequirementAI().userStory,Q=n.useState(""===w),G=Q[0],J=Q[1],K=n.useState(!1);K[0];var X=K[1],Y=n.useState(null),Z=Y[0],$=Y[1],ee=n.useState(!1),te=ee[0],ne=ee[1],re=n.useRef(null),se=n.useState(!1);se[0];var oe=se[1];n.useEffect(function(){p&&J(p)},[p]),n.useEffect(function(){z(e.__assign(e.__assign({},structuredClone(I)),{value:l.formatMarkdown(I.value)||""}))},[I]),n.useEffect(function(){A.length>0&&J(!0)},[A]);var ie=function(){$(null)},ae=function(){J(function(e){return!e})};return t.jsxs("div",e.__assign({className:a.default.card,style:null==E?void 0:E.cardStyle},{children:[t.jsxs("div",e.__assign({className:a.default.titleSection,style:null==E?void 0:E.titleSection},{children:[t.jsxs("div",e.__assign({className:a.default.titleRow,style:null==E?void 0:E.titleRow,onClick:ae},{children:[t.jsxs("div",e.__assign({className:a.default.titleLeft,style:null==E?void 0:E.titleLeft,onMouseEnter:function(){return oe(!0)},onMouseLeave:function(){return oe(!1)}},{children:[t.jsx(h,{displayName:g}),t.jsx("h2",e.__assign({className:a.default.storyTitle,style:null==E?void 0:E.storyTitle},{children:m(I.title)}),I.artifactId)]})),t.jsxs("div",e.__assign({className:a.default.titleActions,style:null==E?void 0:E.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!H.userStory&&t.jsxs(t.Fragment,{children:[t.jsx("button",e.__assign({className:a.default.iconButton,style:null==E?void 0:E.iconButton,onClick:function(e){$(e.currentTarget)}},{children:t.jsx(r.ExternalLink,{size:16})})),t.jsxs(o.Menu,e.__assign({id:"user-story-share-menu",anchorEl:Z,open:!!Z,onClose:function(){return $(null)},style:null==E?void 0:E.userStoryShareMenu},{children:[N&&t.jsx(o.MenuItem,e.__assign({style:null==E?void 0:E.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return X(!0),M?[4,Promise.all([M("pdf"),M("doc")])]:[2];case 1:return e.sent(),X(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:re,className:a.default.menuItemContent,style:null==E?void 0:E.menuItemContent},{children:[t.jsx(r.Download,{size:16,color:null==E?void 0:E.menuIconColor}),t.jsx("p",e.__assign({style:null==E?void 0:E.menuLabel},{children:"Download"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==E?void 0:E.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=I,j&&(t=e.__assign(e.__assign({},I),{value:"".concat(u.replaceTitleSection(null==j?void 0:j.value,I.title)," \n").concat(I.value)})),null==k||k(!0,[t],I.artifactId),ie(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==E?void 0:E.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Share2,{size:16,color:null==E?void 0:E.menuIconColor}),t.jsx("p",e.__assign({style:null==E?void 0:E.menuLabel},{children:"Send"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==E?void 0:E.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,s,o;return e.__generator(this,function(e){switch(e.label){case 0:t=new _.default.Converter,n=t.makeHtml(l.formatMarkdown(I.value)||I.value),r=function(e){var t=(new _.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(l.formatMarkdown(I.value)||I.value),s=new ClipboardItem({"text/plain":new Blob([r],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([s])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return o=e.sent(),console.error("Failed to copy user story:",o),[3,5];case 4:return ie(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==E?void 0:E.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Copy,{size:16,color:null==E?void 0:E.menuIconColor}),t.jsx("p",e.__assign({style:null==E?void 0:E.menuLabel},{children:"Copy"}))]}))}))]}))]}),H.userStory&&G?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==E?void 0:E.cancelButton,onClick:function(){F(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),H.userStory&&G?t.jsx(d.default,{type:"fill",children:te?t.jsxs("span",e.__assign({className:a.default.savingSpinner},{children:[t.jsx(r.LoaderCircle,{className:a.default.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:te,style:null==E?void 0:E.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(t){switch(t.label){case 0:return ne(!0),"userStory"==="userStory"&&(C(W),console.log("I am changing RTE editor values",W)),[4,q(R,V,x)];case 1:return t.sent(),F(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),ne(!1),[2]}})})}}):!b&&!D&&G&&t.jsx("button",e.__assign({className:a.default.iconButton,style:null==E?void 0:E.editButton,onClick:function(){return F(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(r.PencilIcon,{color:null==E?void 0:E.pencilIconColor,size:16})})),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),ae()},style:null==E?void 0:E.chevronButton,className:a.default.chevronButton},{children:G?t.jsx(r.ChevronUp,{className:a.default.chevronIcon,color:null==E?void 0:E.chevronIconColor}):t.jsx(r.ChevronDown,{className:a.default.chevronIcon,color:null==E?void 0:E.chevronIconColor})}))]}))]})),t.jsx("div",{className:a.default.divider,style:null==E?void 0:E.dividerStyle})]})),G&&t.jsx("div",e.__assign({className:a.default.cardContent,style:null==E?void 0:E.cardContentStyle},{children:t.jsxs("div",e.__assign({className:a.default.contentInner,style:null==E?void 0:E.contentInner},{children:[t.jsxs("div",e.__assign({className:a.default.descriptionSection,style:null==E?void 0:E.descriptionSection},{children:[t.jsx("div",{className:a.default.justifyBetween,style:null==E?void 0:E.justifyBetween}),H.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:l.formatMarkdown(I.value)||"",handleUpdateState:function(t,n){var r=l.indentMarkdown(n);z(function(t){return e.__assign(e.__assign({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:H.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:D,isParent:""===w,message:l.formatMarkdown(I.value)||"",artifactId:I.artifactId,customStyles:L})]})),null===(y=W.sub_features)||void 0===y?void 0:y.map(function(n,r){return t.jsx(S,{artifactId:x,isUserStoryCurrentlyUpdated:p,artifactTitleId:"".concat(g,"-").concat(String.fromCharCode(65+r)),parentUserStory:I,parentIndex:"".concat(w).concat(w&&".").concat(U),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var r=e.__spreadArray([],I.sub_features||[],!0);r[t]=n,C(e.__assign(e.__assign({},I),{sub_features:r}))}(r,t)},enableDownload:!0,isDiffEditReviewMode:b,showUserStoryDiff:D,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:k},n.artifactId)})]}))}))]}))};exports.StoryCard=S,exports.UserStoryCardWrapper=function(n){var r=n.artifactTitleIDs,s=n.isDiffEditReviewMode,o=n.showUserStoryDiff,i=n.updateUserStoryArtifact,l=n.isUserStoryCurrentlyUpdated,u=n.artifactId,d=n.handleOpenSendDialog,c=n.handleDownloadUserStory,f=v.useRequirementAI(),y=f.userStory,_=f.setUserStory,m=f.customStyles,h=null==m?void 0:m.userStoryCardStyles;return t.jsx("div",e.__assign({className:a.default.userStoryCardWrapper,style:null==h?void 0:h.userStoryCardWrapper},{children:y.map(function(n,a){return t.jsx(S,{isUserStoryCurrentlyUpdated:l,artifactId:u,artifactTitleId:r[a]||"",currentUserStory:n,onUserStoryChange:function(t){_(function(n){return n[a]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(a+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:o,updateUserStoryArtifact:i,handleOpenSendDialog:d,handleDownloadUserStory:c},n.artifactId)})}))},exports.default=S,exports.replaceLearnedTagsWithInfo=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),r=require("lucide-react"),s=require("showdown"),o=require("@mui/material"),i=require("uuid"),a=require("./UserStoryCard.module.css.js"),l=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=y(s);function m(n){for(var s,a=[],l=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(s=l.exec(n));){var c=s[1],f=s.index;f>u&&a.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),a.push(t.jsx(o.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(r.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(i.v4()))),u=l.lastIndex}return u<(null==n?void 0:n.length)&&a.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),a}var h=function(n){var s,o=n.displayName,i=v.useRequirementAI().customStyles,l=null===(s=null==i?void 0:i.userStoryCardStyles)||void 0===s?void 0:s.showDisplayName;return t.jsxs("div",e.__assign({className:a.default.displayName,style:null==l?void 0:l.wrapper},{children:[t.jsx(r.Bookmark,{className:a.default.displayNameIcon,style:null==l?void 0:l.displayNameIcon}),t.jsxs("span",e.__assign({style:null==l?void 0:l.label},{children:[o,":"]}))]}))},S=function(s){var i,y,p=s.isUserStoryCurrentlyUpdated,x=s.artifactId,g=s.artifactTitleId,I=s.parentUserStory,j=s.currentUserStory,C=s.onUserStoryChange,w=s.parentIndex,U=s.currentIndex,N=s.enableDownload,b=s.isDiffEditReviewMode,D=s.showUserStoryDiff,M=s.handleDownloadUserStory,k=s.handleOpenSendDialog,q=s.updateUserStoryArtifact,A=s.selectedArtifactId,B=v.useRequirementAI(),R=B.searchQueryList,T=B.citations,E=B.customStyles,L=null==E?void 0:E.userStoryCardStyles,P=null===(i=null==E?void 0:E.userStoryScreenStyles)||void 0===i?void 0:i.userStoryContentStyles,W=n.useState(e.__assign(e.__assign({},structuredClone(j)),{value:l.formatMarkdown(j.value)||""})),z=W[0],O=W[1],H=n.useState({userStory:!1}),F=H[0],V=H[1],Q=v.useRequirementAI().userStory,G=n.useState(""===w||A===j.artifactId),J=G[0],K=G[1],X=n.useState(!1);X[0];var Y=X[1],Z=n.useState(null),$=Z[0],ee=Z[1],te=n.useState(!1),ne=te[0],re=te[1],se=n.useRef(null),oe=n.useState(!1);oe[0];var ie=oe[1];n.useEffect(function(){p&&K(p)},[p]),n.useEffect(function(){O(e.__assign(e.__assign({},structuredClone(j)),{value:l.formatMarkdown(j.value)||""}))},[j]),n.useEffect(function(){R.length>0?K(!0):A&&K(A===j.artifactId)},[R,A,j.artifactId]);var ae=function(){ee(null)},le=function(){K(function(e){return!e})};return t.jsxs("div",e.__assign({className:a.default.card,style:null==L?void 0:L.cardStyle},{children:[t.jsxs("div",e.__assign({className:a.default.titleSection,style:null==L?void 0:L.titleSection},{children:[t.jsxs("div",e.__assign({className:a.default.titleRow,style:null==L?void 0:L.titleRow,onClick:le},{children:[t.jsxs("div",e.__assign({className:a.default.titleLeft,style:null==L?void 0:L.titleLeft,onMouseEnter:function(){return ie(!0)},onMouseLeave:function(){return ie(!1)}},{children:[t.jsx(h,{displayName:g}),t.jsx("h2",e.__assign({className:a.default.storyTitle,style:null==L?void 0:L.storyTitle},{children:m(j.title)}),j.artifactId)]})),t.jsxs("div",e.__assign({className:a.default.titleActions,style:null==L?void 0:L.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!F.userStory&&t.jsxs(t.Fragment,{children:[t.jsx("button",e.__assign({className:a.default.iconButton,style:null==L?void 0:L.iconButton,onClick:function(e){ee(e.currentTarget)}},{children:t.jsx(r.ExternalLink,{size:16})})),t.jsxs(o.Menu,e.__assign({id:"user-story-share-menu",anchorEl:$,open:!!$,onClose:function(){return ee(null)},style:null==L?void 0:L.userStoryShareMenu},{children:[N&&t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return Y(!0),M?[4,Promise.all([M("pdf"),M("doc")])]:[2];case 1:return e.sent(),Y(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:se,className:a.default.menuItemContent,style:null==L?void 0:L.menuItemContent},{children:[t.jsx(r.Download,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Download"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=j,I&&(t=e.__assign(e.__assign({},j),{value:"".concat(u.replaceTitleSection(null==I?void 0:I.value,j.title)," \n").concat(j.value)})),null==k||k(!0,[t],j.artifactId),ae(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==L?void 0:L.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Share2,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Send"}))]}))})),t.jsx(o.MenuItem,e.__assign({style:null==L?void 0:L.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,r,s,o;return e.__generator(this,function(e){switch(e.label){case 0:t=new _.default.Converter,n=t.makeHtml(l.formatMarkdown(j.value)||j.value),r=function(e){var t=(new _.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(l.formatMarkdown(j.value)||j.value),s=new ClipboardItem({"text/plain":new Blob([r],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([s])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return o=e.sent(),console.error("Failed to copy user story:",o),[3,5];case 4:return ae(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==L?void 0:L.menuItemContent,className:a.default.menuItemContentPadded},{children:[t.jsx(r.Copy,{size:16,color:null==L?void 0:L.menuIconColor}),t.jsx("p",e.__assign({style:null==L?void 0:L.menuLabel},{children:"Copy"}))]}))}))]}))]}),F.userStory&&J?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==L?void 0:L.cancelButton,onClick:function(){V(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),F.userStory&&J?t.jsx(d.default,{type:"fill",children:ne?t.jsxs("span",e.__assign({className:a.default.savingSpinner},{children:[t.jsx(r.LoaderCircle,{className:a.default.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:ne,style:null==L?void 0:L.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(t){switch(t.label){case 0:return re(!0),"userStory"==="userStory"&&(C(z),console.log("I am changing RTE editor values",z)),[4,q(T,Q,x)];case 1:return t.sent(),V(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),re(!1),[2]}})})}}):!b&&!D&&J&&t.jsx("button",e.__assign({className:a.default.iconButton,style:null==L?void 0:L.editButton,onClick:function(){return V(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(r.PencilIcon,{color:null==L?void 0:L.pencilIconColor,size:16})})),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),le()},style:null==L?void 0:L.chevronButton,className:a.default.chevronButton},{children:J?t.jsx(r.ChevronUp,{className:a.default.chevronIcon,color:null==L?void 0:L.chevronIconColor}):t.jsx(r.ChevronDown,{className:a.default.chevronIcon,color:null==L?void 0:L.chevronIconColor})}))]}))]})),t.jsx("div",{className:a.default.divider,style:null==L?void 0:L.dividerStyle})]})),J&&t.jsx("div",e.__assign({className:a.default.cardContent,style:null==L?void 0:L.cardContentStyle},{children:t.jsxs("div",e.__assign({className:a.default.contentInner,style:null==L?void 0:L.contentInner},{children:[t.jsxs("div",e.__assign({className:a.default.descriptionSection,style:null==L?void 0:L.descriptionSection},{children:[t.jsx("div",{className:a.default.justifyBetween,style:null==L?void 0:L.justifyBetween}),F.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:l.formatMarkdown(j.value)||"",handleUpdateState:function(t,n){var r=l.indentMarkdown(n);O(function(t){return e.__assign(e.__assign({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:F.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:D,isParent:""===w,message:l.formatMarkdown(j.value)||"",artifactId:j.artifactId,customStyles:P})]})),null===(y=z.sub_features)||void 0===y?void 0:y.map(function(n,r){return t.jsx(S,{artifactId:x,isUserStoryCurrentlyUpdated:p,artifactTitleId:"".concat(g,"-").concat(String.fromCharCode(65+r)),parentUserStory:j,parentIndex:"".concat(w).concat(w&&".").concat(U),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var r=e.__spreadArray([],j.sub_features||[],!0);r[t]=n,C(e.__assign(e.__assign({},j),{sub_features:r}))}(r,t)},enableDownload:!0,isDiffEditReviewMode:b,showUserStoryDiff:D,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:k},n.artifactId)})]}))}))]}))};exports.StoryCard=S,exports.UserStoryCardWrapper=function(n){var r=n.artifactTitleIDs,s=n.isDiffEditReviewMode,o=n.showUserStoryDiff,i=n.updateUserStoryArtifact,l=n.isUserStoryCurrentlyUpdated,u=n.artifactId,d=n.handleOpenSendDialog,c=n.handleDownloadUserStory,f=n.selectedArtifactId,y=v.useRequirementAI(),_=y.userStory,m=y.setUserStory,h=y.customStyles,p=null==h?void 0:h.userStoryCardStyles;return t.jsx("div",e.__assign({className:a.default.userStoryCardWrapper,style:null==p?void 0:p.userStoryCardWrapper},{children:_.map(function(n,a){return t.jsx(S,{isUserStoryCurrentlyUpdated:l,artifactId:u,artifactTitleId:r[a]||"",currentUserStory:n,onUserStoryChange:function(t){m(function(n){return n[a]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(a+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:s,showUserStoryDiff:o,updateUserStoryArtifact:i,handleOpenSendDialog:d,handleDownloadUserStory:c,selectedArtifactId:f},n.artifactId)})}))},exports.default=S,exports.replaceLearnedTagsWithInfo=m;
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),o=require("../../utils/userstory-approval.utils.js"),i=require("../../hooks/useApprovalStatus.js"),s=require("./components/ContentSegment/ContentSegment.js"),l=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),c=require("../../icons/CheckIcon.js"),u=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),g={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},f={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"},h=Object.assign(function(s){var l,c=s.artifactTitleIds,u=s.config,v=void 0===u?{}:u,p=s.callbacks,h=void 0===p?{}:p,m=s.labels,_=void 0===m?{}:m,y=s.isDisabled,A=void 0!==y&&y,b=s.children,I=s.classNames,C=a.useRequirementAI(),x=C.userStory,j=C.customStyles,U=e.__assign(e.__assign({},g),v),w=e.__assign(e.__assign({},f),_),k=r.useState([]),E=k[0],q=k[1],N=r.useState(""),F=N[0],T=N[1],D=r.useState(""),R=D[0],B=D[1],M=r.useState(!1),P=M[0],W=M[1],O=r.useState(!0),V=O[0],z=O[1],L=r.useRef(void 0),H=r.useCallback(function(e,t,r,a){h.onShowNotification?h.onShowNotification(e,t,r,a):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(r))},[h]),G=r.useCallback(function(e){h.onScrollToElement?h.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[h]),Y=r.useMemo(function(){var e=E.findIndex(function(e){return e.artifactId===F});return e>=0?e:0},[E,F]),J=E[Y];r.useEffect(function(){L.current=J},[J]),r.useEffect(function(){var e;(null==x?void 0:x.length)&&(null===(e=h.onInitialize)||void 0===e||e.call(h),1===x.length&&z(!1),x.length>0&&!F&&T(x[0].artifactId))},[x]),r.useEffect(function(){var e=n.createUserStoriesForApproval(n.cloneUserStories(x));q(e)},[]),r.useEffect(function(){if(J){var e=o.getFirstNonApprovedSegmentId(J,"");B(e)}},[null==J?void 0:J.artifactId]);var K=r.useCallback(function(t,r){q(function(a){var n=e.__spreadArray([],a,!0);if("APPROVED"===r.approval_status&&"APPROVED"!==a[t].approval_status){var i=o.getFirstUnapprovedStoryId(a,r.artifactId);i&&T(i)}return n[t]=r,n})},[]),Q=r.useCallback(function(e){var t=L.current;if(t){var r=o.getFirstNonApprovedSegmentId(t,e);"NA"!==r&&(B(""),setTimeout(function(){B(r)},0))}},[]);i.useApprovalStatus({userStoryForApproval:E,selectedUserStoryForApproval:J,userStoryIndex:Y,callbacks:h,labels:w,onSaveUserStory:K});var X=e.__assign({height:U.containerHeight},U.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),Z={userStoryForApproval:E,setUserStoryForApproval:q,selectedStoryArtifactId:F,setSelectedStoryArtifactId:T,selectedUserStoryIndex:Y,selectedUserStoryForApproval:J,currentContentId:R,setCurrentContentId:B,isEditingSegment:P,setIsEditingSegment:W,isSidebarExpanded:V,setIsSidebarExpanded:z,artifactTitleIds:c,config:U,labels:w,callbacks:h,isDisabled:A,handleSaveUserStory:K,handleUpdateContentId:Q,showNotification:H,scrollToElement:G};return t.jsx(S.UserStoryApprovalScreenContext.Provider,e.__assign({value:Z},{children:t.jsx("div",e.__assign({className:"".concat(d.default.container," ").concat((null==I?void 0:I.container)||""),style:e.__assign(e.__assign({},X),null===(l=null==j?void 0:j.approvalScreen)||void 0===l?void 0:l.wrapperContainer)},{children:b}))}))},{Sidebar:function(e){var r=e.Component,a=e.config,n=e.className,o=S.useUserStoryApprovalScreen(),i=o.isSidebarExpanded,s=o.selectedStoryArtifactId,l=o.setSelectedStoryArtifactId,d=o.userStoryForApproval,c=o.isEditingSegment,u=o.artifactTitleIds;return r?t.jsx(r,{isSidebarExpanded:i,selectedStoryArtifactId:s,setSelectedStoryArtifactId:l,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:u}):t.jsx(v.ApprovalSidebar,{config:a,className:n})},SidebarToggle:function(r){var a=r.OpenIcon,n=r.CloseIcon,o=r.className,i=void 0===o?"":o,s=S.useUserStoryApprovalScreen(),l=s.isSidebarExpanded,c=s.setIsSidebarExpanded,u=a||p.SidebarOpenIcon,v=n||p.SidebarCloseIcon;return t.jsx("div",e.__assign({className:"".concat(d.default.sidebarToggleWrapper," ").concat(i)},{children:t.jsx("button",e.__assign({onClick:function(){return c(function(e){return!e})},className:d.default.sidebarToggleBtn,"aria-label":l?"Collapse sidebar":"Expand sidebar",type:"button"},{children:l?t.jsx(v,{}):t.jsx(u,{})}))}))},Content:function(n){var i,s,v,p,g,f,h,m,_,y,A,b,I,C,x,j,U,w,k,E,q,N=n.children,F=n.ButtonComponent,T=n.hideApproveAll,D=void 0!==T&&T,R=n.pageTitle,B=void 0===R?"Review Generated Requirements":R,M=n.pageDescription,P=void 0===M?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":M,W=S.useUserStoryApprovalScreen(),O=W.selectedUserStoryForApproval,V=W.selectedUserStoryIndex,z=W.artifactTitleIds,L=W.labels,H=W.config,G=W.isDisabled,Y=W.isEditingSegment,J=W.handleSaveUserStory,K=W.setCurrentContentId,Q=W.showNotification,X=a.useRequirementAI().customStyles,Z=r.useCallback(function(){if(O)if(Y)Q("warn","Warning!",L.unsavedChangesWarning,3e3);else{var e=o.approveAllSegments(O);J(V,e),K("")}},[O,V,Y,L,J,K,Q]);if(!O)return null;var $=z[V]||"",ee="APPROVED"===O.approval_status;return t.jsxs("div",e.__assign({className:d.default.content,style:e.__assign({},null===(s=null===(i=null==X?void 0:X.approvalScreen)||void 0===i?void 0:i.content)||void 0===s?void 0:s.content),"data-lsc-ui-page-title":B,"data-lsc-ui-page-description":P},{children:[t.jsxs("div",e.__assign({className:d.default.header,style:e.__assign({},null===(g=null===(p=null===(v=null==X?void 0:X.approvalScreen)||void 0===v?void 0:v.body)||void 0===p?void 0:p.contentSegment)||void 0===g?void 0:g.header)},{children:[t.jsxs("div",e.__assign({className:d.default.headerLeft,style:e.__assign({},null===(h=null===(f=null==X?void 0:X.approvalScreen)||void 0===f?void 0:f.content)||void 0===h?void 0:h.headerLeft)},{children:[t.jsxs("div",e.__assign({className:d.default.headerMeta,style:e.__assign({},null===(y=null===(_=null===(m=null==X?void 0:X.approvalScreen)||void 0===m?void 0:m.body)||void 0===_?void 0:_.contentSegment)||void 0===y?void 0:y.headerMeta)},{children:[t.jsx(u.BookmarkIcon,{size:16,color:(null===(I=null===(b=null===(A=null==X?void 0:X.approvalScreen)||void 0===A?void 0:A.body)||void 0===b?void 0:b.contentSegment)||void 0===I?void 0:I.bookMarkColor)||"#8C8C8C"}),t.jsx("h2",e.__assign({className:d.default.headerArtifactId,style:e.__assign({},null===(j=null===(x=null===(C=null==X?void 0:X.approvalScreen)||void 0===C?void 0:C.body)||void 0===x?void 0:x.contentSegment)||void 0===j?void 0:j.headerArtifactId)},{children:$}))]})),t.jsx("p",e.__assign({className:d.default.headerTitle,style:e.__assign({},null===(k=null===(w=null===(U=null==X?void 0:X.approvalScreen)||void 0===U?void 0:U.body)||void 0===w?void 0:w.contentSegment)||void 0===k?void 0:k.headerTitle)},{children:null==O?void 0:O.title}))]})),!D&&H.showApproveAllButton&&t.jsx("div",e.__assign({className:d.default.headerRight},{children:ee?t.jsx(l.ApprovalBadge,{status:"APPROVED",label:L.approved}):F?t.jsx(F,e.__assign({type:"fill",onClick:Z,isDisable:G,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:L.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:t.jsxs("div",e.__assign({className:d.default.approveAllContent},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))})):t.jsxs("button",e.__assign({onClick:Z,disabled:G,className:d.default.approveAllButtonDefault,style:e.__assign({},null===(q=null===(E=null==X?void 0:X.approvalScreen)||void 0===E?void 0:E.content)||void 0===q?void 0:q.approveAllButtonDefault)},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))}))]})),N]}))},Body:function(n){var o,i,l,c=n.children,u=n.EditorComponent,v=n.ViewerComponent,p=S.useUserStoryApprovalScreen(),g=p.selectedUserStoryForApproval,f=p.selectedUserStoryIndex,h=p.artifactTitleIds,m=p.handleSaveUserStory,_=a.useRequirementAI().customStyles,y=r.useCallback(function(e){m(f,e)},[f,m]),A=r.useCallback(function(t,r){var a;if(g){var n=e.__assign(e.__assign({},g),{sub_features:null===(a=g.sub_features)||void 0===a?void 0:a.map(function(e,a){return a===t?r:e})});m(f,n)}},[g,f,m]),b=r.useCallback(function(t){var r;if(g){var a=e.__assign(e.__assign({},g),{sub_features:null===(r=g.sub_features)||void 0===r?void 0:r.filter(function(e,r){return r!==t})});m(f,a)}},[g,f,m]);if(!g)return null;var I=h[f]||"";return t.jsxs("div",e.__assign({className:d.default.body,style:e.__assign({},null===(i=null===(o=null==_?void 0:_.approvalScreen)||void 0===o?void 0:o.body)||void 0===i?void 0:i.container)},{children:[t.jsx(s.ContentSegment,{userStoryForApproval:g,artifactTitleId:I,onSaveMainStoryContent:y,EditorComponent:u,ViewerComponent:v}),null===(l=g.sub_features)||void 0===l?void 0:l.map(function(e,r){return t.jsx(s.ContentSegment,{userStoryForApproval:e,artifactTitleId:"".concat(I," - ").concat(String.fromCharCode(65+r)),isSubFeature:!0,subFeatureIndex:r,onSaveSubFeature:A,onDeleteSubFeature:b,EditorComponent:u,ViewerComponent:v},e.artifactId)}),c]}))}});exports.default=h;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),n=require("../../utils/userstory-approval-transform.utils.js"),o=require("../../utils/userstory-approval.utils.js"),i=require("../../hooks/useApprovalStatus.js"),s=require("./components/ContentSegment/ContentSegment.js"),l=require("./components/ApprovalBadge/ApprovalBadge.js"),d=require("./UserStoryApprovalScreen.module.css.js"),c=require("../../icons/CheckIcon.js"),u=require("../../icons/BookmarkIcon.js"),v=require("./components/ApprovalSidebar/ApprovalSidebar.js"),p=require("lucide-react"),S=require("./UserStoryApprovalContext.js"),f={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},g={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"},h=Object.assign(function(s){var l,c=s.artifactTitleIds,u=s.config,v=void 0===u?{}:u,p=s.callbacks,h=void 0===p?{}:p,m=s.labels,_=void 0===m?{}:m,A=s.isDisabled,y=void 0!==A&&A,b=s.children,I=s.classNames,C=s.selectedArtifactId,x=a.useRequirementAI(),j=x.userStory,U=x.customStyles,w=e.__assign(e.__assign({},f),v),k=e.__assign(e.__assign({},g),_),E=r.useState([]),q=E[0],N=E[1],F=r.useState(""),T=F[0],D=F[1],R=r.useState(""),B=R[0],M=R[1],P=r.useState(!1),W=P[0],O=P[1],V=r.useState(!0),z=V[0],L=V[1],H=r.useRef(void 0),G=r.useCallback(function(e,t,r,a){h.onShowNotification?h.onShowNotification(e,t,r,a):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(r))},[h]),Y=r.useCallback(function(e){h.onScrollToElement?h.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[h]),J=r.useMemo(function(){var e=q.findIndex(function(e){return e.artifactId===T});return e>=0?e:0},[q,T]),K=q[J];r.useEffect(function(){H.current=K},[K]),r.useEffect(function(){var e;(null==j?void 0:j.length)&&(null===(e=h.onInitialize)||void 0===e||e.call(h),1===j.length&&L(!1),j.length>0&&!T&&D(C||j[0].artifactId))},[j,C]),r.useEffect(function(){C&&C!==T&&D(C)},[C,T]),r.useEffect(function(){var e=n.createUserStoriesForApproval(n.cloneUserStories(j));N(e)},[]),r.useEffect(function(){if(K){var e=o.getFirstNonApprovedSegmentId(K,"");M(e)}},[null==K?void 0:K.artifactId]);var Q=r.useCallback(function(t,r){N(function(a){var n=e.__spreadArray([],a,!0);if("APPROVED"===r.approval_status&&"APPROVED"!==a[t].approval_status){var i=o.getFirstUnapprovedStoryId(a,r.artifactId);i&&D(i)}return n[t]=r,n})},[]),X=r.useCallback(function(e){var t=H.current;if(t){var r=o.getFirstNonApprovedSegmentId(t,e);"NA"!==r&&(M(""),setTimeout(function(){M(r)},0))}},[]);i.useApprovalStatus({userStoryForApproval:q,selectedUserStoryForApproval:K,userStoryIndex:J,callbacks:h,labels:k,onSaveUserStory:Q});var Z=e.__assign({height:w.containerHeight},w.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),$={userStoryForApproval:q,setUserStoryForApproval:N,selectedStoryArtifactId:T,setSelectedStoryArtifactId:D,selectedUserStoryIndex:J,selectedUserStoryForApproval:K,currentContentId:B,setCurrentContentId:M,isEditingSegment:W,setIsEditingSegment:O,isSidebarExpanded:z,setIsSidebarExpanded:L,artifactTitleIds:c,config:w,labels:k,callbacks:h,isDisabled:y,handleSaveUserStory:Q,handleUpdateContentId:X,showNotification:G,scrollToElement:Y};return t.jsx(S.UserStoryApprovalScreenContext.Provider,e.__assign({value:$},{children:t.jsx("div",e.__assign({className:"".concat(d.default.container," ").concat((null==I?void 0:I.container)||""),style:e.__assign(e.__assign({},Z),null===(l=null==U?void 0:U.approvalScreen)||void 0===l?void 0:l.wrapperContainer)},{children:b}))}))},{Sidebar:function(e){var r=e.Component,a=e.config,n=e.className,o=S.useUserStoryApprovalScreen(),i=o.isSidebarExpanded,s=o.selectedStoryArtifactId,l=o.setSelectedStoryArtifactId,d=o.userStoryForApproval,c=o.isEditingSegment,u=o.artifactTitleIds;return r?t.jsx(r,{isSidebarExpanded:i,selectedStoryArtifactId:s,setSelectedStoryArtifactId:l,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:u}):t.jsx(v.ApprovalSidebar,{config:a,className:n})},SidebarToggle:function(r){var a=r.OpenIcon,n=r.CloseIcon,o=r.className,i=void 0===o?"":o,s=S.useUserStoryApprovalScreen(),l=s.isSidebarExpanded,c=s.setIsSidebarExpanded,u=a||p.SidebarOpenIcon,v=n||p.SidebarCloseIcon;return t.jsx("div",e.__assign({className:"".concat(d.default.sidebarToggleWrapper," ").concat(i)},{children:t.jsx("button",e.__assign({onClick:function(){return c(function(e){return!e})},className:d.default.sidebarToggleBtn,"aria-label":l?"Collapse sidebar":"Expand sidebar",type:"button"},{children:l?t.jsx(v,{}):t.jsx(u,{})}))}))},Content:function(n){var i,s,v,p,f,g,h,m,_,A,y,b,I,C,x,j,U,w,k,E,q,N=n.children,F=n.ButtonComponent,T=n.hideApproveAll,D=void 0!==T&&T,R=n.pageTitle,B=void 0===R?"Review Generated Requirements":R,M=n.pageDescription,P=void 0===M?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":M,W=S.useUserStoryApprovalScreen(),O=W.selectedUserStoryForApproval,V=W.selectedUserStoryIndex,z=W.artifactTitleIds,L=W.labels,H=W.config,G=W.isDisabled,Y=W.isEditingSegment,J=W.handleSaveUserStory,K=W.setCurrentContentId,Q=W.showNotification,X=a.useRequirementAI().customStyles,Z=r.useCallback(function(){if(O)if(Y)Q("warn","Warning!",L.unsavedChangesWarning,3e3);else{var e=o.approveAllSegments(O);J(V,e),K("")}},[O,V,Y,L,J,K,Q]);if(!O)return null;var $=z[V]||"",ee="APPROVED"===O.approval_status;return t.jsxs("div",e.__assign({className:d.default.content,style:e.__assign({},null===(s=null===(i=null==X?void 0:X.approvalScreen)||void 0===i?void 0:i.content)||void 0===s?void 0:s.content),"data-lsc-ui-page-title":B,"data-lsc-ui-page-description":P},{children:[t.jsxs("div",e.__assign({className:d.default.header,style:e.__assign({},null===(f=null===(p=null===(v=null==X?void 0:X.approvalScreen)||void 0===v?void 0:v.body)||void 0===p?void 0:p.contentSegment)||void 0===f?void 0:f.header)},{children:[t.jsxs("div",e.__assign({className:d.default.headerLeft,style:e.__assign({},null===(h=null===(g=null==X?void 0:X.approvalScreen)||void 0===g?void 0:g.content)||void 0===h?void 0:h.headerLeft)},{children:[t.jsxs("div",e.__assign({className:d.default.headerMeta,style:e.__assign({},null===(A=null===(_=null===(m=null==X?void 0:X.approvalScreen)||void 0===m?void 0:m.body)||void 0===_?void 0:_.contentSegment)||void 0===A?void 0:A.headerMeta)},{children:[t.jsx(u.BookmarkIcon,{size:16,color:(null===(I=null===(b=null===(y=null==X?void 0:X.approvalScreen)||void 0===y?void 0:y.body)||void 0===b?void 0:b.contentSegment)||void 0===I?void 0:I.bookMarkColor)||"#8C8C8C"}),t.jsx("h2",e.__assign({className:d.default.headerArtifactId,style:e.__assign({},null===(j=null===(x=null===(C=null==X?void 0:X.approvalScreen)||void 0===C?void 0:C.body)||void 0===x?void 0:x.contentSegment)||void 0===j?void 0:j.headerArtifactId)},{children:$}))]})),t.jsx("p",e.__assign({className:d.default.headerTitle,style:e.__assign({},null===(k=null===(w=null===(U=null==X?void 0:X.approvalScreen)||void 0===U?void 0:U.body)||void 0===w?void 0:w.contentSegment)||void 0===k?void 0:k.headerTitle)},{children:null==O?void 0:O.title}))]})),!D&&H.showApproveAllButton&&t.jsx("div",e.__assign({className:d.default.headerRight},{children:ee?t.jsx(l.ApprovalBadge,{status:"APPROVED",label:L.approved}):F?t.jsx(F,e.__assign({type:"fill",onClick:Z,isDisable:G,className:d.default.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:L.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:t.jsxs("div",e.__assign({className:d.default.approveAllContent},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))})):t.jsxs("button",e.__assign({onClick:Z,disabled:G,className:d.default.approveAllButtonDefault,style:e.__assign({},null===(q=null===(E=null==X?void 0:X.approvalScreen)||void 0===E?void 0:E.content)||void 0===q?void 0:q.approveAllButtonDefault)},{children:[t.jsx(c.CheckIcon,{size:16,color:"white"}),t.jsx("span",{children:L.approveAll})]}))}))]})),N]}))},Body:function(n){var o,i,l,c=n.children,u=n.EditorComponent,v=n.ViewerComponent,p=S.useUserStoryApprovalScreen(),f=p.selectedUserStoryForApproval,g=p.selectedUserStoryIndex,h=p.artifactTitleIds,m=p.handleSaveUserStory,_=a.useRequirementAI().customStyles,A=r.useCallback(function(e){m(g,e)},[g,m]),y=r.useCallback(function(t,r){var a;if(f){var n=e.__assign(e.__assign({},f),{sub_features:null===(a=f.sub_features)||void 0===a?void 0:a.map(function(e,a){return a===t?r:e})});m(g,n)}},[f,g,m]),b=r.useCallback(function(t){var r;if(f){var a=e.__assign(e.__assign({},f),{sub_features:null===(r=f.sub_features)||void 0===r?void 0:r.filter(function(e,r){return r!==t})});m(g,a)}},[f,g,m]);if(!f)return null;var I=h[g]||"";return t.jsxs("div",e.__assign({className:d.default.body,style:e.__assign({},null===(i=null===(o=null==_?void 0:_.approvalScreen)||void 0===o?void 0:o.body)||void 0===i?void 0:i.container)},{children:[t.jsx(s.ContentSegment,{userStoryForApproval:f,artifactTitleId:I,onSaveMainStoryContent:A,EditorComponent:u,ViewerComponent:v}),null===(l=f.sub_features)||void 0===l?void 0:l.map(function(e,r){return t.jsx(s.ContentSegment,{userStoryForApproval:e,artifactTitleId:"".concat(I," - ").concat(String.fromCharCode(65+r)),isSubFeature:!0,subFeatureIndex:r,onSaveSubFeature:y,onDeleteSubFeature:b,EditorComponent:u,ViewerComponent:v},e.artifactId)}),c]}))}});exports.default=h;
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as l,useState as d,useCallback as t,useMemo as a}from"react";import{Menu as r,CheckCircle2 as s,SidebarOpenIcon as c,SidebarCloseIcon as u}from"lucide-react";import v from"./components/StoryNode/StoryNode.js";import{useRequirementAI as p}from"../RequirementAIWrapper/RequirementAIWrapper.js";import m from"./GapRiskSidebar.module.css.js";var S=n(null),g=function(){var i=l(S);if(!i)throw new Error("GapRiskSidebar compound components must be used within <GapRiskSidebar.Root>");return i},y=function(i){return{title:i.title,artifactTitleID:i.artifactTitleID,id:i.id,display_items:i.gap_items||i.risk_items||{critical:[],warning:[],recommendation:[]},sub_feature:(i.sub_feature||[]).map(y)}};var h=function(n){var l=n.styles,d=n.CheckCircleIcon,t=n.iconColor,a=n.iconSize,r=d||s;return o("div",i({className:m.noGapsContainer,style:null==l?void 0:l.container},{children:[e("p",i({className:m.noGapsText,style:null==l?void 0:l.text},{children:"No Gaps Found"})),e(r,{className:m.noGapsIcon,style:i({color:t,width:a,height:a},null==l?void 0:l.icon)})]}))},b=Object.assign(function(o){var n,l,r=o.storyDetails,s=o.type,c=o.isSidebarExpanded,u=o.onToggleSidebar,v=o.defaultExpanded,m=void 0===v||v,g=o.onClickStoryNodeCallback,y=o.isProcessingGapItems,h=o.onClickAiReasoning,b=o.handleFixRisk,I=o.handleHighlightGapContent,C=o.customStyles,f=o.customIcons,k=o.sidebarWidth,N=o.headerTitle,G=o.children,x=function(){try{return p()}catch(i){return null}}(),R=d(m),T=R[0],W=R[1],E=void 0!==c,F=E?c:T,w=t(function(i){var o="function"==typeof i?i(F):i;E?null==u||u(o):W(o)},[E,F,u]),z=a(function(){var o,e,n,l,d,t,a,r,s,c,u,v,p;return i(i(i({},null===(o=null==x?void 0:x.customStyles)||void 0===o?void 0:o.gapSidebar),C),{gapRiskSidebar:i(i({},null===(n=null===(e=null==x?void 0:x.customStyles)||void 0===e?void 0:e.gapSidebar)||void 0===n?void 0:n.gapRiskSidebar),null==C?void 0:C.gapRiskSidebar),noGapsFound:i(i({},null===(d=null===(l=null==x?void 0:x.customStyles)||void 0===l?void 0:l.gapSidebar)||void 0===d?void 0:d.noGapsFound),null==C?void 0:C.noGapsFound),storyNode:i(i({},null===(a=null===(t=null==x?void 0:x.customStyles)||void 0===t?void 0:t.gapSidebar)||void 0===a?void 0:a.storyNode),null==C?void 0:C.storyNode),riskSidebarCategorySection:i(i({},null===(s=null===(r=null==x?void 0:x.customStyles)||void 0===r?void 0:r.gapSidebar)||void 0===s?void 0:s.riskSidebarCategorySection),null==C?void 0:C.riskSidebarCategorySection),riskCategorySection:i(i({},null===(u=null===(c=null==x?void 0:x.customStyles)||void 0===c?void 0:c.gapSidebar)||void 0===u?void 0:u.riskCategorySection),null==C?void 0:C.riskCategorySection),gapItem:i(i({},null===(p=null===(v=null==x?void 0:x.customStyles)||void 0===v?void 0:v.gapSidebar)||void 0===p?void 0:p.gapItem),null==C?void 0:C.gapItem)})},[null===(n=null==x?void 0:x.customStyles)||void 0===n?void 0:n.gapSidebar,C]),A=a(function(){var o,e,n,l,d,t;return{icons:i(i({},null===(e=null===(o=null==x?void 0:x.customIcons)||void 0===o?void 0:o.gapSidebarIcons)||void 0===e?void 0:e.icons),null==f?void 0:f.icons),iconSizes:i(i({},null===(l=null===(n=null==x?void 0:x.customIcons)||void 0===n?void 0:n.gapSidebarIcons)||void 0===l?void 0:l.iconSizes),null==f?void 0:f.iconSizes),iconColors:i(i({},null===(t=null===(d=null==x?void 0:x.customIcons)||void 0===d?void 0:d.gapSidebarIcons)||void 0===t?void 0:t.iconColors),null==f?void 0:f.iconColors)}},[null===(l=null==x?void 0:x.customIcons)||void 0===l?void 0:l.gapSidebarIcons,f]),D={isSidebarExpanded:F,setIsSidebarExpanded:w,storyDetails:r,type:s,isProcessingGapItems:y,onClickStoryNodeCallback:g,onClickAiReasoning:h,handleFixRisk:b,handleHighlightGapContent:I,mergedStyles:z,mergedIcons:A,sidebarWidth:k,headerTitle:N};return e(S.Provider,i({value:D},{children:G}))},{Panel:function(n){var l,d,t,s,c=n.className,u=void 0===c?"":c,p=n.style,S=g(),h=S.isSidebarExpanded,b=S.storyDetails,I=S.type,C=S.isProcessingGapItems,f=S.onClickStoryNodeCallback,k=S.onClickAiReasoning,N=S.handleFixRisk,G=S.handleHighlightGapContent,x=S.mergedStyles,R=S.mergedIcons,T=S.sidebarWidth,W=void 0===T?320:T,E=S.headerTitle,F=void 0===E?"Generated User Stories":E,w=x.gapRiskSidebar,z=(null===(l=R.icons)||void 0===l?void 0:l.menuIcon)||r,A=a(function(){return b.map(y)},[b]),D="number"==typeof W?"".concat(W,"px"):W;return e("div",i({className:"".concat(m.sidebarContainer," ").concat(h?m.sidebarExpanded:m.sidebarCollapsed," ").concat(u),style:i(i(i(i({},h?{width:D,minWidth:D}:{}),null==w?void 0:w.container),h?{}:null==w?void 0:w.containerCollapsed),p)},{children:o("div",i({className:m.sidebarInnerWrapper,style:i({minWidth:D},null==w?void 0:w.innerWrapper)},{children:[o("div",i({className:m.header,style:null==w?void 0:w.header},{children:[e(z,{className:m.headerMenuIcon,style:i({color:null===(d=R.iconColors)||void 0===d?void 0:d.menuIcon,width:null===(t=R.iconSizes)||void 0===t?void 0:t.menuIcon,height:null===(s=R.iconSizes)||void 0===s?void 0:s.menuIcon},null==w?void 0:w.headerMenuIcon)}),e("h2",i({className:m.headerTitle,style:null==w?void 0:w.headerTitle},{children:F}))]})),e("div",i({className:m.storyList,style:null==w?void 0:w.storyList},{children:A.map(function(o){return e("div",i({className:m.storyItemWrapper,style:null==w?void 0:w.storyItemWrapper},{children:e(v,{story:o,onClickStoryNodeCallback:f,type:I,isProcessingGapItems:C,onClickAiReasoning:k,handleFixRisk:N,handleHighlightGapContent:G,customStyles:x,customIcons:R})}),o.artifactTitleID)})}))]}))}))},Toggle:function(o){var n=o.OpenIcon,l=o.CloseIcon,d=o.className,t=void 0===d?"":d,a=g(),r=a.isSidebarExpanded,s=a.setIsSidebarExpanded,v=n||c,p=l||u;return e("div",i({className:"".concat(m.sidebarToggleWrapper," ").concat(t)},{children:e("button",i({onClick:function(){return s(function(i){return!i})},className:m.sidebarToggleBtn,"aria-label":r?"Collapse sidebar":"Expand sidebar",type:"button"},{children:e(r?p:v,{})}))}))}});export{h as NoGapsFound,b as default,g as useGapRiskSidebar};
1
+ import{__assign as i}from"tslib";import{jsxs as o,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as l,useState as t,useCallback as d,useMemo as a}from"react";import{Menu as r,CheckCircle2 as s,SidebarOpenIcon as c,SidebarCloseIcon as u}from"lucide-react";import v from"./components/StoryNode/StoryNode.js";import{useRequirementAI as p}from"../RequirementAIWrapper/RequirementAIWrapper.js";import m from"./GapRiskSidebar.module.css.js";var S=n(null),y=function(){var i=l(S);if(!i)throw new Error("GapRiskSidebar compound components must be used within <GapRiskSidebar.Root>");return i},g=function(i){return{title:i.title,artifactTitleID:i.artifactTitleID,id:i.id,display_items:i.gap_items||i.risk_items||{critical:[],warning:[],recommendation:[]},sub_feature:(i.sub_feature||[]).map(g)}};var h=function(n){var l=n.styles,t=n.CheckCircleIcon,d=n.iconColor,a=n.iconSize,r=t||s;return o("div",i({className:m.noGapsContainer,style:null==l?void 0:l.container},{children:[e("p",i({className:m.noGapsText,style:null==l?void 0:l.text},{children:"No Gaps Found"})),e(r,{className:m.noGapsIcon,style:i({color:d,width:a,height:a},null==l?void 0:l.icon)})]}))},b=Object.assign(function(o){var n,l,r=o.storyDetails,s=o.type,c=o.isSidebarExpanded,u=o.onToggleSidebar,v=o.defaultExpanded,m=void 0===v||v,y=o.onClickStoryNodeCallback,g=o.isProcessingGapItems,h=o.onClickAiReasoning,b=o.handleFixRisk,I=o.handleHighlightGapContent,C=o.customStyles,f=o.customIcons,k=o.sidebarWidth,N=o.headerTitle,G=o.onSelectStory,x=o.children,R=function(){try{return p()}catch(i){return null}}(),T=t(m),W=T[0],E=T[1],F=void 0!==c,w=F?c:W,z=d(function(i){var o="function"==typeof i?i(w):i;F?null==u||u(o):E(o)},[F,w,u]),A=a(function(){var o,e,n,l,t,d,a,r,s,c,u,v,p;return i(i(i({},null===(o=null==R?void 0:R.customStyles)||void 0===o?void 0:o.gapSidebar),C),{gapRiskSidebar:i(i({},null===(n=null===(e=null==R?void 0:R.customStyles)||void 0===e?void 0:e.gapSidebar)||void 0===n?void 0:n.gapRiskSidebar),null==C?void 0:C.gapRiskSidebar),noGapsFound:i(i({},null===(t=null===(l=null==R?void 0:R.customStyles)||void 0===l?void 0:l.gapSidebar)||void 0===t?void 0:t.noGapsFound),null==C?void 0:C.noGapsFound),storyNode:i(i({},null===(a=null===(d=null==R?void 0:R.customStyles)||void 0===d?void 0:d.gapSidebar)||void 0===a?void 0:a.storyNode),null==C?void 0:C.storyNode),riskSidebarCategorySection:i(i({},null===(s=null===(r=null==R?void 0:R.customStyles)||void 0===r?void 0:r.gapSidebar)||void 0===s?void 0:s.riskSidebarCategorySection),null==C?void 0:C.riskSidebarCategorySection),riskCategorySection:i(i({},null===(u=null===(c=null==R?void 0:R.customStyles)||void 0===c?void 0:c.gapSidebar)||void 0===u?void 0:u.riskCategorySection),null==C?void 0:C.riskCategorySection),gapItem:i(i({},null===(p=null===(v=null==R?void 0:R.customStyles)||void 0===v?void 0:v.gapSidebar)||void 0===p?void 0:p.gapItem),null==C?void 0:C.gapItem)})},[null===(n=null==R?void 0:R.customStyles)||void 0===n?void 0:n.gapSidebar,C]),D=a(function(){var o,e,n,l,t,d;return{icons:i(i({},null===(e=null===(o=null==R?void 0:R.customIcons)||void 0===o?void 0:o.gapSidebarIcons)||void 0===e?void 0:e.icons),null==f?void 0:f.icons),iconSizes:i(i({},null===(l=null===(n=null==R?void 0:R.customIcons)||void 0===n?void 0:n.gapSidebarIcons)||void 0===l?void 0:l.iconSizes),null==f?void 0:f.iconSizes),iconColors:i(i({},null===(d=null===(t=null==R?void 0:R.customIcons)||void 0===t?void 0:t.gapSidebarIcons)||void 0===d?void 0:d.iconColors),null==f?void 0:f.iconColors)}},[null===(l=null==R?void 0:R.customIcons)||void 0===l?void 0:l.gapSidebarIcons,f]),P={isSidebarExpanded:w,setIsSidebarExpanded:z,storyDetails:r,type:s,isProcessingGapItems:g,onClickStoryNodeCallback:y,onClickAiReasoning:h,handleFixRisk:b,handleHighlightGapContent:I,mergedStyles:A,mergedIcons:D,sidebarWidth:k,headerTitle:N,onSelectStory:G};return e(S.Provider,i({value:P},{children:x}))},{Panel:function(n){var l,t,d,s,c=n.className,u=void 0===c?"":c,p=n.style,S=y(),h=S.isSidebarExpanded,b=S.storyDetails,I=S.type,C=S.isProcessingGapItems,f=S.onClickStoryNodeCallback,k=S.onClickAiReasoning,N=S.handleFixRisk,G=S.handleHighlightGapContent,x=S.mergedStyles,R=S.mergedIcons,T=S.sidebarWidth,W=void 0===T?320:T,E=S.headerTitle,F=void 0===E?"Generated User Stories":E,w=S.onSelectStory,z=x.gapRiskSidebar,A=(null===(l=R.icons)||void 0===l?void 0:l.menuIcon)||r,D=a(function(){return b.map(g)},[b]),P="number"==typeof W?"".concat(W,"px"):W;return e("div",i({className:"".concat(m.sidebarContainer," ").concat(h?m.sidebarExpanded:m.sidebarCollapsed," ").concat(u),style:i(i(i(i({},h?{width:P,minWidth:P}:{}),null==z?void 0:z.container),h?{}:null==z?void 0:z.containerCollapsed),p)},{children:o("div",i({className:m.sidebarInnerWrapper,style:i({minWidth:P},null==z?void 0:z.innerWrapper)},{children:[o("div",i({className:m.header,style:null==z?void 0:z.header},{children:[e(A,{className:m.headerMenuIcon,style:i({color:null===(t=R.iconColors)||void 0===t?void 0:t.menuIcon,width:null===(d=R.iconSizes)||void 0===d?void 0:d.menuIcon,height:null===(s=R.iconSizes)||void 0===s?void 0:s.menuIcon},null==z?void 0:z.headerMenuIcon)}),e("h2",i({className:m.headerTitle,style:null==z?void 0:z.headerTitle},{children:F}))]})),e("div",i({className:m.storyList,style:null==z?void 0:z.storyList},{children:D.map(function(o){return e("div",i({className:m.storyItemWrapper,style:null==z?void 0:z.storyItemWrapper},{children:e(v,{story:o,onClickStoryNodeCallback:f,type:I,isProcessingGapItems:C,onClickAiReasoning:k,handleFixRisk:N,handleHighlightGapContent:G,customStyles:x,customIcons:R,onSelectStory:w})}),o.artifactTitleID)})}))]}))}))},Toggle:function(o){var n=o.OpenIcon,l=o.CloseIcon,t=o.className,d=void 0===t?"":t,a=y(),r=a.isSidebarExpanded,s=a.setIsSidebarExpanded,v=n||c,p=l||u;return e("div",i({className:"".concat(m.sidebarToggleWrapper," ").concat(d)},{children:e("button",i({onClick:function(){return s(function(i){return!i})},className:m.sidebarToggleBtn,"aria-label":r?"Collapse sidebar":"Expand sidebar",type:"button"},{children:e(r?p:v,{})}))}))}});export{h as NoGapsFound,b as default,y as useGapRiskSidebar};
2
2
  //# sourceMappingURL=GapRiskSidebar.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as i}from"tslib";import{jsxs as n,jsx as o,Fragment as l}from"react/jsx-runtime";import{useState as e,useMemo as t}from"react";import{Bookmark as s,ChevronDown as a,ChevronRight as d,Info as r}from"lucide-react";import{Tooltip as c}from"@mui/material";import{v4 as u}from"uuid";import v from"../RiskSidebarCategorySection/RiskSidebarCategorySection.js";import m from"../RiskCategorySection/RiskCategorySection.js";import h from"./StoryNode.module.css.js";var g=function(i){var n,o,l,e,t,s,a,d=(null===(o=null===(n=i.display_items)||void 0===n?void 0:n.critical)||void 0===o?void 0:o.length)||0,r=(null===(e=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===e?void 0:e.length)||0,c=(null===(s=null===(t=i.display_items)||void 0===t?void 0:t.recommendation)||void 0===s?void 0:s.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var u=0,v=i.sub_feature;u<v.length;u++){var m=v[u],h=g(m);d+=h.critical,r+=h.warning,c+=h.recommendation}return{critical:d,warning:r,recommendation:c}};function p(n,l,e,t){for(var s,a=[],d=/<learned>(.*?)<\/learned>/g,v=0,m=0,g=l||r;null!==(s=d.exec(n));){s[0];var p=s[1],y=s.index;y>v&&a.push(o("span",{children:n.slice(v,y)},"text-pre-".concat(m++))),a.push(o(c,i({title:p,placement:"top"},{children:o(g,{size:t||16,className:h.infoIcon,style:{color:e,width:t,height:t}})}),"tooltip-".concat(u()))),v=d.lastIndex}return v<(null==n?void 0:n.length)&&a.push(o("span",{children:n.slice(v)},"text-post-".concat(m++))),a}var y=function(r){var u,C,f,I,S,k,b,w,N,R,_,x,G,z,W,F,H,P,A,j,L,O,B,D,M=r.story,T=r.depth,E=void 0===T?0:T,J=r.onClickStoryNodeCallback,q=r.type,K=r.isProcessingGapItems,Q=r.onClickAiReasoning,U=r.handleFixRisk,V=r.handleHighlightGapContent,X=r.customStyles,Y=r.customIcons,Z=e(0===E),$=Z[0],ii=Z[1],ni=e(!1),oi=ni[0],li=ni[1],ei=null==X?void 0:X.storyNode,ti=(null===(u=null==Y?void 0:Y.icons)||void 0===u?void 0:u.bookmarkIcon)||s,si=(null===(C=null==Y?void 0:Y.icons)||void 0===C?void 0:C.chevronDownIcon)||a,ai=(null===(f=null==Y?void 0:Y.icons)||void 0===f?void 0:f.chevronRightIcon)||d,di=t(function(){return M.display_items.critical.length>0?"Critical":M.display_items.warning.length>0?"Warning":M.display_items.recommendation.length>0?"Suggestion":null},[M.display_items,q]),ri=t(function(){return g(M)},[M]),ci=0===((null===(S=null===(I=M.display_items)||void 0===I?void 0:I.critical)||void 0===S?void 0:S.length)||0)+((null===(b=null===(k=M.display_items)||void 0===k?void 0:k.warning)||void 0===b?void 0:b.length)||0)+((null===(N=null===(w=M.display_items)||void 0===w?void 0:w.recommendation)||void 0===N?void 0:N.length)||0);return n("div",i({className:"".concat(h.container," ").concat(E>0?h.nestedContainer:""),style:i(i({},null==ei?void 0:ei.container),E>0?null==ei?void 0:ei.nestedContainer:{})},{children:[n("div",i({onClick:function(){ii(!$),null==J||J()},className:h.headerRow,style:i(i({},null==ei?void 0:ei.headerRow),oi?null==ei?void 0:ei.headerRowHover:{}),onMouseEnter:function(){return li(!0)},onMouseLeave:function(){return li(!1)}},{children:[o("div",i({className:h.chevronWrapper,style:null==ei?void 0:ei.chevronWrapper},{children:$?o(si,{className:h.chevronIcon,style:{color:null===(R=null==Y?void 0:Y.iconColors)||void 0===R?void 0:R.chevronIcon,width:null===(_=null==Y?void 0:Y.iconSizes)||void 0===_?void 0:_.chevronIcon,height:null===(x=null==Y?void 0:Y.iconSizes)||void 0===x?void 0:x.chevronIcon}}):o(ai,{className:h.chevronIcon,style:{color:null===(G=null==Y?void 0:Y.iconColors)||void 0===G?void 0:G.chevronIcon,width:null===(z=null==Y?void 0:Y.iconSizes)||void 0===z?void 0:z.chevronIcon,height:null===(W=null==Y?void 0:Y.iconSizes)||void 0===W?void 0:W.chevronIcon}})})),n("div",i({className:h.headerContent,style:null==ei?void 0:ei.headerContent},{children:[n("div",i({className:h.artifactIdRow,style:null==ei?void 0:ei.artifactIdRow},{children:[o(ti,{className:h.bookmarkIcon,style:{color:null===(F=null==Y?void 0:Y.iconColors)||void 0===F?void 0:F.bookmarkIcon,width:null===(H=null==Y?void 0:Y.iconSizes)||void 0===H?void 0:H.bookmarkIcon,height:null===(P=null==Y?void 0:Y.iconSizes)||void 0===P?void 0:P.bookmarkIcon}}),o("span",i({style:null==ei?void 0:ei.artifactIdText},{children:M.artifactTitleID}))]})),o(c,i({title:p(M.title,null===(A=null==Y?void 0:Y.icons)||void 0===A?void 0:A.infoIcon,null===(j=null==Y?void 0:Y.iconColors)||void 0===j?void 0:j.infoIcon,null===(L=null==Y?void 0:Y.iconSizes)||void 0===L?void 0:L.infoIcon),arrow:!0},{children:o("h3",i({className:h.title,style:i(i({},null==ei?void 0:ei.title),oi?null==ei?void 0:ei.titleHover:{})},{children:p(M.title,null===(O=null==Y?void 0:Y.icons)||void 0===O?void 0:O.infoIcon,null===(B=null==Y?void 0:Y.iconColors)||void 0===B?void 0:B.infoIcon,null===(D=null==Y?void 0:Y.iconSizes)||void 0===D?void 0:D.infoIcon)}))})),!$&&o("div",i({className:h.collapsedSummary,style:null==ei?void 0:ei.collapsedSummary},{children:(0===E||ri.critical+ri.warning+ri.recommendation>0)&&n(l,{children:[o("span",i({className:h.summaryLabel,style:null==ei?void 0:ei.summaryLabel},{children:"Gap"===q?"Gaps : ":"Risks : "})),n("div",i({className:h.summaryBadgesContainer,style:null==ei?void 0:ei.summaryBadgesContainer},{children:[ri.critical>0&&o(v,{title:"Critical",length:ri.critical,badgeColorClass:"critical",customStyles:X}),ri.warning>0&&o(v,{title:"Warning",length:ri.warning,badgeColorClass:"warning",customStyles:X}),ri.recommendation>0&&o(v,{title:"JAS",length:ri.recommendation,badgeColorClass:"suggestion",customStyles:X})]}))]})}))]}))]})),$&&n("div",i({className:h.expandedContent,style:null==ei?void 0:ei.expandedContent},{children:[o("div",i({className:h.expandedInnerPadding,style:null==ei?void 0:ei.expandedInnerPadding},{children:!ci&&n("div",i({className:h.itemsContainer,style:null==ei?void 0:ei.itemsContainer},{children:[o(m,{title:"Critical",items:M.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===di,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Warning",items:M.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===di,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Suggestion",items:M.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===di,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y})]}))})),M.sub_feature&&M.sub_feature.length>0&&o("div",i({className:h.subFeaturesWrapper,style:null==ei?void 0:ei.subFeaturesWrapper},{children:M.sub_feature.map(function(i,n){return o(y,{story:i,depth:E+1,onClickStoryNodeCallback:J,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y},n)})}))]}))]}))};export{y as default,p as replaceLearnedTagsWithInfo};
1
+ import{__assign as i}from"tslib";import{jsxs as n,jsx as o,Fragment as l}from"react/jsx-runtime";import{useState as e,useMemo as t}from"react";import{Bookmark as s,ChevronDown as a,ChevronRight as d,Info as r}from"lucide-react";import{Tooltip as c}from"@mui/material";import{v4 as u}from"uuid";import v from"../RiskSidebarCategorySection/RiskSidebarCategorySection.js";import m from"../RiskCategorySection/RiskCategorySection.js";import h from"./StoryNode.module.css.js";var g=function(i){var n,o,l,e,t,s,a,d=(null===(o=null===(n=i.display_items)||void 0===n?void 0:n.critical)||void 0===o?void 0:o.length)||0,r=(null===(e=null===(l=i.display_items)||void 0===l?void 0:l.warning)||void 0===e?void 0:e.length)||0,c=(null===(s=null===(t=i.display_items)||void 0===t?void 0:t.recommendation)||void 0===s?void 0:s.length)||0;if((null===(a=i.sub_feature)||void 0===a?void 0:a.length)>0)for(var u=0,v=i.sub_feature;u<v.length;u++){var m=v[u],h=g(m);d+=h.critical,r+=h.warning,c+=h.recommendation}return{critical:d,warning:r,recommendation:c}};function p(n,l,e,t){for(var s,a=[],d=/<learned>(.*?)<\/learned>/g,v=0,m=0,g=l||r;null!==(s=d.exec(n));){s[0];var p=s[1],y=s.index;y>v&&a.push(o("span",{children:n.slice(v,y)},"text-pre-".concat(m++))),a.push(o(c,i({title:p,placement:"top"},{children:o(g,{size:t||16,className:h.infoIcon,style:{color:e,width:t,height:t}})}),"tooltip-".concat(u()))),v=d.lastIndex}return v<(null==n?void 0:n.length)&&a.push(o("span",{children:n.slice(v)},"text-post-".concat(m++))),a}var y=function(r){var u,C,f,I,S,k,b,w,N,R,_,x,G,z,A,W,F,H,P,j,L,O,B,D,M=r.story,T=r.depth,E=void 0===T?0:T,J=r.onClickStoryNodeCallback,q=r.type,K=r.isProcessingGapItems,Q=r.onClickAiReasoning,U=r.handleFixRisk,V=r.handleHighlightGapContent,X=r.customStyles,Y=r.customIcons,Z=r.onSelectStory,$=r.rootArtifactId,ii=void 0===$?M.id:$,ni=e(0===E),oi=ni[0],li=ni[1],ei=e(!1),ti=ei[0],si=ei[1],ai=null==X?void 0:X.storyNode,di=(null===(u=null==Y?void 0:Y.icons)||void 0===u?void 0:u.bookmarkIcon)||s,ri=(null===(C=null==Y?void 0:Y.icons)||void 0===C?void 0:C.chevronDownIcon)||a,ci=(null===(f=null==Y?void 0:Y.icons)||void 0===f?void 0:f.chevronRightIcon)||d,ui=t(function(){return M.display_items.critical.length>0?"Critical":M.display_items.warning.length>0?"Warning":M.display_items.recommendation.length>0?"Suggestion":null},[M.display_items,q]),vi=t(function(){return g(M)},[M]),mi=0===((null===(S=null===(I=M.display_items)||void 0===I?void 0:I.critical)||void 0===S?void 0:S.length)||0)+((null===(b=null===(k=M.display_items)||void 0===k?void 0:k.warning)||void 0===b?void 0:b.length)||0)+((null===(N=null===(w=M.display_items)||void 0===w?void 0:w.recommendation)||void 0===N?void 0:N.length)||0);return n("div",i({className:"".concat(h.container," ").concat(E>0?h.nestedContainer:""),style:i(i({},null==ai?void 0:ai.container),E>0?null==ai?void 0:ai.nestedContainer:{})},{children:[n("div",i({onClick:function(){li(!oi),null==J||J(),null==Z||Z(ii)},className:h.headerRow,style:i(i({},null==ai?void 0:ai.headerRow),ti?null==ai?void 0:ai.headerRowHover:{}),onMouseEnter:function(){return si(!0)},onMouseLeave:function(){return si(!1)}},{children:[o("div",i({className:h.chevronWrapper,style:null==ai?void 0:ai.chevronWrapper},{children:oi?o(ri,{className:h.chevronIcon,style:{color:null===(R=null==Y?void 0:Y.iconColors)||void 0===R?void 0:R.chevronIcon,width:null===(_=null==Y?void 0:Y.iconSizes)||void 0===_?void 0:_.chevronIcon,height:null===(x=null==Y?void 0:Y.iconSizes)||void 0===x?void 0:x.chevronIcon}}):o(ci,{className:h.chevronIcon,style:{color:null===(G=null==Y?void 0:Y.iconColors)||void 0===G?void 0:G.chevronIcon,width:null===(z=null==Y?void 0:Y.iconSizes)||void 0===z?void 0:z.chevronIcon,height:null===(A=null==Y?void 0:Y.iconSizes)||void 0===A?void 0:A.chevronIcon}})})),n("div",i({className:h.headerContent,style:null==ai?void 0:ai.headerContent},{children:[n("div",i({className:h.artifactIdRow,style:null==ai?void 0:ai.artifactIdRow},{children:[o(di,{className:h.bookmarkIcon,style:{color:null===(W=null==Y?void 0:Y.iconColors)||void 0===W?void 0:W.bookmarkIcon,width:null===(F=null==Y?void 0:Y.iconSizes)||void 0===F?void 0:F.bookmarkIcon,height:null===(H=null==Y?void 0:Y.iconSizes)||void 0===H?void 0:H.bookmarkIcon}}),o("span",i({style:null==ai?void 0:ai.artifactIdText},{children:M.artifactTitleID}))]})),o(c,i({title:p(M.title,null===(P=null==Y?void 0:Y.icons)||void 0===P?void 0:P.infoIcon,null===(j=null==Y?void 0:Y.iconColors)||void 0===j?void 0:j.infoIcon,null===(L=null==Y?void 0:Y.iconSizes)||void 0===L?void 0:L.infoIcon),arrow:!0},{children:o("h3",i({className:h.title,style:i(i({},null==ai?void 0:ai.title),ti?null==ai?void 0:ai.titleHover:{})},{children:p(M.title,null===(O=null==Y?void 0:Y.icons)||void 0===O?void 0:O.infoIcon,null===(B=null==Y?void 0:Y.iconColors)||void 0===B?void 0:B.infoIcon,null===(D=null==Y?void 0:Y.iconSizes)||void 0===D?void 0:D.infoIcon)}))})),!oi&&o("div",i({className:h.collapsedSummary,style:null==ai?void 0:ai.collapsedSummary},{children:(0===E||vi.critical+vi.warning+vi.recommendation>0)&&n(l,{children:[o("span",i({className:h.summaryLabel,style:null==ai?void 0:ai.summaryLabel},{children:"Gap"===q?"Gaps : ":"Risks : "})),n("div",i({className:h.summaryBadgesContainer,style:null==ai?void 0:ai.summaryBadgesContainer},{children:[vi.critical>0&&o(v,{title:"Critical",length:vi.critical,badgeColorClass:"critical",customStyles:X}),vi.warning>0&&o(v,{title:"Warning",length:vi.warning,badgeColorClass:"warning",customStyles:X}),vi.recommendation>0&&o(v,{title:"JAS",length:vi.recommendation,badgeColorClass:"suggestion",customStyles:X})]}))]})}))]}))]})),oi&&n("div",i({className:h.expandedContent,style:null==ai?void 0:ai.expandedContent},{children:[o("div",i({className:h.expandedInnerPadding,style:null==ai?void 0:ai.expandedInnerPadding},{children:!mi&&n("div",i({className:h.itemsContainer,style:null==ai?void 0:ai.itemsContainer},{children:[o(m,{title:"Critical",items:M.display_items.critical,badgeColorClass:"critical",defaultOpen:"Critical"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Warning",items:M.display_items.warning,badgeColorClass:"warning",defaultOpen:"Warning"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y}),o(m,{title:"Suggestion",items:M.display_items.recommendation,badgeColorClass:"suggestion",defaultOpen:"Suggestion"===ui,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y})]}))})),M.sub_feature&&M.sub_feature.length>0&&o("div",i({className:h.subFeaturesWrapper,style:null==ai?void 0:ai.subFeaturesWrapper},{children:M.sub_feature.map(function(i,n){return o(y,{story:i,depth:E+1,onClickStoryNodeCallback:J,type:q,isProcessingGapItems:K,onClickAiReasoning:Q,handleFixRisk:U,handleHighlightGapContent:V,customStyles:X,customIcons:Y,onSelectStory:Z,rootArtifactId:ii},n)})}))]}))]}))};export{y as default,p as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=StoryNode.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as l,Fragment as i}from"react/jsx-runtime";import{useState as s,useRef as a,useEffect as u}from"react";import{ExternalLink as c,Download as d,Share2 as v,Copy as y,LoaderCircle as m,PencilIcon as f,ChevronUp as p,ChevronDown as h,Info as S,Bookmark as C}from"lucide-react";import I from"showdown";import{Menu as w,MenuItem as U,Tooltip as N}from"@mui/material";import{v4 as b}from"uuid";import g from"./UserStoryCard.module.css.js";import{formatMarkdown as x,indentMarkdown as D}from"../../utils/helpers.js";import{replaceTitleSection as B}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import k from"../RichTextEditor/RichTextEditor.js";import T from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";function j(t){for(var n,r=[],l=/<learned>(.*?)<\/learned>/g,i=0,s=0;null!==(n=l.exec(t));){var a=n[1],u=n.index;u>i&&r.push(o("span",{children:t.slice(i,u)},"text-pre-".concat(s++))),r.push(o(N,e({title:a,placement:"top"},{children:o(S,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(b()))),i=l.lastIndex}return i<(null==t?void 0:t.length)&&r.push(o("span",{children:t.slice(i)},"text-post-".concat(s++))),r}var A=function(t){var n,r=t.displayName,i=R().customStyles,s=null===(n=null==i?void 0:i.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:g.displayName,style:null==s?void 0:s.wrapper},{children:[o(C,{className:g.displayNameIcon,style:null==s?void 0:s.displayNameIcon}),l("span",e({style:null==s?void 0:s.label},{children:[r,":"]}))]}))},E=function(S){var C,N,b=S.isUserStoryCurrentlyUpdated,L=S.artifactId,z=S.artifactTitleId,P=S.parentUserStory,O=S.currentUserStory,W=S.onUserStoryChange,H=S.parentIndex,V=S.currentIndex,_=S.enableDownload,q=S.isDiffEditReviewMode,F=S.showUserStoryDiff,Q=S.handleDownloadUserStory,G=S.handleOpenSendDialog,J=S.updateUserStoryArtifact,K=R(),X=K.searchQueryList,Y=K.citations,Z=K.customStyles,$=null==Z?void 0:Z.userStoryCardStyles,ee=null===(C=null==Z?void 0:Z.userStoryScreenStyles)||void 0===C?void 0:C.userStoryContentStyles,te=s(e(e({},structuredClone(O)),{value:x(O.value)||""})),ne=te[0],re=te[1],oe=s({userStory:!1}),le=oe[0],ie=oe[1],se=R().userStory,ae=s(""===H),ue=ae[0],ce=ae[1],de=s(!1);de[0];var ve=de[1],ye=s(null),me=ye[0],fe=ye[1],pe=s(!1),he=pe[0],Se=pe[1],Ce=a(null),Ie=s(!1);Ie[0];var we=Ie[1];u(function(){b&&ce(b)},[b]),u(function(){re(e(e({},structuredClone(O)),{value:x(O.value)||""}))},[O]),u(function(){X.length>0&&ce(!0)},[X]);var Ue=function(){fe(null)},Ne=function(){ce(function(e){return!e})};return l("div",e({className:g.card,style:null==$?void 0:$.cardStyle},{children:[l("div",e({className:g.titleSection,style:null==$?void 0:$.titleSection},{children:[l("div",e({className:g.titleRow,style:null==$?void 0:$.titleRow,onClick:Ne},{children:[l("div",e({className:g.titleLeft,style:null==$?void 0:$.titleLeft,onMouseEnter:function(){return we(!0)},onMouseLeave:function(){return we(!1)}},{children:[o(A,{displayName:z}),o("h2",e({className:g.storyTitle,style:null==$?void 0:$.storyTitle},{children:j(O.title)}),O.artifactId)]})),l("div",e({className:g.titleActions,style:null==$?void 0:$.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!le.userStory&&l(i,{children:[o("button",e({className:g.iconButton,style:null==$?void 0:$.iconButton,onClick:function(e){fe(e.currentTarget)}},{children:o(c,{size:16})})),l(w,e({id:"user-story-share-menu",anchorEl:me,open:!!me,onClose:function(){return fe(null)},style:null==$?void 0:$.userStoryShareMenu},{children:[_&&o(U,e({style:null==$?void 0:$.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return ve(!0),Q?[4,Promise.all([Q("pdf"),Q("doc")])]:[2];case 1:return e.sent(),ve(!1),[2]}})})}},{children:l("div",e({ref:Ce,className:g.menuItemContent,style:null==$?void 0:$.menuItemContent},{children:[o(d,{size:16,color:null==$?void 0:$.menuIconColor}),o("p",e({style:null==$?void 0:$.menuLabel},{children:"Download"}))]}))})),o(U,e({style:null==$?void 0:$.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var t;return r(this,function(n){return t=O,P&&(t=e(e({},O),{value:"".concat(B(null==P?void 0:P.value,O.title)," \n").concat(O.value)})),null==G||G(!0,[t],O.artifactId),Ue(),[2]})})}},{children:l("div",e({style:null==$?void 0:$.menuItemContent,className:g.menuItemContentPadded},{children:[o(v,{size:16,color:null==$?void 0:$.menuIconColor}),o("p",e({style:null==$?void 0:$.menuLabel},{children:"Send"}))]}))})),o(U,e({style:null==$?void 0:$.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o,l;return r(this,function(r){switch(r.label){case 0:e=new I.Converter,t=e.makeHtml(x(O.value)||O.value),n=function(e){var t=(new I.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(x(O.value)||O.value),o=new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,navigator.clipboard.write([o])];case 2:return r.sent(),console.log("Copied User Story"),[3,5];case 3:return l=r.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Ue(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==$?void 0:$.menuItemContent,className:g.menuItemContentPadded},{children:[o(y,{size:16,color:null==$?void 0:$.menuIconColor}),o("p",e({style:null==$?void 0:$.menuLabel},{children:"Copy"}))]}))}))]}))]}),le.userStory&&ue?o(M,{type:"outline",children:"Cancel",style:null==$?void 0:$.cancelButton,onClick:function(){ie(function(t){return e(e({},t),{userStory:!1})})}}):o(i,{}),le.userStory&&ue?o(M,{type:"fill",children:he?l("span",e({className:g.savingSpinner},{children:[o(m,{className:g.spinAnimation}),o("span",{children:"Saving..."})]})):"Save",isDisable:he,style:null==$?void 0:$.saveButton,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return Se(!0),"userStory"==="userStory"&&(W(ne),console.log("I am changing RTE editor values",ne)),[4,J(Y,se,L)];case 1:return t.sent(),ie(function(t){return e(e({},t),{userStory:!1})}),Se(!1),[2]}})})}}):!q&&!F&&ue&&o("button",e({className:g.iconButton,style:null==$?void 0:$.editButton,onClick:function(){return ie(function(t){return e(e({},t),{userStory:!0})})}},{children:o(f,{color:null==$?void 0:$.pencilIconColor,size:16})})),o("button",e({type:"button",onClick:function(e){e.stopPropagation(),Ne()},style:null==$?void 0:$.chevronButton,className:g.chevronButton},{children:o(ue?p:h,{className:g.chevronIcon,color:null==$?void 0:$.chevronIconColor})}))]}))]})),o("div",{className:g.divider,style:null==$?void 0:$.dividerStyle})]})),ue&&o("div",e({className:g.cardContent,style:null==$?void 0:$.cardContentStyle},{children:l("div",e({className:g.contentInner,style:null==$?void 0:$.contentInner},{children:[l("div",e({className:g.descriptionSection,style:null==$?void 0:$.descriptionSection},{children:[o("div",{className:g.justifyBetween,style:null==$?void 0:$.justifyBetween}),le.userStory?o(k,{minHeight:"100%",height:"100%",type:"string",value:x(O.value)||"",handleUpdateState:function(t,n){var r=D(n);re(function(t){return e(e({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:le.userStory?"edit":"readOnly"}):o(T,{showUserStoryDiff:F,isParent:""===H,message:x(O.value)||"",artifactId:O.artifactId,customStyles:ee})]})),null===(N=ne.sub_features)||void 0===N?void 0:N.map(function(n,r){return o(E,{artifactId:L,isUserStoryCurrentlyUpdated:b,artifactTitleId:"".concat(z,"-").concat(String.fromCharCode(65+r)),parentUserStory:O,parentIndex:"".concat(H).concat(H&&".").concat(V),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(n){return function(n,r){var o=t([],O.sub_features||[],!0);o[n]=r,W(e(e({},O),{sub_features:o}))}(r,n)},enableDownload:!0,isDiffEditReviewMode:q,showUserStoryDiff:F,updateUserStoryArtifact:J,handleDownloadUserStory:Q,handleOpenSendDialog:G},n.artifactId)})]}))}))]}))},L=function(n){var r=n.artifactTitleIDs,l=n.isDiffEditReviewMode,i=n.showUserStoryDiff,s=n.updateUserStoryArtifact,a=n.isUserStoryCurrentlyUpdated,u=n.artifactId,c=n.handleOpenSendDialog,d=n.handleDownloadUserStory,v=R(),y=v.userStory,m=v.setUserStory,f=v.customStyles,p=null==f?void 0:f.userStoryCardStyles;return o("div",e({className:g.userStoryCardWrapper,style:null==p?void 0:p.userStoryCardWrapper},{children:y.map(function(e,n){return o(E,{isUserStoryCurrentlyUpdated:a,artifactId:u,artifactTitleId:r[n]||"",currentUserStory:e,onUserStoryChange:function(e){m(function(r){return r[n]=e,t([],r,!0)})},parentIndex:"",currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:i,updateUserStoryArtifact:s,handleOpenSendDialog:c,handleDownloadUserStory:d},e.artifactId)})}))};export{E as StoryCard,L as UserStoryCardWrapper,E as default,j as replaceLearnedTagsWithInfo};
1
+ import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsx as o,jsxs as l,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ExternalLink as c,Download as d,Share2 as v,Copy as y,LoaderCircle as f,PencilIcon as m,ChevronUp as p,ChevronDown as h,Info as S,Bookmark as I}from"lucide-react";import C from"showdown";import{Menu as w,MenuItem as U,Tooltip as N}from"@mui/material";import{v4 as b}from"uuid";import g from"./UserStoryCard.module.css.js";import{formatMarkdown as x,indentMarkdown as D}from"../../utils/helpers.js";import{replaceTitleSection as B}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import k from"../RichTextEditor/RichTextEditor.js";import A from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as T}from"../RequirementAIWrapper/RequirementAIWrapper.js";function R(t){for(var n,r=[],l=/<learned>(.*?)<\/learned>/g,i=0,a=0;null!==(n=l.exec(t));){var s=n[1],u=n.index;u>i&&r.push(o("span",{children:t.slice(i,u)},"text-pre-".concat(a++))),r.push(o(N,e({title:s,placement:"top"},{children:o(S,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(b()))),i=l.lastIndex}return i<(null==t?void 0:t.length)&&r.push(o("span",{children:t.slice(i)},"text-post-".concat(a++))),r}var j=function(t){var n,r=t.displayName,i=T().customStyles,a=null===(n=null==i?void 0:i.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return l("div",e({className:g.displayName,style:null==a?void 0:a.wrapper},{children:[o(I,{className:g.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),l("span",e({style:null==a?void 0:a.label},{children:[r,":"]}))]}))},E=function(S){var I,N,b=S.isUserStoryCurrentlyUpdated,L=S.artifactId,z=S.artifactTitleId,P=S.parentUserStory,O=S.currentUserStory,W=S.onUserStoryChange,H=S.parentIndex,V=S.currentIndex,_=S.enableDownload,q=S.isDiffEditReviewMode,F=S.showUserStoryDiff,Q=S.handleDownloadUserStory,G=S.handleOpenSendDialog,J=S.updateUserStoryArtifact,K=S.selectedArtifactId,X=T(),Y=X.searchQueryList,Z=X.citations,$=X.customStyles,ee=null==$?void 0:$.userStoryCardStyles,te=null===(I=null==$?void 0:$.userStoryScreenStyles)||void 0===I?void 0:I.userStoryContentStyles,ne=a(e(e({},structuredClone(O)),{value:x(O.value)||""})),re=ne[0],oe=ne[1],le=a({userStory:!1}),ie=le[0],ae=le[1],se=T().userStory,ue=a(""===H||K===O.artifactId),ce=ue[0],de=ue[1],ve=a(!1);ve[0];var ye=ve[1],fe=a(null),me=fe[0],pe=fe[1],he=a(!1),Se=he[0],Ie=he[1],Ce=s(null),we=a(!1);we[0];var Ue=we[1];u(function(){b&&de(b)},[b]),u(function(){oe(e(e({},structuredClone(O)),{value:x(O.value)||""}))},[O]),u(function(){Y.length>0?de(!0):K&&de(K===O.artifactId)},[Y,K,O.artifactId]);var Ne=function(){pe(null)},be=function(){de(function(e){return!e})};return l("div",e({className:g.card,style:null==ee?void 0:ee.cardStyle},{children:[l("div",e({className:g.titleSection,style:null==ee?void 0:ee.titleSection},{children:[l("div",e({className:g.titleRow,style:null==ee?void 0:ee.titleRow,onClick:be},{children:[l("div",e({className:g.titleLeft,style:null==ee?void 0:ee.titleLeft,onMouseEnter:function(){return Ue(!0)},onMouseLeave:function(){return Ue(!1)}},{children:[o(j,{displayName:z}),o("h2",e({className:g.storyTitle,style:null==ee?void 0:ee.storyTitle},{children:R(O.title)}),O.artifactId)]})),l("div",e({className:g.titleActions,style:null==ee?void 0:ee.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[!ie.userStory&&l(i,{children:[o("button",e({className:g.iconButton,style:null==ee?void 0:ee.iconButton,onClick:function(e){pe(e.currentTarget)}},{children:o(c,{size:16})})),l(w,e({id:"user-story-share-menu",anchorEl:me,open:!!me,onClose:function(){return pe(null)},style:null==ee?void 0:ee.userStoryShareMenu},{children:[_&&o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return ye(!0),Q?[4,Promise.all([Q("pdf"),Q("doc")])]:[2];case 1:return e.sent(),ye(!1),[2]}})})}},{children:l("div",e({ref:Ce,className:g.menuItemContent,style:null==ee?void 0:ee.menuItemContent},{children:[o(d,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Download"}))]}))})),o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var t;return r(this,function(n){return t=O,P&&(t=e(e({},O),{value:"".concat(B(null==P?void 0:P.value,O.title)," \n").concat(O.value)})),null==G||G(!0,[t],O.artifactId),Ne(),[2]})})}},{children:l("div",e({style:null==ee?void 0:ee.menuItemContent,className:g.menuItemContentPadded},{children:[o(v,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Send"}))]}))})),o(U,e({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o,l;return r(this,function(r){switch(r.label){case 0:e=new C.Converter,t=e.makeHtml(x(O.value)||O.value),n=function(e){var t=(new C.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(x(O.value)||O.value),o=new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,navigator.clipboard.write([o])];case 2:return r.sent(),console.log("Copied User Story"),[3,5];case 3:return l=r.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Ne(),[7];case 5:return[2]}})})}},{children:l("div",e({style:null==ee?void 0:ee.menuItemContent,className:g.menuItemContentPadded},{children:[o(y,{size:16,color:null==ee?void 0:ee.menuIconColor}),o("p",e({style:null==ee?void 0:ee.menuLabel},{children:"Copy"}))]}))}))]}))]}),ie.userStory&&ce?o(M,{type:"outline",children:"Cancel",style:null==ee?void 0:ee.cancelButton,onClick:function(){ae(function(t){return e(e({},t),{userStory:!1})})}}):o(i,{}),ie.userStory&&ce?o(M,{type:"fill",children:Se?l("span",e({className:g.savingSpinner},{children:[o(f,{className:g.spinAnimation}),o("span",{children:"Saving..."})]})):"Save",isDisable:Se,style:null==ee?void 0:ee.saveButton,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return Ie(!0),"userStory"==="userStory"&&(W(re),console.log("I am changing RTE editor values",re)),[4,J(Z,se,L)];case 1:return t.sent(),ae(function(t){return e(e({},t),{userStory:!1})}),Ie(!1),[2]}})})}}):!q&&!F&&ce&&o("button",e({className:g.iconButton,style:null==ee?void 0:ee.editButton,onClick:function(){return ae(function(t){return e(e({},t),{userStory:!0})})}},{children:o(m,{color:null==ee?void 0:ee.pencilIconColor,size:16})})),o("button",e({type:"button",onClick:function(e){e.stopPropagation(),be()},style:null==ee?void 0:ee.chevronButton,className:g.chevronButton},{children:o(ce?p:h,{className:g.chevronIcon,color:null==ee?void 0:ee.chevronIconColor})}))]}))]})),o("div",{className:g.divider,style:null==ee?void 0:ee.dividerStyle})]})),ce&&o("div",e({className:g.cardContent,style:null==ee?void 0:ee.cardContentStyle},{children:l("div",e({className:g.contentInner,style:null==ee?void 0:ee.contentInner},{children:[l("div",e({className:g.descriptionSection,style:null==ee?void 0:ee.descriptionSection},{children:[o("div",{className:g.justifyBetween,style:null==ee?void 0:ee.justifyBetween}),ie.userStory?o(k,{minHeight:"100%",height:"100%",type:"string",value:x(O.value)||"",handleUpdateState:function(t,n){var r=D(n);oe(function(t){return e(e({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ie.userStory?"edit":"readOnly"}):o(A,{showUserStoryDiff:F,isParent:""===H,message:x(O.value)||"",artifactId:O.artifactId,customStyles:te})]})),null===(N=re.sub_features)||void 0===N?void 0:N.map(function(n,r){return o(E,{artifactId:L,isUserStoryCurrentlyUpdated:b,artifactTitleId:"".concat(z,"-").concat(String.fromCharCode(65+r)),parentUserStory:O,parentIndex:"".concat(H).concat(H&&".").concat(V),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(n){return function(n,r){var o=t([],O.sub_features||[],!0);o[n]=r,W(e(e({},O),{sub_features:o}))}(r,n)},enableDownload:!0,isDiffEditReviewMode:q,showUserStoryDiff:F,updateUserStoryArtifact:J,handleDownloadUserStory:Q,handleOpenSendDialog:G},n.artifactId)})]}))}))]}))},L=function(n){var r=n.artifactTitleIDs,l=n.isDiffEditReviewMode,i=n.showUserStoryDiff,a=n.updateUserStoryArtifact,s=n.isUserStoryCurrentlyUpdated,u=n.artifactId,c=n.handleOpenSendDialog,d=n.handleDownloadUserStory,v=n.selectedArtifactId,y=T(),f=y.userStory,m=y.setUserStory,p=y.customStyles,h=null==p?void 0:p.userStoryCardStyles;return o("div",e({className:g.userStoryCardWrapper,style:null==h?void 0:h.userStoryCardWrapper},{children:f.map(function(e,n){return o(E,{isUserStoryCurrentlyUpdated:s,artifactId:u,artifactTitleId:r[n]||"",currentUserStory:e,onUserStoryChange:function(e){m(function(r){return r[n]=e,t([],r,!0)})},parentIndex:"",currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:i,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:d,selectedArtifactId:v},e.artifactId)})}))};export{E as StoryCard,L as UserStoryCardWrapper,E as default,R as replaceLearnedTagsWithInfo};
2
2
  //# sourceMappingURL=UserStoryCard.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e,__spreadArray as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as a,useMemo as l,useEffect as s}from"react";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as v}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as p,getFirstUnapprovedStoryId as u,approveAllSegments as f}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as m}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as h}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as y}from"../../icons/CheckIcon.js";import{BookmarkIcon as A}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as b}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{SidebarOpenIcon as I,SidebarCloseIcon as C}from"lucide-react";import{UserStoryApprovalScreenContext as w,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";var E={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},N={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"},U=Object.assign(function(r){var f,S=r.artifactTitleIds,h=r.config,y=void 0===h?{}:h,A=r.callbacks,b=void 0===A?{}:A,I=r.labels,C=void 0===I?{}:I,T=r.isDisabled,U=void 0!==T&&T,x=r.children,F=r.classNames,k=d(),D=k.userStory,j=k.customStyles,B=e(e({},E),y),R=e(e({},N),C),P=n([]),W=P[0],M=P[1],V=n(""),_=V[0],q=V[1],O=n(""),z=O[0],L=O[1],H=n(!1),G=H[0],Y=H[1],J=n(!0),K=J[0],Q=J[1],X=i(void 0),Z=a(function(e,t,o,r){b.onShowNotification?b.onShowNotification(e,t,o,r):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(o))},[b]),$=a(function(e){b.onScrollToElement?b.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[b]),ee=l(function(){var e=W.findIndex(function(e){return e.artifactId===_});return e>=0?e:0},[W,_]),te=W[ee];s(function(){X.current=te},[te]),s(function(){var e;(null==D?void 0:D.length)&&(null===(e=b.onInitialize)||void 0===e||e.call(b),1===D.length&&Q(!1),D.length>0&&!_&&q(D[0].artifactId))},[D]),s(function(){var e=c(v(D));M(e)},[]),s(function(){if(te){var e=p(te,"");L(e)}},[null==te?void 0:te.artifactId]);var oe=a(function(e,o){M(function(r){var n=t([],r,!0);if("APPROVED"===o.approval_status&&"APPROVED"!==r[e].approval_status){var i=u(r,o.artifactId);i&&q(i)}return n[e]=o,n})},[]),re=a(function(e){var t=X.current;if(t){var o=p(t,e);"NA"!==o&&(L(""),setTimeout(function(){L(o)},0))}},[]);m({userStoryForApproval:W,selectedUserStoryForApproval:te,userStoryIndex:ee,callbacks:b,labels:R,onSaveUserStory:oe});var ne=e({height:B.containerHeight},B.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),ie={userStoryForApproval:W,setUserStoryForApproval:M,selectedStoryArtifactId:_,setSelectedStoryArtifactId:q,selectedUserStoryIndex:ee,selectedUserStoryForApproval:te,currentContentId:z,setCurrentContentId:L,isEditingSegment:G,setIsEditingSegment:Y,isSidebarExpanded:K,setIsSidebarExpanded:Q,artifactTitleIds:S,config:B,labels:R,callbacks:b,isDisabled:U,handleSaveUserStory:oe,handleUpdateContentId:re,showNotification:Z,scrollToElement:$};return o(w.Provider,e({value:ie},{children:o("div",e({className:"".concat(g.container," ").concat((null==F?void 0:F.container)||""),style:e(e({},ne),null===(f=null==j?void 0:j.approvalScreen)||void 0===f?void 0:f.wrapperContainer)},{children:x}))}))},{Sidebar:function(e){var t=e.Component,r=e.config,n=e.className,i=T(),a=i.isSidebarExpanded,l=i.selectedStoryArtifactId,s=i.setSelectedStoryArtifactId,d=i.userStoryForApproval,c=i.isEditingSegment,v=i.artifactTitleIds;return t?o(t,{isSidebarExpanded:a,selectedStoryArtifactId:l,setSelectedStoryArtifactId:s,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:v}):o(b,{config:r,className:n})},SidebarToggle:function(t){var r=t.OpenIcon,n=t.CloseIcon,i=t.className,a=void 0===i?"":i,l=T(),s=l.isSidebarExpanded,d=l.setIsSidebarExpanded,c=r||I,v=n||C;return o("div",e({className:"".concat(g.sidebarToggleWrapper," ").concat(a)},{children:o("button",e({onClick:function(){return d(function(e){return!e})},className:g.sidebarToggleBtn,"aria-label":s?"Collapse sidebar":"Expand sidebar",type:"button"},{children:o(s?v:c,{})}))}))},Content:function(t){var n,i,l,s,c,v,p,u,m,S,b,I,C,w,E,N,U,x,F,k,D,j=t.children,B=t.ButtonComponent,R=t.hideApproveAll,P=void 0!==R&&R,W=t.pageTitle,M=void 0===W?"Review Generated Requirements":W,V=t.pageDescription,_=void 0===V?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":V,q=T(),O=q.selectedUserStoryForApproval,z=q.selectedUserStoryIndex,L=q.artifactTitleIds,H=q.labels,G=q.config,Y=q.isDisabled,J=q.isEditingSegment,K=q.handleSaveUserStory,Q=q.setCurrentContentId,X=q.showNotification,Z=d().customStyles,$=a(function(){if(O)if(J)X("warn","Warning!",H.unsavedChangesWarning,3e3);else{var e=f(O);K(z,e),Q("")}},[O,z,J,H,K,Q,X]);if(!O)return null;var ee=L[z]||"",te="APPROVED"===O.approval_status;return r("div",e({className:g.content,style:e({},null===(i=null===(n=null==Z?void 0:Z.approvalScreen)||void 0===n?void 0:n.content)||void 0===i?void 0:i.content),"data-lsc-ui-page-title":M,"data-lsc-ui-page-description":_},{children:[r("div",e({className:g.header,style:e({},null===(c=null===(s=null===(l=null==Z?void 0:Z.approvalScreen)||void 0===l?void 0:l.body)||void 0===s?void 0:s.contentSegment)||void 0===c?void 0:c.header)},{children:[r("div",e({className:g.headerLeft,style:e({},null===(p=null===(v=null==Z?void 0:Z.approvalScreen)||void 0===v?void 0:v.content)||void 0===p?void 0:p.headerLeft)},{children:[r("div",e({className:g.headerMeta,style:e({},null===(S=null===(m=null===(u=null==Z?void 0:Z.approvalScreen)||void 0===u?void 0:u.body)||void 0===m?void 0:m.contentSegment)||void 0===S?void 0:S.headerMeta)},{children:[o(A,{size:16,color:(null===(C=null===(I=null===(b=null==Z?void 0:Z.approvalScreen)||void 0===b?void 0:b.body)||void 0===I?void 0:I.contentSegment)||void 0===C?void 0:C.bookMarkColor)||"#8C8C8C"}),o("h2",e({className:g.headerArtifactId,style:e({},null===(N=null===(E=null===(w=null==Z?void 0:Z.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===N?void 0:N.headerArtifactId)},{children:ee}))]})),o("p",e({className:g.headerTitle,style:e({},null===(F=null===(x=null===(U=null==Z?void 0:Z.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===F?void 0:F.headerTitle)},{children:null==O?void 0:O.title}))]})),!P&&G.showApproveAllButton&&o("div",e({className:g.headerRight},{children:te?o(h,{status:"APPROVED",label:H.approved}):B?o(B,e({type:"fill",onClick:$,isDisable:Y,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:H.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:r("div",e({className:g.approveAllContent},{children:[o(y,{size:16,color:"white"}),o("span",{children:H.approveAll})]}))})):r("button",e({onClick:$,disabled:Y,className:g.approveAllButtonDefault,style:e({},null===(D=null===(k=null==Z?void 0:Z.approvalScreen)||void 0===k?void 0:k.content)||void 0===D?void 0:D.approveAllButtonDefault)},{children:[o(y,{size:16,color:"white"}),o("span",{children:H.approveAll})]}))}))]})),j]}))},Body:function(t){var n,i,l,s=t.children,c=t.EditorComponent,v=t.ViewerComponent,p=T(),u=p.selectedUserStoryForApproval,f=p.selectedUserStoryIndex,m=p.artifactTitleIds,h=p.handleSaveUserStory,y=d().customStyles,A=a(function(e){h(f,e)},[f,h]),b=a(function(t,o){var r;if(u){var n=e(e({},u),{sub_features:null===(r=u.sub_features)||void 0===r?void 0:r.map(function(e,r){return r===t?o:e})});h(f,n)}},[u,f,h]),I=a(function(t){var o;if(u){var r=e(e({},u),{sub_features:null===(o=u.sub_features)||void 0===o?void 0:o.filter(function(e,o){return o!==t})});h(f,r)}},[u,f,h]);if(!u)return null;var C=m[f]||"";return r("div",e({className:g.body,style:e({},null===(i=null===(n=null==y?void 0:y.approvalScreen)||void 0===n?void 0:n.body)||void 0===i?void 0:i.container)},{children:[o(S,{userStoryForApproval:u,artifactTitleId:C,onSaveMainStoryContent:A,EditorComponent:c,ViewerComponent:v}),null===(l=u.sub_features)||void 0===l?void 0:l.map(function(e,t){return o(S,{userStoryForApproval:e,artifactTitleId:"".concat(C," - ").concat(String.fromCharCode(65+t)),isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:b,onDeleteSubFeature:I,EditorComponent:c,ViewerComponent:v},e.artifactId)}),s]}))}});export{U as default};
1
+ import{__assign as e,__spreadArray as t}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useState as n,useRef as i,useCallback as a,useMemo as l,useEffect as s}from"react";import{useRequirementAI as d}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{createUserStoriesForApproval as c,cloneUserStories as v}from"../../utils/userstory-approval-transform.utils.js";import{getFirstNonApprovedSegmentId as p,getFirstUnapprovedStoryId as u,approveAllSegments as f}from"../../utils/userstory-approval.utils.js";import{useApprovalStatus as m}from"../../hooks/useApprovalStatus.js";import{ContentSegment as S}from"./components/ContentSegment/ContentSegment.js";import{ApprovalBadge as h}from"./components/ApprovalBadge/ApprovalBadge.js";import g from"./UserStoryApprovalScreen.module.css.js";import{CheckIcon as y}from"../../icons/CheckIcon.js";import{BookmarkIcon as A}from"../../icons/BookmarkIcon.js";import{ApprovalSidebar as b}from"./components/ApprovalSidebar/ApprovalSidebar.js";import{SidebarOpenIcon as I,SidebarCloseIcon as C}from"lucide-react";import{UserStoryApprovalScreenContext as w,useUserStoryApprovalScreen as T}from"./UserStoryApprovalContext.js";var E={showApproveAllButton:!0,allowEditing:!0,allowDeletion:!0,showSidebar:!1,containerHeight:"calc(100vh - 100px)",useFullWidth:!1},N={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"},U=Object.assign(function(r){var f,S=r.artifactTitleIds,h=r.config,y=void 0===h?{}:h,A=r.callbacks,b=void 0===A?{}:A,I=r.labels,C=void 0===I?{}:I,T=r.isDisabled,U=void 0!==T&&T,x=r.children,F=r.classNames,k=r.selectedArtifactId,D=d(),j=D.userStory,B=D.customStyles,R=e(e({},E),y),P=e(e({},N),C),W=n([]),M=W[0],V=W[1],_=n(""),q=_[0],O=_[1],z=n(""),L=z[0],H=z[1],G=n(!1),Y=G[0],J=G[1],K=n(!0),Q=K[0],X=K[1],Z=i(void 0),$=a(function(e,t,o,r){b.onShowNotification?b.onShowNotification(e,t,o,r):console.log("[".concat(e.toUpperCase(),"] ").concat(t,": ").concat(o))},[b]),ee=a(function(e){b.onScrollToElement?b.onScrollToElement(e):(e.style.scrollMarginTop="20px",e.scrollIntoView({behavior:"smooth",block:"start"}))},[b]),te=l(function(){var e=M.findIndex(function(e){return e.artifactId===q});return e>=0?e:0},[M,q]),oe=M[te];s(function(){Z.current=oe},[oe]),s(function(){var e;(null==j?void 0:j.length)&&(null===(e=b.onInitialize)||void 0===e||e.call(b),1===j.length&&X(!1),j.length>0&&!q&&O(k||j[0].artifactId))},[j,k]),s(function(){k&&k!==q&&O(k)},[k,q]),s(function(){var e=c(v(j));V(e)},[]),s(function(){if(oe){var e=p(oe,"");H(e)}},[null==oe?void 0:oe.artifactId]);var re=a(function(e,o){V(function(r){var n=t([],r,!0);if("APPROVED"===o.approval_status&&"APPROVED"!==r[e].approval_status){var i=u(r,o.artifactId);i&&O(i)}return n[e]=o,n})},[]),ne=a(function(e){var t=Z.current;if(t){var o=p(t,e);"NA"!==o&&(H(""),setTimeout(function(){H(o)},0))}},[]);m({userStoryForApproval:M,selectedUserStoryForApproval:oe,userStoryIndex:te,callbacks:b,labels:P,onSaveUserStory:re});var ie=e({height:R.containerHeight},R.useFullWidth?{width:"100%",marginLeft:0,marginRight:0}:{width:"calc(100% + 40px)",marginLeft:"-20px",marginRight:"-20px"}),ae={userStoryForApproval:M,setUserStoryForApproval:V,selectedStoryArtifactId:q,setSelectedStoryArtifactId:O,selectedUserStoryIndex:te,selectedUserStoryForApproval:oe,currentContentId:L,setCurrentContentId:H,isEditingSegment:Y,setIsEditingSegment:J,isSidebarExpanded:Q,setIsSidebarExpanded:X,artifactTitleIds:S,config:R,labels:P,callbacks:b,isDisabled:U,handleSaveUserStory:re,handleUpdateContentId:ne,showNotification:$,scrollToElement:ee};return o(w.Provider,e({value:ae},{children:o("div",e({className:"".concat(g.container," ").concat((null==F?void 0:F.container)||""),style:e(e({},ie),null===(f=null==B?void 0:B.approvalScreen)||void 0===f?void 0:f.wrapperContainer)},{children:x}))}))},{Sidebar:function(e){var t=e.Component,r=e.config,n=e.className,i=T(),a=i.isSidebarExpanded,l=i.selectedStoryArtifactId,s=i.setSelectedStoryArtifactId,d=i.userStoryForApproval,c=i.isEditingSegment,v=i.artifactTitleIds;return t?o(t,{isSidebarExpanded:a,selectedStoryArtifactId:l,setSelectedStoryArtifactId:s,userStoryForApproval:d,isEditingAnUserStorySegment:c,artifactTitleIds:v}):o(b,{config:r,className:n})},SidebarToggle:function(t){var r=t.OpenIcon,n=t.CloseIcon,i=t.className,a=void 0===i?"":i,l=T(),s=l.isSidebarExpanded,d=l.setIsSidebarExpanded,c=r||I,v=n||C;return o("div",e({className:"".concat(g.sidebarToggleWrapper," ").concat(a)},{children:o("button",e({onClick:function(){return d(function(e){return!e})},className:g.sidebarToggleBtn,"aria-label":s?"Collapse sidebar":"Expand sidebar",type:"button"},{children:o(s?v:c,{})}))}))},Content:function(t){var n,i,l,s,c,v,p,u,m,S,b,I,C,w,E,N,U,x,F,k,D,j=t.children,B=t.ButtonComponent,R=t.hideApproveAll,P=void 0!==R&&R,W=t.pageTitle,M=void 0===W?"Review Generated Requirements":W,V=t.pageDescription,_=void 0===V?"This page displays automatically generated requirements for your project. Use this screen to review, refine, correct, or approve all generated requirements.":V,q=T(),O=q.selectedUserStoryForApproval,z=q.selectedUserStoryIndex,L=q.artifactTitleIds,H=q.labels,G=q.config,Y=q.isDisabled,J=q.isEditingSegment,K=q.handleSaveUserStory,Q=q.setCurrentContentId,X=q.showNotification,Z=d().customStyles,$=a(function(){if(O)if(J)X("warn","Warning!",H.unsavedChangesWarning,3e3);else{var e=f(O);K(z,e),Q("")}},[O,z,J,H,K,Q,X]);if(!O)return null;var ee=L[z]||"",te="APPROVED"===O.approval_status;return r("div",e({className:g.content,style:e({},null===(i=null===(n=null==Z?void 0:Z.approvalScreen)||void 0===n?void 0:n.content)||void 0===i?void 0:i.content),"data-lsc-ui-page-title":M,"data-lsc-ui-page-description":_},{children:[r("div",e({className:g.header,style:e({},null===(c=null===(s=null===(l=null==Z?void 0:Z.approvalScreen)||void 0===l?void 0:l.body)||void 0===s?void 0:s.contentSegment)||void 0===c?void 0:c.header)},{children:[r("div",e({className:g.headerLeft,style:e({},null===(p=null===(v=null==Z?void 0:Z.approvalScreen)||void 0===v?void 0:v.content)||void 0===p?void 0:p.headerLeft)},{children:[r("div",e({className:g.headerMeta,style:e({},null===(S=null===(m=null===(u=null==Z?void 0:Z.approvalScreen)||void 0===u?void 0:u.body)||void 0===m?void 0:m.contentSegment)||void 0===S?void 0:S.headerMeta)},{children:[o(A,{size:16,color:(null===(C=null===(I=null===(b=null==Z?void 0:Z.approvalScreen)||void 0===b?void 0:b.body)||void 0===I?void 0:I.contentSegment)||void 0===C?void 0:C.bookMarkColor)||"#8C8C8C"}),o("h2",e({className:g.headerArtifactId,style:e({},null===(N=null===(E=null===(w=null==Z?void 0:Z.approvalScreen)||void 0===w?void 0:w.body)||void 0===E?void 0:E.contentSegment)||void 0===N?void 0:N.headerArtifactId)},{children:ee}))]})),o("p",e({className:g.headerTitle,style:e({},null===(F=null===(x=null===(U=null==Z?void 0:Z.approvalScreen)||void 0===U?void 0:U.body)||void 0===x?void 0:x.contentSegment)||void 0===F?void 0:F.headerTitle)},{children:null==O?void 0:O.title}))]})),!P&&G.showApproveAllButton&&o("div",e({className:g.headerRight},{children:te?o(h,{status:"APPROVED",label:H.approved}):B?o(B,e({type:"fill",onClick:$,isDisable:Y,className:g.approveAllButton,overrideStyles:!0,lscUIAgent:{id:"approve-all",lscUIType:"button",lscUILabel:H.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:r("div",e({className:g.approveAllContent},{children:[o(y,{size:16,color:"white"}),o("span",{children:H.approveAll})]}))})):r("button",e({onClick:$,disabled:Y,className:g.approveAllButtonDefault,style:e({},null===(D=null===(k=null==Z?void 0:Z.approvalScreen)||void 0===k?void 0:k.content)||void 0===D?void 0:D.approveAllButtonDefault)},{children:[o(y,{size:16,color:"white"}),o("span",{children:H.approveAll})]}))}))]})),j]}))},Body:function(t){var n,i,l,s=t.children,c=t.EditorComponent,v=t.ViewerComponent,p=T(),u=p.selectedUserStoryForApproval,f=p.selectedUserStoryIndex,m=p.artifactTitleIds,h=p.handleSaveUserStory,y=d().customStyles,A=a(function(e){h(f,e)},[f,h]),b=a(function(t,o){var r;if(u){var n=e(e({},u),{sub_features:null===(r=u.sub_features)||void 0===r?void 0:r.map(function(e,r){return r===t?o:e})});h(f,n)}},[u,f,h]),I=a(function(t){var o;if(u){var r=e(e({},u),{sub_features:null===(o=u.sub_features)||void 0===o?void 0:o.filter(function(e,o){return o!==t})});h(f,r)}},[u,f,h]);if(!u)return null;var C=m[f]||"";return r("div",e({className:g.body,style:e({},null===(i=null===(n=null==y?void 0:y.approvalScreen)||void 0===n?void 0:n.body)||void 0===i?void 0:i.container)},{children:[o(S,{userStoryForApproval:u,artifactTitleId:C,onSaveMainStoryContent:A,EditorComponent:c,ViewerComponent:v}),null===(l=u.sub_features)||void 0===l?void 0:l.map(function(e,t){return o(S,{userStoryForApproval:e,artifactTitleId:"".concat(C," - ").concat(String.fromCharCode(65+t)),isSubFeature:!0,subFeatureIndex:t,onSaveSubFeature:b,onDeleteSubFeature:I,EditorComponent:c,ViewerComponent:v},e.artifactId)}),s]}))}});export{U as default};
2
2
  //# sourceMappingURL=UserStoryApprovalScreen.js.map
@@ -15,6 +15,7 @@ interface GapRiskSidebarContextType {
15
15
  mergedIcons: GapSidebarCustomIcons;
16
16
  sidebarWidth?: string | number;
17
17
  headerTitle?: string;
18
+ onSelectStory?: (artifactId: string) => void;
18
19
  }
19
20
  declare const useGapRiskSidebar: () => GapRiskSidebarContextType;
20
21
  declare const NoGapsFound: React.FC<{
@@ -42,6 +43,7 @@ interface RootProps {
42
43
  /** Width of expanded sidebar (default: 320px) */
43
44
  sidebarWidth?: string | number;
44
45
  headerTitle?: string;
46
+ onSelectStory?: (artifactId: string) => void;
45
47
  children: React.ReactNode;
46
48
  }
47
49
  interface PanelProps {
@@ -1 +1 @@
1
- {"version":3,"file":"GapRiskSidebar.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,sBAAsB,EAAE,qBAAqB,EAAqB,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGlK,UAAU,yBAAyB;IACjC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,YAAY,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE,CAAC;IACjD,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,EAAE,sBAAsB,CAAC;IACrC,WAAW,EAAE,qBAAqB,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,QAAA,MAAM,iBAAiB,QAAO,yBAQ7B,CAAC;AAqBF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC7B,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CA2BA,CAAC;AAEF,UAAU,SAAS;IACjB,YAAY,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE,CAAC;IACjD,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAoHD,UAAU,UAAU;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAoGD,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0BD,QAAA,MAAM,cAAc;;;CAGlB,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC1C,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"GapRiskSidebar.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGnE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,sBAAsB,EAAE,qBAAqB,EAAqB,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGlK,UAAU,yBAAyB;IACjC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACpE,YAAY,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE,CAAC;IACjD,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,EAAE,sBAAsB,CAAC;IACrC,WAAW,EAAE,qBAAqB,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAID,QAAA,MAAM,iBAAiB,QAAO,yBAQ7B,CAAC;AAqBF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC7B,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CA2BA,CAAC;AAEF,UAAU,SAAS;IACjB,YAAY,EAAE,cAAc,EAAE,GAAG,aAAa,EAAE,CAAC;IACjD,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAsHD,UAAU,UAAU;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAsGD,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0BD,QAAA,MAAM,cAAc;;;CAGlB,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAC1C,eAAe,cAAc,CAAC"}
@@ -19,6 +19,8 @@ declare const StoryNode: React.FC<{
19
19
  handleHighlightGapContent: (selectedItem: TGapItem | TRiskItem) => void;
20
20
  customStyles?: GapSidebarCustomStyles;
21
21
  customIcons?: GapSidebarCustomIcons;
22
+ onSelectStory?: (artifactId: string) => void;
23
+ rootArtifactId?: string;
22
24
  }>;
23
25
  export default StoryNode;
24
26
  //# sourceMappingURL=StoryNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StoryNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAoBpH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC,EACF,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,CAAC,SAAS,EAAE,CAiDnB;AAED;;GAEG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACrC,CA4QA,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"StoryNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/GapRiskSidebar/components/StoryNode/StoryNode.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAoBpH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC,EACF,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,CAAC,SAAS,EAAE,CAiDnB;AAED;;GAEG;AACH,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IAC5D,yBAAyB,EAAE,CAAC,YAAY,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACxE,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAiRA,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -18,9 +18,10 @@ interface StoryCardProps {
18
18
  handleDownloadUserStory?: (filetype: "pdf" | "doc") => Promise<void>;
19
19
  handleOpenSendDialog?: (sendEmailDialog: boolean, userStoryToSend: IUserStory[], artifactId: string, initSelectedEmails?: string[], autoSendEmail?: boolean) => void;
20
20
  updateUserStoryArtifact: (citationsObj: UserStoryCitations | null, userStoryWithCitations: IUserStory[], artifactId: string) => Promise<any>;
21
+ selectedArtifactId?: string;
21
22
  }
22
23
  export declare function replaceLearnedTagsWithInfo(content: string): React.ReactNode[];
23
- export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
24
25
  interface IProps {
25
26
  isUserStoryCurrentlyUpdated?: boolean;
26
27
  artifactId: string;
@@ -30,7 +31,8 @@ interface IProps {
30
31
  updateUserStoryArtifact: (citationsObj: UserStoryCitations | null, userStoryWithCitations: IUserStory[], artifactId: string) => Promise<any>;
31
32
  handleOpenSendDialog?: (sendEmailDialog: boolean, userStoryToSend: IUserStory[], artifactId: string, initSelectedEmails?: string[], autoSendEmail?: boolean) => void;
32
33
  handleDownloadUserStory?: (filetype: "pdf" | "doc") => Promise<void>;
34
+ selectedArtifactId?: string;
33
35
  }
34
- export declare const UserStoryCardWrapper: ({ artifactTitleIDs, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory }: IProps) => import("react/jsx-runtime").JSX.Element;
36
+ export declare const UserStoryCardWrapper: ({ artifactTitleIDs, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId }: IProps) => import("react/jsx-runtime").JSX.Element;
35
37
  export default StoryCard;
36
38
  //# sourceMappingURL=UserStoryCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAOlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAIzE,UAAU,cAAc;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAC/I;AAID,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAwC7E;AAkBD,eAAO,MAAM,SAAS,mRAenB,cAAc,4CA8ThB,CAAC;AAEF,UAAU,MAAM;IACZ,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7I,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AAED,eAAO,MAAM,oBAAoB,mLAAoL,MAAM,4CAgC1N,CAAA;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAOlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAIzE,UAAU,cAAc;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7I,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAID,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAwC7E;AAkBD,eAAO,MAAM,SAAS,uSAgBnB,cAAc,4CAgUhB,CAAC;AAEF,UAAU,MAAM;IACZ,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7I,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,uMAAwM,MAAM,4CAiC9O,CAAA;AAED,eAAe,SAAS,CAAC"}
@@ -18,6 +18,8 @@ interface RootProps {
18
18
  children: React.ReactNode;
19
19
  /** Custom class names */
20
20
  classNames?: UserStoryApprovalScreenClassNames;
21
+ /** Selected artifact ID to sync with external state */
22
+ selectedArtifactId?: string;
21
23
  }
22
24
  interface SidebarProps {
23
25
  /**
@@ -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,EACtB,MAAM,sCAAsC,CAAC;AA0D9C,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;CAChD;AAiOD,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;CAC1B;AAkID,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;CAC5C;AA0FD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
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,EACtB,MAAM,sCAAsC,CAAC;AA0D9C,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;AAyOD,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;CAC1B;AAkID,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;CAC5C;AA0FD,QAAA,MAAM,uBAAuB;;;;;CAK3B,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",