@e-llm-studio/instant-learning 1.3.0-alpha.83 → 1.3.0-alpha.84
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/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.js +1 -1
- package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),r=require("@mui/material"),t=require("lucide-react"),o=require("@e-llm-studio/citation"),s=function(n){var t=n.data,o=n.isSelected,s=n.onClick,a=function(e){var i=String(null!=e?e:"").match(/(\d+(?:\.\d+)?)\s*%/);if(!i)return{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"};var n=parseFloat(i[1]);return n<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:n<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}}(t.similarityScoreText);return i.jsxs(r.Box,e.__assign({id:"variant-card-".concat(t.id),onClick:s,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[i.jsx(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?i.jsx(r.Skeleton,{variant:"rounded",width:80,height:20}):i.jsx(r.Box,e.__assign({sx:{bgcolor:a.bg,color:a.text,fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid ".concat(a.border),textTransform:"capitalize"}},{children:t.similarityScoreText||"0% Similarity"}))})),i.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:i.jsxs(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[t.isLoading?i.jsx(r.Skeleton,{width:"90%"}):i.jsx(r.Typography,e.__assign({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&i.jsx(r.Box,e.__assign({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]}))}))]}))},a=function(e){if(null==e||""===e)return null;var i=parseFloat(String(e));if(isNaN(i))return null;var n=i<=1?100*i:i;return n<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:n<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}};exports.default=function(l){var c=l.variants,x=void 0===c?[]:c,d=l.onSelectVariant,g=l.onSkip,p=l.onBack,u=l.targetVariantId,f=n.useState(u||null),h=f[0],F=f[1],b=n.useRef(null);n.useEffect(function(){u&&F(u)},[u]);var m=function(e){b.current&&b.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};console.log("formatedData",x);var _=n.useMemo(function(){if(h){var e=String(h).trim();return x.find(function(i){return i.id&&String(i.id).trim()===e})||x[0]}return x.length>0?x[0]:null},[h,x]);n.useEffect(function(){if(h&&b.current){var e=h.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),n=b.current;if(i&&n){var r=i.offsetLeft-n.offsetLeft-n.clientWidth/2+i.clientWidth/2;n.scrollTo({left:r,behavior:"smooth"})}},150)}},[h,x]);n.useEffect(function(){!h&&!u&&x.length>0&&!x[0].isLoading&&F(x[0].id)},[x,h,u]);var v=n.useState(!1),y=v[0],B=v[1],j=n.useState(!1),E=j[0],S=j[1];n.useEffect(function(){var e=b.current;if(e){var i=function(){B(e.scrollLeft>0),S(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return i(),e.addEventListener("scroll",i),window.addEventListener("resize",i),function(){e.removeEventListener("scroll",i),window.removeEventListener("resize",i)}}},[x]);var C=n.useMemo(function(){return e.__spreadArray([],x,!0).sort(function(e,i){var n=function(e){var i=null==e?void 0:e.match(/(\d+(\.\d+)?)\s*%/);return i?parseFloat(i[1]):-1};return n(i.similarityScoreText)-n(e.similarityScoreText)})},[x]),w=(null==_?void 0:_.intentTreeData)||null,k=(null==_?void 0:_.behaviorTreeData)||null;return i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[i.jsxs(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(r.IconButton,e.__assign({onClick:p,size:"small"},{children:i.jsx(t.ArrowLeft,{})})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),i.jsx(r.IconButton,e.__assign({onClick:g,size:"small"},{children:i.jsx(r.Box,e.__assign({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),i.jsx(r.Box,e.__assign({sx:{bgcolor:"#F6F7F9B2"}},{children:x.length>0&&i.jsxs(r.Box,e.__assign({sx:{pb:2}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i.jsxs(r.Box,e.__assign({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[i.jsx(r.IconButton,e.__assign({onClick:function(){return m("left")},size:"small",disabled:!y},{children:i.jsx(t.ArrowLeft,{size:18})})),i.jsx(r.IconButton,e.__assign({onClick:function(){return m("right")},size:"small",disabled:!E},{children:i.jsx(t.ArrowRight,{size:18})}))]}))]})),i.jsx(r.Box,e.__assign({ref:b,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:C.map(function(e){return i.jsx(s,{data:e,isSelected:(null==_?void 0:_.id)===e.id,onClick:function(){return F((i=e).id),void d(i);var i}},e.id)})}))]}))})),i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:3,margin:3,overflowY:"auto",backgroundColor:"#fff","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"}}},{children:[w&&i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),i.jsx(o.CognitiveCompare,{treeData:w,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1,expandLevels:1,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),r=require("@mui/material"),t=require("lucide-react"),o=require("@e-llm-studio/citation"),s=function(n){var t=n.data,o=n.isSelected,s=n.onClick,a=function(e){var i=String(null!=e?e:"").match(/(\d+(?:\.\d+)?)\s*%/);if(!i)return{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"};var n=parseFloat(i[1]);return n<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:n<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}}(t.similarityScoreText);return i.jsxs(r.Box,e.__assign({id:"variant-card-".concat(t.id),onClick:s,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:t.isLoading?.7:1,border:o?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[i.jsx(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:t.isLoading?i.jsx(r.Skeleton,{variant:"rounded",width:80,height:20}):i.jsx(r.Box,e.__assign({sx:{bgcolor:a.bg,color:a.text,fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid ".concat(a.border),textTransform:"capitalize"}},{children:t.similarityScoreText||"0% Similarity"}))})),i.jsx(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:1}},{children:i.jsxs(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[t.isLoading?i.jsx(r.Skeleton,{width:"90%"}):i.jsx(r.Typography,e.__assign({title:t.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:t.title})),t.scope&&i.jsx(r.Box,e.__assign({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:t.scope}))]}))}))]}))},a=function(e){if(null==e||""===e)return null;var i=parseFloat(String(e));if(isNaN(i))return null;var n=i<=1?100*i:i;return n<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:n<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}};exports.default=function(l){var c=l.variants,x=void 0===c?[]:c,d=l.onSelectVariant,g=l.onSkip,p=l.onBack,u=l.targetVariantId,f=n.useState(u||null),h=f[0],F=f[1],b=n.useRef(null);n.useEffect(function(){u&&F(u)},[u]);var m=function(e){b.current&&b.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};console.log("formatedData",x);var _=n.useMemo(function(){if(h){var e=String(h).trim();return x.find(function(i){return i.id&&String(i.id).trim()===e})||x[0]}return x.length>0?x[0]:null},[h,x]);n.useEffect(function(){if(h&&b.current){var e=h.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),n=b.current;if(i&&n){var r=i.offsetLeft-n.offsetLeft-n.clientWidth/2+i.clientWidth/2;n.scrollTo({left:r,behavior:"smooth"})}},150)}},[h,x]);n.useEffect(function(){!h&&!u&&x.length>0&&!x[0].isLoading&&F(x[0].id)},[x,h,u]);var v=n.useState(!1),y=v[0],B=v[1],j=n.useState(!1),E=j[0],S=j[1];n.useEffect(function(){var e=b.current;if(e){var i=function(){B(e.scrollLeft>0),S(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return i(),e.addEventListener("scroll",i),window.addEventListener("resize",i),function(){e.removeEventListener("scroll",i),window.removeEventListener("resize",i)}}},[x]);var C=n.useMemo(function(){return e.__spreadArray([],x,!0).sort(function(e,i){var n=function(e){var i=null==e?void 0:e.match(/(\d+(\.\d+)?)\s*%/);return i?parseFloat(i[1]):-1};return n(i.similarityScoreText)-n(e.similarityScoreText)})},[x]),w=(null==_?void 0:_.intentTreeData)||null,k=(null==_?void 0:_.behaviorTreeData)||null;return i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[i.jsxs(r.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:[i.jsx(r.IconButton,e.__assign({onClick:p,size:"small"},{children:i.jsx(t.ArrowLeft,{})})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),i.jsx(r.IconButton,e.__assign({onClick:g,size:"small"},{children:i.jsx(r.Box,e.__assign({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),i.jsx(r.Box,e.__assign({sx:{bgcolor:"#F6F7F9B2"}},{children:x.length>0&&i.jsxs(r.Box,e.__assign({sx:{pb:2}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),i.jsxs(r.Box,e.__assign({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[i.jsx(r.IconButton,e.__assign({onClick:function(){return m("left")},size:"small",disabled:!y},{children:i.jsx(t.ArrowLeft,{size:18})})),i.jsx(r.IconButton,e.__assign({onClick:function(){return m("right")},size:"small",disabled:!E},{children:i.jsx(t.ArrowRight,{size:18})}))]}))]})),i.jsx(r.Box,e.__assign({ref:b,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:C.map(function(e){return i.jsx(s,{data:e,isSelected:(null==_?void 0:_.id)===e.id,onClick:function(){return F((i=e).id),void d(i);var i}},e.id)})}))]}))})),i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",gap:3,margin:3,overflowY:"auto",backgroundColor:"#fff","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"}}},{children:[w&&i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),i.jsx(o.CognitiveCompare,{treeData:w,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1,expandLevels:1,enableDeviationSchemaBackwardCompatibility:!1},badgeStyleOverride:a},"intent-".concat(null==_?void 0:_.id))]})),k&&i.jsxs(r.Box,e.__assign({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[i.jsxs(r.Box,e.__assign({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[i.jsx(r.Typography,e.__assign({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning behavior matching?"})),i.jsx(r.Typography,e.__assign({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the variant you are trying to add is similar, overlapping or conflicting with the existing variant."}))]})),i.jsx(o.CognitiveCompare,{treeData:k,componentHeaderText:"Is the learning behavior matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1,expandLevels:2,enableDeviationSchemaBackwardCompatibility:!1},badgeStyleOverride:a},"intent-".concat(null==_?void 0:_.id))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=RuleComparison.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as i}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as l,useMemo as a}from"react";import{Box as c,IconButton as d,Typography as s,Skeleton as x}from"@mui/material";import{ArrowLeft as p,ArrowRight as f}from"lucide-react";import{CognitiveCompare as h}from"@e-llm-studio/citation";var u=function(e){var n=e.data,o=e.isSelected,l=e.onClick,a=function(e){var i=String(null!=e?e:"").match(/(\d+(?:\.\d+)?)\s*%/);if(!i)return{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"};var r=parseFloat(i[1]);return r<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:r<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}}(n.similarityScoreText);return r(c,i({id:"variant-card-".concat(n.id),onClick:l,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:n.isLoading?.7:1,border:o?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[t(c,i({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:n.isLoading?t(x,{variant:"rounded",width:80,height:20}):t(c,i({sx:{bgcolor:a.bg,color:a.text,fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid ".concat(a.border),textTransform:"capitalize"}},{children:n.similarityScoreText||"0% Similarity"}))})),t(c,i({sx:{display:"flex",flexDirection:"column",gap:1}},{children:r(c,i({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[n.isLoading?t(x,{width:"90%"}):t(s,i({title:n.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:n.title})),n.scope&&t(c,i({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:n.scope}))]}))}))]}))},g=function(e){if(null==e||""===e)return null;var i=parseFloat(String(e));if(isNaN(i))return null;var r=i<=1?100*i:i;return r<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:r<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}},F=function(x){var F=x.variants,m=void 0===F?[]:F,b=x.onSelectVariant,v=x.onSkip,y=x.onBack,E=x.targetVariantId,S=n(E||null),C=S[0],w=S[1],k=o(null);l(function(){E&&w(E)},[E]);var D=function(e){k.current&&k.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};console.log("formatedData",m);var B=a(function(){if(C){var e=String(C).trim();return m.find(function(i){return i.id&&String(i.id).trim()===e})||m[0]}return m.length>0?m[0]:null},[C,m]);l(function(){if(C&&k.current){var e=C.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),r=k.current;if(i&&r){var t=i.offsetLeft-r.offsetLeft-r.clientWidth/2+i.clientWidth/2;r.scrollTo({left:t,behavior:"smooth"})}},150)}},[C,m]);l(function(){!C&&!E&&m.length>0&&!m[0].isLoading&&w(m[0].id)},[m,C,E]);var z=n(!1),L=z[0],A=z[1],T=n(!1),W=T[0],I=T[1];l(function(){var e=k.current;if(e){var i=function(){A(e.scrollLeft>0),I(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return i(),e.addEventListener("scroll",i),window.addEventListener("resize",i),function(){e.removeEventListener("scroll",i),window.removeEventListener("resize",i)}}},[m]);var R=a(function(){return e([],m,!0).sort(function(e,i){var r=function(e){var i=null==e?void 0:e.match(/(\d+(\.\d+)?)\s*%/);return i?parseFloat(i[1]):-1};return r(i.similarityScoreText)-r(e.similarityScoreText)})},[m]),H=(null==B?void 0:B.intentTreeData)||null,V=(null==B?void 0:B.behaviorTreeData)||null;return r(c,i({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[r(c,i({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[r(c,i({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(d,i({onClick:y,size:"small"},{children:t(p,{})})),t(s,i({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),t(d,i({onClick:v,size:"small"},{children:t(c,i({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),t(c,i({sx:{bgcolor:"#F6F7F9B2"}},{children:m.length>0&&r(c,i({sx:{pb:2}},{children:[r(c,i({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[t(s,i({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),r(c,i({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[t(d,i({onClick:function(){return D("left")},size:"small",disabled:!L},{children:t(p,{size:18})})),t(d,i({onClick:function(){return D("right")},size:"small",disabled:!W},{children:t(f,{size:18})}))]}))]})),t(c,i({ref:k,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:R.map(function(e){return t(u,{data:e,isSelected:(null==B?void 0:B.id)===e.id,onClick:function(){return w((i=e).id),void b(i);var i}},e.id)})}))]}))})),r(c,i({sx:{display:"flex",flexDirection:"column",gap:3,margin:3,overflowY:"auto",backgroundColor:"#fff","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"}}},{children:[H&&r(c,i({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[r(c,i({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[t(s,i({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),t(s,i({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),t(h,{treeData:H,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1,expandLevels:1,
|
|
1
|
+
import{__spreadArray as e,__assign as i}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as l,useMemo as a}from"react";import{Box as c,IconButton as d,Typography as s,Skeleton as x}from"@mui/material";import{ArrowLeft as p,ArrowRight as f}from"lucide-react";import{CognitiveCompare as h}from"@e-llm-studio/citation";var u=function(e){var n=e.data,o=e.isSelected,l=e.onClick,a=function(e){var i=String(null!=e?e:"").match(/(\d+(?:\.\d+)?)\s*%/);if(!i)return{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"};var r=parseFloat(i[1]);return r<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:r<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}}(n.similarityScoreText);return r(c,i({id:"variant-card-".concat(n.id),onClick:l,sx:{minWidth:"280px",maxWidth:"280px",p:2,m:.5,bgcolor:o?"#EFF6FF99":"#FFFFFF",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s",display:"flex",flexDirection:"column",gap:1,flexShrink:0,opacity:n.isLoading?.7:1,border:o?"1.4px solid #2563EB":"1.4px solid transparent",boxShadow:o?"none":"0px 2px 4px 0px #19213D14","&:hover":{borderColor:o?"#2563EB":"#CBD5E1",boxShadow:o?"none":"0px 4px 8px 0px #19213D1F"}}},{children:[t(c,i({sx:{display:"flex",alignItems:"center",gap:1.5}},{children:n.isLoading?t(x,{variant:"rounded",width:80,height:20}):t(c,i({sx:{bgcolor:a.bg,color:a.text,fontSize:"11px",fontWeight:600,px:1,py:.5,borderRadius:"100px",border:"1px solid ".concat(a.border),textTransform:"capitalize"}},{children:n.similarityScoreText||"0% Similarity"}))})),t(c,i({sx:{display:"flex",flexDirection:"column",gap:1}},{children:r(c,i({sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"nowrap"}},{children:[n.isLoading?t(x,{width:"90%"}):t(s,i({title:n.title,sx:{fontWeight:500,fontSize:"14px",color:"#19213D",lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}},{children:n.title})),n.scope&&t(c,i({sx:{flexShrink:0,fontSize:"10px",fontWeight:600,color:"#19213D",bgcolor:"#FFF",border:"1px solid #EDEFF2",px:.75,py:.25,borderRadius:"6px",lineHeight:1.4,whiteSpace:"nowrap"}},{children:n.scope}))]}))}))]}))},g=function(e){if(null==e||""===e)return null;var i=parseFloat(String(e));if(isNaN(i))return null;var r=i<=1?100*i:i;return r<=34?{bg:"#EFF6FF",text:"#1D4ED8",border:"#BFDBFE"}:r<=75?{bg:"#FFF9EA",text:"#A16207",border:"#F2E5A1"}:{bg:"#FEF2F2",text:"#B91C1C",border:"#FECACA"}},F=function(x){var F=x.variants,m=void 0===F?[]:F,b=x.onSelectVariant,v=x.onSkip,y=x.onBack,E=x.targetVariantId,S=n(E||null),C=S[0],w=S[1],k=o(null);l(function(){E&&w(E)},[E]);var D=function(e){k.current&&k.current.scrollBy({left:"left"===e?-300:300,behavior:"smooth"})};console.log("formatedData",m);var B=a(function(){if(C){var e=String(C).trim();return m.find(function(i){return i.id&&String(i.id).trim()===e})||m[0]}return m.length>0?m[0]:null},[C,m]);l(function(){if(C&&k.current){var e=C.trim();setTimeout(function(){var i=document.getElementById("variant-card-".concat(e)),r=k.current;if(i&&r){var t=i.offsetLeft-r.offsetLeft-r.clientWidth/2+i.clientWidth/2;r.scrollTo({left:t,behavior:"smooth"})}},150)}},[C,m]);l(function(){!C&&!E&&m.length>0&&!m[0].isLoading&&w(m[0].id)},[m,C,E]);var z=n(!1),L=z[0],A=z[1],T=n(!1),W=T[0],I=T[1];l(function(){var e=k.current;if(e){var i=function(){A(e.scrollLeft>0),I(e.scrollLeft+e.clientWidth<e.scrollWidth-1)};return i(),e.addEventListener("scroll",i),window.addEventListener("resize",i),function(){e.removeEventListener("scroll",i),window.removeEventListener("resize",i)}}},[m]);var R=a(function(){return e([],m,!0).sort(function(e,i){var r=function(e){var i=null==e?void 0:e.match(/(\d+(\.\d+)?)\s*%/);return i?parseFloat(i[1]):-1};return r(i.similarityScoreText)-r(e.similarityScoreText)})},[m]),H=(null==B?void 0:B.intentTreeData)||null,V=(null==B?void 0:B.behaviorTreeData)||null;return r(c,i({sx:{display:"flex",flexDirection:"column",height:"100%",bgcolor:"#FFFFFF",fontFamily:'"Plus Jakarta Sans", sans-serif',overflow:"hidden"}},{children:[r(c,i({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF"}},{children:[r(c,i({sx:{display:"flex",alignItems:"center",gap:1}},{children:[t(d,i({onClick:y,size:"small"},{children:t(p,{})})),t(s,i({sx:{fontSize:"16px",fontWeight:450,color:"#0F172A"}},{children:"Learning Comparison"}))]})),t(d,i({onClick:v,size:"small"},{children:t(c,i({sx:{fontSize:24,lineHeight:.5}},{children:"×"}))}))]})),t(c,i({sx:{bgcolor:"#F6F7F9B2"}},{children:m.length>0&&r(c,i({sx:{pb:2}},{children:[r(c,i({sx:{px:3,display:"flex",alignItems:"center",justifyContent:"space-between",py:1}},{children:[t(s,i({sx:{fontSize:"13px",color:"#475569"}},{children:"Choose the Learning you want to compare with the rule you are creating."})),r(c,i({sx:{display:"flex",gap:.5,flexShrink:0,ml:1}},{children:[t(d,i({onClick:function(){return D("left")},size:"small",disabled:!L},{children:t(p,{size:18})})),t(d,i({onClick:function(){return D("right")},size:"small",disabled:!W},{children:t(f,{size:18})}))]}))]})),t(c,i({ref:k,sx:{display:"flex",gap:1,overflowX:"auto",px:3,"&::-webkit-scrollbar":{display:"none"}}},{children:R.map(function(e){return t(u,{data:e,isSelected:(null==B?void 0:B.id)===e.id,onClick:function(){return w((i=e).id),void b(i);var i}},e.id)})}))]}))})),r(c,i({sx:{display:"flex",flexDirection:"column",gap:3,margin:3,overflowY:"auto",backgroundColor:"#fff","&::-webkit-scrollbar":{height:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#CBD5E1",borderRadius:"10px"}}},{children:[H&&r(c,i({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[r(c,i({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[t(s,i({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning's intent matching?"})),t(s,i({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the learning you are creating is same as the existing learning."}))]})),t(h,{treeData:H,componentHeaderText:"Is the learning's intent matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1,expandLevels:1,enableDeviationSchemaBackwardCompatibility:!1},badgeStyleOverride:g},"intent-".concat(null==B?void 0:B.id))]})),V&&r(c,i({sx:{display:"flex",flexDirection:"column",borderRadius:"8px",border:"1px solid #E2E8F0"}},{children:[r(c,i({sx:{px:3,py:1.5,bgcolor:"#F8F9FB",borderBottom:"1px solid #E2E8F0",textAlign:"center"}},{children:[t(s,i({sx:{fontSize:"15px",fontWeight:600,color:"#0F172A",mb:.5}},{children:"Is the learning behavior matching?"})),t(s,i({sx:{fontSize:"13px",color:"#64748B"}},{children:"Checking if the variant you are trying to add is similar, overlapping or conflicting with the existing variant."}))]})),t(h,{treeData:V,componentHeaderText:"Is the learning behavior matching?",displayConfig:{isHeaderVisible:!1,isToggleVisible:!1,maintainRelativeOrder:!1,isLoading:!1,expandLevels:2,enableDeviationSchemaBackwardCompatibility:!1},badgeStyleOverride:g},"intent-".concat(null==B?void 0:B.id))]}))]}))]}))};export{F as default};
|
|
2
2
|
//# sourceMappingURL=RuleComparison.js.map
|
package/dist/types/src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuleComparison.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAKpE,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAkHD,QAAA,MAAM,cAAc,oEAMjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"RuleComparison.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/IL-OTJ/_components/templates/RuleComparison/RuleComparison.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAKpE,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,cAAc,CAAC,EAAE,GAAG,CAAC;IACrB,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAkHD,QAAA,MAAM,cAAc,oEAMjB,mBAAmB,sBAgMrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-llm-studio/instant-learning",
|
|
3
|
-
"version": "1.3.0-alpha.
|
|
3
|
+
"version": "1.3.0-alpha.84",
|
|
4
4
|
"author": "Devesh Patel",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"dependencies": {
|
|
151
151
|
"@craco/craco": "^7.1.0",
|
|
152
152
|
"@e-llm-studio/audit-log": "^2.0.3",
|
|
153
|
-
"@e-llm-studio/citation": "^0.0.
|
|
153
|
+
"@e-llm-studio/citation": "^0.0.212",
|
|
154
154
|
"@e-llm-studio/watch-me-work": "^0.0.25",
|
|
155
155
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
156
156
|
"@react-pdf-viewer/core": "^3.12.0",
|