@defikitdotnet/education-module-ai
Version:
AI Education Module using Agent Framework
96 lines (95 loc) • 4.11 kB
JavaScript
;
/**
* Frontend entry point for the Education Module
* Exports components, hooks, and contexts for use in external systems
*/
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useCourseContent = exports.useCourses = exports.useAuth = void 0;
exports.createEducationModuleConfig = createEducationModuleConfig;
exports.initializeEducationModule = initializeEducationModule;
// ==== Core Exports ====
// Export all models/types
__exportStar(require("./models/index"), exports);
__exportStar(require("./components/H5PEditor"), exports);
// Import hooks and types to re-export
var index_1 = require("./hooks/index");
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return index_1.useAuth; } });
Object.defineProperty(exports, "useCourses", { enumerable: true, get: function () { return index_1.useCourses; } });
Object.defineProperty(exports, "useCourseContent", { enumerable: true, get: function () { return index_1.useCourseContent; } });
// Export context providers for state management
__exportStar(require("./providers/index"), exports);
// ==== Components Exports ====
// Export UI components for building custom interfaces
__exportStar(require("./components/index"), exports);
// Export container components for data fetching and state management
__exportStar(require("./containers/index"), exports);
// ==== Page Components Exports ====
// Export full page components
// These can be directly used in external systems with minimal configuration
__exportStar(require("./pages/index"), exports);
/**
* Helper function to create configuration for the Education Module
* This is useful for maintaining consistent configuration across components
*/
function createEducationModuleConfig(config) {
if (config === void 0) { config = {}; }
return {
apiBaseUrl: config.apiBaseUrl || '/api',
agentId: config.agentId,
theme: config.theme || 'light',
initialUserId: config.initialUserId,
isTeacher: config.isTeacher || false,
isStudent: config.isStudent || false,
};
}
// ==== Convenience Functions ====
/**
* Function to initialize the education module in an external system
* Returns tools for working with the education module
*/
function initializeEducationModule(config) {
if (config === void 0) { config = {}; }
var moduleConfig = createEducationModuleConfig(config);
return {
config: moduleConfig,
version: '1.0.0',
name: 'Education Module',
// Methods to help with common tasks
createTeacherView: function () { return ({
type: 'teacher',
config: __assign(__assign({}, moduleConfig), { isTeacher: true }),
}); },
createStudentView: function () { return ({
type: 'student',
config: __assign(__assign({}, moduleConfig), { isStudent: true }),
}); },
// You can add additional helper methods here
};
}
// Default export for convenience
exports.default = initializeEducationModule;