@e-llm-studio/instant-learning 1.3.0-alpha.61 → 1.3.0-alpha.62

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("tslib"),n=require("react/jsx-runtime"),o=require("react"),t=require("@mui/material"),i=require("@mui/icons-material/Check"),r=require("@mui/icons-material/CloseRounded"),a=require("lucide-react"),s=require("../store/useLMSConfigStore.js"),c=require("../constants.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(i),u=l(r),p={header:{padding:"16px 16px 0",display:"flex",justifyContent:"space-between",alignItems:"center"},title:{color:"#334155",fontSize:"1rem"},closeButton:{border:"none",background:"transparent",padding:0,color:"#9CA3AF",cursor:"pointer",outline:"none",transition:"color 150ms ease-in-out"},dialogContent:{padding:"8px 16px"},description:{color:"#475569",fontSize:"0.875rem",lineHeight:1.625},descriptionStrong:{fontWeight:700,color:"#1E293B"},secondaryDescription:{color:"#475569",fontSize:"0.875rem",marginTop:"8px"},rejectSection:{marginTop:"20px"},feedbackLabel:{display:"block",fontSize:"0.875rem",fontWeight:600,color:"#334155",marginBottom:"6px"},textarea:{width:"100%",fontSize:"0.875rem",color:"#1E293B",padding:"10px",border:"1px solid #E2E8F0",borderRadius:"0.5rem",outline:"none",resize:"none",transition:"border-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box",fontFamily:"inherit"},checkboxLabel:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none",marginTop:"16px"},checkbox:{margin:0,height:"1.125rem",width:"1.125rem",borderRadius:"0.25rem",border:"1px solid #CBD5E1",accentColor:"#DC2626",cursor:"pointer"},checkboxTextWrap:{display:"flex",alignItems:"center"},checkboxText:{fontSize:"0.875rem",fontWeight:500,color:"#1E293B",transition:"color 150ms ease-in-out"},actions:{padding:"24px",gap:"8px"},secondaryButton:{padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#475569",border:"1px solid #E2E8F0",borderRadius:"0.5rem",backgroundColor:"#FFFFFF",transition:"background-color 150ms ease-in-out, border-color 150ms ease-in-out",cursor:"pointer"},primaryButton:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#FFFFFF",border:"none",borderRadius:"0.5rem",transition:"background-color 150ms ease-in-out",boxShadow:"none",cursor:"pointer"},actionIcon:{width:"1rem",height:"1rem",fontSize:"1rem"},variantCard:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px 20px",marginTop:"12px"},variantCardTitle:{fontSize:"0.9375rem",fontWeight:700,color:"#111111",marginBottom:"4px"},variantCardDescription:{fontSize:"0.8125rem",color:"#374151",marginBottom:"12px",lineHeight:1.5},variantCardMono:{fontSize:"0.75rem",color:"#4b5563",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:1.6}};exports.default=function(i){var r=i.open,l=i.mode,g=i.onClose,x=i.onSubmit,_=i.variantInformation,b=i.ruleTitle,h=i.pendingVariants,f=void 0===h?[]:h,m=i.isPending,j=void 0!==m&&m,y=o.useState(""),T=y[0],v=y[1],C=o.useState(!0),A=C[0],D=C[1],k=o.useState(!1),E=k[0],F=k[1],L=o.useState(!1),S=L[0],N=L[1],I=o.useState(!1),R=I[0],w=I[1],B=o.useState(!1),M=B[0],z=B[1],P=o.useState(!1),H=P[0],G=P[1],W="undefined"!=typeof document?document.getElementById("rule-template-layout-content"):null,q="reject"===l,V=function(){x(q?{feedback:T,deleteLearning:A}:{}),v(""),D(!1)},O=function(){v(""),D(!1),g()};return n.jsxs(t.Dialog,e.__assign({open:r,onClose:O,container:W,maxWidth:!1,fullWidth:!0,sx:{position:"absolute",inset:0,zIndex:999,"& .MuiBackdrop-root":{position:"absolute"},"& .MuiDialog-container":{alignItems:"center",justifyContent:"center",padding:"24px 16px"},"& .MuiDialog-paper":{width:"100%",maxWidth:"640px",margin:0,borderRadius:"16px"}}},{children:[n.jsxs("div",e.__assign({style:p.header},{children:[n.jsx("div",e.__assign({style:p.title},{children:"".concat(q?s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.title"),"Reject Learning"):s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.title"),"Approve Learning"))})),n.jsx("button",e.__assign({onClick:g,onMouseEnter:function(){return F(!0)},onMouseLeave:function(){return F(!1)},style:e.__assign(e.__assign({},p.closeButton),{color:E?"#4B5563":"#9CA3AF"})},{children:n.jsx(a.X,{size:24})}))]})),n.jsxs(t.DialogContent,e.__assign({sx:p.dialogContent},{children:[n.jsxs(t.DialogContentText,e.__assign({sx:p.description},{children:[n.jsx("span",e.__assign({style:p.descriptionStrong},{children:_}))," ","".concat(q?s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.desc"),"will not be published or applied within the selected scope. You can provide feedback before rejecting"):s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.desc"),"will be published and become active within the selected scope after approval."))]})),f.length>0&&n.jsx("div",{children:f.map(function(o,t){return n.jsxs("div",e.__assign({style:p.variantCard},{children:[n.jsxs("div",e.__assign({style:p.variantCardTitle},{children:[b,f.length>1?" — Variant ".concat(t+1):""]})),o.description&&n.jsx("div",e.__assign({style:p.variantCardDescription},{children:o.description})),n.jsxs("div",e.__assign({style:p.variantCardMono},{children:[o.whenToApply&&n.jsxs("div",{children:["WTA — ",o.whenToApply]}),o.whenNotToApply&&n.jsxs("div",{children:["WNTA — ",o.whenNotToApply]})]}))]}),o.variantId)})}),n.jsx(t.DialogContentText,e.__assign({sx:p.secondaryDescription},{children:q?"":s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.footer"),"Take a moment to check the configuration before moving forward.")})),q&&n.jsxs("div",e.__assign({style:p.rejectSection},{children:[n.jsxs("div",{children:[n.jsx("label",e.__assign({htmlFor:"feedback",style:p.feedbackLabel},{children:s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.feedbackTitle"),"Feedback")})),n.jsx("textarea",{id:"feedback",rows:4,value:T,onChange:function(e){return v(e.target.value)},onFocus:function(){return N(!0)},onBlur:function(){return N(!1)},placeholder:"".concat(s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.feedbackPlaceholder"),"Add feedback or reason for rejection")),style:e.__assign(e.__assign({},p.textarea),{borderColor:S?"#EF4444":"#E2E8F0",boxShadow:S?"0 0 0 2px rgba(239, 68, 68, 0.2)":"none"})})]}),n.jsxs("label",e.__assign({style:p.checkboxLabel,onMouseEnter:function(){return w(!0)},onMouseLeave:function(){return w(!1)}},{children:[n.jsx("input",{type:"checkbox",checked:A,disabled:!1,onChange:function(e){return D(e.target.checked)},style:p.checkbox}),n.jsx("div",e.__assign({style:p.checkboxTextWrap},{children:n.jsx("span",e.__assign({style:e.__assign(e.__assign({},p.checkboxText),{color:R?"#0F172A":"#1E293B"})},{children:s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.deleteCheckboxLabel"),"Also delete this learning")}))}))]}))]}))]})),n.jsxs(t.DialogActions,e.__assign({sx:p.actions},{children:[n.jsx("button",e.__assign({onClick:O,type:"button",disabled:j,onMouseEnter:function(){return z(!0)},onMouseLeave:function(){return z(!1)},style:e.__assign(e.__assign({},p.secondaryButton),{backgroundColor:M&&!j?"#F8FAFC":"#FFFFFF",borderColor:M&&!j?"#CBD5E1":"#E2E8F0",opacity:j?.5:1,cursor:j?"not-allowed":"pointer"})},{children:s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.cancel"),"Cancel")})),q?n.jsxs("button",e.__assign({onClick:V,type:"button",disabled:j,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e.__assign(e.__assign({},p.primaryButton),{backgroundColor:j?"#EF4444":H?"#DC2626":"#EF4444",opacity:j?.7:1,cursor:j?"not-allowed":"pointer"})},{children:[j?n.jsx(a.Loader2,{size:16,style:{animation:"spin 1s linear infinite"}}):n.jsx(u.default,{sx:p.actionIcon}),j?s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.loadingText"),"Processing..."):s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.rejectLearning"),"Reject Learning")]})):n.jsxs("button",e.__assign({onClick:V,type:"button",disabled:j,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e.__assign(e.__assign({},p.primaryButton),{backgroundColor:j?"#22C55E":H?"#16A34A":"#22C55E",opacity:j?.7:1,cursor:j?"not-allowed":"pointer"})},{children:[j?n.jsx(a.Loader2,{size:16,style:{animation:"spin 1s linear infinite"}}):n.jsx(d.default,{sx:p.actionIcon}),j?s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.loadingText"),"Processing..."):s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.approveLearning"),"Approve Learning")]}))]})),n.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),t=require("@mui/material"),i=require("@mui/icons-material/Check"),r=require("@mui/icons-material/CloseRounded"),a=require("lucide-react"),s=require("../store/useLMSConfigStore.js"),c=require("../constants.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(o),u=l(i),p=l(r),g={header:{padding:"16px 16px 0",display:"flex",justifyContent:"space-between",alignItems:"center"},title:{color:"#334155",fontSize:"1rem"},closeButton:{border:"none",background:"transparent",padding:0,color:"#9CA3AF",cursor:"pointer",outline:"none",transition:"color 150ms ease-in-out"},dialogContent:{padding:"8px 16px"},description:{color:"#475569",fontSize:"0.875rem",lineHeight:1.625},descriptionStrong:{fontWeight:700,color:"#1E293B"},secondaryDescription:{color:"#475569",fontSize:"0.875rem",marginTop:"8px"},rejectSection:{marginTop:"20px"},feedbackLabel:{display:"block",fontSize:"0.875rem",fontWeight:600,color:"#334155",marginBottom:"6px"},textarea:{width:"100%",fontSize:"0.875rem",color:"#1E293B",padding:"10px",border:"1px solid #E2E8F0",borderRadius:"0.5rem",outline:"none",resize:"none",transition:"border-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box",fontFamily:"inherit"},checkboxLabel:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none",marginTop:"16px"},checkbox:{margin:0,height:"1.125rem",width:"1.125rem",borderRadius:"0.25rem",border:"1px solid #CBD5E1",accentColor:"#DC2626",cursor:"pointer"},checkboxTextWrap:{display:"flex",alignItems:"center"},checkboxText:{fontSize:"0.875rem",fontWeight:500,color:"#1E293B",transition:"color 150ms ease-in-out"},actions:{padding:"24px",gap:"8px"},secondaryButton:{padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#475569",border:"1px solid #E2E8F0",borderRadius:"0.5rem",backgroundColor:"#FFFFFF",transition:"background-color 150ms ease-in-out, border-color 150ms ease-in-out",cursor:"pointer"},primaryButton:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#FFFFFF",border:"none",borderRadius:"0.5rem",transition:"background-color 150ms ease-in-out",boxShadow:"none",cursor:"pointer"},actionIcon:{width:"1rem",height:"1rem",fontSize:"1rem"},variantCard:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px 20px",marginTop:"12px"},variantCardTitle:{fontSize:"0.9375rem",fontWeight:700,color:"#111111",marginBottom:"4px"},variantCardDescription:{fontSize:"0.8125rem",color:"#374151",marginBottom:"12px",lineHeight:1.5},variantCardMono:{fontSize:"0.75rem",color:"#4b5563",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:1.6}};exports.default=function(i){var r=i.open,l=i.mode,x=i.onClose,_=i.onSubmit,h=i.variantInformation,b=i.ruleTitle,m=i.pendingVariants,f=void 0===m?[]:m,j=i.isPending,y=void 0!==j&&j,v=o.useState(""),T=v[0],C=v[1],A=o.useState(!0),D=A[0],k=A[1],F=o.useState(!1),E=F[0],L=F[1],S=o.useState(!1),N=S[0],I=S[1],R=o.useState(!1),w=R[0],B=R[1],M=o.useState(!1),z=M[0],P=M[1],H=o.useState(!1),G=H[0],W=H[1],q="undefined"!=typeof document?document.getElementById("rule-template-layout-content"):null,V="reject"===l,O=function(){_(V?{feedback:T,deleteLearning:D}:{}),C(""),k(!1)},X=function(){C(""),k(!1),x()},Y=V?s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.desc"),"{variant_name} will not be published or applied within the selected scope. You can provide feedback before rejecting."):s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.desc"),"{variant_name} will be published and become active within the selected scope after approval.");return n.jsxs(t.Dialog,e.__assign({open:r,onClose:X,container:q,maxWidth:!1,fullWidth:!0,sx:{position:"absolute",inset:0,zIndex:999,"& .MuiBackdrop-root":{position:"absolute"},"& .MuiDialog-container":{alignItems:"center",justifyContent:"center",padding:"24px 16px"},"& .MuiDialog-paper":{width:"100%",maxWidth:"640px",margin:0,borderRadius:"16px"}}},{children:[n.jsxs("div",e.__assign({style:g.header},{children:[n.jsx("div",e.__assign({style:g.title},{children:"".concat(V?s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.title"),"Reject Learning"):s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.title"),"Approve Learning"))})),n.jsx("button",e.__assign({onClick:x,onMouseEnter:function(){return L(!0)},onMouseLeave:function(){return L(!1)},style:e.__assign(e.__assign({},g.closeButton),{color:E?"#4B5563":"#9CA3AF"})},{children:n.jsx(a.X,{size:24})}))]})),n.jsxs(t.DialogContent,e.__assign({sx:g.dialogContent},{children:[n.jsxs(t.DialogContentText,e.__assign({sx:g.description},{children:[!Y.includes("{variant_name}")&&n.jsxs(n.Fragment,{children:[n.jsx("span",e.__assign({style:g.descriptionStrong},{children:h}))," "]}),Y.split("{variant_name}").map(function(o,t,i){return n.jsxs(d.default.Fragment,{children:[o,t<i.length-1&&n.jsx("span",e.__assign({style:g.descriptionStrong},{children:h}))]},t)})]})),f.length>0&&n.jsx("div",{children:f.map(function(o,t){return n.jsxs("div",e.__assign({style:g.variantCard},{children:[n.jsxs("div",e.__assign({style:g.variantCardTitle},{children:[b,f.length>1?" — Variant ".concat(t+1):""]})),o.description&&n.jsx("div",e.__assign({style:g.variantCardDescription},{children:o.description})),n.jsxs("div",e.__assign({style:g.variantCardMono},{children:[o.whenToApply&&n.jsxs("div",{children:["WTA — ",o.whenToApply]}),o.whenNotToApply&&n.jsxs("div",{children:["WNTA — ",o.whenNotToApply]})]}))]}),o.variantId)})}),n.jsx(t.DialogContentText,e.__assign({sx:g.secondaryDescription},{children:V?"":s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.footer"),"Take a moment to check the configuration before moving forward.")})),V&&n.jsxs("div",e.__assign({style:g.rejectSection},{children:[n.jsxs("div",{children:[n.jsx("label",e.__assign({htmlFor:"feedback",style:g.feedbackLabel},{children:s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.feedbackTitle"),"Feedback")})),n.jsx("textarea",{id:"feedback",rows:4,value:T,onChange:function(e){return C(e.target.value)},onFocus:function(){return I(!0)},onBlur:function(){return I(!1)},placeholder:"".concat(s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.feedbackPlaceholder"),"Add feedback or reason for rejection")),style:e.__assign(e.__assign({},g.textarea),{borderColor:N?"#EF4444":"#E2E8F0",boxShadow:N?"0 0 0 2px rgba(239, 68, 68, 0.2)":"none"})})]}),n.jsxs("label",e.__assign({style:g.checkboxLabel,onMouseEnter:function(){return B(!0)},onMouseLeave:function(){return B(!1)}},{children:[n.jsx("input",{type:"checkbox",checked:D,disabled:!1,onChange:function(e){return k(e.target.checked)},style:g.checkbox}),n.jsx("div",e.__assign({style:g.checkboxTextWrap},{children:n.jsx("span",e.__assign({style:e.__assign(e.__assign({},g.checkboxText),{color:w?"#0F172A":"#1E293B"})},{children:s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.deleteCheckboxLabel"),"Also delete this learning")}))}))]}))]}))]})),n.jsxs(t.DialogActions,e.__assign({sx:g.actions},{children:[n.jsx("button",e.__assign({onClick:X,type:"button",disabled:y,onMouseEnter:function(){return P(!0)},onMouseLeave:function(){return P(!1)},style:e.__assign(e.__assign({},g.secondaryButton),{backgroundColor:z&&!y?"#F8FAFC":"#FFFFFF",borderColor:z&&!y?"#CBD5E1":"#E2E8F0",opacity:y?.5:1,cursor:y?"not-allowed":"pointer"})},{children:s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.cancel"),"Cancel")})),V?n.jsxs("button",e.__assign({onClick:O,type:"button",disabled:y,onMouseEnter:function(){return W(!0)},onMouseLeave:function(){return W(!1)},style:e.__assign(e.__assign({},g.primaryButton),{backgroundColor:y?"#EF4444":G?"#DC2626":"#EF4444",opacity:y?.7:1,cursor:y?"not-allowed":"pointer"})},{children:[y?n.jsx(a.Loader2,{size:16,style:{animation:"spin 1s linear infinite"}}):n.jsx(p.default,{sx:g.actionIcon}),y?s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.loadingText"),"Processing..."):s.dt("".concat(c.LEARNING_DT_PATH,".rejectDialog.rejectLearning"),"Reject Learning")]})):n.jsxs("button",e.__assign({onClick:O,type:"button",disabled:y,onMouseEnter:function(){return W(!0)},onMouseLeave:function(){return W(!1)},style:e.__assign(e.__assign({},g.primaryButton),{backgroundColor:y?"#22C55E":G?"#16A34A":"#22C55E",opacity:y?.7:1,cursor:y?"not-allowed":"pointer"})},{children:[y?n.jsx(a.Loader2,{size:16,style:{animation:"spin 1s linear infinite"}}):n.jsx(u.default,{sx:g.actionIcon}),y?s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.loadingText"),"Processing..."):s.dt("".concat(c.LEARNING_DT_PATH,".approveDialog.approveLearning"),"Approve Learning")]}))]})),n.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}))};
2
2
  //# sourceMappingURL=ApprovalLearningDialog.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{useState as t}from"react";import{Dialog as r,DialogContent as i,DialogContentText as a,DialogActions as c}from"@mui/material";import l from"@mui/icons-material/Check";import d from"@mui/icons-material/CloseRounded";import{X as s,Loader2 as p}from"lucide-react";import{dt as u}from"../store/useLMSConfigStore.js";import{LEARNING_DT_PATH as m}from"../constants.js";var g={header:{padding:"16px 16px 0",display:"flex",justifyContent:"space-between",alignItems:"center"},title:{color:"#334155",fontSize:"1rem"},closeButton:{border:"none",background:"transparent",padding:0,color:"#9CA3AF",cursor:"pointer",outline:"none",transition:"color 150ms ease-in-out"},dialogContent:{padding:"8px 16px"},description:{color:"#475569",fontSize:"0.875rem",lineHeight:1.625},descriptionStrong:{fontWeight:700,color:"#1E293B"},secondaryDescription:{color:"#475569",fontSize:"0.875rem",marginTop:"8px"},rejectSection:{marginTop:"20px"},feedbackLabel:{display:"block",fontSize:"0.875rem",fontWeight:600,color:"#334155",marginBottom:"6px"},textarea:{width:"100%",fontSize:"0.875rem",color:"#1E293B",padding:"10px",border:"1px solid #E2E8F0",borderRadius:"0.5rem",outline:"none",resize:"none",transition:"border-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box",fontFamily:"inherit"},checkboxLabel:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none",marginTop:"16px"},checkbox:{margin:0,height:"1.125rem",width:"1.125rem",borderRadius:"0.25rem",border:"1px solid #CBD5E1",accentColor:"#DC2626",cursor:"pointer"},checkboxTextWrap:{display:"flex",alignItems:"center"},checkboxText:{fontSize:"0.875rem",fontWeight:500,color:"#1E293B",transition:"color 150ms ease-in-out"},actions:{padding:"24px",gap:"8px"},secondaryButton:{padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#475569",border:"1px solid #E2E8F0",borderRadius:"0.5rem",backgroundColor:"#FFFFFF",transition:"background-color 150ms ease-in-out, border-color 150ms ease-in-out",cursor:"pointer"},primaryButton:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#FFFFFF",border:"none",borderRadius:"0.5rem",transition:"background-color 150ms ease-in-out",boxShadow:"none",cursor:"pointer"},actionIcon:{width:"1rem",height:"1rem",fontSize:"1rem"},variantCard:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px 20px",marginTop:"12px"},variantCardTitle:{fontSize:"0.9375rem",fontWeight:700,color:"#111111",marginBottom:"4px"},variantCardDescription:{fontSize:"0.8125rem",color:"#374151",marginBottom:"12px",lineHeight:1.5},variantCardMono:{fontSize:"0.75rem",color:"#4b5563",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:1.6}},h=function(h){var b=h.open,f=h.mode,x=h.onClose,y=h.onSubmit,v=h.variantInformation,C=h.ruleTitle,k=h.pendingVariants,F=void 0===k?[]:k,E=h.isPending,S=void 0!==E&&E,D=t(""),j=D[0],w=D[1],T=t(!0),B=T[0],M=T[1],z=t(!1),A=z[0],L=z[1],W=t(!1),I=W[0],R=W[1],P=t(!1),H=P[0],N=P[1],V=t(!1),Y=V[0],q=V[1],G=t(!1),J=G[0],K=G[1],O="undefined"!=typeof document?document.getElementById("rule-template-layout-content"):null,Q="reject"===f,U=function(){y(Q?{feedback:j,deleteLearning:B}:{}),w(""),M(!1)},X=function(){w(""),M(!1),x()};return o(r,e({open:b,onClose:X,container:O,maxWidth:!1,fullWidth:!0,sx:{position:"absolute",inset:0,zIndex:999,"& .MuiBackdrop-root":{position:"absolute"},"& .MuiDialog-container":{alignItems:"center",justifyContent:"center",padding:"24px 16px"},"& .MuiDialog-paper":{width:"100%",maxWidth:"640px",margin:0,borderRadius:"16px"}}},{children:[o("div",e({style:g.header},{children:[n("div",e({style:g.title},{children:"".concat(Q?u("".concat(m,".rejectDialog.title"),"Reject Learning"):u("".concat(m,".approveDialog.title"),"Approve Learning"))})),n("button",e({onClick:x,onMouseEnter:function(){return L(!0)},onMouseLeave:function(){return L(!1)},style:e(e({},g.closeButton),{color:A?"#4B5563":"#9CA3AF"})},{children:n(s,{size:24})}))]})),o(i,e({sx:g.dialogContent},{children:[o(a,e({sx:g.description},{children:[n("span",e({style:g.descriptionStrong},{children:v}))," ","".concat(Q?u("".concat(m,".rejectDialog.desc"),"will not be published or applied within the selected scope. You can provide feedback before rejecting"):u("".concat(m,".approveDialog.desc"),"will be published and become active within the selected scope after approval."))]})),F.length>0&&n("div",{children:F.map(function(t,r){return o("div",e({style:g.variantCard},{children:[o("div",e({style:g.variantCardTitle},{children:[C,F.length>1?" — Variant ".concat(r+1):""]})),t.description&&n("div",e({style:g.variantCardDescription},{children:t.description})),o("div",e({style:g.variantCardMono},{children:[t.whenToApply&&o("div",{children:["WTA — ",t.whenToApply]}),t.whenNotToApply&&o("div",{children:["WNTA — ",t.whenNotToApply]})]}))]}),t.variantId)})}),n(a,e({sx:g.secondaryDescription},{children:Q?"":u("".concat(m,".approveDialog.footer"),"Take a moment to check the configuration before moving forward.")})),Q&&o("div",e({style:g.rejectSection},{children:[o("div",{children:[n("label",e({htmlFor:"feedback",style:g.feedbackLabel},{children:u("".concat(m,".rejectDialog.feedbackTitle"),"Feedback")})),n("textarea",{id:"feedback",rows:4,value:j,onChange:function(e){return w(e.target.value)},onFocus:function(){return R(!0)},onBlur:function(){return R(!1)},placeholder:"".concat(u("".concat(m,".rejectDialog.feedbackPlaceholder"),"Add feedback or reason for rejection")),style:e(e({},g.textarea),{borderColor:I?"#EF4444":"#E2E8F0",boxShadow:I?"0 0 0 2px rgba(239, 68, 68, 0.2)":"none"})})]}),o("label",e({style:g.checkboxLabel,onMouseEnter:function(){return N(!0)},onMouseLeave:function(){return N(!1)}},{children:[n("input",{type:"checkbox",checked:B,disabled:!1,onChange:function(e){return M(e.target.checked)},style:g.checkbox}),n("div",e({style:g.checkboxTextWrap},{children:n("span",e({style:e(e({},g.checkboxText),{color:H?"#0F172A":"#1E293B"})},{children:u("".concat(m,".rejectDialog.deleteCheckboxLabel"),"Also delete this learning")}))}))]}))]}))]})),o(c,e({sx:g.actions},{children:[n("button",e({onClick:X,type:"button",disabled:S,onMouseEnter:function(){return q(!0)},onMouseLeave:function(){return q(!1)},style:e(e({},g.secondaryButton),{backgroundColor:Y&&!S?"#F8FAFC":"#FFFFFF",borderColor:Y&&!S?"#CBD5E1":"#E2E8F0",opacity:S?.5:1,cursor:S?"not-allowed":"pointer"})},{children:u("".concat(m,".approveDialog.cancel"),"Cancel")})),o("button",Q?e({onClick:U,type:"button",disabled:S,onMouseEnter:function(){return K(!0)},onMouseLeave:function(){return K(!1)},style:e(e({},g.primaryButton),{backgroundColor:S?"#EF4444":J?"#DC2626":"#EF4444",opacity:S?.7:1,cursor:S?"not-allowed":"pointer"})},{children:[S?n(p,{size:16,style:{animation:"spin 1s linear infinite"}}):n(d,{sx:g.actionIcon}),S?u("".concat(m,".rejectDialog.loadingText"),"Processing..."):u("".concat(m,".rejectDialog.rejectLearning"),"Reject Learning")]}):e({onClick:U,type:"button",disabled:S,onMouseEnter:function(){return K(!0)},onMouseLeave:function(){return K(!1)},style:e(e({},g.primaryButton),{backgroundColor:S?"#22C55E":J?"#16A34A":"#22C55E",opacity:S?.7:1,cursor:S?"not-allowed":"pointer"})},{children:[S?n(p,{size:16,style:{animation:"spin 1s linear infinite"}}):n(l,{sx:g.actionIcon}),S?u("".concat(m,".approveDialog.loadingText"),"Processing..."):u("".concat(m,".approveDialog.approveLearning"),"Approve Learning")]}))]})),n("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}))};export{h as default};
1
+ import{__assign as e}from"tslib";import{jsxs as o,jsx as n,Fragment as t}from"react/jsx-runtime";import r,{useState as i}from"react";import{Dialog as a,DialogContent as c,DialogContentText as l,DialogActions as d}from"@mui/material";import s from"@mui/icons-material/Check";import p from"@mui/icons-material/CloseRounded";import{X as u,Loader2 as m}from"lucide-react";import{dt as g}from"../store/useLMSConfigStore.js";import{LEARNING_DT_PATH as h}from"../constants.js";var f={header:{padding:"16px 16px 0",display:"flex",justifyContent:"space-between",alignItems:"center"},title:{color:"#334155",fontSize:"1rem"},closeButton:{border:"none",background:"transparent",padding:0,color:"#9CA3AF",cursor:"pointer",outline:"none",transition:"color 150ms ease-in-out"},dialogContent:{padding:"8px 16px"},description:{color:"#475569",fontSize:"0.875rem",lineHeight:1.625},descriptionStrong:{fontWeight:700,color:"#1E293B"},secondaryDescription:{color:"#475569",fontSize:"0.875rem",marginTop:"8px"},rejectSection:{marginTop:"20px"},feedbackLabel:{display:"block",fontSize:"0.875rem",fontWeight:600,color:"#334155",marginBottom:"6px"},textarea:{width:"100%",fontSize:"0.875rem",color:"#1E293B",padding:"10px",border:"1px solid #E2E8F0",borderRadius:"0.5rem",outline:"none",resize:"none",transition:"border-color 150ms ease-in-out, box-shadow 150ms ease-in-out",boxSizing:"border-box",fontFamily:"inherit"},checkboxLabel:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",cursor:"pointer",userSelect:"none",marginTop:"16px"},checkbox:{margin:0,height:"1.125rem",width:"1.125rem",borderRadius:"0.25rem",border:"1px solid #CBD5E1",accentColor:"#DC2626",cursor:"pointer"},checkboxTextWrap:{display:"flex",alignItems:"center"},checkboxText:{fontSize:"0.875rem",fontWeight:500,color:"#1E293B",transition:"color 150ms ease-in-out"},actions:{padding:"24px",gap:"8px"},secondaryButton:{padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#475569",border:"1px solid #E2E8F0",borderRadius:"0.5rem",backgroundColor:"#FFFFFF",transition:"background-color 150ms ease-in-out, border-color 150ms ease-in-out",cursor:"pointer"},primaryButton:{display:"inline-flex",alignItems:"center",gap:"0.375rem",padding:"8px 20px",fontSize:"0.875rem",fontWeight:500,color:"#FFFFFF",border:"none",borderRadius:"0.5rem",transition:"background-color 150ms ease-in-out",boxShadow:"none",cursor:"pointer"},actionIcon:{width:"1rem",height:"1rem",fontSize:"1rem"},variantCard:{backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"16px 20px",marginTop:"12px"},variantCardTitle:{fontSize:"0.9375rem",fontWeight:700,color:"#111111",marginBottom:"4px"},variantCardDescription:{fontSize:"0.8125rem",color:"#374151",marginBottom:"12px",lineHeight:1.5},variantCardMono:{fontSize:"0.75rem",color:"#4b5563",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:1.6}},b=function(b){var x=b.open,y=b.mode,v=b.onClose,C=b.onSubmit,k=b.variantInformation,F=b.ruleTitle,E=b.pendingVariants,S=void 0===E?[]:E,D=b.isPending,j=void 0!==D&&D,w=i(""),T=w[0],B=w[1],M=i(!0),z=M[0],A=M[1],L=i(!1),W=L[0],I=L[1],R=i(!1),P=R[0],_=R[1],H=i(!1),N=H[0],V=H[1],Y=i(!1),q=Y[0],G=Y[1],J=i(!1),K=J[0],O=J[1],Q="undefined"!=typeof document?document.getElementById("rule-template-layout-content"):null,U="reject"===y,X=function(){C(U?{feedback:T,deleteLearning:z}:{}),B(""),A(!1)},Z=function(){B(""),A(!1),v()},$=U?g("".concat(h,".rejectDialog.desc"),"{variant_name} will not be published or applied within the selected scope. You can provide feedback before rejecting."):g("".concat(h,".approveDialog.desc"),"{variant_name} will be published and become active within the selected scope after approval.");return o(a,e({open:x,onClose:Z,container:Q,maxWidth:!1,fullWidth:!0,sx:{position:"absolute",inset:0,zIndex:999,"& .MuiBackdrop-root":{position:"absolute"},"& .MuiDialog-container":{alignItems:"center",justifyContent:"center",padding:"24px 16px"},"& .MuiDialog-paper":{width:"100%",maxWidth:"640px",margin:0,borderRadius:"16px"}}},{children:[o("div",e({style:f.header},{children:[n("div",e({style:f.title},{children:"".concat(U?g("".concat(h,".rejectDialog.title"),"Reject Learning"):g("".concat(h,".approveDialog.title"),"Approve Learning"))})),n("button",e({onClick:v,onMouseEnter:function(){return I(!0)},onMouseLeave:function(){return I(!1)},style:e(e({},f.closeButton),{color:W?"#4B5563":"#9CA3AF"})},{children:n(u,{size:24})}))]})),o(c,e({sx:f.dialogContent},{children:[o(l,e({sx:f.description},{children:[!$.includes("{variant_name}")&&o(t,{children:[n("span",e({style:f.descriptionStrong},{children:k}))," "]}),$.split("{variant_name}").map(function(t,i,a){return o(r.Fragment,{children:[t,i<a.length-1&&n("span",e({style:f.descriptionStrong},{children:k}))]},i)})]})),S.length>0&&n("div",{children:S.map(function(t,r){return o("div",e({style:f.variantCard},{children:[o("div",e({style:f.variantCardTitle},{children:[F,S.length>1?" — Variant ".concat(r+1):""]})),t.description&&n("div",e({style:f.variantCardDescription},{children:t.description})),o("div",e({style:f.variantCardMono},{children:[t.whenToApply&&o("div",{children:["WTA — ",t.whenToApply]}),t.whenNotToApply&&o("div",{children:["WNTA — ",t.whenNotToApply]})]}))]}),t.variantId)})}),n(l,e({sx:f.secondaryDescription},{children:U?"":g("".concat(h,".approveDialog.footer"),"Take a moment to check the configuration before moving forward.")})),U&&o("div",e({style:f.rejectSection},{children:[o("div",{children:[n("label",e({htmlFor:"feedback",style:f.feedbackLabel},{children:g("".concat(h,".rejectDialog.feedbackTitle"),"Feedback")})),n("textarea",{id:"feedback",rows:4,value:T,onChange:function(e){return B(e.target.value)},onFocus:function(){return _(!0)},onBlur:function(){return _(!1)},placeholder:"".concat(g("".concat(h,".rejectDialog.feedbackPlaceholder"),"Add feedback or reason for rejection")),style:e(e({},f.textarea),{borderColor:P?"#EF4444":"#E2E8F0",boxShadow:P?"0 0 0 2px rgba(239, 68, 68, 0.2)":"none"})})]}),o("label",e({style:f.checkboxLabel,onMouseEnter:function(){return V(!0)},onMouseLeave:function(){return V(!1)}},{children:[n("input",{type:"checkbox",checked:z,disabled:!1,onChange:function(e){return A(e.target.checked)},style:f.checkbox}),n("div",e({style:f.checkboxTextWrap},{children:n("span",e({style:e(e({},f.checkboxText),{color:N?"#0F172A":"#1E293B"})},{children:g("".concat(h,".rejectDialog.deleteCheckboxLabel"),"Also delete this learning")}))}))]}))]}))]})),o(d,e({sx:f.actions},{children:[n("button",e({onClick:Z,type:"button",disabled:j,onMouseEnter:function(){return G(!0)},onMouseLeave:function(){return G(!1)},style:e(e({},f.secondaryButton),{backgroundColor:q&&!j?"#F8FAFC":"#FFFFFF",borderColor:q&&!j?"#CBD5E1":"#E2E8F0",opacity:j?.5:1,cursor:j?"not-allowed":"pointer"})},{children:g("".concat(h,".approveDialog.cancel"),"Cancel")})),o("button",U?e({onClick:X,type:"button",disabled:j,onMouseEnter:function(){return O(!0)},onMouseLeave:function(){return O(!1)},style:e(e({},f.primaryButton),{backgroundColor:j?"#EF4444":K?"#DC2626":"#EF4444",opacity:j?.7:1,cursor:j?"not-allowed":"pointer"})},{children:[j?n(m,{size:16,style:{animation:"spin 1s linear infinite"}}):n(p,{sx:f.actionIcon}),j?g("".concat(h,".rejectDialog.loadingText"),"Processing..."):g("".concat(h,".rejectDialog.rejectLearning"),"Reject Learning")]}):e({onClick:X,type:"button",disabled:j,onMouseEnter:function(){return O(!0)},onMouseLeave:function(){return O(!1)},style:e(e({},f.primaryButton),{backgroundColor:j?"#22C55E":K?"#16A34A":"#22C55E",opacity:j?.7:1,cursor:j?"not-allowed":"pointer"})},{children:[j?n(m,{size:16,style:{animation:"spin 1s linear infinite"}}):n(s,{sx:f.actionIcon}),j?g("".concat(h,".approveDialog.loadingText"),"Processing..."):g("".concat(h,".approveDialog.approveLearning"),"Approve Learning")]}))]})),n("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}))};export{b as default};
2
2
  //# sourceMappingURL=ApprovalLearningDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalLearningDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/RuleContent/ApprovalLearningDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,UAAU,2BAA2B;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAuJD,QAAA,MAAM,sBAAsB,kGASzB,2BAA2B,sBA2N7B,CAAA;AACD,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"ApprovalLearningDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/features/LearningManagement/RuleContent/ApprovalLearningDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,UAAU,2BAA2B;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAuJD,QAAA,MAAM,sBAAsB,kGASzB,2BAA2B,sBAuO7B,CAAA;AACD,eAAe,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/instant-learning",
3
- "version": "1.3.0-alpha.61",
3
+ "version": "1.3.0-alpha.62",
4
4
  "author": "Devesh Patel",
5
5
  "description": "",
6
6
  "license": "MIT",