@creaditor/course-starterkit

中文文档
0.14.4发布于 2026/11/10ISCES Module近 30 天下载 2638

Creaditor Course Builder - a course channel: sidebar of units & lessons, each lesson edited with the Creaditor

原始使用文档
文档目录6 节
  1. Architecture
  2. Two authoring modes
  3. Lesson types
  4. The quiz element and the shape it stores
  5. Status model (matches the market)
  6. Status

@creaditor/course-starterkit

A course channel for Creaditor — a peer to @creaditor/web-starterkit and @creaditor/newsletter-starterkit. Where those edit a single page, this builds a course: a sidebar of units (drawers) and lessons, where each lesson is one Creaditor page.

Architecture

Three layers, cleanly separated:

@creaditor/course-core        headless · offline · framework-agnostic
  Course → Section → Lesson{ status, access, drip, doc }
  CRUD + events (lesson:created, content:changed, settings:changed, …) + guards

CourseBuilder (this package)  binds course-core ⇄ one Creaditor instance
  openLesson()  → setContent()   editor onSave → setLessonContent()

UI shell (this package)       <course-sidebar> · <lesson-settings> · <course-settings>
  "מבנה הקורס" (manage)  ⇄  "עריכת שיעור" (the Creaditor takes the screen)
  • course-core is the developer surface. It never touches the DOM; every mutation emits an event to persist/track, plus before* guard hooks so production can enforce "locked stays locked" in the core, not just the UI.
  • A lesson is a web page, so lessons are edited with the existing web element catalog (channel: "web") — no new element types required.
  • One editor instance, content swapped per lesson. Each lesson's page is a commands.toJSON() snapshot held in course-core, which keeps the whole course serializable and offline.

Two authoring modes

ModeOwns the screenFor
מבנה הקורסcourse chrome (curriculum + lesson settings)arrange units, set נעול/פורסם/דרוש-שיעור-קודם
עריכת שיעורthe Creaditor + its own design paneledit the lesson page content

Course-settings live in manage mode; page-design lives in the Creaditor — so the two inspector panels never compete for the same edge.

Lesson types

Adding a lesson opens a three-way menu — שיעור (lesson) · בוחן (quiz) · סרטון (video) — and the choice is stored as lesson.type, travels in save-course-structure, and survives a reload.

lesson and quiz have real editors; video does not yet. Picking video sets the type and shows its icon in the sidebar, but opens the ordinary page editor. A quiz lesson opens on a real quiz authoring surface — see The quiz element below.

Requires @creaditor/course-core@^0.2.0. On ^0.1.0 the engine drops type silently, with no error at any layer.

The quiz element and the shape it stores

This package owns the quiz element, so this is where its stored shape is defined. A quiz is a Creaditor element on a lesson's page — not a new document type — registered from the course side through the editor's plugins list. It appears only in the course builder; the web and newsletter editors never see it.

One question type: single-answer multiple choice. The element node is type: "quiz", and everything it owns lives under props.questions:

{
  "questions": [
    {
      "id": "q_48c9574f",
      "text": "What is the capital of France?",
      "options": [
        { "id": "o_959bda38", "text": "Lyon", "correct": false },
        { "id": "o_178416ec", "text": "Paris", "correct": true },
        { "id": "o_855cfa0f", "text": "Marseille", "correct": false }
      ]
    }
  ]
}

A well-formed question holds 2 to 6 options with exactly one marked correct, and non-blank text on the question and every option (whitespace-only input is stored as ""). Those are enforced on authoring transitions, not on data the element did not write — a question that arrives outside them renders as it is and is flagged incomplete, because opening a lesson must never rewrite its stored content.

Two things a host rendering this to learners has to know:

  • text is arbitrary creator-authored content. Escape it exactly as you would any other rich-text field. The element stores it verbatim and never turns it into markup on its own surface; past that boundary it is yours.
  • The correct flags are in the payload. Shipping the whole lesson document to a learner's browser before grading ships them the answer key.

Authoring only. The correct answer is stored because it is authored content; this element evaluates nothing — no scoring, no student answers, no gradebook.

@creaditor/cdtr-course-builder's README is the integration-facing copy: it documents the same shape beside the save-lesson-data event that carries it.

Status model (matches the market)

  • lifecycle — draft → published
  • access — free (preview) · locked (needs enrollment)

Independent axes: a lesson can be published but locked.

Status

  • ✅ @creaditor/course-core — engine + tests (npm test)
  • ✅ CourseBuilder — editor-binding host (this file)
  • ✅ UI shell — <course-sidebar> + <lesson-settings> + <course-settings>, vanilla web components
  • ✅ Lesson types recorded (lesson / quiz / video)
  • ✅ Quiz element — single-answer multiple choice, authoring only
  • ⬜ Video lesson editor + completion-gating settings
  • ⬜ Production render / SSR with locked-content enforcement

版本与发布记录

@creaditor/course-starterkit 共发布 25 个版本,首次发布于 2026/08/15;过去 12 个月发布了 25 个版本。

版本发布日期距今
0.14.4latest2026/11/101 天前
0.14.32026/11/065 天前
0.14.22026/11/046 天前
0.14.12026/11/028 天前
0.14.02026/10/2813 天前
0.13.12026/10/2615 天前

关于 @creaditor/course-starterkit 的常见问题

@creaditor/course-starterkit 是什么?

Creaditor Course Builder - a course channel: sidebar of units & lessons, each lesson edited with the Creaditor

如何安装 @creaditor/course-starterkit?

在项目目录运行 npm install @creaditor/course-starterkit,或使用 pnpm add / yarn add / bun add。

@creaditor/course-starterkit 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/creaditor__course-starterkit 是否存在。

@creaditor/course-starterkit 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@creaditor/course-starterkit 可以商用吗?

@creaditor/course-starterkit 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@creaditor/course-starterkit 的下载量有多少?

根据 npm 官方下载统计,@creaditor/course-starterkit 在 2026/10/11 – 2026/11/09 这 30 天内被下载 2,638 次,日均约 88 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@creaditor/course-starterkit 还在维护吗?

最新版本 0.14.4 发布于 2026/11/10(1 天前);至今共发布 25 个版本,其中过去 12 个月发布了 25 个;首次发布于 2026/08/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。