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,251 +0,0 @@
|
|
|
1
|
-
import { PlayerWarningEvent } from './player-warning';
|
|
2
|
-
import { MediaMark, SkipSteps } from './media-skip';
|
|
3
|
-
import { MediaSpanData, SpanKind, SpanOutcome, SpanWords } from './media-spans';
|
|
4
|
-
import { MediaProgress } from './media-progress';
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
export type { MediaProgress };
|
|
7
|
-
/** The words of the "Picked up at" notice. */
|
|
8
|
-
export type ResumeWords = {
|
|
9
|
-
/** Default `Picked up at 2:05`. Takes the time already formatted. */
|
|
10
|
-
pickedUp?: (time: string) => string;
|
|
11
|
-
/** Default "Start over". */
|
|
12
|
-
startOver?: string;
|
|
13
|
-
};
|
|
14
|
-
/** Why a player is not playing, for the app to word. */
|
|
15
|
-
export type MediaProblem = {
|
|
16
|
-
kind: "load";
|
|
17
|
-
message: string;
|
|
18
|
-
} | {
|
|
19
|
-
kind: "blocked";
|
|
20
|
-
message: string;
|
|
21
|
-
};
|
|
22
|
-
/** What `useMediaElement` returns: the element's state as values, and the requests a player makes of it. */
|
|
23
|
-
export type MediaElementState = {
|
|
24
|
-
/** Seconds that can be sought to: for a source still being made, the end of what exists; otherwise the duration (or 0 while it is not known). */
|
|
25
|
-
ready: number;
|
|
26
|
-
/** A source that is still being made has been played up to the end of what exists, and is waiting for more. */
|
|
27
|
-
waitingForMore: boolean;
|
|
28
|
-
/** Shows a stream's own failure (one the element cannot report, such as a stream engine's fatal error) as the load error, with Try again. */
|
|
29
|
-
reportProblem: (message: string | null) => void;
|
|
30
|
-
/** The stretch of the file being played, if any: the `window` option, or the last `playWindow`. */
|
|
31
|
-
window: MediaWindow | null;
|
|
32
|
-
/** Plays a stretch: seeks to its start, plays, and stops (or loops) at its end. */
|
|
33
|
-
playWindow: (window: MediaWindow) => Promise<void>;
|
|
34
|
-
playing: boolean;
|
|
35
|
-
/** Seconds. */
|
|
36
|
-
time: number;
|
|
37
|
-
/** Seconds, or null until the element knows it (a stream reports NaN or Infinity). */
|
|
38
|
-
duration: number | null;
|
|
39
|
-
/** Seconds buffered from the start of the range holding `time`. */
|
|
40
|
-
buffered: number;
|
|
41
|
-
/** 0 to 100; 0 while muted. */
|
|
42
|
-
volume: number;
|
|
43
|
-
muted: boolean;
|
|
44
|
-
rate: number;
|
|
45
|
-
ended: boolean;
|
|
46
|
-
/** Waiting for data (the first load, or a seek into what is not buffered yet). */
|
|
47
|
-
loading: boolean;
|
|
48
|
-
error: MediaProblem | null;
|
|
49
|
-
play: () => Promise<void>;
|
|
50
|
-
pause: () => void;
|
|
51
|
-
toggle: () => void;
|
|
52
|
-
/** Seeks; before the metadata has loaded, remembers the time and applies it when it has. */
|
|
53
|
-
seek: (time: number) => void;
|
|
54
|
-
/** 0 to 100. 0 mutes; more unmutes at that level. */
|
|
55
|
-
setVolume: (volume: number) => void;
|
|
56
|
-
setRate: (rate: number) => void;
|
|
57
|
-
/** Loads again, and plays if it was playing. For the error state's "Try again". */
|
|
58
|
-
retry: () => void;
|
|
59
|
-
/** Counts a stretch (seconds in the file) as watched without it being played, for one the app skipped on purpose. See `onProgress`. */
|
|
60
|
-
markWatched: (start: number, end: number) => void;
|
|
61
|
-
};
|
|
62
|
-
/** A stretch of a file, in seconds. */
|
|
63
|
-
export type MediaWindow = {
|
|
64
|
-
start: number;
|
|
65
|
-
end: number;
|
|
66
|
-
};
|
|
67
|
-
/** What `useMediaElement` can be asked to do besides follow the element. */
|
|
68
|
-
export type MediaElementOptions = {
|
|
69
|
-
/** Bound playback to a stretch: it starts at `start` (a play from outside it seeks there) and stops at `end`. */
|
|
70
|
-
window?: MediaWindow | null;
|
|
71
|
-
/** At the end of the window, go back to its start and carry on, instead of stopping. */
|
|
72
|
-
loop?: boolean;
|
|
73
|
-
/** Join a group: when this element plays, the others in the group pause. Defaults to the nearest `MediaGroup`. */
|
|
74
|
-
group?: string;
|
|
75
|
-
/** Called every animation frame while playing, with the element's time, for highlighting what is being heard. */
|
|
76
|
-
onTimeUpdate?: (time: number) => void;
|
|
77
|
-
/** The window's end was reached (once per play; not called when it loops). */
|
|
78
|
-
onWindowEnd?: () => void;
|
|
79
|
-
/** The source is still being made (a growing stream): its duration is the end of what exists and keeps growing, it never counts as ended, and playback that reached the end carries on when more arrives. */
|
|
80
|
-
growing?: boolean;
|
|
81
|
-
/** Loads again from `time`, for a source the element cannot reload itself (a stream engine). Replaces the element's `load()` in `retry`. */
|
|
82
|
-
onRetry?: (time: number) => void;
|
|
83
|
-
/**
|
|
84
|
-
* How much has been seen (strata-react issue #272): called every `progressEvery` seconds of playing, and on pause, on the end, when the page is hidden, when it is left and when the player unmounts or changes file.
|
|
85
|
-
* `watched` counts each second once, when the playhead passes it by playing; a seek or skip counts nothing and going back over a part adds nothing. A report is not repeated while nothing has changed.
|
|
86
|
-
*/
|
|
87
|
-
onProgress?: (report: MediaProgress) => void;
|
|
88
|
-
/** Seconds of playing between reports. Default 15. */
|
|
89
|
-
progressEvery?: number;
|
|
90
|
-
/** Names what is being played, so the count starts again when it changes. Default the element's `src` attribute; give it for a stream attached by an engine. */
|
|
91
|
-
progressKey?: string;
|
|
92
|
-
};
|
|
93
|
-
/** Follows an `<audio>` or `<video>` and returns its state and the requests a player makes. Works with the browser's own controls too. */
|
|
94
|
-
export declare function useMediaElement(ref: React.RefObject<HTMLMediaElement | null>, options?: MediaElementOptions): MediaElementState;
|
|
95
|
-
/** What a stream engine is given when it takes over an element. */
|
|
96
|
-
export type StreamContext = {
|
|
97
|
-
/** Where to start, seconds (a reload starts where playback was). */
|
|
98
|
-
startAt: number;
|
|
99
|
-
/** Tell the player the stream failed, in words for the person: it shows the load error with Try again. */
|
|
100
|
-
onProblem: (message: string) => void;
|
|
101
|
-
/** The source is still being made (`MediaPlayer growing`): its start exists and the edge moves, so a first load starts at the beginning, not at the newest part. */
|
|
102
|
-
growing?: boolean;
|
|
103
|
-
};
|
|
104
|
-
/** A stream engine's hold on an element, so the player can end it and restart it. */
|
|
105
|
-
export type StreamAttachment = {
|
|
106
|
-
/** Lets go of the element: stops loading, frees what the engine made. */
|
|
107
|
-
detach: () => void;
|
|
108
|
-
/** Starts again from `at` seconds (the player's Try again). */
|
|
109
|
-
reload: (at: number) => void;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Plays a source the element cannot play by itself (HLS outside Safari, say) by taking over the
|
|
113
|
-
* element: sets what it needs on it, and returns a hold the player ends when the source changes or the
|
|
114
|
-
* player unmounts. `strata-react/hls` has one; any engine that fits is used the same way.
|
|
115
|
-
*/
|
|
116
|
-
export type SourceAttacher = (el: HTMLMediaElement, src: string, context: StreamContext) => StreamAttachment;
|
|
117
|
-
/**
|
|
118
|
-
* Hands `src` to a stream engine (`attach`) for the element in `ref`, and ends the hold when `src` changes, `attach` does, or the component unmounts.
|
|
119
|
-
* Use it for a plain `<video>` the app owns, with `useMediaElement`; `MediaPlayer` does it for `attach`.
|
|
120
|
-
* Returns `reload`, for the player's Try again (`useMediaElement`'s `onRetry`), and gives the engine's failures to `onProblem` (`reportProblem`).
|
|
121
|
-
*/
|
|
122
|
-
export declare function useAttachedSource(ref: React.RefObject<HTMLMediaElement | null>, src: string | undefined, attach: SourceAttacher | undefined, onProblem?: (message: string) => void, growing?: boolean, start?: number): {
|
|
123
|
-
reload: (at: number) => void;
|
|
124
|
-
};
|
|
125
|
-
/** One file in a sequence. */
|
|
126
|
-
export type MediaSource = {
|
|
127
|
-
src: string;
|
|
128
|
-
/** Names the source on the seek bar's marks and in "Chapter 2 of 5". */
|
|
129
|
-
title: string;
|
|
130
|
-
/** Seconds. When every source gives it, the seek bar spans the whole sequence. */
|
|
131
|
-
duration?: number;
|
|
132
|
-
};
|
|
133
|
-
/** Lock-screen and headset metadata (`navigator.mediaSession`). */
|
|
134
|
-
export type MediaSession = {
|
|
135
|
-
title: string;
|
|
136
|
-
artist?: string;
|
|
137
|
-
album?: string;
|
|
138
|
-
artwork?: string;
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* What is playing, drawn across the top of a video while it is paused or the pointer is on it: a
|
|
142
|
-
* title, who made it, and their picture. Plain data; the player draws it.
|
|
143
|
-
*/
|
|
144
|
-
export type MediaHeading = {
|
|
145
|
-
/** What is playing ("Glazing a celadon bowl"). */
|
|
146
|
-
title: string;
|
|
147
|
-
/** An app route the title leads to. */
|
|
148
|
-
to?: string;
|
|
149
|
-
/** Under the title: who made it, or where it is from ("Kiln room"). */
|
|
150
|
-
subtitle?: string;
|
|
151
|
-
/** An app route the subtitle leads to, and the picture with it when there is a subtitle to name that link. */
|
|
152
|
-
subtitleTo?: string;
|
|
153
|
-
/** React Router's location state the heading's links carry (where the person came from, for the next page to read). */
|
|
154
|
-
state?: unknown;
|
|
155
|
-
/** A small round picture before the words (the maker's avatar). `null` draws the subtitle's first letter instead. */
|
|
156
|
-
avatar?: string | null;
|
|
157
|
-
};
|
|
158
|
-
export type MediaPlayerProps = {
|
|
159
|
-
/** Names the player and its element. */
|
|
160
|
-
label: string;
|
|
161
|
-
kind?: "audio" | "video";
|
|
162
|
-
/** One file. */
|
|
163
|
-
src?: string;
|
|
164
|
-
/** Or a sequence; ending moves to the next and keeps playing. */
|
|
165
|
-
sources?: readonly MediaSource[];
|
|
166
|
-
/** The current source, when the app holds it (a chapter list beside the player). */
|
|
167
|
-
index?: number;
|
|
168
|
-
onIndexChange?: (index: number) => void;
|
|
169
|
-
/** Move to the next source when one ends. Default true. */
|
|
170
|
-
autoAdvance?: boolean;
|
|
171
|
-
/** `"auto"`: the browser's controls on a touch device, Strata's on a desktop. Default. */
|
|
172
|
-
controls?: "auto" | "native" | "strata";
|
|
173
|
-
autoPlay?: boolean;
|
|
174
|
-
poster?: string;
|
|
175
|
-
session?: MediaSession;
|
|
176
|
-
/** The playback speeds offered. Default 0.5 to 2; for speech use {@link SPEECH_RATES}. */
|
|
177
|
-
rates?: readonly number[];
|
|
178
|
-
/** Keys on the page (Space or K, J and L for 10 s, M). Default true; turn off when the screen binds its own. With several players on a page the keys go to the one last played, focused or pressed. */
|
|
179
|
-
shortcuts?: boolean;
|
|
180
|
-
/** Play only a stretch of the file (seconds): it starts at `start`, stops at `end` (or loops), the seek bar and time show the stretch, and "Playing 0:12 to 0:15" is announced. One file only, not with `sources`. */
|
|
181
|
-
window?: MediaWindow;
|
|
182
|
-
/** Go back to the start of `window` at its end and carry on. */
|
|
183
|
-
loop?: boolean;
|
|
184
|
-
/** Show the whole file's timeline with the window marked, instead of the window as the whole bar. */
|
|
185
|
-
showFull?: boolean;
|
|
186
|
-
/** Join a group: starting this player pauses the others in it. Defaults to the nearest `MediaGroup`. */
|
|
187
|
-
group?: string;
|
|
188
|
-
/** Called every animation frame while playing, with the time in the file (not in the window), for highlighting. */
|
|
189
|
-
onTimeUpdate?: (time: number) => void;
|
|
190
|
-
/** The window reached its end (not called when it loops). */
|
|
191
|
-
onWindowEnd?: () => void;
|
|
192
|
-
/** Plays the sources through a stream engine instead of the element's own `src` (`attachHls` from `strata-react/hls` for HLS). The element is the same one throughout, so playback carries on across sources as ever. */
|
|
193
|
-
attach?: SourceAttacher;
|
|
194
|
-
/** The source is still being made (a stream that grows while it plays): the seek bar shows the part that exists, a "Still being made" word and `status` (what the app says about progress) appear, and playback that catches up with the end waits, says so, and resumes when more arrives, without an `onEnded`. Give the source's `duration` when the whole length is known. */
|
|
195
|
-
growing?: {
|
|
196
|
-
status?: string;
|
|
197
|
-
};
|
|
198
|
-
/** The last source has ended. */
|
|
199
|
-
onEnded?: () => void;
|
|
200
|
-
/** Called as the element plays, with the time in the whole sequence. */
|
|
201
|
-
onTimeChange?: (time: number) => void;
|
|
202
|
-
/** Marked stretches (an intro, a recap, a sponsor read), in seconds on the player's timeline: drawn on the seek bar, and acted on as playback reaches them as `spanKinds` says (strata-react issue #207). */
|
|
203
|
-
spans?: readonly MediaSpanData[];
|
|
204
|
-
/** For each kind of span: its `label`, its `tone` (a status role) and what happens on reaching one: `"auto"` skips it (or mutes it, for a span whose `action` is `"mute"`) with "Skipped intro" and Undo, `"ask"` offers a Skip button over the picture (and the `s` key), `"off"` (default) only draws it. Keep the object stable (state or `useMemo`). */
|
|
205
|
-
spanKinds?: Readonly<Record<string, SpanKind>>;
|
|
206
|
-
/** Named points of one file drawn on the seek bar (its chapters: "Christmas dinner" at 40:12, and `kind: "scene"` for the scenes within them), each named in a tooltip; pressing one seeks there (strata-react issues #371, #387). They are also what the skip buttons step through. For a single `src` without a `window`: a sequence's own marks (each source's start) and a window's take their place. Keep the array stable. */
|
|
207
|
-
marks?: readonly MediaMark[];
|
|
208
|
-
/** The skip buttons either side of Play. A file with marks skips by them (scenes small, chapters large: "Next scene", "Previous chapter"); a level without marks skips by time, `small` (default 10 s) and `large` (default 60 s). A sequence's large skip is its previous and next source. `false` draws none. */
|
|
209
|
-
skip?: SkipSteps | false;
|
|
210
|
-
/** The video's frame rate: draws Back one frame and Forward one frame beside Play (and the `,` and `.` keys), which pause and step one frame. Not drawn without it, since a browser does not say a file's rate. */
|
|
211
|
-
fps?: number;
|
|
212
|
-
/** Keep a playing video in sight while the page scrolls: once the player has scrolled off the top of the screen, the picture floats in a small box in the corner with its own seek bar, Play, Back to the player and Close, and goes back in place when the player is scrolled to. The same element moves, so playback carries on. Video only. */
|
|
213
|
-
float?: boolean;
|
|
214
|
-
/** Told what was done with a span: `skipped`, `muted`, `undone` or `played`. */
|
|
215
|
-
onSpan?: (span: MediaSpanData, what: SpanOutcome) => void;
|
|
216
|
-
/** The Skip button's and the notice's words, in the product's language. */
|
|
217
|
-
spanWords?: SpanWords;
|
|
218
|
-
/** Where a first load begins, seconds (strata-react issue #271: "Continue watching"). For an `attach`ed stream it is the attacher's `startAt`; for a plain `src`, a seek once the metadata is in. A reload (Try again) keeps the time reached. While it is more than 0 the player says "Picked up at 2:05" over the picture, with Start over, until the person starts over, plays for a few seconds, or it is dismissed by seeking. */
|
|
219
|
-
start?: number;
|
|
220
|
-
/** The words of that notice, in the product's language. */
|
|
221
|
-
resumeWords?: ResumeWords;
|
|
222
|
-
/** How much has been seen: every `progressEvery` seconds of playing, and on pause, on the end, when the page is hidden or left and when the player unmounts, with the position and the seconds played through (a span the player skipped counts as watched). `index` is the source in a `sources` sequence, and the times are those of that file (strata-react issue #272). */
|
|
223
|
-
onProgress?: (report: MediaProgress & {
|
|
224
|
-
index: number;
|
|
225
|
-
}) => void;
|
|
226
|
-
/** Seconds of playing between progress reports. Default 15. */
|
|
227
|
-
progressEvery?: number;
|
|
228
|
-
/** The player's state and requests (`seek`, `setVolume`, `time`, `duration`…), for an app that acts on playback from beside it: a chapter list, comments at a time (strata-react issue #211). An object ref holds the latest state without rendering again; a function ref is called with it on every render. */
|
|
229
|
-
mediaRef?: React.Ref<MediaElementState>;
|
|
230
|
-
/** What is playing, across the top of a video: shown while it is paused, and for a few seconds after the pointer moves on it, a key is pressed or playing starts; hidden with the controls (strata-react issue #329). Video only. */
|
|
231
|
-
heading?: MediaHeading;
|
|
232
|
-
/** Drawn over the picture only (never the controls) in a box that fills it; the app's classes choose the corner (`absolute bottom-3 right-3`). Anything interactive in it is clickable and focusable. A video's box keeps its shape before the metadata loads, so the overlay has a stable place. */
|
|
233
|
-
overlay?: (media: MediaElementState) => React.ReactNode;
|
|
234
|
-
/** Content below the controls for playback-related messages and actions. Hides with the controls during idle fullscreen playback. */
|
|
235
|
-
status?: React.ReactNode;
|
|
236
|
-
/** A transient warning from `usePlayerWarnings`, shown independently of the controls. */
|
|
237
|
-
warning?: PlayerWarningEvent;
|
|
238
|
-
/** The picture's shape before its metadata loads (and after, when given): a width over a height, or "16/9". Default "16/9" until the video says its own. */
|
|
239
|
-
aspect?: number | `${number}/${number}`;
|
|
240
|
-
/** A video has a Full screen button (and the `f` key) beside the speed and volume. Default true; `false` for a picture that must stay in its place. Only where the browser has the Fullscreen API (the window-filling fallback would mount the video again and lose its place). Not drawn with the browser's own controls (`controls="native"`, or `"auto"` on a touch device), which have their own. */
|
|
241
|
-
fullscreen?: boolean;
|
|
242
|
-
className?: string;
|
|
243
|
-
};
|
|
244
|
-
/** Playback speeds an audiobook or lecture listener expects. */
|
|
245
|
-
export declare const SPEECH_RATES: readonly number[];
|
|
246
|
-
/**
|
|
247
|
-
* Plays a file or a sequence: the element, its state, and Strata's controls (or the browser's own on
|
|
248
|
-
* a touch device), with the failure to load shown and retried. For an editor or a replay, use the
|
|
249
|
-
* parts and `useMediaElement` directly.
|
|
250
|
-
*/
|
|
251
|
-
export declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, marks, onSpan, spanWords, start, resumeWords, onProgress, progressEvery, mediaRef, heading, overlay, status, warning, aspect, fullscreen, skip, fps, float, className, }: MediaPlayerProps): React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** What `onProgress` is called with. */
|
|
2
|
-
export type MediaProgress = {
|
|
3
|
-
/** Where the playhead is, seconds into the file. */
|
|
4
|
-
position: number;
|
|
5
|
-
/** Seconds played through, each counted once; a span the player skipped counts as watched. */
|
|
6
|
-
watched: number;
|
|
7
|
-
/** The file's length in seconds, or null while it is not known. */
|
|
8
|
-
duration: number | null;
|
|
9
|
-
};
|
|
10
|
-
/** Ranges of seconds that have been seen, merged, so each second is counted once. */
|
|
11
|
-
export type WatchedRanges = {
|
|
12
|
-
add: (start: number, end: number) => void;
|
|
13
|
-
/** Seconds in all, to a tenth. */
|
|
14
|
-
total: () => number;
|
|
15
|
-
clear: () => void;
|
|
16
|
-
};
|
|
17
|
-
export declare function createWatchedRanges(): WatchedRanges;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/** A named point on a player's timeline: a chapter (the default) or a scene within one. */
|
|
2
|
-
export type MediaMark = {
|
|
3
|
-
time: number;
|
|
4
|
-
label: string;
|
|
5
|
-
kind?: "chapter" | "scene";
|
|
6
|
-
};
|
|
7
|
-
/** The two skip levels. */
|
|
8
|
-
export type SkipLevel = "small" | "large";
|
|
9
|
-
/** The time steps for a file without parts at that level, in seconds. */
|
|
10
|
-
export type SkipSteps = {
|
|
11
|
-
small?: number;
|
|
12
|
-
large?: number;
|
|
13
|
-
};
|
|
14
|
-
/** What a skip does: its button's name, and where it goes (null when there is nowhere, at either end). */
|
|
15
|
-
export type SkipAction = {
|
|
16
|
-
label: string;
|
|
17
|
-
to: number | null;
|
|
18
|
-
by: "mark" | "time";
|
|
19
|
-
};
|
|
20
|
-
/** The marks a level skips by: scenes for small, chapters (and marks with no kind) for large, in time order. */
|
|
21
|
-
export declare function marksFor(marks: readonly MediaMark[], level: SkipLevel): number[];
|
|
22
|
-
/**
|
|
23
|
-
* Where a skip at `level` in `direction` from `time` goes: by the level's marks when the file has any
|
|
24
|
-
* (the file's start counts as one), else by its time step. `restart` is how far into a part
|
|
25
|
-
* "previous" still means its start. The target is kept within 0 to `duration` when that is known, and marks past it are not skipped to.
|
|
26
|
-
*/
|
|
27
|
-
export declare function skipAction(marks: readonly MediaMark[], level: SkipLevel, direction: -1 | 1, time: number, { steps, duration, restart }?: {
|
|
28
|
-
steps?: SkipSteps;
|
|
29
|
-
duration?: number | null;
|
|
30
|
-
restart?: number;
|
|
31
|
-
}): SkipAction;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { SeekBarSpan } from './media';
|
|
2
|
-
import { SpanTone } from './line-chart';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
/** What happens when playback reaches a kind of stretch. `"off"` only draws it. */
|
|
5
|
-
export type SpanBehaviour = "auto" | "ask" | "off";
|
|
6
|
-
/** How one kind of stretch is drawn and treated. */
|
|
7
|
-
export type SpanKind = {
|
|
8
|
-
/** "Intro": its name on the bar and in the buttons ("Skip intro"). */
|
|
9
|
-
label: string;
|
|
10
|
-
/** Default "off". */
|
|
11
|
-
behaviour?: SpanBehaviour;
|
|
12
|
-
/** Default "info". */
|
|
13
|
-
tone?: SpanTone;
|
|
14
|
-
/** A colour of the app's theme for this kind, by its custom property (`"--seg-sponsor"`): for kinds whose colours the app's people already know, and more than five of them. Wins over `tone`. The name stays the carrier of meaning; the library never picks a colour. */
|
|
15
|
-
colour?: string;
|
|
16
|
-
};
|
|
17
|
-
/** A stretch of the recording, in seconds on the player's timeline, of one of the `spanKinds`. */
|
|
18
|
-
export type MediaSpanData = {
|
|
19
|
-
start: number;
|
|
20
|
-
end: number;
|
|
21
|
-
kind: string;
|
|
22
|
-
/** What acting on it does: skip to its end (default), or mute until it ends. */
|
|
23
|
-
action?: "skip" | "mute";
|
|
24
|
-
};
|
|
25
|
-
/** What the player did with a stretch, for an app that records it: `skipped`, `muted`, `undone` (the person took it back), `played` (it was offered and let play, or played after Undo). */
|
|
26
|
-
export type SpanOutcome = "skipped" | "muted" | "undone" | "played";
|
|
27
|
-
/** The words of the Skip button and the notice, in the product's voice. Each takes the kind's label. */
|
|
28
|
-
export type SpanWords = {
|
|
29
|
-
/** Default `Skip intro` (the label in lower case). */
|
|
30
|
-
skip?: (label: string) => string;
|
|
31
|
-
/** Default `Skipped intro`. */
|
|
32
|
-
skipped?: (label: string) => string;
|
|
33
|
-
/** Default `Mute sponsor`. */
|
|
34
|
-
mute?: (label: string) => string;
|
|
35
|
-
/** Default `Muted sponsor`. */
|
|
36
|
-
muted?: (label: string) => string;
|
|
37
|
-
/** Default "Undo". */
|
|
38
|
-
undo?: string;
|
|
39
|
-
};
|
|
40
|
-
type Options = {
|
|
41
|
-
spans?: readonly MediaSpanData[];
|
|
42
|
-
kinds?: Readonly<Record<string, SpanKind>>;
|
|
43
|
-
words?: SpanWords;
|
|
44
|
-
onSpan?: (span: MediaSpanData, what: SpanOutcome) => void;
|
|
45
|
-
/** Seconds, on the same timeline as the spans. */
|
|
46
|
-
time: number;
|
|
47
|
-
playing: boolean;
|
|
48
|
-
/** The length, once known: spans are cut to it. */
|
|
49
|
-
duration: number | null;
|
|
50
|
-
/** Seconds that exist so far, for a source still being made; a span ending beyond it is not skipped yet. */
|
|
51
|
-
limit?: number;
|
|
52
|
-
seek: (time: number) => void;
|
|
53
|
-
/** 0 to 100; 0 is muted. */
|
|
54
|
-
volume: number;
|
|
55
|
-
setVolume: (volume: number) => void;
|
|
56
|
-
};
|
|
57
|
-
/** What `useMediaSpans` gives the player. */
|
|
58
|
-
export type MediaSpansState = {
|
|
59
|
-
/** For `SeekBar spans`. */
|
|
60
|
-
bars: SeekBarSpan[];
|
|
61
|
-
/** The stretch being played that the person can skip (or mute), with its button's words; null when none is offered. */
|
|
62
|
-
offer: {
|
|
63
|
-
label: string;
|
|
64
|
-
run: () => void;
|
|
65
|
-
} | null;
|
|
66
|
-
/** What was just done, with the way back; gone after a few seconds. */
|
|
67
|
-
notice: {
|
|
68
|
-
text: string;
|
|
69
|
-
undoLabel: string;
|
|
70
|
-
undo: () => void;
|
|
71
|
-
} | null;
|
|
72
|
-
};
|
|
73
|
-
/** Draws the spans' ranges and acts on them as playback reaches them. See the file comment for the rules. */
|
|
74
|
-
export declare function useMediaSpans({ spans, kinds, words, onSpan, time, playing, duration, limit, seek, volume, setVolume }: Options): MediaSpansState;
|
|
75
|
-
/** A short notice drawn over a picture (or under an audio player) with one way back: "Skipped intro, Undo", "Picked up at 2:05, Start over". The player's own notices use it, so an overlay of an app's own matches them without copying classes. */
|
|
76
|
-
export declare function PlayerNotice({ children, action, onAction }: {
|
|
77
|
-
children: React.ReactNode;
|
|
78
|
-
action: string;
|
|
79
|
-
onAction: () => void;
|
|
80
|
-
}): React.JSX.Element;
|
|
81
|
-
/** What `SpanActions` can also show in its notice place: a notice that is not about a span (the player's "Picked up at 2:05, Start over"). A span's own notice wins while it shows. */
|
|
82
|
-
export type SpanActionsNotice = {
|
|
83
|
-
text: string;
|
|
84
|
-
actionLabel: string;
|
|
85
|
-
run: () => void;
|
|
86
|
-
};
|
|
87
|
-
/** The Skip button and the "Skipped intro, Undo" notice, for the player to draw over a picture or under the bar. The notice's live region is always present, so a screen reader hears what is put in it. */
|
|
88
|
-
export declare function SpanActions({ state, other, className }: {
|
|
89
|
-
state: MediaSpansState;
|
|
90
|
-
other?: SpanActionsNotice | null;
|
|
91
|
-
className?: string;
|
|
92
|
-
}): React.JSX.Element;
|
|
93
|
-
export {};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { SpanTone } from './line-chart';
|
|
2
|
-
import { Shortcut } from './hotkeys';
|
|
3
|
-
import { CursorMapping } from './cursor';
|
|
4
|
-
import { MediaMark } from './media-skip';
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
export type Precision = "seconds" | "ms" | "frames";
|
|
7
|
-
type TimeProps = {
|
|
8
|
-
precision?: Precision;
|
|
9
|
-
fps?: number;
|
|
10
|
-
};
|
|
11
|
-
/** The current and total time, in `tabular-nums`, as `<time>` elements. */
|
|
12
|
-
export declare function TimeReadout({ time, duration, precision, fps, className }: {
|
|
13
|
-
time: number;
|
|
14
|
-
duration: number | null;
|
|
15
|
-
} & TimeProps & {
|
|
16
|
-
className?: string;
|
|
17
|
-
}): React.JSX.Element;
|
|
18
|
-
/** A stretch of the bar, drawn as a range: an intro, a recap, an advert break. */
|
|
19
|
-
export type SeekBarSpan = {
|
|
20
|
-
/** Seconds. */
|
|
21
|
-
start: number;
|
|
22
|
-
end: number;
|
|
23
|
-
/** Its name for a screen reader and the tooltip: "Intro". The bar adds its times: "Intro, 0:00 to 0:12". */
|
|
24
|
-
label: string;
|
|
25
|
-
/** Default "info". */
|
|
26
|
-
tone?: SpanTone;
|
|
27
|
-
/** What kind of stretch it is ("sponsor"). Drawn as `data-kind` on the range, so an app can colour kinds from its own theme (`[data-kind="sponsor"]`). */
|
|
28
|
-
kind?: string;
|
|
29
|
-
/** A colour of the app's theme, named by its custom property (`"--seg-sponsor"`), for a kind whose colour the app's people know, instead of one of the five tones. Only a name starting with `--` is used; the library never picks a colour. */
|
|
30
|
-
colour?: string;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* The marked stretches as a thin strip, for under a picture played with the browser's own controls, whose seek bar cannot draw them
|
|
34
|
-
* (strata-react issue #270): the same ranges, names and colours as `SeekBar spans`, not a control. Draws nothing until `duration` is known.
|
|
35
|
-
*/
|
|
36
|
-
export declare function SpanStrip({ spans, duration, label, precision, fps, className }: {
|
|
37
|
-
spans: readonly SeekBarSpan[];
|
|
38
|
-
duration: number | null;
|
|
39
|
-
label?: string;
|
|
40
|
-
className?: string;
|
|
41
|
-
} & TimeProps): React.JSX.Element | null;
|
|
42
|
-
export type SeekBarProps = TimeProps & {
|
|
43
|
-
time: number;
|
|
44
|
-
/** Seconds; null, NaN or 0 while it is not known (a stream before its metadata): the bar is drawn disabled, with no thumb. */
|
|
45
|
-
duration: number | null;
|
|
46
|
-
/** The viewer asked for this time (drag, click or key). */
|
|
47
|
-
onSeek: (time: number) => void;
|
|
48
|
-
/** Named points on the bar (chapters, scenes, markers), each with its name and time in a tooltip on hover. Pressing one seeks to it. A `kind: "scene"` mark is drawn shorter and fainter than a chapter, so the parts read inside the whole. */
|
|
49
|
-
marks?: readonly MediaMark[];
|
|
50
|
-
/** Stretches drawn along the bar as ranges (strata-react issue #207): each named for a screen reader and in a tooltip, in a status role's colour, and never thinner than a few pixels so a one-second span still shows. They only draw; `MediaPlayer`'s `spans` is what acts on them. */
|
|
51
|
-
spans?: readonly SeekBarSpan[];
|
|
52
|
-
/** What pressing a mark does. Default seeks to it; a screen that wants to land on it and pause (a moment to look at) passes its own. */
|
|
53
|
-
onMarkPress?: (mark: MediaMark) => void;
|
|
54
|
-
/** How far has loaded or been recorded, drawn behind the played part. */
|
|
55
|
-
buffered?: number;
|
|
56
|
-
/** Arrow key step in seconds. Default 5. */
|
|
57
|
-
step?: number;
|
|
58
|
-
/** Page Up and Page Down step in seconds. Default 30. */
|
|
59
|
-
bigStep?: number;
|
|
60
|
-
label?: string;
|
|
61
|
-
disabled?: boolean;
|
|
62
|
-
/** Join the nearest `CursorScope` (strata-react issue #184): a pointer over the bar puts its time in every member, another member's position shows as a faint tick, and the bar's own time is the scope's playback position (`playback: false` to leave that to the app). A mapping when the scope's unit is not seconds (a route's metres). */
|
|
63
|
-
cursor?: boolean | (CursorMapping & {
|
|
64
|
-
playback?: boolean;
|
|
65
|
-
});
|
|
66
|
-
className?: string;
|
|
67
|
-
};
|
|
68
|
-
/** A seek bar: dragged, clicked and moved by keys (arrows `step`, Page keys `bigStep`, Home and End), with its time as the accessible value. */
|
|
69
|
-
export declare function SeekBar({ time, duration: known, onSeek, marks, spans, onMarkPress, buffered, step, bigStep, label, precision, fps, disabled: off, cursor: cursorProp, className }: SeekBarProps): React.JSX.Element;
|
|
70
|
-
export type TransportProps = {
|
|
71
|
-
playing: boolean;
|
|
72
|
-
onPlayPause: () => void;
|
|
73
|
-
onStop?: () => void;
|
|
74
|
-
onToStart?: () => void;
|
|
75
|
-
onToEnd?: () => void;
|
|
76
|
-
onStepBack?: () => void;
|
|
77
|
-
onStepForward?: () => void;
|
|
78
|
-
/** What a step is called in the buttons' names: "frame" (default) or "second". */
|
|
79
|
-
stepUnit?: string;
|
|
80
|
-
/** Anything else on the row: the time readout, a seek bar, volume. */
|
|
81
|
-
children?: React.ReactNode;
|
|
82
|
-
className?: string;
|
|
83
|
-
};
|
|
84
|
-
/** The transport buttons for a player the app owns. Every control is a named icon button; the play button's name is "Play" or "Pause" from `playing`. Only the buttons whose handler is passed are drawn. */
|
|
85
|
-
export declare function Transport({ playing, onPlayPause, onStop, onToStart, onToEnd, onStepBack, onStepForward, stepUnit, children, className }: TransportProps): React.JSX.Element;
|
|
86
|
-
export type VolumeControlProps = {
|
|
87
|
-
/** 0 to 100. */
|
|
88
|
-
volume: number;
|
|
89
|
-
onVolumeChange: (volume: number) => void;
|
|
90
|
-
/** Allow over 100 (a boost), up to this. Default 100. */
|
|
91
|
-
max?: number;
|
|
92
|
-
disabled?: boolean;
|
|
93
|
-
className?: string;
|
|
94
|
-
};
|
|
95
|
-
/** A mute button and a volume slider with its value in percent. Muting sets the volume to 0 and remembers the level; unmuting puts it back. Moving the slider from 0 unmutes. */
|
|
96
|
-
export declare function VolumeControl({ volume, onVolumeChange, max, disabled, className }: VolumeControlProps): React.JSX.Element;
|
|
97
|
-
/** A choice of playback speed ("0.5×", "1×", "1.5×"), named "Playback speed": React Aria's Select. */
|
|
98
|
-
export declare function RateChoice({ rate, onRateChange, rates, className }: {
|
|
99
|
-
rate: number;
|
|
100
|
-
onRateChange: (rate: number) => void;
|
|
101
|
-
rates?: readonly number[];
|
|
102
|
-
className?: string;
|
|
103
|
-
}): React.JSX.Element;
|
|
104
|
-
/**
|
|
105
|
-
* The shortcuts a player takes, as one list for `useHotkeys` and `KeysLegend`: Space and K play
|
|
106
|
-
* or pause, J and L go back or forward `jump` seconds, the arrows by `frame` seconds, Home and End
|
|
107
|
-
* to the ends, M mutes. Pass the player's actions; the labels are the legend's words. `stageKeys` is for a transport beside a stage that uses the arrows (see `TimelinePlayer`).
|
|
108
|
-
*/
|
|
109
|
-
export declare function transportShortcuts({ toggle, seek, time, duration, frame, jump, toggleMute, stageKeys }: {
|
|
110
|
-
toggle: () => void;
|
|
111
|
-
seek: (time: number) => void;
|
|
112
|
-
time: number;
|
|
113
|
-
duration: number;
|
|
114
|
-
frame?: number;
|
|
115
|
-
jump?: number;
|
|
116
|
-
toggleMute?: () => void;
|
|
117
|
-
stageKeys?: boolean;
|
|
118
|
-
}): Shortcut[];
|
|
119
|
-
/** A frame that fits content of an aspect ratio into the pane, letterboxed on the sunken surface role (light and dark both), with room for the app's overlays. */
|
|
120
|
-
export declare function MediaStage({ aspect, children, label, className }: {
|
|
121
|
-
aspect: number | `${number}/${number}`;
|
|
122
|
-
children: React.ReactNode;
|
|
123
|
-
label: string;
|
|
124
|
-
className?: string;
|
|
125
|
-
}): React.JSX.Element;
|
|
126
|
-
/** Guides over a stage: action-safe and title-safe frames (90% and 80%), a centre cross and a rule-of-thirds grid. Drawn as two strokes (light over dark) so they read on any picture. */
|
|
127
|
-
export declare function StageGuides({ safe, thirds, centre, className }: {
|
|
128
|
-
safe?: boolean;
|
|
129
|
-
thirds?: boolean;
|
|
130
|
-
centre?: boolean;
|
|
131
|
-
className?: string;
|
|
132
|
-
}): React.JSX.Element;
|
|
133
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** A level on a `Meter` at which the reading changes state, with the word for that state. */
|
|
3
|
-
export type MeterThreshold = {
|
|
4
|
-
/** A share of `max`, from 0 to 1: 0.8 is 80%. */
|
|
5
|
-
at: number;
|
|
6
|
-
tone: "warning" | "danger";
|
|
7
|
-
/** What the state is called, in the product's words: "Filling up", "Nearly full". */
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
export type MeterProps = {
|
|
11
|
-
/** What is measured, such as "Disk /". The meter's accessible name. */
|
|
12
|
-
label: string;
|
|
13
|
-
value: number;
|
|
14
|
-
/** The full scale, in the same units as `value`. Defaults to 1, so a share can be passed as is. */
|
|
15
|
-
max?: number;
|
|
16
|
-
/** The reading in words, shown beside the bar and used as `aria-valuetext`. Defaults to "72% used". */
|
|
17
|
-
valueText?: string;
|
|
18
|
-
/** A second line of fact, such as "36 of 50 GB". */
|
|
19
|
-
detail?: React.ReactNode;
|
|
20
|
-
thresholds?: MeterThreshold[];
|
|
21
|
-
/** "lower" when an emptier reading is the worse one (a battery, credit left). */
|
|
22
|
-
worseWhen?: "higher" | "lower";
|
|
23
|
-
/** Keeps the label as the accessible name only, for a meter in a table row that names it. */
|
|
24
|
-
hideLabel?: boolean;
|
|
25
|
-
/** CSS colour for the fill below every threshold. Defaults to the first chart token. */
|
|
26
|
-
colour?: string;
|
|
27
|
-
className?: string;
|
|
28
|
-
};
|
|
29
|
-
/** The threshold a share has crossed, if any: the most severe one reached in the worse direction. */
|
|
30
|
-
export declare function crossedThreshold(share: number, thresholds?: readonly MeterThreshold[], worseWhen?: "higher" | "lower"): MeterThreshold | undefined;
|
|
31
|
-
/** How full one thing is: a labelled `meter` with its reading in words, threshold notches, and a status word once a threshold is crossed. */
|
|
32
|
-
export declare function Meter({ label, value, max, valueText, detail, thresholds, worseWhen, hideLabel, colour, className, }: MeterProps): React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Headline figures as one description list split by hairlines. Holds `Metric`s. */
|
|
3
|
-
export declare function MetricStrip({ label, children, className }: {
|
|
4
|
-
label: string;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
}): React.JSX.Element;
|
|
8
|
-
export type MetricProps = {
|
|
9
|
-
label: string;
|
|
10
|
-
/** Already formatted. Ink colour, 28px, tabular figures: never the brand colour, never 48px. */
|
|
11
|
-
value: string;
|
|
12
|
-
unit?: string;
|
|
13
|
-
/** One sentence: the change in words with its window, or what the figure means right now. */
|
|
14
|
-
note?: React.ReactNode;
|
|
15
|
-
};
|
|
16
|
-
/** One figure: label over value, an optional muted unit and a note that states any change in words with its window. */
|
|
17
|
-
export declare function Metric({ label, value, unit, note }: MetricProps): React.JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Outbox } from '../query/outbox';
|
|
2
|
-
/** Props for `OutboxStatus`. */
|
|
3
|
-
export type OutboxStatusProps = {
|
|
4
|
-
outbox: Outbox;
|
|
5
|
-
/** What a write is, singular, for `format.count`: "answer" gives "3 answers kept on this device". */
|
|
6
|
-
noun: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
};
|
|
9
|
-
/** Says how many writes wait on this device and why, with Send now, and lists any the server refused; renders nothing while all is sent. */
|
|
10
|
-
export declare function OutboxStatus({ outbox, noun, className }: OutboxStatusProps): import('react').JSX.Element | null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** The top of an Operate screen: a noun title, its scope, the main action, and the finding (the one fact in today's data that most needs attention). */
|
|
3
|
-
export declare function PageHeader({ title, scope, actions, finding, as: Heading, }: {
|
|
4
|
-
title: string;
|
|
5
|
-
/** The title's element: h1 on a screen, h2 where the header is shown inside another page. */
|
|
6
|
-
as?: "h1" | "h2";
|
|
7
|
-
/** What the screen covers: a date, a range, a filter. */
|
|
8
|
-
scope?: React.ReactNode;
|
|
9
|
-
actions?: React.ReactNode;
|
|
10
|
-
finding?: {
|
|
11
|
-
text: React.ReactNode;
|
|
12
|
-
action?: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
}): React.JSX.Element;
|