@lessonkit/react 1.2.0 → 1.3.1

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/index.d.cts CHANGED
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React$1 from 'react';
3
3
  import * as _lessonkit_core from '@lessonkit/core';
4
- import { TelemetryEvent, CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, AssessmentHandle, BlockId, AssessmentBaseProps, AssessmentBehaviour, CompoundHandle, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
4
+ import { TelemetryEvent, CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, StoragePort, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, AssessmentHandle, BlockId, AssessmentBaseProps, AssessmentBehaviour, CompoundHandle, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
5
5
  export { AssessmentAnsweredData, AssessmentBaseProps, AssessmentBehaviour, AssessmentCompletedData, AssessmentHandle, AssessmentInteractionType, AssessmentScoreInput, AssessmentScoreResult, AssessmentXAPIData, CompoundBaseProps, CompoundHandle, CompoundResumeState, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
6
6
  import { McqAssessmentDescriptor } from '@lessonkit/lxpack';
7
+ import * as _lessonkit_xapi from '@lessonkit/xapi';
7
8
  import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
8
9
  import { LxpackBridgeMode } from '@lessonkit/lxpack/bridge';
9
10
  import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
@@ -18,6 +19,8 @@ type LessonkitObservabilityConfig = {
18
19
  onXapiQueueDepth?: (depth: number) => void;
19
20
  /** Oldest xAPI statement dropped because the queue reached max size. */
20
21
  onXapiQueueCap?: () => void;
22
+ /** Telemetry batch buffer dropped an event because the cap (1000) was reached. */
23
+ onTelemetryBufferDrop?: () => void;
21
24
  /** LMS bridge missing for a completion-related telemetry event (`bridge: auto`). */
22
25
  onLxpackBridgeMiss?: (event: TelemetryEvent) => void;
23
26
  };
@@ -35,6 +38,8 @@ type LessonkitConfig = {
35
38
  enabled?: boolean;
36
39
  sink?: (event: Parameters<TrackingClient["track"]>[0]) => void | Promise<void>;
37
40
  batchSink?: (events: Parameters<TrackingClient["track"]>[0][]) => void | Promise<void>;
41
+ /** Keepalive batch delivery for pagehide (e.g. from createFetchBatchSink). */
42
+ exitBatchSink?: (events: Parameters<TrackingClient["track"]>[0][]) => void | Promise<void>;
38
43
  batch?: {
39
44
  enabled?: boolean;
40
45
  flushIntervalMs?: number;
@@ -44,6 +49,8 @@ type LessonkitConfig = {
44
49
  xapi?: {
45
50
  enabled?: boolean;
46
51
  transport?: XAPITransport;
52
+ /** Keepalive transport for pagehide (e.g. from createFetchTransport). */
53
+ exitTransport?: _lessonkit_xapi.XAPIExitTransport;
47
54
  client?: XAPIClient;
48
55
  };
49
56
  lxpack?: {
@@ -69,6 +76,7 @@ type LessonkitRuntime = {
69
76
  tracking: TrackingClient;
70
77
  xapi: XAPIClient | null;
71
78
  progress: ProgressState;
79
+ storage: StoragePort;
72
80
  session: {
73
81
  sessionId: string;
74
82
  attemptId?: string;
@@ -262,6 +270,27 @@ type InteractiveBookProps = {
262
270
  };
263
271
  declare const InteractiveBook: React$1.ForwardRefExoticComponent<InteractiveBookProps & React$1.RefAttributes<CompoundHandle>>;
264
272
 
273
+ type SlideProps = {
274
+ blockId: BlockId;
275
+ title?: string;
276
+ /** When true, slide is used in a deck but hidden until navigated (SlideDeck). */
277
+ hidden?: boolean;
278
+ /** Index within a compound parent (set by SlideDeck). */
279
+ slideIndex?: number;
280
+ /** Compound parent type for telemetry (e.g. SlideDeck). */
281
+ parentType?: string;
282
+ children: React$1.ReactNode;
283
+ };
284
+ declare function Slide(props: SlideProps): react_jsx_runtime.JSX.Element;
285
+
286
+ type SlideDeckProps = {
287
+ blockId: BlockId;
288
+ title: string;
289
+ showDeckScore?: boolean;
290
+ children: React$1.ReactElement<SlideProps> | React$1.ReactElement<SlideProps>[];
291
+ };
292
+ declare const SlideDeck: React$1.ForwardRefExoticComponent<SlideDeckProps & React$1.RefAttributes<CompoundHandle>>;
293
+
265
294
  type AccordionSection = {
266
295
  id: string;
267
296
  title: string;
@@ -676,4 +705,4 @@ type BuildBlockCatalogOptions = {
676
705
  declare function buildBlockCatalog(opts?: BuildBlockCatalogOptions): BlockCatalogEntry[] | BlockCatalogEntryV2[] | BlockCatalogEntryV3[];
677
706
  declare function getBlockCatalogEntry(type: string, opts?: BuildBlockCatalogOptions): BlockCatalogEntry | BlockCatalogEntryV2 | BlockCatalogEntryV3 | undefined;
678
707
 
679
- export { Accordion, type AccordionProps, type AccordionSection, AssessmentSequence, type AssessmentSequenceProps, BLOCK_CATALOG, BLOCK_CATALOG_V2, BLOCK_CATALOG_V3, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockCatalogEntryV3, type BlockPropSpec, Course, type CourseProps, type DialogCard, DialogCards, type DialogCardsProps, DragAndDrop, type DragAndDropProps, type DragItem, DragTheWords, type DragTheWordsProps, type DropTarget, type FillInBlankSpec, FillInTheBlanks, type FillInTheBlanksProps, FindHotspot, type FindHotspotProps, FindMultipleHotspots, type FindMultipleHotspotsProps, type Flashcard, Flashcards, type FlashcardsProps, Heading, type HeadingProps, type HotspotSpec, type HotspotTarget, Image, ImageHotspots, type ImageHotspotsProps, type ImageProps, type ImageSlide, ImageSlider, type ImageSliderProps, InteractiveBook, type InteractiveBookProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, type LessonkitObservabilityConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, MarkTheWords, type MarkTheWordsProps, Page, type PageProps, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, Text, type TextProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, TrueFalse, type TrueFalseProps, blockCatalogV2Version, blockCatalogV3Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetAssessmentWarningsForTests, resetQuizWarningsForTests, useAssessmentState, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
708
+ export { Accordion, type AccordionProps, type AccordionSection, AssessmentSequence, type AssessmentSequenceProps, BLOCK_CATALOG, BLOCK_CATALOG_V2, BLOCK_CATALOG_V3, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockCatalogEntryV3, type BlockPropSpec, Course, type CourseProps, type DialogCard, DialogCards, type DialogCardsProps, DragAndDrop, type DragAndDropProps, type DragItem, DragTheWords, type DragTheWordsProps, type DropTarget, type FillInBlankSpec, FillInTheBlanks, type FillInTheBlanksProps, FindHotspot, type FindHotspotProps, FindMultipleHotspots, type FindMultipleHotspotsProps, type Flashcard, Flashcards, type FlashcardsProps, Heading, type HeadingProps, type HotspotSpec, type HotspotTarget, Image, ImageHotspots, type ImageHotspotsProps, type ImageProps, type ImageSlide, ImageSlider, type ImageSliderProps, InteractiveBook, type InteractiveBookProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, type LessonkitObservabilityConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, MarkTheWords, type MarkTheWordsProps, Page, type PageProps, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, Slide, SlideDeck, type SlideDeckProps, type SlideProps, Text, type TextProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, TrueFalse, type TrueFalseProps, blockCatalogV2Version, blockCatalogV3Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetAssessmentWarningsForTests, resetQuizWarningsForTests, useAssessmentState, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React$1 from 'react';
3
3
  import * as _lessonkit_core from '@lessonkit/core';
4
- import { TelemetryEvent, CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, AssessmentHandle, BlockId, AssessmentBaseProps, AssessmentBehaviour, CompoundHandle, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
4
+ import { TelemetryEvent, CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, StoragePort, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, AssessmentHandle, BlockId, AssessmentBaseProps, AssessmentBehaviour, CompoundHandle, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
5
5
  export { AssessmentAnsweredData, AssessmentBaseProps, AssessmentBehaviour, AssessmentCompletedData, AssessmentHandle, AssessmentInteractionType, AssessmentScoreInput, AssessmentScoreResult, AssessmentXAPIData, CompoundBaseProps, CompoundHandle, CompoundResumeState, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
6
6
  import { McqAssessmentDescriptor } from '@lessonkit/lxpack';
7
+ import * as _lessonkit_xapi from '@lessonkit/xapi';
7
8
  import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
8
9
  import { LxpackBridgeMode } from '@lessonkit/lxpack/bridge';
9
10
  import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
@@ -18,6 +19,8 @@ type LessonkitObservabilityConfig = {
18
19
  onXapiQueueDepth?: (depth: number) => void;
19
20
  /** Oldest xAPI statement dropped because the queue reached max size. */
20
21
  onXapiQueueCap?: () => void;
22
+ /** Telemetry batch buffer dropped an event because the cap (1000) was reached. */
23
+ onTelemetryBufferDrop?: () => void;
21
24
  /** LMS bridge missing for a completion-related telemetry event (`bridge: auto`). */
22
25
  onLxpackBridgeMiss?: (event: TelemetryEvent) => void;
23
26
  };
@@ -35,6 +38,8 @@ type LessonkitConfig = {
35
38
  enabled?: boolean;
36
39
  sink?: (event: Parameters<TrackingClient["track"]>[0]) => void | Promise<void>;
37
40
  batchSink?: (events: Parameters<TrackingClient["track"]>[0][]) => void | Promise<void>;
41
+ /** Keepalive batch delivery for pagehide (e.g. from createFetchBatchSink). */
42
+ exitBatchSink?: (events: Parameters<TrackingClient["track"]>[0][]) => void | Promise<void>;
38
43
  batch?: {
39
44
  enabled?: boolean;
40
45
  flushIntervalMs?: number;
@@ -44,6 +49,8 @@ type LessonkitConfig = {
44
49
  xapi?: {
45
50
  enabled?: boolean;
46
51
  transport?: XAPITransport;
52
+ /** Keepalive transport for pagehide (e.g. from createFetchTransport). */
53
+ exitTransport?: _lessonkit_xapi.XAPIExitTransport;
47
54
  client?: XAPIClient;
48
55
  };
49
56
  lxpack?: {
@@ -69,6 +76,7 @@ type LessonkitRuntime = {
69
76
  tracking: TrackingClient;
70
77
  xapi: XAPIClient | null;
71
78
  progress: ProgressState;
79
+ storage: StoragePort;
72
80
  session: {
73
81
  sessionId: string;
74
82
  attemptId?: string;
@@ -262,6 +270,27 @@ type InteractiveBookProps = {
262
270
  };
263
271
  declare const InteractiveBook: React$1.ForwardRefExoticComponent<InteractiveBookProps & React$1.RefAttributes<CompoundHandle>>;
264
272
 
273
+ type SlideProps = {
274
+ blockId: BlockId;
275
+ title?: string;
276
+ /** When true, slide is used in a deck but hidden until navigated (SlideDeck). */
277
+ hidden?: boolean;
278
+ /** Index within a compound parent (set by SlideDeck). */
279
+ slideIndex?: number;
280
+ /** Compound parent type for telemetry (e.g. SlideDeck). */
281
+ parentType?: string;
282
+ children: React$1.ReactNode;
283
+ };
284
+ declare function Slide(props: SlideProps): react_jsx_runtime.JSX.Element;
285
+
286
+ type SlideDeckProps = {
287
+ blockId: BlockId;
288
+ title: string;
289
+ showDeckScore?: boolean;
290
+ children: React$1.ReactElement<SlideProps> | React$1.ReactElement<SlideProps>[];
291
+ };
292
+ declare const SlideDeck: React$1.ForwardRefExoticComponent<SlideDeckProps & React$1.RefAttributes<CompoundHandle>>;
293
+
265
294
  type AccordionSection = {
266
295
  id: string;
267
296
  title: string;
@@ -676,4 +705,4 @@ type BuildBlockCatalogOptions = {
676
705
  declare function buildBlockCatalog(opts?: BuildBlockCatalogOptions): BlockCatalogEntry[] | BlockCatalogEntryV2[] | BlockCatalogEntryV3[];
677
706
  declare function getBlockCatalogEntry(type: string, opts?: BuildBlockCatalogOptions): BlockCatalogEntry | BlockCatalogEntryV2 | BlockCatalogEntryV3 | undefined;
678
707
 
679
- export { Accordion, type AccordionProps, type AccordionSection, AssessmentSequence, type AssessmentSequenceProps, BLOCK_CATALOG, BLOCK_CATALOG_V2, BLOCK_CATALOG_V3, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockCatalogEntryV3, type BlockPropSpec, Course, type CourseProps, type DialogCard, DialogCards, type DialogCardsProps, DragAndDrop, type DragAndDropProps, type DragItem, DragTheWords, type DragTheWordsProps, type DropTarget, type FillInBlankSpec, FillInTheBlanks, type FillInTheBlanksProps, FindHotspot, type FindHotspotProps, FindMultipleHotspots, type FindMultipleHotspotsProps, type Flashcard, Flashcards, type FlashcardsProps, Heading, type HeadingProps, type HotspotSpec, type HotspotTarget, Image, ImageHotspots, type ImageHotspotsProps, type ImageProps, type ImageSlide, ImageSlider, type ImageSliderProps, InteractiveBook, type InteractiveBookProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, type LessonkitObservabilityConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, MarkTheWords, type MarkTheWordsProps, Page, type PageProps, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, Text, type TextProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, TrueFalse, type TrueFalseProps, blockCatalogV2Version, blockCatalogV3Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetAssessmentWarningsForTests, resetQuizWarningsForTests, useAssessmentState, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
708
+ export { Accordion, type AccordionProps, type AccordionSection, AssessmentSequence, type AssessmentSequenceProps, BLOCK_CATALOG, BLOCK_CATALOG_V2, BLOCK_CATALOG_V3, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockCatalogEntryV3, type BlockPropSpec, Course, type CourseProps, type DialogCard, DialogCards, type DialogCardsProps, DragAndDrop, type DragAndDropProps, type DragItem, DragTheWords, type DragTheWordsProps, type DropTarget, type FillInBlankSpec, FillInTheBlanks, type FillInTheBlanksProps, FindHotspot, type FindHotspotProps, FindMultipleHotspots, type FindMultipleHotspotsProps, type Flashcard, Flashcards, type FlashcardsProps, Heading, type HeadingProps, type HotspotSpec, type HotspotTarget, Image, ImageHotspots, type ImageHotspotsProps, type ImageProps, type ImageSlide, ImageSlider, type ImageSliderProps, InteractiveBook, type InteractiveBookProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, type LessonkitObservabilityConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, MarkTheWords, type MarkTheWordsProps, Page, type PageProps, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, Slide, SlideDeck, type SlideDeckProps, type SlideProps, Text, type TextProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, TrueFalse, type TrueFalseProps, blockCatalogV2Version, blockCatalogV3Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetAssessmentWarningsForTests, resetQuizWarningsForTests, useAssessmentState, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };