@mechane-ai/elements 0.49.0 → 0.49.1
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 +40 -2
- package/dist/{article-yyNPg6VU.js → article-CRlhq9oA.js} +531 -463
- package/dist/article.js +1 -1
- package/dist/catalog.json +29 -1
- package/dist/{categorical-values-DCznViFp.js → categorical-values-BYP_R5gS.js} +13 -13
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +4 -4
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +7 -7
- package/dist/{dumbbell-plot-CMv9llfd.js → dumbbell-plot-B-Tn7ewW.js} +45 -45
- package/dist/{embedding-map-DC-lgzCq.js → embedding-map-Bljn-A5q.js} +528 -528
- package/dist/figure-frame-CEijciL7.js +289 -0
- package/dist/{image-grid-DHqtj_zs.js → image-grid-mrG5u9oE.js} +47 -47
- package/dist/kits/evaluation.js +3 -3
- package/dist/kits/interpretability.js +6 -6
- package/dist/kits/operations.js +3 -3
- package/dist/kits/research.js +2 -2
- package/dist/kits/training.js +2 -2
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +4 -4
- package/dist/packages/charts/src/figure/caption-scope.d.ts +12 -0
- package/dist/packages/charts/src/figure/figure-frame.d.ts +2 -1
- package/dist/packages/charts/src/index.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-context.d.ts +2 -0
- package/dist/packages/teaching/src/article/article-layout.stylex.d.ts +13 -0
- package/dist/packages/teaching/src/article/article.d.ts +6 -1
- package/dist/packages/teaching/src/article/figure.d.ts +20 -3
- package/dist/packages/teaching/src/article/index.d.ts +1 -1
- package/dist/packages/teaching/src/article/view-essay.d.ts +2 -1
- package/dist/packages/teaching/src/lesson/define-lesson.d.ts +4 -0
- package/dist/packages/teaching/src/lesson/index.d.ts +2 -2
- package/dist/packages/teaching/src/lesson/lesson-player.d.ts +19 -3
- package/dist/packages/teaching/src/lesson/lesson-store.d.ts +2 -0
- package/dist/packages/teaching/src/lesson/playback.d.ts +9 -6
- package/dist/packages/teaching/src/lesson/use-lesson.d.ts +7 -2
- package/dist/packages/teaching/src/scene/plane/plane-labels.d.ts +4 -1
- package/dist/packages/teaching/src/scene/plane/scene-point.d.ts +5 -6
- package/dist/packages/teaching/src/scene/scene-geometry.d.ts +1 -1
- package/dist/packages/teaching/src/scene/scene-node.d.ts +4 -1
- package/dist/packages/teaching/src/scene/scene-validate.d.ts +6 -0
- package/dist/packages/teaching/src/scene/scene-wire.d.ts +6 -1
- package/dist/packages/teaching/src/scene/scene.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/cell-grid.d.ts +5 -1
- package/dist/packages/teaching/src/scene/shapes/scene-cells.d.ts +1 -1
- package/dist/packages/teaching/src/scene/shapes/scene-slot.d.ts +1 -1
- package/dist/packages/teaching/src/time/tween.d.ts +2 -0
- package/dist/{param-BE3VMSkH.js → param-BdqTpZER.js} +166 -99
- package/dist/{plot-layout-Bqe4-0qZ.js → plot-layout-B2xRt-_k.js} +144 -130
- package/dist/{plot-surface-DON6WUmk.js → plot-surface-0cKFwtws.js} +1 -1
- package/dist/{reference-lines-hjuD1rRZ.js → reference-lines-nSxcZVF5.js} +1 -1
- package/dist/{scene-BP0Ue0R5.js → scene-BwJKueD6.js} +1227 -1125
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-C8eeSgL4.js → slope-chart-CGTYbFxi.js} +179 -179
- package/dist/styles2.css +69 -14
- package/dist/{time-series-BL933QyA.js → time-series-Dh8y5ba0.js} +952 -948
- package/dist/{token-heatmap-BB65awva.js → token-heatmap-BTrZ3-N4.js} +84 -84
- package/dist/{token-predictions-Pa8eUGan.js → token-predictions-CUe4junQ.js} +126 -126
- package/dist/{transport-DzyxVXbL.js → transport-4V9rfYHN.js} +278 -233
- package/dist/{tree-diagram-DJhKBiia.js → tree-diagram-Dpqmo-fh.js} +115 -115
- package/dist/{treemap-CxxgABUg.js → treemap-BUSaVD3m.js} +27 -27
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-CoAEF_7Z.js → violin-plot-BxaLwdRi.js} +123 -123
- package/dist/{waterfall-DdoEXEkT.js → waterfall-CcDMdKec.js} +39 -39
- package/package.json +1 -1
- package/recipes/counting-cards.tsx +3 -3
- package/skills/review-explainer/SKILL.md +2 -1
- package/skills/upgrade-elements/references/releases.md +61 -0
- package/skills/use-elements/SKILL.md +3 -1
- package/skills/use-elements/references/styling.md +23 -0
- package/skills/use-elements/references/teaching.md +13 -0
- package/skills/write-explainer/references/article.md +50 -2
- package/skills/write-explainer/references/lesson.md +18 -9
- package/skills/write-explainer/references/scene-parts.md +17 -12
- package/skills/write-explainer/references/scene.md +25 -3
- package/dist/figure-frame-BjFzbl3m.js +0 -270
- package/dist/use-tween-5HZ55_9d.js +0 -72
package/dist/lesson/spec.js
CHANGED
|
@@ -71,8 +71,8 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
71
71
|
ParamSlider: {
|
|
72
72
|
entry: y,
|
|
73
73
|
question: "How does the figure change as I sweep this value?",
|
|
74
|
-
guidance: "Use it
|
|
75
|
-
example: "<Figure id=\"bars\" caption=\"Probabilities after the softmax.\" description=\"Four bars, one per token, that sum to one.\" reads={['temperature']}
|
|
74
|
+
guidance: "Use it in a figure's header or footer for a number param the reader sweeps through its range. Inside a sentence, use Param; for a time-like param the lesson plays, use Transport.",
|
|
75
|
+
example: "<Figure id=\"bars\" caption=\"Probabilities after the softmax.\" description=\"Four bars, one per token, that sum to one.\" reads={['temperature']} footer={<ParamSlider name=\"temperature\" />}>\n <TokenBars />\n</Figure>"
|
|
76
76
|
},
|
|
77
77
|
ParamChoice: {
|
|
78
78
|
entry: y,
|
|
@@ -89,14 +89,14 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
89
89
|
Playback: {
|
|
90
90
|
entry: y,
|
|
91
91
|
question: "How does this unfold over time?",
|
|
92
|
-
guidance: "Use it to drive a number param step by step, such as training steps or tokens generated. It renders nothing: pair it with a Transport so the reader can pause and scrub.",
|
|
92
|
+
guidance: "Use it to drive a number param step by step, such as training steps or tokens generated, or as one timed run with pace={{ run: 'long' }}, eased for a blend. It renders nothing: pair it with a Transport so the reader can pause and scrub.",
|
|
93
93
|
example: "<Playback name=\"trainStep\" pace=\"regular\" />\n<Transport for=\"trainStep\" />"
|
|
94
94
|
},
|
|
95
95
|
Transport: {
|
|
96
96
|
entry: y,
|
|
97
97
|
question: "Can I pause it, step through it, or go back?",
|
|
98
|
-
guidance: "Use it beside every Playback. It plays, pauses, steps and scrubs the same param. Use ParamSlider when the value has no natural order in time.",
|
|
99
|
-
example: "<Transport for=\"trainStep\" />"
|
|
98
|
+
guidance: "Use it beside every Playback, in the header of the figure it drives. It plays, pauses, steps and scrubs the same param. Use ParamSlider when the value has no natural order in time.",
|
|
99
|
+
example: "<Figure id=\"run\" caption=\"The loss as training runs.\" description=\"A falling loss curve.\" reads={['trainStep']} header={<Transport for=\"trainStep\" />}>\n <LossCurve />\n</Figure>"
|
|
100
100
|
},
|
|
101
101
|
Scene: {
|
|
102
102
|
entry: b,
|
|
@@ -113,7 +113,7 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
113
113
|
SceneWire: {
|
|
114
114
|
entry: b,
|
|
115
115
|
question: "What feeds into what, and how strongly?",
|
|
116
|
-
guidance: "Use it between two nodes; weight sets its thickness and it stays attached while they move. Its text sits beside the stroke, above a level wire and right of an upright one; set textSide when that side collides. Use SceneFlow for a whole derivation graph.",
|
|
116
|
+
guidance: "Use it between two nodes; weight sets its thickness and it stays attached while they move. Its text sits beside the stroke, above a level wire and right of an upright one; set textSide when that side collides. A wire runs straight through what lies between its ends; give it a bend in pixels to bow it around a node. Use SceneFlow for a whole derivation graph.",
|
|
117
117
|
example: "<SceneWire from=\"queen\" to=\"sum\" label=\"Weight 0.8\" weight={0.8} text=\"0.8\" textSide=\"bottom\" hasArrow />"
|
|
118
118
|
},
|
|
119
119
|
SceneGroup: {
|
|
@@ -161,7 +161,7 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
161
161
|
ScenePoint: {
|
|
162
162
|
entry: b,
|
|
163
163
|
question: "Where is this one value on the plane, and what if I move it?",
|
|
164
|
-
guidance: "Use it for a single marked point. With sets
|
|
164
|
+
guidance: "Use it for a single marked point. With sets it is a slider: the reader drags it, or reaches it with Tab and moves it with the arrow keys, Home and End, and it writes lesson params on their step grid; at reads them back, and along keeps it on a curve. Use ScatterPlot for many records.",
|
|
165
165
|
example: "<ScenePoint id=\"probe\" at={[values.temperature, values.entropy]} along={entropyOf} sets={{ x: 'temperature' }} label={`Temperature ${values.temperature.toFixed(2)}`} />"
|
|
166
166
|
},
|
|
167
167
|
SceneVector: {
|
|
@@ -191,8 +191,8 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
191
191
|
SceneCard: {
|
|
192
192
|
entry: b,
|
|
193
193
|
question: "What is on the other side of this, and which comes first?",
|
|
194
|
-
guidance: "Use it for an object that turns over, lifts or deals out, like a playing card or a hidden answer. Use SceneNode for a flat label, and SceneStack to lay several out.",
|
|
195
|
-
example: "<SceneCard id=\"
|
|
194
|
+
guidance: "Use it for an object that turns over, lifts or deals out, like a playing card or a hidden answer. A face-down card shows and says nothing of its face, so leave out label and keep its id free of the card. To turn it when pressed, give the Scene selected={null} and onSelectedChange. Use SceneNode for a flat label, and SceneStack to lay several out.",
|
|
195
|
+
example: "<Scene title=\"The first card\" x={[0, 2]} y={[0, 1]} selected={null} onSelectedChange={() => set('isRevealed', !isRevealed)}>\n <SceneCard id=\"first\" at={[1, 0.5]} rank=\"Q\" suit=\"heart\" isFaceUp={isRevealed} />\n</Scene>"
|
|
196
196
|
},
|
|
197
197
|
SceneStack: {
|
|
198
198
|
entry: b,
|
|
@@ -209,7 +209,7 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
209
209
|
SceneCells: {
|
|
210
210
|
entry: b,
|
|
211
211
|
question: "What is inside this vector or matrix, cell by cell?",
|
|
212
|
-
guidance: "Use it for a small grid of values that moves and changes inside a scene: a flat list is one row, a list of lists is a matrix. Use Matrix for a large grid with axes and a scale legend.",
|
|
212
|
+
guidance: "Use it for a small grid of values that moves and changes inside a scene: a flat list is one row, a list of lists is a matrix. Each cell takes a tone, such as its suit, and isMuted for one already used. Use Matrix for a large grid with axes and a scale legend.",
|
|
213
213
|
example: "<SceneCells id=\"weights\" at={[2, 1]} values={[[0.2, -0.4, 0.1], [0.7, 0.3, -0.2]]} rowLabels={['h1', 'h2']} format={{ maximumFractionDigits: 1 }} label=\"Weight matrix\" />"
|
|
214
214
|
},
|
|
215
215
|
SceneToken: {
|
|
@@ -257,7 +257,7 @@ var v = /* @__PURE__ */ "Lesson.Param.Value.ParamSlider.ParamChoice.ParamToggle.
|
|
|
257
257
|
Figure: {
|
|
258
258
|
entry: x,
|
|
259
259
|
question: "What am I looking at here?",
|
|
260
|
-
guidance: "Wrap every scene or chart in a beat with a Figure: a caption, a description for the static view, and the values it reads. Size text keeps it to the prose column.",
|
|
260
|
+
guidance: "Wrap every scene or chart in a beat with a Figure: a caption, a description for the static view, and the values it reads. Its header and footer frame the figure with its controls, and isFramed frames one with no controls, so an essay frames all its figures or none. A chart or scene inside prints only the caption and keeps its title as its name, so never repeat the beat heading. Size text keeps it to the prose column.",
|
|
261
261
|
example: "<Figure id=\"bet-split\" caption=\"Your bet, split across the two cards.\" description=\"Two cards with the share of the bet on each.\" reads={['bet']} size=\"text\">\n <BetScene />\n</Figure>"
|
|
262
262
|
},
|
|
263
263
|
FigureReference: {
|
package/dist/lesson.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as e, t } from "./clock-DSm5lkNE.js";
|
|
2
|
-
import { n,
|
|
3
|
-
import {
|
|
4
|
-
import { a as d, c as f,
|
|
5
|
-
export {
|
|
2
|
+
import { _ as n, g as r, h as i, i as a, l as o, n as s, t as c, u as l } from "./param-BdqTpZER.js";
|
|
3
|
+
import { t as u } from "./use-tween-BsaEO862.js";
|
|
4
|
+
import { a as d, c as f, d as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./transport-4V9rfYHN.js";
|
|
5
|
+
export { a as BoundValue, h as Lesson, i as LessonLocale, c as Param, m as ParamChoice, d as ParamSlider, _ as ParamToggle, g as Playback, b as Transport, s as Value, n as createTween, o as defineLesson, t as isMotionReduced, l as lessonGraph, e as onFrame, x as playbackPaces, p as playbackRuns, y as useLesson, f as useLessonContext, r as useLessonLocale, v as usePlayback, u as useTween };
|
package/dist/mdx.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-
|
|
2
|
-
import { n as se, t as ce } from "./param-
|
|
3
|
-
import { a as l, i as u, n as d, o as f, t as p } from "./transport-
|
|
4
|
-
import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-
|
|
1
|
+
import { _ as e, b as t, d as n, f as r, g as i, i as ee, l as a, m as o, n as s, p as te, r as c, t as ne, u as re, v as ie, x as ae, y as oe } from "./article-CRlhq9oA.js";
|
|
2
|
+
import { n as se, t as ce } from "./param-BdqTpZER.js";
|
|
3
|
+
import { a as l, i as u, n as d, o as f, t as p } from "./transport-4V9rfYHN.js";
|
|
4
|
+
import { C as m, F as h, G as g, H as _, I as v, J as y, L as b, M as x, N as S, P as C, U as w, W as T, X as E, Y as D, b as O, g as k, i as A, l as j, q as M, r as N, t as P, tt as F, u as I, x as L } from "./scene-BwJKueD6.js";
|
|
5
5
|
import { t as R } from "./code-block-BZsY2sh3.js";
|
|
6
6
|
import { t as z } from "./content-link-PnpcnTCx.js";
|
|
7
7
|
import * as B from "@stylexjs/stylex";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type CaptionScopeProps = {
|
|
3
|
+
/** The charts and scenes the surrounding caption describes. */
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Marks figures whose caption is printed around them, such as inside an article `Figure`. A chart or scene inside keeps
|
|
8
|
+
* its title as its accessible name, and prints neither the title nor the description.
|
|
9
|
+
*/
|
|
10
|
+
export declare function CaptionScope({ children }: CaptionScopeProps): ReactNode;
|
|
11
|
+
/** Whether a figure sits in a `CaptionScope`, so its own title and description stay unprinted. */
|
|
12
|
+
export declare function useIsCaptioned(): boolean;
|
|
@@ -27,7 +27,8 @@ export type FigureFrameProps = FigureFrameInput & {
|
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* The frame every figure shares: title, description, the plot, then the readout and one footnote. The footnote names
|
|
30
|
-
* the source, how much of the data is drawn and what was done to it.
|
|
30
|
+
* the source, how much of the data is drawn and what was done to it. In a `CaptionScope` the title is only the
|
|
31
|
+
* accessible name, and the description is not printed.
|
|
31
32
|
*/
|
|
32
33
|
export declare function FigureFrame({ title, description, report, actions, locale, source, coverage, transforms, status, figure, series, titleDetail, footer, seriesLegend, scaleLegend, children, }: FigureFrameProps): ReactNode;
|
|
33
34
|
/** The sentence a figure shows in place of its plot when there is nothing to draw. */
|
|
@@ -11,6 +11,8 @@ export type { ChartGridProps } from './chart-grid.tsx';
|
|
|
11
11
|
export { ChartGrid } from './chart-grid.tsx';
|
|
12
12
|
export type { ChartLinkControl, ChartLinkInspectChange, ChartLinkProps } from './chart-link.tsx';
|
|
13
13
|
export { ChartLink, useChartLinkControl, useLinkedInspection } from './chart-link.tsx';
|
|
14
|
+
export type { CaptionScopeProps } from './figure/caption-scope.tsx';
|
|
15
|
+
export { CaptionScope, useIsCaptioned } from './figure/caption-scope.tsx';
|
|
14
16
|
export type { TimeFormat, ValueFormat } from './figure/figure-format.ts';
|
|
15
17
|
export { MISSING_VALUE_TEXT, formatTime, formatValue, tickFormat } from './figure/figure-format.ts';
|
|
16
18
|
export type { FigureCoverage, FigureProps, FigureSelectionProps, FigureStatus, SeriesFigureProps, } from './figure/figure-props.ts';
|
|
@@ -21,6 +21,8 @@ export type ChallengeRegistry = {
|
|
|
21
21
|
export type ArticleScope = {
|
|
22
22
|
readonly view: ArticleView;
|
|
23
23
|
readonly title: string;
|
|
24
|
+
/** Whether the article and static views list the beats. False when the host's own navigation lists them. */
|
|
25
|
+
readonly hasContents: boolean;
|
|
24
26
|
readonly lesson: AnyLesson;
|
|
25
27
|
readonly locale: string;
|
|
26
28
|
readonly labels: ArticleLabels;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as stylex from '@stylexjs/stylex';
|
|
1
2
|
/**
|
|
2
3
|
* The geometry every article view shares. Essay text keeps a measure of about 68 characters. From `withMargin` the text
|
|
3
4
|
* gains a margin column for asides and wide figures, and from `withContents` the contents list sits beside it.
|
|
@@ -11,4 +12,16 @@ export declare const articleLayout: {
|
|
|
11
12
|
withMargin: string;
|
|
12
13
|
withContents: string;
|
|
13
14
|
narrow: string;
|
|
15
|
+
withoutContents: string;
|
|
14
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* How far from the top a sticky part of the article stops, and how much room a link target keeps above it. The essay
|
|
19
|
+
* view raises it to the height of its compact contents bar where that bar shows.
|
|
20
|
+
*/
|
|
21
|
+
export declare const articleSticky: stylex.VarGroup<Readonly<{
|
|
22
|
+
top: string;
|
|
23
|
+
}>, symbol>;
|
|
24
|
+
/** Marks a framed figure, so its strips and visual can follow a report frame inside it. */
|
|
25
|
+
export declare const framedFigure: Readonly<{
|
|
26
|
+
readonly marker: stylex.StyleXClassNameFor<"marker", symbol>;
|
|
27
|
+
}>;
|
|
@@ -29,6 +29,11 @@ export type ArticleProps<Params extends LessonParams, Derived extends string, Be
|
|
|
29
29
|
/** Hears each change of the reader's progress. A change an agent makes is refused before it gets here. */
|
|
30
30
|
readonly onProgressChange?: ((progress: LessonProgress, details: ProgressChangeDetails) => void) | undefined;
|
|
31
31
|
readonly labels?: Partial<ArticleLabels> | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the article and static views show their contents list. Set it to false when the host's own navigation lists
|
|
34
|
+
* the beats, such as a rail that sets the beat through `lessonProps`. The text column keeps its measure.
|
|
35
|
+
*/
|
|
36
|
+
readonly hasContents?: boolean | undefined;
|
|
32
37
|
/** Passed to the `Lesson` the article renders: controlled values, beat and step, or address bar sync. */
|
|
33
38
|
readonly lessonProps?: Omit<LessonProps<Params, Derived, Beat>, 'lesson' | 'locale' | 'storageKey' | 'children'> | undefined;
|
|
34
39
|
/** The essay: `Beat`s, and around them `References` and anything else. */
|
|
@@ -39,4 +44,4 @@ export type ArticleProps<Params extends LessonParams, Derived extends string, Be
|
|
|
39
44
|
* around them. It renders the `Lesson`, the tone scope and one link scope, and arranges the same children in four
|
|
40
45
|
* views. The reader's progress is the UI SDK primitive `lesson-progress`, which counts only what the reader did.
|
|
41
46
|
*/
|
|
42
|
-
export declare function Article<Params extends LessonParams, Derived extends string, Beat extends string>({ lesson, locale, title, authors, date, summary, tones, view, math, storageKey, progress, defaultProgress, onProgressChange, labels, lessonProps, children, }: ArticleProps<Params, Derived, Beat>): ReactNode;
|
|
47
|
+
export declare function Article<Params extends LessonParams, Derived extends string, Beat extends string>({ lesson, locale, title, authors, date, summary, tones, view, math, storageKey, progress, defaultProgress, onProgressChange, labels, hasContents, lessonProps, children, }: ArticleProps<Params, Derived, Beat>): ReactNode;
|
|
@@ -5,7 +5,24 @@ export declare const FigureCopy: import("react").Context<boolean>;
|
|
|
5
5
|
export declare const FigureColumn: import("react").Context<boolean>;
|
|
6
6
|
/** How wide a figure is: the text column, or the text and its margin on wide screens. */
|
|
7
7
|
export type FigureSize = 'text' | 'wide';
|
|
8
|
-
|
|
8
|
+
/** The frame a figure takes: given a strip it is framed, and without one `isFramed` frames the visual alone. */
|
|
9
|
+
export type FigureFraming = {
|
|
10
|
+
/** Frames a figure that has no strip, so it matches the framed figures beside it. Defaults to false. */
|
|
11
|
+
readonly isFramed?: boolean | undefined;
|
|
12
|
+
readonly header?: undefined;
|
|
13
|
+
readonly footer?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
/** A figure with a strip is always framed: its controls belong to the frame. */
|
|
16
|
+
readonly isFramed?: true | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Controls above the visual, such as a `Transport`. Given this or `footer`, the figure sits in a hairline frame
|
|
19
|
+
* with a strip for each, ruled off from the visual.
|
|
20
|
+
*/
|
|
21
|
+
readonly header?: ReactNode;
|
|
22
|
+
/** Controls below the visual, such as a `ParamChoice` or a reset button, in the framed figure's bottom strip. */
|
|
23
|
+
readonly footer?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export type FigureProps = FigureFraming & {
|
|
9
26
|
/** The figure's id, unique in the article. It is the element id, so `#id` links land on the figure. */
|
|
10
27
|
readonly id: string;
|
|
11
28
|
/** What the reader should see in the figure, after its number. */
|
|
@@ -19,7 +36,7 @@ export type FigureProps = {
|
|
|
19
36
|
readonly reads?: ReadonlyArray<string> | undefined;
|
|
20
37
|
/** Wide figures, the default, reach into the margin column on wide screens. */
|
|
21
38
|
readonly size?: FigureSize | undefined;
|
|
22
|
-
/** The chart, scene or image. */
|
|
39
|
+
/** The chart, scene or image. A chart or scene inside keeps its title as its name and prints only the caption. */
|
|
23
40
|
readonly children: ReactNode;
|
|
24
41
|
};
|
|
25
42
|
/**
|
|
@@ -27,7 +44,7 @@ export type FigureProps = {
|
|
|
27
44
|
* are numbered in reading order. Give each a `description` so the static view and assistive technology can say what it
|
|
28
45
|
* shows.
|
|
29
46
|
*/
|
|
30
|
-
export declare function Figure({ id, caption, description, size, children }: FigureProps): ReactNode;
|
|
47
|
+
export declare function Figure({ id, caption, description, size, header, footer, isFramed: isFramedProp, children, }: FigureProps): ReactNode;
|
|
31
48
|
export type FigureReferenceProps = {
|
|
32
49
|
/** The id of the figure the reference points to. */
|
|
33
50
|
readonly to: string;
|
|
@@ -12,7 +12,7 @@ export { articleChecks } from './article-checks.ts';
|
|
|
12
12
|
export { answerSources, articleOutline } from './article-outline.ts';
|
|
13
13
|
export type { BeatProps } from './beat.tsx';
|
|
14
14
|
export { Beat } from './beat.tsx';
|
|
15
|
-
export type { FigureProps, FigureReferenceProps, FigureSize, RevealProps } from './figure.tsx';
|
|
15
|
+
export type { FigureFraming, FigureProps, FigureReferenceProps, FigureSize, RevealProps } from './figure.tsx';
|
|
16
16
|
export { Figure, FigureReference, Reveal, useRevealed } from './figure.tsx';
|
|
17
17
|
export type { AsideProps, CiteProps, FootnoteProps, ReferencesProps } from './notes.tsx';
|
|
18
18
|
export type { ArticleOutline, OutlineBeat, OutlineFigure, OutlinePrediction, ReferenceItem } from './outline-types.ts';
|
|
@@ -8,6 +8,7 @@ export type ViewProps = {
|
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* The article view: a scrolling essay with a contents list that follows the reading position. Scrolling a beat into the
|
|
11
|
-
* reading band makes it the lesson's beat, and a beat set elsewhere, such as by an agent, scrolls into view.
|
|
11
|
+
* reading band makes it the lesson's beat, and a beat set elsewhere, such as by an agent, scrolls into view. Below
|
|
12
|
+
* `withContents` the list folds into a sticky bar, which a focused element or a linked target is never left under.
|
|
12
13
|
*/
|
|
13
14
|
export declare function EssayView({ article, header, children }: ViewProps): ReactNode;
|
|
@@ -56,6 +56,8 @@ export type LessonBeat = {
|
|
|
56
56
|
readonly steps?: number | undefined;
|
|
57
57
|
/** The states worth seeing on a beat sheet and in the static view. The first is the beat's opening state. */
|
|
58
58
|
readonly states?: ReadonlyArray<LessonState> | undefined;
|
|
59
|
+
/** The params this beat owns, which `resetBeat` returns to their opening values. Defaults to those its states set. */
|
|
60
|
+
readonly params?: ReadonlyArray<string> | undefined;
|
|
59
61
|
};
|
|
60
62
|
/** A derived value as a lesson keeps it: its label and format. */
|
|
61
63
|
export type LessonDerived = {
|
|
@@ -122,6 +124,8 @@ export declare function paramProblem({ name, param, value, }: {
|
|
|
122
124
|
readonly param: LessonParam;
|
|
123
125
|
readonly value: unknown;
|
|
124
126
|
}): string | undefined;
|
|
127
|
+
/** The params a beat owns: the ones it declares, or else every param its states set. */
|
|
128
|
+
export declare function beatParams(beat: LessonBeat): ReadonlyArray<string>;
|
|
125
129
|
/**
|
|
126
130
|
* Declares a lesson: its params with their ranges, steps and formats, the values derived from them, and its beats as
|
|
127
131
|
* plain data. Every prose value, control, figure, player and agent of the lesson reads these names. A duplicate or
|
|
@@ -6,8 +6,8 @@ export { LessonLocale, useLessonLocale } from './lesson-locale.ts';
|
|
|
6
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
7
|
export { defineLesson, lessonGraph } from './define-lesson.ts';
|
|
8
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';
|
|
9
|
+
export type { LessonPlayer, LessonPlayingChangeReason, PlayOrigin, PlaybackLength, PlaybackPace, PlaybackRun, } from './lesson-player.ts';
|
|
10
|
+
export { playbackPaces, playbackRuns } from './lesson-player.ts';
|
|
11
11
|
export type { LessonProps } from './lesson.tsx';
|
|
12
12
|
export { Lesson } from './lesson.tsx';
|
|
13
13
|
export type { LessonControls } from './use-lesson.ts';
|
|
@@ -8,12 +8,28 @@ export declare const playbackPaces: {
|
|
|
8
8
|
};
|
|
9
9
|
/** A player's pace, from `playbackPaces`. */
|
|
10
10
|
export type PlaybackPace = keyof typeof playbackPaces;
|
|
11
|
+
/** How long a timed run takes from `from` to `to`, in seconds, whatever the number of steps between. */
|
|
12
|
+
export declare const playbackRuns: {
|
|
13
|
+
readonly short: 2;
|
|
14
|
+
readonly regular: 5;
|
|
15
|
+
readonly long: 10;
|
|
16
|
+
};
|
|
17
|
+
/** A timed run's length, from `playbackRuns`. */
|
|
18
|
+
export type PlaybackLength = keyof typeof playbackRuns;
|
|
19
|
+
/**
|
|
20
|
+
* A whole run from `from` to `to` in a set time, such as a 320-step training run that takes `long`. With `isEased` the
|
|
21
|
+
* value starts fast and settles, on the curve every tween uses.
|
|
22
|
+
*/
|
|
23
|
+
export type PlaybackRun = {
|
|
24
|
+
readonly run: PlaybackLength;
|
|
25
|
+
readonly isEased?: boolean | undefined;
|
|
26
|
+
};
|
|
11
27
|
/** A number param that a `Playback` drives: where it starts, where it ends and how fast it goes. */
|
|
12
28
|
export type LessonPlayer = {
|
|
13
29
|
readonly name: string;
|
|
14
30
|
readonly from: number;
|
|
15
31
|
readonly to: number;
|
|
16
|
-
readonly pace: PlaybackPace;
|
|
32
|
+
readonly pace: PlaybackPace | PlaybackRun;
|
|
17
33
|
readonly isLooping: boolean;
|
|
18
34
|
};
|
|
19
35
|
/** Why a player started or stopped: a press, the end of its run or a hidden tab, or a call. */
|
|
@@ -44,8 +60,8 @@ export type LessonPlayers = {
|
|
|
44
60
|
readonly pause: (origin?: PlayOrigin) => void;
|
|
45
61
|
};
|
|
46
62
|
/**
|
|
47
|
-
* Makes a lesson's players. A player advances its param
|
|
48
|
-
*
|
|
63
|
+
* Makes a lesson's players. A player advances its param a step at a time at its pace, or along a timed run. It stops at
|
|
64
|
+
* its end or starts over, and when the tab is hidden; with reduced motion, play shows the end at once.
|
|
49
65
|
*/
|
|
50
66
|
export declare function createPlayers(host: PlayerHost): LessonPlayers;
|
|
51
67
|
export {};
|
|
@@ -61,6 +61,8 @@ export type LessonApi = {
|
|
|
61
61
|
readonly showState: (state: string, origin?: LessonChangeOrigin) => boolean;
|
|
62
62
|
/** Puts every param back to the value the lesson opened with. */
|
|
63
63
|
readonly reset: (origin?: LessonChangeOrigin) => boolean;
|
|
64
|
+
/** Puts the params one beat owns back to their opening values in one change, and leaves every other param alone. */
|
|
65
|
+
readonly resetBeat: (beat: string, origin?: LessonChangeOrigin) => boolean;
|
|
64
66
|
/** Moves to a beat, at its first reveal step unless `step` says otherwise. */
|
|
65
67
|
readonly setBeat: (beat: string, step?: number, origin?: LessonPlaceOrigin) => boolean;
|
|
66
68
|
/** Shows the next reveal step, or the next beat at its first step. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { NumberParam } from './define-lesson.ts';
|
|
3
3
|
import type { LessonScope } from './lesson-context.ts';
|
|
4
|
-
import type { PlaybackPace, PlayOrigin } from './lesson-player.ts';
|
|
4
|
+
import type { PlaybackPace, PlaybackRun, PlayOrigin } from './lesson-player.ts';
|
|
5
5
|
import type { LessonChangeOrigin } from './lesson-store.ts';
|
|
6
6
|
export type PlaybackProps = {
|
|
7
7
|
/** The number param the player moves. */
|
|
@@ -10,8 +10,11 @@ export type PlaybackProps = {
|
|
|
10
10
|
readonly from?: number | undefined;
|
|
11
11
|
/** Where play ends. Defaults to the param's max. */
|
|
12
12
|
readonly to?: number | undefined;
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* How many steps a second, by name, or a timed run. A run of `long` crosses the whole range in ten seconds however
|
|
15
|
+
* many steps it has. Its `isEased` lets it start fast and settle.
|
|
16
|
+
*/
|
|
17
|
+
readonly pace?: PlaybackPace | PlaybackRun | undefined;
|
|
15
18
|
/** Starts over from `from` at the end instead of stopping there. */
|
|
16
19
|
readonly isLooping?: boolean | undefined;
|
|
17
20
|
};
|
|
@@ -33,9 +36,9 @@ export declare function playerRange(scope: LessonScope, name: string, param: Num
|
|
|
33
36
|
readonly to: number;
|
|
34
37
|
};
|
|
35
38
|
/**
|
|
36
|
-
* Drives a number param over time,
|
|
37
|
-
* temperature sweep. It renders nothing; a `Transport` or `usePlayback` plays it. It pauses when the
|
|
38
|
-
* the reader changes the value, and with reduced motion play shows the end at once.
|
|
39
|
+
* Drives a number param over time on the lesson's shared clock, a step at a time or as one timed run: a training step,
|
|
40
|
+
* a token index, a temperature sweep. It renders nothing; a `Transport` or `usePlayback` plays it. It pauses when the
|
|
41
|
+
* tab is hidden or the reader changes the value, and with reduced motion play shows the end at once.
|
|
39
42
|
*/
|
|
40
43
|
export declare function Playback({ name, from, to, pace, isLooping }: PlaybackProps): ReactNode;
|
|
41
44
|
/** Plays, pauses and moves the player of a number param in the nearest lesson. */
|
|
@@ -13,8 +13,13 @@ export type LessonControls<Params extends LessonParams, Derived extends string,
|
|
|
13
13
|
readonly setMany: (values: Partial<ParamValues<Params>>, origin?: LessonChangeOrigin) => boolean;
|
|
14
14
|
/** Shows a state a beat declares, by its id, in one change. Params it does not name take their opening values. */
|
|
15
15
|
readonly show: (state: string, origin?: LessonChangeOrigin) => boolean;
|
|
16
|
-
/** Puts every param back to its opening value. */
|
|
17
|
-
readonly reset: () => boolean;
|
|
16
|
+
/** Puts every param of the whole lesson back to its opening value, the reader's work in every beat included. */
|
|
17
|
+
readonly reset: (origin?: LessonChangeOrigin) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Puts the params one beat owns back to their opening values in one change: its `params`, or those its states set.
|
|
20
|
+
* Use it for a figure's reset button, so the other beats keep the reader's values.
|
|
21
|
+
*/
|
|
22
|
+
readonly resetBeat: (beat: Beat, origin?: LessonChangeOrigin) => boolean;
|
|
18
23
|
readonly beat: Beat | null;
|
|
19
24
|
/** The reveal step inside the beat, from 0. */
|
|
20
25
|
readonly step: number;
|
|
@@ -16,6 +16,8 @@ export type ScenePlaneLabels = {
|
|
|
16
16
|
readonly pointParam: string;
|
|
17
17
|
/** Added after a movable point's label in the readout. */
|
|
18
18
|
readonly pointMovable: string;
|
|
19
|
+
/** A bound axis in a movable point's spoken value. `{name}` is the param's label and `{value}` its written value. */
|
|
20
|
+
readonly pointValue: string;
|
|
19
21
|
/** `{id}` names the region. */
|
|
20
22
|
readonly regionShape: string;
|
|
21
23
|
/** `{id}` names the rule. */
|
|
@@ -34,7 +36,8 @@ export declare const planeLabels: {
|
|
|
34
36
|
readonly pointLabel: 'The point "{id}" can be moved, so it needs a `label` for the readout.';
|
|
35
37
|
readonly pointOutsideLesson: 'The point "{id}" sets lesson params, so it must be inside a Lesson.';
|
|
36
38
|
readonly pointParam: 'The point "{id}" sets "{name}", which lesson "{lesson}" does not declare as a number param.';
|
|
37
|
-
readonly pointMovable: '
|
|
39
|
+
readonly pointMovable: ' Tab to it and use the arrow keys to move it.';
|
|
40
|
+
readonly pointValue: '{name} {value}';
|
|
38
41
|
readonly regionShape: 'The region "{id}" needs one of `between`, `above`, `below` or `points`.';
|
|
39
42
|
readonly ruleAxis: 'The rule "{id}" needs `x` or `y`, and not both.';
|
|
40
43
|
readonly projectionSource: 'The projection "{id}" needs `of` or `at`, and not both.';
|
|
@@ -4,7 +4,7 @@ import type { MarkEmphasis } from '../../../../charts/src/plot/index.ts';
|
|
|
4
4
|
import type { Pace } from '../../time/tween.ts';
|
|
5
5
|
import type { ScenePosition } from '../scene-geometry.ts';
|
|
6
6
|
import type { ScenePlaneLabels } from './plane-labels.ts';
|
|
7
|
-
/** Why a point moved: a pointer drag, or
|
|
7
|
+
/** Why a point moved: a pointer drag, or a key. A cancelled drag reports `drag` with the starting position. */
|
|
8
8
|
export type ScenePointMoveDetails = {
|
|
9
9
|
readonly reason: 'drag' | 'step-key';
|
|
10
10
|
readonly event: PointerEvent | KeyboardEvent;
|
|
@@ -34,8 +34,8 @@ export type ScenePointProps = {
|
|
|
34
34
|
/** True keeps the point and what attaches to it at full strength while the rest recede. */
|
|
35
35
|
readonly isActive?: boolean | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* Makes the point
|
|
38
|
-
*
|
|
37
|
+
* Makes the point a slider the reader drags or reaches with Tab and moves with the keys. It is told where the reader
|
|
38
|
+
* wants the point; the point stays where `at` says until the application moves it.
|
|
39
39
|
*/
|
|
40
40
|
readonly onMove?: ((position: ScenePosition, details: ScenePointMoveDetails) => void) | undefined;
|
|
41
41
|
/**
|
|
@@ -52,8 +52,7 @@ export type ScenePointProps = {
|
|
|
52
52
|
readonly labels?: Partial<ScenePlaneLabels> | undefined;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
* A point at a position in the scene, with optional text beside it. Give it `sets` or `onMove` and
|
|
56
|
-
*
|
|
57
|
-
* eases only when the application moves it.
|
|
55
|
+
* A point at a position in the scene, with optional text beside it. Give it `sets` or `onMove` and it is a slider: the
|
|
56
|
+
* reader drags it, or reaches it with Tab and moves it with the arrow keys, Home and End. It eases only when moved.
|
|
58
57
|
*/
|
|
59
58
|
export declare function ScenePoint({ id, at, label, text, tone, emphasis, isShown, isActive, onMove, sets, snap, along, pace, labels: labelInput, }: ScenePointProps): ReactNode;
|
|
@@ -161,7 +161,7 @@ export declare function sceneMinWidth({ frames, edged, links, domain, innerHeigh
|
|
|
161
161
|
readonly frames: ReadonlyArray<SceneFrame>;
|
|
162
162
|
/** The frames the margins keep whole: `frames`, and the room drawn around some of them, such as a group's outline. */
|
|
163
163
|
readonly edged: ReadonlyArray<SceneFrame>;
|
|
164
|
-
/** The ends of each wire
|
|
164
|
+
/** The ends of each wire, with the room the wire asks for between them: its stroke, its arrow and its text. */
|
|
165
165
|
readonly links: ReadonlyArray<SceneLink>;
|
|
166
166
|
readonly domain: SceneDomain;
|
|
167
167
|
readonly innerHeight: number;
|
|
@@ -29,7 +29,10 @@ export type SceneNodeProps = {
|
|
|
29
29
|
readonly isShown?: boolean | undefined;
|
|
30
30
|
/** True keeps the node at full strength while the parts it is not connected to recede. */
|
|
31
31
|
readonly isActive?: boolean | undefined;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* 0 shows the front, 1 the back; values between are mid-flip. Only the face toward the reader is rendered, so a
|
|
34
|
+
* turned-away face reaches no screen reader or agent, and its content remounts when it turns back.
|
|
35
|
+
*/
|
|
33
36
|
readonly turn?: number | undefined;
|
|
34
37
|
/** 0 rests on the page, 1 is raised toward the reader: larger, with a deeper shadow. */
|
|
35
38
|
readonly lift?: number | undefined;
|
|
@@ -6,6 +6,11 @@ export type SceneLabels = {
|
|
|
6
6
|
readonly objects: string;
|
|
7
7
|
/** The header of the exact-value table. */
|
|
8
8
|
readonly objectColumn: string;
|
|
9
|
+
/**
|
|
10
|
+
* Ends the plot's accessible name when a press acts, with `onSelectedChange`. Name the action, such as "Press Enter
|
|
11
|
+
* to turn the card over."
|
|
12
|
+
*/
|
|
13
|
+
readonly press: string;
|
|
9
14
|
readonly missingLocale: string;
|
|
10
15
|
readonly invalidBox: string;
|
|
11
16
|
readonly invalidAspect: string;
|
|
@@ -28,6 +33,7 @@ export type SceneLabels = {
|
|
|
28
33
|
export declare const sceneLabels: {
|
|
29
34
|
readonly objects: 'diagram parts';
|
|
30
35
|
readonly objectColumn: 'Part';
|
|
36
|
+
readonly press: 'Press Enter or Space to activate a part.';
|
|
31
37
|
readonly missingLocale: 'This scene needs a locale. Pass `locale`, or place it inside a Lesson.';
|
|
32
38
|
readonly invalidBox: 'The scene box needs two finite, increasing values on each axis.';
|
|
33
39
|
readonly invalidAspect: 'The scene aspect must be a positive, finite ratio of width to height.';
|
|
@@ -27,6 +27,11 @@ export type SceneWireProps = {
|
|
|
27
27
|
readonly tone?: ChartTone | undefined;
|
|
28
28
|
/** How the wire runs between its ends. Defaults to `straight`. */
|
|
29
29
|
readonly shape?: SceneWireShape | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Pixels the wire's middle bows off the line between its ends. Positive is above a wire that runs across and right of
|
|
32
|
+
* an upright one. A wire does not avoid other objects, so bow it around a node between its ends.
|
|
33
|
+
*/
|
|
34
|
+
readonly bend?: number | undefined;
|
|
30
35
|
/** Dashed for a modelled or proposed connection. */
|
|
31
36
|
readonly isDashed?: boolean | undefined;
|
|
32
37
|
/** Draws an arrowhead at the `to` end. Defaults to true. */
|
|
@@ -42,4 +47,4 @@ export type SceneWireProps = {
|
|
|
42
47
|
* A connection between two scene objects that stays attached to their edges while they move. Its thickness can carry a
|
|
43
48
|
* signed weight, eased when the weight changes. Give it a label to make it an item the reader can inspect.
|
|
44
49
|
*/
|
|
45
|
-
export declare function SceneWire({ from, to, id, label, text, textSide, weight, tone, shape, isDashed, hasArrow, isShown, isActive, emphasis, }: SceneWireProps): ReactNode;
|
|
50
|
+
export declare function SceneWire({ from, to, id, label, text, textSide, weight, tone, shape, bend, isDashed, hasArrow, isShown, isActive, emphasis, }: SceneWireProps): ReactNode;
|
|
@@ -19,7 +19,7 @@ export type SceneProps = Omit<FigureProps, 'locale'> & FigureSelectionProps & {
|
|
|
19
19
|
readonly pace?: Pace | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* The narrowest plot in pixels; below it the plot scrolls inside the frame. Left out, it is the width at which no
|
|
22
|
-
* two objects on
|
|
22
|
+
* two objects on one row touch and each wire keeps room for its arrow and text. Set it only to keep more room.
|
|
23
23
|
*/
|
|
24
24
|
readonly minWidth?: number | undefined;
|
|
25
25
|
/** The wire weight magnitude drawn thickest. Weights must lie within plus or minus this. Defaults to 1. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NumericDomain } from '../../../../charts/src/index.ts';
|
|
1
|
+
import type { ChartTone, NumericDomain } from '../../../../charts/src/index.ts';
|
|
2
2
|
import type { HeatmapPalette } from '../../../../charts/src/matrix/index.ts';
|
|
3
3
|
import type { SceneOffset } from '../scene-geometry.ts';
|
|
4
4
|
/** The pixel boxes of the named cell sizes. */
|
|
@@ -30,6 +30,10 @@ export type SceneCellInput = {
|
|
|
30
30
|
readonly value?: number | undefined;
|
|
31
31
|
/** The readout sentence. Left out, the cell says its row, column and value. */
|
|
32
32
|
readonly label?: string | undefined;
|
|
33
|
+
/** The hue of the cell's text and tint, such as a card's suit. A palette's fill still wins. */
|
|
34
|
+
readonly tone?: ChartTone | undefined;
|
|
35
|
+
/** True draws the cell gray and unfilled, such as a card already dealt. Its value and label stay. */
|
|
36
|
+
readonly isMuted?: boolean | undefined;
|
|
33
37
|
};
|
|
34
38
|
/** The numbers of a vector or a matrix: a flat list, or a list of rows. */
|
|
35
39
|
export type SceneCellValues = ReadonlyArray<number | ReadonlyArray<number>>;
|
|
@@ -61,7 +61,7 @@ export type SceneCellsProps = {
|
|
|
61
61
|
readonly size?: SceneCellSizeName | undefined;
|
|
62
62
|
/** One caption per row, drawn left of the grid in a column as wide as the longest. */
|
|
63
63
|
readonly rowLabels?: ReadonlyArray<string> | undefined;
|
|
64
|
-
/** One caption per column, drawn above the grid. */
|
|
64
|
+
/** One caption per column, drawn above the grid. A long caption wraps, and a word wider than its column overhangs. */
|
|
65
65
|
readonly columnLabels?: ReadonlyArray<string> | undefined;
|
|
66
66
|
/** A row, a column, or one cell where both are given, drawn with a strong outline. Indices count from 0. */
|
|
67
67
|
readonly highlight?: {
|
|
@@ -20,7 +20,7 @@ export type SceneSlotProps = {
|
|
|
20
20
|
readonly text?: string | undefined;
|
|
21
21
|
/** The readout sentence. With one, the arrow keys reach the slot; Left and Right step on to a card sitting on it. */
|
|
22
22
|
readonly label?: string | undefined;
|
|
23
|
-
/** True draws the slot as the place that matters now: a solid outline and a tint. */
|
|
23
|
+
/** True draws the slot as the place that matters now: a solid outline and a tint. Nothing else recedes. */
|
|
24
24
|
readonly isActive?: boolean | undefined;
|
|
25
25
|
/** The hue of the outline while active. Defaults to neutral. */
|
|
26
26
|
readonly tone?: ChartTone | undefined;
|
|
@@ -12,6 +12,8 @@ export type Tween<Key extends string> = {
|
|
|
12
12
|
/** Stops any move in flight. The tween still answers `get` and can be moved again. */
|
|
13
13
|
readonly destroy: () => void;
|
|
14
14
|
};
|
|
15
|
+
/** Fast at first and settling gently, the curve the motion tokens use for interface transitions. */
|
|
16
|
+
export declare function eased(progress: number): number;
|
|
15
17
|
/**
|
|
16
18
|
* Makes a tween that starts at `initial`. Give it a new target with `to` and read `get` on each change: authors
|
|
17
19
|
* describe where things are, and the tween supplies the motion between.
|