@e-llm-studio/requirement-ai 0.0.71 → 0.0.72
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/citations/readfile-citation/CustomFileIcon.js +2 -0
- package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.module.css.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/ScopeDropdown.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/TypeDropdown.js +1 -1
- package/dist/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js +2 -0
- package/dist/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js.map +1 -0
- package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.js +1 -1
- package/dist/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.module.css.js +1 -1
- package/dist/features/UserStoryImport/components/ScopeDropdown.js +1 -1
- package/dist/features/UserStoryImport/components/TypeDropdown.js +1 -1
- package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.d.ts +13 -0
- package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/components/ScopeDropdown.d.ts +3 -3
- package/dist/types/src/features/UserStoryImport/components/ScopeDropdown.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/components/TypeDropdown.d.ts +2 -2
- package/dist/types/src/features/UserStoryImport/components/TypeDropdown.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("@exuanbo/file-icons-js"),r=require("lucide-react"),s=require("../../../../UserStoryImport/lib/cn.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(n),l=!1;exports.default=function(n){var a=this,u=n.name,o=n.size,f=void 0===o?"12px":o,d=n.className,m=i.useState(d||""),h=m[0],x=m[1];return i.useEffect(function(){e.__awaiter(a,void 0,void 0,function(){var t;return e.__generator(this,function(e){switch(e.label){case 0:return[4,c.default.getClass(u,{array:!0})];case 1:return t=e.sent(),x(t.join(" ")),[2]}})})},[u]),i.useEffect(function(){if(!l){var e=document.createElement("style");e.innerHTML="\n .custom-file-icon::before {\n font-size: inherit !important;\n }\n ",document.head.appendChild(e),l=!0}},[]),u.includes(".txt")?t.jsx(r.File,{className:s.cn("w-3 h-3 mr-2 text-muted",d)}):u.includes(".pdf")?t.jsx(r.FileText,{className:s.cn("w-3 h-3 mr-2 text-destructive",d)}):t.jsx("span",e.__assign({className:"mt-0",style:{width:f,height:f,display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top"}},{children:h?t.jsx("i",{className:s.cn("custom-file-icon",h,d),style:{fontSize:f,height:f,display:"inline-flex",alignItems:"center",lineHeight:1}}):t.jsx(r.File,{className:s.cn("text-muted",d),width:f,height:f})}))};
|
|
2
|
+
//# sourceMappingURL=CustomFileIcon.js.map
|
package/dist/cjs/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomFileIcon.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -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"),i=require("react-dom"),r=require("monaco-editor"),a=require("./ReadFileCitationContent.module.css.js"),l=require("./icons/ExternalLinkIcon.js"),o=require("lucide-react");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}var c=s(i),d=u(r);"undefined"!=typeof self&&(self.MonacoEnvironment=e.__assign(e.__assign({},self.MonacoEnvironment),{getWorker:function(){return{postMessage:function(){},terminate:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!0},onmessage:null,onerror:null,onmessageerror:null}}}));var f=!1,h=function(){if(!f&&"undefined"!=typeof document)try{var e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;overflow:hidden;visibility:hidden;pointer-events:none;",document.body.appendChild(e),d.editor.create(e,{value:"",language:"plaintext",automaticLayout:!1,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0}).dispose(),document.body.removeChild(e),f=!0}catch(e){f=!0}};h(),"undefined"!=typeof window&&(window.addEventListener("error",function(e){var n=e.message||"";if(n.includes("Worker")||n.includes("Monaco"))return e.preventDefault(),e.stopImmediatePropagation(),!1},!0),window.addEventListener("unhandledrejection",function(e){var n,t=(null===(n=e.reason)||void 0===n?void 0:n.message)||String(e.reason||"");(t.includes("Worker")||t.includes("Monaco"))&&(e.preventDefault(),e.stopImmediatePropagation())},!0));var g=function(e){return"number"==typeof e&&Number.isFinite(e)},m=function(e,n){return g(e)&&g(n)?e<=0||n<e?null:{start:e,end:n,length:n-e+1}:null},v=function(e,n,t,i){var r,a=e[0],l=e[1];if(!Number.isFinite(a)||!Number.isFinite(l))return null;if(l<a&&(a=(r=[l,a])[0],l=r[1]),g(t)&&g(i)){var o=Math.max(a,t),s=Math.min(l,i);if(o>s)return null;var u=o-t+1,c=s-t+1,d=Math.max(1,u),f=Math.min(n,c);return d>f?null:[d,f]}var h=Math.max(1,a),m=Math.min(n,l);return h>m?null:[h,m]},p=function(e,n,t,i){if(0===e.length)return!1;var r=m(t,i);return!!r&&(!!e.some(function(e){var t=e[0],i=e[1];return t>n||i>n})||(r.start>n||r.end>n||Math.abs(r.length-n)<=1&&!e.every(function(e){var n=e[0];return e[1]<r.start||n>r.end})))},b={border:"#3c3c3c",headerBg:"#252526",inactiveText:"#858585",background:"#1e1e1e",foreground:"#cccccc",highlightBg:"rgba(59, 130, 246, 0.15)",highlightGutter:"#3b82f6",hoverBg:"rgba(255, 255, 255, 0.1)"},y={theme:"vs-dark",fontSize:13,fontFamily:"Consolas, 'Courier New', monospace",maxHeight:300,minHeight:80},_={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",py:"python",rb:"ruby",java:"java",cpp:"cpp",c:"c",go:"go",rust:"rust",json:"json",html:"html",css:"css",scss:"scss",md:"markdown",sql:"sql",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml"},x=function(e){return _[e.toLowerCase()]||e},j=function(i){var r=i.code,l=i.language,o=i.theme,s=i.fontSize,u=i.fontFamily,c=i.height,f=i.blueHighlightRanges,g=i.yellowHighlightRanges,m=i.backgroundColor,v=i.editorWrapperStyle,p=i.lineNumberOffset,b=void 0===p?0:p,y=i.lineNumberDigits,_=t.useRef(null),j=t.useRef(null),N=t.useRef(!1);return t.useEffect(function(){N.current=!1,h();var e=setTimeout(function(){var e,n=_.current;if(n&&!N.current&&!j.current)try{d.editor.setTheme(o);var t=d.editor.create(n,{value:r,language:x(l),readOnly:!0,domReadOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:s,lineHeight:20,fontFamily:u,lineNumbers:function(e){return String(e+b)},folding:!1,lineDecorationsWidth:10,lineNumbersMinChars:Math.max(4,null!=y?y:4),renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1,alwaysConsumeMouseWheel:!1},automaticLayout:!0,wordWrap:"off",contextmenu:!1,selectOnLineNumbers:!0,glyphMargin:!1,padding:{top:8,bottom:8},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,overviewRulerLanes:0,renderWhitespace:"none",guides:{indentation:!1},cursorStyle:"line",cursorBlinking:"solid",fixedOverflowWidgets:!0});j.current=t;var i=[];f.forEach(function(e){var n=e[0],t=e[1];i.push({range:new d.Range(n,1,t,1),options:{isWholeLine:!0,className:a.default.highlightedLine,linesDecorationsClassName:a.default.highlightedLineDecoration}})}),g.forEach(function(e){var n=e[0],t=e[1];i.push({range:new d.Range(n,1,t,1),options:{isWholeLine:!0,className:a.default.yellowHighlightedLine,linesDecorationsClassName:a.default.yellowHighlightedLineDecoration}})}),i.length>0&&t.createDecorationsCollection(i);var c=null!==(e=g[0])&&void 0!==e?e:f[0];c&&requestAnimationFrame(function(){!N.current&&j.current&&t.revealLineInCenter(c[0])})}catch(e){}},50);return function(){if(N.current=!0,clearTimeout(e),j.current){try{j.current.dispose()}catch(e){}j.current=null}}},[]),t.useEffect(function(){try{d.editor.setTheme(o)}catch(e){}},[o]),n.jsx("div",e.__assign({className:a.default.editorWrapper,style:e.__assign({height:"".concat(c,"px"),backgroundColor:m},v)},{children:n.jsx("div",{ref:_,style:{width:"100%",height:"100%"}})}))};exports.default=function(i){var r=i.citation,s=i.customStyles,u=i.customColors,d=i.customIcons,f=i.editorConfig,h=i.fileCallback,_=t.useMemo(function(){return e.__assign(e.__assign({},b),u)},[u]),x=t.useMemo(function(){return e.__assign(e.__assign({},y),f)},[f]),N=t.useState(!1),C=N[0],M=N[1],w=t.useRef(null),k=t.useRef(!1),O=r.customMetadata.content||"",L=r.customMetadata.highlighted_text,F=r.customMetadata.start_line,S=r.customMetadata.end_line,E=t.useMemo(function(){if(!L)return{};try{var e=L.trim();return e.startsWith("```")&&(e=(e=e.replace(/^```\w*\n?/,"")).replace(/\n?```\s*$/,"")),JSON.parse(e.trim())}catch(e){return console.error("Failed to parse highlight string:",e),{}}},[L]),R=t.useMemo(function(){for(var e,n=[],t=/```(\w+)?\s*<file_path>([\s\S]*?)<\/file_path>\s*<code>([\s\S]*?)<\/code>\s*```/g;null!==(e=t.exec(O));){var i=e[1]||"javascript",r=e[2].trim(),a=e[3].trim();r&&a&&n.push({filePath:r,code:a,language:i})}return n},[O]),P=t.useCallback(function(e){return(E[e]||[]).map(function(e){var n=e.split("-").map(function(e){return Number(e.trim())}),t=n[0],i=n.length>1?n[1]:t;return Number.isFinite(t)&&Number.isFinite(i)?[t,i]:null}).filter(function(e){return null!==e})},[E]),B=t.useMemo(function(){for(var e=function(e){var n=R[e],t=n.code.split("\n").length,i=P(n.filePath),r=p(i,t,F,S);if(i.map(function(e){return v(e,t,r?F:void 0,r?S:void 0)}).filter(function(e){return null!==e}).length>0)return{value:e}},n=0;n<R.length;n++){var t=e(n);if("object"==typeof t)return t.value}return-1},[R,P,F,S]),H=B>=0,W=t.useCallback(function(e,n){var t=P(e),i=p(t,n,F,S);return t.map(function(e){return v(e,n,i?F:void 0,i?S:void 0)}).filter(function(e){return null!==e})},[P,F,S]),z=t.useCallback(function(e,n){if(null==F||null==S)return[];var t=n||function(e,n,t){var i=m(n,t);return!!i&&(i.start>e||i.end>e||Math.abs(i.length-e)<=1)}(e,F,S);if(t){var i=m(F,S);if(!i)return[];var r=Math.min(e,i.length);return r<1?[]:[[1,r]]}var a=Math.max(1,0===F?1:F),l=Math.min(S,e);return a>l?[]:[[a,l]]},[F,S]);t.useEffect(function(){if(H&&!k.current&&R.length>0&&(null==h?void 0:h.autoOpenFirstHighlighted)&&(null==h?void 0:h.onOpenFile)){var e=R[B],n=W(e.filePath,e.code.split("\n").length);k.current=!0;var t=setTimeout(function(){h.onOpenFile({filePath:e.filePath,ranges:n.length>0?n:null})},300);return function(){return clearTimeout(t)}}},[H,B,R,W,h]),t.useEffect(function(){k.current=!1},[O]),t.useEffect(function(){if(!(B<0)){var e=setTimeout(function(){var e;null===(e=w.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},350);return function(){return clearTimeout(e)}}},[B,L]);var T=t.useCallback(function(e,n){if(null==h?void 0:h.onOpenFile){var t=W(e,n);h.onOpenFile({filePath:e,ranges:t.length>0?t:null})}},[W,h]),D=t.useCallback(function(){(null==h?void 0:h.onExpandClick)?h.onExpandClick({blocks:R,highlightMap:E}):M(!0)},[h,R,E]),q=!!(null==h?void 0:h.onOpenFile),I=(null==d?void 0:d.readFileCitationIcon)||n.jsx(l.default,{style:{width:"14px",height:"14px"}}),G=function(t){return R.map(function(i,r){var l,u,c=i.code.split("\n").length,d=P(i.filePath),f=p(d,c,F,S),h=d.map(function(e){return v(e,c,f?F:void 0,f?S:void 0)}).filter(function(e){return null!==e}),m=f&&g(F)?h.map(function(e){var n=e[0],t=e[1];return[n+F-1,t+F-1]}):h,b=h.length>0,y=r===B,N=t?600:x.maxHeight,C=(l=20*i.code.split("\n").length+16+4,Math.min(Math.max(l,x.minHeight),N)),M=i.filePath.split("/").pop(),k=z(c,f),O=f&&g(F)?F-1:0,L=O+c,E=String(Math.max(1,L)).length;return n.jsxs("div",e.__assign({ref:!t&&y?w:void 0,"data-highlighted":b?"true":void 0,"data-first-highlighted":y?"true":void 0,className:a.default.blockContainer,style:e.__assign({border:"1px solid ".concat(_.border)},null==s?void 0:s.blockContainer)},{children:[n.jsxs("div",e.__assign({className:a.default.header,style:e.__assign({backgroundColor:b?_.highlightBg:_.headerBg,borderBottom:"1px solid ".concat(_.border),color:b?_.highlightGutter:_.foreground},b?null==s?void 0:s.headerHighlighted:null==s?void 0:s.header)},{children:[n.jsxs("div",e.__assign({className:a.default.headerLeft},{children:[n.jsx("span",e.__assign({className:a.default.fileName,title:i.filePath,style:null==s?void 0:s.fileName},{children:M})),q&&n.jsx("button",e.__assign({className:a.default.openFileButton,onClick:function(){return T(i.filePath,c)},title:"Open in editor","aria-label":"Open ".concat(M," in editor"),style:null==s?void 0:s.openFileButton},{children:I}))]})),n.jsxs("div",e.__assign({className:a.default.headerRight},{children:[b&&n.jsx("span",e.__assign({className:a.default.lineRanges,style:null==s?void 0:s.lineRanges},{children:(u=m,u.map(function(e){var n=e[0],t=e[1];return n===t?"L".concat(n):"L".concat(n,"-").concat(t)}).join(", "))})),!t&&0===r&&n.jsx("button",e.__assign({className:a.default.expandButton,style:null==s?void 0:s.expandButton,onClick:D,title:"Expand","aria-label":"Expand code view"},{children:n.jsx(o.Maximize2,{size:13})}))]}))]})),n.jsx(j,{code:i.code,language:i.language,theme:x.theme,fontSize:x.fontSize,fontFamily:x.fontFamily,height:C,blueHighlightRanges:k,yellowHighlightRanges:h,backgroundColor:_.background,editorWrapperStyle:null==s?void 0:s.editorWrapper,lineNumberOffset:O,lineNumberDigits:E})]}),r)})};if(0===R.length)return n.jsx("div",e.__assign({className:a.default.emptyState,style:e.__assign({color:_.inactiveText},null==s?void 0:s.emptyState)},{children:"No code content available"}));var A=C?c.default.createPortal(n.jsx("div",e.__assign({className:a.default.modalOverlay,style:null==s?void 0:s.modalOverlay,onClick:function(e){e.target===e.currentTarget&&M(!1)}},{children:n.jsxs("div",e.__assign({className:a.default.modalContent,style:null==s?void 0:s.modalContent},{children:[n.jsxs("div",e.__assign({className:a.default.modalHeader,style:null==s?void 0:s.modalHeader},{children:[n.jsx("span",e.__assign({className:a.default.modalTitle,style:null==s?void 0:s.modalTitle},{children:1===R.length?R[0].filePath:"".concat(R.length," files")})),n.jsx("button",e.__assign({className:a.default.modalCloseButton,style:null==s?void 0:s.modalCloseButton,onClick:function(){return M(!1)},"aria-label":"Close expanded view"},{children:n.jsx(o.X,{size:16})}))]})),n.jsx("div",e.__assign({className:a.default.modalBody},{children:n.jsx("div",e.__assign({className:a.default.container,style:null==s?void 0:s.container},{children:G(!0)}))}))]}))})),document.body):null;return n.jsxs(n.Fragment,{children:[A,n.jsx("div",e.__assign({className:a.default.container,style:null==s?void 0:s.container},{children:G(!1)}))]})};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),i=require("react-dom"),r=require("monaco-editor"),a=require("./ReadFileCitationContent.module.css.js"),l=require("./icons/ExternalLinkIcon.js"),o=require("lucide-react"),s=require("./CustomFileIcon.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function c(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}}),n.default=e,Object.freeze(n)}var d=u(i),f=c(r);"undefined"!=typeof self&&(self.MonacoEnvironment=e.__assign(e.__assign({},self.MonacoEnvironment),{getWorker:function(){return{postMessage:function(){},terminate:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!0},onmessage:null,onerror:null,onmessageerror:null}}}));var h=!1,m=function(){if(!h&&"undefined"!=typeof document)try{var e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;overflow:hidden;visibility:hidden;pointer-events:none;",document.body.appendChild(e),f.editor.create(e,{value:"",language:"plaintext",automaticLayout:!1,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0}).dispose(),document.body.removeChild(e),h=!0}catch(e){h=!0}};m(),"undefined"!=typeof window&&(window.addEventListener("error",function(e){var n=e.message||"";if(n.includes("Worker")||n.includes("Monaco"))return e.preventDefault(),e.stopImmediatePropagation(),!1},!0),window.addEventListener("unhandledrejection",function(e){var n,t=(null===(n=e.reason)||void 0===n?void 0:n.message)||String(e.reason||"");(t.includes("Worker")||t.includes("Monaco"))&&(e.preventDefault(),e.stopImmediatePropagation())},!0));var g=function(e){return"number"==typeof e&&Number.isFinite(e)},v=function(e,n){return g(e)&&g(n)?e<=0||n<e?null:{start:e,end:n,length:n-e+1}:null},p=function(e,n,t,i){var r,a=e[0],l=e[1];if(!Number.isFinite(a)||!Number.isFinite(l))return null;if(l<a&&(a=(r=[l,a])[0],l=r[1]),g(t)&&g(i)){var o=Math.max(a,t),s=Math.min(l,i);if(o>s)return null;var u=o-t+1,c=s-t+1,d=Math.max(1,u),f=Math.min(n,c);return d>f?null:[d,f]}var h=Math.max(1,a),m=Math.min(n,l);return h>m?null:[h,m]},b=function(e,n,t,i){if(0===e.length)return!1;var r=v(t,i);return!!r&&(!!e.some(function(e){var t=e[0],i=e[1];return t>n||i>n})||(r.start>n||r.end>n||Math.abs(r.length-n)<=1&&!e.every(function(e){var n=e[0];return e[1]<r.start||n>r.end})))},y={border:"#3c3c3c",headerBg:"#252526",inactiveText:"#858585",background:"#1e1e1e",foreground:"#cccccc",highlightBg:"rgba(59, 130, 246, 0.15)",highlightGutter:"#3b82f6",hoverBg:"rgba(255, 255, 255, 0.1)"},x={theme:"vs-dark",fontSize:13,fontFamily:"Consolas, 'Courier New', monospace",maxHeight:300,minHeight:80},_={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",py:"python",rb:"ruby",java:"java",cpp:"cpp",c:"c",go:"go",rust:"rust",json:"json",html:"html",css:"css",scss:"scss",md:"markdown",sql:"sql",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml"},j=function(e){return _[e.toLowerCase()]||e},C=function(i){var r=i.code,l=i.language,o=i.theme,s=i.fontSize,u=i.fontFamily,c=i.height,d=i.yellowHighlightRanges,h=i.backgroundColor,g=i.editorWrapperStyle,v=i.lineNumberOffset,p=void 0===v?0:v,b=i.lineNumberDigits,y=t.useRef(null),x=t.useRef(null),_=t.useRef(!1);return t.useEffect(function(){_.current=!1,m();var e=setTimeout(function(){var e=y.current;if(e&&!_.current&&!x.current)try{f.editor.setTheme(o);var n=f.editor.create(e,{value:r,language:j(l),readOnly:!0,domReadOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:s,lineHeight:20,fontFamily:u,lineNumbers:function(e){return String(e+p)},folding:!1,lineDecorationsWidth:10,lineNumbersMinChars:Math.max(4,null!=b?b:4),renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1,alwaysConsumeMouseWheel:!1},automaticLayout:!0,wordWrap:"off",contextmenu:!1,selectOnLineNumbers:!0,glyphMargin:!1,padding:{top:8,bottom:8},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,overviewRulerLanes:0,renderWhitespace:"none",guides:{indentation:!1},cursorStyle:"line",cursorBlinking:"solid",fixedOverflowWidgets:!0});x.current=n;var t=[];d.forEach(function(e){var n=e[0],i=e[1];t.push({range:new f.Range(n,1,i,1),options:{isWholeLine:!0,className:a.default.yellowHighlightedLine,linesDecorationsClassName:a.default.yellowHighlightedLineDecoration}})}),t.length>0&&n.createDecorationsCollection(t);var i=d[0];i&&requestAnimationFrame(function(){!_.current&&x.current&&n.revealLineInCenter(i[0])})}catch(e){}},50);return function(){if(_.current=!0,clearTimeout(e),x.current){try{x.current.dispose()}catch(e){}x.current=null}}},[]),t.useEffect(function(){try{f.editor.setTheme(o)}catch(e){}},[o]),n.jsx("div",e.__assign({className:a.default.editorWrapper,style:e.__assign({height:"".concat(c,"px"),backgroundColor:h},g)},{children:n.jsx("div",{ref:y,style:{width:"100%",height:"100%"}})}))};exports.default=function(i){var r=i.citation,u=i.customStyles,c=i.customColors,f=i.customIcons,h=i.editorConfig,m=i.fileCallback,_=t.useMemo(function(){return e.__assign(e.__assign({},y),c)},[c]),j=t.useMemo(function(){return e.__assign(e.__assign({},x),h)},[h]),N=t.useState(!1),M=N[0],w=N[1],k=t.useRef(null),O=t.useRef(!1),F=r.customMetadata.content||"",S=r.customMetadata.highlighted_text,L=r.customMetadata.start_line,E=r.customMetadata.end_line,P=g(L)?L+1:L,R=t.useMemo(function(){if(!S)return{};try{var e=S.trim();return e.startsWith("```")&&(e=(e=e.replace(/^```\w*\n?/,"")).replace(/\n?```\s*$/,"")),JSON.parse(e.trim())}catch(e){return console.error("Failed to parse highlight string:",e),{}}},[S]),T=t.useMemo(function(){for(var e,n=[],t=/```(\w+)?\s*<file_path>([\s\S]*?)<\/file_path>\s*<code>([\s\S]*?)<\/code>\s*```/g;null!==(e=t.exec(F));){var i=e[1]||"javascript",r=e[2].trim(),a=e[3].trim();r&&a&&n.push({filePath:r,code:a,language:i})}return n},[F]),B=t.useCallback(function(e){return(R[e]||[]).map(function(e){var n=e.split("-").map(function(e){return Number(e.trim())}),t=n[0],i=n.length>1?n[1]:t;return Number.isFinite(t)&&Number.isFinite(i)?[t,i]:null}).filter(function(e){return null!==e})},[R]),z=t.useMemo(function(){for(var e=function(e){var n=T[e],t=n.code.split("\n").length,i=B(n.filePath),r=b(i,t,P,E);if(i.map(function(e){return p(e,t,r?P:void 0,r?E:void 0)}).filter(function(e){return null!==e}).length>0)return{value:e}},n=0;n<T.length;n++){var t=e(n);if("object"==typeof t)return t.value}return-1},[T,B,P,E]),W=z>=0,H=t.useCallback(function(e,n){var t=B(e),i=b(t,n,P,E);return t.map(function(e){return p(e,n,i?P:void 0,i?E:void 0)}).filter(function(e){return null!==e})},[B,P,E]),q=t.useCallback(function(e,n){var t=B(e);if(b(t,n,P,E)){var i=v(P,E);return i?t.map(function(e){var n=e[0],t=e[1],r=n<=t?[n,t]:[t,n],a=Math.max(r[0],i.start),l=Math.min(r[1],i.end);return a>l?null:[a,l]}).filter(function(e){return null!==e}):[]}return H(e,n)},[B,H,P,E]);t.useEffect(function(){if(W&&!O.current&&T.length>0&&(null==m?void 0:m.autoOpenFirstHighlighted)&&(null==m?void 0:m.onOpenFile)){var e=T[z],n=q(e.filePath,e.code.split("\n").length);O.current=!0;var t=setTimeout(function(){m.onOpenFile({filePath:e.filePath,ranges:n.length>0?n:null})},300);return function(){return clearTimeout(t)}}},[W,z,T,H,m]),t.useEffect(function(){O.current=!1},[F]),t.useEffect(function(){if(!(z<0)){var e=setTimeout(function(){var e;null===(e=k.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},350);return function(){return clearTimeout(e)}}},[z,S]);var D=t.useCallback(function(e,n){if(null==m?void 0:m.onOpenFile){var t=q(e,n);m.onOpenFile({filePath:e,ranges:t.length>0?t:null})}},[q,m]),I=t.useCallback(function(){(null==m?void 0:m.onExpandClick)?m.onExpandClick({blocks:T,highlightMap:R}):w(!0)},[m,T,R]),G=!!(null==m?void 0:m.onOpenFile),A=(null==f?void 0:f.readFileCitationIcon)||n.jsx(l.default,{style:{width:"14px",height:"14px"}}),J=function(t){return T.map(function(i,r){var l,s,c=i.code.split("\n").length,d=B(i.filePath),f=b(d,c,P,E),h=d.map(function(e){return p(e,c,f?P:void 0,f?E:void 0)}).filter(function(e){return null!==e}),m=f&&g(P)?h.map(function(e){var n=e[0],t=e[1];return[n+P-1,t+P-1]}):h,v=h.length>0,y=r===z,x=t?600:j.maxHeight,N=(l=20*i.code.split("\n").length+16+4,Math.min(Math.max(l,j.minHeight),x)),M=i.filePath.split("/").pop(),w=f&&g(P)?P-1:0,O=w+c,F=String(Math.max(1,O)).length;return n.jsxs("div",e.__assign({ref:!t&&y?k:void 0,"data-highlighted":v?"true":void 0,"data-first-highlighted":y?"true":void 0,className:a.default.blockContainer,style:e.__assign({border:"1px solid ".concat(_.border)},null==u?void 0:u.blockContainer)},{children:[n.jsxs("div",e.__assign({className:a.default.header,style:e.__assign({backgroundColor:v?_.highlightBg:_.headerBg,borderBottom:"1px solid ".concat(_.border),color:v?_.highlightGutter:_.foreground},v?null==u?void 0:u.headerHighlighted:null==u?void 0:u.header)},{children:[n.jsxs("div",e.__assign({className:a.default.headerLeft},{children:[n.jsx("span",e.__assign({className:a.default.fileName,title:i.filePath,style:null==u?void 0:u.fileName,onClick:function(){return D(i.filePath,c)}},{children:M})),G&&n.jsx("button",e.__assign({className:a.default.openFileButton,onClick:function(){return D(i.filePath,c)},title:"Open in editor","aria-label":"Open ".concat(M," in editor"),style:null==u?void 0:u.openFileButton},{children:A}))]})),n.jsxs("div",e.__assign({className:a.default.headerRight},{children:[v&&n.jsx("span",e.__assign({className:a.default.lineRanges,style:null==u?void 0:u.lineRanges},{children:(s=m,s.map(function(e){var n=e[0],t=e[1];return n===t?"L".concat(n):"L".concat(n,"-").concat(t)}).join(", "))})),!t&&0===r&&n.jsx("button",e.__assign({className:a.default.expandButton,style:null==u?void 0:u.expandButton,onClick:I,title:"Expand","aria-label":"Expand code view"},{children:n.jsx(o.Maximize2,{size:13})}))]}))]})),n.jsx(C,{code:i.code,language:i.language,theme:j.theme,fontSize:j.fontSize,fontFamily:j.fontFamily,height:N,yellowHighlightRanges:h,backgroundColor:_.background,editorWrapperStyle:null==u?void 0:u.editorWrapper,lineNumberOffset:w,lineNumberDigits:F})]}),r)})};if(0===T.length)return n.jsx("div",e.__assign({className:a.default.emptyState,style:e.__assign({color:_.inactiveText},null==u?void 0:u.emptyState)},{children:"No code content available"}));var V=M?d.default.createPortal(n.jsx("div",e.__assign({className:a.default.modalOverlay,style:null==u?void 0:u.modalOverlay,onClick:function(e){e.target===e.currentTarget&&w(!1)}},{children:n.jsxs("div",e.__assign({className:a.default.modalContent,style:null==u?void 0:u.modalContent},{children:[n.jsxs("div",e.__assign({className:a.default.modalHeader,style:null==u?void 0:u.modalHeader},{children:[n.jsx("span",e.__assign({className:a.default.modalTitle,style:null==u?void 0:u.modalTitle},{children:1===T.length?n.jsxs("span",e.__assign({className:a.default.modalTitleContent},{children:[n.jsx(s.default,{name:T[0].filePath,size:"15px"}),n.jsx("span",e.__assign({className:a.default.modalTitleText},{children:T[0].filePath}))]})):"".concat(T.length," files")})),n.jsx("button",e.__assign({className:a.default.modalCloseButton,style:null==u?void 0:u.modalCloseButton,onClick:function(){return w(!1)},"aria-label":"Close expanded view"},{children:n.jsx(o.X,{size:16})}))]})),n.jsx("div",e.__assign({className:a.default.modalBody},{children:n.jsx("div",e.__assign({className:a.default.container,style:null==u?void 0:u.container},{children:J(!0)}))}))]}))})),document.body):null;return n.jsxs(n.Fragment,{children:[V,n.jsx("div",e.__assign({className:a.default.container,style:null==u?void 0:u.container},{children:J(!1)}))]})};
|
|
2
2
|
//# sourceMappingURL=ReadFileCitationContent.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(".ReadFileCitationContent-module_container__Oi3tV{display:flex;flex-direction:column;gap:12px;margin-top:4px}.ReadFileCitationContent-module_blockContainer__yGEX8{border-radius:4px;overflow:hidden}.ReadFileCitationContent-module_header__39-AD{align-items:center;display:flex;font-family:monospace;font-size:12px;gap:8px;justify-content:space-between;padding:6px 12px}.ReadFileCitationContent-module_headerLeft__WOyMV{align-items:center;display:flex;flex:1;gap:8px;min-width:0}.ReadFileCitationContent-module_fileName__ql9Qu{opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_openFileButton__oqea1{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_openFileButton__oqea1:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_lineRanges__RIofb{flex-shrink:0;font-size:11px;max-width:300px;opacity:.7;overflow-x:auto;white-space:nowrap}.ReadFileCitationContent-module_editorWrapper__ab5Sg{overflow:hidden}.ReadFileCitationContent-module_highlightedLine__w6iv-{background-color:#3b82f626!important}.ReadFileCitationContent-module_highlightedLineDecoration__EykBL{background-color:#3b82f6;margin-left:0;width:3px!important}.ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP{background-color:#eab30833!important}.ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N{background-color:#eab308;margin-left:0;width:3px!important}.ReadFileCitationContent-module_emptyState__34kcg{font-size:14px;padding:12px;text-align:center}.ReadFileCitationContent-module_loadingEditor__aOHYT{align-items:center;display:flex;font-size:14px;height:64px;justify-content:center}.ReadFileCitationContent-module_headerRight__Hetda{align-items:center;display:flex;flex-shrink:0;gap:6px}.ReadFileCitationContent-module_expandButton__wjkgL{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_expandButton__wjkgL:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalOverlay__ZJSqk{align-items:center;background-color:#000000b3;box-sizing:border-box;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:9999}.ReadFileCitationContent-module_modalContent__PA-tB{background:#1e1e1e;border:1px solid #3c3c3c;border-radius:6px;display:flex;flex-direction:column;max-height:90vh;max-width:900px;overflow:hidden;width:100%}.ReadFileCitationContent-module_modalHeader__9Jcjf{align-items:center;background:#252526;border-bottom:1px solid #3c3c3c;display:flex;flex-shrink:0;justify-content:space-between;padding:10px 14px}.ReadFileCitationContent-module_modalTitle__M60Jk{color:#ccc;font-family:monospace;font-size:13px;opacity:.85}.ReadFileCitationContent-module_modalCloseButton__4bymQ{align-items:center;background:none;border:none;border-radius:4px;color:#ccc;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_modalCloseButton__4bymQ:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalBody__Oo7OO{flex:1;overflow-y:auto;padding:12px}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"ReadFileCitationContent-module_container__Oi3tV",blockContainer:"ReadFileCitationContent-module_blockContainer__yGEX8",header:"ReadFileCitationContent-module_header__39-AD",headerLeft:"ReadFileCitationContent-module_headerLeft__WOyMV",fileName:"ReadFileCitationContent-module_fileName__ql9Qu",openFileButton:"ReadFileCitationContent-module_openFileButton__oqea1",lineRanges:"ReadFileCitationContent-module_lineRanges__RIofb",editorWrapper:"ReadFileCitationContent-module_editorWrapper__ab5Sg",highlightedLine:"ReadFileCitationContent-module_highlightedLine__w6iv-",highlightedLineDecoration:"ReadFileCitationContent-module_highlightedLineDecoration__EykBL",yellowHighlightedLine:"ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP",yellowHighlightedLineDecoration:"ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N",emptyState:"ReadFileCitationContent-module_emptyState__34kcg",loadingEditor:"ReadFileCitationContent-module_loadingEditor__aOHYT",headerRight:"ReadFileCitationContent-module_headerRight__Hetda",expandButton:"ReadFileCitationContent-module_expandButton__wjkgL",modalOverlay:"ReadFileCitationContent-module_modalOverlay__ZJSqk",modalContent:"ReadFileCitationContent-module_modalContent__PA-tB",modalHeader:"ReadFileCitationContent-module_modalHeader__9Jcjf",modalTitle:"ReadFileCitationContent-module_modalTitle__M60Jk",modalCloseButton:"ReadFileCitationContent-module_modalCloseButton__4bymQ",modalBody:"ReadFileCitationContent-module_modalBody__Oo7OO"};
|
|
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(".ReadFileCitationContent-module_container__Oi3tV{display:flex;flex-direction:column;gap:12px;margin-top:4px}.ReadFileCitationContent-module_blockContainer__yGEX8{border-radius:4px;overflow:hidden}.ReadFileCitationContent-module_header__39-AD{align-items:center;display:flex;font-family:monospace;font-size:12px;gap:8px;justify-content:space-between;padding:6px 12px}.ReadFileCitationContent-module_headerLeft__WOyMV{align-items:center;display:flex;flex:1;gap:8px;min-width:0}.ReadFileCitationContent-module_fileName__ql9Qu{cursor:pointer;opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_openFileButton__oqea1{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_openFileButton__oqea1:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_lineRanges__RIofb{flex-shrink:0;font-size:11px;max-width:300px;opacity:.7;overflow-x:auto;white-space:nowrap}.ReadFileCitationContent-module_editorWrapper__ab5Sg{overflow:hidden}.ReadFileCitationContent-module_highlightedLine__w6iv-{background-color:#3b82f626!important}.ReadFileCitationContent-module_highlightedLineDecoration__EykBL{background-color:#3b82f6;margin-left:0;width:3px!important}.ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP{background-color:#eab30833!important}.ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N{background-color:#eab308;margin-left:0;width:3px!important}.ReadFileCitationContent-module_emptyState__34kcg{font-size:14px;padding:12px;text-align:center}.ReadFileCitationContent-module_loadingEditor__aOHYT{align-items:center;display:flex;font-size:14px;height:64px;justify-content:center}.ReadFileCitationContent-module_headerRight__Hetda{align-items:center;display:flex;flex-shrink:0;gap:6px}.ReadFileCitationContent-module_expandButton__wjkgL{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_expandButton__wjkgL:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalOverlay__ZJSqk{align-items:center;background-color:#000000b3;box-sizing:border-box;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:9999}.ReadFileCitationContent-module_modalContent__PA-tB{background:#1e1e1e;border:1px solid #3c3c3c;border-radius:6px;display:flex;flex-direction:column;max-height:90vh;max-width:900px;overflow:hidden;width:100%}.ReadFileCitationContent-module_modalHeader__9Jcjf{align-items:center;background:#252526;border-bottom:1px solid #3c3c3c;display:flex;flex-shrink:0;justify-content:space-between;padding:10px 14px}.ReadFileCitationContent-module_modalTitle__M60Jk{align-items:center;color:#ccc;display:flex;font-family:monospace;font-size:13px;gap:6px;min-width:0;opacity:.85}.ReadFileCitationContent-module_modalTitleContent__QPLZb{align-items:center;display:inline-flex;gap:6px;min-width:0}.ReadFileCitationContent-module_modalTitleText__CptNG{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_modalCloseButton__4bymQ{align-items:center;background:none;border:none;border-radius:4px;color:#ccc;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_modalCloseButton__4bymQ:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalBody__Oo7OO{flex:1;overflow-y:auto;padding:12px}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={container:"ReadFileCitationContent-module_container__Oi3tV",blockContainer:"ReadFileCitationContent-module_blockContainer__yGEX8",header:"ReadFileCitationContent-module_header__39-AD",headerLeft:"ReadFileCitationContent-module_headerLeft__WOyMV",fileName:"ReadFileCitationContent-module_fileName__ql9Qu",openFileButton:"ReadFileCitationContent-module_openFileButton__oqea1",lineRanges:"ReadFileCitationContent-module_lineRanges__RIofb",editorWrapper:"ReadFileCitationContent-module_editorWrapper__ab5Sg",highlightedLine:"ReadFileCitationContent-module_highlightedLine__w6iv-",highlightedLineDecoration:"ReadFileCitationContent-module_highlightedLineDecoration__EykBL",yellowHighlightedLine:"ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP",yellowHighlightedLineDecoration:"ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N",emptyState:"ReadFileCitationContent-module_emptyState__34kcg",loadingEditor:"ReadFileCitationContent-module_loadingEditor__aOHYT",headerRight:"ReadFileCitationContent-module_headerRight__Hetda",expandButton:"ReadFileCitationContent-module_expandButton__wjkgL",modalOverlay:"ReadFileCitationContent-module_modalOverlay__ZJSqk",modalContent:"ReadFileCitationContent-module_modalContent__PA-tB",modalHeader:"ReadFileCitationContent-module_modalHeader__9Jcjf",modalTitle:"ReadFileCitationContent-module_modalTitle__M60Jk",modalTitleContent:"ReadFileCitationContent-module_modalTitleContent__QPLZb",modalTitleText:"ReadFileCitationContent-module_modalTitleText__CptNG",modalCloseButton:"ReadFileCitationContent-module_modalCloseButton__4bymQ",modalBody:"ReadFileCitationContent-module_modalBody__Oo7OO"};
|
|
2
2
|
//# sourceMappingURL=ReadFileCitationContent.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),r=require("react"),o=require("../UserStoryPicker.context.js"),l=[{value:"currentRepository",label:"Current Repository"},{value:"allRepository",label:"All
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),r=require("react"),o=require("../UserStoryPicker.context.js");function n(){return s.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:s.jsx("path",{d:"m18 15-6-6-6 6"})}))}function t(){return s.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:s.jsx("path",{d:"m6 9 6 6 6-6"})}))}var l=[{value:"currentRepository",label:"Current Repository"},{value:"allRepository",label:"All Repositories"}];exports.ScopeDropdown=function(i){var u,a,c=i.options,p=void 0===c?l:c,d=i.className,_=i.style;i.labelStyle;var v=i.selectStyle,f=o.useUSPContext(),x=f.state,g=f.dispatch,j=f.classNames,m=f.renderProps,y=f.onScopeRepoChange,h=r.useState(!1),w=h[0],b=h[1],k=r.useRef(null),R=r.useCallback(function(e){g({type:"SET_SCOPE_REPO",payload:e}),null==y||y(e),b(!1)},[g,y]);if(r.useEffect(function(){function e(e){k.current&&!k.current.contains(e.target)&&b(!1)}return w&&document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[w]),m.renderScopeDropdown)return m.renderScopeDropdown(x.scopeRepo,R,p);var S=null!==(a=null===(u=p.find(function(e){return e.value===x.scopeRepo}))||void 0===u?void 0:u.label)&&void 0!==a?a:p[0].label,C=["usp-user-story-scope",j.scopeDropdown,d].filter(Boolean).join(" ");return s.jsxs("div",e.__assign({ref:k,className:[C,w&&"open"].filter(Boolean).join(" "),style:_},{children:[s.jsxs("button",e.__assign({type:"button",className:"usp-user-story-scope__trigger",style:v,onClick:function(){return b(function(e){return!e})}},{children:[s.jsx("span",e.__assign({className:"usp-user-story-scope__trigger-label"},{children:S})),s.jsx("span",e.__assign({className:"usp-user-story-scope__chevron"},{children:w?s.jsx(n,{}):s.jsx(t,{})}))," "]})),w&&s.jsx("ul",e.__assign({className:"usp-user-story-scope__menu",role:"listbox"},{children:p.map(function(r){return s.jsx("li",e.__assign({role:"option","aria-selected":x.scopeRepo===r.value,className:["usp-user-story-scope__option",x.scopeRepo===r.value&&"active"].filter(Boolean).join(" "),onClick:function(){return R(r.value)}},{children:r.label}),r.value)})}))]}))};
|
|
2
2
|
//# sourceMappingURL=ScopeDropdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),n=require("react"),r=require("../UserStoryPicker.context.js");function t(){return s.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:s.jsx("path",{d:"m18 15-6-6-6 6"})}))}function o(){return s.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:s.jsx("path",{d:"m6 9 6 6 6-6"})}))}var l=[{value:"All Types",label:"All Types"},{value:"ECG Technical User Story",label:"ECG Technical User Story"}];exports.TypeDropdown=function(i){var u,a,c=i.options,p=void 0===c?l:c,d=i.className,y=i.style;i.labelStyle;var _=i.selectStyle,v=r.useUSPContext(),f=v.state,x=v.dispatch,g=v.classNames,j=v.renderProps,m=v.onTypeChange,h=n.useState(!1),w=h[0],b=h[1],k=n.useRef(null),T=n.useCallback(function(e){x({type:"SET_TYPE",payload:e}),null==m||m(e),b(!1)},[x,m]);if(n.useEffect(function(){function e(e){k.current&&!k.current.contains(e.target)&&b(!1)}return w&&document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[w]),j.renderTypeDropdown)return j.renderTypeDropdown(f.typeBy,T,p);var C=null!==(a=null===(u=p.find(function(e){return e.value===f.typeBy}))||void 0===u?void 0:u.label)&&void 0!==a?a:p[0].label,B=["usp-user-story-scope",g.scopeDropdown,d].filter(Boolean).join(" ");return s.jsxs("div",e.__assign({ref:k,className:[B,w&&"open"].filter(Boolean).join(" "),style:y},{children:[s.jsxs("button",e.__assign({type:"button",className:"usp-user-story-scope__trigger",style:_,onClick:function(){return b(function(e){return!e})}},{children:[s.jsx("span",e.__assign({className:"usp-user-story-scope__trigger-label"},{children:C})),s.jsx("span",e.__assign({className:"usp-user-story-scope__chevron"},{children:w?s.jsx(t,{}):s.jsx(o,{})}))," "]})),w&&s.jsx("ul",e.__assign({className:"usp-user-story-scope__menu"},{children:p.map(function(n){return s.jsx("li",e.__assign({className:["usp-user-story-scope__option",f.typeBy===n.value&&"active"].filter(Boolean).join(" "),onClick:function(){return T(n.value)}},{children:n.label}),n.value)})}))]}))};
|
|
2
2
|
//# sourceMappingURL=TypeDropdown.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as i}from"tslib";import{jsx as n}from"react/jsx-runtime";import{useState as r,useEffect as s}from"react";import a from"@exuanbo/file-icons-js";import{File as o,FileText as c}from"lucide-react";import{cn as l}from"../../../../UserStoryImport/lib/cn.js";var m=!1;function f(f){var u=this,d=f.name,h=f.size,p=void 0===h?"12px":h,x=f.className,v=r(x||""),g=v[0],y=v[1];return s(function(){t(u,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,a.getClass(d,{array:!0})];case 1:return e=t.sent(),y(e.join(" ")),[2]}})})},[d]),s(function(){if(!m){var e=document.createElement("style");e.innerHTML="\n .custom-file-icon::before {\n font-size: inherit !important;\n }\n ",document.head.appendChild(e),m=!0}},[]),d.includes(".txt")?n(o,{className:l("w-3 h-3 mr-2 text-muted",x)}):d.includes(".pdf")?n(c,{className:l("w-3 h-3 mr-2 text-destructive",x)}):n("span",e({className:"mt-0",style:{width:p,height:p,display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top"}},{children:g?n("i",{className:l("custom-file-icon",g,x),style:{fontSize:p,height:p,display:"inline-flex",alignItems:"center",lineHeight:1}}):n(o,{className:l("text-muted",x),width:p,height:p})}))}export{f as default};
|
|
2
|
+
//# sourceMappingURL=CustomFileIcon.js.map
|
package/dist/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomFileIcon.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useMemo as r,useState as o,useRef as l,useCallback as a,useEffect as u}from"react";import c from"react-dom";import*as s from"monaco-editor";import d from"./ReadFileCitationContent.module.css.js";import h from"./icons/ExternalLinkIcon.js";import{X as m,Maximize2 as f}from"lucide-react";"undefined"!=typeof self&&(self.MonacoEnvironment=e(e({},self.MonacoEnvironment),{getWorker:function(){return{postMessage:function(){},terminate:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!0},onmessage:null,onerror:null,onmessageerror:null}}}));var g=!1,v=function(){if(!g&&"undefined"!=typeof document)try{var e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;overflow:hidden;visibility:hidden;pointer-events:none;",document.body.appendChild(e),s.editor.create(e,{value:"",language:"plaintext",automaticLayout:!1,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0}).dispose(),document.body.removeChild(e),g=!0}catch(e){g=!0}};v(),"undefined"!=typeof window&&(window.addEventListener("error",function(e){var n=e.message||"";if(n.includes("Worker")||n.includes("Monaco"))return e.preventDefault(),e.stopImmediatePropagation(),!1},!0),window.addEventListener("unhandledrejection",function(e){var n,t=(null===(n=e.reason)||void 0===n?void 0:n.message)||String(e.reason||"");(t.includes("Worker")||t.includes("Monaco"))&&(e.preventDefault(),e.stopImmediatePropagation())},!0));var p=function(e){return"number"==typeof e&&Number.isFinite(e)},y=function(e,n){return p(e)&&p(n)?e<=0||n<e?null:{start:e,end:n,length:n-e+1}:null},b=function(e,n,t,i){var r,o=e[0],l=e[1];if(!Number.isFinite(o)||!Number.isFinite(l))return null;if(l<o&&(o=(r=[l,o])[0],l=r[1]),p(t)&&p(i)){var a=Math.max(o,t),u=Math.min(l,i);if(a>u)return null;var c=a-t+1,s=u-t+1,d=Math.max(1,c),h=Math.min(n,s);return d>h?null:[d,h]}var m=Math.max(1,o),f=Math.min(n,l);return m>f?null:[m,f]},N=function(e,n,t,i){if(0===e.length)return!1;var r=y(t,i);return!!r&&(!!e.some(function(e){var t=e[0],i=e[1];return t>n||i>n})||(r.start>n||r.end>n||Math.abs(r.length-n)<=1&&!e.every(function(e){var n=e[0];return e[1]<r.start||n>r.end})))},x={border:"#3c3c3c",headerBg:"#252526",inactiveText:"#858585",background:"#1e1e1e",foreground:"#cccccc",highlightBg:"rgba(59, 130, 246, 0.15)",highlightGutter:"#3b82f6",hoverBg:"rgba(255, 255, 255, 0.1)"},C={theme:"vs-dark",fontSize:13,fontFamily:"Consolas, 'Courier New', monospace",maxHeight:300,minHeight:80},w={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",py:"python",rb:"ruby",java:"java",cpp:"cpp",c:"c",go:"go",rust:"rust",json:"json",html:"html",css:"css",scss:"scss",md:"markdown",sql:"sql",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml"},M=function(e){return w[e.toLowerCase()]||e},k=function(t){var i=t.code,r=t.language,o=t.theme,a=t.fontSize,c=t.fontFamily,h=t.height,m=t.blueHighlightRanges,f=t.yellowHighlightRanges,g=t.backgroundColor,p=t.editorWrapperStyle,y=t.lineNumberOffset,b=void 0===y?0:y,N=t.lineNumberDigits,x=l(null),C=l(null),w=l(!1);return u(function(){w.current=!1,v();var e=setTimeout(function(){var e,n=x.current;if(n&&!w.current&&!C.current)try{s.editor.setTheme(o);var t=s.editor.create(n,{value:i,language:M(r),readOnly:!0,domReadOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:a,lineHeight:20,fontFamily:c,lineNumbers:function(e){return String(e+b)},folding:!1,lineDecorationsWidth:10,lineNumbersMinChars:Math.max(4,null!=N?N:4),renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1,alwaysConsumeMouseWheel:!1},automaticLayout:!0,wordWrap:"off",contextmenu:!1,selectOnLineNumbers:!0,glyphMargin:!1,padding:{top:8,bottom:8},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,overviewRulerLanes:0,renderWhitespace:"none",guides:{indentation:!1},cursorStyle:"line",cursorBlinking:"solid",fixedOverflowWidgets:!0});C.current=t;var l=[];m.forEach(function(e){var n=e[0],t=e[1];l.push({range:new s.Range(n,1,t,1),options:{isWholeLine:!0,className:d.highlightedLine,linesDecorationsClassName:d.highlightedLineDecoration}})}),f.forEach(function(e){var n=e[0],t=e[1];l.push({range:new s.Range(n,1,t,1),options:{isWholeLine:!0,className:d.yellowHighlightedLine,linesDecorationsClassName:d.yellowHighlightedLineDecoration}})}),l.length>0&&t.createDecorationsCollection(l);var u=null!==(e=f[0])&&void 0!==e?e:m[0];u&&requestAnimationFrame(function(){!w.current&&C.current&&t.revealLineInCenter(u[0])})}catch(e){}},50);return function(){if(w.current=!0,clearTimeout(e),C.current){try{C.current.dispose()}catch(e){}C.current=null}}},[]),u(function(){try{s.editor.setTheme(o)}catch(e){}},[o]),n("div",e({className:d.editorWrapper,style:e({height:"".concat(h,"px"),backgroundColor:g},p)},{children:n("div",{ref:x,style:{width:"100%",height:"100%"}})}))},L=function(s){var g=s.citation,v=s.customStyles,w=s.customColors,M=s.customIcons,L=s.editorConfig,F=s.fileCallback,S=r(function(){return e(e({},x),w)},[w]),O=r(function(){return e(e({},C),L)},[L]),B=o(!1),H=B[0],W=B[1],j=l(null),E=l(!1),R=g.customMetadata.content||"",P=g.customMetadata.highlighted_text,T=g.customMetadata.start_line,z=g.customMetadata.end_line,D=r(function(){if(!P)return{};try{var e=P.trim();return e.startsWith("```")&&(e=(e=e.replace(/^```\w*\n?/,"")).replace(/\n?```\s*$/,"")),JSON.parse(e.trim())}catch(e){return console.error("Failed to parse highlight string:",e),{}}},[P]),I=r(function(){for(var e,n=[],t=/```(\w+)?\s*<file_path>([\s\S]*?)<\/file_path>\s*<code>([\s\S]*?)<\/code>\s*```/g;null!==(e=t.exec(R));){var i=e[1]||"javascript",r=e[2].trim(),o=e[3].trim();r&&o&&n.push({filePath:r,code:o,language:i})}return n},[R]),_=a(function(e){return(D[e]||[]).map(function(e){var n=e.split("-").map(function(e){return Number(e.trim())}),t=n[0],i=n.length>1?n[1]:t;return Number.isFinite(t)&&Number.isFinite(i)?[t,i]:null}).filter(function(e){return null!==e})},[D]),q=r(function(){for(var e=function(e){var n=I[e],t=n.code.split("\n").length,i=_(n.filePath),r=N(i,t,T,z);if(i.map(function(e){return b(e,t,r?T:void 0,r?z:void 0)}).filter(function(e){return null!==e}).length>0)return{value:e}},n=0;n<I.length;n++){var t=e(n);if("object"==typeof t)return t.value}return-1},[I,_,T,z]),G=q>=0,A=a(function(e,n){var t=_(e),i=N(t,n,T,z);return t.map(function(e){return b(e,n,i?T:void 0,i?z:void 0)}).filter(function(e){return null!==e})},[_,T,z]),J=a(function(e,n){if(null==T||null==z)return[];var t=n||function(e,n,t){var i=y(n,t);return!!i&&(i.start>e||i.end>e||Math.abs(i.length-e)<=1)}(e,T,z);if(t){var i=y(T,z);if(!i)return[];var r=Math.min(e,i.length);return r<1?[]:[[1,r]]}var o=Math.max(1,0===T?1:T),l=Math.min(z,e);return o>l?[]:[[o,l]]},[T,z]);u(function(){if(G&&!E.current&&I.length>0&&(null==F?void 0:F.autoOpenFirstHighlighted)&&(null==F?void 0:F.onOpenFile)){var e=I[q],n=A(e.filePath,e.code.split("\n").length);E.current=!0;var t=setTimeout(function(){F.onOpenFile({filePath:e.filePath,ranges:n.length>0?n:null})},300);return function(){return clearTimeout(t)}}},[G,q,I,A,F]),u(function(){E.current=!1},[R]),u(function(){if(!(q<0)){var e=setTimeout(function(){var e;null===(e=j.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},350);return function(){return clearTimeout(e)}}},[q,P]);var V=a(function(e,n){if(null==F?void 0:F.onOpenFile){var t=A(e,n);F.onOpenFile({filePath:e,ranges:t.length>0?t:null})}},[A,F]),$=a(function(){(null==F?void 0:F.onExpandClick)?F.onExpandClick({blocks:I,highlightMap:D}):W(!0)},[F,I,D]),K=!!(null==F?void 0:F.onOpenFile),Q=(null==M?void 0:M.readFileCitationIcon)||n(h,{style:{width:"14px",height:"14px"}}),U=function(i){return I.map(function(r,o){var l,a,u=r.code.split("\n").length,c=_(r.filePath),s=N(c,u,T,z),h=c.map(function(e){return b(e,u,s?T:void 0,s?z:void 0)}).filter(function(e){return null!==e}),m=s&&p(T)?h.map(function(e){var n=e[0],t=e[1];return[n+T-1,t+T-1]}):h,g=h.length>0,y=o===q,x=i?600:O.maxHeight,C=(l=20*r.code.split("\n").length+16+4,Math.min(Math.max(l,O.minHeight),x)),w=r.filePath.split("/").pop(),M=J(u,s),L=s&&p(T)?T-1:0,F=L+u,B=String(Math.max(1,F)).length;return t("div",e({ref:!i&&y?j:void 0,"data-highlighted":g?"true":void 0,"data-first-highlighted":y?"true":void 0,className:d.blockContainer,style:e({border:"1px solid ".concat(S.border)},null==v?void 0:v.blockContainer)},{children:[t("div",e({className:d.header,style:e({backgroundColor:g?S.highlightBg:S.headerBg,borderBottom:"1px solid ".concat(S.border),color:g?S.highlightGutter:S.foreground},g?null==v?void 0:v.headerHighlighted:null==v?void 0:v.header)},{children:[t("div",e({className:d.headerLeft},{children:[n("span",e({className:d.fileName,title:r.filePath,style:null==v?void 0:v.fileName},{children:w})),K&&n("button",e({className:d.openFileButton,onClick:function(){return V(r.filePath,u)},title:"Open in editor","aria-label":"Open ".concat(w," in editor"),style:null==v?void 0:v.openFileButton},{children:Q}))]})),t("div",e({className:d.headerRight},{children:[g&&n("span",e({className:d.lineRanges,style:null==v?void 0:v.lineRanges},{children:(a=m,a.map(function(e){var n=e[0],t=e[1];return n===t?"L".concat(n):"L".concat(n,"-").concat(t)}).join(", "))})),!i&&0===o&&n("button",e({className:d.expandButton,style:null==v?void 0:v.expandButton,onClick:$,title:"Expand","aria-label":"Expand code view"},{children:n(f,{size:13})}))]}))]})),n(k,{code:r.code,language:r.language,theme:O.theme,fontSize:O.fontSize,fontFamily:O.fontFamily,height:C,blueHighlightRanges:M,yellowHighlightRanges:h,backgroundColor:S.background,editorWrapperStyle:null==v?void 0:v.editorWrapper,lineNumberOffset:L,lineNumberDigits:B})]}),o)})};if(0===I.length)return n("div",e({className:d.emptyState,style:e({color:S.inactiveText},null==v?void 0:v.emptyState)},{children:"No code content available"}));var X=H?c.createPortal(n("div",e({className:d.modalOverlay,style:null==v?void 0:v.modalOverlay,onClick:function(e){e.target===e.currentTarget&&W(!1)}},{children:t("div",e({className:d.modalContent,style:null==v?void 0:v.modalContent},{children:[t("div",e({className:d.modalHeader,style:null==v?void 0:v.modalHeader},{children:[n("span",e({className:d.modalTitle,style:null==v?void 0:v.modalTitle},{children:1===I.length?I[0].filePath:"".concat(I.length," files")})),n("button",e({className:d.modalCloseButton,style:null==v?void 0:v.modalCloseButton,onClick:function(){return W(!1)},"aria-label":"Close expanded view"},{children:n(m,{size:16})}))]})),n("div",e({className:d.modalBody},{children:n("div",e({className:d.container,style:null==v?void 0:v.container},{children:U(!0)}))}))]}))})),document.body):null;return t(i,{children:[X,n("div",e({className:d.container,style:null==v?void 0:v.container},{children:U(!1)}))]})};export{L as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as t,Fragment as i}from"react/jsx-runtime";import{useMemo as r,useState as o,useRef as l,useCallback as a,useEffect as u}from"react";import c from"react-dom";import*as s from"monaco-editor";import d from"./ReadFileCitationContent.module.css.js";import h from"./icons/ExternalLinkIcon.js";import{X as m,Maximize2 as f}from"lucide-react";import v from"./CustomFileIcon.js";"undefined"!=typeof self&&(self.MonacoEnvironment=e(e({},self.MonacoEnvironment),{getWorker:function(){return{postMessage:function(){},terminate:function(){},addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){return!0},onmessage:null,onerror:null,onmessageerror:null}}}));var g=!1,p=function(){if(!g&&"undefined"!=typeof document)try{var e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;overflow:hidden;visibility:hidden;pointer-events:none;",document.body.appendChild(e),s.editor.create(e,{value:"",language:"plaintext",automaticLayout:!1,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden"},overviewRulerLanes:0,lineNumbers:"off",glyphMargin:!1,folding:!1,lineDecorationsWidth:0,lineNumbersMinChars:0}).dispose(),document.body.removeChild(e),g=!0}catch(e){g=!0}};p(),"undefined"!=typeof window&&(window.addEventListener("error",function(e){var n=e.message||"";if(n.includes("Worker")||n.includes("Monaco"))return e.preventDefault(),e.stopImmediatePropagation(),!1},!0),window.addEventListener("unhandledrejection",function(e){var n,t=(null===(n=e.reason)||void 0===n?void 0:n.message)||String(e.reason||"");(t.includes("Worker")||t.includes("Monaco"))&&(e.preventDefault(),e.stopImmediatePropagation())},!0));var y=function(e){return"number"==typeof e&&Number.isFinite(e)},b=function(e,n){return y(e)&&y(n)?e<=0||n<e?null:{start:e,end:n,length:n-e+1}:null},N=function(e,n,t,i){var r,o=e[0],l=e[1];if(!Number.isFinite(o)||!Number.isFinite(l))return null;if(l<o&&(o=(r=[l,o])[0],l=r[1]),y(t)&&y(i)){var a=Math.max(o,t),u=Math.min(l,i);if(a>u)return null;var c=a-t+1,s=u-t+1,d=Math.max(1,c),h=Math.min(n,s);return d>h?null:[d,h]}var m=Math.max(1,o),f=Math.min(n,l);return m>f?null:[m,f]},x=function(e,n,t,i){if(0===e.length)return!1;var r=b(t,i);return!!r&&(!!e.some(function(e){var t=e[0],i=e[1];return t>n||i>n})||(r.start>n||r.end>n||Math.abs(r.length-n)<=1&&!e.every(function(e){var n=e[0];return e[1]<r.start||n>r.end})))},C={border:"#3c3c3c",headerBg:"#252526",inactiveText:"#858585",background:"#1e1e1e",foreground:"#cccccc",highlightBg:"rgba(59, 130, 246, 0.15)",highlightGutter:"#3b82f6",hoverBg:"rgba(255, 255, 255, 0.1)"},w={theme:"vs-dark",fontSize:13,fontFamily:"Consolas, 'Courier New', monospace",maxHeight:300,minHeight:80},M={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",py:"python",rb:"ruby",java:"java",cpp:"cpp",c:"c",go:"go",rust:"rust",json:"json",html:"html",css:"css",scss:"scss",md:"markdown",sql:"sql",sh:"shell",bash:"shell",yaml:"yaml",yml:"yaml"},k=function(e){return M[e.toLowerCase()]||e},F=function(t){var i=t.code,r=t.language,o=t.theme,a=t.fontSize,c=t.fontFamily,h=t.height,m=t.yellowHighlightRanges,f=t.backgroundColor,v=t.editorWrapperStyle,g=t.lineNumberOffset,y=void 0===g?0:g,b=t.lineNumberDigits,N=l(null),x=l(null),C=l(!1);return u(function(){C.current=!1,p();var e=setTimeout(function(){var e=N.current;if(e&&!C.current&&!x.current)try{s.editor.setTheme(o);var n=s.editor.create(e,{value:i,language:k(r),readOnly:!0,domReadOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:a,lineHeight:20,fontFamily:c,lineNumbers:function(e){return String(e+y)},folding:!1,lineDecorationsWidth:10,lineNumbersMinChars:Math.max(4,null!=b?b:4),renderLineHighlight:"none",scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8,useShadows:!1,alwaysConsumeMouseWheel:!1},automaticLayout:!0,wordWrap:"off",contextmenu:!1,selectOnLineNumbers:!0,glyphMargin:!1,padding:{top:8,bottom:8},overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,overviewRulerLanes:0,renderWhitespace:"none",guides:{indentation:!1},cursorStyle:"line",cursorBlinking:"solid",fixedOverflowWidgets:!0});x.current=n;var t=[];m.forEach(function(e){var n=e[0],i=e[1];t.push({range:new s.Range(n,1,i,1),options:{isWholeLine:!0,className:d.yellowHighlightedLine,linesDecorationsClassName:d.yellowHighlightedLineDecoration}})}),t.length>0&&n.createDecorationsCollection(t);var l=m[0];l&&requestAnimationFrame(function(){!C.current&&x.current&&n.revealLineInCenter(l[0])})}catch(e){}},50);return function(){if(C.current=!0,clearTimeout(e),x.current){try{x.current.dispose()}catch(e){}x.current=null}}},[]),u(function(){try{s.editor.setTheme(o)}catch(e){}},[o]),n("div",e({className:d.editorWrapper,style:e({height:"".concat(h,"px"),backgroundColor:f},v)},{children:n("div",{ref:N,style:{width:"100%",height:"100%"}})}))},S=function(s){var g=s.citation,p=s.customStyles,M=s.customColors,k=s.customIcons,S=s.editorConfig,L=s.fileCallback,O=r(function(){return e(e({},C),M)},[M]),T=r(function(){return e(e({},w),S)},[S]),j=o(!1),B=j[0],P=j[1],W=l(null),E=l(!1),H=g.customMetadata.content||"",z=g.customMetadata.highlighted_text,R=g.customMetadata.start_line,D=g.customMetadata.end_line,I=y(R)?R+1:R,_=r(function(){if(!z)return{};try{var e=z.trim();return e.startsWith("```")&&(e=(e=e.replace(/^```\w*\n?/,"")).replace(/\n?```\s*$/,"")),JSON.parse(e.trim())}catch(e){return console.error("Failed to parse highlight string:",e),{}}},[z]),q=r(function(){for(var e,n=[],t=/```(\w+)?\s*<file_path>([\s\S]*?)<\/file_path>\s*<code>([\s\S]*?)<\/code>\s*```/g;null!==(e=t.exec(H));){var i=e[1]||"javascript",r=e[2].trim(),o=e[3].trim();r&&o&&n.push({filePath:r,code:o,language:i})}return n},[H]),G=a(function(e){return(_[e]||[]).map(function(e){var n=e.split("-").map(function(e){return Number(e.trim())}),t=n[0],i=n.length>1?n[1]:t;return Number.isFinite(t)&&Number.isFinite(i)?[t,i]:null}).filter(function(e){return null!==e})},[_]),A=r(function(){for(var e=function(e){var n=q[e],t=n.code.split("\n").length,i=G(n.filePath),r=x(i,t,I,D);if(i.map(function(e){return N(e,t,r?I:void 0,r?D:void 0)}).filter(function(e){return null!==e}).length>0)return{value:e}},n=0;n<q.length;n++){var t=e(n);if("object"==typeof t)return t.value}return-1},[q,G,I,D]),J=A>=0,V=a(function(e,n){var t=G(e),i=x(t,n,I,D);return t.map(function(e){return N(e,n,i?I:void 0,i?D:void 0)}).filter(function(e){return null!==e})},[G,I,D]),$=a(function(e,n){var t=G(e);if(x(t,n,I,D)){var i=b(I,D);return i?t.map(function(e){var n=e[0],t=e[1],r=n<=t?[n,t]:[t,n],o=Math.max(r[0],i.start),l=Math.min(r[1],i.end);return o>l?null:[o,l]}).filter(function(e){return null!==e}):[]}return V(e,n)},[G,V,I,D]);u(function(){if(J&&!E.current&&q.length>0&&(null==L?void 0:L.autoOpenFirstHighlighted)&&(null==L?void 0:L.onOpenFile)){var e=q[A],n=$(e.filePath,e.code.split("\n").length);E.current=!0;var t=setTimeout(function(){L.onOpenFile({filePath:e.filePath,ranges:n.length>0?n:null})},300);return function(){return clearTimeout(t)}}},[J,A,q,V,L]),u(function(){E.current=!1},[H]),u(function(){if(!(A<0)){var e=setTimeout(function(){var e;null===(e=W.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},350);return function(){return clearTimeout(e)}}},[A,z]);var K=a(function(e,n){if(null==L?void 0:L.onOpenFile){var t=$(e,n);L.onOpenFile({filePath:e,ranges:t.length>0?t:null})}},[$,L]),Q=a(function(){(null==L?void 0:L.onExpandClick)?L.onExpandClick({blocks:q,highlightMap:_}):P(!0)},[L,q,_]),U=!!(null==L?void 0:L.onOpenFile),X=(null==k?void 0:k.readFileCitationIcon)||n(h,{style:{width:"14px",height:"14px"}}),Y=function(i){return q.map(function(r,o){var l,a,u=r.code.split("\n").length,c=G(r.filePath),s=x(c,u,I,D),h=c.map(function(e){return N(e,u,s?I:void 0,s?D:void 0)}).filter(function(e){return null!==e}),m=s&&y(I)?h.map(function(e){var n=e[0],t=e[1];return[n+I-1,t+I-1]}):h,v=h.length>0,g=o===A,b=i?600:T.maxHeight,C=(l=20*r.code.split("\n").length+16+4,Math.min(Math.max(l,T.minHeight),b)),w=r.filePath.split("/").pop(),M=s&&y(I)?I-1:0,k=M+u,S=String(Math.max(1,k)).length;return t("div",e({ref:!i&&g?W:void 0,"data-highlighted":v?"true":void 0,"data-first-highlighted":g?"true":void 0,className:d.blockContainer,style:e({border:"1px solid ".concat(O.border)},null==p?void 0:p.blockContainer)},{children:[t("div",e({className:d.header,style:e({backgroundColor:v?O.highlightBg:O.headerBg,borderBottom:"1px solid ".concat(O.border),color:v?O.highlightGutter:O.foreground},v?null==p?void 0:p.headerHighlighted:null==p?void 0:p.header)},{children:[t("div",e({className:d.headerLeft},{children:[n("span",e({className:d.fileName,title:r.filePath,style:null==p?void 0:p.fileName,onClick:function(){return K(r.filePath,u)}},{children:w})),U&&n("button",e({className:d.openFileButton,onClick:function(){return K(r.filePath,u)},title:"Open in editor","aria-label":"Open ".concat(w," in editor"),style:null==p?void 0:p.openFileButton},{children:X}))]})),t("div",e({className:d.headerRight},{children:[v&&n("span",e({className:d.lineRanges,style:null==p?void 0:p.lineRanges},{children:(a=m,a.map(function(e){var n=e[0],t=e[1];return n===t?"L".concat(n):"L".concat(n,"-").concat(t)}).join(", "))})),!i&&0===o&&n("button",e({className:d.expandButton,style:null==p?void 0:p.expandButton,onClick:Q,title:"Expand","aria-label":"Expand code view"},{children:n(f,{size:13})}))]}))]})),n(F,{code:r.code,language:r.language,theme:T.theme,fontSize:T.fontSize,fontFamily:T.fontFamily,height:C,yellowHighlightRanges:h,backgroundColor:O.background,editorWrapperStyle:null==p?void 0:p.editorWrapper,lineNumberOffset:M,lineNumberDigits:S})]}),o)})};if(0===q.length)return n("div",e({className:d.emptyState,style:e({color:O.inactiveText},null==p?void 0:p.emptyState)},{children:"No code content available"}));var Z=B?c.createPortal(n("div",e({className:d.modalOverlay,style:null==p?void 0:p.modalOverlay,onClick:function(e){e.target===e.currentTarget&&P(!1)}},{children:t("div",e({className:d.modalContent,style:null==p?void 0:p.modalContent},{children:[t("div",e({className:d.modalHeader,style:null==p?void 0:p.modalHeader},{children:[n("span",e({className:d.modalTitle,style:null==p?void 0:p.modalTitle},{children:1===q.length?t("span",e({className:d.modalTitleContent},{children:[n(v,{name:q[0].filePath,size:"15px"}),n("span",e({className:d.modalTitleText},{children:q[0].filePath}))]})):"".concat(q.length," files")})),n("button",e({className:d.modalCloseButton,style:null==p?void 0:p.modalCloseButton,onClick:function(){return P(!1)},"aria-label":"Close expanded view"},{children:n(m,{size:16})}))]})),n("div",e({className:d.modalBody},{children:n("div",e({className:d.container,style:null==p?void 0:p.container},{children:Y(!0)}))}))]}))})),document.body):null;return t(i,{children:[Z,n("div",e({className:d.container,style:null==p?void 0:p.container},{children:Y(!1)}))]})};export{S as default};
|
|
2
2
|
//# sourceMappingURL=ReadFileCitationContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={container:"ReadFileCitationContent-module_container__Oi3tV",blockContainer:"ReadFileCitationContent-module_blockContainer__yGEX8",header:"ReadFileCitationContent-module_header__39-AD",headerLeft:"ReadFileCitationContent-module_headerLeft__WOyMV",fileName:"ReadFileCitationContent-module_fileName__ql9Qu",openFileButton:"ReadFileCitationContent-module_openFileButton__oqea1",lineRanges:"ReadFileCitationContent-module_lineRanges__RIofb",editorWrapper:"ReadFileCitationContent-module_editorWrapper__ab5Sg",highlightedLine:"ReadFileCitationContent-module_highlightedLine__w6iv-",highlightedLineDecoration:"ReadFileCitationContent-module_highlightedLineDecoration__EykBL",yellowHighlightedLine:"ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP",yellowHighlightedLineDecoration:"ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N",emptyState:"ReadFileCitationContent-module_emptyState__34kcg",loadingEditor:"ReadFileCitationContent-module_loadingEditor__aOHYT",headerRight:"ReadFileCitationContent-module_headerRight__Hetda",expandButton:"ReadFileCitationContent-module_expandButton__wjkgL",modalOverlay:"ReadFileCitationContent-module_modalOverlay__ZJSqk",modalContent:"ReadFileCitationContent-module_modalContent__PA-tB",modalHeader:"ReadFileCitationContent-module_modalHeader__9Jcjf",modalTitle:"ReadFileCitationContent-module_modalTitle__M60Jk",modalCloseButton:"ReadFileCitationContent-module_modalCloseButton__4bymQ",modalBody:"ReadFileCitationContent-module_modalBody__Oo7OO"};!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(".ReadFileCitationContent-module_container__Oi3tV{display:flex;flex-direction:column;gap:12px;margin-top:4px}.ReadFileCitationContent-module_blockContainer__yGEX8{border-radius:4px;overflow:hidden}.ReadFileCitationContent-module_header__39-AD{align-items:center;display:flex;font-family:monospace;font-size:12px;gap:8px;justify-content:space-between;padding:6px 12px}.ReadFileCitationContent-module_headerLeft__WOyMV{align-items:center;display:flex;flex:1;gap:8px;min-width:0}.ReadFileCitationContent-module_fileName__ql9Qu{opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_openFileButton__oqea1{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_openFileButton__oqea1:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_lineRanges__RIofb{flex-shrink:0;font-size:11px;max-width:300px;opacity:.7;overflow-x:auto;white-space:nowrap}.ReadFileCitationContent-module_editorWrapper__ab5Sg{overflow:hidden}.ReadFileCitationContent-module_highlightedLine__w6iv-{background-color:#3b82f626!important}.ReadFileCitationContent-module_highlightedLineDecoration__EykBL{background-color:#3b82f6;margin-left:0;width:3px!important}.ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP{background-color:#eab30833!important}.ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N{background-color:#eab308;margin-left:0;width:3px!important}.ReadFileCitationContent-module_emptyState__34kcg{font-size:14px;padding:12px;text-align:center}.ReadFileCitationContent-module_loadingEditor__aOHYT{align-items:center;display:flex;font-size:14px;height:64px;justify-content:center}.ReadFileCitationContent-module_headerRight__Hetda{align-items:center;display:flex;flex-shrink:0;gap:6px}.ReadFileCitationContent-module_expandButton__wjkgL{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_expandButton__wjkgL:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalOverlay__ZJSqk{align-items:center;background-color:#000000b3;box-sizing:border-box;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:9999}.ReadFileCitationContent-module_modalContent__PA-tB{background:#1e1e1e;border:1px solid #3c3c3c;border-radius:6px;display:flex;flex-direction:column;max-height:90vh;max-width:900px;overflow:hidden;width:100%}.ReadFileCitationContent-module_modalHeader__9Jcjf{align-items:center;background:#252526;border-bottom:1px solid #3c3c3c;display:flex;flex-shrink:0;justify-content:space-between;padding:10px 14px}.ReadFileCitationContent-module_modalTitle__M60Jk{color:#ccc;font-family:monospace;font-size:13px;opacity:.85}.ReadFileCitationContent-module_modalCloseButton__4bymQ{align-items:center;background:none;border:none;border-radius:4px;color:#ccc;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_modalCloseButton__4bymQ:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalBody__Oo7OO{flex:1;overflow-y:auto;padding:12px}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
1
|
+
var e={container:"ReadFileCitationContent-module_container__Oi3tV",blockContainer:"ReadFileCitationContent-module_blockContainer__yGEX8",header:"ReadFileCitationContent-module_header__39-AD",headerLeft:"ReadFileCitationContent-module_headerLeft__WOyMV",fileName:"ReadFileCitationContent-module_fileName__ql9Qu",openFileButton:"ReadFileCitationContent-module_openFileButton__oqea1",lineRanges:"ReadFileCitationContent-module_lineRanges__RIofb",editorWrapper:"ReadFileCitationContent-module_editorWrapper__ab5Sg",highlightedLine:"ReadFileCitationContent-module_highlightedLine__w6iv-",highlightedLineDecoration:"ReadFileCitationContent-module_highlightedLineDecoration__EykBL",yellowHighlightedLine:"ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP",yellowHighlightedLineDecoration:"ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N",emptyState:"ReadFileCitationContent-module_emptyState__34kcg",loadingEditor:"ReadFileCitationContent-module_loadingEditor__aOHYT",headerRight:"ReadFileCitationContent-module_headerRight__Hetda",expandButton:"ReadFileCitationContent-module_expandButton__wjkgL",modalOverlay:"ReadFileCitationContent-module_modalOverlay__ZJSqk",modalContent:"ReadFileCitationContent-module_modalContent__PA-tB",modalHeader:"ReadFileCitationContent-module_modalHeader__9Jcjf",modalTitle:"ReadFileCitationContent-module_modalTitle__M60Jk",modalTitleContent:"ReadFileCitationContent-module_modalTitleContent__QPLZb",modalTitleText:"ReadFileCitationContent-module_modalTitleText__CptNG",modalCloseButton:"ReadFileCitationContent-module_modalCloseButton__4bymQ",modalBody:"ReadFileCitationContent-module_modalBody__Oo7OO"};!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(".ReadFileCitationContent-module_container__Oi3tV{display:flex;flex-direction:column;gap:12px;margin-top:4px}.ReadFileCitationContent-module_blockContainer__yGEX8{border-radius:4px;overflow:hidden}.ReadFileCitationContent-module_header__39-AD{align-items:center;display:flex;font-family:monospace;font-size:12px;gap:8px;justify-content:space-between;padding:6px 12px}.ReadFileCitationContent-module_headerLeft__WOyMV{align-items:center;display:flex;flex:1;gap:8px;min-width:0}.ReadFileCitationContent-module_fileName__ql9Qu{cursor:pointer;opacity:.9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_openFileButton__oqea1{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_openFileButton__oqea1:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_lineRanges__RIofb{flex-shrink:0;font-size:11px;max-width:300px;opacity:.7;overflow-x:auto;white-space:nowrap}.ReadFileCitationContent-module_editorWrapper__ab5Sg{overflow:hidden}.ReadFileCitationContent-module_highlightedLine__w6iv-{background-color:#3b82f626!important}.ReadFileCitationContent-module_highlightedLineDecoration__EykBL{background-color:#3b82f6;margin-left:0;width:3px!important}.ReadFileCitationContent-module_yellowHighlightedLine__bZ6XP{background-color:#eab30833!important}.ReadFileCitationContent-module_yellowHighlightedLineDecoration__Ru91N{background-color:#eab308;margin-left:0;width:3px!important}.ReadFileCitationContent-module_emptyState__34kcg{font-size:14px;padding:12px;text-align:center}.ReadFileCitationContent-module_loadingEditor__aOHYT{align-items:center;display:flex;font-size:14px;height:64px;justify-content:center}.ReadFileCitationContent-module_headerRight__Hetda{align-items:center;display:flex;flex-shrink:0;gap:6px}.ReadFileCitationContent-module_expandButton__wjkgL{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_expandButton__wjkgL:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalOverlay__ZJSqk{align-items:center;background-color:#000000b3;box-sizing:border-box;display:flex;inset:0;justify-content:center;padding:24px;position:fixed;z-index:9999}.ReadFileCitationContent-module_modalContent__PA-tB{background:#1e1e1e;border:1px solid #3c3c3c;border-radius:6px;display:flex;flex-direction:column;max-height:90vh;max-width:900px;overflow:hidden;width:100%}.ReadFileCitationContent-module_modalHeader__9Jcjf{align-items:center;background:#252526;border-bottom:1px solid #3c3c3c;display:flex;flex-shrink:0;justify-content:space-between;padding:10px 14px}.ReadFileCitationContent-module_modalTitle__M60Jk{align-items:center;color:#ccc;display:flex;font-family:monospace;font-size:13px;gap:6px;min-width:0;opacity:.85}.ReadFileCitationContent-module_modalTitleContent__QPLZb{align-items:center;display:inline-flex;gap:6px;min-width:0}.ReadFileCitationContent-module_modalTitleText__CptNG{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ReadFileCitationContent-module_modalCloseButton__4bymQ{align-items:center;background:none;border:none;border-radius:4px;color:#ccc;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:2px;transition:opacity .15s ease,background-color .15s ease}.ReadFileCitationContent-module_modalCloseButton__4bymQ:hover{background-color:#ffffff1a;opacity:1}.ReadFileCitationContent-module_modalBody__Oo7OO{flex:1;overflow-y:auto;padding:12px}"));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
2
|
//# sourceMappingURL=ReadFileCitationContent.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{useState as n,useRef as t,useCallback as s,useEffect as l}from"react";import{useUSPContext as i}from"../UserStoryPicker.context.js";function u(){return r("svg",e({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r("path",{d:"m18 15-6-6-6 6"})}))}function c(){return r("svg",e({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:r("path",{d:"m6 9 6 6 6-6"})}))}var a=[{value:"currentRepository",label:"Current Repository"},{value:"allRepository",label:"All Repositories"}];function p(p){var d,m,v=p.options,f=void 0===v?a:v,y=p.className,h=p.style;p.labelStyle;var w=p.selectStyle,g=i(),_=g.state,b=g.dispatch,k=g.classNames,R=g.renderProps,x=g.onScopeRepoChange,N=n(!1),S=N[0],j=N[1],C=t(null),L=s(function(e){b({type:"SET_SCOPE_REPO",payload:e}),null==x||x(e),j(!1)},[b,x]);if(l(function(){function e(e){C.current&&!C.current.contains(e.target)&&j(!1)}return S&&document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[S]),R.renderScopeDropdown)return R.renderScopeDropdown(_.scopeRepo,L,f);var B=null!==(m=null===(d=f.find(function(e){return e.value===_.scopeRepo}))||void 0===d?void 0:d.label)&&void 0!==m?m:f[0].label,E=["usp-user-story-scope",k.scopeDropdown,y].filter(Boolean).join(" ");return o("div",e({ref:C,className:[E,S&&"open"].filter(Boolean).join(" "),style:h},{children:[o("button",e({type:"button",className:"usp-user-story-scope__trigger",style:w,onClick:function(){return j(function(e){return!e})}},{children:[r("span",e({className:"usp-user-story-scope__trigger-label"},{children:B})),r("span",e({className:"usp-user-story-scope__chevron"},{children:r(S?u:c,{})}))," "]})),S&&r("ul",e({className:"usp-user-story-scope__menu",role:"listbox"},{children:f.map(function(o){return r("li",e({role:"option","aria-selected":_.scopeRepo===o.value,className:["usp-user-story-scope__option",_.scopeRepo===o.value&&"active"].filter(Boolean).join(" "),onClick:function(){return L(o.value)}},{children:o.label}),o.value)})}))]}))}export{p as ScopeDropdown};
|
|
2
2
|
//# sourceMappingURL=ScopeDropdown.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as r,jsx as n}from"react/jsx-runtime";import{useState as o,useRef as t,useCallback as s,useEffect as l}from"react";import{useUSPContext as i}from"../UserStoryPicker.context.js";function u(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"m18 15-6-6-6 6"})}))}function c(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"m6 9 6 6 6-6"})}))}var a=[{value:"All Types",label:"All Types"},{value:"ECG Technical User Story",label:"ECG Technical User Story"}];function p(p){var d,m,y=p.options,v=void 0===y?a:y,f=p.className,h=p.style;p.labelStyle;var w=p.selectStyle,g=i(),k=g.state,_=g.dispatch,b=g.classNames,T=g.renderProps,B=g.onTypeChange,N=o(!1),j=N[0],x=N[1],C=t(null),E=s(function(e){_({type:"SET_TYPE",payload:e}),null==B||B(e),x(!1)},[_,B]);if(l(function(){function e(e){C.current&&!C.current.contains(e.target)&&x(!1)}return j&&document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[j]),T.renderTypeDropdown)return T.renderTypeDropdown(k.typeBy,E,v);var L=null!==(m=null===(d=v.find(function(e){return e.value===k.typeBy}))||void 0===d?void 0:d.label)&&void 0!==m?m:v[0].label,S=["usp-user-story-scope",b.scopeDropdown,f].filter(Boolean).join(" ");return r("div",e({ref:C,className:[S,j&&"open"].filter(Boolean).join(" "),style:h},{children:[r("button",e({type:"button",className:"usp-user-story-scope__trigger",style:w,onClick:function(){return x(function(e){return!e})}},{children:[n("span",e({className:"usp-user-story-scope__trigger-label"},{children:L})),n("span",e({className:"usp-user-story-scope__chevron"},{children:n(j?u:c,{})}))," "]})),j&&n("ul",e({className:"usp-user-story-scope__menu"},{children:v.map(function(r){return n("li",e({className:["usp-user-story-scope__option",k.typeBy===r.value&&"active"].filter(Boolean).join(" "),onClick:function(){return E(r.value)}},{children:r.label}),r.value)})}))]}))}export{p as TypeDropdown};
|
|
2
2
|
//# sourceMappingURL=TypeDropdown.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface CustomFileIconProps {
|
|
3
|
+
name: string;
|
|
4
|
+
size?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* CustomFileIcon displays a file or language icon based on the file name or extension.
|
|
9
|
+
* It uses the @exuanbo/file-icons-js library to determine the appropriate icon class.
|
|
10
|
+
*/
|
|
11
|
+
declare function CustomFileIcon({ name, size, className }: CustomFileIconProps): JSX.Element;
|
|
12
|
+
export default CustomFileIcon;
|
|
13
|
+
//# sourceMappingURL=CustomFileIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomFileIcon.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/citations/readfile-citation/CustomFileIcon.tsx"],"names":[],"mappings":";AAKA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,iBAAS,cAAc,CAAC,EAAE,IAAI,EAAE,IAAa,EAAE,SAAS,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CA4D5F;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadFileCitationContent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ReadFileCitationContent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/citations/readfile-citation/ReadFileCitationContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAgG7F,UAAU,4BAA4B;IACpC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,YAAY,CAAC,EAAE,0BAA0B,CAAC;IAC1C,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,YAAY,CAAC,EAAE,4BAA4B,CAAC;CAC7C;AAkSD,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA4anE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
export type USPScopeOption =
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type USPScopeOption = "currentRepository" | "allRepository";
|
|
3
3
|
export interface USPScopeDropdownProps {
|
|
4
4
|
options?: {
|
|
5
5
|
value: USPScopeOption;
|
|
@@ -10,5 +10,5 @@ export interface USPScopeDropdownProps {
|
|
|
10
10
|
labelStyle?: React.CSSProperties;
|
|
11
11
|
selectStyle?: React.CSSProperties;
|
|
12
12
|
}
|
|
13
|
-
export declare function ScopeDropdown({ options, className, style, labelStyle, selectStyle, }: USPScopeDropdownProps):
|
|
13
|
+
export declare function ScopeDropdown({ options, className, style, labelStyle, selectStyle, }: USPScopeDropdownProps): React.ReactNode;
|
|
14
14
|
//# sourceMappingURL=ScopeDropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScopeDropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/UserStoryImport/components/ScopeDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ScopeDropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/UserStoryImport/components/ScopeDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAAG,eAAe,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,cAAc,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACnC;AAuCD,wBAAgB,aAAa,CAAC,EAC5B,OAAyB,EACzB,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,GACZ,EAAE,qBAAqB,mBA0FvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type USPTypeOption = "ECG Technical User Story" |
|
|
2
|
+
export type USPTypeOption = "ECG Technical User Story" | "All Types";
|
|
3
3
|
export interface USPTypeDropdownProps {
|
|
4
4
|
options?: {
|
|
5
5
|
value: USPTypeOption;
|
|
@@ -10,5 +10,5 @@ export interface USPTypeDropdownProps {
|
|
|
10
10
|
labelStyle?: React.CSSProperties;
|
|
11
11
|
selectStyle?: React.CSSProperties;
|
|
12
12
|
}
|
|
13
|
-
export declare function TypeDropdown({ options, className, style, labelStyle, selectStyle, }: USPTypeDropdownProps):
|
|
13
|
+
export declare function TypeDropdown({ options, className, style, labelStyle, selectStyle, }: USPTypeDropdownProps): React.ReactNode;
|
|
14
14
|
//# sourceMappingURL=TypeDropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeDropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/UserStoryImport/components/TypeDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TypeDropdown.d.ts","sourceRoot":"","sources":["../../../../../../src/features/UserStoryImport/components/TypeDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,MAAM,MAAM,aAAa,GAAG,0BAA0B,GAAG,WAAW,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACnC;AAuCD,wBAAgB,YAAY,CAAC,EAC3B,OAAyB,EACzB,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,GACZ,EAAE,oBAAoB,mBAkFtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-llm-studio/requirement-ai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.72",
|
|
4
4
|
"author": "Saptyadeep Bhattacharjee",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -583,6 +583,7 @@
|
|
|
583
583
|
"dependencies": {
|
|
584
584
|
"@lexical/react": "^0.41.0",
|
|
585
585
|
"@lexical/yjs": "^0.41.0",
|
|
586
|
+
"@exuanbo/file-icons-js": "^3.3.0",
|
|
586
587
|
"axios": "^1.7.9",
|
|
587
588
|
"dayjs": "^1.11.19",
|
|
588
589
|
"dompurify": "^3.3.1",
|