@lessonkit/react 0.4.0 → 0.6.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
@@ -1,6 +1,6 @@
1
1
  # `@lessonkit/react`
2
2
 
3
- [![CI](https://github.com/eddiethedean/lessonkit/actions/workflows/checks.yml/badge.svg)](https://github.com/eddiethedean/lessonkit/actions/workflows/checks.yml)
3
+ [![CI](https://github.com/eddiethedean/lessonkit/actions/workflows/ci.yml/badge.svg)](https://github.com/eddiethedean/lessonkit/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/@lessonkit/react.svg)](https://www.npmjs.com/package/@lessonkit/react)
5
5
  [![License](https://img.shields.io/github/license/eddiethedean/lessonkit)](../../LICENSE)
6
6
 
@@ -44,6 +44,7 @@ export default function App() {
44
44
  </Scenario>
45
45
 
46
46
  <Quiz
47
+ checkId="first-step"
47
48
  question="What should you do first?"
48
49
  choices={["Open attachment", "Verify sender"]}
49
50
  answer="Verify sender"
@@ -55,16 +56,15 @@ export default function App() {
55
56
  }
56
57
  ```
57
58
 
58
- ## API (0.4.0)
59
+ ## API (0.6.0)
59
60
 
60
61
  ### Components
61
62
 
62
- - `Course`
63
- - `Lesson`
64
- - `Scenario`
65
- - `Quiz`
66
- - `Reflection`
67
- - `KnowledgeCheck`
63
+ - `Course` — requires `courseId`
64
+ - `Lesson` — requires `lessonId`
65
+ - `Scenario` — optional `blockId`
66
+ - `Quiz` / `KnowledgeCheck` — require `checkId`
67
+ - `Reflection` — optional `blockId`
68
68
  - `ProgressTracker`
69
69
 
70
70
  ### Hooks
@@ -87,10 +87,17 @@ export default function App() {
87
87
  - `Course` accepts a `config` prop that is passed through to `LessonkitProvider` (tracking sink,
88
88
  optional `xapi.transport` or custom `xapi.client`, session metadata). Hoist `config` with `useMemo`
89
89
  so tracking/xAPI clients are not recreated every render.
90
- - When a `<Lesson>` unmounts (for example, wizard navigation), it automatically calls `completeLesson`
91
- for that lesson. Use stable `lessonId` values so completion and time-on-task telemetry stay consistent.
90
+ - xAPI is enabled by default unless `xapi.enabled: false`. Provide `xapi.transport` or `xapi.client`
91
+ or statements are queued in memory and never sent (dev warns once).
92
+ - A lesson is marked complete when its `<Lesson>` unmounts (for example, wizard navigation) or when
93
+ another lesson becomes active via `setActiveLesson`. Use stable `lessonId` values so completion and
94
+ time-on-task telemetry stay consistent.
95
+ - `<Lesson>` defers completion on unmount so React Strict Mode remounts in development do not emit
96
+ spurious `lesson_completed` events; completion runs after the component leaves the tree.
92
97
  - If you omit `session.sessionId`, the provider reuses a tab-scoped id via `sessionStorage` so React
93
98
  Strict Mode remounts do not split analytics sessions in development.
99
+ - In development, invalid `courseId` / `lessonId` / `checkId` values log a one-time `console.warn`.
94
100
  - Accessibility guidance lives in [`docs/ACCESSIBILITY.md`](../../docs/ACCESSIBILITY.md).
95
101
  - Theming and token catalog: [`docs/THEMING.md`](../../docs/THEMING.md).
102
+ - Identity and telemetry: [`docs/IDENTITY.md`](../../docs/IDENTITY.md), [`docs/TELEMETRY.md`](../../docs/TELEMETRY.md).
96
103