@mechane-ai/elements 0.48.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/ai.js +5 -5
- package/dist/{article-BXZr10QQ.js → article-CRlhq9oA.js} +532 -464
- package/dist/article.js +1 -1
- package/dist/catalog.json +243 -1
- package/dist/{categorical-values-BpVq8cFj.js → categorical-values-BYP_R5gS.js} +13 -13
- package/dist/{cells-xVmnQ9oQ.js → cells-CNZE4us2.js} +2 -2
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.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 +7 -7
- 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/{code-block-DioAM2bZ.js → code-block-BZsY2sh3.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +2 -2
- package/dist/content/tree.js +1 -1
- package/dist/{content-link-NWuHp5rC.js → content-link-PnpcnTCx.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-Cww8UR_n.js → dates-ckJdYF7t.js} +1 -1
- package/dist/{dumbbell-plot-DQdTxDeO.js → dumbbell-plot-B-Tn7ewW.js} +49 -48
- package/dist/{embedding-map-CF-J-8JW.js → embedding-map-Bljn-A5q.js} +533 -533
- package/dist/feedback.js +1 -1
- package/dist/figure-frame-CEijciL7.js +289 -0
- package/dist/forms/dates.js +1 -1
- package/dist/forms.js +3 -3
- package/dist/{image-grid-Dl2sjIMB.js → image-grid-mrG5u9oE.js} +49 -49
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +320 -302
- package/dist/kits/operations.js +6 -6
- package/dist/kits/research.js +558 -0
- package/dist/kits/training.js +6 -6
- package/dist/layout.js +205 -110
- package/dist/lesson/spec.js +11 -11
- package/dist/lesson.js +4 -4
- package/dist/mdx.js +6 -6
- package/dist/navigation.js +2 -2
- package/dist/packages/charts/src/cartesian/index.d.ts +1 -1
- package/dist/packages/charts/src/cartesian/scatter-plot.d.ts +18 -0
- package/dist/packages/charts/src/chart-theme.d.ts +1 -1
- 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/charts/src/plot/plot-surface.d.ts +3 -1
- package/dist/packages/collections/src/index.d.ts +1 -1
- package/dist/packages/collections/src/metrics.d.ts +9 -1
- package/dist/packages/content/src/index.d.ts +2 -0
- package/dist/packages/content/src/text-match.d.ts +22 -0
- package/dist/packages/core/src/index.d.ts +1 -0
- package/dist/packages/core/src/surfaces.d.ts +12 -2
- package/dist/packages/forms/src/index.d.ts +2 -0
- package/dist/packages/forms/src/token-input.d.ts +24 -0
- package/dist/packages/kits/src/interpretability/index.d.ts +1 -1
- package/dist/packages/kits/src/interpretability/logit-lens.d.ts +10 -1
- package/dist/packages/kits/src/research/finding-card.d.ts +43 -0
- package/dist/packages/kits/src/research/index.d.ts +8 -0
- package/dist/packages/kits/src/research/milestone-path.d.ts +36 -0
- package/dist/packages/kits/src/research/specimen-diff.d.ts +41 -0
- package/dist/packages/kits/src/research/work-heartbeat.d.ts +34 -0
- package/dist/packages/layout/src/figure-grid.d.ts +8 -0
- package/dist/packages/layout/src/index.d.ts +4 -1
- package/dist/packages/layout/src/sidebar.d.ts +7 -0
- package/dist/packages/layout/src/workbench.d.ts +4 -1
- 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-CqKUTHaO.js → param-BdqTpZER.js} +175 -108
- package/dist/{pierre-diff-DlvjyuJn.js → pierre-diff-aGyQK5xK.js} +1 -1
- package/dist/{plot-axes-DJkLW4wk.js → plot-axes-D5S9BnBa.js} +1 -1
- package/dist/{plot-layout-CZVSJ-le.js → plot-layout-B2xRt-_k.js} +146 -132
- package/dist/{plot-marks-uozcbOIX.js → plot-marks-FVsbFkUs.js} +3 -3
- package/dist/{plot-surface-CbVBvgqZ.js → plot-surface-0cKFwtws.js} +11 -11
- package/dist/{plot-width-DcqtSgzb.js → plot-width-D3hTycYX.js} +1 -1
- package/dist/{reference-lines-BDcttOp0.js → reference-lines-nSxcZVF5.js} +2 -2
- package/dist/{scene-0z2gbaDE.js → scene-BwJKueD6.js} +1228 -1126
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-BKVEAVCs.js → slope-chart-CGTYbFxi.js} +182 -182
- package/dist/{src-CpdJlDhO.js → src-9EJskqB_.js} +73 -31
- package/dist/{src-Dcfq8vE4.js → src-B2rgpWap.js} +48 -14
- package/dist/{src-BPTDJqt0.js → src-Ci8DeY8J.js} +1 -1
- package/dist/{src-CGc_hjxJ.js → src-DFW49IAs.js} +143 -111
- package/dist/{src-BD6xlvDt.js → src-Dxs3Buo_.js} +203 -137
- package/dist/{src-CExIrXPC.js → src-npqwq3Sa.js} +1 -1
- package/dist/styles2.css +136 -17
- package/dist/{time-series-BgzGNOk0.js → time-series-Dh8y5ba0.js} +1018 -944
- package/dist/{token-heatmap-BrW1OsKD.js → token-heatmap-BTrZ3-N4.js} +86 -86
- package/dist/{token-predictions-yerq_Oet.js → token-predictions-CUe4junQ.js} +129 -129
- package/dist/{transport-BJweqDPj.js → transport-4V9rfYHN.js} +291 -246
- package/dist/{tree-diagram-D09BRqE-.js → tree-diagram-Dpqmo-fh.js} +118 -118
- package/dist/{treemap-CW4WsJNL.js → treemap-BUSaVD3m.js} +28 -28
- package/dist/use-tween-BsaEO862.js +10 -0
- package/dist/{violin-plot-DrtPZ1-T.js → violin-plot-BxaLwdRi.js} +126 -126
- package/dist/{waterfall-DYLSnGjm.js → waterfall-CcDMdKec.js} +43 -43
- package/package.json +5 -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/kits.md +7 -6
- 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-BJ3REgTA.js +0 -270
- package/dist/use-tween-5HZ55_9d.js +0 -72
package/README.md
CHANGED
|
@@ -309,6 +309,17 @@ The default theme is light, with system fonts and a compact spacing scale. Impor
|
|
|
309
309
|
`@mechane-ai/elements/theme` and spread `themeProps.light` or `themeProps.dark` onto the document root. Portaled content
|
|
310
310
|
then inherits the same theme. The application owns the preference; no theme provider is required.
|
|
311
311
|
|
|
312
|
+
`themeProps.dark` is a `className` and a `style`. A later spread with its own `className`, such as
|
|
313
|
+
`{...themeProps.dark} {...stylex.props(styles.root)}`, replaces the theme's class without an error, and the page is half
|
|
314
|
+
dark. Give the theme an element of its own, or join the class names:
|
|
315
|
+
|
|
316
|
+
```tsx
|
|
317
|
+
const theme = themeProps[isDark ? 'dark' : 'light'];
|
|
318
|
+
const own = stylex.props(styles.root);
|
|
319
|
+
|
|
320
|
+
<div className={`${theme.className ?? ''} ${own.className ?? ''}`} style={{ ...theme.style, ...own.style }} />;
|
|
321
|
+
```
|
|
322
|
+
|
|
312
323
|
For custom StyleX styles and themes, import variables from `@mechane-ai/elements/tokens.stylex` and compile-time
|
|
313
324
|
constants from `@mechane-ai/elements/constants.stylex`. The archive preserves both defining paths. Variables retain the
|
|
314
325
|
same names as the packaged CSS; constants need their source compiled with the consuming styles. The ordinary `/tokens`
|
|
@@ -647,7 +658,8 @@ the lesson. The idea:
|
|
|
647
658
|
its ends, and an object with the same `id` is the same thing in every state. Every move runs on one shared clock
|
|
648
659
|
(`createTween` and `useTween`), and a reader who asked for reduced motion gets the end state at once.
|
|
649
660
|
- **One kernel.** A `Scene` draws with the plot kernel, so a diagram has the chart's tones, readout and keyboard cursor.
|
|
650
|
-
Every labelled object is an item the arrow keys reach
|
|
661
|
+
Every labelled object is an item the arrow keys reach, and with the scene's `onSelectedChange` a press or Enter acts
|
|
662
|
+
on it, such as turning a card.
|
|
651
663
|
- **Four views of one essay.** An `Article` renders the same children as a scrolling essay, a presentation, a static
|
|
652
664
|
page or a beat sheet. The views differ in arrangement only.
|
|
653
665
|
- **Only the reader's acts count.** Predictions, challenges and hints change the reader's progress only when the reader
|
|
@@ -731,7 +743,10 @@ export function BatchPage() {
|
|
|
731
743
|
|
|
732
744
|
A state is the whole picture. `showState` (and `show` from `useLesson`) sets every param the state does not name back to
|
|
733
745
|
the lesson's opening value, so a state looks the same live, on the beat sheet and in a tour. `setMany` changes some
|
|
734
|
-
params and keeps the rest.
|
|
746
|
+
params and keeps the rest. `show` and `reset` act on the whole lesson: a figure's Reset button that calls `reset` clears
|
|
747
|
+
what the reader did in every other beat. Call `resetBeat(beat)` instead. It returns only the params that beat owns to
|
|
748
|
+
their opening values, in one change with the reason `reset`. A beat owns the params its `params` lists, or else those
|
|
749
|
+
its states set.
|
|
735
750
|
|
|
736
751
|
`useLesson(lesson)` types the values from the definition, so `values.noise` is a number and `set('batch', 'high')` does
|
|
737
752
|
not compile. `shouldSyncUrl` keeps the values in the address bar, and `storageKey` keeps them across visits. A `Scene`
|
|
@@ -781,12 +796,35 @@ export function BatchEssay() {
|
|
|
781
796
|
}
|
|
782
797
|
```
|
|
783
798
|
|
|
799
|
+
A figure with controls takes them as `header` or `footer`. The figure then sits in one hairline frame, with a strip
|
|
800
|
+
above or below the visual, ruled off from it. `isFramed` frames a figure with no controls, so every figure in an essay
|
|
801
|
+
can share the frame; a figure with a strip is always framed. A chart or scene inside an article `Figure` keeps its title
|
|
802
|
+
as its accessible name, but prints neither the title nor the description: the figure's number and caption say what it
|
|
803
|
+
is. Write the caption for the reader and the chart's title as its name.
|
|
804
|
+
|
|
784
805
|
Give `Article` a `view` of `'article'` (the default scrolling essay with a contents list), `'present'` (one beat at a
|
|
785
806
|
time; Right or Space goes on, and a beat opens at its first declared state), `'static'` (every beat open at its first
|
|
786
807
|
state, each figure followed by its description, no script needed) or `'sheet'` (every beat in each declared state, each
|
|
787
808
|
figure scaled to fit, its tutor notes, and a list of checks). The sheet names a beat with no figure, a figure with no
|
|
788
809
|
description, a player with no `Transport` and a sentence control that changes no figure.
|
|
789
810
|
|
|
811
|
+
An application whose own navigation lists the beats, such as a rail in an `AppShell`, holds the beat and passes it
|
|
812
|
+
through `lessonProps`, and sets `hasContents={false}` so the article shows no second list:
|
|
813
|
+
|
|
814
|
+
```tsx
|
|
815
|
+
<Article
|
|
816
|
+
lesson={lesson}
|
|
817
|
+
locale="en-US"
|
|
818
|
+
title="Why a bigger batch is quieter"
|
|
819
|
+
hasContents={false}
|
|
820
|
+
lessonProps={{ beat, onBeatChange: (next) => next !== null && setBeat(next) }}
|
|
821
|
+
>
|
|
822
|
+
{essay}
|
|
823
|
+
</Article>
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
Scrolling the essay then moves the rail, and a press in the rail scrolls the essay to that beat.
|
|
827
|
+
|
|
790
828
|
`recipes/counting-cards.tsx` (story `Recipes/Counting Cards`) is a full example on every layer, and
|
|
791
829
|
`recipes/explorable-essay.tsx` is a short one.
|
|
792
830
|
|
package/dist/ai.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as e, O as t, T as n, h as r, i, k as a, m as o, t as s, v as c } from "./src-
|
|
2
|
-
import { t as l } from "./code-block-
|
|
3
|
-
import {
|
|
4
|
-
import { t as d } from "./content-link-
|
|
1
|
+
import { D as e, O as t, T as n, h as r, i, k as a, m as o, t as s, v as c } from "./src-9EJskqB_.js";
|
|
2
|
+
import { t as l } from "./code-block-BZsY2sh3.js";
|
|
3
|
+
import { l as u } from "./src-DFW49IAs.js";
|
|
4
|
+
import { t as d } from "./content-link-PnpcnTCx.js";
|
|
5
5
|
import { r as f, t as p } from "./src-na2DdkKI.js";
|
|
6
|
-
import { c as m, d as h } from "./src-
|
|
6
|
+
import { c as m, d as h } from "./src-npqwq3Sa.js";
|
|
7
7
|
import { i as ee, t as g } from "./forms-CEbwzlRR.js";
|
|
8
8
|
import { t as te } from "./accessibility-P89UG9-r.js";
|
|
9
9
|
import { r as _ } from "./control-styles-D3q_Qyxi.js";
|