@mechane-ai/elements 0.46.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.
- package/README.md +590 -34
- package/bin/mechane-elements-catalog.mjs +104 -12
- package/dist/ai.js +4 -4
- package/dist/article-BXZr10QQ.js +1904 -0
- package/dist/article.js +1 -0
- package/dist/catalog.json +3696 -33
- package/dist/categorical-values-BpVq8cFj.js +107 -0
- package/dist/cells-xVmnQ9oQ.js +384 -0
- package/dist/chart-link-AE_xuxiP.js +35 -0
- package/dist/chart-tones-ei3BC2AL.js +27 -0
- package/dist/charts/cartesian.js +1 -2958
- package/dist/charts/cells.js +1 -0
- package/dist/charts/comparison.js +1 -0
- package/dist/charts/distribution.js +1 -781
- package/dist/charts/figure.js +3404 -0
- package/dist/charts/graph.js +1 -655
- package/dist/charts/hierarchy.js +1 -121
- package/dist/charts/image.js +1 -0
- package/dist/charts/matrix.js +4 -644
- package/dist/charts/plot.js +15 -0
- package/dist/charts/relationship.js +1 -0
- package/dist/charts/text.js +1 -0
- package/dist/charts/timeline.js +1 -266
- package/dist/charts/transforms.js +677 -0
- package/dist/charts/trend.js +1 -0
- package/dist/charts.js +8 -3
- package/dist/clock-DSm5lkNE.js +16 -0
- package/dist/collections.js +1 -2195
- package/dist/color-legend-CIo7DhXB.js +62 -0
- package/dist/dates-Cww8UR_n.js +810 -0
- package/dist/describe-lesson-BmREzDpt.js +175 -0
- package/dist/dumbbell-plot-DQdTxDeO.js +509 -0
- package/dist/embedding-map-CF-J-8JW.js +1929 -0
- package/dist/feedback.js +1 -1
- package/dist/figure-format-B8kRZMlo.js +36 -0
- package/dist/figure-frame-BJ3REgTA.js +270 -0
- package/dist/forms/dates.js +1 -810
- package/dist/forms.js +1 -1
- package/dist/heatmap-scale-Zte6Ya-g.js +20 -0
- package/dist/image-grid-Dl2sjIMB.js +598 -0
- package/dist/kits/evaluation.js +431 -0
- package/dist/kits/interpretability.js +1033 -0
- package/dist/kits/operations.js +239 -0
- package/dist/kits/training.js +335 -0
- package/dist/label-place-Z0fryBZb.js +42 -0
- package/dist/lesson/agent.js +811 -0
- package/dist/lesson/spec.js +661 -0
- package/dist/lesson.js +5 -0
- package/dist/locate-Bcg3QcP4.js +11 -0
- package/dist/mdx.js +227 -0
- package/dist/packages/charts/src/cartesian/bar-chart.d.ts +40 -21
- package/dist/packages/charts/src/cartesian/bar-data.d.ts +15 -4
- package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +7 -3
- package/dist/packages/charts/src/cartesian/breakdown-bar.d.ts +10 -8
- package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +20 -16
- package/dist/packages/charts/src/cartesian/bridge-data.d.ts +5 -4
- package/dist/packages/charts/src/cartesian/composition-bars.d.ts +8 -4
- package/dist/packages/charts/src/cartesian/index.d.ts +5 -5
- package/dist/packages/charts/src/cartesian/reference-lines.d.ts +25 -18
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +30 -25
- package/dist/packages/charts/src/cartesian/sparkline.d.ts +14 -2
- package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +3 -2
- package/dist/packages/charts/src/cartesian/time-series-data.d.ts +12 -2
- package/dist/packages/charts/src/cartesian/time-series-line.d.ts +2 -2
- package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +6 -4
- package/dist/packages/charts/src/cartesian/time-series.d.ts +60 -36
- package/dist/packages/charts/src/cartesian/value-labels.d.ts +22 -0
- package/dist/packages/charts/src/categorical-values.d.ts +1 -1
- package/dist/packages/charts/src/cells/bar-cell.d.ts +13 -0
- package/dist/packages/charts/src/cells/cell-layout.d.ts +81 -0
- package/dist/packages/charts/src/cells/change-cell.d.ts +17 -0
- package/dist/packages/charts/src/cells/heat-cell.d.ts +19 -0
- package/dist/packages/charts/src/cells/index.d.ts +11 -0
- package/dist/packages/charts/src/cells/interval-cell.d.ts +16 -0
- package/dist/packages/charts/src/cells/spark-cell.d.ts +22 -0
- package/dist/packages/charts/src/chart-frame.d.ts +14 -7
- package/dist/packages/charts/src/chart-grid.d.ts +19 -0
- package/dist/packages/charts/src/chart-input.d.ts +1 -9
- package/dist/packages/charts/src/chart-link.d.ts +56 -0
- package/dist/packages/charts/src/chart.d.ts +0 -8
- package/dist/packages/charts/src/comparison/bullet-bar.d.ts +34 -0
- package/dist/packages/charts/src/comparison/comparison-plot.d.ts +54 -0
- package/dist/packages/charts/src/comparison/dot-plot.d.ts +41 -0
- package/dist/packages/charts/src/comparison/dumbbell-plot.d.ts +33 -0
- package/dist/packages/charts/src/comparison/index.d.ts +6 -0
- package/dist/packages/charts/src/distribution/box-plot.d.ts +40 -0
- package/dist/packages/charts/src/distribution/distribution-input.d.ts +5 -3
- package/dist/packages/charts/src/distribution/distribution-plot.d.ts +28 -161
- package/dist/packages/charts/src/distribution/ecdf.d.ts +16 -15
- package/dist/packages/charts/src/distribution/group-plot-input.d.ts +35 -0
- package/dist/packages/charts/src/distribution/group-plot-layout.d.ts +79 -0
- package/dist/packages/charts/src/distribution/group-plot.d.ts +73 -0
- package/dist/packages/charts/src/distribution/histogram.d.ts +16 -16
- package/dist/packages/charts/src/distribution/index.d.ts +11 -0
- package/dist/packages/charts/src/distribution/interval-plot.d.ts +16 -13
- package/dist/packages/charts/src/distribution/ranked-bars.d.ts +17 -14
- package/dist/packages/charts/src/distribution/ridgeline.d.ts +34 -0
- package/dist/packages/charts/src/distribution/strip-plot.d.ts +37 -0
- package/dist/packages/charts/src/distribution/violin-plot.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-format.d.ts +34 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +47 -0
- package/dist/packages/charts/src/figure/figure-props.d.ts +54 -0
- package/dist/packages/charts/src/figure/tone-scope.d.ts +32 -0
- package/dist/packages/charts/src/graph/attribution-graph.d.ts +62 -0
- package/dist/packages/charts/src/graph/attribution-layout.d.ts +88 -0
- package/dist/packages/charts/src/graph/flow-diagram.d.ts +14 -15
- package/dist/packages/charts/src/graph/flow-layout.d.ts +4 -2
- package/dist/packages/charts/src/graph/graph-canvas.d.ts +33 -0
- package/dist/packages/charts/src/graph/index.d.ts +6 -2
- package/dist/packages/charts/src/graph/relation-graph.d.ts +24 -13
- package/dist/packages/charts/src/graph/tree-diagram.d.ts +41 -0
- package/dist/packages/charts/src/graph/tree-layout.d.ts +71 -0
- package/dist/packages/charts/src/hierarchy/area-mark.d.ts +17 -0
- package/dist/packages/charts/src/hierarchy/icicle.d.ts +35 -0
- package/dist/packages/charts/src/hierarchy/index.d.ts +2 -0
- package/dist/packages/charts/src/hierarchy/partition-layout.d.ts +25 -0
- package/dist/packages/charts/src/hierarchy/treemap-layout.d.ts +26 -0
- package/dist/packages/charts/src/hierarchy/treemap.d.ts +11 -9
- package/dist/packages/charts/src/image/attribution-legend.d.ts +13 -0
- package/dist/packages/charts/src/image/attribution-overlay.d.ts +50 -0
- package/dist/packages/charts/src/image/attribution-ramp.d.ts +16 -0
- package/dist/packages/charts/src/image/image-atlas.d.ts +37 -0
- package/dist/packages/charts/src/image/image-fill.d.ts +9 -0
- package/dist/packages/charts/src/image/image-grid.d.ts +26 -0
- package/dist/packages/charts/src/image/image-input.d.ts +27 -0
- package/dist/packages/charts/src/image/image-tile.d.ts +27 -0
- package/dist/packages/charts/src/image/index.d.ts +7 -0
- package/dist/packages/charts/src/index.d.ts +15 -1
- package/dist/packages/charts/src/matrix/attention-matrix.d.ts +41 -0
- package/dist/packages/charts/src/matrix/calendar-heatmap.d.ts +37 -0
- package/dist/packages/charts/src/matrix/color-legend.d.ts +9 -2
- package/dist/packages/charts/src/matrix/confusion-matrix.d.ts +36 -0
- package/dist/packages/charts/src/matrix/correlation-matrix.d.ts +34 -0
- package/dist/packages/charts/src/matrix/heatmap-scale.d.ts +8 -2
- package/dist/packages/charts/src/matrix/index.d.ts +15 -3
- package/dist/packages/charts/src/matrix/matrix-cells.d.ts +27 -3
- package/dist/packages/charts/src/matrix/matrix-figure.d.ts +50 -0
- package/dist/packages/charts/src/matrix/matrix-mark.d.ts +34 -0
- package/dist/packages/charts/src/matrix/matrix-presets.d.ts +20 -0
- package/dist/packages/charts/src/matrix/matrix-range.d.ts +45 -0
- package/dist/packages/charts/src/matrix/matrix-strip.d.ts +13 -14
- package/dist/packages/charts/src/matrix/matrix-types.d.ts +40 -0
- package/dist/packages/charts/src/matrix/matrix.d.ts +13 -11
- package/dist/packages/charts/src/matrix/token-heatmap.d.ts +16 -10
- package/dist/packages/charts/src/plot/contours.d.ts +45 -0
- package/dist/packages/charts/src/plot/index.d.ts +49 -0
- package/dist/packages/charts/src/plot/label-place.d.ts +35 -0
- package/dist/packages/charts/src/plot/locate.d.ts +18 -0
- package/dist/packages/charts/src/plot/path.d.ts +39 -0
- package/dist/packages/charts/src/plot/plot-axes.d.ts +20 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +221 -0
- package/dist/packages/charts/src/plot/plot-marks.d.ts +128 -0
- package/dist/packages/charts/src/plot/plot-surface.d.ts +32 -0
- package/dist/packages/charts/src/plot/render/density-layer.d.ts +17 -0
- package/dist/packages/charts/src/plot/render/hit-index.d.ts +37 -0
- package/dist/packages/charts/src/plot/render/plot-viewport.d.ts +39 -0
- package/dist/packages/charts/src/plot/render/point-layer.d.ts +41 -0
- package/dist/packages/charts/src/plot/render/theme-colors.d.ts +15 -0
- package/dist/packages/charts/src/plot/scale.d.ts +48 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +34 -0
- package/dist/packages/charts/src/plot-width.d.ts +3 -2
- package/dist/packages/charts/src/relationship/contour-plot.d.ts +61 -0
- package/dist/packages/charts/src/relationship/density-map.d.ts +45 -0
- package/dist/packages/charts/src/relationship/embedding-map.d.ts +75 -0
- package/dist/packages/charts/src/relationship/index.d.ts +11 -0
- package/dist/packages/charts/src/relationship/level-legend.d.ts +11 -0
- package/dist/packages/charts/src/relationship/measures.d.ts +85 -0
- package/dist/packages/charts/src/relationship/parallel-coordinates.d.ts +30 -0
- package/dist/packages/charts/src/relationship/range-controls.d.ts +20 -0
- package/dist/packages/charts/src/relationship/scatter-matrix.d.ts +20 -0
- package/dist/packages/charts/src/spec/chart-guide.d.ts +21 -0
- package/dist/packages/charts/src/spec/figure-registry.d.ts +44 -0
- package/dist/packages/charts/src/spec/figure-spec.d.ts +147 -0
- package/dist/packages/charts/src/spec/figure-text.d.ts +8 -0
- package/dist/packages/charts/src/spec/figure.d.ts +12 -0
- package/dist/packages/charts/src/spec/guide-data.d.ts +85 -0
- package/dist/packages/charts/src/spec/index.d.ts +10 -0
- package/dist/packages/charts/src/spec/validate-figure.d.ts +15 -0
- package/dist/packages/charts/src/text/index.d.ts +11 -0
- package/dist/packages/charts/src/text/token-examples.d.ts +42 -0
- package/dist/packages/charts/src/text/token-grid.d.ts +47 -0
- package/dist/packages/charts/src/text/token-links.d.ts +49 -0
- package/dist/packages/charts/src/text/token-predictions.d.ts +38 -0
- package/dist/packages/charts/src/text/token-scale.d.ts +20 -0
- package/dist/packages/charts/src/text/token-text.d.ts +39 -0
- package/dist/packages/charts/src/timeline/event-strip.d.ts +70 -0
- package/dist/packages/charts/src/timeline/index.d.ts +3 -1
- package/dist/packages/charts/src/timeline/waterfall.d.ts +24 -13
- package/dist/packages/charts/src/transforms/bins.d.ts +91 -0
- package/dist/packages/charts/src/transforms/density.d.ts +53 -0
- package/dist/packages/charts/src/transforms/fits.d.ts +50 -0
- package/dist/packages/charts/src/transforms/index.d.ts +19 -0
- package/dist/packages/charts/src/transforms/matrices.d.ts +49 -0
- package/dist/packages/charts/src/transforms/quantiles.d.ts +96 -0
- package/dist/packages/charts/src/transforms/ranks.d.ts +44 -0
- package/dist/packages/charts/src/transforms/runs.d.ts +47 -0
- package/dist/packages/charts/src/transforms/sampling.d.ts +75 -0
- package/dist/packages/charts/src/transforms/smoothing.d.ts +41 -0
- package/dist/packages/charts/src/transforms/values.d.ts +70 -0
- package/dist/packages/charts/src/trend/bump-chart.d.ts +33 -0
- package/dist/packages/charts/src/trend/column-figure.d.ts +38 -0
- package/dist/packages/charts/src/trend/column-positions.d.ts +21 -0
- package/dist/packages/charts/src/trend/curve-chart.d.ts +69 -0
- package/dist/packages/charts/src/trend/end-labels.d.ts +40 -0
- package/dist/packages/charts/src/trend/horizon-chart.d.ts +37 -0
- package/dist/packages/charts/src/trend/index.d.ts +10 -0
- package/dist/packages/charts/src/trend/line-locate.d.ts +21 -0
- package/dist/packages/charts/src/trend/runs-chart.d.ts +50 -0
- package/dist/packages/charts/src/trend/slope-chart.d.ts +35 -0
- package/dist/packages/kits/src/evaluation/evaluation-data.d.ts +31 -0
- package/dist/packages/kits/src/evaluation/index.d.ts +8 -0
- package/dist/packages/kits/src/evaluation/leaderboard-cells.d.ts +62 -0
- package/dist/packages/kits/src/evaluation/leaderboard.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/model-comparison.d.ts +59 -0
- package/dist/packages/kits/src/evaluation/score-breakdown.d.ts +33 -0
- package/dist/packages/kits/src/interpretability/attention-head-grid.d.ts +56 -0
- package/dist/packages/kits/src/interpretability/attribution-workbench.d.ts +29 -0
- package/dist/packages/kits/src/interpretability/embedding-atlas.d.ts +41 -0
- package/dist/packages/kits/src/interpretability/feature-card.d.ts +33 -0
- package/dist/packages/kits/src/interpretability/feature-list.d.ts +51 -0
- package/dist/packages/kits/src/interpretability/feature-logits.d.ts +23 -0
- package/dist/packages/kits/src/interpretability/features.d.ts +70 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +16 -0
- package/dist/packages/kits/src/interpretability/kit-styles.d.ts +118 -0
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +50 -0
- package/dist/packages/kits/src/interpretability/node-panel.d.ts +32 -0
- package/dist/packages/kits/src/interpretability/shared-link.d.ts +8 -0
- package/dist/packages/kits/src/interpretability/steering-panel.d.ts +52 -0
- package/dist/packages/kits/src/operations/budget-board.d.ts +49 -0
- package/dist/packages/kits/src/operations/incident-timeline.d.ts +30 -0
- package/dist/packages/kits/src/operations/index.d.ts +6 -0
- package/dist/packages/kits/src/operations/service-health.d.ts +66 -0
- package/dist/packages/kits/src/training/index.d.ts +8 -0
- package/dist/packages/kits/src/training/run-dashboard.d.ts +49 -0
- package/dist/packages/kits/src/training/run-legend.d.ts +21 -0
- package/dist/packages/kits/src/training/run-marker.d.ts +5 -0
- package/dist/packages/kits/src/training/run-state.d.ts +7 -0
- package/dist/packages/kits/src/training/run-table.d.ts +63 -0
- package/dist/packages/kits/src/training/runs-overview.d.ts +20 -0
- package/dist/packages/kits/src/training/runs.d.ts +34 -0
- package/dist/packages/teaching/src/agent/index.d.ts +11 -0
- package/dist/packages/teaching/src/agent/learner-trace.d.ts +84 -0
- package/dist/packages/teaching/src/agent/lesson-bridge.d.ts +59 -0
- package/dist/packages/teaching/src/agent/lesson-tour.d.ts +63 -0
- package/dist/packages/teaching/src/agent/tutor-tools.d.ts +86 -0
- package/dist/packages/teaching/src/article/article-checks.d.ts +9 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +49 -0
- package/dist/packages/teaching/src/article/article-error.d.ts +12 -0
- package/dist/packages/teaching/src/article/article-labels.d.ts +54 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +14 -0
- package/dist/packages/teaching/src/article/article-outline.d.ts +9 -0
- package/dist/packages/teaching/src/article/article.d.ts +42 -0
- package/dist/packages/teaching/src/article/beat-steps.d.ts +18 -0
- package/dist/packages/teaching/src/article/beat.d.ts +16 -0
- package/dist/packages/teaching/src/article/challenge.d.ts +29 -0
- package/dist/packages/teaching/src/article/exercise-styles.d.ts +76 -0
- package/dist/packages/teaching/src/article/figure.d.ts +51 -0
- package/dist/packages/teaching/src/article/index.d.ts +31 -0
- package/dist/packages/teaching/src/article/lesson-values.d.ts +5 -0
- package/dist/packages/teaching/src/article/linked-target.d.ts +22 -0
- package/dist/packages/teaching/src/article/notes.d.ts +36 -0
- package/dist/packages/teaching/src/article/outline-types.d.ts +73 -0
- package/dist/packages/teaching/src/article/predict.d.ts +58 -0
- package/dist/packages/teaching/src/article/progress-store.d.ts +64 -0
- package/dist/packages/teaching/src/article/scrolly.d.ts +26 -0
- package/dist/packages/teaching/src/article/term.d.ts +35 -0
- package/dist/packages/teaching/src/article/tex.d.ts +12 -0
- package/dist/packages/teaching/src/article/view-essay.d.ts +13 -0
- package/dist/packages/teaching/src/article/view-present.d.ts +8 -0
- package/dist/packages/teaching/src/article/view-sheet.d.ts +7 -0
- package/dist/packages/teaching/src/article/view-static.d.ts +7 -0
- package/dist/packages/teaching/src/article/walk.d.ts +34 -0
- package/dist/packages/teaching/src/lesson/bound-value.d.ts +29 -0
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +136 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +24 -0
- package/dist/packages/teaching/src/lesson/inline-choice.d.ts +12 -0
- package/dist/packages/teaching/src/lesson/lesson-context.d.ts +18 -0
- package/dist/packages/teaching/src/lesson/lesson-error.d.ts +12 -0
- package/dist/packages/teaching/src/lesson/lesson-locale.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/lesson-persistence.d.ts +17 -0
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +51 -0
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +84 -0
- package/dist/packages/teaching/src/lesson/lesson.d.ts +39 -0
- package/dist/packages/teaching/src/lesson/param-controls.d.ts +14 -0
- package/dist/packages/teaching/src/lesson/param.d.ts +34 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +42 -0
- package/dist/packages/teaching/src/lesson/transport.d.ts +19 -0
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +36 -0
- package/dist/packages/teaching/src/mdx/essay-components.d.ts +79 -0
- package/dist/packages/teaching/src/mdx/essay-markdown.d.ts +41 -0
- package/dist/packages/teaching/src/mdx/essay.d.ts +32 -0
- package/dist/packages/teaching/src/mdx/index.d.ts +9 -0
- package/dist/packages/teaching/src/mdx/requested-view.d.ts +6 -0
- package/dist/packages/teaching/src/scene/flow/flow-layout.d.ts +38 -0
- package/dist/packages/teaching/src/scene/flow/flow-pulse.d.ts +16 -0
- package/dist/packages/teaching/src/scene/flow/scene-flow.d.ts +81 -0
- package/dist/packages/teaching/src/scene/index.d.ts +77 -0
- package/dist/packages/teaching/src/scene/morph/morph-scope.d.ts +28 -0
- package/dist/packages/teaching/src/scene/plane/plane-hit.d.ts +22 -0
- package/dist/packages/teaching/src/scene/plane/plane-label.d.ts +23 -0
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +42 -0
- package/dist/packages/teaching/src/scene/plane/plane-math.d.ts +45 -0
- package/dist/packages/teaching/src/scene/plane/scene-axes.d.ts +30 -0
- package/dist/packages/teaching/src/scene/plane/scene-curve.d.ts +42 -0
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +59 -0
- package/dist/packages/teaching/src/scene/plane/scene-projection.d.ts +27 -0
- package/dist/packages/teaching/src/scene/plane/scene-region.d.ts +38 -0
- package/dist/packages/teaching/src/scene/plane/scene-rule.d.ts +35 -0
- package/dist/packages/teaching/src/scene/plane/scene-vector.d.ts +39 -0
- package/dist/packages/teaching/src/scene/scene-bracket.d.ts +24 -0
- package/dist/packages/teaching/src/scene/scene-callout.d.ts +26 -0
- package/dist/packages/teaching/src/scene/scene-context.d.ts +179 -0
- package/dist/packages/teaching/src/scene/scene-custom.d.ts +31 -0
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +181 -0
- package/dist/packages/teaching/src/scene/scene-group.d.ts +28 -0
- package/dist/packages/teaching/src/scene/scene-highlight.d.ts +19 -0
- package/dist/packages/teaching/src/scene/scene-layer.d.ts +16 -0
- package/dist/packages/teaching/src/scene/scene-node.d.ts +67 -0
- package/dist/packages/teaching/src/scene/scene-obstacles.d.ts +27 -0
- package/dist/packages/teaching/src/scene/scene-registry.d.ts +79 -0
- package/dist/packages/teaching/src/scene/scene-stagger.d.ts +43 -0
- package/dist/packages/teaching/src/scene/scene-style.d.ts +14 -0
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +65 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +45 -0
- package/dist/packages/teaching/src/scene/scene.d.ts +36 -0
- package/dist/packages/teaching/src/scene/shapes/cell-color.d.ts +11 -0
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +69 -0
- package/dist/packages/teaching/src/scene/shapes/scene-card.d.ts +114 -0
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +84 -0
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +37 -0
- package/dist/packages/teaching/src/scene/shapes/scene-stack.d.ts +46 -0
- package/dist/packages/teaching/src/scene/shapes/scene-token.d.ts +63 -0
- package/dist/packages/teaching/src/scene/shapes/scene-tokens.d.ts +40 -0
- package/dist/packages/teaching/src/scene/shapes/stack-book.d.ts +35 -0
- package/dist/packages/teaching/src/scene/shapes/stack-layout.d.ts +63 -0
- package/dist/packages/teaching/src/scene/shapes/token-layout.d.ts +39 -0
- package/dist/packages/teaching/src/spec/advice.d.ts +23 -0
- package/dist/packages/teaching/src/spec/chart-names.d.ts +2 -0
- package/dist/packages/teaching/src/spec/describe-lesson.d.ts +85 -0
- package/dist/packages/teaching/src/spec/explainer-guide.d.ts +21 -0
- package/dist/packages/teaching/src/spec/findings.d.ts +39 -0
- package/dist/packages/teaching/src/spec/index.d.ts +14 -0
- package/dist/packages/teaching/src/spec/lesson-plan.d.ts +43 -0
- package/dist/packages/teaching/src/spec/validate-plan.d.ts +11 -0
- package/dist/packages/teaching/src/time/clock.d.ts +7 -0
- package/dist/packages/teaching/src/time/tween.d.ts +19 -0
- package/dist/packages/teaching/src/time/use-tween.d.ts +6 -0
- package/dist/param-CqKUTHaO.js +450 -0
- package/dist/path-BglsXpnO.js +59 -0
- package/dist/plot-axes-DJkLW4wk.js +100 -0
- package/dist/plot-layout-CZVSJ-le.js +912 -0
- package/dist/plot-marks-uozcbOIX.js +229 -0
- package/dist/plot-surface-CbVBvgqZ.js +51 -0
- package/dist/plot-width-DcqtSgzb.js +124 -0
- package/dist/point-layer-C-EYETAt.js +655 -0
- package/dist/reference-lines-BDcttOp0.js +82 -0
- package/dist/scale-C2xgZyZN.js +63 -0
- package/dist/scene-0z2gbaDE.js +4938 -0
- package/dist/scene.js +1 -0
- package/dist/slope-chart-BKVEAVCs.js +1279 -0
- package/dist/{src-1EHkSFS-.js → src-BD6xlvDt.js} +2 -2
- package/dist/{src-DVHlknB6.js → src-CExIrXPC.js} +169 -193
- package/dist/src-DIS0YOj0.js +44 -0
- package/dist/src-Dcfq8vE4.js +2195 -0
- package/dist/styles2.css +907 -59
- package/dist/time-series-BgzGNOk0.js +2670 -0
- package/dist/token-heatmap-BrW1OsKD.js +1354 -0
- package/dist/token-predictions-yerq_Oet.js +1093 -0
- package/dist/tone-scope-DKiSw-JR.js +32 -0
- package/dist/transport-BJweqDPj.js +715 -0
- package/dist/tree-diagram-D09BRqE-.js +1629 -0
- package/dist/treemap-CW4WsJNL.js +472 -0
- package/dist/use-tween-5HZ55_9d.js +72 -0
- package/dist/values-963L6n1m.js +65 -0
- package/dist/violin-plot-DrtPZ1-T.js +1292 -0
- package/dist/waterfall-DYLSnGjm.js +576 -0
- package/package.json +78 -4
- package/recipes/allocation-report.tsx +15 -7
- package/recipes/counting-cards.tsx +656 -0
- package/recipes/explorable-essay.tsx +172 -0
- package/skills/extend-elements/SKILL.md +81 -0
- package/skills/plan-lesson/SKILL.md +86 -0
- package/skills/plan-lesson/references/plan-format.md +114 -0
- package/skills/plan-lesson/references/worked-plan.md +171 -0
- package/skills/review-elements/SKILL.md +47 -3
- package/skills/review-explainer/SKILL.md +97 -0
- package/skills/upgrade-elements/SKILL.md +3 -1
- package/skills/upgrade-elements/references/releases.md +249 -0
- package/skills/use-elements/SKILL.md +22 -14
- package/skills/use-elements/references/charts.md +362 -41
- package/skills/use-elements/references/figures.md +173 -0
- package/skills/use-elements/references/kits.md +180 -0
- package/skills/use-elements/references/teaching.md +36 -0
- package/skills/write-explainer/SKILL.md +112 -0
- package/skills/write-explainer/references/article.md +164 -0
- package/skills/write-explainer/references/lesson.md +148 -0
- package/skills/write-explainer/references/mdx.md +78 -0
- package/skills/write-explainer/references/scene-parts.md +273 -0
- package/skills/write-explainer/references/scene.md +168 -0
- package/skills/write-explainer/references/tutor.md +104 -0
- package/skills/write-explainer/references/worked-essay.md +459 -0
- package/templates/essay/AGENTS.md +14 -0
- package/templates/essay/README.md +59 -0
- package/templates/essay/index.html +17 -0
- package/templates/essay/package.template.json +21 -0
- package/templates/essay/plan.json +96 -0
- package/templates/essay/src/essay.mdx +97 -0
- package/templates/essay/src/figures.tsx +92 -0
- package/templates/essay/src/lesson.ts +83 -0
- package/templates/essay/src/main.tsx +53 -0
- package/templates/essay/src/mdx.d.ts +7 -0
- package/templates/essay/tsconfig.template.json +15 -0
- package/templates/essay/vite.config.template.txt +8 -0
- package/dist/categorical-values-BXi-rJuv.js +0 -74
- package/dist/chart-data-CIJVWCYt.js +0 -21
- package/dist/chart-frame-BaxKn_MB.js +0 -236
- package/dist/chart-input-Bm82_9Rd.js +0 -22
- package/dist/chart-theme-4zprJ3rW.js +0 -404
- package/dist/plot-width-v2c_rA20.js +0 -63
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NumericDomain, ValueFormat } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { HeatmapPalette } from '../../../../charts/src/matrix/index.ts';
|
|
4
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
5
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
6
|
+
import type { SceneCellInput, SceneCellsDirection, SceneCellSizeName, SceneCellValues } from './cell-grid.ts';
|
|
7
|
+
/** The words a grid of cells speaks. Placeholders in braces are filled in. */
|
|
8
|
+
export type SceneCellsLabels = {
|
|
9
|
+
/** A cell of a grid with several rows and columns. `{row}`, `{column}` and `{value}`. */
|
|
10
|
+
readonly cell: string;
|
|
11
|
+
/** A cell of a single row, such as a vector. `{column}` and `{value}`. */
|
|
12
|
+
readonly inRow: string;
|
|
13
|
+
/** A cell of a single column. `{row}` and `{value}`. */
|
|
14
|
+
readonly inColumn: string;
|
|
15
|
+
/** `{index}` counts from 1. */
|
|
16
|
+
readonly rowName: string;
|
|
17
|
+
readonly columnName: string;
|
|
18
|
+
/** `{id}` names the grid. */
|
|
19
|
+
readonly noCells: string;
|
|
20
|
+
readonly ragged: string;
|
|
21
|
+
/** `{id}` names the grid, `{labels}` how many labels it got and `{count}` how many rows or columns it has. */
|
|
22
|
+
readonly rowLabelCount: string;
|
|
23
|
+
readonly columnLabelCount: string;
|
|
24
|
+
};
|
|
25
|
+
/** The plain English words of a grid of cells. */
|
|
26
|
+
export declare const sceneCellsLabels: {
|
|
27
|
+
readonly cell: '{row}, {column}: {value}';
|
|
28
|
+
readonly inRow: '{column}: {value}';
|
|
29
|
+
readonly inColumn: '{row}: {value}';
|
|
30
|
+
readonly rowName: 'Row {index}';
|
|
31
|
+
readonly columnName: 'Column {index}';
|
|
32
|
+
readonly noCells: 'The cells "{id}" have nothing to draw. Give `values` or `cells`.';
|
|
33
|
+
readonly ragged: 'The cells "{id}" have rows of different lengths.';
|
|
34
|
+
readonly rowLabelCount: 'The cells "{id}" have {count} rows but {labels} row labels.';
|
|
35
|
+
readonly columnLabelCount: 'The cells "{id}" have {count} columns but {labels} column labels.';
|
|
36
|
+
};
|
|
37
|
+
export type SceneCellsProps = {
|
|
38
|
+
/**
|
|
39
|
+
* Stable across states. Name a cell `${id}.${row}.${column}`; as one object the grid is the box around its cells,
|
|
40
|
+
* where wires meet it, and the scene makes room for its labels too.
|
|
41
|
+
*/
|
|
42
|
+
readonly id: string;
|
|
43
|
+
/** The center of the cells in data units. Labels hang outside it. */
|
|
44
|
+
readonly at: ScenePosition;
|
|
45
|
+
/** The numbers: a flat list is one row (or one column with `direction`), a list of lists is a matrix. */
|
|
46
|
+
readonly values?: SceneCellValues | undefined;
|
|
47
|
+
/** Cells with text or ids, as a list of rows. Used instead of `values`. */
|
|
48
|
+
readonly cells?: ReadonlyArray<ReadonlyArray<SceneCellInput>> | undefined;
|
|
49
|
+
/** Which way a flat list of `values` runs. Defaults to `row`. */
|
|
50
|
+
readonly direction?: SceneCellsDirection | undefined;
|
|
51
|
+
/** How a number is written. Defaults to at most two decimals. A value that eases is formatted on every frame. */
|
|
52
|
+
readonly format?: ValueFormat | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Colors the cells on the matrix charts' scale: `sequential` shades one hue by size, `diverging` uses two hues around
|
|
55
|
+
* zero. Left out, the cells are plain.
|
|
56
|
+
*/
|
|
57
|
+
readonly palette?: HeatmapPalette | undefined;
|
|
58
|
+
/** The values the color spans. Left out: zero to the largest magnitude, or its mirror for `diverging`. */
|
|
59
|
+
readonly domain?: NumericDomain | undefined;
|
|
60
|
+
/** The named size of each cell. Defaults to `medium`. */
|
|
61
|
+
readonly size?: SceneCellSizeName | undefined;
|
|
62
|
+
/** One caption per row, drawn left of the grid in a column as wide as the longest. */
|
|
63
|
+
readonly rowLabels?: ReadonlyArray<string> | undefined;
|
|
64
|
+
/** One caption per column, drawn above the grid. */
|
|
65
|
+
readonly columnLabels?: ReadonlyArray<string> | undefined;
|
|
66
|
+
/** A row, a column, or one cell where both are given, drawn with a strong outline. Indices count from 0. */
|
|
67
|
+
readonly highlight?: {
|
|
68
|
+
readonly row?: number | undefined;
|
|
69
|
+
readonly column?: number | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
/** The readout sentence for the whole grid. With one, the arrow keys reach it. */
|
|
72
|
+
readonly label?: string | undefined;
|
|
73
|
+
/** `context` keeps the cells plain; the others yield to inspection. */
|
|
74
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
75
|
+
/** False fades the grid out and takes its cells out of the keyboard order. */
|
|
76
|
+
readonly isShown?: boolean | undefined;
|
|
77
|
+
readonly labels?: Partial<SceneCellsLabels> | undefined;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* A vector, a weight matrix or an embedding row drawn as a grid of numbered cells. Each cell is its own object with the
|
|
81
|
+
* id `${id}.${row}.${column}`, so wires and callouts can point at it. Its number counts to a new value and its color
|
|
82
|
+
* eases when `values` change, with the meaning of the matrix charts.
|
|
83
|
+
*/
|
|
84
|
+
export declare function SceneCells(props: SceneCellsProps): ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
5
|
+
import type { SceneCardSizeName } from './stack-layout.ts';
|
|
6
|
+
export type SceneSlotProps = {
|
|
7
|
+
/** Stable across states. Wires, brackets and callouts can name the slot. */
|
|
8
|
+
readonly id: string;
|
|
9
|
+
/** The slot's center in data units. */
|
|
10
|
+
readonly at: ScenePosition;
|
|
11
|
+
/**
|
|
12
|
+
* A named card size, with room around it for one card, or an exact pixel box for a row or a pile. Defaults to
|
|
13
|
+
* `medium`.
|
|
14
|
+
*/
|
|
15
|
+
readonly size?: SceneCardSizeName | {
|
|
16
|
+
readonly width: number;
|
|
17
|
+
readonly height: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
/** The caption drawn above the top edge, such as "Bay A". The scene makes room for it. */
|
|
20
|
+
readonly text?: string | undefined;
|
|
21
|
+
/** The readout sentence. With one, the arrow keys reach the slot; Left and Right step on to a card sitting on it. */
|
|
22
|
+
readonly label?: string | undefined;
|
|
23
|
+
/** True draws the slot as the place that matters now: a solid outline and a tint. */
|
|
24
|
+
readonly isActive?: boolean | undefined;
|
|
25
|
+
/** The hue of the outline while active. Defaults to neutral. */
|
|
26
|
+
readonly tone?: ChartTone | undefined;
|
|
27
|
+
/** `context` keeps the slot plain; the others yield to inspection. */
|
|
28
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
29
|
+
/** False fades the slot out and takes it out of the keyboard order. */
|
|
30
|
+
readonly isShown?: boolean | undefined;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A labelled, outlined place where cards or other nodes go: a bay. Cards are not held by it; give them its position, or
|
|
34
|
+
* list them in a stack anchored at the same point. Name it in a wire or a callout, and set `isActive` for the bay in
|
|
35
|
+
* play.
|
|
36
|
+
*/
|
|
37
|
+
export declare function SceneSlot({ id, at, size, text, label, isActive, tone, emphasis, isShown, }: SceneSlotProps): ReactNode;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
3
|
+
import type { SceneStagger } from '../scene-stagger.ts';
|
|
4
|
+
import type { SceneCardSizeName, StackGapName, StackLayout } from './stack-layout.ts';
|
|
5
|
+
/** The words a stack speaks when its input is wrong. */
|
|
6
|
+
export type SceneStackLabels = {
|
|
7
|
+
/** `{id}` names the stack and `{card}` the card another stack lists too. */
|
|
8
|
+
readonly sharedCard: string;
|
|
9
|
+
/** `{id}` names the stack and `{card}` the card it lists twice. */
|
|
10
|
+
readonly repeatedCard: string;
|
|
11
|
+
};
|
|
12
|
+
/** The plain English words of a stack. */
|
|
13
|
+
export declare const sceneStackLabels: {
|
|
14
|
+
readonly sharedCard: 'The stack "{id}" lists the card "{card}", which another stack lists too. A card sits in one stack.';
|
|
15
|
+
readonly repeatedCard: 'The stack "{id}" lists the card "{card}" twice.';
|
|
16
|
+
};
|
|
17
|
+
export type SceneStackProps = {
|
|
18
|
+
/**
|
|
19
|
+
* Stable across states. A wire, group, bracket, callout or the camera can name the stack: as one object it is the box
|
|
20
|
+
* around all its cards.
|
|
21
|
+
*/
|
|
22
|
+
readonly id: string;
|
|
23
|
+
/** The anchor in data units: the bottom card of a pile, the middle of a row, column or fan. */
|
|
24
|
+
readonly at: ScenePosition;
|
|
25
|
+
/** The ids of the `SceneCard`s in the stack, in order: bottom of a pile, left of a row, top of a column. */
|
|
26
|
+
readonly cards: ReadonlyArray<string>;
|
|
27
|
+
/** Defaults to `pile`. */
|
|
28
|
+
readonly layout?: StackLayout | undefined;
|
|
29
|
+
/** The room between cards in a row, column or fan. Defaults to `medium`. */
|
|
30
|
+
readonly gap?: StackGapName | undefined;
|
|
31
|
+
/** The card size every card in the stack takes. Defaults to `medium`. */
|
|
32
|
+
readonly size?: SceneCardSizeName | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Deals in turn: cards that arrive or move in the same update start this step apart, in stack order, and a card that
|
|
35
|
+
* moves alone starts at once. Left out, they all start together.
|
|
36
|
+
*/
|
|
37
|
+
readonly stagger?: SceneStagger | undefined;
|
|
38
|
+
/** The readout sentence. With one, the arrow keys reach the stack, which lights all its cards. */
|
|
39
|
+
readonly label?: string | undefined;
|
|
40
|
+
readonly labels?: Partial<SceneStackLabels> | undefined;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Places the cards it lists as a pile, a fan, a row or a column from one anchor, and keeps room in the scene for all of
|
|
44
|
+
* them. Declare it before its cards. Reorder, add or move ids between stacks and the cards ease or travel into place.
|
|
45
|
+
*/
|
|
46
|
+
export declare function SceneStack({ id, at, cards, layout, gap, size, stagger, label, labels: labelInput, }: SceneStackProps): ReactNode;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone, ValueFormat } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { SceneOffset, ScenePosition } from '../scene-geometry.ts';
|
|
5
|
+
/** The words a token speaks. `{token}` is the quoted text, `{probability}` and `{id}` the numbers under it. */
|
|
6
|
+
export type SceneTokenLabels = {
|
|
7
|
+
readonly plain: string;
|
|
8
|
+
readonly withProbability: string;
|
|
9
|
+
readonly withId: string;
|
|
10
|
+
readonly withBoth: string;
|
|
11
|
+
};
|
|
12
|
+
/** The plain English words of a token. */
|
|
13
|
+
export declare const sceneTokenLabels: {
|
|
14
|
+
readonly plain: '{token}';
|
|
15
|
+
readonly withProbability: '{token}, probability {probability}';
|
|
16
|
+
readonly withId: '{token}, token id {id}';
|
|
17
|
+
readonly withBoth: '{token}, token id {id}, probability {probability}';
|
|
18
|
+
};
|
|
19
|
+
export type SceneTokenProps = {
|
|
20
|
+
/** Stable across states: the token with this id moves to its new props. */
|
|
21
|
+
readonly id: string;
|
|
22
|
+
/** The token's center in data units. */
|
|
23
|
+
readonly at: ScenePosition;
|
|
24
|
+
/** A shift from `at` in pixels. `SceneTokens` uses it to lay a sequence out. */
|
|
25
|
+
readonly offset?: SceneOffset | undefined;
|
|
26
|
+
/** The token's exact text. Spaces, tabs and newlines show faint marks, as in the text charts. */
|
|
27
|
+
readonly text: string;
|
|
28
|
+
/** The vocabulary id, written under the text. */
|
|
29
|
+
readonly tokenId?: number | string | undefined;
|
|
30
|
+
/** A probability from 0 to 1, written under the text with a bar along the bottom. It eases when it changes. */
|
|
31
|
+
readonly probability?: number | undefined;
|
|
32
|
+
/** How the probability is written. Defaults to a percent with one decimal. */
|
|
33
|
+
readonly format?: ValueFormat | undefined;
|
|
34
|
+
/** The hue of the outline and the bar. Left out, a plain outline and a series bar. */
|
|
35
|
+
readonly tone?: ChartTone | undefined;
|
|
36
|
+
/** The readout sentence. Left out, the quoted text with its id and probability. */
|
|
37
|
+
readonly label?: string | undefined;
|
|
38
|
+
/** `context` draws the token plain; the others yield to inspection. */
|
|
39
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
40
|
+
/** False fades the token out and takes it out of the keyboard order. */
|
|
41
|
+
readonly isShown?: boolean | undefined;
|
|
42
|
+
/** True keeps the token at full strength while the rest recede. */
|
|
43
|
+
readonly isActive?: boolean | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* True draws the token without making room for it in the scene's layout. `SceneTokens` sets it, because the sequence
|
|
46
|
+
* makes room for all its tokens at once.
|
|
47
|
+
*/
|
|
48
|
+
readonly isFloating?: boolean | undefined;
|
|
49
|
+
readonly labels?: Partial<SceneTokenLabels> | undefined;
|
|
50
|
+
};
|
|
51
|
+
/** How a token writes its probability unless told otherwise. */
|
|
52
|
+
export declare const tokenPercent: ValueFormat;
|
|
53
|
+
/** The text under a token, from its id and the probability as written. */
|
|
54
|
+
export declare function tokenCaption({ tokenId, probability, }: {
|
|
55
|
+
readonly tokenId: number | string | undefined;
|
|
56
|
+
readonly probability: string | undefined;
|
|
57
|
+
}): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* One token of text in the monospace face, with its vocabulary id or a probability under it, in the style of the text
|
|
60
|
+
* charts. Give it a position and it eases there; give it a new probability and its bar and number count to it. Its box
|
|
61
|
+
* is sized from its character count, never measured.
|
|
62
|
+
*/
|
|
63
|
+
export declare function SceneToken({ id, at, offset, text, tokenId, probability, format, tone, label, emphasis, isShown, isActive, isFloating, labels: labelInput, }: SceneTokenProps): ReactNode;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ChartTone, ValueFormat } from '../../../../charts/src/index.ts';
|
|
3
|
+
import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
4
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
5
|
+
import type { TokenGapName } from './token-layout.ts';
|
|
6
|
+
/** One token of a sequence. Its scene id is `${sequence id}.${index}`. */
|
|
7
|
+
export type SceneTokenItem = {
|
|
8
|
+
readonly text: string;
|
|
9
|
+
readonly tokenId?: number | string | undefined;
|
|
10
|
+
readonly probability?: number | undefined;
|
|
11
|
+
readonly tone?: ChartTone | undefined;
|
|
12
|
+
/** The readout sentence. Left out, the quoted text with its id and probability. */
|
|
13
|
+
readonly label?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type SceneTokensProps = {
|
|
16
|
+
/** Stable across states. Name one token as `${id}.${index}`; the sequence is the box around its rows. */
|
|
17
|
+
readonly id: string;
|
|
18
|
+
/** The center of the whole block in data units. */
|
|
19
|
+
readonly at: ScenePosition;
|
|
20
|
+
/** The sequence in reading order. */
|
|
21
|
+
readonly tokens: ReadonlyArray<SceneTokenItem>;
|
|
22
|
+
/** The width in pixels at which the row wraps to a new line. Defaults to 480. */
|
|
23
|
+
readonly wrapWidth?: number | undefined;
|
|
24
|
+
/** The room between tokens. Defaults to `medium`. */
|
|
25
|
+
readonly gap?: TokenGapName | undefined;
|
|
26
|
+
/** How probabilities are written. Defaults to a percent with one decimal. */
|
|
27
|
+
readonly format?: ValueFormat | undefined;
|
|
28
|
+
/** The readout sentence for the whole sequence. With one, the arrow keys reach it. */
|
|
29
|
+
readonly label?: string | undefined;
|
|
30
|
+
/** `context` draws every token plain; the others yield to inspection. */
|
|
31
|
+
readonly emphasis?: MarkEmphasis | undefined;
|
|
32
|
+
/** False fades the sequence out and takes its tokens out of the keyboard order. */
|
|
33
|
+
readonly isShown?: boolean | undefined;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* A sequence of tokens laid out in a row that wraps, each with a stable id `${id}.${index}`. Add, remove or change
|
|
37
|
+
* tokens and the rest ease along. Use it for a prompt, a completion or a context window; the text charts draw the same
|
|
38
|
+
* tokens when the figure is data rather than a part of a diagram.
|
|
39
|
+
*/
|
|
40
|
+
export declare function SceneTokens({ id, at, tokens, wrapWidth, gap, format, label, emphasis, isShown, }: SceneTokensProps): ReactNode;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ScenePosition } from '../scene-geometry.ts';
|
|
2
|
+
import type { SceneStagger } from '../scene-stagger.ts';
|
|
3
|
+
import type { SceneCardSizeName, StackGapName, StackLayout } from './stack-layout.ts';
|
|
4
|
+
/** What a stack tells the cards it lists. */
|
|
5
|
+
export type StackSpec = {
|
|
6
|
+
readonly at: ScenePosition;
|
|
7
|
+
readonly layout: StackLayout;
|
|
8
|
+
readonly size: SceneCardSizeName;
|
|
9
|
+
readonly gap: StackGapName;
|
|
10
|
+
/** The ids of the cards in order: the bottom of a pile first, the left of a row first. */
|
|
11
|
+
readonly cards: ReadonlyArray<string>;
|
|
12
|
+
/** The step between cards that move in the same update, or undefined when they all start at once. */
|
|
13
|
+
readonly stagger: SceneStagger | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** Where a card sits: the stack that lists it and its place in that stack's order. */
|
|
16
|
+
export type StackSlot = {
|
|
17
|
+
readonly stackId: string;
|
|
18
|
+
readonly spec: StackSpec;
|
|
19
|
+
readonly index: number;
|
|
20
|
+
};
|
|
21
|
+
/** The scene's record of its stacks, so a card finds its place without being nested inside its stack. */
|
|
22
|
+
export type StackBook = {
|
|
23
|
+
/** Records a stack without telling anyone, so cards rendered after it in one pass see it. Undefined removes it. */
|
|
24
|
+
readonly set: (id: string, spec: StackSpec | undefined) => void;
|
|
25
|
+
/** Tells the cards that a stack changed since the last flush. Call it from a layout effect. */
|
|
26
|
+
readonly flush: () => void;
|
|
27
|
+
readonly slotOf: (cardId: string) => StackSlot | undefined;
|
|
28
|
+
/** A card that this stack lists and another stack lists too, or undefined. */
|
|
29
|
+
readonly sharedCard: (stackId: string) => string | undefined;
|
|
30
|
+
/** Changes whenever a flush tells the cards something. Use it as the store snapshot. */
|
|
31
|
+
readonly version: () => number;
|
|
32
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
33
|
+
};
|
|
34
|
+
/** The stack book of a scene, made on first use and kept as long as the scene's registry lives. */
|
|
35
|
+
export declare const stackBookOf: (registry: import("../scene-registry.ts").SceneRegistry) => StackBook;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { SceneOffset } from '../scene-geometry.ts';
|
|
2
|
+
/** The pixel boxes of the named card sizes, in playing-card proportions. */
|
|
3
|
+
export declare const sceneCardSizes: {
|
|
4
|
+
readonly small: {
|
|
5
|
+
readonly width: 56;
|
|
6
|
+
readonly height: 78;
|
|
7
|
+
};
|
|
8
|
+
readonly medium: {
|
|
9
|
+
readonly width: 84;
|
|
10
|
+
readonly height: 118;
|
|
11
|
+
};
|
|
12
|
+
readonly large: {
|
|
13
|
+
readonly width: 144;
|
|
14
|
+
readonly height: 202;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/** A named card size. */
|
|
18
|
+
export type SceneCardSizeName = keyof typeof sceneCardSizes;
|
|
19
|
+
/** The room between cards in a row, a column or a fan, by name, in CSS pixels. */
|
|
20
|
+
export declare const stackGaps: {
|
|
21
|
+
readonly small: 4;
|
|
22
|
+
readonly medium: 12;
|
|
23
|
+
readonly large: 24;
|
|
24
|
+
};
|
|
25
|
+
/** A named gap between the cards of a stack. */
|
|
26
|
+
export type StackGapName = keyof typeof stackGaps;
|
|
27
|
+
/**
|
|
28
|
+
* How a stack arranges its cards: stacked with a small step, overlapped along an arc, side by side, or one under
|
|
29
|
+
* another.
|
|
30
|
+
*/
|
|
31
|
+
export type StackLayout = 'pile' | 'fan' | 'row' | 'column';
|
|
32
|
+
/** What `stackOffset` and `stackBounds` need to know about a stack. */
|
|
33
|
+
export type StackShape = {
|
|
34
|
+
readonly layout: StackLayout;
|
|
35
|
+
/** How many cards the stack holds. */
|
|
36
|
+
readonly count: number;
|
|
37
|
+
readonly size: SceneCardSizeName;
|
|
38
|
+
readonly gap: StackGapName;
|
|
39
|
+
};
|
|
40
|
+
/** Where one card of a stack sits: its shift from the stack's anchor in pixels, and its turn in degrees. */
|
|
41
|
+
export type StackPlace = {
|
|
42
|
+
readonly offset: SceneOffset;
|
|
43
|
+
readonly rotate: number;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Where the card at `index` sits in a stack. A pile grows up and right from its bottom card; a row or column is
|
|
47
|
+
* centered on it, and a fan turns its cards out along an arc. The first card is the bottom of a pile, the left of a row
|
|
48
|
+
* or fan, and the top of a column.
|
|
49
|
+
*/
|
|
50
|
+
export declare function stackPlace({ layout, count, size, gap, index }: StackShape & {
|
|
51
|
+
readonly index: number;
|
|
52
|
+
}): StackPlace;
|
|
53
|
+
/** The pixel box around a whole stack: its center's shift from the anchor and its size. */
|
|
54
|
+
export type StackBounds = {
|
|
55
|
+
readonly offset: SceneOffset;
|
|
56
|
+
readonly width: number;
|
|
57
|
+
readonly height: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The box around every card of a stack, turned cards included, so a wire, a group, a bracket or the camera can address
|
|
61
|
+
* the stack as one object. An empty stack is one card's box.
|
|
62
|
+
*/
|
|
63
|
+
export declare function stackBounds(shape: StackShape): StackBounds;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SceneOffset } from '../scene-geometry.ts';
|
|
2
|
+
/** The pixels between neighbouring tokens, by name. */
|
|
3
|
+
export declare const tokenGaps: {
|
|
4
|
+
readonly small: 4;
|
|
5
|
+
readonly medium: 8;
|
|
6
|
+
readonly large: 16;
|
|
7
|
+
};
|
|
8
|
+
/** A named gap between tokens. */
|
|
9
|
+
export type TokenGapName = keyof typeof tokenGaps;
|
|
10
|
+
/** What decides a token's box: its text, and the text under it. */
|
|
11
|
+
export type TokenBoxInput = {
|
|
12
|
+
readonly text: string;
|
|
13
|
+
readonly caption: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
/** The pixel box of a token: wide enough for its characters, capped, and taller when a line sits under the text. */
|
|
16
|
+
export declare function tokenBox({ text, caption }: TokenBoxInput): {
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
};
|
|
20
|
+
/** Each token's center as a shift in pixels from the block's center, and the block's size. */
|
|
21
|
+
export type TokenFlow = {
|
|
22
|
+
readonly offsets: ReadonlyArray<SceneOffset>;
|
|
23
|
+
readonly width: number;
|
|
24
|
+
readonly height: number;
|
|
25
|
+
};
|
|
26
|
+
type TokenBox = {
|
|
27
|
+
readonly width: number;
|
|
28
|
+
readonly height: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Lays token boxes out left to right and wraps to a new row when the next would pass `wrapWidth`. Rows are as tall as
|
|
32
|
+
* their tallest token. Offsets are from the block's center, so a block keeps its center as tokens come and go.
|
|
33
|
+
*/
|
|
34
|
+
export declare function tokenFlow({ boxes, wrapWidth, gap, }: {
|
|
35
|
+
readonly boxes: ReadonlyArray<TokenBox>;
|
|
36
|
+
readonly wrapWidth: number;
|
|
37
|
+
readonly gap: TokenGapName;
|
|
38
|
+
}): TokenFlow;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AnyLesson } from '../lesson/define-lesson.ts';
|
|
2
|
+
import type { LessonFinding } from './findings.ts';
|
|
3
|
+
/** A beat as the teaching advice reads it, from a plan or from a defined lesson. */
|
|
4
|
+
export type AdviceBeat = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly hasGoal: boolean;
|
|
8
|
+
/** The values each declared state sets. */
|
|
9
|
+
readonly states: ReadonlyArray<Readonly<Record<string, unknown>>>;
|
|
10
|
+
};
|
|
11
|
+
/** A lesson as the teaching advice reads it. */
|
|
12
|
+
export type AdviceOutline = {
|
|
13
|
+
/** The opening value of every param. */
|
|
14
|
+
readonly defaults: Readonly<Record<string, unknown>>;
|
|
15
|
+
readonly beats: ReadonlyArray<AdviceBeat>;
|
|
16
|
+
};
|
|
17
|
+
/** The teaching advice every lesson gets, from a plan or from a definition. */
|
|
18
|
+
export declare function outlineAdvice(outline: AdviceOutline): ReadonlyArray<LessonFinding>;
|
|
19
|
+
/**
|
|
20
|
+
* Teaching advice for a lesson made by `defineLesson`: beats with no goal, beats that introduce several params at once,
|
|
21
|
+
* params no state moves and long runs without a recap. The definition itself was checked when it was made.
|
|
22
|
+
*/
|
|
23
|
+
export declare function checkLesson(lesson: AnyLesson): ReadonlyArray<LessonFinding>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { AnyLesson, LessonValue, ToggleValue } from '../lesson/define-lesson.ts';
|
|
2
|
+
/** A number format as plain JSON: the `Intl` options, or null for a format the author wrote as a function. */
|
|
3
|
+
export type OutlineFormat = Readonly<Intl.NumberFormatOptions> | null;
|
|
4
|
+
/** A param in an outline: its name, kind, label and opening value, with its range or options. */
|
|
5
|
+
export type OutlineParam = {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly kind: 'number';
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly value: number;
|
|
10
|
+
readonly min: number;
|
|
11
|
+
readonly max: number;
|
|
12
|
+
readonly step: number;
|
|
13
|
+
readonly scale: 'linear' | 'log';
|
|
14
|
+
readonly format: OutlineFormat;
|
|
15
|
+
} | {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly kind: 'choice';
|
|
18
|
+
readonly label: string;
|
|
19
|
+
readonly value: string;
|
|
20
|
+
readonly options: ReadonlyArray<{
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly label: string;
|
|
23
|
+
}>;
|
|
24
|
+
} | {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly kind: 'toggle';
|
|
27
|
+
readonly label: string;
|
|
28
|
+
readonly value: ToggleValue;
|
|
29
|
+
};
|
|
30
|
+
/** A derived value in an outline, with the names it reads. */
|
|
31
|
+
export type OutlineDerived = {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly label: string;
|
|
34
|
+
readonly format: OutlineFormat;
|
|
35
|
+
readonly reads: ReadonlyArray<string>;
|
|
36
|
+
};
|
|
37
|
+
/** A declared state with the derived values it leads to. */
|
|
38
|
+
export type OutlineState = {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly label: string;
|
|
41
|
+
/** The params the state sets. */
|
|
42
|
+
readonly values: Readonly<Record<string, LessonValue>>;
|
|
43
|
+
/** Every derived value once the state is shown over the opening values. */
|
|
44
|
+
readonly derived: Readonly<Record<string, number>>;
|
|
45
|
+
};
|
|
46
|
+
/** A beat in an outline, with its tutor notes. */
|
|
47
|
+
export type OutlineBeat = {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly title: string;
|
|
50
|
+
readonly goal: string | null;
|
|
51
|
+
readonly misconception: string | null;
|
|
52
|
+
readonly hints: ReadonlyArray<string>;
|
|
53
|
+
readonly steps: number;
|
|
54
|
+
readonly states: ReadonlyArray<OutlineState>;
|
|
55
|
+
};
|
|
56
|
+
/** A defined lesson as plain JSON: what an agent reads to know the lesson without rendering it. */
|
|
57
|
+
export type LessonOutline = {
|
|
58
|
+
readonly id: string;
|
|
59
|
+
readonly title: string;
|
|
60
|
+
readonly params: ReadonlyArray<OutlineParam>;
|
|
61
|
+
readonly derived: ReadonlyArray<OutlineDerived>;
|
|
62
|
+
/** Every param and derived value at the opening. */
|
|
63
|
+
readonly initial: Readonly<Record<string, LessonValue>>;
|
|
64
|
+
readonly beats: ReadonlyArray<OutlineBeat>;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The outline of a defined lesson as plain JSON: params with their ranges, derived values with what they read, and
|
|
68
|
+
* beats with tutor notes and each state's derived values. A tutor or a planning agent reads it instead of the page.
|
|
69
|
+
*/
|
|
70
|
+
export declare function describeLesson(lesson: AnyLesson): LessonOutline;
|
|
71
|
+
/**
|
|
72
|
+
* A param or derived value written as the reader sees it: a number in its declared format, a choice by its option's
|
|
73
|
+
* label, a toggle as on or off.
|
|
74
|
+
*/
|
|
75
|
+
export declare function writtenValue({ lesson, name, value, locale, }: {
|
|
76
|
+
readonly lesson: AnyLesson;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly value: LessonValue;
|
|
79
|
+
readonly locale: string;
|
|
80
|
+
}): string;
|
|
81
|
+
/**
|
|
82
|
+
* The lesson as text an agent reads without rendering it. It lists the params and derived values, then each beat with
|
|
83
|
+
* its tutor notes. Each declared state follows, with every value written in its format.
|
|
84
|
+
*/
|
|
85
|
+
export declare function lessonWalk(lesson: AnyLesson, locale: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Every teaching part an author or an agent chooses between when writing an explainer, in reading order. */
|
|
2
|
+
export declare const explainerParts: readonly ['Lesson', 'Param', 'Value', 'ParamSlider', 'ParamChoice', 'ParamToggle', 'Playback', 'Transport', 'Scene', 'SceneNode', 'SceneWire', 'SceneGroup', 'SceneBracket', 'SceneCallout', 'SceneHighlight', 'SceneCustom', 'SceneAxes', 'SceneCurve', 'ScenePoint', 'SceneVector', 'SceneProjection', 'SceneRegion', 'SceneRule', 'SceneCard', 'SceneStack', 'SceneSlot', 'SceneCells', 'SceneToken', 'SceneTokens', 'SceneFlow', 'LessonFlow', 'MorphScope', 'Article', 'Beat', 'Figure', 'FigureReference', 'Reveal', 'Scrolly', 'Predict', 'Challenge', 'Aside', 'Footnote', 'Cite', 'References', 'TeX', 'Term', 'DiagramPart'];
|
|
3
|
+
/** The name of a teaching part. */
|
|
4
|
+
export type ExplainerPart = (typeof explainerParts)[number];
|
|
5
|
+
/** One teaching part in the guide: the reader question it answers, when to use it, and a few lines of TSX. */
|
|
6
|
+
export type ExplainerGuideEntry = {
|
|
7
|
+
readonly part: ExplainerPart;
|
|
8
|
+
/** The public entry to import it from. */
|
|
9
|
+
readonly entry: string;
|
|
10
|
+
/** The question a reader has that this part answers, in the reader's words. */
|
|
11
|
+
readonly question: string;
|
|
12
|
+
/** When to use it, and when another part is better, naming it. */
|
|
13
|
+
readonly guidance: string;
|
|
14
|
+
/** A few lines of TSX that use it well. */
|
|
15
|
+
readonly example: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The teaching parts, each with the reader question it answers, when to use it, and a short TSX example. Read it to
|
|
19
|
+
* choose parts when planning a lesson; a plan's figure names one of these parts or a chart from `chartGuide`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const explainerGuide: ReadonlyArray<ExplainerGuideEntry>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AnyLesson } from '../lesson/define-lesson.ts';
|
|
2
|
+
/** One thing a check found: where it is, a sentence that says what to do, and whether it stops the lesson. */
|
|
3
|
+
export type LessonFinding = {
|
|
4
|
+
/** Where the finding is, written like `beats[2].states[0].values.temperature`. */
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly message: string;
|
|
7
|
+
/** `error` means `defineLesson` would refuse it; `advice` is teaching practice the author may decline. */
|
|
8
|
+
readonly severity: 'error' | 'advice';
|
|
9
|
+
};
|
|
10
|
+
/** What a value must be to suit a param: a number in a range, one option id, or true or false. */
|
|
11
|
+
export type ValueRule = {
|
|
12
|
+
readonly kind: 'number';
|
|
13
|
+
readonly min: number;
|
|
14
|
+
readonly max: number;
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'choice';
|
|
17
|
+
readonly ids: ReadonlyArray<string>;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'toggle';
|
|
20
|
+
};
|
|
21
|
+
/** An error finding. */
|
|
22
|
+
export declare function errorAt(path: string, message: string): LessonFinding;
|
|
23
|
+
/** An advice finding. */
|
|
24
|
+
export declare function adviceAt(path: string, message: string): LessonFinding;
|
|
25
|
+
/** The fields of a plain object, or undefined for anything else. */
|
|
26
|
+
export declare function fieldsOf(value: unknown): ReadonlyMap<string, unknown> | undefined;
|
|
27
|
+
/** A value's JSON kind with its article, for messages: "a string", "an array", "nothing". */
|
|
28
|
+
export declare function kindText(value: unknown): string;
|
|
29
|
+
/** Why `value` does not suit a param with this rule, or undefined when it does. */
|
|
30
|
+
export declare function ruleProblem(name: string, rule: ValueRule, value: unknown): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Why a lesson would refuse `value` for the param `name`, or undefined when it takes it. Ask before setting a value
|
|
33
|
+
* through the agent bridge, or when checking a tour or a state written by hand.
|
|
34
|
+
*/
|
|
35
|
+
export declare function valueProblem({ lesson, name, value, }: {
|
|
36
|
+
readonly lesson: AnyLesson;
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly value: unknown;
|
|
39
|
+
}): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lessons as plain data, for authors and their agents. Check a plan before writing components, read a defined lesson as
|
|
3
|
+
* an outline or as text, get teaching advice, and choose parts from the guide. Runs in Node and in the browser.
|
|
4
|
+
*/
|
|
5
|
+
export { checkLesson } from './advice.ts';
|
|
6
|
+
export type { LessonOutline, OutlineBeat, OutlineDerived, OutlineFormat, OutlineParam, OutlineState, } from './describe-lesson.ts';
|
|
7
|
+
export { describeLesson, lessonWalk, writtenValue } from './describe-lesson.ts';
|
|
8
|
+
export type { ExplainerGuideEntry, ExplainerPart } from './explainer-guide.ts';
|
|
9
|
+
export { explainerGuide, explainerParts } from './explainer-guide.ts';
|
|
10
|
+
export type { LessonFinding } from './findings.ts';
|
|
11
|
+
export { valueProblem } from './findings.ts';
|
|
12
|
+
export type { LessonPlan, LessonPlanAsk, LessonPlanBeat, LessonPlanDerived, LessonPlanFigure } from './lesson-plan.ts';
|
|
13
|
+
export type { LessonPlanResult } from './validate-plan.ts';
|
|
14
|
+
export { validateLessonPlan } from './validate-plan.ts';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ValueFormat } from '../../../charts/src/index.ts';
|
|
2
|
+
import type { LessonBeat, LessonParam } from '../lesson/define-lesson.ts';
|
|
3
|
+
/** A derived value as a plan names it: what it reads and its formula in words, before any code exists. */
|
|
4
|
+
export type LessonPlanDerived = {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly format: ValueFormat;
|
|
7
|
+
/** The params and earlier derived values it reads. */
|
|
8
|
+
readonly reads: ReadonlyArray<string>;
|
|
9
|
+
/** The formula in words, such as "the softmax share of the followed token". */
|
|
10
|
+
readonly formula: string;
|
|
11
|
+
};
|
|
12
|
+
/** The figure a beat shows: a teaching part from `explainerGuide` or a chart name, and the question it answers. */
|
|
13
|
+
export type LessonPlanFigure = {
|
|
14
|
+
readonly part: string;
|
|
15
|
+
readonly question: string;
|
|
16
|
+
/** The params and derived values it draws. */
|
|
17
|
+
readonly shows?: ReadonlyArray<string> | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** A prediction the reader commits to, or a challenge the reader reaches by moving params. */
|
|
20
|
+
export type LessonPlanAsk = {
|
|
21
|
+
readonly kind: 'predict' | 'challenge';
|
|
22
|
+
readonly prompt: string;
|
|
23
|
+
};
|
|
24
|
+
/** One beat as a plan describes it: the lesson beat, with the figure it shows and what it asks. */
|
|
25
|
+
export type LessonPlanBeat = LessonBeat & {
|
|
26
|
+
readonly figure?: LessonPlanFigure | undefined;
|
|
27
|
+
readonly ask?: LessonPlanAsk | undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The plain JSON an agent drafts before writing any component: who it is for, the one idea, the values and the beats.
|
|
31
|
+
* `validateLessonPlan` checks it. Its params and beats carry over to `defineLesson` unchanged.
|
|
32
|
+
*/
|
|
33
|
+
export type LessonPlan = {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly title: string;
|
|
36
|
+
/** Who reads it and what they already know. */
|
|
37
|
+
readonly audience: string;
|
|
38
|
+
/** The one idea the reader should leave with. */
|
|
39
|
+
readonly idea: string;
|
|
40
|
+
readonly params: Readonly<Record<string, LessonParam>>;
|
|
41
|
+
readonly derived?: Readonly<Record<string, LessonPlanDerived>> | undefined;
|
|
42
|
+
readonly beats: ReadonlyArray<LessonPlanBeat>;
|
|
43
|
+
};
|