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/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { i as typeSteps, n as KeyText, r as cn, t as Tooltip } from "./tooltip-
|
|
2
|
-
import { a as Textarea, c as useSearchParam, d as createFormat, f as format, i as NativeSelect, l as MISSING, n as Field, o as useFieldControl, p as toDate, r as Input, s as controlHeight, t as ChoiceGroup, u as NBSP } from "./field-
|
|
3
|
-
import { a as isDev, i as buttonVariants, n as IconButton, o as useInView, r as RowAction, t as Button } from "./button-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
1
|
+
import { i as typeSteps, n as KeyText, r as cn, t as Tooltip } from "./tooltip-BosfsWYh.js";
|
|
2
|
+
import { a as Textarea, c as useSearchParam, d as createFormat, f as format, i as NativeSelect, l as MISSING, n as Field, o as useFieldControl, p as toDate, r as Input, s as controlHeight, t as ChoiceGroup, u as NBSP } from "./field-DBCsFIng.js";
|
|
3
|
+
import { a as isDev, i as buttonVariants, n as IconButton, o as useInView, r as RowAction, t as Button } from "./button-CYXjU-fs.js";
|
|
4
|
+
import { t as followAim } from "./follow-CXQsL86O.js";
|
|
5
|
+
import { n as useViewPointers, r as useWheelZoom, t as useSettledStatus } from "./viewer-input-3Qa-o35k.js";
|
|
6
|
+
import { A as StrataQueryProvider, C as toast, D as LoadError, E as EmptyState, F as useLoad, I as usePoll, L as overlaySurface, M as fetchJson, N as staleOf, O as Skeleton, P as toLoad, S as StrataToastRegion, T as DataView$1, _ as clampViewport, a as useMicrophone, b as viewportTransform, d as zoomToBox, f as FIT, g as boxViewport, h as actualPixelsScale, i as explainMicrophoneError, j as createQueryClient, k as StaleNotice, l as readingOrder, m as MIN_SCALE, n as MicrophoneError, o as Thumbnail, p as MAX_SCALE, r as browserMicrophone, s as ThumbnailSkeleton, t as MicrophoneContext, u as regionStyle, v as frameBoxToShares, w as toastTimeout, x as zoomAt, y as regionShares } from "./microphone-76skMt6i.js";
|
|
7
|
+
import { a as useAsyncAction, c as KeysLegend, d as useHotkeys, i as AsyncButton, l as isTypingTarget, n as NumberField, o as Toolbar, r as Slider, s as ToolbarSeparator, t as ColorField, u as keyName } from "./value-controls-5u7sD_wG.js";
|
|
8
|
+
import { n as useSharedCursor, r as geo, t as CursorScope } from "./cursor-Cwyvgwsw.js";
|
|
9
|
+
import { a as fieldErrorsOf, i as errorPayload, n as describeActionError, o as readErrorBody, r as describeHttpError, t as HttpError } from "./errors-CmuwcWlb.js";
|
|
10
|
+
import { a as PaletteChoice, c as paletteScript, d as usePalette, f as useSystemColorScheme, i as PALETTE_STORAGE_KEY, l as palettes, n as ColorSchemeChoice, o as ThemeProvider, p as Density, r as DEFAULT_PALETTE, s as colorSchemeScript, t as COLOR_SCHEME_STORAGE_KEY, u as useColorScheme } from "./theme-1oOSMj_D.js";
|
|
9
11
|
import * as React from "react";
|
|
10
12
|
import { Autocomplete, Button as Button$1, Cell, Checkbox as Checkbox$1, Collection, Column, Dialog as Dialog$1, DialogTrigger, Disclosure as Disclosure$1, DisclosurePanel, DropIndicator, DropZone, FileTrigger, GridLayout, GridList, GridListItem, Header, Heading, Input as Input$1, Keyboard, Link, ListBox, ListBoxItem, ListLayout, ListStateContext, Menu as Menu$1, MenuItem, MenuSection, MenuTrigger, Modal, ModalOverlay, Popover as Popover$1, RouterProvider, Row, SearchField, Select, SelectValue, Separator, Slider as Slider$1, SliderThumb, SliderTrack, SubmenuTrigger, Switch as Switch$1, Tab, TabList, TabPanel, Table, TableBody, TableHeader, TableLayout, Tabs as Tabs$1, Text, ToggleButton, ToggleButtonGroup, Tree as Tree$1, TreeItem, TreeItemContent, Virtualizer, useDragAndDrop, useFilter } from "react-aria-components";
|
|
11
13
|
import { ArrowDown, ArrowUp, ArrowUpDown, ArrowUpRight, Ban, Check, ChevronDown, ChevronLeft, ChevronRight, CircleAlert, CircleCheck, CircleDashed, Clock, CloudOff, Columns2, Ellipsis, Eye, EyeOff, FastForward, FileQuestion, Flag, Folder, FolderOpen, FolderX, GripVertical, ImageOff, Info, KeyRound, LayoutGrid, List, Loader, LoaderCircle, Lock, Maximize, Maximize2, Minimize, Minus, PanelBottomClose, PanelBottomOpen, PanelLeftClose, PanelLeftOpen, PanelRightClose, PanelRightOpen, PanelTopClose, PanelTopOpen, Pause, Pencil, Play, Redo2, Rewind, RotateCcw, RotateCw, Scan, Search, Send, SkipBack, SkipForward, SlidersHorizontal, Square, StepBack, StepForward, Trash2, TriangleAlert, Undo2, Upload, Volume2, VolumeX, X, ZoomIn, ZoomOut } from "lucide-react";
|
|
@@ -16,6 +18,7 @@ import { createSortedRowModel, flexRender, rowSortingFeature, tableFeatures, use
|
|
|
16
18
|
import { UNSAFE_PortalProvider, VisuallyHidden, mergeProps, useDrag, useDrop, useFocusRing, useMove, useSlider, useSliderThumb, useUNSAFE_PortalContext } from "react-aria";
|
|
17
19
|
import { LayoutInfo, Rect, Size, useSliderState } from "react-stately";
|
|
18
20
|
import pixelmatch from "pixelmatch";
|
|
21
|
+
|
|
19
22
|
// src/lib/chords.ts
|
|
20
23
|
/** The platform this page runs on, read from the browser (`mac` for macOS and iOS). Server and test default: `other`. */
|
|
21
24
|
function detectPlatform() {
|
|
@@ -38,7 +41,7 @@ function parseChord(chord, platform = detectPlatform()) {
|
|
|
38
41
|
key
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
|
-
|
|
44
|
+
const symbol = (key) => key.length === 1 && key.toUpperCase() === key.toLowerCase();
|
|
42
45
|
/** Whether a key event is this chord. Exact on Ctrl, Meta and Alt; Shift is exact for letters and named keys. */
|
|
43
46
|
function matchesChord(e, chord, platform = detectPlatform()) {
|
|
44
47
|
const c = parseChord(chord, platform);
|
|
@@ -48,7 +51,7 @@ function matchesChord(e, chord, platform = detectPlatform()) {
|
|
|
48
51
|
if (e.key.toLowerCase() === c.key.toLowerCase()) return true;
|
|
49
52
|
return c.alt && /^[a-z]$/i.test(c.key) && e.code === `Key${c.key.toUpperCase()}`;
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
const NAMES = {
|
|
52
55
|
ArrowUp: {
|
|
53
56
|
mac: "↑",
|
|
54
57
|
other: "↑"
|
|
@@ -111,7 +114,7 @@ function formatChord(chord, platform = detectPlatform()) {
|
|
|
111
114
|
key
|
|
112
115
|
].filter(Boolean).join("+");
|
|
113
116
|
}
|
|
114
|
-
|
|
117
|
+
const RESERVED = [
|
|
115
118
|
"Mod+S",
|
|
116
119
|
"Mod+P",
|
|
117
120
|
"Mod+F",
|
|
@@ -144,12 +147,13 @@ function isReservedChord(chord, platform = detectPlatform()) {
|
|
|
144
147
|
return p.ctrl === c.ctrl && p.meta === c.meta && p.alt === c.alt && p.shift === c.shift && p.key.toLowerCase() === c.key.toLowerCase();
|
|
145
148
|
});
|
|
146
149
|
}
|
|
150
|
+
|
|
147
151
|
// src/components/commands.tsx
|
|
148
152
|
/** The text of a command's label, whether it is a string or a function. */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
const labelOf = (c) => typeof c.label === "function" ? c.label() : c.label;
|
|
154
|
+
const isDisabled = (c) => Boolean(c.disabled);
|
|
155
|
+
const reasonOf = (c) => typeof c.disabled === "string" ? c.disabled : void 0;
|
|
156
|
+
const isCommand = (e) => typeof e === "object" && "run" in e;
|
|
153
157
|
/**
|
|
154
158
|
* Binds every command's chords on the window. Never while typing (unless the command says
|
|
155
159
|
* `inFields`), never during IME composition, not on a held key (unless `repeat`), not for a disabled
|
|
@@ -212,7 +216,7 @@ function CommandLegend({ commands, platform, label = "Keyboard shortcuts", class
|
|
|
212
216
|
}, c.id))
|
|
213
217
|
});
|
|
214
218
|
}
|
|
215
|
-
|
|
219
|
+
const itemClass = cn("flex min-h-(--control-h-sm) cursor-pointer items-center gap-2 rounded-control px-2 type-body-sm outline-none", "focus:bg-muted disabled:cursor-not-allowed disabled:text-muted-foreground disabled:opacity-70", "open:bg-muted");
|
|
216
220
|
function Item({ command, platform }) {
|
|
217
221
|
const Icon = command.icon ?? (command.destructive ? Trash2 : void 0);
|
|
218
222
|
const shortcut = commandShortcut(command, platform);
|
|
@@ -296,7 +300,7 @@ function Entries({ entries, platform }) {
|
|
|
296
300
|
})] }, `sub-${entry.submenu}`);
|
|
297
301
|
}) });
|
|
298
302
|
}
|
|
299
|
-
|
|
303
|
+
const surface = cn("layer-overlay min-w-48 p-1", overlaySurface);
|
|
300
304
|
/** 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. */
|
|
301
305
|
function Menu({ label, trigger, items, open, onOpenChange, platform, className }) {
|
|
302
306
|
const where = platform ?? detectPlatform();
|
|
@@ -451,9 +455,10 @@ function CommandMenu({ commands, open, onOpenChange, shortcut = "Mod+K", label =
|
|
|
451
455
|
})
|
|
452
456
|
});
|
|
453
457
|
}
|
|
458
|
+
|
|
454
459
|
// src/components/toggle.tsx
|
|
455
|
-
|
|
456
|
-
|
|
460
|
+
const base = "inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control border type-label transition-state press [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-input bg-background text-muted-foreground hover:bg-muted hover:text-foreground selected:border-foreground selected:bg-muted selected:text-foreground disabled:pointer-events-none disabled:opacity-50";
|
|
461
|
+
const sizes$1 = {
|
|
457
462
|
default: "h-(--control-h)",
|
|
458
463
|
sm: "h-(--control-h-sm)"
|
|
459
464
|
};
|
|
@@ -534,6 +539,7 @@ function ToggleGroupView({ label, options, value, onChange, size = "default", cl
|
|
|
534
539
|
})
|
|
535
540
|
});
|
|
536
541
|
}
|
|
542
|
+
|
|
537
543
|
// src/components/pause-button.tsx
|
|
538
544
|
/** The pause control of a polled screen: a "Pause updates" toggle and when the readings were last taken ("Updated 12:00"). Takes the `Poll` from `usePoll`. */
|
|
539
545
|
function PauseButton({ poll, hideUpdated = false, className }) {
|
|
@@ -554,6 +560,7 @@ function PauseButton({ poll, hideUpdated = false, className }) {
|
|
|
554
560
|
})]
|
|
555
561
|
});
|
|
556
562
|
}
|
|
563
|
+
|
|
557
564
|
// src/components/switch.tsx
|
|
558
565
|
/** An on/off setting that applies at once, its label and control one target. */
|
|
559
566
|
function Switch({ label, detail, on, defaultOn, onChange, disabled, className }) {
|
|
@@ -587,8 +594,9 @@ function Switch({ label, detail, on, defaultOn, onChange, disabled, className })
|
|
|
587
594
|
})]
|
|
588
595
|
});
|
|
589
596
|
}
|
|
597
|
+
|
|
590
598
|
// src/components/dialog.tsx
|
|
591
|
-
|
|
599
|
+
const sizes = {
|
|
592
600
|
sm: "max-w-sm",
|
|
593
601
|
md: "max-w-lg",
|
|
594
602
|
lg: "max-w-3xl",
|
|
@@ -626,7 +634,7 @@ function Driven({ open, onOpenChange, children }) {
|
|
|
626
634
|
onOpenChange
|
|
627
635
|
});
|
|
628
636
|
}
|
|
629
|
-
|
|
637
|
+
const overlayClass = "layer-overlay fixed inset-0 grid overflow-hidden scrim";
|
|
630
638
|
/** A modal dialog with a required title; focus goes in and returns, Escape and a close control dismiss it. `placement="end"` makes it a sheet. */
|
|
631
639
|
function Dialog({ title, description, trigger, open, onOpenChange, className, children, actions, hideTitle, closable = true, placement = "center", size = "md" }) {
|
|
632
640
|
const descriptionId = React.useId();
|
|
@@ -760,8 +768,9 @@ function AlertDialog({ title, description, trigger, open, onOpenChange, classNam
|
|
|
760
768
|
})
|
|
761
769
|
});
|
|
762
770
|
}
|
|
771
|
+
|
|
763
772
|
// src/components/popover.tsx
|
|
764
|
-
|
|
773
|
+
const widths = {
|
|
765
774
|
sm: "w-52",
|
|
766
775
|
md: "w-72",
|
|
767
776
|
lg: "w-96"
|
|
@@ -784,6 +793,7 @@ function Popover({ label, trigger, children, side = "bottom", align = "start", o
|
|
|
784
793
|
})]
|
|
785
794
|
});
|
|
786
795
|
}
|
|
796
|
+
|
|
787
797
|
// src/components/checkbox.tsx
|
|
788
798
|
/** A checkbox and its label as one target. `label` is required; `hideLabel` keeps it as the accessible name only. */
|
|
789
799
|
function Checkbox({ label, hideLabel = false, detail, checked, onCheckedChange, className, disabled, required, ...props }) {
|
|
@@ -874,8 +884,9 @@ function TableSelectionCheckbox({ label, className, disabled, mixed }) {
|
|
|
874
884
|
})
|
|
875
885
|
});
|
|
876
886
|
}
|
|
887
|
+
|
|
877
888
|
// src/components/status.tsx
|
|
878
|
-
|
|
889
|
+
const tones$1 = {
|
|
879
890
|
neutral: "bg-muted text-muted-foreground",
|
|
880
891
|
info: "bg-info-subtle text-info",
|
|
881
892
|
success: "bg-success-subtle text-success",
|
|
@@ -892,6 +903,7 @@ function Status({ tone, icon: Icon, children, className }) {
|
|
|
892
903
|
}), children]
|
|
893
904
|
});
|
|
894
905
|
}
|
|
906
|
+
|
|
895
907
|
// src/components/metric.tsx
|
|
896
908
|
/** Headline figures as one description list split by hairlines. Holds `Metric`s. */
|
|
897
909
|
function MetricStrip({ label, children, className }) {
|
|
@@ -924,12 +936,13 @@ function Metric({ label, value, unit, note }) {
|
|
|
924
936
|
]
|
|
925
937
|
});
|
|
926
938
|
}
|
|
939
|
+
|
|
927
940
|
// src/components/meter.tsx
|
|
928
941
|
/** The threshold a share has crossed, if any: the most severe one reached in the worse direction. */
|
|
929
942
|
function crossedThreshold(share, thresholds = [], worseWhen = "higher") {
|
|
930
943
|
return thresholds.filter((t) => worseWhen === "higher" ? share >= t.at : share <= t.at).sort((a, b) => worseWhen === "higher" ? b.at - a.at : a.at - b.at)[0];
|
|
931
944
|
}
|
|
932
|
-
|
|
945
|
+
const fills = {
|
|
933
946
|
warning: "var(--warning)",
|
|
934
947
|
danger: "var(--danger)"
|
|
935
948
|
};
|
|
@@ -1010,6 +1023,7 @@ function Meter({ label, value, max = 1, valueText, detail, thresholds, worseWhen
|
|
|
1010
1023
|
]
|
|
1011
1024
|
});
|
|
1012
1025
|
}
|
|
1026
|
+
|
|
1013
1027
|
// src/lib/base.ts
|
|
1014
1028
|
/**
|
|
1015
1029
|
* Where the app is mounted: the path of the page's `<base href>` without its trailing slash, `""` at the root or where there is no base (SSR, a plain page).
|
|
@@ -1026,8 +1040,9 @@ function appBase(doc = typeof document === "undefined" ? void 0 : document) {
|
|
|
1026
1040
|
function withBase(path, base = appBase()) {
|
|
1027
1041
|
return path.startsWith("/") && !path.startsWith("//") ? base + path : path;
|
|
1028
1042
|
}
|
|
1043
|
+
|
|
1029
1044
|
// src/query/api.ts
|
|
1030
|
-
|
|
1045
|
+
const isRaw = (body) => typeof Blob !== "undefined" && body instanceof Blob || body instanceof ArrayBuffer || ArrayBuffer.isView(body) || typeof FormData !== "undefined" && body instanceof FormData || body instanceof URLSearchParams || typeof ReadableStream !== "undefined" && body instanceof ReadableStream;
|
|
1031
1046
|
/**
|
|
1032
1047
|
* A small client over `fetchJson` for the app's own server: root-relative paths get the app's base (so it works behind a reverse proxy),
|
|
1033
1048
|
* and `post`, `put` and `patch` send their body as JSON (a `Blob`, bytes, `FormData` or a stream is sent as it is, with the Blob's own type). `api.post<Learner>("/api/learners", { nickname })`.
|
|
@@ -1048,6 +1063,7 @@ function createApi({ base, ...options } = {}) {
|
|
|
1048
1063
|
delete: (path, init) => send("DELETE", path, void 0, init)
|
|
1049
1064
|
};
|
|
1050
1065
|
}
|
|
1066
|
+
|
|
1051
1067
|
// src/query/typed-api.ts
|
|
1052
1068
|
function fill(path, values, query) {
|
|
1053
1069
|
const filled = path.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
@@ -1081,6 +1097,7 @@ function createTypedApi(options = {}) {
|
|
|
1081
1097
|
delete: call("delete")
|
|
1082
1098
|
};
|
|
1083
1099
|
}
|
|
1100
|
+
|
|
1084
1101
|
// src/query/infinite.ts
|
|
1085
1102
|
/** `useInfiniteQuery` for cursor-paged data, returned as an `InfiniteLoad<T>` for `InfiniteList` (or `DataView`). */
|
|
1086
1103
|
function useInfiniteLoad({ queryKey, queryFn, items, itemKey, hasMore = () => false, nextCursor, cursorAfter = itemKey, isRemoved, describeError = describeHttpError, enabled, staleTime }) {
|
|
@@ -1178,7 +1195,7 @@ function useInfiniteLoad({ queryKey, queryFn, items, itemKey, hasMore = () => fa
|
|
|
1178
1195
|
...extra
|
|
1179
1196
|
};
|
|
1180
1197
|
}
|
|
1181
|
-
|
|
1198
|
+
const none = /* @__PURE__ */ new Set();
|
|
1182
1199
|
/** Every page's items, in order, once each by key: the ones held (not dismissed) and the last one seen. */
|
|
1183
1200
|
function merge(pages, items, itemKey, hidden) {
|
|
1184
1201
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1214,6 +1231,7 @@ function apiPage() {
|
|
|
1214
1231
|
nextCursor: (page) => page.next
|
|
1215
1232
|
};
|
|
1216
1233
|
}
|
|
1234
|
+
|
|
1217
1235
|
// src/query/job.ts
|
|
1218
1236
|
/** A long-running job's status: polled every `every` ms while `isRunning`, with the `invalidates` queries read again once when it ends. */
|
|
1219
1237
|
function useJob({ isRunning, every = 2e3, invalidates = [], describeError, ...options }) {
|
|
@@ -1248,6 +1266,7 @@ function useJob({ isRunning, every = 2e3, invalidates = [], describeError, ...op
|
|
|
1248
1266
|
function isTaskRunning(task, finished) {
|
|
1249
1267
|
return !(Array.isArray(finished) ? finished.includes(task.state) : finished.has(task.state));
|
|
1250
1268
|
}
|
|
1269
|
+
|
|
1251
1270
|
// src/query/workflow.ts
|
|
1252
1271
|
/** Whether the queue job advancing a workflow run is still going. `finished` is the generated `FINISHED` (or `["done", "failed", "cancelled"]`). */
|
|
1253
1272
|
function isWorkflowRunning(run, finished) {
|
|
@@ -1260,9 +1279,10 @@ function useWorkflowRun({ finished, ...options }) {
|
|
|
1260
1279
|
isRunning: (run) => isWorkflowRunning(run, finished)
|
|
1261
1280
|
});
|
|
1262
1281
|
}
|
|
1282
|
+
|
|
1263
1283
|
// src/components/system-panel.tsx
|
|
1264
1284
|
/** The shared limits for a folder's disk, as shares of its size: filling up at 80%, nearly full at 95%. */
|
|
1265
|
-
|
|
1285
|
+
const diskThresholds = [{
|
|
1266
1286
|
at: .8,
|
|
1267
1287
|
tone: "warning",
|
|
1268
1288
|
label: "Filling up"
|
|
@@ -1441,7 +1461,11 @@ function SystemPanel({ load, thresholds = diskThresholds, facts = [], now, headi
|
|
|
1441
1461
|
term: "Started",
|
|
1442
1462
|
children: [format.dateTime(s.started_at), /* @__PURE__ */ jsxs("span", {
|
|
1443
1463
|
className: "ml-2 text-muted-foreground tabular-nums",
|
|
1444
|
-
children: [
|
|
1464
|
+
children: [
|
|
1465
|
+
"up",
|
|
1466
|
+
" ",
|
|
1467
|
+
format.duration(((now ?? /* @__PURE__ */ new Date()).getTime() - new Date(s.started_at).getTime()) / 1e3, { style: "parts" })
|
|
1468
|
+
]
|
|
1445
1469
|
})]
|
|
1446
1470
|
}),
|
|
1447
1471
|
/* @__PURE__ */ jsx(Fact, {
|
|
@@ -1490,8 +1514,9 @@ function SystemPanel({ load, thresholds = diskThresholds, facts = [], now, headi
|
|
|
1490
1514
|
})
|
|
1491
1515
|
});
|
|
1492
1516
|
}
|
|
1517
|
+
|
|
1493
1518
|
// src/components/composition.tsx
|
|
1494
|
-
|
|
1519
|
+
const MAX_TOKENS = 5;
|
|
1495
1520
|
/** Keeps the four largest parts in their given order and sums the rest into one last part. */
|
|
1496
1521
|
function foldParts(parts, label) {
|
|
1497
1522
|
if (parts.length <= MAX_TOKENS) return parts;
|
|
@@ -1628,6 +1653,7 @@ function CompositionBar({ label, parts, formatValue, formatShare = format.share,
|
|
|
1628
1653
|
]
|
|
1629
1654
|
});
|
|
1630
1655
|
}
|
|
1656
|
+
|
|
1631
1657
|
// src/components/link-card.tsx
|
|
1632
1658
|
/** True when `href` is on another origin than the page (a relative one never is). Unreadable is treated as leaving. */
|
|
1633
1659
|
function leavesSite(href) {
|
|
@@ -1689,8 +1715,9 @@ function LinkCardList({ label, children, className }) {
|
|
|
1689
1715
|
}, React.isValidElement(child) && child.key != null ? child.key : i))
|
|
1690
1716
|
});
|
|
1691
1717
|
}
|
|
1718
|
+
|
|
1692
1719
|
// src/components/secret-field.tsx
|
|
1693
|
-
|
|
1720
|
+
const input = "w-full min-w-0 rounded-control border border-input bg-background pl-3 pr-1 type-body text-foreground transition-state placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-70 aria-invalid:border-danger";
|
|
1694
1721
|
/** A credential the server keeps and never shows again: "Not set", "Set" (no characters, not even its length), a masked entry with a named Show toggle, Replace, a confirmed Remove that says what stops working, and a Test with its result beside it. A set, untouched field reports nothing. */
|
|
1695
1722
|
function SecretField({ noun, isSet, setAt, onChange, onSave, onRemove, consequence, test, disabled, id: idProp, name, className }) {
|
|
1696
1723
|
const { field } = useFieldControl();
|
|
@@ -1866,8 +1893,9 @@ function SecretField({ noun, isSet, setAt, onChange, onSave, onRemove, consequen
|
|
|
1866
1893
|
})]
|
|
1867
1894
|
});
|
|
1868
1895
|
}
|
|
1896
|
+
|
|
1869
1897
|
// src/components/alert.tsx
|
|
1870
|
-
|
|
1898
|
+
const tones = {
|
|
1871
1899
|
info: {
|
|
1872
1900
|
box: "bg-info-subtle text-info",
|
|
1873
1901
|
icon: Info
|
|
@@ -1914,6 +1942,7 @@ function Alert({ tone, title, children, action, announce = false, className }) {
|
|
|
1914
1942
|
]
|
|
1915
1943
|
});
|
|
1916
1944
|
}
|
|
1945
|
+
|
|
1917
1946
|
// src/components/player-warning.tsx
|
|
1918
1947
|
/** Creates a warning channel for one player. Pass `warning` to MediaPlayer and call `warn` when a warning occurs. */
|
|
1919
1948
|
function usePlayerWarnings() {
|
|
@@ -1989,6 +2018,7 @@ function PlayerWarningToast({ warning }) {
|
|
|
1989
2018
|
]
|
|
1990
2019
|
});
|
|
1991
2020
|
}
|
|
2021
|
+
|
|
1992
2022
|
// src/lib/client-work.ts
|
|
1993
2023
|
/** Runs browser-side work with progress, cancel and a clear end state, ready for `JobStatus`. */
|
|
1994
2024
|
function useClientWork(run) {
|
|
@@ -2047,13 +2077,14 @@ function useClientWork(run) {
|
|
|
2047
2077
|
dismiss
|
|
2048
2078
|
};
|
|
2049
2079
|
}
|
|
2080
|
+
|
|
2050
2081
|
// src/components/job-status.tsx
|
|
2051
2082
|
/** The sentence for a job's progress: "3 of 9 done, 6 remaining · Night Sky". */
|
|
2052
2083
|
function jobProgressText({ done, total, current }) {
|
|
2053
2084
|
const d = Math.min(total, Math.max(0, done));
|
|
2054
2085
|
return `${format.integer(d)} of ${format.integer(total)} done, ${format.integer(total - d)} remaining${current ? ` · ${current}` : ""}`;
|
|
2055
2086
|
}
|
|
2056
|
-
|
|
2087
|
+
const Spinner = ({ className, ...props }) => /* @__PURE__ */ jsx(LoaderCircle, {
|
|
2057
2088
|
...props,
|
|
2058
2089
|
className: cn(className, "motion-safe:animate-spin")
|
|
2059
2090
|
});
|
|
@@ -2162,6 +2193,7 @@ function JobStatus({ label, running, words, summary, progress, current: currentP
|
|
|
2162
2193
|
]
|
|
2163
2194
|
});
|
|
2164
2195
|
}
|
|
2196
|
+
|
|
2165
2197
|
// src/components/job-action.tsx
|
|
2166
2198
|
/** One call for a button that starts a server job: busy until the job ends, a queued toast linking to the jobs page, a finished toast with the result, and a failure to start shown on the button. */
|
|
2167
2199
|
function useJobAction({ start, job, queued, done, jobsHref, jobsLabel = "Show jobs", ...asyncOptions }) {
|
|
@@ -2237,8 +2269,9 @@ function useJobAction({ start, job, queued, done, jobsHref, jobsLabel = "Show jo
|
|
|
2237
2269
|
running: waiting && (running || action.phase === "pending")
|
|
2238
2270
|
};
|
|
2239
2271
|
}
|
|
2272
|
+
|
|
2240
2273
|
// src/components/workflow-steps.tsx
|
|
2241
|
-
|
|
2274
|
+
const DEFAULT_WORDS = {
|
|
2242
2275
|
done: "Done",
|
|
2243
2276
|
approved: "Approved",
|
|
2244
2277
|
ready: "Not started",
|
|
@@ -2247,7 +2280,7 @@ var DEFAULT_WORDS = {
|
|
|
2247
2280
|
waiting: "Needs review",
|
|
2248
2281
|
blocked: "Waiting"
|
|
2249
2282
|
};
|
|
2250
|
-
|
|
2283
|
+
const LOOKS$2 = {
|
|
2251
2284
|
done: {
|
|
2252
2285
|
tone: "success",
|
|
2253
2286
|
icon: Check
|
|
@@ -2399,7 +2432,7 @@ function summariseWorkflow(stages, { running = false } = {}) {
|
|
|
2399
2432
|
total
|
|
2400
2433
|
});
|
|
2401
2434
|
}
|
|
2402
|
-
|
|
2435
|
+
const SUMMARY_LOOKS = {
|
|
2403
2436
|
running: {
|
|
2404
2437
|
tone: "info",
|
|
2405
2438
|
icon: Clock,
|
|
@@ -2465,8 +2498,9 @@ function WorkflowSummary({ stages, running, words, className }) {
|
|
|
2465
2498
|
})]
|
|
2466
2499
|
});
|
|
2467
2500
|
}
|
|
2501
|
+
|
|
2468
2502
|
// src/lib/breakpoint.ts
|
|
2469
|
-
|
|
2503
|
+
const DEFAULTS = {
|
|
2470
2504
|
sm: "40rem",
|
|
2471
2505
|
md: "48rem",
|
|
2472
2506
|
lg: "64rem"
|
|
@@ -2494,6 +2528,7 @@ function useNarrowerThan(active) {
|
|
|
2494
2528
|
}, [active]);
|
|
2495
2529
|
return below;
|
|
2496
2530
|
}
|
|
2531
|
+
|
|
2497
2532
|
// src/lib/choice.ts
|
|
2498
2533
|
function resolve(explicit, implies) {
|
|
2499
2534
|
const all = new Set(explicit);
|
|
@@ -2545,6 +2580,7 @@ function noteFor({ added, dropped, refused }) {
|
|
|
2545
2580
|
if (refused > 0) parts.push(refused === 1 ? "1 stays chosen because something chosen depends on it" : `${refused} stay chosen because something chosen depends on them`);
|
|
2546
2581
|
return parts.join(". ");
|
|
2547
2582
|
}
|
|
2583
|
+
|
|
2548
2584
|
// src/components/selection.tsx
|
|
2549
2585
|
function reconcile(prev, rows, keys, initial) {
|
|
2550
2586
|
const present = new Set(keys);
|
|
@@ -2562,7 +2598,7 @@ function reconcile(prev, rows, keys, initial) {
|
|
|
2562
2598
|
raw
|
|
2563
2599
|
};
|
|
2564
2600
|
}
|
|
2565
|
-
|
|
2601
|
+
const sameKeys = (a, b) => a.length === b.length && a.every((k, i) => k === b[i]);
|
|
2566
2602
|
/**
|
|
2567
2603
|
* Chosen row keys, pruned to the rows that exist, and the calls that change them. Spread into
|
|
2568
2604
|
* `DataTable`'s or `SelectableGrid`'s `selection` with a `rowLabel`. `initial` (keys, or a test on
|
|
@@ -2780,6 +2816,7 @@ function BulkBar({ count, noun, onClear, children, format: format$1 = format, cl
|
|
|
2780
2816
|
})]
|
|
2781
2817
|
});
|
|
2782
2818
|
}
|
|
2819
|
+
|
|
2783
2820
|
// src/components/disclosure.tsx
|
|
2784
2821
|
/** Shows more of one thing in place: a button with `aria-expanded` around `summary`, and a body mounted only while open (so a request inside it runs on first open). Controlled with `open`/`onOpenChange` or `useExpanded`, or uncontrolled with `defaultOpen`. */
|
|
2785
2822
|
function Disclosure({ summary, children, actions, open, defaultOpen = false, onOpenChange, className }) {
|
|
@@ -2870,12 +2907,13 @@ function useUrlExpanded(param, { single }) {
|
|
|
2870
2907
|
single
|
|
2871
2908
|
]);
|
|
2872
2909
|
}
|
|
2910
|
+
|
|
2873
2911
|
// src/components/data-table.tsx
|
|
2874
|
-
|
|
2912
|
+
const collator$1 = new Intl.Collator(void 0, {
|
|
2875
2913
|
numeric: true,
|
|
2876
2914
|
sensitivity: "base"
|
|
2877
2915
|
});
|
|
2878
|
-
|
|
2916
|
+
const kind = (v) => typeof v === "number" ? 0 : typeof v === "string" ? 1 : 2;
|
|
2879
2917
|
/** Orders two present values: numbers, then text (locale order, numbers in text read as numbers), then dates. */
|
|
2880
2918
|
function compareValues(a, b) {
|
|
2881
2919
|
if (kind(a) !== kind(b)) return kind(a) - kind(b);
|
|
@@ -2946,11 +2984,11 @@ function UrlSortedTable(props) {
|
|
|
2946
2984
|
sortState: useUrlSort(props.sortParam, props.initialSort)
|
|
2947
2985
|
});
|
|
2948
2986
|
}
|
|
2949
|
-
|
|
2987
|
+
const features = tableFeatures({
|
|
2950
2988
|
rowSortingFeature,
|
|
2951
2989
|
sortedRowModel: createSortedRowModel()
|
|
2952
2990
|
});
|
|
2953
|
-
|
|
2991
|
+
const HIDE_BELOW = {
|
|
2954
2992
|
sm: "max-sm:hidden",
|
|
2955
2993
|
md: "max-md:hidden",
|
|
2956
2994
|
lg: "max-lg:hidden"
|
|
@@ -3022,7 +3060,8 @@ function Table$1({ caption, columns: allColumns, rows, rowKey, sortState: [sort,
|
|
|
3022
3060
|
const shift = useShiftNote();
|
|
3023
3061
|
const pressed = React.useRef(null);
|
|
3024
3062
|
const notePress = (e) => void (pressed.current = e.target.closest("[data-key]")?.getAttribute("data-key") ?? null);
|
|
3025
|
-
const
|
|
3063
|
+
const sortedRows = React.useMemo(() => modelRows.map((r) => r.original), [modelRows]);
|
|
3064
|
+
const select = useSelectRows(sortedRows, rowKey, selection);
|
|
3026
3065
|
const changeSelection = (next) => {
|
|
3027
3066
|
if (!selection) return;
|
|
3028
3067
|
if (next !== "all") {
|
|
@@ -3180,9 +3219,9 @@ function Table$1({ caption, columns: allColumns, rows, rowKey, sortState: [sort,
|
|
|
3180
3219
|
}) : grid
|
|
3181
3220
|
});
|
|
3182
3221
|
}
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3222
|
+
const SELECT = "\0select";
|
|
3223
|
+
const EXPAND = "\0expand";
|
|
3224
|
+
const noop = () => {};
|
|
3186
3225
|
/** The loading placeholder for a `DataTable`, shaped like its rows. */
|
|
3187
3226
|
function TableSkeleton({ rows = 4, columns = 5 }) {
|
|
3188
3227
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -3197,8 +3236,9 @@ function TableSkeleton({ rows = 4, columns = 5 }) {
|
|
|
3197
3236
|
}, r))]
|
|
3198
3237
|
});
|
|
3199
3238
|
}
|
|
3239
|
+
|
|
3200
3240
|
// src/components/jobs-table.tsx
|
|
3201
|
-
|
|
3241
|
+
const LOOKS$1 = {
|
|
3202
3242
|
queued: {
|
|
3203
3243
|
tone: "neutral",
|
|
3204
3244
|
icon: Clock,
|
|
@@ -3313,8 +3353,9 @@ function JobsTable({ caption, jobs, describe = (j) => j.kind, onCancel, onRetry,
|
|
|
3313
3353
|
className: cn(className)
|
|
3314
3354
|
});
|
|
3315
3355
|
}
|
|
3356
|
+
|
|
3316
3357
|
// src/components/schedule-table.tsx
|
|
3317
|
-
|
|
3358
|
+
const LOOKS = {
|
|
3318
3359
|
ok: {
|
|
3319
3360
|
tone: "success",
|
|
3320
3361
|
icon: Check,
|
|
@@ -3399,8 +3440,9 @@ function ScheduleTable({ caption, rows, now, className }) {
|
|
|
3399
3440
|
className
|
|
3400
3441
|
});
|
|
3401
3442
|
}
|
|
3443
|
+
|
|
3402
3444
|
// src/components/film-strip.tsx
|
|
3403
|
-
|
|
3445
|
+
const GAP$1 = 4;
|
|
3404
3446
|
/** `n` of `items` spread evenly from the first to the last (all of them when there are no more than `n`). */
|
|
3405
3447
|
function pickEvenly(items, n) {
|
|
3406
3448
|
if (n <= 0) return [];
|
|
@@ -3483,6 +3525,7 @@ function FilmStrip({ label, frames, span, time, onSeek, aspect = "4/3", frameWid
|
|
|
3483
3525
|
})
|
|
3484
3526
|
});
|
|
3485
3527
|
}
|
|
3528
|
+
|
|
3486
3529
|
// src/components/media-contents.tsx
|
|
3487
3530
|
/** The index of the item whose span holds `time`, or -1. */
|
|
3488
3531
|
function currentItem(items, time) {
|
|
@@ -3503,7 +3546,7 @@ function MediaContents({ label, items, time, onSeek, onSelect, className }) {
|
|
|
3503
3546
|
}, item.id))
|
|
3504
3547
|
});
|
|
3505
3548
|
}
|
|
3506
|
-
|
|
3549
|
+
const ContentsRow = React.memo(function ContentsRow({ item, current, onSeek, onSelect }) {
|
|
3507
3550
|
const from = format.runningTime(item.start);
|
|
3508
3551
|
return /* @__PURE__ */ jsx("li", {
|
|
3509
3552
|
"aria-current": current ? "time" : void 0,
|
|
@@ -3536,8 +3579,9 @@ var ContentsRow = React.memo(function ContentsRow({ item, current, onSeek, onSel
|
|
|
3536
3579
|
})
|
|
3537
3580
|
});
|
|
3538
3581
|
});
|
|
3582
|
+
|
|
3539
3583
|
// src/components/media-skip.ts
|
|
3540
|
-
|
|
3584
|
+
const LEVEL_KIND = {
|
|
3541
3585
|
small: "scene",
|
|
3542
3586
|
large: "chapter"
|
|
3543
3587
|
};
|
|
@@ -3584,6 +3628,7 @@ function skipAction(marks, level, direction, time, { steps = {}, duration = null
|
|
|
3584
3628
|
by: "time"
|
|
3585
3629
|
};
|
|
3586
3630
|
}
|
|
3631
|
+
|
|
3587
3632
|
// src/components/fullscreen-frame.tsx
|
|
3588
3633
|
/** Whether this browser can show an element full screen. False in jsdom and on iPhone, where the modal fallback is used. */
|
|
3589
3634
|
function canFullscreen() {
|
|
@@ -3651,9 +3696,10 @@ function FullscreenFrame({ label, active, onActiveChange, modal: allowModal = tr
|
|
|
3651
3696
|
})
|
|
3652
3697
|
});
|
|
3653
3698
|
}
|
|
3699
|
+
|
|
3654
3700
|
// src/components/media.tsx
|
|
3655
|
-
|
|
3656
|
-
|
|
3701
|
+
const clamp$4 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
3702
|
+
const timecode = (t, { precision, fps }) => format.timecode(t, {
|
|
3657
3703
|
precision,
|
|
3658
3704
|
fps
|
|
3659
3705
|
});
|
|
@@ -3693,14 +3739,14 @@ function TimeReadout({ time, duration, precision = "seconds", fps = 30, classNam
|
|
|
3693
3739
|
]
|
|
3694
3740
|
});
|
|
3695
3741
|
}
|
|
3696
|
-
|
|
3742
|
+
const SPAN_TONE = {
|
|
3697
3743
|
info: "bg-info",
|
|
3698
3744
|
success: "bg-success",
|
|
3699
3745
|
warning: "bg-warning",
|
|
3700
3746
|
danger: "bg-danger",
|
|
3701
3747
|
neutral: "bg-neutral-8"
|
|
3702
3748
|
};
|
|
3703
|
-
|
|
3749
|
+
const COLOUR_NAME = /^--[\w-]+$/;
|
|
3704
3750
|
/** One stretch drawn as a range of a bar of `duration` seconds, named with its times. Shared by the seek bar and the strip under the browser's own controls. */
|
|
3705
3751
|
function SpanRange({ span, duration, thin, ...time }) {
|
|
3706
3752
|
const name = `${span.label}, ${timecode(span.start, time)} to ${timecode(span.end, time)}`;
|
|
@@ -4187,27 +4233,28 @@ function StageGuides({ safe, thirds, centre, className }) {
|
|
|
4187
4233
|
children: [draw("stroke-foreground", 3), draw("stroke-background", 1)]
|
|
4188
4234
|
});
|
|
4189
4235
|
}
|
|
4236
|
+
|
|
4190
4237
|
// src/components/key-owner.ts
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4238
|
+
const members = /* @__PURE__ */ new Set();
|
|
4239
|
+
let active = null;
|
|
4240
|
+
let warned = false;
|
|
4241
|
+
let snapshot = {
|
|
4195
4242
|
count: 0,
|
|
4196
4243
|
active: null
|
|
4197
4244
|
};
|
|
4198
|
-
|
|
4199
|
-
|
|
4245
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
4246
|
+
const emit = () => {
|
|
4200
4247
|
snapshot = {
|
|
4201
4248
|
count: members.size,
|
|
4202
4249
|
active
|
|
4203
4250
|
};
|
|
4204
4251
|
listeners.forEach((l) => l());
|
|
4205
4252
|
};
|
|
4206
|
-
|
|
4253
|
+
const subscribe = (l) => {
|
|
4207
4254
|
listeners.add(l);
|
|
4208
4255
|
return () => void listeners.delete(l);
|
|
4209
4256
|
};
|
|
4210
|
-
|
|
4257
|
+
const get = () => snapshot;
|
|
4211
4258
|
/**
|
|
4212
4259
|
* Joins the page's key owners while `enabled`, and takes the keys whenever `playing` turns true. Spread nothing: call
|
|
4213
4260
|
* `claim` from the region's focus and pointer-down handlers, and bind the player's `useHotkeys` with `enabled: owner.owns`.
|
|
@@ -4246,8 +4293,9 @@ function useKeyOwner(enabled, playing = false) {
|
|
|
4246
4293
|
claim
|
|
4247
4294
|
};
|
|
4248
4295
|
}
|
|
4296
|
+
|
|
4249
4297
|
// src/components/media-group.tsx
|
|
4250
|
-
|
|
4298
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4251
4299
|
/** Adds an element, or a `useTimeline` clock, to a named group until the returned function is called; whenever one plays, the others pause. */
|
|
4252
4300
|
function joinMediaGroup(name, el) {
|
|
4253
4301
|
let members = groups.get(name);
|
|
@@ -4263,7 +4311,7 @@ function joinMediaGroup(name, el) {
|
|
|
4263
4311
|
if (members.size === 0 && groups.get(name) === members) groups.delete(name);
|
|
4264
4312
|
};
|
|
4265
4313
|
}
|
|
4266
|
-
|
|
4314
|
+
const GroupContext = React.createContext(null);
|
|
4267
4315
|
/** The group a `MediaGroup` above this point names, or null. */
|
|
4268
4316
|
function useMediaGroupName() {
|
|
4269
4317
|
return React.useContext(GroupContext);
|
|
@@ -4277,7 +4325,7 @@ function MediaGroup({ name, children }) {
|
|
|
4277
4325
|
});
|
|
4278
4326
|
}
|
|
4279
4327
|
/** Whether two windows are the same stretch. */
|
|
4280
|
-
|
|
4328
|
+
const sameWindow = (a, b) => (a ?? null) === (b ?? null) || !!a && !!b && a.start === b.start && a.end === b.end;
|
|
4281
4329
|
/** A row's play button for one window of a shared element: named for what it plays, pressed while it plays, a second press pauses. */
|
|
4282
4330
|
function PlayWindowButton({ media, window: w, label, size = "sm", className }) {
|
|
4283
4331
|
const playing = media.playing && sameWindow(media.window, w);
|
|
@@ -4290,9 +4338,10 @@ function PlayWindowButton({ media, window: w, label, size = "sm", className }) {
|
|
|
4290
4338
|
onClick: () => playing ? media.pause() : void media.playWindow(w)
|
|
4291
4339
|
});
|
|
4292
4340
|
}
|
|
4341
|
+
|
|
4293
4342
|
// src/components/media-spans.tsx
|
|
4294
|
-
|
|
4295
|
-
|
|
4343
|
+
const lower = (label) => label.charAt(0).toLowerCase() + label.slice(1);
|
|
4344
|
+
const WORDS$1 = {
|
|
4296
4345
|
skip: (l) => `Skip ${lower(l)}`,
|
|
4297
4346
|
skipped: (l) => `Skipped ${lower(l)}`,
|
|
4298
4347
|
mute: (l) => `Mute ${lower(l)}`,
|
|
@@ -4300,7 +4349,7 @@ var WORDS$1 = {
|
|
|
4300
4349
|
undo: "Undo"
|
|
4301
4350
|
};
|
|
4302
4351
|
/** How long "Skipped intro, Undo" stays. */
|
|
4303
|
-
|
|
4352
|
+
const NOTICE_MS$1 = 6e3;
|
|
4304
4353
|
/** Draws the spans' ranges and acts on them as playback reaches them. See the file comment for the rules. */
|
|
4305
4354
|
function useMediaSpans({ spans, kinds = {}, words, onSpan, time, playing, duration, limit = Infinity, seek, volume, setVolume }) {
|
|
4306
4355
|
const w = {
|
|
@@ -4499,6 +4548,7 @@ function SpanActions({ state, other, className }) {
|
|
|
4499
4548
|
})]
|
|
4500
4549
|
});
|
|
4501
4550
|
}
|
|
4551
|
+
|
|
4502
4552
|
// src/components/media-progress.ts
|
|
4503
4553
|
function createWatchedRanges() {
|
|
4504
4554
|
let ranges = [];
|
|
@@ -4520,6 +4570,7 @@ function createWatchedRanges() {
|
|
|
4520
4570
|
clear: () => void (ranges = [])
|
|
4521
4571
|
};
|
|
4522
4572
|
}
|
|
4573
|
+
|
|
4523
4574
|
// src/components/link.tsx
|
|
4524
4575
|
function useTarget(target, newTab, state) {
|
|
4525
4576
|
const navigate = useNavigate();
|
|
@@ -4578,10 +4629,11 @@ function TextLink(all) {
|
|
|
4578
4629
|
children: [Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }), children]
|
|
4579
4630
|
}));
|
|
4580
4631
|
}
|
|
4632
|
+
|
|
4581
4633
|
// src/components/media-player.tsx
|
|
4582
4634
|
/** How far one notch of the wheel over a focused video moves the volume, in percent. */
|
|
4583
|
-
|
|
4584
|
-
|
|
4635
|
+
const WHEEL_VOLUME_STEP = 5;
|
|
4636
|
+
const idle = {
|
|
4585
4637
|
ready: 0,
|
|
4586
4638
|
waitingForMore: false,
|
|
4587
4639
|
playing: false,
|
|
@@ -4595,7 +4647,7 @@ var idle = {
|
|
|
4595
4647
|
loading: false,
|
|
4596
4648
|
error: null
|
|
4597
4649
|
};
|
|
4598
|
-
|
|
4650
|
+
const LOAD_MESSAGES = {
|
|
4599
4651
|
2: "The connection dropped while it was loading.",
|
|
4600
4652
|
3: "The file could not be decoded.",
|
|
4601
4653
|
4: "This format is not supported or the file is not there."
|
|
@@ -4623,7 +4675,7 @@ function useElementListeners(ref, bind) {
|
|
|
4623
4675
|
bound.current = null;
|
|
4624
4676
|
}, []);
|
|
4625
4677
|
}
|
|
4626
|
-
|
|
4678
|
+
const EVENTS = [
|
|
4627
4679
|
"loadstart",
|
|
4628
4680
|
"loadedmetadata",
|
|
4629
4681
|
"durationchange",
|
|
@@ -5014,7 +5066,7 @@ function useAttachedSource(ref, src, attach, onProblem, growing, start) {
|
|
|
5014
5066
|
return React.useMemo(() => ({ reload: (at) => hold.current?.attachment.reload(at) }), []);
|
|
5015
5067
|
}
|
|
5016
5068
|
/** Playback speeds an audiobook or lecture listener expects. */
|
|
5017
|
-
|
|
5069
|
+
const SPEECH_RATES = [
|
|
5018
5070
|
.75,
|
|
5019
5071
|
1,
|
|
5020
5072
|
1.25,
|
|
@@ -5024,9 +5076,9 @@ var SPEECH_RATES = [
|
|
|
5024
5076
|
2.5,
|
|
5025
5077
|
3
|
|
5026
5078
|
];
|
|
5027
|
-
|
|
5079
|
+
const JUMP = 10;
|
|
5028
5080
|
/** How long a notice such as "Picked up at 2:05" stays once the player is playing. */
|
|
5029
|
-
|
|
5081
|
+
const NOTICE_MS = 6e3;
|
|
5030
5082
|
function useCoarsePointer() {
|
|
5031
5083
|
const [coarse, setCoarse] = React.useState(false);
|
|
5032
5084
|
React.useEffect(() => {
|
|
@@ -5817,11 +5869,12 @@ function HeadingLink({ to, state, className, label, children }) {
|
|
|
5817
5869
|
children
|
|
5818
5870
|
}));
|
|
5819
5871
|
}
|
|
5872
|
+
|
|
5820
5873
|
// src/lib/transcript.ts
|
|
5821
5874
|
/** The id of a word for marking (`TranscriptView`'s `marking`, `Mark`): its phrase and its place in it. */
|
|
5822
|
-
|
|
5875
|
+
const wordId = (phraseId, index) => `${phraseId}:${index}`;
|
|
5823
5876
|
/** The phrase an id made by `wordId` belongs to. */
|
|
5824
|
-
|
|
5877
|
+
const phraseOfWordId = (id) => id.slice(0, id.lastIndexOf(":"));
|
|
5825
5878
|
/** Whether a word is doubtful: the recogniser said so, or its confidence is under `below`. */
|
|
5826
5879
|
function isDoubtful(word, below = .6) {
|
|
5827
5880
|
return word.doubtful ?? (word.confidence !== void 0 && word.confidence < below);
|
|
@@ -5853,6 +5906,7 @@ function wordAt(phrase, time) {
|
|
|
5853
5906
|
else break;
|
|
5854
5907
|
return found;
|
|
5855
5908
|
}
|
|
5909
|
+
|
|
5856
5910
|
// src/lib/marks.ts
|
|
5857
5911
|
/** The ids from `a` to `b` inclusive, in document order whichever way round they are given. Empty when either is not in `ids`. */
|
|
5858
5912
|
function rangeBetween(ids, a, b) {
|
|
@@ -5878,8 +5932,9 @@ function stepId(ids, from, by) {
|
|
|
5878
5932
|
if (i < 0) return by >= 0 ? ids[0] : ids[ids.length - 1];
|
|
5879
5933
|
return ids[Math.min(Math.max(i + by, 0), ids.length - 1)];
|
|
5880
5934
|
}
|
|
5935
|
+
|
|
5881
5936
|
// src/components/markable-text.tsx
|
|
5882
|
-
|
|
5937
|
+
const TONE$2 = {
|
|
5883
5938
|
neutral: {
|
|
5884
5939
|
fill: "var(--muted)",
|
|
5885
5940
|
edge: "var(--muted-foreground)"
|
|
@@ -5901,7 +5956,7 @@ var TONE$2 = {
|
|
|
5901
5956
|
edge: "var(--danger)"
|
|
5902
5957
|
}
|
|
5903
5958
|
};
|
|
5904
|
-
|
|
5959
|
+
const MarksContext = React.createContext(null);
|
|
5905
5960
|
/** One word (or phrase, or clip) that can be marked. Draws its mark, its selection and the caret; inside a `MarkableText`. */
|
|
5906
5961
|
function Mark({ id, children, className, onClick, onHover }) {
|
|
5907
5962
|
const c = React.useContext(MarksContext);
|
|
@@ -6137,8 +6192,9 @@ function MarkableText({ label, ids, marks, kinds, onMark, clearKeys = [], onActi
|
|
|
6137
6192
|
]
|
|
6138
6193
|
});
|
|
6139
6194
|
}
|
|
6195
|
+
|
|
6140
6196
|
// src/components/virtual-list.tsx
|
|
6141
|
-
|
|
6197
|
+
const FOOTER = "\0footer";
|
|
6142
6198
|
/** A list that renders only its visible rows (React Aria's GridList and Virtualizer) from `virtualizeFrom` items, with arrow-key navigation between rows. */
|
|
6143
6199
|
function VirtualList({ label, items, itemKey, children, estimateSize = 48, rowHeight, height = 480, virtualizeFrom = 100, bounded = false, footer, className }) {
|
|
6144
6200
|
const virtual = items.length >= virtualizeFrom;
|
|
@@ -6178,10 +6234,11 @@ function VirtualList({ label, items, itemKey, children, estimateSize = 48, rowHe
|
|
|
6178
6234
|
children: list
|
|
6179
6235
|
}) : list;
|
|
6180
6236
|
}
|
|
6237
|
+
|
|
6181
6238
|
// src/components/transcript-view.tsx
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6239
|
+
const ALL = "all";
|
|
6240
|
+
const capital = (s) => s.charAt(0).toUpperCase() + s.slice(1);
|
|
6241
|
+
const range = (a, b) => `${format.runningTime(a)}–${format.runningTime(b)}`;
|
|
6185
6242
|
/** Timed text that follows playback: the heard word marked, any word or phrase pressed to play from, modes, speakers, follow and Jump to now. */
|
|
6186
6243
|
function TranscriptView({ label, groups, time, onSeek, marking, onCorrectionPress, mode: controlledMode, onModeChange, modeLabels = {}, speaker: controlledSpeaker, onSpeakerChange, follow = true, announce = false, renderPlay, doubtfulBelow = .6, states = [], onPhraseState, renderActions, onEdit, renderCard, cardDelay = 500, height = 480, className }) {
|
|
6187
6244
|
const [ownMode, setOwnMode] = React.useState("original");
|
|
@@ -6697,8 +6754,9 @@ function PhraseRow({ phrase, mode, active, word, onSeek, marking, onCorrectionPr
|
|
|
6697
6754
|
]
|
|
6698
6755
|
});
|
|
6699
6756
|
}
|
|
6757
|
+
|
|
6700
6758
|
// src/lib/waveform.ts
|
|
6701
|
-
|
|
6759
|
+
const isPair = (p) => typeof p.min === "object";
|
|
6702
6760
|
/** Makes the lowest and highest sample of each slice from either form. A magnitude `m` is the pair `-m` to `m`. */
|
|
6703
6761
|
function toPeakPair(peaks) {
|
|
6704
6762
|
if (isPair(peaks)) {
|
|
@@ -6806,15 +6864,16 @@ async function peaksFromAudio(audio, buckets, options = {}) {
|
|
|
6806
6864
|
};
|
|
6807
6865
|
}
|
|
6808
6866
|
/** The time at the pointer, given the visible range and the width. */
|
|
6809
|
-
|
|
6867
|
+
const timeAt = (px, width, from, to) => from + Math.min(Math.max(px, 0), width) / (width || 1) * (to - from);
|
|
6810
6868
|
/** Keeps a visible range of `span` seconds inside `0` to `duration`. */
|
|
6811
6869
|
function clampView(from, span, duration) {
|
|
6812
6870
|
const s = Math.min(Math.max(span, Math.min(duration, .05)), duration);
|
|
6813
6871
|
const a = Math.min(Math.max(from, 0), Math.max(duration - s, 0));
|
|
6814
6872
|
return [a, a + s];
|
|
6815
6873
|
}
|
|
6874
|
+
|
|
6816
6875
|
// src/components/waveform.tsx
|
|
6817
|
-
|
|
6876
|
+
const TONE$1 = {
|
|
6818
6877
|
neutral: {
|
|
6819
6878
|
fill: "var(--muted)",
|
|
6820
6879
|
edge: "var(--muted-foreground)"
|
|
@@ -6836,7 +6895,7 @@ var TONE$1 = {
|
|
|
6836
6895
|
edge: "var(--danger)"
|
|
6837
6896
|
}
|
|
6838
6897
|
};
|
|
6839
|
-
|
|
6898
|
+
const MARK_LINE = {
|
|
6840
6899
|
beat: {
|
|
6841
6900
|
width: 1,
|
|
6842
6901
|
opacity: .16
|
|
@@ -6855,7 +6914,7 @@ var MARK_LINE = {
|
|
|
6855
6914
|
dash: "4 3"
|
|
6856
6915
|
}
|
|
6857
6916
|
};
|
|
6858
|
-
|
|
6917
|
+
const WORDS = {
|
|
6859
6918
|
running: "Reading the waveform",
|
|
6860
6919
|
finished: "Waveform ready",
|
|
6861
6920
|
failed: "Could not read the waveform"
|
|
@@ -6870,8 +6929,8 @@ async function defaultDecode(data) {
|
|
|
6870
6929
|
ctx.close?.();
|
|
6871
6930
|
}
|
|
6872
6931
|
}
|
|
6873
|
-
|
|
6874
|
-
|
|
6932
|
+
const clamp$3 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
6933
|
+
const clock = (t) => format.runningTime(t);
|
|
6875
6934
|
/** An audio waveform with marks, spans and a playhead: one slider you click, drag or key to seek, zoom, and a range to select. */
|
|
6876
6935
|
function Waveform({ label, peaks, source, duration: given, time, onSeek, marks = [], spans = [], underlay, range: controlledRange, onRangeChange, step = 5, bigStep = 30, defaultView, buckets = 2e3, normalise = false, decode = defaultDecode, words = WORDS, disabled, className }) {
|
|
6877
6936
|
const work = useClientWork(async ({ signal, progress }) => {
|
|
@@ -7317,8 +7376,9 @@ function Waveform({ label, peaks, source, duration: given, time, onSeek, marks =
|
|
|
7317
7376
|
]
|
|
7318
7377
|
});
|
|
7319
7378
|
}
|
|
7379
|
+
|
|
7320
7380
|
// src/components/use-timeline.ts
|
|
7321
|
-
|
|
7381
|
+
const clamp$2 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
7322
7382
|
/** A playhead the app owns, in the shape `Transport`, `SeekBar` and `transportShortcuts` take. */
|
|
7323
7383
|
function useTimeline({ duration, rate = 1, frame = 1 / 30, loop = false, startAt = "start", group, keys = true }) {
|
|
7324
7384
|
const length = Number.isFinite(duration) && duration > 0 ? duration : 0;
|
|
@@ -7419,6 +7479,7 @@ function useTimeline({ duration, rate = 1, frame = 1 / 30, loop = false, startAt
|
|
|
7419
7479
|
regionProps
|
|
7420
7480
|
};
|
|
7421
7481
|
}
|
|
7482
|
+
|
|
7422
7483
|
// src/components/timeline-player.tsx
|
|
7423
7484
|
/** A stage over a control bar for a timeline the app owns: transport, seek bar, time and speed, with the keys following the clock last used and the stage keeping its arrows. */
|
|
7424
7485
|
function TimelinePlayer({ clock, label, stage, rates, onRateChange, legend = false, className }) {
|
|
@@ -7485,9 +7546,10 @@ function TimelinePlayer({ clock, label, stage, rates, onRateChange, legend = fal
|
|
|
7485
7546
|
]
|
|
7486
7547
|
});
|
|
7487
7548
|
}
|
|
7549
|
+
|
|
7488
7550
|
// src/lib/timeline.ts
|
|
7489
7551
|
/** Steps a person would write on a scale, in seconds: 1, 2, 5 and 10 × 10ⁿ below a minute, then 15 s, 30 s, minutes, quarter hours, hours, days. ux-research components.md §3.8: ticks land on values people would write. */
|
|
7490
|
-
|
|
7552
|
+
const STEPS = [
|
|
7491
7553
|
.01,
|
|
7492
7554
|
.02,
|
|
7493
7555
|
.05,
|
|
@@ -7548,11 +7610,12 @@ function snapTo(time, points, pxPerUnit, thresholdPx = 8) {
|
|
|
7548
7610
|
};
|
|
7549
7611
|
}
|
|
7550
7612
|
/** Round away float noise from adding steps (0.1 + 0.2). */
|
|
7551
|
-
|
|
7613
|
+
const tidy = (n) => Math.round(n * 1e6) / 1e6;
|
|
7614
|
+
|
|
7552
7615
|
// src/components/timeline.tsx
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7616
|
+
const EDGE_PX = 8;
|
|
7617
|
+
const DRAG_THRESHOLD = 3;
|
|
7618
|
+
const defaultFormat = (t) => tickLabel(t, 1);
|
|
7556
7619
|
/** Zoom state for a timeline: `zoomIn`, `zoomOut`, and `fit` to a viewport width. Pass `zoom` and `setZoom` as the timeline's `zoom` and `onZoomChange`. */
|
|
7557
7620
|
function useTimelineZoom({ initial = 20, min = .5, max = 400 } = {}) {
|
|
7558
7621
|
const [zoom, set] = React.useState(initial);
|
|
@@ -8188,7 +8251,8 @@ function Timeline({ label, lanes, items, from = 0, to, zoom, onZoomChange, posit
|
|
|
8188
8251
|
formatTime(info.next.start),
|
|
8189
8252
|
" to ",
|
|
8190
8253
|
formatTime(info.next.start + info.next.length),
|
|
8191
|
-
",
|
|
8254
|
+
",",
|
|
8255
|
+
" ",
|
|
8192
8256
|
laneLabel(info.next.lane)
|
|
8193
8257
|
] })
|
|
8194
8258
|
});
|
|
@@ -8238,10 +8302,11 @@ function LaneRow({ label, register, types, onHover, onLeave, onDropItems, childr
|
|
|
8238
8302
|
children
|
|
8239
8303
|
});
|
|
8240
8304
|
}
|
|
8305
|
+
|
|
8241
8306
|
// src/components/sortable-list.tsx
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8307
|
+
const KIND = "strata-kind/";
|
|
8308
|
+
const ID = "strata-item/id";
|
|
8309
|
+
const LIST = "strata-list/";
|
|
8245
8310
|
/** A list that reorders by drag and by keyboard, and takes items from other lists by kind. It reports what was asked and never changes the data itself. */
|
|
8246
8311
|
function SortableList({ label, items, getKey, getLabel, children, renderActions, empty, onReorder, onInsert, getKind = () => "item", accepts = [], refuses = {}, selectionMode = "none", selectedKeys, onSelectionChange, className }) {
|
|
8247
8312
|
const listId = React.useId();
|
|
@@ -8357,6 +8422,7 @@ function SortableList({ label, items, getKey, getLabel, children, renderActions,
|
|
|
8357
8422
|
})]
|
|
8358
8423
|
});
|
|
8359
8424
|
}
|
|
8425
|
+
|
|
8360
8426
|
// src/components/drag-source.tsx
|
|
8361
8427
|
/**
|
|
8362
8428
|
* The type every `DragSource` drag carries beside the app's own, so a drop target that takes only files (`FileDropZone`) can tell
|
|
@@ -8364,7 +8430,7 @@ function SortableList({ label, items, getKey, getLabel, children, renderActions,
|
|
|
8364
8430
|
* the types it is given, and React Aria's `DragTypes` cannot tell an app's `text/plain` from a dragged `.txt` file, so a type of
|
|
8365
8431
|
* our own is the one that can be recognised for certain.
|
|
8366
8432
|
*/
|
|
8367
|
-
|
|
8433
|
+
const STRATA_DRAG_TYPE = "application/x-strata-drag";
|
|
8368
8434
|
/** A row that can be dragged onto a drop target, such as a `Timeline` lane, by pointer or from the keyboard with its named grip. */
|
|
8369
8435
|
function DragSource({ label, items, onDragStart, onDragEnd, disabled, children, className }) {
|
|
8370
8436
|
const { dragProps, dragButtonProps, isDragging } = useDrag({
|
|
@@ -8396,6 +8462,7 @@ function DragSource({ label, items, onDragStart, onDragEnd, disabled, children,
|
|
|
8396
8462
|
})]
|
|
8397
8463
|
});
|
|
8398
8464
|
}
|
|
8465
|
+
|
|
8399
8466
|
// src/components/file-intake.tsx
|
|
8400
8467
|
/** The picker as a button. `children` is its visible name ("Add files"); `accept` narrows what the dialog shows. */
|
|
8401
8468
|
function FileButton({ accept, multiple = false, onFiles, icon: Icon, children, ...props }) {
|
|
@@ -8412,7 +8479,7 @@ function FileButton({ accept, multiple = false, onFiles, icon: Icon, children, .
|
|
|
8412
8479
|
})
|
|
8413
8480
|
});
|
|
8414
8481
|
}
|
|
8415
|
-
|
|
8482
|
+
const NEVER_CARRIED = "application/x-strata-never";
|
|
8416
8483
|
/** Whether a drag is the app's own, not files: it carries one of `refuse`, and the browser has not left its types unknown. */
|
|
8417
8484
|
function refusesDrag(types, refuse) {
|
|
8418
8485
|
return !types.has(NEVER_CARRIED) && refuse.some((type) => types.has(type));
|
|
@@ -8443,7 +8510,7 @@ function FileDropZone({ onFiles, acceptLabel, title, disabled, refuseTypes, chil
|
|
|
8443
8510
|
] })
|
|
8444
8511
|
});
|
|
8445
8512
|
}
|
|
8446
|
-
|
|
8513
|
+
const carriesFiles = (e, refuse) => {
|
|
8447
8514
|
const types = Array.from(e.dataTransfer?.types ?? []);
|
|
8448
8515
|
return types.includes("Files") && !refusesDrag({ has: (type) => types.includes(type) }, ["application/x-strata-drag", ...refuse]);
|
|
8449
8516
|
};
|
|
@@ -8519,7 +8586,7 @@ function FileDropOverlay({ onFiles, acceptLabel, disabled, refuseTypes }) {
|
|
|
8519
8586
|
})
|
|
8520
8587
|
});
|
|
8521
8588
|
}
|
|
8522
|
-
|
|
8589
|
+
const rowStatus = {
|
|
8523
8590
|
processing: {
|
|
8524
8591
|
tone: "info",
|
|
8525
8592
|
word: "Adding…",
|
|
@@ -8635,6 +8702,7 @@ function MissingFile({ name, accept, onRelink, thumbnail, className }) {
|
|
|
8635
8702
|
})]
|
|
8636
8703
|
});
|
|
8637
8704
|
}
|
|
8705
|
+
|
|
8638
8706
|
// src/lib/object-url.ts
|
|
8639
8707
|
/** 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. */
|
|
8640
8708
|
function useObjectUrl(data, type) {
|
|
@@ -8654,8 +8722,9 @@ function useObjectUrl(data, type) {
|
|
|
8654
8722
|
}, [data, type]);
|
|
8655
8723
|
return url;
|
|
8656
8724
|
}
|
|
8725
|
+
|
|
8657
8726
|
// src/components/pixel-image.tsx
|
|
8658
|
-
|
|
8727
|
+
const sizeOf = (p) => p.image ? {
|
|
8659
8728
|
width: p.image.width,
|
|
8660
8729
|
height: p.image.height,
|
|
8661
8730
|
data: p.image.data
|
|
@@ -8739,25 +8808,26 @@ function rgbaToBlob(width, height, rgba) {
|
|
|
8739
8808
|
el.toBlob((blob) => blob ? resolve(blob) : reject(/* @__PURE__ */ new Error("The picture could not be saved.")), "image/png");
|
|
8740
8809
|
});
|
|
8741
8810
|
}
|
|
8811
|
+
|
|
8742
8812
|
// src/components/byte-view.tsx
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8813
|
+
const PER_ROW = 16;
|
|
8814
|
+
const ROW_PX = 20;
|
|
8815
|
+
const OVERSCAN = 4;
|
|
8816
|
+
const MAX_PX = 8e6;
|
|
8817
|
+
const tints = {
|
|
8748
8818
|
neutral: "bg-muted",
|
|
8749
8819
|
info: "bg-info-subtle",
|
|
8750
8820
|
success: "bg-success-subtle",
|
|
8751
8821
|
warning: "bg-warning-subtle",
|
|
8752
8822
|
danger: "bg-danger-subtle"
|
|
8753
8823
|
};
|
|
8754
|
-
|
|
8824
|
+
const cellStyle = (k) => ({
|
|
8755
8825
|
width: "2ch",
|
|
8756
8826
|
marginLeft: k === 8 ? "1ch" : void 0
|
|
8757
8827
|
});
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8828
|
+
const hex = (n, width = 2) => n.toString(16).padStart(width, "0");
|
|
8829
|
+
const tintOf = (h) => h ? tints[h.tone ?? "neutral"] : void 0;
|
|
8830
|
+
const printable = (b) => b >= 32 && b < 127 ? String.fromCharCode(b) : "·";
|
|
8761
8831
|
/** 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 }`. */
|
|
8762
8832
|
function ByteView({ bytes, label, offset = 0, highlight, defaultSelection, onSelectionChange, height = 320, className }) {
|
|
8763
8833
|
const total = bytes.length;
|
|
@@ -8985,8 +9055,9 @@ function ByteView({ bytes, label, offset = 0, highlight, defaultSelection, onSel
|
|
|
8985
9055
|
})]
|
|
8986
9056
|
});
|
|
8987
9057
|
}
|
|
9058
|
+
|
|
8988
9059
|
// src/components/console.tsx
|
|
8989
|
-
|
|
9060
|
+
const LEVEL_WORD = {
|
|
8990
9061
|
warning: {
|
|
8991
9062
|
word: "Warning",
|
|
8992
9063
|
tone: "warning"
|
|
@@ -8996,7 +9067,7 @@ var LEVEL_WORD = {
|
|
|
8996
9067
|
tone: "danger"
|
|
8997
9068
|
}
|
|
8998
9069
|
};
|
|
8999
|
-
|
|
9070
|
+
const lineKey = (line) => String(line.id);
|
|
9000
9071
|
function readHistory(key) {
|
|
9001
9072
|
if (!key) return [];
|
|
9002
9073
|
try {
|
|
@@ -9187,9 +9258,10 @@ function Console({ label, lines, onCommand, complete, historyKey, height = 320,
|
|
|
9187
9258
|
]
|
|
9188
9259
|
});
|
|
9189
9260
|
}
|
|
9261
|
+
|
|
9190
9262
|
// src/components/shortcut-editor.tsx
|
|
9191
|
-
|
|
9192
|
-
|
|
9263
|
+
const idOf = (s) => s.id ?? s.label;
|
|
9264
|
+
const MODIFIER_KEYS = /* @__PURE__ */ new Set([
|
|
9193
9265
|
"Shift",
|
|
9194
9266
|
"Control",
|
|
9195
9267
|
"Alt",
|
|
@@ -9441,6 +9513,7 @@ function ShortcutEditor({ rebinding, label = "Keyboard shortcuts", className })
|
|
|
9441
9513
|
})]
|
|
9442
9514
|
});
|
|
9443
9515
|
}
|
|
9516
|
+
|
|
9444
9517
|
// src/lib/file-intake.ts
|
|
9445
9518
|
/** Whether a file matches one entry of an `accept` list: extension, exact type or `family/*`, ignoring case. */
|
|
9446
9519
|
function matchesAccept(file, accept) {
|
|
@@ -9453,8 +9526,8 @@ function matchesAccept(file, accept) {
|
|
|
9453
9526
|
return type === a;
|
|
9454
9527
|
});
|
|
9455
9528
|
}
|
|
9456
|
-
|
|
9457
|
-
|
|
9529
|
+
const MB = 1048576;
|
|
9530
|
+
const sizeWords = (bytes) => bytes >= MB ? `${(bytes / MB).toFixed(bytes >= 100 * MB ? 0 : 1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} kB`;
|
|
9458
9531
|
/** 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. */
|
|
9459
9532
|
function useFileIntake(options) {
|
|
9460
9533
|
const [outcomes, setOutcomes] = React.useState([]);
|
|
@@ -9590,6 +9663,7 @@ function useFileIntake(options) {
|
|
|
9590
9663
|
pending
|
|
9591
9664
|
]);
|
|
9592
9665
|
}
|
|
9666
|
+
|
|
9593
9667
|
// src/components/inspector.tsx
|
|
9594
9668
|
function readRemembered(key) {
|
|
9595
9669
|
if (!key) return {};
|
|
@@ -9601,7 +9675,7 @@ function readRemembered(key) {
|
|
|
9601
9675
|
return {};
|
|
9602
9676
|
}
|
|
9603
9677
|
}
|
|
9604
|
-
|
|
9678
|
+
const InspectorContext = React.createContext(null);
|
|
9605
9679
|
/** A panel of properties for the selected thing: a labelled region with a heading, an empty state when `title` is null, and sections whose open state is remembered. */
|
|
9606
9680
|
function Inspector({ title, kind, empty, selectionKey, storageKey, actions, summary, children, className }) {
|
|
9607
9681
|
const headingId = React.useId();
|
|
@@ -9769,11 +9843,14 @@ function PropertyList({ items, label, className }) {
|
|
|
9769
9843
|
})
|
|
9770
9844
|
});
|
|
9771
9845
|
}
|
|
9846
|
+
|
|
9772
9847
|
// src/lib/grouped-grid-layout.ts
|
|
9773
9848
|
/** Keys of group headings start with this, so a tile key that is a plain id can never be mistaken for one. */
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9849
|
+
const GROUP_PREFIX = "group";
|
|
9850
|
+
const groupKey = (group) => `${GROUP_PREFIX}${group}`;
|
|
9851
|
+
const isGroupKey = (key) => typeof key === "string" && key.startsWith("group");
|
|
9852
|
+
/** The height of a group's heading row, in px. */
|
|
9853
|
+
const HEADER_HEIGHT = 40;
|
|
9777
9854
|
/**
|
|
9778
9855
|
* Rows of equal height, each picture at its own shape (Google Photos, Lightroom): fill a row with
|
|
9779
9856
|
* pictures at the target height `rowHeight` until it is full, then scale the row's height so it spans
|
|
@@ -9926,31 +10003,32 @@ var GroupedGridLayout = class extends GridLayout {
|
|
|
9926
10003
|
return [...visible.filter((l) => l.key !== current.key), stuck];
|
|
9927
10004
|
}
|
|
9928
10005
|
};
|
|
10006
|
+
|
|
9929
10007
|
// src/components/tile-grid.tsx
|
|
9930
|
-
|
|
10008
|
+
const minWidth = {
|
|
9931
10009
|
sm: 96,
|
|
9932
10010
|
md: 144,
|
|
9933
10011
|
lg: 192
|
|
9934
10012
|
};
|
|
9935
|
-
|
|
10013
|
+
const aspectClass = {
|
|
9936
10014
|
square: "aspect-square",
|
|
9937
10015
|
portrait: "aspect-3/4",
|
|
9938
10016
|
landscape: "aspect-4/3"
|
|
9939
10017
|
};
|
|
9940
|
-
|
|
10018
|
+
const aspectRatio = {
|
|
9941
10019
|
square: 1,
|
|
9942
10020
|
portrait: 4 / 3,
|
|
9943
10021
|
landscape: 3 / 4
|
|
9944
10022
|
};
|
|
9945
|
-
|
|
10023
|
+
const thumbnailAspect = {
|
|
9946
10024
|
square: 1,
|
|
9947
10025
|
portrait: 3 / 4,
|
|
9948
10026
|
landscape: 4 / 3
|
|
9949
10027
|
};
|
|
9950
|
-
|
|
9951
|
-
|
|
10028
|
+
const GAP = 12;
|
|
10029
|
+
const TILE_CHROME = 40;
|
|
9952
10030
|
/** A tile size as pixels: a named size's minimum width, or the number itself (a continuous size, issue #246). */
|
|
9953
|
-
|
|
10031
|
+
const tileWidth = (size) => typeof size === "number" ? size : minWidth[size];
|
|
9954
10032
|
/** `GridLayout` options for tiles of this size and aspect: they grow from the minimum width to fill the row, and each row is as tall as its tallest tile as measured. */
|
|
9955
10033
|
function tileLayoutOptions(tileSize, aspect) {
|
|
9956
10034
|
const w = tileWidth(tileSize);
|
|
@@ -10055,6 +10133,7 @@ function SelectableGridSkeleton({ count = 24, aspect = "square", tileSize = "md"
|
|
|
10055
10133
|
}, i))
|
|
10056
10134
|
});
|
|
10057
10135
|
}
|
|
10136
|
+
|
|
10058
10137
|
// src/components/selectable-grid.tsx
|
|
10059
10138
|
/** A grid of pictures to choose from: each tile one labelled target, "Select all shown", Shift-click ranges, virtualised from `virtualizeFrom` tiles. Pair with `useSelection` and a `BulkBar`. */
|
|
10060
10139
|
function SelectableGrid({ label, rows, rowKey, renderImage, detail, selection, aspect = "square", naturalAspect, tileSize = "md", onTileSizeChange, zoomRange = [64, 320], selectionMode = "multiple", selectionBehavior = "toggle", onAction, badge, mark, fit = "cover", groupBy, groupHeading, unselectableReason, virtualizeFrom = 100, maxHeight = 480, className }) {
|
|
@@ -10496,8 +10575,11 @@ function TileBox({ label }) {
|
|
|
10496
10575
|
})
|
|
10497
10576
|
});
|
|
10498
10577
|
}
|
|
10578
|
+
|
|
10499
10579
|
// src/components/compare-parts.tsx
|
|
10500
|
-
|
|
10580
|
+
const VIEWPORT_HEIGHT = "max(16rem, calc(100svh - 14rem))";
|
|
10581
|
+
/** The least a frame is made, however little room is left: a pair this small can still be told apart. */
|
|
10582
|
+
const MIN_FIT = 120;
|
|
10501
10583
|
/** 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. */
|
|
10502
10584
|
function fitFrames({ space, chrome, rows, min = 120 }) {
|
|
10503
10585
|
return Math.max(min, Math.floor((space - chrome) / Math.max(1, rows)));
|
|
@@ -10682,7 +10764,7 @@ function Picture({ c, blind, missing, onNatural, imgRef, pixelated }) {
|
|
|
10682
10764
|
className: "absolute inset-0 size-full object-contain"
|
|
10683
10765
|
})] });
|
|
10684
10766
|
}
|
|
10685
|
-
|
|
10767
|
+
const frameSize = (frame) => {
|
|
10686
10768
|
const r = frame.current?.getBoundingClientRect();
|
|
10687
10769
|
return {
|
|
10688
10770
|
width: r?.width ?? 0,
|
|
@@ -10793,6 +10875,7 @@ function useWidth$1(ref) {
|
|
|
10793
10875
|
});
|
|
10794
10876
|
return width;
|
|
10795
10877
|
}
|
|
10878
|
+
|
|
10796
10879
|
// src/components/viewport.tsx
|
|
10797
10880
|
/** Zoom and pan held in React state, to give to every `ViewportFrame` that should move together. */
|
|
10798
10881
|
function useViewport(initial = FIT) {
|
|
@@ -10802,15 +10885,15 @@ function useViewport(initial = FIT) {
|
|
|
10802
10885
|
setViewport
|
|
10803
10886
|
};
|
|
10804
10887
|
}
|
|
10805
|
-
|
|
10888
|
+
const PAN_STEP = 48;
|
|
10806
10889
|
/** A pointer that moves further than this between down and up is a pan, not a click. */
|
|
10807
|
-
|
|
10890
|
+
const CLICK_SLOP = 4;
|
|
10808
10891
|
/** A press held longer than this is not a click. */
|
|
10809
|
-
|
|
10892
|
+
const CLICK_MAX_MS = 500;
|
|
10810
10893
|
/** A click counts only once this long has passed with no second press: a double click zooms instead. */
|
|
10811
|
-
|
|
10894
|
+
const DOUBLE_CLICK_MS = 300;
|
|
10812
10895
|
/** A clipped frame whose children zoom and pan together; the viewport is the caller's, so frames can share one. */
|
|
10813
|
-
|
|
10896
|
+
const ViewportFrame = React.forwardRef(function ViewportFrame({ label, aspect, viewport, setViewport, children, cover, overlay, maxHeight, onBox, outline, pick, className }, forwardedRef) {
|
|
10814
10897
|
const ref = React.useRef(null);
|
|
10815
10898
|
React.useImperativeHandle(forwardedRef, () => ref.current);
|
|
10816
10899
|
const latest = React.useRef(viewport);
|
|
@@ -11070,6 +11153,7 @@ var ViewportFrame = React.forwardRef(function ViewportFrame({ label, aspect, vie
|
|
|
11070
11153
|
]
|
|
11071
11154
|
});
|
|
11072
11155
|
});
|
|
11156
|
+
|
|
11073
11157
|
// src/components/lightbox.tsx
|
|
11074
11158
|
/** Keeps the open picture in the URL (`?view=<id>`): a link or a reload opens it, Back closes it, and stepping between pictures replaces the entry. */
|
|
11075
11159
|
function useLightboxUrl(items, { param = "view" } = {}) {
|
|
@@ -11091,7 +11175,7 @@ function useLightboxUrl(items, { param = "view" } = {}) {
|
|
|
11091
11175
|
show: (to) => set(to, false)
|
|
11092
11176
|
};
|
|
11093
11177
|
}
|
|
11094
|
-
|
|
11178
|
+
const NARROW = "(max-width: 719px)";
|
|
11095
11179
|
function useNarrow() {
|
|
11096
11180
|
const [narrow, setNarrow] = React.useState(() => typeof matchMedia === "function" && matchMedia(NARROW).matches);
|
|
11097
11181
|
React.useEffect(() => {
|
|
@@ -11133,7 +11217,7 @@ function Lightbox({ title, items, index, onIndexChange, open, onOpenChange, miss
|
|
|
11133
11217
|
items
|
|
11134
11218
|
]);
|
|
11135
11219
|
const go = (to) => onIndexChange(Math.min(Math.max(to, 0), last));
|
|
11136
|
-
const keys = React.useRef((
|
|
11220
|
+
const keys = React.useRef((() => {}));
|
|
11137
11221
|
keys.current = (e) => {
|
|
11138
11222
|
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
11139
11223
|
if (e.target.closest?.("[role=\"toolbar\"], [role=\"listbox\"], input, textarea, select, [contenteditable=\"true\"]")) return;
|
|
@@ -11291,8 +11375,9 @@ function ThumbnailStrip({ items, at, onPick, badge, label = "Pictures in this se
|
|
|
11291
11375
|
}, it.id))
|
|
11292
11376
|
});
|
|
11293
11377
|
}
|
|
11378
|
+
|
|
11294
11379
|
// src/components/view-options.tsx
|
|
11295
|
-
|
|
11380
|
+
const collator = new Intl.Collator(void 0, {
|
|
11296
11381
|
numeric: true,
|
|
11297
11382
|
sensitivity: "base"
|
|
11298
11383
|
});
|
|
@@ -11318,7 +11403,7 @@ function sortRows(rows, value, descending = false) {
|
|
|
11318
11403
|
});
|
|
11319
11404
|
return keyed.map((k) => k.row);
|
|
11320
11405
|
}
|
|
11321
|
-
|
|
11406
|
+
const storeKey = (id) => `strata-view:${id}`;
|
|
11322
11407
|
function readStore(id) {
|
|
11323
11408
|
try {
|
|
11324
11409
|
const raw = localStorage.getItem(storeKey(id));
|
|
@@ -11498,7 +11583,7 @@ function useUrlView(names) {
|
|
|
11498
11583
|
}, { replace: true })
|
|
11499
11584
|
};
|
|
11500
11585
|
}
|
|
11501
|
-
|
|
11586
|
+
const ASPECTS = {
|
|
11502
11587
|
square: "Square",
|
|
11503
11588
|
portrait: "Portrait",
|
|
11504
11589
|
landscape: "Landscape"
|
|
@@ -11620,13 +11705,14 @@ function ViewOptions({ view, shown, total, label = "View options", className })
|
|
|
11620
11705
|
]
|
|
11621
11706
|
});
|
|
11622
11707
|
}
|
|
11708
|
+
|
|
11623
11709
|
// src/components/choice-grid.tsx
|
|
11624
|
-
|
|
11710
|
+
const minSide = {
|
|
11625
11711
|
md: 120,
|
|
11626
11712
|
lg: 160
|
|
11627
11713
|
};
|
|
11628
|
-
|
|
11629
|
-
|
|
11714
|
+
const closed = (s) => s === "right" || s === "answer" || s === "picked";
|
|
11715
|
+
const columns = (size) => ({ gridTemplateColumns: `repeat(auto-fill, minmax(min(${minSide[size]}px, 100%), 1fr))` });
|
|
11630
11716
|
/** 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. */
|
|
11631
11717
|
function ChoiceGrid({ label, items, itemKey, itemLabel, renderPicture, state, marks, onChoose, size = "md", className }) {
|
|
11632
11718
|
const byKey = new Map(items.map((item) => [itemKey(item), item]));
|
|
@@ -11675,11 +11761,12 @@ function ChoiceGridSkeleton({ count = 4, size = "md", className }) {
|
|
|
11675
11761
|
children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx("span", { className: "block aspect-square rounded-overlay bg-muted" }, i))
|
|
11676
11762
|
});
|
|
11677
11763
|
}
|
|
11764
|
+
|
|
11678
11765
|
// src/components/place-board.tsx
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11766
|
+
const pieceSide = 96;
|
|
11767
|
+
const placedSide = 72;
|
|
11768
|
+
const placedPicture = { "--type-picture-size": "2.5rem" };
|
|
11769
|
+
const placeSide = 160;
|
|
11683
11770
|
/** Pictures put into places with two taps (pick up, put down) for an answer that is an arrangement: give a number, order, match, sort. The app owns where each piece is and checks it; the board only moves what the learner asks. */
|
|
11684
11771
|
function PlaceBoard({ label, pieces, pieceKey, pieceLabel, renderPiece, places, placeKey, placeLabel, renderPlace, placement, onMove, pileLabel, placeState = () => "open", marks, locked = false, className }) {
|
|
11685
11772
|
const [heldKey, setHeld] = React.useState(null);
|
|
@@ -11780,8 +11867,9 @@ function PlaceBoard({ label, pieces, pieceKey, pieceLabel, renderPiece, places,
|
|
|
11780
11867
|
})]
|
|
11781
11868
|
});
|
|
11782
11869
|
}
|
|
11870
|
+
|
|
11783
11871
|
// src/components/infinite-list.tsx
|
|
11784
|
-
|
|
11872
|
+
const PendingFocus = React.createContext(null);
|
|
11785
11873
|
function MoreFailed({ message, retry }) {
|
|
11786
11874
|
return /* @__PURE__ */ jsxs("div", {
|
|
11787
11875
|
className: "flex flex-wrap items-start gap-3 border-t border-border bg-danger-subtle px-3 py-2 text-danger",
|
|
@@ -11802,7 +11890,7 @@ function MoreFailed({ message, retry }) {
|
|
|
11802
11890
|
]
|
|
11803
11891
|
});
|
|
11804
11892
|
}
|
|
11805
|
-
|
|
11893
|
+
const defaultMoreError = (failure) => /* @__PURE__ */ jsx(MoreFailed, { ...failure });
|
|
11806
11894
|
/**
|
|
11807
11895
|
* The row after a cursor-paged list or grid: loads the next page as it nears the screen, shows
|
|
11808
11896
|
* `moreSkeleton` while it comes, says why it failed with Try again, offers Show more for the
|
|
@@ -11982,8 +12070,9 @@ function InfiniteList({ state, label, children, skeleton, empty, moreLabel, more
|
|
|
11982
12070
|
})
|
|
11983
12071
|
});
|
|
11984
12072
|
}
|
|
12073
|
+
|
|
11985
12074
|
// src/components/line-chart.tsx
|
|
11986
|
-
|
|
12075
|
+
const TONE_FILL = {
|
|
11987
12076
|
neutral: "var(--muted)",
|
|
11988
12077
|
info: "var(--info-subtle)",
|
|
11989
12078
|
success: "var(--success-subtle)",
|
|
@@ -12057,7 +12146,7 @@ function yScale(values, pin = {}) {
|
|
|
12057
12146
|
].map((i) => min + (max - min) * i / 4)
|
|
12058
12147
|
};
|
|
12059
12148
|
}
|
|
12060
|
-
|
|
12149
|
+
const linearScale = (values, pin) => {
|
|
12061
12150
|
const y = yScale(values, pin);
|
|
12062
12151
|
return {
|
|
12063
12152
|
...y,
|
|
@@ -12142,7 +12231,7 @@ function valueAt(series, x) {
|
|
|
12142
12231
|
return sorted[sorted.length - 1].y;
|
|
12143
12232
|
}
|
|
12144
12233
|
/** Roughly how wide a 12px caption label is, in px. jsdom cannot measure text, so the chart estimates. */
|
|
12145
|
-
|
|
12234
|
+
const labelWidth = (text) => text.length * 7;
|
|
12146
12235
|
/**
|
|
12147
12236
|
* The x ticks that fit at this width: every k-th tick, the smallest k for which neighbouring labels
|
|
12148
12237
|
* leave a gap, so the spacing stays even. `scale` maps an x value to a pixel.
|
|
@@ -12897,6 +12986,7 @@ function LineChartGroup({ label, charts, formatX, xLabel, xTicks, spans, marks,
|
|
|
12897
12986
|
children: stack
|
|
12898
12987
|
});
|
|
12899
12988
|
}
|
|
12989
|
+
|
|
12900
12990
|
// src/components/page-header.tsx
|
|
12901
12991
|
/** The top of an Operate screen: a noun title, its scope, the main action, and the finding (the one fact in today's data that most needs attention). */
|
|
12902
12992
|
function PageHeader({ title, scope, actions, finding, as: Heading = "h1" }) {
|
|
@@ -12926,6 +13016,7 @@ function PageHeader({ title, scope, actions, finding, as: Heading = "h1" }) {
|
|
|
12926
13016
|
})]
|
|
12927
13017
|
});
|
|
12928
13018
|
}
|
|
13019
|
+
|
|
12929
13020
|
// src/components/undo.tsx
|
|
12930
13021
|
/**
|
|
12931
13022
|
* Schedules a reversible removal to commit after a window unless undone, and owns which items
|
|
@@ -13091,6 +13182,7 @@ function UndoBar({ undoable, inline = false }) {
|
|
|
13091
13182
|
})
|
|
13092
13183
|
});
|
|
13093
13184
|
}
|
|
13185
|
+
|
|
13094
13186
|
// src/components/done.tsx
|
|
13095
13187
|
/** The completion moment for a rare, earned finish: what happened (past tense, with its object), what happens next, and optionally a figure drawn from the person's own data. Focus moves to the heading. */
|
|
13096
13188
|
function Done({ title, next, figure, actions, focusOnMount = true, className }) {
|
|
@@ -13127,6 +13219,7 @@ function Done({ title, next, figure, actions, focusOnMount = true, className })
|
|
|
13127
13219
|
]
|
|
13128
13220
|
});
|
|
13129
13221
|
}
|
|
13222
|
+
|
|
13130
13223
|
// src/components/app-shell.tsx
|
|
13131
13224
|
/** The app frame: product name, side nav on the page ground (a scrollable row on phones), optional top bar, and the main region. */
|
|
13132
13225
|
function AppShell({ product, nav, navLabel = "Main", topBar, children, className }) {
|
|
@@ -13207,6 +13300,7 @@ function Breadcrumb({ items }) {
|
|
|
13207
13300
|
})
|
|
13208
13301
|
});
|
|
13209
13302
|
}
|
|
13303
|
+
|
|
13210
13304
|
// src/components/tabs.tsx
|
|
13211
13305
|
/** Tabs whose selection lives in a URL search parameter (React Router), with the ARIA tabs keyboard model. */
|
|
13212
13306
|
function Tabs({ param, items, label, children, className }) {
|
|
@@ -13239,6 +13333,7 @@ function Tabs({ param, items, label, children, className }) {
|
|
|
13239
13333
|
})]
|
|
13240
13334
|
});
|
|
13241
13335
|
}
|
|
13336
|
+
|
|
13242
13337
|
// src/components/active-list.tsx
|
|
13243
13338
|
/** Tracks the active item in a list worked through from the keyboard: moving, roving focus, and moving on when the active item is removed. */
|
|
13244
13339
|
function useActiveItem(items, getKey, { initial, noun } = {}) {
|
|
@@ -13360,6 +13455,7 @@ function ActiveList({ label, active, empty, children, className }) {
|
|
|
13360
13455
|
})
|
|
13361
13456
|
});
|
|
13362
13457
|
}
|
|
13458
|
+
|
|
13363
13459
|
// src/query/outbox.ts
|
|
13364
13460
|
/** Whether a failure is the server's answer for good (refused) rather than for now (waiting). */
|
|
13365
13461
|
function isRefusal(error) {
|
|
@@ -13607,6 +13703,7 @@ function useOutbox(outbox) {
|
|
|
13607
13703
|
function useOutboxStarted(outbox) {
|
|
13608
13704
|
React.useEffect(() => outbox.start(), [outbox]);
|
|
13609
13705
|
}
|
|
13706
|
+
|
|
13610
13707
|
// src/components/outbox-status.tsx
|
|
13611
13708
|
/** Says how many writes wait on this device and why, with Send now, and lists any the server refused; renders nothing while all is sent. */
|
|
13612
13709
|
function OutboxStatus({ outbox, noun, className }) {
|
|
@@ -13663,6 +13760,7 @@ function OutboxStatus({ outbox, noun, className }) {
|
|
|
13663
13760
|
})]
|
|
13664
13761
|
});
|
|
13665
13762
|
}
|
|
13763
|
+
|
|
13666
13764
|
// src/query/reserve.ts
|
|
13667
13765
|
function defaultStorage() {
|
|
13668
13766
|
try {
|
|
@@ -13761,8 +13859,9 @@ function useReserve(reserve, key) {
|
|
|
13761
13859
|
}, [reserve]);
|
|
13762
13860
|
return React.useSyncExternalStore(subscribe, () => reserve.kept(key), () => 0);
|
|
13763
13861
|
}
|
|
13862
|
+
|
|
13764
13863
|
// src/lib/speech.ts
|
|
13765
|
-
|
|
13864
|
+
const partsOf = (saying) => (typeof saying === "string" ? [{ text: saying }] : [...saying]).filter((p) => p.text.trim() || p.clip);
|
|
13766
13865
|
/** The words of what is said, as one sentence: what the browser's voice says when a recording is missing, and the button's name. */
|
|
13767
13866
|
function textOf(saying) {
|
|
13768
13867
|
return partsOf(saying).map((p) => p.text.trim()).filter(Boolean).join(" ");
|
|
@@ -13771,7 +13870,7 @@ function textOf(saying) {
|
|
|
13771
13870
|
function canPlayClips() {
|
|
13772
13871
|
return typeof window !== "undefined" && typeof window.Audio === "function";
|
|
13773
13872
|
}
|
|
13774
|
-
|
|
13873
|
+
const allRecorded = (parts) => parts.length > 0 && parts.every((p) => p.clip);
|
|
13775
13874
|
/** Whether `saying` can be said here: every part recorded and audio plays, or the browser has speech and there are words. */
|
|
13776
13875
|
function canSay(saying) {
|
|
13777
13876
|
const parts = partsOf(saying);
|
|
@@ -13789,7 +13888,7 @@ function pickVoice(voices, lang) {
|
|
|
13789
13888
|
return voices.find((v) => v.lang.toLowerCase().replace("_", "-") === wanted) ?? voices.find((v) => v.lang.toLowerCase().replace("_", "-").split("-")[0] === base);
|
|
13790
13889
|
}
|
|
13791
13890
|
/** The recording playing now, so the next prompt or `stopSpeaking` can cut it off. */
|
|
13792
|
-
|
|
13891
|
+
let playing;
|
|
13793
13892
|
function speakText(text, { lang, rate = .9, onEnd }) {
|
|
13794
13893
|
if (!canSpeak() || !text.trim()) return false;
|
|
13795
13894
|
const synth = window.speechSynthesis;
|
|
@@ -13903,10 +14002,11 @@ function useSpeech({ lang, rate, muted = false } = {}) {
|
|
|
13903
14002
|
}, [])
|
|
13904
14003
|
};
|
|
13905
14004
|
}
|
|
14005
|
+
|
|
13906
14006
|
// src/query/clips.tsx
|
|
13907
14007
|
/** The query key of the clip list: invalidate it after a recording is kept, `queryClient.invalidateQueries({ queryKey: clipsQueryKey })`. */
|
|
13908
|
-
|
|
13909
|
-
|
|
14008
|
+
const clipsQueryKey = ["strata", "clips"];
|
|
14009
|
+
const Context$1 = React.createContext({
|
|
13910
14010
|
ready: true,
|
|
13911
14011
|
parts: (text) => [{
|
|
13912
14012
|
text,
|
|
@@ -13976,6 +14076,7 @@ function useSayOnShow(text, { muted = false } = {}) {
|
|
|
13976
14076
|
text
|
|
13977
14077
|
]);
|
|
13978
14078
|
}
|
|
14079
|
+
|
|
13979
14080
|
// src/components/say-again.tsx
|
|
13980
14081
|
/** An icon button that says one sentence aloud, from its recordings when given, else with the browser's voice; hidden where neither can be heard or it is muted. */
|
|
13981
14082
|
function SayAgain({ text, parts, verb = "Say", className, ...options }) {
|
|
@@ -13994,9 +14095,10 @@ function SayAgain({ text, parts, verb = "Say", className, ...options }) {
|
|
|
13994
14095
|
className
|
|
13995
14096
|
});
|
|
13996
14097
|
}
|
|
14098
|
+
|
|
13997
14099
|
// src/lib/recording.ts
|
|
13998
14100
|
/** The quietest level a speech meter draws, in dBFS: below it is silence for speech. */
|
|
13999
|
-
|
|
14101
|
+
const LEVEL_FLOOR_DB = -60;
|
|
14000
14102
|
/** Joins chunks of samples into one buffer, in order. */
|
|
14001
14103
|
function joinSamples(chunks) {
|
|
14002
14104
|
const out = new Float32Array(chunks.reduce((n, c) => n + c.length, 0));
|
|
@@ -14057,6 +14159,7 @@ function speechLevel(peak) {
|
|
|
14057
14159
|
advice: "The level suits speech."
|
|
14058
14160
|
};
|
|
14059
14161
|
}
|
|
14162
|
+
|
|
14060
14163
|
// src/components/recorder.tsx
|
|
14061
14164
|
/** Records one take at a time from the microphone, with its live level, as a lossless WAV. */
|
|
14062
14165
|
function useRecorder({ maxSeconds, microphone }) {
|
|
@@ -14150,8 +14253,8 @@ function useRecorder({ maxSeconds, microphone }) {
|
|
|
14150
14253
|
};
|
|
14151
14254
|
}
|
|
14152
14255
|
/** `InputLevel`'s "Too loud" notch: -3 dBFS on the meter's `LEVEL_FLOOR_DB`..0 scale. */
|
|
14153
|
-
|
|
14154
|
-
at: -
|
|
14256
|
+
const inputLevelThresholds = [{
|
|
14257
|
+
at: (-60 + 3) / -60,
|
|
14155
14258
|
tone: "danger",
|
|
14156
14259
|
label: "Too loud"
|
|
14157
14260
|
}];
|
|
@@ -14161,7 +14264,7 @@ function InputLevel({ level, seconds, maxSeconds, label = "Input level", classNa
|
|
|
14161
14264
|
return /* @__PURE__ */ jsx(Meter, {
|
|
14162
14265
|
label,
|
|
14163
14266
|
value: db - -60,
|
|
14164
|
-
max: 60,
|
|
14267
|
+
max: - -60,
|
|
14165
14268
|
thresholds: inputLevelThresholds,
|
|
14166
14269
|
valueText: `${format.integer(Math.round(db) || 0)}\u00a0dBFS`,
|
|
14167
14270
|
detail: `Recording ${format.runningTime(seconds)} of at most ${format.runningTime(maxSeconds)}`,
|
|
@@ -14187,13 +14290,14 @@ function TakeLevel({ peak, lead, className }) {
|
|
|
14187
14290
|
})]
|
|
14188
14291
|
});
|
|
14189
14292
|
}
|
|
14293
|
+
|
|
14190
14294
|
// src/lib/segmenter.ts
|
|
14191
|
-
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14295
|
+
const FRAME_SECONDS = .02;
|
|
14296
|
+
const ONSET_FRAMES = 3;
|
|
14297
|
+
const HYSTERESIS_DB = 6;
|
|
14298
|
+
const RISE_DB_PER_SECOND = 2.5;
|
|
14299
|
+
const FALL = .2;
|
|
14300
|
+
const SILENT_DB = -100;
|
|
14197
14301
|
/** The RMS of `frame` in dBFS, `SILENT_DB` for zeros. */
|
|
14198
14302
|
function rmsDb(frame) {
|
|
14199
14303
|
let sum = 0;
|
|
@@ -14329,6 +14433,7 @@ function createSegmenter(sampleRate, { onsetDb = 12, floorDb = -55, silenceSecon
|
|
|
14329
14433
|
}
|
|
14330
14434
|
};
|
|
14331
14435
|
}
|
|
14436
|
+
|
|
14332
14437
|
// src/components/auto-recorder.tsx
|
|
14333
14438
|
/** Listens all the time and hands over each stretch of speech as its own lossless take. */
|
|
14334
14439
|
function useAutoRecorder({ maxSeconds, onTake, paused = false, microphone, ...tuning }) {
|
|
@@ -14463,18 +14568,19 @@ function ListeningLevel({ state, maxSeconds, label = "Input level", className })
|
|
|
14463
14568
|
return /* @__PURE__ */ jsx(Meter, {
|
|
14464
14569
|
label,
|
|
14465
14570
|
value: db - -60,
|
|
14466
|
-
max: 60,
|
|
14571
|
+
max: - -60,
|
|
14467
14572
|
thresholds: inputLevelThresholds,
|
|
14468
14573
|
valueText: `${format.integer(Math.round(db) || 0)} dBFS`,
|
|
14469
14574
|
detail,
|
|
14470
14575
|
className
|
|
14471
14576
|
});
|
|
14472
14577
|
}
|
|
14578
|
+
|
|
14473
14579
|
// src/lib/image-diff.ts
|
|
14474
14580
|
/** The longest side, in pixels, a picture is compared at. */
|
|
14475
|
-
|
|
14581
|
+
const MAX_SIDE = 2048;
|
|
14476
14582
|
/** pixelmatch's own default colour distance below which two pixels are the same. */
|
|
14477
|
-
|
|
14583
|
+
const DEFAULT_TOLERANCE = .1;
|
|
14478
14584
|
/** 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. */
|
|
14479
14585
|
function resample(p, width, height) {
|
|
14480
14586
|
if (p.width === width && p.height === height) return p;
|
|
@@ -14539,6 +14645,7 @@ async function readPixels(src, maxSide = MAX_SIDE) {
|
|
|
14539
14645
|
height
|
|
14540
14646
|
};
|
|
14541
14647
|
}
|
|
14648
|
+
|
|
14542
14649
|
// src/components/difference.tsx
|
|
14543
14650
|
/** The pixels that differ between two pictures at a tolerance (0 to 1), read only while `enabled`. */
|
|
14544
14651
|
function useDifference(a, b, tolerance, enabled, read = readPixels) {
|
|
@@ -14595,8 +14702,9 @@ function DifferenceMarks({ difference }) {
|
|
|
14595
14702
|
className: "absolute inset-0 size-full object-contain"
|
|
14596
14703
|
});
|
|
14597
14704
|
}
|
|
14705
|
+
|
|
14598
14706
|
// src/components/compare-regions.tsx
|
|
14599
|
-
|
|
14707
|
+
const REGION_KEYS = [
|
|
14600
14708
|
"q",
|
|
14601
14709
|
"w",
|
|
14602
14710
|
"e",
|
|
@@ -14722,15 +14830,16 @@ function RegionChips({ state }) {
|
|
|
14722
14830
|
})
|
|
14723
14831
|
});
|
|
14724
14832
|
}
|
|
14833
|
+
|
|
14725
14834
|
// src/components/compare.tsx
|
|
14726
|
-
|
|
14835
|
+
const MODE_LABEL$1 = {
|
|
14727
14836
|
side: "Side by side",
|
|
14728
14837
|
swipe: "Swipe",
|
|
14729
14838
|
fade: "Fade",
|
|
14730
14839
|
blink: "Blink",
|
|
14731
14840
|
difference: "Difference"
|
|
14732
14841
|
};
|
|
14733
|
-
|
|
14842
|
+
const ALL_MODES = [
|
|
14734
14843
|
"side",
|
|
14735
14844
|
"swipe",
|
|
14736
14845
|
"fade",
|
|
@@ -15086,6 +15195,7 @@ function Compare({ label, a, b, blind, missing, mode, onModeChange, modes = ALL_
|
|
|
15086
15195
|
})
|
|
15087
15196
|
});
|
|
15088
15197
|
}
|
|
15198
|
+
|
|
15089
15199
|
// src/components/pair-vote.tsx
|
|
15090
15200
|
/** A blind pairwise judgment of two pictures: `Compare`, answer keys in its legend, and a vote bar that never leans on either side. */
|
|
15091
15201
|
function PairVote({ pair, skeleton, empty, onAnswer, pending, progress, flagReasons, preload, last, words, ...compare }) {
|
|
@@ -15255,7 +15365,11 @@ function Judged({ pair, onAnswer, pending, flagReasons, words, last, view }) {
|
|
|
15255
15365
|
onPick: pending ? void 0 : (side) => answer({ answer: side })
|
|
15256
15366
|
}, pair) });
|
|
15257
15367
|
}
|
|
15258
|
-
|
|
15368
|
+
|
|
15369
|
+
// src/lib/loudness.ts
|
|
15370
|
+
/** The most of a clip that is measured, in seconds. */
|
|
15371
|
+
const MAX_SECONDS = 120;
|
|
15372
|
+
const db$1 = (x) => x > 0 ? 20 * Math.log10(x) : -Infinity;
|
|
15259
15373
|
/** The RMS and peak of channel data (-1 to 1), over all channels together. */
|
|
15260
15374
|
function loudnessOf(channels) {
|
|
15261
15375
|
let sum = 0;
|
|
@@ -15289,7 +15403,7 @@ function matchGains(a, b) {
|
|
|
15289
15403
|
};
|
|
15290
15404
|
}
|
|
15291
15405
|
/** dB to a media element's volume (0 to 1). */
|
|
15292
|
-
|
|
15406
|
+
const gainToVolume = (decibels) => Math.min(1, Math.max(0, 10 ** (decibels / 20)));
|
|
15293
15407
|
/** Fetches and decodes a clip and measures it. Needs the Web Audio API; reads at most `MAX_SECONDS`. */
|
|
15294
15408
|
async function measureLoudness(src) {
|
|
15295
15409
|
const response = await fetch(src);
|
|
@@ -15303,8 +15417,9 @@ async function measureLoudness(src) {
|
|
|
15303
15417
|
context.close();
|
|
15304
15418
|
}
|
|
15305
15419
|
}
|
|
15420
|
+
|
|
15306
15421
|
// src/components/compare-audio.tsx
|
|
15307
|
-
|
|
15422
|
+
const db = (x) => `${Math.abs(x).toFixed(1)} dB`;
|
|
15308
15423
|
/** Two clips to judge by ear: one transport, a switch that keeps the playhead, a loop, and matched levels. */
|
|
15309
15424
|
function CompareAudio({ label, a, b, blind, missing, levelMatch = true, align = "auto", measure = measureLoudness, keys = true, extraShortcuts = [], footer, className }) {
|
|
15310
15425
|
const refA = React.useRef(null);
|
|
@@ -15617,9 +15732,10 @@ function CompareAudio({ label, a, b, blind, missing, levelMatch = true, align =
|
|
|
15617
15732
|
]
|
|
15618
15733
|
});
|
|
15619
15734
|
}
|
|
15735
|
+
|
|
15620
15736
|
// src/components/video-clock.tsx
|
|
15621
15737
|
/** Speeds offered by default: slow motion for sitting on a moment. */
|
|
15622
|
-
|
|
15738
|
+
const SLOW_RATES = [
|
|
15623
15739
|
.1,
|
|
15624
15740
|
.25,
|
|
15625
15741
|
.5,
|
|
@@ -16063,8 +16179,9 @@ function VideoControls({ clock, rates = SLOW_RATES, moments = [] }) {
|
|
|
16063
16179
|
]
|
|
16064
16180
|
})] });
|
|
16065
16181
|
}
|
|
16182
|
+
|
|
16066
16183
|
// src/components/compare-video-grid.tsx
|
|
16067
|
-
|
|
16184
|
+
const COLUMNS$1 = {
|
|
16068
16185
|
2: "sm:grid-cols-2",
|
|
16069
16186
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
16070
16187
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
@@ -16230,14 +16347,15 @@ function CompareVideoGrid({ label, items, reference, blind, missing, catchingUp
|
|
|
16230
16347
|
})
|
|
16231
16348
|
});
|
|
16232
16349
|
}
|
|
16350
|
+
|
|
16233
16351
|
// src/components/compare-video.tsx
|
|
16234
|
-
|
|
16352
|
+
const MODES = [
|
|
16235
16353
|
"side",
|
|
16236
16354
|
"swipe",
|
|
16237
16355
|
"fade",
|
|
16238
16356
|
"blink"
|
|
16239
16357
|
];
|
|
16240
|
-
|
|
16358
|
+
const MODE_LABEL = {
|
|
16241
16359
|
side: "Side by side",
|
|
16242
16360
|
swipe: "Swipe",
|
|
16243
16361
|
fade: "Fade",
|
|
@@ -16503,8 +16621,12 @@ function CompareVideo({ label, a, b, blind, missing, mode, onModeChange, rates =
|
|
|
16503
16621
|
})
|
|
16504
16622
|
});
|
|
16505
16623
|
}
|
|
16506
|
-
|
|
16507
|
-
|
|
16624
|
+
|
|
16625
|
+
// src/lib/text-diff.ts
|
|
16626
|
+
/** The most words in A times the most in B that are compared; a bigger pair is not. */
|
|
16627
|
+
const MAX_CELLS = 25e5;
|
|
16628
|
+
const tokens = (text) => text.split(/(\s+)/).filter((t) => t !== "");
|
|
16629
|
+
const isSpace = (t) => /^\s+$/.test(t);
|
|
16508
16630
|
/** Marks the words that differ between two texts, or returns null when the pair is too long to compare. */
|
|
16509
16631
|
function diffWords(a, b) {
|
|
16510
16632
|
const ta = tokens(a);
|
|
@@ -16555,6 +16677,7 @@ function diffWords(a, b) {
|
|
|
16555
16677
|
changedB: rb.changed
|
|
16556
16678
|
};
|
|
16557
16679
|
}
|
|
16680
|
+
|
|
16558
16681
|
// src/components/compare-text.tsx
|
|
16559
16682
|
function Words({ segments, changed }) {
|
|
16560
16683
|
return /* @__PURE__ */ jsx(Fragment, { children: segments.map((s, i) => changed && s.changed ? /* @__PURE__ */ jsx("mark", {
|
|
@@ -16685,8 +16808,9 @@ function CompareText({ label, a, b, blind, reference, defaultDiff = false, tooLo
|
|
|
16685
16808
|
]
|
|
16686
16809
|
});
|
|
16687
16810
|
}
|
|
16811
|
+
|
|
16688
16812
|
// src/components/compare-grid.tsx
|
|
16689
|
-
|
|
16813
|
+
const COLUMNS = {
|
|
16690
16814
|
2: "sm:grid-cols-2",
|
|
16691
16815
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
16692
16816
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
@@ -16781,8 +16905,9 @@ function CompareGrid({ label, items, blind, missing, actions, columns = 3, regio
|
|
|
16781
16905
|
})
|
|
16782
16906
|
});
|
|
16783
16907
|
}
|
|
16908
|
+
|
|
16784
16909
|
// src/components/workspace.tsx
|
|
16785
|
-
|
|
16910
|
+
const readPersisted = (key) => {
|
|
16786
16911
|
const empty = {
|
|
16787
16912
|
sizes: {},
|
|
16788
16913
|
collapsed: {}
|
|
@@ -16858,13 +16983,13 @@ function useWorkspaceState(persist) {
|
|
|
16858
16983
|
narrowOpen
|
|
16859
16984
|
]);
|
|
16860
16985
|
}
|
|
16861
|
-
|
|
16862
|
-
|
|
16986
|
+
const StateContext = React.createContext(null);
|
|
16987
|
+
const useState_ = () => {
|
|
16863
16988
|
const state = React.useContext(StateContext);
|
|
16864
16989
|
if (!state) throw new Error("strata-react: a Pane or Split must be inside a Workspace.");
|
|
16865
16990
|
return state;
|
|
16866
16991
|
};
|
|
16867
|
-
|
|
16992
|
+
const SlotContext = React.createContext({
|
|
16868
16993
|
direction: "row",
|
|
16869
16994
|
edge: "only",
|
|
16870
16995
|
stacked: false
|
|
@@ -16925,7 +17050,7 @@ function WorkspaceBar({ title, status, actions, end, className }) {
|
|
|
16925
17050
|
]
|
|
16926
17051
|
});
|
|
16927
17052
|
}
|
|
16928
|
-
|
|
17053
|
+
const iconsFor = (direction, edge, stacked) => {
|
|
16929
17054
|
if (stacked || direction === "column") return edge === "start" ? [PanelTopClose, PanelTopOpen] : [PanelBottomClose, PanelBottomOpen];
|
|
16930
17055
|
return edge === "end" ? [PanelRightClose, PanelRightOpen] : [PanelLeftClose, PanelLeftOpen];
|
|
16931
17056
|
};
|
|
@@ -16995,8 +17120,8 @@ function Pane({ id, name, grow, size = 280, min, max, collapsible, defaultCollap
|
|
|
16995
17120
|
})]
|
|
16996
17121
|
});
|
|
16997
17122
|
}
|
|
16998
|
-
|
|
16999
|
-
|
|
17123
|
+
const isPane = (c) => React.isValidElement(c) && c.type === Pane;
|
|
17124
|
+
const clamp = (n, lo, hi) => Math.min(Math.max(n, lo), hi);
|
|
17000
17125
|
function Separator$1({ pane, direction, sign, container }) {
|
|
17001
17126
|
const state = useState_();
|
|
17002
17127
|
const [moving, setMoving] = React.useState(false);
|
|
@@ -17118,8 +17243,9 @@ function Split({ direction, className, children }) {
|
|
|
17118
17243
|
children: out
|
|
17119
17244
|
});
|
|
17120
17245
|
}
|
|
17246
|
+
|
|
17121
17247
|
// src/components/history.tsx
|
|
17122
|
-
|
|
17248
|
+
const compose = (older, newer) => ({
|
|
17123
17249
|
label: older.label,
|
|
17124
17250
|
key: older.key,
|
|
17125
17251
|
undo: () => {
|
|
@@ -17283,6 +17409,7 @@ function useHistoryState(initial, options) {
|
|
|
17283
17409
|
history
|
|
17284
17410
|
};
|
|
17285
17411
|
}
|
|
17412
|
+
|
|
17286
17413
|
// src/components/save.tsx
|
|
17287
17414
|
/** Saves `value` after changes settle, never two at once, and says where it stands. The document's first `value` counts as saved. */
|
|
17288
17415
|
function useAutoSave({ value, save, delayMs = 1500, equals = Object.is, describeError = describeActionError }) {
|
|
@@ -17392,7 +17519,7 @@ function useLeaveGuard(active) {
|
|
|
17392
17519
|
return () => window.removeEventListener("beforeunload", onBeforeUnload);
|
|
17393
17520
|
}, [active]);
|
|
17394
17521
|
}
|
|
17395
|
-
|
|
17522
|
+
const labelOf$1 = (s) => s.status === "saved" ? s.at ? `Saved ${format.clock(s.at)}` : "Saved" : s.status === "saving" ? "Saving…" : s.status === "dirty" ? "Unsaved changes" : "Not saved";
|
|
17396
17523
|
/**
|
|
17397
17524
|
* The sign of whether the work is safe: "Saved 10:42", "Saving…", "Unsaved changes", or "Not saved"
|
|
17398
17525
|
* with the reason and "Try again". Fixed width, so it never moves what is beside it. Announces a
|
|
@@ -17460,8 +17587,9 @@ function SaveStatus({ state, onRetry, className }) {
|
|
|
17460
17587
|
]
|
|
17461
17588
|
});
|
|
17462
17589
|
}
|
|
17590
|
+
|
|
17463
17591
|
// src/lib/rich-text.ts
|
|
17464
|
-
|
|
17592
|
+
const WORD = /[\p{L}\p{N}_-]/u;
|
|
17465
17593
|
/** Finds ids in `text`, longest first, never inside a longer word. Overlaps go to the earlier, longer match. */
|
|
17466
17594
|
function matchEntities(text, matcher) {
|
|
17467
17595
|
if (!matcher) return [];
|
|
@@ -17625,8 +17753,9 @@ function parseRichText(text, matcher) {
|
|
|
17625
17753
|
function plainText(text) {
|
|
17626
17754
|
return text.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*\*|`/g, "").replace(/^\s*(?:[-*]|\d+[.)])\s+/gm, "").replace(/\s+/g, " ").trim();
|
|
17627
17755
|
}
|
|
17756
|
+
|
|
17628
17757
|
// src/components/conversation.tsx
|
|
17629
|
-
|
|
17758
|
+
const LINK = "text-primary underline underline-offset-2 hover:no-underline";
|
|
17630
17759
|
function renderInline(nodes, onOpen, keyBase = "") {
|
|
17631
17760
|
return nodes.map((n, i) => {
|
|
17632
17761
|
const key = `${keyBase}${i}`;
|
|
@@ -17676,7 +17805,7 @@ function RichText({ children, entities, onOpen, className }) {
|
|
|
17676
17805
|
children: renderBlocks(blocks, onOpen)
|
|
17677
17806
|
});
|
|
17678
17807
|
}
|
|
17679
|
-
|
|
17808
|
+
const NEAR_BOTTOM = 24;
|
|
17680
17809
|
/** A thread of turns: answers stream, finish or fail in place; the log follows only while the person is at the bottom (with Jump to latest), and a finished answer is announced once, politely. */
|
|
17681
17810
|
function Conversation({ label, turns, answerName, personName = "You", entities, onOpen, onRetry, empty, lookedUpLabel = "What it looked up", className }) {
|
|
17682
17811
|
const box = React.useRef(null);
|
|
@@ -17883,8 +18012,9 @@ function Composer({ label, onSend, answering = false, onStop, answeringReason, s
|
|
|
17883
18012
|
]
|
|
17884
18013
|
});
|
|
17885
18014
|
}
|
|
18015
|
+
|
|
17886
18016
|
// src/lib/region.ts
|
|
17887
|
-
|
|
18017
|
+
const HANDLES = [
|
|
17888
18018
|
"nw",
|
|
17889
18019
|
"n",
|
|
17890
18020
|
"ne",
|
|
@@ -18022,7 +18152,7 @@ function lerpRect(a, b, t, easing = "ease-in-out") {
|
|
|
18022
18152
|
};
|
|
18023
18153
|
}
|
|
18024
18154
|
/** True when two rectangles are the same to the unit's thousandth. */
|
|
18025
|
-
|
|
18155
|
+
const sameRect = (a, b) => [
|
|
18026
18156
|
"x",
|
|
18027
18157
|
"y",
|
|
18028
18158
|
"w",
|
|
@@ -18092,7 +18222,7 @@ function joinRects(a, b) {
|
|
|
18092
18222
|
};
|
|
18093
18223
|
}
|
|
18094
18224
|
/** The x of the gutter between two windows: halfway between the left one's right edge and the right one's left edge. */
|
|
18095
|
-
|
|
18225
|
+
const gutterOf = (left, right) => (left.x + left.w + right.x) / 2;
|
|
18096
18226
|
/** Moves the gutter by `dx`: the left window's right edge and the right window's left edge both move, so they resize together and the gap between them is kept. Neither shrinks below `min` wide, and neither leaves the bounds. */
|
|
18097
18227
|
function moveGutter(left, right, dx, { bounds, min }) {
|
|
18098
18228
|
const mw = min?.w ?? 0;
|
|
@@ -18108,8 +18238,9 @@ function moveGutter(left, right, dx, { bounds, min }) {
|
|
|
18108
18238
|
w: right.w - d
|
|
18109
18239
|
}];
|
|
18110
18240
|
}
|
|
18241
|
+
|
|
18111
18242
|
// src/components/region-editor.tsx
|
|
18112
|
-
|
|
18243
|
+
const TONE = {
|
|
18113
18244
|
neutral: {
|
|
18114
18245
|
edge: "var(--foreground)",
|
|
18115
18246
|
fill: "var(--muted)"
|
|
@@ -18131,7 +18262,7 @@ var TONE = {
|
|
|
18131
18262
|
fill: "var(--danger-subtle)"
|
|
18132
18263
|
}
|
|
18133
18264
|
};
|
|
18134
|
-
|
|
18265
|
+
const CURSOR = {
|
|
18135
18266
|
n: "ns-resize",
|
|
18136
18267
|
s: "ns-resize",
|
|
18137
18268
|
e: "ew-resize",
|
|
@@ -18141,7 +18272,7 @@ var CURSOR = {
|
|
|
18141
18272
|
nw: "nwse-resize",
|
|
18142
18273
|
se: "nwse-resize"
|
|
18143
18274
|
};
|
|
18144
|
-
|
|
18275
|
+
const HANDLE_AT = {
|
|
18145
18276
|
nw: "left-0 top-0 -translate-x-1/2 -translate-y-1/2",
|
|
18146
18277
|
n: "left-1/2 top-0 -translate-x-1/2 -translate-y-1/2",
|
|
18147
18278
|
ne: "right-0 top-0 translate-x-1/2 -translate-y-1/2",
|
|
@@ -18151,9 +18282,9 @@ var HANDLE_AT = {
|
|
|
18151
18282
|
sw: "left-0 bottom-0 -translate-x-1/2 translate-y-1/2",
|
|
18152
18283
|
w: "left-0 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
18153
18284
|
};
|
|
18154
|
-
|
|
18285
|
+
const round = (n) => format.integer(Math.round(n));
|
|
18155
18286
|
/** A window said in words. */
|
|
18156
|
-
|
|
18287
|
+
const describeRegion = (r) => `${r.label}: ${round(r.w)} wide by ${round(r.h)} high, ${round(r.x)} across and ${round(r.y)} down`;
|
|
18157
18288
|
/** Draw and move one or two named windows on a picture, with pointer, keyboard and numbers kept in step; aspect and bounds hold through all three; two windows make a from/to move with a Watch preview. */
|
|
18158
18289
|
function RegionEditor({ label, children, size, regions, onChange, selectedId, onSelectedChange, aspect, min, bounds, step, onDraw, mode = "single", onPreview, duration = 1500, easing = "ease-in-out", fields = true, unit = "px", defaults, angle = 0, onAngleChange, guide, spreadLabels = {
|
|
18159
18290
|
one: "Page",
|
|
@@ -18764,6 +18895,7 @@ function RegionEditor({ label, children, size, regions, onChange, selectedId, on
|
|
|
18764
18895
|
]
|
|
18765
18896
|
});
|
|
18766
18897
|
}
|
|
18898
|
+
|
|
18767
18899
|
// src/lib/book.ts
|
|
18768
18900
|
/**
|
|
18769
18901
|
* The pages shown together, as indexes into the set. In a spread the first page stands alone on
|
|
@@ -18781,7 +18913,7 @@ function viewsOf(count, spread) {
|
|
|
18781
18913
|
function viewOf(index, spread) {
|
|
18782
18914
|
return spread ? index <= 0 ? 0 : Math.floor((index + 1) / 2) : Math.max(index, 0);
|
|
18783
18915
|
}
|
|
18784
|
-
|
|
18916
|
+
const norm = (s) => s.trim().toLowerCase();
|
|
18785
18917
|
/**
|
|
18786
18918
|
* Finds the page a person typed. A printed label wins ("iv", "12") because that is what is printed
|
|
18787
18919
|
* on the page they are looking at; otherwise it is the scan's own position ("22" is the 22nd
|
|
@@ -18797,7 +18929,7 @@ function findPage(pages, query) {
|
|
|
18797
18929
|
return scan >= 0 ? scan : null;
|
|
18798
18930
|
}
|
|
18799
18931
|
/** A page said in words: "Page 22 (12)" or "Page 22" with no printed label. */
|
|
18800
|
-
|
|
18932
|
+
const pageName = (p, word = "Page") => `${word} ${p.scan}${p.printed ? ` (${p.printed})` : ""}`;
|
|
18801
18933
|
/** Where the viewer is, in words: "Page 22 (12) of 44", or "Pages 22 and 23 of 44" for a spread. */
|
|
18802
18934
|
function sayPosition(shown, total, word = "Page", plural = "Pages") {
|
|
18803
18935
|
if (shown.length === 0) return "";
|
|
@@ -18805,6 +18937,7 @@ function sayPosition(shown, total, word = "Page", plural = "Pages") {
|
|
|
18805
18937
|
const label = (p) => `${p.scan}${p.printed ? ` (${p.printed})` : ""}`;
|
|
18806
18938
|
return `${plural} ${label(shown[0])} and ${label(shown[1])} of ${total}`;
|
|
18807
18939
|
}
|
|
18940
|
+
|
|
18808
18941
|
// src/components/book-viewer.tsx
|
|
18809
18942
|
/** 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. */
|
|
18810
18943
|
function useBookUrl(count, { param = "page" } = {}) {
|
|
@@ -19033,6 +19166,7 @@ function BookViewer({ label, pages, index, onIndexChange, missing, layout = "spr
|
|
|
19033
19166
|
]
|
|
19034
19167
|
});
|
|
19035
19168
|
}
|
|
19169
|
+
|
|
19036
19170
|
// src/components/box-overlay.tsx
|
|
19037
19171
|
/** Holds the active and pointed box for a `BoxOverlay` and the `BoxList` beside it. */
|
|
19038
19172
|
function useBoxes(initial = null) {
|
|
@@ -19056,14 +19190,14 @@ function useBoxes(initial = null) {
|
|
|
19056
19190
|
choose
|
|
19057
19191
|
]);
|
|
19058
19192
|
}
|
|
19059
|
-
|
|
19193
|
+
const STROKE = {
|
|
19060
19194
|
neutral: "var(--foreground)",
|
|
19061
19195
|
info: "var(--info)",
|
|
19062
19196
|
success: "var(--success)",
|
|
19063
19197
|
warning: "var(--warning)",
|
|
19064
19198
|
danger: "var(--danger)"
|
|
19065
19199
|
};
|
|
19066
|
-
|
|
19200
|
+
const FILL = {
|
|
19067
19201
|
neutral: "var(--muted)",
|
|
19068
19202
|
info: "var(--info-subtle)",
|
|
19069
19203
|
success: "var(--success-subtle)",
|
|
@@ -19176,6 +19310,7 @@ function BoxList({ label, boxes, state, renderBox, className }) {
|
|
|
19176
19310
|
})
|
|
19177
19311
|
});
|
|
19178
19312
|
}
|
|
19313
|
+
|
|
19179
19314
|
// src/components/boxed-picture.tsx
|
|
19180
19315
|
/** 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`. */
|
|
19181
19316
|
function BoxedPicture({ label, src, alt, missing, of, boxes, state, boxesLabel, zoom = true, margin = .75, maxHeight = "70svh", onChoose, className }) {
|
|
@@ -19241,8 +19376,9 @@ function BoxedPicture({ label, src, alt, missing, of, boxes, state, boxesLabel,
|
|
|
19241
19376
|
})]
|
|
19242
19377
|
});
|
|
19243
19378
|
}
|
|
19379
|
+
|
|
19244
19380
|
// src/lib/sequence.ts
|
|
19245
|
-
|
|
19381
|
+
const EPS = 1e-9;
|
|
19246
19382
|
/** The grid point nearest to `time`, or `time` itself when there is no grid. */
|
|
19247
19383
|
function snapToGrid(time, grid) {
|
|
19248
19384
|
if (grid === void 0) return time;
|
|
@@ -19304,9 +19440,10 @@ function settleCut(wanted, grid, room) {
|
|
|
19304
19440
|
limit: held.limit
|
|
19305
19441
|
};
|
|
19306
19442
|
}
|
|
19443
|
+
|
|
19307
19444
|
// src/components/sequence-timeline.tsx
|
|
19308
|
-
|
|
19309
|
-
|
|
19445
|
+
const seconds = (n) => `${tidy(Math.round(n * 10) / 10)} s`;
|
|
19446
|
+
const at = (t) => tickLabel(t, .1);
|
|
19310
19447
|
/** A gapless strip of windows whose cuts are dragged or stepped, snapping to a beat grid inside the room the app gives; each cut is a slider that announces both windows' new lengths; Shift+click chooses a run. */
|
|
19311
19448
|
function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .1, grid, step = .1, selected = [], onSelectRange, renderItem, height = "5rem", className }) {
|
|
19312
19449
|
const start = items[0]?.start ?? 0;
|
|
@@ -19512,12 +19649,13 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
19512
19649
|
]
|
|
19513
19650
|
});
|
|
19514
19651
|
}
|
|
19652
|
+
|
|
19515
19653
|
// src/components/tree.tsx
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19654
|
+
const Context = React.createContext(null);
|
|
19655
|
+
const useCtx = () => React.useContext(Context);
|
|
19656
|
+
const NOTE = "\0";
|
|
19657
|
+
const isNote = (key) => key.includes(NOTE);
|
|
19658
|
+
const ROW = "flex min-h-(--control-h-sm) min-w-0 items-center gap-1 rounded-control pr-2 type-body-sm";
|
|
19521
19659
|
function Row$1({ level, children }) {
|
|
19522
19660
|
return /* @__PURE__ */ jsx("div", {
|
|
19523
19661
|
className: ROW,
|
|
@@ -19926,17 +20064,18 @@ function Tree({ label, roots, useChildren, nodeKey, nodeLabel, isBranch, renderN
|
|
|
19926
20064
|
]
|
|
19927
20065
|
});
|
|
19928
20066
|
}
|
|
20067
|
+
|
|
19929
20068
|
// src/components/folder-picker.tsx
|
|
19930
|
-
|
|
19931
|
-
|
|
19932
|
-
|
|
20069
|
+
const SEP = "/";
|
|
20070
|
+
const parts = (path) => path.split(SEP).filter(Boolean);
|
|
20071
|
+
const join = (parent, name) => `${parent === SEP ? "" : parent}${SEP}${name}`;
|
|
19933
20072
|
/** The parent of a path, or `null` at the top. */
|
|
19934
|
-
|
|
20073
|
+
const parentOf = (path) => {
|
|
19935
20074
|
const p = parts(path);
|
|
19936
20075
|
return p.length <= 1 ? null : `${SEP}${p.slice(0, -1).join(SEP)}`;
|
|
19937
20076
|
};
|
|
19938
20077
|
/** Every folder from the top down to `path`, which the tree must have open to show it. */
|
|
19939
|
-
|
|
20078
|
+
const ancestorsOf = (path) => parts(path).slice(0, -1).map((_, i, a) => `${SEP}${a.slice(0, i + 1).join(SEP)}`);
|
|
19940
20079
|
/** A server folder chooser: a lazy tree, a breadcrumb that is also editable text, Up, recents, a New folder field that shows the server's refusal, and Choose this folder as the one filled button. */
|
|
19941
20080
|
function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose, expanded, recent, canChoose, chooseLabel = "Choose this folder", onOpen, onCreate, topLabel = "Top", emptyRow = "No folders", height = "18rem", className }) {
|
|
19942
20081
|
const useFolders = (path) => {
|
|
@@ -20156,6 +20295,6 @@ function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose
|
|
|
20156
20295
|
]
|
|
20157
20296
|
});
|
|
20158
20297
|
}
|
|
20159
|
-
export { ActiveList, Alert, AlertDialog, AppShell, AsyncButton, BookViewer, BoxList, BoxOverlay, BoxedPicture, Breadcrumb, BulkBar, Button, ButtonLink, ByteView, COLOR_SCHEME_STORAGE_KEY, Checkbox, ChoiceGrid, ChoiceGridSkeleton, ChoiceGroup, ClipsProvider, ColorField, ColorSchemeChoice, CommandLegend, CommandMenu, Compare, CompareAudio, CompareGrid, CompareText, CompareVideo, CompareVideoGrid, Composer, CompositionBar, Console, ContextMenu, Conversation, CursorScope, DEFAULT_PALETTE, DEFAULT_TOLERANCE, DataTable, DataView$1 as DataView, Density, Dialog, Disclosure, Done, DragSource, EmptyState, FIT, Field, FileButton, FileDropOverlay, FileDropZone, FileOutcomes, FilmStrip, FolderPicker, FullscreenFrame, HttpError, IconButton, InfiniteList, Input, InputLevel, Inspector, InspectorSection, JobStatus, JobsTable, KeysLegend, LEVEL_FLOOR_DB, Lightbox, LineChart, LineChartGroup, LinkCard, LinkCardList, ListeningLevel, LoadError, LoadMore, MAX_SCALE, MAX_SIDE, MIN_SCALE, MISSING, Mark, MarkSummary, MarkableText, MediaContents, MediaGroup, MediaPlayer, MediaStage, Menu, Meter, Metric, MetricStrip, MicrophoneContext, MicrophoneError, MissingFile, NBSP, NativeSelect, NumberField, OutboxStatus, PALETTE_STORAGE_KEY, PageHeader, PairJudge, PairVote, PaletteChoice, Pane, PauseButton, PixelImage, PlaceBoard, PlayWindowButton, PlayerNotice, Popover, PropertyList, PropertyRow, RateChoice, RegionEditor, RichText, RowAction, SPEECH_RATES, STRATA_DRAG_TYPE, SaveStatus, SayAgain, ScheduleTable, SecretField, SeekBar, SelectableGrid, SelectableGridSkeleton, SequenceTimeline, ShortcutEditor, SideNav, Skeleton, Slider, SortableList, SpanActions, SpanStrip, Split, StageGuides, StaleNotice, Status, StrataQueryProvider, StrataToastRegion, Switch, SystemPanel, TableSkeleton, Tabs, TakeLevel, TextLink, Textarea, ThemeProvider, Thumbnail, ThumbnailSkeleton, TileGrid, TileGridSkeleton, TimeReadout, Timeline, TimelinePlayer, TimelineZoomControls, Toggle, ToggleGroup, Toolbar, ToolbarSeparator, Tooltip, TranscriptView, Transport, Tree, UndoBar, ViewOptions, ViewportFrame, VirtualList, VolumeControl, Waveform, WorkflowSteps, WorkflowSummary, Workspace, WorkspaceBar, actualPixelsScale, ancestorsOf, apiPage, appBase, boxViewport, browserMicrophone, buttonVariants, canFullscreen, canPlayClips, canSay, canSpeak, checkKey, clampToRoom, clampViewport, clipsQueryKey, cn, colorSchemeScript, commandShortcut, countMarks, createApi, createFormat, createOutbox, createQueryClient, createReserve, createSegmenter, createTypedApi, crossedThreshold, currentItem, describeActionError, describeHttpError, describeRegion, describeWorkflowSummary, detectPlatform, diffWords, differences, diskThresholds, drawRect, ease, encodeWav, errorPayload, explainMicrophoneError, fetchJson, fieldErrorsOf, findPage, fitRect, format, formatChord, frameAt, gainToVolume, geo, gridPoints, gutterOf, inputLevelThresholds, isDoubtful, isRefusal, isReservedChord, isTaskRunning, isTypingTarget, isWorkflowRunning, jobProgressText, joinMediaGroup, joinRects, joinSamples, keyName, labelOf, lerpRect, logScale, loudnessOf, marksFor, matchEntities, matchGains, matchesAccept, matchesChord, measureLoudness, moveGutter, moveRect, noOverlap, normaliseAngle, pageName, paletteScript, palettes, parentOf, parseChord, parseInline, parseRichText, parseSort, peakDb, peakGain, peaksFromAudio, phraseAt, phraseDoubtful, phraseOfWordId, pickEvenly, pickVoice, pixelZoom, plainText, rangeBetween, readErrorBody, readPixels, readingOrder, regionShares, regionStyle, resample, resamplePeaks, resizeRect, rgbaToBlob, rmsDb, safeHref, sayPosition, serialiseSort, settleCut, skipAction, snapToGrid, sortRows, speak, speechLevel, splitRect, staleOf, stepId, stepOnGrid, stopSpeaking, summariseWorkflow, textOf, tickLabel, tickStep, ticksBetween, toDate, toLoad, toPeakPair, toast, toastTimeout, transportShortcuts, turnRect, turnedSize, typeSteps, useActiveItem, useAsyncAction, useAttachedSource, useAutoRecorder, useAutoSave, useBookUrl, useBoxes, useChoices, useClientWork, useClips, useColorScheme, useCommands, useDifference, useExpanded, useFileIntake, useHistory, useHistoryState, useHotkeys, useInView, useInfiniteLoad, useJob, useJobAction, useLeaveGuard, useLightboxUrl, useLoad, useMediaElement, useMediaSpans, useMicrophone, useObjectUrl, useOutbox, useOutboxStarted, usePalette, usePlayerWarnings, usePoll, useRebindableShortcuts, useRecorder, useReserve, useSayOnShow, useSearchParam, useSelection, useSharedCursor, useSpeech, useSystemColorScheme, useSystemInfo, useTimeline, useTimelineZoom, useUndoable, useViewOptions, useViewport, useWorkflowRun, useWorkspaceState, valueAt, viewOf, viewsOf, withBase, wordAt, wordId, zoomAt, zoomToBox };
|
|
20160
20298
|
|
|
20299
|
+
export { ActiveList, Alert, AlertDialog, AppShell, AsyncButton, BookViewer, BoxList, BoxOverlay, BoxedPicture, Breadcrumb, BulkBar, Button, ButtonLink, ByteView, COLOR_SCHEME_STORAGE_KEY, Checkbox, ChoiceGrid, ChoiceGridSkeleton, ChoiceGroup, ClipsProvider, ColorField, ColorSchemeChoice, CommandLegend, CommandMenu, Compare, CompareAudio, CompareGrid, CompareText, CompareVideo, CompareVideoGrid, Composer, CompositionBar, Console, ContextMenu, Conversation, CursorScope, DEFAULT_PALETTE, DEFAULT_TOLERANCE, DataTable, DataView$1 as DataView, Density, Dialog, Disclosure, Done, DragSource, EmptyState, FIT, Field, FileButton, FileDropOverlay, FileDropZone, FileOutcomes, FilmStrip, FolderPicker, FullscreenFrame, HttpError, IconButton, InfiniteList, Input, InputLevel, Inspector, InspectorSection, JobStatus, JobsTable, KeysLegend, LEVEL_FLOOR_DB, Lightbox, LineChart, LineChartGroup, LinkCard, LinkCardList, ListeningLevel, LoadError, LoadMore, MAX_SCALE, MAX_SIDE, MIN_SCALE, MISSING, Mark, MarkSummary, MarkableText, MediaContents, MediaGroup, MediaPlayer, MediaStage, Menu, Meter, Metric, MetricStrip, MicrophoneContext, MicrophoneError, MissingFile, NBSP, NativeSelect, NumberField, OutboxStatus, PALETTE_STORAGE_KEY, PageHeader, PairJudge, PairVote, PaletteChoice, Pane, PauseButton, PixelImage, PlaceBoard, PlayWindowButton, PlayerNotice, Popover, PropertyList, PropertyRow, RateChoice, RegionEditor, RichText, RowAction, SPEECH_RATES, STRATA_DRAG_TYPE, SaveStatus, SayAgain, ScheduleTable, SecretField, SeekBar, SelectableGrid, SelectableGridSkeleton, SequenceTimeline, ShortcutEditor, SideNav, Skeleton, Slider, SortableList, SpanActions, SpanStrip, Split, StageGuides, StaleNotice, Status, StrataQueryProvider, StrataToastRegion, Switch, SystemPanel, TableSkeleton, Tabs, TakeLevel, TextLink, Textarea, ThemeProvider, Thumbnail, ThumbnailSkeleton, TileGrid, TileGridSkeleton, TimeReadout, Timeline, TimelinePlayer, TimelineZoomControls, Toggle, ToggleGroup, Toolbar, ToolbarSeparator, Tooltip, TranscriptView, Transport, Tree, UndoBar, ViewOptions, ViewportFrame, VirtualList, VolumeControl, Waveform, WorkflowSteps, WorkflowSummary, Workspace, WorkspaceBar, actualPixelsScale, ancestorsOf, apiPage, appBase, boxViewport, browserMicrophone, buttonVariants, canFullscreen, canPlayClips, canSay, canSpeak, checkKey, clampToRoom, clampViewport, clipsQueryKey, cn, colorSchemeScript, commandShortcut, countMarks, createApi, createFormat, createOutbox, createQueryClient, createReserve, createSegmenter, createTypedApi, crossedThreshold, currentItem, describeActionError, describeHttpError, describeRegion, describeWorkflowSummary, detectPlatform, diffWords, differences, diskThresholds, drawRect, ease, encodeWav, errorPayload, explainMicrophoneError, fetchJson, fieldErrorsOf, findPage, fitRect, followAim, format, formatChord, frameAt, gainToVolume, geo, gridPoints, gutterOf, inputLevelThresholds, isDoubtful, isRefusal, isReservedChord, isTaskRunning, isTypingTarget, isWorkflowRunning, jobProgressText, joinMediaGroup, joinRects, joinSamples, keyName, labelOf, lerpRect, logScale, loudnessOf, marksFor, matchEntities, matchGains, matchesAccept, matchesChord, measureLoudness, moveGutter, moveRect, noOverlap, normaliseAngle, pageName, paletteScript, palettes, parentOf, parseChord, parseInline, parseRichText, parseSort, peakDb, peakGain, peaksFromAudio, phraseAt, phraseDoubtful, phraseOfWordId, pickEvenly, pickVoice, pixelZoom, plainText, rangeBetween, readErrorBody, readPixels, readingOrder, regionShares, regionStyle, resample, resamplePeaks, resizeRect, rgbaToBlob, rmsDb, safeHref, sayPosition, serialiseSort, settleCut, skipAction, snapToGrid, sortRows, speak, speechLevel, splitRect, staleOf, stepId, stepOnGrid, stopSpeaking, summariseWorkflow, textOf, tickLabel, tickStep, ticksBetween, toDate, toLoad, toPeakPair, toast, toastTimeout, transportShortcuts, turnRect, turnedSize, typeSteps, useActiveItem, useAsyncAction, useAttachedSource, useAutoRecorder, useAutoSave, useBookUrl, useBoxes, useChoices, useClientWork, useClips, useColorScheme, useCommands, useDifference, useExpanded, useFileIntake, useHistory, useHistoryState, useHotkeys, useInView, useInfiniteLoad, useJob, useJobAction, useLeaveGuard, useLightboxUrl, useLoad, useMediaElement, useMediaSpans, useMicrophone, useObjectUrl, useOutbox, useOutboxStarted, usePalette, usePlayerWarnings, usePoll, useRebindableShortcuts, useRecorder, useReserve, useSayOnShow, useSearchParam, useSelection, useSettledStatus, useSharedCursor, useSpeech, useSystemColorScheme, useSystemInfo, useTimeline, useTimelineZoom, useUndoable, useViewOptions, useViewPointers, useViewport, useWheelZoom, useWorkflowRun, useWorkspaceState, valueAt, viewOf, viewsOf, withBase, wordAt, wordId, zoomAt, zoomToBox };
|
|
20161
20300
|
//# sourceMappingURL=index.js.map
|