@beanchain/handbook-lms 0.1.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/CHANGELOG.md +26 -0
- package/README.md +149 -0
- package/dist/adapter/index.cjs +4 -0
- package/dist/adapter/index.cjs.map +1 -0
- package/dist/adapter/index.d.cts +1 -0
- package/dist/adapter/index.d.ts +1 -0
- package/dist/adapter/index.js +3 -0
- package/dist/adapter/index.js.map +1 -0
- package/dist/chunk-6Z77HGDR.js +2384 -0
- package/dist/chunk-6Z77HGDR.js.map +1 -0
- package/dist/chunk-GZIXEHPW.js +268 -0
- package/dist/chunk-GZIXEHPW.js.map +1 -0
- package/dist/chunk-HOQRIQ33.js +3 -0
- package/dist/chunk-HOQRIQ33.js.map +1 -0
- package/dist/chunk-N4WYUTCR.js +264 -0
- package/dist/chunk-N4WYUTCR.js.map +1 -0
- package/dist/chunk-PYWAXMRT.js +6 -0
- package/dist/chunk-PYWAXMRT.js.map +1 -0
- package/dist/chunk-UVF7B4L2.js +73 -0
- package/dist/chunk-UVF7B4L2.js.map +1 -0
- package/dist/chunk-VRHNGFUG.js +90 -0
- package/dist/chunk-VRHNGFUG.js.map +1 -0
- package/dist/config/index.cjs +8 -0
- package/dist/config/index.cjs.map +1 -0
- package/dist/config/index.d.cts +52 -0
- package/dist/config/index.d.ts +52 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/contracts/index.cjs +307 -0
- package/dist/contracts/index.cjs.map +1 -0
- package/dist/contracts/index.d.cts +3034 -0
- package/dist/contracts/index.d.ts +3034 -0
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/core/index.cjs +107 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +293 -0
- package/dist/core/index.d.ts +293 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index-caUTkZqX.d.cts +321 -0
- package/dist/index-caUTkZqX.d.ts +321 -0
- package/dist/index.cjs +3129 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +77 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +18 -0
- package/dist/react/index.d.ts +18 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react-headless/index.cjs +268 -0
- package/dist/react-headless/index.cjs.map +1 -0
- package/dist/react-headless/index.d.cts +181 -0
- package/dist/react-headless/index.d.ts +181 -0
- package/dist/react-headless/index.js +3 -0
- package/dist/react-headless/index.js.map +1 -0
- package/dist/react-mui/index.cjs +2653 -0
- package/dist/react-mui/index.cjs.map +1 -0
- package/dist/react-mui/index.d.cts +53 -0
- package/dist/react-mui/index.d.ts +53 -0
- package/dist/react-mui/index.js +4 -0
- package/dist/react-mui/index.js.map +1 -0
- package/package.json +85 -0
- package/sql/README.md +80 -0
- package/sql/blueprint.sql +7 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@beanchain/handbook-lms` are documented here.
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-02-23
|
|
6
|
+
|
|
7
|
+
- Added strict domain-agnostic config module (`/config`) with `defineHandbookLmsConfig`.
|
|
8
|
+
- Added expanded adapter contract (`/adapter`) for curriculum CRUD/reorder and review workflows.
|
|
9
|
+
- Added headless hooks (`/react-headless`) for curriculum editor, learner review, and learner learning workspace state.
|
|
10
|
+
- Added prebuilt MUI components (`/react-mui`) for curriculum editing, learner review, and learner learning workspaces.
|
|
11
|
+
- Added canonical `contracts` zod schema surface for LMS entities and mutation payloads.
|
|
12
|
+
- Added adapter-boundary schema validation in host adapters to enforce canonical payloads at runtime.
|
|
13
|
+
- Parity pass: added module drag-and-drop reordering, slug-mode controls, markdown stage editing, and review follow-up history/diff UX in shared MUI components.
|
|
14
|
+
- Learning parity pass: added shared multi-stage stepper, autosave markdown responses, mobile module drawer, and follow-up assignment diff/submit UX.
|
|
15
|
+
- Added optional `notifications` callbacks for package editor/review/learning workspaces so host apps can plug in their own toast/notification systems.
|
|
16
|
+
- Added strict UI config keys for learning autosave notices (`labels.autosaveNotice`, `workflow.enableAutosaveNotifications`, `workflow.autosaveNotificationCooldownMs`).
|
|
17
|
+
- Expanded canonical core LMS types to include learning summaries, assignments, and mutation payloads.
|
|
18
|
+
- Added integration tests for Team Courses and Solution Seeking wrapper pages consuming package editor/review components.
|
|
19
|
+
- Documented provider-agnostic SQL setup with Supabase appendix guidance.
|
|
20
|
+
|
|
21
|
+
## [0.1.0] - 2026-02-23
|
|
22
|
+
|
|
23
|
+
- Initial package scaffold with `core`, `react`, `contracts`, and `sql` modules.
|
|
24
|
+
- Added LMS adapter interface for host apps.
|
|
25
|
+
- Added reusable course library React component.
|
|
26
|
+
- Added `tsup` build pipeline for compiled JS + type declarations in `dist/`.
|
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# @beanchain/handbook-lms
|
|
2
|
+
|
|
3
|
+
Reusable package for Handbook LMS logic.
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
- `@beanchain/handbook-lms/core`: Canonical LMS types, schemas, and shared contracts.
|
|
8
|
+
- `@beanchain/handbook-lms/adapter`: Adapter interfaces for host data integration.
|
|
9
|
+
- `@beanchain/handbook-lms/config`: Strict UI config contract and `defineHandbookLmsConfig` helper.
|
|
10
|
+
- `@beanchain/handbook-lms/react-headless`: Headless editor/review/learning hooks.
|
|
11
|
+
- `@beanchain/handbook-lms/react-mui`: Prebuilt MUI editor/review/learning components.
|
|
12
|
+
- `@beanchain/handbook-lms/react`: Legacy provider + headless course library component.
|
|
13
|
+
- `@beanchain/handbook-lms/contracts`: HTTP endpoint constants and helpers.
|
|
14
|
+
- `@beanchain/handbook-lms/sql`: Provider-agnostic DB guidance + Supabase appendix.
|
|
15
|
+
|
|
16
|
+
## Canonical contracts
|
|
17
|
+
|
|
18
|
+
Use `@beanchain/handbook-lms/contracts` for canonical runtime schemas:
|
|
19
|
+
|
|
20
|
+
- Entity schemas: course, section/module/stage/question hierarchy, progress, assignments, learning summary.
|
|
21
|
+
- Mutation schemas: curriculum CRUD payloads, reorder payloads, review payloads, assignment update payloads.
|
|
22
|
+
|
|
23
|
+
These schemas are intended for adapter-boundary validation only. Package hooks/components assume canonical data and should not receive domain-specific field names.
|
|
24
|
+
|
|
25
|
+
## Adapter boundary pattern
|
|
26
|
+
|
|
27
|
+
Validate requests/responses in host adapters before crossing the package boundary:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import {
|
|
31
|
+
handbookLmsSectionListSchema,
|
|
32
|
+
handbookLmsReviewModuleInputSchema
|
|
33
|
+
} from "@beanchain/handbook-lms/contracts";
|
|
34
|
+
|
|
35
|
+
const curriculum = handbookLmsSectionListSchema.parse(await apiFetch("/api/lms-courses/.../curriculum"));
|
|
36
|
+
const reviewPayload = handbookLmsReviewModuleInputSchema.parse(input);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If your backend uses different naming, map to canonical package fields in the adapter (for example `target_exercise_ids -> target_question_ids`).
|
|
40
|
+
|
|
41
|
+
## Host app setup checklist
|
|
42
|
+
|
|
43
|
+
- Implement `HandbookLmsAdapter` per domain (`team courses`, `solution seeking`, etc.).
|
|
44
|
+
- Define strict UI config with `defineHandbookLmsConfig`.
|
|
45
|
+
- Keep backend endpoints + database migrations in host repo.
|
|
46
|
+
- Pass only canonical models into package hooks/components.
|
|
47
|
+
- Optionally pass `notifications` callbacks into package UI components to integrate host-level toast systems.
|
|
48
|
+
|
|
49
|
+
## UI config reference
|
|
50
|
+
|
|
51
|
+
All keys in `HandbookLmsUiConfig` are required and strongly typed.
|
|
52
|
+
|
|
53
|
+
Autosave notification keys:
|
|
54
|
+
|
|
55
|
+
- `labels.autosaveNotice`: Message used for autosave success notices.
|
|
56
|
+
- `workflow.enableAutosaveNotifications`: Enables/disables autosave notices from learning workspace.
|
|
57
|
+
- `workflow.autosaveNotificationCooldownMs`: Minimum interval between autosave notices.
|
|
58
|
+
|
|
59
|
+
Recommended defaults:
|
|
60
|
+
|
|
61
|
+
- `workflow.enableAutosaveNotifications: true`
|
|
62
|
+
- `workflow.autosaveNotificationCooldownMs: 12000`
|
|
63
|
+
- `labels.autosaveNotice: "Progress autosaved."`
|
|
64
|
+
|
|
65
|
+
Example:
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { defineHandbookLmsConfig } from "@beanchain/handbook-lms/config";
|
|
69
|
+
|
|
70
|
+
export const lmsConfig = defineHandbookLmsConfig({
|
|
71
|
+
labels: {
|
|
72
|
+
editorTitle: "Course Editor",
|
|
73
|
+
reviewTitle: "Course Review",
|
|
74
|
+
backButton: "Back",
|
|
75
|
+
addSection: "Add section",
|
|
76
|
+
addModule: "Add module",
|
|
77
|
+
addStage: "Add stage",
|
|
78
|
+
addQuestion: "Add question",
|
|
79
|
+
editAction: "Edit",
|
|
80
|
+
archiveAction: "Archive",
|
|
81
|
+
restoreAction: "Restore",
|
|
82
|
+
saveAction: "Save",
|
|
83
|
+
cancelAction: "Cancel",
|
|
84
|
+
saveResponseAction: "Save response",
|
|
85
|
+
submitModuleAction: "Submit module",
|
|
86
|
+
passAction: "Mark passed",
|
|
87
|
+
requestRevisionAction: "Request revision",
|
|
88
|
+
applyStatusAction: "Apply status",
|
|
89
|
+
noModulesMessage: "No modules are currently configured.",
|
|
90
|
+
autosaveNotice: "Progress autosaved."
|
|
91
|
+
},
|
|
92
|
+
workflow: {
|
|
93
|
+
enableModuleDragAndDrop: true,
|
|
94
|
+
enableStatusOverride: true,
|
|
95
|
+
enableFollowUpAssignments: true,
|
|
96
|
+
enableTargetedQuestionSelection: true,
|
|
97
|
+
enableAutosaveNotifications: true,
|
|
98
|
+
autosaveNotificationCooldownMs: 12000
|
|
99
|
+
},
|
|
100
|
+
validation: {
|
|
101
|
+
slugPattern: /^[a-z0-9]+(?:-[a-z0-9]+)*$/,
|
|
102
|
+
slugPatternMessage: "Use lowercase letters, numbers, and single dashes only.",
|
|
103
|
+
requiredTitleMessage: "Title is required.",
|
|
104
|
+
requiredSlugMessage: "Slug is required.",
|
|
105
|
+
requiredSummaryMessage: "Summary is required.",
|
|
106
|
+
requiredPromptMessage: "Prompt is required."
|
|
107
|
+
},
|
|
108
|
+
naming: {
|
|
109
|
+
course: "Course",
|
|
110
|
+
section: "Section",
|
|
111
|
+
module: "Module",
|
|
112
|
+
stage: "Stage",
|
|
113
|
+
question: "Question",
|
|
114
|
+
learner: "Learner",
|
|
115
|
+
reviewer: "Reviewer",
|
|
116
|
+
assignment: "Assignment"
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Notes:
|
|
122
|
+
|
|
123
|
+
- Autosave notices are emitted through `notifications` callbacks passed to `HandbookLmsLearningWorkspace`.
|
|
124
|
+
- If no external notification callbacks are provided, autosave notices are suppressed by default.
|
|
125
|
+
- Manual save/submit notifications still work through the existing notification pathways.
|
|
126
|
+
|
|
127
|
+
## Semver policy
|
|
128
|
+
|
|
129
|
+
- `MAJOR`: Breaking API or schema contract changes.
|
|
130
|
+
- `MINOR`: Backward-compatible API additions.
|
|
131
|
+
- `PATCH`: Bug fixes and documentation-only updates.
|
|
132
|
+
|
|
133
|
+
## Publishing
|
|
134
|
+
|
|
135
|
+
This package is published to npm using the workflow at `.github/workflows/publish-handbook-lms.yml`.
|
|
136
|
+
|
|
137
|
+
## Local development
|
|
138
|
+
|
|
139
|
+
- Build compiled outputs: `npm run build --workspace @beanchain/handbook-lms`
|
|
140
|
+
- Typecheck package only: `npm run typecheck --workspace @beanchain/handbook-lms`
|
|
141
|
+
|
|
142
|
+
## Peer dependencies
|
|
143
|
+
|
|
144
|
+
- `react`
|
|
145
|
+
- `@mui/material`
|
|
146
|
+
- `@mui/icons-material`
|
|
147
|
+
- `@hello-pangea/dnd`
|
|
148
|
+
- `@uiw/react-md-editor`
|
|
149
|
+
- `zod`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { D as HandbookLmsAdapter } from '../index-caUTkZqX.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { D as HandbookLmsAdapter } from '../index-caUTkZqX.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|