strata-react 1.3.24 → 1.3.26
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 +1 -1
- package/UPGRADING.md +7 -0
- package/dist/{api-types/cli.d.ts → api-types-cli.d.ts} +1 -0
- package/dist/api-types-cli.js +4 -3
- package/dist/api-types-cli.js.map +1 -1
- package/dist/{api-types/generate.d.ts → api-types.d.ts} +3 -3
- package/dist/api-types.js +3 -1
- package/dist/{button-KGJI6jQr.js → button-CYXjU-fs.js} +8 -5
- package/dist/button-CYXjU-fs.js.map +1 -0
- package/dist/{cursor-DDGBPiTJ.js → cursor-Cwyvgwsw.js} +9 -7
- package/dist/cursor-Cwyvgwsw.js.map +1 -0
- package/dist/{errors-BUvY1Z4d.js → errors-CmuwcWlb.js} +6 -6
- package/dist/{errors-BUvY1Z4d.js.map → errors-CmuwcWlb.js.map} +1 -1
- package/dist/{field-BjeE_FeB.js → field-DBCsFIng.js} +27 -23
- package/dist/field-DBCsFIng.js.map +1 -0
- package/dist/follow-CXQsL86O.js +16 -0
- package/dist/follow-CXQsL86O.js.map +1 -0
- package/dist/{generate-CjTHKJ39.js → generate-BkWhh4k4.js} +8 -6
- package/dist/generate-BkWhh4k4.js.map +1 -0
- package/dist/{lib/geo.d.ts → geo-DfKa9JtK.d.ts} +35 -33
- package/dist/{hls/index.d.ts → hls.d.ts} +13 -12
- package/dist/hls.js +5 -4
- package/dist/hls.js.map +1 -1
- package/dist/index.d.ts +5300 -140
- package/dist/index.js +363 -224
- package/dist/index.js.map +1 -1
- package/dist/map.d.ts +184 -0
- package/dist/map.js +21 -17
- package/dist/map.js.map +1 -1
- package/dist/media-player-BETa3P7K.d.ts +758 -0
- package/dist/{microphone-Bo3WaXgD.js → microphone-76skMt6i.js} +41 -30
- package/dist/microphone-76skMt6i.js.map +1 -0
- package/dist/microphone-DDOnQHxf.d.ts +237 -0
- package/dist/{migrate/cli.d.ts → migrate-cli.d.ts} +1 -0
- package/dist/migrate-cli.js +8 -6
- package/dist/migrate-cli.js.map +1 -1
- package/dist/panorama.d.ts +102 -0
- package/dist/panorama.js +54 -109
- package/dist/panorama.js.map +1 -1
- package/dist/{run-BT2WKzMz.js → run-D_Ic1jE7.js} +23 -16
- package/dist/run-D_Ic1jE7.js.map +1 -0
- package/dist/scene.d.ts +147 -0
- package/dist/scene.js +74 -77
- package/dist/scene.js.map +1 -1
- package/dist/testing.d.ts +468 -0
- package/dist/testing.js +11 -3
- package/dist/testing.js.map +1 -1
- package/dist/{theme-CxYZkUNk.js → theme-1oOSMj_D.js} +19 -17
- package/dist/theme-1oOSMj_D.js.map +1 -0
- package/dist/{tooltip-DhqrDtyu.js → tooltip-BosfsWYh.js} +9 -6
- package/dist/tooltip-BosfsWYh.js.map +1 -0
- package/dist/types-B3TsF0Ey.d.ts +241 -0
- package/dist/{value-controls-Dm_EYfZW.js → value-controls-5u7sD_wG.js} +22 -17
- package/dist/value-controls-5u7sD_wG.js.map +1 -0
- package/dist/viewer-input-3Qa-o35k.js +108 -0
- package/dist/viewer-input-3Qa-o35k.js.map +1 -0
- package/dist/{visual/cli.d.ts → visual-cli.d.ts} +2 -1
- package/dist/visual-cli.js +5 -4
- package/dist/visual-cli.js.map +1 -1
- package/dist/visual.d.ts +105 -0
- package/dist/visual.js +4 -3
- package/dist/visual.js.map +1 -1
- package/package.json +24 -19
- package/dist/api-types/index.d.ts +0 -1
- package/dist/button-KGJI6jQr.js.map +0 -1
- package/dist/components/active-list.d.ts +0 -46
- package/dist/components/alert.d.ts +0 -17
- package/dist/components/app-shell.d.ts +0 -32
- package/dist/components/async-button.d.ts +0 -48
- package/dist/components/auto-recorder.d.ts +0 -67
- package/dist/components/book-viewer.d.ts +0 -50
- package/dist/components/box-overlay.d.ts +0 -44
- package/dist/components/boxed-picture.d.ts +0 -34
- package/dist/components/button.d.ts +0 -45
- package/dist/components/byte-view.d.ts +0 -32
- package/dist/components/checkbox.d.ts +0 -39
- package/dist/components/choice-grid.d.ts +0 -42
- package/dist/components/commands.d.ts +0 -104
- package/dist/components/compare-audio.d.ts +0 -30
- package/dist/components/compare-grid.d.ts +0 -24
- package/dist/components/compare-parts.d.ts +0 -90
- package/dist/components/compare-regions.d.ts +0 -37
- package/dist/components/compare-text.d.ts +0 -32
- package/dist/components/compare-video-grid.d.ts +0 -52
- package/dist/components/compare-video.d.ts +0 -61
- package/dist/components/compare.d.ts +0 -90
- package/dist/components/composition.d.ts +0 -44
- package/dist/components/console.d.ts +0 -34
- package/dist/components/conversation.d.ts +0 -83
- package/dist/components/cursor.d.ts +0 -44
- package/dist/components/data-table.d.ts +0 -89
- package/dist/components/data-view.d.ts +0 -66
- package/dist/components/density.d.ts +0 -16
- package/dist/components/dialog.d.ts +0 -45
- package/dist/components/difference.d.ts +0 -19
- package/dist/components/disclosure.d.ts +0 -49
- package/dist/components/done.d.ts +0 -14
- package/dist/components/drag-source.d.ts +0 -29
- package/dist/components/field.d.ts +0 -79
- package/dist/components/file-intake.d.ts +0 -60
- package/dist/components/film-strip.d.ts +0 -35
- package/dist/components/folder-picker.d.ts +0 -59
- package/dist/components/fullscreen-frame.d.ts +0 -18
- package/dist/components/history.d.ts +0 -61
- package/dist/components/hotkeys.d.ts +0 -44
- package/dist/components/infinite-list.d.ts +0 -77
- package/dist/components/inspector.d.ts +0 -66
- package/dist/components/job-action.d.ts +0 -30
- package/dist/components/job-status.d.ts +0 -55
- package/dist/components/jobs-table.d.ts +0 -35
- package/dist/components/key-glyphs.d.ts +0 -5
- package/dist/components/key-owner.d.ts +0 -11
- package/dist/components/lightbox.d.ts +0 -61
- package/dist/components/line-chart.d.ts +0 -169
- package/dist/components/link-card.d.ts +0 -32
- package/dist/components/link.d.ts +0 -54
- package/dist/components/markable-text.d.ts +0 -60
- package/dist/components/media-contents.d.ts +0 -28
- package/dist/components/media-group.d.ts +0 -32
- package/dist/components/media-player.d.ts +0 -251
- package/dist/components/media-progress.d.ts +0 -17
- package/dist/components/media-skip.d.ts +0 -31
- package/dist/components/media-spans.d.ts +0 -93
- package/dist/components/media.d.ts +0 -133
- package/dist/components/meter.d.ts +0 -32
- package/dist/components/metric.d.ts +0 -17
- package/dist/components/outbox-status.d.ts +0 -10
- package/dist/components/page-header.d.ts +0 -14
- package/dist/components/pair-vote.d.ts +0 -70
- package/dist/components/pause-button.d.ts +0 -7
- package/dist/components/pixel-image.d.ts +0 -29
- package/dist/components/place-board.d.ts +0 -39
- package/dist/components/player-warning.d.ts +0 -24
- package/dist/components/popover.d.ts +0 -20
- package/dist/components/recorder.d.ts +0 -73
- package/dist/components/region-editor.d.ts +0 -67
- package/dist/components/save.d.ts +0 -46
- package/dist/components/say-again.d.ts +0 -13
- package/dist/components/schedule-table.d.ts +0 -24
- package/dist/components/secret-field.d.ts +0 -34
- package/dist/components/selectable-grid.d.ts +0 -57
- package/dist/components/selection.d.ts +0 -104
- package/dist/components/sequence-timeline.d.ts +0 -50
- package/dist/components/shortcut-editor.d.ts +0 -44
- package/dist/components/sortable-list.d.ts +0 -39
- package/dist/components/status.d.ts +0 -9
- package/dist/components/switch.d.ts +0 -15
- package/dist/components/system-panel.d.ts +0 -58
- package/dist/components/tabs.d.ts +0 -16
- package/dist/components/theme.d.ts +0 -106
- package/dist/components/thumbnail.d.ts +0 -50
- package/dist/components/tile-grid.d.ts +0 -67
- package/dist/components/timeline-player.d.ts +0 -18
- package/dist/components/timeline.d.ts +0 -115
- package/dist/components/toast.d.ts +0 -36
- package/dist/components/toggle.d.ts +0 -51
- package/dist/components/toolbar.d.ts +0 -15
- package/dist/components/tooltip.d.ts +0 -19
- package/dist/components/transcript-view.d.ts +0 -63
- package/dist/components/tree.d.ts +0 -74
- package/dist/components/undo.d.ts +0 -63
- package/dist/components/use-timeline.d.ts +0 -44
- package/dist/components/value-controls.d.ts +0 -91
- package/dist/components/video-clock.d.ts +0 -68
- package/dist/components/view-options.d.ts +0 -105
- package/dist/components/viewport.d.ts +0 -85
- package/dist/components/virtual-list.d.ts +0 -19
- package/dist/components/waveform.d.ts +0 -71
- package/dist/components/workflow-steps.d.ts +0 -71
- package/dist/components/workspace.d.ts +0 -83
- package/dist/cursor-DDGBPiTJ.js.map +0 -1
- package/dist/field-BjeE_FeB.js.map +0 -1
- package/dist/generate-CjTHKJ39.js.map +0 -1
- package/dist/lib/base.d.ts +0 -10
- package/dist/lib/book.d.ts +0 -25
- package/dist/lib/boxes.d.ts +0 -55
- package/dist/lib/breakpoint.d.ts +0 -4
- package/dist/lib/choice.d.ts +0 -29
- package/dist/lib/chords.d.ts +0 -20
- package/dist/lib/client-work.d.ts +0 -24
- package/dist/lib/control.d.ts +0 -4
- package/dist/lib/dev.d.ts +0 -2
- package/dist/lib/errors.d.ts +0 -43
- package/dist/lib/file-intake.d.ts +0 -60
- package/dist/lib/format.d.ts +0 -243
- package/dist/lib/grouped-grid-layout.d.ts +0 -44
- package/dist/lib/icon.d.ts +0 -6
- package/dist/lib/image-diff.d.ts +0 -30
- package/dist/lib/in-view.d.ts +0 -21
- package/dist/lib/loudness.d.ts +0 -18
- package/dist/lib/marks.d.ts +0 -6
- package/dist/lib/microphone.d.ts +0 -24
- package/dist/lib/number-input.d.ts +0 -4
- package/dist/lib/object-url.d.ts +0 -2
- package/dist/lib/overlay.d.ts +0 -1
- package/dist/lib/recording.d.ts +0 -16
- package/dist/lib/region.d.ts +0 -64
- package/dist/lib/rich-text.d.ts +0 -44
- package/dist/lib/search-param.d.ts +0 -16
- package/dist/lib/segmenter.d.ts +0 -40
- package/dist/lib/sequence.d.ts +0 -34
- package/dist/lib/speech.d.ts +0 -53
- package/dist/lib/text-diff.d.ts +0 -16
- package/dist/lib/timeline.d.ts +0 -14
- package/dist/lib/transcript.d.ts +0 -53
- package/dist/lib/utils.d.ts +0 -4
- package/dist/lib/viewport.d.ts +0 -55
- package/dist/lib/waveform.d.ts +0 -46
- package/dist/map/fan.d.ts +0 -15
- package/dist/map/index.d.ts +0 -3
- package/dist/map/map-styles.d.ts +0 -2
- package/dist/map/markers.d.ts +0 -60
- package/dist/map/route-map.d.ts +0 -146
- package/dist/microphone-Bo3WaXgD.js.map +0 -1
- package/dist/migrate/stock-classes.d.ts +0 -11
- package/dist/panorama/gl.d.ts +0 -16
- package/dist/panorama/index.d.ts +0 -2
- package/dist/panorama/panorama-viewer.d.ts +0 -56
- package/dist/panorama/projection.d.ts +0 -45
- package/dist/query/api.d.ts +0 -23
- package/dist/query/clips.d.ts +0 -48
- package/dist/query/index.d.ts +0 -55
- package/dist/query/infinite.d.ts +0 -60
- package/dist/query/job.d.ts +0 -26
- package/dist/query/outbox.d.ts +0 -85
- package/dist/query/poll.d.ts +0 -24
- package/dist/query/reserve.d.ts +0 -33
- package/dist/query/typed-api.d.ts +0 -84
- package/dist/query/workflow.d.ts +0 -17
- package/dist/run-BT2WKzMz.js.map +0 -1
- package/dist/scene/camera.d.ts +0 -74
- package/dist/scene/index.d.ts +0 -2
- package/dist/scene/scene-viewport.d.ts +0 -48
- package/dist/testing/buttons.d.ts +0 -7
- package/dist/testing/index.d.ts +0 -161
- package/dist/testing/intersection-observer.d.ts +0 -34
- package/dist/testing/layout.d.ts +0 -13
- package/dist/testing/microphone.d.ts +0 -35
- package/dist/testing/setup.d.ts +0 -14
- package/dist/testing/speech.d.ts +0 -38
- package/dist/testing/storage.d.ts +0 -7
- package/dist/theme-CxYZkUNk.js.map +0 -1
- package/dist/tooltip-DhqrDtyu.js.map +0 -1
- package/dist/value-controls-Dm_EYfZW.js.map +0 -1
- package/dist/visual/capture.d.ts +0 -37
- package/dist/visual/compare.d.ts +0 -46
- package/dist/visual/drop.d.ts +0 -19
- package/dist/visual/fonts.d.ts +0 -18
- package/dist/visual/index.d.ts +0 -19
- package/dist/visual/run.d.ts +0 -22
- package/dist/visual/serve.d.ts +0 -13
- package/dist/visual/targets.d.ts +0 -17
- package/dist/visual/types.d.ts +0 -188
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Region } from '../lib/viewport';
|
|
2
|
-
import { Candidate, VideoMedia } from './compare';
|
|
3
|
-
import { Shortcut } from './hotkeys';
|
|
4
|
-
import { VideoLoop } from './video-clock';
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
/** Props for `CompareVideoGrid`. */
|
|
7
|
-
export type CompareVideoGridProps = {
|
|
8
|
-
/** Names the grid for screen readers: "Five upscales of this clip". Required. */
|
|
9
|
-
label: string;
|
|
10
|
-
items: readonly Candidate<VideoMedia>[];
|
|
11
|
-
/** The source clip, drawn first and never blind, scaled up nearest-neighbour. Give its `label` ("Source"); its `note` shows. */
|
|
12
|
-
reference?: Candidate<VideoMedia>;
|
|
13
|
-
/** Whether the person must not learn which variant is which: cells are named by label only. Required, no default. */
|
|
14
|
-
blind: boolean;
|
|
15
|
-
/** The words shown where a video could not be loaded. Required. */
|
|
16
|
-
missing: string;
|
|
17
|
-
/** The words under a cell that has fallen behind the clock. Default "Catching up". */
|
|
18
|
-
catchingUp?: string;
|
|
19
|
-
/** What goes under a cell's caption: a button to compare it, a choice, a flag. */
|
|
20
|
-
actions?: (item: Candidate<VideoMedia>) => React.ReactNode;
|
|
21
|
-
/** Cells per row at full width. Default 3. A narrow screen uses fewer. */
|
|
22
|
-
columns?: 2 | 3 | 4;
|
|
23
|
-
/** Named boxes to look at enlarged in every cell at once, as in `Compare`. */
|
|
24
|
-
regions?: readonly Region[];
|
|
25
|
-
/** Speeds offered. Default 0.1 to 2. */
|
|
26
|
-
rates?: readonly number[];
|
|
27
|
-
/** Moments the app names, drawn on the seek bar; pressing one goes there and pauses. */
|
|
28
|
-
moments?: readonly {
|
|
29
|
-
time: number;
|
|
30
|
-
label: string;
|
|
31
|
-
}[];
|
|
32
|
-
/** The looped range in seconds; give it with `onLoopChange` to keep it when the item changes. */
|
|
33
|
-
loop?: VideoLoop;
|
|
34
|
-
onLoopChange?: (loop: VideoLoop) => void;
|
|
35
|
-
/** Start playing once every cell has its metadata, muted (unless the person has chosen a sound level), and again when the cells change. Off with reduced motion unless `"always"`. Default false. */
|
|
36
|
-
autoPlay?: boolean | "always";
|
|
37
|
-
/** Loop the whole clip until stopped; a range set with `i` and `o` wins while both ends are set. Default false. */
|
|
38
|
-
loopWhole?: boolean;
|
|
39
|
-
/** The `id` of the cell whose sound is heard. Default none: eight soundtracks at once are noise. */
|
|
40
|
-
audio?: string | null;
|
|
41
|
-
/** Draw nearest-neighbour when a video is shown larger than its own pixels (`zoomed`, default), always, or never. */
|
|
42
|
-
pixelated?: "zoomed" | "always" | "never";
|
|
43
|
-
/** Bind the keys on the window. Default true. */
|
|
44
|
-
keys?: boolean;
|
|
45
|
-
/** Shortcuts of the surrounding screen, bound with these and listed first in the same legend. */
|
|
46
|
-
extraShortcuts?: Shortcut[];
|
|
47
|
-
/** Drawn under the transport, above the legend. */
|
|
48
|
-
footer?: React.ReactNode;
|
|
49
|
-
className?: string;
|
|
50
|
-
};
|
|
51
|
-
/** Many videos in a grid on one clock, zoomed and panned together, with regions, a loop, stepping and full screen. */
|
|
52
|
-
export declare function CompareVideoGrid({ label, items, reference, blind, missing, catchingUp, actions, columns, regions, rates, moments, loop, onLoopChange, audio, autoPlay, loopWhole, pixelated, keys, extraShortcuts, footer, className }: CompareVideoGridProps): React.JSX.Element;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Shortcut } from './hotkeys';
|
|
2
|
-
import { PickWords } from './compare-parts';
|
|
3
|
-
import { Candidate, CompareMode, VideoMedia } from './compare';
|
|
4
|
-
import { VideoLoop } from './video-clock';
|
|
5
|
-
import { Region } from '../lib/viewport';
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
/** The views a pair of videos has: pictures' views without the difference, which needs pixels. */
|
|
8
|
-
export type VideoMode = Exclude<CompareMode, "difference">;
|
|
9
|
-
export type { VideoLoop };
|
|
10
|
-
/** Props for `CompareVideo`. */
|
|
11
|
-
export type CompareVideoProps = {
|
|
12
|
-
/** Names the comparison for screen readers. Required. */
|
|
13
|
-
label: string;
|
|
14
|
-
a: Candidate<VideoMedia>;
|
|
15
|
-
b: Candidate<VideoMedia>;
|
|
16
|
-
/** Whether the person must not learn which video is which. Required, no default. */
|
|
17
|
-
blind: boolean;
|
|
18
|
-
/** The words shown when a video cannot be loaded: "Video not found". Required. */
|
|
19
|
-
missing: string;
|
|
20
|
-
mode: VideoMode;
|
|
21
|
-
onModeChange: (mode: VideoMode) => void;
|
|
22
|
-
/** Speeds offered. Default 0.1, 0.25, 0.5, 1, 1.25, 1.5, 2: slow motion for sitting on a moment. */
|
|
23
|
-
rates?: readonly number[];
|
|
24
|
-
/** Moments the app names ("fast motion"), drawn on the seek bar; pressing one goes there and pauses. */
|
|
25
|
-
moments?: readonly {
|
|
26
|
-
time: number;
|
|
27
|
-
label: string;
|
|
28
|
-
}[];
|
|
29
|
-
/** The looped range in seconds, `null` for an end not set. Give it (with `onLoopChange`) to keep the range when the pair changes to another of the same item. Without it the component keeps its own. */
|
|
30
|
-
loop?: VideoLoop;
|
|
31
|
-
onLoopChange?: (loop: VideoLoop) => void;
|
|
32
|
-
/** Named boxes to look at enlarged, as in `Compare`, on the same clock; a box drawn by hand (Shift-drag) is for a paused clip. Nearest-neighbour while one is shown. */
|
|
33
|
-
regions?: readonly Region[];
|
|
34
|
-
/** Called with the side clicked or tapped (side by side, swipe by the side of the divider, blink the side showing; not fade), whether the clip plays or not. A click never toggles play. A `PairVote` or `PairJudge` slot sets this. */
|
|
35
|
-
onPick?: (side: "a" | "b") => void;
|
|
36
|
-
/** Whether a click chooses at all when `onPick` is given. Default true; `false` for a screen where a click must only pan. */
|
|
37
|
-
pick?: boolean;
|
|
38
|
-
/** Words for click to choose. Defaults say "Click to choose A". */
|
|
39
|
-
pickWords?: PickWords;
|
|
40
|
-
/** Start playing when the pair has loaded, muted (unless the person has chosen a sound level), and again for each new pair. Off with reduced motion unless `"always"`. If the browser refuses, the pair stays paused with Play showing. Default false. */
|
|
41
|
-
autoPlay?: boolean | "always";
|
|
42
|
-
/** Loop the whole clip, from its end back to 0, until the judge answers. A range set with `i` and `o` wins while both ends are set; `c` goes back to the whole clip. Default false. */
|
|
43
|
-
loopWhole?: boolean;
|
|
44
|
-
/** Which video's sound is heard; the other is muted. Default "a". */
|
|
45
|
-
audio?: "a" | "b" | "none";
|
|
46
|
-
/** Draw nearest-neighbour when shown larger than the video's own pixels (`zoomed`, default), always, or never. */
|
|
47
|
-
pixelated?: "zoomed" | "always" | "never";
|
|
48
|
-
/** How tall a frame may be: a CSS length, `"viewport"` (a fixed guess) or `"fit"` (measured), as in `Compare`; full screen fills what the controls leave. */
|
|
49
|
-
maxHeight?: string;
|
|
50
|
-
/** With `maxHeight="fit"`: pixels of the page below this that it cannot measure, as in `Compare`. Default 0. */
|
|
51
|
-
reserve?: number;
|
|
52
|
-
/** Bind the keys on the window. Default true. */
|
|
53
|
-
keys?: boolean;
|
|
54
|
-
/** Shortcuts of the surrounding screen, bound with these and listed first in the same legend. */
|
|
55
|
-
extraShortcuts?: Shortcut[];
|
|
56
|
-
/** Drawn under the video, above the legend, and kept in full screen: where a vote bar goes. */
|
|
57
|
-
footer?: React.ReactNode;
|
|
58
|
-
className?: string;
|
|
59
|
-
};
|
|
60
|
-
/** Two videos to judge by eye on one clock: side by side, swipe, fade or blink, zoomed together, with matched sound and full screen. */
|
|
61
|
-
export declare function CompareVideo({ label, a, b, blind, missing, mode, onModeChange, rates, regions, moments, loop: loopProp, onLoopChange, audio, onPick, pick, pickWords, autoPlay, loopWhole, pixelated, maxHeight, reserve, keys, extraShortcuts, footer, className }: CompareVideoProps): React.JSX.Element;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Shortcut } from './hotkeys';
|
|
2
|
-
import { PickWords } from './compare-parts';
|
|
3
|
-
import { ReadPixels } from './difference';
|
|
4
|
-
import { Region } from '../lib/viewport';
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
/** A picture to compare. */
|
|
7
|
-
export type ImageMedia = {
|
|
8
|
-
kind: "image";
|
|
9
|
-
src: string;
|
|
10
|
-
/** What it shows. Ignored when the comparison is `blind`: the label names it then. */
|
|
11
|
-
alt: string;
|
|
12
|
-
/** Its natural size in pixels, if known, so the frame has its shape and "1:1" is exact before the picture loads. */
|
|
13
|
-
size?: readonly [number, number];
|
|
14
|
-
};
|
|
15
|
-
/** A clip to compare by listening (`CompareAudio`). Serve it under a neutral address when the comparison is blind. */
|
|
16
|
-
export type AudioMedia = {
|
|
17
|
-
kind: "audio";
|
|
18
|
-
src: string;
|
|
19
|
-
};
|
|
20
|
-
/** A text to compare by reading (`CompareText`). */
|
|
21
|
-
export type TextMedia = {
|
|
22
|
-
kind: "text";
|
|
23
|
-
text: string;
|
|
24
|
-
};
|
|
25
|
-
/** A video to compare (`CompareVideo`). Serve it under a neutral address when the comparison is blind: `src` reaches the page. */
|
|
26
|
-
export type VideoMedia = {
|
|
27
|
-
kind: "video";
|
|
28
|
-
src: string;
|
|
29
|
-
/** A still shown before the first frame. */
|
|
30
|
-
poster?: string;
|
|
31
|
-
/** Its size in pixels, for the shape of the frame, "1:1" and drawing candidates of different sizes in one box. */
|
|
32
|
-
width: number;
|
|
33
|
-
height: number;
|
|
34
|
-
/** Frames per second, if known: the unit of the sync tolerance and of the frame readout. Default 30. */
|
|
35
|
-
fps?: number;
|
|
36
|
-
};
|
|
37
|
-
/** One side of a comparison. */
|
|
38
|
-
export type Candidate<M = ImageMedia> = {
|
|
39
|
-
/** Who it is: a variant name, a model. Never put on the page when `blind`, and never needed by it. */
|
|
40
|
-
id: string;
|
|
41
|
-
/** What the person sees it called: "Original", or "A" when blind. */
|
|
42
|
-
label: string;
|
|
43
|
-
media: M;
|
|
44
|
-
/** A line under the label ("auto2, 14 s"). Not shown when `blind`. */
|
|
45
|
-
note?: string;
|
|
46
|
-
};
|
|
47
|
-
/** How two pictures are laid out. */
|
|
48
|
-
export type CompareMode = "side" | "swipe" | "fade" | "blink" | "difference";
|
|
49
|
-
/** Props for `Compare`. */
|
|
50
|
-
export type CompareProps = {
|
|
51
|
-
/** Names the comparison for screen readers: "Photo 1 of 12, two versions". Required. */
|
|
52
|
-
label: string;
|
|
53
|
-
a: Candidate;
|
|
54
|
-
b: Candidate;
|
|
55
|
-
/** Whether the person must not learn which variant is which. Required, no default. */
|
|
56
|
-
blind: boolean;
|
|
57
|
-
/** The words shown where a picture could not be loaded: "Picture not found". Required. */
|
|
58
|
-
missing: string;
|
|
59
|
-
mode: CompareMode;
|
|
60
|
-
onModeChange: (mode: CompareMode) => void;
|
|
61
|
-
/** Words for when the difference view cannot read the pictures' pixels (a picture from another site without CORS headers). Default says so plainly. */
|
|
62
|
-
cannotCompare?: string;
|
|
63
|
-
/** Which difference the difference view opens on: `brightness` (live, any picture) or `pixels` (the changed pixels marked, with a tolerance and the share that differ). Default `brightness`. */
|
|
64
|
-
defaultDifference?: "brightness" | "pixels";
|
|
65
|
-
/** How pictures become pixels for the difference view. Default draws them on a canvas. */
|
|
66
|
-
readPixels?: ReadPixels;
|
|
67
|
-
/** Which views are offered. Default all five. Must include `mode`. */
|
|
68
|
-
modes?: readonly CompareMode[];
|
|
69
|
-
/** How tall a frame may be, so the pair and the answer fit on one screen: a CSS length (`"60svh"`), `"viewport"` (the window's height less a fixed 14rem for the toolbar, captions, a vote bar and the key legend: a guess), or `"fit"` (measured: the window from the top of this component, less what it draws besides its frames and what follows it in the page, shared between the rows of frames, never under 120 px; re-measured as the page changes; see `reserve`). The frame narrows to keep the picture's shape. In full screen the frame fills what the controls leave, whatever this is. Default: as tall as the width makes it. */
|
|
70
|
-
maxHeight?: string;
|
|
71
|
-
/** With `maxHeight="fit"`: pixels of the page below this component that it cannot measure (padding and gaps of the screen around it); later siblings are measured. Default 0. */
|
|
72
|
-
reserve?: number;
|
|
73
|
-
/** Named boxes in the source's coordinates to look at enlarged: a strip of chips, keys `q` `w` `e` `r` `y` `u`, nearest-neighbour drawing while one is shown, and Shift-drag to make another. They work in every view. The same share of each side is shown, whatever its pixel size. Label them by content ("Face"), never by candidate. */
|
|
74
|
-
regions?: readonly Region[];
|
|
75
|
-
/** Called with the side clicked or tapped, in the views where a click is unambiguous: side by side, swipe (by the side of the divider) and blink (the side showing). A pointer convenience: the keys and the vote bar stay the way to answer. A `PairVote` sets this for you. */
|
|
76
|
-
onPick?: (side: "a" | "b") => void;
|
|
77
|
-
/** Whether a click chooses at all when `onPick` is given. Default true; `false` for a screen where a click must only pan. */
|
|
78
|
-
pick?: boolean;
|
|
79
|
-
/** Words for click to choose. Defaults say "Click to choose A". */
|
|
80
|
-
pickWords?: PickWords;
|
|
81
|
-
/** Bind the view, zoom and full-screen keys on the window. Default true; turn off when a surrounding screen binds the same keys. */
|
|
82
|
-
keys?: boolean;
|
|
83
|
-
/** Shortcuts of the surrounding screen (the answer keys of a `PairVote`), bound with Compare's own and drawn in the same legend, so there is one list and the two cannot clash unseen. Listed first. */
|
|
84
|
-
extraShortcuts?: Shortcut[];
|
|
85
|
-
/** Drawn under the picture, above the legend, and kept in full screen: where a vote bar goes so the answer is never out of reach of the pictures. */
|
|
86
|
-
footer?: React.ReactNode;
|
|
87
|
-
className?: string;
|
|
88
|
-
};
|
|
89
|
-
/** Two pictures to judge, side by side or laid over each other, zoomed and panned together, and full screen. */
|
|
90
|
-
export declare function Compare({ label, a, b, blind, missing, mode, onModeChange, modes, regions, onPick, pick, pickWords, keys, extraShortcuts, footer, maxHeight, reserve, cannotCompare, readPixels, defaultDifference, className }: CompareProps): React.JSX.Element;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** One part of a `CompositionBar`'s whole. */
|
|
3
|
-
export type CompositionPart = {
|
|
4
|
-
/** Stable key for the part. */
|
|
5
|
-
key: string;
|
|
6
|
-
label: string;
|
|
7
|
-
value: number;
|
|
8
|
-
/** CSS colour for the segment and swatch. Defaults to the chart token for its position. */
|
|
9
|
-
colour?: string;
|
|
10
|
-
};
|
|
11
|
-
export type CompositionBarProps = {
|
|
12
|
-
/** What the whole is, such as "Memory". Shown above the bar and names the table. */
|
|
13
|
-
label: string;
|
|
14
|
-
parts: CompositionPart[];
|
|
15
|
-
formatValue: (value: number) => string;
|
|
16
|
-
/** Formats a part's share of the whole (0 to 1). Defaults to `format.share` ("<1%" for a part that rounds to 0). */
|
|
17
|
-
formatShare?: (share: number) => string;
|
|
18
|
-
/**
|
|
19
|
-
* Fold the smallest parts into one last part when there are more than five. The four largest keep
|
|
20
|
-
* their given order; the rest are summed under this label (a function gets how many were folded:
|
|
21
|
-
* `(n) => `${n} other apps``). Opt in for parts that come from data and have no order of their own;
|
|
22
|
-
* leave it off for ordered parts (used, cached, free).
|
|
23
|
-
*/
|
|
24
|
-
other?: {
|
|
25
|
-
label: string | ((count: number) => string);
|
|
26
|
-
};
|
|
27
|
-
/** Header of the parts column, for screen readers and over the table. Defaults to "Part". */
|
|
28
|
-
partHeader?: string;
|
|
29
|
-
/** Header of the amounts column. Defaults to "Amount". */
|
|
30
|
-
valueHeader?: string;
|
|
31
|
-
/** Header of the shares column. Defaults to "Share". */
|
|
32
|
-
shareHeader?: string;
|
|
33
|
-
className?: string;
|
|
34
|
-
} & ({
|
|
35
|
-
/** The size of the whole, when the parts do not fill it. The remainder is the empty track. */
|
|
36
|
-
total: number;
|
|
37
|
-
/** What the remainder is called ("Free", "Empty shelves"). Required with `total`. */
|
|
38
|
-
restLabel: string;
|
|
39
|
-
} | {
|
|
40
|
-
total?: undefined;
|
|
41
|
-
restLabel?: undefined;
|
|
42
|
-
});
|
|
43
|
-
/** What a whole is made of: a stacked bar for proportion and a table that names every part, its amount and its share, so colour is never the only cue. */
|
|
44
|
-
export declare function CompositionBar({ label, parts, formatValue, formatShare, partHeader, valueHeader, shareHeader, other, className, ...whole }: CompositionBarProps): React.JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** The kind of a console line: output (`info`), a `warning` or `error`, or the `echo` of a command that ran. */
|
|
3
|
-
export type ConsoleLevel = "info" | "warning" | "error" | "echo";
|
|
4
|
-
/** One line of the log. */
|
|
5
|
-
export type ConsoleLine = {
|
|
6
|
-
/** Unique and stable: the row's key. A counter will do. */
|
|
7
|
-
id: string | number;
|
|
8
|
-
text: string;
|
|
9
|
-
/** Default `info`. */
|
|
10
|
-
level?: ConsoleLevel;
|
|
11
|
-
};
|
|
12
|
-
export type ConsoleProps = {
|
|
13
|
-
/** Names the console: "Game console". The log and the command line are named from it. */
|
|
14
|
-
label: string;
|
|
15
|
-
/** The log, oldest first. */
|
|
16
|
-
lines: readonly ConsoleLine[];
|
|
17
|
-
/** A command was entered (Enter or Run), trimmed and not empty. The line clears. Append its echo and output to `lines`. */
|
|
18
|
-
onCommand: (text: string) => void;
|
|
19
|
-
/** The whole inputs that could follow what is typed, for Tab. Not given: Tab moves on as it does anywhere. */
|
|
20
|
-
complete?: (text: string) => readonly string[];
|
|
21
|
-
/** Where the history of commands is kept (localStorage). Not given: kept for this visit only. */
|
|
22
|
-
historyKey?: string;
|
|
23
|
-
/** The tallest the log may be, in px, before it scrolls. Default 320. */
|
|
24
|
-
height?: number;
|
|
25
|
-
/** Every line is exactly this tall (px) and does not wrap (a long line is cut with an ellipsis, whole in its title): nothing is measured, which is faster for a long log and what a test DOM, which does no layout, needs. Default: lines wrap and are measured. */
|
|
26
|
-
lineHeight?: number;
|
|
27
|
-
/** The command line's label. Default "Command". */
|
|
28
|
-
commandLabel?: string;
|
|
29
|
-
/** The input, for moving focus to it when the console opens. */
|
|
30
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
31
|
-
className?: string;
|
|
32
|
-
};
|
|
33
|
-
/** A command console: a polite, virtualised log pinned to its end, above a command line with history (Up, Down) and Tab completion from the app's list. */
|
|
34
|
-
export declare function Console({ label, lines, onCommand, complete, historyKey, height, lineHeight, commandLabel, inputRef, className }: ConsoleProps): React.JSX.Element;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { EntityMatcher } from '../lib/rich-text';
|
|
2
|
-
import { AspectRatio } from './thumbnail';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
export type RichTextProps = {
|
|
5
|
-
/** The text, in the small subset: paragraphs, `- ` and `1. ` lists, **bold**, `code`, [links](https://…). */
|
|
6
|
-
children: string;
|
|
7
|
-
/** Ids that become buttons: a list (longest first, whole words only) or a function reporting matches. */
|
|
8
|
-
entities?: EntityMatcher;
|
|
9
|
-
/** Called with the id when an entity button is pressed. Without it, an id is drawn as code. */
|
|
10
|
-
onOpen?: (id: string) => void;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
/** Draws a small safe subset of text (bold, code, lists, http links) and turns known ids into buttons. Never HTML: whatever the string holds is shown as text. */
|
|
14
|
-
export declare function RichText({ children, entities, onOpen, className }: RichTextProps): React.JSX.Element;
|
|
15
|
-
/** A picture shown with an answer (issue #257). */
|
|
16
|
-
export type ConversationImage = {
|
|
17
|
-
src: string;
|
|
18
|
-
/** What it shows, in words: the picture's accessible name and its visible caption. */
|
|
19
|
-
label: string;
|
|
20
|
-
/** The full-size picture, when it is not `src`: the thumbnail becomes a link that opens it in a new tab. */
|
|
21
|
-
href?: string;
|
|
22
|
-
/** Width over height, so the box is its shape before the picture loads. Default 16/9. */
|
|
23
|
-
aspect?: AspectRatio;
|
|
24
|
-
};
|
|
25
|
-
/** One turn of the thread. `failed` cannot be written without the sentence saying what happened. */
|
|
26
|
-
export type ConversationTurn = {
|
|
27
|
-
id: string;
|
|
28
|
-
role: "person" | "answer";
|
|
29
|
-
time: Date | string | number;
|
|
30
|
-
text: string;
|
|
31
|
-
/** What the answer consulted, in a collapsed disclosure. Not for a picture that is the answer: use `images`. */
|
|
32
|
-
lookedUp?: React.ReactNode;
|
|
33
|
-
/** Pictures that are part of the answer, drawn under its text, always visible: lazy, each with its label as its name and caption, and a link to the full size when `href` is given. */
|
|
34
|
-
images?: readonly ConversationImage[];
|
|
35
|
-
} & ({
|
|
36
|
-
state?: "done";
|
|
37
|
-
} | {
|
|
38
|
-
state: "streaming";
|
|
39
|
-
} | {
|
|
40
|
-
state: "failed";
|
|
41
|
-
error: string;
|
|
42
|
-
});
|
|
43
|
-
export type ConversationProps = {
|
|
44
|
-
/** Names the thread for assistive technology: "Questions about the kiln". */
|
|
45
|
-
label: string;
|
|
46
|
-
turns: readonly ConversationTurn[];
|
|
47
|
-
/** Who the answers come from, shown on each: "Assistant". */
|
|
48
|
-
answerName: string;
|
|
49
|
-
/** What a person is called in their own turns: "You". */
|
|
50
|
-
personName?: string;
|
|
51
|
-
entities?: EntityMatcher;
|
|
52
|
-
/** An id in an answer was pressed. */
|
|
53
|
-
onOpen?: (id: string) => void;
|
|
54
|
-
/** Try again on a failed answer; the turn is replaced in place. */
|
|
55
|
-
onRetry: (turnId: string) => void;
|
|
56
|
-
/** Shown while there are no turns: the app's invitation, with the suggested questions if it likes. */
|
|
57
|
-
empty: React.ReactNode;
|
|
58
|
-
/** What the "what it looked up" disclosure is called. */
|
|
59
|
-
lookedUpLabel?: string;
|
|
60
|
-
className?: string;
|
|
61
|
-
};
|
|
62
|
-
/** A thread of turns: answers stream, finish or fail in place; the log follows only while the person is at the bottom (with Jump to latest), and a finished answer is announced once, politely. */
|
|
63
|
-
export declare function Conversation({ label, turns, answerName, personName, entities, onOpen, onRetry, empty, lookedUpLabel, className }: ConversationProps): React.JSX.Element;
|
|
64
|
-
export type ComposerProps = {
|
|
65
|
-
/** Names the box: "Ask about the kiln". */
|
|
66
|
-
label: string;
|
|
67
|
-
/** Called with the trimmed text on Enter or the send button; the box then clears. */
|
|
68
|
-
onSend: (text: string) => void;
|
|
69
|
-
/** An answer is on its way: the box is disabled, with `answeringReason` under it, and send becomes Stop. */
|
|
70
|
-
answering?: boolean;
|
|
71
|
-
/** Stops the answer in progress. Required, so a long answer can always be cut short. */
|
|
72
|
-
onStop: () => void;
|
|
73
|
-
/** Why the box is disabled while answering, in the app's words: "Waiting for the answer." */
|
|
74
|
-
answeringReason: string;
|
|
75
|
-
/** Questions to start from; each is a button that sends. */
|
|
76
|
-
suggestions?: readonly string[];
|
|
77
|
-
sendLabel?: string;
|
|
78
|
-
/** The box cannot be used yet, and why, in the app's words: "The footage is still being indexed." Disables the box, send and suggestions; shown under the box. */
|
|
79
|
-
disabled?: string;
|
|
80
|
-
className?: string;
|
|
81
|
-
};
|
|
82
|
-
/** The box a question is typed in: Enter sends, Shift+Enter is a new line, disabled with its reason while answering (and Stop), suggestions as buttons. */
|
|
83
|
-
export declare function Composer({ label, onSend, answering, onStop, answeringReason, suggestions, sendLabel, disabled, className }: ComposerProps): React.JSX.Element;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Who set the cursor: a pointer or key over a member, or playback (a player's clock). */
|
|
3
|
-
export type CursorOwner = "pointer" | "playback";
|
|
4
|
-
/** How a member's own x relates to the scope's unit. Both default to the identity. */
|
|
5
|
-
export type CursorMapping = {
|
|
6
|
-
/** From this member's x to the scope's unit (a chart in seconds in a scope in metres: look it up in the series). */
|
|
7
|
-
toCursor?: (x: number) => number;
|
|
8
|
-
/** From the scope's unit to this member's x. */
|
|
9
|
-
fromCursor?: (at: number) => number;
|
|
10
|
-
};
|
|
11
|
-
type Snapshot = {
|
|
12
|
-
/** The position now: the pointer's while there is one, else playback's; null when neither is set. */
|
|
13
|
-
at: number | null;
|
|
14
|
-
/** Who wrote `at`; a member ignores a position it wrote. */
|
|
15
|
-
source: string | null;
|
|
16
|
-
owner: CursorOwner | null;
|
|
17
|
-
};
|
|
18
|
-
export type CursorScopeProps = {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
/** Words for the position in the scope's unit ("12.4 km along", "1:23"), for the polite announcement. Without it nothing is announced. */
|
|
21
|
-
format?: (at: number) => string;
|
|
22
|
-
/** Milliseconds between announcements. Default 1000. */
|
|
23
|
-
announceEvery?: number;
|
|
24
|
-
};
|
|
25
|
-
/** Holds one cursor position for the charts, map and seek bar inside it, with a throttled polite announcement of where a pointer or key has put it. */
|
|
26
|
-
export declare function CursorScope({ children, format, announceEvery }: CursorScopeProps): React.JSX.Element;
|
|
27
|
-
/** What a member reads and writes. */
|
|
28
|
-
export type SharedCursor = Snapshot & {
|
|
29
|
-
/** This member's own id: positions it writes are not drawn back at it. */
|
|
30
|
-
source: string;
|
|
31
|
-
/** The position another member (or playback) put there, in the scope's unit; null when none or when this member wrote it. */
|
|
32
|
-
other: number | null;
|
|
33
|
-
/** The pointer or keyboard is at `at` over this member (the scope's unit). `null`: it left. */
|
|
34
|
-
setPointer: (at: number | null) => void;
|
|
35
|
-
/** Playback is at `at` (the scope's unit). Call it from the player's clock; `null` when it stops. */
|
|
36
|
-
setPlayback: (at: number | null) => void;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Join the nearest `CursorScope` as one member. Returns null outside a scope, so a component can take a
|
|
40
|
-
* `cursor` prop and do nothing when the app has not set one up. `source` is this member's id; the
|
|
41
|
-
* default is a unique one.
|
|
42
|
-
*/
|
|
43
|
-
export declare function useSharedCursor(source?: string): SharedCursor | null;
|
|
44
|
-
export {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Breakpoint } from '../lib/breakpoint';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** What a column's `value` may be: a number, text or a date, or `null`/`undefined` when the row has none. */
|
|
4
|
-
export type CellValue = number | string | Date | null | undefined;
|
|
5
|
-
export type Column<T> = {
|
|
6
|
-
key: string;
|
|
7
|
-
header: string;
|
|
8
|
-
/** Right-aligns and sets tabular figures. Use for every quantity. */
|
|
9
|
-
numeric?: boolean;
|
|
10
|
-
/** Orders two rows. With `value`, it orders only rows that have one (missing ones go last); `false` turns off `value`'s default sort. */
|
|
11
|
-
sort?: ((a: T, b: T) => number) | false;
|
|
12
|
-
/** What the cell shows when the row's `value` is missing, where the word carries meaning ("Never"). Default an en dash. */
|
|
13
|
-
missing?: string;
|
|
14
|
-
/** Cells that may hold long text get truncated rather than stretching the table. */
|
|
15
|
-
truncate?: boolean;
|
|
16
|
-
/** Keep the header for screen readers only, as for a column of row actions. `header` still names it. */
|
|
17
|
-
hideHeader?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Hide the column, header and cells together, on screens narrower than this Tailwind breakpoint
|
|
20
|
-
* (`"sm"` hides it on a phone). For the columns that are not the row's meaning (its name and state word stay). Not on the first column, which is the row's header. CSS only, except in a virtualised table, where the columns are laid out in script and are dropped by a media query instead.
|
|
21
|
-
*/
|
|
22
|
-
hideBelow?: Breakpoint;
|
|
23
|
-
className?: string;
|
|
24
|
-
} & ({
|
|
25
|
-
cell: (row: T) => React.ReactNode;
|
|
26
|
-
/** The row's value for this column: gives a typed default sort with missing values last, and the missing placeholder. */
|
|
27
|
-
value?: (row: T) => CellValue;
|
|
28
|
-
} | {
|
|
29
|
-
/** How a row with a value is drawn. Default: numbers through `format.decimal`, dates through `format.date`, text as it is. */
|
|
30
|
-
cell?: (row: T) => React.ReactNode;
|
|
31
|
-
/** The row's value for this column: gives a typed default sort with missing values last, and the missing placeholder. */
|
|
32
|
-
value: (row: T) => CellValue;
|
|
33
|
-
});
|
|
34
|
-
/** Row selection for a `DataTable`: the chosen row keys, how to change them, and how to name each row's checkbox. */
|
|
35
|
-
export type RowSelection<T> = {
|
|
36
|
-
/** Keys (from `rowKey`) of the chosen rows. */
|
|
37
|
-
selected: ReadonlySet<string>;
|
|
38
|
-
onChange: (next: Set<string>) => void;
|
|
39
|
-
/** Names the row in its checkbox ("Select <rowLabel>"). Required: an unnamed checkbox is a column of "checkbox, not checked". */
|
|
40
|
-
rowLabel: (row: T) => string;
|
|
41
|
-
/** Rows that cannot be chosen get a disabled checkbox and are left out of select-all. Default: every row. */
|
|
42
|
-
isSelectable?: (row: T) => boolean;
|
|
43
|
-
};
|
|
44
|
-
/** Row expansion for a `DataTable`: the open row keys, how to change them, how to name each toggle, and the detail to show. */
|
|
45
|
-
export type RowExpansion<T> = {
|
|
46
|
-
/** Keys (from `rowKey`) of the open rows. */
|
|
47
|
-
expanded: ReadonlySet<string>;
|
|
48
|
-
onChange: (next: Set<string>) => void;
|
|
49
|
-
/** Names the row's toggle by what it shows: "Pieces in firing 412". Its state is `aria-expanded`, so the name stays the same open or closed. */
|
|
50
|
-
rowLabel: (row: T) => string;
|
|
51
|
-
/** The row's detail, mounted only while it is open. Return an element whose component makes any request, so the request runs on open. */
|
|
52
|
-
detail: (row: T) => React.ReactNode;
|
|
53
|
-
/** Rows with nothing to show get no toggle. Default: every row. */
|
|
54
|
-
isExpandable?: (row: T) => boolean;
|
|
55
|
-
};
|
|
56
|
-
export type Sort = {
|
|
57
|
-
key: string;
|
|
58
|
-
dir: "ascending" | "descending";
|
|
59
|
-
};
|
|
60
|
-
export type DataTableProps<T> = {
|
|
61
|
-
/** Names the table for screen readers and labels the scroll region. */
|
|
62
|
-
caption: string;
|
|
63
|
-
columns: Column<T>[];
|
|
64
|
-
rows: T[];
|
|
65
|
-
rowKey: (row: T) => string;
|
|
66
|
-
initialSort?: Sort;
|
|
67
|
-
/** Keep the sort in this URL search parameter. Needs a React Router context. */
|
|
68
|
-
sortParam?: string;
|
|
69
|
-
/** Row count from which only the visible rows render. Default 100. */
|
|
70
|
-
virtualizeFrom?: number;
|
|
71
|
-
/** Height of the scroll region once virtualised, in px. Default 480. */
|
|
72
|
-
maxHeight?: number;
|
|
73
|
-
/** Adds a checkbox column and "Select all shown". Use only where a `BulkBar` acts on the selection. */
|
|
74
|
-
selection?: RowSelection<T>;
|
|
75
|
-
/** Adds a toggle per row that opens a detail row under it. Spread `useExpanded()` in with a `rowLabel` and `detail`. */
|
|
76
|
-
expansion?: RowExpansion<T>;
|
|
77
|
-
className?: string;
|
|
78
|
-
};
|
|
79
|
-
/** Reads a sort from its URL form (`pieces.desc`). */
|
|
80
|
-
export declare function parseSort(value: string | null): Sort | undefined;
|
|
81
|
-
/** Writes a sort in its URL form (`pieces.desc`). */
|
|
82
|
-
export declare function serialiseSort(sort: Sort): string;
|
|
83
|
-
/** A table on React Aria's Table with TanStack Table's data model: muted headers, row rules, right-aligned tabular numbers, sortable headers with `aria-sort`, virtualised from `virtualizeFrom` rows, sort optionally kept in the URL (`sortParam`). */
|
|
84
|
-
export declare function DataTable<T>(props: DataTableProps<T>): React.JSX.Element;
|
|
85
|
-
/** The loading placeholder for a `DataTable`, shaped like its rows. */
|
|
86
|
-
export declare function TableSkeleton({ rows, columns }: {
|
|
87
|
-
rows?: number;
|
|
88
|
-
columns?: number;
|
|
89
|
-
}): React.JSX.Element;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Data still shown after a refresh failed: why the refresh failed, when the data was read, and the Try again. */
|
|
3
|
-
export type Stale = {
|
|
4
|
-
/** Why the refresh failed, for a person: the sentence an error panel would have shown. */
|
|
5
|
-
message: string;
|
|
6
|
-
/** When the data on screen was read. */
|
|
7
|
-
readAt: Date;
|
|
8
|
-
/** Fetch again. */
|
|
9
|
-
retry: () => void;
|
|
10
|
-
/** A fetch is on its way (a Try again or the next poll). */
|
|
11
|
-
retrying?: boolean;
|
|
12
|
-
};
|
|
13
|
-
/** The state of one remote read, for `DataView`: loading, failed with no data, or ready (and `stale` when a later refresh failed). */
|
|
14
|
-
export type Load<T> = {
|
|
15
|
-
status: "loading";
|
|
16
|
-
} | {
|
|
17
|
-
status: "error";
|
|
18
|
-
message: string;
|
|
19
|
-
retry: () => void;
|
|
20
|
-
} | {
|
|
21
|
-
status: "ready";
|
|
22
|
-
data: T;
|
|
23
|
-
stale?: Stale;
|
|
24
|
-
};
|
|
25
|
-
/** What a failed read hands to an `error` renderer: the sentence for a person, and the Try again. */
|
|
26
|
-
export type LoadFailure = {
|
|
27
|
-
message: string;
|
|
28
|
-
retry: () => void;
|
|
29
|
-
};
|
|
30
|
-
/** The default failed-read panel: the reason on the danger tint, with Try again. Its parent carries `role="alert"`. */
|
|
31
|
-
export declare function LoadError({ message, retry, className }: LoadFailure & {
|
|
32
|
-
className?: string;
|
|
33
|
-
}): React.JSX.Element;
|
|
34
|
-
/** Every view of remote data: renders `skeleton` while loading, an alert with Try again on error, `empty` when `isEmpty`, else `children(data)`, under a `StaleNotice` when a refresh failed. The skeleton and empty state are required. */
|
|
35
|
-
export declare function DataView<T>({ state, isEmpty, skeleton, empty, children, staleNotice, error, className, }: {
|
|
36
|
-
state: Load<T>;
|
|
37
|
-
/** When the loaded data counts as empty. For arrays, `(rows) => rows.length === 0`. */
|
|
38
|
-
isEmpty: (data: T) => boolean;
|
|
39
|
-
/** Mirrors the final layout, so nothing jumps when data arrives. Not a centred spinner. */
|
|
40
|
-
skeleton: React.ReactNode;
|
|
41
|
-
/** What goes here and how to add it. An `EmptyState`, not an illustration. */
|
|
42
|
-
empty: React.ReactNode;
|
|
43
|
-
children: (data: T) => React.ReactNode;
|
|
44
|
-
/** Shown above the data when a refresh failed. Defaults to a `StaleNotice`; pass one with the product's words for what is old ("Readings from 13:50"). */
|
|
45
|
-
staleNotice?: (stale: Stale) => React.ReactNode;
|
|
46
|
-
/** Draws a read that failed with no data, given the message and the retry. Defaults to `LoadError`. Rendered inside a `role="alert"` box. */
|
|
47
|
-
error?: (failure: LoadFailure) => React.ReactNode;
|
|
48
|
-
className?: string;
|
|
49
|
-
}): React.JSX.Element;
|
|
50
|
-
/** The notice over data whose refresh failed: what happened, how old the data shown is, and Try again. A polite status, not an alert: nothing was lost. */
|
|
51
|
-
export declare function StaleNotice({ stale, shown, className, }: {
|
|
52
|
-
stale: Stale;
|
|
53
|
-
/** What is old, in the product's words, given when it was read ("13:50", or "Sat 13:50" before today). Defaults to "Showing data from 13:50." */
|
|
54
|
-
shown?: (when: string) => React.ReactNode;
|
|
55
|
-
className?: string;
|
|
56
|
-
}): React.JSX.Element;
|
|
57
|
-
/** An empty state that teaches the next action: a title, a sentence and an action. No illustration slot, on purpose. */
|
|
58
|
-
export declare function EmptyState({ title, children, action }: {
|
|
59
|
-
title: string;
|
|
60
|
-
children?: React.ReactNode;
|
|
61
|
-
action?: React.ReactNode;
|
|
62
|
-
}): React.JSX.Element;
|
|
63
|
-
/** A placeholder block for a loading layout. Size it with layout classes so it mirrors the final content. */
|
|
64
|
-
export declare function Skeleton({ className }: {
|
|
65
|
-
className?: string;
|
|
66
|
-
}): React.JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** How much a screen packs in: `default`, or `compact` for a tool screen. */
|
|
3
|
-
export type DensityName = "default" | "compact";
|
|
4
|
-
/** The density attribute's page-level setter, shared by `ThemeProvider`. @internal */
|
|
5
|
-
export declare function useDensityOn(value: DensityName | undefined, target?: HTMLElement | null): void;
|
|
6
|
-
/** Props for `Density`. */
|
|
7
|
-
export type DensityProps = {
|
|
8
|
-
value: DensityName;
|
|
9
|
-
/** Set it on the document's root element for the whole page, overlays included, instead of wrapping a region. Renders only its children. */
|
|
10
|
-
page?: boolean;
|
|
11
|
-
/** For the wrapper of a region: layout classes (the wrapper is a plain `div`; `contents` takes it out of layout). */
|
|
12
|
-
className?: string;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
};
|
|
15
|
-
/** Sets the density of a region (a wrapper `div`), or of the whole page with `page`, where overlays are reached too. */
|
|
16
|
-
export declare function Density({ value, page, className, children }: DensityProps): React.JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
type Common = {
|
|
3
|
-
/** What it is for: "Export video", "Delete 3 firings?". Required. */
|
|
4
|
-
title: string;
|
|
5
|
-
/** Shown under the title when it is not enough alone. */
|
|
6
|
-
description?: React.ReactNode;
|
|
7
|
-
/** The control that opens it. Leave out and drive it with `open` and `onOpenChange`. */
|
|
8
|
-
trigger?: React.ReactElement;
|
|
9
|
-
open?: boolean;
|
|
10
|
-
onOpenChange?: (open: boolean) => void;
|
|
11
|
-
className?: string;
|
|
12
|
-
};
|
|
13
|
-
/** Props for `Dialog`. */
|
|
14
|
-
export type DialogProps = Common & {
|
|
15
|
-
/** The body. It scrolls inside the dialog when it is taller than the window. */
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
/** The buttons along the bottom, built with `DialogActions`'s `close` render prop when one should close it. One filled button at most. */
|
|
18
|
-
actions?: React.ReactNode | ((close: () => void) => React.ReactNode);
|
|
19
|
-
/** Keep the title for screen readers only, when the body already says it. */
|
|
20
|
-
hideTitle?: boolean;
|
|
21
|
-
/** `false` while work cannot be interrupted: no close control, Escape or outside press. Default true. */
|
|
22
|
-
closable?: boolean;
|
|
23
|
-
/** `center` is a dialog; `end` is a sheet down the right edge. Default `center`. */
|
|
24
|
-
placement?: "center" | "end";
|
|
25
|
-
size?: "sm" | "md" | "lg" | "full";
|
|
26
|
-
};
|
|
27
|
-
/** A modal dialog with a required title; focus goes in and returns, Escape and a close control dismiss it. `placement="end"` makes it a sheet. */
|
|
28
|
-
export declare function Dialog({ title, description, trigger, open, onOpenChange, className, children, actions, hideTitle, closable, placement, size, }: DialogProps): React.JSX.Element;
|
|
29
|
-
/** Props for `AlertDialog`. */
|
|
30
|
-
export type AlertDialogProps = Common & {
|
|
31
|
-
/** The verb, repeating the action: "Delete 3 firings". Required; "OK" and "Confirm" are what this prevents. */
|
|
32
|
-
confirm: string;
|
|
33
|
-
/** Runs on confirm. When it returns a promise the dialog waits, shows the button busy, and stays open with the reason if it rejects. */
|
|
34
|
-
onConfirm: () => void | Promise<unknown>;
|
|
35
|
-
/** The safe choice, which has initial focus. Default "Cancel". */
|
|
36
|
-
cancel?: string;
|
|
37
|
-
/** `destructive` fills the confirm button with the destructive role. Default `destructive`. */
|
|
38
|
-
tone?: "destructive" | "default";
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* A confirm for what cannot be undone. Names the object and the consequence in `title`, repeats the
|
|
42
|
-
* verb on the confirm button, focuses Cancel first and ignores outside presses.
|
|
43
|
-
*/
|
|
44
|
-
export declare function AlertDialog({ title, description, trigger, open, onOpenChange, className, confirm, onConfirm, cancel, tone, }: AlertDialogProps): React.JSX.Element;
|
|
45
|
-
export {};
|