@iblai/iblai-js 1.18.2 → 1.19.0
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.
|
@@ -192732,7 +192732,7 @@ function AnalyticsCourseDetail({ tenantKey, mentorId, selectedMentorId, courseId
|
|
|
192732
192732
|
mentorId: currentMentorId,
|
|
192733
192733
|
courseId,
|
|
192734
192734
|
});
|
|
192735
|
-
return (jsxs("div", { className: "space-y-8", children: [onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, className: "mb-4", "aria-label": "Go back to courses list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Courses"] })), courseName && (jsx("div", { className: "mb-4", children: jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: courseName }) })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Enrollments", value: courseDetailStats.active_enrollments, percentage: courseDetailStats.active_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Completed Enrollments", value: courseDetailStats.completed_enrollments, percentage: courseDetailStats.completed_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Time Spent", value: formatTimeSpent$1(courseDetailStats.time_spent), percentage: courseDetailStats.time_spent_percentage })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Course enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), ((_a = courseEnrollments === null || courseEnrollments === void 0 ? void 0 : courseEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) && courseEnrollments.enrollments.length > 0 ? (jsx("div", { className: "overflow-x-auto", children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Time Spent" }), jsx(TableHead, { className: "text-right", children: "Progress" }), jsx(TableHead, { className: "text-right", children: "Grade" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: courseEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: formatTimeSpent$1(enrollment.time_spent) }), jsxs(TableCell, { className: "text-right", children: [enrollment.progress, "%"] }), jsx(TableCell, { className: "text-right", children: typeof enrollment.grade === 'number'
|
|
192735
|
+
return (jsxs("div", { className: "space-y-8", children: [onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, className: "mb-4", "aria-label": "Go back to courses list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Courses"] })), courseName && (jsx("div", { className: "mb-4", children: jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: courseName }) })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Enrollments", value: courseDetailStats.active_enrollments, percentage: courseDetailStats.active_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Completed Enrollments", value: courseDetailStats.completed_enrollments, percentage: courseDetailStats.completed_enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Time Spent", value: formatTimeSpent$1(courseDetailStats.time_spent), percentage: courseDetailStats.time_spent_percentage })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Course enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), ((_a = courseEnrollments === null || courseEnrollments === void 0 ? void 0 : courseEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) && courseEnrollments.enrollments.length > 0 ? (jsx("div", { className: "rounded-md overflow-x-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Time Spent" }), jsx(TableHead, { className: "text-right", children: "Progress" }), jsx(TableHead, { className: "text-right", children: "Grade" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: courseEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { className: `h-[48px] ${index % 2 === 0 ? 'bg-gray-50' : ''}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: formatTimeSpent$1(enrollment.time_spent) }), jsxs(TableCell, { className: "text-right", children: [enrollment.progress, "%"] }), jsx(TableCell, { className: "text-right", children: typeof enrollment.grade === 'number'
|
|
192736
192736
|
? enrollment.grade.toFixed(1)
|
|
192737
192737
|
: enrollment.grade }), jsx(TableCell, { className: "text-right", children: new Date(enrollment.last_active_on).toLocaleDateString() })] }, index))) })] }) })) : (jsx(EmptyStats, { title: "No enrollments available" }))] }) }) })] }));
|
|
192738
192738
|
}
|
|
@@ -193021,7 +193021,7 @@ function AnalyticsProgramDetail({ tenantKey, mentorId, selectedMentorId, program
|
|
|
193021
193021
|
programId,
|
|
193022
193022
|
});
|
|
193023
193023
|
return (jsxs("div", { className: "space-y-8", children: [onBack && (jsxs(Button$1, { variant: "ghost", onClick: onBack, className: "mb-4", "aria-label": "Go back to programs list", children: [jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }), "Back to Programs"] })), programName && (jsx("div", { className: "mb-4", children: jsx("h2", { className: "text-2xl font-semibold text-gray-900", children: programName }) })), jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { loading: isLoading, title: "Active Users", value: programDetailStats.active_users, percentage: programDetailStats.active_users_percentage }), jsx(StatCard, { loading: isLoading, title: "Enrollments", value: programDetailStats.enrollments, percentage: programDetailStats.enrollments_percentage }), jsx(StatCard, { loading: isLoading, title: "Time Spent", value: formatTimeSpent(programDetailStats.time_spent) })] }), jsx("div", { className: "grid grid-cols-1 gap-6", children: jsx(Card, { className: "w-full bg-white shadow-xs", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Program enrollments table", children: [jsx("h3", { className: "text-base font-medium text-gray-700 mb-4", children: "Enrolled Users" }), ((_a = programEnrollments === null || programEnrollments === void 0 ? void 0 : programEnrollments.enrollments) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
193024
|
-
programEnrollments.enrollments.length > 0 ? (jsx("div", { className: "overflow-x-auto", children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Time Spent" }), jsx(TableHead, { className: "text-right", children: "Progress" }), jsx(TableHead, { className: "text-right", children: "Grade" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: programEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: formatTimeSpent(enrollment.time_spent) }), jsxs(TableCell, { className: "text-right", children: [enrollment.progress, "%"] }), jsx(TableCell, { className: "text-right", children: typeof enrollment.grade === 'number'
|
|
193024
|
+
programEnrollments.enrollments.length > 0 ? (jsx("div", { className: "rounded-md overflow-x-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "text-left", children: "Name" }), jsx(TableHead, { className: "text-left", children: "Email" }), jsx(TableHead, { className: "text-right", children: "Time Spent" }), jsx(TableHead, { className: "text-right", children: "Progress" }), jsx(TableHead, { className: "text-right", children: "Grade" }), jsx(TableHead, { className: "text-right", children: "Last Active On" })] }) }), jsx(TableBody, { children: programEnrollments.enrollments.map((enrollment, index) => (jsxs(TableRow, { className: `h-[48px] ${index % 2 === 0 ? 'bg-gray-50' : ''}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: enrollment.name }), jsx(TableCell, { className: "text-muted-foreground", children: enrollment.email }), jsx(TableCell, { className: "text-right", children: formatTimeSpent(enrollment.time_spent) }), jsxs(TableCell, { className: "text-right", children: [enrollment.progress, "%"] }), jsx(TableCell, { className: "text-right", children: typeof enrollment.grade === 'number'
|
|
193025
193025
|
? enrollment.grade.toFixed(1)
|
|
193026
193026
|
: enrollment.grade }), jsx(TableCell, { className: "text-right", children: new Date(enrollment.last_active_on).toLocaleDateString() })] }, index))) })] }) })) : (jsx(EmptyStats, { title: "No enrollments available" }))] }) }) })] }));
|
|
193027
193027
|
}
|
|
@@ -193459,7 +193459,7 @@ function AnalyticsAuditLogStats({ tenantKey, mentorId, userId, selectedMentorId,
|
|
|
193459
193459
|
if (is403) {
|
|
193460
193460
|
return (jsx(Card, { className: "bg-white rounded-lg border border-gray-100 shadow-sm", children: jsx(CardContent, { className: "p-8 text-center", children: jsx("p", { className: "text-gray-500", children: "You do not have permission to view audit logs." }) }) }));
|
|
193461
193461
|
}
|
|
193462
|
-
return (jsxs("div", { className: "space-y-6", children: [jsx("div", { className: "border rounded-lg p-4 bg-white", children: jsxs("div", { className: "flex flex-col lg:flex-row gap-3", children: [jsx("div", { className: "relative flex-1 min-w-[200px]", children: jsxs(Popover, { open: actorOpen, onOpenChange: setActorOpen, children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", role: "combobox", "aria-expanded": actorOpen, "aria-label": "Search for User", className: "w-full justify-between font-normal bg-white h-9", children: [actorFilter || 'Search for User', jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), jsx(PopoverContent, { className: "w-full p-0", align: "start", portalled: false, children: jsxs(Command, { children: [jsx(CommandInput, { placeholder: "Search user..." }), jsxs(CommandList, { children: [jsx(CommandEmpty, { children: "No users found." }), jsxs(CommandGroup, { children: [jsxs(CommandItem, { value: "", onSelect: () => {
|
|
193462
|
+
return (jsxs("div", { className: "space-y-6", children: [jsx("div", { className: "border border-[oklch(0.922_0_0)] rounded-lg p-4 bg-white", children: jsxs("div", { className: "flex flex-col lg:flex-row gap-3", children: [jsx("div", { className: "relative flex-1 min-w-[200px]", children: jsxs(Popover, { open: actorOpen, onOpenChange: setActorOpen, children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", role: "combobox", "aria-expanded": actorOpen, "aria-label": "Search for User", className: "w-full justify-between font-normal bg-white h-9", children: [actorFilter || 'Search for User', jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })] }) }), jsx(PopoverContent, { className: "w-full p-0", align: "start", portalled: false, children: jsxs(Command, { children: [jsx(CommandInput, { placeholder: "Search user..." }), jsxs(CommandList, { children: [jsx(CommandEmpty, { children: "No users found." }), jsxs(CommandGroup, { children: [jsxs(CommandItem, { value: "", onSelect: () => {
|
|
193463
193463
|
setActorFilter('');
|
|
193464
193464
|
setActorOpen(false);
|
|
193465
193465
|
setPage(1);
|
|
@@ -193475,7 +193475,7 @@ function AnalyticsAuditLogStats({ tenantKey, mentorId, userId, selectedMentorId,
|
|
|
193475
193475
|
}, numberOfMonths: 2 }) })] }), jsx("div", { className: "min-w-[160px]", children: jsxs(Select$1, { value: actionFilter !== undefined ? String(actionFilter) : 'all', onValueChange: (val) => {
|
|
193476
193476
|
setActionFilter(val === 'all' ? undefined : Number(val));
|
|
193477
193477
|
setPage(1);
|
|
193478
|
-
}, children: [jsx(SelectTrigger, { className: "w-full font-normal bg-white h-9", children: jsx(SelectValue, { placeholder: "All Actions" }) }), jsx(SelectContent, { children: ACTION_FILTER_OPTIONS.map((opt) => (jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value))) })] }) })] }) }), jsx("div", { className: "overflow-hidden rounded-md border bg-white", children: jsx("div", { className: "overflow-x-auto", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isLoading ? (jsx("div", { className: "flex items-center justify-center w-full py-10", children: jsx("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-blue-600 border-t-transparent" }) })) : error && !is403 ? (jsx("div", { className: "py-8 text-center text-[#646464]", children: "An error occurred while loading audit logs." })) : !((_a = data === null || data === void 0 ? void 0 : data.results) === null || _a === void 0 ? void 0 : _a.length) ? (jsx("div", { className: "h-[120px]", children: jsx(EmptyStats, { title: "No audit log entries found for this tenant." }) })) : (jsxs(Table, { className: "min-w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: "USER" }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: "ACTION" }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: "TIME" })] }) }), jsx(TableBody, { children: data.results.map((entry) => (jsxs(TableRow, { className: "border-b last:border-0", children: [jsx(TableCell, { className: "p-3 font-medium whitespace-nowrap text-[#646464]", children: entry.actor_email }), jsx(TableCell, { className: "min-w-[250px] p-3 text-[#646464]", children: summarizeChanges(entry) }), jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: formatDistanceToNow(new Date(entry.timestamp), { addSuffix: true }) })] }, entry.id))) })] })) }) }) }), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isLoading })] }));
|
|
193478
|
+
}, children: [jsx(SelectTrigger, { className: "w-full font-normal bg-white h-9", children: jsx(SelectValue, { placeholder: "All Actions" }) }), jsx(SelectContent, { children: ACTION_FILTER_OPTIONS.map((opt) => (jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value))) })] }) })] }) }), jsx("div", { className: "overflow-hidden rounded-md border border-[oklch(0.922_0_0)] bg-white", children: jsx("div", { className: "overflow-x-auto", children: jsx("div", { className: "inline-block min-w-full align-middle", children: isLoading ? (jsx("div", { className: "flex items-center justify-center w-full py-10", children: jsx("div", { className: "h-6 w-6 animate-spin rounded-full border-2 border-blue-600 border-t-transparent" }) })) : error && !is403 ? (jsx("div", { className: "py-8 text-center text-[#646464]", children: "An error occurred while loading audit logs." })) : !((_a = data === null || data === void 0 ? void 0 : data.results) === null || _a === void 0 ? void 0 : _a.length) ? (jsx("div", { className: "h-[120px]", children: jsx(EmptyStats, { title: "No audit log entries found for this tenant." }) })) : (jsxs(Table, { className: "min-w-full", children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "bg-muted/50 border-b border-[oklch(0.922_0_0)]", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: "USER" }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: "ACTION" }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: "TIME" })] }) }), jsx(TableBody, { children: data.results.map((entry) => (jsxs(TableRow, { className: "border-b border-[oklch(0.922_0_0)] last:border-0", children: [jsx(TableCell, { className: "p-3 font-medium whitespace-nowrap text-[#646464]", children: entry.actor_email }), jsx(TableCell, { className: "min-w-[250px] p-3 text-[#646464]", children: summarizeChanges(entry) }), jsx(TableCell, { className: "p-3 whitespace-nowrap text-[#646464]", children: formatDistanceToNow(new Date(entry.timestamp), { addSuffix: true }) })] }, entry.id))) })] })) }) }) }), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isLoading })] }));
|
|
193479
193479
|
}
|
|
193480
193480
|
|
|
193481
193481
|
const SkeletonMultiplier = ({ Skeleton, multiplier }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iblai/iblai-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"axios": "1.13.6",
|
|
67
67
|
"dotenv": "16.6.1",
|
|
68
68
|
"winston": "3.19.0",
|
|
69
|
-
"@iblai/mcp": "1.
|
|
69
|
+
"@iblai/mcp": "1.7.0",
|
|
70
70
|
"@iblai/web-containers": "1.9.2",
|
|
71
|
-
"@iblai/web-utils": "1.
|
|
71
|
+
"@iblai/web-utils": "1.11.0",
|
|
72
72
|
"@iblai/data-layer": "1.8.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|