@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,136 @@
|
|
|
1
|
+
import type { ValueFormat } from '../../../charts/src/index.ts';
|
|
2
|
+
/** A number the reader changes, with its range, its step grid and how it is written. */
|
|
3
|
+
export type NumberParam = {
|
|
4
|
+
readonly kind: 'number';
|
|
5
|
+
readonly label: string;
|
|
6
|
+
/** The value the lesson opens with. */
|
|
7
|
+
readonly value: number;
|
|
8
|
+
readonly min: number;
|
|
9
|
+
readonly max: number;
|
|
10
|
+
/** The grid values land on. A player advances by one step at a time. */
|
|
11
|
+
readonly step: number;
|
|
12
|
+
/** `log` gives each tenfold the same drag distance, for rates and other ratios. */
|
|
13
|
+
readonly scale?: 'linear' | 'log' | undefined;
|
|
14
|
+
readonly format: ValueFormat;
|
|
15
|
+
};
|
|
16
|
+
/** One of a few named options, such as which card is dealt. */
|
|
17
|
+
export type ChoiceParam = {
|
|
18
|
+
readonly kind: 'choice';
|
|
19
|
+
readonly label: string;
|
|
20
|
+
/** The id of the option the lesson opens with. */
|
|
21
|
+
readonly value: string;
|
|
22
|
+
readonly options: ReadonlyArray<{
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly label: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
/** A yes or no setting, such as whether an answer is revealed. */
|
|
28
|
+
export type ToggleParam = {
|
|
29
|
+
readonly kind: 'toggle';
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly value: ToggleValue;
|
|
32
|
+
};
|
|
33
|
+
/** Whether a toggle is on. */
|
|
34
|
+
export type ToggleValue = boolean;
|
|
35
|
+
/** A value the reader, the application or an agent may set. */
|
|
36
|
+
export type LessonParam = NumberParam | ChoiceParam | ToggleParam;
|
|
37
|
+
/** What a param or derived value holds. */
|
|
38
|
+
export type LessonValue = number | string | boolean;
|
|
39
|
+
/** The params of a lesson, by name. */
|
|
40
|
+
export type LessonParams = Readonly<Record<string, LessonParam>>;
|
|
41
|
+
/** A named state of the lesson: the values a beat shows at one moment. Plain data. */
|
|
42
|
+
export type LessonState = {
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly values: Readonly<Record<string, LessonValue>>;
|
|
46
|
+
};
|
|
47
|
+
/** One beat of the essay as data, so an agent can read the outline without rendering it. */
|
|
48
|
+
export type LessonBeat = {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly title: string;
|
|
51
|
+
/** Tutor notes. Never shown to the reader. */
|
|
52
|
+
readonly goal?: string | undefined;
|
|
53
|
+
readonly misconception?: string | undefined;
|
|
54
|
+
readonly hints?: ReadonlyArray<string> | undefined;
|
|
55
|
+
/** How many reveal steps the beat has after its first view. Defaults to 0. */
|
|
56
|
+
readonly steps?: number | undefined;
|
|
57
|
+
/** The states worth seeing on a beat sheet and in the static view. The first is the beat's opening state. */
|
|
58
|
+
readonly states?: ReadonlyArray<LessonState> | undefined;
|
|
59
|
+
};
|
|
60
|
+
/** A derived value as a lesson keeps it: its label and format. */
|
|
61
|
+
export type LessonDerived = {
|
|
62
|
+
readonly label: string;
|
|
63
|
+
readonly format: ValueFormat;
|
|
64
|
+
};
|
|
65
|
+
type ParamValue<Param> = Param extends NumberParam ? number : Param extends ChoiceParam ? Param['options'][number]['id'] : Param extends ToggleParam ? boolean : never;
|
|
66
|
+
/** The value of each param, typed by its kind: a number, an option id or a boolean. */
|
|
67
|
+
export type ParamValues<Params extends LessonParams> = {
|
|
68
|
+
readonly [Name in keyof Params]: ParamValue<Params[Name]>;
|
|
69
|
+
};
|
|
70
|
+
/** Every value a lesson's readers see: its params and its derived numbers. */
|
|
71
|
+
export type LessonValues<Params extends LessonParams, Derived extends string> = string extends Derived ? Readonly<Record<string, LessonValue>> : ParamValues<Params> & Readonly<Record<Derived, number>>;
|
|
72
|
+
/** How an author declares a derived value: `from` is a pure function of the params and earlier derived values. */
|
|
73
|
+
export type LessonDerivedInput<Values> = LessonDerived & {
|
|
74
|
+
readonly from: (values: Values) => number;
|
|
75
|
+
};
|
|
76
|
+
/** A lesson made by `defineLesson`: the params, derived values and beats every part of the lesson reads. */
|
|
77
|
+
export type LessonDefinition<Params extends LessonParams = LessonParams, Derived extends string = string, Beat extends string = string> = {
|
|
78
|
+
readonly id: string;
|
|
79
|
+
readonly title: string;
|
|
80
|
+
readonly params: Params;
|
|
81
|
+
readonly derived: Readonly<Record<Derived, LessonDerived>>;
|
|
82
|
+
readonly beats: ReadonlyArray<LessonBeat & {
|
|
83
|
+
readonly id: Beat;
|
|
84
|
+
}>;
|
|
85
|
+
/** The opening value of every param. */
|
|
86
|
+
readonly defaults: ParamValues<Params>;
|
|
87
|
+
/** Every value, params and derived, at the opening values. */
|
|
88
|
+
readonly initial: LessonValues<Params, Derived>;
|
|
89
|
+
/** Every derived value from a full set of param values, in declaration order. */
|
|
90
|
+
readonly compute: (values: Readonly<Record<string, LessonValue>>) => Readonly<Record<string, number>>;
|
|
91
|
+
/** The names each derived value reads, from evaluating it over the defaults and every beat state. */
|
|
92
|
+
readonly reads: Readonly<Record<string, ReadonlyArray<string>>>;
|
|
93
|
+
};
|
|
94
|
+
/** What an author writes to declare a lesson. */
|
|
95
|
+
export type LessonInput<Params extends LessonParams, Derived extends string, Beat extends string> = {
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly title: string;
|
|
98
|
+
readonly params: Params;
|
|
99
|
+
/** Values computed from params and from derived values declared earlier. `from` must be pure. */
|
|
100
|
+
readonly derived?: Readonly<Record<Derived, LessonDerivedInput<LessonValues<Params, Derived>>>> | undefined;
|
|
101
|
+
readonly beats?: ReadonlyArray<LessonBeat & {
|
|
102
|
+
readonly id: Beat;
|
|
103
|
+
}> | undefined;
|
|
104
|
+
};
|
|
105
|
+
/** Any lesson, whatever its params. Untyped parts take this. */
|
|
106
|
+
export type AnyLesson = LessonDefinition;
|
|
107
|
+
/** The graph of a lesson: its values and which values each derived value reads. */
|
|
108
|
+
export type LessonGraph = {
|
|
109
|
+
readonly nodes: ReadonlyArray<{
|
|
110
|
+
readonly name: string;
|
|
111
|
+
readonly kind: 'param' | 'derived';
|
|
112
|
+
readonly label: string;
|
|
113
|
+
}>;
|
|
114
|
+
readonly edges: ReadonlyArray<{
|
|
115
|
+
readonly from: string;
|
|
116
|
+
readonly to: string;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
/** Why `value` cannot be the value of `param`, or undefined when it can. */
|
|
120
|
+
export declare function paramProblem({ name, param, value, }: {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly param: LessonParam;
|
|
123
|
+
readonly value: unknown;
|
|
124
|
+
}): string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Declares a lesson: its params with their ranges, steps and formats, the values derived from them, and its beats as
|
|
127
|
+
* plain data. Every prose value, control, figure, player and agent of the lesson reads these names. A duplicate or
|
|
128
|
+
* unknown name, a default out of range or a beat state naming an undeclared param throws an `Error` naming it.
|
|
129
|
+
*/
|
|
130
|
+
export declare function defineLesson<const Params extends LessonParams, const Derived extends string = never, const Beat extends string = string>(definition: LessonInput<Params, Derived, Beat>): LessonDefinition<Params, Derived, Beat>;
|
|
131
|
+
/**
|
|
132
|
+
* Which values each derived value reads, found by evaluating it over the defaults and every beat state. Draw it as a
|
|
133
|
+
* derivation diagram, or check that a lesson's figures read the values its prose sets.
|
|
134
|
+
*/
|
|
135
|
+
export declare function lessonGraph(lesson: AnyLesson): LessonGraph;
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { isMotionReduced, onFrame } from '../time/clock.ts';
|
|
2
|
+
export type { Pace, Tween } from '../time/tween.ts';
|
|
3
|
+
export { createTween } from '../time/tween.ts';
|
|
4
|
+
export { useTween } from '../time/use-tween.ts';
|
|
5
|
+
export { LessonLocale, useLessonLocale } from './lesson-locale.ts';
|
|
6
|
+
export type { AnyLesson, ChoiceParam, LessonBeat, LessonDefinition, LessonDerived, LessonDerivedInput, LessonGraph, LessonInput, LessonParam, LessonParams, LessonState, LessonValue, LessonValues, NumberParam, ParamValues, ToggleParam, ToggleValue, } from './define-lesson.ts';
|
|
7
|
+
export { defineLesson, lessonGraph } from './define-lesson.ts';
|
|
8
|
+
export type { LessonApi, LessonChangeOrigin, LessonPlaceChangeDetails, LessonPlaceChangeReason, LessonPlaceOrigin, LessonPlayingChangeDetails, LessonValuesChangeDetails, LessonValuesChangeReason, } from './lesson-store.ts';
|
|
9
|
+
export type { LessonPlayer, LessonPlayingChangeReason, PlayOrigin, PlaybackPace } from './lesson-player.ts';
|
|
10
|
+
export { playbackPaces } from './lesson-player.ts';
|
|
11
|
+
export type { LessonProps } from './lesson.tsx';
|
|
12
|
+
export { Lesson } from './lesson.tsx';
|
|
13
|
+
export type { LessonControls } from './use-lesson.ts';
|
|
14
|
+
export { useLesson, useLessonContext } from './use-lesson.ts';
|
|
15
|
+
export type { BoundValueChangeDetails, BoundValueProps, BoundValueScale } from './bound-value.tsx';
|
|
16
|
+
export { BoundValue } from './bound-value.tsx';
|
|
17
|
+
export type { ParamProps, ValueLabels, ValueProps } from './param.tsx';
|
|
18
|
+
export { Param, Value } from './param.tsx';
|
|
19
|
+
export type { ParamControlProps } from './param-controls.tsx';
|
|
20
|
+
export { ParamChoice, ParamSlider, ParamToggle } from './param-controls.tsx';
|
|
21
|
+
export type { PlaybackControls, PlaybackProps } from './playback.tsx';
|
|
22
|
+
export { Playback, usePlayback } from './playback.tsx';
|
|
23
|
+
export type { TransportLabels, TransportProps } from './transport.tsx';
|
|
24
|
+
export { Transport } from './transport.tsx';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ChangeDetails } from '@ui-sdk/core';
|
|
2
|
+
import type { SelectValueChangeReason } from '@ui-sdk/react/select';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import type { ChoiceParam } from './define-lesson.ts';
|
|
5
|
+
export type InlineChoiceProps = {
|
|
6
|
+
readonly param: ChoiceParam;
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly isDisabled: boolean;
|
|
9
|
+
readonly onChange: (value: string, details: ChangeDetails<SelectValueChangeReason>) => void;
|
|
10
|
+
};
|
|
11
|
+
/** One option of a choice param, picked from a short list that opens from the word in the sentence. */
|
|
12
|
+
export declare function InlineChoice({ param, value, isDisabled, onChange }: InlineChoiceProps): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AnyLesson, LessonValue } from './define-lesson.ts';
|
|
2
|
+
import type { LessonApi, LessonStoreState } from './lesson-store.ts';
|
|
3
|
+
/** What the nearest `Lesson` shares with the parts inside it. */
|
|
4
|
+
export type LessonScope = {
|
|
5
|
+
readonly lesson: AnyLesson;
|
|
6
|
+
readonly api: LessonApi;
|
|
7
|
+
readonly state: LessonStoreState;
|
|
8
|
+
/** Every value: the params and the derived values computed from them. */
|
|
9
|
+
readonly values: Readonly<Record<string, LessonValue>>;
|
|
10
|
+
readonly locale: string;
|
|
11
|
+
/** The lesson around this one, when lessons are nested. */
|
|
12
|
+
readonly outer: LessonScope | null;
|
|
13
|
+
};
|
|
14
|
+
export declare const LessonContext: import("react").Context<LessonScope | null>;
|
|
15
|
+
/** The nearest lesson. Throws a clear `Error` naming the part outside any `Lesson`. */
|
|
16
|
+
export declare function useLessonScope(part: string): LessonScope;
|
|
17
|
+
/** The nearest lesson that renders `lesson`, walking out through nested lessons. */
|
|
18
|
+
export declare function scopeOf(scope: LessonScope | null, lesson: AnyLesson): LessonScope | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Throws the error a lesson gives for a value or a name it does not take. The message names the lesson and the value at
|
|
4
|
+
* fault, so the author or the agent that made the call can fix it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function failLesson(lesson: string, message: string): never;
|
|
7
|
+
/** Throws the error a lesson part gives when it is used outside every `Lesson`. */
|
|
8
|
+
export declare function failOutside(part: string): never;
|
|
9
|
+
/** The short inline error a lesson part shows in place of itself when the author gave it a name or value it lacks. */
|
|
10
|
+
export declare function LessonError({ children }: {
|
|
11
|
+
readonly children: string;
|
|
12
|
+
}): ReactNode;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The locale of the nearest lesson, which its figures and values fall back to. */
|
|
2
|
+
export declare const LessonLocale: import("react").Context<string | null>;
|
|
3
|
+
/** The locale the nearest `Lesson` was given, or null outside a lesson. */
|
|
4
|
+
export declare function useLessonLocale(): string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AnyLesson, LessonParam, LessonValue } from './define-lesson.ts';
|
|
2
|
+
/** A full set of param values, by name. */
|
|
3
|
+
export type LessonParamValues = Readonly<Record<string, LessonValue>>;
|
|
4
|
+
/** What a caller or an agent hands `setParam`: number text and `"true"` become values, an option's label its id. */
|
|
5
|
+
export declare function coercedValue(param: LessonParam, value: unknown): unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Reads the values a reader saved under `storageKey` and the ones the address bar links to, then writes the values back
|
|
8
|
+
* once they rest. The address bar names each value `lessonId.name` and leaves out the ones at their defaults.
|
|
9
|
+
*/
|
|
10
|
+
export declare function connectPersistence({ lesson, shouldSyncUrl, storageKey, read, subscribe, restore, }: {
|
|
11
|
+
readonly lesson: AnyLesson;
|
|
12
|
+
readonly shouldSyncUrl: boolean;
|
|
13
|
+
readonly storageKey: string | undefined;
|
|
14
|
+
readonly read: () => LessonParamValues;
|
|
15
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
16
|
+
readonly restore: (values: LessonParamValues) => void;
|
|
17
|
+
}): () => void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ChangeSource } from '@ui-sdk/core';
|
|
2
|
+
import type { StepRange } from '@ui-sdk/core/number';
|
|
3
|
+
/** How fast a player moves its param, in steps per second. */
|
|
4
|
+
export declare const playbackPaces: {
|
|
5
|
+
readonly fast: 12;
|
|
6
|
+
readonly regular: 6;
|
|
7
|
+
readonly slow: 2;
|
|
8
|
+
};
|
|
9
|
+
/** A player's pace, from `playbackPaces`. */
|
|
10
|
+
export type PlaybackPace = keyof typeof playbackPaces;
|
|
11
|
+
/** A number param that a `Playback` drives: where it starts, where it ends and how fast it goes. */
|
|
12
|
+
export type LessonPlayer = {
|
|
13
|
+
readonly name: string;
|
|
14
|
+
readonly from: number;
|
|
15
|
+
readonly to: number;
|
|
16
|
+
readonly pace: PlaybackPace;
|
|
17
|
+
readonly isLooping: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** Why a player started or stopped: a press, the end of its run or a hidden tab, or a call. */
|
|
20
|
+
export type LessonPlayingChangeReason = 'press' | 'playback' | 'imperative';
|
|
21
|
+
/** What a start or stop says about itself: its reason, and the event and source when a reader caused it. */
|
|
22
|
+
export type PlayOrigin = {
|
|
23
|
+
readonly reason: LessonPlayingChangeReason;
|
|
24
|
+
readonly event?: Event | undefined;
|
|
25
|
+
readonly source?: ChangeSource | undefined;
|
|
26
|
+
};
|
|
27
|
+
/** What the players need from the store. */
|
|
28
|
+
type PlayerHost = {
|
|
29
|
+
/** The param playing now, or null. */
|
|
30
|
+
readonly playing: () => string | null;
|
|
31
|
+
/** Asks to start or stop a player. False when the application refused. */
|
|
32
|
+
readonly setPlaying: (name: string | null, origin?: PlayOrigin) => boolean;
|
|
33
|
+
readonly publish: (players: Readonly<Record<string, LessonPlayer>>) => void;
|
|
34
|
+
readonly value: (name: string) => number;
|
|
35
|
+
/** The step grid of a number param: its min and step, with the player's end as the max. */
|
|
36
|
+
readonly grid: (player: LessonPlayer) => StepRange;
|
|
37
|
+
readonly move: (name: string, value: number) => void;
|
|
38
|
+
readonly refuse: (message: string) => never;
|
|
39
|
+
};
|
|
40
|
+
/** The players of one lesson, which move their params on the shared clock. */
|
|
41
|
+
export type LessonPlayers = {
|
|
42
|
+
readonly register: (player: LessonPlayer) => () => void;
|
|
43
|
+
readonly play: (name?: string, origin?: PlayOrigin) => void;
|
|
44
|
+
readonly pause: (origin?: PlayOrigin) => void;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Makes a lesson's players. A player advances its param one step at a time at its pace, stops at its end or starts over
|
|
48
|
+
* from `from`, and stops when the tab is hidden. With reduced motion, play shows the end at once.
|
|
49
|
+
*/
|
|
50
|
+
export declare function createPlayers(host: PlayerHost): LessonPlayers;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ChangeDetails, ChangeSource, PrimitiveContext } from '@ui-sdk/core';
|
|
2
|
+
import type { AnyLesson } from './define-lesson.ts';
|
|
3
|
+
import type { LessonParamValues } from './lesson-persistence.ts';
|
|
4
|
+
import type { LessonPlayer, LessonPlayingChangeReason, PlayOrigin } from './lesson-player.ts';
|
|
5
|
+
/** Why the values changed: a control or a key the reader used, a player, a reset, a value read back, or a call. */
|
|
6
|
+
export type LessonValuesChangeReason = 'drag' | 'step-key' | 'track-press' | 'accessibility-adjust' | 'item-press' | 'list-navigation' | 'clear-press' | 'press' | 'playback' | 'scroll' | 'shortcut' | 'reset' | 'restore' | 'imperative';
|
|
7
|
+
/** Why the beat or the reveal step changed: a key in a presentation, scrolling, a press, or a call. */
|
|
8
|
+
export type LessonPlaceChangeReason = 'shortcut' | 'scroll' | 'link-press' | 'press' | 'restore' | 'imperative';
|
|
9
|
+
/** What a player starting or stopping reports: its reason, its event and its source, and `cancel()` to refuse it. */
|
|
10
|
+
export type LessonPlayingChangeDetails = ChangeDetails<LessonPlayingChangeReason>;
|
|
11
|
+
/** What a values change reports: its reason, its event and its source, and `cancel()` to refuse it. */
|
|
12
|
+
export type LessonValuesChangeDetails = ChangeDetails<LessonValuesChangeReason>;
|
|
13
|
+
/** What a beat or step change reports: its reason, its event and its source, and `cancel()` to refuse it. */
|
|
14
|
+
export type LessonPlaceChangeDetails = ChangeDetails<LessonPlaceChangeReason>;
|
|
15
|
+
/** What a change says about itself. Controls pass their own details through. */
|
|
16
|
+
export type LessonChangeOrigin<Reason extends string = LessonValuesChangeReason> = {
|
|
17
|
+
readonly reason: Reason;
|
|
18
|
+
readonly event?: Event | undefined;
|
|
19
|
+
readonly source?: ChangeSource | undefined;
|
|
20
|
+
};
|
|
21
|
+
export type LessonPlaceOrigin = LessonChangeOrigin<LessonPlaceChangeReason>;
|
|
22
|
+
export type LessonStoreOptions = {
|
|
23
|
+
readonly lesson: AnyLesson;
|
|
24
|
+
readonly values?: LessonParamValues | undefined;
|
|
25
|
+
readonly defaultValues?: LessonParamValues | undefined;
|
|
26
|
+
readonly onValuesChange?: ((values: LessonParamValues, details: LessonValuesChangeDetails) => void) | undefined;
|
|
27
|
+
readonly beat?: string | null | undefined;
|
|
28
|
+
readonly defaultBeat?: string | null | undefined;
|
|
29
|
+
readonly onBeatChange?: ((beat: string | null, details: LessonPlaceChangeDetails) => void) | undefined;
|
|
30
|
+
readonly step?: number | undefined;
|
|
31
|
+
readonly defaultStep?: number | undefined;
|
|
32
|
+
readonly onStepChange?: ((step: number, details: LessonPlaceChangeDetails) => void) | undefined;
|
|
33
|
+
readonly onPlayingChange?: ((playing: string | null, details: LessonPlayingChangeDetails) => void) | undefined;
|
|
34
|
+
/** Who started the player that is running, so its steps are attributed to the same source. */
|
|
35
|
+
readonly playSource?: (() => ChangeSource) | undefined;
|
|
36
|
+
/** Steps the markup adds to a beat after its declared reveal steps, such as a scrolly's steps in a presentation. */
|
|
37
|
+
readonly addedSteps?: Readonly<Record<string, number>> | undefined;
|
|
38
|
+
readonly isReadOnly?: boolean | undefined;
|
|
39
|
+
readonly shouldSyncUrl?: boolean | undefined;
|
|
40
|
+
readonly storageKey?: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
/** The lesson as the store holds it. Agents read `values`, `beat` and `step`. */
|
|
43
|
+
export type LessonStoreState = {
|
|
44
|
+
readonly values: LessonParamValues;
|
|
45
|
+
readonly beat: string | null;
|
|
46
|
+
readonly step: number;
|
|
47
|
+
/** The param a player is moving now, or null. */
|
|
48
|
+
readonly playing: string | null;
|
|
49
|
+
readonly players: Readonly<Record<string, LessonPlayer>>;
|
|
50
|
+
readonly isReadOnly: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** What the lesson store does: every change a part, a player or an agent asks of the lesson goes through it. */
|
|
53
|
+
export type LessonApi = {
|
|
54
|
+
/** Sets one param to a value of its kind, with the change's origin. Throws when the value is out of range. */
|
|
55
|
+
readonly apply: (name: string, value: unknown, origin: LessonChangeOrigin) => boolean;
|
|
56
|
+
/** Sets one param: a number in its range, an option's id or label, or true or false. */
|
|
57
|
+
readonly setParam: (name: string, value: unknown) => boolean;
|
|
58
|
+
/** Sets several params in one change, so readers of the change see one move and not one per param. */
|
|
59
|
+
readonly setParams: (values: Readonly<Record<string, unknown>>, origin?: LessonChangeOrigin) => boolean;
|
|
60
|
+
/** Shows a state a beat declares: its values are set in one change. Looks in the current beat first. */
|
|
61
|
+
readonly showState: (state: string, origin?: LessonChangeOrigin) => boolean;
|
|
62
|
+
/** Puts every param back to the value the lesson opened with. */
|
|
63
|
+
readonly reset: (origin?: LessonChangeOrigin) => boolean;
|
|
64
|
+
/** Moves to a beat, at its first reveal step unless `step` says otherwise. */
|
|
65
|
+
readonly setBeat: (beat: string, step?: number, origin?: LessonPlaceOrigin) => boolean;
|
|
66
|
+
/** Shows the next reveal step, or the next beat at its first step. */
|
|
67
|
+
readonly next: (origin?: LessonPlaceOrigin) => boolean;
|
|
68
|
+
/** Hides the last reveal step, or goes back to the previous beat with every step shown. */
|
|
69
|
+
readonly previous: (origin?: LessonPlaceOrigin) => boolean;
|
|
70
|
+
/** Starts the player of a number param, or the only player when there is one. */
|
|
71
|
+
readonly play: (name?: string, origin?: PlayOrigin) => void;
|
|
72
|
+
/** Stops the player that is running. */
|
|
73
|
+
readonly pause: (origin?: PlayOrigin) => void;
|
|
74
|
+
/** Adds a player for a number param. Returns the function that removes it. */
|
|
75
|
+
readonly register: (player: LessonPlayer) => () => void;
|
|
76
|
+
/** Reads saved and linked values once the lesson is on the page, then keeps them current. */
|
|
77
|
+
readonly connect: () => () => void;
|
|
78
|
+
};
|
|
79
|
+
/** The store's opening state, from the lesson and the values, beat and step it is given. */
|
|
80
|
+
export declare function lessonState(options: LessonStoreOptions): LessonStoreState;
|
|
81
|
+
/** The keys the store takes from the options on every render. */
|
|
82
|
+
export declare function lessonSync(options: LessonStoreOptions): Partial<LessonStoreState>;
|
|
83
|
+
/** The store's api, built once per lesson from the primitive's context. */
|
|
84
|
+
export declare function lessonApi(context: PrimitiveContext<LessonStoreOptions, LessonStoreState, 'root'>): LessonApi;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LessonDefinition, LessonParams, ParamValues } from './define-lesson.ts';
|
|
3
|
+
import type { LessonPlaceChangeDetails, LessonPlayingChangeDetails, LessonValuesChangeDetails } from './lesson-store.ts';
|
|
4
|
+
export type LessonProps<Params extends LessonParams, Derived extends string, Beat extends string> = {
|
|
5
|
+
readonly lesson: LessonDefinition<Params, Derived, Beat>;
|
|
6
|
+
/** The locale every value, figure and control of the lesson is written in. */
|
|
7
|
+
readonly locale: string;
|
|
8
|
+
/** The param values the application holds. Names left out keep their defaults. */
|
|
9
|
+
readonly values?: Partial<ParamValues<Params>> | undefined;
|
|
10
|
+
/** The values the lesson opens with, over its declared defaults. `reset` returns to them. */
|
|
11
|
+
readonly defaultValues?: Partial<ParamValues<Params>> | undefined;
|
|
12
|
+
/** Hears every requested change with its reason and source. `details.cancel()` refuses it. */
|
|
13
|
+
readonly onValuesChange?: ((values: ParamValues<Params>, details: LessonValuesChangeDetails) => void) | undefined;
|
|
14
|
+
/** The current beat id, held by the application. */
|
|
15
|
+
readonly beat?: Beat | null | undefined;
|
|
16
|
+
readonly defaultBeat?: Beat | null | undefined;
|
|
17
|
+
readonly onBeatChange?: ((beat: Beat | null, details: LessonPlaceChangeDetails) => void) | undefined;
|
|
18
|
+
/** The reveal step inside the beat, from 0. */
|
|
19
|
+
readonly step?: number | undefined;
|
|
20
|
+
readonly defaultStep?: number | undefined;
|
|
21
|
+
readonly onStepChange?: ((step: number, details: LessonPlaceChangeDetails) => void) | undefined;
|
|
22
|
+
/** Hears a player start (the param's name) or stop (null), with who asked. `details.cancel()` refuses it. */
|
|
23
|
+
readonly onPlayingChange?: ((playing: string | null, details: LessonPlayingChangeDetails) => void) | undefined;
|
|
24
|
+
/** Reads values from the query string once the lesson is on the page, and writes them back as they change. */
|
|
25
|
+
readonly shouldSyncUrl?: boolean | undefined;
|
|
26
|
+
/** Keeps the values in local storage under this key, so they last across visits. */
|
|
27
|
+
readonly storageKey?: string | undefined;
|
|
28
|
+
/** A frozen copy, such as a beat sheet's cell: controls are disabled, and no change, agent action or player runs. */
|
|
29
|
+
readonly isReadOnly?: boolean | undefined;
|
|
30
|
+
/** Steps the markup adds to a beat after its declared reveal steps, by beat id, such as a scrolly's steps. */
|
|
31
|
+
readonly addedSteps?: Readonly<Record<string, number>> | undefined;
|
|
32
|
+
readonly children?: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Holds one lesson's state for everything inside it: prose values, controls, figures, players and agents read and set
|
|
36
|
+
* the same named values. Pass `values` and `onValuesChange` to hold them in the application, or `defaultValues` to let
|
|
37
|
+
* the lesson hold them; beats and reveal steps work the same way. Nested lessons are independent of each other.
|
|
38
|
+
*/
|
|
39
|
+
export declare function Lesson<Params extends LessonParams, Derived extends string, Beat extends string>({ lesson, locale, values, defaultValues, onValuesChange, beat, defaultBeat, onBeatChange, step, defaultStep, onStepChange, onPlayingChange, shouldSyncUrl, storageKey, isReadOnly, addedSteps, children, }: LessonProps<Params, Derived, Beat>): ReactNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ParamControlProps = {
|
|
3
|
+
/** The param's name in the lesson. */
|
|
4
|
+
readonly name: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A labelled slider for a number param, for a figure's footer or a control panel. A log param slides evenly through
|
|
8
|
+
* each tenfold. It reads and sets the same value as every `Param` and figure of the lesson.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ParamSlider({ name }: ParamControlProps): ReactNode;
|
|
11
|
+
/** A labelled segmented control for a choice param with a few options. */
|
|
12
|
+
export declare function ParamChoice({ name }: ParamControlProps): ReactNode;
|
|
13
|
+
/** A labelled switch for a toggle param. */
|
|
14
|
+
export declare function ParamToggle({ name }: ParamControlProps): ReactNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { LessonParam } from './define-lesson.ts';
|
|
3
|
+
import type { LessonScope } from './lesson-context.ts';
|
|
4
|
+
/** The words a toggle's value reads as in prose. */
|
|
5
|
+
export type ValueLabels = {
|
|
6
|
+
readonly on: string;
|
|
7
|
+
readonly off: string;
|
|
8
|
+
};
|
|
9
|
+
export type ParamProps = {
|
|
10
|
+
/** The param's name in the lesson. */
|
|
11
|
+
readonly name: string;
|
|
12
|
+
};
|
|
13
|
+
export type ValueProps = {
|
|
14
|
+
/** A param's or a derived value's name in the lesson. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly labels?: Partial<ValueLabels> | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** The param named `name`, or the inline error a part shows when the lesson declares none. */
|
|
19
|
+
export declare function lessonParam(scope: LessonScope, name: string): {
|
|
20
|
+
readonly param: LessonParam;
|
|
21
|
+
} | {
|
|
22
|
+
readonly error: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A param inside a sentence that the reader changes in place: a number to drag or step, an option picked from a short
|
|
26
|
+
* list, or a switch. Every other part of the lesson that reads the name follows. A name the lesson lacks shows an
|
|
27
|
+
* inline error; a read-only lesson shows the value as text.
|
|
28
|
+
*/
|
|
29
|
+
export declare function Param({ name }: ParamProps): ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* A param or derived value written in its declared format, inside a sentence. It updates on every change; assistive
|
|
32
|
+
* technology hears it politely once it rests, so a drag or a player does not flood a screen reader.
|
|
33
|
+
*/
|
|
34
|
+
export declare function Value({ name, labels }: ValueProps): ReactNode;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { NumberParam } from './define-lesson.ts';
|
|
3
|
+
import type { LessonScope } from './lesson-context.ts';
|
|
4
|
+
import type { PlaybackPace, PlayOrigin } from './lesson-player.ts';
|
|
5
|
+
import type { LessonChangeOrigin } from './lesson-store.ts';
|
|
6
|
+
export type PlaybackProps = {
|
|
7
|
+
/** The number param the player moves. */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** Where play starts and starts over. Defaults to the param's min. */
|
|
10
|
+
readonly from?: number | undefined;
|
|
11
|
+
/** Where play ends. Defaults to the param's max. */
|
|
12
|
+
readonly to?: number | undefined;
|
|
13
|
+
/** How many steps a second: `fast`, `regular` or `slow`. */
|
|
14
|
+
readonly pace?: PlaybackPace | undefined;
|
|
15
|
+
/** Starts over from `from` at the end instead of stopping there. */
|
|
16
|
+
readonly isLooping?: boolean | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** What `usePlayback` returns: whether the player runs, and the calls that run, stop and move it. */
|
|
19
|
+
export type PlaybackControls = {
|
|
20
|
+
readonly isPlaying: boolean;
|
|
21
|
+
/** Starts playing. At the end it starts over from `from`; with reduced motion it shows the end at once. */
|
|
22
|
+
readonly play: (origin?: PlayOrigin) => void;
|
|
23
|
+
readonly pause: (origin?: PlayOrigin) => void;
|
|
24
|
+
readonly toggle: (origin?: PlayOrigin) => void;
|
|
25
|
+
/** Moves the param by whole steps, within the player's range, and pauses. */
|
|
26
|
+
readonly stepBy: (steps: number, origin?: LessonChangeOrigin) => void;
|
|
27
|
+
/** Moves the param to a value within the player's range, and pauses. */
|
|
28
|
+
readonly seek: (value: number, origin?: LessonChangeOrigin) => void;
|
|
29
|
+
};
|
|
30
|
+
/** The range a player moves its param through: its `from` and `to`, or the param's bounds before it registers. */
|
|
31
|
+
export declare function playerRange(scope: LessonScope, name: string, param: NumberParam): {
|
|
32
|
+
readonly from: number;
|
|
33
|
+
readonly to: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Drives a number param over time, one step at a time on the lesson's shared clock: a training step, a token index, a
|
|
37
|
+
* temperature sweep. It renders nothing; a `Transport` or `usePlayback` plays it. It pauses when the tab is hidden or
|
|
38
|
+
* the reader changes the value, and with reduced motion play shows the end at once.
|
|
39
|
+
*/
|
|
40
|
+
export declare function Playback({ name, from, to, pace, isLooping }: PlaybackProps): ReactNode;
|
|
41
|
+
/** Plays, pauses and moves the player of a number param in the nearest lesson. */
|
|
42
|
+
export declare function usePlayback(name: string): PlaybackControls;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** The accessible names of the transport's buttons. `{label}` in a name is replaced by the param's label. */
|
|
3
|
+
export type TransportLabels = {
|
|
4
|
+
readonly play: string;
|
|
5
|
+
readonly pause: string;
|
|
6
|
+
readonly stepBack: string;
|
|
7
|
+
readonly stepForward: string;
|
|
8
|
+
readonly scrub: string;
|
|
9
|
+
};
|
|
10
|
+
export type TransportProps = {
|
|
11
|
+
/** The number param whose `Playback` this transport plays. */
|
|
12
|
+
readonly for: string;
|
|
13
|
+
readonly labels?: Partial<TransportLabels> | undefined;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Play or pause, step back, step forward, a scrub slider and the value, in one row that wraps on a narrow screen. It
|
|
17
|
+
* plays the `Playback` of the same param, and every button and the slider work from the keyboard.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Transport({ for: name, labels }: TransportProps): ReactNode;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { LessonDefinition, LessonParams, LessonValues, ParamValues } from './define-lesson.ts';
|
|
2
|
+
import type { LessonChangeOrigin, LessonPlaceChangeReason } from './lesson-store.ts';
|
|
3
|
+
/** What `useLesson` returns: the lesson's values and the calls that change them, typed by its definition. */
|
|
4
|
+
export type LessonControls<Params extends LessonParams, Derived extends string, Beat extends string> = {
|
|
5
|
+
/** Every param and derived value, as they are now. */
|
|
6
|
+
readonly values: LessonValues<Params, Derived>;
|
|
7
|
+
/**
|
|
8
|
+
* Sets a param. A value outside its range or options throws an `Error` naming the param and its bounds. Every call
|
|
9
|
+
* here takes an optional origin: the reason, event and source its change reports.
|
|
10
|
+
*/
|
|
11
|
+
readonly set: <Name extends keyof Params & string>(name: Name, value: ParamValues<Params>[Name], origin?: LessonChangeOrigin) => boolean;
|
|
12
|
+
/** Sets several params in one change. */
|
|
13
|
+
readonly setMany: (values: Partial<ParamValues<Params>>, origin?: LessonChangeOrigin) => boolean;
|
|
14
|
+
/** Shows a state a beat declares, by its id, in one change. Params it does not name take their opening values. */
|
|
15
|
+
readonly show: (state: string, origin?: LessonChangeOrigin) => boolean;
|
|
16
|
+
/** Puts every param back to its opening value. */
|
|
17
|
+
readonly reset: () => boolean;
|
|
18
|
+
readonly beat: Beat | null;
|
|
19
|
+
/** The reveal step inside the beat, from 0. */
|
|
20
|
+
readonly step: number;
|
|
21
|
+
/** Moves to a beat, at reveal step `step` or its first. */
|
|
22
|
+
readonly goTo: (beat: Beat, step?: number, origin?: LessonChangeOrigin<LessonPlaceChangeReason>) => boolean;
|
|
23
|
+
/** Shows the next reveal step, or the next beat. */
|
|
24
|
+
readonly next: (origin?: LessonChangeOrigin<LessonPlaceChangeReason>) => boolean;
|
|
25
|
+
/** Hides the last reveal step, or goes back a beat. */
|
|
26
|
+
readonly previous: (origin?: LessonChangeOrigin<LessonPlaceChangeReason>) => boolean;
|
|
27
|
+
readonly locale: string;
|
|
28
|
+
readonly lesson: LessonDefinition<Params, Derived, Beat>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The values of `lesson` and the calls that change them, from the nearest `Lesson` that renders it. Types come from the
|
|
32
|
+
* definition, so `values.bet` is a number and `set('bet', 'high')` does not compile. Throws outside that lesson.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useLesson<Params extends LessonParams, Derived extends string, Beat extends string>(lesson: LessonDefinition<Params, Derived, Beat>): LessonControls<Params, Derived, Beat>;
|
|
35
|
+
/** The nearest lesson's values and calls, untyped, for parts that work in any lesson. Throws outside a lesson. */
|
|
36
|
+
export declare function useLessonContext(): LessonControls<LessonParams, string, string>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ElementType } from 'react';
|
|
2
|
+
import { Aside, Beat, Challenge, Cite, DiagramPart, Figure, FigureReference, Footnote, Predict, References, Reveal, Scrolly, ScrollyStep, Term, TeX } from '../article/index.ts';
|
|
3
|
+
import { Param, ParamChoice, ParamSlider, ParamToggle, Playback, Transport, Value } from '../lesson/index.ts';
|
|
4
|
+
import { LessonFlow, MorphScope, Scene, SceneAxes, SceneBracket, SceneCallout, SceneCard, SceneCells, SceneCurve, SceneCustom, SceneFlow, SceneGroup, SceneHighlight, SceneNode, ScenePoint, SceneProjection, SceneRegion, SceneRule, SceneSlot, SceneStack, SceneToken, SceneTokens, SceneVector, SceneWire } from '../scene/index.ts';
|
|
5
|
+
import { EssayCell, EssayCode, EssayEmphasis, EssayHeadCell, EssayImage, EssayItem, EssayLink, EssayList, EssayOrderedList, EssayParagraph, EssayPre, EssayQuote, EssayRule, EssaySection, EssayStrong, EssaySubsection, EssayTable } from './essay-markdown.tsx';
|
|
6
|
+
/** Any component an essay file may name: the map an MDX provider or a compiled MDX component's `components` takes. */
|
|
7
|
+
export type EssayComponents = Readonly<Record<string, ElementType>>;
|
|
8
|
+
/**
|
|
9
|
+
* The components an MDX essay uses without importing them. Markdown elements map to Elements typography that matches
|
|
10
|
+
* the article's prose, and every teaching part is available under its own name, such as `Beat`, `Param` or `Scene`.
|
|
11
|
+
* Math written with remark-math reaches `TeX` when the application adds `remark-math` to its MDX plugins.
|
|
12
|
+
*/
|
|
13
|
+
export declare const essayComponents: {
|
|
14
|
+
readonly h1: typeof EssaySection;
|
|
15
|
+
readonly h2: typeof EssaySection;
|
|
16
|
+
readonly h3: typeof EssaySubsection;
|
|
17
|
+
readonly h4: typeof EssaySubsection;
|
|
18
|
+
readonly p: typeof EssayParagraph;
|
|
19
|
+
readonly a: typeof EssayLink;
|
|
20
|
+
readonly ul: typeof EssayList;
|
|
21
|
+
readonly ol: typeof EssayOrderedList;
|
|
22
|
+
readonly li: typeof EssayItem;
|
|
23
|
+
readonly blockquote: typeof EssayQuote;
|
|
24
|
+
readonly code: typeof EssayCode;
|
|
25
|
+
readonly pre: typeof EssayPre;
|
|
26
|
+
readonly table: typeof EssayTable;
|
|
27
|
+
readonly th: typeof EssayHeadCell;
|
|
28
|
+
readonly td: typeof EssayCell;
|
|
29
|
+
readonly hr: typeof EssayRule;
|
|
30
|
+
readonly img: typeof EssayImage;
|
|
31
|
+
readonly em: typeof EssayEmphasis;
|
|
32
|
+
readonly strong: typeof EssayStrong;
|
|
33
|
+
readonly Beat: typeof Beat;
|
|
34
|
+
readonly Figure: typeof Figure;
|
|
35
|
+
readonly FigureReference: typeof FigureReference;
|
|
36
|
+
readonly Reveal: typeof Reveal;
|
|
37
|
+
readonly Aside: typeof Aside;
|
|
38
|
+
readonly Footnote: typeof Footnote;
|
|
39
|
+
readonly Cite: typeof Cite;
|
|
40
|
+
readonly TeX: typeof TeX;
|
|
41
|
+
readonly Term: typeof Term;
|
|
42
|
+
readonly DiagramPart: typeof DiagramPart;
|
|
43
|
+
readonly Scrolly: typeof Scrolly;
|
|
44
|
+
readonly ScrollyStep: typeof ScrollyStep;
|
|
45
|
+
readonly Predict: typeof Predict;
|
|
46
|
+
readonly Challenge: typeof Challenge;
|
|
47
|
+
readonly References: typeof References;
|
|
48
|
+
readonly Param: typeof Param;
|
|
49
|
+
readonly Value: typeof Value;
|
|
50
|
+
readonly ParamSlider: typeof ParamSlider;
|
|
51
|
+
readonly ParamChoice: typeof ParamChoice;
|
|
52
|
+
readonly ParamToggle: typeof ParamToggle;
|
|
53
|
+
readonly Playback: typeof Playback;
|
|
54
|
+
readonly Transport: typeof Transport;
|
|
55
|
+
readonly Scene: typeof Scene;
|
|
56
|
+
readonly SceneNode: typeof SceneNode;
|
|
57
|
+
readonly SceneWire: typeof SceneWire;
|
|
58
|
+
readonly SceneGroup: typeof SceneGroup;
|
|
59
|
+
readonly SceneBracket: typeof SceneBracket;
|
|
60
|
+
readonly SceneCallout: typeof SceneCallout;
|
|
61
|
+
readonly SceneHighlight: typeof SceneHighlight;
|
|
62
|
+
readonly SceneCustom: typeof SceneCustom;
|
|
63
|
+
readonly SceneAxes: typeof SceneAxes;
|
|
64
|
+
readonly SceneCurve: typeof SceneCurve;
|
|
65
|
+
readonly ScenePoint: typeof ScenePoint;
|
|
66
|
+
readonly SceneVector: typeof SceneVector;
|
|
67
|
+
readonly SceneRegion: typeof SceneRegion;
|
|
68
|
+
readonly SceneRule: typeof SceneRule;
|
|
69
|
+
readonly SceneProjection: typeof SceneProjection;
|
|
70
|
+
readonly SceneCard: typeof SceneCard;
|
|
71
|
+
readonly SceneStack: typeof SceneStack;
|
|
72
|
+
readonly SceneSlot: typeof SceneSlot;
|
|
73
|
+
readonly SceneCells: typeof SceneCells;
|
|
74
|
+
readonly SceneToken: typeof SceneToken;
|
|
75
|
+
readonly SceneTokens: typeof SceneTokens;
|
|
76
|
+
readonly SceneFlow: typeof SceneFlow;
|
|
77
|
+
readonly LessonFlow: typeof LessonFlow;
|
|
78
|
+
readonly MorphScope: typeof MorphScope;
|
|
79
|
+
};
|