@e-llm-studio/requirement-ai 0.0.234 → 0.0.235

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),t=require("../ai-reasoning/AiReasoningCitationContent.js"),n=require("./CompletionPanel.module.css.js"),s=require("../../icons/CDIcon.js"),l=require("lucide-react");const a=({customIcons:a,customStyles:i,currentUserStory:r,panelStyles:c,showPanel:d=!1,children:u,onToggleStateChange:m,completionPanelConfig:p})=>{var g,f,v,j,C;const[h,k]=o.useState(!!d),x=null!==(g=null==r?void 0:r.completion_percentage)&&void 0!==g?g:0,y=o.useRef(null),b=o.useRef(null),{isMarkingComplete:w=!1,markedComplete:_=!1,onMarkAsComplete:P}=null!=p?p:{},S=()=>{k(!1),null==m||m(!1)},O=e=>{e.stopPropagation(),k(e=>{const o=!e;return null==m||m(o),o})};return o.useEffect(()=>{if(!h)return;const e=e=>{b.current&&!b.current.contains(e.target)&&S()},o=e=>{"Escape"===e.key&&(k(!1),null==m||m(!1))};return document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",o)}},[h,m]),e.jsxs("div",Object.assign({ref:b,className:n.default.triggerWrapper,style:null==c?void 0:c.triggerWrapperStyle},{children:[!d&&e.jsx(e.Fragment,{children:u?e.jsx("div",Object.assign({className:n.default.completionButton,style:null==c?void 0:c.completionButtonStyle,onClick:O},{children:u})):e.jsx("button",Object.assign({ref:y,className:n.default.completionIconButton,style:null==c?void 0:c.completionIconButtonStyle,onClick:O},{children:e.jsx(s.default,{})}))}),h&&e.jsx("div",Object.assign({className:`${n.default.dropdown} ${d?n.default.showPanelDropdown:""}`,style:Object.assign(Object.assign({},null==c?void 0:c.dropdownStyle),d?null==c?void 0:c.showPanelDropdownStyle:{}),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()},{children:e.jsx(t.default,{aiReason:{explanation:(null===(f=r.completion_decision_factors)||void 0===f?void 0:f.explanation)||"",relevance_score:(null===(v=r.completion_decision_factors)||void 0===v?void 0:v.relevance_score)||0,reason:(null===(j=r.completion_decision_factors)||void 0===j?void 0:j.score_reason)||"",gap:(null===(C=r.completion_decision_factors)||void 0===C?void 0:C.gap)||"",id:"completion-cd"},customIcons:a,customStyles:i,footer:e.jsxs("div",Object.assign({className:n.default.markCompleteContainer},{children:[e.jsx("h4",Object.assign({className:n.default.markCompleteTitle},{children:"Mark this section as complete?"})),e.jsxs("p",Object.assign({className:n.default.markCompleteDescription},{children:["AI estimates this section is"," ",x,"% complete. If you're satisfied with the content, you can mark it as complete."]})),e.jsxs("button",Object.assign({className:n.default.markCompleteButton,disabled:w||_,onClick:e=>{e.stopPropagation(),null==P||P(),S()}},{children:[w?e.jsx(l.Loader2,{size:18,className:n.default.markCompleteSpinner}):e.jsx(l.Check,{size:18,strokeWidth:3,className:n.default.markCompleteIcon}),e.jsx("span",{children:_?"Marked Complete":"Mark as Complete"})]}))]}))})}))]}))};exports.CompletionPanel=a,exports.default=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),t=require("../ai-reasoning/AiReasoningCitationContent.js"),n=require("./CompletionPanel.module.css.js"),s=require("../../icons/CDIcon.js"),l=require("lucide-react"),i=require("react-dom");const a=({customIcons:a,customStyles:r,currentUserStory:c,panelStyles:d,showPanel:u=!1,children:p,onToggleStateChange:m,completionPanelConfig:g})=>{var j,f,v,x,C;const[h,k]=o.useState(!!u),y=null!==(j=null==c?void 0:c.completion_percentage)&&void 0!==j?j:0,b=o.useRef(null),P=o.useRef(null),{isMarkingComplete:_=!1,markedComplete:O=!1,onMarkAsComplete:w}=null!=g?g:{},S=()=>{k(!1),null==m||m(!1)},I=e=>{e.stopPropagation(),k(e=>{const o=!e;return null==m||m(o),o})};return o.useEffect(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&S()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]),e.jsxs(e.Fragment,{children:[h&&i.createPortal(e.jsx("div",{onClick:S,style:{position:"fixed",inset:0,zIndex:9998,background:"rgba(0, 0, 0, 0.5)"},"aria-hidden":"true"}),document.body),e.jsxs("div",Object.assign({ref:P,className:n.default.triggerWrapper,style:Object.assign(Object.assign({},null==d?void 0:d.triggerWrapperStyle),h&&{position:"relative",zIndex:9999})},{children:[!u&&e.jsx(e.Fragment,{children:p?e.jsx("div",Object.assign({className:n.default.completionButton,style:null==d?void 0:d.completionButtonStyle,onClick:I},{children:p})):e.jsx("button",Object.assign({ref:b,className:n.default.completionIconButton,style:null==d?void 0:d.completionIconButtonStyle,onClick:I},{children:e.jsx(s.default,{})}))}),h&&e.jsx("div",Object.assign({className:`${n.default.dropdown} ${u?n.default.showPanelDropdown:""}`,style:Object.assign(Object.assign({},null==d?void 0:d.dropdownStyle),u?null==d?void 0:d.showPanelDropdownStyle:{}),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()},{children:e.jsx(t.default,{aiReason:{explanation:(null===(f=c.completion_decision_factors)||void 0===f?void 0:f.explanation)||"",relevance_score:(null===(v=c.completion_decision_factors)||void 0===v?void 0:v.relevance_score)||0,reason:(null===(x=c.completion_decision_factors)||void 0===x?void 0:x.score_reason)||"",gap:(null===(C=c.completion_decision_factors)||void 0===C?void 0:C.gap)||"",id:"completion-cd"},customIcons:a,customStyles:r,footer:e.jsxs("div",Object.assign({className:n.default.markCompleteContainer},{children:[e.jsx("h4",Object.assign({className:n.default.markCompleteTitle},{children:"Mark this section as complete?"})),e.jsxs("p",Object.assign({className:n.default.markCompleteDescription},{children:["AI estimates this section is"," ",y,"% complete. If you're satisfied with the content, you can mark it as complete."]})),e.jsxs("button",Object.assign({className:n.default.markCompleteButton,disabled:_||O,onClick:e=>{e.stopPropagation(),null==w||w(),S()}},{children:[_?e.jsx(l.Loader2,{size:18,className:n.default.markCompleteSpinner}):e.jsx(l.Check,{size:18,strokeWidth:3,className:n.default.markCompleteIcon}),e.jsx("span",{children:O?"Marked Complete":"Mark as Complete"})]}))]}))})}))]}))]})};exports.CompletionPanel=a,exports.default=a;
2
2
  //# sourceMappingURL=CompletionPanel.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as o,Fragment as n}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as s}from"react";import l from"../ai-reasoning/AiReasoningCitationContent.js";import a from"./CompletionPanel.module.css.js";import r from"../../icons/CDIcon.js";import{Loader2 as c,Check as m}from"lucide-react";const d=({customIcons:d,customStyles:p,currentUserStory:u,panelStyles:g,showPanel:v=!1,children:C,onToggleStateChange:h,completionPanelConfig:k})=>{var f,y,j,w,b;const[_,P]=t(!!v),S=null!==(f=null==u?void 0:u.completion_percentage)&&void 0!==f?f:0,N=i(null),O=i(null),{isMarkingComplete:I=!1,markedComplete:D=!1,onMarkAsComplete:M}=null!=k?k:{},B=()=>{P(!1),null==h||h(!1)},E=e=>{e.stopPropagation(),P(e=>{const o=!e;return null==h||h(o),o})};return s(()=>{if(!_)return;const e=e=>{O.current&&!O.current.contains(e.target)&&B()},o=e=>{"Escape"===e.key&&(P(!1),null==h||h(!1))};return document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",o)}},[_,h]),e("div",Object.assign({ref:O,className:a.triggerWrapper,style:null==g?void 0:g.triggerWrapperStyle},{children:[!v&&o(n,{children:C?o("div",Object.assign({className:a.completionButton,style:null==g?void 0:g.completionButtonStyle,onClick:E},{children:C})):o("button",Object.assign({ref:N,className:a.completionIconButton,style:null==g?void 0:g.completionIconButtonStyle,onClick:E},{children:o(r,{})}))}),_&&o("div",Object.assign({className:`${a.dropdown} ${v?a.showPanelDropdown:""}`,style:Object.assign(Object.assign({},null==g?void 0:g.dropdownStyle),v?null==g?void 0:g.showPanelDropdownStyle:{}),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()},{children:o(l,{aiReason:{explanation:(null===(y=u.completion_decision_factors)||void 0===y?void 0:y.explanation)||"",relevance_score:(null===(j=u.completion_decision_factors)||void 0===j?void 0:j.relevance_score)||0,reason:(null===(w=u.completion_decision_factors)||void 0===w?void 0:w.score_reason)||"",gap:(null===(b=u.completion_decision_factors)||void 0===b?void 0:b.gap)||"",id:"completion-cd"},customIcons:d,customStyles:p,footer:e("div",Object.assign({className:a.markCompleteContainer},{children:[o("h4",Object.assign({className:a.markCompleteTitle},{children:"Mark this section as complete?"})),e("p",Object.assign({className:a.markCompleteDescription},{children:["AI estimates this section is"," ",S,"% complete. If you're satisfied with the content, you can mark it as complete."]})),e("button",Object.assign({className:a.markCompleteButton,disabled:I||D,onClick:e=>{e.stopPropagation(),null==M||M(),B()}},{children:[I?o(c,{size:18,className:a.markCompleteSpinner}):o(m,{size:18,strokeWidth:3,className:a.markCompleteIcon}),o("span",{children:D?"Marked Complete":"Mark as Complete"})]}))]}))})}))]}))};export{d as CompletionPanel,d as default};
1
+ import{jsxs as e,Fragment as o,jsx as n}from"react/jsx-runtime";import{useState as t,useRef as i,useEffect as s}from"react";import l from"../ai-reasoning/AiReasoningCitationContent.js";import a from"./CompletionPanel.module.css.js";import r from"../../icons/CDIcon.js";import{Loader2 as c,Check as m}from"lucide-react";import{createPortal as d}from"react-dom";const p=({customIcons:p,customStyles:u,currentUserStory:g,panelStyles:v,showPanel:h=!1,children:k,onToggleStateChange:C,completionPanelConfig:f})=>{var y,b,j,w,O;const[_,P]=t(!!h),S=null!==(y=null==g?void 0:g.completion_percentage)&&void 0!==y?y:0,I=i(null),N=i(null),{isMarkingComplete:x=!1,markedComplete:D=!1,onMarkAsComplete:M}=null!=f?f:{},B=()=>{P(!1),null==C||C(!1)},z=e=>{e.stopPropagation(),P(e=>{const o=!e;return null==C||C(o),o})};return s(()=>{if(!_)return;const e=e=>{"Escape"===e.key&&B()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[_]),e(o,{children:[_&&d(n("div",{onClick:B,style:{position:"fixed",inset:0,zIndex:9998,background:"rgba(0, 0, 0, 0.5)"},"aria-hidden":"true"}),document.body),e("div",Object.assign({ref:N,className:a.triggerWrapper,style:Object.assign(Object.assign({},null==v?void 0:v.triggerWrapperStyle),_&&{position:"relative",zIndex:9999})},{children:[!h&&n(o,{children:k?n("div",Object.assign({className:a.completionButton,style:null==v?void 0:v.completionButtonStyle,onClick:z},{children:k})):n("button",Object.assign({ref:I,className:a.completionIconButton,style:null==v?void 0:v.completionIconButtonStyle,onClick:z},{children:n(r,{})}))}),_&&n("div",Object.assign({className:`${a.dropdown} ${h?a.showPanelDropdown:""}`,style:Object.assign(Object.assign({},null==v?void 0:v.dropdownStyle),h?null==v?void 0:v.showPanelDropdownStyle:{}),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()},{children:n(l,{aiReason:{explanation:(null===(b=g.completion_decision_factors)||void 0===b?void 0:b.explanation)||"",relevance_score:(null===(j=g.completion_decision_factors)||void 0===j?void 0:j.relevance_score)||0,reason:(null===(w=g.completion_decision_factors)||void 0===w?void 0:w.score_reason)||"",gap:(null===(O=g.completion_decision_factors)||void 0===O?void 0:O.gap)||"",id:"completion-cd"},customIcons:p,customStyles:u,footer:e("div",Object.assign({className:a.markCompleteContainer},{children:[n("h4",Object.assign({className:a.markCompleteTitle},{children:"Mark this section as complete?"})),e("p",Object.assign({className:a.markCompleteDescription},{children:["AI estimates this section is"," ",S,"% complete. If you're satisfied with the content, you can mark it as complete."]})),e("button",Object.assign({className:a.markCompleteButton,disabled:x||D,onClick:e=>{e.stopPropagation(),null==M||M(),B()}},{children:[x?n(c,{size:18,className:a.markCompleteSpinner}):n(m,{size:18,strokeWidth:3,className:a.markCompleteIcon}),n("span",{children:D?"Marked Complete":"Mark as Complete"})]}))]}))})}))]}))]})};export{p as CompletionPanel,p as default};
2
2
  //# sourceMappingURL=CompletionPanel.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;AAQvJ,QAAA,MAAM,iBAAiB,+CAgqHtB,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
+ {"version":3,"file":"RequirementAiTest.d.ts","sourceRoot":"","sources":["../../../src/RequirementAiTest.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAA2B,cAAc,EAAE,aAAa,EAAE,MAAM,+EAA+E,CAAC;AAQvJ,QAAA,MAAM,iBAAiB,+CA8lItB,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 +1 @@
1
- {"version":3,"file":"CompletionPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/story-screen/CompletionPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAC/D,OAAO,EACH,UAAU,EACV,qBAAqB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,uBAAuB,EACvB,cAAc,EACjB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACH,2BAA2B,EAC9B,MAAM,8CAA8C,CAAC;AAItD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,eAAO,MAAM,eAAe;iBAUX,cAAc;kBACb,uBAAuB;sBACnB,qBAAqB,GAAG,UAAU;;;eAGzC,SAAS;oCACW,OAAO,KAAK,IAAI;;6CA6LlD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"CompletionPanel.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/story-screen/CompletionPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAC/D,OAAO,EACH,UAAU,EACV,qBAAqB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,uBAAuB,EACvB,cAAc,EACjB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACH,2BAA2B,EAC9B,MAAM,8CAA8C,CAAC;AAItD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,eAAO,MAAM,eAAe;iBAUX,cAAc;kBACb,uBAAuB;sBACnB,qBAAqB,GAAG,UAAU;;;eAGzC,SAAS;oCACW,OAAO,KAAK,IAAI;;6CA2MlD,CAAC;AAEF,eAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.234",
3
+ "version": "0.0.235",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",