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,50 +0,0 @@
|
|
|
1
|
-
import { Grid } from '../lib/sequence';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** One window of the sequence. Windows tile the axis: each starts where the one before ends. */
|
|
4
|
-
export type SequenceItem = {
|
|
5
|
-
id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
start: number;
|
|
8
|
-
end: number;
|
|
9
|
-
};
|
|
10
|
-
/** The room a cut has: the earliest and latest time it may take, with the reason for each end. */
|
|
11
|
-
export type CutRoom = {
|
|
12
|
-
min: number;
|
|
13
|
-
max: number;
|
|
14
|
-
minReason?: string;
|
|
15
|
-
maxReason?: string;
|
|
16
|
-
};
|
|
17
|
-
/** A cut's change: the two windows with their new edges. */
|
|
18
|
-
export type CutChange = {
|
|
19
|
-
before: SequenceItem;
|
|
20
|
-
after: SequenceItem;
|
|
21
|
-
};
|
|
22
|
-
export type SequenceTimelineProps = {
|
|
23
|
-
/** Names the sequence: "Film, windows in order". Required. */
|
|
24
|
-
label: string;
|
|
25
|
-
/** The windows in time order, each starting where the last ends. */
|
|
26
|
-
items: readonly SequenceItem[];
|
|
27
|
-
/** Pixels per second; leave out to fit the width. */
|
|
28
|
-
zoom?: number;
|
|
29
|
-
/** A cut was moved (dragged and let go, or stepped by key). The app applies it. */
|
|
30
|
-
onCutChange: (boundaryIndex: number, time: number, change: CutChange) => void;
|
|
31
|
-
/** The room for the cut between `items[i]` and `items[i + 1]`. Default: each window keeps `minLength`. */
|
|
32
|
-
room?: (boundaryIndex: number) => CutRoom;
|
|
33
|
-
/** The shortest a window may be when `room` is not given. Default 0.1 s. */
|
|
34
|
-
minLength?: number;
|
|
35
|
-
/** A beat grid: a step in seconds, or the beats' times. Cuts snap to it and arrows step along it. */
|
|
36
|
-
grid?: Grid;
|
|
37
|
-
/** The arrow-key step when there is no grid. Default 0.1 s. */
|
|
38
|
-
step?: number;
|
|
39
|
-
/** The windows chosen, as ids. */
|
|
40
|
-
selected?: readonly string[];
|
|
41
|
-
/** A window or a run (Shift+click) was chosen: ids in order. */
|
|
42
|
-
onSelectRange?: (ids: readonly string[]) => void;
|
|
43
|
-
/** The inside of a window, such as a thumbnail; it gets the window and whether it is chosen. */
|
|
44
|
-
renderItem?: (item: SequenceItem, selected: boolean) => React.ReactNode;
|
|
45
|
-
/** The height of the strip. Default 5rem. */
|
|
46
|
-
height?: string;
|
|
47
|
-
className?: string;
|
|
48
|
-
};
|
|
49
|
-
/** A gapless strip of windows whose cuts are dragged or stepped, snapping to a beat grid inside the room the app gives; each cut is a slider that announces both windows' new lengths; Shift+click chooses a run. */
|
|
50
|
-
export declare function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength, grid, step, selected, onSelectRange, renderItem, height, className, }: SequenceTimelineProps): React.JSX.Element;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Shortcut } from './hotkeys';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** The keys a person has chosen, by shortcut id; an action absent here keeps its default keys. */
|
|
4
|
-
export type ShortcutOverrides = Record<string, string[]>;
|
|
5
|
-
/** What `useRebindableShortcuts` returns: the list to hand to `useHotkeys` and `KeysLegend`, and what `ShortcutEditor` edits. */
|
|
6
|
-
export type Rebinding = {
|
|
7
|
-
/** The defaults with the person's keys: give this to `useHotkeys` and `KeysLegend`. */
|
|
8
|
-
shortcuts: Shortcut[];
|
|
9
|
-
/** The defaults the editor resets to. */
|
|
10
|
-
defaults: readonly Shortcut[];
|
|
11
|
-
overrides: ShortcutOverrides;
|
|
12
|
-
/** Whether an action has other keys than its default. */
|
|
13
|
-
isChanged: (id: string) => boolean;
|
|
14
|
-
/** Sets an action's keys (or `null` to go back to its default). */
|
|
15
|
-
setKeys: (id: string, keys: string[] | null) => void;
|
|
16
|
-
/** Back to the defaults, every action. */
|
|
17
|
-
resetAll: () => void;
|
|
18
|
-
};
|
|
19
|
-
/** Holds a person's rebound keys over a default `Shortcut[]`, remembered under `storageKey` and handed to `onChange`. The result's `shortcuts` is what `useHotkeys` and `KeysLegend` take. */
|
|
20
|
-
export declare function useRebindableShortcuts(defaults: readonly Shortcut[], { storageKey, initial, onChange }?: {
|
|
21
|
-
storageKey?: string;
|
|
22
|
-
initial?: ShortcutOverrides;
|
|
23
|
-
onChange?: (overrides: ShortcutOverrides) => void;
|
|
24
|
-
}): Rebinding;
|
|
25
|
-
/** What a pressed key means for one action: take it, refuse it with a reason, or ask about the action that already has it. */
|
|
26
|
-
export type KeyCheck = {
|
|
27
|
-
ok: true;
|
|
28
|
-
key: string;
|
|
29
|
-
} | {
|
|
30
|
-
ok: false;
|
|
31
|
-
reason: string;
|
|
32
|
-
} | {
|
|
33
|
-
ok: "conflict";
|
|
34
|
-
key: string;
|
|
35
|
-
other: Shortcut;
|
|
36
|
-
};
|
|
37
|
-
/** Judges a key pressed while recording for the shortcut `id`, against the current list. */
|
|
38
|
-
export declare function checkKey(e: Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey" | "altKey" | "shiftKey">, id: string, shortcuts: readonly Shortcut[]): KeyCheck;
|
|
39
|
-
/** Each shortcut with its keys and a "Change" that records the next key pressed; refuses keys that cannot be bound, names a conflict and offers a swap, and resets one or all. Edits the list a `useRebindableShortcuts` holds. */
|
|
40
|
-
export declare function ShortcutEditor({ rebinding, label, className }: {
|
|
41
|
-
rebinding: Rebinding;
|
|
42
|
-
label?: string;
|
|
43
|
-
className?: string;
|
|
44
|
-
}): React.JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Where a drop landed, relative to the item with `key`. */
|
|
3
|
-
export type DropTarget = {
|
|
4
|
-
key: string;
|
|
5
|
-
position: "before" | "after" | "on";
|
|
6
|
-
} | {
|
|
7
|
-
key: null;
|
|
8
|
-
position: "root";
|
|
9
|
-
};
|
|
10
|
-
export type SortableListProps<T> = {
|
|
11
|
-
/** Names the list ("Tracks"). Required. */
|
|
12
|
-
label: string;
|
|
13
|
-
items: readonly T[];
|
|
14
|
-
getKey: (item: T) => string;
|
|
15
|
-
/** The item's name for a screen reader, typeahead and announcements ("Picked up Moonbeam bowl"). */
|
|
16
|
-
getLabel: (item: T) => string;
|
|
17
|
-
/** The row's content, beside the grip. Plain text and marks; actions go in `renderActions`. */
|
|
18
|
-
children: (item: T) => React.ReactNode;
|
|
19
|
-
/** Controls for the row (a `RowAction`), outside the row's selection target. */
|
|
20
|
-
renderActions?: (item: T) => React.ReactNode;
|
|
21
|
-
/** Shown when the list is empty, and "Drop here" while something is dragged over it. */
|
|
22
|
-
empty: React.ReactNode;
|
|
23
|
-
/** The item was moved within this list: `keys` now sit at `target`. */
|
|
24
|
-
onReorder: (keys: string[], target: DropTarget) => void;
|
|
25
|
-
/** An item of another list was dropped here. The app finds it by id and moves it. Needs `accepts`. */
|
|
26
|
-
onInsert?: (ids: string[], target: DropTarget) => void;
|
|
27
|
-
/** What an item is, for deciding which lists take it. Default: every item is "item". */
|
|
28
|
-
getKind?: (item: T) => string;
|
|
29
|
-
/** Kinds this list takes from other lists. Default none: it only reorders. */
|
|
30
|
-
accepts?: readonly string[];
|
|
31
|
-
/** Why a kind is refused, in the product's words, shown while one is dragged over: `{ text: "Tracks take video and audio, not text clips." }`. React Aria cannot list what is being dragged, only ask about a kind, so name the kinds that exist. */
|
|
32
|
-
refuses?: Readonly<Record<string, string>>;
|
|
33
|
-
selectionMode?: "none" | "single" | "multiple";
|
|
34
|
-
selectedKeys?: ReadonlySet<string>;
|
|
35
|
-
onSelectionChange?: (keys: Set<string>) => void;
|
|
36
|
-
className?: string;
|
|
37
|
-
};
|
|
38
|
-
/** A list that reorders by drag and by keyboard, and takes items from other lists by kind. It reports what was asked and never changes the data itself. */
|
|
39
|
-
export declare function SortableList<T>({ label, items, getKey, getLabel, children, renderActions, empty, onReorder, onInsert, getKind, accepts, refuses, selectionMode, selectedKeys, onSelectionChange, className, }: SortableListProps<T>): React.JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IconComponent } from '../lib/icon';
|
|
2
|
-
export type Tone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
3
|
-
/** A status as a word on a pale tint of its tone, with an optional icon. Never colour alone. */
|
|
4
|
-
export declare function Status({ tone, icon: Icon, children, className, }: {
|
|
5
|
-
tone: Tone;
|
|
6
|
-
icon?: IconComponent;
|
|
7
|
-
children: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
}): import('react').JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Props for `Switch`. */
|
|
3
|
-
export type SwitchProps = {
|
|
4
|
-
/** What it turns on, as the visible label: "Show elevation profile". Required. */
|
|
5
|
-
label: string;
|
|
6
|
-
/** A muted second line under the label. */
|
|
7
|
-
detail?: string;
|
|
8
|
-
on?: boolean;
|
|
9
|
-
defaultOn?: boolean;
|
|
10
|
-
onChange?: (on: boolean) => void;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
className?: string;
|
|
13
|
-
};
|
|
14
|
-
/** An on/off setting that applies at once, its label and control one target. */
|
|
15
|
-
export declare function Switch({ label, detail, on, defaultOn, onChange, disabled, className }: SwitchProps): React.JSX.Element;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Poll } from '../query/poll';
|
|
2
|
-
import { Load } from './data-view';
|
|
3
|
-
import { MeterThreshold } from './meter';
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
/** A folder the server watches, as `GET /api/system` reports it. */
|
|
6
|
-
export type SystemFolder = {
|
|
7
|
-
name: string;
|
|
8
|
-
path: string;
|
|
9
|
-
exists: boolean;
|
|
10
|
-
free_bytes: number | null;
|
|
11
|
-
total_bytes: number | null;
|
|
12
|
-
};
|
|
13
|
-
/** A service the app calls, with its health as the service's own health endpoint answered just now. */
|
|
14
|
-
export type SystemService = {
|
|
15
|
-
name: string;
|
|
16
|
-
ok: boolean;
|
|
17
|
-
version?: string | null;
|
|
18
|
-
detail?: string | null;
|
|
19
|
-
url?: string;
|
|
20
|
-
};
|
|
21
|
-
/** What `SystemPanel` draws: the shape of strata-python's `SystemInfo` (the generated schema satisfies it, extra fields and all). */
|
|
22
|
-
export type SystemInfoLike = {
|
|
23
|
-
version: string;
|
|
24
|
-
commit?: string | null;
|
|
25
|
-
python: string;
|
|
26
|
-
platform: string;
|
|
27
|
-
started_at: string;
|
|
28
|
-
folders: SystemFolder[];
|
|
29
|
-
services: SystemService[];
|
|
30
|
-
};
|
|
31
|
-
/** The shared limits for a folder's disk, as shares of its size: filling up at 80%, nearly full at 95%. */
|
|
32
|
-
export declare const diskThresholds: MeterThreshold[];
|
|
33
|
-
/** Reads `GET /api/system` (or another path) as a `Load` for `SystemPanel`, polled when given a `Poll`. Behind a reverse proxy the path is put under the app's base. */
|
|
34
|
-
export declare function useSystemInfo<T extends SystemInfoLike = SystemInfoLike>({ path, poll }?: {
|
|
35
|
-
path?: string;
|
|
36
|
-
poll?: Poll;
|
|
37
|
-
}): Load<T>;
|
|
38
|
-
/** A fact of the server the panel does not know, drawn with the others: a term and its value. */
|
|
39
|
-
export type SystemFact = {
|
|
40
|
-
term: string;
|
|
41
|
-
value: React.ReactNode;
|
|
42
|
-
};
|
|
43
|
-
/** The system panel's props. */
|
|
44
|
-
export type SystemPanelProps = {
|
|
45
|
-
/** The read: `useSystemInfo()`, or `useLoad` on the route with the app's own types. */
|
|
46
|
-
load: Load<SystemInfoLike>;
|
|
47
|
-
/** Limits for a folder's disk, as shares of its size. Default `diskThresholds`. */
|
|
48
|
-
thresholds?: MeterThreshold[];
|
|
49
|
-
/** The app's own facts (greetings kept, queue length), drawn under the server's. */
|
|
50
|
-
facts?: SystemFact[];
|
|
51
|
-
/** "Now", for the uptime (tests and screenshots). */
|
|
52
|
-
now?: Date;
|
|
53
|
-
/** The level of the panel's three headings (Server, Folders, Services). Default 2; a page that wraps the panel in its own `h2` section passes 3 so the outline nests (#348). */
|
|
54
|
-
headingLevel?: 2 | 3 | 4;
|
|
55
|
-
className?: string;
|
|
56
|
-
};
|
|
57
|
-
/** About this server, from `GET /api/system`: version and commit, when it started, each folder's disk as a meter with its state in words, and each service as Up or Down. Loaded through `DataView`, with a skeleton and the stale notice. */
|
|
58
|
-
export declare function SystemPanel({ load, thresholds, facts, now, headingLevel, className }: SystemPanelProps): React.JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type TabItem = {
|
|
3
|
-
value: string;
|
|
4
|
-
label: string;
|
|
5
|
-
};
|
|
6
|
-
/** Tabs whose selection lives in a URL search parameter (React Router), with the ARIA tabs keyboard model. */
|
|
7
|
-
export declare function Tabs({ param, items, label, children, className, }: {
|
|
8
|
-
/** The search parameter that holds the selected tab. */
|
|
9
|
-
param: string;
|
|
10
|
-
items: TabItem[];
|
|
11
|
-
/** Names the tab list for screen readers. */
|
|
12
|
-
label: string;
|
|
13
|
-
/** Renders the selected panel. */
|
|
14
|
-
children: (value: string) => React.ReactNode;
|
|
15
|
-
className?: string;
|
|
16
|
-
}): React.JSX.Element;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { DensityName } from './density';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** What a person chose: follow the operating system, or a fixed light or dark theme. */
|
|
4
|
-
export type ColorSchemePreference = "system" | "light" | "dark";
|
|
5
|
-
/** The scheme in effect after "system" is resolved. */
|
|
6
|
-
export type ColorScheme = "light" | "dark";
|
|
7
|
-
/** The localStorage key `ThemeProvider` uses unless given another. */
|
|
8
|
-
export declare const COLOR_SCHEME_STORAGE_KEY = "strata-color-scheme";
|
|
9
|
-
/** A palette Strata ships: its name (the `data-palette` value) and the words `PaletteChoice` shows. */
|
|
10
|
-
export type PaletteOption = {
|
|
11
|
-
name: string;
|
|
12
|
-
label: string;
|
|
13
|
-
detail?: string;
|
|
14
|
-
};
|
|
15
|
-
/** The palettes in `strata.css`: the default first, then four others. An app that adds its own in CSS passes its own list to `PaletteChoice`. */
|
|
16
|
-
export declare const palettes: readonly PaletteOption[];
|
|
17
|
-
/** The default palette: the plain `:root` look, with no override. */
|
|
18
|
-
export declare const DEFAULT_PALETTE = "petrol";
|
|
19
|
-
/** The localStorage key `ThemeProvider` keeps the palette under unless given another. */
|
|
20
|
-
export declare const PALETTE_STORAGE_KEY = "strata-palette";
|
|
21
|
-
/** The operating system's colour scheme, kept current as it changes. Light where it cannot be read (the server, jsdom). */
|
|
22
|
-
export declare function useSystemColorScheme(): ColorScheme;
|
|
23
|
-
/** What `useColorScheme` returns: the chosen preference, the scheme in effect, and a setter that persists the choice. */
|
|
24
|
-
export type ColorSchemeState = {
|
|
25
|
-
preference: ColorSchemePreference;
|
|
26
|
-
scheme: ColorScheme;
|
|
27
|
-
setPreference: (preference: ColorSchemePreference) => void;
|
|
28
|
-
};
|
|
29
|
-
/** What `usePalette` returns: the palette name in effect and a setter that persists it. */
|
|
30
|
-
export type PaletteState = {
|
|
31
|
-
palette: string;
|
|
32
|
-
setPalette: (palette: string) => void;
|
|
33
|
-
};
|
|
34
|
-
/** Sets the `.dark` class strata.css keys on, from a system, light or dark preference that persists in localStorage when it can. */
|
|
35
|
-
export declare function ThemeProvider({ children, defaultPreference, storageKey, defaultPalette, paletteStorageKey, target, density, }: {
|
|
36
|
-
children: React.ReactNode;
|
|
37
|
-
/** The preference before a person has chosen one. */
|
|
38
|
-
defaultPreference?: ColorSchemePreference;
|
|
39
|
-
/** Where the choice is kept in localStorage; `null` keeps it for this visit only. */
|
|
40
|
-
storageKey?: string | null;
|
|
41
|
-
/** The palette before a person has chosen one: a `data-palette` name from `palettes` (or the app's own). Left out, the default palette. */
|
|
42
|
-
defaultPalette?: string;
|
|
43
|
-
/** Where the palette is kept in localStorage; `null` keeps it for this visit only. */
|
|
44
|
-
paletteStorageKey?: string | null;
|
|
45
|
-
/**
|
|
46
|
-
* The element that gets the `.dark` class; the document's root element when left out. A nested
|
|
47
|
-
* target can turn a light page's panel dark, not the reverse: strata.css keys dark on any
|
|
48
|
-
* `.dark` ancestor. Pass the element itself (keep it in state with a callback ref, since a
|
|
49
|
-
* wrapping element's ref is not attached yet when this provider's effect first runs); `null`
|
|
50
|
-
* means it has not mounted yet, and nothing is set until it has.
|
|
51
|
-
*/
|
|
52
|
-
target?: HTMLElement | null;
|
|
53
|
-
/**
|
|
54
|
-
* How much the screen packs in, set on the same element as the colour scheme (the root, so
|
|
55
|
-
* overlays are reached): `compact` for a tool screen. See `Density`. Left out, nothing is set.
|
|
56
|
-
*/
|
|
57
|
-
density?: DensityName;
|
|
58
|
-
}): React.JSX.Element;
|
|
59
|
-
/** The person's colour-scheme preference, the scheme in effect, and a setter that persists it. Must be inside `ThemeProvider`. */
|
|
60
|
-
export declare function useColorScheme(): ColorSchemeState;
|
|
61
|
-
/**
|
|
62
|
-
* The body of an inline `<script>` for the page's `<head>` that sets `.dark` before the first
|
|
63
|
-
* paint, from the stored choice or the operating system, so a dark page does not flash light while
|
|
64
|
-
* the bundle loads. Pass the same key and default as the `ThemeProvider`.
|
|
65
|
-
*/
|
|
66
|
-
export declare function colorSchemeScript(storageKey?: string, defaultPreference?: ColorSchemePreference): string;
|
|
67
|
-
/** The words `ColorSchemeChoice` shows for each preference. */
|
|
68
|
-
export type ColorSchemeLabels = Record<ColorSchemePreference, {
|
|
69
|
-
label: string;
|
|
70
|
-
detail?: string;
|
|
71
|
-
}>;
|
|
72
|
-
/** The three colour-scheme preferences as radio buttons, bound to the nearest `ThemeProvider`. A list for a settings page, or `compact` icon segments named "Appearance" for a header. */
|
|
73
|
-
export declare function ColorSchemeChoice({ legend, labels, compact, className, }: {
|
|
74
|
-
/** The group's name, as the page words it. Defaults to "Theme", or "Appearance" when `compact`. */
|
|
75
|
-
legend?: string;
|
|
76
|
-
/** Overrides the words for each choice, in the product's voice. */
|
|
77
|
-
labels?: Partial<ColorSchemeLabels>;
|
|
78
|
-
/** Three icon segments for a header or footer, for an app with no settings page. */
|
|
79
|
-
compact?: boolean;
|
|
80
|
-
/** Layout at the call site (compact only). */
|
|
81
|
-
className?: string;
|
|
82
|
-
}): React.JSX.Element;
|
|
83
|
-
/** The palette in effect and a setter that persists it. Must be inside `ThemeProvider`. */
|
|
84
|
-
export declare function usePalette(): PaletteState;
|
|
85
|
-
/**
|
|
86
|
-
* The body of an inline `<script>` for the page's `<head>` that sets `data-palette` before the first paint
|
|
87
|
-
* from the stored choice, so a page does not flash the default palette while the bundle loads. Pass the
|
|
88
|
-
* same key and default as the `ThemeProvider`; put it beside `colorSchemeScript()`.
|
|
89
|
-
*/
|
|
90
|
-
export declare function paletteScript(storageKey?: string, defaultPalette?: string): string;
|
|
91
|
-
/**
|
|
92
|
-
* The palettes as radio buttons, bound to the nearest `ThemeProvider`, each with a swatch drawn in its own
|
|
93
|
-
* palette (primary and the one warm accent) so the colours are seen before they are chosen. A list for a
|
|
94
|
-
* settings page, or `compact` swatches named "Palette" for a header. The words are always present (the
|
|
95
|
-
* list shows them, the compact form names each swatch and shows the same words as a tooltip).
|
|
96
|
-
*/
|
|
97
|
-
export declare function PaletteChoice({ legend, options, compact, className, }: {
|
|
98
|
-
/** The group's name, as the page words it. Defaults to "Palette". */
|
|
99
|
-
legend?: string;
|
|
100
|
-
/** The palettes offered: names that `strata.css` (or the app's own CSS) defines under `data-palette`, with their words. Defaults to `palettes`. */
|
|
101
|
-
options?: readonly PaletteOption[];
|
|
102
|
-
/** Swatches only, for a header or footer, for an app with no settings page. */
|
|
103
|
-
compact?: boolean;
|
|
104
|
-
/** Layout at the call site (compact only). */
|
|
105
|
-
className?: string;
|
|
106
|
-
}): React.JSX.Element;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { PictureRegion } from '../lib/boxes';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** Forgets which pictures `Thumbnail` has loaded, so a test that checks the loading state starts from nothing. `renderWithStrata` and `renderRoutes` call it. */
|
|
4
|
-
export declare function forgetLoadedThumbnails(): void;
|
|
5
|
-
/** A width-over-height ratio: a number (`1.5`) or a fraction (`"4/3"`). */
|
|
6
|
-
export type AspectRatio = number | `${number}/${number}`;
|
|
7
|
-
/** The thumbnail's props. Either `missing` (the words shown when there is no image) or a `fallback` drawing is required. */
|
|
8
|
-
export type ThumbnailProps = {
|
|
9
|
-
/** The image URL, or a list of them tried in order (the next one when a request fails or `onLoad` rejects it). `null` or an empty list when the record has no photo: the `missing` words show without a request. */
|
|
10
|
-
src: string | readonly string[] | null;
|
|
11
|
-
/** What the photo shows ("Celadon bowl, front"). `""` only when the text beside it already says it. */
|
|
12
|
-
alt: string;
|
|
13
|
-
/** Width over height. The box has this shape before the image loads. Default `1`. */
|
|
14
|
-
aspect?: AspectRatio;
|
|
15
|
-
/** `cover` crops to fill the box (default); `contain` fits the whole image in it. */
|
|
16
|
-
fit?: "cover" | "contain";
|
|
17
|
-
srcSet?: string;
|
|
18
|
-
sizes?: string;
|
|
19
|
-
/** Load at once rather than when near the screen: for the first few above the fold. */
|
|
20
|
-
eager?: boolean;
|
|
21
|
-
/** How far outside the scroll region the request starts (IntersectionObserver `rootMargin`). */
|
|
22
|
-
rootMargin?: string;
|
|
23
|
-
/** Layout at the call site: a width (`w-24`, `w-full`), or `rounded-pill` for an avatar. The height follows from `aspect`. */
|
|
24
|
-
className?: string;
|
|
25
|
-
/** Sees each image that loaded, with the index of its source. Return `false` to reject it (a host's grey placeholder answered with a 200): the next source is tried, or the missing state shows. */
|
|
26
|
-
onLoad?: (image: HTMLImageElement, index: number) => boolean | void;
|
|
27
|
-
/** Called once when the thumbnail ends in its missing state after a request failed or was rejected, never for a record with no source. */
|
|
28
|
-
onMissing?: () => void;
|
|
29
|
-
/** Show one box of the picture, filling the thumbnail (a face from a photo): the picture's size, the box in its pixels and `pad`, how many times the box the crop is (default 1.6). `fit` does not apply. */
|
|
30
|
-
region?: PictureRegion;
|
|
31
|
-
/** Overlays drawn above the image in the same box (a running time, a "Saved" badge), in place whether the image has loaded, failed or is missing. */
|
|
32
|
-
children?: React.ReactNode;
|
|
33
|
-
} & ({
|
|
34
|
-
/** What to show when there is no photo or it cannot be loaded, in the product's words: "Photo not found". */
|
|
35
|
-
missing: string;
|
|
36
|
-
/** Drawn instead of the icon and `missing` words when there is no image: a letter on a disc for an avatar. */
|
|
37
|
-
fallback?: React.ReactNode;
|
|
38
|
-
} | {
|
|
39
|
-
/** Added to the missing state's name after `alt` ("Night Sky: No picture"), when given. */
|
|
40
|
-
missing?: string;
|
|
41
|
-
/** Drawn when there is no image or it cannot be loaded: a letter on a disc for an avatar. */
|
|
42
|
-
fallback: React.ReactNode;
|
|
43
|
-
});
|
|
44
|
-
/** A box of fixed aspect ratio for a remote image: a skeleton until it loads, the `missing` words (or a `fallback`) if it cannot, a request only when it nears the screen, and `children` overlaid in its corners. `alt` and `missing` or `fallback` are required. */
|
|
45
|
-
export declare function Thumbnail({ src, alt, missing, aspect, fit, srcSet, sizes, eager, rootMargin, className, fallback, onLoad, onMissing, region, children, }: ThumbnailProps): React.JSX.Element;
|
|
46
|
-
/** The loading shape of a `Thumbnail`, for a `DataView` skeleton: the same box and aspect ratio, so nothing moves when the list arrives. */
|
|
47
|
-
export declare function ThumbnailSkeleton({ aspect, className }: {
|
|
48
|
-
aspect?: AspectRatio;
|
|
49
|
-
className?: string;
|
|
50
|
-
}): React.JSX.Element;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Size } from 'react-stately';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** The frame each picture is drawn in. */
|
|
4
|
-
export type TileAspect = "square" | "portrait" | "landscape";
|
|
5
|
-
/** Smallest tile width: `sm` 96px (dense crops), `md` 144px, `lg` 192px. Tiles grow to fill the row. */
|
|
6
|
-
export type TileSize = "sm" | "md" | "lg";
|
|
7
|
-
export declare const minWidth: Record<TileSize, number>;
|
|
8
|
-
export declare const aspectClass: Record<TileAspect, string>;
|
|
9
|
-
/** A tile size as pixels: a named size's minimum width, or the number itself (a continuous size, issue #246). */
|
|
10
|
-
export declare const tileWidth: (size: TileSize | number) => number;
|
|
11
|
-
/** `GridLayout` options for tiles of this size and aspect: they grow from the minimum width to fill the row, and each row is as tall as its tallest tile as measured. */
|
|
12
|
-
export declare function tileLayoutOptions(tileSize: TileSize | number, aspect: TileAspect | number): {
|
|
13
|
-
minItemSize: Size;
|
|
14
|
-
minSpace: Size;
|
|
15
|
-
};
|
|
16
|
-
type TileGridBase<T> = {
|
|
17
|
-
/** Names the grid of tiles: "Pages of the Punch book". */
|
|
18
|
-
label: string;
|
|
19
|
-
items: T[];
|
|
20
|
-
itemKey: (item: T) => string;
|
|
21
|
-
/** The tile's name for assistive technology, one sentence: "Page 14, 4, 368 words, needs a look". */
|
|
22
|
-
itemLabel: (item: T) => string;
|
|
23
|
-
/** The picture, drawn to fill a frame of `aspect`. An `<img className="size-full object-cover">` or a `Thumbnail`. */
|
|
24
|
-
renderImage: (item: T) => React.ReactNode;
|
|
25
|
-
/** One line under the picture: the name ("Page 14, 4"). Truncated. */
|
|
26
|
-
caption?: (item: T) => React.ReactNode;
|
|
27
|
-
/** A quieter line under the caption: "368 words", "blank". Truncated. */
|
|
28
|
-
detail?: (item: T) => React.ReactNode;
|
|
29
|
-
/** In the picture's top right corner: a `Status` ("Look"). Return `null` for a tile with nothing to say. */
|
|
30
|
-
badge?: (item: T) => React.ReactNode;
|
|
31
|
-
/** Default `square`. `portrait` is 3:4, `landscape` 4:3. */
|
|
32
|
-
aspect?: TileAspect;
|
|
33
|
-
/** Default `md`. */
|
|
34
|
-
tileSize?: TileSize;
|
|
35
|
-
/** Tile count from which only the visible rows of tiles render. Default 100. */
|
|
36
|
-
virtualizeFrom?: number;
|
|
37
|
-
/** Height of the scroll region once virtualised, in px. Default 480. */
|
|
38
|
-
maxHeight?: number;
|
|
39
|
-
className?: string;
|
|
40
|
-
};
|
|
41
|
-
/** A tile always does something: it is a link (`href`: a route in the app or a URL) or an action, never neither. */
|
|
42
|
-
export type TileGridProps<T> = TileGridBase<T> & ({
|
|
43
|
-
/** Where a tile goes: a route path in this app (client navigation, the router's basename applied) or a full URL. */
|
|
44
|
-
href: (item: T) => string;
|
|
45
|
-
onAction?: (item: T) => void;
|
|
46
|
-
} | {
|
|
47
|
-
href?: undefined;
|
|
48
|
-
onAction: (item: T) => void;
|
|
49
|
-
});
|
|
50
|
-
/** A grid of picture tiles that open something: a labelled list of links (or actions), two-dimensional arrow keys, a caption, a detail line and a corner badge on each, virtualised from `virtualizeFrom` tiles. No selection: use `SelectableGrid` for that. */
|
|
51
|
-
export declare function TileGrid<T>({ label, items, itemKey, itemLabel, renderImage, caption, detail, badge, href, onAction, aspect, tileSize, virtualizeFrom, maxHeight, className, }: TileGridProps<T>): React.JSX.Element;
|
|
52
|
-
/** The loading shape of a `TileGrid`: `count` picture boxes in the same grid at the same sizes, for a `DataView` skeleton, so nothing moves when the tiles arrive. */
|
|
53
|
-
export declare function TileGridSkeleton({ count, aspect, tileSize, className }: {
|
|
54
|
-
count?: number;
|
|
55
|
-
aspect?: TileAspect;
|
|
56
|
-
tileSize?: TileSize;
|
|
57
|
-
className?: string;
|
|
58
|
-
}): React.JSX.Element;
|
|
59
|
-
/** The loading shape of a `SelectableGrid`: `count` picture boxes at the grid's tile size and shape, for a `DataView` skeleton. With `shapes` (widths over heights, cycled) the boxes are in rows at their own shapes, as `aspect="natural"` draws them. */
|
|
60
|
-
export declare function SelectableGridSkeleton({ count, aspect, tileSize, shapes, className }: {
|
|
61
|
-
count?: number;
|
|
62
|
-
aspect?: TileAspect | number;
|
|
63
|
-
tileSize?: TileSize | number;
|
|
64
|
-
shapes?: readonly number[];
|
|
65
|
-
className?: string;
|
|
66
|
-
}): React.JSX.Element;
|
|
67
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TimelineClock } from './use-timeline';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export type TimelinePlayerProps = {
|
|
4
|
-
/** From `useTimeline`. */
|
|
5
|
-
clock: TimelineClock;
|
|
6
|
-
/** Names the player and its controls: "Movement replay". */
|
|
7
|
-
label: string;
|
|
8
|
-
/** The picture, drawn from `clock.time` (give `SceneViewport` `time={clock.time}`). */
|
|
9
|
-
stage: React.ReactNode;
|
|
10
|
-
/** The speeds offered, with `onRateChange` to change `useTimeline`'s `rate`. Without `onRateChange` the choice is not drawn. */
|
|
11
|
-
rates?: readonly number[];
|
|
12
|
-
onRateChange?: (rate: number) => void;
|
|
13
|
-
/** Show the legend of keys that are live now. Default false (an app usually has its own place for it). */
|
|
14
|
-
legend?: boolean;
|
|
15
|
-
className?: string;
|
|
16
|
-
};
|
|
17
|
-
/** A stage over a control bar for a timeline the app owns: transport, seek bar, time and speed, with the keys following the clock last used and the stage keeping its arrows. */
|
|
18
|
-
export declare function TimelinePlayer({ clock, label, stage, rates, onRateChange, legend, className }: TimelinePlayerProps): React.JSX.Element;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { DropItem } from 'react-aria-components';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export type TimelineItem = {
|
|
4
|
-
id: string;
|
|
5
|
-
/** The lane's id. */
|
|
6
|
-
lane: string;
|
|
7
|
-
start: number;
|
|
8
|
-
length: number;
|
|
9
|
-
/** The item's name, in the item and for a screen reader. */
|
|
10
|
-
label: string;
|
|
11
|
-
/** What kind of thing it is (video, audio, booking). Shown as a word and a colour stripe, never colour alone. Its colour is `kindColours[kind]`, else the chart palette in order of appearance. */
|
|
12
|
-
kind?: string;
|
|
13
|
-
};
|
|
14
|
-
export type TimelineLane = {
|
|
15
|
-
id: string;
|
|
16
|
-
label: string;
|
|
17
|
-
/** The app's controls for the lane (mute, lock, delete). Drawn in the lane's header, at the left. */
|
|
18
|
-
header?: React.ReactNode;
|
|
19
|
-
};
|
|
20
|
-
export type TimelineMarker = {
|
|
21
|
-
id: string;
|
|
22
|
-
time: number;
|
|
23
|
-
label: string;
|
|
24
|
-
};
|
|
25
|
-
/** What a move or trim would produce. */
|
|
26
|
-
export type TimelineChange = {
|
|
27
|
-
start: number;
|
|
28
|
-
length: number;
|
|
29
|
-
lane: string;
|
|
30
|
-
};
|
|
31
|
-
/** Where something dragged in from outside landed. */
|
|
32
|
-
export type TimelineDrop = TimelineChange & {
|
|
33
|
-
items: DropItem[];
|
|
34
|
-
};
|
|
35
|
-
export type TimelineProps = {
|
|
36
|
-
/** Names the timeline for a screen reader ("Firing schedule"). */
|
|
37
|
-
label: string;
|
|
38
|
-
lanes: readonly TimelineLane[];
|
|
39
|
-
items: readonly TimelineItem[];
|
|
40
|
-
/** The axis runs from this time. Default 0. */
|
|
41
|
-
from?: number;
|
|
42
|
-
/** ... to this time. */
|
|
43
|
-
to: number;
|
|
44
|
-
/** Pixels per unit of time. Controlled with `onZoomChange`. */
|
|
45
|
-
zoom: number;
|
|
46
|
-
onZoomChange?: (zoom: number) => void;
|
|
47
|
-
/** The current time, drawn as a rule across the lanes and set by the slider on the ruler. */
|
|
48
|
-
position?: number;
|
|
49
|
-
onPositionChange?: (time: number) => void;
|
|
50
|
-
/** Keep the current time in view as it advances. */
|
|
51
|
-
follow?: boolean;
|
|
52
|
-
markers?: readonly TimelineMarker[];
|
|
53
|
-
selectedIds?: ReadonlySet<string>;
|
|
54
|
-
/** The selection changed: `ids` is the whole new selection. */
|
|
55
|
-
onSelect?: (ids: string[]) => void;
|
|
56
|
-
/** The item was moved, trimmed or put in another lane. Not called for a change `validate` refused. */
|
|
57
|
-
onItemChange?: (id: string, next: TimelineChange) => void;
|
|
58
|
-
/** The person asked to remove the selection (Delete). The app does it, undoably. */
|
|
59
|
-
onDelete?: (ids: string[]) => void;
|
|
60
|
-
/** A reason a change cannot be made, in the product's words, or `null`. Called while dragging, so keep it cheap. */
|
|
61
|
-
validate?: (id: string, next: TimelineChange) => string | null;
|
|
62
|
-
/** Extra times items snap to, besides the edges of other items, markers and the current time. */
|
|
63
|
-
snapPoints?: readonly number[];
|
|
64
|
-
/** Turn snapping off. Default on. */
|
|
65
|
-
snap?: boolean;
|
|
66
|
-
/** One keyboard step, in time units. Default 1. */
|
|
67
|
-
step?: number;
|
|
68
|
-
/** Smallest an item may be, in time units. Default `step`. */
|
|
69
|
-
minLength?: number;
|
|
70
|
-
/** The colour of each kind's stripe, chosen by the app: a CSS colour, normally a role or a subject colour of its theme (`var(--info)`, `var(--kind-gpx)`). Without an entry a kind takes the chart palette in order of appearance, which moves when the set of kinds changes. */
|
|
71
|
-
kindColours?: Readonly<Record<string, string>>;
|
|
72
|
-
/** How many control heights tall each lane is. Default 1; 2 or 3 for items that draw thumbnails or a waveform. */
|
|
73
|
-
laneRows?: number;
|
|
74
|
-
/** Drag types a lane accepts from outside the timeline (`"text/plain"`, an app type). Without it nothing can be dropped. */
|
|
75
|
-
dropTypes?: readonly string[];
|
|
76
|
-
/** Length of an item dropped from outside, for the preview and for `validateDrop`. Default five steps. */
|
|
77
|
-
dropLength?: number;
|
|
78
|
-
/** Something was dropped on a lane at a time (snapped like a move). The app makes the item. Not called for a drop `validateDrop` refused. */
|
|
79
|
-
onDrop?: (drop: TimelineDrop) => void;
|
|
80
|
-
/** A reason a drop cannot be made, in the product's words, or `null`. Called while a drag is over a lane, so keep it cheap. */
|
|
81
|
-
validateDrop?: (next: TimelineChange) => string | null;
|
|
82
|
-
/** Draws an item's content (a strip of thumbnails, a waveform). Default: the label and kind. */
|
|
83
|
-
renderItem?: (item: TimelineItem, state: {
|
|
84
|
-
selected: boolean;
|
|
85
|
-
width: number;
|
|
86
|
-
}) => React.ReactNode;
|
|
87
|
-
/** A time as words ("0:14", "13:30"). Default `m:ss`, with tenths on the ruler when zoomed far in. Also labels the ruler when given, so a schedule in hours reads as clock times. */
|
|
88
|
-
formatTime?: (time: number) => string;
|
|
89
|
-
/** Shown instead of the lanes' area when there are no lanes. */
|
|
90
|
-
empty?: React.ReactNode;
|
|
91
|
-
className?: string;
|
|
92
|
-
};
|
|
93
|
-
/** Zoom state for a timeline: `zoomIn`, `zoomOut`, and `fit` to a viewport width. Pass `zoom` and `setZoom` as the timeline's `zoom` and `onZoomChange`. */
|
|
94
|
-
export declare function useTimelineZoom({ initial, min, max }?: {
|
|
95
|
-
initial?: number;
|
|
96
|
-
min?: number;
|
|
97
|
-
max?: number;
|
|
98
|
-
}): {
|
|
99
|
-
zoom: number;
|
|
100
|
-
setZoom: (z: number) => void;
|
|
101
|
-
zoomIn: () => void;
|
|
102
|
-
zoomOut: () => void;
|
|
103
|
-
/** Zoom so `duration` fills `viewportWidth` pixels. */
|
|
104
|
-
fit: (viewportWidth: number, duration: number) => void;
|
|
105
|
-
};
|
|
106
|
-
/** Zoom in, zoom out and fit, as named icon buttons for a timeline's toolbar. */
|
|
107
|
-
export declare function TimelineZoomControls({ zoom }: {
|
|
108
|
-
zoom: Pick<ReturnType<typeof useTimelineZoom>, "zoomIn" | "zoomOut"> & {
|
|
109
|
-
fit: () => void;
|
|
110
|
-
};
|
|
111
|
-
}): React.JSX.Element;
|
|
112
|
-
/** A rule that refuses an item overlapping another in its lane, for `validate`: names the item in the way. */
|
|
113
|
-
export declare function noOverlap(items: readonly TimelineItem[]): (id: string, next: TimelineChange) => string | null;
|
|
114
|
-
/** Items placed on a zoomable time axis in lanes, with a current-time rule and markers. Reports every move, trim, selection and time change; the app applies them. Keyboard-complete, and only the items near the view are rendered. */
|
|
115
|
-
export declare function Timeline({ label, lanes, items, from, to, zoom, onZoomChange, position, onPositionChange, follow, markers, selectedIds, onSelect, onItemChange, onDelete, validate, snapPoints, snap, step, minLength, renderItem, kindColours, laneRows, dropTypes, dropLength, onDrop, validateDrop, formatTime, empty, className, }: TimelineProps): React.JSX.Element;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** What a toast says. */
|
|
3
|
-
export type ToastContentProps = {
|
|
4
|
-
/** What finished, past tense, in the product's words: "Export finished". */
|
|
5
|
-
title: string;
|
|
6
|
-
/** One more sentence: what and where ("run.mp4, 2:31 at 1080p, in your Downloads folder."). */
|
|
7
|
-
description?: string;
|
|
8
|
-
/** `info` by default. There is no danger tone: an error the person must act on is an `Alert`. */
|
|
9
|
-
tone?: "info" | "success" | "warning";
|
|
10
|
-
/** One action beside the words. */
|
|
11
|
-
action?: {
|
|
12
|
-
label: string;
|
|
13
|
-
onPress: () => void;
|
|
14
|
-
};
|
|
15
|
-
/** Milliseconds before it goes. Defaults to enough to read the words. */
|
|
16
|
-
timeout?: number;
|
|
17
|
-
};
|
|
18
|
-
/** Milliseconds a toast stays: 5 s plus 40 ms a character, to at most 15 s, and at least 8 s with an action. */
|
|
19
|
-
export declare function toastTimeout(content: Pick<ToastContentProps, "title" | "description" | "action" | "timeout">): number;
|
|
20
|
-
/** The toast queue: `toast.show({ title })` from anywhere; `toast.close(key)`; `toast.clear()`. */
|
|
21
|
-
export declare const toast: {
|
|
22
|
-
/** Shows a toast and returns its key. */
|
|
23
|
-
show(content: ToastContentProps): string;
|
|
24
|
-
close(key: string): void;
|
|
25
|
-
clear(): void;
|
|
26
|
-
};
|
|
27
|
-
/** Props for `ToastRegion`. */
|
|
28
|
-
export type StrataToastRegionProps = {
|
|
29
|
-
/** Names the landmark. Default "Notifications". */
|
|
30
|
-
label?: string;
|
|
31
|
-
className?: string;
|
|
32
|
-
};
|
|
33
|
-
/** For tests: forget that the missing-region warning was given. */
|
|
34
|
-
export declare function resetToastWarnings(): void;
|
|
35
|
-
/** The one place toasts appear. Render it once at the app root; a second one mounted at the same time draws nothing and warns in development. A labelled landmark (F6), polite, above panes and the undo bar. */
|
|
36
|
-
export declare function StrataToastRegion({ label, className }: StrataToastRegionProps): React.JSX.Element | null;
|