strata-react 1.3.24 → 1.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/UPGRADING.md +7 -0
- package/dist/{api-types/cli.d.ts → api-types-cli.d.ts} +1 -0
- package/dist/api-types-cli.js +4 -3
- package/dist/api-types-cli.js.map +1 -1
- package/dist/{api-types/generate.d.ts → api-types.d.ts} +3 -3
- package/dist/api-types.js +3 -1
- package/dist/{button-KGJI6jQr.js → button-CYXjU-fs.js} +8 -5
- package/dist/button-CYXjU-fs.js.map +1 -0
- package/dist/{cursor-DDGBPiTJ.js → cursor-Cwyvgwsw.js} +9 -7
- package/dist/cursor-Cwyvgwsw.js.map +1 -0
- package/dist/{errors-BUvY1Z4d.js → errors-CmuwcWlb.js} +6 -6
- package/dist/{errors-BUvY1Z4d.js.map → errors-CmuwcWlb.js.map} +1 -1
- package/dist/{field-BjeE_FeB.js → field-DBCsFIng.js} +27 -23
- package/dist/field-DBCsFIng.js.map +1 -0
- package/dist/follow-CXQsL86O.js +16 -0
- package/dist/follow-CXQsL86O.js.map +1 -0
- package/dist/{generate-CjTHKJ39.js → generate-BkWhh4k4.js} +8 -6
- package/dist/generate-BkWhh4k4.js.map +1 -0
- package/dist/{lib/geo.d.ts → geo-DfKa9JtK.d.ts} +35 -33
- package/dist/{hls/index.d.ts → hls.d.ts} +13 -12
- package/dist/hls.js +5 -4
- package/dist/hls.js.map +1 -1
- package/dist/index.d.ts +5300 -140
- package/dist/index.js +363 -224
- package/dist/index.js.map +1 -1
- package/dist/map.d.ts +184 -0
- package/dist/map.js +21 -17
- package/dist/map.js.map +1 -1
- package/dist/media-player-BETa3P7K.d.ts +758 -0
- package/dist/{microphone-Bo3WaXgD.js → microphone-76skMt6i.js} +41 -30
- package/dist/microphone-76skMt6i.js.map +1 -0
- package/dist/microphone-DDOnQHxf.d.ts +237 -0
- package/dist/{migrate/cli.d.ts → migrate-cli.d.ts} +1 -0
- package/dist/migrate-cli.js +8 -6
- package/dist/migrate-cli.js.map +1 -1
- package/dist/panorama.d.ts +102 -0
- package/dist/panorama.js +54 -109
- package/dist/panorama.js.map +1 -1
- package/dist/{run-BT2WKzMz.js → run-D_Ic1jE7.js} +23 -16
- package/dist/run-D_Ic1jE7.js.map +1 -0
- package/dist/scene.d.ts +147 -0
- package/dist/scene.js +74 -77
- package/dist/scene.js.map +1 -1
- package/dist/testing.d.ts +468 -0
- package/dist/testing.js +11 -3
- package/dist/testing.js.map +1 -1
- package/dist/{theme-CxYZkUNk.js → theme-1oOSMj_D.js} +19 -17
- package/dist/theme-1oOSMj_D.js.map +1 -0
- package/dist/{tooltip-DhqrDtyu.js → tooltip-BosfsWYh.js} +9 -6
- package/dist/tooltip-BosfsWYh.js.map +1 -0
- package/dist/types-B3TsF0Ey.d.ts +241 -0
- package/dist/{value-controls-Dm_EYfZW.js → value-controls-5u7sD_wG.js} +22 -17
- package/dist/value-controls-5u7sD_wG.js.map +1 -0
- package/dist/viewer-input-3Qa-o35k.js +108 -0
- package/dist/viewer-input-3Qa-o35k.js.map +1 -0
- package/dist/{visual/cli.d.ts → visual-cli.d.ts} +2 -1
- package/dist/visual-cli.js +5 -4
- package/dist/visual-cli.js.map +1 -1
- package/dist/visual.d.ts +105 -0
- package/dist/visual.js +4 -3
- package/dist/visual.js.map +1 -1
- package/package.json +24 -19
- package/dist/api-types/index.d.ts +0 -1
- package/dist/button-KGJI6jQr.js.map +0 -1
- package/dist/components/active-list.d.ts +0 -46
- package/dist/components/alert.d.ts +0 -17
- package/dist/components/app-shell.d.ts +0 -32
- package/dist/components/async-button.d.ts +0 -48
- package/dist/components/auto-recorder.d.ts +0 -67
- package/dist/components/book-viewer.d.ts +0 -50
- package/dist/components/box-overlay.d.ts +0 -44
- package/dist/components/boxed-picture.d.ts +0 -34
- package/dist/components/button.d.ts +0 -45
- package/dist/components/byte-view.d.ts +0 -32
- package/dist/components/checkbox.d.ts +0 -39
- package/dist/components/choice-grid.d.ts +0 -42
- package/dist/components/commands.d.ts +0 -104
- package/dist/components/compare-audio.d.ts +0 -30
- package/dist/components/compare-grid.d.ts +0 -24
- package/dist/components/compare-parts.d.ts +0 -90
- package/dist/components/compare-regions.d.ts +0 -37
- package/dist/components/compare-text.d.ts +0 -32
- package/dist/components/compare-video-grid.d.ts +0 -52
- package/dist/components/compare-video.d.ts +0 -61
- package/dist/components/compare.d.ts +0 -90
- package/dist/components/composition.d.ts +0 -44
- package/dist/components/console.d.ts +0 -34
- package/dist/components/conversation.d.ts +0 -83
- package/dist/components/cursor.d.ts +0 -44
- package/dist/components/data-table.d.ts +0 -89
- package/dist/components/data-view.d.ts +0 -66
- package/dist/components/density.d.ts +0 -16
- package/dist/components/dialog.d.ts +0 -45
- package/dist/components/difference.d.ts +0 -19
- package/dist/components/disclosure.d.ts +0 -49
- package/dist/components/done.d.ts +0 -14
- package/dist/components/drag-source.d.ts +0 -29
- package/dist/components/field.d.ts +0 -79
- package/dist/components/file-intake.d.ts +0 -60
- package/dist/components/film-strip.d.ts +0 -35
- package/dist/components/folder-picker.d.ts +0 -59
- package/dist/components/fullscreen-frame.d.ts +0 -18
- package/dist/components/history.d.ts +0 -61
- package/dist/components/hotkeys.d.ts +0 -44
- package/dist/components/infinite-list.d.ts +0 -77
- package/dist/components/inspector.d.ts +0 -66
- package/dist/components/job-action.d.ts +0 -30
- package/dist/components/job-status.d.ts +0 -55
- package/dist/components/jobs-table.d.ts +0 -35
- package/dist/components/key-glyphs.d.ts +0 -5
- package/dist/components/key-owner.d.ts +0 -11
- package/dist/components/lightbox.d.ts +0 -61
- package/dist/components/line-chart.d.ts +0 -169
- package/dist/components/link-card.d.ts +0 -32
- package/dist/components/link.d.ts +0 -54
- package/dist/components/markable-text.d.ts +0 -60
- package/dist/components/media-contents.d.ts +0 -28
- package/dist/components/media-group.d.ts +0 -32
- package/dist/components/media-player.d.ts +0 -251
- package/dist/components/media-progress.d.ts +0 -17
- package/dist/components/media-skip.d.ts +0 -31
- package/dist/components/media-spans.d.ts +0 -93
- package/dist/components/media.d.ts +0 -133
- package/dist/components/meter.d.ts +0 -32
- package/dist/components/metric.d.ts +0 -17
- package/dist/components/outbox-status.d.ts +0 -10
- package/dist/components/page-header.d.ts +0 -14
- package/dist/components/pair-vote.d.ts +0 -70
- package/dist/components/pause-button.d.ts +0 -7
- package/dist/components/pixel-image.d.ts +0 -29
- package/dist/components/place-board.d.ts +0 -39
- package/dist/components/player-warning.d.ts +0 -24
- package/dist/components/popover.d.ts +0 -20
- package/dist/components/recorder.d.ts +0 -73
- package/dist/components/region-editor.d.ts +0 -67
- package/dist/components/save.d.ts +0 -46
- package/dist/components/say-again.d.ts +0 -13
- package/dist/components/schedule-table.d.ts +0 -24
- package/dist/components/secret-field.d.ts +0 -34
- package/dist/components/selectable-grid.d.ts +0 -57
- package/dist/components/selection.d.ts +0 -104
- package/dist/components/sequence-timeline.d.ts +0 -50
- package/dist/components/shortcut-editor.d.ts +0 -44
- package/dist/components/sortable-list.d.ts +0 -39
- package/dist/components/status.d.ts +0 -9
- package/dist/components/switch.d.ts +0 -15
- package/dist/components/system-panel.d.ts +0 -58
- package/dist/components/tabs.d.ts +0 -16
- package/dist/components/theme.d.ts +0 -106
- package/dist/components/thumbnail.d.ts +0 -50
- package/dist/components/tile-grid.d.ts +0 -67
- package/dist/components/timeline-player.d.ts +0 -18
- package/dist/components/timeline.d.ts +0 -115
- package/dist/components/toast.d.ts +0 -36
- package/dist/components/toggle.d.ts +0 -51
- package/dist/components/toolbar.d.ts +0 -15
- package/dist/components/tooltip.d.ts +0 -19
- package/dist/components/transcript-view.d.ts +0 -63
- package/dist/components/tree.d.ts +0 -74
- package/dist/components/undo.d.ts +0 -63
- package/dist/components/use-timeline.d.ts +0 -44
- package/dist/components/value-controls.d.ts +0 -91
- package/dist/components/video-clock.d.ts +0 -68
- package/dist/components/view-options.d.ts +0 -105
- package/dist/components/viewport.d.ts +0 -85
- package/dist/components/virtual-list.d.ts +0 -19
- package/dist/components/waveform.d.ts +0 -71
- package/dist/components/workflow-steps.d.ts +0 -71
- package/dist/components/workspace.d.ts +0 -83
- package/dist/cursor-DDGBPiTJ.js.map +0 -1
- package/dist/field-BjeE_FeB.js.map +0 -1
- package/dist/generate-CjTHKJ39.js.map +0 -1
- package/dist/lib/base.d.ts +0 -10
- package/dist/lib/book.d.ts +0 -25
- package/dist/lib/boxes.d.ts +0 -55
- package/dist/lib/breakpoint.d.ts +0 -4
- package/dist/lib/choice.d.ts +0 -29
- package/dist/lib/chords.d.ts +0 -20
- package/dist/lib/client-work.d.ts +0 -24
- package/dist/lib/control.d.ts +0 -4
- package/dist/lib/dev.d.ts +0 -2
- package/dist/lib/errors.d.ts +0 -43
- package/dist/lib/file-intake.d.ts +0 -60
- package/dist/lib/format.d.ts +0 -243
- package/dist/lib/grouped-grid-layout.d.ts +0 -44
- package/dist/lib/icon.d.ts +0 -6
- package/dist/lib/image-diff.d.ts +0 -30
- package/dist/lib/in-view.d.ts +0 -21
- package/dist/lib/loudness.d.ts +0 -18
- package/dist/lib/marks.d.ts +0 -6
- package/dist/lib/microphone.d.ts +0 -24
- package/dist/lib/number-input.d.ts +0 -4
- package/dist/lib/object-url.d.ts +0 -2
- package/dist/lib/overlay.d.ts +0 -1
- package/dist/lib/recording.d.ts +0 -16
- package/dist/lib/region.d.ts +0 -64
- package/dist/lib/rich-text.d.ts +0 -44
- package/dist/lib/search-param.d.ts +0 -16
- package/dist/lib/segmenter.d.ts +0 -40
- package/dist/lib/sequence.d.ts +0 -34
- package/dist/lib/speech.d.ts +0 -53
- package/dist/lib/text-diff.d.ts +0 -16
- package/dist/lib/timeline.d.ts +0 -14
- package/dist/lib/transcript.d.ts +0 -53
- package/dist/lib/utils.d.ts +0 -4
- package/dist/lib/viewport.d.ts +0 -55
- package/dist/lib/waveform.d.ts +0 -46
- package/dist/map/fan.d.ts +0 -15
- package/dist/map/index.d.ts +0 -3
- package/dist/map/map-styles.d.ts +0 -2
- package/dist/map/markers.d.ts +0 -60
- package/dist/map/route-map.d.ts +0 -146
- package/dist/microphone-Bo3WaXgD.js.map +0 -1
- package/dist/migrate/stock-classes.d.ts +0 -11
- package/dist/panorama/gl.d.ts +0 -16
- package/dist/panorama/index.d.ts +0 -2
- package/dist/panorama/panorama-viewer.d.ts +0 -56
- package/dist/panorama/projection.d.ts +0 -45
- package/dist/query/api.d.ts +0 -23
- package/dist/query/clips.d.ts +0 -48
- package/dist/query/index.d.ts +0 -55
- package/dist/query/infinite.d.ts +0 -60
- package/dist/query/job.d.ts +0 -26
- package/dist/query/outbox.d.ts +0 -85
- package/dist/query/poll.d.ts +0 -24
- package/dist/query/reserve.d.ts +0 -33
- package/dist/query/typed-api.d.ts +0 -84
- package/dist/query/workflow.d.ts +0 -17
- package/dist/run-BT2WKzMz.js.map +0 -1
- package/dist/scene/camera.d.ts +0 -74
- package/dist/scene/index.d.ts +0 -2
- package/dist/scene/scene-viewport.d.ts +0 -48
- package/dist/testing/buttons.d.ts +0 -7
- package/dist/testing/index.d.ts +0 -161
- package/dist/testing/intersection-observer.d.ts +0 -34
- package/dist/testing/layout.d.ts +0 -13
- package/dist/testing/microphone.d.ts +0 -35
- package/dist/testing/setup.d.ts +0 -14
- package/dist/testing/speech.d.ts +0 -38
- package/dist/testing/storage.d.ts +0 -7
- package/dist/theme-CxYZkUNk.js.map +0 -1
- package/dist/tooltip-DhqrDtyu.js.map +0 -1
- package/dist/value-controls-Dm_EYfZW.js.map +0 -1
- package/dist/visual/capture.d.ts +0 -37
- package/dist/visual/compare.d.ts +0 -46
- package/dist/visual/drop.d.ts +0 -19
- package/dist/visual/fonts.d.ts +0 -18
- package/dist/visual/index.d.ts +0 -19
- package/dist/visual/run.d.ts +0 -22
- package/dist/visual/serve.d.ts +0 -13
- package/dist/visual/targets.d.ts +0 -17
- package/dist/visual/types.d.ts +0 -188
package/dist/lib/choice.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** What a chosen key brings with it: keys, or nothing. */
|
|
2
|
-
export type Implies = (key: string) => Iterable<string> | null | undefined;
|
|
3
|
-
/** The derived sets for one explicit choice. */
|
|
4
|
-
export type Resolved = {
|
|
5
|
-
/** Explicit and implied keys. */
|
|
6
|
-
all: Set<string>;
|
|
7
|
-
/** Keys some chosen key implies: cannot be cleared on their own. */
|
|
8
|
-
locked: Set<string>;
|
|
9
|
-
/** Implied keys that were not chosen themselves. */
|
|
10
|
-
dependents: Set<string>;
|
|
11
|
-
/** For each locked key, the chosen keys that bring it (directly or through others). */
|
|
12
|
-
because: Map<string, string[]>;
|
|
13
|
-
};
|
|
14
|
-
export declare function resolve(explicit: ReadonlySet<string>, implies?: Implies): Resolved;
|
|
15
|
-
/** What a change did, for the sentence that announces it. */
|
|
16
|
-
export type ChoiceChange = {
|
|
17
|
-
explicit: Set<string>;
|
|
18
|
-
added: number;
|
|
19
|
-
dropped: number;
|
|
20
|
-
refused: number;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Apply a surface's request for the set it wants shown chosen (`next`, what a tree or table gives
|
|
24
|
-
* back) to the explicit choice. A dependent (implied, not chosen) in `next` is not made explicit
|
|
25
|
-
* (it is already in), and one missing from `next` is put back, not cleared.
|
|
26
|
-
*/
|
|
27
|
-
export declare function applyChange(explicit: ReadonlySet<string>, next: ReadonlySet<string>, implies?: Implies): ChoiceChange;
|
|
28
|
-
/** The sentence a screen reader hears for a change, or "" when nothing worth saying happened. */
|
|
29
|
-
export declare function noteFor({ added, dropped, refused }: Pick<ChoiceChange, "added" | "dropped" | "refused">): string;
|
package/dist/lib/chords.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/** `"mac"` or `"other"`: which modifier glyphs to draw and what `Mod` means. */
|
|
2
|
-
export type Platform = "mac" | "other";
|
|
3
|
-
/** The platform this page runs on, read from the browser (`mac` for macOS and iOS). Server and test default: `other`. */
|
|
4
|
-
export declare function detectPlatform(): Platform;
|
|
5
|
-
type Parsed = {
|
|
6
|
-
ctrl: boolean;
|
|
7
|
-
meta: boolean;
|
|
8
|
-
alt: boolean;
|
|
9
|
-
shift: boolean;
|
|
10
|
-
key: string;
|
|
11
|
-
};
|
|
12
|
-
/** Splits "Mod+Shift+Z" into modifiers and key for a platform. A bare "+" key is written "Mod++". */
|
|
13
|
-
export declare function parseChord(chord: string, platform?: Platform): Parsed;
|
|
14
|
-
/** Whether a key event is this chord. Exact on Ctrl, Meta and Alt; Shift is exact for letters and named keys. */
|
|
15
|
-
export declare function matchesChord(e: Pick<KeyboardEvent, "key" | "code" | "ctrlKey" | "metaKey" | "altKey" | "shiftKey">, chord: string, platform?: Platform): boolean;
|
|
16
|
-
/** A chord as a person reads it on this platform: "⌘⇧Z" on macOS, "Ctrl+Shift+Z" elsewhere. */
|
|
17
|
-
export declare function formatChord(chord: string, platform?: Platform): string;
|
|
18
|
-
/** Whether the browser uses this chord for itself, so a command may take it only with `claim`. */
|
|
19
|
-
export declare function isReservedChord(chord: string, platform?: Platform): boolean;
|
|
20
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** What the work is given: a signal that aborts on cancel, and a way to report progress. */
|
|
2
|
-
export type WorkContext = {
|
|
3
|
-
signal: AbortSignal;
|
|
4
|
-
/** Report items done, and the total when it is known. */
|
|
5
|
-
progress: (current: number, total?: number) => void;
|
|
6
|
-
};
|
|
7
|
-
/** Where client work is. */
|
|
8
|
-
export type WorkPhase = "idle" | "running" | "finished" | "failed" | "cancelled";
|
|
9
|
-
/** The state `useClientWork` returns. */
|
|
10
|
-
export type ClientWork<T> = {
|
|
11
|
-
phase: WorkPhase;
|
|
12
|
-
current?: number;
|
|
13
|
-
total?: number;
|
|
14
|
-
result?: T;
|
|
15
|
-
error?: unknown;
|
|
16
|
-
/** Runs the work. Ignored while it is already running. */
|
|
17
|
-
start: () => Promise<void>;
|
|
18
|
-
/** Aborts the work's signal; the phase becomes `cancelled`. */
|
|
19
|
-
cancel: () => void;
|
|
20
|
-
/** Back to `idle`, forgetting the result. */
|
|
21
|
-
dismiss: () => void;
|
|
22
|
-
};
|
|
23
|
-
/** Runs browser-side work with progress, cancel and a clear end state, ready for `JobStatus`. */
|
|
24
|
-
export declare function useClientWork<T>(run: (ctx: WorkContext) => Promise<T>): ClientWork<T>;
|
package/dist/lib/control.d.ts
DELETED
package/dist/lib/dev.d.ts
DELETED
package/dist/lib/errors.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** What `readErrorBody` finds in an error response: the server's sentence, and messages per field. */
|
|
2
|
-
export type ErrorBody = {
|
|
3
|
-
/** Why the server refused, in its own words. */
|
|
4
|
-
reason?: string;
|
|
5
|
-
/** Messages for individual fields, keyed by field name (`"name"`, `"address.city"`). */
|
|
6
|
-
fields?: Record<string, string>;
|
|
7
|
-
/** The structured part of the body (`ErrorBody.payload` of the shared contract): what the app can act on, such as what is already running on a 409. Typed by the caller with `errorPayload`. */
|
|
8
|
-
payload?: unknown;
|
|
9
|
-
};
|
|
10
|
-
/** Thrown by `fetchJson` on a non-2xx response; carries the status, the response body and the server's reason for `describeHttpError` and `describeActionError`. */
|
|
11
|
-
export declare class HttpError extends Error {
|
|
12
|
-
readonly status: number;
|
|
13
|
-
readonly statusText: string;
|
|
14
|
-
readonly url: string;
|
|
15
|
-
/** The response body: parsed JSON when it was JSON, else its text; undefined when empty. */
|
|
16
|
-
readonly body?: unknown | undefined;
|
|
17
|
-
/** The server's sentence for why it refused, from the body (`detail`, `message`, `error`), if it gave one. */
|
|
18
|
-
readonly reason?: string;
|
|
19
|
-
/** Messages for individual fields from the body (FastAPI's 422 `detail: [{loc, msg}]`), keyed by field name. Empty when there are none. */
|
|
20
|
-
readonly fieldErrors: Readonly<Record<string, string>>;
|
|
21
|
-
/** The body's `payload`, when it has one (`{ detail, payload }`): data for the app, not words for the person. Read it typed with `errorPayload`. */
|
|
22
|
-
readonly payload?: unknown;
|
|
23
|
-
constructor(status: number, statusText: string, url: string,
|
|
24
|
-
/** The response body: parsed JSON when it was JSON, else its text; undefined when empty. */
|
|
25
|
-
body?: unknown | undefined, found?: ErrorBody);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The default reading of an error body, for the shapes most JSON APIs use: `{ detail: "…" }`
|
|
29
|
-
* (FastAPI), `{ message: "…" }`, `{ error: "…" }` or `{ error: { message: "…" } }` for the reason,
|
|
30
|
-
* and FastAPI's validation list `{ detail: [{ loc, msg }] }` for per-field messages. A short
|
|
31
|
-
* plain-text body (not HTML) is taken as the reason too. Pass your own to `fetchJson` for other APIs.
|
|
32
|
-
*/
|
|
33
|
-
export declare function readErrorBody(body: unknown): ErrorBody;
|
|
34
|
-
/** Writes an error for a person: what happened, in a sentence. A product passes its own words. */
|
|
35
|
-
export type DescribeError = (error: unknown) => string;
|
|
36
|
-
/** The default `DescribeError` for loads: the HTTP status in a sentence (with the server's reason for a 4xx), else the error's message, else a plain fallback. */
|
|
37
|
-
export declare const describeHttpError: DescribeError;
|
|
38
|
-
/** The default for `useAsyncAction`: the HTTP status in a sentence (with the server's reason for a 4xx), else the thrown Error's message, else undefined (the retry label alone). */
|
|
39
|
-
export declare const describeActionError: (error: unknown) => string | undefined;
|
|
40
|
-
/** Messages for individual fields carried by what was thrown: an `HttpError`'s `fieldErrors`, else none. */
|
|
41
|
-
export declare function fieldErrorsOf(error: unknown): Readonly<Record<string, string>>;
|
|
42
|
-
/** The payload of an error from the server as the type the app expects (`errorPayload<{ running: string }>(error)`), or `undefined` when it is not an `HttpError` or carries none. The type is the caller's claim: check it against the API's schema. */
|
|
43
|
-
export declare function errorPayload<T>(error: unknown): T | undefined;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export type FileOutcome = {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
size: number;
|
|
5
|
-
status: "processing";
|
|
6
|
-
} | {
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
size: number;
|
|
10
|
-
status: "added";
|
|
11
|
-
} | {
|
|
12
|
-
id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
size: number;
|
|
15
|
-
status: "rejected";
|
|
16
|
-
reason: string;
|
|
17
|
-
} | {
|
|
18
|
-
id: string;
|
|
19
|
-
name: string;
|
|
20
|
-
size: number;
|
|
21
|
-
status: "failed";
|
|
22
|
-
reason: string;
|
|
23
|
-
};
|
|
24
|
-
export type FileIntakeOptions = {
|
|
25
|
-
/** What is accepted, as the picker's `accept` list: extensions (`.gpx`), exact types (`audio/mpeg`) or families (`video/*`). */
|
|
26
|
-
accept: readonly string[];
|
|
27
|
-
/** The accepted kinds in words, used in the rejection reason and the drop hint: "a video, an audio file or a GPX track". */
|
|
28
|
-
acceptLabel: string;
|
|
29
|
-
/** More than one file at a time. Default true; with false, extra files in one drop are rejected by name. */
|
|
30
|
-
multiple?: boolean;
|
|
31
|
-
/** Largest size in bytes. Larger files are rejected with their size in the reason. */
|
|
32
|
-
maxBytes?: number;
|
|
33
|
-
/** Extra checks after the type check, for what a type cannot say. Return the reason in the product's words, or `null` to accept. */
|
|
34
|
-
check?: (file: File) => string | null | Promise<string | null>;
|
|
35
|
-
/** The app's own work on an accepted file. A throw marks it `failed` with the error's message and offers a retry. */
|
|
36
|
-
process?: (file: File, context: {
|
|
37
|
-
signal: AbortSignal;
|
|
38
|
-
}) => void | Promise<void>;
|
|
39
|
-
};
|
|
40
|
-
export type FileIntake = {
|
|
41
|
-
/** One outcome per file offered, in the order offered, newest batch last. */
|
|
42
|
-
outcomes: readonly FileOutcome[];
|
|
43
|
-
/** Offers files (from the picker or a drop). Rejections appear as outcomes at once; accepted files are processed. */
|
|
44
|
-
add: (files: Iterable<File> | ArrayLike<File>) => void;
|
|
45
|
-
/** Runs `process` again for a failed file. */
|
|
46
|
-
retry: (id: string) => void;
|
|
47
|
-
/** Removes an outcome (and aborts its processing if still running). */
|
|
48
|
-
dismiss: (id: string) => void;
|
|
49
|
-
/** Removes every finished outcome (added, rejected and failed), leaving those still processing. */
|
|
50
|
-
clear: () => void;
|
|
51
|
-
/** Files still being processed. */
|
|
52
|
-
pending: number;
|
|
53
|
-
};
|
|
54
|
-
/** Whether a file matches one entry of an `accept` list: extension, exact type or `family/*`, ignoring case. */
|
|
55
|
-
export declare function matchesAccept(file: {
|
|
56
|
-
name: string;
|
|
57
|
-
type: string;
|
|
58
|
-
}, accept: readonly string[]): boolean;
|
|
59
|
-
/** Per-file outcomes for files picked or dropped: type and size checks with a named reason, the app's own `process` per file, retry and dismiss. */
|
|
60
|
-
export declare function useFileIntake(options: FileIntakeOptions): FileIntake;
|
package/dist/lib/format.d.ts
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
export declare const NBSP = "\u00A0";
|
|
2
|
-
/** The placeholder printed for a value that is not known: an en dash. */
|
|
3
|
-
export declare const MISSING = "\u2013";
|
|
4
|
-
/** The decimal byte units `format.bytes` writes. */
|
|
5
|
-
export type ByteUnit = "B" | "kB" | "MB" | "GB" | "TB" | "PB";
|
|
6
|
-
/** The binary byte units `format.bytes` writes with `{ binary: true }`. */
|
|
7
|
-
export type BinaryByteUnit = "B" | "KiB" | "MiB" | "GiB" | "TiB" | "PiB";
|
|
8
|
-
/** What `format.bytes` and `format.byteUnit` take beyond the value: `{ binary: true }` for KiB, MiB, GiB (powers of 1024), or a unit to fix. A binary unit implies binary. */
|
|
9
|
-
export type BytesOptions = {
|
|
10
|
-
binary?: boolean;
|
|
11
|
-
unit?: ByteUnit | BinaryByteUnit;
|
|
12
|
-
};
|
|
13
|
-
/** An `Intl.NumberFormat` that can also be called directly: `f(n)` is `f.format(n)`. `null` or `undefined` prints the placeholder. */
|
|
14
|
-
export type NumberFormatter = ((value: number | bigint | Intl.StringNumericLiteral | null | undefined) => string) & {
|
|
15
|
-
format: (value: number | bigint | Intl.StringNumericLiteral | null | undefined) => string;
|
|
16
|
-
} & Pick<Intl.NumberFormat, "formatToParts" | "resolvedOptions">;
|
|
17
|
-
/** What a date formatter accepts: a Date, an ISO 8601 string, or epoch milliseconds. */
|
|
18
|
-
export type DateInput = Date | string | number;
|
|
19
|
-
/** An `Intl.DateTimeFormat` that can also be called directly, with a Date, an ISO string or epoch milliseconds. */
|
|
20
|
-
export type DateFormatter = ((value: DateInput | null | undefined) => string) & {
|
|
21
|
-
format: (value: DateInput | null | undefined) => string;
|
|
22
|
-
formatToParts: (value: DateInput) => Intl.DateTimeFormatPart[];
|
|
23
|
-
formatRange: (start: DateInput, end: DateInput) => string;
|
|
24
|
-
} & Pick<Intl.DateTimeFormat, "resolvedOptions">;
|
|
25
|
-
/** Options shared by every date formatter one `createFormat` call makes. */
|
|
26
|
-
export interface FormatOptions {
|
|
27
|
-
/** An IANA zone ("Europe/London", "UTC") to show times in. Left out, times are the viewer's own. */
|
|
28
|
-
timeZone?: string;
|
|
29
|
-
/** What a missing value (`null`, `undefined`) prints as. Default an en dash (`MISSING`). */
|
|
30
|
-
missing?: string;
|
|
31
|
-
}
|
|
32
|
-
/** Options for `format.count`. */
|
|
33
|
-
export interface CountOptions {
|
|
34
|
-
/** Write the figure compactly: "1.2k views". The noun still agrees with the exact count. */
|
|
35
|
-
compact?: boolean;
|
|
36
|
-
}
|
|
37
|
-
/** A Date from a Date, an ISO string or epoch milliseconds; throws a RangeError naming the input when it is not a date. */
|
|
38
|
-
export declare function toDate(value: DateInput): Date;
|
|
39
|
-
/** Intl formatters for one locale (and optionally one time zone): integers, decimals, percent, dates, times, units with a non-breaking space, byte sizes, and counted nouns. */
|
|
40
|
-
export declare function createFormat(locale: string, options?: FormatOptions): {
|
|
41
|
-
locale: string;
|
|
42
|
-
/** The zone times are shown in, or `undefined` for the viewer's own. */
|
|
43
|
-
timeZone: string | undefined;
|
|
44
|
-
/** Whole numbers with grouping: `format.integer(1222)` is "1,222". */
|
|
45
|
-
integer: NumberFormatter;
|
|
46
|
-
/** One decimal place at most: `format.decimal(3.14)` is "3.1". */
|
|
47
|
-
decimal: NumberFormatter;
|
|
48
|
-
/** A ratio as a whole percent: `format.percent(0.42)` is "42%". */
|
|
49
|
-
percent: NumberFormatter;
|
|
50
|
-
/**
|
|
51
|
-
* A part's share of a whole, as `percent` but never misleading at the ends: a part above 0 that
|
|
52
|
-
* rounds to 0 is "<1%", and one short of the whole that rounds to 100 is ">99%".
|
|
53
|
-
* `format.share(2.4 / 512)` is "<1%".
|
|
54
|
-
*/
|
|
55
|
-
share: (value: number | null | undefined) => string;
|
|
56
|
-
/** A figure in short form for counts that run to thousands: `format.compact(1234)` is "1.2k" in en-GB, "1.2K" in en-US. */
|
|
57
|
-
compact: NumberFormatter;
|
|
58
|
-
/**
|
|
59
|
-
* How long ago (or how far ahead) a time is, in the largest unit it reaches:
|
|
60
|
-
* "3 weeks ago", "yesterday", "in 2 hours", "now" under a minute. Pass `now` in tests.
|
|
61
|
-
*/
|
|
62
|
-
ago: (value: DateInput | null | undefined, now?: DateInput) => string;
|
|
63
|
-
/**
|
|
64
|
-
* A media running time from seconds, as a player shows it: "4:05", "1:02:09". Unknown
|
|
65
|
-
* (null, negative, not finite) prints the placeholder. Set it in `tabular-nums`.
|
|
66
|
-
*/
|
|
67
|
-
runningTime: (seconds: number | null | undefined) => string;
|
|
68
|
-
/**
|
|
69
|
-
* A position in media as an editor shows it, to a chosen precision: "4:05" (seconds), "4:05.250"
|
|
70
|
-
* (`"ms"`), or "0:04:05:07" (`"frames"` at `fps`, the last part the frame). Hours appear only
|
|
71
|
-
* from one hour, except in frames. Frames are always four parts, hours included, as SMPTE
|
|
72
|
-
* timecode is (non-drop frame, with colons): a three-part "1:05:00" reads as one hour five, so
|
|
73
|
-
* a frame count must never be three. Editors write the same four parts (strata-react issue
|
|
74
|
-
* #122). Floors, never rounds up, so a time never reads ahead of the picture. Unknown (null,
|
|
75
|
-
* negative, not finite) prints the placeholder. Set it in `tabular-nums`.
|
|
76
|
-
*/
|
|
77
|
-
timecode: (seconds: number | null | undefined, { precision, fps }?: {
|
|
78
|
-
precision?: "seconds" | "ms" | "frames";
|
|
79
|
-
fps?: number;
|
|
80
|
-
}) => string;
|
|
81
|
-
/** What a missing value prints as: an en dash unless `createFormat`'s `missing` says otherwise. */
|
|
82
|
-
missing: string;
|
|
83
|
-
/** A time of day: `format.clock(at)` is "06:05". */
|
|
84
|
-
clock: DateFormatter;
|
|
85
|
-
/** A day without its year, for this week's things: `format.day(at)` is "Sunday 8 November". */
|
|
86
|
-
day: DateFormatter;
|
|
87
|
-
/** A weekday and time, for chart axes and recent rows: `format.shortDay(at)` is "Sun 06:05". */
|
|
88
|
-
shortDay: DateFormatter;
|
|
89
|
-
/** A date with its year, for a record or a deadline: `format.date(at)` is "8 Nov 2026". */
|
|
90
|
-
date: DateFormatter;
|
|
91
|
-
/** A date and time, for a log or history row: `format.dateTime(at)` is "8 Nov 2026, 06:05". */
|
|
92
|
-
dateTime: DateFormatter;
|
|
93
|
-
/** A figure and its unit joined by a non-breaking space (`NBSP`), so they never wrap apart. */
|
|
94
|
-
withUnit: (value: number, unit: string, fmt?: Pick<Intl.NumberFormat, "format">) => string;
|
|
95
|
-
/** A temperature in °C, joined by a non-breaking space. */
|
|
96
|
-
celsius: (value: number) => string;
|
|
97
|
-
/**
|
|
98
|
-
* A size in bytes in the largest decimal unit it reaches (kB, MB, GB, TB, as disks and
|
|
99
|
-
* networks are sold): one decimal below 10 ("5.2 GB"), whole above ("431 GB"). Pass `unit`
|
|
100
|
-
* to fix the unit, so figures compared side by side ("431 of 466 GB") share one. Memory is
|
|
101
|
-
* read in binary units: `{ binary: true }` writes KiB, MiB, GiB ("7.6 GiB"), and a binary
|
|
102
|
-
* unit ("GiB") picks that too. The second argument is a unit or `{ binary, unit }`.
|
|
103
|
-
*/
|
|
104
|
-
bytes: (value: number, unitOrOptions?: ByteUnit | BinaryByteUnit | BytesOptions) => string;
|
|
105
|
-
/**
|
|
106
|
-
* A length of time in words, the unit chosen by size: "45 s", "16 min", "3.5 h", "2 days". Unknown
|
|
107
|
-
* (null, negative, not finite) prints the placeholder. `style: "parts"` is an uptime, the two
|
|
108
|
-
* largest units written out: "1d 1h 0m", "2h 5m", "5m 3s". Not `runningTime`, which is a media clock.
|
|
109
|
-
*/
|
|
110
|
-
duration: (seconds: number | null | undefined, { style }?: {
|
|
111
|
-
style?: "approx" | "parts";
|
|
112
|
-
}) => string;
|
|
113
|
-
/**
|
|
114
|
-
* A reading and its unit: `format.measure(12.34, "GB")` is "12.3 GB" (one decimal at most, a
|
|
115
|
-
* non-breaking space). `"%"` takes the figure as percent points and goes through `percent`, so
|
|
116
|
-
* the locale decides the spacing: `format.measure(41, "%")` is "41%". Unknown prints the placeholder.
|
|
117
|
-
*/
|
|
118
|
-
measure: (value: number | null | undefined, unit: string) => string;
|
|
119
|
-
/**
|
|
120
|
-
* A tick for the axis of a chart of the past, from seconds before now: "now", "−30 s", "−2 min",
|
|
121
|
-
* "−6 h", "−3 d" (a true minus sign). Pass it as `LineChart`'s `formatX` after turning x into seconds ago.
|
|
122
|
-
*/
|
|
123
|
-
agoTick: (secondsAgo: number | null | undefined) => string;
|
|
124
|
-
/**
|
|
125
|
-
* A distance in metres as a person says it: metres under a kilometre ("850 m"), then
|
|
126
|
-
* kilometres, one decimal below 100 ("12.4 km"), whole above; `"imperial"` is feet under a
|
|
127
|
-
* tenth of a mile ("320 ft"), then miles ("7.7 mi").
|
|
128
|
-
*/
|
|
129
|
-
distance: (metres: number, system?: "metric" | "imperial") => string;
|
|
130
|
-
/** The unit `bytes` would choose for a value, to share it across a set of figures. */
|
|
131
|
-
byteUnit: (value: number, { binary }?: {
|
|
132
|
-
binary?: boolean;
|
|
133
|
-
}) => "B" | "kB" | "MB" | "GB" | "TB" | "PB" | "KiB" | "MiB" | "GiB" | "TiB" | "PiB";
|
|
134
|
-
/**
|
|
135
|
-
* "1 piece", "6 pieces": the count and its noun, so copy never reads "1 pieces". They are
|
|
136
|
-
* joined by a non-breaking space (`NBSP`), not a plain one: in a test, match with the same
|
|
137
|
-
* call or a `\s` regex, not a typed "6 pieces" string in a role's `name`.
|
|
138
|
-
*/
|
|
139
|
-
count: (value: number | null | undefined, one: string, many?: string, { compact: short }?: CountOptions) => string;
|
|
140
|
-
};
|
|
141
|
-
export type Format = ReturnType<typeof createFormat>;
|
|
142
|
-
/** The en-GB formatters. */
|
|
143
|
-
export declare const format: {
|
|
144
|
-
locale: string;
|
|
145
|
-
/** The zone times are shown in, or `undefined` for the viewer's own. */
|
|
146
|
-
timeZone: string | undefined;
|
|
147
|
-
/** Whole numbers with grouping: `format.integer(1222)` is "1,222". */
|
|
148
|
-
integer: NumberFormatter;
|
|
149
|
-
/** One decimal place at most: `format.decimal(3.14)` is "3.1". */
|
|
150
|
-
decimal: NumberFormatter;
|
|
151
|
-
/** A ratio as a whole percent: `format.percent(0.42)` is "42%". */
|
|
152
|
-
percent: NumberFormatter;
|
|
153
|
-
/**
|
|
154
|
-
* A part's share of a whole, as `percent` but never misleading at the ends: a part above 0 that
|
|
155
|
-
* rounds to 0 is "<1%", and one short of the whole that rounds to 100 is ">99%".
|
|
156
|
-
* `format.share(2.4 / 512)` is "<1%".
|
|
157
|
-
*/
|
|
158
|
-
share: (value: number | null | undefined) => string;
|
|
159
|
-
/** A figure in short form for counts that run to thousands: `format.compact(1234)` is "1.2k" in en-GB, "1.2K" in en-US. */
|
|
160
|
-
compact: NumberFormatter;
|
|
161
|
-
/**
|
|
162
|
-
* How long ago (or how far ahead) a time is, in the largest unit it reaches:
|
|
163
|
-
* "3 weeks ago", "yesterday", "in 2 hours", "now" under a minute. Pass `now` in tests.
|
|
164
|
-
*/
|
|
165
|
-
ago: (value: DateInput | null | undefined, now?: DateInput) => string;
|
|
166
|
-
/**
|
|
167
|
-
* A media running time from seconds, as a player shows it: "4:05", "1:02:09". Unknown
|
|
168
|
-
* (null, negative, not finite) prints the placeholder. Set it in `tabular-nums`.
|
|
169
|
-
*/
|
|
170
|
-
runningTime: (seconds: number | null | undefined) => string;
|
|
171
|
-
/**
|
|
172
|
-
* A position in media as an editor shows it, to a chosen precision: "4:05" (seconds), "4:05.250"
|
|
173
|
-
* (`"ms"`), or "0:04:05:07" (`"frames"` at `fps`, the last part the frame). Hours appear only
|
|
174
|
-
* from one hour, except in frames. Frames are always four parts, hours included, as SMPTE
|
|
175
|
-
* timecode is (non-drop frame, with colons): a three-part "1:05:00" reads as one hour five, so
|
|
176
|
-
* a frame count must never be three. Editors write the same four parts (strata-react issue
|
|
177
|
-
* #122). Floors, never rounds up, so a time never reads ahead of the picture. Unknown (null,
|
|
178
|
-
* negative, not finite) prints the placeholder. Set it in `tabular-nums`.
|
|
179
|
-
*/
|
|
180
|
-
timecode: (seconds: number | null | undefined, { precision, fps }?: {
|
|
181
|
-
precision?: "seconds" | "ms" | "frames";
|
|
182
|
-
fps?: number;
|
|
183
|
-
}) => string;
|
|
184
|
-
/** What a missing value prints as: an en dash unless `createFormat`'s `missing` says otherwise. */
|
|
185
|
-
missing: string;
|
|
186
|
-
/** A time of day: `format.clock(at)` is "06:05". */
|
|
187
|
-
clock: DateFormatter;
|
|
188
|
-
/** A day without its year, for this week's things: `format.day(at)` is "Sunday 8 November". */
|
|
189
|
-
day: DateFormatter;
|
|
190
|
-
/** A weekday and time, for chart axes and recent rows: `format.shortDay(at)` is "Sun 06:05". */
|
|
191
|
-
shortDay: DateFormatter;
|
|
192
|
-
/** A date with its year, for a record or a deadline: `format.date(at)` is "8 Nov 2026". */
|
|
193
|
-
date: DateFormatter;
|
|
194
|
-
/** A date and time, for a log or history row: `format.dateTime(at)` is "8 Nov 2026, 06:05". */
|
|
195
|
-
dateTime: DateFormatter;
|
|
196
|
-
/** A figure and its unit joined by a non-breaking space (`NBSP`), so they never wrap apart. */
|
|
197
|
-
withUnit: (value: number, unit: string, fmt?: Pick<Intl.NumberFormat, "format">) => string;
|
|
198
|
-
/** A temperature in °C, joined by a non-breaking space. */
|
|
199
|
-
celsius: (value: number) => string;
|
|
200
|
-
/**
|
|
201
|
-
* A size in bytes in the largest decimal unit it reaches (kB, MB, GB, TB, as disks and
|
|
202
|
-
* networks are sold): one decimal below 10 ("5.2 GB"), whole above ("431 GB"). Pass `unit`
|
|
203
|
-
* to fix the unit, so figures compared side by side ("431 of 466 GB") share one. Memory is
|
|
204
|
-
* read in binary units: `{ binary: true }` writes KiB, MiB, GiB ("7.6 GiB"), and a binary
|
|
205
|
-
* unit ("GiB") picks that too. The second argument is a unit or `{ binary, unit }`.
|
|
206
|
-
*/
|
|
207
|
-
bytes: (value: number, unitOrOptions?: ByteUnit | BinaryByteUnit | BytesOptions) => string;
|
|
208
|
-
/**
|
|
209
|
-
* A length of time in words, the unit chosen by size: "45 s", "16 min", "3.5 h", "2 days". Unknown
|
|
210
|
-
* (null, negative, not finite) prints the placeholder. `style: "parts"` is an uptime, the two
|
|
211
|
-
* largest units written out: "1d 1h 0m", "2h 5m", "5m 3s". Not `runningTime`, which is a media clock.
|
|
212
|
-
*/
|
|
213
|
-
duration: (seconds: number | null | undefined, { style }?: {
|
|
214
|
-
style?: "approx" | "parts";
|
|
215
|
-
}) => string;
|
|
216
|
-
/**
|
|
217
|
-
* A reading and its unit: `format.measure(12.34, "GB")` is "12.3 GB" (one decimal at most, a
|
|
218
|
-
* non-breaking space). `"%"` takes the figure as percent points and goes through `percent`, so
|
|
219
|
-
* the locale decides the spacing: `format.measure(41, "%")` is "41%". Unknown prints the placeholder.
|
|
220
|
-
*/
|
|
221
|
-
measure: (value: number | null | undefined, unit: string) => string;
|
|
222
|
-
/**
|
|
223
|
-
* A tick for the axis of a chart of the past, from seconds before now: "now", "−30 s", "−2 min",
|
|
224
|
-
* "−6 h", "−3 d" (a true minus sign). Pass it as `LineChart`'s `formatX` after turning x into seconds ago.
|
|
225
|
-
*/
|
|
226
|
-
agoTick: (secondsAgo: number | null | undefined) => string;
|
|
227
|
-
/**
|
|
228
|
-
* A distance in metres as a person says it: metres under a kilometre ("850 m"), then
|
|
229
|
-
* kilometres, one decimal below 100 ("12.4 km"), whole above; `"imperial"` is feet under a
|
|
230
|
-
* tenth of a mile ("320 ft"), then miles ("7.7 mi").
|
|
231
|
-
*/
|
|
232
|
-
distance: (metres: number, system?: "metric" | "imperial") => string;
|
|
233
|
-
/** The unit `bytes` would choose for a value, to share it across a set of figures. */
|
|
234
|
-
byteUnit: (value: number, { binary }?: {
|
|
235
|
-
binary?: boolean;
|
|
236
|
-
}) => "B" | "kB" | "MB" | "GB" | "TB" | "PB" | "KiB" | "MiB" | "GiB" | "TiB" | "PiB";
|
|
237
|
-
/**
|
|
238
|
-
* "1 piece", "6 pieces": the count and its noun, so copy never reads "1 pieces". They are
|
|
239
|
-
* joined by a non-breaking space (`NBSP`), not a plain one: in a test, match with the same
|
|
240
|
-
* call or a `\s` regex, not a typed "6 pieces" string in a role's `name`.
|
|
241
|
-
*/
|
|
242
|
-
count: (value: number | null | undefined, one: string, many?: string, { compact: short }?: CountOptions) => string;
|
|
243
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { GridLayout } from 'react-aria-components';
|
|
2
|
-
import { LayoutInfo, Rect } from 'react-stately';
|
|
3
|
-
/** Keys of group headings start with this, so a tile key that is a plain id can never be mistaken for one. */
|
|
4
|
-
export declare const GROUP_PREFIX = "\u2063group\u2063";
|
|
5
|
-
export declare const groupKey: (group: string) => string;
|
|
6
|
-
export declare const isGroupKey: (key: unknown) => key is string;
|
|
7
|
-
/** The height of a group's heading row, in px. */
|
|
8
|
-
export declare const HEADER_HEIGHT = 40;
|
|
9
|
-
/** One picture to place in a justified row: its width over height, known before it loads. */
|
|
10
|
-
export type JustifyItem = {
|
|
11
|
-
key: string;
|
|
12
|
-
aspect: number;
|
|
13
|
-
};
|
|
14
|
-
/** Where `justifyRows` put a picture, relative to the row's left edge, and the height of the picture's row. */
|
|
15
|
-
export type Justified = {
|
|
16
|
-
key: string;
|
|
17
|
-
x: number;
|
|
18
|
-
width: number;
|
|
19
|
-
row: number;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Rows of equal height, each picture at its own shape (Google Photos, Lightroom): fill a row with
|
|
23
|
-
* pictures at the target height `rowHeight` until it is full, then scale the row's height so it spans
|
|
24
|
-
* `width` exactly. The last row of a run keeps the target height rather than stretching, so a short
|
|
25
|
-
* run does not become giant pictures. `padding` is each tile's own padding and border, added to
|
|
26
|
-
* every tile's width on top of the picture (the picture is `aspect` times the row's height). Returns
|
|
27
|
-
* the placements and each row's picture height.
|
|
28
|
-
*/
|
|
29
|
-
export declare function justifyRows(items: readonly JustifyItem[], width: number, rowHeight: number, gap: number, padding: number): {
|
|
30
|
-
placed: Justified[];
|
|
31
|
-
heights: number[];
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* The copy of the heading to draw at the top of the visible area, or null when the real one is already
|
|
35
|
-
* there. It is the last heading at or above `top`, moved to `top`, but never lower than the next
|
|
36
|
-
* heading's top less its own height, so the next heading pushes it up as it arrives.
|
|
37
|
-
*/
|
|
38
|
-
export declare function stuckHeader<H extends LayoutInfo>(headers: readonly H[], top: number): LayoutInfo | null;
|
|
39
|
-
/** `GridLayout` with full-width group headings (items keyed by `groupKey`) that stay at the top of the scroll box while their group is in view. */
|
|
40
|
-
export declare class GroupedGridLayout<T = unknown> extends GridLayout<T> {
|
|
41
|
-
private headers;
|
|
42
|
-
update(context: Parameters<GridLayout<T>["update"]>[0]): void;
|
|
43
|
-
getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
|
|
44
|
-
}
|
package/dist/lib/icon.d.ts
DELETED
package/dist/lib/image-diff.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/** Decoded pixels: RGBA, 4 bytes each, row by row. */
|
|
2
|
-
export type Pixels = {
|
|
3
|
-
data: Uint8ClampedArray;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
};
|
|
7
|
-
/** The result of comparing two pictures. */
|
|
8
|
-
export type Difference = {
|
|
9
|
-
/** RGBA, `width` × `height`: opaque where a pixel differs, transparent elsewhere. */
|
|
10
|
-
marks: Uint8ClampedArray;
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
/** Pixels judged different. */
|
|
14
|
-
differing: number;
|
|
15
|
-
/** Pixels compared. */
|
|
16
|
-
total: number;
|
|
17
|
-
};
|
|
18
|
-
/** The longest side, in pixels, a picture is compared at. */
|
|
19
|
-
export declare const MAX_SIDE = 2048;
|
|
20
|
-
/** pixelmatch's own default colour distance below which two pixels are the same. */
|
|
21
|
-
export declare const DEFAULT_TOLERANCE = 0.1;
|
|
22
|
-
/** The picture drawn at another size, each new pixel taken from the nearest old one. Used to bring the second picture to the first's size. */
|
|
23
|
-
export declare function resample(p: Pixels, width: number, height: number): Pixels;
|
|
24
|
-
/**
|
|
25
|
-
* Which pixels differ between two pictures. `b` is resampled to `a`'s size first when they differ,
|
|
26
|
-
* so a re-encoded or resized rendering still lines up. `tolerance` is pixelmatch's `threshold`, 0 to 1.
|
|
27
|
-
*/
|
|
28
|
-
export declare function differences(a: Pixels, b: Pixels, tolerance?: number): Difference;
|
|
29
|
-
/** Reads a picture's pixels by drawing it on a canvas, scaled down so its long side is at most `maxSide`. Rejects when the picture cannot be loaded or the browser will not let a page read it (a picture from another site without CORS headers). */
|
|
30
|
-
export declare function readPixels(src: string, maxSide?: number): Promise<Pixels>;
|
package/dist/lib/in-view.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Options for {@link useInView}. */
|
|
3
|
-
export type InViewOptions = {
|
|
4
|
-
/** Watch only while this is true. Default true. */
|
|
5
|
-
active?: boolean;
|
|
6
|
-
/** How far outside the scroll region still counts as in view (IntersectionObserver `rootMargin`). */
|
|
7
|
-
rootMargin?: string;
|
|
8
|
-
/** Stay in view after the first time, and stop watching. */
|
|
9
|
-
once?: boolean;
|
|
10
|
-
/** What to report where `IntersectionObserver` does not exist. Default false. */
|
|
11
|
-
unsupported?: boolean;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Whether an element is within `rootMargin` of its scroll region (the nearest
|
|
15
|
-
* `[data-strata-scroll]` ancestor, else the viewport). Returns a callback ref, so it follows the
|
|
16
|
-
* element as it mounts and unmounts.
|
|
17
|
-
*/
|
|
18
|
-
export declare function useInView({ active, rootMargin, once, unsupported }?: InViewOptions): {
|
|
19
|
-
ref: React.Dispatch<React.SetStateAction<Element | null>>;
|
|
20
|
-
inView: boolean;
|
|
21
|
-
};
|
package/dist/lib/loudness.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** A clip's level in dB relative to full scale: its RMS (what the ear follows) and its highest sample. */
|
|
2
|
-
export type Loudness = {
|
|
3
|
-
rms: number;
|
|
4
|
-
peak: number;
|
|
5
|
-
};
|
|
6
|
-
/** The most of a clip that is measured, in seconds. */
|
|
7
|
-
export declare const MAX_SECONDS = 120;
|
|
8
|
-
/** The RMS and peak of channel data (-1 to 1), over all channels together. */
|
|
9
|
-
export declare function loudnessOf(channels: readonly Float32Array[]): Loudness;
|
|
10
|
-
/** How much to turn each of two clips down (in dB, zero or less) so they play at the same RMS: the louder is lowered to the quieter. */
|
|
11
|
-
export declare function matchGains(a: Loudness, b: Loudness): {
|
|
12
|
-
a: number;
|
|
13
|
-
b: number;
|
|
14
|
-
};
|
|
15
|
-
/** dB to a media element's volume (0 to 1). */
|
|
16
|
-
export declare const gainToVolume: (decibels: number) => number;
|
|
17
|
-
/** Fetches and decodes a clip and measures it. Needs the Web Audio API; reads at most `MAX_SECONDS`. */
|
|
18
|
-
export declare function measureLoudness(src: string): Promise<Loudness>;
|
package/dist/lib/marks.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** The ids from `a` to `b` inclusive, in document order whichever way round they are given. Empty when either is not in `ids`. */
|
|
2
|
-
export declare function rangeBetween(ids: readonly string[], a: string | null, b: string | null): string[];
|
|
3
|
-
/** How many ids carry each mark key. Ids with no mark are not counted. */
|
|
4
|
-
export declare function countMarks(marks: Readonly<Record<string, string | undefined>>, ids?: readonly string[]): Record<string, number>;
|
|
5
|
-
/** The id `by` places from `from` in `ids`, held to the ends; the first (or last) when `from` is not set. */
|
|
6
|
-
export declare function stepId(ids: readonly string[], from: string | null, by: number): string | null;
|
package/dist/lib/microphone.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** A microphone that is open and sending samples. */
|
|
3
|
-
export type MicrophoneStream = {
|
|
4
|
-
sampleRate: number;
|
|
5
|
-
/** What the browser calls the device ("USB Audio Device"), or null when it says nothing. */
|
|
6
|
-
device: string | null;
|
|
7
|
-
/** Stops the device (the browser's recording light goes out). */
|
|
8
|
-
close: () => void;
|
|
9
|
-
};
|
|
10
|
-
/** Something that can be opened to send mono samples (-1 to 1) a chunk at a time. */
|
|
11
|
-
export type Microphone = {
|
|
12
|
-
open: (onSamples: (chunk: Float32Array) => void) => Promise<MicrophoneStream>;
|
|
13
|
-
};
|
|
14
|
-
/** A microphone that would not open, with a sentence a person can act on. */
|
|
15
|
-
export declare class MicrophoneError extends Error {
|
|
16
|
-
}
|
|
17
|
-
/** The sentence for what getUserMedia threw. */
|
|
18
|
-
export declare function explainMicrophoneError(e: unknown): MicrophoneError;
|
|
19
|
-
/** The browser's own microphone, with its processing off. */
|
|
20
|
-
export declare const browserMicrophone: Microphone;
|
|
21
|
-
/** The microphone screens record from: the browser's, unless a provider gives another (a fake in tests and stories). */
|
|
22
|
-
export declare const MicrophoneContext: React.Context<Microphone>;
|
|
23
|
-
/** The microphone from the nearest `MicrophoneContext`. */
|
|
24
|
-
export declare const useMicrophone: () => Microphone;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Reads `#rgb`, `#rrggbb` (with or without the #) as lower-case `#rrggbb`, or null. */
|
|
2
|
-
export declare function parseHex(text: string): string | null;
|
|
3
|
-
/** WCAG contrast ratio between two `#rrggbb` colours, 1 to 21. */
|
|
4
|
-
export declare function contrastRatio(a: string, b: string): number;
|
package/dist/lib/object-url.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/** Bytes (or a Blob) as an object URL: made once per value, revoked when the value changes or the component unmounts. `null` until made, and for `null` data. `type` is the MIME type for bytes ("audio/wav"); a Blob keeps its own unless `type` is given. */
|
|
2
|
-
export declare function useObjectUrl(data: Blob | BufferSource | null | undefined, type?: string): string | null;
|
package/dist/lib/overlay.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const overlaySurface = "rounded-overlay border border-border bg-popover text-popover-foreground shadow-overlay enter-overlay";
|
package/dist/lib/recording.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** The quietest level a speech meter draws, in dBFS: below it is silence for speech. */
|
|
2
|
-
export declare const LEVEL_FLOOR_DB = -60;
|
|
3
|
-
/** Joins chunks of samples into one buffer, in order. */
|
|
4
|
-
export declare function joinSamples(chunks: readonly Float32Array[]): Float32Array;
|
|
5
|
-
/** A mono 16-bit PCM WAV of `samples` (-1 to 1; beyond full scale is clipped). */
|
|
6
|
-
export declare function encodeWav(samples: Float32Array, sampleRate: number): Blob;
|
|
7
|
-
/** The highest sample in dBFS, never below `LEVEL_FLOOR_DB` (silence reads as the floor, not minus infinity). */
|
|
8
|
-
export declare function peakDb(samples: Float32Array): number;
|
|
9
|
-
/** How a take's level reads for speech, in words a speaker can act on. */
|
|
10
|
-
export type SpeechLevel = {
|
|
11
|
-
tone: "success" | "warning" | "danger";
|
|
12
|
-
word: string;
|
|
13
|
-
advice: string;
|
|
14
|
-
};
|
|
15
|
-
/** Judges a take by its peak (dBFS). */
|
|
16
|
-
export declare function speechLevel(peak: number): SpeechLevel;
|