Refactored modules and updated loader.

This commit is contained in:
2025-04-06 18:35:04 +00:00
parent fc693ae695
commit 0ab639fd25
37 changed files with 3530 additions and 5989 deletions
+7 -15
View File
@@ -6,7 +6,10 @@ import { TTSHandlerModule } from './tts-handler-module.js';
export class KokoroTTSModule extends TTSHandlerModule {
constructor() {
super('kokoro', 'Kokoro TTS');
super('kokoro-tts', 'Kokoro TTS');
// Declare proper dependencies according to architecture principles
this.dependencies = ['persistence-manager', 'localization'];
// State
this.iframe = null;
@@ -641,17 +644,6 @@ export class KokoroTTSModule extends TTSHandlerModule {
}
}
// Register the module with the module registry
// Module registry MUST be accessed via window, not direct import
if (window.moduleRegistry) {
try {
// Create instance first, then register it
const kokoroTTSModule = new KokoroTTSModule();
window.moduleRegistry.register(kokoroTTSModule);
console.log('Kokoro TTS Module registered successfully');
} catch (err) {
console.error('Failed to register Kokoro TTS Module:', err);
}
} else {
console.error('Module registry not available when attempting to register Kokoro TTS Module');
}
const kokoroTTSModule = new KokoroTTSModule();
export { kokoroTTSModule };