@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/README.md
CHANGED
|
@@ -12,7 +12,7 @@ React components and hooks for authoring LessonKit courses.
|
|
|
12
12
|
npm install @lessonkit/react react react-dom
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Optional: `@lessonkit/xapi`, `@lessonkit/themes`, `@lessonkit/accessibility`
|
|
15
|
+
Optional: `@lessonkit/xapi`, `@lessonkit/themes`, `@lessonkit/accessibility`, `@lessonkit/cli` (devDependency for packaging)
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
@@ -23,7 +23,10 @@ import { useMemo } from "react";
|
|
|
23
23
|
import { Course, Lesson, Quiz, ProgressTracker, ThemeProvider } from "@lessonkit/react";
|
|
24
24
|
|
|
25
25
|
export default function App() {
|
|
26
|
-
const config = useMemo(
|
|
26
|
+
const config = useMemo(
|
|
27
|
+
() => ({ tracking: { enabled: false }, xapi: { enabled: false } }),
|
|
28
|
+
[],
|
|
29
|
+
);
|
|
27
30
|
|
|
28
31
|
return (
|
|
29
32
|
<ThemeProvider mode="light">
|
|
@@ -43,28 +46,33 @@ export default function App() {
|
|
|
43
46
|
}
|
|
44
47
|
```
|
|
45
48
|
|
|
49
|
+
For telemetry and xAPI in dev and production, use `npx @lessonkit/cli init` (includes `src/courseConfig.ts`) or follow the [quickstart](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/quickstart.html). Production builds reject console-only sinks unless you wire real transports—see the [production checklist](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/production-checklist.html).
|
|
50
|
+
|
|
46
51
|
## API
|
|
47
52
|
|
|
48
53
|
**Structure:** `Course`, `Lesson`, `Scenario`, `Quiz`, `KnowledgeCheck`, `Reflection`, `ProgressTracker`, `ThemeProvider`, `LessonkitProvider`
|
|
49
54
|
|
|
50
|
-
**Compound:** `Page`, `InteractiveBook`, `AssessmentSequence` — types: `CompoundHandle`, `CompoundResumeState`, `CompoundBaseProps`
|
|
55
|
+
**Compound:** `Page`, `InteractiveBook`, `Slide`, `SlideDeck`, `InteractiveVideo`, `TimedCue`, `BranchingScenario`, `BranchNode`, `BranchChoice`, `AssessmentSequence` — types: `CompoundHandle`, `CompoundResumeState`, `CompoundBaseProps`
|
|
56
|
+
|
|
57
|
+
**Content:** `Text`, `Heading`, `Image`, `Video`
|
|
51
58
|
|
|
52
|
-
**
|
|
59
|
+
**Assessments:** `TrueFalse`, `MarkTheWords`, `FillInTheBlanks`, `DragTheWords`, `DragAndDrop`, `FindHotspot`, `FindMultipleHotspots`, `Summary`, `ImagePairing`, `ImageSequencing`, `ArithmeticQuiz`, `Essay`
|
|
53
60
|
|
|
54
|
-
**
|
|
61
|
+
**Presentation:** `Accordion`, `DialogCards`, `Flashcards`, `ImageHotspots`, `ImageSlider`, `MemoryGame`, `InformationWall`, `ParallaxSlideshow`, `Questionnaire`, `Embed`, `Chart`
|
|
55
62
|
|
|
56
|
-
**
|
|
63
|
+
**Tree-shake friendly blocks:** `import { Quiz } from "@lessonkit/react/blocks"`
|
|
57
64
|
|
|
58
|
-
**Hooks:** `useProgress`, `useTracking`, `useQuizState`, `useAssessmentState`, `useCompletion`, `useLessonkit`, `useTheme`
|
|
65
|
+
**Hooks:** `useProgress`, `useTracking`, `useQuizState`, `useAssessmentState`, `useCompletion`, `useLessonkit`, `useTheme`, `useBranchingScenario`
|
|
59
66
|
|
|
60
67
|
**Runtime (re-exported from `@lessonkit/core`):** `createLessonkitRuntime`, `buildTelemetryEvent`, `createPluginRegistry`, `defineAssessmentPlugin`, `defineLifecyclePlugin`, `defineTelemetryPlugin` — use `@lessonkit/core` directly for headless runtimes.
|
|
61
68
|
|
|
62
|
-
**Catalog:** `buildBlockCatalog()` defaults to **v3** in 1.2.0
|
|
69
|
+
**Catalog:** `buildBlockCatalog()` defaults to **v3** in 1.2.0+. JSON: `@lessonkit/react/block-catalog.v3.json` — `getBlockCatalogEntry()`, `BLOCK_CATALOG_V3`, etc.
|
|
63
70
|
|
|
64
71
|
## Tips
|
|
65
72
|
|
|
66
73
|
- Hoist `config` with `useMemo` so tracking/xAPI clients are not recreated every render.
|
|
67
|
-
-
|
|
74
|
+
- Tracking is enabled by default when `config.tracking` is omitted—provide a sink or set `tracking: { enabled: false }`.
|
|
75
|
+
- xAPI is on by default; provide `xapi.transport` or set `xapi: { enabled: false }`.
|
|
68
76
|
- Lessons complete on unmount or when another lesson becomes active via `setActiveLesson`.
|
|
69
77
|
- Compound resume: use a unique `blockId` when `persistCompoundState` is enabled; see [SECURITY.md](https://github.com/eddiethedean/lessonkit/blob/main/SECURITY.md) for shared-device guidance.
|
|
70
78
|
|