@lessonkit/react 1.3.1 → 1.5.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.
- package/README.md +17 -9
- package/block-catalog.v3.json +1530 -219
- package/dist/AssessmentLessonGuard-BzNPbjaV.d.cts +21 -0
- package/dist/AssessmentLessonGuard-BzNPbjaV.d.ts +21 -0
- package/dist/blocks-entry.cjs +6085 -0
- package/dist/blocks-entry.d.cts +471 -0
- package/dist/blocks-entry.d.ts +471 -0
- package/dist/blocks-entry.js +79 -0
- package/dist/chunk-5P23C2W3.js +5535 -0
- package/dist/chunk-7TJQJFYR.js +1982 -0
- package/dist/chunk-ELGQ4XI3.js +271 -0
- package/dist/index.cjs +4597 -740
- package/dist/index.d.cts +118 -282
- package/dist/index.d.ts +118 -282
- package/dist/index.js +550 -4292
- package/dist/testing.cjs +576 -0
- package/dist/testing.d.cts +16 -0
- package/dist/testing.d.ts +16 -0
- package/dist/testing.js +18 -0
- package/package.json +41 -27
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React$1 from 'react';
|
|
1
|
+
import React__default from 'react';
|
|
3
2
|
import * as _lessonkit_core from '@lessonkit/core';
|
|
4
|
-
import { TelemetryEvent, CourseId, TelemetryUser, TrackingClient,
|
|
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
|
-
import { McqAssessmentDescriptor } from '@lessonkit/lxpack';
|
|
3
|
+
import { TelemetryEvent, CourseId, TelemetryUser, TrackingClient, LmsBridgeMode, LessonkitPlugin, StoragePort, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, McqAssessmentProps, BlockId, AssessmentAnsweredData, AssessmentCompletedData, CheckId } from '@lessonkit/core';
|
|
4
|
+
export { AssessmentAnsweredData, AssessmentBaseProps, AssessmentBehaviour, AssessmentCompletedData, AssessmentHandle, AssessmentInteractionType, AssessmentScoreInput, AssessmentScoreResult, AssessmentXAPIData, CompoundBaseProps, CompoundHandle, CompoundResumeState, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, LmsBridgeMode, McqAssessmentProps, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
7
5
|
import * as _lessonkit_xapi from '@lessonkit/xapi';
|
|
8
6
|
import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
|
|
9
|
-
|
|
7
|
+
export { Accordion, AccordionProps, AccordionSection, ArithmeticProblem, ArithmeticQuiz, ArithmeticQuizProps, AssessmentSequence, AssessmentSequenceProps, BranchChoice, BranchChoiceProps, BranchNode, BranchNodeProps, BranchingScenario, BranchingScenarioProps, Chart, ChartDatum, ChartProps, DialogCard, DialogCards, DialogCardsProps, DragAndDrop, DragAndDropProps, DragItem, DragTheWords, DragTheWordsProps, DropTarget, Embed, EmbedProps, Essay, EssayProps, FillInBlankSpec, FillInTheBlanks, FillInTheBlanksProps, FindHotspot, FindHotspotProps, FindMultipleHotspots, FindMultipleHotspotsProps, Flashcard, Flashcards, FlashcardsProps, Heading, HeadingProps, HotspotSpec, HotspotTarget, Image, ImageHotspots, ImageHotspotsProps, ImagePair, ImagePairing, ImagePairingProps, ImageProps, ImageSequencing, ImageSequencingProps, ImageSlide, ImageSlider, ImageSliderProps, InformationPanel, InformationWall, InformationWallProps, InteractiveBook, InteractiveBookProps, InteractiveVideo, InteractiveVideoProps, MarkTheWords, MarkTheWordsProps, MemoryGame, MemoryGameProps, MemoryPair, Page, PageProps, ParallaxSlide, ParallaxSlideshow, ParallaxSlideshowProps, Questionnaire, QuestionnaireField, QuestionnaireProps, SequencingImage, Slide, SlideDeck, SlideDeckProps, SlideProps, Summary, SummaryProps, Text, TextProps, TimedCue, TimedCueProps, TrueFalse, TrueFalseProps, Video, VideoProps } from './blocks-entry.cjs';
|
|
8
|
+
export { K as KnowledgeCheck, Q as Quiz, b as QuizProps, r as resetAssessmentWarningsForTests, a as resetQuizWarningsForTests } from './AssessmentLessonGuard-BzNPbjaV.cjs';
|
|
10
9
|
import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
|
|
11
10
|
export { ThemePresetName } from '@lessonkit/themes';
|
|
12
11
|
|
|
@@ -23,8 +22,29 @@ type LessonkitObservabilityConfig = {
|
|
|
23
22
|
onTelemetryBufferDrop?: () => void;
|
|
24
23
|
/** LMS bridge missing for a completion-related telemetry event (`bridge: auto`). */
|
|
25
24
|
onLxpackBridgeMiss?: (event: TelemetryEvent) => void;
|
|
25
|
+
/** LMS bridge host threw while forwarding telemetry (`bridge: auto`). */
|
|
26
|
+
onLxpackBridgeError?: (err: unknown) => void;
|
|
27
|
+
/** xAPI transport failure after retries (statement re-queued). */
|
|
28
|
+
onXapiTransportError?: (err: unknown) => void;
|
|
29
|
+
/** Telemetry → xAPI mapping failure (statement skipped). */
|
|
30
|
+
onXapiMappingError?: (err: unknown) => void;
|
|
31
|
+
/** Compound child resume incomplete after hydration retries. */
|
|
32
|
+
onCompoundHydrationPartial?: (ctx: {
|
|
33
|
+
compoundId: string;
|
|
34
|
+
missingCheckIds: string[];
|
|
35
|
+
}) => void;
|
|
36
|
+
/** Corrupt compound resume blob or invalid child states stripped on load. */
|
|
37
|
+
onCompoundResumeCorrupt?: (ctx: {
|
|
38
|
+
compoundId: string;
|
|
39
|
+
droppedChildKeys?: string[];
|
|
40
|
+
corrupt?: boolean;
|
|
41
|
+
}) => void;
|
|
26
42
|
};
|
|
27
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Runtime configuration for {@link LessonkitProvider} and {@link Course}.
|
|
46
|
+
* Pass tracking, xAPI, LMS bridge, observability hooks, and plugins here.
|
|
47
|
+
*/
|
|
28
48
|
type LessonkitConfig = {
|
|
29
49
|
courseId: CourseId;
|
|
30
50
|
session?: {
|
|
@@ -38,6 +58,12 @@ type LessonkitConfig = {
|
|
|
38
58
|
enabled?: boolean;
|
|
39
59
|
sink?: (event: Parameters<TrackingClient["track"]>[0]) => void | Promise<void>;
|
|
40
60
|
batchSink?: (events: Parameters<TrackingClient["track"]>[0][]) => void | Promise<void>;
|
|
61
|
+
/** Factory for a custom tracking client (alternative to sink/batchSink). */
|
|
62
|
+
createClient?: () => TrackingClient;
|
|
63
|
+
/** Explicit opt-in for console sinks in production builds. */
|
|
64
|
+
consoleSink?: boolean;
|
|
65
|
+
/** Re-emit assessment telemetry when restoring session state (default false). */
|
|
66
|
+
replayResumeEvents?: boolean;
|
|
41
67
|
/** Keepalive batch delivery for pagehide (e.g. from createFetchBatchSink). */
|
|
42
68
|
exitBatchSink?: (events: Parameters<TrackingClient["track"]>[0][]) => void | Promise<void>;
|
|
43
69
|
batch?: {
|
|
@@ -49,13 +75,19 @@ type LessonkitConfig = {
|
|
|
49
75
|
xapi?: {
|
|
50
76
|
enabled?: boolean;
|
|
51
77
|
transport?: XAPITransport;
|
|
78
|
+
/** Explicit opt-in for console transport in production builds. */
|
|
79
|
+
consoleTransport?: boolean;
|
|
52
80
|
/** Keepalive transport for pagehide (e.g. from createFetchTransport). */
|
|
53
81
|
exitTransport?: _lessonkit_xapi.XAPIExitTransport;
|
|
82
|
+
/** Abort in-flight transport by statement id (e.g. from createFetchTransport). */
|
|
83
|
+
abortInFlight?: (statementId: string) => void;
|
|
54
84
|
client?: XAPIClient;
|
|
55
85
|
};
|
|
56
86
|
lxpack?: {
|
|
57
87
|
/** Forward completion events to `window.parent.lxpackBridge.v1` when embedded (default `auto`). */
|
|
58
|
-
bridge?:
|
|
88
|
+
bridge?: LmsBridgeMode;
|
|
89
|
+
/** Parent-frame origins allowed to receive bridge calls when `bridge` is `auto`. */
|
|
90
|
+
allowedParentOrigins?: string[];
|
|
59
91
|
};
|
|
60
92
|
/** Framework plugins (analytics, LMS, assessment, interaction, AI). */
|
|
61
93
|
plugins?: LessonkitPlugin[];
|
|
@@ -65,11 +97,27 @@ type LessonkitConfig = {
|
|
|
65
97
|
sinks?: _lessonkit_core.TelemetryPipelineSink[];
|
|
66
98
|
/** Production hooks for sink failures, xAPI queue depth, and LMS bridge misses. */
|
|
67
99
|
observability?: LessonkitObservabilityConfig;
|
|
100
|
+
/** Optional storage port override (default: per-provider sessionStorage-backed port). */
|
|
101
|
+
storage?: StoragePort;
|
|
102
|
+
/** Embed block security defaults. */
|
|
103
|
+
embed?: {
|
|
104
|
+
/** Strip `allow-popups` from iframe sandbox in production builds (default true). */
|
|
105
|
+
restrictPopupsInProduction?: boolean;
|
|
106
|
+
/** Hostnames allowed to bypass the production private-network media/embed blocklist. */
|
|
107
|
+
allowedHosts?: string[];
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Non-production preview options. `allowConsoleTelemetry` skips production guard
|
|
111
|
+
* checks for console sinks (docs demos only — not for shipped LMS courses).
|
|
112
|
+
*/
|
|
113
|
+
preview?: {
|
|
114
|
+
allowConsoleTelemetry?: boolean;
|
|
115
|
+
};
|
|
68
116
|
};
|
|
69
117
|
|
|
70
118
|
type LessonkitProviderProps = {
|
|
71
119
|
config: LessonkitConfig;
|
|
72
|
-
children:
|
|
120
|
+
children: React__default.ReactNode;
|
|
73
121
|
};
|
|
74
122
|
type LessonkitRuntime = {
|
|
75
123
|
config: LessonkitConfig;
|
|
@@ -92,30 +140,28 @@ type LessonkitRuntime = {
|
|
|
92
140
|
}) => void;
|
|
93
141
|
plugins: PluginHost | null;
|
|
94
142
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
declare function
|
|
100
|
-
/** @internal Reset module warnings between tests. */
|
|
101
|
-
declare function resetQuizWarningsForTests(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Root runtime provider for telemetry, xAPI, progress, and LMS bridge forwarding.
|
|
145
|
+
* Prefer wrapping with {@link Course} unless you need a custom layout.
|
|
146
|
+
*/
|
|
147
|
+
declare function LessonkitProvider(props: LessonkitProviderProps): React__default.JSX.Element;
|
|
102
148
|
|
|
103
149
|
type CourseProps = {
|
|
104
150
|
title: string;
|
|
105
151
|
courseId: CourseId;
|
|
106
152
|
config?: Omit<LessonkitConfig, "courseId">;
|
|
107
|
-
children:
|
|
153
|
+
children: React__default.ReactNode;
|
|
108
154
|
};
|
|
109
155
|
type LessonProps = {
|
|
110
156
|
title: string;
|
|
111
157
|
lessonId: LessonId;
|
|
112
158
|
/** When false, unmount does not emit lesson_completed (for routed multi-pane layouts). Default true. */
|
|
113
159
|
autoCompleteOnUnmount?: boolean;
|
|
114
|
-
children:
|
|
160
|
+
children: React__default.ReactNode;
|
|
115
161
|
};
|
|
116
162
|
type ScenarioProps = {
|
|
117
163
|
blockId?: BlockId;
|
|
118
|
-
children:
|
|
164
|
+
children: React__default.ReactNode;
|
|
119
165
|
};
|
|
120
166
|
type ReflectionProps = {
|
|
121
167
|
blockId?: BlockId;
|
|
@@ -123,270 +169,37 @@ type ReflectionProps = {
|
|
|
123
169
|
hint?: string;
|
|
124
170
|
value?: string;
|
|
125
171
|
onChange?: (value: string) => void;
|
|
126
|
-
children?:
|
|
172
|
+
children?: React__default.ReactNode;
|
|
127
173
|
};
|
|
128
|
-
type KnowledgeCheckProps =
|
|
174
|
+
type KnowledgeCheckProps = McqAssessmentProps;
|
|
129
175
|
type ProgressTrackerProps = {
|
|
130
176
|
totalLessons?: number;
|
|
131
177
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
declare
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
declare
|
|
156
|
-
|
|
157
|
-
passingScore?: number;
|
|
158
|
-
} & {
|
|
159
|
-
/** Plain text; words listed in `correctWords` are selectable targets. */
|
|
160
|
-
text: string;
|
|
161
|
-
correctWords: string[];
|
|
162
|
-
} & React$1.RefAttributes<AssessmentHandle>>;
|
|
163
|
-
|
|
164
|
-
type FillInBlankSpec = {
|
|
165
|
-
id: string;
|
|
166
|
-
answer: string;
|
|
167
|
-
};
|
|
168
|
-
type FillInTheBlanksProps = AssessmentBaseProps & {
|
|
169
|
-
/** Text with `*` wrapping each blank answer, e.g. "The *capital* of France is *Paris*." */
|
|
170
|
-
template: string;
|
|
171
|
-
/** Optional explicit blanks (overrides parsing from template). */
|
|
172
|
-
blanks?: FillInBlankSpec[];
|
|
173
|
-
};
|
|
174
|
-
declare const FillInTheBlanks: React$1.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
175
|
-
checkId: _lessonkit_core.CheckId;
|
|
176
|
-
passingScore?: number;
|
|
177
|
-
} & {
|
|
178
|
-
/** Text with `*` wrapping each blank answer, e.g. "The *capital* of France is *Paris*." */
|
|
179
|
-
template: string;
|
|
180
|
-
/** Optional explicit blanks (overrides parsing from template). */
|
|
181
|
-
blanks?: FillInBlankSpec[];
|
|
182
|
-
} & React$1.RefAttributes<AssessmentHandle>>;
|
|
183
|
-
|
|
184
|
-
type DragTheWordsProps = AssessmentBaseProps & {
|
|
185
|
-
/** Sentence with `*` around drop zones; `words` are draggable options. */
|
|
186
|
-
template: string;
|
|
187
|
-
words: string[];
|
|
188
|
-
};
|
|
189
|
-
declare const DragTheWords: React$1.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
190
|
-
checkId: _lessonkit_core.CheckId;
|
|
191
|
-
passingScore?: number;
|
|
192
|
-
} & {
|
|
193
|
-
/** Sentence with `*` around drop zones; `words` are draggable options. */
|
|
194
|
-
template: string;
|
|
195
|
-
words: string[];
|
|
196
|
-
} & React$1.RefAttributes<AssessmentHandle>>;
|
|
197
|
-
|
|
198
|
-
type DragItem = {
|
|
199
|
-
id: string;
|
|
200
|
-
label: string;
|
|
201
|
-
};
|
|
202
|
-
type DropTarget = {
|
|
203
|
-
id: string;
|
|
204
|
-
label: string;
|
|
205
|
-
accepts: string;
|
|
206
|
-
};
|
|
207
|
-
type DragAndDropProps = AssessmentBaseProps & {
|
|
208
|
-
items: DragItem[];
|
|
209
|
-
targets: DropTarget[];
|
|
210
|
-
};
|
|
211
|
-
declare const DragAndDrop: React$1.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
212
|
-
checkId: _lessonkit_core.CheckId;
|
|
213
|
-
passingScore?: number;
|
|
214
|
-
} & {
|
|
215
|
-
items: DragItem[];
|
|
216
|
-
targets: DropTarget[];
|
|
217
|
-
} & React$1.RefAttributes<AssessmentHandle>>;
|
|
218
|
-
|
|
219
|
-
type AssessmentSequenceProps = AssessmentBehaviour & {
|
|
220
|
-
children: React$1.ReactNode;
|
|
221
|
-
/** Show one child assessment at a time (Question Set). */
|
|
222
|
-
sequential?: boolean;
|
|
223
|
-
blockId?: BlockId;
|
|
224
|
-
};
|
|
225
|
-
declare const AssessmentSequence: React$1.ForwardRefExoticComponent<AssessmentBehaviour & {
|
|
226
|
-
children: React$1.ReactNode;
|
|
227
|
-
/** Show one child assessment at a time (Question Set). */
|
|
228
|
-
sequential?: boolean;
|
|
229
|
-
blockId?: BlockId;
|
|
230
|
-
} & React$1.RefAttributes<CompoundHandle>>;
|
|
231
|
-
|
|
232
|
-
type TextProps = {
|
|
233
|
-
blockId?: BlockId;
|
|
234
|
-
children: React$1.ReactNode;
|
|
235
|
-
};
|
|
236
|
-
declare function Text(props: TextProps): react_jsx_runtime.JSX.Element;
|
|
237
|
-
|
|
238
|
-
type HeadingProps = {
|
|
239
|
-
blockId?: BlockId;
|
|
240
|
-
level: 1 | 2 | 3;
|
|
241
|
-
children: React.ReactNode;
|
|
242
|
-
};
|
|
243
|
-
declare function Heading(props: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
244
|
-
|
|
245
|
-
type ImageProps = {
|
|
246
|
-
blockId?: BlockId;
|
|
247
|
-
src: string;
|
|
248
|
-
alt: string;
|
|
249
|
-
};
|
|
250
|
-
declare function Image(props: ImageProps): react_jsx_runtime.JSX.Element;
|
|
251
|
-
|
|
252
|
-
type PageProps = {
|
|
253
|
-
blockId: BlockId;
|
|
254
|
-
title?: string;
|
|
255
|
-
/** When true, page is used as a book chapter but hidden until navigated (InteractiveBook). */
|
|
256
|
-
hidden?: boolean;
|
|
257
|
-
/** Index within a compound parent (set by InteractiveBook). */
|
|
258
|
-
pageIndex?: number;
|
|
259
|
-
/** Compound parent type for telemetry (e.g. InteractiveBook). */
|
|
260
|
-
parentType?: string;
|
|
261
|
-
children: React$1.ReactNode;
|
|
262
|
-
};
|
|
263
|
-
declare function Page(props: PageProps): react_jsx_runtime.JSX.Element;
|
|
264
|
-
|
|
265
|
-
type InteractiveBookProps = {
|
|
266
|
-
blockId: BlockId;
|
|
267
|
-
title: string;
|
|
268
|
-
showBookScore?: boolean;
|
|
269
|
-
children: React$1.ReactElement<PageProps> | React$1.ReactElement<PageProps>[];
|
|
270
|
-
};
|
|
271
|
-
declare const InteractiveBook: React$1.ForwardRefExoticComponent<InteractiveBookProps & React$1.RefAttributes<CompoundHandle>>;
|
|
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
|
-
|
|
294
|
-
type AccordionSection = {
|
|
295
|
-
id: string;
|
|
296
|
-
title: string;
|
|
297
|
-
content: React$1.ReactNode;
|
|
298
|
-
};
|
|
299
|
-
type AccordionProps = {
|
|
300
|
-
blockId: BlockId;
|
|
301
|
-
sections: AccordionSection[];
|
|
302
|
-
};
|
|
303
|
-
declare function Accordion(props: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
304
|
-
|
|
305
|
-
type DialogCard = {
|
|
306
|
-
front: string;
|
|
307
|
-
back: string;
|
|
308
|
-
};
|
|
309
|
-
type DialogCardsProps = {
|
|
310
|
-
blockId: BlockId;
|
|
311
|
-
cards: DialogCard[];
|
|
312
|
-
};
|
|
313
|
-
declare function DialogCards(props: DialogCardsProps): react_jsx_runtime.JSX.Element | null;
|
|
314
|
-
|
|
315
|
-
type Flashcard = {
|
|
316
|
-
front: string;
|
|
317
|
-
back: string;
|
|
318
|
-
};
|
|
319
|
-
type FlashcardsProps = {
|
|
320
|
-
blockId: BlockId;
|
|
321
|
-
cards: Flashcard[];
|
|
322
|
-
/** Optional self-score mode (not LMS-scored). */
|
|
323
|
-
selfScore?: boolean;
|
|
324
|
-
};
|
|
325
|
-
declare function Flashcards(props: FlashcardsProps): react_jsx_runtime.JSX.Element | null;
|
|
326
|
-
|
|
327
|
-
type HotspotSpec = {
|
|
328
|
-
id: string;
|
|
329
|
-
label: string;
|
|
330
|
-
x: number;
|
|
331
|
-
y: number;
|
|
332
|
-
content: React$1.ReactNode;
|
|
333
|
-
};
|
|
334
|
-
type ImageHotspotsProps = {
|
|
335
|
-
blockId: BlockId;
|
|
336
|
-
src: string;
|
|
337
|
-
alt: string;
|
|
338
|
-
hotspots: HotspotSpec[];
|
|
339
|
-
};
|
|
340
|
-
declare function ImageHotspots(props: ImageHotspotsProps): react_jsx_runtime.JSX.Element;
|
|
341
|
-
|
|
342
|
-
type ImageSlide = {
|
|
343
|
-
src: string;
|
|
344
|
-
alt: string;
|
|
345
|
-
caption?: string;
|
|
346
|
-
};
|
|
347
|
-
type ImageSliderProps = {
|
|
348
|
-
blockId: BlockId;
|
|
349
|
-
slides: ImageSlide[];
|
|
350
|
-
};
|
|
351
|
-
declare function ImageSlider(props: ImageSliderProps): react_jsx_runtime.JSX.Element | null;
|
|
352
|
-
|
|
353
|
-
type HotspotTarget = {
|
|
354
|
-
id: string;
|
|
355
|
-
label: string;
|
|
356
|
-
x: number;
|
|
357
|
-
y: number;
|
|
358
|
-
};
|
|
359
|
-
type FindHotspotProps = AssessmentBaseProps & {
|
|
360
|
-
src: string;
|
|
361
|
-
alt: string;
|
|
362
|
-
targets: HotspotTarget[];
|
|
363
|
-
correctTargetId: string;
|
|
364
|
-
};
|
|
365
|
-
declare const FindHotspot: React$1.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
366
|
-
checkId: _lessonkit_core.CheckId;
|
|
367
|
-
passingScore?: number;
|
|
368
|
-
} & {
|
|
369
|
-
src: string;
|
|
370
|
-
alt: string;
|
|
371
|
-
targets: HotspotTarget[];
|
|
372
|
-
correctTargetId: string;
|
|
373
|
-
} & React$1.RefAttributes<AssessmentHandle>>;
|
|
374
|
-
|
|
375
|
-
type FindMultipleHotspotsProps = AssessmentBaseProps & {
|
|
376
|
-
src: string;
|
|
377
|
-
alt: string;
|
|
378
|
-
targets: HotspotTarget[];
|
|
379
|
-
correctTargetIds: string[];
|
|
380
|
-
};
|
|
381
|
-
declare const FindMultipleHotspots: React$1.ForwardRefExoticComponent<_lessonkit_core.AssessmentBehaviour & {
|
|
382
|
-
checkId: _lessonkit_core.CheckId;
|
|
383
|
-
passingScore?: number;
|
|
384
|
-
} & {
|
|
385
|
-
src: string;
|
|
386
|
-
alt: string;
|
|
387
|
-
targets: HotspotTarget[];
|
|
388
|
-
correctTargetIds: string[];
|
|
389
|
-
} & React$1.RefAttributes<AssessmentHandle>>;
|
|
178
|
+
/**
|
|
179
|
+
* Top-level course shell. Wraps {@link LessonkitProvider} and renders a semantic section with title.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```tsx
|
|
183
|
+
* <Course title="Security 101" courseId="sec-101" config={courseConfig}>
|
|
184
|
+
* <Lesson title="Phishing" lessonId="phishing-101">…</Lesson>
|
|
185
|
+
* </Course>
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
declare function Course(props: CourseProps): React__default.JSX.Element;
|
|
189
|
+
/**
|
|
190
|
+
* Lesson container. Sets the active lesson on mount and emits lesson lifecycle telemetry.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```tsx
|
|
194
|
+
* <Lesson title="Phishing" lessonId="phishing-101">
|
|
195
|
+
* <Scenario>…</Scenario>
|
|
196
|
+
* </Lesson>
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
declare function Lesson(props: LessonProps): React__default.JSX.Element;
|
|
200
|
+
declare function Scenario(props: ScenarioProps): React__default.JSX.Element;
|
|
201
|
+
declare function Reflection(props: ReflectionProps): React__default.JSX.Element;
|
|
202
|
+
declare function ProgressTracker(props: ProgressTrackerProps): React__default.JSX.Element;
|
|
390
203
|
|
|
391
204
|
declare function useAssessmentState(enclosingLessonId?: LessonId): {
|
|
392
205
|
answer: (data: AssessmentAnsweredData) => void;
|
|
@@ -394,7 +207,9 @@ declare function useAssessmentState(enclosingLessonId?: LessonId): {
|
|
|
394
207
|
};
|
|
395
208
|
|
|
396
209
|
declare function useLessonkit(): LessonkitRuntime;
|
|
210
|
+
/** Read course progress state (completed lessons, active lesson). */
|
|
397
211
|
declare function useProgress(): _lessonkit_core.ProgressState;
|
|
212
|
+
/** Emit typed telemetry events from custom UI (`track("interaction", …)`). */
|
|
398
213
|
declare function useTracking(): {
|
|
399
214
|
track: <N extends _lessonkit_core.TelemetryEventName>(name: N, data?: _lessonkit_core.TelemetryDataFor<N>, opts?: {
|
|
400
215
|
lessonId?: LessonId;
|
|
@@ -422,12 +237,17 @@ declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
|
422
237
|
}) => void;
|
|
423
238
|
};
|
|
424
239
|
|
|
425
|
-
declare function
|
|
240
|
+
declare function shouldEnforceProductionGuard(): boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Throws in production when course config still uses dev-only console sinks or
|
|
243
|
+
* omits observability hooks while telemetry/xAPI are enabled.
|
|
244
|
+
*/
|
|
245
|
+
declare function assertProductionCourseConfig(config: Pick<LessonkitConfig, "tracking" | "xapi" | "observability" | "lxpack" | "preview">): void;
|
|
426
246
|
|
|
427
247
|
type ThemeMode = "light" | "dark" | "system";
|
|
428
248
|
type ThemeResolvedMode = "light" | "dark";
|
|
429
249
|
type ThemeProviderProps = {
|
|
430
|
-
children:
|
|
250
|
+
children: React__default.ReactNode;
|
|
431
251
|
/** Partial theme merged on top of the resolved preset (last writer wins). */
|
|
432
252
|
theme?: PartialLessonkitThemeV1;
|
|
433
253
|
preset?: ThemePresetName;
|
|
@@ -441,9 +261,25 @@ type ThemeContextValue = {
|
|
|
441
261
|
mode: ThemeMode;
|
|
442
262
|
resolvedMode: ThemeResolvedMode;
|
|
443
263
|
};
|
|
444
|
-
declare function ThemeProvider(props: ThemeProviderProps):
|
|
264
|
+
declare function ThemeProvider(props: ThemeProviderProps): React__default.JSX.Element;
|
|
445
265
|
declare function useTheme(): ThemeContextValue;
|
|
446
266
|
|
|
267
|
+
type BranchingScenarioContextValue = {
|
|
268
|
+
compoundBlockId: string;
|
|
269
|
+
activeNodeId: string;
|
|
270
|
+
visitedNodeIds: readonly string[];
|
|
271
|
+
visitedLabels: readonly string[];
|
|
272
|
+
navigateToNode: (opts: {
|
|
273
|
+
fromNodeId: string;
|
|
274
|
+
toNodeId: string;
|
|
275
|
+
label: string;
|
|
276
|
+
scoreWeight?: number;
|
|
277
|
+
}) => void;
|
|
278
|
+
isTerminal: boolean;
|
|
279
|
+
choicesLocked: boolean;
|
|
280
|
+
};
|
|
281
|
+
declare function useBranchingScenario(): BranchingScenarioContextValue;
|
|
282
|
+
|
|
447
283
|
declare const blockCatalogVersion: 1;
|
|
448
284
|
declare const blockCatalogV2Version: 2;
|
|
449
285
|
declare const blockCatalogV3Version: 3;
|
|
@@ -705,4 +541,4 @@ type BuildBlockCatalogOptions = {
|
|
|
705
541
|
declare function buildBlockCatalog(opts?: BuildBlockCatalogOptions): BlockCatalogEntry[] | BlockCatalogEntryV2[] | BlockCatalogEntryV3[];
|
|
706
542
|
declare function getBlockCatalogEntry(type: string, opts?: BuildBlockCatalogOptions): BlockCatalogEntry | BlockCatalogEntryV2 | BlockCatalogEntryV3 | undefined;
|
|
707
543
|
|
|
708
|
-
export {
|
|
544
|
+
export { BLOCK_CATALOG, BLOCK_CATALOG_V2, BLOCK_CATALOG_V3, type BlockCatalogEntry, type BlockCatalogEntryV2, type BlockCatalogEntryV3, type BlockPropSpec, Course, type CourseProps, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, type LessonkitObservabilityConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, ProgressTracker, type ProgressTrackerProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, assertProductionCourseConfig, blockCatalogV2Version, blockCatalogV3Version, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, shouldEnforceProductionGuard, useAssessmentState, useBranchingScenario, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|