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,19 +0,0 @@
|
|
|
1
|
-
import { Difference, Pixels } from '../lib/image-diff';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** How pictures become pixels. The default draws them on a canvas; supply another where that does not fit (an authenticated request, a picture the browser will not let a page read). */
|
|
4
|
-
export type ReadPixels = (src: string) => Promise<Pixels>;
|
|
5
|
-
/** The state of a difference: reading the pictures, unable to, or the result. */
|
|
6
|
-
export type DifferenceState = {
|
|
7
|
-
status: "loading";
|
|
8
|
-
} | {
|
|
9
|
-
status: "failed";
|
|
10
|
-
} | {
|
|
11
|
-
status: "ready";
|
|
12
|
-
difference: Difference;
|
|
13
|
-
};
|
|
14
|
-
/** The pixels that differ between two pictures at a tolerance (0 to 1), read only while `enabled`. */
|
|
15
|
-
export declare function useDifference(a: string, b: string, tolerance: number, enabled: boolean, read?: ReadPixels): DifferenceState;
|
|
16
|
-
/** The marks of a difference drawn over the picture: a canvas that fits its frame the way the picture does (`object-contain`). */
|
|
17
|
-
export declare function DifferenceMarks({ difference }: {
|
|
18
|
-
difference: Difference;
|
|
19
|
-
}): React.JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Open and closed disclosure state: controlled with `open` and `onOpenChange`, or uncontrolled from `defaultOpen`. */
|
|
3
|
-
export type DisclosureOpenProps = {
|
|
4
|
-
open: boolean;
|
|
5
|
-
onOpenChange: (open: boolean) => void;
|
|
6
|
-
defaultOpen?: never;
|
|
7
|
-
} | {
|
|
8
|
-
open?: never;
|
|
9
|
-
onOpenChange?: (open: boolean) => void;
|
|
10
|
-
defaultOpen?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type DisclosureProps = DisclosureOpenProps & {
|
|
13
|
-
/** The always-visible line, and the button's accessible name: text and marks, no controls. */
|
|
14
|
-
summary: React.ReactNode;
|
|
15
|
-
/** Mounted only while open, so a request inside runs when the person opens it. */
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
/** Controls for the row (a `RowAction`), beside the summary and outside its button. */
|
|
18
|
-
actions?: React.ReactNode;
|
|
19
|
-
className?: string;
|
|
20
|
-
};
|
|
21
|
-
/** Shows more of one thing in place: a button with `aria-expanded` around `summary`, and a body mounted only while open (so a request inside it runs on first open). Controlled with `open`/`onOpenChange` or `useExpanded`, or uncontrolled with `defaultOpen`. */
|
|
22
|
-
export declare function Disclosure({ summary, children, actions, open, defaultOpen, onOpenChange, className }: DisclosureProps): React.JSX.Element;
|
|
23
|
-
/** The disclosure chevron: points right when closed, down when open. Shared with `DataTable`'s row toggle. */
|
|
24
|
-
export declare function Chevron({ open, className }: {
|
|
25
|
-
open: boolean;
|
|
26
|
-
className?: string;
|
|
27
|
-
}): React.JSX.Element;
|
|
28
|
-
/** Which of many disclosures are open, by key: spread into `DataTable`'s `expansion`, or read with `isOpen`/`setOpen` for a list of `Disclosure`s. */
|
|
29
|
-
export type Expanded = {
|
|
30
|
-
/** Keys of the open items. */
|
|
31
|
-
expanded: ReadonlySet<string>;
|
|
32
|
-
/** Replaces the open set. `DataTable` calls this. */
|
|
33
|
-
onChange: (next: Set<string>) => void;
|
|
34
|
-
isOpen: (key: string) => boolean;
|
|
35
|
-
setOpen: (key: string, open: boolean) => void;
|
|
36
|
-
/** Opens a closed key, closes an open one (the same word as `WorkspaceState.toggle`). */
|
|
37
|
-
toggle: (key: string) => void;
|
|
38
|
-
collapseAll: () => void;
|
|
39
|
-
};
|
|
40
|
-
export type ExpandedOptions = {
|
|
41
|
-
/** Keep the open keys in this URL search parameter (`?open=a&open=b`), so an opened row can be linked and survives a reload. Needs a React Router context. */
|
|
42
|
-
param?: string;
|
|
43
|
-
/** Keys open at first. Ignored with `param`: there the URL says what is open, so a link that opens a row carries it. */
|
|
44
|
-
initial?: Iterable<string>;
|
|
45
|
-
/** Opening one closes the others (an accordion). Default false: people compare two rows. */
|
|
46
|
-
single?: boolean;
|
|
47
|
-
};
|
|
48
|
-
/** Shared open state for the disclosures of one list or table, optionally kept in the URL (`param`). */
|
|
49
|
-
export declare function useExpanded(options?: ExpandedOptions): Expanded;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** The completion moment for a rare, earned finish: what happened (past tense, with its object), what happens next, and optionally a figure drawn from the person's own data. Focus moves to the heading. */
|
|
3
|
-
export declare function Done({ title, next, figure, actions, focusOnMount, className, }: {
|
|
4
|
-
/** What happened, past tense, with its object. */
|
|
5
|
-
title: string;
|
|
6
|
-
/** What the person does now, or what happens next and when. */
|
|
7
|
-
next: React.ReactNode;
|
|
8
|
-
/** A drawing of the result made from the person's data in the subject's own terms. */
|
|
9
|
-
figure?: React.ReactNode;
|
|
10
|
-
actions?: React.ReactNode;
|
|
11
|
-
/** Off only where the result is not the page's subject (the state-matrix page). */
|
|
12
|
-
focusOnMount?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
}): React.JSX.Element;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/**
|
|
3
|
-
* The type every `DragSource` drag carries beside the app's own, so a drop target that takes only files (`FileDropZone`) can tell
|
|
4
|
-
* an in-app drag from a drag of files without the app declaring anything (issue #291). A drag started by `useDrag` carries only
|
|
5
|
-
* the types it is given, and React Aria's `DragTypes` cannot tell an app's `text/plain` from a dragged `.txt` file, so a type of
|
|
6
|
-
* our own is the one that can be recognised for certain.
|
|
7
|
-
*/
|
|
8
|
-
export declare const STRATA_DRAG_TYPE = "application/x-strata-drag";
|
|
9
|
-
/** One dragged item: each drag type it offers, with its value (`{ "application/x-clip": "clip-9", "text/plain": "run.mp4" }`). React Aria's `DragItem`. */
|
|
10
|
-
export type DragData = Record<string, string>;
|
|
11
|
-
/** Props for `DragSource`. */
|
|
12
|
-
export type DragSourceProps = {
|
|
13
|
-
/** What is dragged, as a person would say it ("GX010412.MP4"). Names the grip "Drag GX010412.MP4". */
|
|
14
|
-
label: string;
|
|
15
|
-
/** The data the drop receives, one entry per item: each maps a type to its value. Called when the drag starts. */
|
|
16
|
-
items: () => DragData[];
|
|
17
|
-
/** The drag started (pointer or keyboard). */
|
|
18
|
-
onDragStart?: () => void;
|
|
19
|
-
/** The drag ended. `dropped` is false when it was cancelled or let go where nothing took it. */
|
|
20
|
-
onDragEnd?: (dropped: boolean) => void;
|
|
21
|
-
/** Nothing can be dragged; the grip is drawn disabled. */
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
/** The row's own content, beside the grip. Its buttons keep working. */
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
/** Layout only. */
|
|
26
|
-
className?: string;
|
|
27
|
-
};
|
|
28
|
-
/** A row that can be dragged onto a drop target, such as a `Timeline` lane, by pointer or from the keyboard with its named grip. */
|
|
29
|
-
export declare function DragSource({ label, items, onDragStart, onDragEnd, disabled, children, className }: DragSourceProps): React.JSX.Element;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { ControlSize } from '../lib/control';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
type FieldState = {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
describedBy?: string;
|
|
7
|
-
invalid: boolean;
|
|
8
|
-
report: (message: string | undefined) => void;
|
|
9
|
-
};
|
|
10
|
-
/** @internal The surrounding Field, and where a control reports its own message. */
|
|
11
|
-
export declare function useFieldControl(): {
|
|
12
|
-
field: FieldState | null;
|
|
13
|
-
report: (message: string | undefined) => void;
|
|
14
|
-
};
|
|
15
|
-
export type FieldProps = {
|
|
16
|
-
label: string;
|
|
17
|
-
/** The control's id, when the page needs a known one (an anchor, a test). Generated otherwise. */
|
|
18
|
-
id?: string;
|
|
19
|
-
/** What the person needs to know before typing, such as limits or units. */
|
|
20
|
-
hint?: React.ReactNode;
|
|
21
|
-
/** What went wrong and how to fix it, in one sentence. Shown under the control, never in a toast. */
|
|
22
|
-
error?: string;
|
|
23
|
-
/** A button on the control's row, for a one-field form (an `AsyncButton` "Add"). The hint and error run under both; on a narrow screen it wraps under the control. */
|
|
24
|
-
action?: React.ReactNode;
|
|
25
|
-
children: React.ReactNode;
|
|
26
|
-
className?: string;
|
|
27
|
-
};
|
|
28
|
-
/** A labelled form field: wires the label, hint, error, `aria-describedby` and `aria-invalid` into the one control it wraps. */
|
|
29
|
-
export declare function Field({ label, id: idProp, hint, error, action, children, className }: FieldProps): React.JSX.Element;
|
|
30
|
-
/** A text input that picks up its id and descriptions from the surrounding `Field`. `size="sm"` is --control-h-sm; the native `size` (a width in characters) is not passed on. */
|
|
31
|
-
export declare function Input({ className, id, size, ...props }: Omit<React.ComponentProps<"input">, "size"> & {
|
|
32
|
-
size?: ControlSize;
|
|
33
|
-
}): React.JSX.Element;
|
|
34
|
-
/** A multi-line input that picks up its id and descriptions from the surrounding `Field`. */
|
|
35
|
-
export declare function Textarea({ className, id, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
|
36
|
-
/** The platform select, styled. The default for short lists, especially on touch screens. `size="sm"` is --control-h-sm. */
|
|
37
|
-
export declare function NativeSelect(props: NativeSelectProps): React.JSX.Element;
|
|
38
|
-
type PlainSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
|
|
39
|
-
size?: ControlSize;
|
|
40
|
-
};
|
|
41
|
-
/** Props of `NativeSelect`: a native select's own, or (with `param`) a choice held in the URL. */
|
|
42
|
-
export type NativeSelectProps = (PlainSelectProps & {
|
|
43
|
-
param?: undefined;
|
|
44
|
-
paramDefault?: undefined;
|
|
45
|
-
}) | (Omit<PlainSelectProps, "value" | "defaultValue" | "onChange"> & {
|
|
46
|
-
/** The search parameter that holds the choice (`?mode=…`), so it can be linked and survives a reload. */
|
|
47
|
-
param: string;
|
|
48
|
-
/** The option that is chosen when the URL says nothing; choosing it removes the param. */
|
|
49
|
-
paramDefault: string;
|
|
50
|
-
/** Called after the URL changes. */
|
|
51
|
-
onChange?: (value: string) => void;
|
|
52
|
-
});
|
|
53
|
-
/** One option of a `ChoiceGroup`: its value, its words, and optionally a decorative `leading` mark (a swatch) before the words, which a screen reader skips, so the label must say it all. */
|
|
54
|
-
export type Choice = {
|
|
55
|
-
value: string;
|
|
56
|
-
label: string;
|
|
57
|
-
detail?: string;
|
|
58
|
-
leading?: React.ReactNode;
|
|
59
|
-
};
|
|
60
|
-
/** Radio choices in a fieldset with a legend; each whole row is the hit target. For 2 to 5 options that each need a sentence. */
|
|
61
|
-
export declare function ChoiceGroup(props: ChoiceGroupProps): React.JSX.Element;
|
|
62
|
-
/** Props of `ChoiceGroup`: the value and `onChange` are the caller's, or (with `param`) the URL's, the first choice being the default. */
|
|
63
|
-
export type ChoiceGroupProps = {
|
|
64
|
-
legend: string;
|
|
65
|
-
name: string;
|
|
66
|
-
choices: Choice[];
|
|
67
|
-
error?: string;
|
|
68
|
-
} & ({
|
|
69
|
-
value: string;
|
|
70
|
-
onChange: (value: string) => void;
|
|
71
|
-
param?: undefined;
|
|
72
|
-
} | {
|
|
73
|
-
/** The search parameter that holds the choice, so it can be linked and survives a reload. The first choice is the default and is not written. */
|
|
74
|
-
param: string;
|
|
75
|
-
value?: undefined;
|
|
76
|
-
/** Called after the URL changes. */
|
|
77
|
-
onChange?: (value: string) => void;
|
|
78
|
-
});
|
|
79
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { FileIntake } from '../lib/file-intake';
|
|
2
|
-
import { IconComponent } from '../lib/icon';
|
|
3
|
-
import { ButtonProps } from './button';
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
/** The picker as a button. `children` is its visible name ("Add files"); `accept` narrows what the dialog shows. */
|
|
6
|
-
export declare function FileButton({ accept, multiple, onFiles, icon: Icon, children, ...props }: Omit<ButtonProps, "onChange" | "children"> & {
|
|
7
|
-
/** What the dialog offers: extensions (`.gpx`), exact types or families (`video/*`). */
|
|
8
|
-
accept: readonly string[];
|
|
9
|
-
multiple?: boolean;
|
|
10
|
-
/** Called with the files chosen. Not called when the dialog is cancelled. */
|
|
11
|
-
onFiles: (files: File[]) => void;
|
|
12
|
-
icon?: IconComponent;
|
|
13
|
-
children: string;
|
|
14
|
-
}): React.JSX.Element;
|
|
15
|
-
/** Whether a drag is the app's own, not files: it carries one of `refuse`, and the browser has not left its types unknown. */
|
|
16
|
-
export declare function refusesDrag(types: {
|
|
17
|
-
has: (type: string) => boolean;
|
|
18
|
-
}, refuse: readonly string[]): boolean;
|
|
19
|
-
/** A region that takes dropped files and offers the picker as its keyboard alternative. */
|
|
20
|
-
export declare function FileDropZone({ onFiles, acceptLabel, title, disabled, refuseTypes, children, className, }: {
|
|
21
|
-
onFiles: (files: File[]) => void;
|
|
22
|
-
/** What it takes, in words ("a video, an audio file or a GPX track"). Shown while a drag is over it. */
|
|
23
|
-
acceptLabel: string;
|
|
24
|
-
/** The resting prompt ("Drag files here"). */
|
|
25
|
-
title: string;
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/** Drag types of the app's own drags to ignore, besides every `DragSource`'s (which are always ignored): the zone does not light up for them and a keyboard drag does not stop on it. A dragged file never carries these, so a file is never refused. */
|
|
28
|
-
refuseTypes?: readonly string[];
|
|
29
|
-
/** The `FileButton` (required in practice: it is how a keyboard or phone gets files in). */
|
|
30
|
-
children?: React.ReactNode;
|
|
31
|
-
className?: string;
|
|
32
|
-
}): React.JSX.Element;
|
|
33
|
-
/** While files are dragged anywhere over the window, a dim overlay names what is taken ("Drop to add PAK files"); a drop calls `onFiles`. The app's own drags never trigger it. Keep a `FileButton` beside it for the keyboard and phones. */
|
|
34
|
-
export declare function FileDropOverlay({ onFiles, acceptLabel, disabled, refuseTypes, }: {
|
|
35
|
-
onFiles: (files: File[]) => void;
|
|
36
|
-
/** What it takes, in words ("PAK files"), shown in "Drop to add …". */
|
|
37
|
-
acceptLabel: string;
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
/** Drag types of the app's own drags to ignore, besides every `DragSource`'s. */
|
|
40
|
-
refuseTypes?: readonly string[];
|
|
41
|
-
}): React.JSX.Element | null;
|
|
42
|
-
/** One row per file offered: its name, a status word, and for a rejected or failed file the reason and (for failed) a retry. Announces a summary politely when a batch finishes. */
|
|
43
|
-
export declare function FileOutcomes({ intake, className }: {
|
|
44
|
-
intake: FileIntake;
|
|
45
|
-
className?: string;
|
|
46
|
-
}): React.JSX.Element;
|
|
47
|
-
/**
|
|
48
|
-
* A saved item whose file is gone: the item's name, a "File missing" status (a word and an icon) and a "Relink" button that opens the picker for this one item.
|
|
49
|
-
* In a narrow column the name keeps its own line, in full, and the status and button wrap under it. An optional `thumbnail` sits beside all three.
|
|
50
|
-
*/
|
|
51
|
-
export declare function MissingFile({ name, accept, onRelink, thumbnail, className, }: {
|
|
52
|
-
/** The item's name as the person knows it ("run-02.mp4"). */
|
|
53
|
-
name: string;
|
|
54
|
-
accept: readonly string[];
|
|
55
|
-
/** Called with the file the person chose to stand in for it. */
|
|
56
|
-
onRelink: (file: File) => void;
|
|
57
|
-
/** A picture of the item (what it last looked like), drawn at the start. */
|
|
58
|
-
thumbnail?: React.ReactNode;
|
|
59
|
-
className?: string;
|
|
60
|
-
}): React.JSX.Element;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AspectRatio } from './thumbnail';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** One frame: its time in seconds and its picture (`null` when there is none). */
|
|
4
|
-
export type FilmFrame = {
|
|
5
|
-
time: number;
|
|
6
|
-
src: string | null;
|
|
7
|
-
};
|
|
8
|
-
/** The film strip's props. */
|
|
9
|
-
export type FilmStripProps = {
|
|
10
|
-
/** Names the strip: "Frames of scene 3". */
|
|
11
|
-
label: string;
|
|
12
|
-
/** The frames, in time order. More than fit are thinned evenly. */
|
|
13
|
-
frames: readonly FilmFrame[];
|
|
14
|
-
/** The stretch the strip stands for, seconds: `time` inside it marks the frame being watched. Default the first frame's time to the last's. */
|
|
15
|
-
span?: readonly [number, number];
|
|
16
|
-
/** The playhead, seconds. */
|
|
17
|
-
time?: number;
|
|
18
|
-
/** A frame was pressed: play from its time. Makes the frames buttons. */
|
|
19
|
-
onSeek?: (time: number) => void;
|
|
20
|
-
/** Width over height of each frame. Default 4/3. */
|
|
21
|
-
aspect?: AspectRatio;
|
|
22
|
-
/** The narrowest a frame is drawn, px: sets how many fit. Default 96. */
|
|
23
|
-
frameWidth?: number;
|
|
24
|
-
/** The words for a frame with no picture. Default "No picture". */
|
|
25
|
-
missing?: string;
|
|
26
|
-
/** The verb of a frame's button. Default "Play from", as "Play from 1:20". */
|
|
27
|
-
seekVerb?: string;
|
|
28
|
-
className?: string;
|
|
29
|
-
};
|
|
30
|
-
/** `n` of `items` spread evenly from the first to the last (all of them when there are no more than `n`). */
|
|
31
|
-
export declare function pickEvenly<T>(items: readonly T[], n: number): T[];
|
|
32
|
-
/** The index of the frame showing `time`: the last at or before it, or -1 outside `span`. */
|
|
33
|
-
export declare function frameAt(frames: readonly FilmFrame[], time: number | undefined, span: readonly [number, number]): number;
|
|
34
|
-
/** A row of frames from a stretch of video that fits its width, each with its time; pressing one seeks when `onSeek` is given, and the frame at `time` is marked. */
|
|
35
|
-
export declare function FilmStrip({ label, frames, span, time, onSeek, aspect, frameWidth, missing, seekVerb, className }: FilmStripProps): React.JSX.Element;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Load } from './data-view';
|
|
2
|
-
import { Expanded } from './disclosure';
|
|
3
|
-
import { Tone } from './status';
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
/** One folder in a listing. */
|
|
6
|
-
export type Folder = {
|
|
7
|
-
/** The full path, which is also its key. */
|
|
8
|
-
path: string;
|
|
9
|
-
/** The last part, shown. */
|
|
10
|
-
name: string;
|
|
11
|
-
/** How many folders are inside it, when the server knows; shown beside the name. */
|
|
12
|
-
count?: number;
|
|
13
|
-
/** A word about the folder ("project"), shown beside the name as text on a tint and included in its row's name. */
|
|
14
|
-
badge?: string;
|
|
15
|
-
/** The badge's tone. Default `neutral`. */
|
|
16
|
-
tone?: Tone;
|
|
17
|
-
};
|
|
18
|
-
/** What a listing hook may return instead of a bare array: the folders and a sentence about the folder they are in. */
|
|
19
|
-
export type FolderListing = {
|
|
20
|
-
folders: readonly Folder[];
|
|
21
|
-
/** Shown under the tree while this folder is the one being looked at: "3 camera files here". */
|
|
22
|
-
footer?: string;
|
|
23
|
-
};
|
|
24
|
-
export type FolderPickerProps = {
|
|
25
|
-
/** Names the picker: "Choose a folder for the project". Required. */
|
|
26
|
-
label: string;
|
|
27
|
-
/** Reads one folder's subfolders (`null` is the top). A hook: `useLoad` inside. It may return `{ folders, footer }` to say something about the folder itself. */
|
|
28
|
-
useFolders: (path: string | null) => Load<readonly Folder[] | FolderListing>;
|
|
29
|
-
/** The folder being looked at, or `null`. */
|
|
30
|
-
value: string | null;
|
|
31
|
-
onChange: (path: string | null) => void;
|
|
32
|
-
/** The person chose this folder. */
|
|
33
|
-
onChoose: (path: string) => void;
|
|
34
|
-
/** Which folders are open in the tree; from `useExpanded`, optionally in the URL. */
|
|
35
|
-
expanded: Expanded;
|
|
36
|
-
/** Folders chosen before, newest first. */
|
|
37
|
-
recent?: readonly string[];
|
|
38
|
-
/** Whether the looked-at folder may be chosen: `true`, or the reason it may not, shown beside the disabled button. Given the folder when the listing has it. */
|
|
39
|
-
canChoose?: (path: string, folder: Folder | undefined) => true | string;
|
|
40
|
-
/** Names the choosing button: "Create project here". Default "Choose this folder". */
|
|
41
|
-
chooseLabel?: string;
|
|
42
|
-
/** Asked when the person opens a folder in the tree: `"choose"` takes it as chosen at once and keeps it closed, `"enter"` (the default) opens it. */
|
|
43
|
-
onOpen?: (folder: Folder) => "choose" | "enter";
|
|
44
|
-
/** Makes a folder named `name` in `parent`. Throw (an `HttpError`) to refuse; its reason is shown on the field. Without it there is no New folder. */
|
|
45
|
-
onCreate?: (parent: string, name: string) => Promise<unknown>;
|
|
46
|
-
/** The name of the top: "Server". Default "Top". */
|
|
47
|
-
topLabel?: string;
|
|
48
|
-
/** What a folder with no folders in it says. Default "No folders". */
|
|
49
|
-
emptyRow?: string;
|
|
50
|
-
/** The height of the tree before it scrolls. Default 18rem. */
|
|
51
|
-
height?: string;
|
|
52
|
-
className?: string;
|
|
53
|
-
};
|
|
54
|
-
/** The parent of a path, or `null` at the top. */
|
|
55
|
-
export declare const parentOf: (path: string) => string | null;
|
|
56
|
-
/** Every folder from the top down to `path`, which the tree must have open to show it. */
|
|
57
|
-
export declare const ancestorsOf: (path: string) => string[];
|
|
58
|
-
/** A server folder chooser: a lazy tree, a breadcrumb that is also editable text, Up, recents, a New folder field that shows the server's refusal, and Choose this folder as the one filled button. */
|
|
59
|
-
export declare function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose, expanded, recent, canChoose, chooseLabel, onOpen, onCreate, topLabel, emptyRow, height, className }: FolderPickerProps): React.JSX.Element;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Props for `FullscreenFrame`. */
|
|
3
|
-
export type FullscreenFrameProps = {
|
|
4
|
-
/** Names the full-screen view for screen readers: "Compare renderings". Required. */
|
|
5
|
-
label: string;
|
|
6
|
-
/** Whether the frame is full screen. The caller owns it so a button and a key can share it. */
|
|
7
|
-
active: boolean;
|
|
8
|
-
/** Called with `false` when the person leaves with Escape or the browser's own control. */
|
|
9
|
-
onActiveChange: (active: boolean) => void;
|
|
10
|
-
/** Open a window-filling modal where the browser has no Fullscreen API or refuses. Default true. `false` for content that must not be mounted again (a playing video): where the browser cannot or will not, `onActiveChange(false)` is called instead. */
|
|
11
|
-
modal?: boolean;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
className?: string;
|
|
14
|
-
};
|
|
15
|
-
/** Whether this browser can show an element full screen. False in jsdom and on iPhone, where the modal fallback is used. */
|
|
16
|
-
export declare function canFullscreen(): boolean;
|
|
17
|
-
/** Shows its children full screen while `active`: the browser's Fullscreen API where there is one, a window-filling modal where there is not. */
|
|
18
|
-
export declare function FullscreenFrame({ label, active, onActiveChange, modal: allowModal, children, className }: FullscreenFrameProps): React.JSX.Element;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Command } from './commands';
|
|
2
|
-
/** One undoable step. `label` is the phrase after the verb ("move clip"); `undo` and `redo` must be inverses. */
|
|
3
|
-
export type HistoryStep = {
|
|
4
|
-
label: string;
|
|
5
|
-
undo: () => void;
|
|
6
|
-
redo: () => void;
|
|
7
|
-
/** Consecutive pushes with the same key merge into one step (a slider, a text drag). */
|
|
8
|
-
key?: string;
|
|
9
|
-
};
|
|
10
|
-
/** Options for `useHistory`. */
|
|
11
|
-
export type HistoryOptions = {
|
|
12
|
-
/** The most steps kept; the oldest is dropped past it. Default 100. */
|
|
13
|
-
limit?: number;
|
|
14
|
-
};
|
|
15
|
-
/** What `useHistory` returns. */
|
|
16
|
-
export type History = {
|
|
17
|
-
/** Records a step the app has just done. Clears what could have been redone. Inside `begin`/`end` it joins the group. */
|
|
18
|
-
push: (step: HistoryStep) => void;
|
|
19
|
-
/** Starts a group named `label`; every push until the returned `end()` is one step. Nested groups join the outer one. An empty group records nothing. */
|
|
20
|
-
begin: (label: string) => () => void;
|
|
21
|
-
/** `begin`, run a function, `end`. */
|
|
22
|
-
group: <T>(label: string, run: () => T) => T;
|
|
23
|
-
undo: () => void;
|
|
24
|
-
redo: () => void;
|
|
25
|
-
canUndo: boolean;
|
|
26
|
-
canRedo: boolean;
|
|
27
|
-
/** The name of the step Undo would take back, or undefined. */
|
|
28
|
-
undoLabel: string | undefined;
|
|
29
|
-
/** The name of the step Redo would repeat, or undefined. */
|
|
30
|
-
redoLabel: string | undefined;
|
|
31
|
-
/** Names of the steps that can be undone, oldest first. */
|
|
32
|
-
past: string[];
|
|
33
|
-
/** Names of the steps that can be redone, next first. */
|
|
34
|
-
future: string[];
|
|
35
|
-
/** The history holds `limit` steps, so the next push drops the oldest. */
|
|
36
|
-
atLimit: boolean;
|
|
37
|
-
/** Forgets every step (a document was opened or saved to a new place). */
|
|
38
|
-
clear: () => void;
|
|
39
|
-
/** Undo then Redo as commands: "Undo move clip", disabled with "Nothing to undo". Pass to `useCommands` and a `Menu`. */
|
|
40
|
-
commands: [undo: Command, redo: Command];
|
|
41
|
-
};
|
|
42
|
-
/** A history of named, undoable steps with grouping, a limit, and Undo and Redo as commands. */
|
|
43
|
-
export declare function useHistory({ limit }?: HistoryOptions): History;
|
|
44
|
-
/** Options for `useHistoryState`. */
|
|
45
|
-
export type HistoryStateOptions = HistoryOptions;
|
|
46
|
-
/** What `setValue` takes besides the new value. */
|
|
47
|
-
export type SetOptions = {
|
|
48
|
-
/** Merges consecutive changes with this key into one step (a slider, a drag). */
|
|
49
|
-
key?: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* React state with a history: `set(next, "move clip")` changes the value and records the step; Undo
|
|
53
|
-
* and Redo put the old and new values back. For an app whose document is a plain value. An app on its
|
|
54
|
-
* own store uses `useHistory` and pushes steps from its actions.
|
|
55
|
-
*/
|
|
56
|
-
export declare function useHistoryState<S>(initial: S | (() => S), options?: HistoryStateOptions): {
|
|
57
|
-
value: S;
|
|
58
|
-
set: (next: S | ((previous: S) => S), label: string, { key }?: SetOptions) => void;
|
|
59
|
-
reset: (next: S) => void;
|
|
60
|
-
history: History;
|
|
61
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** One shortcut: the keys that run it (as `KeyboardEvent.key`), what it does in the product's words, and the action. */
|
|
3
|
-
export type Shortcut = {
|
|
4
|
-
/** `KeyboardEvent.key` values, e.g. `["j", "ArrowDown"]`. The first is the one the legend leads with. */
|
|
5
|
-
keys: string[];
|
|
6
|
-
/** What it does, in the product's words: "Accept booking", not "Action 1". */
|
|
7
|
-
label: string;
|
|
8
|
-
/** What names it when keys are rebound (`ShortcutEditor`): stable across releases, so a person's saved keys still mean the same action. Default: the label. */
|
|
9
|
-
id?: string;
|
|
10
|
-
run: () => void;
|
|
11
|
-
/** Fire again while the key is held. On for moving through a list, off (the default) for answers. */
|
|
12
|
-
repeat?: boolean;
|
|
13
|
-
/** With `useHotkeys`' `within`: keep this key page-wide (Space to play, say) while the others only count with focus inside the region. */
|
|
14
|
-
anywhere?: boolean;
|
|
15
|
-
/** Ignore the key for now, and show it muted in the legend (nothing is active, say). */
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
};
|
|
18
|
-
/** True when a key pressed on this element is the person typing, so single-key shortcuts must leave it alone. */
|
|
19
|
-
export declare function isTypingTarget(target: EventTarget | null): boolean;
|
|
20
|
-
export type HotkeysOptions = {
|
|
21
|
-
enabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Only count keys while focus is inside this region (strata-react issue #385): a player's own region, so a stage beside it keeps
|
|
24
|
-
* its arrow keys. A shortcut with `anywhere` stays page-wide. A key whose target is outside the region goes to whoever else wants it.
|
|
25
|
-
*/
|
|
26
|
-
within?: React.RefObject<Element | null>;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Binds single-key shortcuts on the window (also for a key pressed on a control inside a grid row, whose React Aria hooks stop propagation), ignoring keys typed into fields, chords with Ctrl, Meta
|
|
30
|
-
* or Alt, IME composition and (unless `repeat`) held keys. Pass the same list to `KeysLegend`: better, pass it `live`, which is what answers a key
|
|
31
|
-
* right now (nothing while `enabled` is off; with `within`, only the `anywhere` keys until focus is inside the region).
|
|
32
|
-
*/
|
|
33
|
-
export declare function useHotkeys(shortcuts: Shortcut[] | Record<string, () => void>, { enabled, within }?: HotkeysOptions): {
|
|
34
|
-
live: Shortcut[];
|
|
35
|
-
};
|
|
36
|
-
/** How a `KeyboardEvent.key` is drawn in a legend and an editor: arrows as arrows, the rest by name. */
|
|
37
|
-
export declare const keyName: (key: string) => string;
|
|
38
|
-
/** A quiet legend of the screen's shortcuts, from the same list `useHotkeys` binds. Hidden on touch screens. */
|
|
39
|
-
export declare function KeysLegend({ shortcuts, label, className, }: {
|
|
40
|
-
shortcuts: Pick<Shortcut, "keys" | "label" | "disabled">[];
|
|
41
|
-
/** Names the legend for screen readers. */
|
|
42
|
-
label?: string;
|
|
43
|
-
className?: string;
|
|
44
|
-
}): React.JSX.Element;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { LoadFailure } from './data-view';
|
|
2
|
-
import { InfiniteLoad } from '../query/infinite';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
/** The next-page row's props: `InfiniteList`'s, for a list or grid the app draws itself. */
|
|
5
|
-
export type LoadMoreProps<T> = {
|
|
6
|
-
state: InfiniteLoad<T>;
|
|
7
|
-
/** The button behind the sentinel, in the product's words: "Show older firings". */
|
|
8
|
-
moreLabel: string;
|
|
9
|
-
/** The items of a page on its way, mirroring the ones already drawn. */
|
|
10
|
-
moreSkeleton: React.ReactNode;
|
|
11
|
-
/** After the last page: say that this is everything. */
|
|
12
|
-
end?: React.ReactNode;
|
|
13
|
-
/** How far before the end the next page is asked for (IntersectionObserver `rootMargin`). Default 400px. */
|
|
14
|
-
rootMargin?: string;
|
|
15
|
-
/** Load more whenever fewer than this many items are held. */
|
|
16
|
-
keepAtLeast?: number;
|
|
17
|
-
/** Draws a failed later page, given the reason and the Try again. Rendered inside a `role="alert"` box. */
|
|
18
|
-
error?: (failure: LoadFailure) => React.ReactNode;
|
|
19
|
-
/** Draws the idle row (the "Show more" button) in the app's own look, given the label and the request. It must call `load` from a real button; focus moves to the first new item afterwards as with the default. */
|
|
20
|
-
more?: (row: {
|
|
21
|
-
label: string;
|
|
22
|
-
load: () => void;
|
|
23
|
-
}) => React.ReactNode;
|
|
24
|
-
/** Draws the row while a page is on its way, given `moreSkeleton`. The row is hidden from assistive technology as the default is; the "Loading more" announcement stays. */
|
|
25
|
-
loading?: (skeleton: React.ReactNode) => React.ReactNode;
|
|
26
|
-
/** A hairline above the idle, loading and end rows. Default true; `false` for a look with no rules between pages. */
|
|
27
|
-
ruled?: boolean;
|
|
28
|
-
className?: string;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* The row after a cursor-paged list or grid: loads the next page as it nears the screen, shows
|
|
32
|
-
* `moreSkeleton` while it comes, says why it failed with Try again, offers Show more for the
|
|
33
|
-
* keyboard, and `end` after the last page. After Show more it focuses the first new item: mark
|
|
34
|
-
* each item with `data-index` and put this row beside the list, in the same parent.
|
|
35
|
-
*/
|
|
36
|
-
export declare function LoadMore<T>({ state, moreLabel, moreSkeleton, end, rootMargin, keepAtLeast, error: drawError, more: drawMore, loading: drawLoading, ruled, className, }: LoadMoreProps<T>): React.JSX.Element | null;
|
|
37
|
-
/** The infinite list's props. */
|
|
38
|
-
export type InfiniteListProps<T> = {
|
|
39
|
-
state: InfiniteLoad<T>;
|
|
40
|
-
/** The list's accessible name, e.g. "Firing log, newest first". */
|
|
41
|
-
label: string;
|
|
42
|
-
children: (item: T, index: number) => React.ReactNode;
|
|
43
|
-
/** The first load. Mirrors the final layout, so nothing jumps when data arrives. */
|
|
44
|
-
skeleton: React.ReactNode;
|
|
45
|
-
/** What goes here and how to add it, when the first page is empty and there are no more. */
|
|
46
|
-
empty: React.ReactNode;
|
|
47
|
-
/** The button behind the sentinel, in the product's words: "Show older firings". */
|
|
48
|
-
moreLabel: string;
|
|
49
|
-
/** The rows of a page on its way. Defaults to `skeleton`. */
|
|
50
|
-
moreSkeleton?: React.ReactNode;
|
|
51
|
-
/** After the last page: say that this is everything. */
|
|
52
|
-
end?: React.ReactNode;
|
|
53
|
-
/** How far before the end the next page is asked for (IntersectionObserver `rootMargin`). */
|
|
54
|
-
rootMargin?: string;
|
|
55
|
-
/** Load more whenever fewer than this many items are held. */
|
|
56
|
-
keepAtLeast?: number;
|
|
57
|
-
/** `region` (default): rows in a scroll region of `height`, virtual from `virtualizeFrom`. `page`: a plain list that scrolls with the page, laid out by `listClassName`. */
|
|
58
|
-
scroll?: "region" | "page";
|
|
59
|
-
/** With `scroll="page"`: the classes of the `ul`, such as a responsive grid (`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`). */
|
|
60
|
-
listClassName?: string;
|
|
61
|
-
/** Draws a failed first page. Defaults to DataView's `LoadError`. */
|
|
62
|
-
error?: (failure: LoadFailure) => React.ReactNode;
|
|
63
|
-
/** Draws a failed later page. Defaults to a danger row with Try again. */
|
|
64
|
-
moreError?: (failure: LoadFailure) => React.ReactNode;
|
|
65
|
-
/** Draws the "Show more" row in the app's own look, as `LoadMore`'s `more`. */
|
|
66
|
-
moreRow?: LoadMoreProps<T>["more"];
|
|
67
|
-
/** Draws the row while a page is on its way, as `LoadMore`'s `loading`. */
|
|
68
|
-
moreLoading?: LoadMoreProps<T>["loading"];
|
|
69
|
-
/** A hairline above the next-page rows. Default true. */
|
|
70
|
-
ruled?: boolean;
|
|
71
|
-
estimateSize?: number;
|
|
72
|
-
height?: number;
|
|
73
|
-
virtualizeFrom?: number;
|
|
74
|
-
className?: string;
|
|
75
|
-
};
|
|
76
|
-
/** A cursor-paged list for `useInfiniteLoad`: DataView's first-page states, virtual rows (or a page-scrolled grid), and a `LoadMore` row that loads on approach, shows a skeleton, or says why it failed with Try again. */
|
|
77
|
-
export declare function InfiniteList<T>({ state, label, children, skeleton, empty, moreLabel, moreSkeleton, end, rootMargin, keepAtLeast, scroll, listClassName, error, moreError, moreRow, moreLoading, ruled, estimateSize, height, virtualizeFrom, className, }: InfiniteListProps<T>): React.JSX.Element;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type InspectorProps = {
|
|
3
|
-
/** The selection's name, as the panel's heading ("run-02.mp4", "Clip: Title card"). `null` when nothing is selected. */
|
|
4
|
-
title: string | null;
|
|
5
|
-
/** What kind of thing it is, under the heading ("Video", "Text clip"). */
|
|
6
|
-
kind?: string;
|
|
7
|
-
/** Shown when `title` is `null`: an `EmptyState` that says what to select and what appears ("Select a clip on the timeline to change how it looks"). */
|
|
8
|
-
empty: React.ReactNode;
|
|
9
|
-
/** The selected thing's id. A new value remounts the sections' bodies so no control shows the last item's typed text. */
|
|
10
|
-
selectionKey?: string;
|
|
11
|
-
/** localStorage key under which closed and opened sections are remembered. Omit to remember only for this visit. */
|
|
12
|
-
storageKey?: string;
|
|
13
|
-
/** The panel's few actions (a menu, a "Delete"), beside the heading. */
|
|
14
|
-
actions?: React.ReactNode;
|
|
15
|
-
/** A picture or summary of the selection above the sections (a `Thumbnail`). */
|
|
16
|
-
summary?: React.ReactNode;
|
|
17
|
-
/** `InspectorSection`s and `PropertyList`s. */
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
className?: string;
|
|
20
|
-
};
|
|
21
|
-
/** A panel of properties for the selected thing: a labelled region with a heading, an empty state when `title` is null, and sections whose open state is remembered. */
|
|
22
|
-
export declare function Inspector({ title, kind, empty, selectionKey, storageKey, actions, summary, children, className }: InspectorProps): React.JSX.Element;
|
|
23
|
-
export type InspectorSectionProps = {
|
|
24
|
-
/** Identifies the section for remembering, stable across selections of the same kind ("audio", "text-style"). */
|
|
25
|
-
id: string;
|
|
26
|
-
title: string;
|
|
27
|
-
/** Open when the person has not chosen. Default true; start the few that answer the next question open and the rest closed. */
|
|
28
|
-
defaultOpen?: boolean;
|
|
29
|
-
/** The section's few actions (add, reset all), beside its heading and outside its toggle. Name them for the section ("Add track"). */
|
|
30
|
-
actions?: React.ReactNode;
|
|
31
|
-
/** Mounted only while the section is open. */
|
|
32
|
-
children: React.ReactNode;
|
|
33
|
-
className?: string;
|
|
34
|
-
};
|
|
35
|
-
/** A titled group of rows that collapses. The body is mounted only while open; the open state is remembered by the surrounding `Inspector` (and held locally outside one). */
|
|
36
|
-
export declare function InspectorSection({ id, title, defaultOpen, actions, children, className }: InspectorSectionProps): React.JSX.Element;
|
|
37
|
-
export type PropertyRowProps = {
|
|
38
|
-
label: string;
|
|
39
|
-
hint?: React.ReactNode;
|
|
40
|
-
error?: string;
|
|
41
|
-
/** Whether the value differs from its default. With `onReset`, shows a "Reset" button named for the property. */
|
|
42
|
-
modified?: boolean;
|
|
43
|
-
/** Puts the value back to its default. */
|
|
44
|
-
onReset?: () => void;
|
|
45
|
-
/** The control: an `Input`, `NumberField`, `Slider`, `NativeSelect`… It picks up the label from the row. */
|
|
46
|
-
children: React.ReactNode;
|
|
47
|
-
className?: string;
|
|
48
|
-
};
|
|
49
|
-
/** One editable property: a `Field` (label, hint, error wired to the control) with a "Reset <label>" that shows only while `modified`. */
|
|
50
|
-
export declare function PropertyRow({ label, hint, error, modified, onReset, children, className }: PropertyRowProps): React.JSX.Element;
|
|
51
|
-
export type Property = {
|
|
52
|
-
/** The fact's name ("Frame rate"). */
|
|
53
|
-
term: string;
|
|
54
|
-
/** Its value. `null` or `undefined` prints the missing mark; a string is truncated with the whole value in a tooltip. */
|
|
55
|
-
value: React.ReactNode | null | undefined;
|
|
56
|
-
/** A unit, joined with a non-breaking space and muted. */
|
|
57
|
-
unit?: string;
|
|
58
|
-
};
|
|
59
|
-
export type PropertyListProps = {
|
|
60
|
-
items: readonly Property[];
|
|
61
|
-
/** Names the list for a screen reader ("Video details") when a visible heading does not. */
|
|
62
|
-
label?: string;
|
|
63
|
-
className?: string;
|
|
64
|
-
};
|
|
65
|
-
/** Read-only facts as a description list: term left, value right, long strings truncated with the full value on hover, a missing value printed as an en dash, units muted after a non-breaking space. */
|
|
66
|
-
export declare function PropertyList({ items, label, className }: PropertyListProps): React.JSX.Element;
|