@e-llm-studio/requirement-ai 0.0.149 → 0.0.151
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/CustomPopover/CustomPopover.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/ExampleComponentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/story-screen/UserStoryScreen.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/ProjectCard.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/UserStoryCard.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/features/RequirementAI/components/CustomPopover/CustomPopover.js +1 -1
- package/dist/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/segment/ExampleComponentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/features/RequirementAI/components/story-screen/UserStoryScreen.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/UserStoryImport/components/ProjectCard.js +1 -1
- package/dist/features/UserStoryImport/components/UserStoryCard.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/CustomPopover/CustomPopover.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts +9 -3
- package/dist/types/src/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/ExampleComponentWrapper.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/segment/ExampleComponentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +2 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/story-screen/UserStoryScreen.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +8 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +12 -0
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -0
- package/dist/types/src/features/UserStoryImport/components/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +27 -27
- package/dist/types/src/index.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"),r=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("./CustomPopover.module.css.js");exports.default=function(s){var o=s.anchorEl,i=s.open,l=s.onClose,u=s.children,a=s.customStyles,c=void 0===a?{}:a,d=t.useRef(null);if(t.useEffect(function(){if(i){var e=function(e){var r;(null===(r=d.current)||void 0===r?void 0:r.contains(e.target))||l()};return window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}},[i,l]),!i||!o)return null;var f=o.getBoundingClientRect();return r.jsxs(r.Fragment,{children:[r.jsx("div",{onClick:l,className:n.default.backdrop,style:e.__assign({},c.backdrop)}),r.jsx("div",e.__assign({ref:d,className:n.default.popup,style:e.__assign({top:f.bottom+15,left:f.left-700},c.popup)},{children:u}))]})};
|
|
2
2
|
//# sourceMappingURL=CustomPopover.js.map
|
package/dist/cjs/features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js
CHANGED
|
@@ -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"),i=require("../../store/ref.context.js"),r=n.createContext(null);exports.default=function(o){var s=o.children,a=o.userStory,u=o.setUserStory,c=o.aiReasoning,l=o.setAiReasoning,g=o.citations,f=o.setCitations,d=o.apiCachingConfig,h=o.customStyles,C=o.customIcons,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("../../store/ref.context.js"),r=n.createContext(null);exports.default=function(o){var s=o.children,a=o.userStory,u=o.setUserStory,c=o.aiReasoning,l=o.setAiReasoning,g=o.citations,f=o.setCitations,d=o.apiCachingConfig,h=o.customStyles,C=o.customIcons,m=o.searchQueryList,p=o.searchQueryReasoningIdList,v=o.citationConfig,y=o.chatHistory,x=o.chatCitationConfigs,S=o.gptCitationConfigs,I=o.aiReasoningAccordionOpenStates,R=o.persistedDataFiles,A=o.inlineUpdateComponentConfig,q=o.handleViewGlossary,_=o.segmentDataList,b=o.getSegmentExampleComponent,L=n.useState(0),j=L[0],w=L[1],D=n.useMemo(function(){if(0===a.length||0===c.length)return Array(a.length).fill(0);var e=Array.from({length:a.length},function(){return[]});return c.forEach(function(t){var n=Number(t.relevance_score);if(!(isNaN(n)||n<=0)){var i="ai_reasoning$".concat(t.id),r=a.findIndex(function(e){var t;return e.value.includes(i)||(null===(t=e.sub_features)||void 0===t?void 0:t.some(function(e){return e.value.includes(i)}))});-1!==r&&e[r].push(n)}}),e.map(function(e){return 0===e.length?0:Math.round(e.reduce(function(e,t){return e+t},0)/e.length)})},[a,c]),E=n.useCallback(function(e){var t,n=a.findIndex(function(t){return t.artifactId===e});return-1===n?0:null!==(t=D[n])&&void 0!==t?t:0},[a,D]);return t.jsx(r.Provider,e.__assign({value:{chatHistory:y,userStory:a,setUserStory:u,aiReasoning:c,setAiReasoning:l,citations:g,setCitations:f,apiCachingConfig:d,customStyles:h,customIcons:C,searchQueryList:m,searchQueryReasoningIdList:p,citationConfig:v,getAvgScoreForStory:E,chatCitationConfigs:x,gptCitationConfigs:S,aiReasoningAccordionOpenStates:I,persistedDataFiles:R,currentHighlightIndex:j,setCurrentHighlightIndex:w,inlineUpdateComponentConfig:A,handleViewGlossary:q,segmentDataList:_,getSegmentExampleComponent:b}},{children:t.jsx(i.RefProvider,{children:s})}))},exports.useRequirementAI=function(){var e=n.useContext(r);if(!e)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return e};
|
|
2
2
|
//# sourceMappingURL=RequirementAIWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),l=require("./segment.module.css.js"),s=require("lucide-react");exports.default=function(n){var t=n.segmentExampleComponent,i=n.customStyles,r=n.handleCancelExample;return a.jsxs("div",e.__assign({className:"".concat(l.default.exampleWrapper),style:e.__assign({},null==i?void 0:i.exampleWrapper)},{children:[a.jsxs("div",e.__assign({className:"".concat(l.default.exampleHeader),style:e.__assign({},null==i?void 0:i.exampleHeader)},{children:[a.jsx("p",e.__assign({className:"".concat(l.default.exampleHeaderText),style:e.__assign({},null==i?void 0:i.exampleHeaderText)},{children:"Example: "})),a.jsx("button",e.__assign({className:"".concat(l.default.cancelButton),onClick:r,style:e.__assign({},null==i?void 0:i.cancelButton)},{children:a.jsx(s.X,{size:16})}))]})),null!=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),l=require("./segment.module.css.js"),s=require("lucide-react");exports.default=function(n){var t=n.label,c=n.segmentExampleComponent,i=n.customStyles,r=n.handleCancelExample;return a.jsxs("div",e.__assign({className:"".concat(l.default.exampleWrapper),style:e.__assign({},null==i?void 0:i.exampleWrapper)},{children:[a.jsx("div",e.__assign({className:"".concat(l.default.exampleHeaderText," ").concat(l.default.uppercase),style:e.__assign({},null==i?void 0:i.exampleHeaderText)},{children:"{".concat(t,"}")})),a.jsxs("div",e.__assign({className:"".concat(l.default.exampleContainer),style:e.__assign({},null==i?void 0:i.exampleContainer)},{children:[a.jsxs("div",e.__assign({className:"".concat(l.default.exampleHeader),style:e.__assign({},null==i?void 0:i.exampleHeader)},{children:[a.jsx("p",e.__assign({className:"".concat(l.default.exampleHeaderText),style:e.__assign({},null==i?void 0:i.exampleHeaderText)},{children:"Example: "})),a.jsx("button",e.__assign({className:"".concat(l.default.cancelButton),onClick:r,style:e.__assign({},null==i?void 0:i.cancelButton)},{children:a.jsx(s.X,{size:16})}))]})),null!=c?c:a.jsx("p",e.__assign({className:"".concat(l.default.exampleHeaderText),style:e.__assign({},null==i?void 0:i.exampleHeaderText)},{children:"No example available..."}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=ExampleComponentWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),l=require("./segment.module.css.js"),o=require("./ExampleComponentWrapper.js"),i=require("../ai-reasoning/AiReasoningCitationContent.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=r(t);exports.default=function(t){var r=t.id,u=void 0===r?"Segment":r,d=t.label;t.originalValue,t.decisionStrength;var m=t.aiReason,g=t.customStyles,p=t.customIcons,f=t.aiReasoningCitationCustomStyles,_=t.segmentExampleComponent,v=t.handleViewGlossary,x=c.default.useState(!1),j=x[0],y=x[1],h=c.default.useState(!1),C=h[0],b=h[1];return n.jsxs("div",e.__assign({className:"".concat(l.default.segmentWrapper),style:e.__assign({},null==g?void 0:g.segmentWrapper)},{children:[n.jsxs("div",e.__assign({className:"".concat(l.default.segmentContainer),style:e.__assign({},null==g?void 0:g.container)},{children:[n.jsxs("span",e.__assign({className:"".concat(l.default.segmentLabel),style:e.__assign({},null==g?void 0:g.label)},{children:[u," ","{".concat(d,"}")]})),n.jsx("button",e.__assign({className:"".concat(l.default.segmentExplanationButtonContainer),style:e.__assign({},null==g?void 0:g.buttonContainer),onClick:function(){y(function(e){return!e}),b(!1)}},{children:n.jsx(a.ChevronDown,{className:s.cn("".concat(l.default.cheveronIcon),j&&"".concat(l.default.cheveronIconRotated)),style:e.__assign({},null==g?void 0:g.cheveronIcon)})}))]})),m&&C&&_?n.jsx(o.default,{label:null!=d?d:"",segmentExampleComponent:_,customStyles:null==g?void 0:g.segmentExample,handleCancelExample:function(){b(!1)}}):m&&j&&n.jsx(i.default,{aiReason:m,customStyles:f,customIcons:p,isSegmentExplanation:!0,handleViewGlossary:function(){y(!1),null==v||v()},handleViewExample:function(){b(!0)}})]}))};
|
|
2
2
|
//# sourceMappingURL=Segment.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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(".segment-module_segmentWrapper__PVOuq{display:flex;flex-direction:column;gap:8px}.segment-module_segmentContainer__wBEel{align-items:center;background-color:#eff6ff;border:1px dashed #bfdbfe;border-radius:4px;color:#3b82f6;display:flex;gap:8px;padding:8px}.segment-module_segmentLabel__-y8Su{color:#3b82f6;font-size:14px;font-weight:600;line-height:21px}.segment-module_segmentButtonContainer__X76sx{background-color:initial;border:none;cursor:pointer;padding:0}.segment-module_cheveronIcon__1njFy{color:#3b82f6;height:16px;transition:all .2s ease-in-out;width:16px}.segment-module_cheveronIconRotated__qDYj7{transform:rotate(180deg)}.segment-module_exampleWrapper__ptZzj{align-items:flex-start;border:2px dashed #e2e8f0;border-radius:8px;display:flex;flex-direction:column;gap:8px;padding:16px}.segment-module_exampleHeader__9P11O{align-items:center;align-self:stretch;display:flex;justify-content:space-between}.segment-module_exampleHeaderText__MWMG0{color:#334155;font-size:14px;font-weight:600;line-height:21px;margin:0}.segment-module_cancelButton__-F5aZ{align-items:center;align-self:stretch;background-color:initial;border:none;color:#334155;cursor:pointer;display:flex;height:fit-content;justify-content:space-between;padding:4px;transition:all .2s ease-in-out}.segment-module_cancelButton__-F5aZ:hover{background-color:#eff6ff}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentContainer:"segment-module_segmentContainer__wBEel",segmentLabel:"segment-module_segmentLabel__-y8Su",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",exampleWrapper:"segment-module_exampleWrapper__ptZzj",exampleHeader:"segment-module_exampleHeader__9P11O",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ"};
|
|
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(".segment-module_segmentWrapper__PVOuq{display:flex;flex-direction:column;gap:8px}.segment-module_segmentContainer__wBEel{align-items:center;background-color:#eff6ff;border:1px dashed #bfdbfe;border-radius:4px;color:#3b82f6;display:flex;gap:8px;padding:8px}.segment-module_segmentLabel__-y8Su{color:#3b82f6;font-size:14px;font-weight:600;line-height:21px;text-transform:uppercase}.segment-module_segmentButtonContainer__X76sx{background-color:initial;border:none;cursor:pointer;padding:0}.segment-module_cheveronIcon__1njFy{color:#3b82f6;height:16px;transition:all .2s ease-in-out;width:16px}.segment-module_cheveronIconRotated__qDYj7{transform:rotate(180deg)}.segment-module_exampleWrapper__ptZzj{align-items:flex-start;display:flex;flex-direction:column;gap:12px}.segment-module_uppercase__hjgxG{text-transform:uppercase}.segment-module_exampleContainer__9tMXx{align-items:flex-start;border:2px dashed #e2e8f0;border-radius:8px;display:flex;flex-direction:column;gap:8px;padding:16px;width:100%}.segment-module_exampleHeader__9P11O{align-items:center;align-self:stretch;display:flex;justify-content:space-between}.segment-module_exampleHeaderText__MWMG0{color:#334155;font-size:14px;font-weight:600;line-height:21px;margin:0}.segment-module_cancelButton__-F5aZ{align-items:center;align-self:stretch;background-color:initial;border:none;color:#334155;cursor:pointer;display:flex;height:fit-content;justify-content:space-between;padding:4px;transition:all .2s ease-in-out}.segment-module_cancelButton__-F5aZ:hover{background-color:#eff6ff}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}(),exports.default={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentContainer:"segment-module_segmentContainer__wBEel",segmentLabel:"segment-module_segmentLabel__-y8Su",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",exampleWrapper:"segment-module_exampleWrapper__ptZzj",uppercase:"segment-module_uppercase__hjgxG",exampleContainer:"segment-module_exampleContainer__9tMXx",exampleHeader:"segment-module_exampleHeader__9P11O",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ"};
|
|
2
2
|
//# sourceMappingURL=segment.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("react-resizable-panels"),l=require("lucide-react"),i=require("../../utils/helpers.js"),r=require("./SubfeatureBlock.js"),o=require("./UserStoryScreen.module.css.js"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),d=n.createContext(null),u=function(){var e=n.useContext(d);if(!e)throw new Error("UserStoryScreen must be used inside its provider");return e},c=function(n){var s,l,i=n.AtomicButton,r=u(),d=r.selectedStreamingStoryIndex,c=r.isCitationLoadingNotStarted,m=r.classNames,g=r.scenario,y=a.useRequirementAI(),f=y.userStory,x=y.customStyles,p=null==x?void 0:x.userStoryScreenStyles;return(null==f?void 0:f.length)?t.jsxs("div",e.__assign({className:"".concat(o.default.header," ").concat(null!==(s=null==m?void 0:m.header)&&void 0!==s?s:""),style:null==p?void 0:p.header},{children:[t.jsxs("div",e.__assign({className:o.default.headerLeftContainer},{children:[t.jsx("span",e.__assign({className:o.default.headerTitle,style:null==p?void 0:p.headerTitle},{children:null===(l=f[d])||void 0===l?void 0:l.title})),"streaming"===g&&t.jsxs("span",e.__assign({className:o.default.headerSubtitle,style:null==p?void 0:p.headerSubtitle},{children:[t.jsx("span",e.__assign({className:o.default.streamingText,style:null==p?void 0:p.streamingText},{children:c?"Generating Requirement Doc":"Hang tight! We're loading the citations."}))," • Review & edit blocks as we build"]}))]})),t.jsx(v,{AtomicButton:i})]})):t.jsx(S,{classNames:m})},v=function(n){var s=n.AtomicButton,i=u(),r=i.isEditing,d=i.isEditingModeOn,c=i.setIsEditing,v=i.setIsEditingModeOn,S=i.userStoryCopy,m=a.useRequirementAI(),g=m.userStory,y=m.setUserStory,f=m.customStyles,x=null==f?void 0:f.userStoryScreenStyles;return(null==g?void 0:g.length)?r?t.jsxs("div",e.__assign({className:o.default.actions,style:null==x?void 0:x.actions},{children:[t.jsx(s,e.__assign({type:"outline",onClick:function(){c(!1),v(!1)},style:null==x?void 0:x.cancelAtomicButton},{children:"Cancel"})),t.jsx(s,e.__assign({type:"fill",onClick:function(){y(S),c(!1),v(!1)},style:null==x?void 0:x.saveAtomicButton},{children:"Save"}))]})):d?null:t.jsx("div",e.__assign({className:o.default.editToggleWrapper},{children:t.jsx("button",e.__assign({className:o.default.editToggleBtn,style:null==x?void 0:x.editToggleBtn,onClick:function(){c(!0),v(!0)}},{children:t.jsx(l.PencilIcon,{size:16})}))})):null},S=function(n){var s,l=n.classNames;return t.jsxs("div",e.__assign({className:"".concat(o.default.header," ").concat(null!==(s=null==l?void 0:l.header)&&void 0!==s?s:"")},{children:[t.jsx("div",{className:o.default.skeletonTitle}),t.jsx("div",{className:o.default.skeletonSubtitle})]}))},m=function(){var n,s=a.useRequirementAI().customStyles,l=null===(n=null==s?void 0:s.userStoryScreenStyles)||void 0===n?void 0:n.accordionSkeleton;return t.jsxs("div",e.__assign({className:o.default.accordionSkeleton,style:null==l?void 0:l.wrapper},{children:[t.jsx("div",{className:o.default.skeletonLine,style:null==l?void 0:l.line}),t.jsx("div",{className:o.default.skeletonBox,style:null==l?void 0:l.box})]}))},g=function(){var n,s=a.useRequirementAI().customStyles,l=null===(n=null==s?void 0:s.userStoryScreenStyles)||void 0===n?void 0:n.subFeatureSkeleton;return t.jsxs("div",e.__assign({className:o.default.subFeatureSkeleton,style:null==l?void 0:l.wrapper},{children:[t.jsx("div",{className:o.default.skeletonLine,style:null==l?void 0:l.line}),t.jsx("div",{className:o.default.skeletonLine,style:null==l?void 0:l.line}),t.jsx("div",{className:o.default.skeletonLine,style:null==l?void 0:l.line})]}))},y=Object.assign(function(l){var i,r,u,c,v,S=l.scenario,m=l.isCitationLoadingNotStarted,g=l.children,y=l.classNames,f=l.artifactTitleIds,x=a.useRequirementAI(),p=x.userStory,_=x.customStyles,h=n.useState(0),j=h[0],I=h[1],b=n.useState(!0),N=b[0],C=b[1],E=n.useState(!1),B=E[0],R=E[1],A=n.useState(!1),q=A[0],k=A[1],T=n.useState(!1),w=T[0],P=T[1],L=n.useState(!1),M=L[0],z=L[1],O=n.useState(p),W=O[0],H=O[1],U=n.useRef(null),F=n.useRef(null);return n.useEffect(function(){H(p)},[p]),n.useEffect(function(){R(!0);var e=setTimeout(function(){return R(!1)},2e3);return function(){return clearTimeout(e)}},[null===(r=null===(i=null==p?void 0:p[j])||void 0===i?void 0:i.sub_features)||void 0===r?void 0:r.length]),n.useEffect(function(){var e=F.current;if(e){var t=function(){k(e.scrollHeight-e.scrollTop-e.clientHeight<20)};return e.addEventListener("scroll",t),function(){return e.removeEventListener("scroll",t)}}},[null==p?void 0:p[j]]),t.jsx(d.Provider,e.__assign({value:{scenario:S,isCitationLoadingNotStarted:m,selectedStreamingStoryIndex:j,setSelectedStreamingStoryIndex:I,isSidebarExpanded:N,setIsSidebarExpanded:C,sidebarPanelRef:U,isEditing:w,setIsEditing:P,isEditingModeOn:M,setIsEditingModeOn:z,userStoryCopy:W,setUserStoryCopy:H,scrollContainerRef:F,isAtBottom:q,isScrollBtnBouncing:B,scrollToBottom:function(){F.current&&F.current.scrollTo({top:F.current.scrollHeight,behavior:"smooth"})},classNames:y,artifactTitleIds:f}},{children:t.jsx("div",e.__assign({className:"".concat(o.default.container," ").concat(null!==(u=null==y?void 0:y.container)&&void 0!==u?u:""),style:e.__assign({},null===(c=null==_?void 0:_.userStoryScreenStyles)||void 0===c?void 0:c.wrapperContainer)},{children:t.jsx(s.PanelGroup,e.__assign({direction:"horizontal",className:o.default.panelGroup,style:null===(v=null==_?void 0:_.userStoryScreenStyles)||void 0===v?void 0:v.panelGroup},{children:g}))}))}))},{Sidebar:function(n){var l,i=n.Component,r=u(),d=r.selectedStreamingStoryIndex,c=r.setSelectedStreamingStoryIndex,v=r.isSidebarExpanded,S=r.setIsSidebarExpanded,m=r.sidebarPanelRef,g=r.scenario,y=r.artifactTitleIds,f=a.useRequirementAI(),x=f.userStory,p=f.customStyles;return t.jsx(s.Panel,e.__assign({ref:m,defaultSize:25,minSize:15,collapsible:!0,collapsedSize:0,onCollapse:function(){return S(!1)},onExpand:function(){return S(!0)},id:"streaming-sidebar",order:1,className:o.default.sidebarPanel,style:null===(l=null==p?void 0:p.userStoryScreenStyles)||void 0===l?void 0:l.sidebarPanel},{children:t.jsx(i,{streamingUserStories:x,selectedStreamingStoryIndex:d,setSelectedStreamingStoryIndex:c,isSidebarExpanded:v,isStreamingScreen:"streaming"===g,artifactTitleIds:y})}))},SidebarToggle:function(n){var l=n.OpenIcon,i=n.CloseIcon,r=u(),d=r.isSidebarExpanded;r.setIsSidebarExpanded;var c=r.sidebarPanelRef,v=a.useRequirementAI().customStyles,S=null==v?void 0:v.userStoryScreenStyles;return t.jsx(s.PanelResizeHandle,e.__assign({className:o.default.resizeHandle,style:null==S?void 0:S.resizeHandle},{children:t.jsx("button",e.__assign({className:o.default.sidebarToggleBtn,onClick:function(e){e.stopPropagation(),function(){var e,t;d?null===(e=c.current)||void 0===e||e.collapse():null===(t=c.current)||void 0===t||t.expand()}()},style:null==S?void 0:S.sidebarToggleBtn},{children:d?t.jsx(i,{}):t.jsx(l,{})}))}))},Content:function(n){var l,i=n.children,r=n.AtomicButton,d=u(),v=d.scrollContainerRef,S=d.classNames,m=a.useRequirementAI().customStyles,g=null==m?void 0:m.userStoryScreenStyles;return t.jsx(s.Panel,e.__assign({minSize:0,id:"streaming-content",order:2,className:o.default.contentPanel,style:null==g?void 0:g.contentPanel},{children:t.jsxs("div",e.__assign({ref:v,className:"".concat(o.default.scrollContainer," ").concat(null!==(l=null==S?void 0:S.scrollContainer)&&void 0!==l?l:""),style:null==g?void 0:g.scrollContainer},{children:[t.jsx(c,{AtomicButton:r}),i]}))}))},Body:function(e){var n=e.children,s=a.useRequirementAI(),l=s.userStory;return s.setUserStory,(null==l?void 0:l.length)?t.jsx(t.Fragment,{children:n}):null},Story:function(n){var s,l,i,r=n.Component,d=u(),c=d.selectedStreamingStoryIndex,v=d.isEditing,S=d.scenario,m=a.useRequirementAI(),g=m.userStory,y=m.customStyles,f=m.customIcons,x=m.segmentExampleComponent,p=m.handleViewGlossary,_=null==y?void 0:y.userStoryScreenStyles,h=null==_?void 0:_.userStoryContentStyles;return v?null:t.jsx("div",e.__assign({className:o.default.storyWrapper,style:null==_?void 0:_.storyWrapper},{children:t.jsx(r,{message:null===(s=g[c])||void 0===s?void 0:s.value,aiReasoningsForBlock:(null===(l=g[c])||void 0===l?void 0:l.aiReasoning)||[],isCitationLoadingDisplay:"streaming"===S,customStyles:e.__assign({},h),customIcons:e.__assign({},null==f?void 0:f.userStoryIcons),artifactId:null===(i=g[c])||void 0===i?void 0:i.artifactId,segmentExampleComponent:x,handleViewGlossary:p})}))},Editor:function(n){var s,l=n.Component,r=n.onBlur,d=u(),c=d.selectedStreamingStoryIndex,v=d.isEditing,S=d.setUserStoryCopy,m=a.useRequirementAI(),g=m.userStory,y=m.customStyles,f=null==y?void 0:y.textEditorStyles;if(!v)return null;return t.jsx("div",e.__assign({className:o.default.editorWrapper,style:null==f?void 0:f.wrapper},{children:t.jsx(l,{minHeight:"100%",height:"100%",type:"string",value:i.formatMarkdown(null===(s=g[c])||void 0===s?void 0:s.value)||"",handleUpdateState:function(t,n){var s,l=i.indentMarkdown(n),r=null===(s=g[c])||void 0===s?void 0:s.storyNumber;S(function(t){var n=e.__spreadArray([],t,!0),s=n.findIndex(function(e){return e.storyNumber===r});return-1===s||(n[s]=e.__assign(e.__assign({},n[s]),{value:l})),n})},doNotShowBorderInViewMode:!1,onBlur:r,mode:"edit",customStyles:f})}))},SubFeatures:function(){var n,s=u(),l=s.selectedStreamingStoryIndex,i=s.isEditingModeOn,d=s.setIsEditingModeOn,c=s.scenario,v=s.isCitationLoadingNotStarted,S=a.useRequirementAI().userStory,y=(null===(n=null==S?void 0:S[l])||void 0===n?void 0:n.sub_features)||[];return 0===y.length&&"streaming"===c?t.jsx(m,{}):t.jsxs(t.Fragment,{children:[y.map(function(e){return t.jsx(r.default,{parentArtifactId:null==S?void 0:S[l].artifactId,artifactId:e.artifactId,title:e.title,content:e.value,aiReasoning:e.aiReasoning||[],isEditingModeOn:i,setIsEditingModeOn:d,isCitationLoadingDisplay:"streaming"===c},e.artifactId)}),"streaming"===c&&v&&t.jsx("div",e.__assign({className:o.default.subFeatureSkeletonWrapper},{children:t.jsx(g,{})}))]})},ScrollButton:function(){var n=u(),s=n.isAtBottom,i=n.isSidebarExpanded,r=n.scrollToBottom,d=n.isScrollBtnBouncing,c=a.useRequirementAI(),v=c.userStory,S=c.customStyles,m=null==S?void 0:S.userStoryScreenStyles;return!(null==v?void 0:v.length)||s?null:t.jsx("div",e.__assign({className:"".concat(o.default.scrollBtnWrapper," ").concat(i?o.default.scrollExpanded:o.default.scrollCollapsed),style:null==m?void 0:m.scrollBtnWrapper},{children:t.jsx("button",e.__assign({onClick:r,className:"".concat(o.default.scrollBtn," ").concat(d?o.default.bounce:""),style:null==m?void 0:m.scrollBtn,"aria-label":"Scroll to bottom"},{children:t.jsx(l.ChevronDown,{size:20})}))}))}});exports.default=y;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),s=require("react-resizable-panels"),i=require("lucide-react"),l=require("../../utils/helpers.js"),r=require("./SubfeatureBlock.js"),o=require("./UserStoryScreen.module.css.js"),a=require("../RequirementAIWrapper/RequirementAIWrapper.js"),d=n.createContext(null),u=function(){var e=n.useContext(d);if(!e)throw new Error("UserStoryScreen must be used inside its provider");return e},c=function(n){var s,i,l=n.AtomicButton,r=u(),d=r.selectedStreamingStoryIndex,c=r.isCitationLoadingNotStarted,m=r.classNames,g=r.scenario,y=a.useRequirementAI(),f=y.userStory,x=y.customStyles,p=null==x?void 0:x.userStoryScreenStyles;return(null==f?void 0:f.length)?t.jsxs("div",e.__assign({className:"".concat(o.default.header," ").concat(null!==(s=null==m?void 0:m.header)&&void 0!==s?s:""),style:null==p?void 0:p.header},{children:[t.jsxs("div",e.__assign({className:o.default.headerLeftContainer},{children:[t.jsx("span",e.__assign({className:o.default.headerTitle,style:null==p?void 0:p.headerTitle},{children:null===(i=f[d])||void 0===i?void 0:i.title})),"streaming"===g&&t.jsxs("span",e.__assign({className:o.default.headerSubtitle,style:null==p?void 0:p.headerSubtitle},{children:[t.jsx("span",e.__assign({className:o.default.streamingText,style:null==p?void 0:p.streamingText},{children:c?"Generating Requirement Doc":"Hang tight! We're loading the citations."}))," • Review & edit blocks as we build"]}))]})),t.jsx(v,{AtomicButton:l})]})):t.jsx(S,{classNames:m})},v=function(n){var s=n.AtomicButton,l=u(),r=l.isEditing,d=l.isEditingModeOn,c=l.setIsEditing,v=l.setIsEditingModeOn,S=l.userStoryCopy,m=a.useRequirementAI(),g=m.userStory,y=m.setUserStory,f=m.customStyles,x=null==f?void 0:f.userStoryScreenStyles;return(null==g?void 0:g.length)?r?t.jsxs("div",e.__assign({className:o.default.actions,style:null==x?void 0:x.actions},{children:[t.jsx(s,e.__assign({type:"outline",onClick:function(){c(!1),v(!1)},style:null==x?void 0:x.cancelAtomicButton},{children:"Cancel"})),t.jsx(s,e.__assign({type:"fill",onClick:function(){y(S),c(!1),v(!1)},style:null==x?void 0:x.saveAtomicButton},{children:"Save"}))]})):d?null:t.jsx("div",e.__assign({className:o.default.editToggleWrapper},{children:t.jsx("button",e.__assign({className:o.default.editToggleBtn,style:null==x?void 0:x.editToggleBtn,onClick:function(){c(!0),v(!0)}},{children:t.jsx(i.PencilIcon,{size:16})}))})):null},S=function(n){var s,i=n.classNames;return t.jsxs("div",e.__assign({className:"".concat(o.default.header," ").concat(null!==(s=null==i?void 0:i.header)&&void 0!==s?s:"")},{children:[t.jsx("div",{className:o.default.skeletonTitle}),t.jsx("div",{className:o.default.skeletonSubtitle})]}))},m=function(){var n,s=a.useRequirementAI().customStyles,i=null===(n=null==s?void 0:s.userStoryScreenStyles)||void 0===n?void 0:n.accordionSkeleton;return t.jsxs("div",e.__assign({className:o.default.accordionSkeleton,style:null==i?void 0:i.wrapper},{children:[t.jsx("div",{className:o.default.skeletonLine,style:null==i?void 0:i.line}),t.jsx("div",{className:o.default.skeletonBox,style:null==i?void 0:i.box})]}))},g=function(){var n,s=a.useRequirementAI().customStyles,i=null===(n=null==s?void 0:s.userStoryScreenStyles)||void 0===n?void 0:n.subFeatureSkeleton;return t.jsxs("div",e.__assign({className:o.default.subFeatureSkeleton,style:null==i?void 0:i.wrapper},{children:[t.jsx("div",{className:o.default.skeletonLine,style:null==i?void 0:i.line}),t.jsx("div",{className:o.default.skeletonLine,style:null==i?void 0:i.line}),t.jsx("div",{className:o.default.skeletonLine,style:null==i?void 0:i.line})]}))},y=Object.assign(function(i){var l,r,u,c,v,S=i.scenario,m=i.isCitationLoadingNotStarted,g=i.children,y=i.classNames,f=i.artifactTitleIds,x=a.useRequirementAI(),p=x.userStory,_=x.customStyles,h=n.useState(0),j=h[0],I=h[1],b=n.useState(!0),N=b[0],C=b[1],E=n.useState(!1),B=E[0],R=E[1],A=n.useState(!1),q=A[0],k=A[1],T=n.useState(!1),w=T[0],L=T[1],P=n.useState(!1),M=P[0],z=P[1],O=n.useState(p),W=O[0],H=O[1],U=n.useRef(null),F=n.useRef(null);return n.useEffect(function(){H(p)},[p]),n.useEffect(function(){R(!0);var e=setTimeout(function(){return R(!1)},2e3);return function(){return clearTimeout(e)}},[null===(r=null===(l=null==p?void 0:p[j])||void 0===l?void 0:l.sub_features)||void 0===r?void 0:r.length]),n.useEffect(function(){var e=F.current;if(e){var t=function(){k(e.scrollHeight-e.scrollTop-e.clientHeight<20)};return e.addEventListener("scroll",t),function(){return e.removeEventListener("scroll",t)}}},[null==p?void 0:p[j]]),t.jsx(d.Provider,e.__assign({value:{scenario:S,isCitationLoadingNotStarted:m,selectedStreamingStoryIndex:j,setSelectedStreamingStoryIndex:I,isSidebarExpanded:N,setIsSidebarExpanded:C,sidebarPanelRef:U,isEditing:w,setIsEditing:L,isEditingModeOn:M,setIsEditingModeOn:z,userStoryCopy:W,setUserStoryCopy:H,scrollContainerRef:F,isAtBottom:q,isScrollBtnBouncing:B,scrollToBottom:function(){F.current&&F.current.scrollTo({top:F.current.scrollHeight,behavior:"smooth"})},classNames:y,artifactTitleIds:f}},{children:t.jsx("div",e.__assign({className:"".concat(o.default.container," ").concat(null!==(u=null==y?void 0:y.container)&&void 0!==u?u:""),style:e.__assign({},null===(c=null==_?void 0:_.userStoryScreenStyles)||void 0===c?void 0:c.wrapperContainer)},{children:t.jsx(s.PanelGroup,e.__assign({direction:"horizontal",className:o.default.panelGroup,style:null===(v=null==_?void 0:_.userStoryScreenStyles)||void 0===v?void 0:v.panelGroup},{children:g}))}))}))},{Sidebar:function(n){var i,l=n.Component,r=u(),d=r.selectedStreamingStoryIndex,c=r.setSelectedStreamingStoryIndex,v=r.isSidebarExpanded,S=r.setIsSidebarExpanded,m=r.sidebarPanelRef,g=r.scenario,y=r.artifactTitleIds,f=a.useRequirementAI(),x=f.userStory,p=f.customStyles;return t.jsx(s.Panel,e.__assign({ref:m,defaultSize:25,minSize:15,collapsible:!0,collapsedSize:0,onCollapse:function(){return S(!1)},onExpand:function(){return S(!0)},id:"streaming-sidebar",order:1,className:o.default.sidebarPanel,style:null===(i=null==p?void 0:p.userStoryScreenStyles)||void 0===i?void 0:i.sidebarPanel},{children:t.jsx(l,{streamingUserStories:x,selectedStreamingStoryIndex:d,setSelectedStreamingStoryIndex:c,isSidebarExpanded:v,isStreamingScreen:"streaming"===g,artifactTitleIds:y})}))},SidebarToggle:function(n){var i=n.OpenIcon,l=n.CloseIcon,r=u(),d=r.isSidebarExpanded;r.setIsSidebarExpanded;var c=r.sidebarPanelRef,v=a.useRequirementAI().customStyles,S=null==v?void 0:v.userStoryScreenStyles;return t.jsx(s.PanelResizeHandle,e.__assign({className:o.default.resizeHandle,style:null==S?void 0:S.resizeHandle},{children:t.jsx("button",e.__assign({className:o.default.sidebarToggleBtn,onClick:function(e){e.stopPropagation(),function(){var e,t;d?null===(e=c.current)||void 0===e||e.collapse():null===(t=c.current)||void 0===t||t.expand()}()},style:null==S?void 0:S.sidebarToggleBtn},{children:d?t.jsx(l,{}):t.jsx(i,{})}))}))},Content:function(n){var i,l=n.children,r=n.AtomicButton,d=u(),v=d.scrollContainerRef,S=d.classNames,m=a.useRequirementAI().customStyles,g=null==m?void 0:m.userStoryScreenStyles;return t.jsx(s.Panel,e.__assign({minSize:0,id:"streaming-content",order:2,className:o.default.contentPanel,style:null==g?void 0:g.contentPanel},{children:t.jsxs("div",e.__assign({ref:v,className:"".concat(o.default.scrollContainer," ").concat(null!==(i=null==S?void 0:S.scrollContainer)&&void 0!==i?i:""),style:null==g?void 0:g.scrollContainer},{children:[t.jsx(c,{AtomicButton:r}),l]}))}))},Body:function(e){var n=e.children,s=a.useRequirementAI(),i=s.userStory;return s.setUserStory,(null==i?void 0:i.length)?t.jsx(t.Fragment,{children:n}):null},Story:function(n){var s,i,l,r=n.Component,d=u(),c=d.selectedStreamingStoryIndex,v=d.isEditing,S=d.scenario,m=a.useRequirementAI(),g=m.userStory,y=m.customStyles,f=m.customIcons,x=m.segmentDataList,p=m.handleViewGlossary,_=m.getSegmentExampleComponent,h=null==y?void 0:y.userStoryScreenStyles,j=null==h?void 0:h.userStoryContentStyles;return v?null:t.jsx("div",e.__assign({className:o.default.storyWrapper,style:null==h?void 0:h.storyWrapper},{children:t.jsx(r,{message:null===(s=g[c])||void 0===s?void 0:s.value,aiReasoningsForBlock:(null===(i=g[c])||void 0===i?void 0:i.aiReasoning)||[],isCitationLoadingDisplay:"streaming"===S,customStyles:e.__assign({},j),customIcons:e.__assign({},null==f?void 0:f.userStoryIcons),artifactId:null===(l=g[c])||void 0===l?void 0:l.artifactId,getSegmentExampleComponent:_,handleViewGlossary:p,segmentDataList:x})}))},Editor:function(n){var s,i=n.Component,r=n.onBlur,d=u(),c=d.selectedStreamingStoryIndex,v=d.isEditing,S=d.setUserStoryCopy,m=a.useRequirementAI(),g=m.userStory,y=m.customStyles,f=null==y?void 0:y.textEditorStyles;if(!v)return null;return t.jsx("div",e.__assign({className:o.default.editorWrapper,style:null==f?void 0:f.wrapper},{children:t.jsx(i,{minHeight:"100%",height:"100%",type:"string",value:l.formatMarkdown(null===(s=g[c])||void 0===s?void 0:s.value)||"",handleUpdateState:function(t,n){var s,i=l.indentMarkdown(n),r=null===(s=g[c])||void 0===s?void 0:s.storyNumber;S(function(t){var n=e.__spreadArray([],t,!0),s=n.findIndex(function(e){return e.storyNumber===r});return-1===s||(n[s]=e.__assign(e.__assign({},n[s]),{value:i})),n})},doNotShowBorderInViewMode:!1,onBlur:r,mode:"edit",customStyles:f})}))},SubFeatures:function(){var n,s=u(),i=s.selectedStreamingStoryIndex,l=s.isEditingModeOn,d=s.setIsEditingModeOn,c=s.scenario,v=s.isCitationLoadingNotStarted,S=a.useRequirementAI().userStory,y=(null===(n=null==S?void 0:S[i])||void 0===n?void 0:n.sub_features)||[];return 0===y.length&&"streaming"===c?t.jsx(m,{}):t.jsxs(t.Fragment,{children:[y.map(function(e){return t.jsx(r.default,{parentArtifactId:null==S?void 0:S[i].artifactId,artifactId:e.artifactId,title:e.title,content:e.value,aiReasoning:e.aiReasoning||[],isEditingModeOn:l,setIsEditingModeOn:d,isCitationLoadingDisplay:"streaming"===c},e.artifactId)}),"streaming"===c&&v&&t.jsx("div",e.__assign({className:o.default.subFeatureSkeletonWrapper},{children:t.jsx(g,{})}))]})},ScrollButton:function(){var n=u(),s=n.isAtBottom,l=n.isSidebarExpanded,r=n.scrollToBottom,d=n.isScrollBtnBouncing,c=a.useRequirementAI(),v=c.userStory,S=c.customStyles,m=null==S?void 0:S.userStoryScreenStyles;return!(null==v?void 0:v.length)||s?null:t.jsx("div",e.__assign({className:"".concat(o.default.scrollBtnWrapper," ").concat(l?o.default.scrollExpanded:o.default.scrollCollapsed),style:null==m?void 0:m.scrollBtnWrapper},{children:t.jsx("button",e.__assign({onClick:r,className:"".concat(o.default.scrollBtn," ").concat(d?o.default.bounce:""),style:null==m?void 0:m.scrollBtn,"aria-label":"Scroll to bottom"},{children:t.jsx(i.ChevronDown,{size:20})}))}))}});exports.default=y;
|
|
2
2
|
//# sourceMappingURL=UserStoryScreen.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"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),d=require("@mui/material"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),p=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),j=require("../segment/Segment.js");function y(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=y(t),S=y(o),I=i.createContext(!1),w=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),b=i.createContext({rowId:""}),N=function(t){var o,l=t.aiReason,r=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(w),u=c.expandedInfo,g=c.setExpanded,h=c.reasonToRow,m=i.useContext(b).rowId,C=String(l.id);m&&h.current.set(C,m);var p=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==s?void 0:s.highConfidence)||n.jsx(v.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(p?null:m,p?null:l)}},{children:[_,p?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},q=function(t){var o,l,r=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(w).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,h=null!==(l=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(b.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:h?{cssText:h}:void 0},{children:r})),v&&(null==g?void 0:g.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(_.default,{aiReason:g.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}})}))}))}))}))]}))};exports.default=function(t){var o=t.message,v=t.isParent,f=t.scenario,_=t.showUserStoryDiff,y=void 0!==_&&_,b=t.aiReasoningsForBlock,A=t.isCitationLoadingDisplay,E=void 0!==A&&A,k=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var M=t.customStyles,T=t.customIcons,U=t.aiReasoningDiffView,L=t.userStoryCitations,P=t.artifactId,H=t.isCraflow,$=t.onCraAccept,D=t.onCraReject,F=t.craFlowConfig,O=t.isDisplayHighlightControl,B=void 0!==O&&O,G=t.segmentExampleComponent,W=t.handleViewGlossary,z=i.useRef(null),V=g.useRequirementAI(),Q=V.userStory,J=V.inlineUpdateComponentConfig,K=V.getAvgScoreForStory,X=V.setUserStory,Y=V.aiReasoning,Z=V.setAiReasoning,ee=V.customIcons,ne=V.searchQueryList,ie=V.searchQueryReasoningIdList,te=V.currentHighlightIndex,oe=null!=T?T:null==ee?void 0:ee.userStoryIcons;null==M||M.searchHighlight;var ae=l.useMarkdownSearch(z),le=ae.search,re=ae.clear,de=i.useState("1"),se=de[0],ce=de[1],ue=i.useState(null),ge=ue[0],ve=ue[1],fe=i.useRef(new Map),he=i.useCallback(function(e,n){ve(e&&n?{rowId:e,aiReason:n}:null)},[]),me=P?K(P):0,Ce=i.useState([]),pe=Ce[0],_e=Ce[1],xe=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],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=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==l?void 0:l[1])||""),changedItemCount:d((null==r?void 0:r[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,l=s.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(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.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(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||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},je=i.useMemo(function(){return o?xe(o):o},[o]);i.useEffect(function(){_e(b||Y)},[b,Y]);var ye=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,d=Y.find(function(e){return e.id.toString()===r});return d?n.jsx(x.default,e.__assign({aiReason:d,customStyles:null==M?void 0:M.inlineUpdatedComponent,handleClickCognitiveDecision:null==J?void 0:J.handleClickCognitiveDecision,handleClickUpdatedPill:null==J?void 0:J.handleClickUpdatedPill},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==M?void 0:M.deleted},o,{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==M?void 0:M.inserted},o,{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==M?void 0:M.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==M?void 0:M.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==M?void 0:M.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==M?void 0:M.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==M?void 0:M.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(s.default,e.__assign({},o,{showUserStoryDiff:y,currentUpdatedTagId:se,setCurrentUpdatedTagId:ce,userStory:Q,setUserStory:X,setAiReasoning:Z,node:t,isCraflow:H,onCraAccept:$,onCraReject:D,customStyles:null==M?void 0:M.updatedContent,craFlowConfig:F}))},ol:function(i){var t,o,l,r=i.node,d=e.__rest(i,["node"]),s=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==M?void 0:M.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==M?void 0:M.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==M?void 0:M.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(q,{node:i,children:t,customStyles:M})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,d=e.__rest(l,["style"]);return n.jsx(I.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,d=e.__rest(l,["style"]);return n.jsx(I.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:r?{cssText:r}: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==M?void 0:M.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline,t.children,t.node;var r=e.__rest(t,["inline","children","node"]),d=i.useContext(I)||"true"==(null==r?void 0:r.table),s="".concat(null==r?void 0:r.href),c=null===(o=s.split("$"))||void 0===o?void 0:o[0],u=null===(a=s.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===c){var g=(null!==(l=y?U:Y)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)}),v=ie.includes(u);if(g)return d?n.jsx(N,{aiReason:g,customStyle:null==M?void 0:M.tableAiReasoning,customIcons:oe,isHighConfidence:g.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING}):n.jsx(h.default,{aiReason:g,isSourceHasHighlight:v,customIcons:oe,customStyles:{aiReasoningContent:null==M?void 0:M.aiReasoningContent,aiReasoningAccordion:null==M?void 0:M.aiReasoningAccordion,aiReasoningMarkdown:null==M?void 0:M.aiReasoningMarkdown,aiReasoningPill:null==M?void 0:M.aiReasoningPill,webCitation:null==M?void 0:M.webCitation,stormeeCitation:null==M?void 0:M.stormeeCitation,waveformCitation:null==M?void 0:M.waveformCitation,imageCitation:null==M?void 0:M.imageCitation,fileCitation:null==M?void 0:M.fileCitation,appModCitation:null==M?void 0:M.appModCitation,rcaCitation:null==M?void 0:M.rcaCitation,readFileCitation:null==M?void 0:M.readFileCitation,loadingCitations:null==M?void 0:M.loadingCitations,chatCitation:null==M?void 0:M.chatCitation,bigEnoughCitation:null==M?void 0:M.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==M?void 0:M.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==M?void 0:M.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.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(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==M?void 0:M.generatedCodePill,content:null==M?void 0:M.generatedCodeContent}})},segment:function(i){var t,o,a,l,r,d,s,c;i.node;var u=i.children,g=e.__rest(i,["node","children"]),v=(null==g?void 0:g.id)||"Segment",f=(null==g?void 0:g.decisionstrength)||"80",h=null!==(t=null==g?void 0:g.cognitivedecisionid)&&void 0!==t?t:-1,m=(null!==(o=y?U:Y)&&void 0!==o?o:[]).find(function(e){return String(e.id)===String(h)});return n.jsx(j.default,{id:v,label:u,decisionStrength:f,aiReason:m,customIcons:T,aiReasoningCitationCustomStyles:M,segmentExampleComponent:G,handleViewGlossary:W,customStyles:{container:null===(a=null==M?void 0:M.segment)||void 0===a?void 0:a.container,label:null===(l=null==M?void 0:M.segment)||void 0===l?void 0:l.label,decisionStrength:null===(r=null==M?void 0:M.segment)||void 0===r?void 0:r.decisionStrength,buttonContainer:null===(d=null==M?void 0:M.segment)||void 0===d?void 0:d.buttonContainer,cheveronIcon:null===(s=null==M?void 0:M.segment)||void 0===s?void 0:s.cheveronIcon,segmentExample:null===(c=null==M?void 0:M.segment)||void 0===c?void 0:c.segmentExample}})}}},[pe,F,Y,L,se,y,o,T,ne,ie,M]);return i.useEffect(function(){if(z.current){if(ne.length){var e;if(0===ie.length||B)requestAnimationFrame(function(){le([ne[te].replace(/\*/g,"")])});else{var n=z.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){le([ne[te].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}re()}},[ne,ie,te,B]),n.jsx(w.Provider,e.__assign({value:{expandedInfo:ge,setExpanded:he,reasonToRow:fe}},{children:n.jsxs("div",e.__assign({ref:z,className:"".concat(a.default.container," ").concat("approving"!==f?a.default.wrapper:""," ").concat(k||""),style:null==M?void 0:M.container},{children:[n.jsx(R.default,e.__assign({components:ye,rehypePlugins:[S.default]},{children:je})),me>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==M?void 0:M.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==M?void 0:M.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==M?void 0:M.confidenceScoreIconColor)||"#166534"}),me,"%"]}))})),E&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==M?void 0:M.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==M?void 0:M.citationLoadingContainer,icon:null==M?void 0:M.citationLoadingIcon,text:null==M?void 0:M.citationLoadingText}})})),v&&n.jsx("div",e.__assign({className:"flex mt-5"},{children:n.jsx(p.default,{})}))]}))}))};
|
|
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"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),d=require("@mui/material"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),g=require("../../icons/CognitiveDecision.js"),h=require("../../icons/BrainRed.js"),f=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),p=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),y=require("../segment/Segment.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var S=j(t),R=j(o),I=i.createContext(!1),w=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),b=i.createContext({rowId:""}),N=function(t){var o,l=t.aiReason,r=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(w),u=c.expandedInfo,v=c.setExpanded,f=c.reasonToRow,m=i.useContext(b).rowId,p=String(l.id);m&&f.current.set(p,m);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==s?void 0:s.highConfidence)||n.jsx(g.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(h.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),v(C?null:m,C?null:l)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},q=function(t){var o,l,r=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,v=i.useContext(w).expandedInfo,g=(null==v?void 0:v.rowId)===u,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,f=null!==(l=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(b.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:f?{cssText:f}:void 0},{children:r})),g&&(null==v?void 0:v.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:h||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(_.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}})}))}))}))}))]}))};exports.default=function(t){var o,g=t.message,h=t.isParent,_=t.scenario,j=t.showUserStoryDiff,b=void 0!==j&&j,A=t.aiReasoningsForBlock,E=t.isCitationLoadingDisplay,k=void 0!==E&&E,M=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var T=t.customStyles,U=t.customIcons,L=t.aiReasoningDiffView,P=t.userStoryCitations,D=t.artifactId,F=t.isCraflow,H=t.onCraAccept,$=t.onCraReject,O=t.craFlowConfig,B=t.isDisplayHighlightControl,G=void 0!==B&&B;t.segmentExampleComponent;var W=t.handleFetchSegmentDetails,z=t.handleViewGlossary,V=t.getSegmentExampleComponent,Q=t.segmentDataList,J=i.useRef(null),K=v.useRequirementAI(),X=K.userStory,Y=K.inlineUpdateComponentConfig,Z=K.getAvgScoreForStory,ee=K.setUserStory,ne=K.aiReasoning,ie=K.setAiReasoning,te=K.customIcons,oe=K.searchQueryList,ae=K.searchQueryReasoningIdList,le=K.currentHighlightIndex,re=null!=U?U:null==te?void 0:te.userStoryIcons;null==T||T.searchHighlight;var de=l.useMarkdownSearch(J),se=de.search,ce=de.clear,ue=i.useState("1"),ve=ue[0],ge=ue[1],he=i.useState(null),fe=he[0],me=he[1],pe=i.useRef(new Map),Ce=i.useCallback(function(e,n){me(e&&n?{rowId:e,aiReason:n}:null)},[]),_e=D?Z(D):0,xe=i.useState([]),ye=xe[0],je=xe[1],Se=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],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=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==l?void 0:l[1])||""),changedItemCount:d((null==r?void 0:r[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,l=s.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(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.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(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||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},Re=i.useMemo(function(){return g?Se(g):g},[g]);i.useEffect(function(){je(A||ne)},[A,ne]);var Ie=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,d=ne.find(function(e){return e.id.toString()===r});return d?n.jsx(x.default,e.__assign({aiReason:d,customStyles:null==T?void 0:T.inlineUpdatedComponent,handleClickCognitiveDecision:null==Y?void 0:Y.handleClickCognitiveDecision,handleClickUpdatedPill:null==Y?void 0:Y.handleClickUpdatedPill},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==T?void 0:T.deleted},o,{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==T?void 0:T.inserted},o,{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==T?void 0:T.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==T?void 0:T.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==T?void 0:T.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==T?void 0:T.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==T?void 0:T.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(s.default,e.__assign({},o,{showUserStoryDiff:b,currentUpdatedTagId:ve,setCurrentUpdatedTagId:ge,userStory:X,setUserStory:ee,setAiReasoning:ie,node:t,isCraflow:F,onCraAccept:H,onCraReject:$,customStyles:null==T?void 0:T.updatedContent,craFlowConfig:O}))},ol:function(i){var t,o,l,r=i.node,d=e.__rest(i,["node"]),s=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==T?void 0:T.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==T?void 0:T.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==T?void 0:T.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(q,{node:i,children:t,customStyles:T})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,d=e.__rest(l,["style"]);return n.jsx(I.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,d=e.__rest(l,["style"]);return n.jsx(I.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:r?{cssText:r}: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(p.default,e.__assign({},o,{customStyles:null==T?void 0:T.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline,t.children,t.node;var r=e.__rest(t,["inline","children","node"]),d=i.useContext(I)||"true"==(null==r?void 0:r.table),s="".concat(null==r?void 0:r.href),c=null===(o=s.split("$"))||void 0===o?void 0:o[0],u=null===(a=s.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===c){var v=(null!==(l=b?L:ne)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)}),g=ae.includes(u);if(v)return d?n.jsx(N,{aiReason:v,customStyle:null==T?void 0:T.tableAiReasoning,customIcons:re,isHighConfidence:v.relevance_score>=f.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING}):n.jsx(f.default,{aiReason:v,isSourceHasHighlight:g,customIcons:re,customStyles:{aiReasoningContent:null==T?void 0:T.aiReasoningContent,aiReasoningAccordion:null==T?void 0:T.aiReasoningAccordion,aiReasoningMarkdown:null==T?void 0:T.aiReasoningMarkdown,aiReasoningPill:null==T?void 0:T.aiReasoningPill,webCitation:null==T?void 0:T.webCitation,stormeeCitation:null==T?void 0:T.stormeeCitation,waveformCitation:null==T?void 0:T.waveformCitation,imageCitation:null==T?void 0:T.imageCitation,fileCitation:null==T?void 0:T.fileCitation,appModCitation:null==T?void 0:T.appModCitation,rcaCitation:null==T?void 0:T.rcaCitation,readFileCitation:null==T?void 0:T.readFileCitation,loadingCitations:null==T?void 0:T.loadingCitations,chatCitation:null==T?void 0:T.chatCitation,bigEnoughCitation:null==T?void 0:T.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==T?void 0:T.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==T?void 0:T.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.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(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==T?void 0:T.generatedCodePill,content:null==T?void 0:T.generatedCodeContent}})},segment:function(i){var t,o,a,l,r,d,s,c,u,v;i.node;var g=i.children,h=e.__rest(i,["node","children"]),f=(null==h?void 0:h.id)||"Segment",m=(null==h?void 0:h.decisionstrength)||"80",p=null==Q?void 0:Q.find(function(e){return String(e.segment_id)===String(f)}),C={id:f,reason:null!==(t=null==p?void 0:p.reason)&&void 0!==t?t:"",gap:null!==(o=null==p?void 0:p.gap)&&void 0!==o?o:"",explanation:null!==(a=null==p?void 0:p.explanation)&&void 0!==a?a:"",relevance_score:null!==(l=null==p?void 0:p.relevance_score)&&void 0!==l?l:0,isOpen:!1},_=void 0;return W&&W(f),f&&p&&V&&(_=V(f,"".concat(g),p.segment_type)),n.jsx(y.default,{id:f,label:null==p?void 0:p.segment_name,originalValue:g,decisionStrength:m,aiReason:C,customIcons:U,aiReasoningCitationCustomStyles:T,segmentExampleComponent:_,handleViewGlossary:z,customStyles:{container:null===(r=null==T?void 0:T.segment)||void 0===r?void 0:r.container,label:null===(d=null==T?void 0:T.segment)||void 0===d?void 0:d.label,decisionStrength:null===(s=null==T?void 0:T.segment)||void 0===s?void 0:s.decisionStrength,buttonContainer:null===(c=null==T?void 0:T.segment)||void 0===c?void 0:c.buttonContainer,cheveronIcon:null===(u=null==T?void 0:T.segment)||void 0===u?void 0:u.cheveronIcon,segmentExample:null===(v=null==T?void 0:T.segment)||void 0===v?void 0:v.segmentExample}})}}},[ye,O,ne,P,ve,b,g,U,oe,ae,T]);return i.useEffect(function(){if(J.current){if(oe.length){var e;if(0===ae.length||G)requestAnimationFrame(function(){se([oe[le].replace(/\*/g,"")])});else{var n=J.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){se([oe[le].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ce()}},[oe,ae,le,G]),n.jsx(w.Provider,e.__assign({value:{expandedInfo:fe,setExpanded:Ce,reasonToRow:pe}},{children:n.jsxs("div",e.__assign({ref:J,className:"".concat(a.default.container," ").concat("approving"!==_?a.default.wrapper:""," ").concat(M||""),style:null==T?void 0:T.container},{children:[n.jsx(S.default,e.__assign({components:Ie,rehypePlugins:[R.default]},{children:Re})),_e>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==T?void 0:T.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==T?void 0:T.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==T?void 0:T.confidenceScoreIconColor)||"#166534"}),_e,"%"]}))})),k&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==T?void 0:T.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==T?void 0:T.citationLoadingContainer,icon:null==T?void 0:T.citationLoadingIcon,text:null==T?void 0:T.citationLoadingText}})})),h&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==T?void 0:T.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(C.default,{})}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),s=require("react"),n=require("../UserStoryPicker.context.js");function a(){return r.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function t(){return r.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r.jsx("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"})}))}function i(){return r.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function o(e){try{return new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(r){return e}}exports.ProjectCard=function(l){var c,d,u=l.project,p=l.className,_=l.style,j=l.headerStyle,h=l.titleStyle,m=l.descriptionStyle,x=l.metaStyle,g=n.useUSPContext(),f=g.dispatch,v=g.classNames,y=g.renderProps,k=g.onProjectSelect,w=g.onViewMoreDescription,S=s.useState(!1),C=S[0],L=S[1],N=s.useCallback(function(e){e.stopPropagation(),L(function(e){return!e})},[]),b=C?u.description:(null!==(d=null===(c=u.description)||void 0===c?void 0:c.length)&&void 0!==d?d:0)>100?u.description.slice(0,100):u.description,B=u.description.length>100
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),s=require("react"),n=require("../UserStoryPicker.context.js");function a(){return r.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function t(){return r.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r.jsx("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"})}))}function i(){return r.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function o(e){try{return new Date(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(r){return e}}exports.ProjectCard=function(l){var c,d,u=l.project,p=l.className,_=l.style,j=l.headerStyle,h=l.titleStyle,m=l.descriptionStyle,x=l.metaStyle,g=n.useUSPContext(),f=g.dispatch,v=g.classNames,y=g.renderProps,k=g.onProjectSelect,w=g.onViewMoreDescription,S=s.useState(!1),C=S[0],L=S[1],N=s.useCallback(function(e){e.stopPropagation(),L(function(e){return!e})},[]),b=C?u.description:(null!==(d=null===(c=u.description)||void 0===c?void 0:c.length)&&void 0!==d?d:0)>100?u.description.slice(0,100):u.description,B=u.description.length>100,P=s.useCallback(function(){f({type:"SELECT_PROJECT",payload:u.id}),null==k||k(u)},[f,u,k]);s.useCallback(function(e){e.stopPropagation(),null==w||w(u)},[w,u]);var A=["usp-card usp-card--project",v.card,p].filter(Boolean).join(" ");return y.renderProjectCard?r.jsx(r.Fragment,{children:y.renderProjectCard(u)}):r.jsxs("div",e.__assign({className:A,style:_,onClick:P,role:"button",tabIndex:0},{children:[r.jsxs("div",e.__assign({className:["usp-card__header",v.cardHeader].filter(Boolean).join(" "),style:j},{children:[r.jsx("span",e.__assign({className:"usp-card__icon"},{children:y.renderFolderIcon?y.renderFolderIcon():r.jsx(a,{})})),r.jsx("span",e.__assign({className:["usp-card__title",v.cardTitle].filter(Boolean).join(" "),style:h},{children:u.name})),r.jsxs("span",e.__assign({className:["usp-card__artifact-count",v.cardArtifactCount].filter(Boolean).join(" ")},{children:[r.jsx(i,{}),u.artifactCount," Artifacts"]}))]})),void 0!==u.summary&&r.jsxs("div",e.__assign({className:["usp-card__summary-label",v.cardSummaryLabel].filter(Boolean).join(" ")},{children:[y.renderSparkleIcon?y.renderSparkleIcon():r.jsx(t,{}),"Summary"]})),r.jsx("div",e.__assign({className:["usp-card-userstory-description",!u.description&&"usp-card__description--empty",v.cardDescription].filter(Boolean).join(" "),style:m},{children:u.description?r.jsxs(r.Fragment,{children:[b,B&&r.jsx("button",e.__assign({onClick:N,className:["usp-card-moreButton",v.cardViewMore].filter(Boolean).join(" "),"aria-label":C?"Show less":"Show more"},{children:C?"less":"..."}))]}):r.jsx("span",e.__assign({className:"usp-card__description--placeholder"},{children:"No Description available"}))})),r.jsx("div",e.__assign({className:"usp-card__meta",style:x},{children:r.jsxs("span",e.__assign({className:["usp-card__date",v.cardDate].filter(Boolean).join(" ")},{children:["Last Updated: ",o(u.lastUpdated)]}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=ProjectCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("../UserStoryPicker.context.js"),s=require("./Badge.js"),i=require("./CardProceedButton.js"),a=require("../lib/CustomTooltip.js"),o=require("../../RequirementAI/components/ai-reasoning/AiReasoningCitation.js"),l=require("../../RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js"),u=require("../../RequirementAI/utils/helpers.js");function c(t){var r=t.filled;return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"})}))}function d(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function p(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function _(e){try{var n=e.split(" "),t=n[0],r=n[1],s=void 0===r?"00:00:00":r,i=t.split("/"),a=i[0],o=i[1],l=i[2];if(!a||!o||!l)return e;var u=Number(l)+2e3,c="".concat(u,"-").concat(o,"-").concat(a,"T").concat(s),d=new Date(c);return isNaN(d.getTime())?e:d.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(n){return e}}exports.UserStoryCard=function(f){var v,g,h,m=this,j=f.story,x=f.className,y=f.style,S=f.headerStyle,w=f.titleStyle,C=f.descriptionStyle,k=f.metaStyle,N=r.useUSPContext(),b=N.state,A=N.dispatch,B=N.classNames,q=N.renderProps,I=N.onStorySelect,R=N.onFavoriteToggle,U=N.adapter,P=N.disableTooltip,L=N.tooltipClassName,M=N.mediaCacheHooks,T=N.showCitations,E=b.selectedStoryId===j.user_story_id,F=t.useState(!1),D=F[0],G=F[1],Q=t.useState(null!==(v=j.isFavorite)&&void 0!==v&&v),O=Q[0],V=Q[1],H=t.useState(!1),W=H[0],z=H[1],Z=t.useState(!1),Y=Z[0],J=Z[1],K=t.useState(null),X=K[0],$=K[1],ee=U.fetchFinalUserStory,ne=t.useCallback(function(n){return e.__awaiter(m,void 0,void 0,function(){var t,r,s,i;return e.__generator(this,function(e){switch(e.label){case 0:if(!ee||!n)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,ee(n)];case 2:return t=e.sent(),r=null!==(i=null===(s=null==t?void 0:t.artifactData)||void 0===s?void 0:s.citationsSnapshot)&&void 0!==i?i:null,$(r),[3,4];case 3:return e.sent(),$(null),[3,4];case 4:return[2]}})})},[ee]);t.useEffect(function(){T&&j.artifact_id&&ne(j.artifact_id)},[j.artifact_id,ne]);var te=t.useCallback(function(e){e.stopPropagation(),J(function(e){return!e})},[]),re=Y?j.description:(null!==(h=null===(g=j.description)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>100?j.description.slice(0,100):j.description,se=j.description.length>100;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),r=require("../UserStoryPicker.context.js"),s=require("./Badge.js"),i=require("./CardProceedButton.js"),a=require("../lib/CustomTooltip.js"),o=require("../../RequirementAI/components/ai-reasoning/AiReasoningCitation.js"),l=require("../../RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js"),u=require("../../RequirementAI/utils/helpers.js");function c(t){var r=t.filled;return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"})}))}function d(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})}))}function p(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})}))}function _(e){try{var n=e.split(" "),t=n[0],r=n[1],s=void 0===r?"00:00:00":r,i=t.split("/"),a=i[0],o=i[1],l=i[2];if(!a||!o||!l)return e;var u=Number(l)+2e3,c="".concat(u,"-").concat(o,"-").concat(a,"T").concat(s),d=new Date(c);return isNaN(d.getTime())?e:d.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}catch(n){return e}}exports.UserStoryCard=function(f){var v,g,h,m=this,j=f.story,x=f.className,y=f.style,S=f.headerStyle,w=f.titleStyle,C=f.descriptionStyle,k=f.metaStyle,N=r.useUSPContext(),b=N.state,A=N.dispatch,B=N.classNames,q=N.renderProps,I=N.onStorySelect,R=N.onFavoriteToggle,U=N.adapter,P=N.disableTooltip,L=N.tooltipClassName,M=N.mediaCacheHooks,T=N.showCitations,E=b.selectedStoryId===j.user_story_id,F=t.useState(!1),D=F[0],G=F[1],Q=t.useState(null!==(v=j.isFavorite)&&void 0!==v&&v),O=Q[0],V=Q[1],H=t.useState(!1),W=H[0],z=H[1],Z=t.useState(!1),Y=Z[0],J=Z[1],K=t.useState(null),X=K[0],$=K[1],ee=U.fetchFinalUserStory,ne=t.useCallback(function(n){return e.__awaiter(m,void 0,void 0,function(){var t,r,s,i;return e.__generator(this,function(e){switch(e.label){case 0:if(!ee||!n)return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,ee(n)];case 2:return t=e.sent(),r=null!==(i=null===(s=null==t?void 0:t.artifactData)||void 0===s?void 0:s.citationsSnapshot)&&void 0!==i?i:null,$(r),[3,4];case 3:return e.sent(),$(null),[3,4];case 4:return[2]}})})},[ee]);t.useEffect(function(){T&&j.artifact_id&&ne(j.artifact_id)},[j.artifact_id,ne]);var te=t.useCallback(function(e){e.stopPropagation(),J(function(e){return!e})},[]),re=Y?j.description:(null!==(h=null===(g=j.description)||void 0===g?void 0:g.length)&&void 0!==h?h:0)>100?j.description.slice(0,100):j.description,se=j.description.length>100;t.useEffect(function(){var e;V(null!==(e=j.isFavorite)&&void 0!==e&&e)},[j.isFavorite]),t.useEffect(function(){if(W){var e=window.setTimeout(function(){z(!1)},600);return function(){return window.clearTimeout(e)}}},[W]);var ie=t.useCallback(function(){A({type:"SELECT_STORY",payload:E?null:j.user_story_id}),E||null==I||I(j)},[A,E,j,I]),ae=t.useCallback(function(n){return e.__awaiter(m,void 0,void 0,function(){var t,r;return e.__generator(this,function(e){switch(e.label){case 0:return n.stopPropagation(),V(t=!O),t&&z(!0),null==R||R(j,t),r={user_story_title_id:j.storyId,user_story_id:j.user_story_id,is_favorite:t},[4,U.markFavorite(r)];case 1:return e.sent()||(V(!t),t&&z(!1),null==R||R(j,!t)),[2]}})})},[O,j,R,U]),oe=["usp-card usp-card--story",D&&"usp-card--hovered",W&&"usp-card--favorite-bounce",B.card,x].filter(Boolean).join(" "),le=u.extractAllAiReasoningIds(j.description||"").map(function(e){var n;return null===(n=null==j?void 0:j.ai_reasonings_snaphost)||void 0===n?void 0:n.find(function(n){return n.id.toString()===e})}).filter(function(e){return void 0!==e});return q.renderStoryCard?n.jsx(n.Fragment,{children:q.renderStoryCard(j,{isSelected:E})}):n.jsxs("div",e.__assign({className:oe,style:y,onClick:ie,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},role:"option","aria-selected":E},{children:[n.jsxs("div",e.__assign({className:["usp-card__header",B.cardHeader].filter(Boolean).join(" "),style:S},{children:[n.jsx("span",e.__assign({className:"usp-card__icon"},{children:q.renderBookmarkIcon?q.renderBookmarkIcon():n.jsx(d,{})})),""!==j.storyId&&n.jsxs("span",e.__assign({className:["usp-card__id",B.cardId].filter(Boolean).join(" ")},{children:[j.storyId,":"]})),n.jsx(a.default,e.__assign({content:j.title,placement:"top",disabled:P,contentClassName:L},{children:n.jsx("span",e.__assign({className:["usp-card__title",B.cardTitle].filter(Boolean).join(" "),style:w},{children:j.title}))})),j.isNew&&n.jsx(s.Badge,{type:"new"}),n.jsx("div",e.__assign({className:"usp-card__actions"},{children:n.jsx(a.default,e.__assign({content:O?"Remove from Shortlist":"Add to Shortlist",placement:"top",disabled:P,contentClassName:L},{children:n.jsxs("button",e.__assign({type:"button",className:["usp-card__heart",O&&"usp-card__heart--active",W&&"usp-card__heart--burst"].filter(Boolean).join(" "),onClick:ae,"aria-label":O?"Remove from Shortlist":"Add to Shortlist","aria-pressed":O},{children:[n.jsx(c,{filled:O}),n.jsxs("span",e.__assign({className:"usp-card__heart-burst","aria-hidden":"true"},{children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]}))]}))}))}))]})),n.jsxs("div",e.__assign({className:["usp-card__project-name",B.cardProjectName].filter(Boolean).join(" ")},{children:[q.renderFolderIcon?q.renderFolderIcon():n.jsx(p,{}),j.projectName]})),n.jsx("div",e.__assign({className:["usp-card-userstory-description",!j.description&&"usp-card__description--empty",B.cardDescription].filter(Boolean).join(" "),style:C},{children:j.description?n.jsxs(n.Fragment,{children:[n.jsx("span",{dangerouslySetInnerHTML:{__html:u.stripAiReasoningAnchors(re)}}),se&&n.jsx("button",e.__assign({onClick:te,className:["usp-card-moreButton",B.cardViewMore].filter(Boolean).join(" "),"aria-label":Y?"Show less":"Show more"},{children:Y?"less":"more"})),T&&(null==le?void 0:le.length)>0&&n.jsx("span",e.__assign({className:"mt-1 inline flex-row flex-wrap gap-1 relative w-full",onClick:function(e){return e.stopPropagation()},"data-citation":"true"},{children:null==le?void 0:le.map(function(t){var r,s,i,a,u,c;return n.jsx(l.default,e.__assign({searchQueryList:[""],searchQueryReasoningIdList:[],userStory:[],aiReasoning:[],citations:null!=X?X:{},apiCachingConfig:{queryClient:function(){var e;return null!==(e=null==M?void 0:M.queryClient)&&void 0!==e?e:function(){}},useGetSignedUrlQuery:null!==(r=null==M?void 0:M.useGetSignedUrlQuery)&&void 0!==r?r:function(){},useGetSignedUrlMutation:null!==(s=null==M?void 0:M.useGetSignedUrlMutation)&&void 0!==s?s:function(){},useExtractAudioPeaksMutation:null!==(i=null==M?void 0:M.useExtractAudioPeaksMutation)&&void 0!==i?i:function(){},useExtractAudioPeaksQuery:null!==(a=null==M?void 0:M.useExtractAudioPeaksQuery)&&void 0!==a?a:function(){},useGetVideoSignedUrlMutation:null!==(u=null==M?void 0:M.useGetVideoSignedUrlMutation)&&void 0!==u?u:function(){},useGetVideoSignedUrlQuery:null!==(c=null==M?void 0:M.useGetVideoSignedUrlQuery)&&void 0!==c?c:function(){}},setUserStory:function(){},setAiReasoning:function(){},setCitations:function(){},aiReasoningAccordionOpenStates:{isBottomComponentCollapsed:!0,gapAlwaysOpen:!1,gapDefaultOpen:!1,isBottomComponentDefaultOpen:!0,reasoningAlwaysOpen:!0}},{children:n.jsx(o.default,{aiReason:t,isSourceHasHighlight:!1,customStyles:{aiReasoningPill:{background:"transparent",fontSize:"13px"}}})}))})}))]}):n.jsx("span",e.__assign({className:"usp-card__description--placeholder"},{children:"No Description available"}))})),n.jsx("div",e.__assign({className:"usp-card__meta",style:k},{children:n.jsxs("span",e.__assign({className:["usp-card__date",B.cardDate].filter(Boolean).join(" ")},{children:["Last Updated: ",_(j.lastUpdated)]}))})),n.jsx(i.CardProceedButton,{story:j})]}))};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./features/UserStoryImport/UserStoryPicker.js"),r=require("./features/UserStoryImport/components/Header.js"),t=require("./features/UserStoryImport/components/Toolbar.js"),o=require("./features/UserStoryImport/components/SearchInput.js"),s=require("./features/UserStoryImport/components/BrowseProjectsButton.js"),i=require("./features/UserStoryImport/components/SectionHeading.js"),a=require("./features/UserStoryImport/components/CardGrid.js"),n=require("./features/UserStoryImport/components/UserStoryCard.js"),p=require("./features/UserStoryImport/components/ProjectCard.js"),u=require("./features/UserStoryImport/components/Badge.js"),d=require("./features/UserStoryImport/components/BackNav.js"),c=require("./features/UserStoryImport/components/SortDropdown.js"),m=require("./features/UserStoryImport/components/ShowMore.js"),S=require("./features/UserStoryImport/components/ProceedButton.js"),l=require("./features/UserStoryImport/components/Footer.js"),f=require("./features/UserStoryImport/components/SplitLayout.js"),R=require("./features/UserStoryImport/components/Sidebar.js"),q=require("./features/UserStoryImport/components/SidebarSection.js"),I=require("./features/UserStoryImport/components/SidebarProjectList.js"),y=require("./features/UserStoryImport/components/SidebarFavoritesList.js"),C=require("./features/UserStoryImport/components/ContentArea.js"),x=require("./features/UserStoryImport/components/NavRow.js"),j=require("./features/UserStoryImport/components/UserStoryImportDialog.js"),A=require("./features/UserStoryImport/components/ResizeHandle.js"),U=require("./features/UserStoryImport/components/ScopeDropdown.js"),h=require("./features/UserStoryImport/components/TypeDropdown.js"),b=require("./features/RequirementAI/components/citations/readfile-citation/ReadFileCitationRenderer.js"),k=require("./features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js"),g=require("./features/RequirementAI/components/citations/rca-citation/RCACitationRenderer.js"),P=require("./features/RequirementAI/components/citations/rca-citation/RCACitationContent.js"),w=require("./features/RequirementAI/components/citations/appmod-citation/AppmodCitationRenderer.js"),B=require("./features/RequirementAI/components/citations/appmod-citation/AppmodCitationContent.js"),D=require("./features/RequirementAI/components/RequirementAIWrapper/RequirementAIWrapper.js"),v=require("./features/RequirementAI/components/story-screen/UserStoryScreen.js"),T=require("./features/RequirementAI/components/userstory-approval-screen/UserStoryApprovalScreen.js"),F=require("./features/RequirementAI/components/RichTextEditor/RichTextEditor.js"),G=require("./features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js"),W=require("./features/RequirementAI/components/story-screen/SubfeatureBlock.js"),H=require("./features/RequirementAI/shared/AtomicButton.js"),L=require("./features/RequirementAI/icons/SidebarOpenIcon.js"),M=require("./features/RequirementAI/icons/SidebarCloseIcon.js"),z=require("./features/RequirementAI/components/story-screen/StreamingScreenSidebar.js"),E=require("./features/RequirementAI/components/ai-reasoning/AiReasoningCitationContent.js"),N=require("./features/RequirementAI/hooks/useStreamContentHandler.js"),O=require("./features/RequirementAI/utils/proccess-stream.utils.js"),V=require("./features/RequirementAI/components/cra/PartialRequirementContent.js"),_=require("./features/RequirementAI/utils/diff-edit.utils.js"),J=require("./features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.js"),K=require("./features/RequirementAI/hooks/useDiffEditReviewMode.js"),Q=require("./features/RequirementAI/components/UserStoryCard/UserStoryCard.js"),X=require("./features/RequirementAI/components/citations/file-citation/FileCitationRender.js"),Y=require("./features/RequirementAI/components/citations/web-citation/WebCitationWithImageRenderer.js"),Z=require("./features/RequirementAI/components/citations/web-citation/WebCitationRenderer.js"),$=require("./features/RequirementAI/components/citations/stormee-citation/StormeeCitationRenderer.js"),ee=require("./features/RequirementAI/components/citations/audio-citation/WaveformCitationRenderer.js"),re=require("./features/RequirementAI/components/citations/image-citation/ImageCitationRenderer.js"),te=require("./features/RequirementAI/components/GapRiskSidebar/GapRiskSidebar.js"),oe=require("./features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithGap.js"),se=require("./features/RequirementAI/components/GapRiskSidebar/utils/buildStoryWithRisk.js"),ie=require("./features/RequirementAI/utils/userstory-approval-transform.utils.js"),ae=require("./features/UserStoryImport/UserStoryPicker.context.js"),ne=require("./features/UserStoryImport/hooks/useUSPData.js"),pe=require("./features/UserStoryImport/components/usePanelResize.js"),ue=require("./features/UserStoryImport/UserStoryPicker.theme.js"),de=require("./features/CitationRenderer/CitationRenderer.js"),ce=require("./features/RequirementAI/components/CustomPopover/CustomPopover.js"),me=Object.assign(e.UserStoryPickerRoot,{Header:r.Header,Toolbar:t.Toolbar,SearchInput:o.SearchInput,BrowseProjectsButton:s.BrowseProjectsButton,SectionHeading:i.SectionHeading,CardGrid:a.CardGrid,UserStoryCard:n.UserStoryCard,ProjectCard:p.ProjectCard,Badge:u.Badge,BackNav:d.BackNav,SortDropdown:c.SortDropdown,ScopeDropdown:U.ScopeDropdown,TypeDropdown:h.TypeDropdown,ShowMore:m.ShowMore,ProceedButton:S.ProceedButton,Footer:l.Footer,SplitLayout:f.SplitLayout,Sidebar:R.Sidebar,SidebarSection:q.SidebarSection,SidebarProjectList:I.SidebarProjectList,SidebarFavoritesList:y.SidebarFavoritesList,ContentArea:C.ContentArea,NavRow:x.NavRow,UserStoryImportDialog:j.UserStoryImportDialog,ResizeHandle:A.ResizeHandle});exports.UserStoryImportDialog=j.UserStoryImportDialog,exports.ResizeHandle=A.ResizeHandle,exports.ReadFileCitationRenderer=b.default,exports.ReadFileCitationContent=k.default,exports.RCACitationRenderer=g.default,exports.RCACitationContent=P.default,exports.AppModCitationRenderer=w.default,exports.AppModCitationContent=B.default,exports.RequirementAIWrapper=D.default,exports.useRequirementAI=D.useRequirementAI,exports.UserStoryScreen=v.default,exports.UserStoryApprovalScreen=T.default,exports.RichTextEditor=F.default,exports.UserStoryWithCitation=G.default,exports.SubFeatureBlock=W.default,exports.AtomicButton=H.default,exports.SidebarOpenIcon=L.SidebarOpenIcon,exports.SidebarCloseIcon=M.SidebarCloseIcon,exports.StreamingScreenSidebar=z.default,exports.AiReasoningCitationContent=E.default,exports.useStreamContentHandler=N.useStreamContentHandler,exports.extractBlockStreams=O.extractBlockStreams,exports.extractDescription=O.extractDescription,exports.processAIReasoningFromBlocks=O.processAIReasoningFromBlocks,exports.processUserStoryValue=O.processUserStoryValue,exports.PartialRequirementContent=V.PartialRequirementContent,exports.handleAcceptAllChanges=_.handleAcceptAllChanges,exports.handleDiffEditApplied=_.handleDiffEditApplied,exports.handleDiscardAll=_.handleDiscardAll,exports.GapFilterBlock=J.GapFilterBlock,exports.hasAnyUpdatedTags=K.hasAnyUpdatedTags,exports.hasUpdatedTagsInMarkdown=K.hasUpdatedTagsInMarkdown,exports.useDiffEditReviewMode=K.useDiffEditReviewMode,exports.StoryCard=Q.StoryCard,exports.UserStoryCardWrapper=Q.UserStoryCardWrapper,exports.FileCitationRender=X.default,exports.WebCitationWithImageRenderer=Y.default,exports.WebCitationRenderer=Z.default,exports.StormeeCitationRenderer=$.default,exports.WaveformCitationRenderer=ee.default,exports.ImageCitationRenderer=re.default,exports.GapRiskSidebar=te.default,exports.NoGapsFound=te.NoGapsFound,exports.useGapRiskSidebar=te.useGapRiskSidebar,exports.buildStoryWithGap=oe.buildStoryWithGap,exports.updateGapInRawData=oe.updateGapInRawData,exports.updateGapStory=oe.updateGapStory,exports.buildStoryWithRisk=se.buildStoryWithRisk,exports.updateRiskInRawData=se.updateRiskInRawData,exports.updateStory=se.updateStory,exports.cloneUserStories=ie.cloneUserStories,exports.createUserStoriesForApproval=ie.createUserStoriesForApproval,exports.splitByHeaders=ie.splitByHeaders,exports.transformApprovalToUserStory=ie.transformApprovalToUserStory,exports.useUSPContext=ae.useUSPContext,exports.useUSPData=ne.useUSPData,exports.usePanelResize=pe.usePanelResize,exports.darkTheme=ue.darkTheme,exports.lightTheme=ue.lightTheme,exports.themeToStyle=ue.themeToStyle,exports.uspColorPalette=ue.uspColorPalette,exports.uspVSCodeLightTheme=ue.uspVSCodeLightTheme,exports.vscodeTheme=ue.vscodeTheme,exports.CitationRenderer=de.default,exports.collapseAllCitations=de.collapseAllCitations,exports.collapseCitationsByIds=de.collapseCitationsByIds,exports.CustomPopover=ce.default,exports.UserStoryPicker=me;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as r,Fragment as t,jsx as e}from"react/jsx-runtime";import{useEffect as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as r,Fragment as t,jsx as e}from"react/jsx-runtime";import{useRef as n,useEffect as i}from"react";import l from"./CustomPopover.module.css.js";var c=function(c){var s=c.anchorEl,a=c.open,u=c.onClose,d=c.children,m=c.customStyles,p=void 0===m?{}:m,f=n(null);if(i(function(){if(a){var o=function(o){var r;(null===(r=f.current)||void 0===r?void 0:r.contains(o.target))||u()};return window.addEventListener("scroll",o,!0),function(){window.removeEventListener("scroll",o,!0)}}},[a,u]),!a||!s)return null;var v=s.getBoundingClientRect();return r(t,{children:[e("div",{onClick:u,className:l.backdrop,style:o({},p.backdrop)}),e("div",o({ref:f,className:l.popup,style:o({top:v.bottom+15,left:v.left-700},p.popup)},{children:d}))]})};export{c as default};
|
|
2
2
|
//# sourceMappingURL=CustomPopover.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from"tslib";import{jsx as n}from"react/jsx-runtime";import{createContext as e,useState as i,useMemo as r,useCallback as o,useContext as a}from"react";import{RefProvider as s}from"../../store/ref.context.js";var u=e(null),c=function(e){var a=e.children,c=e.userStory,g=e.setUserStory,l=e.aiReasoning,f=e.setAiReasoning,d=e.citations,h=e.setCitations,m=e.apiCachingConfig,p=e.customStyles,C=e.customIcons,v=e.searchQueryList,y=e.searchQueryReasoningIdList,S=e.citationConfig,I=e.chatHistory,R=e.chatCitationConfigs,x=e.gptCitationConfigs,A=e.aiReasoningAccordionOpenStates,L=e.persistedDataFiles,w=e.inlineUpdateComponentConfig,b=e.handleViewGlossary,D=e.segmentDataList,E=e.getSegmentExampleComponent,H=i(0),Q=H[0],U=H[1],F=r(function(){if(0===c.length||0===l.length)return Array(c.length).fill(0);var t=Array.from({length:c.length},function(){return[]});return l.forEach(function(n){var e=Number(n.relevance_score);if(!(isNaN(e)||e<=0)){var i="ai_reasoning$".concat(n.id),r=c.findIndex(function(t){var n;return t.value.includes(i)||(null===(n=t.sub_features)||void 0===n?void 0:n.some(function(t){return t.value.includes(i)}))});-1!==r&&t[r].push(e)}}),t.map(function(t){return 0===t.length?0:Math.round(t.reduce(function(t,n){return t+n},0)/t.length)})},[c,l]),N=o(function(t){var n,e=c.findIndex(function(n){return n.artifactId===t});return-1===e?0:null!==(n=F[e])&&void 0!==n?n:0},[c,F]);return n(u.Provider,t({value:{chatHistory:I,userStory:c,setUserStory:g,aiReasoning:l,setAiReasoning:f,citations:d,setCitations:h,apiCachingConfig:m,customStyles:p,customIcons:C,searchQueryList:v,searchQueryReasoningIdList:y,citationConfig:S,getAvgScoreForStory:N,chatCitationConfigs:R,gptCitationConfigs:x,aiReasoningAccordionOpenStates:A,persistedDataFiles:L,currentHighlightIndex:Q,setCurrentHighlightIndex:U,inlineUpdateComponentConfig:w,handleViewGlossary:b,segmentDataList:D,getSegmentExampleComponent:E}},{children:n(s,{children:a})}))},g=function(){var t=a(u);if(!t)throw new Error("useRequirementAI must be used within RequirementAIWrapper");return t};export{c as default,g as useRequirementAI};
|
|
2
2
|
//# sourceMappingURL=RequirementAIWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t,__awaiter as n,__generator as r}from"tslib";import{jsxs as o,jsx as l,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ChevronUpIcon as d,ChevronDownIcon as c,ExternalLink as v,Download as y,Share2 as h,Copy as f,LoaderCircle as m,PencilIcon as p,ChevronUp as S,ChevronDown as g,Info as C,Bookmark as I}from"lucide-react";import w from"showdown";import{Menu as N,MenuItem as b,Tooltip as U}from"@mui/material";import{v4 as D}from"uuid";import x from"./UserStoryCard.module.css.js";import{formatMarkdown as B,indentMarkdown as k}from"../../utils/helpers.js";import{replaceTitleSection as A}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import E from"../RichTextEditor/RichTextEditor.js";import H from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as P}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as R}from"../story-screen/BigEnoughPanel.js";function T(t){for(var n,r=[],o=/<learned>(.*?)<\/learned>/g,i=0,a=0;null!==(n=o.exec(t));){var s=n[1],u=n.index;u>i&&r.push(l("span",{children:t.slice(i,u)},"text-pre-".concat(a++))),r.push(l(U,e({title:s,placement:"top"},{children:l(C,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(D()))),i=o.lastIndex}return i<(null==t?void 0:t.length)&&r.push(l("span",{children:t.slice(i)},"text-post-".concat(a++))),r}function j(t,n,r){var o;if(!t)return{};if(n)return e({},t.parentConfig);var l=e({},t.childConfig);return r&&(null===(o=t.subFeatureOverrides)||void 0===o?void 0:o[r])?e(e({},l),t.subFeatureOverrides[r]):l}var _=function(t){var n,r=t.displayName,i=P().customStyles,a=null===(n=null==i?void 0:i.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return o("div",e({className:x.displayName,style:null==a?void 0:a.wrapper},{children:[l(I,{className:x.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),o("span",e({style:null==a?void 0:a.label},{children:[r,":"]}))]}))},L=function(d){var c,C,I,U,D,W,z=d.isUserStoryCurrentlyUpdated,O=d.artifactId,V=d.artifactTitleId,F=d.parentUserStory,G=d.currentUserStory,q=d.onUserStoryChange,Q=d.parentIndex,J=d.currentIndex,K=d.enableDownload,X=d.isDiffEditReviewMode,Y=d.showUserStoryDiff,Z=d.handleDownloadUserStory,$=d.handleOpenSendDialog,ee=d.updateUserStoryArtifact,te=d.selectedArtifactId,ne=d.isDisplayHighlightControl,re=d.elementDisplayConfig,oe=d._resolvedConfig,le=d.showWrapper,ie=void 0!==le&&le,ae=P(),se=ae.searchQueryList,ue=ae.citations,de=ae.customStyles,ce=null==de?void 0:de.userStoryCardStyles,ve=null===(c=null==de?void 0:de.userStoryScreenStyles)||void 0===c?void 0:c.userStoryContentStyles,ye=null==ce?void 0:ce.progressHeaderStyles,he=a(e(e({},structuredClone(G)),{value:B(G.value)||""})),fe=he[0],me=he[1],pe=a({userStory:!1}),Se=pe[0],ge=pe[1],Ce=P(),Ie=Ce.userStory,we=Ce.customIcons,Ne=a(""===Q||te===G.artifactId),be=Ne[0],Ue=Ne[1],De=a(!1);De[0];var xe=De[1],Be=a(null),ke=Be[0],Ae=Be[1],Me=a(!1),Ee=Me[0],He=Me[1],Pe=s(null),Re=a(!1);Re[0];var Te=Re[1],je=s(null);u(function(){z&&Ue(z)},[z]),u(function(){me(e(e({},structuredClone(G)),{value:B(G.value)||""}))},[G]),u(function(){se.length>0?Ue(!0):te&&Ue(te===G.artifactId)},[se,te,G.artifactId]);var _e=function(){Ae(null)},Le=function(){Ue(function(e){return!e})};var We=null!=(null==G?void 0:G.big_enough)&&!Number.isNaN(G.big_enough)&&!!(null==G?void 0:G.big_enough_decision_factors),ze=null!=oe?oe:j(re,""===Q);return o("div",e({className:x.card,style:null==ce?void 0:ce.cardStyle,id:"story-card-".concat(G.title),"data-expanded":be},{children:[o("div",e({className:x.titleSection,style:null==ce?void 0:ce.titleSection},{children:[o("div",e({className:x.titleRow,style:null==ce?void 0:ce.titleRow,onClick:Le},{children:[o("div",e({className:x.titleLeft,style:null==ce?void 0:ce.titleLeft,onMouseEnter:function(){return Te(!0)},onMouseLeave:function(){return Te(!1)}},{children:[l(_,{displayName:V}),l("h2",e({className:x.storyTitle,style:null==ce?void 0:ce.storyTitle},{children:T(G.title)}),G.artifactId)]})),o("div",e({className:x.titleActions,style:null==ce?void 0:ce.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(ze.showProgressPercentage||ze.showGapBox)&&ie&&o("div",e({className:x.progressHeader,style:null==ye?void 0:ye.wrapper},{children:[ze.showProgressPercentage&&o("div",e({className:x.progressPercentage,style:null==ye?void 0:ye.percentage},{children:[null!==(I=null!==(C=null==G?void 0:G.confidenceScore)&&void 0!==C?C:null==ze?void 0:ze.confidenceValue)&&void 0!==I?I:"0","%"]})),ze.showGapBox&&o("div",e({className:x.gapBox,style:null==ye?void 0:ye.gapBox},{children:[null!==(D=null!==(U=null==G?void 0:G.gapValue)&&void 0!==U?U:null==ze?void 0:ze.gapBoxValue)&&void 0!==D?D:"2"," ","Gaps"]}))]})),We&&l(R,{customIcons:null==we?void 0:we.userStoryIcons,customStyles:null==ce?void 0:ce.aiReasoningCitaionStyles,currentUserStory:G,panelStyles:null==ce?void 0:ce.BigEnoughStyles}),!Se.userStory&&o(i,{children:[!1!==(null==ze?void 0:ze.showShareButton)&&l("button",e({className:x.iconButton,style:null==ce?void 0:ce.iconButton,onClick:function(e){Ae(e.currentTarget)}},{children:l(v,{size:16})})),o(N,e({id:"user-story-share-menu",anchorEl:ke,open:!!ke,onClose:function(){return Ae(null)},style:null==ce?void 0:ce.userStoryShareMenu},{children:[K&&l(b,e({style:null==ce?void 0:ce.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return xe(!0),Z?[4,Promise.all([Z("pdf"),Z("doc")])]:[2];case 1:return e.sent(),xe(!1),[2]}})})}},{children:o("div",e({ref:Pe,className:x.menuItemContent,style:null==ce?void 0:ce.menuItemContent},{children:[l(y,{size:16,color:null==ce?void 0:ce.menuIconColor}),l("p",e({style:null==ce?void 0:ce.menuLabel},{children:"Download"}))]}))})),l(b,e({style:null==ce?void 0:ce.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var t;return r(this,function(n){return t=G,F&&(t=e(e({},G),{value:"".concat(A(null==F?void 0:F.value,G.title)," \n").concat(G.value)})),null==$||$(!0,[t],G.artifactId),_e(),[2]})})}},{children:o("div",e({style:null==ce?void 0:ce.menuItemContent,className:x.menuItemContentPadded},{children:[l(h,{size:16,color:null==ce?void 0:ce.menuIconColor}),l("p",e({style:null==ce?void 0:ce.menuLabel},{children:"Send"}))]}))})),l(b,e({style:null==ce?void 0:ce.userStoryMenuItem,onClick:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o,l;return r(this,function(r){switch(r.label){case 0:e=new w.Converter,t=e.makeHtml(B(G.value)||G.value),n=function(e){var t=(new w.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(B(G.value)||G.value),o=new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})}),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,navigator.clipboard.write([o])];case 2:return r.sent(),console.log("Copied User Story"),[3,5];case 3:return l=r.sent(),console.error("Failed to copy user story:",l),[3,5];case 4:return _e(),[7];case 5:return[2]}})})}},{children:o("div",e({style:null==ce?void 0:ce.menuItemContent,className:x.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"}))]}))}))]}))]}),Se.userStory&&be?l(M,{type:"outline",children:"Cancel",style:null==ce?void 0:ce.cancelButton,onClick:function(){var t;null===(t=je.current)||void 0===t||t.abort(),ge(function(t){return e(e({},t),{userStory:!1})})}}):l(i,{}),Se.userStory&&be?l(M,{type:"fill",children:Ee?o("span",e({className:x.savingSpinner,style:null==ce?void 0:ce.savingSpinner},{children:[l(m,{className:x.spinAnimation,style:null==ce?void 0:ce.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:Ee,style:Ee?null==ce?void 0:ce.savingButton:null==ce?void 0:ce.saveButton,onClick:function(){return n(void 0,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return He(!0),"userStory"==="userStory"&&(q(fe),console.log("I am changing RTE editor values",fe)),[4,ee(ue,Ie,O,null===(t=je.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),ge(function(t){return e(e({},t),{userStory:!1})}),He(!1),[2]}})})}}):!X&&!Y&&be&&!1!==(null==ze?void 0:ze.showEditButton)&&l("button",e({className:x.iconButton,style:null==ce?void 0:ce.editButton,onClick:function(){return ge(function(t){return e(e({},t),{userStory:!0})})}},{children:l(p,{color:null==ce?void 0:ce.pencilIconColor,size:16})})),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),Le()},style:null==ce?void 0:ce.chevronButton,className:x.chevronButton},{children:l(be?S:g,{className:x.chevronIcon,color:null==ce?void 0:ce.chevronIconColor})}))]}))]})),l("div",{className:x.divider,style:null==ce?void 0:ce.dividerStyle})]})),be&&l("div",e({className:x.cardContent,style:null==ce?void 0:ce.cardContentStyle},{children:o("div",e({className:x.contentInner,style:null==ce?void 0:ce.contentInner},{children:[o("div",e({className:x.descriptionSection,style:null==ce?void 0:ce.descriptionSection},{children:[l("div",{className:x.justifyBetween,style:null==ce?void 0:ce.justifyBetween}),Se.userStory?l(E,{minHeight:"100%",height:"100%",type:"string",value:B(G.value)||"",handleUpdateState:function(t,n){var r=k(n);me(function(t){return e(e({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Se.userStory?"edit":"readOnly"}):l(H,{showUserStoryDiff:Y,isParent:""===Q,message:B(G.value)||"",artifactId:G.artifactId,customStyles:ve,isDisplayHighlightControl:ne})]})),null===(W=fe.sub_features)||void 0===W?void 0:W.map(function(n,r){var o=j(re,!1,n.artifactId);return l(L,{artifactId:O,isUserStoryCurrentlyUpdated:z,artifactTitleId:"".concat(V,"-").concat(String.fromCharCode(65+r)),parentUserStory:G,parentIndex:"".concat(Q).concat(Q&&".").concat(J),currentIndex:"".concat(r+1),doNotShowBorderInViewMode:!1,currentUserStory:n,onUserStoryChange:function(n){return function(n,r){var o=t([],G.sub_features||[],!0);o[n]=r,q(e(e({},G),{sub_features:o}))}(r,n)},enableDownload:!0,isDiffEditReviewMode:X,showUserStoryDiff:Y,updateUserStoryArtifact:ee,handleDownloadUserStory:Z,handleOpenSendDialog:$,isDisplayHighlightControl:ne,elementDisplayConfig:re,_resolvedConfig:o},n.artifactId)})]}))}))]}))},W=function(n){var r=n.artifactTitleIDs,a=n.isDiffEditReviewMode,s=n.showUserStoryDiff,u=n.updateUserStoryArtifact,v=n.isUserStoryCurrentlyUpdated,y=n.artifactId,h=n.handleOpenSendDialog,f=n.handleDownloadUserStory,m=n.selectedArtifactId,p=n.isDisplayHighlightControl,S=n.elementDisplayConfig,g=n.showWrapper,C=P(),I=C.userStory,w=C.setUserStory,N=C.customStyles,b=C.searchQueryList,U=C.currentHighlightIndex,D=C.setCurrentHighlightIndex,B=null==N?void 0:N.userStoryCardStyles,k=0===U,A=U===b.length-1;return o("div",e({className:x.userStoryCardWrapper,style:p?e(e({},null==B?void 0:B.userStoryCardWrapper),{position:"relative"}):null==B?void 0:B.userStoryCardWrapper},{children:[p&&l(i,{children:b.length>0&&l("div",e({className:x.wrapper},{children:l("div",e({className:x.highlightNavigation},{children:o("div",e({className:x.navigationContainer},{children:[o("span",e({className:x.navCounter},{children:[U+1," of ",b.length]})),o("div",e({className:x.navButtons},{children:[l("button",e({onClick:function(){U>0&&D(function(e){return e-1})},className:x.navButton,disabled:k},{children:l(d,{size:20,className:x.navIcon})})),l("button",e({onClick:function(){U<b.length-1&&D(function(e){return e+1})},className:x.navButton,disabled:A},{children:l(c,{size:20,className:x.navIcon})}))]}))]}))}))}))}),I.map(function(e,n){var o=j(S,!0);return l(L,{isUserStoryCurrentlyUpdated:v,artifactId:y,artifactTitleId:r[n]||"",currentUserStory:e,onUserStoryChange:function(e){w(function(r){return r[n]=e,t([],r,!0)})},parentIndex:"",currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:u,handleOpenSendDialog:h,handleDownloadUserStory:f,selectedArtifactId:m,isDisplayHighlightControl:p,elementDisplayConfig:S,_resolvedConfig:o,showWrapper:g},e.artifactId)})]}))};export{L as StoryCard,W as UserStoryCardWrapper,L as default,T as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n,__spreadArray as r}from"tslib";import{jsxs as o,jsx as l,Fragment as i}from"react/jsx-runtime";import{useState as a,useRef as s,useEffect as u}from"react";import{ExternalLink as d,Download as c,Share2 as v,Copy as y,LoaderCircle as h,PencilIcon as f,ChevronUp as m,ChevronDown as p,ChevronUpIcon as S,ChevronDownIcon as g,Info as C,Bookmark as I}from"lucide-react";import w from"showdown";import{Menu as N,MenuItem as b,Tooltip as U}from"@mui/material";import{v4 as D}from"uuid";import x from"./UserStoryCard.module.css.js";import{formatMarkdown as B,indentMarkdown as k}from"../../utils/helpers.js";import{replaceTitleSection as A}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import E from"../RichTextEditor/RichTextEditor.js";import H from"../userstory-with-citation/UserStoryWithCitation.js";import{useRequirementAI as P}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as R}from"../story-screen/BigEnoughPanel.js";function T(t){for(var n,r=[],o=/<learned>(.*?)<\/learned>/g,i=0,a=0;null!==(n=o.exec(t));){var s=n[1],u=n.index;u>i&&r.push(l("span",{children:t.slice(i,u)},"text-pre-".concat(a++))),r.push(l(U,e({title:s,placement:"top"},{children:l(C,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})}),"tooltip-".concat(D()))),i=o.lastIndex}return i<(null==t?void 0:t.length)&&r.push(l("span",{children:t.slice(i)},"text-post-".concat(a++))),r}function j(t,n,r){var o;if(!t)return{};if(n)return e({},t.parentConfig);var l=e({},t.childConfig);return r&&(null===(o=t.subFeatureOverrides)||void 0===o?void 0:o[r])?e(e({},l),t.subFeatureOverrides[r]):l}var _=function(t){var n,r=t.displayName,i=P().customStyles,a=null===(n=null==i?void 0:i.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return o("div",e({className:x.displayName,style:null==a?void 0:a.wrapper},{children:[l(I,{className:x.displayNameIcon,style:null==a?void 0:a.displayNameIcon}),o("span",e({style:null==a?void 0:a.label},{children:[r,":"]}))]}))},L=function(S){var g,C,I,U,D,W,z=S.isUserStoryCurrentlyUpdated,O=S.artifactId,V=S.artifactTitleId,F=S.parentUserStory,G=S.currentUserStory,q=S.onUserStoryChange,Q=S.parentIndex,J=S.currentIndex,K=S.enableDownload,X=S.isDiffEditReviewMode,Y=S.showUserStoryDiff,Z=S.handleDownloadUserStory,$=S.handleOpenSendDialog,ee=S.updateUserStoryArtifact,te=S.selectedArtifactId,ne=S.isDisplayHighlightControl,re=S.elementDisplayConfig,oe=S._resolvedConfig,le=S.showWrapper,ie=void 0!==le&&le,ae=P(),se=ae.searchQueryList,ue=ae.citations,de=ae.customStyles,ce=null==de?void 0:de.userStoryCardStyles,ve=null===(g=null==de?void 0:de.userStoryScreenStyles)||void 0===g?void 0:g.userStoryContentStyles,ye=null==ce?void 0:ce.progressHeaderStyles,he=a(e(e({},structuredClone(G)),{value:B(G.value)||""})),fe=he[0],me=he[1],pe=a({userStory:!1}),Se=pe[0],ge=pe[1],Ce=P(),Ie=Ce.userStory,we=Ce.customIcons,Ne=a(""===Q||te===G.artifactId),be=Ne[0],Ue=Ne[1],De=a(!1);De[0];var xe=De[1],Be=a(null),ke=Be[0],Ae=Be[1],Me=a(!1),Ee=Me[0],He=Me[1],Pe=s(null),Re=a(!1);Re[0];var Te=Re[1],je=s(null);u(function(){z&&Ue(z)},[z]),u(function(){me(e(e({},structuredClone(G)),{value:B(G.value)||""}))},[G]),u(function(){se.length>0?Ue(!0):te&&Ue(te===G.artifactId)},[se,te,G.artifactId]);var _e=function(){Ae(null)},Le=function(){Ue(function(e){return!e})};var We=null!=(null==G?void 0:G.big_enough)&&!Number.isNaN(G.big_enough)&&!!(null==G?void 0:G.big_enough_decision_factors),ze=null!=oe?oe:j(re,""===Q);return o("div",e({className:x.card,style:null==ce?void 0:ce.cardStyle,id:"story-card-".concat(G.title),"data-expanded":be},{children:[o("div",e({className:x.titleSection,style:null==ce?void 0:ce.titleSection},{children:[o("div",e({className:x.titleRow,style:null==ce?void 0:ce.titleRow,onClick:Le},{children:[o("div",e({className:x.titleLeft,style:null==ce?void 0:ce.titleLeft,onMouseEnter:function(){return Te(!0)},onMouseLeave:function(){return Te(!1)}},{children:[l(_,{displayName:V}),l("h2",e({className:x.storyTitle,style:null==ce?void 0:ce.storyTitle},{children:T(G.title)}),G.artifactId)]})),o("div",e({className:x.titleActions,style:null==ce?void 0:ce.titleActions,onClick:function(e){return e.stopPropagation()}},{children:[(ze.showProgressPercentage||ze.showGapBox)&&ie&&o("div",e({className:x.progressHeader,style:null==ye?void 0:ye.wrapper},{children:[ze.showProgressPercentage&&o("div",e({className:x.progressPercentage,style:null==ye?void 0:ye.percentage},{children:[null!==(I=null!==(C=null==G?void 0:G.confidenceScore)&&void 0!==C?C:null==ze?void 0:ze.confidenceValue)&&void 0!==I?I:"0","%"]})),ze.showGapBox&&o("div",e({className:x.gapBox,style:null==ye?void 0:ye.gapBox},{children:[null!==(D=null!==(U=null==G?void 0:G.gapValue)&&void 0!==U?U:null==ze?void 0:ze.gapBoxValue)&&void 0!==D?D:"2"," ","Gaps"]}))]})),We&&l(R,{customIcons:null==we?void 0:we.userStoryIcons,customStyles:null==ce?void 0:ce.aiReasoningCitaionStyles,currentUserStory:G,panelStyles:null==ce?void 0:ce.BigEnoughStyles}),!Se.userStory&&o(i,{children:[!1!==(null==ze?void 0:ze.showShareButton)&&l("button",e({className:x.iconButton,style:null==ce?void 0:ce.iconButton,onClick:function(e){Ae(e.currentTarget)}},{children:l(d,{size:16})})),o(N,e({id:"user-story-share-menu",anchorEl:ke,open:!!ke,onClose:function(){return Ae(null)},style:null==ce?void 0:ce.userStoryShareMenu},{children:[K&&l(b,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 xe(!0),Z?[4,Promise.all([Z("pdf"),Z("doc")])]:[2];case 1:return e.sent(),xe(!1),[2]}})})}},{children:o("div",e({ref:Pe,className:x.menuItemContent,style:null==ce?void 0:ce.menuItemContent},{children:[l(c,{size:16,color:null==ce?void 0:ce.menuIconColor}),l("p",e({style:null==ce?void 0:ce.menuLabel},{children:"Download"}))]}))})),l(b,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=G,F&&(t=e(e({},G),{value:"".concat(A(null==F?void 0:F.value,G.title)," \n").concat(G.value)})),null==$||$(!0,[t],G.artifactId),_e(),[2]})})}},{children:o("div",e({style:null==ce?void 0:ce.menuItemContent,className:x.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(b,e({style:null==ce?void 0:ce.userStoryMenuItem,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,r,o,l;return n(this,function(n){switch(n.label){case 0:e=new w.Converter,t=e.makeHtml(B(G.value)||G.value),r=function(e){var t=(new w.Converter).makeHtml(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}(B(G.value)||G.value),o=new ClipboardItem({"text/plain":new Blob([r],{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([o])];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 _e(),[7];case 5:return[2]}})})}},{children:o("div",e({style:null==ce?void 0:ce.menuItemContent,className:x.menuItemContentPadded},{children:[l(y,{size:16,color:null==ce?void 0:ce.menuIconColor}),l("p",e({style:null==ce?void 0:ce.menuLabel},{children:"Copy"}))]}))}))]}))]}),Se.userStory&&be?l(M,{type:"outline",children:"Cancel",style:null==ce?void 0:ce.cancelButton,onClick:function(){var t;null===(t=je.current)||void 0===t||t.abort(),ge(function(t){return e(e({},t),{userStory:!1})})}}):l(i,{}),Se.userStory&&be?l(M,{type:"fill",children:Ee?o("span",e({className:x.savingSpinner,style:null==ce?void 0:ce.savingSpinner},{children:[l(h,{className:x.spinAnimation,style:null==ce?void 0:ce.spinAnimation}),l("span",{children:"Saving..."})]})):"Save",isDisable:Ee,style:Ee?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 He(!0),"userStory"==="userStory"&&(q(fe),console.log("I am changing RTE editor values",fe)),[4,ee(ue,Ie,O,null===(t=je.current)||void 0===t?void 0:t.signal)];case 1:return n.sent(),ge(function(t){return e(e({},t),{userStory:!1})}),He(!1),[2]}})})}}):!X&&!Y&&be&&!1!==(null==ze?void 0:ze.showEditButton)&&l("button",e({className:x.iconButton,style:null==ce?void 0:ce.editButton,onClick:function(){return ge(function(t){return e(e({},t),{userStory:!0})})}},{children:l(f,{color:null==ce?void 0:ce.pencilIconColor,size:16})})),l("button",e({type:"button",onClick:function(e){e.stopPropagation(),Le()},style:null==ce?void 0:ce.chevronButton,className:x.chevronButton},{children:l(be?m:p,{className:x.chevronIcon,color:null==ce?void 0:ce.chevronIconColor})}))]}))]})),l("div",{className:x.divider,style:null==ce?void 0:ce.dividerStyle})]})),be&&l("div",e({className:x.cardContent,style:null==ce?void 0:ce.cardContentStyle},{children:o("div",e({className:x.contentInner,style:null==ce?void 0:ce.contentInner},{children:[o("div",e({className:x.descriptionSection,style:null==ce?void 0:ce.descriptionSection},{children:[l("div",{className:x.justifyBetween,style:null==ce?void 0:ce.justifyBetween}),Se.userStory?l(E,{minHeight:"100%",height:"100%",type:"string",value:B(G.value)||"",handleUpdateState:function(t,n){var r=k(n);me(function(t){return e(e({},t),{value:r||""})})},doNotShowBorderInViewMode:!1,onBlur:function(){},mode:Se.userStory?"edit":"readOnly"}):l(H,{showUserStoryDiff:Y,isParent:""===Q,message:B(G.value)||"",artifactId:G.artifactId,customStyles:ve,isDisplayHighlightControl:ne})]})),null===(W=fe.sub_features)||void 0===W?void 0:W.map(function(t,n){var o=j(re,!1,t.artifactId);return l(L,{artifactId:O,isUserStoryCurrentlyUpdated:z,artifactTitleId:"".concat(V,"-").concat(String.fromCharCode(65+n)),parentUserStory:G,parentIndex:"".concat(Q).concat(Q&&".").concat(J),currentIndex:"".concat(n+1),doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:function(t){return function(t,n){var o=r([],G.sub_features||[],!0);o[t]=n,q(e(e({},G),{sub_features:o}))}(n,t)},enableDownload:!0,isDiffEditReviewMode:X,showUserStoryDiff:Y,updateUserStoryArtifact:ee,handleDownloadUserStory:Z,handleOpenSendDialog:$,isDisplayHighlightControl:ne,elementDisplayConfig:re,_resolvedConfig:o},t.artifactId)})]}))}))]}))},W=function(t){var n=t.artifactTitleIDs,a=t.isDiffEditReviewMode,s=t.showUserStoryDiff,u=t.updateUserStoryArtifact,d=t.isUserStoryCurrentlyUpdated,c=t.artifactId,v=t.handleOpenSendDialog,y=t.handleDownloadUserStory,h=t.selectedArtifactId,f=t.isDisplayHighlightControl,m=t.elementDisplayConfig,p=t.showWrapper,C=P(),I=C.userStory,w=C.setUserStory,N=C.customStyles,b=C.searchQueryList,U=C.currentHighlightIndex,D=C.setCurrentHighlightIndex,B=null==N?void 0:N.userStoryCardStyles,k=0===U,A=U===b.length-1;return o("div",e({className:x.userStoryCardWrapper,style:f?e(e({},null==B?void 0:B.userStoryCardWrapper),{position:"relative"}):null==B?void 0:B.userStoryCardWrapper},{children:[f&&l(i,{children:b.length>0&&l("div",e({className:x.wrapper},{children:l("div",e({className:x.highlightNavigation},{children:o("div",e({className:x.navigationContainer},{children:[o("span",e({className:x.navCounter},{children:[U+1," of ",b.length]})),o("div",e({className:x.navButtons},{children:[l("button",e({onClick:function(){U>0&&D(function(e){return e-1})},className:x.navButton,disabled:k},{children:l(S,{size:20,className:x.navIcon})})),l("button",e({onClick:function(){U<b.length-1&&D(function(e){return e+1})},className:x.navButton,disabled:A},{children:l(g,{size:20,className:x.navIcon})}))]}))]}))}))}))}),I.map(function(e,t){var o=j(m,!0);return l(L,{isUserStoryCurrentlyUpdated:d,artifactId:c,artifactTitleId:n[t]||"",currentUserStory:e,onUserStoryChange:function(e){w(function(n){return n[t]=e,r([],n,!0)})},parentIndex:"",currentIndex:"".concat(t+1),doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:u,handleOpenSendDialog:v,handleDownloadUserStory:y,selectedArtifactId:h,isDisplayHighlightControl:f,elementDisplayConfig:m,_resolvedConfig:o,showWrapper:p},e.artifactId)})]}))};export{L as StoryCard,W as UserStoryCardWrapper,L as default,T as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as l,jsx as a}from"react/jsx-runtime";import t from"./segment.module.css.js";import{X as c}from"lucide-react";var n=function(n){var m=n.segmentExampleComponent,
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as l,jsx as a}from"react/jsx-runtime";import t from"./segment.module.css.js";import{X as c}from"lucide-react";var n=function(n){var r=n.label,m=n.segmentExampleComponent,o=n.customStyles,s=n.handleCancelExample;return l("div",e({className:"".concat(t.exampleWrapper),style:e({},null==o?void 0:o.exampleWrapper)},{children:[a("div",e({className:"".concat(t.exampleHeaderText," ").concat(t.uppercase),style:e({},null==o?void 0:o.exampleHeaderText)},{children:"{".concat(r,"}")})),l("div",e({className:"".concat(t.exampleContainer),style:e({},null==o?void 0:o.exampleContainer)},{children:[l("div",e({className:"".concat(t.exampleHeader),style:e({},null==o?void 0:o.exampleHeader)},{children:[a("p",e({className:"".concat(t.exampleHeaderText),style:e({},null==o?void 0:o.exampleHeaderText)},{children:"Example: "})),a("button",e({className:"".concat(t.cancelButton),onClick:s,style:e({},null==o?void 0:o.cancelButton)},{children:a(c,{size:16})}))]})),null!=m?m:a("p",e({className:"".concat(t.exampleHeaderText),style:e({},null==o?void 0:o.exampleHeaderText)},{children:"No example available..."}))]}))]}))};export{n as default};
|
|
2
2
|
//# sourceMappingURL=ExampleComponentWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import o from"react";import{ChevronDown as a}from"lucide-react";import{cn as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as n,jsx as t}from"react/jsx-runtime";import o from"react";import{ChevronDown as a}from"lucide-react";import{cn as l}from"../../../UserStoryImport/lib/cn.js";import s from"./segment.module.css.js";import i from"./ExampleComponentWrapper.js";import r from"../ai-reasoning/AiReasoningCitationContent.js";var c=function(c){var m=c.id,u=void 0===m?"Segment":m,p=c.label;c.originalValue,c.decisionStrength;var d=c.aiReason,g=c.customStyles,f=c.customIcons,v=c.aiReasoningCitationCustomStyles,h=c.segmentExampleComponent,y=c.handleViewGlossary,C=o.useState(!1),x=C[0],S=C[1],b=o.useState(!1),E=b[0],I=b[1];return n("div",e({className:"".concat(s.segmentWrapper),style:e({},null==g?void 0:g.segmentWrapper)},{children:[n("div",e({className:"".concat(s.segmentContainer),style:e({},null==g?void 0:g.container)},{children:[n("span",e({className:"".concat(s.segmentLabel),style:e({},null==g?void 0:g.label)},{children:[u," ","{".concat(p,"}")]})),t("button",e({className:"".concat(s.segmentExplanationButtonContainer),style:e({},null==g?void 0:g.buttonContainer),onClick:function(){S(function(e){return!e}),I(!1)}},{children:t(a,{className:l("".concat(s.cheveronIcon),x&&"".concat(s.cheveronIconRotated)),style:e({},null==g?void 0:g.cheveronIcon)})}))]})),d&&E&&h?t(i,{label:null!=p?p:"",segmentExampleComponent:h,customStyles:null==g?void 0:g.segmentExample,handleCancelExample:function(){I(!1)}}):d&&x&&t(r,{aiReason:d,customStyles:v,customIcons:f,isSegmentExplanation:!0,handleViewGlossary:function(){S(!1),null==y||y()},handleViewExample:function(){I(!0)}})]}))};export{c as default};
|
|
2
2
|
//# sourceMappingURL=Segment.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentContainer:"segment-module_segmentContainer__wBEel",segmentLabel:"segment-module_segmentLabel__-y8Su",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",exampleWrapper:"segment-module_exampleWrapper__ptZzj",exampleHeader:"segment-module_exampleHeader__9P11O",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const
|
|
1
|
+
var e={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentContainer:"segment-module_segmentContainer__wBEel",segmentLabel:"segment-module_segmentLabel__-y8Su",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",exampleWrapper:"segment-module_exampleWrapper__ptZzj",uppercase:"segment-module_uppercase__hjgxG",exampleContainer:"segment-module_exampleContainer__9tMXx",exampleHeader:"segment-module_exampleHeader__9P11O",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ"};!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(".segment-module_segmentWrapper__PVOuq{display:flex;flex-direction:column;gap:8px}.segment-module_segmentContainer__wBEel{align-items:center;background-color:#eff6ff;border:1px dashed #bfdbfe;border-radius:4px;color:#3b82f6;display:flex;gap:8px;padding:8px}.segment-module_segmentLabel__-y8Su{color:#3b82f6;font-size:14px;font-weight:600;line-height:21px;text-transform:uppercase}.segment-module_segmentButtonContainer__X76sx{background-color:initial;border:none;cursor:pointer;padding:0}.segment-module_cheveronIcon__1njFy{color:#3b82f6;height:16px;transition:all .2s ease-in-out;width:16px}.segment-module_cheveronIconRotated__qDYj7{transform:rotate(180deg)}.segment-module_exampleWrapper__ptZzj{align-items:flex-start;display:flex;flex-direction:column;gap:12px}.segment-module_uppercase__hjgxG{text-transform:uppercase}.segment-module_exampleContainer__9tMXx{align-items:flex-start;border:2px dashed #e2e8f0;border-radius:8px;display:flex;flex-direction:column;gap:8px;padding:16px;width:100%}.segment-module_exampleHeader__9P11O{align-items:center;align-self:stretch;display:flex;justify-content:space-between}.segment-module_exampleHeaderText__MWMG0{color:#334155;font-size:14px;font-weight:600;line-height:21px;margin:0}.segment-module_cancelButton__-F5aZ{align-items:center;align-self:stretch;background-color:initial;border:none;color:#334155;cursor:pointer;display:flex;height:fit-content;justify-content:space-between;padding:4px;transition:all .2s ease-in-out}.segment-module_cancelButton__-F5aZ:hover{background-color:#eff6ff}"));const n=document.head||document.getElementsByTagName("head")[0]||document.documentElement;n&&n.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=segment.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__spreadArray as t}from"tslib";import{jsx as n,jsxs as l,Fragment as i}from"react/jsx-runtime";import{createContext as o,useState as r,useRef as s,useEffect as a,useContext as d}from"react";import{PanelGroup as c,Panel as u,PanelResizeHandle as v}from"react-resizable-panels";import{PencilIcon as S,ChevronDown as m}from"lucide-react";import{formatMarkdown as y,indentMarkdown as p}from"../../utils/helpers.js";import g from"./SubfeatureBlock.js";import f from"./UserStoryScreen.module.css.js";import{useRequirementAI as h}from"../RequirementAIWrapper/RequirementAIWrapper.js";var b=o(null),N=function(){var e=d(b);if(!e)throw new Error("UserStoryScreen must be used inside its provider");return e},I=function(t){var i,o,r=t.AtomicButton,s=N(),a=s.selectedStreamingStoryIndex,d=s.isCitationLoadingNotStarted,c=s.classNames,u=s.scenario,v=h(),S=v.userStory,m=v.customStyles,y=null==m?void 0:m.userStoryScreenStyles;return(null==S?void 0:S.length)?l("div",e({className:"".concat(f.header," ").concat(null!==(i=null==c?void 0:c.header)&&void 0!==i?i:""),style:null==y?void 0:y.header},{children:[l("div",e({className:f.headerLeftContainer},{children:[n("span",e({className:f.headerTitle,style:null==y?void 0:y.headerTitle},{children:null===(o=S[a])||void 0===o?void 0:o.title})),"streaming"===u&&l("span",e({className:f.headerSubtitle,style:null==y?void 0:y.headerSubtitle},{children:[n("span",e({className:f.streamingText,style:null==y?void 0:y.streamingText},{children:d?"Generating Requirement Doc":"Hang tight! We're loading the citations."}))," • Review & edit blocks as we build"]}))]})),n(C,{AtomicButton:r})]})):n(x,{classNames:c})},C=function(t){var i=t.AtomicButton,o=N(),r=o.isEditing,s=o.isEditingModeOn,a=o.setIsEditing,d=o.setIsEditingModeOn,c=o.userStoryCopy,u=h(),v=u.userStory,m=u.setUserStory,y=u.customStyles,p=null==y?void 0:y.userStoryScreenStyles;return(null==v?void 0:v.length)?r?l("div",e({className:f.actions,style:null==p?void 0:p.actions},{children:[n(i,e({type:"outline",onClick:function(){a(!1),d(!1)},style:null==p?void 0:p.cancelAtomicButton},{children:"Cancel"})),n(i,e({type:"fill",onClick:function(){m(c),a(!1),d(!1)},style:null==p?void 0:p.saveAtomicButton},{children:"Save"}))]})):s?null:n("div",e({className:f.editToggleWrapper},{children:n("button",e({className:f.editToggleBtn,style:null==p?void 0:p.editToggleBtn,onClick:function(){a(!0),d(!0)}},{children:n(S,{size:16})}))})):null},x=function(t){var i,o=t.classNames;return l("div",e({className:"".concat(f.header," ").concat(null!==(i=null==o?void 0:o.header)&&void 0!==i?i:"")},{children:[n("div",{className:f.skeletonTitle}),n("div",{className:f.skeletonSubtitle})]}))},B=function(){var t,i=h().customStyles,o=null===(t=null==i?void 0:i.userStoryScreenStyles)||void 0===t?void 0:t.accordionSkeleton;return l("div",e({className:f.accordionSkeleton,style:null==o?void 0:o.wrapper},{children:[n("div",{className:f.skeletonLine,style:null==o?void 0:o.line}),n("div",{className:f.skeletonBox,style:null==o?void 0:o.box})]}))},E=function(){var t,i=h().customStyles,o=null===(t=null==i?void 0:i.userStoryScreenStyles)||void 0===t?void 0:t.subFeatureSkeleton;return l("div",e({className:f.subFeatureSkeleton,style:null==o?void 0:o.wrapper},{children:[n("div",{className:f.skeletonLine,style:null==o?void 0:o.line}),n("div",{className:f.skeletonLine,style:null==o?void 0:o.line}),n("div",{className:f.skeletonLine,style:null==o?void 0:o.line})]}))},T=Object.assign(function(t){var l,i,o,d,u,v=t.scenario,S=t.isCitationLoadingNotStarted,m=t.children,y=t.classNames,p=t.artifactTitleIds,g=h(),N=g.userStory,I=g.customStyles,C=r(0),x=C[0],B=C[1],E=r(!0),T=E[0],k=E[1],L=r(!1),R=L[0],w=L[1],A=r(!1),z=A[0],O=A[1],W=r(!1),M=W[0],P=W[1],U=r(!1),H=U[0],j=U[1],
|
|
1
|
+
import{__assign as e,__spreadArray as t}from"tslib";import{jsx as n,jsxs as l,Fragment as i}from"react/jsx-runtime";import{createContext as o,useState as r,useRef as s,useEffect as a,useContext as d}from"react";import{PanelGroup as c,Panel as u,PanelResizeHandle as v}from"react-resizable-panels";import{PencilIcon as S,ChevronDown as m}from"lucide-react";import{formatMarkdown as y,indentMarkdown as p}from"../../utils/helpers.js";import g from"./SubfeatureBlock.js";import f from"./UserStoryScreen.module.css.js";import{useRequirementAI as h}from"../RequirementAIWrapper/RequirementAIWrapper.js";var b=o(null),N=function(){var e=d(b);if(!e)throw new Error("UserStoryScreen must be used inside its provider");return e},I=function(t){var i,o,r=t.AtomicButton,s=N(),a=s.selectedStreamingStoryIndex,d=s.isCitationLoadingNotStarted,c=s.classNames,u=s.scenario,v=h(),S=v.userStory,m=v.customStyles,y=null==m?void 0:m.userStoryScreenStyles;return(null==S?void 0:S.length)?l("div",e({className:"".concat(f.header," ").concat(null!==(i=null==c?void 0:c.header)&&void 0!==i?i:""),style:null==y?void 0:y.header},{children:[l("div",e({className:f.headerLeftContainer},{children:[n("span",e({className:f.headerTitle,style:null==y?void 0:y.headerTitle},{children:null===(o=S[a])||void 0===o?void 0:o.title})),"streaming"===u&&l("span",e({className:f.headerSubtitle,style:null==y?void 0:y.headerSubtitle},{children:[n("span",e({className:f.streamingText,style:null==y?void 0:y.streamingText},{children:d?"Generating Requirement Doc":"Hang tight! We're loading the citations."}))," • Review & edit blocks as we build"]}))]})),n(C,{AtomicButton:r})]})):n(x,{classNames:c})},C=function(t){var i=t.AtomicButton,o=N(),r=o.isEditing,s=o.isEditingModeOn,a=o.setIsEditing,d=o.setIsEditingModeOn,c=o.userStoryCopy,u=h(),v=u.userStory,m=u.setUserStory,y=u.customStyles,p=null==y?void 0:y.userStoryScreenStyles;return(null==v?void 0:v.length)?r?l("div",e({className:f.actions,style:null==p?void 0:p.actions},{children:[n(i,e({type:"outline",onClick:function(){a(!1),d(!1)},style:null==p?void 0:p.cancelAtomicButton},{children:"Cancel"})),n(i,e({type:"fill",onClick:function(){m(c),a(!1),d(!1)},style:null==p?void 0:p.saveAtomicButton},{children:"Save"}))]})):s?null:n("div",e({className:f.editToggleWrapper},{children:n("button",e({className:f.editToggleBtn,style:null==p?void 0:p.editToggleBtn,onClick:function(){a(!0),d(!0)}},{children:n(S,{size:16})}))})):null},x=function(t){var i,o=t.classNames;return l("div",e({className:"".concat(f.header," ").concat(null!==(i=null==o?void 0:o.header)&&void 0!==i?i:"")},{children:[n("div",{className:f.skeletonTitle}),n("div",{className:f.skeletonSubtitle})]}))},B=function(){var t,i=h().customStyles,o=null===(t=null==i?void 0:i.userStoryScreenStyles)||void 0===t?void 0:t.accordionSkeleton;return l("div",e({className:f.accordionSkeleton,style:null==o?void 0:o.wrapper},{children:[n("div",{className:f.skeletonLine,style:null==o?void 0:o.line}),n("div",{className:f.skeletonBox,style:null==o?void 0:o.box})]}))},E=function(){var t,i=h().customStyles,o=null===(t=null==i?void 0:i.userStoryScreenStyles)||void 0===t?void 0:t.subFeatureSkeleton;return l("div",e({className:f.subFeatureSkeleton,style:null==o?void 0:o.wrapper},{children:[n("div",{className:f.skeletonLine,style:null==o?void 0:o.line}),n("div",{className:f.skeletonLine,style:null==o?void 0:o.line}),n("div",{className:f.skeletonLine,style:null==o?void 0:o.line})]}))},T=Object.assign(function(t){var l,i,o,d,u,v=t.scenario,S=t.isCitationLoadingNotStarted,m=t.children,y=t.classNames,p=t.artifactTitleIds,g=h(),N=g.userStory,I=g.customStyles,C=r(0),x=C[0],B=C[1],E=r(!0),T=E[0],k=E[1],L=r(!1),R=L[0],w=L[1],A=r(!1),z=A[0],O=A[1],W=r(!1),M=W[0],P=W[1],U=r(!1),H=U[0],j=U[1],D=r(N),F=D[0],G=D[1],q=s(null),V=s(null);return a(function(){G(N)},[N]),a(function(){w(!0);var e=setTimeout(function(){return w(!1)},2e3);return function(){return clearTimeout(e)}},[null===(i=null===(l=null==N?void 0:N[x])||void 0===l?void 0:l.sub_features)||void 0===i?void 0:i.length]),a(function(){var e=V.current;if(e){var t=function(){O(e.scrollHeight-e.scrollTop-e.clientHeight<20)};return e.addEventListener("scroll",t),function(){return e.removeEventListener("scroll",t)}}},[null==N?void 0:N[x]]),n(b.Provider,e({value:{scenario:v,isCitationLoadingNotStarted:S,selectedStreamingStoryIndex:x,setSelectedStreamingStoryIndex:B,isSidebarExpanded:T,setIsSidebarExpanded:k,sidebarPanelRef:q,isEditing:M,setIsEditing:P,isEditingModeOn:H,setIsEditingModeOn:j,userStoryCopy:F,setUserStoryCopy:G,scrollContainerRef:V,isAtBottom:z,isScrollBtnBouncing:R,scrollToBottom:function(){V.current&&V.current.scrollTo({top:V.current.scrollHeight,behavior:"smooth"})},classNames:y,artifactTitleIds:p}},{children:n("div",e({className:"".concat(f.container," ").concat(null!==(o=null==y?void 0:y.container)&&void 0!==o?o:""),style:e({},null===(d=null==I?void 0:I.userStoryScreenStyles)||void 0===d?void 0:d.wrapperContainer)},{children:n(c,e({direction:"horizontal",className:f.panelGroup,style:null===(u=null==I?void 0:I.userStoryScreenStyles)||void 0===u?void 0:u.panelGroup},{children:m}))}))}))},{Sidebar:function(t){var l,i=t.Component,o=N(),r=o.selectedStreamingStoryIndex,s=o.setSelectedStreamingStoryIndex,a=o.isSidebarExpanded,d=o.setIsSidebarExpanded,c=o.sidebarPanelRef,v=o.scenario,S=o.artifactTitleIds,m=h(),y=m.userStory,p=m.customStyles;return n(u,e({ref:c,defaultSize:25,minSize:15,collapsible:!0,collapsedSize:0,onCollapse:function(){return d(!1)},onExpand:function(){return d(!0)},id:"streaming-sidebar",order:1,className:f.sidebarPanel,style:null===(l=null==p?void 0:p.userStoryScreenStyles)||void 0===l?void 0:l.sidebarPanel},{children:n(i,{streamingUserStories:y,selectedStreamingStoryIndex:r,setSelectedStreamingStoryIndex:s,isSidebarExpanded:a,isStreamingScreen:"streaming"===v,artifactTitleIds:S})}))},SidebarToggle:function(t){var l=t.OpenIcon,i=t.CloseIcon,o=N(),r=o.isSidebarExpanded;o.setIsSidebarExpanded;var s=o.sidebarPanelRef,a=h().customStyles,d=null==a?void 0:a.userStoryScreenStyles;return n(v,e({className:f.resizeHandle,style:null==d?void 0:d.resizeHandle},{children:n("button",e({className:f.sidebarToggleBtn,onClick:function(e){e.stopPropagation(),function(){var e,t;r?null===(e=s.current)||void 0===e||e.collapse():null===(t=s.current)||void 0===t||t.expand()}()},style:null==d?void 0:d.sidebarToggleBtn},{children:n(r?i:l,{})}))}))},Content:function(t){var i,o=t.children,r=t.AtomicButton,s=N(),a=s.scrollContainerRef,d=s.classNames,c=h().customStyles,v=null==c?void 0:c.userStoryScreenStyles;return n(u,e({minSize:0,id:"streaming-content",order:2,className:f.contentPanel,style:null==v?void 0:v.contentPanel},{children:l("div",e({ref:a,className:"".concat(f.scrollContainer," ").concat(null!==(i=null==d?void 0:d.scrollContainer)&&void 0!==i?i:""),style:null==v?void 0:v.scrollContainer},{children:[n(I,{AtomicButton:r}),o]}))}))},Body:function(e){var t=e.children,l=h(),o=l.userStory;return l.setUserStory,(null==o?void 0:o.length)?n(i,{children:t}):null},Story:function(t){var l,i,o,r=t.Component,s=N(),a=s.selectedStreamingStoryIndex,d=s.isEditing,c=s.scenario,u=h(),v=u.userStory,S=u.customStyles,m=u.customIcons,y=u.segmentDataList,p=u.handleViewGlossary,g=u.getSegmentExampleComponent,b=null==S?void 0:S.userStoryScreenStyles,I=null==b?void 0:b.userStoryContentStyles;return d?null:n("div",e({className:f.storyWrapper,style:null==b?void 0:b.storyWrapper},{children:n(r,{message:null===(l=v[a])||void 0===l?void 0:l.value,aiReasoningsForBlock:(null===(i=v[a])||void 0===i?void 0:i.aiReasoning)||[],isCitationLoadingDisplay:"streaming"===c,customStyles:e({},I),customIcons:e({},null==m?void 0:m.userStoryIcons),artifactId:null===(o=v[a])||void 0===o?void 0:o.artifactId,getSegmentExampleComponent:g,handleViewGlossary:p,segmentDataList:y})}))},Editor:function(l){var i,o=l.Component,r=l.onBlur,s=N(),a=s.selectedStreamingStoryIndex,d=s.isEditing,c=s.setUserStoryCopy,u=h(),v=u.userStory,S=u.customStyles,m=null==S?void 0:S.textEditorStyles;if(!d)return null;return n("div",e({className:f.editorWrapper,style:null==m?void 0:m.wrapper},{children:n(o,{minHeight:"100%",height:"100%",type:"string",value:y(null===(i=v[a])||void 0===i?void 0:i.value)||"",handleUpdateState:function(n,l){var i,o=p(l),r=null===(i=v[a])||void 0===i?void 0:i.storyNumber;c(function(n){var l=t([],n,!0),i=l.findIndex(function(e){return e.storyNumber===r});return-1===i||(l[i]=e(e({},l[i]),{value:o})),l})},doNotShowBorderInViewMode:!1,onBlur:r,mode:"edit",customStyles:m})}))},SubFeatures:function(){var t,o=N(),r=o.selectedStreamingStoryIndex,s=o.isEditingModeOn,a=o.setIsEditingModeOn,d=o.scenario,c=o.isCitationLoadingNotStarted,u=h().userStory,v=(null===(t=null==u?void 0:u[r])||void 0===t?void 0:t.sub_features)||[];return 0===v.length&&"streaming"===d?n(B,{}):l(i,{children:[v.map(function(e){return n(g,{parentArtifactId:null==u?void 0:u[r].artifactId,artifactId:e.artifactId,title:e.title,content:e.value,aiReasoning:e.aiReasoning||[],isEditingModeOn:s,setIsEditingModeOn:a,isCitationLoadingDisplay:"streaming"===d},e.artifactId)}),"streaming"===d&&c&&n("div",e({className:f.subFeatureSkeletonWrapper},{children:n(E,{})}))]})},ScrollButton:function(){var t=N(),l=t.isAtBottom,i=t.isSidebarExpanded,o=t.scrollToBottom,r=t.isScrollBtnBouncing,s=h(),a=s.userStory,d=s.customStyles,c=null==d?void 0:d.userStoryScreenStyles;return!(null==a?void 0:a.length)||l?null:n("div",e({className:"".concat(f.scrollBtnWrapper," ").concat(i?f.scrollExpanded:f.scrollCollapsed),style:null==c?void 0:c.scrollBtnWrapper},{children:n("button",e({onClick:o,className:"".concat(f.scrollBtn," ").concat(r?f.bounce:""),style:null==c?void 0:c.scrollBtn,"aria-label":"Scroll to bottom"},{children:n(m,{size:20})}))}))}});export{T as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryScreen.js.map
|