strata-react 1.3.25 → 1.3.27
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 -0
- package/UPGRADING.md +4 -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-BTPs49FP.js → follow-CXQsL86O.js} +2 -2
- 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 +5401 -142
- package/dist/index.js +1072 -227
- 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 +18 -15
- 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 +15 -13
- 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-CHU0Hx4A.js → viewer-input-3Qa-o35k.js} +3 -2
- package/dist/{viewer-input-CHU0Hx4A.js.map → viewer-input-3Qa-o35k.js.map} +1 -1
- 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/follow-BTPs49FP.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/follow.d.ts +0 -18
- 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/viewer-input.d.ts +0 -29
- 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 -99
- 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,55 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** An item a job could not do, and why, in the product's words. */
|
|
3
|
-
export type JobFailure = {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
reason: string;
|
|
7
|
-
};
|
|
8
|
-
/** How far a job has got, in the one shape every job uses (issue #250): items done, items in all, and what it is on now. `JobStatus` renders it as "3 of 9 done, 6 remaining · Night Sky". */
|
|
9
|
-
export type JobProgress = {
|
|
10
|
-
done: number;
|
|
11
|
-
total: number;
|
|
12
|
-
current?: string;
|
|
13
|
-
};
|
|
14
|
-
/** The sentence for a job's progress: "3 of 9 done, 6 remaining · Night Sky". */
|
|
15
|
-
export declare function jobProgressText({ done, total, current }: JobProgress): string;
|
|
16
|
-
/** A job's three states as words, all required: "Syncing", "Finished", "Finished with failures". */
|
|
17
|
-
export type JobWords = {
|
|
18
|
-
running: string;
|
|
19
|
-
finished: string;
|
|
20
|
-
failed: string; /** Shown when `cancelled`. Default "Cancelled". */
|
|
21
|
-
cancelled?: string;
|
|
22
|
-
};
|
|
23
|
-
/** The job status's props. */
|
|
24
|
-
export type JobStatusProps = {
|
|
25
|
-
/** What the job is ("Library sync"): names the section and the progress bar. */
|
|
26
|
-
label: string;
|
|
27
|
-
/** The job is still going. */
|
|
28
|
-
running: boolean;
|
|
29
|
-
words: JobWords;
|
|
30
|
-
/** The app's sentence for where the job is or how it went: "Syncing 2 of 3: Night Sky." */
|
|
31
|
-
summary: string;
|
|
32
|
-
/** How far it has got, in the shared shape (`{ done, total, current }`): the bar and the sentence "3 of 9 done, 6 remaining · Night Sky" under the summary. Wins over `current` and `total`. */
|
|
33
|
-
progress?: JobProgress;
|
|
34
|
-
/** Items done or being done, with `total`, for the bar. */
|
|
35
|
-
current?: number;
|
|
36
|
-
/** Items in all, when known. No bar without it. */
|
|
37
|
-
total?: number;
|
|
38
|
-
/** Each item that failed, with its reason. Any failure makes a finished job `failed`'s word. */
|
|
39
|
-
failures?: JobFailure[];
|
|
40
|
-
/** The job failed as a whole, for a reason that names no item (the summary says it). */
|
|
41
|
-
failed?: boolean;
|
|
42
|
-
/** Names the list of failures for screen readers. Default "Failures". */
|
|
43
|
-
failuresLabel?: string;
|
|
44
|
-
/** The person stopped it. A neutral ending, not a failure. */
|
|
45
|
-
cancelled?: boolean;
|
|
46
|
-
/** Stops the job. Shows a Cancel button while it runs. */
|
|
47
|
-
onCancel?: () => void;
|
|
48
|
-
/** Label of the cancel button. Default "Cancel". */
|
|
49
|
-
cancelLabel?: string;
|
|
50
|
-
/** Clears the result. Shows a Dismiss button once the job has ended. */
|
|
51
|
-
onDismiss?: () => void;
|
|
52
|
-
className?: string;
|
|
53
|
-
};
|
|
54
|
-
/** A long-running server job: its state as a required word beside the app's sentence, a progress bar when the total is known, each failure named with its reason, and a polite announcement only when the item changes or the job ends. */
|
|
55
|
-
export declare function JobStatus({ label, running, words, summary, progress, current: currentProp, total: totalProp, failures, failed, failuresLabel, cancelled, onCancel, cancelLabel, onDismiss, className, }: JobStatusProps): React.JSX.Element;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** The fields of a job `JobsTable` draws: the shape of `Schema<"Task">`, which satisfies it. */
|
|
2
|
-
export type JobRow = {
|
|
3
|
-
id: number | string;
|
|
4
|
-
kind: string;
|
|
5
|
-
state: string;
|
|
6
|
-
created_at: string;
|
|
7
|
-
started_at?: string | null;
|
|
8
|
-
finished_at?: string | null;
|
|
9
|
-
error?: string | null;
|
|
10
|
-
attempts?: number;
|
|
11
|
-
domain?: string | null;
|
|
12
|
-
progress?: {
|
|
13
|
-
text?: string;
|
|
14
|
-
done?: number;
|
|
15
|
-
total?: number | null;
|
|
16
|
-
} | null;
|
|
17
|
-
};
|
|
18
|
-
/** The jobs table's props. */
|
|
19
|
-
export type JobsTableProps<T extends JobRow> = {
|
|
20
|
-
/** Names the table: "Jobs". */
|
|
21
|
-
caption: string;
|
|
22
|
-
/** The jobs, newest first: the items of `GET /api/jobs` pages. */
|
|
23
|
-
jobs: T[];
|
|
24
|
-
/** What a job is, in the person's words. Default its kind. */
|
|
25
|
-
describe?: (job: T) => string;
|
|
26
|
-
/** Cancels a queued or running job (`POST /api/jobs/<id>/cancel`). Without it, no Cancel. */
|
|
27
|
-
onCancel?: (job: T) => Promise<unknown>;
|
|
28
|
-
/** Runs a failed or cancelled job again (`POST /api/jobs/<id>/retry`). Without it, no Run again. */
|
|
29
|
-
onRetry?: (job: T) => Promise<unknown>;
|
|
30
|
-
/** "Now", for `format.ago` (tests and screenshots). */
|
|
31
|
-
now?: Date;
|
|
32
|
-
className?: string;
|
|
33
|
-
};
|
|
34
|
-
/** A table of the queue's jobs (`GET /api/jobs`): what each is, its state as a word with its progress or error, when it started, and Cancel or Run again where they apply. */
|
|
35
|
-
export declare function JobsTable<T extends JobRow>({ caption, jobs, describe, onCancel, onRetry, now, className }: JobsTableProps<T>): import('react').JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type KeyOwner = {
|
|
2
|
-
/** Whether this player's keys are live: it is the only one on the page, or the one last used. */
|
|
3
|
-
owns: boolean;
|
|
4
|
-
/** Take the keys (the player was focused or pressed). */
|
|
5
|
-
claim: () => void;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Joins the page's key owners while `enabled`, and takes the keys whenever `playing` turns true. Spread nothing: call
|
|
9
|
-
* `claim` from the region's focus and pointer-down handlers, and bind the player's `useHotkeys` with `enabled: owner.owns`.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useKeyOwner(enabled: boolean, playing?: boolean): KeyOwner;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** One picture in the set. */
|
|
3
|
-
export type LightboxItem = {
|
|
4
|
-
id: string;
|
|
5
|
-
/** The picture's address. */
|
|
6
|
-
src: string;
|
|
7
|
-
/** What it shows, for the picture's alternative text: "Bowl 12, front". Required. */
|
|
8
|
-
label: string;
|
|
9
|
-
/** Its natural size in pixels, for 1:1. */
|
|
10
|
-
natural?: readonly [number, number];
|
|
11
|
-
/** Where it sits in the set, in the set's own words: "Page 22 (12)". Read as "Page 22 (12) of 44"; default is its number. */
|
|
12
|
-
position?: string;
|
|
13
|
-
/** A small picture for the thumbnail strip. Default `src`. */
|
|
14
|
-
thumb?: string;
|
|
15
|
-
};
|
|
16
|
-
export type LightboxProps = {
|
|
17
|
-
/** The dialog's title: "Photos of firing f-0412". Required. */
|
|
18
|
-
title: string;
|
|
19
|
-
items: readonly LightboxItem[];
|
|
20
|
-
index: number;
|
|
21
|
-
onIndexChange: (index: number) => void;
|
|
22
|
-
open: boolean;
|
|
23
|
-
onOpenChange: (open: boolean) => void;
|
|
24
|
-
/** What shows in place of a picture that did not load, in words: "This photo could not be loaded." Required. */
|
|
25
|
-
missing: string;
|
|
26
|
-
/** Beside the picture (a `PropertyList` or `Inspector` fits), under it when narrow. */
|
|
27
|
-
details?: (item: LightboxItem) => React.ReactNode;
|
|
28
|
-
/** Name of the folded details on a narrow screen. */
|
|
29
|
-
detailsLabel?: string;
|
|
30
|
-
/** Ids ticked in the grid; with `onCompare` this shows "Compare ticked". */
|
|
31
|
-
ticked?: readonly string[];
|
|
32
|
-
/** Hands the ticked ids to the app. Needs two or more. */
|
|
33
|
-
onCompare?: (ids: readonly string[]) => void;
|
|
34
|
-
/** Width over height of the frame before the picture loads. Default 3:2. */
|
|
35
|
-
aspect?: number;
|
|
36
|
-
/** A layer inside the zoomable frame that zooms with the picture, in the picture's own pixels (`natural` once it is known): a `BoxOverlay`. */
|
|
37
|
-
overlay?: (item: LightboxItem, natural: readonly [number, number] | null) => React.ReactNode;
|
|
38
|
-
/** The current item's own buttons, beside the position. */
|
|
39
|
-
actions?: (item: LightboxItem) => React.ReactNode;
|
|
40
|
-
/** A thumbnail strip along the bottom, for a large set. */
|
|
41
|
-
strip?: boolean;
|
|
42
|
-
};
|
|
43
|
-
/** What `useLightboxUrl` returns: the props a `Lightbox` takes for what is open, plus `show` for the grid that opens it. */
|
|
44
|
-
export type LightboxUrl = Pick<LightboxProps, "open" | "index" | "onIndexChange" | "onOpenChange"> & {
|
|
45
|
-
/** Opens the lightbox on this item (a grid tile's press); an entry in the history, so Back closes it. */
|
|
46
|
-
show: (id: string) => void;
|
|
47
|
-
};
|
|
48
|
-
/** Keeps the open picture in the URL (`?view=<id>`): a link or a reload opens it, Back closes it, and stepping between pictures replaces the entry. */
|
|
49
|
-
export declare function useLightboxUrl(items: readonly LightboxItem[], { param }?: {
|
|
50
|
-
param?: string;
|
|
51
|
-
}): LightboxUrl;
|
|
52
|
-
export declare function useNarrow(): boolean;
|
|
53
|
-
/** A picture from a set in a full-size dialog: previous/next and arrow keys, "3 of 40", zoom and pan, details beside it, neighbours preloaded, a `missing` sentence for one that fails, and a Compare ticked hand-off. Focus returns to the tile that opened it. */
|
|
54
|
-
export declare function Lightbox({ title, items, index, onIndexChange, open, onOpenChange, missing, details, detailsLabel, ticked, onCompare, aspect, overlay, actions, strip }: LightboxProps): React.JSX.Element;
|
|
55
|
-
export declare function ThumbnailStrip({ items, at, onPick, badge, label }: {
|
|
56
|
-
items: readonly LightboxItem[];
|
|
57
|
-
at: number;
|
|
58
|
-
onPick: (i: number) => void;
|
|
59
|
-
badge?: (item: LightboxItem) => React.ReactNode;
|
|
60
|
-
label?: string;
|
|
61
|
-
}): React.JSX.Element;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { CursorMapping } from './cursor';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export type Point = {
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
};
|
|
7
|
-
/** Shading tones for `spans`: the role's subtle fill. */
|
|
8
|
-
export type SpanTone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
9
|
-
/** A stretch of x shaded behind the line (stops, usable footage, a chosen stretch). */
|
|
10
|
-
export type ChartSpan = {
|
|
11
|
-
from: number;
|
|
12
|
-
to: number;
|
|
13
|
-
label: string;
|
|
14
|
-
tone?: SpanTone;
|
|
15
|
-
};
|
|
16
|
-
/** A labelled point on the line, as a control. */
|
|
17
|
-
export type ChartMark = {
|
|
18
|
-
x: number;
|
|
19
|
-
/** Its name: "Clip 4". Said with its x, listed for screen readers and shown on hover and focus. */
|
|
20
|
-
label: string;
|
|
21
|
-
/** Any CSS colour, normally a role. Default the foreground. */
|
|
22
|
-
colour?: string;
|
|
23
|
-
selected?: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type LineChartProps = {
|
|
26
|
-
/** What the chart shows, as a sentence. Used as the accessible name and the table caption. */
|
|
27
|
-
label: string;
|
|
28
|
-
series: Point[];
|
|
29
|
-
seriesLabel: string;
|
|
30
|
-
planned?: Point[];
|
|
31
|
-
plannedLabel?: string;
|
|
32
|
-
band?: {
|
|
33
|
-
below: number;
|
|
34
|
-
label: string;
|
|
35
|
-
};
|
|
36
|
-
/** The lowest and highest value each reading stands for, by index into `series` (a downsampled track keeps its extremes). Drawn as a pale area behind the line, included in the y-axis, said in the readout and the table. `label` names it in the key: "Lowest to highest in each stretch". */
|
|
37
|
-
range?: {
|
|
38
|
-
low: readonly number[];
|
|
39
|
-
high: readonly number[];
|
|
40
|
-
label: string;
|
|
41
|
-
};
|
|
42
|
-
formatX: (x: number) => string;
|
|
43
|
-
/** What x is, as the screen-reader table's first column heading: "Distance", "Day". Default "Time". */
|
|
44
|
-
xLabel?: string;
|
|
45
|
-
formatY: (y: number) => string;
|
|
46
|
-
/** Where to put x labels, in x units, or a function of the visible range (so labels can switch between clock time and distance). The chart drops every other one (and so on) when they would overlap at its width. */
|
|
47
|
-
xTicks: number[] | ((range: {
|
|
48
|
-
min: number;
|
|
49
|
-
max: number;
|
|
50
|
-
}) => number[]);
|
|
51
|
-
/** A fixed x range, for charts that share one axis (`LineChartGroup` sets it). Default: the series' own. */
|
|
52
|
-
xDomain?: readonly [number, number];
|
|
53
|
-
/** `"none"` draws no x labels: the upper charts of a stack. Default `"labels"`. */
|
|
54
|
-
xAxis?: "labels" | "none";
|
|
55
|
-
/** `"log"` for a quantity that spans decades (pace, a magnitude). Ticks are 1, 2, 5 steps chosen here; a reading at or below zero is not drawn and is counted under the chart. Default `"linear"`. */
|
|
56
|
-
yScale?: "linear" | "log";
|
|
57
|
-
/** The smaller value at the top (pace: faster is up). */
|
|
58
|
-
yInvert?: boolean;
|
|
59
|
-
/** Stretches shaded behind the line, named in the key and the text for screen readers. */
|
|
60
|
-
spans?: readonly ChartSpan[];
|
|
61
|
-
/** Labelled points on the line. One tab stop; arrows move between them. */
|
|
62
|
-
marks?: readonly ChartMark[];
|
|
63
|
-
/** A mark was pressed (a click, Enter or Space). */
|
|
64
|
-
onMarkSelect?: (mark: ChartMark) => void;
|
|
65
|
-
/** What shows beside a mark on hover and focus: words, as in `Tooltip`. Default the mark's label and x. */
|
|
66
|
-
renderMarkCard?: (mark: ChartMark) => React.ReactNode;
|
|
67
|
-
/** Join the nearest `CursorScope`: hovering or arrowing here puts a rule and this chart's reading in every member, and theirs shows here. `true` when x is the scope's unit; a mapping when it is not (time here, distance there). */
|
|
68
|
-
cursor?: boolean | CursorMapping;
|
|
69
|
-
/** Pin the bottom of the y-axis (default: 0, or lower if a reading is negative). A reading below it still shows. */
|
|
70
|
-
yMin?: number;
|
|
71
|
-
/** Pin the top of the y-axis, for a bounded quantity such as a percentage (`yMax={100}`), so a low reading looks low. Choose a range that divides into four steps. A reading above it still shows. */
|
|
72
|
-
yMax?: number;
|
|
73
|
-
/** CSS colour for the measured series. Defaults to the first chart token. */
|
|
74
|
-
colour?: string;
|
|
75
|
-
/** Colour the measured series by value: each stop applies from `at` upwards, blending to the
|
|
76
|
-
* next. Only where the colour means something in the subject; record the reason in DESIGN.md. */
|
|
77
|
-
colourScale?: {
|
|
78
|
-
at: number;
|
|
79
|
-
colour: string;
|
|
80
|
-
}[];
|
|
81
|
-
/** Says what the colours mean, shown beside the legend swatch when `colourScale` is set. */
|
|
82
|
-
colourScaleLabel?: string;
|
|
83
|
-
/** What the end of the line is. `"now"` marks the last reading with a rule, a dot and "<value> now": right for a live reading, where the last point is the present. `"none"` leaves it unmarked: right for a series whose x is not time running up to now (an elevation profile, where the last point is the finish). Default `"now"`, or `"none"` when `current` is set, since `current` already says where now is. The peak label stays either way. */
|
|
84
|
-
end?: "now" | "none";
|
|
85
|
-
/** The current x, supplied by the app and drawn as a rule with its value ("now" in a replay, a playhead). Cheap to update often. */
|
|
86
|
-
current?: number;
|
|
87
|
-
/** The value at the rule, as a sentence part. Default: `formatX` and the value read off the line. */
|
|
88
|
-
formatCurrent?: (at: {
|
|
89
|
-
x: number;
|
|
90
|
-
y: number;
|
|
91
|
-
}) => string;
|
|
92
|
-
/** Read values at the pointer, and by keyboard on the plot (arrows, Home, End). `readout` words the reading; default `formatX: formatY`. */
|
|
93
|
-
readout?: boolean | ((p: Point) => string);
|
|
94
|
-
/** The viewer chose a reading (a click, or Enter on the plot): its x, so the app can seek or select. */
|
|
95
|
-
onPick?: (x: number) => void;
|
|
96
|
-
/** One flat, pale tint under the line. Only where the area carries the meaning (a profile, a running total). */
|
|
97
|
-
area?: boolean;
|
|
98
|
-
height?: number;
|
|
99
|
-
className?: string;
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* The y-axis: four equal gridline steps covering every value. With no pins the steps are a size
|
|
103
|
-
* people write on a scale (1, 2, 2.5, 4 or 5 × 10ⁿ), from zero or a round number below the lowest
|
|
104
|
-
* reading. A pinned end is used as given unless a value lies beyond it.
|
|
105
|
-
*/
|
|
106
|
-
export declare function yScale(values: number[], pin?: {
|
|
107
|
-
min?: number;
|
|
108
|
-
max?: number;
|
|
109
|
-
}): {
|
|
110
|
-
min: number;
|
|
111
|
-
max: number;
|
|
112
|
-
ticks: number[];
|
|
113
|
-
};
|
|
114
|
-
/** What a y scale gives the chart: its ends, ticks and where a value falls between them (0 at `min`, 1 at `max`). */
|
|
115
|
-
export type YScale = {
|
|
116
|
-
min: number;
|
|
117
|
-
max: number;
|
|
118
|
-
ticks: number[];
|
|
119
|
-
at: (v: number) => number;
|
|
120
|
-
log: boolean;
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* A logarithmic y axis over the positive values: the ends are the nearest 1, 2, 5 steps outside the
|
|
124
|
-
* data, the ticks are those steps, thinned to whole decades and then every k-th decade when there are
|
|
125
|
-
* more than seven. Values at or below zero are ignored (the chart reports them). A pinned end is used as
|
|
126
|
-
* given when it is positive and does not cut a reading off.
|
|
127
|
-
*/
|
|
128
|
-
export declare function logScale(values: number[], pin?: {
|
|
129
|
-
min?: number;
|
|
130
|
-
max?: number;
|
|
131
|
-
}): YScale;
|
|
132
|
-
/** The value of a series at x, read between the two readings either side (flat beyond the ends). Series need not be sorted. */
|
|
133
|
-
export declare function valueAt(series: readonly Point[], x: number): number;
|
|
134
|
-
/**
|
|
135
|
-
* The x ticks that fit at this width: every k-th tick, the smallest k for which neighbouring labels
|
|
136
|
-
* leave a gap, so the spacing stays even. `scale` maps an x value to a pixel.
|
|
137
|
-
*/
|
|
138
|
-
export declare function fitTicks(ticks: number[], scale: (x: number) => number, widthOf: (t: number) => number, gap?: number): number[];
|
|
139
|
-
/** One measured series, drawn in real pixels, with the peak and current readings labelled on the chart and every reading in a screen-reader table. Optional plan, threshold band and `colourScale`. */
|
|
140
|
-
export declare function LineChart({ label, series, seriesLabel, planned, plannedLabel, band, formatX, xLabel, formatY, xTicks, xDomain, xAxis, yScale: yMode, yInvert, spans, marks, onMarkSelect, renderMarkCard, cursor: cursorProp, yMin, yMax, colour, colourScale, colourScaleLabel, current, end, formatCurrent, readout, onPick, area, range, height, className, }: LineChartProps): React.JSX.Element;
|
|
141
|
-
/** One chart of a `LineChartGroup`: the props that differ per chart. The group owns the x axis, the cursor, `current` and `onPick`. */
|
|
142
|
-
export type GroupedChart = Omit<LineChartProps, "formatX" | "xLabel" | "xTicks" | "xDomain" | "xAxis" | "current" | "onPick" | "cursor" | "readout" | "label"> & {
|
|
143
|
-
/** Names this chart in the group's reading and its own accessible name. Default `seriesLabel`. */
|
|
144
|
-
label?: string;
|
|
145
|
-
};
|
|
146
|
-
export type LineChartGroupProps = {
|
|
147
|
-
/** What the stack shows, as a sentence. */
|
|
148
|
-
label: string;
|
|
149
|
-
charts: readonly GroupedChart[];
|
|
150
|
-
formatX: (x: number) => string;
|
|
151
|
-
xLabel?: string;
|
|
152
|
-
xTicks: LineChartProps["xTicks"];
|
|
153
|
-
/** Drawn on every chart (a chart's own `spans` and `marks` replace them). */
|
|
154
|
-
spans?: readonly ChartSpan[];
|
|
155
|
-
marks?: readonly ChartMark[];
|
|
156
|
-
onMarkSelect?: (mark: ChartMark) => void;
|
|
157
|
-
renderMarkCard?: (mark: ChartMark) => React.ReactNode;
|
|
158
|
-
/** The current x, drawn on every chart. */
|
|
159
|
-
current?: number;
|
|
160
|
-
onPick?: (x: number) => void;
|
|
161
|
-
className?: string;
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* Charts stacked on one x axis: one shared range, labels on the last chart only, and one cursor, so
|
|
165
|
-
* hovering or arrowing in any chart puts a rule and that chart's own reading in all of them (read
|
|
166
|
-
* together, and announced as one sentence, politely, at most once a second). Inside a `CursorScope`
|
|
167
|
-
* already, it joins that scope (a map beside the charts moves with them); otherwise it makes its own.
|
|
168
|
-
*/
|
|
169
|
-
export declare function LineChartGroup({ label, charts, formatX, xLabel, xTicks, spans, marks, onMarkSelect, renderMarkCard, current, onPick, className }: LineChartGroupProps): React.JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { To } from 'react-router';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** A destination card's props: `to` for a route in this app, or `href` for anywhere else, never both. */
|
|
4
|
-
export type LinkCardProps = ({
|
|
5
|
-
/** A route in this app, followed with React Router. */
|
|
6
|
-
to: To;
|
|
7
|
-
href?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
/** Somewhere that is not a route of this app. The card shows an arrow when it is on another origin. */
|
|
10
|
-
href: string;
|
|
11
|
-
to?: undefined;
|
|
12
|
-
}) & {
|
|
13
|
-
/** The destination's name, and the link's accessible name. */
|
|
14
|
-
title: string;
|
|
15
|
-
/** One sentence on what is there. Read as the link's description. */
|
|
16
|
-
description?: string;
|
|
17
|
-
/** `Status` words about the destination ("Running", "Updated today"). Nothing interactive. */
|
|
18
|
-
marks?: React.ReactNode;
|
|
19
|
-
/** For an `href`: whether it leaves the site (the arrow). Default: true when its origin is not this page's. */
|
|
20
|
-
external?: boolean;
|
|
21
|
-
/** The title's element. h3 under a section heading; h2 when the cards are the page's sections. */
|
|
22
|
-
as?: "h2" | "h3" | "h4";
|
|
23
|
-
className?: string;
|
|
24
|
-
};
|
|
25
|
-
/** A destination as a card that is one link: its title is the link's name, the description and status marks are its description, and the whole card is the target. */
|
|
26
|
-
export declare function LinkCard({ title, description, marks, as: Heading, className, external, ...destination }: LinkCardProps): React.JSX.Element;
|
|
27
|
-
/** A labelled list of `LinkCard`s in a grid: one column on a phone, up to three on a wide screen. */
|
|
28
|
-
export declare function LinkCardList({ label, children, className }: {
|
|
29
|
-
label: string;
|
|
30
|
-
children: React.ReactNode;
|
|
31
|
-
className?: string;
|
|
32
|
-
}): React.JSX.Element;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IconComponent } from '../lib/icon';
|
|
2
|
-
import { ButtonProps } from './button';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
export type Target = {
|
|
5
|
-
/** An app route (React Router): `"/learners/7"`, `"?tab=log"`. Client-side navigation, the basename applied. */
|
|
6
|
-
to: string;
|
|
7
|
-
href?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
/** A plain link: a download, a file or another site. */
|
|
10
|
-
href: string;
|
|
11
|
-
to?: undefined;
|
|
12
|
-
/** Offers the file for saving; `true` uses the server's name. */
|
|
13
|
-
download?: boolean | string;
|
|
14
|
-
};
|
|
15
|
-
type BaseProps = {
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
className?: string;
|
|
18
|
-
/** Opens in a new tab; the link gets `rel="noreferrer"`. */
|
|
19
|
-
newTab?: boolean;
|
|
20
|
-
/** Names the link when its text alone does not. */
|
|
21
|
-
"aria-label"?: string;
|
|
22
|
-
id?: string;
|
|
23
|
-
onPress?: ButtonProps["onPress"];
|
|
24
|
-
/** React Router's location state for a `to` link (where the person came from, read on the next page with `useLocation().state`). */
|
|
25
|
-
state?: unknown;
|
|
26
|
-
};
|
|
27
|
-
/** Props of `ButtonLink`. */
|
|
28
|
-
export type ButtonLinkProps = BaseProps & Target & {
|
|
29
|
-
variant?: ButtonProps["variant"];
|
|
30
|
-
size?: ButtonProps["size"];
|
|
31
|
-
icon?: IconComponent;
|
|
32
|
-
};
|
|
33
|
-
/** Props of `TextLink`. */
|
|
34
|
-
export type TextLinkProps = BaseProps & Target & {
|
|
35
|
-
icon?: IconComponent;
|
|
36
|
-
};
|
|
37
|
-
export declare function useTarget(target: Target, newTab: boolean | undefined, state?: unknown): {
|
|
38
|
-
provide: (node: React.ReactNode) => React.JSX.Element;
|
|
39
|
-
props: {
|
|
40
|
-
href: string;
|
|
41
|
-
download: string | boolean | undefined;
|
|
42
|
-
target: string | undefined;
|
|
43
|
-
rel: string | undefined;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* A link drawn as a `Button` (React Router `to`, or `href` for a download or another site): the same variants and heights, `variant="default"` is the filled one and counts for the one-filled-button rule (`data-variant` is set).
|
|
48
|
-
*/
|
|
49
|
-
export declare function ButtonLink(all: ButtonLinkProps): React.JSX.Element;
|
|
50
|
-
/**
|
|
51
|
-
* The house in-app link: accent ink, underlined, for a sentence, a table cell or an empty state's next step. `to` for a route, `href` for a file or another site.
|
|
52
|
-
*/
|
|
53
|
-
export declare function TextLink(all: TextLinkProps): React.JSX.Element;
|
|
54
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { IconComponent } from '../lib/icon';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** A tone for a mark, as a role colour. */
|
|
4
|
-
export type MarkTone = "neutral" | "info" | "success" | "warning" | "danger";
|
|
5
|
-
/** An underline pattern, so a mark does not depend on its colour. */
|
|
6
|
-
export type MarkPattern = "solid" | "dashed" | "dotted" | "double" | "wavy";
|
|
7
|
-
/** One kind of mark the app offers. */
|
|
8
|
-
export type MarkKind = {
|
|
9
|
-
/** What is stored per word. */
|
|
10
|
-
key: string;
|
|
11
|
-
/** What the mark means, said and shown: "Must use". Never a colour name. */
|
|
12
|
-
label: string;
|
|
13
|
-
tone: MarkTone;
|
|
14
|
-
pattern: MarkPattern;
|
|
15
|
-
/** Shown in the toolbar, legend and summary beside the label. */
|
|
16
|
-
icon?: IconComponent;
|
|
17
|
-
/** The chord that applies it to the selection: `["g"]`. Single keys are fine; they never fire while typing. */
|
|
18
|
-
keys?: string[];
|
|
19
|
-
};
|
|
20
|
-
/** One word (or phrase, or clip) that can be marked. Draws its mark, its selection and the caret; inside a `MarkableText`. */
|
|
21
|
-
export declare function Mark({ id, children, className, onClick, onHover }: {
|
|
22
|
-
id: string;
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
className?: string; /** A click on the word (a press and release on it), beside selecting it: a correction opens. */
|
|
25
|
-
onClick?: () => void; /** The pointer is over the word (its element) or has left (`null`). */
|
|
26
|
-
onHover?: (el: HTMLElement | null) => void;
|
|
27
|
-
}): React.JSX.Element;
|
|
28
|
-
/** "12 words must use, 3 never": a count for each kind in use, with its icon. */
|
|
29
|
-
export declare function MarkSummary({ marks, kinds, unit, className }: {
|
|
30
|
-
marks: Readonly<Record<string, string | undefined>>;
|
|
31
|
-
kinds: readonly MarkKind[];
|
|
32
|
-
unit?: readonly [string, string];
|
|
33
|
-
className?: string;
|
|
34
|
-
}): React.JSX.Element;
|
|
35
|
-
export type MarkableTextProps = {
|
|
36
|
-
/** Names the region: "Transcript, for marking". Required. */
|
|
37
|
-
label: string;
|
|
38
|
-
/** Every markable id in document order, including those in rows not mounted now. */
|
|
39
|
-
ids: readonly string[];
|
|
40
|
-
/** The mark on each id (a kind's `key`); ids with none are unmarked. */
|
|
41
|
-
marks: Readonly<Record<string, string | undefined>>;
|
|
42
|
-
kinds: readonly MarkKind[];
|
|
43
|
-
/** Apply a kind (or `null` to clear) to the selected ids. The app stores it. */
|
|
44
|
-
onMark: (ids: readonly string[], kind: string | null) => void;
|
|
45
|
-
/** Chords that clear the selection's marks: `["w"]`. */
|
|
46
|
-
clearKeys?: string[];
|
|
47
|
-
/** Enter on the caret's id (a word that has something to open, such as a correction). Leave out and Enter does nothing. */
|
|
48
|
-
onActivate?: (id: string) => void;
|
|
49
|
-
/** The caret moved to this id (so a virtualised list can scroll it into view). */
|
|
50
|
-
onCaretChange?: (id: string) => void;
|
|
51
|
-
/** What one id is called in counts: `["word", "words"]`. */
|
|
52
|
-
unit?: readonly [string, string];
|
|
53
|
-
/** Show the summary line under the text. Default true. */
|
|
54
|
-
summary?: boolean;
|
|
55
|
-
/** The text, with `<Mark id>` elements. */
|
|
56
|
-
children: React.ReactNode;
|
|
57
|
-
className?: string;
|
|
58
|
-
};
|
|
59
|
-
/** Selects ids over `<Mark>` words by drag, Shift+click and Shift+arrows (a run in the app's order, so it holds across virtualised rows), offers the app's marks as chorded commands in a bar, says each change in words, and lists what is marked. */
|
|
60
|
-
export declare function MarkableText({ label, ids, marks, kinds, onMark, clearKeys, onActivate, onCaretChange, unit, summary, children, className }: MarkableTextProps): React.JSX.Element;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** One stretch of the file: its id, title, span in seconds, and an optional line under the title. */
|
|
3
|
-
export type MediaContentsItem = {
|
|
4
|
-
id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
/** Under the title: "3 scenes", "Grandma, the children". */
|
|
9
|
-
detail?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
/** The media contents' props. */
|
|
12
|
-
export type MediaContentsProps = {
|
|
13
|
-
/** Names the list: "Chapters of the tape". */
|
|
14
|
-
label: string;
|
|
15
|
-
/** The stretches in order. */
|
|
16
|
-
items: readonly MediaContentsItem[];
|
|
17
|
-
/** The playhead, seconds: the item holding it is marked current. */
|
|
18
|
-
time?: number;
|
|
19
|
-
/** Plays from a time (an item's start). */
|
|
20
|
-
onSeek: (time: number) => void;
|
|
21
|
-
/** Told which item was pressed, after `onSeek`, for an app that brings its own section into view. */
|
|
22
|
-
onSelect?: (id: string) => void;
|
|
23
|
-
className?: string;
|
|
24
|
-
};
|
|
25
|
-
/** The index of the item whose span holds `time`, or -1. */
|
|
26
|
-
export declare function currentItem(items: readonly Pick<MediaContentsItem, "start" | "end">[], time: number | undefined): number;
|
|
27
|
-
/** One media file's chapters as a list of contents beside its player: the one playing marked, and pressing one plays from its start. */
|
|
28
|
-
export declare function MediaContents({ label, items, time, onSeek, onSelect, className }: MediaContentsProps): React.JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { MediaElementState, MediaWindow } from './media-player';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** What a group needs of a member: whether it is paused, a way to pause it, and a way to hear it start. An `HTMLMediaElement` is one; so is a `useTimeline` clock (strata-react issue #384). */
|
|
4
|
-
export type GroupMember = {
|
|
5
|
-
readonly paused: boolean;
|
|
6
|
-
pause(): void;
|
|
7
|
-
addEventListener(type: "play", listener: () => void): void;
|
|
8
|
-
removeEventListener(type: "play", listener: () => void): void;
|
|
9
|
-
};
|
|
10
|
-
/** Adds an element, or a `useTimeline` clock, to a named group until the returned function is called; whenever one plays, the others pause. */
|
|
11
|
-
export declare function joinMediaGroup(name: string, el: GroupMember): () => void;
|
|
12
|
-
/** The group a `MediaGroup` above this point names, or null. */
|
|
13
|
-
export declare function useMediaGroupName(): string | null;
|
|
14
|
-
/** Players and elements under it play one at a time: starting one pauses the others. */
|
|
15
|
-
export declare function MediaGroup({ name, children }: {
|
|
16
|
-
name?: string;
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
}): React.JSX.Element;
|
|
19
|
-
/** Whether two windows are the same stretch. */
|
|
20
|
-
export declare const sameWindow: (a: MediaWindow | null | undefined, b: MediaWindow | null | undefined) => boolean;
|
|
21
|
-
export type PlayWindowButtonProps = {
|
|
22
|
-
/** The shared element's handle from `useMediaElement`. */
|
|
23
|
-
media: Pick<MediaElementState, "playing" | "window" | "playWindow" | "pause">;
|
|
24
|
-
/** The stretch it plays, in seconds. */
|
|
25
|
-
window: MediaWindow;
|
|
26
|
-
/** What it plays, in the row's words: "Play phrase 12" (the name stays the same while it plays; the pressed state says the rest). */
|
|
27
|
-
label: string;
|
|
28
|
-
size?: "default" | "sm";
|
|
29
|
-
className?: string;
|
|
30
|
-
};
|
|
31
|
-
/** A row's play button for one window of a shared element: named for what it plays, pressed while it plays, a second press pauses. */
|
|
32
|
-
export declare function PlayWindowButton({ media, window: w, label, size, className }: PlayWindowButtonProps): React.JSX.Element;
|