@mechane-ai/elements 0.47.0 → 0.48.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.
Files changed (204) hide show
  1. package/README.md +288 -5
  2. package/bin/mechane-elements-catalog.mjs +104 -12
  3. package/dist/article-BXZr10QQ.js +1904 -0
  4. package/dist/article.js +1 -0
  5. package/dist/catalog.json +1389 -75
  6. package/dist/{categorical-values-DdfGIowV.js → categorical-values-BpVq8cFj.js} +1 -1
  7. package/dist/{cells--Bd1fQFR.js → cells-xVmnQ9oQ.js} +1 -1
  8. package/dist/charts/cartesian.js +1 -1
  9. package/dist/charts/cells.js +1 -1
  10. package/dist/charts/comparison.js +1 -1
  11. package/dist/charts/distribution.js +1 -1
  12. package/dist/charts/figure.js +12 -12
  13. package/dist/charts/graph.js +1 -1
  14. package/dist/charts/hierarchy.js +1 -1
  15. package/dist/charts/image.js +1 -1
  16. package/dist/charts/matrix.js +3 -2
  17. package/dist/charts/plot.js +4 -4
  18. package/dist/charts/relationship.js +1 -1
  19. package/dist/charts/text.js +1 -1
  20. package/dist/charts/timeline.js +1 -1
  21. package/dist/charts/trend.js +1 -1
  22. package/dist/charts.js +2 -2
  23. package/dist/clock-DSm5lkNE.js +16 -0
  24. package/dist/collections.js +1 -1
  25. package/dist/describe-lesson-BmREzDpt.js +175 -0
  26. package/dist/{dumbbell-plot-B2ZTgQaI.js → dumbbell-plot-DQdTxDeO.js} +6 -5
  27. package/dist/{embedding-map-CGM_k6lC.js → embedding-map-CF-J-8JW.js} +5 -5
  28. package/dist/{figure-frame-wRkIEAwe.js → figure-frame-BJ3REgTA.js} +1 -1
  29. package/dist/forms.js +1 -1
  30. package/dist/{image-grid-CVA4SOy_.js → image-grid-Dl2sjIMB.js} +3 -3
  31. package/dist/kits/evaluation.js +5 -5
  32. package/dist/kits/interpretability.js +9 -9
  33. package/dist/kits/operations.js +4 -4
  34. package/dist/kits/training.js +4 -4
  35. package/dist/lesson/agent.js +811 -0
  36. package/dist/lesson/spec.js +661 -0
  37. package/dist/lesson.js +5 -0
  38. package/dist/mdx.js +227 -0
  39. package/dist/packages/charts/src/matrix/index.d.ts +1 -0
  40. package/dist/packages/charts/src/plot/plot-marks.d.ts +7 -3
  41. package/dist/packages/teaching/src/agent/index.d.ts +11 -0
  42. package/dist/packages/teaching/src/agent/learner-trace.d.ts +84 -0
  43. package/dist/packages/teaching/src/agent/lesson-bridge.d.ts +59 -0
  44. package/dist/packages/teaching/src/agent/lesson-tour.d.ts +63 -0
  45. package/dist/packages/teaching/src/agent/tutor-tools.d.ts +86 -0
  46. package/dist/packages/teaching/src/article/article-checks.d.ts +9 -0
  47. package/dist/packages/teaching/src/article/article-context.d.ts +49 -0
  48. package/dist/packages/teaching/src/article/article-error.d.ts +12 -0
  49. package/dist/packages/teaching/src/article/article-labels.d.ts +54 -0
  50. package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +14 -0
  51. package/dist/packages/teaching/src/article/article-outline.d.ts +9 -0
  52. package/dist/packages/teaching/src/article/article.d.ts +42 -0
  53. package/dist/packages/teaching/src/article/beat-steps.d.ts +18 -0
  54. package/dist/packages/teaching/src/article/beat.d.ts +16 -0
  55. package/dist/packages/teaching/src/article/challenge.d.ts +29 -0
  56. package/dist/packages/teaching/src/article/exercise-styles.d.ts +76 -0
  57. package/dist/packages/teaching/src/article/figure.d.ts +51 -0
  58. package/dist/packages/teaching/src/article/index.d.ts +31 -0
  59. package/dist/packages/teaching/src/article/lesson-values.d.ts +5 -0
  60. package/dist/packages/teaching/src/article/notes.d.ts +36 -0
  61. package/dist/packages/teaching/src/article/outline-types.d.ts +73 -0
  62. package/dist/packages/teaching/src/article/predict.d.ts +58 -0
  63. package/dist/packages/teaching/src/article/progress-store.d.ts +64 -0
  64. package/dist/packages/teaching/src/article/scrolly.d.ts +26 -0
  65. package/dist/packages/{kits/src/explainers → teaching/src/article}/term.d.ts +8 -2
  66. package/dist/packages/teaching/src/article/tex.d.ts +12 -0
  67. package/dist/packages/teaching/src/article/view-essay.d.ts +13 -0
  68. package/dist/packages/teaching/src/article/view-present.d.ts +8 -0
  69. package/dist/packages/teaching/src/article/view-sheet.d.ts +7 -0
  70. package/dist/packages/teaching/src/article/view-static.d.ts +7 -0
  71. package/dist/packages/teaching/src/article/walk.d.ts +34 -0
  72. package/dist/packages/teaching/src/lesson/define-lesson.d.ts +136 -0
  73. package/dist/packages/teaching/src/lesson/index.d.ts +24 -0
  74. package/dist/packages/teaching/src/lesson/inline-choice.d.ts +12 -0
  75. package/dist/packages/teaching/src/lesson/lesson-context.d.ts +18 -0
  76. package/dist/packages/teaching/src/lesson/lesson-error.d.ts +12 -0
  77. package/dist/packages/teaching/src/lesson/lesson-locale.d.ts +4 -0
  78. package/dist/packages/teaching/src/lesson/lesson-persistence.d.ts +17 -0
  79. package/dist/packages/teaching/src/lesson/lesson-player.d.ts +51 -0
  80. package/dist/packages/teaching/src/lesson/lesson-store.d.ts +84 -0
  81. package/dist/packages/teaching/src/lesson/lesson.d.ts +39 -0
  82. package/dist/packages/teaching/src/lesson/param-controls.d.ts +14 -0
  83. package/dist/packages/teaching/src/lesson/param.d.ts +34 -0
  84. package/dist/packages/teaching/src/lesson/playback.d.ts +42 -0
  85. package/dist/packages/teaching/src/lesson/transport.d.ts +19 -0
  86. package/dist/packages/teaching/src/lesson/use-lesson.d.ts +36 -0
  87. package/dist/packages/teaching/src/mdx/essay-components.d.ts +79 -0
  88. package/dist/packages/teaching/src/mdx/essay-markdown.d.ts +41 -0
  89. package/dist/packages/teaching/src/mdx/essay.d.ts +32 -0
  90. package/dist/packages/teaching/src/mdx/index.d.ts +9 -0
  91. package/dist/packages/teaching/src/mdx/requested-view.d.ts +6 -0
  92. package/dist/packages/teaching/src/scene/flow/flow-layout.d.ts +38 -0
  93. package/dist/packages/teaching/src/scene/flow/flow-pulse.d.ts +16 -0
  94. package/dist/packages/teaching/src/scene/flow/scene-flow.d.ts +81 -0
  95. package/dist/packages/teaching/src/scene/index.d.ts +77 -0
  96. package/dist/packages/teaching/src/scene/morph/morph-scope.d.ts +28 -0
  97. package/dist/packages/teaching/src/scene/plane/plane-hit.d.ts +22 -0
  98. package/dist/packages/teaching/src/scene/plane/plane-label.d.ts +23 -0
  99. package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +42 -0
  100. package/dist/packages/teaching/src/scene/plane/plane-math.d.ts +45 -0
  101. package/dist/packages/teaching/src/scene/plane/scene-axes.d.ts +30 -0
  102. package/dist/packages/teaching/src/scene/plane/scene-curve.d.ts +42 -0
  103. package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +59 -0
  104. package/dist/packages/teaching/src/scene/plane/scene-projection.d.ts +27 -0
  105. package/dist/packages/teaching/src/scene/plane/scene-region.d.ts +38 -0
  106. package/dist/packages/teaching/src/scene/plane/scene-rule.d.ts +35 -0
  107. package/dist/packages/teaching/src/scene/plane/scene-vector.d.ts +39 -0
  108. package/dist/packages/teaching/src/scene/scene-bracket.d.ts +24 -0
  109. package/dist/packages/teaching/src/scene/scene-callout.d.ts +26 -0
  110. package/dist/packages/teaching/src/scene/scene-context.d.ts +179 -0
  111. package/dist/packages/teaching/src/scene/scene-custom.d.ts +31 -0
  112. package/dist/packages/teaching/src/scene/scene-geometry.d.ts +181 -0
  113. package/dist/packages/teaching/src/scene/scene-group.d.ts +28 -0
  114. package/dist/packages/teaching/src/scene/scene-highlight.d.ts +19 -0
  115. package/dist/packages/teaching/src/scene/scene-layer.d.ts +16 -0
  116. package/dist/packages/teaching/src/scene/scene-node.d.ts +67 -0
  117. package/dist/packages/teaching/src/scene/scene-obstacles.d.ts +27 -0
  118. package/dist/packages/teaching/src/scene/scene-registry.d.ts +79 -0
  119. package/dist/packages/teaching/src/scene/scene-stagger.d.ts +43 -0
  120. package/dist/packages/teaching/src/scene/scene-style.d.ts +14 -0
  121. package/dist/packages/teaching/src/scene/scene-validate.d.ts +65 -0
  122. package/dist/packages/teaching/src/scene/scene-wire.d.ts +45 -0
  123. package/dist/packages/teaching/src/scene/scene.d.ts +36 -0
  124. package/dist/packages/teaching/src/scene/shapes/cell-color.d.ts +11 -0
  125. package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +69 -0
  126. package/dist/packages/teaching/src/scene/shapes/scene-card.d.ts +114 -0
  127. package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +84 -0
  128. package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +37 -0
  129. package/dist/packages/teaching/src/scene/shapes/scene-stack.d.ts +46 -0
  130. package/dist/packages/teaching/src/scene/shapes/scene-token.d.ts +63 -0
  131. package/dist/packages/teaching/src/scene/shapes/scene-tokens.d.ts +40 -0
  132. package/dist/packages/teaching/src/scene/shapes/stack-book.d.ts +35 -0
  133. package/dist/packages/teaching/src/scene/shapes/stack-layout.d.ts +63 -0
  134. package/dist/packages/teaching/src/scene/shapes/token-layout.d.ts +39 -0
  135. package/dist/packages/teaching/src/spec/advice.d.ts +23 -0
  136. package/dist/packages/teaching/src/spec/chart-names.d.ts +2 -0
  137. package/dist/packages/teaching/src/spec/describe-lesson.d.ts +85 -0
  138. package/dist/packages/teaching/src/spec/explainer-guide.d.ts +21 -0
  139. package/dist/packages/teaching/src/spec/findings.d.ts +39 -0
  140. package/dist/packages/teaching/src/spec/index.d.ts +14 -0
  141. package/dist/packages/teaching/src/spec/lesson-plan.d.ts +43 -0
  142. package/dist/packages/teaching/src/spec/validate-plan.d.ts +11 -0
  143. package/dist/packages/teaching/src/time/clock.d.ts +7 -0
  144. package/dist/packages/teaching/src/time/tween.d.ts +19 -0
  145. package/dist/packages/teaching/src/time/use-tween.d.ts +6 -0
  146. package/dist/param-CqKUTHaO.js +450 -0
  147. package/dist/{plot-layout-BEuoOHbs.js → plot-layout-CZVSJ-le.js} +2 -1
  148. package/dist/{plot-marks-A64v7aTw.js → plot-marks-uozcbOIX.js} +15 -12
  149. package/dist/{plot-surface-CJTIqtck.js → plot-surface-CbVBvgqZ.js} +1 -1
  150. package/dist/{reference-lines-CWA8VeUR.js → reference-lines-BDcttOp0.js} +2 -2
  151. package/dist/scene-0z2gbaDE.js +4938 -0
  152. package/dist/scene.js +1 -0
  153. package/dist/{slope-chart-DT22h_ym.js → slope-chart-BKVEAVCs.js} +5 -5
  154. package/dist/{src-1EHkSFS-.js → src-BD6xlvDt.js} +2 -2
  155. package/dist/{src-D5NXRJZe.js → src-Dcfq8vE4.js} +1 -1
  156. package/dist/styles2.css +475 -18
  157. package/dist/{time-series-IB3CB93O.js → time-series-BgzGNOk0.js} +12 -10
  158. package/dist/{token-heatmap-C00DnoNO.js → token-heatmap-BrW1OsKD.js} +2 -2
  159. package/dist/{token-predictions-Cxx29iDr.js → token-predictions-yerq_Oet.js} +4 -4
  160. package/dist/transport-BJweqDPj.js +715 -0
  161. package/dist/{tree-diagram-DsckNKaW.js → tree-diagram-D09BRqE-.js} +4 -4
  162. package/dist/{treemap-9_DpLCW9.js → treemap-CW4WsJNL.js} +4 -4
  163. package/dist/use-tween-5HZ55_9d.js +72 -0
  164. package/dist/{violin-plot-BhPHKXsN.js → violin-plot-DrtPZ1-T.js} +5 -4
  165. package/dist/{waterfall-CGksuTy5.js → waterfall-DYLSnGjm.js} +4 -4
  166. package/package.json +26 -5
  167. package/recipes/counting-cards.tsx +656 -0
  168. package/recipes/explorable-essay.tsx +172 -0
  169. package/skills/extend-elements/SKILL.md +21 -0
  170. package/skills/plan-lesson/SKILL.md +86 -0
  171. package/skills/plan-lesson/references/plan-format.md +114 -0
  172. package/skills/plan-lesson/references/worked-plan.md +171 -0
  173. package/skills/review-elements/SKILL.md +4 -2
  174. package/skills/review-explainer/SKILL.md +97 -0
  175. package/skills/upgrade-elements/references/releases.md +65 -0
  176. package/skills/use-elements/SKILL.md +18 -16
  177. package/skills/use-elements/references/kits.md +2 -20
  178. package/skills/use-elements/references/teaching.md +36 -0
  179. package/skills/write-explainer/SKILL.md +112 -0
  180. package/skills/write-explainer/references/article.md +164 -0
  181. package/skills/write-explainer/references/lesson.md +148 -0
  182. package/skills/write-explainer/references/mdx.md +78 -0
  183. package/skills/write-explainer/references/scene-parts.md +273 -0
  184. package/skills/write-explainer/references/scene.md +168 -0
  185. package/skills/write-explainer/references/tutor.md +104 -0
  186. package/skills/write-explainer/references/worked-essay.md +459 -0
  187. package/templates/essay/AGENTS.md +14 -0
  188. package/templates/essay/README.md +59 -0
  189. package/templates/essay/index.html +17 -0
  190. package/templates/essay/package.template.json +21 -0
  191. package/templates/essay/plan.json +96 -0
  192. package/templates/essay/src/essay.mdx +97 -0
  193. package/templates/essay/src/figures.tsx +92 -0
  194. package/templates/essay/src/lesson.ts +83 -0
  195. package/templates/essay/src/main.tsx +53 -0
  196. package/templates/essay/src/mdx.d.ts +7 -0
  197. package/templates/essay/tsconfig.template.json +15 -0
  198. package/templates/essay/vite.config.template.txt +8 -0
  199. package/dist/kits/explainers.js +0 -452
  200. package/dist/packages/kits/src/explainers/figures.d.ts +0 -31
  201. package/dist/packages/kits/src/explainers/index.d.ts +0 -8
  202. package/dist/packages/kits/src/explainers/story-steps.d.ts +0 -46
  203. /package/dist/packages/{kits/src/explainers → teaching/src/article}/linked-target.d.ts +0 -0
  204. /package/dist/packages/{kits/src/explainers → teaching/src/lesson}/bound-value.d.ts +0 -0
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The words an article writes around the author's content. The present view's position reads "Beat 2 of 5, step 1":
3
+ * `beat`, the number, `of`, the count, then `step` and its number.
4
+ */
5
+ export type ArticleLabels = {
6
+ readonly contents: string;
7
+ readonly figure: string;
8
+ readonly notes: string;
9
+ readonly note: string;
10
+ readonly references: string;
11
+ readonly backToText: string;
12
+ readonly by: string;
13
+ readonly previous: string;
14
+ readonly next: string;
15
+ readonly beat: string;
16
+ readonly of: string;
17
+ readonly step: string;
18
+ readonly figureDescription: string;
19
+ readonly showAnswer: string;
20
+ readonly sheet: string;
21
+ readonly checks: string;
22
+ readonly noProblems: string;
23
+ readonly opening: string;
24
+ readonly goal: string;
25
+ readonly misconception: string;
26
+ readonly tutorHints: string;
27
+ readonly steps: string;
28
+ readonly progress: string;
29
+ };
30
+ export declare const defaultArticleLabels: {
31
+ readonly contents: 'Contents';
32
+ readonly figure: 'Figure';
33
+ readonly notes: 'Notes';
34
+ readonly note: 'Note';
35
+ readonly references: 'References';
36
+ readonly backToText: 'Back to the text';
37
+ readonly by: 'By';
38
+ readonly previous: 'Previous';
39
+ readonly next: 'Next';
40
+ readonly beat: 'Beat';
41
+ readonly of: 'of';
42
+ readonly step: 'step';
43
+ readonly figureDescription: 'What the figure shows';
44
+ readonly showAnswer: 'Show the answer';
45
+ readonly sheet: 'Beat sheet';
46
+ readonly checks: 'Checks';
47
+ readonly noProblems: 'No problems found.';
48
+ readonly opening: 'Opening';
49
+ readonly goal: 'Goal';
50
+ readonly misconception: 'Misconception';
51
+ readonly tutorHints: 'Tutor hints';
52
+ readonly steps: 'Reveal steps';
53
+ readonly progress: 'Reading progress';
54
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The geometry every article view shares. Essay text keeps a measure of about 68 characters. From `withMargin` the text
3
+ * gains a margin column for asides and wide figures, and from `withContents` the contents list sits beside it.
4
+ */
5
+ export declare const articleLayout: {
6
+ measure: string;
7
+ marginWidth: string;
8
+ marginGap: string;
9
+ marginSpan: string;
10
+ contentsWidth: string;
11
+ withMargin: string;
12
+ withContents: string;
13
+ narrow: string;
14
+ };
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ArticleOutline } from './outline-types.ts';
3
+ /** Reads an article's markup: its beats, figures, notes, references, players and the names each part takes. */
4
+ export declare function articleOutline(children: ReactNode): ArticleOutline;
5
+ /**
6
+ * The lesson value each prediction's answer comes from, by the `Predict` id. Tutor tools take it as their `answers`
7
+ * option, so a value a pending prediction asks about stays out of their results until the reader commits.
8
+ */
9
+ export declare function answerSources(outline: ArticleOutline): Readonly<Record<string, string>>;
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChartTone } from '../../../charts/src/index.ts';
3
+ import type { LessonDefinition, LessonParams } from '../lesson/define-lesson.ts';
4
+ import type { LessonProps } from '../lesson/lesson.tsx';
5
+ import type { ArticleMath, ArticleView } from './article-context.ts';
6
+ import type { ArticleLabels } from './article-labels.ts';
7
+ import type { LessonProgress, ProgressChangeDetails } from './progress-store.ts';
8
+ export type ArticleProps<Params extends LessonParams, Derived extends string, Beat extends string> = {
9
+ readonly lesson: LessonDefinition<Params, Derived, Beat>;
10
+ /** The locale every value, date and figure of the article is written in. */
11
+ readonly locale: string;
12
+ readonly title: string;
13
+ readonly authors?: ReadonlyArray<string> | undefined;
14
+ /** The publication date as an ISO date, such as `2026-11-23`. */
15
+ readonly date?: string | undefined;
16
+ /** A sentence or two under the title that says what the reader will learn. */
17
+ readonly summary?: ReactNode;
18
+ /** The lesson's color meaning, declared once: the tone of each id every figure and term of the article shares. */
19
+ readonly tones?: Readonly<Record<string, ChartTone>> | undefined;
20
+ /** How the same children are arranged. Defaults to `article`, the scrolling essay. */
21
+ readonly view?: ArticleView | undefined;
22
+ /** Typesets the source of each `TeX`. Without it, math shows its TeX source. */
23
+ readonly math?: ArticleMath | undefined;
24
+ /** Keeps the lesson's values and the reader's progress in local storage under this key. */
25
+ readonly storageKey?: string | undefined;
26
+ /** The reader's progress, when the application holds it. */
27
+ readonly progress?: LessonProgress | undefined;
28
+ readonly defaultProgress?: LessonProgress | undefined;
29
+ /** Hears each change of the reader's progress. A change an agent makes is refused before it gets here. */
30
+ readonly onProgressChange?: ((progress: LessonProgress, details: ProgressChangeDetails) => void) | undefined;
31
+ readonly labels?: Partial<ArticleLabels> | undefined;
32
+ /** Passed to the `Lesson` the article renders: controlled values, beat and step, or address bar sync. */
33
+ readonly lessonProps?: Omit<LessonProps<Params, Derived, Beat>, 'lesson' | 'locale' | 'storageKey' | 'children'> | undefined;
34
+ /** The essay: `Beat`s, and around them `References` and anything else. */
35
+ readonly children: ReactNode;
36
+ };
37
+ /**
38
+ * An explorable essay on one lesson: a title block, beats of prose and figures, and the exercises, notes and references
39
+ * around them. It renders the `Lesson`, the tone scope and one link scope, and arranges the same children in four
40
+ * views. The reader's progress is the UI SDK primitive `lesson-progress`, which counts only what the reader did.
41
+ */
42
+ export declare function Article<Params extends LessonParams, Derived extends string, Beat extends string>({ lesson, locale, title, authors, date, summary, tones, view, math, storageKey, progress, defaultProgress, onProgressChange, labels, lessonProps, children, }: ArticleProps<Params, Derived, Beat>): ReactNode;
@@ -0,0 +1,18 @@
1
+ import type { ArticleView } from './article-context.ts';
2
+ import type { ArticleOutline, OutlineBeat } from './outline-types.ts';
3
+ /** Where a beat stands at a lesson step: the scrolly step it shows, if any, and its reveal step. */
4
+ export type BeatPlace = {
5
+ readonly scrolly: number | null;
6
+ readonly reveal: number;
7
+ };
8
+ /**
9
+ * Splits a lesson step into a scrolly step and a reveal step. In the present view a beat walks its scrolly steps first,
10
+ * then its declared reveal steps; the other views count reveal steps alone, since scrolling walks a scrolly.
11
+ */
12
+ export declare function beatPlace({ beat, step, view, }: {
13
+ readonly beat: OutlineBeat | undefined;
14
+ readonly step: number;
15
+ readonly view: ArticleView;
16
+ }): BeatPlace;
17
+ /** The steps each beat's scrollies add to the lesson: one fewer than they have, as step 0 shows one. */
18
+ export declare function scrollyAddedSteps(outline: ArticleOutline): Readonly<Record<string, number>>;
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { AnyLesson, LessonBeat } from '../lesson/define-lesson.ts';
3
+ export type BeatProps = {
4
+ /** The id of a beat the lesson declares. Its title, tutor notes, reveal steps and states come from there. */
5
+ readonly id: string;
6
+ /** The beat's prose, figures and exercises. */
7
+ readonly children: ReactNode;
8
+ };
9
+ /** The beat a lesson declares under `id`, or undefined. */
10
+ export declare function lessonBeat(lesson: AnyLesson, id: string): LessonBeat | undefined;
11
+ /**
12
+ * One beat of an essay: a titled section whose title, tutor notes, reveal steps and states the lesson declares. The
13
+ * article view scrolls through every beat, the present view shows the current one, and the static view opens each at
14
+ * its first state. Tutor notes are never shown to the reader.
15
+ */
16
+ export declare function Beat({ id, children }: BeatProps): ReactNode;
@@ -0,0 +1,29 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { LessonValue } from '../lesson/define-lesson.ts';
3
+ /** The words of a challenge. The hint button reads "Show a hint (1 of 3)": `hint`, then `of`. */
4
+ export type ChallengeLabels = {
5
+ readonly kicker: string;
6
+ readonly reached: string;
7
+ readonly notYet: string;
8
+ readonly hint: string;
9
+ readonly of: string;
10
+ readonly showOutcome: string;
11
+ };
12
+ export type ChallengeProps = {
13
+ /** The challenge's id, unique in the article. The reader's progress records it under this id. */
14
+ readonly id: string;
15
+ /** The task, such as "Make the top token at least 90% likely". */
16
+ readonly prompt: ReactNode;
17
+ /** Whether the lesson's values meet the task. It reads params and derived values by name. */
18
+ readonly isReached: (values: Readonly<Record<string, LessonValue>>) => boolean;
19
+ /** Hints the reader can ask for, one at a time. */
20
+ readonly hints?: ReadonlyArray<string> | undefined;
21
+ /** What the reader finds, shown once the challenge is reached. */
22
+ readonly children: ReactNode;
23
+ readonly labels?: Partial<ChallengeLabels> | undefined;
24
+ };
25
+ /**
26
+ * A task the reader meets by changing the lesson's values: once a change of their own makes `isReached` true, the
27
+ * challenge counts as reached and shows its outcome. A change an agent makes never reaches it.
28
+ */
29
+ export declare function Challenge({ id, prompt, isReached, hints, children, labels }: ChallengeProps): ReactNode;
@@ -0,0 +1,76 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ /** The look `Predict` and `Challenge` share: a quiet panel in the text column, with a kicker above the question. */
3
+ export declare const exerciseStyles: Readonly<{
4
+ readonly box: Readonly<{
5
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
6
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
7
+ readonly marginBlock: stylex.StyleXClassNameFor<"marginBlock", string>;
8
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", string>;
9
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", string>;
10
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 1>;
11
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
12
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
13
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
14
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
15
+ readonly breakInside: stylex.StyleXClassNameFor<"breakInside", "avoid">;
16
+ }>;
17
+ readonly kicker: Readonly<{
18
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
19
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
20
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
21
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
22
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
23
+ readonly letterSpacing: stylex.StyleXClassNameFor<"letterSpacing", "0.06em">;
24
+ readonly textTransform: stylex.StyleXClassNameFor<"textTransform", "uppercase">;
25
+ }>;
26
+ readonly prompt: Readonly<{
27
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
28
+ }>;
29
+ readonly meta: Readonly<{
30
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
31
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
32
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
33
+ }>;
34
+ readonly controls: Readonly<{
35
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
36
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
37
+ readonly maxWidth: stylex.StyleXClassNameFor<"maxWidth", "28rem">;
38
+ }>;
39
+ readonly result: Readonly<{
40
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
41
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
42
+ }>;
43
+ readonly verdict: Readonly<{
44
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
45
+ }>;
46
+ readonly right: Readonly<{
47
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
48
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
49
+ }>;
50
+ readonly wrong: Readonly<{
51
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
52
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
53
+ }>;
54
+ readonly details: Readonly<{
55
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
56
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
57
+ }>;
58
+ readonly summary: Readonly<{
59
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
60
+ readonly cursor: stylex.StyleXClassNameFor<"cursor", "pointer">;
61
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
62
+ }>;
63
+ readonly hints: Readonly<{
64
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
65
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
66
+ readonly margin: stylex.StyleXClassNameFor<"margin", 0>;
67
+ readonly paddingInlineStart: stylex.StyleXClassNameFor<"paddingInlineStart", string>;
68
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
69
+ }>;
70
+ readonly actions: Readonly<{
71
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
72
+ readonly flexWrap: stylex.StyleXClassNameFor<"flexWrap", "wrap">;
73
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
74
+ readonly gap: stylex.StyleXClassNameFor<"gap", string>;
75
+ }>;
76
+ }>;
@@ -0,0 +1,51 @@
1
+ import type { ReactNode } from 'react';
2
+ /** True inside a repeated copy of a figure, such as a scrolly's figure at each step, so only the first keeps its id. */
3
+ export declare const FigureCopy: import("react").Context<boolean>;
4
+ /** True inside a part that already sets its figure's width, such as a scrolly, so the figure never widens again. */
5
+ export declare const FigureColumn: import("react").Context<boolean>;
6
+ /** How wide a figure is: the text column, or the text and its margin on wide screens. */
7
+ export type FigureSize = 'text' | 'wide';
8
+ export type FigureProps = {
9
+ /** The figure's id, unique in the article. It is the element id, so `#id` links land on the figure. */
10
+ readonly id: string;
11
+ /** What the reader should see in the figure, after its number. */
12
+ readonly caption: ReactNode;
13
+ /** The figure in words, for a reader who cannot see it. The static view prints it after the figure. */
14
+ readonly description?: string | undefined;
15
+ /**
16
+ * The lesson values the figure reads, when its markup does not name them through `Param`, `Value` or a control. The
17
+ * beat sheet uses them to find prose controls that change no figure.
18
+ */
19
+ readonly reads?: ReadonlyArray<string> | undefined;
20
+ /** Wide figures, the default, reach into the margin column on wide screens. */
21
+ readonly size?: FigureSize | undefined;
22
+ /** The chart, scene or image. */
23
+ readonly children: ReactNode;
24
+ };
25
+ /**
26
+ * A chart, scene or image with its number and caption: "Figure 2. Lower temperatures sharpen the distribution." Figures
27
+ * are numbered in reading order. Give each a `description` so the static view and assistive technology can say what it
28
+ * shows.
29
+ */
30
+ export declare function Figure({ id, caption, description, size, children }: FigureProps): ReactNode;
31
+ export type FigureReferenceProps = {
32
+ /** The id of the figure the reference points to. */
33
+ readonly to: string;
34
+ };
35
+ /** "Figure 2" in prose, as a link that moves the reader to that figure. An unknown id shows an error in its place. */
36
+ export declare function FigureReference({ to }: FigureReferenceProps): ReactNode;
37
+ export type RevealProps = {
38
+ /** The reveal step of the beat from which this content shows, counted from 0. */
39
+ readonly at: number;
40
+ readonly children: ReactNode;
41
+ };
42
+ /**
43
+ * Whether reveal step `at` of the surrounding beat shows now, for a figure that reveals its own parts. It is true in
44
+ * the article, static and sheet views and outside a beat; in the present view it follows the beat's reveal step.
45
+ */
46
+ export declare function useRevealed(at: number): boolean;
47
+ /**
48
+ * Content that appears at a reveal step of its beat in the present view, where Right or Space shows the next step. The
49
+ * article and static views show it at once, so a scrolling reader and a printed page lose nothing.
50
+ */
51
+ export declare function Reveal({ at, children }: RevealProps): ReactNode;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Narrative structure for explorable essays. An `Article` renders a lesson as beats of prose, figures and exercises,
3
+ * and arranges the same children as a scrolling essay, a presentation, a static page or a beat sheet.
4
+ */
5
+ export type { ArticleProps } from './article.tsx';
6
+ export { Article } from './article.tsx';
7
+ export type { ArticleMath, ArticleView } from './article-context.ts';
8
+ export type { ArticleLabels } from './article-labels.ts';
9
+ export { defaultArticleLabels } from './article-labels.ts';
10
+ export type { ArticleFinding } from './article-checks.ts';
11
+ export { articleChecks } from './article-checks.ts';
12
+ export { answerSources, articleOutline } from './article-outline.ts';
13
+ export type { BeatProps } from './beat.tsx';
14
+ export { Beat } from './beat.tsx';
15
+ export type { FigureProps, FigureReferenceProps, FigureSize, RevealProps } from './figure.tsx';
16
+ export { Figure, FigureReference, Reveal, useRevealed } from './figure.tsx';
17
+ export type { AsideProps, CiteProps, FootnoteProps, ReferencesProps } from './notes.tsx';
18
+ export type { ArticleOutline, OutlineBeat, OutlineFigure, OutlinePrediction, ReferenceItem } from './outline-types.ts';
19
+ export { Aside, Cite, Footnote, References } from './notes.tsx';
20
+ export type { TeXProps } from './tex.tsx';
21
+ export { TeX } from './tex.tsx';
22
+ export type { DiagramPartProps, TermLabels, TermProps } from './term.tsx';
23
+ export { DiagramPart, Term } from './term.tsx';
24
+ export type { ScrollyProps, ScrollyStepProps } from './scrolly.tsx';
25
+ export { Scrolly, ScrollyStep } from './scrolly.tsx';
26
+ export type { ChoicePrediction, NumberPrediction, PredictLabels, PredictProps } from './predict.tsx';
27
+ export { Predict } from './predict.tsx';
28
+ export type { ChallengeLabels, ChallengeProps } from './challenge.tsx';
29
+ export { Challenge } from './challenge.tsx';
30
+ export type { LessonProgress, PredictionRecord, ProgressChangeDetails, ProgressChangeReason, } from './progress-store.ts';
31
+ export { emptyProgress } from './progress-store.ts';
@@ -0,0 +1,5 @@
1
+ import type { AnyLesson, LessonValue } from '../lesson/define-lesson.ts';
2
+ /** The first problem with values an author wrote for a lesson, such as a name it lacks or a number out of range. */
3
+ export declare function valuesProblem(lesson: AnyLesson, values: Readonly<Record<string, LessonValue>>): string | undefined;
4
+ /** The values a beat state declares, by the state's id in any beat, or undefined when no beat declares it. */
5
+ export declare function stateValues(lesson: AnyLesson, state: string): Readonly<Record<string, LessonValue>> | undefined;
@@ -0,0 +1,36 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ReferenceItem } from './outline-types.ts';
3
+ export type AsideProps = {
4
+ readonly children: ReactNode;
5
+ };
6
+ /** A note beside the text: in the margin on wide screens, an indented block between paragraphs on narrow ones. */
7
+ export declare function Aside({ children }: AsideProps): ReactNode;
8
+ export type FootnoteProps = {
9
+ /** The note's id, unique in the article. Its number comes from reading order. */
10
+ readonly id: string;
11
+ /** The note, collected at the end of the article. */
12
+ readonly children: ReactNode;
13
+ };
14
+ /** A numbered note: a small number in the sentence that links to the note at the end, and back. */
15
+ export declare function Footnote({ id }: FootnoteProps): ReactNode;
16
+ export type ArticleNotesProps = {
17
+ /** Only the notes of this beat, small, for its slide in the present view. Every note when left out. */
18
+ readonly beat?: string | undefined;
19
+ };
20
+ /** The notes of an article, in reading order, each linked back to its place in the text. Numbers stay article-wide. */
21
+ export declare function ArticleNotes({ beat }: ArticleNotesProps): ReactNode;
22
+ export type CiteProps = {
23
+ /** The id of an item in the article's `References`. */
24
+ readonly id: string;
25
+ };
26
+ /** A citation in the text: the work's number in the references, linked to it. An unknown id shows an inline error. */
27
+ export declare function Cite({ id }: CiteProps): ReactNode;
28
+ export type ReferencesProps = {
29
+ /** The works the article cites, in the order they are numbered. */
30
+ readonly items: ReadonlyArray<ReferenceItem>;
31
+ };
32
+ /**
33
+ * The numbered list of works the article cites. `Cite` links to each by its id; the present view shows it on the last
34
+ * beat.
35
+ */
36
+ export declare function References({ items }: ReferencesProps): ReactNode;
@@ -0,0 +1,73 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { LessonValue } from '../lesson/define-lesson.ts';
3
+ /** A work the article cites. Plain data, so an agent can write and check the list. */
4
+ export type ReferenceItem = {
5
+ readonly id: string;
6
+ readonly authors: ReadonlyArray<string>;
7
+ readonly title: string;
8
+ readonly year: number;
9
+ readonly venue?: string | undefined;
10
+ readonly url?: string | undefined;
11
+ };
12
+ /** A prediction of the article as its markup declares it. */
13
+ export type OutlinePrediction = {
14
+ readonly id: string;
15
+ readonly beat: string | null;
16
+ /** The lesson value the answer is read from, which stays out of an agent's view until the reader commits. */
17
+ readonly answerFrom?: string | undefined;
18
+ };
19
+ /** A figure of the article as its markup declares it. */
20
+ export type OutlineFigure = {
21
+ readonly id: string;
22
+ readonly beat: string | null;
23
+ readonly hasDescription: boolean;
24
+ /** How wide the essay draws it: the text column, or the text and its margin. A scrolly's figure is `text`. */
25
+ readonly size: 'text' | 'wide';
26
+ /** The figure itself, for a beat sheet's cells. */
27
+ readonly node: ReactNode;
28
+ };
29
+ /** A step of a `Scrolly` as its markup declares it: the values or the state it shows. */
30
+ export type OutlineScrollyStep = {
31
+ readonly id: string;
32
+ readonly values?: Readonly<Record<string, LessonValue>> | undefined;
33
+ readonly state?: string | undefined;
34
+ };
35
+ /** A footnote of the article, with its beat, so the present view can show it on that beat's slide. */
36
+ export type OutlineFootnote = {
37
+ readonly id: string;
38
+ readonly beat: string | null;
39
+ readonly content: ReactNode;
40
+ };
41
+ /** A beat of the article as its markup declares it. */
42
+ export type OutlineBeat = {
43
+ readonly id: string;
44
+ readonly figures: ReadonlyArray<OutlineFigure>;
45
+ /** The lesson names the beat's figures read: their `reads` and every name a lesson part inside them takes. */
46
+ readonly figureNames: ReadonlyArray<string>;
47
+ /** The params a `Param` in the beat's prose sets. */
48
+ readonly proseParams: ReadonlyArray<string>;
49
+ /** The steps of the beat's scrollies, in reading order. The present view walks them before its reveal steps. */
50
+ readonly scrollySteps: ReadonlyArray<OutlineScrollyStep>;
51
+ };
52
+ /** What an article's markup holds, found by reading it before it renders, so numbers agree on server and browser. */
53
+ export type ArticleOutline = {
54
+ readonly beats: ReadonlyArray<OutlineBeat>;
55
+ /** Every figure id, in reading order. Figures are numbered by it. */
56
+ readonly figures: ReadonlyArray<string>;
57
+ readonly footnotes: ReadonlyArray<OutlineFootnote>;
58
+ readonly references: ReadonlyArray<ReferenceItem>;
59
+ /** The param each `Playback` drives, with its beat. */
60
+ readonly playbacks: ReadonlyArray<{
61
+ readonly name: string;
62
+ readonly beat: string | null;
63
+ }>;
64
+ /** The param each `Transport` controls. */
65
+ readonly transports: ReadonlyArray<string>;
66
+ /** Each `Predict`, with its beat and the lesson value its answer comes from, when it names one. */
67
+ readonly predictions: ReadonlyArray<OutlinePrediction>;
68
+ /** Each `Challenge`, with its beat. */
69
+ readonly challenges: ReadonlyArray<{
70
+ readonly id: string;
71
+ readonly beat: string | null;
72
+ }>;
73
+ };
@@ -0,0 +1,58 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ValueFormat } from '../../../charts/src/index.ts';
3
+ /** The words of a prediction. Its result shows `youGuessed` and the guess, `answerIs` and the answer, and a verdict. */
4
+ export type PredictLabels = {
5
+ readonly kicker: string;
6
+ readonly yourGuess: string;
7
+ readonly commit: string;
8
+ readonly youGuessed: string;
9
+ readonly answerIs: string;
10
+ readonly right: string;
11
+ readonly wrong: string;
12
+ readonly showAnswer: string;
13
+ readonly range: string;
14
+ /** What an agent is told when it tries to commit for the reader. */
15
+ readonly needsReader: string;
16
+ };
17
+ type PredictOption = {
18
+ readonly id: string;
19
+ readonly label: string;
20
+ };
21
+ /** A guess among options, one of which is right. */
22
+ export type ChoicePrediction = {
23
+ readonly options: ReadonlyArray<PredictOption>;
24
+ /** The id of the right option. */
25
+ readonly answer: string;
26
+ };
27
+ /** A guessed number. The answer is a fixed number or a lesson value read when the reader commits. */
28
+ export type NumberPrediction = {
29
+ readonly min: number;
30
+ readonly max: number;
31
+ readonly step: number;
32
+ readonly format: ValueFormat;
33
+ /** How far a guess may be from the answer and still be right. Defaults to one step. */
34
+ readonly tolerance?: number | undefined;
35
+ } & ({
36
+ readonly answer: number;
37
+ readonly answerFrom?: undefined;
38
+ } | {
39
+ /** A number param or derived value of the lesson whose value, when the reader commits, is the answer. */
40
+ readonly answerFrom: string;
41
+ readonly answer?: undefined;
42
+ });
43
+ export type PredictProps = {
44
+ /** The prediction's id, unique in the article. The reader's progress records the guess under it. */
45
+ readonly id: string;
46
+ /** The question, such as "At temperature 4, how much entropy is left?". */
47
+ readonly prompt: ReactNode;
48
+ /** The explanation, shown once the reader commits. Agents do not see it before then. */
49
+ readonly children: ReactNode;
50
+ readonly labels?: Partial<PredictLabels> | undefined;
51
+ } & (ChoicePrediction | NumberPrediction);
52
+ /**
53
+ * Asks the reader to commit a guess before the answer shows: one of a few options, or a number on a slider. Once the
54
+ * reader commits, the answer and the explanation appear and the reader's progress keeps the guess. An agent can read
55
+ * the question but never commits for the reader, and does not see the answer before the reader commits.
56
+ */
57
+ export declare function Predict(props: PredictProps): ReactNode;
58
+ export {};
@@ -0,0 +1,64 @@
1
+ import type { ChangeDetails, ChangeSource } from '@ui-sdk/core';
2
+ import type { PartProps } from '@ui-sdk/react/primitive';
3
+ import type { ReactElement } from 'react';
4
+ /** A prediction the reader committed: their guess, the answer at that moment, and whether the guess was right. */
5
+ export type PredictionRecord = {
6
+ readonly value: number | string;
7
+ readonly answer: number | string;
8
+ readonly isCorrect: boolean;
9
+ };
10
+ /**
11
+ * What the reader has done in one article. Only the reader's own acts count: an agent's change never commits a
12
+ * prediction, reaches a challenge or shows a hint.
13
+ */
14
+ export type LessonProgress = {
15
+ /** Each committed prediction, by the `Predict` id. */
16
+ readonly predictions: Readonly<Record<string, PredictionRecord>>;
17
+ /** The ids of the challenges the reader reached, in the order reached. */
18
+ readonly reached: ReadonlyArray<string>;
19
+ /** How many hints the reader asked for, by the `Challenge` id. */
20
+ readonly hints: Readonly<Record<string, number>>;
21
+ /** The ids of the beats the reader has been on, in the order first visited. */
22
+ readonly visited: ReadonlyArray<string>;
23
+ };
24
+ /** Why the progress changed: a commit, a challenge reached, a hint asked for, a beat visited, a restore or a reset. */
25
+ export type ProgressChangeReason = 'commit' | 'reach' | 'hint-press' | 'visit' | 'restore' | 'reset';
26
+ /** What a progress change reports: its reason, event and source, and `cancel()` to refuse it. */
27
+ export type ProgressChangeDetails = ChangeDetails<ProgressChangeReason>;
28
+ /** What a progress change says about itself. */
29
+ export type ProgressOrigin = {
30
+ readonly reason: ProgressChangeReason;
31
+ readonly event?: Event | undefined;
32
+ readonly source?: ChangeSource | undefined;
33
+ };
34
+ export declare const emptyProgress: {
35
+ readonly predictions: {};
36
+ readonly reached: readonly [];
37
+ readonly hints: {};
38
+ readonly visited: readonly [];
39
+ };
40
+ /** Where the reader's progress lives: controlled, kept by the article, or saved under a storage key as well. */
41
+ export type ProgressOptions = {
42
+ readonly progress?: LessonProgress | undefined;
43
+ readonly defaultProgress?: LessonProgress | undefined;
44
+ readonly onProgressChange?: ((progress: LessonProgress, details: ProgressChangeDetails) => void) | undefined;
45
+ readonly storageKey?: string | undefined;
46
+ };
47
+ /** The calls the progress primitive offers the parts of an article. Each returns whether the progress changed. */
48
+ export type ProgressApi = {
49
+ /** Records the reader's committed prediction. A prediction commits once. */
50
+ readonly commit: (id: string, record: PredictionRecord, origin: ProgressOrigin) => boolean;
51
+ /** Records that the reader reached a challenge. */
52
+ readonly reach: (id: string, origin: ProgressOrigin) => boolean;
53
+ /** Shows one more hint of a challenge. */
54
+ readonly showHint: (id: string, origin: ProgressOrigin) => boolean;
55
+ /** Records that the reader is on a beat. */
56
+ readonly visit: (beat: string, origin: ProgressOrigin) => boolean;
57
+ /** Forgets every prediction, challenge, hint and visit. */
58
+ readonly reset: (origin?: ProgressOrigin) => boolean;
59
+ };
60
+ /**
61
+ * Renders an article element as the root of `lesson-progress`, with props built from the progress and its calls. A
62
+ * change an agent makes is refused before `onProgressChange` hears of it.
63
+ */
64
+ export declare function useProgressRoot(options: ProgressOptions, props: (progress: LessonProgress, api: ProgressApi) => PartProps<'article'>): ReactElement | null;
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { LessonValue } from '../lesson/define-lesson.ts';
3
+ export type ScrollyStepProps = {
4
+ /** The step's id, unique in its scrolly. */
5
+ readonly id: string;
6
+ /** The values this step applies while it is in view. */
7
+ readonly values?: Readonly<Record<string, LessonValue>> | undefined;
8
+ /** A state of a lesson beat this step shows while it is in view, by its id. */
9
+ readonly state?: string | undefined;
10
+ /** The step's prose. */
11
+ readonly children: ReactNode;
12
+ };
13
+ /** One step of a `Scrolly`: prose that sets the lesson's values while the reader has it in view. */
14
+ export declare function ScrollyStep({ children }: ScrollyStepProps): ReactNode;
15
+ export type ScrollyProps = {
16
+ /** The figure that stays in view beside the steps and follows the values each step applies. */
17
+ readonly figure: ReactNode;
18
+ /** The steps, as `ScrollyStep` elements. */
19
+ readonly children: ReactNode;
20
+ };
21
+ /**
22
+ * A figure that stays in view while the reader scrolls through steps of prose beside it, each setting the lesson's
23
+ * values. The present view lists the steps beside the figure and walks them as the beat's first steps. The static view
24
+ * prints each step with the figure at its values.
25
+ */
26
+ export declare function Scrolly({ figure, children }: ScrollyProps): ReactNode;