@lessonkit/react 1.0.2 → 1.2.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 -4
- package/block-catalog.v2.json +770 -0
- package/block-catalog.v3.json +1504 -0
- package/block-contract.v2.json +104 -0
- package/block-contract.v3.json +110 -0
- package/dist/index.cjs +2960 -336
- package/dist/index.d.cts +293 -18
- package/dist/index.d.ts +293 -18
- package/dist/index.js +2929 -315
- package/package.json +17 -9
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@ Optional: `@lessonkit/xapi`, `@lessonkit/themes`, `@lessonkit/accessibility`
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
+
`Course` wraps `LessonkitProvider`—pass `config` on `Course` unless you need a custom provider tree.
|
|
20
|
+
|
|
19
21
|
```tsx
|
|
20
22
|
import { useMemo } from "react";
|
|
21
23
|
import { Course, Lesson, Quiz, ProgressTracker, ThemeProvider } from "@lessonkit/react";
|
|
@@ -43,21 +45,32 @@ export default function App() {
|
|
|
43
45
|
|
|
44
46
|
## API
|
|
45
47
|
|
|
46
|
-
**
|
|
48
|
+
**Structure:** `Course`, `Lesson`, `Scenario`, `Quiz`, `KnowledgeCheck`, `Reflection`, `ProgressTracker`, `ThemeProvider`, `LessonkitProvider`
|
|
49
|
+
|
|
50
|
+
**Compound:** `Page`, `InteractiveBook`, `AssessmentSequence` — types: `CompoundHandle`, `CompoundResumeState`, `CompoundBaseProps`
|
|
51
|
+
|
|
52
|
+
**Content:** `Text`, `Heading`, `Image`
|
|
53
|
+
|
|
54
|
+
**Assessments:** `TrueFalse`, `MarkTheWords`, `FillInTheBlanks`, `DragTheWords`, `DragAndDrop`, `FindHotspot`, `FindMultipleHotspots`
|
|
55
|
+
|
|
56
|
+
**Presentation:** `Accordion`, `DialogCards`, `Flashcards`, `ImageHotspots`, `ImageSlider`
|
|
57
|
+
|
|
58
|
+
**Hooks:** `useProgress`, `useTracking`, `useQuizState`, `useAssessmentState`, `useCompletion`, `useLessonkit`, `useTheme`
|
|
47
59
|
|
|
48
|
-
**
|
|
60
|
+
**Runtime (re-exported from `@lessonkit/core`):** `createLessonkitRuntime`, `buildTelemetryEvent`, `createPluginRegistry`, `defineAssessmentPlugin`, `defineLifecyclePlugin`, `defineTelemetryPlugin` — use `@lessonkit/core` directly for headless runtimes.
|
|
49
61
|
|
|
50
|
-
**Catalog:** `@lessonkit/react/block-catalog.v1.json`
|
|
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.
|
|
51
63
|
|
|
52
64
|
## Tips
|
|
53
65
|
|
|
54
66
|
- Hoist `config` with `useMemo` so tracking/xAPI clients are not recreated every render.
|
|
55
67
|
- xAPI is on by default; provide `xapi.transport` or statements queue in memory.
|
|
56
68
|
- Lessons complete on unmount or when another lesson becomes active via `setActiveLesson`.
|
|
69
|
+
- 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.
|
|
57
70
|
|
|
58
71
|
## Docs
|
|
59
72
|
|
|
60
|
-
[Components & hooks](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/components-and-hooks.html) · [Block catalog](https://lessonkit.readthedocs.io/en/latest/reference/block-catalog.html) · [Theming](https://lessonkit.readthedocs.io/en/latest/reference/theming.html) · [Storybook](https://github.
|
|
73
|
+
[Components & hooks](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/components-and-hooks.html) · [5-minute guide](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/getting-started-in-5-minutes.html) · [Block catalog](https://lessonkit.readthedocs.io/en/latest/reference/block-catalog.html) · [Theming](https://lessonkit.readthedocs.io/en/latest/reference/theming.html) · [Storybook](https://eddiethedean.github.io/lessonkit/storybook/) · [API index](https://lessonkit.readthedocs.io/en/latest/reference/api.html)
|
|
61
74
|
|
|
62
75
|
## License
|
|
63
76
|
|