@e-llm-studio/requirement-ai 0.0.186 → 0.0.187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/RequirementAI/components/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/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- 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/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- 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/UserStoryCard.d.ts +4 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),i=require("../RequirementAIWrapper/RequirementAIWrapper.js"),a=require("@mui/material"),r=require("../../utils/userStoryAttachedContext.utils.js"),l=require("./AttachedContext.module.css.js"),o=function(e){return["mp4","mov","webm","mkv"].includes(e)?t.jsx(s.Video,{size:24}):["mp3","wav","ogg","m4a","aac"].includes(e)?t.jsx(s.Headphones,{size:24}):["png","jpg","jpeg","svg","webp","gif"].includes(e)?t.jsx(s.ImageIcon,{size:24}):["pdf","docx","doc","txt","rtf","pages"].includes(e)?t.jsx(s.FileText,{size:24}):t.jsx(s.FileCode,{size:24})},c=function(t,s){var a=i.useRequirementAI().apiCachingConfig,r=a.queryClient,l=a.useGetSignedUrlQuery,o=a.useGetSignedUrlMutation,c=a.getProjectFileUrl,u=null==c?void 0:c(t.path),d=["getSignedUrl",u],m=l(u,d).data,g=o(u),f=g.mutate,h=g.isPending;n.useEffect(function(){u?r.getQueryData(d)||m||f({gsUtilPath:u}):null==s||s("Please provide valid gsUtilPath.")},[u]);return{handleRedirect:function(n){return e.__awaiter(void 0,void 0,void 0,function(){var i,a,l,o,c,g,p;return e.__generator(this,function(e){switch(e.label){case 0:null==n||n.stopPropagation(),e.label=1;case 1:return e.trys.push([1,4,,5]),(i=m||r.getQueryData(d))?"json"!==t.extension.toLowerCase()?(window.open(i,"_blank"),[2]):[4,fetch(i)]:(!h&&u&&f({gsUtilPath:u}),[2]);case 2:if(!(a=e.sent()).ok)throw new Error("Failed to fetch artifact JSON");return[4,a.json()];case 3:return l=e.sent(),o=l.id,c=l.modeName,o&&c?(g="".concat(window.location.origin,"/artifact/").concat(o,"/mode/").concat(c),window.open(g,"_blank"),[3,5]):(window.open(i,"_blank"),[2]);case 4:return p=e.sent(),console.error("Redirect failed:",p),m?window.open(m,"_blank"):null==s||s("Failed to open the selected file."),[3,5];case 5:return[2]}})})},isPending:h,signedUrl:m}},u=function(i){var o=i.item,u=i.isLast,d=i.getIconByExtension,m=i.customStyles,g=n.useState(!1),f=g[0],h=g[1],p=n.useState(""),v=p[0],x=p[1],_=c(o,function(e){x(e),h(!0)}),j=_.handleRedirect,y=_.isPending,w=_.signedUrl;return t.jsxs("div",e.__assign({className:"".concat(l.default.contextItem," ").concat(u?l.default.lastItem:""),style:null==m?void 0:m.contextItem},{children:[t.jsx("div",e.__assign({className:l.default.itemIconWrapper,style:null==m?void 0:m.iconWrapper},{children:r.GetFileIcon(o.extension,o.title.toUpperCase())||d(o.extension)})),t.jsxs("div",e.__assign({className:l.default.itemContent,style:null==m?void 0:m.itemContent},{children:[t.jsx("h3",e.__assign({className:l.default.itemTitle,style:null==m?void 0:m.title},{children:o.title})),t.jsx("p",e.__assign({className:l.default.itemMeta,style:null==m?void 0:m.metadata},{children:o.metadata}))]})),t.jsx("div",e.__assign({onClick:j,className:"".concat(l.default.actionButton," ").concat(w?l.default.actionButtonReady:""),style:null==m?void 0:m.actionButton},{children:y?t.jsx(s.Loader2,{size:24,className:"animate-spin"}):t.jsx(s.ExternalLink,{size:24})})),t.jsx(a.Snackbar,e.__assign({open:f,autoHideDuration:3e3,onClose:function(){return h(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"}},{children:t.jsxs(a.Alert,e.__assign({onClose:function(){return h(!1)},severity:"error",sx:{width:"100%"}},{children:[t.jsx(a.AlertTitle,{children:"Error"}),v]}))}))]}))},d=function(i){var r=i.item,o=n.useState(!1),u=o[0],d=o[1],m=n.useState(""),g=m[0],f=m[1],h=c(r,function(e){f(e),d(!0)}),p=h.handleRedirect,v=h.isPending;return t.jsxs(t.Fragment,{children:[t.jsxs("span",e.__assign({className:l.default.sourceChip,onClick:p},{children:[t.jsx("span",e.__assign({className:l.default.sourceChipLabel},{children:r.title})),v?t.jsx(s.Loader2,{size:12,className:"animate-spin"}):t.jsx(s.Eye,{size:12})]})),t.jsx(a.Snackbar,e.__assign({open:u,autoHideDuration:3e3,onClose:function(){return d(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"}},{children:t.jsxs(a.Alert,e.__assign({onClose:function(){return d(!1)},severity:"error",sx:{width:"100%"}},{children:[t.jsx(a.AlertTitle,{children:"Error"}),g]}))}))]})},m=function(s){var i=s.flattenedData,a=n.useState(!1),r=a[0],o=a[1],c=r?i:i.slice(0,2);return t.jsxs("div",e.__assign({className:l.default.sourcesContainer},{children:[t.jsx("span",e.__assign({className:l.default.sourcesLabel},{children:"Sources :"})),t.jsx("div",e.__assign({className:r?l.default.sourcesScrollContainer:l.default.sourcesInlineContainer},{children:c.map(function(e){return t.jsx(d,{item:e},e.id)})})),!r&&i.length>2&&t.jsxs("span",e.__assign({className:l.default.moreChip,onClick:function(){return o(!0)}},{children:["+",i.length-2]})),r&&i.length>2&&t.jsx("span",e.__assign({className:l.default.moreChip,onClick:function(){return o(!1)}},{children:"Show Less"}))]}))};exports.default=function(a){var c=a.customStyles,d=a.variant,g=void 0===d?"dropdown":d,f=n.useState(!1),h=f[0],p=f[1],v=n.useRef(null),x=i.useRequirementAI().persistedDataFiles;n.useEffect(function(){var e=function(e){v.current&&!v.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);var _=n.useMemo(function(){var e=[];return x?(Object.entries(x).forEach(function(t){var n=t[0],s=t[1];Array.isArray(s)&&s.forEach(function(t){var s,i=t.filesFromProject;if(i){var a,l=i.name,o=(null===(s=i.type)||void 0===s?void 0:s.toLowerCase())||"",c=(a=i.uploadTime)?new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"";e.push({id:i.url,category:n,title:l,extension:o,metadata:"".concat(c," • ").concat(r.getDisplayFileType(o,l)),path:i.url,uploadTime:i.uploadTime})}})}),e):e},[x]);return"inline"===g?0===_.length?null:t.jsx(m,{flattenedData:_}):t.jsx("div",e.__assign({className:l.default.wrapper,style:null==c?void 0:c.wrapperComponent},{children:t.jsxs("div",e.__assign({className:l.default.dropdownContainer,style:null==c?void 0:c.dropdownContainer,ref:v},{children:[t.jsxs("button",e.__assign({onClick:function(e){e.stopPropagation(),p(!h)},className:l.default.triggerButton,style:null==c?void 0:c.triggerButton},{children:[t.jsx(s.BookOpen,{size:18,className:l.default.triggerIcon,style:null==c?void 0:c.triggerIcon}),t.jsxs("span",e.__assign({className:l.default.triggerLabel,style:null==c?void 0:c.triggerLabel},{children:["Attached Context(",_.length,")"]})),h?t.jsx(s.ChevronUp,{size:18}):t.jsx(s.ChevronDown,{size:18})]})),h&&t.jsxs("div",e.__assign({className:l.default.dropdownPanel,style:null==c?void 0:c.dropdownPanel},{children:[t.jsx("div",e.__assign({className:l.default.dropdownList,style:null==c?void 0:c.dropdownList},{children:_.length>0?_.map(function(e,n){return t.jsx(u,{item:e,isLast:n===_.length-1,getIconByExtension:o,customStyles:null==c?void 0:c.contextItem},e.id)}):t.jsx("div",e.__assign({className:l.default.emptyState},{children:"No attachments found"}))})),_.length>4&&t.jsx("div",{className:l.default.fadeGradient,style:null==c?void 0:c.fadeGradient})]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=AttachedContext.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/AttachedContext.module.css.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!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,.AttachedContext-module_sourcesInlineContainer__DR4d8{align-items:center;display:flex;gap:8px;min-width:0}.AttachedContext-module_sourcesScrollContainer__FmVI2{-ms-overflow-style:none;align-items:center;display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;scroll-behavior:smooth;scrollbar-width:none}.AttachedContext-module_sourcesScrollContainer__FmVI2::-webkit-scrollbar{display:none}.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:0;font-size:13px;font-weight:500;gap:6px;line-height:18px;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;white-space:nowrap}.AttachedContext-module_moreChip__ieXRs{align-items:center;background:#eef2ff;border-radius:10px;color:#6366f1;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)}(),exports.default={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",sourcesInlineContainer:"AttachedContext-module_sourcesInlineContainer__DR4d8",sourcesScrollContainer:"AttachedContext-module_sourcesScrollContainer__FmVI2",sourcesLabel:"AttachedContext-module_sourcesLabel__VN-9Q",sourceChip:"AttachedContext-module_sourceChip__QsVPO",sourceChipLabel:"AttachedContext-module_sourceChipLabel__f29Qv",moreChip:"AttachedContext-module_moreChip__ieXRs"};
|
|
2
2
|
//# sourceMappingURL=AttachedContext.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),i=require("showdown"),l=require("@mui/material"),r=require("uuid"),o=require("./UserStoryCard.module.css.js"),a=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),_=require("../story-screen/BigEnoughPanel.js"),g=require("./TitleEditor/TitleEditor.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=y(i);function m(n){for(var i,o=[],a=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(i=a.exec(n));){var c=i[1],f=i.index;f>u&&o.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),o.push(t.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(s.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(r.v4()))),u=a.lastIndex}return u<(null==n?void 0:n.length)&&o.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),o}function p(t,n,s){var i;if(!t)return{};if(n)return e.__assign({},t.parentConfig);var l=e.__assign({},t.childConfig);return s&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[s])?e.__assign(e.__assign({},l),t.subFeatureOverrides[s]):l}var S=function(n){var i,l=n.displayName,r=v.useRequirementAI().customStyles,a=null===(i=null==r?void 0:r.userStoryCardStyles)||void 0===i?void 0:i.showDisplayName;return t.jsxs("div",e.__assign({className:o.default.displayName,style:null==a?void 0:a.wrapper},{children:[t.jsx(s.Bookmark,{className:o.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),t.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},x=function(i){var y,C,I,j,w,b,N,B=i.isUserStoryCurrentlyUpdated,D=i.artifactId,U=i.artifactTitleId,k=i.parentUserStory,E=i.currentUserStory,M=i.onUserStoryChange,A=i.parentIndex,T=i.currentIndex,q=i.enableDownload,P=i.isDiffEditReviewMode,R=i.showUserStoryDiff,L=i.handleDownloadUserStory,H=i.handleOpenSendDialog,W=i.updateUserStoryArtifact,z=i.selectedArtifactId,O=i.isDisplayHighlightControl,F=i.elementDisplayConfig,V=i._resolvedConfig,G=i.showWrapper,Q=void 0!==G&&G,Z=i.actionItemsConfig,J=i.onDelete,K=v.useRequirementAI(),X=K.searchQueryList,Y=K.citations,$=K.customStyles,ee=null==$?void 0:$.userStoryCardStyles,te=null===(y=null==$?void 0:$.userStoryCardStyles)||void 0===y?void 0:y.userStoryEditStyles,ne=null===(C=null==$?void 0:$.userStoryScreenStyles)||void 0===C?void 0:C.userStoryContentStyles,se=null==ee?void 0:ee.progressHeaderStyles,ie=n.useState(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""})),le=ie[0],re=ie[1],oe=n.useState({userStory:!!E.isDefaultEdit}),ae=oe[0],ue=oe[1],de=n.useState(!1),ce=de[0],fe=de[1],ve=n.useState(null),_e=ve[0],ge=ve[1],ye=v.useRequirementAI(),he=ye.userStory,me=ye.customIcons,pe=n.useState(""===A||z===E.artifactId||!!E.isDefaultOpen),Se=pe[0],xe=pe[1],Ce=n.useState(!1);Ce[0];var Ie=Ce[1],je=n.useState(null),we=je[0],be=je[1],Ne=n.useState(null),Be=Ne[0],De=Ne[1],Ue=n.useState(!1),ke=Ue[0],Ee=Ue[1],Me=n.useRef(null),Ae=n.useState(!1);Ae[0];var Te=Ae[1],qe=n.useRef(null);n.useEffect(function(){B&&xe(B)},[B]),n.useEffect(function(){re(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""}))},[E]),n.useEffect(function(){X.length>0?xe(!0):z&&xe(z===E.artifactId)},[X,z,E.artifactId]);var Pe=function(){be(null)},Re=function(){De(null)},Le=function(){xe(function(e){return!e})};var He=null!=(null==E?void 0:E.big_enough)&&!Number.isNaN(E.big_enough)&&!!(null==E?void 0:E.big_enough_decision_factors),We=""===A,ze=null!=V?V:p(F,We),Oe=!P&&!R;return n.useEffect(function(){if(_e){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(_e));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[_e]),n.useEffect(function(){E.isDefaultEdit&&ue(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})},[E.isDefaultEdit]),t.jsxs("div",e.__assign({className:o.default.card,style:null==ee?void 0:ee.cardStyle,id:"story-card-".concat(E.title),"data-expanded":Se},{children:[t.jsxs("div",e.__assign({className:o.default.titleSection,style:null==ee?void 0:ee.titleSection},{children:[t.jsxs("div",e.__assign({className:o.default.titleRow,style:null==ee?void 0:ee.titleRow,onClick:Le},{children:[t.jsxs("div",e.__assign({className:o.default.titleLeft,style:null==ee?void 0:ee.titleLeft,onMouseEnter:function(){return Te(!0)},onMouseLeave:function(){return Te(!1)}},{children:[t.jsx(S,{displayName:U}),ce&&Oe?t.jsx(g.InlineTitleEditor,{title:E.title,onSave:function(t){return function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var s,i;return e.__generator(this,function(l){try{s=e.__assign({},E),E.artifactId===n?s.title=t:s.sub_features=(null===(i=E.sub_features)||void 0===i?void 0:i.map(function(s){return s.artifactId===n?e.__assign(e.__assign({},s),{title:t}):s}))||[],re(s),M(s),fe(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(t,E.artifactId)},onCancel:function(){fe(!1)},inputStyle:null==te?void 0:te.inlineTitleInput,confirmButtonStyle:null==te?void 0:te.inlineTitleConfirm,cancelButtonStyle:null==te?void 0:te.inlineTitleCancel},"inline-title-editor"):t.jsxs("div",e.__assign({className:o.default.storyTitleWrapper},{children:[t.jsx("h2",e.__assign({title:E.title,className:o.default.storyTitle,style:null==ee?void 0:ee.storyTitle},{children:m(E.title)}),E.artifactId),t.jsx("button",e.__assign({type:"button",className:o.default.titleEditButton,style:null==te?void 0:te.titleEditButton,onClick:function(e){e.stopPropagation(),fe(!0),Se||xe(!0)},"aria-label":"Edit title",title:"Edit title"},{children:t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:t.jsx("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"})}))}))]}))]})),t.jsxs("div",e.__assign({className:o.default.titleActions,style:null==ee?void 0:ee.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(ze.showProgressPercentage||ze.showGapBox)&&Q&&t.jsxs("div",e.__assign({className:o.default.progressHeader,style:null==se?void 0:se.wrapper},{children:[ze.showProgressPercentage&&t.jsxs("div",e.__assign({className:o.default.progressPercentage,style:null==se?void 0:se.percentage},{children:[null!==(j=null!==(I=null==E?void 0:E.confidenceScore)&&void 0!==I?I:null==ze?void 0:ze.confidenceValue)&&void 0!==j?j:"0","%"]})),ze.showGapBox&&t.jsxs("div",e.__assign({className:o.default.gapBox,style:null==se?void 0:se.gapBox},{children:[null!==(b=null!==(w=null==E?void 0:E.gapValue)&&void 0!==w?w:null==ze?void 0:ze.gapBoxValue)&&void 0!==b?b:"2"," ","Gaps"]}))]})),He&&t.jsx(_.BigEnoughPanel,{customIcons:null==me?void 0:me.userStoryIcons,customStyles:null==ee?void 0:ee.aiReasoningCitaionStyles,currentUserStory:E,panelStyles:null==ee?void 0:ee.BigEnoughStyles}),!ae.userStory&&t.jsxs(t.Fragment,{children:[!1!==(null==ze?void 0:ze.showShareButton)&&t.jsx("button",e.__assign({className:o.default.iconButton,style:null==ee?void 0:ee.iconButton,onClick:function(e){be(e.currentTarget)}},{children:t.jsx(s.ExternalLink,{size:16})})),t.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:we,open:!!we,onClose:function(){return be(null)},style:null==ee?void 0:ee.userStoryShareMenu},{children:[q&&t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return Ie(!0),L?[4,Promise.all([L("pdf"),L("doc")])]:[2];case 1:return e.sent(),Ie(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:Me,className:o.default.menuItemContent,style:null==ee?void 0:ee.menuItemContent},{children:[t.jsx(s.Download,{size:16,color:null==ee?void 0:ee.menuIconColor}),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:"Download"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=E,k&&(t=e.__assign(e.__assign({},E),{value:"".concat(u.replaceTitleSection(null==k?void 0:k.value,E.title)," \n").concat(E.value)})),null==H||H(!0,[t],E.artifactId),Pe(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==ee?void 0:ee.menuItemContent,className:o.default.menuItemContentPadded},{children:[t.jsx(s.Share2,{size:16,color:null==ee?void 0:ee.menuIconColor}),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:"Send"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,s,i,l;return e.__generator(this,function(e){switch(e.label){case 0:t=new h.default.Converter,n=t.makeHtml(a.formatMarkdown(E.value)||E.value),s=function(e){var t=(new h.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(a.formatMarkdown(E.value)||E.value),i=new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([i])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Pe(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==ee?void 0:ee.menuItemContent,className:o.default.menuItemContentPadded},{children:[t.jsx(s.Copy,{size:16,color:null==ee?void 0:ee.menuIconColor}),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:"Copy"}))]}))}))]}))]}),ae.userStory&&Se?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==ee?void 0:ee.cancelButton,onClick:function(){var t;null===(t=qe.current)||void 0===t||t.abort(),ue(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),ae.userStory&&Se?t.jsx(d.default,{type:"fill",children:ke?t.jsxs("span",e.__assign({className:o.default.savingSpinner,style:null==ee?void 0:ee.savingSpinner},{children:[t.jsx(s.LoaderCircle,{className:o.default.spinAnimation,style:null==ee?void 0:ee.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:ke,style:ke?null==ee?void 0:ee.savingButton:null==ee?void 0:ee.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){switch(n.label){case 0:return Ee(!0),"userStory"==="userStory"&&(M(le),console.log("I am changing RTE editor values",le)),[4,W(Y,he,D,null===(t=qe.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),M(e.__assign(e.__assign({},le),{isDefaultEdit:!1})),ue(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),Ee(!1),[2]}})})}}):!P&&!R&&Se&&!1!==(null==ze?void 0:ze.showEditButton)&&t.jsx("button",e.__assign({className:o.default.iconButton,style:null==ee?void 0:ee.editButton,onClick:function(){return ue(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(s.PencilIcon,{color:null==ee?void 0:ee.pencilIconColor,size:16})})),We&&Se&&!P&&!R&&!1!==(null==ze?void 0:ze.showEditButton)&&t.jsxs("button",e.__assign({type:"button",className:o.default.addSectionButton,style:null==te?void 0:te.addSectionButton,onClick:function(t){var n,s,i;t.stopPropagation();var l=(null!==(s=null===(n=E.sub_features)||void 0===n?void 0:n.length)&&void 0!==s?s:0)+1,o={artifactId:r.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a=e.__assign(e.__assign({},E),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(i=E.sub_features)&&void 0!==i?i:[],!0),[o],!1)});re(a),M(a),xe(!0),ge(o.title)},"aria-label":"Add section",title:"Add section"},{children:[t.jsx(s.Plus,{size:14}),t.jsx("span",e.__assign({className:o.default.addSectionLabel},{children:"Add Section"}))]})),!We&&!P&&!R&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==J||J()},className:o.default.iconButton,style:null==te?void 0:te.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:t.jsx(s.Trash2,{size:16})})),(null==ze?void 0:ze.actionItemsButton)&&t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({className:o.default.actionItemBtn,style:null==ee?void 0:ee.actionItemBtn,onClick:function(e){e.stopPropagation(),De(e.currentTarget)}},{children:t.jsx(s.Ellipsis,{})})),t.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:Be,open:!!Be,onClose:Re,style:null==ee?void 0:ee.userStoryShareMenu},{children:null==Z?void 0:Z.items.map(function(n,s){return t.jsx(l.MenuItem,e.__assign({style:null==ee?void 0:ee.userStoryMenuItem,onClick:function(){n.onclick(),Re()}},{children:t.jsxs("div",e.__assign({className:o.default.menuItemContent,style:e.__assign(e.__assign({},null==ee?void 0:ee.menuItemContent),!n.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[t.jsx("span",e.__assign({className:o.default.menuItemIcon,style:null==ee?void 0:ee.menuItemIcon},{children:n.icon})),t.jsx("p",e.__assign({style:null==ee?void 0:ee.menuLabel},{children:n.name})),t.jsx("span",{className:o.default.menuItemRight,style:null==ee?void 0:ee.menuItemRight})]}))}),"action-item-".concat(s,"-").concat(n.name))})}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),Le()},style:null==ee?void 0:ee.chevronButton,className:o.default.chevronButton},{children:Se?t.jsx(s.ChevronUp,{className:o.default.chevronIcon,color:null==ee?void 0:ee.chevronIconColor}):t.jsx(s.ChevronDown,{className:o.default.chevronIcon,color:null==ee?void 0:ee.chevronIconColor})}))]}))]})),t.jsx("div",{className:o.default.divider,style:null==ee?void 0:ee.dividerStyle})]})),Se&&t.jsx("div",e.__assign({className:o.default.cardContent,style:null==ee?void 0:ee.cardContentStyle},{children:t.jsxs("div",e.__assign({className:o.default.contentInner,style:null==ee?void 0:ee.contentInner},{children:[t.jsxs("div",e.__assign({className:o.default.descriptionSection,style:null==ee?void 0:ee.descriptionSection},{children:[t.jsx("div",{className:o.default.justifyBetween,style:null==ee?void 0:ee.justifyBetween}),ae.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:a.formatMarkdown(E.value)||"",handleUpdateState:function(t,n){var s=a.indentMarkdown(n);re(function(t){return e.__assign(e.__assign({},t),{value:s||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ae.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:R,isParent:""===A,message:a.formatMarkdown(E.value)||"",artifactId:E.artifactId,customStyles:ne,isDisplayHighlightControl:O})]})),null===(N=le.sub_features)||void 0===N?void 0:N.map(function(n,s){var i=p(F,!1,n.artifactId);return t.jsx(x,{artifactId:D,isUserStoryCurrentlyUpdated:B,artifactTitleId:"".concat(U,"-").concat(String.fromCharCode(65+s)),parentUserStory:E,parentIndex:"".concat(A).concat(A&&".").concat(T),currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var s=e.__spreadArray([],E.sub_features||[],!0);s[t]=n,M(e.__assign(e.__assign({},E),{sub_features:s}))}(s,t)},enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:W,handleDownloadUserStory:L,handleOpenSendDialog:H,isDisplayHighlightControl:O,elementDisplayConfig:F,_resolvedConfig:i,actionItemsConfig:Z,onDelete:function(){return function(t){var n=(E.sub_features||[]).filter(function(e,n){return n!==t}),s=e.__assign(e.__assign({},E),{sub_features:n});re(s),M(s)}(s)}},n.artifactId)})]}))}))]}))};exports.StoryCard=x,exports.UserStoryCardWrapper=function(n){var i=n.artifactTitleIDs,l=n.isDiffEditReviewMode,r=n.showUserStoryDiff,a=n.updateUserStoryArtifact,u=n.isUserStoryCurrentlyUpdated,d=n.artifactId,c=n.handleOpenSendDialog,f=n.handleDownloadUserStory,_=n.selectedArtifactId,g=n.isDisplayHighlightControl,y=n.elementDisplayConfig,h=n.showWrapper,m=n.actionItemsConfig,S=v.useRequirementAI(),C=S.userStory,I=S.setUserStory,j=S.customStyles,w=S.searchQueryList,b=S.currentHighlightIndex,N=S.setCurrentHighlightIndex;S.segmentComponentConfig;var B=null==j?void 0:j.userStoryCardStyles,D=0===b,U=b===w.length-1;return t.jsxs("div",e.__assign({className:o.default.userStoryCardWrapper,style:g?e.__assign(e.__assign({},null==B?void 0:B.userStoryCardWrapper),{position:"relative"}):null==B?void 0:B.userStoryCardWrapper},{children:[g&&t.jsx(t.Fragment,{children:w.length>0&&t.jsx("div",e.__assign({className:o.default.wrapper},{children:t.jsx("div",e.__assign({className:o.default.highlightNavigation},{children:t.jsxs("div",e.__assign({className:o.default.navigationContainer},{children:[t.jsxs("span",e.__assign({className:o.default.navCounter},{children:[b+1," of ",w.length]})),t.jsxs("div",e.__assign({className:o.default.navButtons},{children:[t.jsx("button",e.__assign({onClick:function(){b>0&&N(function(e){return e-1})},className:o.default.navButton,disabled:D},{children:t.jsx(s.ChevronUpIcon,{size:20,className:o.default.navIcon})})),t.jsx("button",e.__assign({onClick:function(){b<w.length-1&&N(function(e){return e+1})},className:o.default.navButton,disabled:U},{children:t.jsx(s.ChevronDownIcon,{size:20,className:o.default.navIcon})}))]}))]}))}))}))}),C.map(function(n,s){var o=p(y,!0);return t.jsx(x,{isUserStoryCurrentlyUpdated:u,artifactId:d,artifactTitleId:i[s]||"",currentUserStory:n,onUserStoryChange:function(t){I(function(n){return n[s]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:r,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:f,selectedArtifactId:_,isDisplayHighlightControl:g,elementDisplayConfig:y,_resolvedConfig:o,showWrapper:h,actionItemsConfig:m},n.artifactId)})]}))},exports.default=x,exports.replaceLearnedTagsWithInfo=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("lucide-react"),i=require("showdown"),l=require("@mui/material"),r=require("uuid"),o=require("./UserStoryCard.module.css.js"),a=require("../../utils/helpers.js"),u=require("../../utils/user-story.utils.js"),d=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),f=require("../userstory-with-citation/UserStoryWithCitation.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),_=require("../story-screen/BigEnoughPanel.js"),g=require("./TitleEditor/TitleEditor.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=y(i);function m(n){for(var i,o=[],a=/<learned>(.*?)<\/learned>/g,u=0,d=0;null!==(i=a.exec(n));){var c=i[1],f=i.index;f>u&&o.push(t.jsx("span",{children:n.slice(u,f)},"text-pre-".concat(d++))),o.push(t.jsx(l.Tooltip,e.__assign({title:c,placement:"top"},{children:t.jsx(s.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(r.v4()))),u=a.lastIndex}return u<(null==n?void 0:n.length)&&o.push(t.jsx("span",{children:n.slice(u)},"text-post-".concat(d++))),o}function p(t,n,s){var i;if(!t)return{};if(n)return e.__assign({},t.parentConfig);var l=e.__assign({},t.childConfig);return s&&(null===(i=t.subFeatureOverrides)||void 0===i?void 0:i[s])?e.__assign(e.__assign({},l),t.subFeatureOverrides[s]):l}var x=function(n){var i,l=n.displayName,r=v.useRequirementAI().customStyles,a=null===(i=null==r?void 0:r.userStoryCardStyles)||void 0===i?void 0:i.showDisplayName;return t.jsxs("div",e.__assign({className:o.default.displayName,style:null==a?void 0:a.wrapper},{children:[t.jsx(s.Bookmark,{className:o.default.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),t.jsxs("span",e.__assign({style:null==a?void 0:a.label},{children:[l,":"]}))]}))},S=function(i){var y,C,I,j,w,b,N,B=i.isUserStoryCurrentlyUpdated,D=i.artifactId,U=i.artifactTitleId,k=i.parentUserStory,E=i.currentUserStory,M=i.onUserStoryChange,A=i.parentIndex,T=i.currentIndex,q=i.enableDownload,P=i.isDiffEditReviewMode,R=i.showUserStoryDiff,L=i.handleDownloadUserStory,H=i.handleOpenSendDialog,V=i.updateUserStoryArtifact,W=i.selectedArtifactId,z=i.isDisplayHighlightControl,O=i.elementDisplayConfig,F=i._resolvedConfig,G=i.showWrapper,Q=void 0!==G&&G,Z=i.actionItemsConfig,J=i.onDelete,K=i.contextVariant,X=v.useRequirementAI(),Y=X.searchQueryList,$=X.citations,ee=X.customStyles,te=null==ee?void 0:ee.userStoryCardStyles,ne=null===(y=null==ee?void 0:ee.userStoryCardStyles)||void 0===y?void 0:y.userStoryEditStyles,se=null===(C=null==ee?void 0:ee.userStoryScreenStyles)||void 0===C?void 0:C.userStoryContentStyles,ie=null==te?void 0:te.progressHeaderStyles,le=n.useState(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""})),re=le[0],oe=le[1],ae=n.useState({userStory:!!E.isDefaultEdit}),ue=ae[0],de=ae[1],ce=n.useState(!1),fe=ce[0],ve=ce[1],_e=n.useState(null),ge=_e[0],ye=_e[1],he=v.useRequirementAI(),me=he.userStory,pe=he.customIcons,xe=n.useState(""===A||W===E.artifactId||!!E.isDefaultOpen),Se=xe[0],Ce=xe[1],Ie=n.useState(!1);Ie[0];var je=Ie[1],we=n.useState(null),be=we[0],Ne=we[1],Be=n.useState(null),De=Be[0],Ue=Be[1],ke=n.useState(!1),Ee=ke[0],Me=ke[1],Ae=n.useRef(null),Te=n.useState(!1);Te[0];var qe=Te[1],Pe=n.useRef(null);n.useEffect(function(){B&&Ce(B)},[B]),n.useEffect(function(){oe(e.__assign(e.__assign({},structuredClone(E)),{value:a.formatMarkdown(E.value)||""}))},[E]),n.useEffect(function(){Y.length>0?Ce(!0):W&&Ce(W===E.artifactId)},[Y,W,E.artifactId]);var Re=function(){Ne(null)},Le=function(){Ue(null)},He=function(){Ce(function(e){return!e})};var Ve=null!=(null==E?void 0:E.big_enough)&&!Number.isNaN(E.big_enough)&&!!(null==E?void 0:E.big_enough_decision_factors),We=""===A,ze=null!=F?F:p(O,We),Oe=!P&&!R;return n.useEffect(function(){if(ge){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(ge));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[ge]),n.useEffect(function(){E.isDefaultEdit&&de(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})},[E.isDefaultEdit]),t.jsxs("div",e.__assign({className:o.default.card,style:null==te?void 0:te.cardStyle,id:"story-card-".concat(E.title),"data-expanded":Se},{children:[t.jsxs("div",e.__assign({className:o.default.titleSection,style:null==te?void 0:te.titleSection},{children:[t.jsxs("div",e.__assign({className:o.default.titleRow,style:null==te?void 0:te.titleRow,onClick:He},{children:[t.jsxs("div",e.__assign({className:o.default.titleLeft,style:null==te?void 0:te.titleLeft,onMouseEnter:function(){return qe(!0)},onMouseLeave:function(){return qe(!1)}},{children:[t.jsx(x,{displayName:U}),fe&&Oe?t.jsx(g.InlineTitleEditor,{title:E.title,onSave:function(t){return function(t,n){return e.__awaiter(void 0,void 0,void 0,function(){var s,i;return e.__generator(this,function(l){try{s=e.__assign({},E),E.artifactId===n?s.title=t:s.sub_features=(null===(i=E.sub_features)||void 0===i?void 0:i.map(function(s){return s.artifactId===n?e.__assign(e.__assign({},s),{title:t}):s}))||[],oe(s),M(s),ve(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(t,E.artifactId)},onCancel:function(){ve(!1)},inputStyle:null==ne?void 0:ne.inlineTitleInput,confirmButtonStyle:null==ne?void 0:ne.inlineTitleConfirm,cancelButtonStyle:null==ne?void 0:ne.inlineTitleCancel},"inline-title-editor"):t.jsxs("div",e.__assign({className:o.default.storyTitleWrapper},{children:[t.jsx("h2",e.__assign({title:E.title,className:o.default.storyTitle,style:null==te?void 0:te.storyTitle},{children:m(E.title)}),E.artifactId),t.jsx("button",e.__assign({type:"button",className:o.default.titleEditButton,style:null==ne?void 0:ne.titleEditButton,onClick:function(e){e.stopPropagation(),ve(!0),Se||Ce(!0)},"aria-label":"Edit title",title:"Edit title"},{children:t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:t.jsx("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"})}))}))]}))]})),t.jsxs("div",e.__assign({className:o.default.titleActions,style:null==te?void 0:te.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(ze.showProgressPercentage||ze.showGapBox)&&Q&&t.jsxs("div",e.__assign({className:o.default.progressHeader,style:null==ie?void 0:ie.wrapper},{children:[ze.showProgressPercentage&&t.jsxs("div",e.__assign({className:o.default.progressPercentage,style:null==ie?void 0:ie.percentage},{children:[null!==(j=null!==(I=null==E?void 0:E.confidenceScore)&&void 0!==I?I:null==ze?void 0:ze.confidenceValue)&&void 0!==j?j:"0","%"]})),ze.showGapBox&&t.jsxs("div",e.__assign({className:o.default.gapBox,style:null==ie?void 0:ie.gapBox},{children:[null!==(b=null!==(w=null==E?void 0:E.gapValue)&&void 0!==w?w:null==ze?void 0:ze.gapBoxValue)&&void 0!==b?b:"2"," ","Gaps"]}))]})),Ve&&t.jsx(_.BigEnoughPanel,{customIcons:null==pe?void 0:pe.userStoryIcons,customStyles:null==te?void 0:te.aiReasoningCitaionStyles,currentUserStory:E,panelStyles:null==te?void 0:te.BigEnoughStyles}),!ue.userStory&&t.jsxs(t.Fragment,{children:[!1!==(null==ze?void 0:ze.showShareButton)&&t.jsx("button",e.__assign({className:o.default.iconButton,style:null==te?void 0:te.iconButton,onClick:function(e){Ne(e.currentTarget)}},{children:t.jsx(s.ExternalLink,{size:16})})),t.jsxs(l.Menu,e.__assign({id:"user-story-share-menu",anchorEl:be,open:!!be,onClose:function(){return Ne(null)},style:null==te?void 0:te.userStoryShareMenu},{children:[q&&t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return je(!0),L?[4,Promise.all([L("pdf"),L("doc")])]:[2];case 1:return e.sent(),je(!1),[2]}})})}},{children:t.jsxs("div",e.__assign({ref:Ae,className:o.default.menuItemContent,style:null==te?void 0:te.menuItemContent},{children:[t.jsx(s.Download,{size:16,color:null==te?void 0:te.menuIconColor}),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:"Download"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){return t=E,k&&(t=e.__assign(e.__assign({},E),{value:"".concat(u.replaceTitleSection(null==k?void 0:k.value,E.title)," \n").concat(E.value)})),null==H||H(!0,[t],E.artifactId),Re(),[2]})})}},{children:t.jsxs("div",e.__assign({style:null==te?void 0:te.menuItemContent,className:o.default.menuItemContentPadded},{children:[t.jsx(s.Share2,{size:16,color:null==te?void 0:te.menuIconColor}),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:"Send"}))]}))})),t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t,n,s,i,l;return e.__generator(this,function(e){switch(e.label){case 0:t=new h.default.Converter,n=t.makeHtml(a.formatMarkdown(E.value)||E.value),s=function(e){var t=(new h.default.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(a.formatMarkdown(E.value)||E.value),i=new ClipboardItem({"text/plain":new Blob([s],{type:"text/plain"}),"text/html":new Blob([n],{type:"text/html"})}),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,navigator.clipboard.write([i])];case 2:return e.sent(),console.log("Copied User Story"),[3,5];case 3:return l=e.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return Re(),[7];case 5:return[2]}})})}},{children:t.jsxs("div",e.__assign({style:null==te?void 0:te.menuItemContent,className:o.default.menuItemContentPadded},{children:[t.jsx(s.Copy,{size:16,color:null==te?void 0:te.menuIconColor}),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:"Copy"}))]}))}))]}))]}),ue.userStory&&Se?t.jsx(d.default,{type:"outline",children:"Cancel",style:null==te?void 0:te.cancelButton,onClick:function(){var t;null===(t=Pe.current)||void 0===t||t.abort(),de(function(t){return e.__assign(e.__assign({},t),{userStory:!1})})}}):t.jsx(t.Fragment,{}),ue.userStory&&Se?t.jsx(d.default,{type:"fill",children:Ee?t.jsxs("span",e.__assign({className:o.default.savingSpinner,style:null==te?void 0:te.savingSpinner},{children:[t.jsx(s.LoaderCircle,{className:o.default.spinAnimation,style:null==te?void 0:te.spinAnimation}),t.jsx("span",{children:"Saving..."})]})):"Save",isDisable:Ee,style:Ee?null==te?void 0:te.savingButton:null==te?void 0:te.saveButton,onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var t;return e.__generator(this,function(n){switch(n.label){case 0:return Me(!0),"userStory"==="userStory"&&(M(re),console.log("I am changing RTE editor values",re)),[4,V($,me,D,null===(t=Pe.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),M(e.__assign(e.__assign({},re),{isDefaultEdit:!1})),de(function(t){return e.__assign(e.__assign({},t),{userStory:!1})}),Me(!1),[2]}})})}}):!P&&!R&&Se&&!1!==(null==ze?void 0:ze.showEditButton)&&t.jsx("button",e.__assign({className:o.default.iconButton,style:null==te?void 0:te.editButton,onClick:function(){return de(function(t){return e.__assign(e.__assign({},t),{userStory:!0})})}},{children:t.jsx(s.PencilIcon,{color:null==te?void 0:te.pencilIconColor,size:16})})),We&&Se&&!P&&!R&&!1!==(null==ze?void 0:ze.showEditButton)&&t.jsxs("button",e.__assign({type:"button",className:o.default.addSectionButton,style:null==ne?void 0:ne.addSectionButton,onClick:function(t){var n,s,i;t.stopPropagation();var l=(null!==(s=null===(n=E.sub_features)||void 0===n?void 0:n.length)&&void 0!==s?s:0)+1,o={artifactId:r.v4(),title:"New Section ".concat(l),value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a=e.__assign(e.__assign({},E),{sub_features:e.__spreadArray(e.__spreadArray([],null!==(i=E.sub_features)&&void 0!==i?i:[],!0),[o],!1)});oe(a),M(a),Ce(!0),ye(o.title)},"aria-label":"Add section",title:"Add section"},{children:[t.jsx(s.Plus,{size:14}),t.jsx("span",e.__assign({className:o.default.addSectionLabel},{children:"Add Section"}))]})),!We&&!P&&!R&&t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),null==J||J()},className:o.default.iconButton,style:null==ne?void 0:ne.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:t.jsx(s.Trash2,{size:16})})),(null==ze?void 0:ze.actionItemsButton)&&t.jsxs(t.Fragment,{children:[t.jsx("span",e.__assign({className:o.default.actionItemBtn,style:null==te?void 0:te.actionItemBtn,onClick:function(e){e.stopPropagation(),Ue(e.currentTarget)}},{children:t.jsx(s.Ellipsis,{})})),t.jsx(l.Menu,e.__assign({id:"user-story-action-menu",anchorEl:De,open:!!De,onClose:Le,style:null==te?void 0:te.userStoryShareMenu},{children:null==Z?void 0:Z.items.map(function(n,s){return t.jsx(l.MenuItem,e.__assign({style:null==te?void 0:te.userStoryMenuItem,onClick:function(){n.onclick(),Le()}},{children:t.jsxs("div",e.__assign({className:o.default.menuItemContent,style:e.__assign(e.__assign({},null==te?void 0:te.menuItemContent),!n.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[t.jsx("span",e.__assign({className:o.default.menuItemIcon,style:null==te?void 0:te.menuItemIcon},{children:n.icon})),t.jsx("p",e.__assign({style:null==te?void 0:te.menuLabel},{children:n.name})),t.jsx("span",{className:o.default.menuItemRight,style:null==te?void 0:te.menuItemRight})]}))}),"action-item-".concat(s,"-").concat(n.name))})}))]}),t.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),He()},style:null==te?void 0:te.chevronButton,className:o.default.chevronButton},{children:Se?t.jsx(s.ChevronUp,{className:o.default.chevronIcon,color:null==te?void 0:te.chevronIconColor}):t.jsx(s.ChevronDown,{className:o.default.chevronIcon,color:null==te?void 0:te.chevronIconColor})}))]}))]})),t.jsx("div",{className:o.default.divider,style:null==te?void 0:te.dividerStyle})]})),Se&&t.jsx("div",e.__assign({className:o.default.cardContent,style:null==te?void 0:te.cardContentStyle},{children:t.jsxs("div",e.__assign({className:o.default.contentInner,style:null==te?void 0:te.contentInner},{children:[t.jsxs("div",e.__assign({className:o.default.descriptionSection,style:null==te?void 0:te.descriptionSection},{children:[t.jsx("div",{className:o.default.justifyBetween,style:null==te?void 0:te.justifyBetween}),ue.userStory?t.jsx(c.default,{minHeight:"100%",height:"100%",type:"string",value:a.formatMarkdown(E.value)||"",handleUpdateState:function(t,n){var s=a.indentMarkdown(n);oe(function(t){return e.__assign(e.__assign({},t),{value:s||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:ue.userStory?"edit":"readOnly"}):t.jsx(f.default,{showUserStoryDiff:R,isParent:""===A,message:a.formatMarkdown(E.value)||"",artifactId:E.artifactId,customStyles:se,isDisplayHighlightControl:z,contextVariant:K})]})),null===(N=re.sub_features)||void 0===N?void 0:N.map(function(n,s){var i=p(O,!1,n.artifactId);return t.jsx(S,{artifactId:D,isUserStoryCurrentlyUpdated:B,artifactTitleId:"".concat(U,"-").concat(String.fromCharCode(65+s)),parentUserStory:E,parentIndex:"".concat(A).concat(A&&".").concat(T),currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(t){return function(t,n){var s=e.__spreadArray([],E.sub_features||[],!0);s[t]=n,M(e.__assign(e.__assign({},E),{sub_features:s}))}(s,t)},enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:V,handleDownloadUserStory:L,handleOpenSendDialog:H,isDisplayHighlightControl:z,elementDisplayConfig:O,_resolvedConfig:i,actionItemsConfig:Z,onDelete:function(){return function(t){var n=(E.sub_features||[]).filter(function(e,n){return n!==t}),s=e.__assign(e.__assign({},E),{sub_features:n});oe(s),M(s)}(s)}},n.artifactId)})]}))}))]}))};exports.StoryCard=S,exports.UserStoryCardWrapper=function(n){var i=n.artifactTitleIDs,l=n.isDiffEditReviewMode,r=n.showUserStoryDiff,a=n.updateUserStoryArtifact,u=n.isUserStoryCurrentlyUpdated,d=n.artifactId,c=n.handleOpenSendDialog,f=n.handleDownloadUserStory,_=n.selectedArtifactId,g=n.isDisplayHighlightControl,y=n.elementDisplayConfig,h=n.showWrapper,m=n.actionItemsConfig,x=n.contextVariant,C=v.useRequirementAI(),I=C.userStory,j=C.setUserStory,w=C.customStyles,b=C.searchQueryList,N=C.currentHighlightIndex,B=C.setCurrentHighlightIndex;C.segmentComponentConfig;var D=null==w?void 0:w.userStoryCardStyles,U=0===N,k=N===b.length-1;return t.jsxs("div",e.__assign({className:o.default.userStoryCardWrapper,style:g?e.__assign(e.__assign({},null==D?void 0:D.userStoryCardWrapper),{position:"relative"}):null==D?void 0:D.userStoryCardWrapper},{children:[g&&t.jsx(t.Fragment,{children:b.length>0&&t.jsx("div",e.__assign({className:o.default.wrapper},{children:t.jsx("div",e.__assign({className:o.default.highlightNavigation},{children:t.jsxs("div",e.__assign({className:o.default.navigationContainer},{children:[t.jsxs("span",e.__assign({className:o.default.navCounter},{children:[N+1," of ",b.length]})),t.jsxs("div",e.__assign({className:o.default.navButtons},{children:[t.jsx("button",e.__assign({onClick:function(){N>0&&B(function(e){return e-1})},className:o.default.navButton,disabled:U},{children:t.jsx(s.ChevronUpIcon,{size:20,className:o.default.navIcon})})),t.jsx("button",e.__assign({onClick:function(){N<b.length-1&&B(function(e){return e+1})},className:o.default.navButton,disabled:k},{children:t.jsx(s.ChevronDownIcon,{size:20,className:o.default.navIcon})}))]}))]}))}))}))}),I.map(function(n,s){var o=p(y,!0);return t.jsx(S,{isUserStoryCurrentlyUpdated:u,artifactId:d,artifactTitleId:i[s]||"",currentUserStory:n,onUserStoryChange:function(t){j(function(n){return n[s]=t,e.__spreadArray([],n,!0)})},parentIndex:"",currentIndex:"".concat(s+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:l,showUserStoryDiff:r,updateUserStoryArtifact:a,handleOpenSendDialog:c,handleDownloadUserStory:f,selectedArtifactId:_,isDisplayHighlightControl:g,elementDisplayConfig:y,_resolvedConfig:o,showWrapper:h,actionItemsConfig:m,contextVariant:x},n.artifactId)})]}))},exports.default=S,exports.replaceLearnedTagsWithInfo=m;
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("./AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js"),o=require("../../../CitationRenderer/CitationRenderer.js"),s=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"18 15 12 9 6 15"})}))},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("./AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js"),o=require("../../../CitationRenderer/CitationRenderer.js"),s=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"18 15 12 9 6 15"})}))},l=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"6 9 12 15 18 9"})}))};exports.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING=75,exports.default=function(r){var a=r.isSourceHasHighlight,c=r.aiReason,d=r.citationTitle,u=void 0===d?"":d,p=r.customStyles,f=r.customIcons,g=r.onSelectProceed,x=r.isDisableProceedButton,h=r.inlineLabel,v=r.isInlineCitation,m=(c.relevance_score>=75?null==f?void 0:f.highConfidence:null==f?void 0:f.lowConfidence)||i.jsx(t.default,{});return i.jsx("span",{children:i.jsx(o.default,{inLineCitation:!0,citationId:"ai-reasoning-".concat(c.id),citationTitle:v?h||"":u||"",citationIcon:v?null:m,defaultExpanded:(null==c?void 0:c.isOpen)||a||!1,citationComponent:i.jsx(n.default,{aiReason:c,customStyles:p,customIcons:f,onSelectProceed:g,isDisableProceedButton:x}),chevronDownComponent:v?null:i.jsx(l,{}),chevronUpComponent:v?null:i.jsx(s,{}),styles:{pillButton:e.__assign({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==p?void 0:p.aiReasoningPill),citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})})};
|
|
2
2
|
//# sourceMappingURL=AiReasoningCitation.js.map
|
package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),l=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),v=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=R(i),w=R(t),b=R(o),N=R(s),k=i.createContext(!1),A=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),q=i.createContext({rowId:""}),E=function(t){var o,r=t.aiReason,l=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(A),u=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,h=i.useContext(q).rowId,m=String(r.id);h&&g.current.set(m,h);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===r.id,_=l?(null==s?void 0:s.highConfidence)||n.jsx(f.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(p.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:h,C?null:r)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(l?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(l?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},M=function(t){var o,r,l=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(A).expandedInfo,g=(null==v?void 0:v.rowId)===u,f=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,p=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return n.jsxs(q.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:p?{cssText:p}:void 0},{children:l})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:v.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var U=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,U,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,s=t.message,f=t.noMarkdownContent,p=t.useMarkdown,x=void 0===p||p,R=t.isParent,q=t.scenario,U=t.showUserStoryDiff,L=void 0!==U&&U,P=t.aiReasoningsForBlock,$=t.isCitationLoadingDisplay,D=void 0!==$&&$,H=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var O=t.customStyles,F=t.customIcons,z=t.aiReasoningDiffView,B=t.userStoryCitations,W=t.artifactId,V=t.isCraflow,G=t.onCraAccept,Q=t.onCraReject,J=t.craFlowConfig,K=t.isDisplayHighlightControl,X=void 0!==K&&K,Y=i.useRef(null),Z=g.useRequirementAI(),ee=Z.userStory,ne=Z.inlineUpdateComponentConfig,ie=Z.getAvgScoreForStory,te=Z.setUserStory,oe=Z.aiReasoning,ae=Z.setAiReasoning,re=Z.customIcons,le=Z.searchQueryList,de=Z.searchQueryReasoningIdList,se=Z.currentHighlightIndex,ce=Z.segmentComponentConfig,ue=null!=F?F:null==re?void 0:re.userStoryIcons;null==O||O.searchHighlight;var ve=r.useMarkdownSearch(Y),ge=ve.search,fe=ve.clear,pe=i.useState("1"),he=pe[0],me=pe[1],Ce=i.useState(null),_e=Ce[0],xe=Ce[1],je=i.useRef(new Map),ye=i.useCallback(function(e,n){xe(e&&n?{rowId:e,aiReason:n}:null)},[]),Se=W?ie(W):0,Re=i.useState([]),Ie=Re[0],we=Re[1],be=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(be).join(""):I.default.isValidElement(e)?be(e.props.children):""},Ne=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],r=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),l=a.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==r?void 0:r[1])||""),changedItemCount:d((null==l?void 0:l[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,r=s.substring(0,n.index).split("\n").reverse();a<r.length;a++){var l=r[a].trim();if(""!==l){/^\d+\.\s/.test(l)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var r=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),r=a.lastIndexOf("\n"),l=/^\s+[-*]\s/.test(a.substring(r+1))||/^\s+\d+\.\s/.test(a.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(r+1));if(l||d){var s=t;return s=(s=(s=(s=s.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(s,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},ke=i.useMemo(function(){return s?Ne(s):s},[s]);i.useEffect(function(){we(P||oe)},[P,oe]);var Ae=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),r=null==a?void 0:a.id,l=r?null===(t=r.split("$"))||void 0===t?void 0:t[1]:null,d=oe.find(function(e){return e.id.toString()===l});return d?n.jsx(j.default,e.__assign({aiReason:d,customStyles:null==O?void 0:O.inlineUpdatedComponent,handleClickCognitiveDecision:null==ne?void 0:ne.handleClickCognitiveDecision,handleClickUpdatedPill:null==ne?void 0:ne.handleClickUpdatedPill,handleClickOutputValue:null==ne?void 0:ne.handleClickOutputValue,customIcons:null==ne?void 0:ne.customIcons},{children:o})):o},del:function(i){var t,o,r,l;i.node;var d=i.children,s=e.__rest(i,["node","children"]),c=s.aireason,u=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(o=c.deviation_details)||void 0===o?void 0:o.resolved)||"reverted"===(null===(r=c.deviation_details)||void 0===r?void 0:r.resolved));return n.jsx("span",e.__assign({className:a.default.deleted,style:e.__assign(e.__assign({},null!==(l=null==O?void 0:O.deleted)&&void 0!==l?l:{}),{textDecoration:u?"none":"line-through"})},s,{onClick:s.onclick},{children:d}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==O?void 0:O.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.preserved,style:null==O?void 0:O.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==O?void 0:O.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==O?void 0:O.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==O?void 0:O.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==O?void 0:O.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==O?void 0:O.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:L,currentUpdatedTagId:he,setCurrentUpdatedTagId:me,userStory:ee,setUserStory:te,setAiReasoning:ae,node:t,isCraflow:V,onCraAccept:G,onCraReject:Q,customStyles:null==O?void 0:O.updatedContent,craFlowConfig:J}))},ol:function(i){var t,o,r,l=i.node,d=e.__rest(i,["node"]),s=null!==(r=null!==(o=null===(t=null==l?void 0:l.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==r?r:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==O?void 0:O.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==O?void 0:O.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==O?void 0:O.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(M,{node:i,children:t,customStyles:O})},td:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(C.default,e.__assign({},o,{customStyles:null==O?void 0:O.recommendationBlock,label:a}))},a:function(t){var o,a,r;t.inline;var l=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(k)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],v=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){var g=(null!==(r=L?z:oe)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(v)}),f=de.includes(v);if(g){if(s)return n.jsx(E,{aiReason:g,customStyle:null==O?void 0:O.tableAiReasoning,customIcons:ue,isHighConfidence:g.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var p="source"!==I.default.Children.toArray(l).join("").trim().toLowerCase();return n.jsx(h.default,{aiReason:g,isSourceHasHighlight:f,inlineLabel:l,isInlineCitation:p,customIcons:ue,customStyles:{aiReasoningContent:null==O?void 0:O.aiReasoningContent,aiReasoningAccordion:null==O?void 0:O.aiReasoningAccordion,aiReasoningMarkdown:null==O?void 0:O.aiReasoningMarkdown,aiReasoningPill:null==O?void 0:O.aiReasoningPill,webCitation:null==O?void 0:O.webCitation,stormeeCitation:null==O?void 0:O.stormeeCitation,waveformCitation:null==O?void 0:O.waveformCitation,imageCitation:null==O?void 0:O.imageCitation,fileCitation:null==O?void 0:O.fileCitation,appModCitation:null==O?void 0:O.appModCitation,rcaCitation:null==O?void 0:O.rcaCitation,readFileCitation:null==O?void 0:O.readFileCitation,loadingCitations:null==O?void 0:O.loadingCitations,chatCitation:null==O?void 0:O.chatCitation,bigEnoughCitation:null==O?void 0:O.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==O?void 0:O.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==O?void 0:O.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(l.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(u.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==O?void 0:O.generatedCodePill,content:null==O?void 0:O.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,r,l=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=l.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=l.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=l.position)||void 0===a?void 0:a.end.line,"-").concat(null===(r=l.position)||void 0===r?void 0:r.end.column),u=function(e){if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}}(s),v=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:N.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(y.default,{id:c,node:l,children:v,props:s,segmentComponentConfig:ce,customStyles:O,customIcons:F,extractText:be,isUpdatedSegment:!0})},segment:function(i){var t,o,a,r,l=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=l.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=l.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=l.position)||void 0===a?void 0:a.end.line,"-").concat(null===(r=l.position)||void 0===r?void 0:r.end.column);return n.jsx(y.default,{id:c,node:l,children:d,props:s,segmentComponentConfig:ce,customStyles:O,customIcons:F,extractText:be})}}},[Ie,J,oe,B,he,L,s,F,le,de,O,ce]);return console.log("normalized markdown ",ke),i.useEffect(function(){if(Y.current){if(le.length){var e;if(0===de.length||X)requestAnimationFrame(function(){ge([le[se].replace(/\*/g,"")])});else{var n=Y.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){ge([le[se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}fe()}},[le,de,se,X]),n.jsx(A.Provider,e.__assign({value:{expandedInfo:_e,setExpanded:ye,reasonToRow:je}},{children:n.jsxs("div",e.__assign({ref:Y,className:"".concat(a.default.container," ").concat("approving"!==q?a.default.wrapper:""," ").concat(H||""),style:null==O?void 0:O.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(w.default,e.__assign({components:Ae,rehypePlugins:[b.default]},{children:ke}))}):f,Se>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==O?void 0:O.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==O?void 0:O.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==O?void 0:O.confidenceScoreIconColor)||"#166534"}),Se,"%"]}))})),D&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==O?void 0:O.citationLoaderContainer},{children:n.jsx(v.default,{customStyles:{container:null==O?void 0:O.citationLoadingContainer,icon:null==O?void 0:O.citationLoadingIcon,text:null==O?void 0:O.citationLoadingText}})})),R&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==O?void 0:O.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==O?void 0:O.attachedContext})}))]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),l=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),v=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=R(i),w=R(t),b=R(o),N=R(s),k=i.createContext(!1),A=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),q=i.createContext({rowId:""}),E=function(t){var o,r=t.aiReason,l=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(A),u=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,h=i.useContext(q).rowId,m=String(r.id);h&&g.current.set(m,h);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===r.id,_=l?(null==s?void 0:s.highConfidence)||n.jsx(f.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(p.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:h,C?null:r)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(l?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(l?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},M=function(t){var o,r,l=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(A).expandedInfo,g=(null==v?void 0:v.rowId)===u,f=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,p=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return n.jsxs(q.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:p?{cssText:p}:void 0},{children:l})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:v.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var U=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,U,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,s=t.message,f=t.noMarkdownContent,p=t.useMarkdown,x=void 0===p||p,R=t.isParent,q=t.scenario,U=t.showUserStoryDiff,L=void 0!==U&&U,P=t.aiReasoningsForBlock,$=t.isCitationLoadingDisplay,D=void 0!==$&&$,H=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var O=t.customStyles,F=t.customIcons,z=t.contextVariant,B=t.aiReasoningDiffView,W=t.userStoryCitations,V=t.artifactId,G=t.isCraflow,Q=t.onCraAccept,J=t.onCraReject,K=t.craFlowConfig,X=t.isDisplayHighlightControl,Y=void 0!==X&&X,Z=i.useRef(null),ee=g.useRequirementAI(),ne=ee.userStory,ie=ee.inlineUpdateComponentConfig,te=ee.getAvgScoreForStory,oe=ee.setUserStory,ae=ee.aiReasoning,re=ee.setAiReasoning,le=ee.customIcons,de=ee.searchQueryList,se=ee.searchQueryReasoningIdList,ce=ee.currentHighlightIndex,ue=ee.segmentComponentConfig,ve=null!=F?F:null==le?void 0:le.userStoryIcons;null==O||O.searchHighlight;var ge=r.useMarkdownSearch(Z),fe=ge.search,pe=ge.clear,he=i.useState("1"),me=he[0],Ce=he[1],_e=i.useState(null),xe=_e[0],je=_e[1],ye=i.useRef(new Map),Se=i.useCallback(function(e,n){je(e&&n?{rowId:e,aiReason:n}:null)},[]),Re=V?te(V):0,Ie=i.useState([]),we=Ie[0],be=Ie[1],Ne=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Ne).join(""):I.default.isValidElement(e)?Ne(e.props.children):""},ke=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],r=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),l=a.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==r?void 0:r[1])||""),changedItemCount:d((null==l?void 0:l[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,r=s.substring(0,n.index).split("\n").reverse();a<r.length;a++){var l=r[a].trim();if(""!==l){/^\d+\.\s/.test(l)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var r=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),r=a.lastIndexOf("\n"),l=/^\s+[-*]\s/.test(a.substring(r+1))||/^\s+\d+\.\s/.test(a.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(r+1));if(l||d){var s=t;return s=(s=(s=(s=s.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(s,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},Ae=i.useMemo(function(){return s?ke(s):s},[s]);i.useEffect(function(){be(P||ae)},[P,ae]);var qe=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),r=null==a?void 0:a.id,l=r?null===(t=r.split("$"))||void 0===t?void 0:t[1]:null,d=ae.find(function(e){return e.id.toString()===l});return d?n.jsx(j.default,e.__assign({aiReason:d,customStyles:null==O?void 0:O.inlineUpdatedComponent,handleClickCognitiveDecision:null==ie?void 0:ie.handleClickCognitiveDecision,handleClickUpdatedPill:null==ie?void 0:ie.handleClickUpdatedPill,handleClickOutputValue:null==ie?void 0:ie.handleClickOutputValue,customIcons:null==ie?void 0:ie.customIcons},{children:o})):o},del:function(i){var t,o,r,l;i.node;var d=i.children,s=e.__rest(i,["node","children"]),c=s.aireason,u=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(o=c.deviation_details)||void 0===o?void 0:o.resolved)||"reverted"===(null===(r=c.deviation_details)||void 0===r?void 0:r.resolved));return n.jsx("span",e.__assign({className:a.default.deleted,style:e.__assign(e.__assign({},null!==(l=null==O?void 0:O.deleted)&&void 0!==l?l:{}),{textDecoration:u?"none":"line-through"})},s,{onClick:s.onclick},{children:d}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==O?void 0:O.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.preserved,style:null==O?void 0:O.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==O?void 0:O.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==O?void 0:O.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==O?void 0:O.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==O?void 0:O.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==O?void 0:O.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:L,currentUpdatedTagId:me,setCurrentUpdatedTagId:Ce,userStory:ne,setUserStory:oe,setAiReasoning:re,node:t,isCraflow:G,onCraAccept:Q,onCraReject:J,customStyles:null==O?void 0:O.updatedContent,craFlowConfig:K}))},ol:function(i){var t,o,r,l=i.node,d=e.__rest(i,["node"]),s=null!==(r=null!==(o=null===(t=null==l?void 0:l.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==r?r:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==O?void 0:O.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==O?void 0:O.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==O?void 0:O.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(M,{node:i,children:t,customStyles:O})},td:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(C.default,e.__assign({},o,{customStyles:null==O?void 0:O.recommendationBlock,label:a}))},a:function(t){var o,a,r;t.inline;var l=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(k)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],v=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){var g=(null!==(r=L?B:ae)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(v)}),f=se.includes(v);if(g){if(s)return n.jsx(E,{aiReason:g,customStyle:null==O?void 0:O.tableAiReasoning,customIcons:ve,isHighConfidence:g.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var p="source"!==I.default.Children.toArray(l).join("").trim().toLowerCase();return n.jsx(h.default,{aiReason:g,isSourceHasHighlight:f,inlineLabel:l,isInlineCitation:p,customIcons:ve,customStyles:{aiReasoningContent:null==O?void 0:O.aiReasoningContent,aiReasoningAccordion:null==O?void 0:O.aiReasoningAccordion,aiReasoningMarkdown:null==O?void 0:O.aiReasoningMarkdown,aiReasoningPill:null==O?void 0:O.aiReasoningPill,webCitation:null==O?void 0:O.webCitation,stormeeCitation:null==O?void 0:O.stormeeCitation,waveformCitation:null==O?void 0:O.waveformCitation,imageCitation:null==O?void 0:O.imageCitation,fileCitation:null==O?void 0:O.fileCitation,appModCitation:null==O?void 0:O.appModCitation,rcaCitation:null==O?void 0:O.rcaCitation,readFileCitation:null==O?void 0:O.readFileCitation,loadingCitations:null==O?void 0:O.loadingCitations,chatCitation:null==O?void 0:O.chatCitation,bigEnoughCitation:null==O?void 0:O.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==O?void 0:O.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==O?void 0:O.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(l.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(u.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==O?void 0:O.generatedCodePill,content:null==O?void 0:O.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,r,l=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=l.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=l.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=l.position)||void 0===a?void 0:a.end.line,"-").concat(null===(r=l.position)||void 0===r?void 0:r.end.column),u=function(e){if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}}(s),v=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:N.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(y.default,{id:c,node:l,children:v,props:s,segmentComponentConfig:ue,customStyles:O,customIcons:F,extractText:Ne,isUpdatedSegment:!0})},segment:function(i){var t,o,a,r,l=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=l.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=l.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=l.position)||void 0===a?void 0:a.end.line,"-").concat(null===(r=l.position)||void 0===r?void 0:r.end.column);return n.jsx(y.default,{id:c,node:l,children:d,props:s,segmentComponentConfig:ue,customStyles:O,customIcons:F,extractText:Ne})}}},[we,K,ae,W,me,L,s,F,de,se,O,ue]);return console.log("normalized markdown ",Ae),i.useEffect(function(){if(Z.current){if(de.length){var e;if(0===se.length||Y)requestAnimationFrame(function(){fe([de[ce].replace(/\*/g,"")])});else{var n=Z.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){fe([de[ce].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}pe()}},[de,se,ce,Y]),n.jsx(A.Provider,e.__assign({value:{expandedInfo:xe,setExpanded:Se,reasonToRow:ye}},{children:n.jsxs("div",e.__assign({ref:Z,className:"".concat(a.default.container," ").concat("approving"!==q?a.default.wrapper:""," ").concat(H||""),style:null==O?void 0:O.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(w.default,e.__assign({components:qe,rehypePlugins:[b.default]},{children:Ae}))}):f,Re>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==O?void 0:O.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==O?void 0:O.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==O?void 0:O.confidenceScoreIconColor)||"#166534"}),Re,"%"]}))})),D&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==O?void 0:O.citationLoaderContainer},{children:n.jsx(v.default,{customStyles:{container:null==O?void 0:O.citationLoadingContainer,icon:null==O?void 0:O.citationLoadingIcon,text:null==O?void 0:O.citationLoadingText}})})),R&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==O?void 0:O.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==O?void 0:O.attachedContext,variant:z})}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -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 S from"./AttachedContext.module.css.js";var I=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})},j=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}},k=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=j(n,function(e){h(e),u(!0)}),g=v.handleRedirect,f=v.isPending,C=v.signedUrl;return r("div",e({className:"".concat(S.contextItem," ").concat(o?S.lastItem:""),style:null==s?void 0:s.contextItem},{children:[i("div",e({className:S.itemIconWrapper,style:null==s?void 0:s.iconWrapper},{children:z(n.extension,n.title.toUpperCase())||l(n.extension)})),r("div",e({className:S.itemContent,style:null==s?void 0:s.itemContent},{children:[i("h3",e({className:S.itemTitle,style:null==s?void 0:s.title},{children:n.title})),i("p",e({className:S.itemMeta,style:null==s?void 0:s.metadata},{children:n.metadata}))]})),i("div",e({onClick:g,className:"".concat(S.actionButton," ").concat(C?S.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=j(n,function(e){m(e),c(!0)}),h=p.handleRedirect,v=p.isPending;return r(o,{children:[r("span",e({className:S.sourceChip,onClick:h},{children:[i("span",e({className:S.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:S.sourcesContainer},{children:[i("span",e({className:S.sourcesLabel},{children:"Sources :"})),i("div",e({className:l?S.sourcesScrollContainer:S.sourcesInlineContainer},{children:c.map(function(e){return i(U,{item:e},e.id)})})),!l&&n.length>2&&r("span",e({className:S.moreChip,onClick:function(){return s(!0)}},{children:["+",n.length-2]})),l&&n.length>2&&i("span",e({className:S.moreChip,onClick:function(){return s(!1)}},{children:"Show 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:S.wrapper,style:null==n?void 0:n.wrapperComponent},{children:r("div",e({className:S.dropdownContainer,style:null==n?void 0:n.dropdownContainer,ref:f},{children:[r("button",e({onClick:function(e){e.stopPropagation(),g(!v)},className:S.triggerButton,style:null==n?void 0:n.triggerButton},{children:[i(d,{size:18,className:S.triggerIcon,style:null==n?void 0:n.triggerIcon}),r("span",e({className:S.triggerLabel,style:null==n?void 0:n.triggerLabel},{children:["Attached Context(",w.length,")"]})),i(v?u:m,{size:18})]})),v&&r("div",e({className:S.dropdownPanel,style:null==n?void 0:n.dropdownPanel},{children:[i("div",e({className:S.dropdownList,style:null==n?void 0:n.dropdownList},{children:w.length>0?w.map(function(e,t){return i(k,{item:e,isLast:t===w.length-1,getIconByExtension:I,customStyles:null==n?void 0:n.contextItem},e.id)}):i("div",e({className:S.emptyState},{children:"No attachments found"}))})),w.length>4&&i("div",{className:S.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",sourcesInlineContainer:"AttachedContext-module_sourcesInlineContainer__DR4d8",sourcesScrollContainer:"AttachedContext-module_sourcesScrollContainer__FmVI2",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,.AttachedContext-module_sourcesInlineContainer__DR4d8{align-items:center;display:flex;gap:8px;min-width:0}.AttachedContext-module_sourcesScrollContainer__FmVI2{-ms-overflow-style:none;align-items:center;display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;scroll-behavior:smooth;scrollbar-width:none}.AttachedContext-module_sourcesScrollContainer__FmVI2::-webkit-scrollbar{display:none}.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:0;font-size:13px;font-weight:500;gap:6px;line-height:18px;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;white-space:nowrap}.AttachedContext-module_moreChip__ieXRs{align-items:center;background:#eef2ff;border-radius:10px;color:#6366f1;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,__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 b,Bookmark as N}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 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 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(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 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: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,":"]}))]}))},O=function(I){var w,b,N,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=R(),pe=he.searchQueryList,Se=he.citations,ge=he.customStyles,Ce=null==ge?void 0:ge.userStoryCardStyles,Ie=null===(w=null==ge?void 0:ge.userStoryCardStyles)||void 0===w?void 0:w.userStoryEditStyles,we=null===(b=null==ge?void 0:ge.userStoryScreenStyles)||void 0===b?void 0:b.userStoryContentStyles,be=null==Ce?void 0:Ce.progressHeaderStyles,Ne=a(e(e({},structuredClone(X)),{value:T(X.value)||""})),Be=Ne[0],De=Ne[1],xe=a({userStory:!!X.isDefaultEdit}),Ue=xe[0],Ee=xe[1],ke=a(!1),Te=ke[0],Ae=ke[1],Me=a(null),_e=Me[0],Pe=Me[1],He=R(),Re=He.userStory,je=He.customIcons,Le=a(""===$||ae===X.artifactId||!!X.isDefaultOpen),Ve=Le[0],ze=Le[1],We=a(!1);We[0];var Oe=We[1],Fe=a(null),Ge=Fe[0],qe=Fe[1],Qe=a(null),Ze=Qe[0],Je=Qe[1],Ke=a(!1),Xe=Ke[0],Ye=Ke[1],$e=s(null),et=a(!1);et[0];var tt=et[1],nt=s(null);u(function(){Q&&ze(Q)},[Q]),u(function(){De(e(e({},structuredClone(X)),{value:T(X.value)||""}))},[X]),u(function(){pe.length>0?ze(!0):ae&&ze(ae===X.artifactId)},[pe,ae,X.artifactId]);var ot=function(){qe(null)},it=function(){Je(null)},lt=function(){ze(function(e){return!e})};var rt=null!=(null==X?void 0:X.big_enough)&&!Number.isNaN(X.big_enough)&&!!(null==X?void 0:X.big_enough_decision_factors),at=""===$,st=null!=ce?ce:z(ue,at),ut=!ne&&!oe;return u(function(){if(_e){var e=setTimeout(function(){var e=document.getElementById("story-card-".concat(_e));null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return function(){return clearTimeout(e)}}},[_e]),u(function(){X.isDefaultEdit&&Ee(function(t){return e(e({},t),{userStory:!0})})},[X.isDefaultEdit]),i("div",e({className:k.card,style:null==Ce?void 0:Ce.cardStyle,id:"story-card-".concat(X.title),"data-expanded":Ve},{children:[i("div",e({className:k.titleSection,style:null==Ce?void 0:Ce.titleSection},{children:[i("div",e({className:k.titleRow,style:null==Ce?void 0:Ce.titleRow,onClick:lt},{children:[i("div",e({className:k.titleLeft,style:null==Ce?void 0:Ce.titleLeft,onMouseEnter:function(){return tt(!0)},onMouseLeave:function(){return tt(!1)}},{children:[l(W,{displayName:J}),Te&&ut?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}))||[],De(t),Y(t),Ae(!1)}catch(e){console.error("Failed to save title",e)}return[2]})})}(o,X.artifactId)},onCancel:function(){Ae(!1)},inputStyle:null==Ie?void 0:Ie.inlineTitleInput,confirmButtonStyle:null==Ie?void 0:Ie.inlineTitleConfirm,cancelButtonStyle:null==Ie?void 0:Ie.inlineTitleCancel},"inline-title-editor"):i("div",e({className:k.storyTitleWrapper},{children:[l("h2",e({title:X.title,className:k.storyTitle,style:null==Ce?void 0:Ce.storyTitle},{children:V(X.title)}),X.artifactId),l("button",e({type:"button",className:k.titleEditButton,style:null==Ie?void 0:Ie.titleEditButton,onClick:function(e){e.stopPropagation(),Ae(!0),Ve||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==Ce?void 0:Ce.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(st.showProgressPercentage||st.showGapBox)&&ve&&i("div",e({className:k.progressHeader,style:null==be?void 0:be.wrapper},{children:[st.showProgressPercentage&&i("div",e({className:k.progressPercentage,style:null==be?void 0:be.percentage},{children:[null!==(U=null!==(N=null==X?void 0:X.confidenceScore)&&void 0!==N?N:null==st?void 0:st.confidenceValue)&&void 0!==U?U:"0","%"]})),st.showGapBox&&i("div",e({className:k.gapBox,style:null==be?void 0:be.gapBox},{children:[null!==(G=null!==(F=null==X?void 0:X.gapValue)&&void 0!==F?F:null==st?void 0:st.gapBoxValue)&&void 0!==G?G:"2"," ","Gaps"]}))]})),rt&&l(j,{customIcons:null==je?void 0:je.userStoryIcons,customStyles:null==Ce?void 0:Ce.aiReasoningCitaionStyles,currentUserStory:X,panelStyles:null==Ce?void 0:Ce.BigEnoughStyles}),!Ue.userStory&&i(r,{children:[!1!==(null==st?void 0:st.showShareButton)&&l("button",e({className:k.iconButton,style:null==Ce?void 0:Ce.iconButton,onClick:function(e){qe(e.currentTarget)}},{children:l(c,{size:16})})),i(D,e({id:"user-story-share-menu",anchorEl:Ge,open:!!Ge,onClose:function(){return qe(null)},style:null==Ce?void 0:Ce.userStoryShareMenu},{children:[te&&l(x,e({style:null==Ce?void 0:Ce.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:$e,className:k.menuItemContent,style:null==Ce?void 0:Ce.menuItemContent},{children:[l(d,{size:16,color:null==Ce?void 0:Ce.menuIconColor}),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:"Download"}))]}))})),l(x,e({style:null==Ce?void 0:Ce.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),ot(),[2]})})}},{children:i("div",e({style:null==Ce?void 0:Ce.menuItemContent,className:k.menuItemContentPadded},{children:[l(v,{size:16,color:null==Ce?void 0:Ce.menuIconColor}),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:"Send"}))]}))})),l(x,e({style:null==Ce?void 0:Ce.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 ot(),[7];case 5:return[2]}})})}},{children:i("div",e({style:null==Ce?void 0:Ce.menuItemContent,className:k.menuItemContentPadded},{children:[l(f,{size:16,color:null==Ce?void 0:Ce.menuIconColor}),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:"Copy"}))]}))}))]}))]}),Ue.userStory&&Ve?l(_,{type:"outline",children:"Cancel",style:null==Ce?void 0:Ce.cancelButton,onClick:function(){var t;null===(t=nt.current)||void 0===t||t.abort(),Ee(function(t){return e(e({},t),{userStory:!1})})}}):l(r,{}),Ue.userStory&&Ve?l(_,{type:"fill",children:Xe?i("span",e({className:k.savingSpinner,style:null==Ce?void 0:Ce.savingSpinner},{children:[l(m,{className:k.spinAnimation,style:null==Ce?void 0:Ce.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:Xe,style:Xe?null==Ce?void 0:Ce.savingButton:null==Ce?void 0:Ce.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 Ye(!0),"userStory"==="userStory"&&(Y(Be),console.log("I am changing RTE editor values",Be)),[4,re(Se,Re,Z,null===(t=nt.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),Y(e(e({},Be),{isDefaultEdit:!1})),Ee(function(t){return e(e({},t),{userStory:!1})}),Ye(!1),[2]}})})}}):!ne&&!oe&&Ve&&!1!==(null==st?void 0:st.showEditButton)&&l("button",e({className:k.iconButton,style:null==Ce?void 0:Ce.editButton,onClick:function(){return Ee(function(t){return e(e({},t),{userStory:!0})})}},{children:l(y,{color:null==Ce?void 0:Ce.pencilIconColor,size:16})})),at&&Ve&&!ne&&!oe&&!1!==(null==st?void 0:st.showEditButton)&&i("button",e({type:"button",className:k.addSectionButton,style:null==Ie?void 0:Ie.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)});De(s),Y(s),ze(!0),Pe(a.title)},"aria-label":"Add section",title:"Add section"},{children:[l(h,{size:14}),l("span",e({className:k.addSectionLabel},{children:"Add Section"}))]})),!at&&!ne&&!oe&&l("button",e({type:"button",onClick:function(e){e.stopPropagation(),null==me||me()},className:k.iconButton,style:null==Ie?void 0:Ie.deleteButton,"aria-label":"Delete section",title:"Delete section"},{children:l(p,{size:16})})),(null==st?void 0:st.actionItemsButton)&&i(r,{children:[l("span",e({className:k.actionItemBtn,style:null==Ce?void 0:Ce.actionItemBtn,onClick:function(e){e.stopPropagation(),Je(e.currentTarget)}},{children:l(S,{})})),l(D,e({id:"user-story-action-menu",anchorEl:Ze,open:!!Ze,onClose:it,style:null==Ce?void 0:Ce.userStoryShareMenu},{children:null==fe?void 0:fe.items.map(function(t,n){return l(x,e({style:null==Ce?void 0:Ce.userStoryMenuItem,onClick:function(){t.onclick(),it()}},{children:i("div",e({className:k.menuItemContent,style:e(e({},null==Ce?void 0:Ce.menuItemContent),!t.isActive&&{cursor:"not-allowed",opacity:.5})},{children:[l("span",e({className:k.menuItemIcon,style:null==Ce?void 0:Ce.menuItemIcon},{children:t.icon})),l("p",e({style:null==Ce?void 0:Ce.menuLabel},{children:t.name})),l("span",{className:k.menuItemRight,style:null==Ce?void 0:Ce.menuItemRight})]}))}),"action-item-".concat(n,"-").concat(t.name))})}))]}),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),lt()},style:null==Ce?void 0:Ce.chevronButton,className:k.chevronButton},{children:l(Ve?g:C,{className:k.chevronIcon,color:null==Ce?void 0:Ce.chevronIconColor})}))]}))]})),l("div",{className:k.divider,style:null==Ce?void 0:Ce.dividerStyle})]})),Ve&&l("div",e({className:k.cardContent,style:null==Ce?void 0:Ce.cardContentStyle},{children:i("div",e({className:k.contentInner,style:null==Ce?void 0:Ce.contentInner},{children:[i("div",e({className:k.descriptionSection,style:null==Ce?void 0:Ce.descriptionSection},{children:[l("div",{className:k.justifyBetween,style:null==Ce?void 0:Ce.justifyBetween}),Ue.userStory?l(P,{minHeight:"100%",height:"100%",type:"string",value:T(X.value)||"",handleUpdateState:function(t,n){var o=A(n);De(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:we,isDisplayHighlightControl:se,contextVariant:ye})]})),null===(q=Be.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});De(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=R(),b=C.userStory,N=C.setUserStory,B=C.customStyles,D=C.searchQueryList,x=C.currentHighlightIndex,U=C.setCurrentHighlightIndex;C.segmentComponentConfig;var E=null==B?void 0:B.userStoryCardStyles,T=0===x,A=x===D.length-1;return i("div",e({className:k.userStoryCardWrapper,style:y?e(e({},null==E?void 0:E.userStoryCardWrapper),{position:"relative"}):null==E?void 0:E.userStoryCardWrapper},{children:[y&&l(r,{children:D.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:[x+1," of ",D.length]})),i("div",e({className:k.navButtons},{children:[l("button",e({onClick:function(){x>0&&U(function(e){return e-1})},className:k.navButton,disabled:T},{children:l(I,{size:20,className:k.navIcon})})),l("button",e({onClick:function(){x<D.length-1&&U(function(e){return e+1})},className:k.navButton,disabled:A},{children:l(w,{size:20,className:k.navIcon})}))]}))]}))}))}))}),b.map(function(e,t){var i=z(h,!0);return l(O,{isUserStoryCurrentlyUpdated:c,artifactId:d,artifactTitleId:n[t]||"",currentUserStory:e,onUserStoryChange:function(e){N(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},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
|
-
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
|
package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as n,__assign as e}from"tslib";import{jsx as o,jsxs as i}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import m from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as p}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"dompurify";import y from"../../shared/UpdatedAnimationContent.js";import S from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import I from"../../icons/CognitiveDecision.js";import b from"../../icons/BrainRed.js";import x,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as N}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import A from"../RecommendationBlock/RecommendationBlock.js";import j from"../UserStoryCard/AttachedContext.js";import U from"../ai-reasoning/AiReasoningCitationContent.js";import T from"./components/InlineUpdatedComponent.js";import L from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as _}from"../../store/markdown-context.js";var M=r(!1),P=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=r({rowId:""}),$=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u(P),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=u(E).rowId,h=String(r.id);p&&g.current.set(h,p);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||o(I,{}):(null==d?void 0:d.lowConfidence)||o(b,{});return i("button",e({className:m.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:p,f?null:r)}},{children:[C,o("i",f?{className:"pi pi-angle-up ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)})]}))},D=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u(P).expandedInfo,p=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return i(E.Provider,e({value:{rowId:v}},{children:[o("tr",e({style:f?{cssText:f}:void 0},{children:a})),p&&(null==g?void 0:g.aiReason)&&o("tr",e({style:{width:"100%"}},{children:o("td",e({colSpan:h||1,className:m.tableExpandedCell},{children:o("div",e({className:m.tableExpandedCellInner},{children:o("div",e({className:m.tableExpandedCellContent},{children:o(U,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var F=["del","ins"];function H(n){return function(n,e,o){var i=e.join("|");return n.replace(new RegExp("<(".concat(i,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,i){return"<".concat(e,">").concat(o(i),"</").concat(e,">")})}(n,F,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,o){var i=e.push(o)-1;return"@@CODE_SPAN_".concat(i,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,o){var i,t=null!==(i=e[Number(o)])&&void 0!==i?i:"";return"<code>".concat(t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(n)}).join("")})}var z=function(r){var I,b=r.message,U=r.noMarkdownContent,E=r.useMarkdown,F=void 0===E||E,z=r.isParent,B=r.scenario,O=r.showUserStoryDiff,q=void 0!==O&&O,W=r.aiReasoningsForBlock,V=r.isCitationLoadingDisplay,G=void 0!==V&&V,Q=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var J=r.customStyles,K=r.customIcons,X=r.aiReasoningDiffView,Y=r.userStoryCitations,Z=r.artifactId,nn=r.isCraflow,en=r.onCraAccept,on=r.onCraReject,tn=r.craFlowConfig,rn=r.isDisplayHighlightControl,ln=void 0!==rn&&rn,an=l(null),dn=R(),cn=dn.userStory,sn=dn.inlineUpdateComponentConfig,un=dn.getAvgScoreForStory,vn=dn.setUserStory,gn=dn.aiReasoning,mn=dn.setAiReasoning,pn=dn.customIcons,hn=dn.searchQueryList,fn=dn.searchQueryReasoningIdList,Cn=dn.currentHighlightIndex,yn=dn.segmentComponentConfig,Sn=null!=K?K:null==pn?void 0:pn.userStoryIcons;null==J||J.searchHighlight;var wn=p(an),Rn=wn.search,In=wn.clear,bn=a("1"),xn=bn[0],Nn=bn[1],kn=a(null),An=kn[0],jn=kn[1],Un=l(new Map),Tn=d(function(n,e){jn(n&&e?{rowId:n,aiReason:e}:null)},[]),Ln=Z?un(Z):0,_n=a([]),Mn=_n[0],Pn=_n[1],En=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(En).join(""):t.isValidElement(n)?En(n.props.children):""},$n=function(n){var e=n;return e=function(n){for(var e,o=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[],t=new RegExp(o.source,o.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};i.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===i.length)return n;for(var c=n,s=function(n){var e=i[n],o=e.changedItemCount-e.deletedItemCount;if(0===o)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<i.length?i[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,i){return"".concat(e).concat(parseInt(i,10)+o,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=i.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var o=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(o,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,o){var i=btoa(encodeURIComponent(o.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(i,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,o,i,t){var r=i.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(o,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,o){if(/<table[\s>]/i.test(o)){var i=btoa(encodeURIComponent(o));return"<updatedsegment".concat(e,' data-raw="').concat(i,'"></updatedsegment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,o,i,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=i;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(o,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var o=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:o!==e}),"<deleted>".concat(o,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var o=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:o!==e,preview:e.substring(0,120)}),"<changed>".concat(o,"</changed>")})}(e),e=H(e)},Dn=c(function(){return b?$n(b):b},[b]);s(function(){Pn(W||gn)},[W,gn]);var Fn=c(function(){return{upt:function(i){var t;i.node;var r=i.children,l=n(i,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=gn.find(function(n){return n.id.toString()===d});return c?o(T,e({aiReason:c,customStyles:null==J?void 0:J.inlineUpdatedComponent,handleClickCognitiveDecision:null==sn?void 0:sn.handleClickCognitiveDecision,handleClickUpdatedPill:null==sn?void 0:sn.handleClickUpdatedPill,handleClickOutputValue:null==sn?void 0:sn.handleClickOutputValue,customIcons:null==sn?void 0:sn.customIcons},{children:r})):r},del:function(i){var t,r,l,a;i.node;var d=i.children,c=n(i,["node","children"]),s=c.aireason,u=s&&(null===(t=s.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(r=s.deviation_details)||void 0===r?void 0:r.resolved)||"reverted"===(null===(l=s.deviation_details)||void 0===l?void 0:l.resolved));return o("span",e({className:m.deleted,style:e(e({},null!==(a=null==J?void 0:J.deleted)&&void 0!==a?a:{}),{textDecoration:u?"none":"line-through"})},c,{onClick:c.onclick},{children:d}))},ins:function(i){var t=i.children,r=n(i,["children"]);return o("span",e({className:m.inserted,style:null==J?void 0:J.inserted},r,{onClick:r.onclick},{children:t}))},preserved:function(i){var t=i.children,r=n(i,["children"]);return o("span",e({className:m.preserved,style:null==J?void 0:J.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(i){i.node;var t=n(i,["node"]);return o("h1",e({className:m.heading1,style:null==J?void 0:J.heading1},{children:t.children}))},h2:function(i){i.node;var t=n(i,["node"]);return o("h2",e({className:m.heading2,style:null==J?void 0:J.heading2},{children:t.children}))},h3:function(i){i.node;var t=n(i,["node"]);return o("h3",e({className:m.heading3,style:null==J?void 0:J.heading3},{children:t.children}))},b:function(i){i.node;var t=n(i,["node"]);return o("b",e({className:m.bold,style:null==J?void 0:J.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=n(i,["node"]);return o("p",e({},t,{className:m.paragraph,style:null==J?void 0:J.paragraph},{children:t.children}))},updated:function(i){var t=i.node,r=n(i,["node"]);return o(y,e({},r,{showUserStoryDiff:q,currentUpdatedTagId:xn,setCurrentUpdatedTagId:Nn,userStory:cn,setUserStory:vn,setAiReasoning:mn,node:t,isCraflow:nn,onCraAccept:en,onCraReject:on,customStyles:null==J?void 0:J.updatedContent,craFlowConfig:tn}))},ol:function(i){var t,r,l,a=i.node,d=n(i,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return o("ol",e({className:m.orderedList,style:null==J?void 0:J.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=n(i,["node"]);return o("ul",e({className:m.unorderedList,style:null==J?void 0:J.ulist},{children:null==t?void 0:t.children}))},table:function(n){var i=n.children;return o("div",e({className:m.tableWrapper},{children:o("table",e({className:m.table,style:null==J?void 0:J.table},{children:i}))}))},tr:function(n){var e=n.node,i=n.children;return o(D,{node:e,children:i,customStyles:J})},td:function(i){var t,r=i.node,l=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return o(M.Provider,e({value:!0},{children:o("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(i){var t,r=i.node,l=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return o(M.Provider,e({value:!0},{children:o("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var r=n(i,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return o(A,e({},r,{customStyles:null==J?void 0:J.recommendationBlock,label:l}))},a:function(e){var i,r,l;e.inline;var a=e.children;e.node;var d=n(e,["inline","children","node"]),c=u(M)||"true"==(null==d?void 0:d.table),s="".concat(null==d?void 0:d.href),v=null===(i=s.split("$"))||void 0===i?void 0:i[0],g=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===v){var m=(null!==(l=q?X:gn)&&void 0!==l?l:[]).find(function(n){return n.id.toString()===decodeURIComponent(g)}),p=fn.includes(g);if(m){if(c)return o($,{aiReason:m,customStyle:null==J?void 0:J.tableAiReasoning,customIcons:Sn,isHighConfidence:m.relevance_score>=N});var h="source"!==t.Children.toArray(a).join("").trim().toLowerCase();return o(x,{aiReason:m,isSourceHasHighlight:p,inlineLabel:a,isInlineCitation:h,customIcons:Sn,customStyles:{aiReasoningContent:null==J?void 0:J.aiReasoningContent,aiReasoningAccordion:null==J?void 0:J.aiReasoningAccordion,aiReasoningMarkdown:null==J?void 0:J.aiReasoningMarkdown,aiReasoningPill:null==J?void 0:J.aiReasoningPill,webCitation:null==J?void 0:J.webCitation,stormeeCitation:null==J?void 0:J.stormeeCitation,waveformCitation:null==J?void 0:J.waveformCitation,imageCitation:null==J?void 0:J.imageCitation,fileCitation:null==J?void 0:J.fileCitation,appModCitation:null==J?void 0:J.appModCitation,rcaCitation:null==J?void 0:J.rcaCitation,readFileCitation:null==J?void 0:J.readFileCitation,loadingCitations:null==J?void 0:J.loadingCitations,chatCitation:null==J?void 0:J.chatCitation,bigEnoughCitation:null==J?void 0:J.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,r=i.className;return i.node,n(i,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?o("div",{children:o("code",e({className:m.blockCode,style:null==J?void 0:J.code},{children:t}))}):o("code",e({className:m.inlineCode,style:null==J?void 0:J.code},{children:t}))},learned:function(n){var i=n.children;return o(f,e({title:i,placement:"top"},{children:o(h,{size:16,className:m.learned})}))},generatedcode:function(e){e.node;var i=n(e,["node"]),t=(null==i?void 0:i.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var o=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(o).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?o(n.props.children):""};e=o(n.children)}}catch(o){console.error("Error decoding generated code:",o),e=String(n.children)}return e}(i);return o(S,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==J?void 0:J.generatedCodePill,content:null==J?void 0:J.generatedCodeContent}})},updatedsegment:function(e){var i,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(i=a.position)||void 0===i?void 0:i.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=o("div",u?{dangerouslySetInnerHTML:{__html:C.sanitize(u)}}:{children:d});return o(L,{id:s,node:a,children:v,props:c,segmentComponentConfig:yn,customStyles:J,customIcons:K,extractText:En,isUpdatedSegment:!0})},segment:function(e){var i,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(i=a.position)||void 0===i?void 0:i.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return o(L,{id:s,node:a,children:d,props:c,segmentComponentConfig:yn,customStyles:J,customIcons:K,extractText:En})}}},[Mn,tn,gn,Y,xn,q,b,K,hn,fn,J,yn]);return console.log("normalized markdown ",Dn),s(function(){if(an.current){if(hn.length){var n;if(0===fn.length||ln)requestAnimationFrame(function(){Rn([hn[Cn].replace(/\*/g,"")])});else{var e=an.current,o=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){o.disconnect(),requestAnimationFrame(function(){Rn([hn[Cn].replace(/\*/g,"")])})},50)});o.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}In()}},[hn,fn,Cn,ln]),o(P.Provider,e({value:{expandedInfo:An,setExpanded:Tn,reasonToRow:Un}},{children:i("div",e({ref:an,className:"".concat(m.container," ").concat("approving"!==B?m.wrapper:""," ").concat(Q||""),style:null==J?void 0:J.container},{children:[F?o(_,{children:o(v,e({components:Fn,rehypePlugins:[g]},{children:Dn}))}):U,Ln>0&&o("div",e({className:m.confidenceScoreContainer,style:null==J?void 0:J.confidenceScoreContainer},{children:i("span",e({className:m.confidenceScore,style:null==J?void 0:J.confidenceScore},{children:[o(k,{size:14,color:(null==J?void 0:J.confidenceScoreIconColor)||"#166534"}),Ln,"%"]}))})),G&&o("div",e({className:m.citationLoader,style:null==J?void 0:J.citationLoaderContainer},{children:o(w,{customStyles:{container:null==J?void 0:J.citationLoadingContainer,icon:null==J?void 0:J.citationLoadingIcon,text:null==J?void 0:J.citationLoadingText}})})),z&&o("div",e({style:e({},null===(I=null==J?void 0:J.attachedContext)||void 0===I?void 0:I.wrapper),className:"flex mt-5"},{children:o(j,{customStyles:null==J?void 0:J.attachedContext})}))]}))}))};export{z as default};
|
|
1
|
+
import{__rest as n,__assign as e}from"tslib";import{jsx as o,jsxs as i}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import m from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as p}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"dompurify";import y from"../../shared/UpdatedAnimationContent.js";import S from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import I from"../../icons/CognitiveDecision.js";import b from"../../icons/BrainRed.js";import x,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as N}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import A from"../RecommendationBlock/RecommendationBlock.js";import j from"../UserStoryCard/AttachedContext.js";import U from"../ai-reasoning/AiReasoningCitationContent.js";import T from"./components/InlineUpdatedComponent.js";import L from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as _}from"../../store/markdown-context.js";var M=r(!1),P=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=r({rowId:""}),$=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u(P),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=u(E).rowId,h=String(r.id);p&&g.current.set(h,p);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||o(I,{}):(null==d?void 0:d.lowConfidence)||o(b,{});return i("button",e({className:m.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:p,f?null:r)}},{children:[C,o("i",f?{className:"pi pi-angle-up ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)})]}))},D=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u(P).expandedInfo,p=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return i(E.Provider,e({value:{rowId:v}},{children:[o("tr",e({style:f?{cssText:f}:void 0},{children:a})),p&&(null==g?void 0:g.aiReason)&&o("tr",e({style:{width:"100%"}},{children:o("td",e({colSpan:h||1,className:m.tableExpandedCell},{children:o("div",e({className:m.tableExpandedCellInner},{children:o("div",e({className:m.tableExpandedCellContent},{children:o(U,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var F=["del","ins"];function H(n){return function(n,e,o){var i=e.join("|");return n.replace(new RegExp("<(".concat(i,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,i){return"<".concat(e,">").concat(o(i),"</").concat(e,">")})}(n,F,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,o){var i=e.push(o)-1;return"@@CODE_SPAN_".concat(i,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,o){var i,t=null!==(i=e[Number(o)])&&void 0!==i?i:"";return"<code>".concat(t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(n)}).join("")})}var z=function(r){var I,b=r.message,U=r.noMarkdownContent,E=r.useMarkdown,F=void 0===E||E,z=r.isParent,B=r.scenario,O=r.showUserStoryDiff,q=void 0!==O&&O,V=r.aiReasoningsForBlock,W=r.isCitationLoadingDisplay,G=void 0!==W&&W,Q=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var J=r.customStyles,K=r.customIcons,X=r.contextVariant,Y=r.aiReasoningDiffView,Z=r.userStoryCitations,nn=r.artifactId,en=r.isCraflow,on=r.onCraAccept,tn=r.onCraReject,rn=r.craFlowConfig,ln=r.isDisplayHighlightControl,an=void 0!==ln&&ln,dn=l(null),cn=R(),sn=cn.userStory,un=cn.inlineUpdateComponentConfig,vn=cn.getAvgScoreForStory,gn=cn.setUserStory,mn=cn.aiReasoning,pn=cn.setAiReasoning,hn=cn.customIcons,fn=cn.searchQueryList,Cn=cn.searchQueryReasoningIdList,yn=cn.currentHighlightIndex,Sn=cn.segmentComponentConfig,wn=null!=K?K:null==hn?void 0:hn.userStoryIcons;null==J||J.searchHighlight;var Rn=p(dn),In=Rn.search,bn=Rn.clear,xn=a("1"),Nn=xn[0],kn=xn[1],An=a(null),jn=An[0],Un=An[1],Tn=l(new Map),Ln=d(function(n,e){Un(n&&e?{rowId:n,aiReason:e}:null)},[]),_n=nn?vn(nn):0,Mn=a([]),Pn=Mn[0],En=Mn[1],$n=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map($n).join(""):t.isValidElement(n)?$n(n.props.children):""},Dn=function(n){var e=n;return e=function(n){for(var e,o=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[],t=new RegExp(o.source,o.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};i.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===i.length)return n;for(var c=n,s=function(n){var e=i[n],o=e.changedItemCount-e.deletedItemCount;if(0===o)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<i.length?i[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,i){return"".concat(e).concat(parseInt(i,10)+o,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=i.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var o=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(o,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,o){var i=btoa(encodeURIComponent(o.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(i,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,o,i,t){var r=i.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(o,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,o){if(/<table[\s>]/i.test(o)){var i=btoa(encodeURIComponent(o));return"<updatedsegment".concat(e,' data-raw="').concat(i,'"></updatedsegment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,o,i,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=i;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(o,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var o=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:o!==e}),"<deleted>".concat(o,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var o=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:o!==e,preview:e.substring(0,120)}),"<changed>".concat(o,"</changed>")})}(e),e=H(e)},Fn=c(function(){return b?Dn(b):b},[b]);s(function(){En(V||mn)},[V,mn]);var Hn=c(function(){return{upt:function(i){var t;i.node;var r=i.children,l=n(i,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=mn.find(function(n){return n.id.toString()===d});return c?o(T,e({aiReason:c,customStyles:null==J?void 0:J.inlineUpdatedComponent,handleClickCognitiveDecision:null==un?void 0:un.handleClickCognitiveDecision,handleClickUpdatedPill:null==un?void 0:un.handleClickUpdatedPill,handleClickOutputValue:null==un?void 0:un.handleClickOutputValue,customIcons:null==un?void 0:un.customIcons},{children:r})):r},del:function(i){var t,r,l,a;i.node;var d=i.children,c=n(i,["node","children"]),s=c.aireason,u=s&&(null===(t=s.deviation_details)||void 0===t?void 0:t.resolved)&&("rejected"===(null===(r=s.deviation_details)||void 0===r?void 0:r.resolved)||"reverted"===(null===(l=s.deviation_details)||void 0===l?void 0:l.resolved));return o("span",e({className:m.deleted,style:e(e({},null!==(a=null==J?void 0:J.deleted)&&void 0!==a?a:{}),{textDecoration:u?"none":"line-through"})},c,{onClick:c.onclick},{children:d}))},ins:function(i){var t=i.children,r=n(i,["children"]);return o("span",e({className:m.inserted,style:null==J?void 0:J.inserted},r,{onClick:r.onclick},{children:t}))},preserved:function(i){var t=i.children,r=n(i,["children"]);return o("span",e({className:m.preserved,style:null==J?void 0:J.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(i){i.node;var t=n(i,["node"]);return o("h1",e({className:m.heading1,style:null==J?void 0:J.heading1},{children:t.children}))},h2:function(i){i.node;var t=n(i,["node"]);return o("h2",e({className:m.heading2,style:null==J?void 0:J.heading2},{children:t.children}))},h3:function(i){i.node;var t=n(i,["node"]);return o("h3",e({className:m.heading3,style:null==J?void 0:J.heading3},{children:t.children}))},b:function(i){i.node;var t=n(i,["node"]);return o("b",e({className:m.bold,style:null==J?void 0:J.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=n(i,["node"]);return o("p",e({},t,{className:m.paragraph,style:null==J?void 0:J.paragraph},{children:t.children}))},updated:function(i){var t=i.node,r=n(i,["node"]);return o(y,e({},r,{showUserStoryDiff:q,currentUpdatedTagId:Nn,setCurrentUpdatedTagId:kn,userStory:sn,setUserStory:gn,setAiReasoning:pn,node:t,isCraflow:en,onCraAccept:on,onCraReject:tn,customStyles:null==J?void 0:J.updatedContent,craFlowConfig:rn}))},ol:function(i){var t,r,l,a=i.node,d=n(i,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return o("ol",e({className:m.orderedList,style:null==J?void 0:J.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=n(i,["node"]);return o("ul",e({className:m.unorderedList,style:null==J?void 0:J.ulist},{children:null==t?void 0:t.children}))},table:function(n){var i=n.children;return o("div",e({className:m.tableWrapper},{children:o("table",e({className:m.table,style:null==J?void 0:J.table},{children:i}))}))},tr:function(n){var e=n.node,i=n.children;return o(D,{node:e,children:i,customStyles:J})},td:function(i){var t,r=i.node,l=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return o(M.Provider,e({value:!0},{children:o("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(i){var t,r=i.node,l=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return o(M.Provider,e({value:!0},{children:o("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var r=n(i,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return o(A,e({},r,{customStyles:null==J?void 0:J.recommendationBlock,label:l}))},a:function(e){var i,r,l;e.inline;var a=e.children;e.node;var d=n(e,["inline","children","node"]),c=u(M)||"true"==(null==d?void 0:d.table),s="".concat(null==d?void 0:d.href),v=null===(i=s.split("$"))||void 0===i?void 0:i[0],g=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===v){var m=(null!==(l=q?Y:mn)&&void 0!==l?l:[]).find(function(n){return n.id.toString()===decodeURIComponent(g)}),p=Cn.includes(g);if(m){if(c)return o($,{aiReason:m,customStyle:null==J?void 0:J.tableAiReasoning,customIcons:wn,isHighConfidence:m.relevance_score>=N});var h="source"!==t.Children.toArray(a).join("").trim().toLowerCase();return o(x,{aiReason:m,isSourceHasHighlight:p,inlineLabel:a,isInlineCitation:h,customIcons:wn,customStyles:{aiReasoningContent:null==J?void 0:J.aiReasoningContent,aiReasoningAccordion:null==J?void 0:J.aiReasoningAccordion,aiReasoningMarkdown:null==J?void 0:J.aiReasoningMarkdown,aiReasoningPill:null==J?void 0:J.aiReasoningPill,webCitation:null==J?void 0:J.webCitation,stormeeCitation:null==J?void 0:J.stormeeCitation,waveformCitation:null==J?void 0:J.waveformCitation,imageCitation:null==J?void 0:J.imageCitation,fileCitation:null==J?void 0:J.fileCitation,appModCitation:null==J?void 0:J.appModCitation,rcaCitation:null==J?void 0:J.rcaCitation,readFileCitation:null==J?void 0:J.readFileCitation,loadingCitations:null==J?void 0:J.loadingCitations,chatCitation:null==J?void 0:J.chatCitation,bigEnoughCitation:null==J?void 0:J.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,r=i.className;return i.node,n(i,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?o("div",{children:o("code",e({className:m.blockCode,style:null==J?void 0:J.code},{children:t}))}):o("code",e({className:m.inlineCode,style:null==J?void 0:J.code},{children:t}))},learned:function(n){var i=n.children;return o(f,e({title:i,placement:"top"},{children:o(h,{size:16,className:m.learned})}))},generatedcode:function(e){e.node;var i=n(e,["node"]),t=(null==i?void 0:i.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var o=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(o).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?o(n.props.children):""};e=o(n.children)}}catch(o){console.error("Error decoding generated code:",o),e=String(n.children)}return e}(i);return o(S,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==J?void 0:J.generatedCodePill,content:null==J?void 0:J.generatedCodeContent}})},updatedsegment:function(e){var i,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(i=a.position)||void 0===i?void 0:i.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=o("div",u?{dangerouslySetInnerHTML:{__html:C.sanitize(u)}}:{children:d});return o(L,{id:s,node:a,children:v,props:c,segmentComponentConfig:Sn,customStyles:J,customIcons:K,extractText:$n,isUpdatedSegment:!0})},segment:function(e){var i,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(i=a.position)||void 0===i?void 0:i.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return o(L,{id:s,node:a,children:d,props:c,segmentComponentConfig:Sn,customStyles:J,customIcons:K,extractText:$n})}}},[Pn,rn,mn,Z,Nn,q,b,K,fn,Cn,J,Sn]);return console.log("normalized markdown ",Fn),s(function(){if(dn.current){if(fn.length){var n;if(0===Cn.length||an)requestAnimationFrame(function(){In([fn[yn].replace(/\*/g,"")])});else{var e=dn.current,o=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){o.disconnect(),requestAnimationFrame(function(){In([fn[yn].replace(/\*/g,"")])})},50)});o.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}bn()}},[fn,Cn,yn,an]),o(P.Provider,e({value:{expandedInfo:jn,setExpanded:Ln,reasonToRow:Tn}},{children:i("div",e({ref:dn,className:"".concat(m.container," ").concat("approving"!==B?m.wrapper:""," ").concat(Q||""),style:null==J?void 0:J.container},{children:[F?o(_,{children:o(v,e({components:Hn,rehypePlugins:[g]},{children:Fn}))}):U,_n>0&&o("div",e({className:m.confidenceScoreContainer,style:null==J?void 0:J.confidenceScoreContainer},{children:i("span",e({className:m.confidenceScore,style:null==J?void 0:J.confidenceScore},{children:[o(k,{size:14,color:(null==J?void 0:J.confidenceScoreIconColor)||"#166534"}),_n,"%"]}))})),G&&o("div",e({className:m.citationLoader,style:null==J?void 0:J.citationLoaderContainer},{children:o(w,{customStyles:{container:null==J?void 0:J.citationLoadingContainer,icon:null==J?void 0:J.citationLoadingIcon,text:null==J?void 0:J.citationLoadingText}})})),z&&o("div",e({style:e({},null===(I=null==J?void 0:J.attachedContext)||void 0===I?void 0:I.wrapper),className:"flex mt-5"},{children:o(j,{customStyles:null==J?void 0:J.attachedContext,variant:X})}))]}))}))};export{z as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -10,10 +10,8 @@ export interface IContextItemStyles {
|
|
|
10
10
|
}
|
|
11
11
|
interface IProps {
|
|
12
12
|
customStyles?: UserStoryWithCitationCustomStyles["attachedContext"];
|
|
13
|
+
variant?: "dropdown" | "inline";
|
|
13
14
|
}
|
|
14
|
-
/**
|
|
15
|
-
* MAIN COMPONENT: AttachedContext
|
|
16
|
-
*/
|
|
17
15
|
declare const AttachedContext: React.FC<IProps>;
|
|
18
16
|
export default AttachedContext;
|
|
19
17
|
//# sourceMappingURL=AttachedContext.d.ts.map
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/AttachedContext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachedContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/AttachedContext.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AttachedContext.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/AttachedContext.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AAYrG,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC/B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACpC;AA8ND,UAAU,MAAM;IACd,YAAY,CAAC,EAAE,iCAAiC,CAAC,iBAAiB,CAAC,CAAC;IACpE,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;CACjC;AAoDD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAsGrC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -48,9 +48,10 @@ interface StoryCardProps {
|
|
|
48
48
|
showWrapper?: boolean;
|
|
49
49
|
actionItemsConfig?: ActionItemsConfig;
|
|
50
50
|
onDelete?: () => void;
|
|
51
|
+
contextVariant?: "dropdown" | "inline";
|
|
51
52
|
}
|
|
52
53
|
export declare function replaceLearnedTagsWithInfo(content: string): React.ReactNode[];
|
|
53
|
-
export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, actionItemsConfig, onDelete, }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, actionItemsConfig, onDelete, contextVariant }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
55
|
interface IProps {
|
|
55
56
|
isUserStoryCurrentlyUpdated?: boolean;
|
|
56
57
|
artifactId: string;
|
|
@@ -65,7 +66,8 @@ interface IProps {
|
|
|
65
66
|
elementDisplayConfig?: ElementDisplayConfig;
|
|
66
67
|
showWrapper?: boolean;
|
|
67
68
|
actionItemsConfig?: ActionItemsConfig;
|
|
69
|
+
contextVariant?: "dropdown" | "inline";
|
|
68
70
|
}
|
|
69
|
-
export declare const UserStoryCardWrapper: ({ artifactTitleIDs, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export declare const UserStoryCardWrapper: ({ artifactTitleIDs, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
72
|
export default StoryCard;
|
|
71
73
|
//# sourceMappingURL=UserStoryCard.d.ts.map
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAwB/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAOlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AASzE,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACjC,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,UAAU,cAAc;IACpB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,iBAAiB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAEpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,2CAA2C;IAC3C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrK,uBAAuB,EAAE,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnK,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"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"}
|
|
@@ -96,6 +96,7 @@ interface UserStoryWithCitationsProps {
|
|
|
96
96
|
lowConfidenceIcon?: React.ReactNode;
|
|
97
97
|
customStyles?: UserStoryWithCitationCustomStyles;
|
|
98
98
|
customIcons?: UserStoryIcons;
|
|
99
|
+
contextVariant?: "dropdown" | "inline";
|
|
99
100
|
aiReasoningDiffView?: TAIReasoning[];
|
|
100
101
|
userStoryCitations?: any;
|
|
101
102
|
isCraflow?: boolean;
|
|
@@ -110,6 +111,6 @@ interface UserStoryWithCitationsProps {
|
|
|
110
111
|
displayActionButtons: boolean;
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
|
-
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, contextVariant, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
114
115
|
export default UserStoryWithCitations;
|
|
115
116
|
//# sourceMappingURL=UserStoryWithCitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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"}
|