@mechane-ai/elements 0.65.0 → 0.68.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 +21 -10
- package/dist/ai.js +288 -205
- package/dist/{article-BrUa4Wz1.js → article-Ni152e-v.js} +107 -92
- package/dist/article.js +1 -1
- package/dist/catalog.json +151 -34
- package/dist/{categorical-values-AXJkMt-Y.js → categorical-values-6Iz03F1i.js} +1 -1
- package/dist/{cells-X8SVrZBc.js → cells-BRI8LpMU.js} +1 -1
- 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 +2 -2
- package/dist/charts/plot.js +16 -15
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +2 -2
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{code-block-BDRmjlES.js → code-block-DbW_t9U4.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/{color-legend-CIo7DhXB.js → color-legend-4As8881l.js} +1 -1
- package/dist/{commands-rzsDElrG.js → commands-C7Zrp-tG.js} +2 -2
- 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 +1 -1
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-DRaNf1mD.js → content-link-BN4NPp0u.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-wu-gKO2C.js → dates-OTq-xU33.js} +2 -2
- package/dist/{dumbbell-plot-VFajQtEW.js → dumbbell-plot-jaQvOctJ.js} +4 -4
- package/dist/{embedding-map-BqDEmy88.js → embedding-map-DnZL1kvY.js} +8 -8
- package/dist/feedback.js +1 -1
- package/dist/figure-format-BVb7yFCA.js +46 -0
- package/dist/{figure-frame-Dd-pOeZN.js → figure-frame-96zFqsWz.js} +22 -21
- package/dist/forms/dates.js +1 -1
- package/dist/{forms-Bjx7JQ30.js → forms-iAOjGRTO.js} +1 -1
- package/dist/forms.js +2 -2
- package/dist/{image-grid-Dpyqxgwy.js → image-grid-B6fdmE9c.js} +4 -4
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +15 -15
- package/dist/kits/interpretability.js +49 -45
- package/dist/kits/operations.js +81 -80
- package/dist/kits/research.js +776 -499
- package/dist/kits/training.js +108 -107
- package/dist/layout.js +1 -1
- package/dist/lesson.js +3 -3
- package/dist/markdown-JeuBeMDZ.js +293 -0
- package/dist/mdx.js +6 -6
- package/dist/navigation/commands.js +1 -1
- package/dist/{navigation-Cp3p0gss.js → navigation-CTnYtVD8.js} +1 -1
- package/dist/navigation.js +3 -3
- package/dist/packages/ai/src/index.d.ts +2 -0
- package/dist/packages/ai/src/message-reactions.d.ts +51 -0
- package/dist/packages/ai/src/message.d.ts +3 -1
- package/dist/packages/charts/src/plot/index.d.ts +2 -0
- package/dist/packages/charts/src/plot/plot-layout.d.ts +2 -2
- package/dist/packages/charts/src/plot/spatial-layer.d.ts +32 -0
- package/dist/packages/charts/src/plot/ticks.d.ts +2 -2
- package/dist/packages/collections/src/card-columns-model.d.ts +50 -0
- package/dist/packages/collections/src/card-columns.d.ts +30 -0
- package/dist/packages/collections/src/collection-page.d.ts +43 -0
- package/dist/packages/collections/src/column-card.d.ts +15 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +2 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +4 -3
- package/dist/packages/collections/src/data-table.d.ts +2 -2
- package/dist/packages/collections/src/index.d.ts +5 -0
- package/dist/packages/collections/src/table-query.d.ts +9 -1
- package/dist/packages/feedback/src/feedback.d.ts +0 -4
- package/dist/packages/feedback/src/index.d.ts +1 -1
- package/dist/packages/foundations/src/visible-motion.d.ts +1 -1
- package/dist/packages/kits/src/research/index.d.ts +7 -2
- package/dist/packages/kits/src/research/motion-clip.d.ts +41 -0
- package/dist/packages/kits/src/research/motion-error.d.ts +8 -0
- package/dist/packages/kits/src/research/motion-figure.d.ts +9 -0
- package/dist/packages/kits/src/research/motion-frame.d.ts +22 -0
- package/dist/packages/kits/src/research/motion-scene.d.ts +22 -0
- package/dist/packages/teaching/src/article/uncover.d.ts +2 -0
- package/dist/{param-CwT1RvUS.js → param-Dk92C-K1.js} +2 -2
- package/dist/{pierre-diff-DuvK3kLF.js → pierre-diff-DXVIwW7o.js} +1 -1
- package/dist/plot-CpTwLIYN.js +101 -0
- package/dist/{plot-layout-CvkeUuG6.js → plot-layout-1MG72ZWn.js} +175 -124
- package/dist/{plot-surface-yy37R4vs.js → plot-surface-8-FZI94y.js} +1 -1
- package/dist/{reference-lines-AMeDkYlo.js → reference-lines-C18o1yEY.js} +1 -1
- package/dist/{scene-BRhI8XSy.js → scene-B8dppj5V.js} +7 -7
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-BMOCaa8R.js → slope-chart-CELflRJd.js} +5 -5
- package/dist/{src-9n2M1V_y.js → src-BCAelv4f.js} +3 -3
- package/dist/{src-BgmAkau8.js → src-Bkov5TTa.js} +171 -164
- package/dist/{src-Bns-5joF.js → src-BsqbWDxS.js} +4 -4
- package/dist/{src-BdyO4PgQ.js → src-CIyuaSCi.js} +101 -107
- package/dist/{src-Tu6d_Pm8.js → src-Dc1t1ugL.js} +958 -585
- package/dist/{src-C5SH3jjU.js → src-DceyVyL0.js} +2 -2
- package/dist/{src-C_E29-DX.js → src-Dlh99sPD.js} +1 -1
- package/dist/styles2.css +33 -1
- package/dist/{time-series-CTNVqoUQ.js → time-series-DtAtGoT_.js} +9 -9
- package/dist/{timeline-DrsDtEIW.js → timeline-CzianQir.js} +5 -5
- package/dist/{token-heatmap-DddArdH8.js → token-heatmap-m6oaMwkK.js} +274 -289
- package/dist/{token-predictions-CBykmPID.js → token-predictions-CpGVjOIs.js} +4 -4
- package/dist/{transport-r1QgELf8.js → transport-DQ1yzsQl.js} +5 -5
- package/dist/{tree-diagram-BIJFK4pl.js → tree-diagram-D9ekymCQ.js} +5 -5
- package/dist/{treemap-DgmEw_mr.js → treemap-DT8q65LQ.js} +5 -5
- package/dist/{use-tween-BWf44Jy4.js → use-tween-DbXVZBR8.js} +1 -1
- package/dist/{violin-plot-BYJnv6sG.js → violin-plot-83HSjnQM.js} +4 -4
- package/dist/visible-motion-D6NwjGNz.js +24 -0
- package/dist/{waterfall-BNseqMas.js → waterfall-DmApvdrY.js} +5 -5
- package/package.json +1 -1
- package/recipes/recorded-motion.tsx +14 -0
- package/recipes/searchable-collection.tsx +74 -76
- package/skills/extend-elements/SKILL.md +2 -1
- package/skills/review-elements/SKILL.md +15 -7
- package/skills/review-explainer/SKILL.md +4 -0
- package/skills/upgrade-elements/SKILL.md +3 -1
- package/skills/upgrade-elements/references/releases.md +20 -0
- package/skills/use-elements/SKILL.md +10 -6
- package/skills/use-elements/references/collections.md +59 -12
- package/skills/use-elements/references/conversations.md +32 -0
- package/skills/use-elements/references/editorial-restraint.md +17 -29
- package/skills/use-elements/references/figures.md +6 -2
- package/skills/use-elements/references/kits.md +23 -0
- package/skills/use-elements/references/workspace.md +5 -5
- package/skills/write-explainer/SKILL.md +5 -0
- package/dist/figure-format-B8kRZMlo.js +0 -36
- package/dist/markdown--nfaDoR1.js +0 -313
- package/dist/packages/kits/src/research/collection-page.d.ts +0 -71
|
@@ -19,6 +19,38 @@ Compose `Conversation.Root`, `Viewport`, `Content` and one `Item` per message, w
|
|
|
19
19
|
end-aligned user messages. Render text with `Markdown` from `/content/markdown`. `MessageAction` is a named icon button
|
|
20
20
|
that shows on hover and focus. `ReplyIndicator` shows a supplied waiting label; remove it when real output arrives.
|
|
21
21
|
|
|
22
|
+
## Reactions
|
|
23
|
+
|
|
24
|
+
Pass `MessageReactions` to a `Message`'s `reactions` slot. Unlike `actions`, which appear on hover, reactions stay
|
|
25
|
+
visible.
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<Message
|
|
29
|
+
author="Ada Example"
|
|
30
|
+
reactions={
|
|
31
|
+
<MessageReactions
|
|
32
|
+
locale="en-US"
|
|
33
|
+
reactions={[{ emoji: '👍', name: 'Thumbs up', count: 3, isReacted: true }]}
|
|
34
|
+
choices={[
|
|
35
|
+
{ emoji: '👍', name: 'Thumbs up' },
|
|
36
|
+
{ emoji: '🎉', name: 'Party popper' },
|
|
37
|
+
]}
|
|
38
|
+
onReactionToggle={({ emoji, isReacted }) => requestReaction(messageId, emoji, isReacted)}
|
|
39
|
+
/>
|
|
40
|
+
}
|
|
41
|
+
>
|
|
42
|
+
Done.
|
|
43
|
+
</Message>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `reactions` holds only emoji with at least one person, in display order. Give each a `name` in words. A button is
|
|
47
|
+
named from it and the count, such as "Thumbs up, 3", and reports whether it is pressed.
|
|
48
|
+
- `choices` is the app's list of emoji for the add control. Elements ships no emoji data or picker. With no choices the
|
|
49
|
+
add control is left out.
|
|
50
|
+
- Both a chip and a menu choice call `onReactionToggle` with the emoji and the state the viewer asks for. Nothing
|
|
51
|
+
changes until the app supplies new `reactions`, so it owns counts, permission and failed writes. `isDisabled` keeps
|
|
52
|
+
counts visible and stops reacting.
|
|
53
|
+
|
|
22
54
|
## The prompt
|
|
23
55
|
|
|
24
56
|
`PromptInput` takes `value`, `onValueChange` and `onSubmit`. The app owns the draft, the request identity, the result
|
|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# One task per page
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lead with the action the reader came to take. A collection opens with its titled list. Link each record to its detail
|
|
4
|
+
route so people can copy the address, open another tab and return to their place. Give an independent investigation its
|
|
5
|
+
own destination. Keep a chart and its breakdown together when both answer the same question. A persistent inspector is
|
|
6
|
+
appropriate when the task requires simultaneous context, such as inspecting a trace while scrubbing it.
|
|
4
7
|
|
|
5
|
-
##
|
|
8
|
+
## Surfaces and copy
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
investigation its own route.
|
|
10
|
+
Use the collection directly in its working pane. Its heading and row dividers span both edges. The heading and cells own
|
|
11
|
+
their inner padding. Use a reading column for an article or form. Compare both outer edges and the first text position
|
|
12
|
+
independently before adding a wrapper.
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
Give each sentence a job. A label identifies a choice. A qualification identifies a material limit on the data. A
|
|
15
|
+
validation or access error explains what the user can do. Put optional methods and long identifiers in the detail view
|
|
16
|
+
or a named disclosure. Remove copy that narrates ordinary controls, repeats the heading or describes internal matching
|
|
17
|
+
rules. Chart descriptions can identify a non-obvious sample, split or source.
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
content in `PageInset`. Headers, tables and plots supply their own visual structure. Use a `Panel` for a unit that needs
|
|
16
|
-
its own boundary, such as a separate decision.
|
|
19
|
+
## Background updates
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
write UI instructions (`"Hover to inspect..."`, `"Click any cell..."`, `"Check rows to filter"`) or restate what the
|
|
22
|
-
title, axes, and legend already show (`"Dashed curve marks..."`, `"Higher is better..."`).
|
|
23
|
-
- Keep table rows scannable: concise single-line primary labels, short badge tokens, and tabular numbers. Put long prose
|
|
24
|
-
and raw metadata in the click-through inspector pane or drawer.
|
|
25
|
-
- Never show raw backend slugs (`w5_v3_d1536_t115...`) in primary labels; map them to short human labels and keep the
|
|
26
|
-
raw identifier in the inspector with `CopyValue`.
|
|
27
|
-
|
|
28
|
-
## Shell & collection Lego blocks
|
|
29
|
-
|
|
30
|
-
- **Area-forking rail:** Put top-level areas in `AppShell.rail` and Settings/account controls in `AppShell.railFooter`.
|
|
31
|
-
Swap `AppShell.sidebar` to show only the active area's pages—never duplicate every page on both the rail and sidebar.
|
|
32
|
-
- Keep successful background reads quiet. A pending explicit refresh belongs on the action the user pressed. Show
|
|
33
|
-
stale-data or failure feedback beside affected records with a useful recovery action.
|
|
34
|
-
- Use `CollectionPage` for a finite, locally searchable collection. Use a controlled `DataTable` when a server owns
|
|
35
|
-
paging, filtering or sorting. Searching only the loaded page gives incomplete results.
|
|
21
|
+
Keep a usable authorized collection in place during a refresh. An explicit refresh reports progress on its trigger. When
|
|
22
|
+
stale data matters to the task, expose its status and recovery on an existing stable control. Preserve a visible
|
|
23
|
+
recovery path for a failed initial read. A reconnect or status change must leave the row under the pointer in place.
|
|
@@ -78,7 +78,7 @@ The last bin has `"count": null`. The chart draws it hollow, not as zero.
|
|
|
78
78
|
## Check and draw it
|
|
79
79
|
|
|
80
80
|
```tsx
|
|
81
|
-
import {
|
|
81
|
+
import { Status } from '@mechane-ai/elements';
|
|
82
82
|
import { useState } from 'react';
|
|
83
83
|
|
|
84
84
|
function AgentFigure({ input }: { readonly input: unknown }) {
|
|
@@ -86,7 +86,11 @@ function AgentFigure({ input }: { readonly input: unknown }) {
|
|
|
86
86
|
const result = validateFigureSpec(input);
|
|
87
87
|
|
|
88
88
|
if (result.kind === 'invalid') {
|
|
89
|
-
return
|
|
89
|
+
return (
|
|
90
|
+
<Status tone="negative" role="alert">
|
|
91
|
+
{result.message}
|
|
92
|
+
</Status>
|
|
93
|
+
);
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
return <Figure spec={result.spec} selected={selected} onSelectedChange={(id) => setSelected(id)} />;
|
|
@@ -179,3 +179,26 @@ import { RunDashboard, RunTable } from '@mechane-ai/elements/kits/training';
|
|
|
179
179
|
/>
|
|
180
180
|
</>;
|
|
181
181
|
```
|
|
182
|
+
|
|
183
|
+
### Recorded motion
|
|
184
|
+
|
|
185
|
+
Use the `recorded-motion` recipe for spatial observations on one integer clock. Limit attachment bytes before reading
|
|
186
|
+
JSON. Call `parseMotionClip` once, catch invalid input at the read boundary and offer the original evidence. The reader
|
|
187
|
+
controls `tick` through `MotionFigure.onTickChange`. Key by clip identity when changing recordings. Keep playback local
|
|
188
|
+
unless a poster or essay needs the controlled `isPlaying` and `onPlayingChange` pair. Start paused until a reader asks
|
|
189
|
+
to play.
|
|
190
|
+
|
|
191
|
+
- Supply version 1, title, inclusive first and last ticks, hz, initial speed, and shared bounds in left, top, right,
|
|
192
|
+
bottom order. Y increases down the page. Supply one to eight labeled arms and a list of named moments with distinct
|
|
193
|
+
IDs, integer ticks and optional detail. Source metadata stays opaque.
|
|
194
|
+
- Within each arm, give tracks a stable ID, label, increasing `[tick, x, y]` points and inclusive end. Motion
|
|
195
|
+
interpolates between points and holds the final position until end. Split tracks at gaps or jumps. Use disjoint
|
|
196
|
+
segments of the same ID to resume. Metric `[tick, value]` pairs change exactly at the given tick. Supply measured
|
|
197
|
+
values separately from sampled motion. Regions take a label and bounds.
|
|
198
|
+
- Keep long clips sparse where motion is predictable. Preserve the exact observations behind the finding. The decoder
|
|
199
|
+
accepts up to one million samples across positions and metrics, 4096 segments per arm and 512 moments. Smaller focused
|
|
200
|
+
windows usually read better.
|
|
201
|
+
- Use `isInspecting` for actor coordinates and the latest moment. Optional track `notes` are increasing `[tick, text]`
|
|
202
|
+
pairs. Inspection shows the latest note at or before the selected tick. Use `isGuided` when adjacent prose already
|
|
203
|
+
offers the named jumps. It keeps a pair side by side. Use `MotionScene` at explicit ticks for stills and movies and
|
|
204
|
+
`motionSceneAt` for matching data. A position with `sampled: false` is an estimate.
|
|
@@ -23,11 +23,11 @@ centered prose or a form with a bounded line length. Keep a wide plot's horizont
|
|
|
23
23
|
both outer edges of each section header and table to the working pane at each viewport width. An inspector or drawer can
|
|
24
24
|
be its own working pane.
|
|
25
25
|
|
|
26
|
-
Use `CollectionPage` from `/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
Use `CollectionPage` from `/collections` for the primary list, or `CollectionSection` under a page heading. Search and
|
|
27
|
+
filters belong to the collection title row. The collection handles pending geometry, focus and query controls. The app
|
|
28
|
+
supplies the local or controlled query and the row's destination. For distinct reading or editing tasks use linked
|
|
29
|
+
routes. Use a `Workbench` when the reader needs simultaneous context, such as inspecting a trace while scrubbing its
|
|
30
|
+
timeline.
|
|
31
31
|
|
|
32
32
|
Use `SegmentedControl` from `/forms` to switch between a few views; one item is always checked. Use `ToggleGroup` for
|
|
33
33
|
independent pressed choices. Both size to their content. Put either beside an Elements field and select, compare their
|
|
@@ -82,6 +82,11 @@ Take the part from `explainerGuide` (in `@mechane-ai/elements/lesson/spec`), who
|
|
|
82
82
|
params through `sets`, which keeps them on their step grid and inside their range; do not round in a handler.
|
|
83
83
|
- **No `requestAnimationFrame`, timer or CSS keyframe for motion.** Change a part's props and it eases on the shared
|
|
84
84
|
clock, which also gives reduced motion its end state. Drive time with `Playback`.
|
|
85
|
+
- **For recorded motion, let prose guide the player until the reader takes over.** Give each `ScrollyStep` the observed
|
|
86
|
+
tick, for example `values={{ passage: moment.tick }}`. Feed `MotionFigure` from `@mechane-ai/elements/kits/research`
|
|
87
|
+
the lesson value `manual ? cursor : passage`. Play and drag set `manual` and update the cursor. Keep tracking the
|
|
88
|
+
passage while the reader explores. A passage button pauses and selects its tick. A “Follow the text” button pauses and
|
|
89
|
+
returns to the current passage.
|
|
85
90
|
- **No hand-placed SVG where a scene part exists.** Parts are inspectable, keyboard-reachable and themed. Draw what no
|
|
86
91
|
part draws with `SceneCustom`, which hands you the scene's scales and tones.
|
|
87
92
|
- **Stable ids name things, not slots.** The Queen of Hearts is `queen-hearts` in every state and figure, so it moves
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { formatNumber as e } from "@ui-sdk/core/number";
|
|
2
|
-
import { dateFormatter as t } from "@ui-sdk/core/date";
|
|
3
|
-
// packages/charts/src/figure/figure-format.ts
|
|
4
|
-
var n = "Unavailable";
|
|
5
|
-
function r({ value: t, locale: r, format: i }) {
|
|
6
|
-
return t === null || !Number.isFinite(t) ? n : e(t, r, i);
|
|
7
|
-
}
|
|
8
|
-
function i(e) {
|
|
9
|
-
return typeof e == "function" ? e : {
|
|
10
|
-
notation: "compact",
|
|
11
|
-
...e
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function a({ timestamp: e, locale: n, format: r }) {
|
|
15
|
-
return typeof r == "function" ? r(e) : t(n, r).format(e);
|
|
16
|
-
}
|
|
17
|
-
var o = {
|
|
18
|
-
hourCycle: "h23",
|
|
19
|
-
year: "numeric",
|
|
20
|
-
month: "numeric",
|
|
21
|
-
day: "numeric",
|
|
22
|
-
hour: "numeric",
|
|
23
|
-
minute: "numeric",
|
|
24
|
-
second: "numeric"
|
|
25
|
-
}, s = 1e3;
|
|
26
|
-
function c(e, n) {
|
|
27
|
-
let r = t("en-US", {
|
|
28
|
-
...o,
|
|
29
|
-
timeZone: n
|
|
30
|
-
}).formatToParts(e);
|
|
31
|
-
function i(e) {
|
|
32
|
-
return Number(r.find((t) => t.type === e)?.value);
|
|
33
|
-
}
|
|
34
|
-
return Date.UTC(i("year"), i("month") - 1, i("day"), i("hour"), i("minute"), i("second")) - Math.floor(e / s) * s;
|
|
35
|
-
}
|
|
36
|
-
export { c as a, i, a as n, r, n as t };
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./use-scroll-tab-index-Dxpdh4W7.js";
|
|
2
|
-
import { t } from "./code-block-BDRmjlES.js";
|
|
3
|
-
import { n, t as r } from "./content-link-DRaNf1mD.js";
|
|
4
|
-
import { t as i } from "./viewer-styles-DsFYri4K.js";
|
|
5
|
-
import * as a from "@stylexjs/stylex";
|
|
6
|
-
import { Children as o, createContext as s, createElement as c, memo as l, useContext as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
7
|
-
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
-
import { Block as v, Streamdown as y, defaultRehypePlugins as b, defaultRemarkPlugins as x, useIsCodeFenceIncomplete as S } from "streamdown";
|
|
9
|
-
// packages/foundations/src/visible-motion.ts
|
|
10
|
-
function C(e) {
|
|
11
|
-
let t = p(null), [n, r] = m(!1);
|
|
12
|
-
return d(() => {
|
|
13
|
-
let n = t.current;
|
|
14
|
-
if (!e || n === null) return;
|
|
15
|
-
let i = matchMedia("(prefers-reduced-motion: reduce)"), a = !1;
|
|
16
|
-
function o() {
|
|
17
|
-
r(a && !document.hidden && !i.matches);
|
|
18
|
-
}
|
|
19
|
-
let s = new IntersectionObserver((e) => {
|
|
20
|
-
a = e.some((e) => e.isIntersecting), o();
|
|
21
|
-
});
|
|
22
|
-
return s.observe(n), i.addEventListener("change", o), document.addEventListener("visibilitychange", o), () => {
|
|
23
|
-
s.disconnect(), i.removeEventListener("change", o), document.removeEventListener("visibilitychange", o);
|
|
24
|
-
};
|
|
25
|
-
}, [e]), {
|
|
26
|
-
ref: t,
|
|
27
|
-
isActive: e && n
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
// packages/content/src/markdown/markdown-options.ts
|
|
31
|
-
var w = /* @__PURE__ */ new Set(["href", "src"]), T = {
|
|
32
|
-
rehypePlugins: Object.entries(b).filter(([e]) => e === "sanitize").map(([, e]) => e),
|
|
33
|
-
remarkPlugins: Object.values(x),
|
|
34
|
-
skipHtml: !0,
|
|
35
|
-
urlTransform: (e, t) => {
|
|
36
|
-
if (w.has(t)) return n(e);
|
|
37
|
-
}
|
|
38
|
-
}, E = {
|
|
39
|
-
root: {
|
|
40
|
-
k7Eaqz: "xeuugli",
|
|
41
|
-
kMwMTN: "xbixft",
|
|
42
|
-
kMv6JI: "x1hz01jw",
|
|
43
|
-
khiITx: "xvmahel",
|
|
44
|
-
kGuDYH: "xtqrqnz",
|
|
45
|
-
kLWn49: "x1ytb0s6",
|
|
46
|
-
k63SB2: "xj57cvi",
|
|
47
|
-
kHjlTd: "xj0a0fe",
|
|
48
|
-
$$css: !0
|
|
49
|
-
},
|
|
50
|
-
block: {
|
|
51
|
-
keoZOQ: "xyrmp21 x14l7nz5",
|
|
52
|
-
k1K539: "x1jfksii xzboxd6",
|
|
53
|
-
$$css: !0
|
|
54
|
-
},
|
|
55
|
-
heading: {
|
|
56
|
-
keoZOQ: "x1m1vpj6 x14l7nz5",
|
|
57
|
-
k1K539: "x1jfksii xzboxd6",
|
|
58
|
-
k63SB2: "x1b5ytql",
|
|
59
|
-
$$css: !0
|
|
60
|
-
},
|
|
61
|
-
title: {
|
|
62
|
-
kGuDYH: "x1i2cqwi",
|
|
63
|
-
kLWn49: "x4fansv",
|
|
64
|
-
$$css: !0
|
|
65
|
-
},
|
|
66
|
-
section: {
|
|
67
|
-
kGuDYH: "x12myhf4",
|
|
68
|
-
kLWn49: "x1778rvt",
|
|
69
|
-
$$css: !0
|
|
70
|
-
},
|
|
71
|
-
minor: {
|
|
72
|
-
kGuDYH: "xtqrqnz",
|
|
73
|
-
kLWn49: "x1778rvt",
|
|
74
|
-
$$css: !0
|
|
75
|
-
},
|
|
76
|
-
tableRegion: {
|
|
77
|
-
k7Eaqz: "xeuugli",
|
|
78
|
-
ks0D6T: "x193iq5w",
|
|
79
|
-
kXHlph: "xw2csxc",
|
|
80
|
-
kMzoRj: "xmkeg23",
|
|
81
|
-
kt9PQ7: "x1qhh985",
|
|
82
|
-
ksu8eU: "x1y0btm7",
|
|
83
|
-
kVAM5u: "x1ey3b81",
|
|
84
|
-
$$css: !0
|
|
85
|
-
},
|
|
86
|
-
strong: {
|
|
87
|
-
k63SB2: "x1b5ytql",
|
|
88
|
-
$$css: !0
|
|
89
|
-
},
|
|
90
|
-
muted: {
|
|
91
|
-
kMwMTN: "x153jb6y",
|
|
92
|
-
$$css: !0
|
|
93
|
-
}
|
|
94
|
-
}, D = {
|
|
95
|
-
default: null,
|
|
96
|
-
muted: E.muted
|
|
97
|
-
}, O = {
|
|
98
|
-
regular: null,
|
|
99
|
-
strong: E.strong
|
|
100
|
-
}, k = s(1), A = {
|
|
101
|
-
animation: "fadeIn",
|
|
102
|
-
duration: 160,
|
|
103
|
-
stagger: 14,
|
|
104
|
-
maxBacklogMs: 100
|
|
105
|
-
}, j = /* @__PURE__ */ new Set(["string", "number"]);
|
|
106
|
-
function M(e) {
|
|
107
|
-
return j.has(typeof e);
|
|
108
|
-
}
|
|
109
|
-
function N({ children: e, className: n }) {
|
|
110
|
-
let r = S(), i = typeof n == "string" ? /(?:^|\s)language-([^\s]+)/u.exec(n) : null, a = i === null ? void 0 : i[1], s = o.toArray(e);
|
|
111
|
-
return s.every(M) ? /* @__PURE__ */ g("div", {
|
|
112
|
-
className: "xyrmp21 x14l7nz5 x1jfksii xzboxd6",
|
|
113
|
-
children: /* @__PURE__ */ g(t, {
|
|
114
|
-
code: s.join(""),
|
|
115
|
-
language: a,
|
|
116
|
-
isStreaming: r
|
|
117
|
-
})
|
|
118
|
-
}) : /* @__PURE__ */ g("code", {
|
|
119
|
-
className: "xiard35 xy8obcc x1r7kqkb x1ok0vyi x10dazmo x14w6jbu x17etxam",
|
|
120
|
-
children: e
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
function P({ level: e, children: t, id: n }) {
|
|
124
|
-
let r = u(k), i = `h${Math.min(e + r - 1, 6)}`, o = e === 1 ? E.title : e === 2 ? E.section : E.minor;
|
|
125
|
-
return c(i, {
|
|
126
|
-
id: n,
|
|
127
|
-
...a.props(E.heading, o)
|
|
128
|
-
}, t);
|
|
129
|
-
}
|
|
130
|
-
function F({ children: t }) {
|
|
131
|
-
let n = e();
|
|
132
|
-
return /* @__PURE__ */ g("div", {
|
|
133
|
-
ref: n.ref,
|
|
134
|
-
role: "region",
|
|
135
|
-
"aria-label": "Markdown table",
|
|
136
|
-
tabIndex: n.tabIndex,
|
|
137
|
-
...a.props(i.scrollRegion, E.block, E.tableRegion),
|
|
138
|
-
children: /* @__PURE__ */ g("table", {
|
|
139
|
-
className: "xh8yej3 x1mwwwfo xss6m8b x1yc453h x1h4wwuj x1778rvt",
|
|
140
|
-
children: t
|
|
141
|
-
})
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
var I = s(void 0);
|
|
145
|
-
function L(e) {
|
|
146
|
-
let t = u(I);
|
|
147
|
-
return t === void 0 ? /* @__PURE__ */ g(r, {
|
|
148
|
-
href: e.href,
|
|
149
|
-
title: e.title,
|
|
150
|
-
children: e.children
|
|
151
|
-
}) : t(e);
|
|
152
|
-
}
|
|
153
|
-
var R = {
|
|
154
|
-
h1: (e) => /* @__PURE__ */ g(P, {
|
|
155
|
-
...e,
|
|
156
|
-
level: 1
|
|
157
|
-
}),
|
|
158
|
-
h2: (e) => /* @__PURE__ */ g(P, {
|
|
159
|
-
...e,
|
|
160
|
-
level: 2
|
|
161
|
-
}),
|
|
162
|
-
h3: (e) => /* @__PURE__ */ g(P, {
|
|
163
|
-
...e,
|
|
164
|
-
level: 3
|
|
165
|
-
}),
|
|
166
|
-
h4: (e) => /* @__PURE__ */ g(P, {
|
|
167
|
-
...e,
|
|
168
|
-
level: 4
|
|
169
|
-
}),
|
|
170
|
-
h5: (e) => /* @__PURE__ */ g(P, {
|
|
171
|
-
...e,
|
|
172
|
-
level: 5
|
|
173
|
-
}),
|
|
174
|
-
h6: (e) => /* @__PURE__ */ g(P, {
|
|
175
|
-
...e,
|
|
176
|
-
level: 6
|
|
177
|
-
}),
|
|
178
|
-
p: ({ children: e }) => /* @__PURE__ */ g("p", {
|
|
179
|
-
className: "xyrmp21 x14l7nz5 x1jfksii xzboxd6",
|
|
180
|
-
children: e
|
|
181
|
-
}),
|
|
182
|
-
ul: ({ children: e }) => /* @__PURE__ */ g("ul", {
|
|
183
|
-
className: "xyrmp21 x14l7nz5 x1jfksii xzboxd6 x1sbza1b",
|
|
184
|
-
children: e
|
|
185
|
-
}),
|
|
186
|
-
ol: ({ children: e, start: t }) => /* @__PURE__ */ g("ol", {
|
|
187
|
-
start: t,
|
|
188
|
-
className: "xyrmp21 x14l7nz5 x1jfksii xzboxd6 x1sbza1b",
|
|
189
|
-
children: e
|
|
190
|
-
}),
|
|
191
|
-
li: ({ children: e }) => /* @__PURE__ */ g("li", {
|
|
192
|
-
className: "x1vblts3 xnkn1qj",
|
|
193
|
-
children: e
|
|
194
|
-
}),
|
|
195
|
-
blockquote: ({ children: e }) => /* @__PURE__ */ g("blockquote", {
|
|
196
|
-
className: "xyrmp21 x14l7nz5 x1jfksii xzboxd6 xrxpjvj x1umj4g3 xyumdvf x1t7ytsu x97x49r x153jb6y",
|
|
197
|
-
children: e
|
|
198
|
-
}),
|
|
199
|
-
code: ({ children: e, className: t }) => /* @__PURE__ */ g(N, {
|
|
200
|
-
className: t,
|
|
201
|
-
children: e
|
|
202
|
-
}),
|
|
203
|
-
inlineCode: ({ children: e }) => /* @__PURE__ */ g("code", {
|
|
204
|
-
className: "xiard35 xy8obcc x1r7kqkb x1ok0vyi x10dazmo x14w6jbu x17etxam",
|
|
205
|
-
children: e
|
|
206
|
-
}),
|
|
207
|
-
a: ({ href: e, children: t, title: n }) => /* @__PURE__ */ g(L, {
|
|
208
|
-
kind: "link",
|
|
209
|
-
href: e,
|
|
210
|
-
title: n,
|
|
211
|
-
children: t
|
|
212
|
-
}),
|
|
213
|
-
img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */ g(L, {
|
|
214
|
-
kind: "image",
|
|
215
|
-
href: typeof e == "string" ? e : void 0,
|
|
216
|
-
title: n,
|
|
217
|
-
children: t !== void 0 && t.length > 0 ? `Open image: ${t}` : "Open image"
|
|
218
|
-
}),
|
|
219
|
-
table: ({ children: e }) => /* @__PURE__ */ g(F, { children: e }),
|
|
220
|
-
thead: ({ children: e }) => /* @__PURE__ */ g("thead", { children: e }),
|
|
221
|
-
tbody: ({ children: e }) => /* @__PURE__ */ g("tbody", { children: e }),
|
|
222
|
-
tr: ({ children: e }) => /* @__PURE__ */ g("tr", { children: e }),
|
|
223
|
-
th: ({ children: e }) => /* @__PURE__ */ g("th", {
|
|
224
|
-
scope: "col",
|
|
225
|
-
className: "xn9t2bk x1doqdfy xso031l x1q0q8m5 x1qndepd x16dsc37 x1yc453h x153jb6y xk4h15q x1r7kqkb",
|
|
226
|
-
children: e
|
|
227
|
-
}),
|
|
228
|
-
td: ({ children: e }) => /* @__PURE__ */ g("td", {
|
|
229
|
-
className: "xn9t2bk x1doqdfy xso031l x1q0q8m5 x1qndepd x16dsc37 x1yc453h",
|
|
230
|
-
children: e
|
|
231
|
-
}),
|
|
232
|
-
input: ({ checked: e }) => /* @__PURE__ */ g("input", {
|
|
233
|
-
type: "checkbox",
|
|
234
|
-
checked: e ?? !1,
|
|
235
|
-
disabled: !0,
|
|
236
|
-
"aria-label": "Task item",
|
|
237
|
-
className: "x1bzlxqo x6e7ywc"
|
|
238
|
-
}),
|
|
239
|
-
hr: () => /* @__PURE__ */ g("hr", { className: "xhff0hu xc342km x178xt8z x13fuv20 xhjagg4" }),
|
|
240
|
-
strong: ({ children: e }) => /* @__PURE__ */ g("strong", {
|
|
241
|
-
className: "x1b5ytql",
|
|
242
|
-
children: e
|
|
243
|
-
}),
|
|
244
|
-
em: ({ children: e }) => /* @__PURE__ */ g("em", {
|
|
245
|
-
className: "x1k4tb9n",
|
|
246
|
-
children: e
|
|
247
|
-
}),
|
|
248
|
-
del: ({ children: e }) => /* @__PURE__ */ g("del", {
|
|
249
|
-
className: "x5lhwog",
|
|
250
|
-
children: e
|
|
251
|
-
})
|
|
252
|
-
}, z = /* @__PURE__ */ "p.span.h1.h2.h3.h4.h5.h6.ul.ol.li.blockquote.pre.code.a.img.table.thead.tbody.tr.th.td.input.hr.strong.em.del.br.sup.sub.section".split("."), B = l(({ children: e, isStreaming: t = !1, label: n, headingLevel: r = 1, tone: i = "default", weight: o = "regular", renderLink: s, remarkPlugins: c }) => {
|
|
253
|
-
let { ref: l, isActive: u } = C(t), d = f(() => [...T.remarkPlugins ?? [], ...c ?? []], [c]);
|
|
254
|
-
return /* @__PURE__ */ g(I, {
|
|
255
|
-
value: s,
|
|
256
|
-
children: /* @__PURE__ */ g(k, {
|
|
257
|
-
value: r,
|
|
258
|
-
children: /* @__PURE__ */ g("div", {
|
|
259
|
-
ref: l,
|
|
260
|
-
"data-streamdown-paused": t && !u ? "" : void 0,
|
|
261
|
-
children: /* @__PURE__ */ g(y, {
|
|
262
|
-
...T,
|
|
263
|
-
remarkPlugins: d,
|
|
264
|
-
...a.props(E.root, D[i], O[o]),
|
|
265
|
-
"aria-label": n,
|
|
266
|
-
components: R,
|
|
267
|
-
mode: t ? "streaming" : "static",
|
|
268
|
-
isAnimating: t,
|
|
269
|
-
animated: t ? A : !1,
|
|
270
|
-
controls: !1,
|
|
271
|
-
linkSafety: { enabled: !1 },
|
|
272
|
-
allowedElements: z,
|
|
273
|
-
children: e
|
|
274
|
-
})
|
|
275
|
-
})
|
|
276
|
-
})
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
// packages/content/src/markdown/markdown-preview.tsx
|
|
280
|
-
function V({ children: e }) {
|
|
281
|
-
return /* @__PURE__ */ _(h, { children: [e, " "] });
|
|
282
|
-
}
|
|
283
|
-
var H = {
|
|
284
|
-
p: V,
|
|
285
|
-
li: V,
|
|
286
|
-
h1: V,
|
|
287
|
-
h2: V,
|
|
288
|
-
h3: V,
|
|
289
|
-
h4: V,
|
|
290
|
-
h5: V,
|
|
291
|
-
h6: V,
|
|
292
|
-
blockquote: V,
|
|
293
|
-
pre: V,
|
|
294
|
-
code: ({ children: e }) => /* @__PURE__ */ g(h, { children: e }),
|
|
295
|
-
th: V,
|
|
296
|
-
td: V,
|
|
297
|
-
br: () => /* @__PURE__ */ g(h, { children: " " }),
|
|
298
|
-
img: ({ alt: e }) => /* @__PURE__ */ g(h, { children: e })
|
|
299
|
-
};
|
|
300
|
-
function U({ children: e }) {
|
|
301
|
-
return /* @__PURE__ */ g(v, {
|
|
302
|
-
...T,
|
|
303
|
-
content: e,
|
|
304
|
-
components: H,
|
|
305
|
-
allowedElements: Object.keys(H),
|
|
306
|
-
unwrapDisallowed: !0,
|
|
307
|
-
shouldParseIncompleteMarkdown: !1,
|
|
308
|
-
shouldNormalizeHtmlIndentation: !1,
|
|
309
|
-
isIncomplete: !1,
|
|
310
|
-
index: 0
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
export { B as n, C as r, U as t };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
-
import type { DataTableColumn, DataTableRowAction, DataTableSort, DataTableSortDetails, LocalTableQuery } from '../../../collections/src/index.ts';
|
|
3
|
-
import { PageLayout } from '../../../layout/src/index.ts';
|
|
4
|
-
export type CollectionStatus = 'loading' | 'ready' | 'failed';
|
|
5
|
-
/** A named scope partition shown as a segmented switcher in the collection header with live item counts. */
|
|
6
|
-
export type CollectionScope<Row> = {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly label: string;
|
|
9
|
-
readonly match: (row: Row) => boolean;
|
|
10
|
-
};
|
|
11
|
-
type SortableColumns<Row> = {
|
|
12
|
-
readonly columns: ReadonlyArray<DataTableColumn<Row>>;
|
|
13
|
-
readonly sort: DataTableSort | undefined;
|
|
14
|
-
readonly onSortChange: (sort: DataTableSort | undefined, details: DataTableSortDetails) => void;
|
|
15
|
-
} | {
|
|
16
|
-
readonly columns: ReadonlyArray<DataTableColumn<Row> & {
|
|
17
|
-
readonly canSort?: false;
|
|
18
|
-
}>;
|
|
19
|
-
readonly sort?: never;
|
|
20
|
-
readonly onSortChange?: never;
|
|
21
|
-
};
|
|
22
|
-
type SharedCollectionProps<Row extends object> = SortableColumns<Row> & {
|
|
23
|
-
readonly title: string;
|
|
24
|
-
readonly caption?: string;
|
|
25
|
-
readonly rows: ReadonlyArray<Row>;
|
|
26
|
-
readonly getRowId: (row: Row) => string;
|
|
27
|
-
/** Local full-text search accessor, or an explicit exception reason when search is omitted. */
|
|
28
|
-
readonly search: LocalTableQuery<Row>['search'];
|
|
29
|
-
/** Local filter dimensions rendered in the top toolbar filter menu, or an explicit exception reason. */
|
|
30
|
-
readonly filters: LocalTableQuery<Row>['filters'];
|
|
31
|
-
/** Optional custom row transformer (e.g. sorting) applied after local search and filtering. */
|
|
32
|
-
readonly transformRows?: (rows: ReadonlyArray<Row>) => ReadonlyArray<Row>;
|
|
33
|
-
/** Optional segmented scopes (e.g. Active / All) that partition rows before local search and filtering. */
|
|
34
|
-
readonly scopes?: ReadonlyArray<CollectionScope<Row>> | undefined;
|
|
35
|
-
readonly defaultScopeId?: string | undefined;
|
|
36
|
-
readonly actions?: ReactNode;
|
|
37
|
-
readonly notice?: ReactNode;
|
|
38
|
-
readonly rowAction?: DataTableRowAction<Row> | undefined;
|
|
39
|
-
readonly activeRowId?: string | undefined;
|
|
40
|
-
readonly rowSizing?: 'fixed' | 'content' | undefined;
|
|
41
|
-
readonly empty: ReactNode;
|
|
42
|
-
readonly filteredEmpty?: ReactNode;
|
|
43
|
-
/** Read lifecycle state: `'loading'` reserves geometry with `DataTablePlaceholder` inside `AsyncRegion`. */
|
|
44
|
-
readonly status?: CollectionStatus;
|
|
45
|
-
readonly failure?: ReactNode;
|
|
46
|
-
readonly placeholderRows?: number;
|
|
47
|
-
};
|
|
48
|
-
export type CollectionPageProps<Row extends object> = SharedCollectionProps<Row> & {
|
|
49
|
-
readonly navigation?: ComponentProps<typeof PageLayout>['navigation'];
|
|
50
|
-
/** Optional right-hand inspector pane rendered inside a resizable Workbench split when open. */
|
|
51
|
-
readonly inspector?: {
|
|
52
|
-
readonly label: string;
|
|
53
|
-
readonly content: ReactNode;
|
|
54
|
-
} | undefined;
|
|
55
|
-
};
|
|
56
|
-
export type CollectionSectionProps<Row extends object> = SharedCollectionProps<Row> & {
|
|
57
|
-
readonly id?: string;
|
|
58
|
-
readonly meta?: ReactNode;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Full-width collection page Lego block: wires `PageLayout`, top-bar search and filter controls (`/` and `⌘F`), active
|
|
62
|
-
* filter chips, `AsyncRegion` + `DataTablePlaceholder` loading states, edge-to-edge `CollectionLayout`, and an optional
|
|
63
|
-
* resizable `Workbench` inspector.
|
|
64
|
-
*/
|
|
65
|
-
export declare function CollectionPage<Row extends object>(props: CollectionPageProps<Row>): ReactNode;
|
|
66
|
-
/**
|
|
67
|
-
* Full-width collection section for tabbed or multi-section views. Wires `SectionHeading`, top-bar search and filters,
|
|
68
|
-
* active filter chips, `AsyncRegion` loading placeholders, and edge-to-edge `DataTable`.
|
|
69
|
-
*/
|
|
70
|
-
export declare function CollectionSection<Row extends object>(props: CollectionSectionProps<Row>): ReactNode;
|
|
71
|
-
export {};
|