strata-react 1.3.24 → 1.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/UPGRADING.md +7 -0
- package/dist/{api-types/cli.d.ts → api-types-cli.d.ts} +1 -0
- package/dist/api-types-cli.js +4 -3
- package/dist/api-types-cli.js.map +1 -1
- package/dist/{api-types/generate.d.ts → api-types.d.ts} +3 -3
- package/dist/api-types.js +3 -1
- package/dist/{button-KGJI6jQr.js → button-CYXjU-fs.js} +8 -5
- package/dist/button-CYXjU-fs.js.map +1 -0
- package/dist/{cursor-DDGBPiTJ.js → cursor-Cwyvgwsw.js} +9 -7
- package/dist/cursor-Cwyvgwsw.js.map +1 -0
- package/dist/{errors-BUvY1Z4d.js → errors-CmuwcWlb.js} +6 -6
- package/dist/{errors-BUvY1Z4d.js.map → errors-CmuwcWlb.js.map} +1 -1
- package/dist/{field-BjeE_FeB.js → field-DBCsFIng.js} +27 -23
- package/dist/field-DBCsFIng.js.map +1 -0
- package/dist/follow-CXQsL86O.js +16 -0
- package/dist/follow-CXQsL86O.js.map +1 -0
- package/dist/{generate-CjTHKJ39.js → generate-BkWhh4k4.js} +8 -6
- package/dist/generate-BkWhh4k4.js.map +1 -0
- package/dist/{lib/geo.d.ts → geo-DfKa9JtK.d.ts} +35 -33
- package/dist/{hls/index.d.ts → hls.d.ts} +13 -12
- package/dist/hls.js +5 -4
- package/dist/hls.js.map +1 -1
- package/dist/index.d.ts +5300 -140
- package/dist/index.js +363 -224
- package/dist/index.js.map +1 -1
- package/dist/map.d.ts +184 -0
- package/dist/map.js +21 -17
- package/dist/map.js.map +1 -1
- package/dist/media-player-BETa3P7K.d.ts +758 -0
- package/dist/{microphone-Bo3WaXgD.js → microphone-76skMt6i.js} +41 -30
- package/dist/microphone-76skMt6i.js.map +1 -0
- package/dist/microphone-DDOnQHxf.d.ts +237 -0
- package/dist/{migrate/cli.d.ts → migrate-cli.d.ts} +1 -0
- package/dist/migrate-cli.js +8 -6
- package/dist/migrate-cli.js.map +1 -1
- package/dist/panorama.d.ts +102 -0
- package/dist/panorama.js +54 -109
- package/dist/panorama.js.map +1 -1
- package/dist/{run-BT2WKzMz.js → run-D_Ic1jE7.js} +23 -16
- package/dist/run-D_Ic1jE7.js.map +1 -0
- package/dist/scene.d.ts +147 -0
- package/dist/scene.js +74 -77
- package/dist/scene.js.map +1 -1
- package/dist/testing.d.ts +468 -0
- package/dist/testing.js +11 -3
- package/dist/testing.js.map +1 -1
- package/dist/{theme-CxYZkUNk.js → theme-1oOSMj_D.js} +19 -17
- package/dist/theme-1oOSMj_D.js.map +1 -0
- package/dist/{tooltip-DhqrDtyu.js → tooltip-BosfsWYh.js} +9 -6
- package/dist/tooltip-BosfsWYh.js.map +1 -0
- package/dist/types-B3TsF0Ey.d.ts +241 -0
- package/dist/{value-controls-Dm_EYfZW.js → value-controls-5u7sD_wG.js} +22 -17
- package/dist/value-controls-5u7sD_wG.js.map +1 -0
- package/dist/viewer-input-3Qa-o35k.js +108 -0
- package/dist/viewer-input-3Qa-o35k.js.map +1 -0
- package/dist/{visual/cli.d.ts → visual-cli.d.ts} +2 -1
- package/dist/visual-cli.js +5 -4
- package/dist/visual-cli.js.map +1 -1
- package/dist/visual.d.ts +105 -0
- package/dist/visual.js +4 -3
- package/dist/visual.js.map +1 -1
- package/package.json +24 -19
- package/dist/api-types/index.d.ts +0 -1
- package/dist/button-KGJI6jQr.js.map +0 -1
- package/dist/components/active-list.d.ts +0 -46
- package/dist/components/alert.d.ts +0 -17
- package/dist/components/app-shell.d.ts +0 -32
- package/dist/components/async-button.d.ts +0 -48
- package/dist/components/auto-recorder.d.ts +0 -67
- package/dist/components/book-viewer.d.ts +0 -50
- package/dist/components/box-overlay.d.ts +0 -44
- package/dist/components/boxed-picture.d.ts +0 -34
- package/dist/components/button.d.ts +0 -45
- package/dist/components/byte-view.d.ts +0 -32
- package/dist/components/checkbox.d.ts +0 -39
- package/dist/components/choice-grid.d.ts +0 -42
- package/dist/components/commands.d.ts +0 -104
- package/dist/components/compare-audio.d.ts +0 -30
- package/dist/components/compare-grid.d.ts +0 -24
- package/dist/components/compare-parts.d.ts +0 -90
- package/dist/components/compare-regions.d.ts +0 -37
- package/dist/components/compare-text.d.ts +0 -32
- package/dist/components/compare-video-grid.d.ts +0 -52
- package/dist/components/compare-video.d.ts +0 -61
- package/dist/components/compare.d.ts +0 -90
- package/dist/components/composition.d.ts +0 -44
- package/dist/components/console.d.ts +0 -34
- package/dist/components/conversation.d.ts +0 -83
- package/dist/components/cursor.d.ts +0 -44
- package/dist/components/data-table.d.ts +0 -89
- package/dist/components/data-view.d.ts +0 -66
- package/dist/components/density.d.ts +0 -16
- package/dist/components/dialog.d.ts +0 -45
- package/dist/components/difference.d.ts +0 -19
- package/dist/components/disclosure.d.ts +0 -49
- package/dist/components/done.d.ts +0 -14
- package/dist/components/drag-source.d.ts +0 -29
- package/dist/components/field.d.ts +0 -79
- package/dist/components/file-intake.d.ts +0 -60
- package/dist/components/film-strip.d.ts +0 -35
- package/dist/components/folder-picker.d.ts +0 -59
- package/dist/components/fullscreen-frame.d.ts +0 -18
- package/dist/components/history.d.ts +0 -61
- package/dist/components/hotkeys.d.ts +0 -44
- package/dist/components/infinite-list.d.ts +0 -77
- package/dist/components/inspector.d.ts +0 -66
- package/dist/components/job-action.d.ts +0 -30
- package/dist/components/job-status.d.ts +0 -55
- package/dist/components/jobs-table.d.ts +0 -35
- package/dist/components/key-glyphs.d.ts +0 -5
- package/dist/components/key-owner.d.ts +0 -11
- package/dist/components/lightbox.d.ts +0 -61
- package/dist/components/line-chart.d.ts +0 -169
- package/dist/components/link-card.d.ts +0 -32
- package/dist/components/link.d.ts +0 -54
- package/dist/components/markable-text.d.ts +0 -60
- package/dist/components/media-contents.d.ts +0 -28
- package/dist/components/media-group.d.ts +0 -32
- package/dist/components/media-player.d.ts +0 -251
- package/dist/components/media-progress.d.ts +0 -17
- package/dist/components/media-skip.d.ts +0 -31
- package/dist/components/media-spans.d.ts +0 -93
- package/dist/components/media.d.ts +0 -133
- package/dist/components/meter.d.ts +0 -32
- package/dist/components/metric.d.ts +0 -17
- package/dist/components/outbox-status.d.ts +0 -10
- package/dist/components/page-header.d.ts +0 -14
- package/dist/components/pair-vote.d.ts +0 -70
- package/dist/components/pause-button.d.ts +0 -7
- package/dist/components/pixel-image.d.ts +0 -29
- package/dist/components/place-board.d.ts +0 -39
- package/dist/components/player-warning.d.ts +0 -24
- package/dist/components/popover.d.ts +0 -20
- package/dist/components/recorder.d.ts +0 -73
- package/dist/components/region-editor.d.ts +0 -67
- package/dist/components/save.d.ts +0 -46
- package/dist/components/say-again.d.ts +0 -13
- package/dist/components/schedule-table.d.ts +0 -24
- package/dist/components/secret-field.d.ts +0 -34
- package/dist/components/selectable-grid.d.ts +0 -57
- package/dist/components/selection.d.ts +0 -104
- package/dist/components/sequence-timeline.d.ts +0 -50
- package/dist/components/shortcut-editor.d.ts +0 -44
- package/dist/components/sortable-list.d.ts +0 -39
- package/dist/components/status.d.ts +0 -9
- package/dist/components/switch.d.ts +0 -15
- package/dist/components/system-panel.d.ts +0 -58
- package/dist/components/tabs.d.ts +0 -16
- package/dist/components/theme.d.ts +0 -106
- package/dist/components/thumbnail.d.ts +0 -50
- package/dist/components/tile-grid.d.ts +0 -67
- package/dist/components/timeline-player.d.ts +0 -18
- package/dist/components/timeline.d.ts +0 -115
- package/dist/components/toast.d.ts +0 -36
- package/dist/components/toggle.d.ts +0 -51
- package/dist/components/toolbar.d.ts +0 -15
- package/dist/components/tooltip.d.ts +0 -19
- package/dist/components/transcript-view.d.ts +0 -63
- package/dist/components/tree.d.ts +0 -74
- package/dist/components/undo.d.ts +0 -63
- package/dist/components/use-timeline.d.ts +0 -44
- package/dist/components/value-controls.d.ts +0 -91
- package/dist/components/video-clock.d.ts +0 -68
- package/dist/components/view-options.d.ts +0 -105
- package/dist/components/viewport.d.ts +0 -85
- package/dist/components/virtual-list.d.ts +0 -19
- package/dist/components/waveform.d.ts +0 -71
- package/dist/components/workflow-steps.d.ts +0 -71
- package/dist/components/workspace.d.ts +0 -83
- package/dist/cursor-DDGBPiTJ.js.map +0 -1
- package/dist/field-BjeE_FeB.js.map +0 -1
- package/dist/generate-CjTHKJ39.js.map +0 -1
- package/dist/lib/base.d.ts +0 -10
- package/dist/lib/book.d.ts +0 -25
- package/dist/lib/boxes.d.ts +0 -55
- package/dist/lib/breakpoint.d.ts +0 -4
- package/dist/lib/choice.d.ts +0 -29
- package/dist/lib/chords.d.ts +0 -20
- package/dist/lib/client-work.d.ts +0 -24
- package/dist/lib/control.d.ts +0 -4
- package/dist/lib/dev.d.ts +0 -2
- package/dist/lib/errors.d.ts +0 -43
- package/dist/lib/file-intake.d.ts +0 -60
- package/dist/lib/format.d.ts +0 -243
- package/dist/lib/grouped-grid-layout.d.ts +0 -44
- package/dist/lib/icon.d.ts +0 -6
- package/dist/lib/image-diff.d.ts +0 -30
- package/dist/lib/in-view.d.ts +0 -21
- package/dist/lib/loudness.d.ts +0 -18
- package/dist/lib/marks.d.ts +0 -6
- package/dist/lib/microphone.d.ts +0 -24
- package/dist/lib/number-input.d.ts +0 -4
- package/dist/lib/object-url.d.ts +0 -2
- package/dist/lib/overlay.d.ts +0 -1
- package/dist/lib/recording.d.ts +0 -16
- package/dist/lib/region.d.ts +0 -64
- package/dist/lib/rich-text.d.ts +0 -44
- package/dist/lib/search-param.d.ts +0 -16
- package/dist/lib/segmenter.d.ts +0 -40
- package/dist/lib/sequence.d.ts +0 -34
- package/dist/lib/speech.d.ts +0 -53
- package/dist/lib/text-diff.d.ts +0 -16
- package/dist/lib/timeline.d.ts +0 -14
- package/dist/lib/transcript.d.ts +0 -53
- package/dist/lib/utils.d.ts +0 -4
- package/dist/lib/viewport.d.ts +0 -55
- package/dist/lib/waveform.d.ts +0 -46
- package/dist/map/fan.d.ts +0 -15
- package/dist/map/index.d.ts +0 -3
- package/dist/map/map-styles.d.ts +0 -2
- package/dist/map/markers.d.ts +0 -60
- package/dist/map/route-map.d.ts +0 -146
- package/dist/microphone-Bo3WaXgD.js.map +0 -1
- package/dist/migrate/stock-classes.d.ts +0 -11
- package/dist/panorama/gl.d.ts +0 -16
- package/dist/panorama/index.d.ts +0 -2
- package/dist/panorama/panorama-viewer.d.ts +0 -56
- package/dist/panorama/projection.d.ts +0 -45
- package/dist/query/api.d.ts +0 -23
- package/dist/query/clips.d.ts +0 -48
- package/dist/query/index.d.ts +0 -55
- package/dist/query/infinite.d.ts +0 -60
- package/dist/query/job.d.ts +0 -26
- package/dist/query/outbox.d.ts +0 -85
- package/dist/query/poll.d.ts +0 -24
- package/dist/query/reserve.d.ts +0 -33
- package/dist/query/typed-api.d.ts +0 -84
- package/dist/query/workflow.d.ts +0 -17
- package/dist/run-BT2WKzMz.js.map +0 -1
- package/dist/scene/camera.d.ts +0 -74
- package/dist/scene/index.d.ts +0 -2
- package/dist/scene/scene-viewport.d.ts +0 -48
- package/dist/testing/buttons.d.ts +0 -7
- package/dist/testing/index.d.ts +0 -161
- package/dist/testing/intersection-observer.d.ts +0 -34
- package/dist/testing/layout.d.ts +0 -13
- package/dist/testing/microphone.d.ts +0 -35
- package/dist/testing/setup.d.ts +0 -14
- package/dist/testing/speech.d.ts +0 -38
- package/dist/testing/storage.d.ts +0 -7
- package/dist/theme-CxYZkUNk.js.map +0 -1
- package/dist/tooltip-DhqrDtyu.js.map +0 -1
- package/dist/value-controls-Dm_EYfZW.js.map +0 -1
- package/dist/visual/capture.d.ts +0 -37
- package/dist/visual/compare.d.ts +0 -46
- package/dist/visual/drop.d.ts +0 -19
- package/dist/visual/fonts.d.ts +0 -18
- package/dist/visual/index.d.ts +0 -19
- package/dist/visual/run.d.ts +0 -22
- package/dist/visual/serve.d.ts +0 -13
- package/dist/visual/targets.d.ts +0 -17
- package/dist/visual/types.d.ts +0 -188
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** One page of the book. */
|
|
3
|
-
export type BookPage = {
|
|
4
|
-
id: string;
|
|
5
|
-
src: string;
|
|
6
|
-
/** What the page shows, for assistive technology: "Page 22 of the Punch book". Required. */
|
|
7
|
-
label: string;
|
|
8
|
-
/** Its position in the scan, as a person counts: "22". */
|
|
9
|
-
scan: string;
|
|
10
|
-
/** What is printed on it: "12", "iv", or a running head. Pages with none have only their scan position. */
|
|
11
|
-
printed?: string;
|
|
12
|
-
/** A small picture for the strip. Default `src`. */
|
|
13
|
-
thumb?: string;
|
|
14
|
-
/** Its natural size in pixels, for 1:1 and the frame's shape. */
|
|
15
|
-
natural?: readonly [number, number];
|
|
16
|
-
};
|
|
17
|
-
export type BookViewerProps = {
|
|
18
|
-
/** Names the book: "The Play of Punch and Judy". */
|
|
19
|
-
label: string;
|
|
20
|
-
pages: readonly BookPage[];
|
|
21
|
-
/** The page being read (any page of a spread), as an index into `pages`. */
|
|
22
|
-
index: number;
|
|
23
|
-
onIndexChange: (index: number) => void;
|
|
24
|
-
/** What shows in place of a page that did not load, in words. Required. */
|
|
25
|
-
missing: string;
|
|
26
|
-
/** `"spread"` (default) shows facing pages when there is room; `"single"` always one. */
|
|
27
|
-
layout?: "spread" | "single";
|
|
28
|
-
/** Beside the pages (under them when narrow): the pages shown, for the transcript pane. */
|
|
29
|
-
side?: (shown: readonly BookPage[]) => React.ReactNode;
|
|
30
|
-
sideLabel?: string;
|
|
31
|
-
/** In the corner of a page's thumbnail: a `Status` ("Look") for the pages that need a look. */
|
|
32
|
-
badge?: (page: BookPage) => React.ReactNode;
|
|
33
|
-
/** A layer inside a page's zoomable frame, in the page's own pixels (`natural` once known): a `BoxOverlay`. */
|
|
34
|
-
overlay?: (page: BookPage, natural: readonly [number, number] | null) => React.ReactNode;
|
|
35
|
-
/** The thumbnail strip under the pages. Default true. */
|
|
36
|
-
strip?: boolean;
|
|
37
|
-
/** Width over height of a page before it loads. Default 2:3. */
|
|
38
|
-
aspect?: number;
|
|
39
|
-
/** What a page is called: "Page" (default), or "Leaf", "Folio". */
|
|
40
|
-
word?: string;
|
|
41
|
-
className?: string;
|
|
42
|
-
};
|
|
43
|
-
/** What `useBookUrl` returns: the `index` and `onIndexChange` a `BookViewer` takes. */
|
|
44
|
-
export type BookUrl = Pick<BookViewerProps, "index" | "onIndexChange">;
|
|
45
|
-
/** Keeps the page being read in the URL (`?page=22`, the 1-based position in the scan): a link or a reload opens it, and turning pages replaces the entry so Back leaves the book. */
|
|
46
|
-
export declare function useBookUrl(count: number, { param }?: {
|
|
47
|
-
param?: string;
|
|
48
|
-
}): BookUrl;
|
|
49
|
-
/** A scanned book read as a book: facing pages (the first alone on the right) or one page, printed and scan names with a go-to that takes either, arrows, Page Up/Down, Home/End and a click on a page's outer half, the position in the URL and in words, a thumbnail strip with badges, an optional text pane. */
|
|
50
|
-
export declare function BookViewer({ label, pages, index, onIndexChange, missing, layout, side, sideLabel, badge, overlay, strip, aspect, word, className }: BookViewerProps): React.JSX.Element;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { PictureBox } from '../lib/boxes';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** Where the last choice was made, so the other part can follow it (focus moves to the list only when the picture chose). */
|
|
4
|
-
export type BoxSource = "list" | "picture";
|
|
5
|
-
/** The state `BoxOverlay` and `BoxList` share. */
|
|
6
|
-
export type BoxesState = {
|
|
7
|
-
/** The chosen box's id. */
|
|
8
|
-
active: string | null;
|
|
9
|
-
/** The box under the pointer or being tabbed to, in either part. */
|
|
10
|
-
pointed: string | null;
|
|
11
|
-
source: BoxSource | null;
|
|
12
|
-
choose: (id: string | null, from?: BoxSource) => void;
|
|
13
|
-
point: (id: string | null) => void;
|
|
14
|
-
};
|
|
15
|
-
/** Holds the active and pointed box for a `BoxOverlay` and the `BoxList` beside it. */
|
|
16
|
-
export declare function useBoxes(initial?: string | null): BoxesState;
|
|
17
|
-
export type BoxOverlayProps = {
|
|
18
|
-
/** Names the layer: "Lines the reader found". */
|
|
19
|
-
label: string;
|
|
20
|
-
/** The picture's size in pixels; the boxes are in these units. */
|
|
21
|
-
of: {
|
|
22
|
-
w: number;
|
|
23
|
-
h: number;
|
|
24
|
-
};
|
|
25
|
-
boxes: readonly PictureBox[];
|
|
26
|
-
state: BoxesState;
|
|
27
|
-
/** A box was chosen (a click, Enter or Space): zoom to it, scroll a text pane. The state already holds it. */
|
|
28
|
-
onChoose?: (box: PictureBox) => void;
|
|
29
|
-
/** Fill the pointed or chosen box with its tone's subtle colour. Default `true` (a line of text stays readable under it); `false` for what the box is about to be looked at, such as a face, which only a heavier outline marks. */
|
|
30
|
-
fillLit?: boolean;
|
|
31
|
-
};
|
|
32
|
-
/** Read-only boxes drawn as one SVG layer over a picture, inside `ViewportFrame` so they zoom with it: outline by tone, hover and choice shared with a `BoxList`, one tab stop with arrows in reading order. */
|
|
33
|
-
export declare function BoxOverlay({ label, of, boxes, state, onChoose, fillLit }: BoxOverlayProps): React.JSX.Element;
|
|
34
|
-
export type BoxListProps = {
|
|
35
|
-
/** Names the list: "Lines on this page". */
|
|
36
|
-
label: string;
|
|
37
|
-
boxes: readonly PictureBox[];
|
|
38
|
-
state: BoxesState;
|
|
39
|
-
/** What each line shows. Default: the box's label. */
|
|
40
|
-
renderBox?: (box: PictureBox) => React.ReactNode;
|
|
41
|
-
className?: string;
|
|
42
|
-
};
|
|
43
|
-
/** The list beside a `BoxOverlay`, in the same reading order: choosing a line marks its box, pointing at one lights it, and choosing a box in the picture scrolls the list to its line and focuses it. */
|
|
44
|
-
export declare function BoxList({ label, boxes, state, renderBox, className }: BoxListProps): React.JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { BoxesState } from './box-overlay';
|
|
2
|
-
import { PictureBox } from '../lib/boxes';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
export type BoxedPictureProps = {
|
|
5
|
-
/** Names the frame: "Photo 2026-03-14 09:12". */
|
|
6
|
-
label: string;
|
|
7
|
-
/** The picture; `null` when there is none (the boxes still show, on the `missing` words). */
|
|
8
|
-
src: string | readonly string[] | null;
|
|
9
|
-
/** What the picture shows, or `""` when `label` says it. */
|
|
10
|
-
alt: string;
|
|
11
|
-
/** The words when the picture cannot be shown: "Photo not kept". */
|
|
12
|
-
missing: string;
|
|
13
|
-
/** The picture's size in pixels; the boxes are in these units. */
|
|
14
|
-
of: {
|
|
15
|
-
w: number;
|
|
16
|
-
h: number;
|
|
17
|
-
};
|
|
18
|
-
boxes: readonly PictureBox[];
|
|
19
|
-
/** From `useBoxes`, shared with a `BoxList` if there is one; its `active` box is the one opened on. */
|
|
20
|
-
state: BoxesState;
|
|
21
|
-
/** Names the layer of boxes: "Faces in this photo". */
|
|
22
|
-
boxesLabel: string;
|
|
23
|
-
/** Zoom to the chosen box when it is chosen and when the picture opens on one. Default `true`. */
|
|
24
|
-
zoom?: boolean;
|
|
25
|
-
/** How much of the box's size to leave around it when zoomed, on every side. Default 0.75 (a face with its hair, shoulders and something of who is beside it). */
|
|
26
|
-
margin?: number;
|
|
27
|
-
/** The tallest the frame may be, as a CSS length. Default `"70svh"`. */
|
|
28
|
-
maxHeight?: string;
|
|
29
|
-
/** A box was chosen in the picture. */
|
|
30
|
-
onChoose?: (box: PictureBox) => void;
|
|
31
|
-
className?: string;
|
|
32
|
-
};
|
|
33
|
-
/** A picture with its boxes drawn on it, opened zoomed to the chosen one (a face in its photo): `ViewportFrame` + `BoxOverlay` + `zoomToBox`, with the picture's missing state. Pair it with a `BoxList` through one `useBoxes`. */
|
|
34
|
-
export declare function BoxedPicture({ label, src, alt, missing, of, boxes, state, boxesLabel, zoom, margin, maxHeight, onChoose, className }: BoxedPictureProps): React.JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { PressEvent } from 'react-aria-components';
|
|
2
|
-
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { IconComponent } from '../lib/icon';
|
|
4
|
-
import { ControlSize } from '../lib/control';
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
export declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
8
|
-
size?: "default" | "sm" | "icon" | "icon-sm" | null | undefined;
|
|
9
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
-
export type ButtonProps = Omit<React.ComponentProps<"button">, "className" | "style" | "title"> & VariantProps<typeof buttonVariants> & {
|
|
11
|
-
className?: string;
|
|
12
|
-
/** Not accepted: a `title` is a poor tooltip (no keyboard focus, no touch) and React Aria's button drops it. Wrap the button in a `Tooltip`, or use `IconButton`'s `label` and `hint`. */
|
|
13
|
-
title?: never;
|
|
14
|
-
/** React Aria's press event (mouse, touch, pen and keyboard alike). `onClick` also works. */
|
|
15
|
-
onPress?: (event: PressEvent) => void;
|
|
16
|
-
/** When a press begins and ends: for a control that acts while held (a nudge that repeats). */
|
|
17
|
-
onPressStart?: (event: PressEvent) => void;
|
|
18
|
-
onPressEnd?: (event: PressEvent) => void;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* A button with shadcn's variant names, built on React Aria's `Button` (press handling that behaves
|
|
22
|
-
* the same for mouse, touch, pen and keyboard, focus-visible and hover state). The default variant is
|
|
23
|
-
* `outline`; ask for the filled accent (`variant="default"`) once per view. `type` defaults to `button`.
|
|
24
|
-
* `onClick` and `disabled` are the DOM names and keep working; `onPress` is also accepted.
|
|
25
|
-
*/
|
|
26
|
-
export declare function Button({ className, variant, size, type, disabled, children, "aria-busy": ariaBusy, ...props }: ButtonProps): React.JSX.Element;
|
|
27
|
-
export type IconButtonProps = Omit<ButtonProps, "size" | "children" | "aria-label"> & {
|
|
28
|
-
/** `sm` is --control-h-sm, the height of a small `Toggle` or `Button`, for a toolbar or property row. Default --control-h. */
|
|
29
|
-
size?: ControlSize;
|
|
30
|
-
icon: IconComponent;
|
|
31
|
-
label: string;
|
|
32
|
-
/** Shown after the label in its tooltip, muted: "Ctrl+Z". */
|
|
33
|
-
hint?: React.ReactNode;
|
|
34
|
-
};
|
|
35
|
-
/** An icon-only button. `label` is required and becomes the accessible name and the tooltip (hover and keyboard focus); `hint` adds a muted aside to it, such as a shortcut. */
|
|
36
|
-
export declare function IconButton({ icon: Icon, label, hint, variant, size, ...props }: IconButtonProps): React.JSX.Element;
|
|
37
|
-
export type RowActionProps = Omit<ButtonProps, "children" | "aria-label"> & {
|
|
38
|
-
/** The visible verb, sentence case: "Withdraw", "Remove". */
|
|
39
|
-
label: string;
|
|
40
|
-
/** What the row is, as a person would say it: "Tom Ellery", "Moonbeam". Completes the accessible name. */
|
|
41
|
-
subject: string;
|
|
42
|
-
icon?: IconComponent;
|
|
43
|
-
};
|
|
44
|
-
/** A small ghost action for one table row: shows `label`, and is named "`label` `subject`" so every row's action has its own name. */
|
|
45
|
-
export declare function RowAction({ label, subject, icon: Icon, variant, size, className, ...props }: RowActionProps): React.JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Tone } from './status';
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
/** A range of bytes the app has understood, drawn tinted; `end` is exclusive, `label` is what the status says of it. */
|
|
4
|
-
export type ByteHighlight = {
|
|
5
|
-
start: number;
|
|
6
|
-
end: number;
|
|
7
|
-
tone?: Tone;
|
|
8
|
-
label?: string;
|
|
9
|
-
};
|
|
10
|
-
/** The selected bytes: `start` to `end`, `end` exclusive. */
|
|
11
|
-
export type ByteRange = {
|
|
12
|
-
start: number;
|
|
13
|
-
end: number;
|
|
14
|
-
};
|
|
15
|
-
export type ByteViewProps = {
|
|
16
|
-
bytes: Uint8Array;
|
|
17
|
-
/** Names the dump: "pak0.pak, raw bytes". The byte count is added to it. */
|
|
18
|
-
label: string;
|
|
19
|
-
/** The address of `bytes[0]`, shown in the offsets column. Default 0. */
|
|
20
|
-
offset?: number;
|
|
21
|
-
/** Ranges to tint and name. */
|
|
22
|
-
highlight?: readonly ByteHighlight[];
|
|
23
|
-
/** The range chosen first. Default none until the person moves or presses. */
|
|
24
|
-
defaultSelection?: ByteRange;
|
|
25
|
-
/** The selected range changed (a press, a drag, a key). */
|
|
26
|
-
onSelectionChange?: (range: ByteRange) => void;
|
|
27
|
-
/** The height of the dump in px. Default 320. */
|
|
28
|
-
height?: number;
|
|
29
|
-
className?: string;
|
|
30
|
-
};
|
|
31
|
-
/** A virtualised hex dump: offsets, sixteen bytes a row and the printable characters, byte and range keyboard, and the selected range reported as `{ start, end }`. */
|
|
32
|
-
export declare function ByteView({ bytes, label, offset, highlight, defaultSelection, onSelectionChange, height, className }: ByteViewProps): React.JSX.Element;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** A checkbox with its label as one target. `label` is required; `checked="mixed"` is indeterminate. */
|
|
3
|
-
export type CheckboxProps = Omit<React.ComponentProps<"input">, "type" | "checked" | "onChange" | "aria-label" | "children" | "style"> & {
|
|
4
|
-
/** Names the checkbox. Shown beside it unless `hideLabel`. */
|
|
5
|
-
label: string;
|
|
6
|
-
/** Keep the label as the accessible name only, for a cell or toolbar where the context shows what it is. */
|
|
7
|
-
hideLabel?: boolean;
|
|
8
|
-
/** A muted second line under a shown label. */
|
|
9
|
-
detail?: string;
|
|
10
|
-
checked: boolean | "mixed";
|
|
11
|
-
/** Called with the new state, and whether Shift was held (a range click or Shift+Space). */
|
|
12
|
-
onCheckedChange: (checked: boolean, gesture: CheckboxGesture) => void;
|
|
13
|
-
};
|
|
14
|
-
/** How a checkbox was changed: `shiftKey` is true for Shift+click and Shift+Space, which extend a range in a list. */
|
|
15
|
-
export type CheckboxGesture = {
|
|
16
|
-
shiftKey: boolean;
|
|
17
|
-
};
|
|
18
|
-
/** A checkbox and its label as one target. `label` is required; `hideLabel` keeps it as the accessible name only. */
|
|
19
|
-
export declare function Checkbox({ label, hideLabel, detail, checked, onCheckedChange, className, disabled, required, ...props }: CheckboxProps): React.JSX.Element;
|
|
20
|
-
/** Notes Shift on the press that leads to a checkbox's change event, which has no modifier keys of its own. */
|
|
21
|
-
export declare function useShiftNote(): {
|
|
22
|
-
handlers: {
|
|
23
|
-
onMouseDown: (e: React.MouseEvent) => undefined;
|
|
24
|
-
onKeyDown: (e: React.KeyboardEvent) => undefined;
|
|
25
|
-
};
|
|
26
|
-
take: () => CheckboxGesture;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* The checkbox of a React Aria `Table` row or header (`slot="selection"`): its checked, mixed and
|
|
30
|
-
* disabled state come from the table, so it takes only a name. A `Checkbox` is controlled and would
|
|
31
|
-
* fight the table's own selection state. Not exported from the package: `DataTable` uses it.
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare function TableSelectionCheckbox({ label, className, disabled, mixed }: {
|
|
35
|
-
label: string;
|
|
36
|
-
className?: string;
|
|
37
|
-
disabled?: boolean; /** Drawn mixed (a tree branch with some of its rows chosen); the surface decides, as React Aria has no parent-child rule. */
|
|
38
|
-
mixed?: boolean;
|
|
39
|
-
}): React.JSX.Element;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
/** Where a tile stands in the round: not yet tried, tried and wrong, tried and right, or shown as the answer after the tries ran out. */
|
|
3
|
-
export type ChoiceState = "open" | "wrong" | "right" | "answer" | "picked";
|
|
4
|
-
/** The word under each closed tile. A quiz gives `wrong`, `right` and `answer` (and `picked` if it ever uses it); a choice with no answer key gives only `picked`. A state with no word draws no word, so name every state the grid can reach. */
|
|
5
|
-
export type ChoiceMarks = (Record<"wrong" | "right" | "answer", string> & {
|
|
6
|
-
picked?: string;
|
|
7
|
-
}) | {
|
|
8
|
-
picked: string;
|
|
9
|
-
wrong?: never;
|
|
10
|
-
right?: never;
|
|
11
|
-
answer?: never;
|
|
12
|
-
};
|
|
13
|
-
/** Smallest tile side: `md` 120px, `lg` 160px. Tiles grow to fill the row. */
|
|
14
|
-
export type ChoiceSize = "md" | "lg";
|
|
15
|
-
/** Props of `ChoiceGrid`. */
|
|
16
|
-
export type ChoiceGridProps<T> = {
|
|
17
|
-
/** Names the grid: "Choices", or the question itself ("Find the cow"). */
|
|
18
|
-
label: string;
|
|
19
|
-
items: T[];
|
|
20
|
-
itemKey: (item: T) => string;
|
|
21
|
-
/** What the picture is, said by a screen reader and used for type-ahead: "cow", "3". Never drawn, which would give the answer away. */
|
|
22
|
-
itemLabel: (item: T) => string;
|
|
23
|
-
/** The picture: an emoji, a numeral or an `<img alt="">`; drawn at `type-picture`. */
|
|
24
|
-
renderPicture: (item: T) => React.ReactNode;
|
|
25
|
-
/** Each tile's state in the round. The app owns the answer; the grid only draws it. */
|
|
26
|
-
state: (item: T) => ChoiceState;
|
|
27
|
-
/** The word under a closed tile, for each closed state: `{ wrong: "Not this one", right: "Right", answer: "This one" }`, or `{ picked: "Picked" }` where there is no answer key. */
|
|
28
|
-
marks: ChoiceMarks;
|
|
29
|
-
/** An open tile was pressed (pointer, touch, Enter or Space). */
|
|
30
|
-
onChoose: (item: T) => void;
|
|
31
|
-
/** Default `md`. */
|
|
32
|
-
size?: ChoiceSize;
|
|
33
|
-
className?: string;
|
|
34
|
-
};
|
|
35
|
-
/** A grid of large picture tiles for answering one question with a tap: each tile open, wrong, right, shown as the answer or (no answer key) picked, with its word; answered tiles cannot be pressed again, and the grid closes once the answer shows. */
|
|
36
|
-
export declare function ChoiceGrid<T>({ label, items, itemKey, itemLabel, renderPicture, state, marks, onChoose, size, className }: ChoiceGridProps<T>): React.JSX.Element;
|
|
37
|
-
/** The loading shape of a `ChoiceGrid`: `count` tiles at the same size, for a `DataView` skeleton. */
|
|
38
|
-
export declare function ChoiceGridSkeleton({ count, size, className }: {
|
|
39
|
-
count?: number;
|
|
40
|
-
size?: ChoiceSize;
|
|
41
|
-
className?: string;
|
|
42
|
-
}): React.JSX.Element;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { IconComponent } from '../lib/icon';
|
|
2
|
-
import { Platform } from '../lib/chords';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
/** A command: what it is called, how it is run, and everything the menus need to draw it. */
|
|
5
|
-
export type Command = {
|
|
6
|
-
/** Stable key for the command. */
|
|
7
|
-
id: string;
|
|
8
|
-
/** The verb phrase, sentence case, in the product's words ("Split clip"); a function when it follows state ("Undo move clip"). */
|
|
9
|
-
label: string | (() => string);
|
|
10
|
-
run: () => void;
|
|
11
|
-
/** Chords that run it, written once ("Mod+Z", "Delete", "Shift+?"); the first is the one shown. */
|
|
12
|
-
keys?: string[];
|
|
13
|
-
/** Cannot run now. A sentence says why ("Nothing to undo") and is shown in menus. */
|
|
14
|
-
disabled?: boolean | string;
|
|
15
|
-
/** Cannot be undone or removes something: drawn with an icon and the danger colour. */
|
|
16
|
-
destructive?: boolean;
|
|
17
|
-
/** Makes a menu item checkable: whether it is on now. `run` toggles it. */
|
|
18
|
-
checked?: boolean;
|
|
19
|
-
icon?: IconComponent;
|
|
20
|
-
/** Fire again while the key is held (for moving). Default false. */
|
|
21
|
-
repeat?: boolean;
|
|
22
|
-
/** Run from inside a text field too. Default false: a field keeps its own keys. */
|
|
23
|
-
inFields?: boolean;
|
|
24
|
-
/** Take over a chord the browser uses (Ctrl+S, Ctrl+P). Required for those; otherwise the command is not bound. */
|
|
25
|
-
claim?: boolean;
|
|
26
|
-
};
|
|
27
|
-
/** What goes in a menu: a command, a separator, a titled group, or a submenu. */
|
|
28
|
-
export type MenuEntry = Command | "separator" | {
|
|
29
|
-
group: string;
|
|
30
|
-
items: Command[];
|
|
31
|
-
} | {
|
|
32
|
-
submenu: string;
|
|
33
|
-
items: MenuEntry[];
|
|
34
|
-
};
|
|
35
|
-
/** The text of a command's label, whether it is a string or a function. */
|
|
36
|
-
export declare const labelOf: (c: Command) => string;
|
|
37
|
-
/** Options for `useCommands`. */
|
|
38
|
-
export type CommandsOptions = {
|
|
39
|
-
enabled?: boolean;
|
|
40
|
-
/** Which platform's `Mod` to use; read from the browser when left out. */
|
|
41
|
-
platform?: Platform;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Binds every command's chords on the window. Never while typing (unless the command says
|
|
45
|
-
* `inFields`), never during IME composition, not on a held key (unless `repeat`), not for a disabled
|
|
46
|
-
* command, and not for a chord the browser uses unless the command `claim`s it. A command's chord
|
|
47
|
-
* that clashes with another's is a mistake: the first in the list wins, and a dev warning names both.
|
|
48
|
-
*/
|
|
49
|
-
export declare function useCommands(commands: readonly Command[], { enabled, platform }?: CommandsOptions): void;
|
|
50
|
-
/** The shortcut a command shows in menus and legends ("⌘Z", "Ctrl+Z"), or undefined. */
|
|
51
|
-
export declare function commandShortcut(c: Command, platform?: Platform): string | undefined;
|
|
52
|
-
/** A quiet legend built from the same commands the key handler runs: only commands with keys, disabled ones muted. */
|
|
53
|
-
export declare function CommandLegend({ commands, platform, label, className, }: {
|
|
54
|
-
commands: readonly Command[];
|
|
55
|
-
platform?: Platform;
|
|
56
|
-
label?: string;
|
|
57
|
-
className?: string;
|
|
58
|
-
}): React.JSX.Element;
|
|
59
|
-
/** Props for `Menu`. */
|
|
60
|
-
export type MenuProps = {
|
|
61
|
-
/** Names the menu: "File", "Edit". Required. */
|
|
62
|
-
label: string;
|
|
63
|
-
/** The control that opens it. */
|
|
64
|
-
trigger: React.ReactElement;
|
|
65
|
-
items: readonly MenuEntry[];
|
|
66
|
-
/** Controlled open state, for a story or a test that needs it shown. */
|
|
67
|
-
open?: boolean;
|
|
68
|
-
onOpenChange?: (open: boolean) => void;
|
|
69
|
-
platform?: Platform;
|
|
70
|
-
className?: string;
|
|
71
|
-
};
|
|
72
|
-
/** A dropdown menu of commands: the menu roles and keyboard model, shortcuts shown per platform, unavailable items with their reason, separators, groups, checkable groups and submenus. */
|
|
73
|
-
export declare function Menu({ label, trigger, items, open, onOpenChange, platform, className }: MenuProps): React.JSX.Element;
|
|
74
|
-
/** Props for `ContextMenu`. */
|
|
75
|
-
export type ContextMenuProps = {
|
|
76
|
-
/** Names the menu: "Clip actions". Required. */
|
|
77
|
-
label: string;
|
|
78
|
-
items: readonly MenuEntry[];
|
|
79
|
-
/** The object it belongs to. It becomes the thing the menu opens on: right-click, the context-menu key and Shift+F10. */
|
|
80
|
-
children: React.ReactElement<React.HTMLAttributes<HTMLElement>>;
|
|
81
|
-
platform?: Platform;
|
|
82
|
-
disabled?: boolean;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* A context menu for an object: opens on right-click at the pointer, and from the keyboard (the
|
|
86
|
-
* context-menu key or Shift+F10) beside the focused object, with the same items and shortcuts as
|
|
87
|
-
* every other menu. The child gets the handlers, so it should be focusable (a row, a clip).
|
|
88
|
-
*/
|
|
89
|
-
export declare function ContextMenu({ label, items, children, platform, disabled }: ContextMenuProps): React.JSX.Element;
|
|
90
|
-
/** Props for `CommandMenu`. */
|
|
91
|
-
export type CommandMenuProps = {
|
|
92
|
-
/** The commands to search, usually the same list given to `useCommands`. Entries may be grouped. */
|
|
93
|
-
commands: readonly MenuEntry[];
|
|
94
|
-
/** Controlled open state; otherwise it opens on `shortcut`. */
|
|
95
|
-
open?: boolean;
|
|
96
|
-
onOpenChange?: (open: boolean) => void;
|
|
97
|
-
/** The chord that opens it. Default `Mod+K`. `null` for none. */
|
|
98
|
-
shortcut?: string | null;
|
|
99
|
-
/** The search field's name and placeholder. Default "Search commands". */
|
|
100
|
-
label?: string;
|
|
101
|
-
platform?: Platform;
|
|
102
|
-
};
|
|
103
|
-
/** A searchable list of every command, opened by a chord (default Mod+K). Choosing one closes it and runs it; an unavailable command is shown with its reason and does nothing. */
|
|
104
|
-
export declare function CommandMenu({ commands, open, onOpenChange, shortcut, label, platform }: CommandMenuProps): React.JSX.Element;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Loudness } from '../lib/loudness';
|
|
2
|
-
import { AudioMedia, Candidate } from './compare';
|
|
3
|
-
import { Shortcut } from './hotkeys';
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
/** Props for `CompareAudio`. */
|
|
6
|
-
export type CompareAudioProps = {
|
|
7
|
-
/** Names the comparison for screen readers. Required. */
|
|
8
|
-
label: string;
|
|
9
|
-
a: Candidate<AudioMedia>;
|
|
10
|
-
b: Candidate<AudioMedia>;
|
|
11
|
-
/** Whether the person must not learn which clip is which. Required, no default. */
|
|
12
|
-
blind: boolean;
|
|
13
|
-
/** The words shown when a clip cannot be loaded: "Clip not found". Required. */
|
|
14
|
-
missing: string;
|
|
15
|
-
/** Turn the louder clip down to the quieter one. Default true. */
|
|
16
|
-
levelMatch?: boolean;
|
|
17
|
-
/** How a switch carries the playhead over: the same time, the same share of the clip, or by share when the lengths differ by more than 2%. Default "auto". */
|
|
18
|
-
align?: "time" | "proportion" | "auto";
|
|
19
|
-
/** Measures a clip's level. Default decodes it in the browser. */
|
|
20
|
-
measure?: (src: string) => Promise<Loudness>;
|
|
21
|
-
/** Bind the keys on the window. Default true. */
|
|
22
|
-
keys?: boolean;
|
|
23
|
-
/** Shortcuts of the surrounding screen, bound with these and listed first in the same legend. */
|
|
24
|
-
extraShortcuts?: Shortcut[];
|
|
25
|
-
/** Drawn under the controls, above the legend: where a vote bar goes. */
|
|
26
|
-
footer?: React.ReactNode;
|
|
27
|
-
className?: string;
|
|
28
|
-
};
|
|
29
|
-
/** Two clips to judge by ear: one transport, a switch that keeps the playhead, a loop, and matched levels. */
|
|
30
|
-
export declare function CompareAudio({ label, a, b, blind, missing, levelMatch, align, measure, keys, extraShortcuts, footer, className }: CompareAudioProps): React.JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Candidate } from './compare';
|
|
2
|
-
import { Region } from '../lib/viewport';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
/** Props for `CompareGrid`. */
|
|
5
|
-
export type CompareGridProps = {
|
|
6
|
-
/** Names the grid for screen readers: "Four versions of this photo". Required. */
|
|
7
|
-
label: string;
|
|
8
|
-
items: readonly Candidate[];
|
|
9
|
-
/** Whether the person must not learn which variant is which: tiles are named by label only. Required, no default. */
|
|
10
|
-
blind: boolean;
|
|
11
|
-
/** The words shown where a picture could not be loaded. Required. */
|
|
12
|
-
missing: string;
|
|
13
|
-
/** What goes under a tile's caption: a button to compare it, a choice, a flag. */
|
|
14
|
-
actions?: (item: Candidate) => React.ReactNode;
|
|
15
|
-
/** Tiles per row at full width. Default 3. A narrow screen uses fewer. */
|
|
16
|
-
columns?: 2 | 3 | 4;
|
|
17
|
-
/** Named boxes to look at enlarged in every tile at once, as in `Compare`: chips, keys `q` `w` `e` `r` `y` `u`, nearest-neighbour while one is shown, Shift-drag to make another. */
|
|
18
|
-
regions?: readonly Region[];
|
|
19
|
-
/** Bind the zoom and full-screen keys on the window. Default true. */
|
|
20
|
-
keys?: boolean;
|
|
21
|
-
className?: string;
|
|
22
|
-
};
|
|
23
|
-
/** Many pictures in a grid, zoomed and panned together, and full screen. */
|
|
24
|
-
export declare function CompareGrid({ label, items, blind, missing, actions, columns, regions, keys, className }: CompareGridProps): React.JSX.Element;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Viewport } from '../lib/viewport';
|
|
2
|
-
import { Shortcut } from './hotkeys';
|
|
3
|
-
import { Candidate } from './compare';
|
|
4
|
-
import { FramePick } from './viewport';
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
export declare const VIEWPORT_HEIGHT = "max(16rem, calc(100svh - 14rem))";
|
|
7
|
-
/** The least a frame is made, however little room is left: a pair this small can still be told apart. */
|
|
8
|
-
export declare const MIN_FIT = 120;
|
|
9
|
-
/** The tallest each row of frames may be so that all of `chrome` and `rows` rows fit in `space` pixels. Pure, so it is tested without a layout. */
|
|
10
|
-
export declare function fitFrames({ space, chrome, rows, min }: {
|
|
11
|
-
space: number;
|
|
12
|
-
chrome: number;
|
|
13
|
-
rows: number;
|
|
14
|
-
min?: number;
|
|
15
|
-
}): number;
|
|
16
|
-
/** Frame cap for what the caller asked for: a measured height for `"fit"` and in full screen (whatever the caller passed, so the frame fills what the controls leave), the guess for `"viewport"`, the caller's own length otherwise. */
|
|
17
|
-
export declare function frameCap(maxHeight: string | undefined, fit: number | null, full: boolean): string | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* How tall each frame may be for the pair and everything around it to fit the window (issue #229), measured, not
|
|
20
|
-
* guessed. In the page: the window's height from the top of `root` (as the page is at its top), less what `root` draws
|
|
21
|
-
* besides its frames (toolbar, captions, footer, legend: the bottom of its last child, not its height, which a stretched
|
|
22
|
-
* full-screen section would inflate), less what follows it (later siblings of it and of its ancestors, then `reserve` for
|
|
23
|
-
* padding and gaps the caller knows). In full screen: the window from the top of `root`, nothing after. Divided by the
|
|
24
|
-
* rows of frames (side by side is one row; below `sm` it is two) and floored at `MIN_FIT`. Frames are found by
|
|
25
|
-
* `data-viewport-frame`, so an app never queries for them. Null until measured, or when `enabled` is false.
|
|
26
|
-
*/
|
|
27
|
-
export declare function useFitHeight(root: React.RefObject<HTMLElement | null>, { enabled, full, reserve }: {
|
|
28
|
-
enabled: boolean;
|
|
29
|
-
full: boolean;
|
|
30
|
-
reserve?: number;
|
|
31
|
-
}): number | null;
|
|
32
|
-
/** Words for click to choose, in the product's voice. */
|
|
33
|
-
export type PickWords = {
|
|
34
|
-
/** What hovering a side says, and what the frame is described as: `(label) => "Click to choose " + label`. */
|
|
35
|
-
choose?: (label: string) => string;
|
|
36
|
-
/** Said under the view's controls in a view where a click cannot choose (fade, difference): `(view) => ...`. */
|
|
37
|
-
unavailable?: (view: string) => string;
|
|
38
|
-
};
|
|
39
|
-
/** What a pair's frames do with a click (issue #201): the same answer as the keys, only where a click is unambiguous. Blind: only a candidate's `label` is ever said. */
|
|
40
|
-
export declare function makePicker(a: Candidate<unknown>, b: Candidate<unknown>, onPick: (side: "a" | "b") => void, words?: PickWords): {
|
|
41
|
-
/** A frame that is one whole side. */
|
|
42
|
-
one(side: "a" | "b"): FramePick;
|
|
43
|
-
/** A frame cut by a swipe divider at `divider` percent: the left is A, the right is B. */
|
|
44
|
-
split(divider: number): FramePick;
|
|
45
|
-
unavailable: (view: string) => string;
|
|
46
|
-
};
|
|
47
|
-
/** A word for a picture's name on the page: its label, with its note unless blind. */
|
|
48
|
-
export declare function Caption({ c, blind }: {
|
|
49
|
-
c: Candidate<unknown>;
|
|
50
|
-
blind: boolean;
|
|
51
|
-
}): React.JSX.Element;
|
|
52
|
-
/** One picture inside a frame: a skeleton while it loads, the product's words if it fails. */
|
|
53
|
-
export declare function Picture({ c, blind, missing, onNatural, imgRef, pixelated }: {
|
|
54
|
-
c: Candidate;
|
|
55
|
-
blind: boolean;
|
|
56
|
-
missing: string;
|
|
57
|
-
onNatural?: (w: number, h: number) => void;
|
|
58
|
-
imgRef?: React.Ref<HTMLImageElement>;
|
|
59
|
-
pixelated?: boolean;
|
|
60
|
-
}): React.JSX.Element;
|
|
61
|
-
type ZoomProps = {
|
|
62
|
-
viewport: Viewport;
|
|
63
|
-
setViewport: (next: Viewport) => void;
|
|
64
|
-
/** The frame whose size zoom is measured against. */
|
|
65
|
-
frame: React.RefObject<HTMLElement | null>;
|
|
66
|
-
/** The picture's natural size, if known, for 1:1. */
|
|
67
|
-
natural: readonly [number, number] | null;
|
|
68
|
-
};
|
|
69
|
-
/** Zoom steps about the frame's centre, and 1:1. */
|
|
70
|
-
export declare function useZoom({ viewport, setViewport, frame, natural }: ZoomProps): {
|
|
71
|
-
by: (k: number) => void;
|
|
72
|
-
actual: () => void;
|
|
73
|
-
fit: () => void;
|
|
74
|
-
};
|
|
75
|
-
/** The shortcuts for zoom and full screen, to join a screen's own list. */
|
|
76
|
-
export declare function zoomShortcuts(zoom: ReturnType<typeof useZoom>, full: boolean, setFull: (f: boolean) => void): Shortcut[];
|
|
77
|
-
/** Zoom out, in, fit, 1:1 and the zoom now, for inside a `Toolbar`. */
|
|
78
|
-
export declare function ZoomControls({ viewport, zoom, natural }: {
|
|
79
|
-
viewport: Viewport;
|
|
80
|
-
zoom: ReturnType<typeof useZoom>;
|
|
81
|
-
natural: readonly [number, number] | null;
|
|
82
|
-
}): React.JSX.Element;
|
|
83
|
-
/** The full-screen button, for inside a `Toolbar`. */
|
|
84
|
-
export declare function FullscreenButton({ full, setFull }: {
|
|
85
|
-
full: boolean;
|
|
86
|
-
setFull: (f: boolean) => void;
|
|
87
|
-
}): React.JSX.Element;
|
|
88
|
-
/** The width of an element, kept current: for "is this shown larger than its own pixels". */
|
|
89
|
-
export declare function useWidth(ref: React.RefObject<HTMLElement | null>): number;
|
|
90
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Region, ShareBox, Viewport } from '../lib/viewport';
|
|
2
|
-
import { Shortcut } from './hotkeys';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
/** What a view needs to show regions. */
|
|
5
|
-
export type RegionState = {
|
|
6
|
-
/** The given regions, then the ones drawn by hand. */
|
|
7
|
-
regions: readonly Region[];
|
|
8
|
-
/** The chosen region's id, `null` for the whole frame or any other zoom. */
|
|
9
|
-
active: string | null;
|
|
10
|
-
/** Choose a region (fill the frame with it) or `null` for the whole frame. */
|
|
11
|
-
choose: (id: string | null) => void;
|
|
12
|
-
/** Wrap the view's own `setViewport`, so a zoom or pan by hand clears the chosen region. */
|
|
13
|
-
setViewport: (next: Viewport) => void;
|
|
14
|
-
/** A box drawn by hand, as a new region. */
|
|
15
|
-
add: (rect: {
|
|
16
|
-
x0: number;
|
|
17
|
-
y0: number;
|
|
18
|
-
x1: number;
|
|
19
|
-
y1: number;
|
|
20
|
-
}) => void;
|
|
21
|
-
/** The box to outline on the whole frame (the chip being pointed at). */
|
|
22
|
-
peek: ShareBox | null;
|
|
23
|
-
setPeek: (id: string | null) => void;
|
|
24
|
-
shortcuts: Shortcut[];
|
|
25
|
-
};
|
|
26
|
-
/** Regions for one item: `reset` is a key that changes with the item, which drops the regions drawn by hand. */
|
|
27
|
-
export declare function useRegions({ regions, viewport, setViewport, frame, reset }: {
|
|
28
|
-
regions?: readonly Region[];
|
|
29
|
-
viewport: Viewport;
|
|
30
|
-
setViewport: (v: Viewport) => void;
|
|
31
|
-
frame: React.RefObject<HTMLElement | null>;
|
|
32
|
-
reset: string;
|
|
33
|
-
}): RegionState;
|
|
34
|
-
/** The chip strip: the whole frame and each region, one chosen. Renders nothing when there are no regions. */
|
|
35
|
-
export declare function RegionChips({ state }: {
|
|
36
|
-
state: RegionState;
|
|
37
|
-
}): React.JSX.Element | null;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Candidate, TextMedia } from './compare';
|
|
2
|
-
import { Shortcut } from './hotkeys';
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
/** Props for `CompareText`. */
|
|
5
|
-
export type CompareTextProps = {
|
|
6
|
-
/** Names the comparison for screen readers. Required. */
|
|
7
|
-
label: string;
|
|
8
|
-
a: Candidate<TextMedia>;
|
|
9
|
-
b: Candidate<TextMedia>;
|
|
10
|
-
/** Whether the person must not learn which text is which. Required, no default. */
|
|
11
|
-
blind: boolean;
|
|
12
|
-
/** A ground-truth text, shown above both; the diff starts against it, and can be switched to the other candidate. */
|
|
13
|
-
reference?: {
|
|
14
|
-
label: string;
|
|
15
|
-
text: string;
|
|
16
|
-
};
|
|
17
|
-
/** Start with the word differences marked. Default false. */
|
|
18
|
-
defaultDiff?: boolean;
|
|
19
|
-
/** Said when the pair is too long to compare word by word. Default says so plainly. */
|
|
20
|
-
tooLong?: string;
|
|
21
|
-
/** Scroll the two panes together. Default true. */
|
|
22
|
-
linkedScroll?: boolean;
|
|
23
|
-
/** Bind the keys (`d` marks the differences) on the window. Default true. */
|
|
24
|
-
keys?: boolean;
|
|
25
|
-
/** Shortcuts of the surrounding screen (a `PairJudge`'s answer keys), bound with these and listed first in the same legend. */
|
|
26
|
-
extraShortcuts?: Shortcut[];
|
|
27
|
-
/** Drawn under the texts, above the legend: where a vote bar goes. */
|
|
28
|
-
footer?: React.ReactNode;
|
|
29
|
-
className?: string;
|
|
30
|
-
};
|
|
31
|
-
/** Two texts side by side with scrolling together, an optional reference, and a word diff on request. */
|
|
32
|
-
export declare function CompareText({ label, a, b, blind, reference, defaultDiff, tooLong, linkedScroll, keys, extraShortcuts, footer, className }: CompareTextProps): React.JSX.Element;
|