@viswa-test/test-citation 0.0.226 → 0.0.227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +270 -0
- package/dist/assests/svg/NeuralNetworkIcon.js +2 -0
- package/dist/assests/svg/NeuralNetworkIcon.js.map +1 -0
- package/dist/cjs/assests/svg/NeuralNetworkIcon.js +2 -0
- package/dist/cjs/assests/svg/NeuralNetworkIcon.js.map +1 -0
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useStyles.js +1 -1
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitation.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitation.module.css.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitation.module.css.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageCitation.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageFullScreenView.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationImageFullScreenView.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationSkeleton.js +2 -0
- package/dist/cjs/features/GptWebCitation/GptWebCitationSkeleton.js.map +1 -0
- package/dist/cjs/features/GptWebCitation/utils/citationData.utils.js +2 -0
- package/dist/cjs/features/GptWebCitation/utils/citationData.utils.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/segment-common.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/cjs/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
- package/dist/cjs/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.module.css.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
- package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useCompareData.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useStyles.js +1 -1
- package/dist/features/GptWebCitation/GptWebCitation.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitation.js.map +1 -0
- package/dist/features/GptWebCitation/GptWebCitation.module.css.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitation.module.css.js.map +1 -0
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationImageCitation.js.map +1 -0
- package/dist/features/GptWebCitation/GptWebCitationImageFullScreenView.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationImageFullScreenView.js.map +1 -0
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
- package/dist/features/GptWebCitation/GptWebCitationSkeleton.js +2 -0
- package/dist/features/GptWebCitation/GptWebCitationSkeleton.js.map +1 -0
- package/dist/features/GptWebCitation/utils/citationData.utils.js +2 -0
- package/dist/features/GptWebCitation/utils/citationData.utils.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/AttachedContext.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/AttachedContext.module.css.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.module.css.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +1 -1
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/segment-common.css.js +1 -1
- package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
- package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.js +1 -1
- package/dist/features/RequirementAiCitations/WebCitation/WebCitationWithImageContent.module.css.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/src/CognitiveCompareTest.d.ts.map +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +0 -10476
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/DeviationSummaryTest.d.ts +2 -0
- package/dist/types/src/DeviationSummaryTest.d.ts.map +1 -0
- package/dist/types/src/assests/svg/NeuralNetworkIcon.d.ts +9 -0
- package/dist/types/src/assests/svg/NeuralNetworkIcon.d.ts.map +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +6 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +1 -1
- package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/memoizedMarkdown.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareData.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useStyles.d.ts +3 -2
- package/dist/types/src/features/CognitiveCompare/hooks/useStyles.d.ts.map +1 -1
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts +5 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitation.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts +8 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageCitation.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageFullScreenView.d.ts +8 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationImageFullScreenView.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationMarkdown.d.ts +9 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationMarkdown.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationSkeleton.d.ts +3 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationSkeleton.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationTest.d.ts +4 -0
- package/dist/types/src/features/GptWebCitation/GptWebCitationTest.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/WebCitationSampleResponse.d.ts +4 -0
- package/dist/types/src/features/GptWebCitation/WebCitationSampleResponse.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts +112 -0
- package/dist/types/src/features/GptWebCitation/types.d.ts.map +1 -0
- package/dist/types/src/features/GptWebCitation/utils/citationData.utils.d.ts +8 -0
- package/dist/types/src/features/GptWebCitation/utils/citationData.utils.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/AttachedContext.d.ts +1 -3
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/AttachedContext.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +6 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +13 -3
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GptWebCitation.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useState as a,useEffect as n}from"react";import{Maximize2 as o,SquareArrowOutUpRight as r}from"lucide-react";import l from"./GptWebCitationImageFullScreenView.js";import s from"./GptWebCitationSkeleton.js";import{sanitizeExternalUrl as c}from"./utils/citationData.utils.js";import m from"./GptWebCitation.module.css.js";var d=function(d){var p=d.citationImage,u=d.citationUrl,f=d.showExpandImageButton,g=void 0===f||f,v=a(!1),h=v[0],C=v[1],b=a("loading"),k=b[0],N=b[1];n(function(){var i=!0;N("loading"),C(!1);var t=new Image;return t.onload=function(){i&&N("loaded")},t.onerror=function(){i&&N("error")},t.src=p,function(){i=!1,t.onload=null,t.onerror=null}},[p]);var w="loaded"===k,I=c(u);return t("div",i({className:m.imageCitationWrapper},{children:[e("div",i({className:m.imageCitationCenter},{children:w?t("div",i({className:m.imageCitationViewport},{children:[e("div",i({className:m.imageCitationScrollContainer},{children:e("img",{src:p,alt:"Web citation snapshot",className:m.citationImage})})),g&&e("button",i({type:"button",onClick:function(i){i.stopPropagation(),C(!0)},className:m.expandImageButton,"aria-label":"View citation image in full screen",title:"Expand image"},{children:e(o,{size:16,strokeWidth:2})}))]})):e(s,{})})),I&&t("div",i({className:m.visitLinkRow},{children:[e("span",i({className:m.visitLinkHint},{children:"Open link in new tab to read in detail"})),t("a",i({href:I,target:"_blank",rel:"noreferrer",className:m.visitLink},{children:["Visit Link",e(r,{size:16})]}))]})),h&&w&&e(l,{src:p,onClose:function(){return C(!1)}})]}))};export{d as default};
|
|
2
|
+
//# sourceMappingURL=GptWebCitationImageCitation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GptWebCitationImageCitation.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as o,jsxs as r}from"react/jsx-runtime";import{useEffect as t}from"react";import{createPortal as l}from"react-dom";import{X as n}from"lucide-react";import i from"./GptWebCitation.module.css.js";var a=function(e){return e.stopPropagation()},c=function(e){e.stopPropagation()},s=function(s){var m=s.src,u=s.onClose;return t(function(){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}},[]),l(o("div",e({role:"dialog","aria-modal":"true",className:i.fullScreenOverlay,onClick:u,onWheel:c},{children:r("div",e({className:i.fullScreenContent,onClick:a},{children:[o("button",e({type:"button",onClick:u,className:i.fullScreenCloseButton,"aria-label":"Close full screen view"},{children:o(n,{size:18,strokeWidth:2})})),o("div",e({className:i.fullScreenImageWrapper},{children:o("img",{src:m,alt:"Citation full view",className:i.fullScreenImage})}))]}))})),document.body)};export{s as default};
|
|
2
|
+
//# sourceMappingURL=GptWebCitationImageFullScreenView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GptWebCitationImageFullScreenView.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__rest as r,__assign as n}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useRef as i,useMemo as c,useEffect as l}from"react";import o from"react-markdown";import a from"rehype-raw";import{sanitizeExternalUrl as h}from"./utils/citationData.utils.js";import u from"./GptWebCitation.module.css.js";var d=function(d){var f=d.content,s=d.activeHighlightIndex,v=d.onHighlightCountChange,m=i(null),g=c(function(){var r,n=f.match(/id=["']highlighted-\d+["']/g);if(null==n?void 0:n.length)return n.length;var t=f.match(/<a\b[^>]*>/gi);return null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0},[f]),p=c(function(){return/id=["']highlighted-\d+["']/.test(f)},[f]);l(function(){null==v||v(g)},[g,v]),l(function(){var r;if(m.current){var n=m.current.querySelector("#highlighted-".concat(s));if(n)n.scrollIntoView({behavior:"smooth",block:"center"});else null===(r=m.current.querySelectorAll("a[href]")[s])||void 0===r||r.scrollIntoView({behavior:"smooth",block:"center"})}},[s,f]);var b=c(function(){var i=-1;return{span:function(e){e.node;var i=r(e,["node"]),c=i.id;if(null==c?void 0:c.startsWith("highlighted-")){var l=Number(c.replace("highlighted-",""))===s;return t("span",n({},i,{id:c,className:"".concat(u.highlight).concat(l?" ".concat(u.highlightActive):"")}))}return t("span",n({},i))},a:function(r){var c,l=r.children,o=r.href,a=r.title,d=r.className;if(!o)return t(e,{children:l});i+=1;var f=!p&&i===s,v=null!==(c=h(o))&&void 0!==c?c:"#";return t("a",n({href:v,title:a,target:"_blank",rel:"noreferrer",className:"".concat(u.citationLink).concat(f?" ".concat(u.citationLinkActive):"").concat(d?" ".concat(d):"")},{children:l}))},code:function(e){var i=e.children,c=r(e,["children"]);return t("code",n({},c,{children:i}))},ol:function(e){var i=e.children,c=r(e,["children"]);return t("ol",n({},c,{children:i}))},ul:function(e){var i=e.children,c=r(e,["children"]);return t("ul",n({},c,{children:i}))},li:function(e){var i=e.children,c=r(e,["children"]);return t("li",n({},c,{children:i}))},p:function(e){var i=e.children,c=r(e,["children"]);return t("p",n({},c,{children:i}))}}},[s,p,f]);return t("div",n({ref:m,className:u.markdownBody},{children:t(o,n({rehypePlugins:[a],components:b},{children:f}))}))};export{d as default};
|
|
2
|
+
//# sourceMappingURL=GptWebCitationMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GptWebCitationMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as s}from"react/jsx-runtime";import o from"./GptWebCitation.module.css.js";var i=function(){return t("div",e({className:o.skeleton},{children:[s("span",e({className:o.skeletonText},{children:"Loading a snapshot of citation from source website..."})),s("div",{className:o.skeletonShimmer})]}))};export{i as default};
|
|
2
|
+
//# sourceMappingURL=GptWebCitationSkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GptWebCitationSkeleton.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=function(t){return t?t.replace(/\\"/g,'"').replace(/\\'/g,"'").trim():""},i=function(t){if(null==t?void 0:t.trim()){var i=t.trim();if(!/^(javascript|data|vbscript):/i.test(i))try{var r=new URL(i);if("http:"===r.protocol||"https:"===r.protocol)return i}catch(t){if(i.startsWith("gs://"))return i}}},r=function(i){if(i)for(var r=t(i),e=0,a=[/decision strength is\s+([\d.]+)\s*%/i,/relevance score is\s+([\d.]+)\s*%/i,/confidence(?:\s+score)?(?:\s+is)?\s+([\d.]+)\s*%/i];e<a.length;e++){var n=a[e],o=r.match(n);if(null==o?void 0:o[1]){var c=Number(o[1]);if(!Number.isNaN(c))return c}}},e=function(i){if(i){var r=t(i).match(/<a\b[^>]*>(.*?)<\/a>/i);if(null==r?void 0:r[1]){var e=r[1].replace(/<[^>]*>?/gm,"").trim();if(e)return e}}},a=function(t){if(t)try{var i=new URL(t).hostname.replace(/^www\./i,""),r=i.split(".");if(r.length<2)return i;var e=r[r.length-2];return e.charAt(0).toUpperCase()+e.slice(1)}catch(t){return}},n=function(t){var r,e,a,n=i(null===(r=null==t?void 0:t.imageMetadata)||void 0===r?void 0:r.signed_url);if(n)return n;var o=null===(a=null===(e=null==t?void 0:t.imageMetadata)||void 0===e?void 0:e.gs_uri)||void 0===a?void 0:a.trim();return(null==o?void 0:o.startsWith("gs://"))?o:void 0},o=function(o){var c,l,u=t(o.content);return{citationId:o.citationId,content:u,citationType:o.citationType,citationUrl:i(o.citationUrl),topic:null!==(c=e(u))&&void 0!==c?c:"Web Citation",relevanceScore:null!==(l=r(u))&&void 0!==l?l:0,learnedFrom:a(o.citationUrl),web_citation_gcs_url:n(o),userId:o.userId,userName:o.userName,userEmail:o.userEmail,db:o.db,imageMetadata:o.imageMetadata}};export{a as extractLearnedFromUrl,r as extractRelevanceScoreFromContent,e as extractTopicFromContent,n as getWebCitationImageUrl,o as mapCitationDataToDisplay,i as sanitizeExternalUrl};
|
|
2
|
+
//# sourceMappingURL=citationData.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citationData.utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n}from"tslib";import{jsx as i,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useState as a,useRef as l,useEffect as s,useMemo as c}from"react";import{BookOpen as d,ChevronUp as u,ChevronDown as m,Video as p,Headphones as h,ImageIcon as v,FileText as g,FileCode as f,Loader2 as y,ExternalLink as w,Eye as C}from"lucide-react";import{useRequirementAI as N}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{Snackbar as x,Alert as b,AlertTitle as L}from"@mui/material";import{getDisplayFileType as P,GetFileIcon as z}from"../../utils/userStoryAttachedContext.utils.js";import j from"./AttachedContext.module.css.js";var k=function(e){return["mp4","mov","webm","mkv"].includes(e)?i(p,{size:24}):["mp3","wav","ogg","m4a","aac"].includes(e)?i(h,{size:24}):["png","jpg","jpeg","svg","webp","gif"].includes(e)?i(v,{size:24}):["pdf","docx","doc","txt","rtf","pages"].includes(e)?i(g,{size:24}):i(f,{size:24})},I=function(e,i){var r=N().apiCachingConfig,o=r.queryClient,a=r.useGetSignedUrlQuery,l=r.useGetSignedUrlMutation,c=r.getProjectFileUrl,d=null==c?void 0:c(e.path),u=["getSignedUrl",d],m=a(d,u).data,p=l(d),h=p.mutate,v=p.isPending;s(function(){d?o.getQueryData(u)||m||h({gsUtilPath:d}):null==i||i("Please provide valid gsUtilPath.")},[d]);return{handleRedirect:function(r){return t(void 0,void 0,void 0,function(){var t,a,l,s,c,p,g;return n(this,function(n){switch(n.label){case 0:null==r||r.stopPropagation(),n.label=1;case 1:return n.trys.push([1,4,,5]),(t=m||o.getQueryData(u))?"json"!==e.extension.toLowerCase()?(window.open(t,"_blank"),[2]):[4,fetch(t)]:(!v&&d&&h({gsUtilPath:d}),[2]);case 2:if(!(a=n.sent()).ok)throw new Error("Failed to fetch artifact JSON");return[4,a.json()];case 3:return l=n.sent(),s=l.id,c=l.modeName,s&&c?(p="".concat(window.location.origin,"/artifact/").concat(s,"/mode/").concat(c),window.open(p,"_blank"),[3,5]):(window.open(t,"_blank"),[2]);case 4:return g=n.sent(),console.error("Redirect failed:",g),m?window.open(m,"_blank"):null==i||i("Failed to open the selected file."),[3,5];case 5:return[2]}})})},isPending:v,signedUrl:m}},S=function(t){var n=t.item,o=t.isLast,l=t.getIconByExtension,s=t.customStyles,c=a(!1),d=c[0],u=c[1],m=a(""),p=m[0],h=m[1],v=I(n,function(e){h(e),u(!0)}),g=v.handleRedirect,f=v.isPending,C=v.signedUrl;return r("div",e({className:"".concat(j.contextItem," ").concat(o?j.lastItem:""),style:null==s?void 0:s.contextItem},{children:[i("div",e({className:j.itemIconWrapper,style:null==s?void 0:s.iconWrapper},{children:z(n.extension,n.title.toUpperCase())||l(n.extension)})),r("div",e({className:j.itemContent,style:null==s?void 0:s.itemContent},{children:[i("h3",e({className:j.itemTitle,style:null==s?void 0:s.title},{children:n.title})),i("p",e({className:j.itemMeta,style:null==s?void 0:s.metadata},{children:n.metadata}))]})),i("div",e({onClick:g,className:"".concat(j.actionButton," ").concat(C?j.actionButtonReady:""),style:null==s?void 0:s.actionButton},{children:f?i(y,{size:24,className:"animate-spin"}):i(w,{size:24})})),i(x,e({open:d,autoHideDuration:3e3,onClose:function(){return u(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"}},{children:r(b,e({onClose:function(){return u(!1)},severity:"error",sx:{width:"100%"}},{children:[i(L,{children:"Error"}),p]}))}))]}))},U=function(t){var n=t.item,l=a(!1),s=l[0],c=l[1],d=a(""),u=d[0],m=d[1],p=I(n,function(e){m(e),c(!0)}),h=p.handleRedirect,v=p.isPending;return r(o,{children:[r("span",e({className:j.sourceChip,onClick:h},{children:[i("span",e({className:j.sourceChipLabel},{children:n.title})),v?i(y,{size:12,className:"animate-spin"}):i(C,{size:12})]})),i(x,e({open:s,autoHideDuration:3e3,onClose:function(){return c(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"}},{children:r(b,e({onClose:function(){return c(!1)},severity:"error",sx:{width:"100%"}},{children:[i(L,{children:"Error"}),u]}))}))]})},D=function(t){var n=t.flattenedData,o=a(!1),l=o[0],s=o[1],c=l?n:n.slice(0,2);return r("div",e({className:j.sourcesContainer},{children:[i("span",e({className:j.sourcesLabel},{children:"Sources :"})),r("div",e({className:j.sourcesFilesContainer},{children:[c.map(function(e){return i(U,{item:e},e.id)}),!l&&n.length>2&&r("span",e({className:j.moreChip,onClick:function(){return s(!0)}},{children:["+",n.length-2]})),l&&n.length>2&&i("span",e({className:j.moreChip,onClick:function(){return s(!1)}},{children:"View Less"}))]}))]}))},E=function(t){var n=t.customStyles,o=t.variant,p=void 0===o?"dropdown":o,h=a(!1),v=h[0],g=h[1],f=l(null),y=N().persistedDataFiles;s(function(){var e=function(e){f.current&&!f.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var w=c(function(){var e=[];return y?(Object.entries(y).forEach(function(t){var n=t[0],i=t[1];Array.isArray(i)&&i.forEach(function(t){var i,r=t.filesFromProject;if(r){var o,a=r.name,l=(null===(i=r.type)||void 0===i?void 0:i.toLowerCase())||"",s=(o=r.uploadTime)?new Date(o).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"";e.push({id:r.url,category:n,title:a,extension:l,metadata:"".concat(s," • ").concat(P(l,a)),path:r.url,uploadTime:r.uploadTime})}})}),e):e},[y]);return"inline"===p?0===w.length?null:i(D,{flattenedData:w}):i("div",e({className:j.wrapper,style:null==n?void 0:n.wrapperComponent},{children:r("div",e({className:j.dropdownContainer,style:null==n?void 0:n.dropdownContainer,ref:f},{children:[r("button",e({onClick:function(e){e.stopPropagation(),g(!v)},className:j.triggerButton,style:null==n?void 0:n.triggerButton},{children:[i(d,{size:18,className:j.triggerIcon,style:null==n?void 0:n.triggerIcon}),r("span",e({className:j.triggerLabel,style:null==n?void 0:n.triggerLabel},{children:["Attached Context(",w.length,")"]})),i(v?u:m,{size:18})]})),v&&r("div",e({className:j.dropdownPanel,style:null==n?void 0:n.dropdownPanel},{children:[i("div",e({className:j.dropdownList,style:null==n?void 0:n.dropdownList},{children:w.length>0?w.map(function(e,t){return i(S,{item:e,isLast:t===w.length-1,getIconByExtension:k,customStyles:null==n?void 0:n.contextItem},e.id)}):i("div",e({className:j.emptyState},{children:"No attachments found"}))})),w.length>4&&i("div",{className:j.fadeGradient,style:null==n?void 0:n.fadeGradient})]}))]}))}))};export{E as default};
|
|
2
2
|
//# sourceMappingURL=AttachedContext.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var e={wrapper:"AttachedContext-module_wrapper__KHDIP",dropdownContainer:"AttachedContext-module_dropdownContainer__TPFtZ",triggerButton:"AttachedContext-module_triggerButton__ZXDWZ",triggerIcon:"AttachedContext-module_triggerIcon__cdeba",triggerLabel:"AttachedContext-module_triggerLabel__7HM4O",dropdownPanel:"AttachedContext-module_dropdownPanel__r-NRo",slideIn:"AttachedContext-module_slideIn__ah8dZ",dropdownList:"AttachedContext-module_dropdownList__E-mKF",fadeGradient:"AttachedContext-module_fadeGradient__ncpfP",emptyState:"AttachedContext-module_emptyState__WCYKW",contextItem:"AttachedContext-module_contextItem__I0Q9u",lastItem:"AttachedContext-module_lastItem__fWT-n",itemIconWrapper:"AttachedContext-module_itemIconWrapper__FjAJj",itemContent:"AttachedContext-module_itemContent__jwJwp",itemTitle:"AttachedContext-module_itemTitle__e2hAN",itemMeta:"AttachedContext-module_itemMeta__Hw9Ct",actionButton:"AttachedContext-module_actionButton__oQioa",actionButtonReady:"AttachedContext-module_actionButtonReady__TbrP-",sourcesContainer:"AttachedContext-module_sourcesContainer__AP6PI",sourcesFilesContainer:"AttachedContext-module_sourcesFilesContainer__-Mnhn",sourcesLabel:"AttachedContext-module_sourcesLabel__VN-9Q",sourceChip:"AttachedContext-module_sourceChip__QsVPO",sourceChipLabel:"AttachedContext-module_sourceChipLabel__f29Qv",moreChip:"AttachedContext-module_moreChip__ieXRs"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode(".AttachedContext-module_wrapper__KHDIP{display:flex;flex-direction:column}.AttachedContext-module_dropdownContainer__TPFtZ{display:inline-block;position:relative;text-align:left}.AttachedContext-module_triggerButton__ZXDWZ{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 1px 2px 0 #0000000d;color:#374151;cursor:pointer;display:flex;gap:.5rem;padding:.5rem 1rem;transition:background-color .2s,border-color .2s}.AttachedContext-module_triggerButton__ZXDWZ:hover{background-color:#f9fafb}.AttachedContext-module_triggerIcon__cdeba{color:#4b5563}.AttachedContext-module_triggerLabel__7HM4O{font-weight:500}.AttachedContext-module_dropdownPanel__r-NRo{animation:AttachedContext-module_slideIn__ah8dZ .2s ease-out;background-color:#fff;border:1px solid #f3f4f6;border-radius:12px;box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;left:0;margin-top:.5rem;overflow:hidden;position:absolute;width:420px;z-index:50}.AttachedContext-module_dropdownList__E-mKF{max-height:300px;overflow-y:auto;padding-bottom:.5rem;padding-top:.5rem}.AttachedContext-module_dropdownList__E-mKF::-webkit-scrollbar{width:6px}.AttachedContext-module_dropdownList__E-mKF::-webkit-scrollbar-track{background:#0000}.AttachedContext-module_dropdownList__E-mKF::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:10px}.AttachedContext-module_dropdownList__E-mKF::-webkit-scrollbar-thumb:hover{background:#d1d5db}.AttachedContext-module_fadeGradient__ncpfP{background:linear-gradient(0deg,#f9fafb80,#0000);height:1rem;pointer-events:none}.AttachedContext-module_emptyState__WCYKW{color:#9ca3af;font-size:.875rem;padding:2rem;text-align:center}.AttachedContext-module_contextItem__I0Q9u{align-items:flex-start;border-bottom:1px solid #0000;border-radius:8px;display:flex;gap:1rem;margin-left:.5rem;margin-right:.5rem;padding:1rem;transition:background-color .15s}.AttachedContext-module_contextItem__I0Q9u:not(.AttachedContext-module_lastItem__fWT-n){border-bottom-color:#f3f4f6}.AttachedContext-module_contextItem__I0Q9u:hover{background-color:#f9fafb}.AttachedContext-module_itemIconWrapper__FjAJj{background-color:#f5f3ff;border-radius:8px;color:#8b5cf6;flex-shrink:0;margin-top:.25rem;padding:.5rem}.AttachedContext-module_itemContent__jwJwp{flex:1;min-width:0}.AttachedContext-module_itemTitle__e2hAN{color:#111827;font-size:.9375rem;font-weight:600;margin:0;overflow:hidden;text-overflow:ellipsis;transition:color .15s;white-space:nowrap}.AttachedContext-module_contextItem__I0Q9u:hover .AttachedContext-module_itemTitle__e2hAN{color:#7c3aed}.AttachedContext-module_itemMeta__Hw9Ct{color:#6b7280;font-size:.875rem;margin-bottom:0;margin-top:.125rem}.AttachedContext-module_actionButton__oQioa{align-self:center;background:none;border:none;border-radius:4px;color:#9ca3af;cursor:pointer;flex-shrink:0;line-height:0;padding:.5rem;transition:color .15s,background-color .15s}.AttachedContext-module_actionButton__oQioa:hover{background-color:#fff;color:#7c3aed}.AttachedContext-module_actionButtonReady__TbrP-{color:#6b7280}.AttachedContext-module_sourcesContainer__AP6PI{align-items:center;display:flex;gap:8px;min-width:0;width:100%}.AttachedContext-module_sourcesFilesContainer__-Mnhn{align-items:center;display:flex;flex-wrap:wrap;gap:8px;min-width:0}.AttachedContext-module_sourcesLabel__VN-9Q{color:#374151;flex-shrink:0;font-size:14px;font-weight:600;line-height:20px}.AttachedContext-module_sourceChip__QsVPO{align-items:center;background:#eef2ff;border-radius:10px;color:#6366f1;cursor:pointer;display:inline-flex;flex-shrink:1;font-size:13px;font-weight:500;gap:6px;line-height:18px;min-width:0;padding:6px 12px;transition:background-color .15s ease,transform .15s ease}.AttachedContext-module_sourceChip__QsVPO:hover{background:#e0e7ff}.AttachedContext-module_sourceChipLabel__f29Qv{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AttachedContext-module_moreChip__ieXRs{align-items:center;border:1px solid #c8d0db;border-radius:10px;cursor:pointer;display:inline-flex;flex-shrink:0;font-size:13px;font-weight:600;justify-content:center;line-height:18px;padding:6px 12px;transition:background-color .15s ease}.AttachedContext-module_moreChip__ieXRs:hover{background:#e0e7ff}@keyframes AttachedContext-module_slideIn__ah8dZ{0%{opacity:0;transform:translateY(-10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=AttachedContext.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as i,jsxs as o,Fragment as n}from"react/jsx-runtime";import{PenLine as t,CheckCircle as l,XCircle as r,Info as d,ChevronDown as a,ChevronRight as s}from"lucide-react";import{useState as c}from"react";import{ToneToggle as p}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as v}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";var g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],m=function(n){var t=n.toneIndex,l=n.configs,r=void 0===l?g:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,p=(s-90)*Math.PI/180,v=11+9*Math.cos(p),u=13+9*Math.sin(p);return o("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:v,y2:u,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},y=function(o){var n=o.type,t=o.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[n]||r.Medium;return i("div",e({style:d},{children:n}))},f=["Lenient","Balanced","Aggressive"],h={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},x={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},S={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},b={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},C={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},B={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},I={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},A={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},D={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},z={borderTop:"0.5px solid #eee",paddingTop:14},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},E={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},j={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},L={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},M={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},F={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};function N(N){var _,P,O,G,q,J,K,Q,U,V,X,Y,Z,$,ee,ie,oe=N.onClose,ne=N.aiReason,te=N.onAccept,le=N.onReject,re=N.onIterate,de=N.initialTone,ae=N.onRegenerate,se=N.labels,ce=void 0===se?{}:se,pe=N.toneLevelsConfig,ve=void 0===pe?f:pe,ue=N.toneColorsConfig,ge=void 0===ue?h:ue,me=N.dialConfigs,ye=void 0===me?g:me,fe=N.actions,he=N.disableAllActions,xe=void 0!==he&&he,Se=N.customStyles,be=void 0===Se?{}:Se,Ce=N.severityChipStyles,Be=void 0===Ce?{}:Ce,Ie=N.customIcons,ke=void 0===Ie?{}:Ie,Ae=N.onOpenCognitive,De=N.showTone,Te=void 0===De||De,we=N.cognitiveSectionStyle,ze=void 0===we?{}:we,Re=N.cognitiveScoreBadgeStyle,We=void 0===Re?{}:Re,Ee=N.cognitiveScoreTextStyle,je=void 0===Ee?{}:Ee,Le=N.cognitiveStyles,Me=void 0===Le?{}:Le,Fe=N.cognitiveClassNames,He=void 0===Fe?{}:Fe,Ne=N.cognitiveTitle,_e=void 0===Ne?"Cognitive Integrity":Ne,Pe=N.cognitiveLeftIcon,Oe=N.showCognitiveRightArrow,Ge=void 0===Oe||Oe,qe=N.isStreaming,Je=ve.findIndex(function(e){return e===de});-1===Je&&(Je=1);var Ke=c(!0),Qe=Ke[0],Ue=Ke[1],Ve=c(!1),Xe=Ve[0],Ye=Ve[1],Ze=c(Je),$e=Ze[0],ei=Ze[1],ii=c(Je)[0],oi=ve[$e],ni=ge[oi]||"#BA7517",ti=$e!==ii,li=[{id:"iterate",icon:ke.iterateIcon||i(t,{size:16,color:"#64748B"}),label:ce.btnIterate||"Iterate",color:"#64748B",onClick:re},{id:"accept",icon:ke.acceptIcon||i(l,{size:16,color:"#10B981"}),label:ce.btnAccept||"Approve",color:"#10B981",onClick:te},{id:"reject",icon:ke.rejectIcon||i(r,{size:16,color:"#DC2626"}),label:ce.btnReject||"Reject",color:"#DC2626",onClick:le}],ri=fe||li;return o("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},x),null===(_=null==be?void 0:be.DeviationSummaryStyles)||void 0===_?void 0:_.root)},{children:[o("div",e({style:e(e({},S),null===(P=null==be?void 0:be.DeviationSummaryStyles)||void 0===P?void 0:P.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",{children:ke.summaryIcon||i(d,{size:16,color:"#E24B4A"})}),i("span",e({style:e(e({},b),null===(O=null==be?void 0:be.DeviationSummaryStyles)||void 0===O?void 0:O.title)},{children:ce.summaryHeader||"Summary"}))]})),i("button",e({onClick:oe,style:e(e({},w),null===(G=null==be?void 0:be.DeviationSummaryStyles)||void 0===G?void 0:G.closeBtn)},{children:"✕"}))]})),i("p",e({style:e(e({},C),null===(q=null==be?void 0:be.DeviationSummaryStyles)||void 0===q?void 0:q.bodyText)},{children:null===(J=null==ne?void 0:ne.deviation_details)||void 0===J?void 0:J.deviation_title})),i("p",e({style:e(e({},B),null===(K=null==be?void 0:be.DeviationSummaryStyles)||void 0===K?void 0:K.summary)},{children:null===(Q=null==ne?void 0:ne.deviation_details)||void 0===Q?void 0:Q.deviation_summary})),o("div",e({style:e(e({},I),null===(U=null==be?void 0:be.DeviationSummaryStyles)||void 0===U?void 0:U.impactContainer)},{children:[o("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[o("button",e({onClick:function(){return Ue(!Qe)},style:e(e({},k),null===(V=null==be?void 0:be.DeviationSummaryStyles)||void 0===V?void 0:V.impactToggle)},{children:[i("span",e({style:e(e({},A),null===(X=null==be?void 0:be.DeviationSummaryStyles)||void 0===X?void 0:X.impactToggleLabel)},{children:ce.impactHeader||"Impact"})),i("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Qe?"rotate(180deg)":"rotate(0deg)"}},{children:i(a,{size:16,color:"#E24B4A"})}))]})),i(y,{type:(null==ne?void 0:ne.severity)||"Medium",customStyles:Be})]})),Qe&&i("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(Z=null===(Y=null==ne?void 0:ne.deviation_details)||void 0===Y?void 0:Y.deviation_impact)&&void 0!==Z?Z:ce.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i("div",e({style:e(e({},D),null===($=null==be?void 0:be.DeviationSummaryStyles)||void 0===$?void 0:$.actionContainer)},{children:ri.map(function(i){var n,t,l=xe||i.disabled,r=l?e(e({cursor:"not-allowed",opacity:.5},null===(n=null==be?void 0:be.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtnDisabled),i.disabledStyle):{};return o("button",e({style:e(e(e(e(e({},T),null===(t=null==be?void 0:be.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtn),{color:i.color}),i.style),r),onClick:l?void 0:i.onClick,disabled:l},{children:[i.icon,i.label]}),i.id)})})),Te&&o("div",e({style:e(e({},z),null===(ee=null==be?void 0:be.DeviationSummaryStyles)||void 0===ee?void 0:ee.toneContainer)},{children:[o("button",e({onClick:function(){return Ye(!Xe)},style:e(e({},R),null===(ie=null==be?void 0:be.DeviationSummaryStyles)||void 0===ie?void 0:ie.toneToggleBtn)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[i(m,{toneIndex:$e,configs:ye}),i("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ce.toneHeader||"Redline Tone"}))]})),i("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Xe?"rotate(180deg)":"rotate(0deg)"}},{children:i(a,{size:16,color:"#111"})}))]})),Xe&&o(n,{children:[i("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ce.toneDescription||"Controls how assertively AI is redlining"})),i(p,{isDirty:ti,onToneChange:function(e){ei(e)},toneColor:ni,toneIndex:$e,onClickRegenerate:function(){return null==ae?void 0:ae(oi)},toneLabels:ve,isStreaming:qe,aiReason:ne})]})]})),Ae&&o("div",e({className:null==He?void 0:He.section,onClick:function(e){e.stopPropagation(),Ae&&Ae(e)},style:e(e(e({},W),null==Me?void 0:Me.section),ze)},{children:[o("div",e({className:null==He?void 0:He.headerLeft,style:e(e({},E),null==Me?void 0:Me.headerLeft)},{children:[i("span",e({className:null==He?void 0:He.titleIcon,style:e(e({},j),null==Me?void 0:Me.titleIcon)},{children:null!=Pe?Pe:i(v,{})})),i("div",e({className:null==He?void 0:He.cognitiveTitle,style:e(e({},L),null==Me?void 0:Me.cognitiveTitle)},{children:_e}))]})),o("div",e({className:null==He?void 0:He.headerRight,style:e(e({},M),null==Me?void 0:Me.headerRight)},{children:[void 0!==(null==ne?void 0:ne.relevance_score)&&null!==(null==ne?void 0:ne.relevance_score)?o("span",e({className:null==He?void 0:He.scoreBadge,style:e(e(e({},F),null==Me?void 0:Me.scoreBadge),We)},{children:[i(u,{}),o("span",e({className:null==He?void 0:He.scoreText,style:e(e(e({},H),null==Me?void 0:Me.scoreText),je)},{children:[Math.round(Number(ne.relevance_score)),"%"]}))]})):null,Ge&&i("span",e({style:{display:"flex",alignItems:"center"}},{children:i(s,{size:16,color:"#64748B"})}))]}))]}))]}))}export{N as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as i,jsxs as n,Fragment as o}from"react/jsx-runtime";import{PenLine as t,CheckCircle as l,XCircle as r,Info as d,ChevronDown as a,ChevronRight as s}from"lucide-react";import{useState as c}from"react";import{ToneToggle as p}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as u}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as v}from"../icons/aiMagic.svg.js";var g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],m=function(o){var t=o.toneIndex,l=o.configs,r=void 0===l?g:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,p=(s-90)*Math.PI/180,u=11+9*Math.cos(p),v=13+9*Math.sin(p);return n("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:u,y2:v,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},y=function(n){var o=n.type,t=n.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[o]||r.Medium;return i("div",e({style:d},{children:o}))},h=["Lenient","Balanced","Aggressive"],f={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},x={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},b={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},S={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},C={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},k={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},B={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},I={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},w={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},A={display:"flex",gap:8,marginBottom:18},D={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},T={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},z={borderTop:"0.5px solid #eee",paddingTop:14},E={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},R={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},j={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},W={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},M={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},F={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},L={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},N={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},H={menuStyles:{padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0}};function _(o){var t=o.onAssignClick;return i("div",e({style:H.menuStyles},{children:n("p",e({style:{margin:0,padding:"4px",cursor:"pointer",gap:"8px",display:"flex",alignItems:"center",justifyContent:"center"},onClick:t},{children:[n("svg",e({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-users-icon lucide-users"},{children:[i("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),i("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),i("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),i("circle",{cx:"9",cy:"7",r:"4"})]})),i("p",e({style:{margin:"0px",display:"flex",alignItems:"center"}},{children:"Assign"}))]}))}))}function P(o){var t=o.onAssignClick,l=c(!1),r=l[0],d=l[1];return n("div",e({style:{position:"relative",display:"flex"}},{children:[i("button",e({onClick:function(){return d(!r)},style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px"}},{children:n("svg",e({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-ellipsis-vertical-icon lucide-ellipsis-vertical"},{children:[i("circle",{cx:"12",cy:"12",r:"1"}),i("circle",{cx:"12",cy:"5",r:"1"}),i("circle",{cx:"12",cy:"19",r:"1"})]}))})),r&&i(_,{onAssignClick:function(){d(!r),t()}})]}))}function O(i){var o=i.users,t=o.length;return n("div",e({style:{display:"flex",padding:"8px",paddingTop:"5px",paddingBottom:"5px",border:"1px solid #E2E8F0",background:"transparent",fontSize:"11px",gap:9,borderRadius:"5px"}},{children:[n("p",e({style:{margin:"0px",display:"flex",alignItems:"center"}},{children:[(null==o?void 0:o[0].length)>9?(null==o?void 0:o[0].slice(0,9))+"...":null==o?void 0:o[0]," "]})),n("p",e({style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0"}},{children:["+",t-1]}))]}))}function G(H){var _,G,U,q,J,K,Q,V,X,Y,Z,$,ee,ie,ne,oe,te=H.onClose,le=H.aiReason,re=H.onAccept,de=H.onReject,ae=H.onIterate,se=H.initialTone,ce=H.onRegenerate,pe=H.labels,ue=void 0===pe?{}:pe,ve=H.toneLevelsConfig,ge=void 0===ve?h:ve,me=H.toneColorsConfig,ye=void 0===me?f:me,he=H.dialConfigs,fe=void 0===he?g:he,xe=H.actions,be=H.disableAllActions,Se=void 0!==be&&be,Ce=H.customStyles,ke=void 0===Ce?{}:Ce,Be=H.severityChipStyles,Ie=void 0===Be?{}:Be,we=H.customIcons,Ae=void 0===we?{}:we,De=H.onOpenCognitive,Te=H.showTone,ze=void 0===Te||Te,Ee=H.cognitiveSectionStyle,Re=void 0===Ee?{}:Ee,je=H.cognitiveScoreBadgeStyle,We=void 0===je?{}:je,Me=H.cognitiveScoreTextStyle,Fe=void 0===Me?{}:Me,Le=H.cognitiveStyles,Ne=void 0===Le?{}:Le,He=H.cognitiveClassNames,_e=void 0===He?{}:He,Pe=H.cognitiveTitle,Oe=void 0===Pe?"Cognitive Integrity":Pe,Ge=H.cognitiveLeftIcon,Ue=H.showCognitiveRightArrow,qe=void 0===Ue||Ue,Je=H.isStreaming,Ke=H.onAssignClick,Qe=H.assignedUsers,Ve=ge.findIndex(function(e){return e===se});-1===Ve&&(Ve=1);var Xe=c(!0),Ye=Xe[0],Ze=Xe[1],$e=c(!1),ei=$e[0],ii=$e[1],ni=c(Ve),oi=ni[0],ti=ni[1],li=c(Ve)[0],ri=ge[oi],di=ye[ri]||"#BA7517",ai=oi!==li,si=[{id:"iterate",icon:Ae.iterateIcon||i(t,{size:16,color:"#64748B"}),label:ue.btnIterate||"Iterate",color:"#64748B",onClick:ae},{id:"accept",icon:Ae.acceptIcon||i(l,{size:16,color:"#10B981"}),label:ue.btnAccept||"Approve",color:"#10B981",onClick:re},{id:"reject",icon:Ae.rejectIcon||i(r,{size:16,color:"#DC2626"}),label:ue.btnReject||"Reject",color:"#DC2626",onClick:de}],ci=xe||si;return n("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},x),null===(_=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===_?void 0:_.root)},{children:[n("div",e({style:e(e({},b),null===(G=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===G?void 0:G.header)},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",{children:Ae.summaryIcon||i(d,{size:16,color:"#E24B4A"})}),i("span",e({style:e(e({},S),null===(U=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===U?void 0:U.title)},{children:ue.summaryHeader||"Summary"}))]})),n("div",e({style:{display:"flex",gap:15}},{children:[Qe&&i(O,{users:Qe}),Ke&&i(P,{onAssignClick:Ke}),i("button",e({onClick:te,style:e(e({},T),null===(q=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===q?void 0:q.closeBtn)},{children:"✕"}))]}))]})),i("p",e({style:e(e({},C),null===(J=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===J?void 0:J.bodyText)},{children:null===(K=null==le?void 0:le.deviation_details)||void 0===K?void 0:K.deviation_title})),i("p",e({style:e(e({},k),null===(Q=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===Q?void 0:Q.summary)},{children:null===(V=null==le?void 0:le.deviation_details)||void 0===V?void 0:V.deviation_summary})),n("div",e({style:e(e({},B),null===(X=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===X?void 0:X.impactContainer)},{children:[n("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[n("button",e({onClick:function(){return Ze(!Ye)},style:e(e({},I),null===(Y=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===Y?void 0:Y.impactToggle)},{children:[i("span",e({style:e(e({},w),null===(Z=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===Z?void 0:Z.impactToggleLabel)},{children:ue.impactHeader||"Impact"})),i("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ye?"rotate(180deg)":"rotate(0deg)"}},{children:i(a,{size:16,color:"#E24B4A"})}))]})),i(y,{type:(null==le?void 0:le.severity)||"Medium",customStyles:Ie})]})),Ye&&i("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(ee=null===($=null==le?void 0:le.deviation_details)||void 0===$?void 0:$.deviation_impact)&&void 0!==ee?ee:ue.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i("div",e({style:e(e({},A),null===(ie=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===ie?void 0:ie.actionContainer)},{children:ci.map(function(i){var o,t,l=Se||i.disabled,r=l?e(e({cursor:"not-allowed",opacity:.5},null===(o=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtnDisabled),i.disabledStyle):{};return n("button",e({style:e(e(e(e(e({},D),null===(t=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtn),{color:i.color}),i.style),r),onClick:l?void 0:i.onClick,disabled:l},{children:[i.icon,i.label]}),i.id)})})),ze&&n("div",e({style:e(e({},z),null===(ne=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===ne?void 0:ne.toneContainer)},{children:[n("button",e({onClick:function(){return ii(!ei)},style:e(e({},E),null===(oe=null==ke?void 0:ke.DeviationSummaryStyles)||void 0===oe?void 0:oe.toneToggleBtn)},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[i(m,{toneIndex:oi,configs:fe}),i("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ue.toneHeader||"Redline Tone"}))]})),i("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ei?"rotate(180deg)":"rotate(0deg)"}},{children:i(a,{size:16,color:"#111"})}))]})),ei&&n(o,{children:[i("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ue.toneDescription||"Controls how assertively AI is redlining"})),i(p,{isDirty:ai,onToneChange:function(e){ti(e)},toneColor:di,toneIndex:oi,onClickRegenerate:function(){return null==ce?void 0:ce(ri)},toneLabels:ge,isStreaming:Je,aiReason:le})]})]})),De&&n("div",e({className:null==_e?void 0:_e.section,onClick:function(e){e.stopPropagation(),De&&De(e)},style:e(e(e({},R),null==Ne?void 0:Ne.section),Re)},{children:[n("div",e({className:null==_e?void 0:_e.headerLeft,style:e(e({},j),null==Ne?void 0:Ne.headerLeft)},{children:[i("span",e({className:null==_e?void 0:_e.titleIcon,style:e(e({},W),null==Ne?void 0:Ne.titleIcon)},{children:null!=Ge?Ge:i(u,{})})),i("div",e({className:null==_e?void 0:_e.cognitiveTitle,style:e(e({},M),null==Ne?void 0:Ne.cognitiveTitle)},{children:Oe}))]})),n("div",e({className:null==_e?void 0:_e.headerRight,style:e(e({},F),null==Ne?void 0:Ne.headerRight)},{children:[void 0!==(null==le?void 0:le.relevance_score)&&null!==(null==le?void 0:le.relevance_score)?n("span",e({className:null==_e?void 0:_e.scoreBadge,style:e(e(e({},L),null==Ne?void 0:Ne.scoreBadge),We)},{children:[i(v,{}),n("span",e({className:null==_e?void 0:_e.scoreText,style:e(e(e({},N),null==Ne?void 0:Ne.scoreText),Fe)},{children:[Math.round(Number(le.relevance_score)),"%"]}))]})):null,qe&&i("span",e({style:{display:"flex",alignItems:"center"}},{children:i(s,{size:16,color:"#64748B"})}))]}))]}))]}))}export{P as KebabMenu,G as default};
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as i,jsx as l,Fragment as r}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 f,LoaderCircle as m,PencilIcon as y,Plus as h,Trash2 as p,Ellipsis as S,ChevronUp as g,ChevronDown as C,ChevronUpIcon as I,ChevronDownIcon as w,Info as b,Bookmark as N}from"lucide-react";import B from"showdown";import{Menu as D,MenuItem as U,Tooltip as x}from"@mui/material";import{v4 as E}from"uuid";import k from"./UserStoryCard.module.css.js";import{formatMarkdown as T,indentMarkdown as A}from"../../utils/helpers.js";import{replaceTitleSection as M}from"../../utils/user-story.utils.js";import _ from"../../shared/AtomicButton.js";import P from"../RichTextEditor/RichTextEditor.js";import H from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as j}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as L}from"./TitleEditor/TitleEditor.js";function z(t){for(var n,o=[],i=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=i.exec(t));){var s=n[1],u=n.index;u>r&&o.push(l("span",{children:t.slice(r,u)},"text-pre-".concat(a++))),o.push(l(x,e({title:s,placement:"top"},{children:l(b,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(E()))),r=i.lastIndex}return r<(null==t?void 0:t.length)&&o.push(l("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function W(t,n,o){var i;if(!t)return{};if(n)return e({},t.parentConfig);var l=e({},t.childConfig);return o&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[o])?e(e({},l),t.subFeatureOverrides[o]):l}var O=function(t){var n,o=t.displayName,r=R().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return i("div",e({className:k.displayName,style:null==a?void 0:a.wrapper},{children:[l(N,{className:k.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),i("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},V=function(I){var w,b,N,x,F,G,q,Q=I.isUserStoryCurrentlyUpdated,Z=I.artifactId,J=I.artifactTitleId,K=I.parentUserStory,X=I.currentUserStory,Y=I.onUserStoryChange,$=I.parentIndex,ee=I.currentIndex,te=I.enableDownload,ne=I.isDiffEditReviewMode,oe=I.showUserStoryDiff,ie=I.handleDownloadUserStory,le=I.handleOpenSendDialog,re=I.updateUserStoryArtifact,ae=I.selectedArtifactId,se=I.isDisplayHighlightControl,ue=I.elementDisplayConfig,ce=I._resolvedConfig,de=I.showWrapper,ve=void 0!==de&&de,fe=I.actionItemsConfig,me=I.onDelete,ye=R(),he=ye.searchQueryList,pe=ye.citations,Se=ye.customStyles,ge=null==Se?void 0:Se.userStoryCardStyles,Ce=null===(w=null==Se?void 0:Se.userStoryCardStyles)||void 0===w?void 0:w.userStoryEditStyles,Ie=null===(b=null==Se?void 0:Se.userStoryScreenStyles)||void 0===b?void 0:b.userStoryContentStyles,we=null==ge?void 0:ge.progressHeaderStyles,be=a(e(e({},structuredClone(X)),{value:T(X.value)||""})),Ne=be[0],Be=be[1],De=a({userStory:!!X.isDefaultEdit}),Ue=De[0],xe=De[1],Ee=a(!1),ke=Ee[0],Te=Ee[1],Ae=a(null),Me=Ae[0],_e=Ae[1],Pe=R(),He=Pe.userStory,Re=Pe.customIcons,je=a(""===$||ae===X.artifactId||!!X.isDefaultOpen),Le=je[0],ze=je[1],We=a(!1);We[0];var Oe=We[1],Ve=a(null),Fe=Ve[0],Ge=Ve[1],qe=a(null),Qe=qe[0],Ze=qe[1],Je=a(!1),Ke=Je[0],Xe=Je[1],Ye=s(null),$e=a(!1);$e[0];var et=$e[1],tt=s(null);u(function(){Q&&ze(Q)},[Q]),u(function(){Be(e(e({},structuredClone(X)),{value:T(X.value)||""}))},[X]),u(function(){he.length>0?ze(!0):ae&&ze(ae===X.artifactId)},[he,ae,X.artifactId]);var nt=function(){Ge(null)},ot=function(){Ze(null)},it=function(){ze(function(e){return!e})};var lt=null!=(null==X?void 0:X.big_enough)&&!Number.isNaN(X.big_enough)&&!!(null==X?void 0:X.big_enough_decision_factors),rt=""===$,at=null!=ce?ce:W(ue,rt),st=!ne&&!oe;return u(function(){if(Me){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(Me));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[Me]),u(function(){X.isDefaultEdit&&xe(function(t){return e(e({},t),{userStory:!0})})},[X.isDefaultEdit]),i("div",e({className:k.card,style:null==ge?void 0:ge.cardStyle,id:"story-card-".concat(X.title),"data-expanded":Le},{children:[i("div",e({className:k.titleSection,style:null==ge?void 0:ge.titleSection},{children:[i("div",e({className:k.titleRow,style:null==ge?void 0:ge.titleRow,onClick:it},{children:[i("div",e({className:k.titleLeft,style:null==ge?void 0:ge.titleLeft,onMouseEnter:function(){return et(!0)},onMouseLeave:function(){return et(!1)}},{children:[l(O,{displayName:J}),ke&&st?l(L,{title:X.title,onSave:function(o){return function(o,i){return t(void 0,void 0,void 0,function(){var t,l;return n(this,function(n){try{t=e({},X),X.artifactId===i?t.title=o:t.sub_features=(null===(l=X.sub_features)||void 0===l?void 0:l.map(function(t){return t.artifactId===i?e(e({},t),{title:o}):t}))||[],Be(t),Y(t),Te(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,X.artifactId)},onCancel:function(){Te(!1)},inputStyle:null==Ce?void 0:Ce.inlineTitleInput,confirmButtonStyle:null==Ce?void 0:Ce.inlineTitleConfirm,cancelButtonStyle:null==Ce?void 0:Ce.inlineTitleCancel},"inline-title-editor"):i("div",e({className:k.storyTitleWrapper},{children:[l("h2",e({title:X.title,className:k.storyTitle,style:null==ge?void 0:ge.storyTitle},{children:z(X.title)}),X.artifactId),l("button",e({type:"button",className:k.titleEditButton,style:null==Ce?void 0:Ce.titleEditButton,onClick:function(e){e.stopPropagation(),Te(!0),Le||ze(!0)},"aria-label":"Edit title",title:"Edit title"},{children:l("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})}))}))]}))]})),i("div",e({className:k.titleActions,style:null==ge?void 0:ge.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(at.showProgressPercentage||at.showGapBox)&&ve&&i("div",e({className:k.progressHeader,style:null==we?void 0:we.wrapper},{children:[at.showProgressPercentage&&i("div",e({className:k.progressPercentage,style:null==we?void 0:we.percentage},{children:[null!==(x=null!==(N=null==X?void 0:X.confidenceScore)&&void 0!==N?N:null==at?void 0:at.confidenceValue)&&void 0!==x?x:"0","%"]})),at.showGapBox&&i("div",e({className:k.gapBox,style:null==we?void 0:we.gapBox},{children:[null!==(G=null!==(F=null==X?void 0:X.gapValue)&&void 0!==F?F:null==at?void 0:at.gapBoxValue)&&void 0!==G?G:"2"," ","Gaps"]}))]})),lt&&l(j,{customIcons:null==Re?void 0:Re.userStoryIcons,customStyles:null==ge?void 0:ge.aiReasoningCitaionStyles,currentUserStory:X,panelStyles:null==ge?void 0:ge.BigEnoughStyles}),!Ue.userStory&&i(r,{children:[!1!==(null==at?void 0:at.showShareButton)&&l("button",e({className:k.iconButton,style:null==ge?void 0:ge.iconButton,onClick:function(e){Ge(e.currentTarget)}},{children:l(c,{size:16})})),i(D,e({id:"user-story-share-menu",anchorEl:Fe,open:!!Fe,onClose:function(){return Ge(null)},style:null==ge?void 0:ge.userStoryShareMenu},{children:[te&&l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Oe(!0),ie?[4,Promise.all([ie("pdf"),ie("doc")])]:[2];case 1:return e.sent(),Oe(!1),[2]}})})}},{children:i("div",e({ref:Ye,className:k.menuItemContent,style:null==ge?void 0:ge.menuItemContent},{children:[l(d,{size:16,color:null==ge?void 0:ge.menuIconColor}),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:"Download"}))]}))})),l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=X,K&&(t=e(e({},X),{value:"".concat(M(null==K?void 0:K.value,X.title)," \n").concat(X.value)})),null==le||le(!0,[t],X.artifactId),nt(),[2]})})}},{children:i("div",e({style:null==ge?void 0:ge.menuItemContent,className:k.menuItemContentPadded},{children:[l(v,{size:16,color:null==ge?void 0:ge.menuIconColor}),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:"Send"}))]}))})),l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,i,l;return n(this,function(n){switch(n.label){case 0:e=new B.Converter,t=e.makeHtml(T(X.value)||X.value),o=function(e){var t=(new B.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(T(X.value)||X.value),i=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,navigator.clipboard.write([i])];case 2:return n.sent(),console.log("Copied User Story"),[3,5];case 3:return l=n.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return nt(),[7];case 5:return[2]}})})}},{children:i("div",e({style:null==ge?void 0:ge.menuItemContent,className:k.menuItemContentPadded},{children:[l(f,{size:16,color:null==ge?void 0:ge.menuIconColor}),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:"Copy"}))]}))}))]}))]}),Ue.userStory&&Le?l(_,{type:"outline",children:"Cancel",style:null==ge?void 0:ge.cancelButton,onClick:function(){var t;null===(t=tt.current)||void 0===t||t.abort(),xe(function(t){return e(e({},t),{userStory:!1})})}}):l(r,{}),Ue.userStory&&Le?l(_,{type:"fill",children:Ke?i("span",e({className:k.savingSpinner,style:null==ge?void 0:ge.savingSpinner},{children:[l(m,{className:k.spinAnimation,style:null==ge?void 0:ge.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:Ke,style:Ke?null==ge?void 0:ge.savingButton:null==ge?void 0:ge.saveButton,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return Xe(!0),"userStory"==="userStory"&&(Y(Ne),console.log("I am changing RTE editor values",Ne)),[4,re(pe,He,Z,null===(t=tt.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e(e({},Ne),{isDefaultEdit:!1})),xe(function(t){return e(e({},t),{userStory:!1})}),Xe(!1),[2]}})})}}):!ne&&!oe&&Le&&!1!==(null==at?void 0:at.showEditButton)&&l("button",e({className:k.iconButton,style:null==ge?void 0:ge.editButton,onClick:function(){return xe(function(t){return e(e({},t),{userStory:!0})})}},{children:l(y,{color:null==ge?void 0:ge.pencilIconColor,size:16})})),rt&&Le&&!ne&&!oe&&!1!==(null==at?void 0:at.showEditButton)&&i("button",e({type:"button",className:k.addSectionButton,style:null==Ce?void 0:Ce.addSectionButton,onClick:function(t){var n,i,l;t.stopPropagation();var r=(null!==(i=null===(n=X.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,a={artifactId:E(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},X),{sub_features:o(o([],null!==(l=X.sub_features)&&void 0!==l?l:[],!0),[a],!1)});Be(s),Y(s),ze(!0),_e(a.title)},"aria-label":"Add section",title:"Add section"},{children:[l(h,{size:14}),l("span",e({className:k.addSectionLabel},{children:"Add Section"}))]})),!rt&&!ne&&!oe&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==me||me()},className:k.iconButton,style:null==Ce?void 0:Ce.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:l(p,{size:16})})),(null==at?void 0:at.actionItemsButton)&&i(r,{children:[l("span",e({className:k.actionItemBtn,style:null==ge?void 0:ge.actionItemBtn,onClick:function(e){e.stopPropagation(),Ze(e.currentTarget)}},{children:l(S,{})})),l(D,e({id:"user-story-action-menu",anchorEl:Qe,open:!!Qe,onClose:ot,style:null==ge?void 0:ge.userStoryShareMenu},{children:null==fe?void 0:fe.items.map(function(t,n){return l(U,e({style:null==ge?void 0:ge.userStoryMenuItem,onClick:function(){t.onclick(),ot()}},{children:i("div",e({className:k.menuItemContent,style:e(e({},null==ge?void 0:ge.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[l("span",e({className:k.menuItemIcon,style:null==ge?void 0:ge.menuItemIcon},{children:t.icon})),l("p",e({style:null==ge?void 0:ge.menuLabel},{children:t.name})),l("span",{className:k.menuItemRight,style:null==ge?void 0:ge.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),it()},style:null==ge?void 0:ge.chevronButton,className:k.chevronButton},{children:l(Le?g:C,{className:k.chevronIcon,color:null==ge?void 0:ge.chevronIconColor})}))]}))]})),l("div",{className:k.divider,style:null==ge?void 0:ge.dividerStyle})]})),Le&&l("div",e({className:k.cardContent,style:null==ge?void 0:ge.cardContentStyle},{children:i("div",e({className:k.contentInner,style:null==ge?void 0:ge.contentInner},{children:[i("div",e({className:k.descriptionSection,style:null==ge?void 0:ge.descriptionSection},{children:[l("div",{className:k.justifyBetween,style:null==ge?void 0:ge.justifyBetween}),Ue.userStory?l(P,{minHeight:"100%",height:"100%",type:"string",value:T(X.value)||"",handleUpdateState:function(t,n){var o=A(n);Be(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Ue.userStory?"edit":"readOnly"}):l(H,{showUserStoryDiff:oe,isParent:""===$,message:T(X.value)||"",artifactId:X.artifactId,customStyles:Ie,isDisplayHighlightControl:se})]})),null===(q=Ne.sub_features)||void 0===q?void 0:q.map(function(t,n){var i=W(ue,!1,t.artifactId);return l(V,{artifactId:Z,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(J,"-").concat(String.fromCharCode(65+n)),parentUserStory:X,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var i=o([],X.sub_features||[],!0);i[t]=n,Y(e(e({},X),{sub_features:i}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:re,handleDownloadUserStory:ie,handleOpenSendDialog:le,isDisplayHighlightControl:se,elementDisplayConfig:ue,_resolvedConfig:i,actionItemsConfig:fe,onDelete:function(){return function(t){var n=(X.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},X),{sub_features:n});Be(o),Y(o)}(n)}},t.artifactId)})]}))}))]}))},F=function(t){var n=t.artifactTitleIDs,a=t.isDiffEditReviewMode,s=t.showUserStoryDiff,u=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,d=t.artifactId,v=t.handleOpenSendDialog,f=t.handleDownloadUserStory,m=t.selectedArtifactId,y=t.isDisplayHighlightControl,h=t.elementDisplayConfig,p=t.showWrapper,S=t.actionItemsConfig,g=R(),C=g.userStory,b=g.setUserStory,N=g.customStyles,B=g.searchQueryList,D=g.currentHighlightIndex,U=g.setCurrentHighlightIndex;g.segmentComponentConfig;var x=null==N?void 0:N.userStoryCardStyles,E=0===D,T=D===B.length-1;return i("div",e({className:k.userStoryCardWrapper,style:y?e(e({},null==x?void 0:x.userStoryCardWrapper),{position:"relative"}):null==x?void 0:x.userStoryCardWrapper},{children:[y&&l(r,{children:B.length>0&&l("div",e({className:k.wrapper},{children:l("div",e({className:k.highlightNavigation},{children:i("div",e({className:k.navigationContainer},{children:[i("span",e({className:k.navCounter},{children:[D+1," of ",B.length]})),i("div",e({className:k.navButtons},{children:[l("button",e({onClick:function(){D>0&&U(function(e){return e-1})},className:k.navButton,disabled:E},{children:l(I,{size:20,className:k.navIcon})})),l("button",e({onClick:function(){D<B.length-1&&U(function(e){return e+1})},className:k.navButton,disabled:T},{children:l(w,{size:20,className:k.navIcon})}))]}))]}))}))}))}),C.map(function(e,t){var i=W(h,!0);return l(V,{isUserStoryCurrentlyUpdated:c,artifactId:d,artifactTitleId:n[t]||"",currentUserStory:e,onUserStoryChange:function(e){b(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:m,isDisplayHighlightControl:y,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:p,actionItemsConfig:S},e.artifactId)})]}))};export{V as StoryCard,F as UserStoryCardWrapper,V as default,z as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n,__spreadArray as o}from"tslib";import{jsxs as i,jsx as l,Fragment as r}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 f,LoaderCircle as m,PencilIcon as y,Plus as h,Trash2 as p,Ellipsis as S,ChevronUp as g,ChevronDown as C,ChevronUpIcon as I,ChevronDownIcon as w,Info as N,Bookmark as b}from"lucide-react";import B from"showdown";import{Menu as D,MenuItem as x,Tooltip as U}from"@mui/material";import{v4 as E}from"uuid";import T from"./UserStoryCard.module.css.js";import{formatMarkdown as k,indentMarkdown as A}from"../../utils/helpers.js";import{replaceTitleSection as M}from"../../utils/user-story.utils.js";import _ from"../../shared/AtomicButton.js";import P from"../RichTextEditor/RichTextEditor.js";import H from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as j}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as L}from"./TitleEditor/TitleEditor.js";function V(t){for(var n,o=[],i=/<learned>(.*?)<\/learned>/g,r=0,a=0;null!==(n=i.exec(t));){var s=n[1],u=n.index;u>r&&o.push(l("span",{children:t.slice(r,u)},"text-pre-".concat(a++))),o.push(l(U,e({title:s,placement:"top"},{children:l(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(E()))),r=i.lastIndex}return r<(null==t?void 0:t.length)&&o.push(l("span",{children:t.slice(r)},"text-post-".concat(a++))),o}function z(t,n,o){var i;if(!t)return{};if(n)return e({},t.parentConfig);var l=e({},t.childConfig);return o&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[o])?e(e({},l),t.subFeatureOverrides[o]):l}var W=function(t){var n,o=t.displayName,r=R().customStyles,a=null===(n=null==r?void 0:r.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return i("div",e({className:T.displayName,style:null==a?void 0:a.wrapper},{children:[l(b,{className:T.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),i("span",e({style:null==a?void 0:a.label},{children:[o,":"]}))]}))},O=function(I){var w,N,b,U,F,G,q,Q=I.isUserStoryCurrentlyUpdated,Z=I.artifactId,J=I.artifactTitleId,K=I.parentUserStory,X=I.currentUserStory,Y=I.onUserStoryChange,$=I.parentIndex,ee=I.currentIndex,te=I.enableDownload,ne=I.isDiffEditReviewMode,oe=I.showUserStoryDiff,ie=I.handleDownloadUserStory,le=I.handleOpenSendDialog,re=I.updateUserStoryArtifact,ae=I.selectedArtifactId,se=I.isDisplayHighlightControl,ue=I.elementDisplayConfig,ce=I._resolvedConfig,de=I.showWrapper,ve=void 0!==de&&de,fe=I.actionItemsConfig,me=I.onDelete,ye=I.contextVariant,he=I.showDisplayName,pe=void 0===he||he,Se=I.allowTitleEdit,ge=void 0===Se||Se,Ce=I.showConfidenceScore,Ie=void 0===Ce||Ce,we=I.showBorderTop,Ne=void 0===we||we,be=R(),Be=be.searchQueryList,De=be.citations,xe=be.customStyles,Ue=null==xe?void 0:xe.userStoryCardStyles,Ee=null===(w=null==xe?void 0:xe.userStoryCardStyles)||void 0===w?void 0:w.userStoryEditStyles,Te=null===(N=null==xe?void 0:xe.userStoryScreenStyles)||void 0===N?void 0:N.userStoryContentStyles,ke=null==Ue?void 0:Ue.progressHeaderStyles,Ae=a(e(e({},structuredClone(X)),{value:k(X.value)||""})),Me=Ae[0],_e=Ae[1],Pe=a({userStory:!!X.isDefaultEdit}),He=Pe[0],Re=Pe[1],je=a(!1),Le=je[0],Ve=je[1],ze=a(null),We=ze[0],Oe=ze[1],Fe=R(),Ge=Fe.userStory,qe=Fe.customIcons,Qe=a(""===$||ae===X.artifactId||!!X.isDefaultOpen),Ze=Qe[0],Je=Qe[1],Ke=a(!1);Ke[0];var Xe=Ke[1],Ye=a(null),$e=Ye[0],et=Ye[1],tt=a(null),nt=tt[0],ot=tt[1],it=a(!1),lt=it[0],rt=it[1],at=s(null),st=a(!1);st[0];var ut=st[1],ct=s(null);u(function(){Q&&Je(Q)},[Q]),u(function(){_e(e(e({},structuredClone(X)),{value:k(X.value)||""}))},[X]),u(function(){Be.length>0?Je(!0):ae&&Je(ae===X.artifactId)},[Be,ae,X.artifactId]);var dt=function(){et(null)},vt=function(){ot(null)},ft=function(){Je(function(e){return!e})};var mt=null!=(null==X?void 0:X.big_enough)&&!Number.isNaN(X.big_enough)&&!!(null==X?void 0:X.big_enough_decision_factors),yt=""===$,ht=null!=ce?ce:z(ue,yt),pt=!ne&&!oe;return u(function(){if(We){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(We));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[We]),u(function(){X.isDefaultEdit&&Re(function(t){return e(e({},t),{userStory:!0})})},[X.isDefaultEdit]),i("div",e({className:T.card,style:null==Ue?void 0:Ue.cardStyle,id:"story-card-".concat(X.title),"data-expanded":Ze},{children:[i("div",e({className:T.titleSection,style:null==Ue?void 0:Ue.titleSection},{children:[i("div",e({className:T.titleRow,style:null==Ue?void 0:Ue.titleRow,onClick:ft},{children:[i("div",e({className:T.titleLeft,style:null==Ue?void 0:Ue.titleLeft,onMouseEnter:function(){return ut(!0)},onMouseLeave:function(){return ut(!1)}},{children:[pe&&l(W,{displayName:J}),Le&&pt?l(L,{title:X.title,onSave:function(o){return function(o,i){return t(void 0,void 0,void 0,function(){var t,l;return n(this,function(n){try{t=e({},X),X.artifactId===i?t.title=o:t.sub_features=(null===(l=X.sub_features)||void 0===l?void 0:l.map(function(t){return t.artifactId===i?e(e({},t),{title:o}):t}))||[],_e(t),Y(t),Ve(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,X.artifactId)},onCancel:function(){Ve(!1)},inputStyle:null==Ee?void 0:Ee.inlineTitleInput,confirmButtonStyle:null==Ee?void 0:Ee.inlineTitleConfirm,cancelButtonStyle:null==Ee?void 0:Ee.inlineTitleCancel},"inline-title-editor"):i("div",e({className:T.storyTitleWrapper},{children:[l("h2",e({title:X.title,className:T.storyTitle,style:null==Ue?void 0:Ue.storyTitle},{children:V(X.title)}),X.artifactId),ge&&l("button",e({type:"button",className:T.titleEditButton,style:null==Ee?void 0:Ee.titleEditButton,onClick:function(e){e.stopPropagation(),Ve(!0),Ze||Je(!0)},"aria-label":"Edit title",title:"Edit title"},{children:l("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:l("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})}))}))]}))]})),i("div",e({className:T.titleActions,style:null==Ue?void 0:Ue.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(ht.showProgressPercentage||ht.showGapBox)&&ve&&i("div",e({className:T.progressHeader,style:null==ke?void 0:ke.wrapper},{children:[ht.showProgressPercentage&&i("div",e({className:T.progressPercentage,style:null==ke?void 0:ke.percentage},{children:[null!==(U=null!==(b=null==X?void 0:X.confidenceScore)&&void 0!==b?b:null==ht?void 0:ht.confidenceValue)&&void 0!==U?U:"0","%"]})),ht.showGapBox&&i("div",e({className:T.gapBox,style:null==ke?void 0:ke.gapBox},{children:[null!==(G=null!==(F=null==X?void 0:X.gapValue)&&void 0!==F?F:null==ht?void 0:ht.gapBoxValue)&&void 0!==G?G:"2"," ","Gaps"]}))]})),mt&&l(j,{customIcons:null==qe?void 0:qe.userStoryIcons,customStyles:null==Ue?void 0:Ue.aiReasoningCitaionStyles,currentUserStory:X,panelStyles:null==Ue?void 0:Ue.BigEnoughStyles}),!He.userStory&&i(r,{children:[!1!==(null==ht?void 0:ht.showShareButton)&&l("button",e({className:T.iconButton,style:null==Ue?void 0:Ue.iconButton,onClick:function(e){et(e.currentTarget)}},{children:l(c,{size:16})})),i(D,e({id:"user-story-share-menu",anchorEl:$e,open:!!$e,onClose:function(){return et(null)},style:null==Ue?void 0:Ue.userStoryShareMenu},{children:[te&&l(x,e({style:null==Ue?void 0:Ue.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Xe(!0),ie?[4,Promise.all([ie("pdf"),ie("doc")])]:[2];case 1:return e.sent(),Xe(!1),[2]}})})}},{children:i("div",e({ref:at,className:T.menuItemContent,style:null==Ue?void 0:Ue.menuItemContent},{children:[l(d,{size:16,color:null==Ue?void 0:Ue.menuIconColor}),l("p",e({style:null==Ue?void 0:Ue.menuLabel},{children:"Download"}))]}))})),l(x,e({style:null==Ue?void 0:Ue.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){return t=X,K&&(t=e(e({},X),{value:"".concat(M(null==K?void 0:K.value,X.title)," \n").concat(X.value)})),null==le||le(!0,[t],X.artifactId),dt(),[2]})})}},{children:i("div",e({style:null==Ue?void 0:Ue.menuItemContent,className:T.menuItemContentPadded},{children:[l(v,{size:16,color:null==Ue?void 0:Ue.menuIconColor}),l("p",e({style:null==Ue?void 0:Ue.menuLabel},{children:"Send"}))]}))})),l(x,e({style:null==Ue?void 0:Ue.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,o,i,l;return n(this,function(n){switch(n.label){case 0:e=new B.Converter,t=e.makeHtml(k(X.value)||X.value),o=function(e){var t=(new B.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(k(X.value)||X.value),i=new ClipboardItem({"text/plain":new Blob([o],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,navigator.clipboard.write([i])];case 2:return n.sent(),console.log("Copied User Story"),[3,5];case 3:return l=n.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return dt(),[7];case 5:return[2]}})})}},{children:i("div",e({style:null==Ue?void 0:Ue.menuItemContent,className:T.menuItemContentPadded},{children:[l(f,{size:16,color:null==Ue?void 0:Ue.menuIconColor}),l("p",e({style:null==Ue?void 0:Ue.menuLabel},{children:"Copy"}))]}))}))]}))]}),He.userStory&&Ze?l(_,{type:"outline",children:"Cancel",style:null==Ue?void 0:Ue.cancelButton,onClick:function(){var t;null===(t=ct.current)||void 0===t||t.abort(),Re(function(t){return e(e({},t),{userStory:!1})})}}):l(r,{}),He.userStory&&Ze?l(_,{type:"fill",children:lt?i("span",e({className:T.savingSpinner,style:null==Ue?void 0:Ue.savingSpinner},{children:[l(m,{className:T.spinAnimation,style:null==Ue?void 0:Ue.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:lt,style:lt?null==Ue?void 0:Ue.savingButton:null==Ue?void 0:Ue.saveButton,onClick:function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return rt(!0),"userStory"==="userStory"&&(Y(Me),console.log("I am changing RTE editor values",Me)),[4,re(De,Ge,Z,null===(t=ct.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e(e({},Me),{isDefaultEdit:!1})),Re(function(t){return e(e({},t),{userStory:!1})}),rt(!1),[2]}})})}}):!ne&&!oe&&Ze&&!1!==(null==ht?void 0:ht.showEditButton)&&ge&&l("button",e({className:T.iconButton,style:null==Ue?void 0:Ue.editButton,onClick:function(){return Re(function(t){return e(e({},t),{userStory:!0})})}},{children:l(y,{color:null==Ue?void 0:Ue.pencilIconColor,size:16})})),yt&&Ze&&!ne&&!oe&&!1!==(null==ht?void 0:ht.showEditButton)&&i("button",e({type:"button",className:T.addSectionButton,style:null==Ee?void 0:Ee.addSectionButton,onClick:function(t){var n,i,l;t.stopPropagation();var r=(null!==(i=null===(n=X.sub_features)||void 0===n?void 0:n.length)&&void 0!==i?i:0)+1,a={artifactId:E(),title:"New Section ".concat(r),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},s=e(e({},X),{sub_features:o(o([],null!==(l=X.sub_features)&&void 0!==l?l:[],!0),[a],!1)});_e(s),Y(s),Je(!0),Oe(a.title)},"aria-label":"Add section",title:"Add section"},{children:[l(h,{size:14}),l("span",e({className:T.addSectionLabel},{children:"Add Section"}))]})),!yt&&!ne&&!oe&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==me||me()},className:T.iconButton,style:null==Ee?void 0:Ee.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:l(p,{size:16})})),(null==ht?void 0:ht.actionItemsButton)&&i(r,{children:[l("span",e({className:T.actionItemBtn,style:null==Ue?void 0:Ue.actionItemBtn,onClick:function(e){e.stopPropagation(),ot(e.currentTarget)}},{children:l(S,{})})),l(D,e({id:"user-story-action-menu",anchorEl:nt,open:!!nt,onClose:vt,style:null==Ue?void 0:Ue.userStoryShareMenu},{children:null==fe?void 0:fe.items.map(function(t,n){return l(x,e({style:null==Ue?void 0:Ue.userStoryMenuItem,onClick:function(){t.onclick(X),vt()}},{children:i("div",e({className:T.menuItemContent,style:e(e({},null==Ue?void 0:Ue.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[l("span",e({className:T.menuItemIcon,style:null==Ue?void 0:Ue.menuItemIcon},{children:t.icon})),l("p",e({style:null==Ue?void 0:Ue.menuLabel},{children:t.name})),l("span",{className:T.menuItemRight,style:null==Ue?void 0:Ue.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),ft()},style:null==Ue?void 0:Ue.chevronButton,className:T.chevronButton},{children:l(Ze?g:C,{className:T.chevronIcon,color:null==Ue?void 0:Ue.chevronIconColor})}))]}))]})),l("div",{className:T.divider,style:null==Ue?void 0:Ue.dividerStyle})]})),Ze&&l("div",e({className:T.cardContent,style:e(e({},null==Ue?void 0:Ue.cardContentStyle),{borderTop:Ne?"1px solid #E5E5E5":"none"})},{children:i("div",e({className:T.contentInner,style:null==Ue?void 0:Ue.contentInner},{children:[i("div",e({className:T.descriptionSection,style:null==Ue?void 0:Ue.descriptionSection},{children:[l("div",{className:T.justifyBetween,style:null==Ue?void 0:Ue.justifyBetween}),He.userStory?l(P,{minHeight:"100%",height:"100%",type:"string",value:k(X.value)||"",handleUpdateState:function(t,n){var o=A(n);_e(function(t){return e(e({},t),{value:o||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:He.userStory?"edit":"readOnly"}):l(H,{showUserStoryDiff:oe,isParent:""===$,message:k(X.value)||"",artifactId:X.artifactId,customStyles:Te,isDisplayHighlightControl:se,contextVariant:ye,showConfidenceScore:Ie})]})),null===(q=Me.sub_features)||void 0===q?void 0:q.map(function(t,n){var i=z(ue,!1,t.artifactId);return l(O,{artifactId:Z,isUserStoryCurrentlyUpdated:Q,artifactTitleId:"".concat(J,"-").concat(String.fromCharCode(65+n)),parentUserStory:X,parentIndex:"".concat($).concat($&&".").concat(ee),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var i=o([],X.sub_features||[],!0);i[t]=n,Y(e(e({},X),{sub_features:i}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:re,handleDownloadUserStory:ie,handleOpenSendDialog:le,isDisplayHighlightControl:se,elementDisplayConfig:ue,_resolvedConfig:i,actionItemsConfig:fe,onDelete:function(){return function(t){var n=(X.sub_features||[]).filter(function(e,n){return n!==t}),o=e(e({},X),{sub_features:n});_e(o),Y(o)}(n)}},t.artifactId)})]}))}))]}))},F=function(t){var n=t.artifactTitleIDs,a=t.isDiffEditReviewMode,s=t.showUserStoryDiff,u=t.updateUserStoryArtifact,c=t.isUserStoryCurrentlyUpdated,d=t.artifactId,v=t.handleOpenSendDialog,f=t.handleDownloadUserStory,m=t.selectedArtifactId,y=t.isDisplayHighlightControl,h=t.elementDisplayConfig,p=t.showWrapper,S=t.actionItemsConfig,g=t.contextVariant,C=t.showDisplayName,N=t.allowTitleEdit,b=t.showConfidenceScore,B=t.showBorderTop,D=R(),x=D.userStory,U=D.setUserStory,E=D.customStyles,k=D.searchQueryList,A=D.currentHighlightIndex,M=D.setCurrentHighlightIndex;D.segmentComponentConfig;var _=null==E?void 0:E.userStoryCardStyles,P=0===A,H=A===k.length-1;return i("div",e({className:T.userStoryCardWrapper,style:y?e(e({},null==_?void 0:_.userStoryCardWrapper),{position:"relative"}):null==_?void 0:_.userStoryCardWrapper},{children:[y&&l(r,{children:k.length>0&&l("div",e({className:T.wrapper},{children:l("div",e({className:T.highlightNavigation},{children:i("div",e({className:T.navigationContainer},{children:[i("span",e({className:T.navCounter},{children:[A+1," of ",k.length]})),i("div",e({className:T.navButtons},{children:[l("button",e({onClick:function(){A>0&&M(function(e){return e-1})},className:T.navButton,disabled:P},{children:l(I,{size:20,className:T.navIcon})})),l("button",e({onClick:function(){A<k.length-1&&M(function(e){return e+1})},className:T.navButton,disabled:H},{children:l(w,{size:20,className:T.navIcon})}))]}))]}))}))}))}),x.map(function(e,t){var i=z(h,!0);return l(O,{isUserStoryCurrentlyUpdated:c,artifactId:d,artifactTitleId:n[t]||"",currentUserStory:e,onUserStoryChange:function(e){U(function(n){return n[t]=e,o([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:f,selectedArtifactId:m,isDisplayHighlightControl:y,elementDisplayConfig:h,_resolvedConfig:i,showWrapper:p,actionItemsConfig:S,contextVariant:g,showDisplayName:C,allowTitleEdit:N,showConfidenceScore:b,showBorderTop:B},e.artifactId)})]}))};export{O as StoryCard,F as UserStoryCardWrapper,O as default,V as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={card:"UserStoryCard-module_card__9pErS",titleSection:"UserStoryCard-module_titleSection__pGbpL",titleRow:"UserStoryCard-module_titleRow__TyEN9",titleLeft:"UserStoryCard-module_titleLeft__fzF6u",titleActions:"UserStoryCard-module_titleActions__Dabx1",divider:"UserStoryCard-module_divider__xG-FC",displayName:"UserStoryCard-module_displayName__Jj-HK",displayNameIcon:"UserStoryCard-module_displayNameIcon__-SCM3",storyTitle:"UserStoryCard-module_storyTitle__FDX4p",iconButton:"UserStoryCard-module_iconButton__DkfRA",chevronButton:"UserStoryCard-module_chevronButton__nxxYC",chevronIcon:"UserStoryCard-module_chevronIcon__Azswy",cardContent:"UserStoryCard-module_cardContent__rR2g3",contentInner:"UserStoryCard-module_contentInner__AYQbu",descriptionSection:"UserStoryCard-module_descriptionSection__5j6cg",justifyBetween:"UserStoryCard-module_justifyBetween__cD-EG",savingSpinner:"UserStoryCard-module_savingSpinner__UmbEq",spinAnimation:"UserStoryCard-module_spinAnimation__INSou",spin:"UserStoryCard-module_spin__afcZ6",menuItemContent:"UserStoryCard-module_menuItemContent__U-ZxP",actionItemBtn:"UserStoryCard-module_actionItemBtn__3jocB",menuItemIcon:"UserStoryCard-module_menuItemIcon__BxrJU",menuItemRight:"UserStoryCard-module_menuItemRight__Cjw2j",wrapper:"UserStoryCard-module_wrapper__ahzRY",highlightNavigation:"UserStoryCard-module_highlightNavigation__vv8RW",navigationContainer:"UserStoryCard-module_navigationContainer__2UcOj",navButton:"UserStoryCard-module_navButton__EWoVi",navIcon:"UserStoryCard-module_navIcon__3ZSIH",navCounter:"UserStoryCard-module_navCounter__sIIeS",navButtons:"UserStoryCard-module_navButtons__6oLaN",menuItemContentPadded:"UserStoryCard-module_menuItemContentPadded__w6udq",userStoryCardWrapper:"UserStoryCard-module_userStoryCardWrapper__0gC-E",progressHeader:"UserStoryCard-module_progressHeader__LBMsg",progressPercentage:"UserStoryCard-module_progressPercentage__brScW",gapBox:"UserStoryCard-module_gapBox__LkEiT",storyTitleWrapper:"UserStoryCard-module_storyTitleWrapper__Ng-Th",titleEditButton:"UserStoryCard-module_titleEditButton__iJADR",inlineTitleEditor:"UserStoryCard-module_inlineTitleEditor__rdF-w",inlineTitleInput:"UserStoryCard-module_inlineTitleInput__Ft6mB",inlineTitleConfirm:"UserStoryCard-module_inlineTitleConfirm__YTG-3",inlineTitleCancel:"UserStoryCard-module_inlineTitleCancel__clhBR",addSectionButton:"UserStoryCard-module_addSectionButton__lBCWj",addSectionLabel:"UserStoryCard-module_addSectionLabel__kUs2E"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".UserStoryCard-module_card__9pErS{border:1px solid #e5e5e5;border-radius:.75rem;display:flex;flex:1;flex-direction:column;margin-bottom:auto;margin-left:auto;margin-right:auto;position:relative;width:100%}.UserStoryCard-module_titleSection__pGbpL{cursor:pointer;padding:.5rem 1rem;width:100%}.UserStoryCard-module_titleRow__TyEN9{align-items:center;display:flex;justify-content:space-between;margin-top:.5rem;position:relative;width:100%}.UserStoryCard-module_titleLeft__fzF6u{align-items:center;display:flex;font-family:Inter,sans-serif;gap:.5rem;max-width:66.666%}.UserStoryCard-module_titleActions__Dabx1{align-items:center;display:flex;gap:.5rem;width:fit-content}.UserStoryCard-module_divider__xG-FC{background-color:#ffffff4d;border-radius:9999px;height:.25rem;width:4rem}.UserStoryCard-module_displayName__Jj-HK{align-items:center;color:#4b5563;display:inline-flex;font-size:.875rem;font-weight:500;gap:.5rem}.UserStoryCard-module_displayNameIcon__-SCM3{height:1rem;width:1rem}.UserStoryCard-module_storyTitle__FDX4p{color:#374151;flex:1;font-size:1rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.UserStoryCard-module_iconButton__DkfRA{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;display:flex;justify-content:center;margin-left:.5rem;padding:.4rem .8rem}.UserStoryCard-module_iconButton__DkfRA:hover{background-color:#f9fafb}.UserStoryCard-module_chevronButton__nxxYC{background:none;border:none;cursor:pointer;margin-left:.5rem;padding:.25rem}.UserStoryCard-module_chevronIcon__Azswy{color:#4b5563;height:1.5rem;width:1.5rem}.UserStoryCard-module_cardContent__rR2g3{border-top:1px solid #e5e5e5;max-height:fit-content;opacity:1;padding:1.5rem 2rem 2rem;transition:all .3s ease-in-out;width:100%}.UserStoryCard-module_contentInner__AYQbu{display:flex;flex-direction:column;gap:2.5rem;width:100%}.UserStoryCard-module_descriptionSection__5j6cg{display:flex;flex-direction:column;gap:1rem;width:100%}.UserStoryCard-module_justifyBetween__cD-EG{display:flex;justify-content:space-between}.UserStoryCard-module_savingSpinner__UmbEq{align-items:center;color:#fff;display:flex;flex-direction:row;gap:.5rem}.UserStoryCard-module_spinAnimation__INSou{animation:UserStoryCard-module_spin__afcZ6 1s linear infinite}@keyframes UserStoryCard-module_spin__afcZ6{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.UserStoryCard-module_menuItemContent__U-ZxP{align-items:center;display:flex;flex-direction:row;gap:.5rem;margin-left:.25rem}.UserStoryCard-module_actionItemBtn__3jocB{font-size:18px;line-height:0}.UserStoryCard-module_menuItemIcon__BxrJU{align-items:center;display:inline-flex;margin-right:.5rem}.UserStoryCard-module_menuItemRight__Cjw2j{align-self:center;border-radius:50%;height:8px;margin-left:auto;width:8px}.UserStoryCard-module_wrapper__ahzRY{background-color:#fff;border-bottom:1px solid hsla(0,0%,50%,.126);display:flex;justify-content:flex-end;margin-bottom:4px;padding:5px 10px 5px 0;position:sticky;top:0;width:100%;z-index:1000}.UserStoryCard-module_highlightNavigation__vv8RW{width:max-content}.UserStoryCard-module_navigationContainer__2UcOj{align-items:center;border:1px solid hsla(0,0%,50%,.126);border-radius:10px;display:inline-flex;gap:8px;padding:6px 8px}.UserStoryCard-module_navButton__EWoVi{align-items:center;background:none;border:none;color:#374151;cursor:pointer;display:flex;justify-content:center;padding:2px;transition:color .15s ease}.UserStoryCard-module_navIcon__3ZSIH{height:20px;width:20px}.UserStoryCard-module_navCounter__sIIeS{color:#4b5563;font-size:17px;font-weight:500;letter-spacing:.01em;min-width:28px;text-align:center}.UserStoryCard-module_navButtons__6oLaN{display:flex;gap:0}.UserStoryCard-module_navButton__EWoVi:disabled{cursor:not-allowed;opacity:.4}.UserStoryCard-module_menuItemContentPadded__w6udq{align-items:center;display:flex;flex-direction:row;gap:.5rem;padding-left:.25rem}.UserStoryCard-module_userStoryCardWrapper__0gC-E{width:100%}.UserStoryCard-module_progressHeader__LBMsg{align-items:center;display:flex;gap:8px}.UserStoryCard-module_progressPercentage__brScW{background:#fff;border:1px solid #d0d5dd;border-radius:8px;font-size:14px;font-weight:500;padding:4px 10px}.UserStoryCard-module_gapBox__LkEiT{background:#fff7e6;border:1px solid #f7d58d;border-radius:8px;color:#b26b00;font-size:14px;font-weight:500;padding:4px 10px}.UserStoryCard-module_storyTitleWrapper__Ng-Th{align-items:center;display:flex;gap:6px;min-width:0}.UserStoryCard-module_titleEditButton__iJADR{align-items:center;background:#0000;border:none;border-radius:4px;color:var(--color-text-secondary,#6b7280);cursor:pointer;display:inline-flex;flex-shrink:0;justify-content:center;opacity:1;padding:3px;transition:opacity .15s ease,background .15s ease,color .15s ease}.UserStoryCard-module_titleEditButton__iJADR:hover{background:var(--color-surface-hover,#f3f4f6);color:var(--color-primary,#4f46e5);opacity:1}.UserStoryCard-module_titleEditButton__iJADR:focus-visible{opacity:1;outline:2px solid var(--color-primary,#4f46e5);outline-offset:1px}.UserStoryCard-module_inlineTitleEditor__rdF-w{align-items:center;display:flex;flex:1;gap:4px;min-width:0}.UserStoryCard-module_inlineTitleInput__Ft6mB{background:var(--color-surface,#fff);border:1.5px solid var(--color-primary,#4f46e5);border-radius:5px;color:var(--color-text-primary,#111827);flex:1;font-size:inherit;font-weight:600;line-height:1.4;min-width:0;outline:none;padding:3px 8px;transition:border-color .15s ease,box-shadow .15s ease}.UserStoryCard-module_inlineTitleInput__Ft6mB:focus{border-color:var(--color-primary,#4f46e5);box-shadow:0 0 0 3px #4f46e526}.UserStoryCard-module_inlineTitleConfirm__YTG-3{align-items:center;background:var(--color-primary,#4f46e5);border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-flex;flex-shrink:0;height:26px;justify-content:center;transition:background .15s ease,transform .1s ease;width:26px}.UserStoryCard-module_inlineTitleConfirm__YTG-3:hover:not(:disabled){background:var(--color-primary-dark,#4338ca)}.UserStoryCard-module_inlineTitleConfirm__YTG-3:active:not(:disabled){transform:scale(.93)}.UserStoryCard-module_inlineTitleConfirm__YTG-3:disabled{cursor:not-allowed;opacity:.45}.UserStoryCard-module_inlineTitleConfirm__YTG-3:focus-visible{outline:2px solid var(--color-primary,#4f46e5);outline-offset:2px}.UserStoryCard-module_inlineTitleCancel__clhBR{align-items:center;background:#0000;border:1.5px solid var(--color-border,#e5e7eb);border-radius:5px;color:var(--color-text-secondary,#6b7280);cursor:pointer;display:inline-flex;flex-shrink:0;height:26px;justify-content:center;transition:background .15s ease,color .15s ease,border-color .15s ease;width:26px}.UserStoryCard-module_inlineTitleCancel__clhBR:hover{background:var(--color-surface-hover,#f3f4f6);border-color:var(--color-danger,#ef4444);color:var(--color-danger,#ef4444)}.UserStoryCard-module_inlineTitleCancel__clhBR:focus-visible{outline:2px solid var(--color-danger,#ef4444);outline-offset:2px}.UserStoryCard-module_addSectionButton__lBCWj{align-items:center;background:#0000;border:1.5px dashed var(--color-border,#d1d5db);border-radius:6px;color:var(--color-text-secondary,#6b7280);cursor:pointer;display:inline-flex;flex-shrink:0;font-size:12px;font-weight:500;gap:5px;padding:6px 10px;transition:border-color .15s ease,color .15s ease,background .15s ease;white-space:nowrap}.UserStoryCard-module_addSectionButton__lBCWj:hover{background:var(--color-primary-subtle,#4f46e50d);border-color:var(--color-primary,#4f46e5);color:var(--color-primary,#4f46e5)}.UserStoryCard-module_addSectionButton__lBCWj:active{transform:scale(.97)}.UserStoryCard-module_addSectionButton__lBCWj:focus-visible{outline:2px solid var(--color-primary,#4f46e5);outline-offset:2px}.UserStoryCard-module_addSectionLabel__kUs2E{display:inline}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
1
|
+
var e={card:"UserStoryCard-module_card__9pErS",titleSection:"UserStoryCard-module_titleSection__pGbpL",titleRow:"UserStoryCard-module_titleRow__TyEN9",titleLeft:"UserStoryCard-module_titleLeft__fzF6u",titleActions:"UserStoryCard-module_titleActions__Dabx1",divider:"UserStoryCard-module_divider__xG-FC",displayName:"UserStoryCard-module_displayName__Jj-HK",displayNameIcon:"UserStoryCard-module_displayNameIcon__-SCM3",storyTitle:"UserStoryCard-module_storyTitle__FDX4p",iconButton:"UserStoryCard-module_iconButton__DkfRA",chevronButton:"UserStoryCard-module_chevronButton__nxxYC",chevronIcon:"UserStoryCard-module_chevronIcon__Azswy",cardContent:"UserStoryCard-module_cardContent__rR2g3",contentInner:"UserStoryCard-module_contentInner__AYQbu",descriptionSection:"UserStoryCard-module_descriptionSection__5j6cg",justifyBetween:"UserStoryCard-module_justifyBetween__cD-EG",savingSpinner:"UserStoryCard-module_savingSpinner__UmbEq",spinAnimation:"UserStoryCard-module_spinAnimation__INSou",spin:"UserStoryCard-module_spin__afcZ6",menuItemContent:"UserStoryCard-module_menuItemContent__U-ZxP",actionItemBtn:"UserStoryCard-module_actionItemBtn__3jocB",menuItemIcon:"UserStoryCard-module_menuItemIcon__BxrJU",menuItemRight:"UserStoryCard-module_menuItemRight__Cjw2j",wrapper:"UserStoryCard-module_wrapper__ahzRY",highlightNavigation:"UserStoryCard-module_highlightNavigation__vv8RW",navigationContainer:"UserStoryCard-module_navigationContainer__2UcOj",navButton:"UserStoryCard-module_navButton__EWoVi",navIcon:"UserStoryCard-module_navIcon__3ZSIH",navCounter:"UserStoryCard-module_navCounter__sIIeS",navButtons:"UserStoryCard-module_navButtons__6oLaN",menuItemContentPadded:"UserStoryCard-module_menuItemContentPadded__w6udq",userStoryCardWrapper:"UserStoryCard-module_userStoryCardWrapper__0gC-E",progressHeader:"UserStoryCard-module_progressHeader__LBMsg",progressPercentage:"UserStoryCard-module_progressPercentage__brScW",gapBox:"UserStoryCard-module_gapBox__LkEiT",storyTitleWrapper:"UserStoryCard-module_storyTitleWrapper__Ng-Th",titleEditButton:"UserStoryCard-module_titleEditButton__iJADR",inlineTitleEditor:"UserStoryCard-module_inlineTitleEditor__rdF-w",inlineTitleInput:"UserStoryCard-module_inlineTitleInput__Ft6mB",inlineTitleConfirm:"UserStoryCard-module_inlineTitleConfirm__YTG-3",inlineTitleCancel:"UserStoryCard-module_inlineTitleCancel__clhBR",addSectionButton:"UserStoryCard-module_addSectionButton__lBCWj",addSectionLabel:"UserStoryCard-module_addSectionLabel__kUs2E"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const r=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;r&&e.setAttribute("nonce",r),e.appendChild(document.createTextNode(".UserStoryCard-module_card__9pErS{border:1px solid #e5e5e5;border-radius:.75rem;display:flex;flex:1;flex-direction:column;margin-bottom:auto;margin-left:auto;margin-right:auto;position:relative;width:100%}.UserStoryCard-module_titleSection__pGbpL{cursor:pointer;padding:.5rem 1rem;width:100%}.UserStoryCard-module_titleRow__TyEN9{align-items:center;display:flex;justify-content:space-between;margin-top:.5rem;position:relative;width:100%}.UserStoryCard-module_titleLeft__fzF6u{align-items:center;display:flex;font-family:Inter,sans-serif;gap:.5rem;max-width:66.666%}.UserStoryCard-module_titleActions__Dabx1{align-items:center;display:flex;gap:.5rem;width:fit-content}.UserStoryCard-module_divider__xG-FC{background-color:#ffffff4d;border-radius:9999px;height:.25rem;width:4rem}.UserStoryCard-module_displayName__Jj-HK{align-items:center;color:#4b5563;display:inline-flex;font-size:.875rem;font-weight:500;gap:.5rem}.UserStoryCard-module_displayNameIcon__-SCM3{height:1rem;width:1rem}.UserStoryCard-module_storyTitle__FDX4p{color:#374151;flex:1;font-size:1rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.UserStoryCard-module_iconButton__DkfRA{align-items:center;background-color:#fff;border:1px solid #d1d5db;border-radius:.3rem;box-shadow:0 1px 2px #0000000d;cursor:pointer;display:flex;justify-content:center;margin-left:.5rem;padding:.4rem .8rem}.UserStoryCard-module_iconButton__DkfRA:hover{background-color:#f9fafb}.UserStoryCard-module_chevronButton__nxxYC{background:none;border:none;cursor:pointer;margin-left:.5rem;padding:.25rem}.UserStoryCard-module_chevronIcon__Azswy{color:#4b5563;height:1.5rem;width:1.5rem}.UserStoryCard-module_cardContent__rR2g3{max-height:fit-content;opacity:1;padding:1.5rem 2rem 2rem;transition:all .3s ease-in-out;width:100%}.UserStoryCard-module_contentInner__AYQbu{display:flex;flex-direction:column;gap:2.5rem;width:100%}.UserStoryCard-module_descriptionSection__5j6cg{display:flex;flex-direction:column;gap:1rem;width:100%}.UserStoryCard-module_justifyBetween__cD-EG{display:flex;justify-content:space-between}.UserStoryCard-module_savingSpinner__UmbEq{align-items:center;color:#fff;display:flex;flex-direction:row;gap:.5rem}.UserStoryCard-module_spinAnimation__INSou{animation:UserStoryCard-module_spin__afcZ6 1s linear infinite}@keyframes UserStoryCard-module_spin__afcZ6{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.UserStoryCard-module_menuItemContent__U-ZxP{align-items:center;display:flex;flex-direction:row;gap:.5rem;margin-left:.25rem}.UserStoryCard-module_actionItemBtn__3jocB{font-size:18px;line-height:0}.UserStoryCard-module_menuItemIcon__BxrJU{align-items:center;display:inline-flex;margin-right:.5rem}.UserStoryCard-module_menuItemRight__Cjw2j{align-self:center;border-radius:50%;height:8px;margin-left:auto;width:8px}.UserStoryCard-module_wrapper__ahzRY{background-color:#fff;border-bottom:1px solid hsla(0,0%,50%,.126);display:flex;justify-content:flex-end;margin-bottom:4px;padding:5px 10px 5px 0;position:sticky;top:0;width:100%;z-index:1000}.UserStoryCard-module_highlightNavigation__vv8RW{width:max-content}.UserStoryCard-module_navigationContainer__2UcOj{align-items:center;border:1px solid hsla(0,0%,50%,.126);border-radius:10px;display:inline-flex;gap:8px;padding:6px 8px}.UserStoryCard-module_navButton__EWoVi{align-items:center;background:none;border:none;color:#374151;cursor:pointer;display:flex;justify-content:center;padding:2px;transition:color .15s ease}.UserStoryCard-module_navIcon__3ZSIH{height:20px;width:20px}.UserStoryCard-module_navCounter__sIIeS{color:#4b5563;font-size:17px;font-weight:500;letter-spacing:.01em;min-width:28px;text-align:center}.UserStoryCard-module_navButtons__6oLaN{display:flex;gap:0}.UserStoryCard-module_navButton__EWoVi:disabled{cursor:not-allowed;opacity:.4}.UserStoryCard-module_menuItemContentPadded__w6udq{align-items:center;display:flex;flex-direction:row;gap:.5rem;padding-left:.25rem}.UserStoryCard-module_userStoryCardWrapper__0gC-E{width:100%}.UserStoryCard-module_progressHeader__LBMsg{align-items:center;display:flex;gap:8px}.UserStoryCard-module_progressPercentage__brScW{background:#fff;border:1px solid #d0d5dd;border-radius:8px;font-size:14px;font-weight:500;padding:4px 10px}.UserStoryCard-module_gapBox__LkEiT{background:#fff7e6;border:1px solid #f7d58d;border-radius:8px;color:#b26b00;font-size:14px;font-weight:500;padding:4px 10px}.UserStoryCard-module_storyTitleWrapper__Ng-Th{align-items:center;display:flex;gap:6px;min-width:0}.UserStoryCard-module_titleEditButton__iJADR{align-items:center;background:#0000;border:none;border-radius:4px;color:var(--color-text-secondary,#6b7280);cursor:pointer;display:inline-flex;flex-shrink:0;justify-content:center;opacity:1;padding:3px;transition:opacity .15s ease,background .15s ease,color .15s ease}.UserStoryCard-module_titleEditButton__iJADR:hover{background:var(--color-surface-hover,#f3f4f6);color:var(--color-primary,#4f46e5);opacity:1}.UserStoryCard-module_titleEditButton__iJADR:focus-visible{opacity:1;outline:2px solid var(--color-primary,#4f46e5);outline-offset:1px}.UserStoryCard-module_inlineTitleEditor__rdF-w{align-items:center;display:flex;flex:1;gap:4px;min-width:0}.UserStoryCard-module_inlineTitleInput__Ft6mB{background:var(--color-surface,#fff);border:1.5px solid var(--color-primary,#4f46e5);border-radius:5px;color:var(--color-text-primary,#111827);flex:1;font-size:inherit;font-weight:600;line-height:1.4;min-width:0;outline:none;padding:3px 8px;transition:border-color .15s ease,box-shadow .15s ease}.UserStoryCard-module_inlineTitleInput__Ft6mB:focus{border-color:var(--color-primary,#4f46e5);box-shadow:0 0 0 3px #4f46e526}.UserStoryCard-module_inlineTitleConfirm__YTG-3{align-items:center;background:var(--color-primary,#4f46e5);border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-flex;flex-shrink:0;height:26px;justify-content:center;transition:background .15s ease,transform .1s ease;width:26px}.UserStoryCard-module_inlineTitleConfirm__YTG-3:hover:not(:disabled){background:var(--color-primary-dark,#4338ca)}.UserStoryCard-module_inlineTitleConfirm__YTG-3:active:not(:disabled){transform:scale(.93)}.UserStoryCard-module_inlineTitleConfirm__YTG-3:disabled{cursor:not-allowed;opacity:.45}.UserStoryCard-module_inlineTitleConfirm__YTG-3:focus-visible{outline:2px solid var(--color-primary,#4f46e5);outline-offset:2px}.UserStoryCard-module_inlineTitleCancel__clhBR{align-items:center;background:#0000;border:1.5px solid var(--color-border,#e5e7eb);border-radius:5px;color:var(--color-text-secondary,#6b7280);cursor:pointer;display:inline-flex;flex-shrink:0;height:26px;justify-content:center;transition:background .15s ease,color .15s ease,border-color .15s ease;width:26px}.UserStoryCard-module_inlineTitleCancel__clhBR:hover{background:var(--color-surface-hover,#f3f4f6);border-color:var(--color-danger,#ef4444);color:var(--color-danger,#ef4444)}.UserStoryCard-module_inlineTitleCancel__clhBR:focus-visible{outline:2px solid var(--color-danger,#ef4444);outline-offset:2px}.UserStoryCard-module_addSectionButton__lBCWj{align-items:center;background:#0000;border:1.5px dashed var(--color-border,#d1d5db);border-radius:6px;color:var(--color-text-secondary,#6b7280);cursor:pointer;display:inline-flex;flex-shrink:0;font-size:12px;font-weight:500;gap:5px;padding:6px 10px;transition:border-color .15s ease,color .15s ease,background .15s ease;white-space:nowrap}.UserStoryCard-module_addSectionButton__lBCWj:hover{background:var(--color-primary-subtle,#4f46e50d);border-color:var(--color-primary,#4f46e5);color:var(--color-primary,#4f46e5)}.UserStoryCard-module_addSectionButton__lBCWj:active{transform:scale(.97)}.UserStoryCard-module_addSectionButton__lBCWj:focus-visible{outline:2px solid var(--color-primary,#4f46e5);outline-offset:2px}.UserStoryCard-module_addSectionLabel__kUs2E{display:inline}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as n}from"react/jsx-runtime";import e from"./AiReasoningCitationContent.js";import t from"../../icons/CognitiveDecision.js";import o from"../../../CitationRenderer/CitationRenderer.js";var
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as n}from"react/jsx-runtime";import e from"./AiReasoningCitationContent.js";import t from"../../icons/CognitiveDecision.js";import o from"../../../CitationRenderer/CitationRenderer.js";var l=function(){return n("svg",i({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:n("polyline",{points:"18 15 12 9 6 15"})}))},r=function(){return n("svg",i({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:n("polyline",{points:"6 9 12 15 18 9"})}))},a=75,c=function(a){var c=a.isSourceHasHighlight,s=a.aiReason,d=a.citationTitle,p=void 0===d?"":d,f=a.customStyles,u=a.customIcons,m=a.onSelectProceed,g=a.isDisableProceedButton,h=a.inlineLabel,v=a.isInlineCitation,x=(s.relevance_score>=75?null==u?void 0:u.highConfidence:null==u?void 0:u.lowConfidence)||n(t,{});return n("span",{children:n(o,{inLineCitation:!0,citationId:"ai-reasoning-".concat(s.id),citationTitle:v?h||"":p||"",citationIcon:v?null:x,defaultExpanded:(null==s?void 0:s.isOpen)||c||!1,citationComponent:n(e,{aiReason:s,customStyles:f,customIcons:u,onSelectProceed:m,isDisableProceedButton:g}),chevronDownComponent:v?null:n(r,{}),chevronUpComponent:v?null:n(l,{}),styles:{pillButton:i({margin:"0px",padding:v?"0":"4px 8px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:v?"center":"flex-end",background:"#ffffffff",fontWeight:"700",gap:"1.5px",border:"none"},null==f?void 0:f.aiReasoningPill),citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})})};export{a as SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING,c as default};
|
|
2
2
|
//# sourceMappingURL=AiReasoningCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as n,jsxs as o,Fragment as e}from"react/jsx-runtime";import a from"../../icons/AiReasoningIcon.js";import l from"./AIReasonAccordion.js";import t from"../../icons/ReasoningBulbIcon.js";import{AiReasonMarkdownWrapper as d}from"./AiReasonMarkdownWrapper.js";import s from"../../icons/AiGapIcon.js";import{useState as r}from"react";import{ChevronUp as c,ChevronDown as v}from"lucide-react";import u from"./AiReasoningCitationContent.module.css.js";import{renderAIConfidenceDisplay as C}from"../../shared/CitationAIConfidenceDisplay.js";import{useRequirementAI as m}from"../RequirementAIWrapper/RequirementAIWrapper.js";var p=function(p){var g,h,f,b,y,R,w,S,I,N,A,B,k,x,D,E,_,M,O,j,W,F,G,H=p.label,P=p.aiReason,T=p.scenario,U=p.customStyles,V=p.customIcons,q=p.cognitiveDecisionHeaders,L=p.onSelectProceed,z=p.isDisableProceedButton,J=p.big_enough_block,K=p.isSegmentExplanation,Q=p.handleViewExample,X=p.handleViewGlossary,Y=p.isUpdatedSegment,Z=m().aiReasoningAccordionOpenStates,$=(null==V?void 0:V.aireasonIcon)||n(a,{}),ii=(null==V?void 0:V.reasoningIcon)||n(t,{}),ni=(null==V?void 0:V.gapIcon)||n(s,{}),oi=r(null!==(g=null==Z?void 0:Z.isBottomComponentDefaultOpen)&&void 0!==g&&g),ei=oi[0],ai=oi[1];return o("div",i({className:"".concat(u.container," ").concat("riskSideBar"===T?"":u.containerBordered),style:null===(h=null==U?void 0:U.aiReasoningContent)||void 0===h?void 0:h.container},{children:[n("div",i({className:"".concat((null==P?void 0:P.explanation)&&"riskSideBar"!==T?"":u.explanationDivider),style:null===(f=null==U?void 0:U.aiReasoningContent)||void 0===f?void 0:f.explanationDivider},{children:
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as n,jsxs as o,Fragment as e}from"react/jsx-runtime";import a from"../../icons/AiReasoningIcon.js";import l from"./AIReasonAccordion.js";import t from"../../icons/ReasoningBulbIcon.js";import{AiReasonMarkdownWrapper as d}from"./AiReasonMarkdownWrapper.js";import s from"../../icons/AiGapIcon.js";import{useState as r}from"react";import{ChevronUp as c,ChevronDown as v}from"lucide-react";import u from"./AiReasoningCitationContent.module.css.js";import{renderAIConfidenceDisplay as C}from"../../shared/CitationAIConfidenceDisplay.js";import{useRequirementAI as m}from"../RequirementAIWrapper/RequirementAIWrapper.js";var p=function(p){var g,h,f,b,y,R,w,S,I,N,A,B,k,x,D,E,_,M,O,j,W,F,G,H=p.label,P=p.aiReason,T=p.scenario,U=p.customStyles,V=p.customIcons,q=p.cognitiveDecisionHeaders,L=p.onSelectProceed,z=p.isDisableProceedButton,J=p.big_enough_block,K=p.isSegmentExplanation,Q=p.handleViewExample,X=p.handleViewGlossary,Y=p.isUpdatedSegment,Z=m().aiReasoningAccordionOpenStates,$=(null==V?void 0:V.aireasonIcon)||n(a,{}),ii=(null==V?void 0:V.reasoningIcon)||n(t,{}),ni=(null==V?void 0:V.gapIcon)||n(s,{}),oi=r(null!==(g=null==Z?void 0:Z.isBottomComponentDefaultOpen)&&void 0!==g&&g),ei=oi[0],ai=oi[1];return o("div",i({className:"".concat(u.container," ").concat("riskSideBar"===T?"":u.containerBordered),style:null===(h=null==U?void 0:U.aiReasoningContent)||void 0===h?void 0:h.container},{children:[(null==P?void 0:P.explanation)&&n("div",i({className:"".concat((null==P?void 0:P.explanation)&&"riskSideBar"!==T?"":u.explanationDivider),style:null===(f=null==U?void 0:U.aiReasoningContent)||void 0===f?void 0:f.explanationDivider},{children:n(l,{icon:n(e,{}),title:"Explanation",subTitle:"",customStyles:null==U?void 0:U.aiReasoningAccordion,content:n(d,{label:H,message:P.explanation,isExpandableOrderedListEnabled:!0,customStyles:null==U?void 0:U.aiReasoningMarkdown,citationStyles:{webCitation:null==U?void 0:U.webCitation,stormeeCitation:null==U?void 0:U.stormeeCitation,waveformCitation:null==U?void 0:U.waveformCitation,imageCitation:null==U?void 0:U.imageCitation,fileCitation:null==U?void 0:U.fileCitation,appModCitation:null==U?void 0:U.appModCitation,rcaCitation:null==U?void 0:U.rcaCitation,readFileCitation:null==U?void 0:U.readFileCitation,loadingCitations:null==U?void 0:U.loadingCitations,chatCitation:null==U?void 0:U.chatCitation,bigEnoughCitation:null==U?void 0:U.bigEnoughCitation},customIcons:V,onSelectProceed:L,isDisableProceedButton:z,big_enough_block:J}),isSegmentExplanation:K,scenario:T,handleViewExample:Q,handleViewGlossary:X,isUpdatedSegment:Y})})),"riskSideBar"!==T&&o("div",i({onClick:function(){(null==Z?void 0:Z.isBottomComponentCollapsed)&&ai(function(i){return!i})},className:"".concat(u.headerBar," ").concat("riskSideBar"===T?"":u.headerBarRounded),style:null===(b=null==U?void 0:U.aiReasoningContent)||void 0===b?void 0:b.headerBar},{children:[o("div",i({className:u.headerBrand,style:null===(y=null==U?void 0:U.aiReasoningContent)||void 0===y?void 0:y.headerBrand},{children:[$,n("p",{children:null!==(R=null==q?void 0:q.mainHeader)&&void 0!==R?R:"Cognitive Decisioning AI"})]})),o("div",i({className:u.headerScore,style:null===(w=null==U?void 0:U.aiReasoningContent)||void 0===w?void 0:w.headerScore},{children:[!isNaN(null==P?void 0:P.relevance_score)&&C(P.relevance_score,P.relevance_score_diff,null===(S=null==U?void 0:U.aiReasoningContent)||void 0===S?void 0:S.confidenceDisplay,V),(null==Z?void 0:Z.isBottomComponentCollapsed)&&n("button",i({className:u.chevronWrapper,style:null===(I=null==U?void 0:U.aiReasoningContent)||void 0===I?void 0:I.chevronWrapper},{children:ei?n(c,{className:null==u?void 0:u.chevronIcon,style:null===(N=null==U?void 0:U.aiReasoningContent)||void 0===N?void 0:N.chevronIcon}):n(v,{className:null==u?void 0:u.chevronIcon,style:null===(A=null==U?void 0:U.aiReasoningContent)||void 0===A?void 0:A.chevronIcon})}))]}))]})),"riskSideBar"!==T&&ei&&n("div",i({className:u.bodyRow,style:i({width:"100%"},null===(B=null==U?void 0:U.aiReasoningContent)||void 0===B?void 0:B.bodyRow)},{children:o("div",i({className:"flex flex-col ".concat(u.bodyFull)},{children:[n(l,{icon:n("div",i({className:u.iconWrapper,style:null===(k=null==U?void 0:U.aiReasoningContent)||void 0===k?void 0:k.iconWrapper},{children:ii})),isUpdatedSegment:Y,title:null!==(x=null==q?void 0:q.decisionHeader)&&void 0!==x?x:"Decision Making Factors",subTitle:"",customStyles:null==U?void 0:U.aiReasoningAccordion,alwaysOpen:null===(D=null==Z?void 0:Z.reasoningAlwaysOpen)||void 0===D||D,defaultOpen:null===(E=null==Z?void 0:Z.reasoningDefaultOpen)||void 0===E||E,content:n(d,{message:(null==P?void 0:P.reason)||"No reasoning available.",customStyles:null==U?void 0:U.aiReasoningMarkdown,citationStyles:{webCitation:null==U?void 0:U.webCitation,stormeeCitation:null==U?void 0:U.stormeeCitation,waveformCitation:null==U?void 0:U.waveformCitation,imageCitation:null==U?void 0:U.imageCitation,fileCitation:null==U?void 0:U.fileCitation,appModCitation:null==U?void 0:U.appModCitation,rcaCitation:null==U?void 0:U.rcaCitation,readFileCitation:null==U?void 0:U.readFileCitation,loadingCitations:null==U?void 0:U.loadingCitations,chatCitation:null==U?void 0:U.chatCitation,bigEnoughCitation:null==U?void 0:U.bigEnoughCitation},customIcons:V,big_enough_block:J})}),n("div",{className:u.divider,style:null===(_=null==U?void 0:U.aiReasoningContent)||void 0===_?void 0:_.divider}),n(l,{icon:n("div",i({className:u.iconWrapper,style:null===(M=null==U?void 0:U.aiReasoningContent)||void 0===M?void 0:M.iconWrapper},{children:ni})),title:null!==(O=null==q?void 0:q.gapHeader)&&void 0!==O?O:"Gaps in Decision",subTitle:"",customStyles:null==U?void 0:U.aiReasoningAccordion,alwaysOpen:null!==(j=null==Z?void 0:Z.gapAlwaysOpen)&&void 0!==j&&j,defaultOpen:null!==(W=null==Z?void 0:Z.gapDefaultOpen)&&void 0!==W&&W,isUpdatedSegment:Y,content:n(d,{message:(F=P.relevance_score,G=(null==P?void 0:P.gap)||"No gap available.",F<100?"The decision strength is ".concat(F,"% because: \n").concat(G):G),customStyles:null==U?void 0:U.aiReasoningMarkdown,citationStyles:{webCitation:null==U?void 0:U.webCitation,stormeeCitation:null==U?void 0:U.stormeeCitation,waveformCitation:null==U?void 0:U.waveformCitation,imageCitation:null==U?void 0:U.imageCitation,fileCitation:null==U?void 0:U.fileCitation,appModCitation:null==U?void 0:U.appModCitation,rcaCitation:null==U?void 0:U.rcaCitation,readFileCitation:null==U?void 0:U.readFileCitation,loadingCitations:null==U?void 0:U.loadingCitations,chatCitation:null==U?void 0:U.chatCitation,bigEnoughCitation:null==U?void 0:U.bigEnoughCitation},customIcons:V,big_enough_block:J}),className:u.gapAccordion})]}))}))]}))};export{p as default};
|
|
2
2
|
//# sourceMappingURL=AiReasoningCitationContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as t}from"tslib";import{jsx as n}from"react/jsx-runtime";import{ScannedDocCitation as i}from"@e-llm-studio/citation";import o from"../../../
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as n}from"react/jsx-runtime";import{ScannedDocCitation as i}from"@e-llm-studio/citation";import o from"../../../CitationRenderer/CitationRenderer.js";import e from"../../../RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js";var r=function(r){var a,c=r.title,l=r.citation,m=r.customIcons,s=r.customStyles,u=l.customMetadata,d=null!==(a=null==m?void 0:m.ScannedDocumentIcon)&&void 0!==a?a:n(e,{});return n(o,{inLineCitation:!0,citationTitle:c,citationId:"scanned-doc-".concat(l.citation_number),citationComponent:n(i,{pages:null==u?void 0:u.value,subHeadingText:null==u?void 0:u.artifact_title,height:"400px"}),chevronDownComponent:d,chevronUpComponent:d,styles:{pillButton:t({fontSize:"14px",margin:"0px",background:"#ffffff",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",border:"none"},null==s?void 0:s.pill),citationContent:t({width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"},null==s?void 0:s.content)}})};export{r as default};
|
|
2
2
|
//# sourceMappingURL=ScannedCitationRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as a}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as a,Fragment as i}from"react/jsx-runtime";import l,{useContext as r,useMemo as s}from"react";import{ArrowUpRight as d,X as c}from"lucide-react";import{cn as m}from"../../../UserStoryImport/lib/cn.js";import u from"./segment.module.css.js";import p from"./ExampleComponentWrapper.js";import g from"../ai-reasoning/AiReasoningCitationContent.js";import v from"./SegmentLoader.js";import"./segment-common.css.js";import{MarkdownStateContext as f}from"../../store/markdown-context.js";import h from"@mui/material/Dialog";import y from"@mui/material/IconButton";var b=function(b){var C,S=b.id,x=void 0===S?"Segment":S,E=b.label,w=b.children,I=b.segmentUUID;b.decisionStrength;var j=b.aiReason,L=b.customStyles,N=b.customIcons,B=b.aiReasoningCitationCustomStyles,R=b.segmentExampleComponent,U=b.handleViewGlossary,W=b.isUpdatedSegment,k=b.onOpen,A=r(f),V=A.citationsMetadata,G=A.updateCitationsMetadata;console.log("citation metadata ",V);var M=l.useState(!1),z=M[0],D=M[1],T=s(function(){return V.get(I)},[V,I]),O=s(function(){return(null==T?void 0:T.open)||!1},[T]),q=s(function(){return T&&"loading"===T.state},[T]),F=function(){return n(void 0,void 0,void 0,function(){var n;return t(this,function(t){switch(t.label){case 0:if(n=!O,D(!1),console.log("citation metadata::",n,j),!n||(null==j?void 0:j.reason))return[3,5];G(I,function(t){if(t){var o=e({},t);return o.state="loading",o}return{open:n,state:"loading"}}),t.label=1;case 1:return t.trys.push([1,,3,4]),console.log("citation metadata:: onopen"),[4,null==k?void 0:k()];case 2:return t.sent(),[3,4];case 3:return G(I,function(t){if(t){var o=e({},t);return o.state="ready",o.open=n,o}return{open:n,state:"ready"}}),[7];case 4:return[3,6];case 5:console.log("citation metadata:: else block"),G(I,function(t){if(t){var o=e({},t);return o.open=n,o}return{open:n,state:q?"loading":"ready"}}),t.label=6;case 6:return[2]}})})};return o("div",e({className:"".concat(u.segmentWrapper),style:e(e({},null==L?void 0:L.segmentWrapper),{display:"inline-flex",verticalAlign:"middle"})},{children:[o("div",e({className:"segment-".concat(x,"-container segmentContainer ").concat(W?"updatedSegmentContainer":""),style:e({},null==L?void 0:L.container)},{children:[a("span",e({className:"segment-".concat(x," segmentLabel ").concat(W?"updatedSegmentLabel":""),style:e({},null==L?void 0:L.label)},{children:W?w:E})),a("button",e({className:"".concat(u.segmentExplanationButtonContainer),style:e({},null==L?void 0:L.buttonContainer),onClick:F},{children:a(d,{className:m(W&&u.updatedChevronIcon,u.cheveronIcon),style:e({},null==L?void 0:L.cheveronIcon)})}))]})),O&&a(h,e({open:!0,onClose:F,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",maxWidth:"xl",container:document.getElementById("#root")},{children:o("div",e({style:{minWidth:"50vw",paddingLeft:16,paddingRight:16,paddingTop:24,paddingBottom:24}},{children:[o("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16}},{children:[a("span",e({className:"segmentLabel ".concat(W?"updatedSegmentLabel":""),style:{fontSize:18,fontWeight:600}},{children:W?"SEGMENT VALUE":E})),a(y,e({"aria-label":"close",onClick:F,sx:function(e){return{position:"absolute",right:8,top:8,color:e.palette.grey[500]}}},{children:a(c,{size:24})}))]})),q?a(v,{customStyles:null==L?void 0:L.loadingSkeleton}):o(i,{children:[z&&!W&&a("div",e({style:{marginBottom:16}},{children:a(p,{label:null!=E?E:"",segmentExampleComponent:R,customStyles:e(e({},null==L?void 0:L.segmentExample),{exampleContainer:e(e({},null===(C=null==L?void 0:L.segmentExample)||void 0===C?void 0:C.exampleContainer),{width:"100%"})}),handleCancelExample:function(){D(!1)}})})),W&&a("div",e({style:{marginBottom:16}},{children:a("div",e({className:"segment-".concat(x,"-container segmentContainer updatedSegmentContainer"),style:e({},null==L?void 0:L.container)},{children:a("span",e({className:"segment-".concat(x," segmentLabel updatedSegmentLabel"),style:e({},null==L?void 0:L.label)},{children:w}))}))})),a("div",{children:a(g,{aiReason:j,customStyles:e(e({},B),{aiReasoningContent:e(e({},null==B?void 0:B.aiReasoningContent),{headerBar:{width:"auto"}}),aiReasoningAccordion:{header:{width:"auto"}}}),customIcons:N,isSegmentExplanation:!0,handleViewGlossary:U?function(){G(I,function(n){if(n){var t=e({},n);return t.open=!1,t}return{open:!1,state:q?"loading":"ready"}}),null==U||U(x)}:void 0,handleViewExample:R?function(){D(!0)}:void 0,isUpdatedSegment:W})})]})]}))}))]}))};export{b as default};
|
|
2
2
|
//# sourceMappingURL=Segment.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=".segmentContainer{align-items:center;background-color:#eff6ff;border:1px dashed #bfdbfe;border-radius:4px;color:#3b82f6;display:flex;gap:8px;padding:8px;width:fit-content}.updatedSegmentContainer{background-color:#f0fdf4;border:1px solid #bbf7d0;color:#16a34a}.segmentLabel{color:#3b82f6;font-size:14px;font-weight:600;line-height:21px;text-transform:uppercase}.updatedSegmentLabel{color:#16a34a}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&t.setAttribute("nonce",n),t.appendChild(document.createTextNode(e));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(t)}();export{e as default};
|
|
1
|
+
var e=".segmentContainer{align-items:center;background-color:#eff6ff;border:1px dashed #bfdbfe;border-radius:4px;color:#3b82f6;display:flex;gap:8px;padding:8px;width:fit-content}.updatedSegmentContainer{align-items:start;background-color:#f0fdf4;border:1px solid #bbf7d0;color:#16a34a}.segmentLabel{color:#3b82f6;font-size:14px;font-weight:600;line-height:21px;text-transform:uppercase}.updatedSegmentLabel{color:#16a34a}.glow{box-shadow:0 4px 12px #deea611a}";!function(){if("undefined"==typeof document)return;const t=document.createElement("style");t.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&t.setAttribute("nonce",n),t.appendChild(document.createTextNode(e));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(t)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=segment-common.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",updatedChevronIcon:"segment-module_updatedChevronIcon__8vN-t",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",segmentPopup:"segment-module_segmentPopup__YcHor",explanationPanel:"segment-module_explanationPanel__7YlpU",exampleWrapper:"segment-module_exampleWrapper__ptZzj",uppercase:"segment-module_uppercase__hjgxG",exampleContainer:"segment-module_exampleContainer__9tMXx",exampleHeader:"segment-module_exampleHeader__9P11O",loaderWrapper:"segment-module_loaderWrapper__SwIof",loaderContainer:"segment-module_loaderContainer__5Mhyz",loaderHeader:"segment-module_loaderHeader__J2JnY",skeleton:"segment-module_skeleton__2uZEf",pulse:"segment-module_pulse__A17cR",title:"segment-module_title__fW93U",icon:"segment-module_icon__Dvee3",lineFull:"segment-module_lineFull__MMmOD",line90:"segment-module_line90__OFStl",line75:"segment-module_line75__9r6Xp",line60:"segment-module_line60__bLRec",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ",spinner:"segment-module_spinner__kRnWD",spin:"segment-module_spin__MV6y5"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&e.setAttribute("nonce",n),e.appendChild(document.createTextNode(".segment-module_segmentWrapper__PVOuq{display:
|
|
1
|
+
var e={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",updatedChevronIcon:"segment-module_updatedChevronIcon__8vN-t",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",segmentPopup:"segment-module_segmentPopup__YcHor",explanationPanel:"segment-module_explanationPanel__7YlpU",exampleWrapper:"segment-module_exampleWrapper__ptZzj",uppercase:"segment-module_uppercase__hjgxG",exampleContainer:"segment-module_exampleContainer__9tMXx",exampleHeader:"segment-module_exampleHeader__9P11O",loaderWrapper:"segment-module_loaderWrapper__SwIof",loaderContainer:"segment-module_loaderContainer__5Mhyz",loaderHeader:"segment-module_loaderHeader__J2JnY",skeleton:"segment-module_skeleton__2uZEf",pulse:"segment-module_pulse__A17cR",title:"segment-module_title__fW93U",icon:"segment-module_icon__Dvee3",lineFull:"segment-module_lineFull__MMmOD",line90:"segment-module_line90__OFStl",line75:"segment-module_line75__9r6Xp",line60:"segment-module_line60__bLRec",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ",spinner:"segment-module_spinner__kRnWD",spin:"segment-module_spin__MV6y5"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&e.setAttribute("nonce",n),e.appendChild(document.createTextNode(".segment-module_segmentWrapper__PVOuq{display:flex;flex-direction:column;gap:8px}.segment-module_segmentButtonContainer__X76sx{background-color:initial;border:none;cursor:pointer;padding:0}.segment-module_cheveronIcon__1njFy{color:#3b82f6;height:16px;transition:all .2s ease-in-out;width:16px}.segment-module_updatedChevronIcon__8vN-t{color:#16a34a}.segment-module_cheveronIconRotated__qDYj7{transform:rotate(180deg)}.segment-module_segmentPopup__YcHor{left:0;min-width:500px;position:absolute;top:calc(100% + 8px);z-index:1000}.segment-module_explanationPanel__7YlpU{background:#fff;left:0;position:absolute;top:100%;width:600px;z-index:100}.segment-module_exampleWrapper__ptZzj{align-items:flex-start;display:flex;flex-direction:column;gap:12px}.segment-module_uppercase__hjgxG{text-transform:uppercase}.segment-module_exampleContainer__9tMXx{align-items:flex-start;border:2px dashed #e2e8f0;border-radius:8px;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;padding:16px;width:100%}.segment-module_exampleHeader__9P11O{align-items:center;align-self:stretch;display:flex;justify-content:space-between}.segment-module_loaderContainer__5Mhyz,.segment-module_loaderWrapper__SwIof{border:1px solid #e5e7eb;border-radius:8px;padding:12px}.segment-module_loaderHeader__J2JnY{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.segment-module_skeleton__2uZEf{animation:segment-module_pulse__A17cR 1.5s ease-in-out infinite;background:#e5e7eb;border-radius:6px}.segment-module_title__fW93U{height:18px;width:100px}.segment-module_icon__Dvee3{height:18px;width:18px}.segment-module_lineFull__MMmOD{height:14px;margin-bottom:10px;width:100%}.segment-module_line90__OFStl{height:14px;margin-bottom:10px;width:90%}.segment-module_line75__9r6Xp{height:14px;margin-bottom:10px;width:75%}.segment-module_line60__bLRec{height:14px;width:60%}@keyframes segment-module_pulse__A17cR{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.segment-module_exampleHeaderText__MWMG0{color:#334155;font-size:14px;font-weight:600;line-height:21px;margin:0}.segment-module_cancelButton__-F5aZ{align-items:center;align-self:stretch;background-color:initial;border:none;color:#334155;cursor:pointer;display:flex;height:fit-content;justify-content:space-between;padding:4px;transition:all .2s ease-in-out}.segment-module_cancelButton__-F5aZ:hover{background-color:#eff6ff}.segment-module_spinner__kRnWD{animation:segment-module_spin__MV6y5 1s linear infinite}@keyframes segment-module_spin__MV6y5{to{transform:rotate(1turn)}}"));const t=document.head||document.getElementsByTagName("head")[0]||document.documentElement;t&&t.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=segment.module.css.js.map
|