@e-llm-studio/instant-learning 0.1.1-alpha.50 → 0.1.1-alpha.51
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/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/features/LearningManagement/components/CreateRuleSetLegacyModal.js +1 -1
- package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),t=require("react"),n=require("uuid"),i=require("../config.js"),s=require("../store/useAuthStore.js");exports.default=function(o){var a=o.isOpen,l=o.onClose,d=o.onSubmit,p=o.hasGlobalRuleSet,c=void 0!==p&&p,u=t.useState("");u[0];var x=u[1],g=t.useState(""),_=g[0],f=g[1],m=t.useState(""),h=m[0],b=m[1],v=t.useState(!1),S=v[0],y=v[1],j=t.useState({}),C=j[0],B=j[1],E=s.default(),z=E.user;if(E.setUser,t.useEffect(function(){a&&(x(""),f(""),b(""),B({}))},[a]),!a)return null;var k={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},modal:{position:"relative",width:"600px",borderRadius:"12px",backgroundColor:"#ffffff",padding:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},header:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"24px"},title:{margin:0,fontSize:"18px",fontWeight:500,color:"#19213D"},subtitle:{marginTop:"4px",fontSize:"14px",fontWeight:400,color:"#666F8D"},closeButton:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#9CA3AF"},formGroup:{display:"flex",flexDirection:"column",marginBottom:"20px",gap:"6px"},label:{fontSize:"14px",fontWeight:500,color:"#19213D"},asterisk:{color:"#8F2C23",marginRight:"4px",fontSize:"16px",fontWeight:600},input:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px"},inputError:{border:"1px solid #8F2C23"},errorText:{margin:0,marginTop:"4px",fontSize:"12px",color:"#8F2C23"},textarea:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px",minHeight:"100px",maxHeight:"200px",overflowY:"auto",resize:"vertical"},footer:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"32px"},cancelBtn:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #E2E8F0",backgroundColor:"transparent",color:"#64748B",fontSize:"14px",fontWeight:500,cursor:"pointer"},submitBtn:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:"#2563EB",color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer"},disabledBtn:{opacity:.5,cursor:"not-allowed"}};return r.jsx("div",e.__assign({style:k.overlay},{children:r.jsxs("div",e.__assign({style:k.modal},{children:[r.jsxs("div",e.__assign({style:k.header},{children:[r.jsxs("div",{children:[r.jsx("h2",e.__assign({style:k.title},{children:"Create Scope"})),r.jsx("p",e.__assign({style:k.subtitle},{children:"Create a scope to group and manage rules."}))]}),r.jsx("button",e.__assign({onClick:l,style:k.closeButton},{children:"✕"}))]})),r.jsxs("div",{children:[r.jsxs("div",e.__assign({style:k.formGroup},{children:[r.jsxs("label",e.__assign({style:k.label},{children:[r.jsx("span",e.__assign({style:k.asterisk},{children:"*"})),"Scope Name"]})),r.jsx("input",{type:"text",value:_,onChange:function(r){var t=r.target.value;if(t.length>50)return f(t.slice(0,50)),void B(function(r){return e.__assign(e.__assign({},r),{name:"Scope Name must be 50 characters or fewer"})});f(t),C.name&&B(function(r){return e.__assign(e.__assign({},r),{name:void 0})})},placeholder:"e.g. Global Learnings",style:e.__assign(e.__assign({},k.input),C.name?k.inputError:{})}),C.name&&r.jsx("p",e.__assign({style:k.errorText},{children:C.name}))]})),r.jsxs("div",e.__assign({style:k.formGroup},{children:[r.jsxs("label",e.__assign({style:k.label},{children:[r.jsx("span",e.__assign({style:k.asterisk},{children:"*"})),"Description"]})),r.jsx("textarea",{value:h,onChange:function(r){b(r.target.value),C.description&&B(function(r){return e.__assign(e.__assign({},r),{description:void 0})})},placeholder:"Enter short description for scope",style:e.__assign(e.__assign({},k.textarea),C.description?k.inputError:{})}),C.description&&r.jsx("p",e.__assign({style:k.errorText},{children:C.description}))]}))]}),r.jsxs("div",e.__assign({style:k.footer},{children:[r.jsx("button",e.__assign({onClick:l,disabled:S,style:e.__assign(e.__assign({},k.cancelBtn),S?k.disabledBtn:{})},{children:"Cancel"})),r.jsx("button",e.__assign({onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var r,t;return e.__generator(this,function(e){switch(e.label){case 0:if(s={},o=!0,_.trim()?_.length>50&&(s.name="Scope Name must be 50 characters or fewer",o=!1):(s.name="Scope Name is required",o=!1),h.trim()||(s.description="Description is required",o=!1),B(s),!o)return[2];y(!0),r={topic:c?"genreRuleSet":"globalRuleSet",customScopeGroupName:i.IL_CONFIG_CONSTANTS.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:h,parentScopeId:null,customScopeName:_,customScopeId:n.v4(),createByName:null==z?void 0:z.firstname,createdBy:null==z?void 0:z.email},e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,d(r)];case 2:return e.sent(),l(),[3,5];case 3:return t=e.sent(),console.error("Error in submission",t),[3,5];case 4:return y(!1),[7];case 5:return[2]}var s,o})})},disabled:S,style:e.__assign(e.__assign({},k.submitBtn),S?k.disabledBtn:{})},{children:S?"Creating...":"Create Scope"}))]}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CreateRuleSetLegacyModal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as r,__generator as t}from"tslib";import{jsx as o,jsxs as
|
|
1
|
+
import{__assign as e,__awaiter as r,__generator as t}from"tslib";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{useState as i,useEffect as l}from"react";import{v4 as a}from"uuid";import{IL_CONFIG_CONSTANTS as s}from"../config.js";import p from"../store/useAuthStore.js";var d=function(d){var c=d.isOpen,u=d.onClose,f=d.onSubmit,m=d.hasGlobalRuleSet,x=void 0!==m&&m,h=i("");h[0];var b=h[1],g=i(""),v=g[0],y=g[1],S=i(""),C=S[0],B=S[1],E=i(!1),z=E[0],k=E[1],w=i({}),R=w[0],F=w[1],N=p(),D=N.user;if(N.setUser,l(function(){c&&(b(""),y(""),B(""),F({}))},[c]),!c)return null;var G={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.3)"},modal:{position:"relative",width:"600px",borderRadius:"12px",backgroundColor:"#ffffff",padding:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},header:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"24px"},title:{margin:0,fontSize:"18px",fontWeight:500,color:"#19213D"},subtitle:{marginTop:"4px",fontSize:"14px",fontWeight:400,color:"#666F8D"},closeButton:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#9CA3AF"},formGroup:{display:"flex",flexDirection:"column",marginBottom:"20px",gap:"6px"},label:{fontSize:"14px",fontWeight:500,color:"#19213D"},asterisk:{color:"#8F2C23",marginRight:"4px",fontSize:"16px",fontWeight:600},input:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px"},inputError:{border:"1px solid #8F2C23"},errorText:{margin:0,marginTop:"4px",fontSize:"12px",color:"#8F2C23"},textarea:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid #E2E8F0",outline:"none",fontSize:"14px",minHeight:"100px",maxHeight:"200px",overflowY:"auto",resize:"vertical"},footer:{display:"flex",justifyContent:"flex-end",gap:"12px",marginTop:"32px"},cancelBtn:{padding:"8px 16px",borderRadius:"6px",border:"1px solid #E2E8F0",backgroundColor:"transparent",color:"#64748B",fontSize:"14px",fontWeight:500,cursor:"pointer"},submitBtn:{padding:"8px 16px",borderRadius:"6px",border:"none",backgroundColor:"#2563EB",color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer"},disabledBtn:{opacity:.5,cursor:"not-allowed"}};return o("div",e({style:G.overlay},{children:n("div",e({style:G.modal},{children:[n("div",e({style:G.header},{children:[n("div",{children:[o("h2",e({style:G.title},{children:"Create Scope"})),o("p",e({style:G.subtitle},{children:"Create a scope to group and manage rules."}))]}),o("button",e({onClick:u,style:G.closeButton},{children:"✕"}))]})),n("div",{children:[n("div",e({style:G.formGroup},{children:[n("label",e({style:G.label},{children:[o("span",e({style:G.asterisk},{children:"*"})),"Scope Name"]})),o("input",{type:"text",value:v,onChange:function(r){var t=r.target.value;if(t.length>50)return y(t.slice(0,50)),void F(function(r){return e(e({},r),{name:"Scope Name must be 50 characters or fewer"})});y(t),R.name&&F(function(r){return e(e({},r),{name:void 0})})},placeholder:"e.g. Global Learnings",style:e(e({},G.input),R.name?G.inputError:{})}),R.name&&o("p",e({style:G.errorText},{children:R.name}))]})),n("div",e({style:G.formGroup},{children:[n("label",e({style:G.label},{children:[o("span",e({style:G.asterisk},{children:"*"})),"Description"]})),o("textarea",{value:C,onChange:function(r){B(r.target.value),R.description&&F(function(r){return e(e({},r),{description:void 0})})},placeholder:"Enter short description for scope",style:e(e({},G.textarea),R.description?G.inputError:{})}),R.description&&o("p",e({style:G.errorText},{children:R.description}))]}))]}),n("div",e({style:G.footer},{children:[o("button",e({onClick:u,disabled:z,style:e(e({},G.cancelBtn),z?G.disabledBtn:{})},{children:"Cancel"})),o("button",e({onClick:function(){return r(void 0,void 0,void 0,function(){var e,r;return t(this,function(t){switch(t.label){case 0:if(o={},n=!0,v.trim()?v.length>50&&(o.name="Scope Name must be 50 characters or fewer",n=!1):(o.name="Scope Name is required",n=!1),C.trim()||(o.description="Description is required",n=!1),F(o),!n)return[2];k(!0),e={topic:x?"genreRuleSet":"globalRuleSet",customScopeGroupName:s.CUSTOM_SCOPE_GROUP_NAME,scopeDescription:C,parentScopeId:null,customScopeName:v,customScopeId:a(),createByName:null==D?void 0:D.firstname,createdBy:null==D?void 0:D.email},t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,f(e)];case 2:return t.sent(),u(),[3,5];case 3:return r=t.sent(),console.error("Error in submission",r),[3,5];case 4:return k(!1),[7];case 5:return[2]}var o,n})})},disabled:z,style:e(e({},G.submitBtn),z?G.disabledBtn:{})},{children:z?"Creating...":"Create Scope"}))]}))]}))}))};export{d as default};
|
|
2
2
|
//# sourceMappingURL=CreateRuleSetLegacyModal.js.map
|
package/dist/types/src/features/LearningManagement/components/CreateRuleSetLegacyModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateRuleSetLegacyModal.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/components/CreateRuleSetLegacyModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,UAAU,6BAA6B;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,
|
|
1
|
+
{"version":3,"file":"CreateRuleSetLegacyModal.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/components/CreateRuleSetLegacyModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,UAAU,6BAA6B;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAQD,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA+MrE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|