@e-llm-studio/requirement-ai 0.0.165 → 0.0.166
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/RichTextEditor/Editor/plugins/DeleteNode.js +1 -1
- package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.js +1 -1
- package/dist/cjs/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
- package/dist/cjs/features/RequirementAI/utils/user-story.utils.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.js +1 -1
- package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.js +1 -1
- package/dist/features/RequirementAI/components/cra/PartialRequirementContent.js +1 -1
- package/dist/features/RequirementAI/utils/user-story.utils.js +1 -1
- package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.d.ts +9 -4
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.d.ts +7 -11
- package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/utils/user-story.utils.d.ts +2 -0
- package/dist/types/src/features/RequirementAI/utils/user-story.utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=function(t){function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=function(t){function n(e,r){void 0===e&&(e=crypto.randomUUID());var n=t.call(this,r)||this;return n.__reviewId=e,n}return e.__extends(n,t),n.getType=function(){return"delete"},n.clone=function(e){return new n(e.__reviewId,e.__key)},n.prototype.createDOM=function(){var e=document.createElement("del");return e.setAttribute("data-review-id",this.__reviewId),e.style.textDecoration="line-through",e.style.textDecorationColor="#dc2626",e.style.textDecorationThickness="2px",e.contentEditable="false",e},n.prototype.updateDOM=function(){return!1},n.importDOM=function(){return{del:function(){return{conversion:r,priority:1}}}},n.prototype.exportDOM=function(){var e=document.createElement("del");return e.setAttribute("data-review-id",this.__reviewId),e.style.color="#dc2626",e.style.textDecoration="line-through",e.style.textDecorationColor="#dc2626",e.style.textDecorationThickness="2px",{element:e}},n.importJSON=function(e){return new n(e.reviewId)},n.prototype.exportJSON=function(){return e.__assign(e.__assign({},t.prototype.exportJSON.call(this)),{type:"delete",version:1,reviewId:this.__reviewId})},n.prototype.isInline=function(){return!0},n.prototype.canBeEmpty=function(){return!1},n.prototype.canInsertTextBefore=function(){return!1},n.prototype.canInsertTextAfter=function(){return!1},n.prototype.canMergeWith=function(){return!1},n}(require("lexical").ElementNode);function r(e){var r=e.getAttribute("data-review-id")||crypto.randomUUID();return{node:new t(r)}}exports.DeleteNode=t;
|
|
2
2
|
//# sourceMappingURL=DeleteNode.js.map
|
package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=function(t){function n(e,r
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=function(t){function n(e,r){void 0===e&&(e=crypto.randomUUID());var n=t.call(this,r)||this;return n.__reviewId=e,n}return e.__extends(n,t),n.getType=function(){return"insert"},n.clone=function(e){return new n(e.__reviewId,e.__key)},n.prototype.createDOM=function(e){var t=document.createElement("ins");return t.setAttribute("data-review-id",this.__reviewId),t.style.backgroundColor="#dbeafe",t.style.color="#1e3a8a",t.style.textDecoration="none",t.style.padding="1px 2px",t.style.borderRadius="2px",t},n.prototype.updateDOM=function(e,t,r){return e.__reviewId!==this.__reviewId},n.importDOM=function(){return{ins:function(){return{conversion:r,priority:1}}}},n.prototype.exportDOM=function(e){var t=document.createElement("ins");return t.setAttribute("data-review-id",this.__reviewId),t.style.backgroundColor="#dbeafe",t.style.color="#1e3a8a",t.style.textDecoration="none",t.style.padding="1px 2px",t.style.borderRadius="2px",{element:t}},n.importJSON=function(e){var t=new n(e.reviewId);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t},n.prototype.exportJSON=function(){return e.__assign(e.__assign({},t.prototype.exportJSON.call(this)),{type:"insert",version:1,reviewId:this.__reviewId})},n.prototype.isInline=function(){return!0},n}(require("lexical").ElementNode);function r(e){var r=e.getAttribute("data-review-id")||crypto.randomUUID();return{node:new t(r)}}exports.InsertNode=t;
|
|
2
2
|
//# sourceMappingURL=InsertNode.js.map
|
|
@@ -1,2 +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("lucide-react"),l=require("../../utils/user-story.utils.js"),s=require("../userstory-with-citation/UserStoryWithCitation.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("react"),n=require("lucide-react"),l=require("../../utils/user-story.utils.js"),s=require("../userstory-with-citation/UserStoryWithCitation.js"),o=require("./PartialRequirementContent.module.css.js"),a=require("@mui/material"),r=require("../RequirementAIWrapper/RequirementAIWrapper.js"),d=require("../RichTextEditor/RichTextEditor.js"),u=function(u){var v,c,m,g,y,_,p,f,C,q,S,j,h,x,R,P,w,B,b=u.loadingPartialRequirements,N=u.localUserStory,A=u.setLocalUserStory,E=u.onCraFlowDiffAgentAction,k=u.disableEditing,U=u.isCraflow,D=void 0===U||U,T=u.onCraAccept,W=u.onCraReject,F=i.useState(!1),I=F[0],M=F[1],z=i.useState(""),L=z[0],H=z[1],O=r.useRequirementAI(),V=O.customStyles,X=O.segmentComponentConfig;i.useEffect(function(){k&&M(!1)},[k]),i.useEffect(function(){var e;H(null===(e=null==N?void 0:N[0])||void 0===e?void 0:e.value)},[N]);if(b)return t.jsx("div",e.__assign({className:o.default.skeletonWrapper,style:null===(v=null==V?void 0:V.PartialRequirementContentStyles)||void 0===v?void 0:v.skeletonWrapper},{children:[1,2,3,4,5].map(function(e){var i;return t.jsx("div",{className:o.default.skeletonLine,style:null===(i=null==V?void 0:V.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},e)})}));var G=!L||""===L.trim();return t.jsxs("div",e.__assign({className:o.default.wrapper,style:null===(c=null==V?void 0:V.PartialRequirementContentStyles)||void 0===c?void 0:c.wrapper},{children:[t.jsx("div",e.__assign({className:o.default.actionBar,style:null===(m=null==V?void 0:V.PartialRequirementContentStyles)||void 0===m?void 0:m.actionBar},{children:I?t.jsxs(t.Fragment,{children:[t.jsxs("span",e.__assign({className:o.default.editingBadge,style:null===(p=null==V?void 0:V.PartialRequirementContentStyles)||void 0===p?void 0:p.editingBadge},{children:[t.jsx("span",{className:o.default.editingDot,style:null===(f=null==V?void 0:V.PartialRequirementContentStyles)||void 0===f?void 0:f.editingDot}),"Editing"]})),t.jsx("div",{className:o.default.btnDivider,style:null===(C=null==V?void 0:V.PartialRequirementContentStyles)||void 0===C?void 0:C.btnDivider}),t.jsx(a.Tooltip,e.__assign({title:G?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:e.__assign({},null===(q=null==V?void 0:V.PartialRequirementContentStyles)||void 0===q?void 0:q.headerTooltip)}}},{children:t.jsx("span",{children:t.jsx("button",e.__assign({className:o.default.saveBtn,style:e.__assign(e.__assign(e.__assign({},null===(S=null==V?void 0:V.PartialRequirementContentStyles)||void 0===S?void 0:S.actionBtn),null===(j=null==V?void 0:V.PartialRequirementContentStyles)||void 0===j?void 0:j.saveBtn),{opacity:G?.5:1,cursor:G?"not-allowed":"pointer"}),onClick:function(){G||(A(function(t){var i=e.__assign(e.__assign({},t[0]),{value:l.postprocessUserStoryAfterEdit(L)});return null==E||E("accept",[i]),[i]}),M(!1))},disabled:G},{children:t.jsx(n.Save,{size:16})}))})})),t.jsx("button",e.__assign({className:o.default.cancelBtn,style:e.__assign(e.__assign({},null===(h=null==V?void 0:V.PartialRequirementContentStyles)||void 0===h?void 0:h.actionBtn),null===(x=null==V?void 0:V.PartialRequirementContentStyles)||void 0===x?void 0:x.cancelBtn),onClick:function(){var e;H(null===(e=null==N?void 0:N[0])||void 0===e?void 0:e.value),M(!1)},title:"Discard changes","aria-label":"Discard changes"},{children:t.jsx(n.X,{size:16})}))]}):t.jsx(a.Tooltip,e.__assign({title:k?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:e.__assign({},null===(g=null==V?void 0:V.PartialRequirementContentStyles)||void 0===g?void 0:g.headerTooltip)}}},{children:t.jsx("span",{children:t.jsx("button",e.__assign({className:o.default.editBtn,style:e.__assign(e.__assign(e.__assign({},null===(y=null==V?void 0:V.PartialRequirementContentStyles)||void 0===y?void 0:y.actionBtn),null===(_=null==V?void 0:V.PartialRequirementContentStyles)||void 0===_?void 0:_.editBtn),{opacity:k?.5:1,cursor:k?"not-allowed":"pointer"}),onClick:function(){k||M(!0)},disabled:k,"aria-label":"Edit requirement"},{children:t.jsx(n.Pencil,{size:16})}))})}))})),I?t.jsx("div",e.__assign({className:o.default.editorContainer,style:null===(R=null==V?void 0:V.PartialRequirementContentStyles)||void 0===R?void 0:R.editorContainer},{children:t.jsx(d.default,{minHeight:"100%",height:"100%",type:"string",value:l.preprocessUserStoryForEdit(l.formatMarkdown((null===(P=null==N?void 0:N[0])||void 0===P?void 0:P.value)||"")||""),handleUpdateState:function(e,t){H(t)},doNotShowBorderInViewMode:!1,mode:"edit"})})):t.jsx("div",e.__assign({className:o.default.viewContainer,style:null===(w=null==V?void 0:V.PartialRequirementContentStyles)||void 0===w?void 0:w.viewContainer},{children:t.jsx(s.default,{message:l.formatMarkdown((null===(B=null==N?void 0:N[0])||void 0===B?void 0:B.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:N,setCraUserStory:A,onCraFlowDiffAgentAction:E,displayActionButtons:!I},isCraflow:D,onCraAccept:T,onCraReject:W,customStyles:null==V?void 0:V.UserStoryWithCitationCustomStyles,segmentComponentConfig:X})}))]}))};exports.PartialRequirementContent=u,exports.default=u;
|
|
2
2
|
//# sourceMappingURL=PartialRequirementContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.formatMarkdown=function(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};exports.formatMarkdown=function(e){try{return e=null==e?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,function(e,t){var r=t.split("."),c=" ".repeat(r.length-1);return"".concat(c).concat(t,".")})}catch(e){console.error("Error in formatMarkdown",e)}},exports.postprocessUserStoryAfterEdit=function(t){console.log("postprocessUserStoryAfterEdit::input",t);var r=t.replace(/<del([^>]*?)data-review-id="([^"]*)"([^>]*)>([\s\S]*?)<\/del>([\s\S]*?)<ins([^>]*?)data-review-id="([^"]*)"([^>]*)>([\s\S]*?)<\/ins>/g,function(t,r,c,o,n,a,i,s,p,l){var d=e(c);if(d!==e(s))return t;var u="".concat(r).concat(o).replace(/\s+/g," ").trim(),f="".concat(i).concat(p).replace(/\s+/g," ").trim(),g=u?"<del ".concat(u,">").concat(n,"</del>"):"<del>".concat(n,"</del>"),v=f?"<ins ".concat(f,">").concat(l,"</ins>"):"<ins>".concat(l,"</ins>");return'<upt id="'.concat(decodeURIComponent(d),'">').concat(g).concat(a).concat(v,"</upt>")});return console.log("postprocessUserStoryAfterEdit::output",r),r},exports.preprocessUserStoryForEdit=function(e){var t=e.replace(/<upt\s+id="([^"]*)">([\s\S]*?)<\/upt>/g,function(e,t,r){var c=encodeURIComponent(t);return r.replace(/<del>/,'<del id="'.concat(c,'" data-review-id="').concat(c,'">')).replace(/<ins>/,'<ins id="'.concat(c,'" data-review-id="').concat(c,'">'))});return console.log("postprocessUserStoryAfterEdit::output",t),t},exports.replaceTitleSection=function(e,t){try{if(e){return e.replace(/\*\*Title\*\* ?: ([\s\S]*?)\n\n\*\*Description\*\*/,"**Title** : ".concat(t,"\n\n**Description**"))}}catch(t){return console.error("Error in replaceTitleSection:",t),e}};
|
|
2
2
|
//# sourceMappingURL=user-story.utils.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__extends as t,__assign as e}from"tslib";import{ElementNode as
|
|
1
|
+
import{__extends as t,__assign as e}from"tslib";import{ElementNode as r}from"lexical";var n=function(r){function n(t,e){void 0===t&&(t=crypto.randomUUID());var n=r.call(this,e)||this;return n.__reviewId=t,n}return t(n,r),n.getType=function(){return"delete"},n.clone=function(t){return new n(t.__reviewId,t.__key)},n.prototype.createDOM=function(){var t=document.createElement("del");return t.setAttribute("data-review-id",this.__reviewId),t.style.textDecoration="line-through",t.style.textDecorationColor="#dc2626",t.style.textDecorationThickness="2px",t.contentEditable="false",t},n.prototype.updateDOM=function(){return!1},n.importDOM=function(){return{del:function(){return{conversion:o,priority:1}}}},n.prototype.exportDOM=function(){var t=document.createElement("del");return t.setAttribute("data-review-id",this.__reviewId),t.style.color="#dc2626",t.style.textDecoration="line-through",t.style.textDecorationColor="#dc2626",t.style.textDecorationThickness="2px",{element:t}},n.importJSON=function(t){return new n(t.reviewId)},n.prototype.exportJSON=function(){return e(e({},r.prototype.exportJSON.call(this)),{type:"delete",version:1,reviewId:this.__reviewId})},n.prototype.isInline=function(){return!0},n.prototype.canBeEmpty=function(){return!1},n.prototype.canInsertTextBefore=function(){return!1},n.prototype.canInsertTextAfter=function(){return!1},n.prototype.canMergeWith=function(){return!1},n}(r);function o(t){var e=t.getAttribute("data-review-id")||crypto.randomUUID();return{node:new n(e)}}export{n as DeleteNode};
|
|
2
2
|
//# sourceMappingURL=DeleteNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__extends as
|
|
1
|
+
import{__extends as e,__assign as t}from"tslib";import{ElementNode as r}from"lexical";var n=function(r){function n(e,t){void 0===e&&(e=crypto.randomUUID());var n=r.call(this,t)||this;return n.__reviewId=e,n}return e(n,r),n.getType=function(){return"insert"},n.clone=function(e){return new n(e.__reviewId,e.__key)},n.prototype.createDOM=function(e){var t=document.createElement("ins");return t.setAttribute("data-review-id",this.__reviewId),t.style.backgroundColor="#dbeafe",t.style.color="#1e3a8a",t.style.textDecoration="none",t.style.padding="1px 2px",t.style.borderRadius="2px",t},n.prototype.updateDOM=function(e,t,r){return e.__reviewId!==this.__reviewId},n.importDOM=function(){return{ins:function(){return{conversion:o,priority:1}}}},n.prototype.exportDOM=function(e){var t=document.createElement("ins");return t.setAttribute("data-review-id",this.__reviewId),t.style.backgroundColor="#dbeafe",t.style.color="#1e3a8a",t.style.textDecoration="none",t.style.padding="1px 2px",t.style.borderRadius="2px",{element:t}},n.importJSON=function(e){var t=new n(e.reviewId);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t},n.prototype.exportJSON=function(){return t(t({},r.prototype.exportJSON.call(this)),{type:"insert",version:1,reviewId:this.__reviewId})},n.prototype.isInline=function(){return!0},n}(r);function o(e){var t=e.getAttribute("data-review-id")||crypto.randomUUID();return{node:new n(t)}}export{n as InsertNode};
|
|
2
2
|
//# sourceMappingURL=InsertNode.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import{useState as l,useEffect as o}from"react";import{Pencil as r,Save as a,X as d}from"lucide-react";import{formatMarkdown as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as i,Fragment as n}from"react/jsx-runtime";import{useState as l,useEffect as o}from"react";import{Pencil as r,Save as a,X as d}from"lucide-react";import{preprocessUserStoryForEdit as s,formatMarkdown as u,postprocessUserStoryAfterEdit as v}from"../../utils/user-story.utils.js";import c from"../userstory-with-citation/UserStoryWithCitation.js";import m from"./PartialRequirementContent.module.css.js";import{Tooltip as p}from"@mui/material";import{useRequirementAI as y}from"../RequirementAIWrapper/RequirementAIWrapper.js";import C from"../RichTextEditor/RichTextEditor.js";var f=function(f){var h,S,R,g,q,P,w,B,b,N,A,j,D,k,E,U,x,W,T=f.loadingPartialRequirements,z=f.localUserStory,F=f.setLocalUserStory,I=f.onCraFlowDiffAgentAction,L=f.disableEditing,H=f.isCraflow,M=void 0===H||H,V=f.onCraAccept,G=f.onCraReject,J=l(!1),K=J[0],O=J[1],Q=l(""),X=Q[0],Y=Q[1],Z=y(),$=Z.customStyles,_=Z.segmentComponentConfig;o(function(){L&&O(!1)},[L]),o(function(){var e;Y(null===(e=null==z?void 0:z[0])||void 0===e?void 0:e.value)},[z]);if(T)return t("div",e({className:m.skeletonWrapper,style:null===(h=null==$?void 0:$.PartialRequirementContentStyles)||void 0===h?void 0:h.skeletonWrapper},{children:[1,2,3,4,5].map(function(e){var i;return t("div",{className:m.skeletonLine,style:null===(i=null==$?void 0:$.PartialRequirementContentStyles)||void 0===i?void 0:i.skeletonLine},e)})}));var ee=!X||""===X.trim();return i("div",e({className:m.wrapper,style:null===(S=null==$?void 0:$.PartialRequirementContentStyles)||void 0===S?void 0:S.wrapper},{children:[t("div",e({className:m.actionBar,style:null===(R=null==$?void 0:$.PartialRequirementContentStyles)||void 0===R?void 0:R.actionBar},{children:K?i(n,{children:[i("span",e({className:m.editingBadge,style:null===(w=null==$?void 0:$.PartialRequirementContentStyles)||void 0===w?void 0:w.editingBadge},{children:[t("span",{className:m.editingDot,style:null===(B=null==$?void 0:$.PartialRequirementContentStyles)||void 0===B?void 0:B.editingDot}),"Editing"]})),t("div",{className:m.btnDivider,style:null===(b=null==$?void 0:$.PartialRequirementContentStyles)||void 0===b?void 0:b.btnDivider}),t(p,e({title:ee?"This field cannot be empty":"Save changes",slotProps:{tooltip:{sx:e({},null===(N=null==$?void 0:$.PartialRequirementContentStyles)||void 0===N?void 0:N.headerTooltip)}}},{children:t("span",{children:t("button",e({className:m.saveBtn,style:e(e(e({},null===(A=null==$?void 0:$.PartialRequirementContentStyles)||void 0===A?void 0:A.actionBtn),null===(j=null==$?void 0:$.PartialRequirementContentStyles)||void 0===j?void 0:j.saveBtn),{opacity:ee?.5:1,cursor:ee?"not-allowed":"pointer"}),onClick:function(){ee||(F(function(t){var i=e(e({},t[0]),{value:v(X)});return null==I||I("accept",[i]),[i]}),O(!1))},disabled:ee},{children:t(a,{size:16})}))})})),t("button",e({className:m.cancelBtn,style:e(e({},null===(D=null==$?void 0:$.PartialRequirementContentStyles)||void 0===D?void 0:D.actionBtn),null===(k=null==$?void 0:$.PartialRequirementContentStyles)||void 0===k?void 0:k.cancelBtn),onClick:function(){var e;Y(null===(e=null==z?void 0:z[0])||void 0===e?void 0:e.value),O(!1)},title:"Discard changes","aria-label":"Discard changes"},{children:t(d,{size:16})}))]}):t(p,e({title:L?"Editing is disabled":"Edit",slotProps:{tooltip:{sx:e({},null===(g=null==$?void 0:$.PartialRequirementContentStyles)||void 0===g?void 0:g.headerTooltip)}}},{children:t("span",{children:t("button",e({className:m.editBtn,style:e(e(e({},null===(q=null==$?void 0:$.PartialRequirementContentStyles)||void 0===q?void 0:q.actionBtn),null===(P=null==$?void 0:$.PartialRequirementContentStyles)||void 0===P?void 0:P.editBtn),{opacity:L?.5:1,cursor:L?"not-allowed":"pointer"}),onClick:function(){L||O(!0)},disabled:L,"aria-label":"Edit requirement"},{children:t(r,{size:16})}))})}))})),t("div",K?e({className:m.editorContainer,style:null===(E=null==$?void 0:$.PartialRequirementContentStyles)||void 0===E?void 0:E.editorContainer},{children:t(C,{minHeight:"100%",height:"100%",type:"string",value:s(u((null===(U=null==z?void 0:z[0])||void 0===U?void 0:U.value)||"")||""),handleUpdateState:function(e,t){Y(t)},doNotShowBorderInViewMode:!1,mode:"edit"})}):e({className:m.viewContainer,style:null===(x=null==$?void 0:$.PartialRequirementContentStyles)||void 0===x?void 0:x.viewContainer},{children:t(c,{message:u((null===(W=null==z?void 0:z[0])||void 0===W?void 0:W.value)||""),craFlowConfig:{isCraflow:!0,craUserStory:z,setCraUserStory:F,onCraFlowDiffAgentAction:I,displayActionButtons:!K},isCraflow:M,onCraAccept:V,onCraReject:G,customStyles:null==$?void 0:$.UserStoryWithCitationCustomStyles,segmentComponentConfig:_})}))]}))};export{f as PartialRequirementContent,f as default};
|
|
2
2
|
//# sourceMappingURL=PartialRequirementContent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(e){try{return e=null==e?void 0:e.replace(/(?<!\d)(\d+(?:\.\d+)+)\./g,function(e,t){var c=t.split("."),r=" ".repeat(c.length-1);return"".concat(r).concat(t,".")})}catch(e){console.error("Error in formatMarkdown",e)}}var t=function(e,t){try{if(e){return e.replace(/\*\*Title\*\* ?: ([\s\S]*?)\n\n\*\*Description\*\*/,"**Title** : ".concat(t,"\n\n**Description**"))}}catch(t){return console.error("Error in replaceTitleSection:",t),e}},c=function(e){var t=e.replace(/<upt\s+id="([^"]*)">([\s\S]*?)<\/upt>/g,function(e,t,c){var r=encodeURIComponent(t);return c.replace(/<del>/,'<del id="'.concat(r,'" data-review-id="').concat(r,'">')).replace(/<ins>/,'<ins id="'.concat(r,'" data-review-id="').concat(r,'">'))});return console.log("postprocessUserStoryAfterEdit::output",t),t},r=function(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")},n=function(e){console.log("postprocessUserStoryAfterEdit::input",e);var t=e.replace(/<del([^>]*?)data-review-id="([^"]*)"([^>]*)>([\s\S]*?)<\/del>([\s\S]*?)<ins([^>]*?)data-review-id="([^"]*)"([^>]*)>([\s\S]*?)<\/ins>/g,function(e,t,c,n,o,a,i,l,s,p){var d=r(c);if(d!==r(l))return e;var u="".concat(t).concat(n).replace(/\s+/g," ").trim(),g="".concat(i).concat(s).replace(/\s+/g," ").trim(),f=u?"<del ".concat(u,">").concat(o,"</del>"):"<del>".concat(o,"</del>"),v=g?"<ins ".concat(g,">").concat(p,"</ins>"):"<ins>".concat(p,"</ins>");return'<upt id="'.concat(decodeURIComponent(d),'">').concat(f).concat(a).concat(v,"</upt>")});return console.log("postprocessUserStoryAfterEdit::output",t),t};export{e as formatMarkdown,n as postprocessUserStoryAfterEdit,c as preprocessUserStoryForEdit,t as replaceTitleSection};
|
|
2
2
|
//# sourceMappingURL=user-story.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAA2B,cAAc,EAAE,aAAa,EAAE,MAAM,+EAA+E,CAAC;AAKvJ,QAAA,MAAM,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAA2B,cAAc,EAAE,aAAa,EAAE,MAAM,+EAA+E,CAAC;AAKvJ,QAAA,MAAM,iBAAiB,+CA6mHtB,CAAC;AAiVF,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAoH7C,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAoV3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,YACrB,cAAc,EAAE,GAAG,aAAa,EAAE;;;;;CA0B5C,CAAC;AAGF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { ElementNode, NodeKey, DOMConversionMap, SerializedElementNode } from "lexical";
|
|
2
|
-
export type SerializedDeleteNode = SerializedElementNode
|
|
2
|
+
export type SerializedDeleteNode = SerializedElementNode & {
|
|
3
|
+
type: "delete";
|
|
4
|
+
version: 1;
|
|
5
|
+
reviewId: string;
|
|
6
|
+
};
|
|
3
7
|
export declare class DeleteNode extends ElementNode {
|
|
8
|
+
__reviewId: string;
|
|
4
9
|
static getType(): string;
|
|
5
10
|
static clone(node: DeleteNode): DeleteNode;
|
|
6
|
-
constructor(key?: NodeKey);
|
|
11
|
+
constructor(reviewId?: string, key?: NodeKey);
|
|
7
12
|
createDOM(): HTMLElement;
|
|
8
13
|
updateDOM(): false;
|
|
9
14
|
static importDOM(): DOMConversionMap | null;
|
|
10
15
|
exportDOM(): {
|
|
11
16
|
element: HTMLModElement;
|
|
12
17
|
};
|
|
13
|
-
static importJSON(): DeleteNode;
|
|
14
|
-
exportJSON():
|
|
18
|
+
static importJSON(serializedNode: SerializedDeleteNode): DeleteNode;
|
|
19
|
+
exportJSON(): SerializedDeleteNode;
|
|
15
20
|
isInline(): true;
|
|
16
21
|
canBeEmpty(): false;
|
|
17
22
|
canInsertTextBefore(): false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,OAAO,EACP,gBAAgB,EAEhB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DeleteNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/RichTextEditor/Editor/plugins/DeleteNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,OAAO,EACP,gBAAgB,EAEhB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG;IACzD,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,CAAC,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,UAAW,SAAQ,WAAW;IACzC,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;gBAKxC,QAAQ,GAAE,MAA4B,EACtC,GAAG,CAAC,EAAE,OAAO;IAMf,SAAS,IAAI,WAAW;IAgBxB,SAAS,IAAI,KAAK;IAIlB,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAS3C,SAAS;;;IAeT,MAAM,CAAC,UAAU,CACf,cAAc,EAAE,oBAAoB,GACnC,UAAU;IAIb,UAAU,IAAI,oBAAoB;IASlC,QAAQ,IAAI,IAAI;IAIhB,UAAU,IAAI,KAAK;IAInB,mBAAmB,IAAI,KAAK;IAI9B,kBAAkB,IAAI,KAAK;IAI3B,YAAY,IAAI,KAAK;CAGpB"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type SerializedInsertNode =
|
|
1
|
+
import { ElementNode, NodeKey, SerializedElementNode, DOMConversionMap, EditorConfig, LexicalEditor, DOMExportOutput } from "lexical";
|
|
2
|
+
export type SerializedInsertNode = SerializedElementNode & {
|
|
3
3
|
type: "insert";
|
|
4
4
|
version: 1;
|
|
5
5
|
reviewId: string;
|
|
6
6
|
};
|
|
7
|
-
export declare class InsertNode extends
|
|
7
|
+
export declare class InsertNode extends ElementNode {
|
|
8
8
|
__reviewId: string;
|
|
9
9
|
static getType(): string;
|
|
10
10
|
static clone(node: InsertNode): InsertNode;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(reviewId?: string, key?: NodeKey);
|
|
12
12
|
createDOM(config: EditorConfig): HTMLElement;
|
|
13
|
-
updateDOM(): boolean;
|
|
13
|
+
updateDOM(prevNode: InsertNode, dom: HTMLElement, config: EditorConfig): boolean;
|
|
14
14
|
static importDOM(): DOMConversionMap | null;
|
|
15
|
-
exportDOM():
|
|
16
|
-
element: HTMLModElement;
|
|
17
|
-
};
|
|
15
|
+
exportDOM(editor: LexicalEditor): DOMExportOutput;
|
|
18
16
|
static importJSON(serializedNode: SerializedInsertNode): InsertNode;
|
|
19
17
|
exportJSON(): SerializedInsertNode;
|
|
20
|
-
isInline():
|
|
21
|
-
canInsertTextBefore(): boolean;
|
|
22
|
-
canInsertTextAfter(): boolean;
|
|
18
|
+
isInline(): boolean;
|
|
23
19
|
}
|
|
24
20
|
//# sourceMappingURL=InsertNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsertNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"InsertNode.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/features/RequirementAI/components/RichTextEditor/Editor/plugins/InsertNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,gBAAgB,EAEhB,YAAY,EACZ,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG;IACzD,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,CAAC,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBAAa,UAAW,SAAQ,WAAW;IACzC,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;gBAKxC,QAAQ,GAAE,MAA4B,EACtC,GAAG,CAAC,EAAE,OAAO;IAUf,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;IAa5C,SAAS,CACP,QAAQ,EAAE,UAAU,EACpB,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO;IAQV,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAa3C,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe;IAiBjD,MAAM,CAAC,UAAU,CACf,cAAc,EAAE,oBAAoB,GACnC,UAAU;IAQb,UAAU,IAAI,oBAAoB;IAalC,QAAQ,IAAI,OAAO;CAGpB"}
|
|
@@ -11,4 +11,6 @@ export declare const removeAllTagsAndContent: (inputString: string) => string;
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function removeMarkdownLinks(markdown: string): string;
|
|
13
13
|
export declare const replaceTitleSection: (original: string | undefined, newTitle: string) => string | undefined;
|
|
14
|
+
export declare const preprocessUserStoryForEdit: (input: string) => string;
|
|
15
|
+
export declare const postprocessUserStoryAfterEdit: (input: string) => string;
|
|
14
16
|
//# sourceMappingURL=user-story.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-story.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/utils/user-story.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,sBAa1C;AAED,eAAO,MAAM,cAAc,QAAS,MAAM,cAAc,MAAM,WAM7D,CAAA;AAED,eAAO,MAAM,iCAAiC,cAAe,UAAU,WAAW,MAAM,eAAe,MAAM,gBAAgB,MAAM,uBAgBlI,CAAA;AAED,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,MAAM,UAmBxD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,UAgB9C;AAED,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,WAwB1D,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,eAAO,MAAM,mBAAmB,aAAc,MAAM,GAAG,SAAS,YAAY,MAAM,uBAUjF,CAAA"}
|
|
1
|
+
{"version":3,"file":"user-story.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/utils/user-story.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,sBAa1C;AAED,eAAO,MAAM,cAAc,QAAS,MAAM,cAAc,MAAM,WAM7D,CAAA;AAED,eAAO,MAAM,iCAAiC,cAAe,UAAU,WAAW,MAAM,eAAe,MAAM,gBAAgB,MAAM,uBAgBlI,CAAA;AAED,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,MAAM,UAmBxD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,UAgB9C;AAED,eAAO,MAAM,uBAAuB,gBAAiB,MAAM,WAwB1D,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,eAAO,MAAM,mBAAmB,aAAc,MAAM,GAAG,SAAS,YAAY,MAAM,uBAUjF,CAAA;AAED,eAAO,MAAM,0BAA0B,UAAW,MAAM,WAavD,CAAA;AAWD,eAAO,MAAM,6BAA6B,UAAW,MAAM,WA6B1D,CAAC"}
|