@sage-rsc/talking-head-react 1.0.53 → 1.0.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-rsc/talking-head-react",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "A reusable React component for 3D talking avatars with lip-sync and text-to-speech",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -459,11 +459,18 @@ const CurriculumLearning = forwardRef(({
459
459
  stateRef.current.score = 0;
460
460
  stateRef.current.totalQuestions = 0;
461
461
 
462
+ // Check if there's a next lesson available after this one
463
+ const currentModuleAfterMove = curriculum.modules[stateRef.current.currentModuleIndex];
464
+ const hasNextLessonInModuleAfterMove = stateRef.current.currentLessonIndex < (currentModuleAfterMove?.lessons?.length || 0) - 1;
465
+ const hasNextModuleAfterMove = stateRef.current.currentModuleIndex < (curriculum.modules?.length || 0) - 1;
466
+ const hasNextLessonAfterMove = hasNextLessonInModuleAfterMove || hasNextModuleAfterMove;
467
+
462
468
  // Clear current question in UI and notify parent
463
469
  callbacksRef.current.onCustomAction({
464
470
  type: 'lessonStart',
465
471
  moduleIndex: stateRef.current.currentModuleIndex,
466
- lessonIndex: stateRef.current.currentLessonIndex
472
+ lessonIndex: stateRef.current.currentLessonIndex,
473
+ hasNextLesson: hasNextLessonAfterMove
467
474
  });
468
475
 
469
476
  // Notify parent that lesson has changed - parent decides when to start teaching
@@ -492,11 +499,18 @@ const CurriculumLearning = forwardRef(({
492
499
  stateRef.current.score = 0;
493
500
  stateRef.current.totalQuestions = 0;
494
501
 
502
+ // Check if there's a next lesson available after this one
503
+ const currentModuleAfterMove = curriculum.modules[stateRef.current.currentModuleIndex];
504
+ const hasNextLessonInModuleAfterMove = stateRef.current.currentLessonIndex < (currentModuleAfterMove?.lessons?.length || 0) - 1;
505
+ const hasNextModuleAfterMove = stateRef.current.currentModuleIndex < (curriculum.modules?.length || 0) - 1;
506
+ const hasNextLessonAfterMove = hasNextLessonInModuleAfterMove || hasNextModuleAfterMove;
507
+
495
508
  // Clear current question in UI and notify parent
496
509
  callbacksRef.current.onCustomAction({
497
510
  type: 'lessonStart',
498
511
  moduleIndex: stateRef.current.currentModuleIndex,
499
- lessonIndex: stateRef.current.currentLessonIndex
512
+ lessonIndex: stateRef.current.currentLessonIndex,
513
+ hasNextLesson: hasNextLessonAfterMove
500
514
  });
501
515
 
502
516
  // Notify parent that lesson has changed - parent decides when to start teaching