@lessonkit/react 1.4.0 → 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 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(() => ({ tracking: { sink: console.log } }), []);
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
- **Content:** `Text`, `Heading`, `Image`
59
+ **Assessments:** `TrueFalse`, `MarkTheWords`, `FillInTheBlanks`, `DragTheWords`, `DragAndDrop`, `FindHotspot`, `FindMultipleHotspots`, `Summary`, `ImagePairing`, `ImageSequencing`, `ArithmeticQuiz`, `Essay`
53
60
 
54
- **Assessments:** `TrueFalse`, `MarkTheWords`, `FillInTheBlanks`, `DragTheWords`, `DragAndDrop`, `FindHotspot`, `FindMultipleHotspots`
61
+ **Presentation:** `Accordion`, `DialogCards`, `Flashcards`, `ImageHotspots`, `ImageSlider`, `MemoryGame`, `InformationWall`, `ParallaxSlideshow`, `Questionnaire`, `Embed`, `Chart`
55
62
 
56
- **Presentation:** `Accordion`, `DialogCards`, `Flashcards`, `ImageHotspots`, `ImageSlider`
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 (`{ version: 2 }` for the 1.1.x shape). JSON: `@lessonkit/react/block-catalog.v1.json`, `.v2.json`, `.v3.json` — `getBlockCatalogEntry()`, `BLOCK_CATALOG_V3`, etc.
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
- - xAPI is on by default; provide `xapi.transport` or statements queue in memory.
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