@lessonkit/react 1.0.0 → 1.0.2
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/block-catalog.v1.json +6 -0
- package/dist/index.cjs +242 -99
- package/dist/index.d.cts +245 -37
- package/dist/index.d.ts +245 -37
- package/dist/index.js +242 -97
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import * as _lessonkit_core from '@lessonkit/core';
|
|
4
|
-
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName,
|
|
4
|
+
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, BlockId, CheckId } from '@lessonkit/core';
|
|
5
5
|
export { AssessmentScoreInput, AssessmentScoreResult, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
6
|
+
import { AssessmentDescriptor } from '@lessonkit/lxpack';
|
|
6
7
|
import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
|
|
8
|
+
import { LxpackBridgeMode } from '@lessonkit/lxpack/bridge';
|
|
7
9
|
import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
|
|
8
10
|
export { ThemePresetName } from '@lessonkit/themes';
|
|
9
11
|
|
|
@@ -31,7 +33,7 @@ type LessonkitConfig = {
|
|
|
31
33
|
};
|
|
32
34
|
lxpack?: {
|
|
33
35
|
/** Forward completion events to `window.parent.lxpackBridge.v1` when embedded (default `auto`). */
|
|
34
|
-
bridge?:
|
|
36
|
+
bridge?: LxpackBridgeMode;
|
|
35
37
|
};
|
|
36
38
|
/** Framework plugins (analytics, LMS, assessment, interaction, AI). */
|
|
37
39
|
plugins?: LessonkitPlugin[];
|
|
@@ -41,6 +43,10 @@ type LessonkitConfig = {
|
|
|
41
43
|
sinks?: _lessonkit_core.TelemetryPipelineSink[];
|
|
42
44
|
};
|
|
43
45
|
|
|
46
|
+
type LessonkitProviderProps = {
|
|
47
|
+
config: LessonkitConfig;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
};
|
|
44
50
|
type LessonkitRuntime = {
|
|
45
51
|
config: LessonkitConfig;
|
|
46
52
|
tracking: TrackingClient;
|
|
@@ -52,72 +58,68 @@ type LessonkitRuntime = {
|
|
|
52
58
|
user?: TelemetryUser;
|
|
53
59
|
};
|
|
54
60
|
setActiveLesson: (lessonId: LessonId) => void;
|
|
55
|
-
completeLesson: (lessonId: LessonId
|
|
61
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
62
|
+
courseId?: CourseId;
|
|
63
|
+
}) => void;
|
|
56
64
|
completeCourse: () => void;
|
|
57
|
-
track: (name:
|
|
65
|
+
track: <N extends TelemetryEventName>(name: N, data?: TelemetryDataFor<N>, opts?: {
|
|
58
66
|
lessonId?: LessonId;
|
|
59
67
|
}) => void;
|
|
60
68
|
plugins: PluginHost | null;
|
|
61
69
|
};
|
|
62
|
-
declare function LessonkitProvider(props:
|
|
63
|
-
config: LessonkitConfig;
|
|
64
|
-
children: React.ReactNode;
|
|
65
|
-
}): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function LessonkitProvider(props: LessonkitProviderProps): react_jsx_runtime.JSX.Element;
|
|
66
71
|
|
|
67
72
|
/** @internal Reset module warnings between tests. */
|
|
68
73
|
declare function resetQuizWarningsForTests(): void;
|
|
69
|
-
|
|
74
|
+
type CourseProps = {
|
|
70
75
|
title: string;
|
|
71
76
|
courseId: CourseId;
|
|
72
|
-
config?: Omit<
|
|
77
|
+
config?: Omit<LessonkitConfig, "courseId">;
|
|
73
78
|
children: React.ReactNode;
|
|
74
|
-
}
|
|
75
|
-
|
|
79
|
+
};
|
|
80
|
+
type LessonProps = {
|
|
76
81
|
title: string;
|
|
77
82
|
lessonId: LessonId;
|
|
78
83
|
/** When false, unmount does not emit lesson_completed (for routed multi-pane layouts). Default true. */
|
|
79
84
|
autoCompleteOnUnmount?: boolean;
|
|
80
85
|
children: React.ReactNode;
|
|
81
|
-
}
|
|
82
|
-
|
|
86
|
+
};
|
|
87
|
+
type ScenarioProps = {
|
|
83
88
|
blockId?: BlockId;
|
|
84
89
|
children: React.ReactNode;
|
|
85
|
-
}
|
|
86
|
-
|
|
90
|
+
};
|
|
91
|
+
type ReflectionProps = {
|
|
87
92
|
blockId?: BlockId;
|
|
88
93
|
prompt?: string;
|
|
89
94
|
hint?: string;
|
|
90
95
|
value?: string;
|
|
91
96
|
onChange?: (value: string) => void;
|
|
92
97
|
children?: React.ReactNode;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
choices: string[];
|
|
98
|
-
answer: string;
|
|
99
|
-
passingScore?: number;
|
|
100
|
-
}): react_jsx_runtime.JSX.Element;
|
|
101
|
-
declare function Quiz(props: {
|
|
102
|
-
checkId: CheckId;
|
|
103
|
-
question: string;
|
|
104
|
-
choices: string[];
|
|
105
|
-
answer: string;
|
|
106
|
-
passingScore?: number;
|
|
107
|
-
}): react_jsx_runtime.JSX.Element;
|
|
108
|
-
declare function ProgressTracker(props: {
|
|
98
|
+
};
|
|
99
|
+
type QuizProps = AssessmentDescriptor;
|
|
100
|
+
type KnowledgeCheckProps = AssessmentDescriptor;
|
|
101
|
+
type ProgressTrackerProps = {
|
|
109
102
|
totalLessons?: number;
|
|
110
|
-
}
|
|
103
|
+
};
|
|
104
|
+
declare function Course(props: CourseProps): react_jsx_runtime.JSX.Element;
|
|
105
|
+
declare function Lesson(props: LessonProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
declare function Scenario(props: ScenarioProps): react_jsx_runtime.JSX.Element;
|
|
107
|
+
declare function Reflection(props: ReflectionProps): react_jsx_runtime.JSX.Element;
|
|
108
|
+
declare function KnowledgeCheck(props: KnowledgeCheckProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare function Quiz(props: QuizProps): react_jsx_runtime.JSX.Element;
|
|
110
|
+
declare function ProgressTracker(props: ProgressTrackerProps): react_jsx_runtime.JSX.Element;
|
|
111
111
|
|
|
112
112
|
declare function useLessonkit(): LessonkitRuntime;
|
|
113
113
|
declare function useProgress(): _lessonkit_core.ProgressState;
|
|
114
114
|
declare function useTracking(): {
|
|
115
|
-
track: (name:
|
|
115
|
+
track: <N extends _lessonkit_core.TelemetryEventName>(name: N, data?: _lessonkit_core.TelemetryDataFor<N>, opts?: {
|
|
116
116
|
lessonId?: LessonId;
|
|
117
117
|
}) => void;
|
|
118
118
|
};
|
|
119
119
|
declare function useCompletion(): {
|
|
120
|
-
completeLesson: (lessonId: LessonId
|
|
120
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
121
|
+
courseId?: _lessonkit_core.CourseId;
|
|
122
|
+
}) => void;
|
|
121
123
|
completeCourse: () => void;
|
|
122
124
|
};
|
|
123
125
|
declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
@@ -189,8 +191,214 @@ type BlockCatalogEntry = {
|
|
|
189
191
|
manualTracking?: string;
|
|
190
192
|
};
|
|
191
193
|
};
|
|
192
|
-
declare const BLOCK_CATALOG:
|
|
194
|
+
declare const BLOCK_CATALOG: ({
|
|
195
|
+
type: string;
|
|
196
|
+
category: "container";
|
|
197
|
+
description: string;
|
|
198
|
+
props: ({
|
|
199
|
+
name: string;
|
|
200
|
+
type: string;
|
|
201
|
+
required: true;
|
|
202
|
+
description: string;
|
|
203
|
+
} | {
|
|
204
|
+
name: string;
|
|
205
|
+
type: string;
|
|
206
|
+
required: false;
|
|
207
|
+
description: string;
|
|
208
|
+
})[];
|
|
209
|
+
requiredIds: string[];
|
|
210
|
+
a11y: {
|
|
211
|
+
element: string;
|
|
212
|
+
ariaLabel: string;
|
|
213
|
+
keyboard: string;
|
|
214
|
+
notes: string;
|
|
215
|
+
liveRegions?: undefined;
|
|
216
|
+
};
|
|
217
|
+
theming: {
|
|
218
|
+
surface: "global-inherit";
|
|
219
|
+
stylingNotes: string;
|
|
220
|
+
dataAttributes?: undefined;
|
|
221
|
+
};
|
|
222
|
+
telemetry: {
|
|
223
|
+
emits: string[];
|
|
224
|
+
manualTracking?: undefined;
|
|
225
|
+
requiresActiveLesson?: undefined;
|
|
226
|
+
};
|
|
227
|
+
parentConstraints?: undefined;
|
|
228
|
+
optionalIds?: undefined;
|
|
229
|
+
aliases?: undefined;
|
|
230
|
+
} | {
|
|
231
|
+
type: string;
|
|
232
|
+
category: "container";
|
|
233
|
+
description: string;
|
|
234
|
+
props: ({
|
|
235
|
+
name: string;
|
|
236
|
+
type: string;
|
|
237
|
+
required: true;
|
|
238
|
+
description: string;
|
|
239
|
+
} | {
|
|
240
|
+
name: string;
|
|
241
|
+
type: string;
|
|
242
|
+
required: false;
|
|
243
|
+
description: string;
|
|
244
|
+
})[];
|
|
245
|
+
requiredIds: string[];
|
|
246
|
+
parentConstraints: string[];
|
|
247
|
+
a11y: {
|
|
248
|
+
element: string;
|
|
249
|
+
ariaLabel: string;
|
|
250
|
+
keyboard: string;
|
|
251
|
+
notes: string;
|
|
252
|
+
liveRegions?: undefined;
|
|
253
|
+
};
|
|
254
|
+
theming: {
|
|
255
|
+
surface: "global-inherit";
|
|
256
|
+
stylingNotes: string;
|
|
257
|
+
dataAttributes?: undefined;
|
|
258
|
+
};
|
|
259
|
+
telemetry: {
|
|
260
|
+
emits: string[];
|
|
261
|
+
manualTracking?: undefined;
|
|
262
|
+
requiresActiveLesson?: undefined;
|
|
263
|
+
};
|
|
264
|
+
optionalIds?: undefined;
|
|
265
|
+
aliases?: undefined;
|
|
266
|
+
} | {
|
|
267
|
+
type: string;
|
|
268
|
+
category: "content";
|
|
269
|
+
description: string;
|
|
270
|
+
props: ({
|
|
271
|
+
name: string;
|
|
272
|
+
type: string;
|
|
273
|
+
required: false;
|
|
274
|
+
description: string;
|
|
275
|
+
} | {
|
|
276
|
+
name: string;
|
|
277
|
+
type: string;
|
|
278
|
+
required: true;
|
|
279
|
+
description: string;
|
|
280
|
+
})[];
|
|
281
|
+
requiredIds: never[];
|
|
282
|
+
optionalIds: string[];
|
|
283
|
+
parentConstraints: string[];
|
|
284
|
+
a11y: {
|
|
285
|
+
element: string;
|
|
286
|
+
ariaLabel: string;
|
|
287
|
+
keyboard: string;
|
|
288
|
+
notes: string;
|
|
289
|
+
liveRegions?: undefined;
|
|
290
|
+
};
|
|
291
|
+
theming: {
|
|
292
|
+
surface: "global-inherit";
|
|
293
|
+
dataAttributes: string[];
|
|
294
|
+
stylingNotes: string;
|
|
295
|
+
};
|
|
296
|
+
telemetry: {
|
|
297
|
+
emits: never[];
|
|
298
|
+
manualTracking: string;
|
|
299
|
+
requiresActiveLesson?: undefined;
|
|
300
|
+
};
|
|
301
|
+
aliases?: undefined;
|
|
302
|
+
} | {
|
|
303
|
+
type: string;
|
|
304
|
+
category: "content";
|
|
305
|
+
description: string;
|
|
306
|
+
props: {
|
|
307
|
+
name: string;
|
|
308
|
+
type: string;
|
|
309
|
+
required: false;
|
|
310
|
+
description: string;
|
|
311
|
+
}[];
|
|
312
|
+
requiredIds: never[];
|
|
313
|
+
optionalIds: string[];
|
|
314
|
+
parentConstraints: string[];
|
|
315
|
+
a11y: {
|
|
316
|
+
element: string;
|
|
317
|
+
ariaLabel: string;
|
|
318
|
+
keyboard: string;
|
|
319
|
+
notes: string;
|
|
320
|
+
liveRegions?: undefined;
|
|
321
|
+
};
|
|
322
|
+
theming: {
|
|
323
|
+
surface: "global-inherit";
|
|
324
|
+
dataAttributes: string[];
|
|
325
|
+
stylingNotes: string;
|
|
326
|
+
};
|
|
327
|
+
telemetry: {
|
|
328
|
+
emits: never[];
|
|
329
|
+
requiresActiveLesson: true;
|
|
330
|
+
manualTracking: string;
|
|
331
|
+
};
|
|
332
|
+
aliases?: undefined;
|
|
333
|
+
} | {
|
|
334
|
+
type: string;
|
|
335
|
+
aliases: string[];
|
|
336
|
+
category: "assessment";
|
|
337
|
+
description: string;
|
|
338
|
+
props: ({
|
|
339
|
+
name: string;
|
|
340
|
+
type: string;
|
|
341
|
+
required: true;
|
|
342
|
+
description: string;
|
|
343
|
+
} | {
|
|
344
|
+
name: string;
|
|
345
|
+
type: string;
|
|
346
|
+
required: false;
|
|
347
|
+
description: string;
|
|
348
|
+
})[];
|
|
349
|
+
requiredIds: string[];
|
|
350
|
+
parentConstraints: string[];
|
|
351
|
+
a11y: {
|
|
352
|
+
element: string;
|
|
353
|
+
ariaLabel: string;
|
|
354
|
+
keyboard: string;
|
|
355
|
+
liveRegions: string;
|
|
356
|
+
notes: string;
|
|
357
|
+
};
|
|
358
|
+
theming: {
|
|
359
|
+
surface: "global-inherit";
|
|
360
|
+
dataAttributes: string[];
|
|
361
|
+
stylingNotes: string;
|
|
362
|
+
};
|
|
363
|
+
telemetry: {
|
|
364
|
+
emits: string[];
|
|
365
|
+
requiresActiveLesson: true;
|
|
366
|
+
manualTracking?: undefined;
|
|
367
|
+
};
|
|
368
|
+
optionalIds?: undefined;
|
|
369
|
+
} | {
|
|
370
|
+
type: string;
|
|
371
|
+
category: "chrome";
|
|
372
|
+
description: string;
|
|
373
|
+
props: {
|
|
374
|
+
name: string;
|
|
375
|
+
type: string;
|
|
376
|
+
required: false;
|
|
377
|
+
description: string;
|
|
378
|
+
}[];
|
|
379
|
+
requiredIds: never[];
|
|
380
|
+
parentConstraints: string[];
|
|
381
|
+
a11y: {
|
|
382
|
+
element: string;
|
|
383
|
+
ariaLabel: string;
|
|
384
|
+
keyboard: string;
|
|
385
|
+
notes: string;
|
|
386
|
+
liveRegions?: undefined;
|
|
387
|
+
};
|
|
388
|
+
theming: {
|
|
389
|
+
surface: "global-inherit";
|
|
390
|
+
stylingNotes: string;
|
|
391
|
+
dataAttributes?: undefined;
|
|
392
|
+
};
|
|
393
|
+
telemetry: {
|
|
394
|
+
emits: never[];
|
|
395
|
+
manualTracking?: undefined;
|
|
396
|
+
requiresActiveLesson?: undefined;
|
|
397
|
+
};
|
|
398
|
+
optionalIds?: undefined;
|
|
399
|
+
aliases?: undefined;
|
|
400
|
+
})[];
|
|
193
401
|
declare function buildBlockCatalog(): BlockCatalogEntry[];
|
|
194
402
|
declare function getBlockCatalogEntry(type: string): BlockCatalogEntry | undefined;
|
|
195
403
|
|
|
196
|
-
export { BLOCK_CATALOG, type BlockCatalogEntry, type BlockPropSpec, Course, KnowledgeCheck, Lesson, type LessonkitConfig, LessonkitProvider, type LessonkitRuntime, ProgressTracker, Quiz, Reflection, Scenario, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetQuizWarningsForTests, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|
|
404
|
+
export { BLOCK_CATALOG, type BlockCatalogEntry, type BlockPropSpec, Course, type CourseProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetQuizWarningsForTests, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import * as _lessonkit_core from '@lessonkit/core';
|
|
4
|
-
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName,
|
|
4
|
+
import { CourseId, TelemetryUser, TrackingClient, LessonkitPlugin, ProgressState, LessonId, TelemetryEventName, TelemetryDataFor, PluginHost, BlockId, CheckId } from '@lessonkit/core';
|
|
5
5
|
export { AssessmentScoreInput, AssessmentScoreResult, InteractionBlockRegistration, LessonkitPlugin, LessonkitPluginContext, LessonkitPluginKind, PluginHost, PluginRegistry, TelemetryPipelineSink, buildTelemetryEvent, createLessonkitRuntime, createPluginRegistry, createTelemetryPipeline, defineAssessmentPlugin, defineLifecyclePlugin, defineTelemetryPlugin } from '@lessonkit/core';
|
|
6
|
+
import { AssessmentDescriptor } from '@lessonkit/lxpack';
|
|
6
7
|
import { XAPITransport, XAPIClient } from '@lessonkit/xapi';
|
|
8
|
+
import { LxpackBridgeMode } from '@lessonkit/lxpack/bridge';
|
|
7
9
|
import { LessonkitThemeV1, ThemePresetName, PartialLessonkitThemeV1 } from '@lessonkit/themes';
|
|
8
10
|
export { ThemePresetName } from '@lessonkit/themes';
|
|
9
11
|
|
|
@@ -31,7 +33,7 @@ type LessonkitConfig = {
|
|
|
31
33
|
};
|
|
32
34
|
lxpack?: {
|
|
33
35
|
/** Forward completion events to `window.parent.lxpackBridge.v1` when embedded (default `auto`). */
|
|
34
|
-
bridge?:
|
|
36
|
+
bridge?: LxpackBridgeMode;
|
|
35
37
|
};
|
|
36
38
|
/** Framework plugins (analytics, LMS, assessment, interaction, AI). */
|
|
37
39
|
plugins?: LessonkitPlugin[];
|
|
@@ -41,6 +43,10 @@ type LessonkitConfig = {
|
|
|
41
43
|
sinks?: _lessonkit_core.TelemetryPipelineSink[];
|
|
42
44
|
};
|
|
43
45
|
|
|
46
|
+
type LessonkitProviderProps = {
|
|
47
|
+
config: LessonkitConfig;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
};
|
|
44
50
|
type LessonkitRuntime = {
|
|
45
51
|
config: LessonkitConfig;
|
|
46
52
|
tracking: TrackingClient;
|
|
@@ -52,72 +58,68 @@ type LessonkitRuntime = {
|
|
|
52
58
|
user?: TelemetryUser;
|
|
53
59
|
};
|
|
54
60
|
setActiveLesson: (lessonId: LessonId) => void;
|
|
55
|
-
completeLesson: (lessonId: LessonId
|
|
61
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
62
|
+
courseId?: CourseId;
|
|
63
|
+
}) => void;
|
|
56
64
|
completeCourse: () => void;
|
|
57
|
-
track: (name:
|
|
65
|
+
track: <N extends TelemetryEventName>(name: N, data?: TelemetryDataFor<N>, opts?: {
|
|
58
66
|
lessonId?: LessonId;
|
|
59
67
|
}) => void;
|
|
60
68
|
plugins: PluginHost | null;
|
|
61
69
|
};
|
|
62
|
-
declare function LessonkitProvider(props:
|
|
63
|
-
config: LessonkitConfig;
|
|
64
|
-
children: React.ReactNode;
|
|
65
|
-
}): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function LessonkitProvider(props: LessonkitProviderProps): react_jsx_runtime.JSX.Element;
|
|
66
71
|
|
|
67
72
|
/** @internal Reset module warnings between tests. */
|
|
68
73
|
declare function resetQuizWarningsForTests(): void;
|
|
69
|
-
|
|
74
|
+
type CourseProps = {
|
|
70
75
|
title: string;
|
|
71
76
|
courseId: CourseId;
|
|
72
|
-
config?: Omit<
|
|
77
|
+
config?: Omit<LessonkitConfig, "courseId">;
|
|
73
78
|
children: React.ReactNode;
|
|
74
|
-
}
|
|
75
|
-
|
|
79
|
+
};
|
|
80
|
+
type LessonProps = {
|
|
76
81
|
title: string;
|
|
77
82
|
lessonId: LessonId;
|
|
78
83
|
/** When false, unmount does not emit lesson_completed (for routed multi-pane layouts). Default true. */
|
|
79
84
|
autoCompleteOnUnmount?: boolean;
|
|
80
85
|
children: React.ReactNode;
|
|
81
|
-
}
|
|
82
|
-
|
|
86
|
+
};
|
|
87
|
+
type ScenarioProps = {
|
|
83
88
|
blockId?: BlockId;
|
|
84
89
|
children: React.ReactNode;
|
|
85
|
-
}
|
|
86
|
-
|
|
90
|
+
};
|
|
91
|
+
type ReflectionProps = {
|
|
87
92
|
blockId?: BlockId;
|
|
88
93
|
prompt?: string;
|
|
89
94
|
hint?: string;
|
|
90
95
|
value?: string;
|
|
91
96
|
onChange?: (value: string) => void;
|
|
92
97
|
children?: React.ReactNode;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
choices: string[];
|
|
98
|
-
answer: string;
|
|
99
|
-
passingScore?: number;
|
|
100
|
-
}): react_jsx_runtime.JSX.Element;
|
|
101
|
-
declare function Quiz(props: {
|
|
102
|
-
checkId: CheckId;
|
|
103
|
-
question: string;
|
|
104
|
-
choices: string[];
|
|
105
|
-
answer: string;
|
|
106
|
-
passingScore?: number;
|
|
107
|
-
}): react_jsx_runtime.JSX.Element;
|
|
108
|
-
declare function ProgressTracker(props: {
|
|
98
|
+
};
|
|
99
|
+
type QuizProps = AssessmentDescriptor;
|
|
100
|
+
type KnowledgeCheckProps = AssessmentDescriptor;
|
|
101
|
+
type ProgressTrackerProps = {
|
|
109
102
|
totalLessons?: number;
|
|
110
|
-
}
|
|
103
|
+
};
|
|
104
|
+
declare function Course(props: CourseProps): react_jsx_runtime.JSX.Element;
|
|
105
|
+
declare function Lesson(props: LessonProps): react_jsx_runtime.JSX.Element;
|
|
106
|
+
declare function Scenario(props: ScenarioProps): react_jsx_runtime.JSX.Element;
|
|
107
|
+
declare function Reflection(props: ReflectionProps): react_jsx_runtime.JSX.Element;
|
|
108
|
+
declare function KnowledgeCheck(props: KnowledgeCheckProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare function Quiz(props: QuizProps): react_jsx_runtime.JSX.Element;
|
|
110
|
+
declare function ProgressTracker(props: ProgressTrackerProps): react_jsx_runtime.JSX.Element;
|
|
111
111
|
|
|
112
112
|
declare function useLessonkit(): LessonkitRuntime;
|
|
113
113
|
declare function useProgress(): _lessonkit_core.ProgressState;
|
|
114
114
|
declare function useTracking(): {
|
|
115
|
-
track: (name:
|
|
115
|
+
track: <N extends _lessonkit_core.TelemetryEventName>(name: N, data?: _lessonkit_core.TelemetryDataFor<N>, opts?: {
|
|
116
116
|
lessonId?: LessonId;
|
|
117
117
|
}) => void;
|
|
118
118
|
};
|
|
119
119
|
declare function useCompletion(): {
|
|
120
|
-
completeLesson: (lessonId: LessonId
|
|
120
|
+
completeLesson: (lessonId: LessonId, opts?: {
|
|
121
|
+
courseId?: _lessonkit_core.CourseId;
|
|
122
|
+
}) => void;
|
|
121
123
|
completeCourse: () => void;
|
|
122
124
|
};
|
|
123
125
|
declare function useQuizState(enclosingLessonId?: LessonId): {
|
|
@@ -189,8 +191,214 @@ type BlockCatalogEntry = {
|
|
|
189
191
|
manualTracking?: string;
|
|
190
192
|
};
|
|
191
193
|
};
|
|
192
|
-
declare const BLOCK_CATALOG:
|
|
194
|
+
declare const BLOCK_CATALOG: ({
|
|
195
|
+
type: string;
|
|
196
|
+
category: "container";
|
|
197
|
+
description: string;
|
|
198
|
+
props: ({
|
|
199
|
+
name: string;
|
|
200
|
+
type: string;
|
|
201
|
+
required: true;
|
|
202
|
+
description: string;
|
|
203
|
+
} | {
|
|
204
|
+
name: string;
|
|
205
|
+
type: string;
|
|
206
|
+
required: false;
|
|
207
|
+
description: string;
|
|
208
|
+
})[];
|
|
209
|
+
requiredIds: string[];
|
|
210
|
+
a11y: {
|
|
211
|
+
element: string;
|
|
212
|
+
ariaLabel: string;
|
|
213
|
+
keyboard: string;
|
|
214
|
+
notes: string;
|
|
215
|
+
liveRegions?: undefined;
|
|
216
|
+
};
|
|
217
|
+
theming: {
|
|
218
|
+
surface: "global-inherit";
|
|
219
|
+
stylingNotes: string;
|
|
220
|
+
dataAttributes?: undefined;
|
|
221
|
+
};
|
|
222
|
+
telemetry: {
|
|
223
|
+
emits: string[];
|
|
224
|
+
manualTracking?: undefined;
|
|
225
|
+
requiresActiveLesson?: undefined;
|
|
226
|
+
};
|
|
227
|
+
parentConstraints?: undefined;
|
|
228
|
+
optionalIds?: undefined;
|
|
229
|
+
aliases?: undefined;
|
|
230
|
+
} | {
|
|
231
|
+
type: string;
|
|
232
|
+
category: "container";
|
|
233
|
+
description: string;
|
|
234
|
+
props: ({
|
|
235
|
+
name: string;
|
|
236
|
+
type: string;
|
|
237
|
+
required: true;
|
|
238
|
+
description: string;
|
|
239
|
+
} | {
|
|
240
|
+
name: string;
|
|
241
|
+
type: string;
|
|
242
|
+
required: false;
|
|
243
|
+
description: string;
|
|
244
|
+
})[];
|
|
245
|
+
requiredIds: string[];
|
|
246
|
+
parentConstraints: string[];
|
|
247
|
+
a11y: {
|
|
248
|
+
element: string;
|
|
249
|
+
ariaLabel: string;
|
|
250
|
+
keyboard: string;
|
|
251
|
+
notes: string;
|
|
252
|
+
liveRegions?: undefined;
|
|
253
|
+
};
|
|
254
|
+
theming: {
|
|
255
|
+
surface: "global-inherit";
|
|
256
|
+
stylingNotes: string;
|
|
257
|
+
dataAttributes?: undefined;
|
|
258
|
+
};
|
|
259
|
+
telemetry: {
|
|
260
|
+
emits: string[];
|
|
261
|
+
manualTracking?: undefined;
|
|
262
|
+
requiresActiveLesson?: undefined;
|
|
263
|
+
};
|
|
264
|
+
optionalIds?: undefined;
|
|
265
|
+
aliases?: undefined;
|
|
266
|
+
} | {
|
|
267
|
+
type: string;
|
|
268
|
+
category: "content";
|
|
269
|
+
description: string;
|
|
270
|
+
props: ({
|
|
271
|
+
name: string;
|
|
272
|
+
type: string;
|
|
273
|
+
required: false;
|
|
274
|
+
description: string;
|
|
275
|
+
} | {
|
|
276
|
+
name: string;
|
|
277
|
+
type: string;
|
|
278
|
+
required: true;
|
|
279
|
+
description: string;
|
|
280
|
+
})[];
|
|
281
|
+
requiredIds: never[];
|
|
282
|
+
optionalIds: string[];
|
|
283
|
+
parentConstraints: string[];
|
|
284
|
+
a11y: {
|
|
285
|
+
element: string;
|
|
286
|
+
ariaLabel: string;
|
|
287
|
+
keyboard: string;
|
|
288
|
+
notes: string;
|
|
289
|
+
liveRegions?: undefined;
|
|
290
|
+
};
|
|
291
|
+
theming: {
|
|
292
|
+
surface: "global-inherit";
|
|
293
|
+
dataAttributes: string[];
|
|
294
|
+
stylingNotes: string;
|
|
295
|
+
};
|
|
296
|
+
telemetry: {
|
|
297
|
+
emits: never[];
|
|
298
|
+
manualTracking: string;
|
|
299
|
+
requiresActiveLesson?: undefined;
|
|
300
|
+
};
|
|
301
|
+
aliases?: undefined;
|
|
302
|
+
} | {
|
|
303
|
+
type: string;
|
|
304
|
+
category: "content";
|
|
305
|
+
description: string;
|
|
306
|
+
props: {
|
|
307
|
+
name: string;
|
|
308
|
+
type: string;
|
|
309
|
+
required: false;
|
|
310
|
+
description: string;
|
|
311
|
+
}[];
|
|
312
|
+
requiredIds: never[];
|
|
313
|
+
optionalIds: string[];
|
|
314
|
+
parentConstraints: string[];
|
|
315
|
+
a11y: {
|
|
316
|
+
element: string;
|
|
317
|
+
ariaLabel: string;
|
|
318
|
+
keyboard: string;
|
|
319
|
+
notes: string;
|
|
320
|
+
liveRegions?: undefined;
|
|
321
|
+
};
|
|
322
|
+
theming: {
|
|
323
|
+
surface: "global-inherit";
|
|
324
|
+
dataAttributes: string[];
|
|
325
|
+
stylingNotes: string;
|
|
326
|
+
};
|
|
327
|
+
telemetry: {
|
|
328
|
+
emits: never[];
|
|
329
|
+
requiresActiveLesson: true;
|
|
330
|
+
manualTracking: string;
|
|
331
|
+
};
|
|
332
|
+
aliases?: undefined;
|
|
333
|
+
} | {
|
|
334
|
+
type: string;
|
|
335
|
+
aliases: string[];
|
|
336
|
+
category: "assessment";
|
|
337
|
+
description: string;
|
|
338
|
+
props: ({
|
|
339
|
+
name: string;
|
|
340
|
+
type: string;
|
|
341
|
+
required: true;
|
|
342
|
+
description: string;
|
|
343
|
+
} | {
|
|
344
|
+
name: string;
|
|
345
|
+
type: string;
|
|
346
|
+
required: false;
|
|
347
|
+
description: string;
|
|
348
|
+
})[];
|
|
349
|
+
requiredIds: string[];
|
|
350
|
+
parentConstraints: string[];
|
|
351
|
+
a11y: {
|
|
352
|
+
element: string;
|
|
353
|
+
ariaLabel: string;
|
|
354
|
+
keyboard: string;
|
|
355
|
+
liveRegions: string;
|
|
356
|
+
notes: string;
|
|
357
|
+
};
|
|
358
|
+
theming: {
|
|
359
|
+
surface: "global-inherit";
|
|
360
|
+
dataAttributes: string[];
|
|
361
|
+
stylingNotes: string;
|
|
362
|
+
};
|
|
363
|
+
telemetry: {
|
|
364
|
+
emits: string[];
|
|
365
|
+
requiresActiveLesson: true;
|
|
366
|
+
manualTracking?: undefined;
|
|
367
|
+
};
|
|
368
|
+
optionalIds?: undefined;
|
|
369
|
+
} | {
|
|
370
|
+
type: string;
|
|
371
|
+
category: "chrome";
|
|
372
|
+
description: string;
|
|
373
|
+
props: {
|
|
374
|
+
name: string;
|
|
375
|
+
type: string;
|
|
376
|
+
required: false;
|
|
377
|
+
description: string;
|
|
378
|
+
}[];
|
|
379
|
+
requiredIds: never[];
|
|
380
|
+
parentConstraints: string[];
|
|
381
|
+
a11y: {
|
|
382
|
+
element: string;
|
|
383
|
+
ariaLabel: string;
|
|
384
|
+
keyboard: string;
|
|
385
|
+
notes: string;
|
|
386
|
+
liveRegions?: undefined;
|
|
387
|
+
};
|
|
388
|
+
theming: {
|
|
389
|
+
surface: "global-inherit";
|
|
390
|
+
stylingNotes: string;
|
|
391
|
+
dataAttributes?: undefined;
|
|
392
|
+
};
|
|
393
|
+
telemetry: {
|
|
394
|
+
emits: never[];
|
|
395
|
+
manualTracking?: undefined;
|
|
396
|
+
requiresActiveLesson?: undefined;
|
|
397
|
+
};
|
|
398
|
+
optionalIds?: undefined;
|
|
399
|
+
aliases?: undefined;
|
|
400
|
+
})[];
|
|
193
401
|
declare function buildBlockCatalog(): BlockCatalogEntry[];
|
|
194
402
|
declare function getBlockCatalogEntry(type: string): BlockCatalogEntry | undefined;
|
|
195
403
|
|
|
196
|
-
export { BLOCK_CATALOG, type BlockCatalogEntry, type BlockPropSpec, Course, KnowledgeCheck, Lesson, type LessonkitConfig, LessonkitProvider, type LessonkitRuntime, ProgressTracker, Quiz, Reflection, Scenario, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetQuizWarningsForTests, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|
|
404
|
+
export { BLOCK_CATALOG, type BlockCatalogEntry, type BlockPropSpec, Course, type CourseProps, KnowledgeCheck, type KnowledgeCheckProps, Lesson, type LessonProps, type LessonkitConfig, LessonkitProvider, type LessonkitProviderProps, type LessonkitRuntime, ProgressTracker, type ProgressTrackerProps, Quiz, type QuizProps, Reflection, type ReflectionProps, Scenario, type ScenarioProps, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, type ThemeResolvedMode, blockCatalogVersion, buildBlockCatalog, getBlockCatalogEntry, resetQuizWarningsForTests, useCompletion, useLessonkit, useProgress, useQuizState, useTheme, useTracking };
|