strata-react 1.3.25 → 1.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/UPGRADING.md +4 -0
- package/dist/{api-types/cli.d.ts → api-types-cli.d.ts} +1 -0
- package/dist/api-types-cli.js +4 -3
- package/dist/api-types-cli.js.map +1 -1
- package/dist/{api-types/generate.d.ts → api-types.d.ts} +3 -3
- package/dist/api-types.js +3 -1
- package/dist/{button-KGJI6jQr.js → button-CYXjU-fs.js} +8 -5
- package/dist/button-CYXjU-fs.js.map +1 -0
- package/dist/{cursor-DDGBPiTJ.js → cursor-Cwyvgwsw.js} +9 -7
- package/dist/cursor-Cwyvgwsw.js.map +1 -0
- package/dist/{errors-BUvY1Z4d.js → errors-CmuwcWlb.js} +6 -6
- package/dist/{errors-BUvY1Z4d.js.map → errors-CmuwcWlb.js.map} +1 -1
- package/dist/{field-BjeE_FeB.js → field-DBCsFIng.js} +27 -23
- package/dist/field-DBCsFIng.js.map +1 -0
- package/dist/{follow-BTPs49FP.js → follow-CXQsL86O.js} +2 -2
- package/dist/follow-CXQsL86O.js.map +1 -0
- package/dist/{generate-CjTHKJ39.js → generate-BkWhh4k4.js} +8 -6
- package/dist/generate-BkWhh4k4.js.map +1 -0
- package/dist/{lib/geo.d.ts → geo-DfKa9JtK.d.ts} +35 -33
- package/dist/{hls/index.d.ts → hls.d.ts} +13 -12
- package/dist/hls.js +5 -4
- package/dist/hls.js.map +1 -1
- package/dist/index.d.ts +5401 -142
- package/dist/index.js +1072 -227
- package/dist/index.js.map +1 -1
- package/dist/map.d.ts +184 -0
- package/dist/map.js +21 -17
- package/dist/map.js.map +1 -1
- package/dist/media-player-BETa3P7K.d.ts +758 -0
- package/dist/{microphone-Bo3WaXgD.js → microphone-76skMt6i.js} +41 -30
- package/dist/microphone-76skMt6i.js.map +1 -0
- package/dist/microphone-DDOnQHxf.d.ts +237 -0
- package/dist/{migrate/cli.d.ts → migrate-cli.d.ts} +1 -0
- package/dist/migrate-cli.js +8 -6
- package/dist/migrate-cli.js.map +1 -1
- package/dist/panorama.d.ts +102 -0
- package/dist/panorama.js +18 -15
- package/dist/panorama.js.map +1 -1
- package/dist/{run-BT2WKzMz.js → run-D_Ic1jE7.js} +23 -16
- package/dist/run-D_Ic1jE7.js.map +1 -0
- package/dist/scene.d.ts +147 -0
- package/dist/scene.js +15 -13
- package/dist/scene.js.map +1 -1
- package/dist/testing.d.ts +468 -0
- package/dist/testing.js +11 -3
- package/dist/testing.js.map +1 -1
- package/dist/{theme-CxYZkUNk.js → theme-1oOSMj_D.js} +19 -17
- package/dist/theme-1oOSMj_D.js.map +1 -0
- package/dist/{tooltip-DhqrDtyu.js → tooltip-BosfsWYh.js} +9 -6
- package/dist/tooltip-BosfsWYh.js.map +1 -0
- package/dist/types-B3TsF0Ey.d.ts +241 -0
- package/dist/{value-controls-Dm_EYfZW.js → value-controls-5u7sD_wG.js} +22 -17
- package/dist/value-controls-5u7sD_wG.js.map +1 -0
- package/dist/{viewer-input-CHU0Hx4A.js → viewer-input-3Qa-o35k.js} +3 -2
- package/dist/{viewer-input-CHU0Hx4A.js.map → viewer-input-3Qa-o35k.js.map} +1 -1
- package/dist/{visual/cli.d.ts → visual-cli.d.ts} +2 -1
- package/dist/visual-cli.js +5 -4
- package/dist/visual-cli.js.map +1 -1
- package/dist/visual.d.ts +105 -0
- package/dist/visual.js +4 -3
- package/dist/visual.js.map +1 -1
- package/package.json +24 -19
- package/dist/api-types/index.d.ts +0 -1
- package/dist/button-KGJI6jQr.js.map +0 -1
- package/dist/components/active-list.d.ts +0 -46
- package/dist/components/alert.d.ts +0 -17
- package/dist/components/app-shell.d.ts +0 -32
- package/dist/components/async-button.d.ts +0 -48
- package/dist/components/auto-recorder.d.ts +0 -67
- package/dist/components/book-viewer.d.ts +0 -50
- package/dist/components/box-overlay.d.ts +0 -44
- package/dist/components/boxed-picture.d.ts +0 -34
- package/dist/components/button.d.ts +0 -45
- package/dist/components/byte-view.d.ts +0 -32
- package/dist/components/checkbox.d.ts +0 -39
- package/dist/components/choice-grid.d.ts +0 -42
- package/dist/components/commands.d.ts +0 -104
- package/dist/components/compare-audio.d.ts +0 -30
- package/dist/components/compare-grid.d.ts +0 -24
- package/dist/components/compare-parts.d.ts +0 -90
- package/dist/components/compare-regions.d.ts +0 -37
- package/dist/components/compare-text.d.ts +0 -32
- package/dist/components/compare-video-grid.d.ts +0 -52
- package/dist/components/compare-video.d.ts +0 -61
- package/dist/components/compare.d.ts +0 -90
- package/dist/components/composition.d.ts +0 -44
- package/dist/components/console.d.ts +0 -34
- package/dist/components/conversation.d.ts +0 -83
- package/dist/components/cursor.d.ts +0 -44
- package/dist/components/data-table.d.ts +0 -89
- package/dist/components/data-view.d.ts +0 -66
- package/dist/components/density.d.ts +0 -16
- package/dist/components/dialog.d.ts +0 -45
- package/dist/components/difference.d.ts +0 -19
- package/dist/components/disclosure.d.ts +0 -49
- package/dist/components/done.d.ts +0 -14
- package/dist/components/drag-source.d.ts +0 -29
- package/dist/components/field.d.ts +0 -79
- package/dist/components/file-intake.d.ts +0 -60
- package/dist/components/film-strip.d.ts +0 -35
- package/dist/components/folder-picker.d.ts +0 -59
- package/dist/components/fullscreen-frame.d.ts +0 -18
- package/dist/components/history.d.ts +0 -61
- package/dist/components/hotkeys.d.ts +0 -44
- package/dist/components/infinite-list.d.ts +0 -77
- package/dist/components/inspector.d.ts +0 -66
- package/dist/components/job-action.d.ts +0 -30
- package/dist/components/job-status.d.ts +0 -55
- package/dist/components/jobs-table.d.ts +0 -35
- package/dist/components/key-glyphs.d.ts +0 -5
- package/dist/components/key-owner.d.ts +0 -11
- package/dist/components/lightbox.d.ts +0 -61
- package/dist/components/line-chart.d.ts +0 -169
- package/dist/components/link-card.d.ts +0 -32
- package/dist/components/link.d.ts +0 -54
- package/dist/components/markable-text.d.ts +0 -60
- package/dist/components/media-contents.d.ts +0 -28
- package/dist/components/media-group.d.ts +0 -32
- package/dist/components/media-player.d.ts +0 -251
- package/dist/components/media-progress.d.ts +0 -17
- package/dist/components/media-skip.d.ts +0 -31
- package/dist/components/media-spans.d.ts +0 -93
- package/dist/components/media.d.ts +0 -133
- package/dist/components/meter.d.ts +0 -32
- package/dist/components/metric.d.ts +0 -17
- package/dist/components/outbox-status.d.ts +0 -10
- package/dist/components/page-header.d.ts +0 -14
- package/dist/components/pair-vote.d.ts +0 -70
- package/dist/components/pause-button.d.ts +0 -7
- package/dist/components/pixel-image.d.ts +0 -29
- package/dist/components/place-board.d.ts +0 -39
- package/dist/components/player-warning.d.ts +0 -24
- package/dist/components/popover.d.ts +0 -20
- package/dist/components/recorder.d.ts +0 -73
- package/dist/components/region-editor.d.ts +0 -67
- package/dist/components/save.d.ts +0 -46
- package/dist/components/say-again.d.ts +0 -13
- package/dist/components/schedule-table.d.ts +0 -24
- package/dist/components/secret-field.d.ts +0 -34
- package/dist/components/selectable-grid.d.ts +0 -57
- package/dist/components/selection.d.ts +0 -104
- package/dist/components/sequence-timeline.d.ts +0 -50
- package/dist/components/shortcut-editor.d.ts +0 -44
- package/dist/components/sortable-list.d.ts +0 -39
- package/dist/components/status.d.ts +0 -9
- package/dist/components/switch.d.ts +0 -15
- package/dist/components/system-panel.d.ts +0 -58
- package/dist/components/tabs.d.ts +0 -16
- package/dist/components/theme.d.ts +0 -106
- package/dist/components/thumbnail.d.ts +0 -50
- package/dist/components/tile-grid.d.ts +0 -67
- package/dist/components/timeline-player.d.ts +0 -18
- package/dist/components/timeline.d.ts +0 -115
- package/dist/components/toast.d.ts +0 -36
- package/dist/components/toggle.d.ts +0 -51
- package/dist/components/toolbar.d.ts +0 -15
- package/dist/components/tooltip.d.ts +0 -19
- package/dist/components/transcript-view.d.ts +0 -63
- package/dist/components/tree.d.ts +0 -74
- package/dist/components/undo.d.ts +0 -63
- package/dist/components/use-timeline.d.ts +0 -44
- package/dist/components/value-controls.d.ts +0 -91
- package/dist/components/video-clock.d.ts +0 -68
- package/dist/components/view-options.d.ts +0 -105
- package/dist/components/viewport.d.ts +0 -85
- package/dist/components/virtual-list.d.ts +0 -19
- package/dist/components/waveform.d.ts +0 -71
- package/dist/components/workflow-steps.d.ts +0 -71
- package/dist/components/workspace.d.ts +0 -83
- package/dist/cursor-DDGBPiTJ.js.map +0 -1
- package/dist/field-BjeE_FeB.js.map +0 -1
- package/dist/follow-BTPs49FP.js.map +0 -1
- package/dist/generate-CjTHKJ39.js.map +0 -1
- package/dist/lib/base.d.ts +0 -10
- package/dist/lib/book.d.ts +0 -25
- package/dist/lib/boxes.d.ts +0 -55
- package/dist/lib/breakpoint.d.ts +0 -4
- package/dist/lib/choice.d.ts +0 -29
- package/dist/lib/chords.d.ts +0 -20
- package/dist/lib/client-work.d.ts +0 -24
- package/dist/lib/control.d.ts +0 -4
- package/dist/lib/dev.d.ts +0 -2
- package/dist/lib/errors.d.ts +0 -43
- package/dist/lib/file-intake.d.ts +0 -60
- package/dist/lib/follow.d.ts +0 -18
- package/dist/lib/format.d.ts +0 -243
- package/dist/lib/grouped-grid-layout.d.ts +0 -44
- package/dist/lib/icon.d.ts +0 -6
- package/dist/lib/image-diff.d.ts +0 -30
- package/dist/lib/in-view.d.ts +0 -21
- package/dist/lib/loudness.d.ts +0 -18
- package/dist/lib/marks.d.ts +0 -6
- package/dist/lib/microphone.d.ts +0 -24
- package/dist/lib/number-input.d.ts +0 -4
- package/dist/lib/object-url.d.ts +0 -2
- package/dist/lib/overlay.d.ts +0 -1
- package/dist/lib/recording.d.ts +0 -16
- package/dist/lib/region.d.ts +0 -64
- package/dist/lib/rich-text.d.ts +0 -44
- package/dist/lib/search-param.d.ts +0 -16
- package/dist/lib/segmenter.d.ts +0 -40
- package/dist/lib/sequence.d.ts +0 -34
- package/dist/lib/speech.d.ts +0 -53
- package/dist/lib/text-diff.d.ts +0 -16
- package/dist/lib/timeline.d.ts +0 -14
- package/dist/lib/transcript.d.ts +0 -53
- package/dist/lib/utils.d.ts +0 -4
- package/dist/lib/viewer-input.d.ts +0 -29
- package/dist/lib/viewport.d.ts +0 -55
- package/dist/lib/waveform.d.ts +0 -46
- package/dist/map/fan.d.ts +0 -15
- package/dist/map/index.d.ts +0 -3
- package/dist/map/map-styles.d.ts +0 -2
- package/dist/map/markers.d.ts +0 -60
- package/dist/map/route-map.d.ts +0 -146
- package/dist/microphone-Bo3WaXgD.js.map +0 -1
- package/dist/migrate/stock-classes.d.ts +0 -11
- package/dist/panorama/gl.d.ts +0 -16
- package/dist/panorama/index.d.ts +0 -2
- package/dist/panorama/panorama-viewer.d.ts +0 -56
- package/dist/panorama/projection.d.ts +0 -45
- package/dist/query/api.d.ts +0 -23
- package/dist/query/clips.d.ts +0 -48
- package/dist/query/index.d.ts +0 -55
- package/dist/query/infinite.d.ts +0 -60
- package/dist/query/job.d.ts +0 -26
- package/dist/query/outbox.d.ts +0 -85
- package/dist/query/poll.d.ts +0 -24
- package/dist/query/reserve.d.ts +0 -33
- package/dist/query/typed-api.d.ts +0 -84
- package/dist/query/workflow.d.ts +0 -17
- package/dist/run-BT2WKzMz.js.map +0 -1
- package/dist/scene/camera.d.ts +0 -99
- package/dist/scene/index.d.ts +0 -2
- package/dist/scene/scene-viewport.d.ts +0 -48
- package/dist/testing/buttons.d.ts +0 -7
- package/dist/testing/index.d.ts +0 -161
- package/dist/testing/intersection-observer.d.ts +0 -34
- package/dist/testing/layout.d.ts +0 -13
- package/dist/testing/microphone.d.ts +0 -35
- package/dist/testing/setup.d.ts +0 -14
- package/dist/testing/speech.d.ts +0 -38
- package/dist/testing/storage.d.ts +0 -7
- package/dist/theme-CxYZkUNk.js.map +0 -1
- package/dist/tooltip-DhqrDtyu.js.map +0 -1
- package/dist/value-controls-Dm_EYfZW.js.map +0 -1
- package/dist/visual/capture.d.ts +0 -37
- package/dist/visual/compare.d.ts +0 -46
- package/dist/visual/drop.d.ts +0 -19
- package/dist/visual/fonts.d.ts +0 -18
- package/dist/visual/index.d.ts +0 -19
- package/dist/visual/run.d.ts +0 -22
- package/dist/visual/serve.d.ts +0 -13
- package/dist/visual/targets.d.ts +0 -17
- package/dist/visual/types.d.ts +0 -188
package/dist/index.js
CHANGED
|
@@ -1,13 +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 { t as followAim } from "./follow-
|
|
5
|
-
import { n as useViewPointers, r as useWheelZoom, t as useSettledStatus } from "./viewer-input-
|
|
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-
|
|
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-
|
|
8
|
-
import { n as useSharedCursor, r as geo, t as CursorScope } from "./cursor-
|
|
9
|
-
import { a as fieldErrorsOf, i as errorPayload, n as describeActionError, o as readErrorBody, r as describeHttpError, t as HttpError } from "./errors-
|
|
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-
|
|
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";
|
|
11
11
|
import * as React from "react";
|
|
12
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";
|
|
13
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";
|
|
@@ -18,6 +18,7 @@ import { createSortedRowModel, flexRender, rowSortingFeature, tableFeatures, use
|
|
|
18
18
|
import { UNSAFE_PortalProvider, VisuallyHidden, mergeProps, useDrag, useDrop, useFocusRing, useMove, useSlider, useSliderThumb, useUNSAFE_PortalContext } from "react-aria";
|
|
19
19
|
import { LayoutInfo, Rect, Size, useSliderState } from "react-stately";
|
|
20
20
|
import pixelmatch from "pixelmatch";
|
|
21
|
+
|
|
21
22
|
// src/lib/chords.ts
|
|
22
23
|
/** The platform this page runs on, read from the browser (`mac` for macOS and iOS). Server and test default: `other`. */
|
|
23
24
|
function detectPlatform() {
|
|
@@ -40,7 +41,7 @@ function parseChord(chord, platform = detectPlatform()) {
|
|
|
40
41
|
key
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
const symbol = (key) => key.length === 1 && key.toUpperCase() === key.toLowerCase();
|
|
44
45
|
/** Whether a key event is this chord. Exact on Ctrl, Meta and Alt; Shift is exact for letters and named keys. */
|
|
45
46
|
function matchesChord(e, chord, platform = detectPlatform()) {
|
|
46
47
|
const c = parseChord(chord, platform);
|
|
@@ -50,7 +51,7 @@ function matchesChord(e, chord, platform = detectPlatform()) {
|
|
|
50
51
|
if (e.key.toLowerCase() === c.key.toLowerCase()) return true;
|
|
51
52
|
return c.alt && /^[a-z]$/i.test(c.key) && e.code === `Key${c.key.toUpperCase()}`;
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
const NAMES = {
|
|
54
55
|
ArrowUp: {
|
|
55
56
|
mac: "↑",
|
|
56
57
|
other: "↑"
|
|
@@ -113,7 +114,7 @@ function formatChord(chord, platform = detectPlatform()) {
|
|
|
113
114
|
key
|
|
114
115
|
].filter(Boolean).join("+");
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
+
const RESERVED = [
|
|
117
118
|
"Mod+S",
|
|
118
119
|
"Mod+P",
|
|
119
120
|
"Mod+F",
|
|
@@ -146,12 +147,13 @@ function isReservedChord(chord, platform = detectPlatform()) {
|
|
|
146
147
|
return p.ctrl === c.ctrl && p.meta === c.meta && p.alt === c.alt && p.shift === c.shift && p.key.toLowerCase() === c.key.toLowerCase();
|
|
147
148
|
});
|
|
148
149
|
}
|
|
150
|
+
|
|
149
151
|
// src/components/commands.tsx
|
|
150
152
|
/** The text of a command's label, whether it is a string or a function. */
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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;
|
|
155
157
|
/**
|
|
156
158
|
* Binds every command's chords on the window. Never while typing (unless the command says
|
|
157
159
|
* `inFields`), never during IME composition, not on a held key (unless `repeat`), not for a disabled
|
|
@@ -214,7 +216,7 @@ function CommandLegend({ commands, platform, label = "Keyboard shortcuts", class
|
|
|
214
216
|
}, c.id))
|
|
215
217
|
});
|
|
216
218
|
}
|
|
217
|
-
|
|
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");
|
|
218
220
|
function Item({ command, platform }) {
|
|
219
221
|
const Icon = command.icon ?? (command.destructive ? Trash2 : void 0);
|
|
220
222
|
const shortcut = commandShortcut(command, platform);
|
|
@@ -298,7 +300,7 @@ function Entries({ entries, platform }) {
|
|
|
298
300
|
})] }, `sub-${entry.submenu}`);
|
|
299
301
|
}) });
|
|
300
302
|
}
|
|
301
|
-
|
|
303
|
+
const surface = cn("layer-overlay min-w-48 p-1", overlaySurface);
|
|
302
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. */
|
|
303
305
|
function Menu({ label, trigger, items, open, onOpenChange, platform, className }) {
|
|
304
306
|
const where = platform ?? detectPlatform();
|
|
@@ -453,9 +455,10 @@ function CommandMenu({ commands, open, onOpenChange, shortcut = "Mod+K", label =
|
|
|
453
455
|
})
|
|
454
456
|
});
|
|
455
457
|
}
|
|
458
|
+
|
|
456
459
|
// src/components/toggle.tsx
|
|
457
|
-
|
|
458
|
-
|
|
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 = {
|
|
459
462
|
default: "h-(--control-h)",
|
|
460
463
|
sm: "h-(--control-h-sm)"
|
|
461
464
|
};
|
|
@@ -536,6 +539,7 @@ function ToggleGroupView({ label, options, value, onChange, size = "default", cl
|
|
|
536
539
|
})
|
|
537
540
|
});
|
|
538
541
|
}
|
|
542
|
+
|
|
539
543
|
// src/components/pause-button.tsx
|
|
540
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`. */
|
|
541
545
|
function PauseButton({ poll, hideUpdated = false, className }) {
|
|
@@ -556,6 +560,7 @@ function PauseButton({ poll, hideUpdated = false, className }) {
|
|
|
556
560
|
})]
|
|
557
561
|
});
|
|
558
562
|
}
|
|
563
|
+
|
|
559
564
|
// src/components/switch.tsx
|
|
560
565
|
/** An on/off setting that applies at once, its label and control one target. */
|
|
561
566
|
function Switch({ label, detail, on, defaultOn, onChange, disabled, className }) {
|
|
@@ -589,8 +594,9 @@ function Switch({ label, detail, on, defaultOn, onChange, disabled, className })
|
|
|
589
594
|
})]
|
|
590
595
|
});
|
|
591
596
|
}
|
|
597
|
+
|
|
592
598
|
// src/components/dialog.tsx
|
|
593
|
-
|
|
599
|
+
const sizes = {
|
|
594
600
|
sm: "max-w-sm",
|
|
595
601
|
md: "max-w-lg",
|
|
596
602
|
lg: "max-w-3xl",
|
|
@@ -628,7 +634,7 @@ function Driven({ open, onOpenChange, children }) {
|
|
|
628
634
|
onOpenChange
|
|
629
635
|
});
|
|
630
636
|
}
|
|
631
|
-
|
|
637
|
+
const overlayClass = "layer-overlay fixed inset-0 grid overflow-hidden scrim";
|
|
632
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. */
|
|
633
639
|
function Dialog({ title, description, trigger, open, onOpenChange, className, children, actions, hideTitle, closable = true, placement = "center", size = "md" }) {
|
|
634
640
|
const descriptionId = React.useId();
|
|
@@ -762,8 +768,9 @@ function AlertDialog({ title, description, trigger, open, onOpenChange, classNam
|
|
|
762
768
|
})
|
|
763
769
|
});
|
|
764
770
|
}
|
|
771
|
+
|
|
765
772
|
// src/components/popover.tsx
|
|
766
|
-
|
|
773
|
+
const widths = {
|
|
767
774
|
sm: "w-52",
|
|
768
775
|
md: "w-72",
|
|
769
776
|
lg: "w-96"
|
|
@@ -786,6 +793,7 @@ function Popover({ label, trigger, children, side = "bottom", align = "start", o
|
|
|
786
793
|
})]
|
|
787
794
|
});
|
|
788
795
|
}
|
|
796
|
+
|
|
789
797
|
// src/components/checkbox.tsx
|
|
790
798
|
/** A checkbox and its label as one target. `label` is required; `hideLabel` keeps it as the accessible name only. */
|
|
791
799
|
function Checkbox({ label, hideLabel = false, detail, checked, onCheckedChange, className, disabled, required, ...props }) {
|
|
@@ -876,8 +884,9 @@ function TableSelectionCheckbox({ label, className, disabled, mixed }) {
|
|
|
876
884
|
})
|
|
877
885
|
});
|
|
878
886
|
}
|
|
887
|
+
|
|
879
888
|
// src/components/status.tsx
|
|
880
|
-
|
|
889
|
+
const tones$1 = {
|
|
881
890
|
neutral: "bg-muted text-muted-foreground",
|
|
882
891
|
info: "bg-info-subtle text-info",
|
|
883
892
|
success: "bg-success-subtle text-success",
|
|
@@ -894,6 +903,7 @@ function Status({ tone, icon: Icon, children, className }) {
|
|
|
894
903
|
}), children]
|
|
895
904
|
});
|
|
896
905
|
}
|
|
906
|
+
|
|
897
907
|
// src/components/metric.tsx
|
|
898
908
|
/** Headline figures as one description list split by hairlines. Holds `Metric`s. */
|
|
899
909
|
function MetricStrip({ label, children, className }) {
|
|
@@ -926,12 +936,13 @@ function Metric({ label, value, unit, note }) {
|
|
|
926
936
|
]
|
|
927
937
|
});
|
|
928
938
|
}
|
|
939
|
+
|
|
929
940
|
// src/components/meter.tsx
|
|
930
941
|
/** The threshold a share has crossed, if any: the most severe one reached in the worse direction. */
|
|
931
942
|
function crossedThreshold(share, thresholds = [], worseWhen = "higher") {
|
|
932
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];
|
|
933
944
|
}
|
|
934
|
-
|
|
945
|
+
const fills = {
|
|
935
946
|
warning: "var(--warning)",
|
|
936
947
|
danger: "var(--danger)"
|
|
937
948
|
};
|
|
@@ -1012,6 +1023,7 @@ function Meter({ label, value, max = 1, valueText, detail, thresholds, worseWhen
|
|
|
1012
1023
|
]
|
|
1013
1024
|
});
|
|
1014
1025
|
}
|
|
1026
|
+
|
|
1015
1027
|
// src/lib/base.ts
|
|
1016
1028
|
/**
|
|
1017
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).
|
|
@@ -1028,8 +1040,9 @@ function appBase(doc = typeof document === "undefined" ? void 0 : document) {
|
|
|
1028
1040
|
function withBase(path, base = appBase()) {
|
|
1029
1041
|
return path.startsWith("/") && !path.startsWith("//") ? base + path : path;
|
|
1030
1042
|
}
|
|
1043
|
+
|
|
1031
1044
|
// src/query/api.ts
|
|
1032
|
-
|
|
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;
|
|
1033
1046
|
/**
|
|
1034
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),
|
|
1035
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 })`.
|
|
@@ -1050,6 +1063,7 @@ function createApi({ base, ...options } = {}) {
|
|
|
1050
1063
|
delete: (path, init) => send("DELETE", path, void 0, init)
|
|
1051
1064
|
};
|
|
1052
1065
|
}
|
|
1066
|
+
|
|
1053
1067
|
// src/query/typed-api.ts
|
|
1054
1068
|
function fill(path, values, query) {
|
|
1055
1069
|
const filled = path.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
@@ -1083,6 +1097,7 @@ function createTypedApi(options = {}) {
|
|
|
1083
1097
|
delete: call("delete")
|
|
1084
1098
|
};
|
|
1085
1099
|
}
|
|
1100
|
+
|
|
1086
1101
|
// src/query/infinite.ts
|
|
1087
1102
|
/** `useInfiniteQuery` for cursor-paged data, returned as an `InfiniteLoad<T>` for `InfiniteList` (or `DataView`). */
|
|
1088
1103
|
function useInfiniteLoad({ queryKey, queryFn, items, itemKey, hasMore = () => false, nextCursor, cursorAfter = itemKey, isRemoved, describeError = describeHttpError, enabled, staleTime }) {
|
|
@@ -1180,7 +1195,7 @@ function useInfiniteLoad({ queryKey, queryFn, items, itemKey, hasMore = () => fa
|
|
|
1180
1195
|
...extra
|
|
1181
1196
|
};
|
|
1182
1197
|
}
|
|
1183
|
-
|
|
1198
|
+
const none = /* @__PURE__ */ new Set();
|
|
1184
1199
|
/** Every page's items, in order, once each by key: the ones held (not dismissed) and the last one seen. */
|
|
1185
1200
|
function merge(pages, items, itemKey, hidden) {
|
|
1186
1201
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1216,6 +1231,7 @@ function apiPage() {
|
|
|
1216
1231
|
nextCursor: (page) => page.next
|
|
1217
1232
|
};
|
|
1218
1233
|
}
|
|
1234
|
+
|
|
1219
1235
|
// src/query/job.ts
|
|
1220
1236
|
/** A long-running job's status: polled every `every` ms while `isRunning`, with the `invalidates` queries read again once when it ends. */
|
|
1221
1237
|
function useJob({ isRunning, every = 2e3, invalidates = [], describeError, ...options }) {
|
|
@@ -1250,6 +1266,7 @@ function useJob({ isRunning, every = 2e3, invalidates = [], describeError, ...op
|
|
|
1250
1266
|
function isTaskRunning(task, finished) {
|
|
1251
1267
|
return !(Array.isArray(finished) ? finished.includes(task.state) : finished.has(task.state));
|
|
1252
1268
|
}
|
|
1269
|
+
|
|
1253
1270
|
// src/query/workflow.ts
|
|
1254
1271
|
/** Whether the queue job advancing a workflow run is still going. `finished` is the generated `FINISHED` (or `["done", "failed", "cancelled"]`). */
|
|
1255
1272
|
function isWorkflowRunning(run, finished) {
|
|
@@ -1262,9 +1279,10 @@ function useWorkflowRun({ finished, ...options }) {
|
|
|
1262
1279
|
isRunning: (run) => isWorkflowRunning(run, finished)
|
|
1263
1280
|
});
|
|
1264
1281
|
}
|
|
1282
|
+
|
|
1265
1283
|
// src/components/system-panel.tsx
|
|
1266
1284
|
/** The shared limits for a folder's disk, as shares of its size: filling up at 80%, nearly full at 95%. */
|
|
1267
|
-
|
|
1285
|
+
const diskThresholds = [{
|
|
1268
1286
|
at: .8,
|
|
1269
1287
|
tone: "warning",
|
|
1270
1288
|
label: "Filling up"
|
|
@@ -1443,7 +1461,11 @@ function SystemPanel({ load, thresholds = diskThresholds, facts = [], now, headi
|
|
|
1443
1461
|
term: "Started",
|
|
1444
1462
|
children: [format.dateTime(s.started_at), /* @__PURE__ */ jsxs("span", {
|
|
1445
1463
|
className: "ml-2 text-muted-foreground tabular-nums",
|
|
1446
|
-
children: [
|
|
1464
|
+
children: [
|
|
1465
|
+
"up",
|
|
1466
|
+
" ",
|
|
1467
|
+
format.duration(((now ?? /* @__PURE__ */ new Date()).getTime() - new Date(s.started_at).getTime()) / 1e3, { style: "parts" })
|
|
1468
|
+
]
|
|
1447
1469
|
})]
|
|
1448
1470
|
}),
|
|
1449
1471
|
/* @__PURE__ */ jsx(Fact, {
|
|
@@ -1492,8 +1514,9 @@ function SystemPanel({ load, thresholds = diskThresholds, facts = [], now, headi
|
|
|
1492
1514
|
})
|
|
1493
1515
|
});
|
|
1494
1516
|
}
|
|
1517
|
+
|
|
1495
1518
|
// src/components/composition.tsx
|
|
1496
|
-
|
|
1519
|
+
const MAX_TOKENS = 5;
|
|
1497
1520
|
/** Keeps the four largest parts in their given order and sums the rest into one last part. */
|
|
1498
1521
|
function foldParts(parts, label) {
|
|
1499
1522
|
if (parts.length <= MAX_TOKENS) return parts;
|
|
@@ -1630,6 +1653,7 @@ function CompositionBar({ label, parts, formatValue, formatShare = format.share,
|
|
|
1630
1653
|
]
|
|
1631
1654
|
});
|
|
1632
1655
|
}
|
|
1656
|
+
|
|
1633
1657
|
// src/components/link-card.tsx
|
|
1634
1658
|
/** True when `href` is on another origin than the page (a relative one never is). Unreadable is treated as leaving. */
|
|
1635
1659
|
function leavesSite(href) {
|
|
@@ -1691,8 +1715,9 @@ function LinkCardList({ label, children, className }) {
|
|
|
1691
1715
|
}, React.isValidElement(child) && child.key != null ? child.key : i))
|
|
1692
1716
|
});
|
|
1693
1717
|
}
|
|
1718
|
+
|
|
1694
1719
|
// src/components/secret-field.tsx
|
|
1695
|
-
|
|
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";
|
|
1696
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. */
|
|
1697
1722
|
function SecretField({ noun, isSet, setAt, onChange, onSave, onRemove, consequence, test, disabled, id: idProp, name, className }) {
|
|
1698
1723
|
const { field } = useFieldControl();
|
|
@@ -1868,8 +1893,9 @@ function SecretField({ noun, isSet, setAt, onChange, onSave, onRemove, consequen
|
|
|
1868
1893
|
})]
|
|
1869
1894
|
});
|
|
1870
1895
|
}
|
|
1896
|
+
|
|
1871
1897
|
// src/components/alert.tsx
|
|
1872
|
-
|
|
1898
|
+
const tones = {
|
|
1873
1899
|
info: {
|
|
1874
1900
|
box: "bg-info-subtle text-info",
|
|
1875
1901
|
icon: Info
|
|
@@ -1916,6 +1942,7 @@ function Alert({ tone, title, children, action, announce = false, className }) {
|
|
|
1916
1942
|
]
|
|
1917
1943
|
});
|
|
1918
1944
|
}
|
|
1945
|
+
|
|
1919
1946
|
// src/components/player-warning.tsx
|
|
1920
1947
|
/** Creates a warning channel for one player. Pass `warning` to MediaPlayer and call `warn` when a warning occurs. */
|
|
1921
1948
|
function usePlayerWarnings() {
|
|
@@ -1991,6 +2018,7 @@ function PlayerWarningToast({ warning }) {
|
|
|
1991
2018
|
]
|
|
1992
2019
|
});
|
|
1993
2020
|
}
|
|
2021
|
+
|
|
1994
2022
|
// src/lib/client-work.ts
|
|
1995
2023
|
/** Runs browser-side work with progress, cancel and a clear end state, ready for `JobStatus`. */
|
|
1996
2024
|
function useClientWork(run) {
|
|
@@ -2049,13 +2077,14 @@ function useClientWork(run) {
|
|
|
2049
2077
|
dismiss
|
|
2050
2078
|
};
|
|
2051
2079
|
}
|
|
2080
|
+
|
|
2052
2081
|
// src/components/job-status.tsx
|
|
2053
2082
|
/** The sentence for a job's progress: "3 of 9 done, 6 remaining · Night Sky". */
|
|
2054
2083
|
function jobProgressText({ done, total, current }) {
|
|
2055
2084
|
const d = Math.min(total, Math.max(0, done));
|
|
2056
2085
|
return `${format.integer(d)} of ${format.integer(total)} done, ${format.integer(total - d)} remaining${current ? ` · ${current}` : ""}`;
|
|
2057
2086
|
}
|
|
2058
|
-
|
|
2087
|
+
const Spinner = ({ className, ...props }) => /* @__PURE__ */ jsx(LoaderCircle, {
|
|
2059
2088
|
...props,
|
|
2060
2089
|
className: cn(className, "motion-safe:animate-spin")
|
|
2061
2090
|
});
|
|
@@ -2164,6 +2193,7 @@ function JobStatus({ label, running, words, summary, progress, current: currentP
|
|
|
2164
2193
|
]
|
|
2165
2194
|
});
|
|
2166
2195
|
}
|
|
2196
|
+
|
|
2167
2197
|
// src/components/job-action.tsx
|
|
2168
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. */
|
|
2169
2199
|
function useJobAction({ start, job, queued, done, jobsHref, jobsLabel = "Show jobs", ...asyncOptions }) {
|
|
@@ -2239,8 +2269,9 @@ function useJobAction({ start, job, queued, done, jobsHref, jobsLabel = "Show jo
|
|
|
2239
2269
|
running: waiting && (running || action.phase === "pending")
|
|
2240
2270
|
};
|
|
2241
2271
|
}
|
|
2272
|
+
|
|
2242
2273
|
// src/components/workflow-steps.tsx
|
|
2243
|
-
|
|
2274
|
+
const DEFAULT_WORDS = {
|
|
2244
2275
|
done: "Done",
|
|
2245
2276
|
approved: "Approved",
|
|
2246
2277
|
ready: "Not started",
|
|
@@ -2249,7 +2280,7 @@ var DEFAULT_WORDS = {
|
|
|
2249
2280
|
waiting: "Needs review",
|
|
2250
2281
|
blocked: "Waiting"
|
|
2251
2282
|
};
|
|
2252
|
-
|
|
2283
|
+
const LOOKS$2 = {
|
|
2253
2284
|
done: {
|
|
2254
2285
|
tone: "success",
|
|
2255
2286
|
icon: Check
|
|
@@ -2401,7 +2432,7 @@ function summariseWorkflow(stages, { running = false } = {}) {
|
|
|
2401
2432
|
total
|
|
2402
2433
|
});
|
|
2403
2434
|
}
|
|
2404
|
-
|
|
2435
|
+
const SUMMARY_LOOKS = {
|
|
2405
2436
|
running: {
|
|
2406
2437
|
tone: "info",
|
|
2407
2438
|
icon: Clock,
|
|
@@ -2467,8 +2498,9 @@ function WorkflowSummary({ stages, running, words, className }) {
|
|
|
2467
2498
|
})]
|
|
2468
2499
|
});
|
|
2469
2500
|
}
|
|
2501
|
+
|
|
2470
2502
|
// src/lib/breakpoint.ts
|
|
2471
|
-
|
|
2503
|
+
const DEFAULTS = {
|
|
2472
2504
|
sm: "40rem",
|
|
2473
2505
|
md: "48rem",
|
|
2474
2506
|
lg: "64rem"
|
|
@@ -2496,6 +2528,7 @@ function useNarrowerThan(active) {
|
|
|
2496
2528
|
}, [active]);
|
|
2497
2529
|
return below;
|
|
2498
2530
|
}
|
|
2531
|
+
|
|
2499
2532
|
// src/lib/choice.ts
|
|
2500
2533
|
function resolve(explicit, implies) {
|
|
2501
2534
|
const all = new Set(explicit);
|
|
@@ -2547,6 +2580,7 @@ function noteFor({ added, dropped, refused }) {
|
|
|
2547
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`);
|
|
2548
2581
|
return parts.join(". ");
|
|
2549
2582
|
}
|
|
2583
|
+
|
|
2550
2584
|
// src/components/selection.tsx
|
|
2551
2585
|
function reconcile(prev, rows, keys, initial) {
|
|
2552
2586
|
const present = new Set(keys);
|
|
@@ -2564,7 +2598,7 @@ function reconcile(prev, rows, keys, initial) {
|
|
|
2564
2598
|
raw
|
|
2565
2599
|
};
|
|
2566
2600
|
}
|
|
2567
|
-
|
|
2601
|
+
const sameKeys = (a, b) => a.length === b.length && a.every((k, i) => k === b[i]);
|
|
2568
2602
|
/**
|
|
2569
2603
|
* Chosen row keys, pruned to the rows that exist, and the calls that change them. Spread into
|
|
2570
2604
|
* `DataTable`'s or `SelectableGrid`'s `selection` with a `rowLabel`. `initial` (keys, or a test on
|
|
@@ -2782,6 +2816,7 @@ function BulkBar({ count, noun, onClear, children, format: format$1 = format, cl
|
|
|
2782
2816
|
})]
|
|
2783
2817
|
});
|
|
2784
2818
|
}
|
|
2819
|
+
|
|
2785
2820
|
// src/components/disclosure.tsx
|
|
2786
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`. */
|
|
2787
2822
|
function Disclosure({ summary, children, actions, open, defaultOpen = false, onOpenChange, className }) {
|
|
@@ -2872,12 +2907,13 @@ function useUrlExpanded(param, { single }) {
|
|
|
2872
2907
|
single
|
|
2873
2908
|
]);
|
|
2874
2909
|
}
|
|
2910
|
+
|
|
2875
2911
|
// src/components/data-table.tsx
|
|
2876
|
-
|
|
2912
|
+
const collator$1 = new Intl.Collator(void 0, {
|
|
2877
2913
|
numeric: true,
|
|
2878
2914
|
sensitivity: "base"
|
|
2879
2915
|
});
|
|
2880
|
-
|
|
2916
|
+
const kind = (v) => typeof v === "number" ? 0 : typeof v === "string" ? 1 : 2;
|
|
2881
2917
|
/** Orders two present values: numbers, then text (locale order, numbers in text read as numbers), then dates. */
|
|
2882
2918
|
function compareValues(a, b) {
|
|
2883
2919
|
if (kind(a) !== kind(b)) return kind(a) - kind(b);
|
|
@@ -2948,11 +2984,11 @@ function UrlSortedTable(props) {
|
|
|
2948
2984
|
sortState: useUrlSort(props.sortParam, props.initialSort)
|
|
2949
2985
|
});
|
|
2950
2986
|
}
|
|
2951
|
-
|
|
2987
|
+
const features = tableFeatures({
|
|
2952
2988
|
rowSortingFeature,
|
|
2953
2989
|
sortedRowModel: createSortedRowModel()
|
|
2954
2990
|
});
|
|
2955
|
-
|
|
2991
|
+
const HIDE_BELOW = {
|
|
2956
2992
|
sm: "max-sm:hidden",
|
|
2957
2993
|
md: "max-md:hidden",
|
|
2958
2994
|
lg: "max-lg:hidden"
|
|
@@ -3024,7 +3060,8 @@ function Table$1({ caption, columns: allColumns, rows, rowKey, sortState: [sort,
|
|
|
3024
3060
|
const shift = useShiftNote();
|
|
3025
3061
|
const pressed = React.useRef(null);
|
|
3026
3062
|
const notePress = (e) => void (pressed.current = e.target.closest("[data-key]")?.getAttribute("data-key") ?? null);
|
|
3027
|
-
const
|
|
3063
|
+
const sortedRows = React.useMemo(() => modelRows.map((r) => r.original), [modelRows]);
|
|
3064
|
+
const select = useSelectRows(sortedRows, rowKey, selection);
|
|
3028
3065
|
const changeSelection = (next) => {
|
|
3029
3066
|
if (!selection) return;
|
|
3030
3067
|
if (next !== "all") {
|
|
@@ -3182,9 +3219,9 @@ function Table$1({ caption, columns: allColumns, rows, rowKey, sortState: [sort,
|
|
|
3182
3219
|
}) : grid
|
|
3183
3220
|
});
|
|
3184
3221
|
}
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3222
|
+
const SELECT = "\0select";
|
|
3223
|
+
const EXPAND = "\0expand";
|
|
3224
|
+
const noop = () => {};
|
|
3188
3225
|
/** The loading placeholder for a `DataTable`, shaped like its rows. */
|
|
3189
3226
|
function TableSkeleton({ rows = 4, columns = 5 }) {
|
|
3190
3227
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -3199,8 +3236,9 @@ function TableSkeleton({ rows = 4, columns = 5 }) {
|
|
|
3199
3236
|
}, r))]
|
|
3200
3237
|
});
|
|
3201
3238
|
}
|
|
3239
|
+
|
|
3202
3240
|
// src/components/jobs-table.tsx
|
|
3203
|
-
|
|
3241
|
+
const LOOKS$1 = {
|
|
3204
3242
|
queued: {
|
|
3205
3243
|
tone: "neutral",
|
|
3206
3244
|
icon: Clock,
|
|
@@ -3315,8 +3353,9 @@ function JobsTable({ caption, jobs, describe = (j) => j.kind, onCancel, onRetry,
|
|
|
3315
3353
|
className: cn(className)
|
|
3316
3354
|
});
|
|
3317
3355
|
}
|
|
3356
|
+
|
|
3318
3357
|
// src/components/schedule-table.tsx
|
|
3319
|
-
|
|
3358
|
+
const LOOKS = {
|
|
3320
3359
|
ok: {
|
|
3321
3360
|
tone: "success",
|
|
3322
3361
|
icon: Check,
|
|
@@ -3401,8 +3440,9 @@ function ScheduleTable({ caption, rows, now, className }) {
|
|
|
3401
3440
|
className
|
|
3402
3441
|
});
|
|
3403
3442
|
}
|
|
3443
|
+
|
|
3404
3444
|
// src/components/film-strip.tsx
|
|
3405
|
-
|
|
3445
|
+
const GAP$1 = 4;
|
|
3406
3446
|
/** `n` of `items` spread evenly from the first to the last (all of them when there are no more than `n`). */
|
|
3407
3447
|
function pickEvenly(items, n) {
|
|
3408
3448
|
if (n <= 0) return [];
|
|
@@ -3485,6 +3525,7 @@ function FilmStrip({ label, frames, span, time, onSeek, aspect = "4/3", frameWid
|
|
|
3485
3525
|
})
|
|
3486
3526
|
});
|
|
3487
3527
|
}
|
|
3528
|
+
|
|
3488
3529
|
// src/components/media-contents.tsx
|
|
3489
3530
|
/** The index of the item whose span holds `time`, or -1. */
|
|
3490
3531
|
function currentItem(items, time) {
|
|
@@ -3505,7 +3546,7 @@ function MediaContents({ label, items, time, onSeek, onSelect, className }) {
|
|
|
3505
3546
|
}, item.id))
|
|
3506
3547
|
});
|
|
3507
3548
|
}
|
|
3508
|
-
|
|
3549
|
+
const ContentsRow = React.memo(function ContentsRow({ item, current, onSeek, onSelect }) {
|
|
3509
3550
|
const from = format.runningTime(item.start);
|
|
3510
3551
|
return /* @__PURE__ */ jsx("li", {
|
|
3511
3552
|
"aria-current": current ? "time" : void 0,
|
|
@@ -3538,8 +3579,9 @@ var ContentsRow = React.memo(function ContentsRow({ item, current, onSeek, onSel
|
|
|
3538
3579
|
})
|
|
3539
3580
|
});
|
|
3540
3581
|
});
|
|
3582
|
+
|
|
3541
3583
|
// src/components/media-skip.ts
|
|
3542
|
-
|
|
3584
|
+
const LEVEL_KIND = {
|
|
3543
3585
|
small: "scene",
|
|
3544
3586
|
large: "chapter"
|
|
3545
3587
|
};
|
|
@@ -3586,6 +3628,7 @@ function skipAction(marks, level, direction, time, { steps = {}, duration = null
|
|
|
3586
3628
|
by: "time"
|
|
3587
3629
|
};
|
|
3588
3630
|
}
|
|
3631
|
+
|
|
3589
3632
|
// src/components/fullscreen-frame.tsx
|
|
3590
3633
|
/** Whether this browser can show an element full screen. False in jsdom and on iPhone, where the modal fallback is used. */
|
|
3591
3634
|
function canFullscreen() {
|
|
@@ -3653,9 +3696,10 @@ function FullscreenFrame({ label, active, onActiveChange, modal: allowModal = tr
|
|
|
3653
3696
|
})
|
|
3654
3697
|
});
|
|
3655
3698
|
}
|
|
3699
|
+
|
|
3656
3700
|
// src/components/media.tsx
|
|
3657
|
-
|
|
3658
|
-
|
|
3701
|
+
const clamp$4 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
3702
|
+
const timecode = (t, { precision, fps }) => format.timecode(t, {
|
|
3659
3703
|
precision,
|
|
3660
3704
|
fps
|
|
3661
3705
|
});
|
|
@@ -3695,14 +3739,14 @@ function TimeReadout({ time, duration, precision = "seconds", fps = 30, classNam
|
|
|
3695
3739
|
]
|
|
3696
3740
|
});
|
|
3697
3741
|
}
|
|
3698
|
-
|
|
3742
|
+
const SPAN_TONE = {
|
|
3699
3743
|
info: "bg-info",
|
|
3700
3744
|
success: "bg-success",
|
|
3701
3745
|
warning: "bg-warning",
|
|
3702
3746
|
danger: "bg-danger",
|
|
3703
3747
|
neutral: "bg-neutral-8"
|
|
3704
3748
|
};
|
|
3705
|
-
|
|
3749
|
+
const COLOUR_NAME = /^--[\w-]+$/;
|
|
3706
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. */
|
|
3707
3751
|
function SpanRange({ span, duration, thin, ...time }) {
|
|
3708
3752
|
const name = `${span.label}, ${timecode(span.start, time)} to ${timecode(span.end, time)}`;
|
|
@@ -4189,27 +4233,28 @@ function StageGuides({ safe, thirds, centre, className }) {
|
|
|
4189
4233
|
children: [draw("stroke-foreground", 3), draw("stroke-background", 1)]
|
|
4190
4234
|
});
|
|
4191
4235
|
}
|
|
4236
|
+
|
|
4192
4237
|
// src/components/key-owner.ts
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4238
|
+
const members = /* @__PURE__ */ new Set();
|
|
4239
|
+
let active = null;
|
|
4240
|
+
let warned = false;
|
|
4241
|
+
let snapshot = {
|
|
4197
4242
|
count: 0,
|
|
4198
4243
|
active: null
|
|
4199
4244
|
};
|
|
4200
|
-
|
|
4201
|
-
|
|
4245
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
4246
|
+
const emit = () => {
|
|
4202
4247
|
snapshot = {
|
|
4203
4248
|
count: members.size,
|
|
4204
4249
|
active
|
|
4205
4250
|
};
|
|
4206
4251
|
listeners.forEach((l) => l());
|
|
4207
4252
|
};
|
|
4208
|
-
|
|
4253
|
+
const subscribe = (l) => {
|
|
4209
4254
|
listeners.add(l);
|
|
4210
4255
|
return () => void listeners.delete(l);
|
|
4211
4256
|
};
|
|
4212
|
-
|
|
4257
|
+
const get = () => snapshot;
|
|
4213
4258
|
/**
|
|
4214
4259
|
* Joins the page's key owners while `enabled`, and takes the keys whenever `playing` turns true. Spread nothing: call
|
|
4215
4260
|
* `claim` from the region's focus and pointer-down handlers, and bind the player's `useHotkeys` with `enabled: owner.owns`.
|
|
@@ -4248,8 +4293,9 @@ function useKeyOwner(enabled, playing = false) {
|
|
|
4248
4293
|
claim
|
|
4249
4294
|
};
|
|
4250
4295
|
}
|
|
4296
|
+
|
|
4251
4297
|
// src/components/media-group.tsx
|
|
4252
|
-
|
|
4298
|
+
const groups = /* @__PURE__ */ new Map();
|
|
4253
4299
|
/** Adds an element, or a `useTimeline` clock, to a named group until the returned function is called; whenever one plays, the others pause. */
|
|
4254
4300
|
function joinMediaGroup(name, el) {
|
|
4255
4301
|
let members = groups.get(name);
|
|
@@ -4265,7 +4311,7 @@ function joinMediaGroup(name, el) {
|
|
|
4265
4311
|
if (members.size === 0 && groups.get(name) === members) groups.delete(name);
|
|
4266
4312
|
};
|
|
4267
4313
|
}
|
|
4268
|
-
|
|
4314
|
+
const GroupContext = React.createContext(null);
|
|
4269
4315
|
/** The group a `MediaGroup` above this point names, or null. */
|
|
4270
4316
|
function useMediaGroupName() {
|
|
4271
4317
|
return React.useContext(GroupContext);
|
|
@@ -4279,7 +4325,7 @@ function MediaGroup({ name, children }) {
|
|
|
4279
4325
|
});
|
|
4280
4326
|
}
|
|
4281
4327
|
/** Whether two windows are the same stretch. */
|
|
4282
|
-
|
|
4328
|
+
const sameWindow = (a, b) => (a ?? null) === (b ?? null) || !!a && !!b && a.start === b.start && a.end === b.end;
|
|
4283
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. */
|
|
4284
4330
|
function PlayWindowButton({ media, window: w, label, size = "sm", className }) {
|
|
4285
4331
|
const playing = media.playing && sameWindow(media.window, w);
|
|
@@ -4292,9 +4338,10 @@ function PlayWindowButton({ media, window: w, label, size = "sm", className }) {
|
|
|
4292
4338
|
onClick: () => playing ? media.pause() : void media.playWindow(w)
|
|
4293
4339
|
});
|
|
4294
4340
|
}
|
|
4341
|
+
|
|
4295
4342
|
// src/components/media-spans.tsx
|
|
4296
|
-
|
|
4297
|
-
|
|
4343
|
+
const lower = (label) => label.charAt(0).toLowerCase() + label.slice(1);
|
|
4344
|
+
const WORDS$1 = {
|
|
4298
4345
|
skip: (l) => `Skip ${lower(l)}`,
|
|
4299
4346
|
skipped: (l) => `Skipped ${lower(l)}`,
|
|
4300
4347
|
mute: (l) => `Mute ${lower(l)}`,
|
|
@@ -4302,7 +4349,7 @@ var WORDS$1 = {
|
|
|
4302
4349
|
undo: "Undo"
|
|
4303
4350
|
};
|
|
4304
4351
|
/** How long "Skipped intro, Undo" stays. */
|
|
4305
|
-
|
|
4352
|
+
const NOTICE_MS$1 = 6e3;
|
|
4306
4353
|
/** Draws the spans' ranges and acts on them as playback reaches them. See the file comment for the rules. */
|
|
4307
4354
|
function useMediaSpans({ spans, kinds = {}, words, onSpan, time, playing, duration, limit = Infinity, seek, volume, setVolume }) {
|
|
4308
4355
|
const w = {
|
|
@@ -4501,6 +4548,7 @@ function SpanActions({ state, other, className }) {
|
|
|
4501
4548
|
})]
|
|
4502
4549
|
});
|
|
4503
4550
|
}
|
|
4551
|
+
|
|
4504
4552
|
// src/components/media-progress.ts
|
|
4505
4553
|
function createWatchedRanges() {
|
|
4506
4554
|
let ranges = [];
|
|
@@ -4522,6 +4570,7 @@ function createWatchedRanges() {
|
|
|
4522
4570
|
clear: () => void (ranges = [])
|
|
4523
4571
|
};
|
|
4524
4572
|
}
|
|
4573
|
+
|
|
4525
4574
|
// src/components/link.tsx
|
|
4526
4575
|
function useTarget(target, newTab, state) {
|
|
4527
4576
|
const navigate = useNavigate();
|
|
@@ -4580,10 +4629,11 @@ function TextLink(all) {
|
|
|
4580
4629
|
children: [Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }), children]
|
|
4581
4630
|
}));
|
|
4582
4631
|
}
|
|
4632
|
+
|
|
4583
4633
|
// src/components/media-player.tsx
|
|
4584
4634
|
/** How far one notch of the wheel over a focused video moves the volume, in percent. */
|
|
4585
|
-
|
|
4586
|
-
|
|
4635
|
+
const WHEEL_VOLUME_STEP = 5;
|
|
4636
|
+
const idle = {
|
|
4587
4637
|
ready: 0,
|
|
4588
4638
|
waitingForMore: false,
|
|
4589
4639
|
playing: false,
|
|
@@ -4597,7 +4647,7 @@ var idle = {
|
|
|
4597
4647
|
loading: false,
|
|
4598
4648
|
error: null
|
|
4599
4649
|
};
|
|
4600
|
-
|
|
4650
|
+
const LOAD_MESSAGES$1 = {
|
|
4601
4651
|
2: "The connection dropped while it was loading.",
|
|
4602
4652
|
3: "The file could not be decoded.",
|
|
4603
4653
|
4: "This format is not supported or the file is not there."
|
|
@@ -4625,7 +4675,7 @@ function useElementListeners(ref, bind) {
|
|
|
4625
4675
|
bound.current = null;
|
|
4626
4676
|
}, []);
|
|
4627
4677
|
}
|
|
4628
|
-
|
|
4678
|
+
const EVENTS = [
|
|
4629
4679
|
"loadstart",
|
|
4630
4680
|
"loadedmetadata",
|
|
4631
4681
|
"durationchange",
|
|
@@ -4675,7 +4725,7 @@ function useMediaElement(ref, options = {}) {
|
|
|
4675
4725
|
} : null);
|
|
4676
4726
|
if (el.error && el.error.code !== 1) error = {
|
|
4677
4727
|
kind: "load",
|
|
4678
|
-
message: LOAD_MESSAGES[el.error.code] ?? "It could not be played."
|
|
4728
|
+
message: LOAD_MESSAGES$1[el.error.code] ?? "It could not be played."
|
|
4679
4729
|
};
|
|
4680
4730
|
const next = {
|
|
4681
4731
|
ready,
|
|
@@ -5016,7 +5066,7 @@ function useAttachedSource(ref, src, attach, onProblem, growing, start) {
|
|
|
5016
5066
|
return React.useMemo(() => ({ reload: (at) => hold.current?.attachment.reload(at) }), []);
|
|
5017
5067
|
}
|
|
5018
5068
|
/** Playback speeds an audiobook or lecture listener expects. */
|
|
5019
|
-
|
|
5069
|
+
const SPEECH_RATES = [
|
|
5020
5070
|
.75,
|
|
5021
5071
|
1,
|
|
5022
5072
|
1.25,
|
|
@@ -5026,9 +5076,9 @@ var SPEECH_RATES = [
|
|
|
5026
5076
|
2.5,
|
|
5027
5077
|
3
|
|
5028
5078
|
];
|
|
5029
|
-
|
|
5079
|
+
const JUMP = 10;
|
|
5030
5080
|
/** How long a notice such as "Picked up at 2:05" stays once the player is playing. */
|
|
5031
|
-
|
|
5081
|
+
const NOTICE_MS = 6e3;
|
|
5032
5082
|
function useCoarsePointer() {
|
|
5033
5083
|
const [coarse, setCoarse] = React.useState(false);
|
|
5034
5084
|
React.useEffect(() => {
|
|
@@ -5819,11 +5869,12 @@ function HeadingLink({ to, state, className, label, children }) {
|
|
|
5819
5869
|
children
|
|
5820
5870
|
}));
|
|
5821
5871
|
}
|
|
5872
|
+
|
|
5822
5873
|
// src/lib/transcript.ts
|
|
5823
5874
|
/** The id of a word for marking (`TranscriptView`'s `marking`, `Mark`): its phrase and its place in it. */
|
|
5824
|
-
|
|
5875
|
+
const wordId = (phraseId, index) => `${phraseId}:${index}`;
|
|
5825
5876
|
/** The phrase an id made by `wordId` belongs to. */
|
|
5826
|
-
|
|
5877
|
+
const phraseOfWordId = (id) => id.slice(0, id.lastIndexOf(":"));
|
|
5827
5878
|
/** Whether a word is doubtful: the recogniser said so, or its confidence is under `below`. */
|
|
5828
5879
|
function isDoubtful(word, below = .6) {
|
|
5829
5880
|
return word.doubtful ?? (word.confidence !== void 0 && word.confidence < below);
|
|
@@ -5855,6 +5906,7 @@ function wordAt(phrase, time) {
|
|
|
5855
5906
|
else break;
|
|
5856
5907
|
return found;
|
|
5857
5908
|
}
|
|
5909
|
+
|
|
5858
5910
|
// src/lib/marks.ts
|
|
5859
5911
|
/** The ids from `a` to `b` inclusive, in document order whichever way round they are given. Empty when either is not in `ids`. */
|
|
5860
5912
|
function rangeBetween(ids, a, b) {
|
|
@@ -5880,8 +5932,9 @@ function stepId(ids, from, by) {
|
|
|
5880
5932
|
if (i < 0) return by >= 0 ? ids[0] : ids[ids.length - 1];
|
|
5881
5933
|
return ids[Math.min(Math.max(i + by, 0), ids.length - 1)];
|
|
5882
5934
|
}
|
|
5935
|
+
|
|
5883
5936
|
// src/components/markable-text.tsx
|
|
5884
|
-
|
|
5937
|
+
const TONE$2 = {
|
|
5885
5938
|
neutral: {
|
|
5886
5939
|
fill: "var(--muted)",
|
|
5887
5940
|
edge: "var(--muted-foreground)"
|
|
@@ -5903,7 +5956,7 @@ var TONE$2 = {
|
|
|
5903
5956
|
edge: "var(--danger)"
|
|
5904
5957
|
}
|
|
5905
5958
|
};
|
|
5906
|
-
|
|
5959
|
+
const MarksContext = React.createContext(null);
|
|
5907
5960
|
/** One word (or phrase, or clip) that can be marked. Draws its mark, its selection and the caret; inside a `MarkableText`. */
|
|
5908
5961
|
function Mark({ id, children, className, onClick, onHover }) {
|
|
5909
5962
|
const c = React.useContext(MarksContext);
|
|
@@ -6139,8 +6192,9 @@ function MarkableText({ label, ids, marks, kinds, onMark, clearKeys = [], onActi
|
|
|
6139
6192
|
]
|
|
6140
6193
|
});
|
|
6141
6194
|
}
|
|
6195
|
+
|
|
6142
6196
|
// src/components/virtual-list.tsx
|
|
6143
|
-
|
|
6197
|
+
const FOOTER = "\0footer";
|
|
6144
6198
|
/** A list that renders only its visible rows (React Aria's GridList and Virtualizer) from `virtualizeFrom` items, with arrow-key navigation between rows. */
|
|
6145
6199
|
function VirtualList({ label, items, itemKey, children, estimateSize = 48, rowHeight, height = 480, virtualizeFrom = 100, bounded = false, footer, className }) {
|
|
6146
6200
|
const virtual = items.length >= virtualizeFrom;
|
|
@@ -6180,10 +6234,11 @@ function VirtualList({ label, items, itemKey, children, estimateSize = 48, rowHe
|
|
|
6180
6234
|
children: list
|
|
6181
6235
|
}) : list;
|
|
6182
6236
|
}
|
|
6237
|
+
|
|
6183
6238
|
// src/components/transcript-view.tsx
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
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)}`;
|
|
6187
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. */
|
|
6188
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 }) {
|
|
6189
6244
|
const [ownMode, setOwnMode] = React.useState("original");
|
|
@@ -6699,8 +6754,9 @@ function PhraseRow({ phrase, mode, active, word, onSeek, marking, onCorrectionPr
|
|
|
6699
6754
|
]
|
|
6700
6755
|
});
|
|
6701
6756
|
}
|
|
6757
|
+
|
|
6702
6758
|
// src/lib/waveform.ts
|
|
6703
|
-
|
|
6759
|
+
const isPair = (p) => typeof p.min === "object";
|
|
6704
6760
|
/** Makes the lowest and highest sample of each slice from either form. A magnitude `m` is the pair `-m` to `m`. */
|
|
6705
6761
|
function toPeakPair(peaks) {
|
|
6706
6762
|
if (isPair(peaks)) {
|
|
@@ -6808,15 +6864,16 @@ async function peaksFromAudio(audio, buckets, options = {}) {
|
|
|
6808
6864
|
};
|
|
6809
6865
|
}
|
|
6810
6866
|
/** The time at the pointer, given the visible range and the width. */
|
|
6811
|
-
|
|
6867
|
+
const timeAt = (px, width, from, to) => from + Math.min(Math.max(px, 0), width) / (width || 1) * (to - from);
|
|
6812
6868
|
/** Keeps a visible range of `span` seconds inside `0` to `duration`. */
|
|
6813
6869
|
function clampView(from, span, duration) {
|
|
6814
6870
|
const s = Math.min(Math.max(span, Math.min(duration, .05)), duration);
|
|
6815
6871
|
const a = Math.min(Math.max(from, 0), Math.max(duration - s, 0));
|
|
6816
6872
|
return [a, a + s];
|
|
6817
6873
|
}
|
|
6874
|
+
|
|
6818
6875
|
// src/components/waveform.tsx
|
|
6819
|
-
|
|
6876
|
+
const TONE$1 = {
|
|
6820
6877
|
neutral: {
|
|
6821
6878
|
fill: "var(--muted)",
|
|
6822
6879
|
edge: "var(--muted-foreground)"
|
|
@@ -6838,7 +6895,7 @@ var TONE$1 = {
|
|
|
6838
6895
|
edge: "var(--danger)"
|
|
6839
6896
|
}
|
|
6840
6897
|
};
|
|
6841
|
-
|
|
6898
|
+
const MARK_LINE = {
|
|
6842
6899
|
beat: {
|
|
6843
6900
|
width: 1,
|
|
6844
6901
|
opacity: .16
|
|
@@ -6857,7 +6914,7 @@ var MARK_LINE = {
|
|
|
6857
6914
|
dash: "4 3"
|
|
6858
6915
|
}
|
|
6859
6916
|
};
|
|
6860
|
-
|
|
6917
|
+
const WORDS = {
|
|
6861
6918
|
running: "Reading the waveform",
|
|
6862
6919
|
finished: "Waveform ready",
|
|
6863
6920
|
failed: "Could not read the waveform"
|
|
@@ -6872,8 +6929,8 @@ async function defaultDecode(data) {
|
|
|
6872
6929
|
ctx.close?.();
|
|
6873
6930
|
}
|
|
6874
6931
|
}
|
|
6875
|
-
|
|
6876
|
-
|
|
6932
|
+
const clamp$3 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
6933
|
+
const clock = (t) => format.runningTime(t);
|
|
6877
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. */
|
|
6878
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 }) {
|
|
6879
6936
|
const work = useClientWork(async ({ signal, progress }) => {
|
|
@@ -7319,8 +7376,9 @@ function Waveform({ label, peaks, source, duration: given, time, onSeek, marks =
|
|
|
7319
7376
|
]
|
|
7320
7377
|
});
|
|
7321
7378
|
}
|
|
7379
|
+
|
|
7322
7380
|
// src/components/use-timeline.ts
|
|
7323
|
-
|
|
7381
|
+
const clamp$2 = (v, lo, hi) => Math.min(Math.max(v, lo), hi);
|
|
7324
7382
|
/** A playhead the app owns, in the shape `Transport`, `SeekBar` and `transportShortcuts` take. */
|
|
7325
7383
|
function useTimeline({ duration, rate = 1, frame = 1 / 30, loop = false, startAt = "start", group, keys = true }) {
|
|
7326
7384
|
const length = Number.isFinite(duration) && duration > 0 ? duration : 0;
|
|
@@ -7421,6 +7479,7 @@ function useTimeline({ duration, rate = 1, frame = 1 / 30, loop = false, startAt
|
|
|
7421
7479
|
regionProps
|
|
7422
7480
|
};
|
|
7423
7481
|
}
|
|
7482
|
+
|
|
7424
7483
|
// src/components/timeline-player.tsx
|
|
7425
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. */
|
|
7426
7485
|
function TimelinePlayer({ clock, label, stage, rates, onRateChange, legend = false, className }) {
|
|
@@ -7487,9 +7546,718 @@ function TimelinePlayer({ clock, label, stage, rates, onRateChange, legend = fal
|
|
|
7487
7546
|
]
|
|
7488
7547
|
});
|
|
7489
7548
|
}
|
|
7549
|
+
|
|
7550
|
+
// src/lib/edit-list.ts
|
|
7551
|
+
/** Below this, two times are the same (a frame at 120 fps is 8 ms; float sums of rationals drift by far less). */
|
|
7552
|
+
const EDIT_EPS = 1e-6;
|
|
7553
|
+
const length = (c) => Math.max(0, c.end - c.start);
|
|
7554
|
+
/** The start of each clip in edit time, and the total. */
|
|
7555
|
+
function editTimes(clips) {
|
|
7556
|
+
const at = [];
|
|
7557
|
+
let t = 0;
|
|
7558
|
+
for (const c of clips) {
|
|
7559
|
+
at.push(t);
|
|
7560
|
+
t += length(c);
|
|
7561
|
+
}
|
|
7562
|
+
return {
|
|
7563
|
+
at,
|
|
7564
|
+
duration: t
|
|
7565
|
+
};
|
|
7566
|
+
}
|
|
7567
|
+
/** The clip playing at edit `time` and the time in its file. At a cut the later clip is playing (clips are half-open); at or past the end, the last clip at its end. Null for an empty edit. */
|
|
7568
|
+
function locateInEdit(clips, times, time) {
|
|
7569
|
+
if (clips.length === 0) return null;
|
|
7570
|
+
if (time >= times.duration - 1e-6) {
|
|
7571
|
+
const last = clips.length - 1;
|
|
7572
|
+
return {
|
|
7573
|
+
index: last,
|
|
7574
|
+
source: clips[last].end
|
|
7575
|
+
};
|
|
7576
|
+
}
|
|
7577
|
+
const t = Math.max(0, time);
|
|
7578
|
+
let lo = 0;
|
|
7579
|
+
let hi = clips.length - 1;
|
|
7580
|
+
while (lo < hi) {
|
|
7581
|
+
const mid = lo + hi + 1 >> 1;
|
|
7582
|
+
if (times.at[mid] <= t + 1e-6) lo = mid;
|
|
7583
|
+
else hi = mid - 1;
|
|
7584
|
+
}
|
|
7585
|
+
while (lo > 0 && length(clips[lo]) === 0) lo--;
|
|
7586
|
+
return {
|
|
7587
|
+
index: lo,
|
|
7588
|
+
source: clips[lo].start + Math.max(0, t - times.at[lo])
|
|
7589
|
+
};
|
|
7590
|
+
}
|
|
7591
|
+
/** Edit time of `source` seconds into clip `index`'s file, held inside the clip. */
|
|
7592
|
+
function editTimeOf(clips, times, index, source) {
|
|
7593
|
+
const c = clips[index];
|
|
7594
|
+
return times.at[index] + Math.min(Math.max(source - c.start, 0), length(c));
|
|
7595
|
+
}
|
|
7596
|
+
/** Whether `b` carries straight on from `a` in the same file, so playing through the cut needs no seek. */
|
|
7597
|
+
function continues(a, b) {
|
|
7598
|
+
return a.src === b.src && Math.abs(b.start - a.end) < 1e-6;
|
|
7599
|
+
}
|
|
7600
|
+
/** The first clip after `index` that does not carry straight on from the one before it: the next one a second element must have ready. Null when the rest of the edit is one stretch of the same file. */
|
|
7601
|
+
function nextBreak(clips, index) {
|
|
7602
|
+
for (let k = index + 1; k < clips.length; k++) if (!continues(clips[k - 1], clips[k])) return k;
|
|
7603
|
+
return null;
|
|
7604
|
+
}
|
|
7605
|
+
|
|
7606
|
+
// src/components/edit-list-player.tsx
|
|
7607
|
+
const LOAD_MESSAGES = {
|
|
7608
|
+
2: "The connection dropped while it was loading.",
|
|
7609
|
+
3: "A file could not be decoded.",
|
|
7610
|
+
4: "A file is in a format this browser cannot play, or is not there."
|
|
7611
|
+
};
|
|
7612
|
+
/** Plays an edit list through two stacked `<video>` elements with no gap at the cuts. `EditListPlayer` is it with the bar. */
|
|
7613
|
+
function useEditList(clips, options = {}) {
|
|
7614
|
+
const { fps, keys = true } = options;
|
|
7615
|
+
const a = React.useRef(null);
|
|
7616
|
+
const b = React.useRef(null);
|
|
7617
|
+
const refs = React.useMemo(() => [a, b], []);
|
|
7618
|
+
const times = React.useMemo(() => editTimes(clips), [clips]);
|
|
7619
|
+
const [front, setFront] = React.useState(0);
|
|
7620
|
+
const [index, setIndex] = React.useState(clips.length ? 0 : -1);
|
|
7621
|
+
const [time, setTime] = React.useState(0);
|
|
7622
|
+
const [playing, setPlaying] = React.useState(false);
|
|
7623
|
+
const [loading, setLoading] = React.useState(false);
|
|
7624
|
+
const [error, setError] = React.useState(null);
|
|
7625
|
+
const [volume, setVolumeState] = React.useState(100);
|
|
7626
|
+
const live = React.useRef({
|
|
7627
|
+
clips,
|
|
7628
|
+
times,
|
|
7629
|
+
front: 0,
|
|
7630
|
+
index: clips.length ? 0 : -1,
|
|
7631
|
+
holds: [null, null],
|
|
7632
|
+
pending: [null, null],
|
|
7633
|
+
playing: false,
|
|
7634
|
+
quiet: [false, false],
|
|
7635
|
+
unlocked: [false, false],
|
|
7636
|
+
busy: false,
|
|
7637
|
+
volume: 100,
|
|
7638
|
+
lead: fps ? .5 / fps : .02,
|
|
7639
|
+
refresh: 1 / 60,
|
|
7640
|
+
frames: false
|
|
7641
|
+
});
|
|
7642
|
+
live.current.clips = clips;
|
|
7643
|
+
live.current.times = times;
|
|
7644
|
+
live.current.lead = fps ? .5 / fps : .02;
|
|
7645
|
+
const onClip = React.useRef(options.onClipChange);
|
|
7646
|
+
onClip.current = options.onClipChange;
|
|
7647
|
+
const el = (slot) => refs[slot].current;
|
|
7648
|
+
const setIdx = React.useCallback((i) => {
|
|
7649
|
+
if (live.current.index === i) return;
|
|
7650
|
+
live.current.index = i;
|
|
7651
|
+
setIndex(i);
|
|
7652
|
+
onClip.current?.(i);
|
|
7653
|
+
}, []);
|
|
7654
|
+
const hold = React.useCallback((slot, i, source) => {
|
|
7655
|
+
const v = el(slot);
|
|
7656
|
+
const c = live.current.clips[i];
|
|
7657
|
+
if (!v || !c) return;
|
|
7658
|
+
const at = source ?? c.start;
|
|
7659
|
+
live.current.holds[slot] = i;
|
|
7660
|
+
v.volume = live.current.volume / 100;
|
|
7661
|
+
if (v.getAttribute("src") !== c.src) {
|
|
7662
|
+
live.current.quiet[slot] = true;
|
|
7663
|
+
live.current.pending[slot] = at;
|
|
7664
|
+
v.src = c.src;
|
|
7665
|
+
v.load();
|
|
7666
|
+
live.current.quiet[slot] = false;
|
|
7667
|
+
} else if (v.readyState >= 1) {
|
|
7668
|
+
if (Math.abs(v.currentTime - at) > 1e-6) v.currentTime = at;
|
|
7669
|
+
} else live.current.pending[slot] = at;
|
|
7670
|
+
}, []);
|
|
7671
|
+
const muteFor = (v, vol) => {
|
|
7672
|
+
v.muted = vol === 0;
|
|
7673
|
+
};
|
|
7674
|
+
const prepareBehind = React.useCallback((i) => {
|
|
7675
|
+
const behind = 1 - live.current.front;
|
|
7676
|
+
const k = nextBreak(live.current.clips, i);
|
|
7677
|
+
if (k === null) return;
|
|
7678
|
+
if (live.current.holds[behind] === k && live.current.pending[behind] === null) {
|
|
7679
|
+
const v = el(behind);
|
|
7680
|
+
const c = live.current.clips[k];
|
|
7681
|
+
if (v && Math.abs(v.currentTime - c.start) <= 1e-6) return;
|
|
7682
|
+
}
|
|
7683
|
+
el(behind)?.pause();
|
|
7684
|
+
hold(behind, k);
|
|
7685
|
+
}, [hold]);
|
|
7686
|
+
const reject = React.useCallback(() => {
|
|
7687
|
+
setError({
|
|
7688
|
+
kind: "blocked",
|
|
7689
|
+
message: "The browser did not let it play. Press Play to start it."
|
|
7690
|
+
});
|
|
7691
|
+
live.current.playing = false;
|
|
7692
|
+
setPlaying(false);
|
|
7693
|
+
}, []);
|
|
7694
|
+
const playFront = React.useCallback(() => {
|
|
7695
|
+
const v = el(live.current.front);
|
|
7696
|
+
if (!v) return;
|
|
7697
|
+
muteFor(v, live.current.volume);
|
|
7698
|
+
const p = v.play();
|
|
7699
|
+
if (p && typeof p.catch === "function") p.catch(reject);
|
|
7700
|
+
}, [reject]);
|
|
7701
|
+
const show = (slot) => refs.forEach((r, i) => {
|
|
7702
|
+
const v = r.current;
|
|
7703
|
+
if (!v) return;
|
|
7704
|
+
v.style.opacity = i === slot ? "" : "0";
|
|
7705
|
+
v.style.pointerEvents = i === slot ? "" : "none";
|
|
7706
|
+
});
|
|
7707
|
+
React.useLayoutEffect(() => show(live.current.front));
|
|
7708
|
+
const bringForward = React.useCallback((slot) => {
|
|
7709
|
+
const old = live.current.front;
|
|
7710
|
+
if (old === slot) return;
|
|
7711
|
+
live.current.front = slot;
|
|
7712
|
+
show(slot);
|
|
7713
|
+
setFront(slot);
|
|
7714
|
+
if (live.current.playing) playFront();
|
|
7715
|
+
el(old)?.pause();
|
|
7716
|
+
}, [playFront]);
|
|
7717
|
+
const advance = React.useCallback((j) => {
|
|
7718
|
+
const s = live.current;
|
|
7719
|
+
if (j >= s.clips.length) {
|
|
7720
|
+
s.playing = false;
|
|
7721
|
+
setPlaying(false);
|
|
7722
|
+
el(s.front)?.pause();
|
|
7723
|
+
setTime(s.times.duration);
|
|
7724
|
+
return;
|
|
7725
|
+
}
|
|
7726
|
+
const i = s.index;
|
|
7727
|
+
if (i >= 0 && continues(s.clips[i], s.clips[j]) && s.holds[s.front] === i) {
|
|
7728
|
+
s.holds[s.front] = j;
|
|
7729
|
+
setIdx(j);
|
|
7730
|
+
return;
|
|
7731
|
+
}
|
|
7732
|
+
const behind = 1 - s.front;
|
|
7733
|
+
if (s.holds[behind] !== j) hold(behind, j);
|
|
7734
|
+
setIdx(j);
|
|
7735
|
+
bringForward(behind);
|
|
7736
|
+
prepareBehind(j);
|
|
7737
|
+
}, [
|
|
7738
|
+
bringForward,
|
|
7739
|
+
hold,
|
|
7740
|
+
prepareBehind,
|
|
7741
|
+
setIdx
|
|
7742
|
+
]);
|
|
7743
|
+
const cut = React.useCallback((i) => {
|
|
7744
|
+
const s = live.current;
|
|
7745
|
+
if (s.busy || s.index !== i || !s.playing) return;
|
|
7746
|
+
s.busy = true;
|
|
7747
|
+
try {
|
|
7748
|
+
advance(i + 1);
|
|
7749
|
+
} finally {
|
|
7750
|
+
s.busy = false;
|
|
7751
|
+
}
|
|
7752
|
+
}, [advance]);
|
|
7753
|
+
const tick = React.useCallback(() => {
|
|
7754
|
+
const s = live.current;
|
|
7755
|
+
const v = el(s.front);
|
|
7756
|
+
const i = s.index;
|
|
7757
|
+
if (!v || i < 0 || s.busy) return;
|
|
7758
|
+
const c = s.clips[i];
|
|
7759
|
+
if (!c) return;
|
|
7760
|
+
const early = s.frames ? 0 : Math.max(s.lead, s.refresh);
|
|
7761
|
+
if (s.playing && s.pending[s.front] === null && (v.currentTime >= c.end - early || v.ended)) {
|
|
7762
|
+
cut(i);
|
|
7763
|
+
return;
|
|
7764
|
+
}
|
|
7765
|
+
setTime(editTimeOf(s.clips, s.times, i, v.currentTime));
|
|
7766
|
+
setLoading(s.playing && (s.pending[s.front] !== null || v.readyState < 3));
|
|
7767
|
+
}, [cut]);
|
|
7768
|
+
React.useEffect(() => {
|
|
7769
|
+
if (!playing) return;
|
|
7770
|
+
const s = live.current;
|
|
7771
|
+
let stopped = false;
|
|
7772
|
+
let timer;
|
|
7773
|
+
let watching = null;
|
|
7774
|
+
let lastMedia = null;
|
|
7775
|
+
let frameLength = fps ? 1 / fps : 0;
|
|
7776
|
+
const watch = () => {
|
|
7777
|
+
const v = el(s.front);
|
|
7778
|
+
if (stopped || !v || typeof v.requestVideoFrameCallback !== "function") return;
|
|
7779
|
+
s.frames = true;
|
|
7780
|
+
watching = {
|
|
7781
|
+
v,
|
|
7782
|
+
id: v.requestVideoFrameCallback((now, meta) => {
|
|
7783
|
+
if (stopped) return;
|
|
7784
|
+
if (v !== el(s.front)) return;
|
|
7785
|
+
if (!fps && lastMedia !== null && meta.mediaTime > lastMedia) frameLength = meta.mediaTime - lastMedia;
|
|
7786
|
+
lastMedia = meta.mediaTime;
|
|
7787
|
+
const i = s.index;
|
|
7788
|
+
const c = s.clips[i];
|
|
7789
|
+
if (c && frameLength > 0 && meta.mediaTime + frameLength >= c.end - 1e-6) {
|
|
7790
|
+
const wait = (meta.expectedDisplayTime ?? now) + frameLength * 1e3 - s.refresh * 500 - performance.now();
|
|
7791
|
+
clearTimeout(timer);
|
|
7792
|
+
timer = setTimeout(() => cut(i), Math.max(0, wait));
|
|
7793
|
+
}
|
|
7794
|
+
watch();
|
|
7795
|
+
})
|
|
7796
|
+
};
|
|
7797
|
+
};
|
|
7798
|
+
watch();
|
|
7799
|
+
return () => {
|
|
7800
|
+
stopped = true;
|
|
7801
|
+
clearTimeout(timer);
|
|
7802
|
+
if (watching) watching.v.cancelVideoFrameCallback(watching.id);
|
|
7803
|
+
};
|
|
7804
|
+
}, [
|
|
7805
|
+
playing,
|
|
7806
|
+
fps,
|
|
7807
|
+
cut,
|
|
7808
|
+
front
|
|
7809
|
+
]);
|
|
7810
|
+
React.useEffect(() => {
|
|
7811
|
+
if (!playing) return;
|
|
7812
|
+
let last = null;
|
|
7813
|
+
let id = requestAnimationFrame(function loop(now) {
|
|
7814
|
+
if (last !== null) live.current.refresh = .8 * live.current.refresh + .2 * Math.min(.05, (now - last) / 1e3);
|
|
7815
|
+
last = now;
|
|
7816
|
+
tick();
|
|
7817
|
+
id = requestAnimationFrame(loop);
|
|
7818
|
+
});
|
|
7819
|
+
return () => cancelAnimationFrame(id);
|
|
7820
|
+
}, [playing, tick]);
|
|
7821
|
+
React.useEffect(() => {
|
|
7822
|
+
const unbind = [];
|
|
7823
|
+
refs.forEach((ref, slot) => {
|
|
7824
|
+
const v = ref.current;
|
|
7825
|
+
if (!v) return;
|
|
7826
|
+
const on = (e) => {
|
|
7827
|
+
const s = live.current;
|
|
7828
|
+
if (e.type === "loadedmetadata" && s.pending[slot] !== null) {
|
|
7829
|
+
v.currentTime = s.pending[slot];
|
|
7830
|
+
s.pending[slot] = null;
|
|
7831
|
+
if (slot === s.front && s.playing) playFront();
|
|
7832
|
+
}
|
|
7833
|
+
if (e.type === "error" && v.error && v.error.code !== 1 && slot === s.front) {
|
|
7834
|
+
setError({
|
|
7835
|
+
kind: "load",
|
|
7836
|
+
message: LOAD_MESSAGES[v.error.code] ?? "It could not be played."
|
|
7837
|
+
});
|
|
7838
|
+
s.playing = false;
|
|
7839
|
+
setPlaying(false);
|
|
7840
|
+
}
|
|
7841
|
+
if (e.type === "pause" && slot === s.front && s.playing && !s.quiet[slot] && !v.ended) {
|
|
7842
|
+
const c = s.clips[s.index];
|
|
7843
|
+
if (c && v.currentTime < c.end - s.lead) {
|
|
7844
|
+
s.playing = false;
|
|
7845
|
+
setPlaying(false);
|
|
7846
|
+
}
|
|
7847
|
+
}
|
|
7848
|
+
if (slot === s.front) tick();
|
|
7849
|
+
};
|
|
7850
|
+
const types = [
|
|
7851
|
+
"loadedmetadata",
|
|
7852
|
+
"timeupdate",
|
|
7853
|
+
"waiting",
|
|
7854
|
+
"playing",
|
|
7855
|
+
"canplay",
|
|
7856
|
+
"seeked",
|
|
7857
|
+
"error",
|
|
7858
|
+
"pause",
|
|
7859
|
+
"ended"
|
|
7860
|
+
];
|
|
7861
|
+
for (const t of types) v.addEventListener(t, on);
|
|
7862
|
+
unbind.push(() => types.forEach((t) => v.removeEventListener(t, on)));
|
|
7863
|
+
});
|
|
7864
|
+
return () => unbind.forEach((u) => u());
|
|
7865
|
+
}, [
|
|
7866
|
+
refs,
|
|
7867
|
+
tick,
|
|
7868
|
+
playFront
|
|
7869
|
+
]);
|
|
7870
|
+
const signature = clips.map((c) => `${c.id}|${c.src}|${c.start}|${c.end}`).join(";");
|
|
7871
|
+
const previous = React.useRef([]);
|
|
7872
|
+
React.useEffect(() => {
|
|
7873
|
+
const s = live.current;
|
|
7874
|
+
const was = s.index >= 0 ? previous.current[s.index] : void 0;
|
|
7875
|
+
const source = was ? el(s.front)?.currentTime ?? was.start : 0;
|
|
7876
|
+
previous.current = s.clips;
|
|
7877
|
+
s.holds = [null, null];
|
|
7878
|
+
s.pending = [null, null];
|
|
7879
|
+
if (s.clips.length === 0) {
|
|
7880
|
+
s.index = -1;
|
|
7881
|
+
s.playing = false;
|
|
7882
|
+
refs.forEach((r, slot) => {
|
|
7883
|
+
const v = r.current;
|
|
7884
|
+
if (!v) return;
|
|
7885
|
+
v.pause();
|
|
7886
|
+
if (v.getAttribute("src")) {
|
|
7887
|
+
s.quiet[slot] = true;
|
|
7888
|
+
v.removeAttribute("src");
|
|
7889
|
+
v.load();
|
|
7890
|
+
s.quiet[slot] = false;
|
|
7891
|
+
}
|
|
7892
|
+
});
|
|
7893
|
+
setIndex(-1);
|
|
7894
|
+
setPlaying(false);
|
|
7895
|
+
setTime(0);
|
|
7896
|
+
return;
|
|
7897
|
+
}
|
|
7898
|
+
const same = was ? s.clips.findIndex((c) => c.id === was.id && source >= c.start && source < c.end) : -1;
|
|
7899
|
+
const found = same >= 0 ? {
|
|
7900
|
+
index: same,
|
|
7901
|
+
source
|
|
7902
|
+
} : locateInEdit(s.clips, s.times, Math.min(timeRef.current, s.times.duration));
|
|
7903
|
+
s.busy = true;
|
|
7904
|
+
try {
|
|
7905
|
+
setIdx(found.index);
|
|
7906
|
+
hold(s.front, found.index, found.source);
|
|
7907
|
+
setTime(editTimeOf(s.clips, s.times, found.index, found.source));
|
|
7908
|
+
prepareBehind(found.index);
|
|
7909
|
+
if (s.playing) playFront();
|
|
7910
|
+
} finally {
|
|
7911
|
+
s.busy = false;
|
|
7912
|
+
}
|
|
7913
|
+
}, [signature]);
|
|
7914
|
+
const timeRef = React.useRef(time);
|
|
7915
|
+
timeRef.current = time;
|
|
7916
|
+
React.useEffect(() => () => {
|
|
7917
|
+
refs.forEach((r) => r.current?.pause());
|
|
7918
|
+
}, [refs]);
|
|
7919
|
+
const unlockBehind = () => {
|
|
7920
|
+
const s = live.current;
|
|
7921
|
+
const slot = 1 - s.front;
|
|
7922
|
+
const v = el(slot);
|
|
7923
|
+
if (!v || s.unlocked[slot] || !v.getAttribute("src")) return;
|
|
7924
|
+
s.unlocked[slot] = true;
|
|
7925
|
+
const at = s.pending[slot] ?? v.currentTime;
|
|
7926
|
+
const held = s.holds[slot];
|
|
7927
|
+
v.muted = true;
|
|
7928
|
+
s.quiet[slot] = true;
|
|
7929
|
+
const p = v.play();
|
|
7930
|
+
const done = () => {
|
|
7931
|
+
s.quiet[slot] = false;
|
|
7932
|
+
if (live.current.front === slot) return;
|
|
7933
|
+
v.pause();
|
|
7934
|
+
muteFor(v, s.volume);
|
|
7935
|
+
if (s.holds[slot] !== held || s.pending[slot] !== null) return;
|
|
7936
|
+
if (Math.abs(v.currentTime - at) > 1e-6) v.currentTime = at;
|
|
7937
|
+
};
|
|
7938
|
+
if (p && typeof p.then === "function") p.then(done, done);
|
|
7939
|
+
else done();
|
|
7940
|
+
};
|
|
7941
|
+
const play = React.useCallback(() => {
|
|
7942
|
+
const s = live.current;
|
|
7943
|
+
if (s.clips.length === 0) return;
|
|
7944
|
+
setError(null);
|
|
7945
|
+
if (timeRef.current >= s.times.duration - 1e-6) {
|
|
7946
|
+
if (el(s.front)) {
|
|
7947
|
+
hold(s.front, 0);
|
|
7948
|
+
setIdx(0);
|
|
7949
|
+
setTime(0);
|
|
7950
|
+
prepareBehind(0);
|
|
7951
|
+
}
|
|
7952
|
+
}
|
|
7953
|
+
s.playing = true;
|
|
7954
|
+
setPlaying(true);
|
|
7955
|
+
s.unlocked[s.front] = true;
|
|
7956
|
+
playFront();
|
|
7957
|
+
unlockBehind();
|
|
7958
|
+
}, [
|
|
7959
|
+
hold,
|
|
7960
|
+
playFront,
|
|
7961
|
+
prepareBehind,
|
|
7962
|
+
setIdx
|
|
7963
|
+
]);
|
|
7964
|
+
const pause = React.useCallback(() => {
|
|
7965
|
+
live.current.playing = false;
|
|
7966
|
+
setPlaying(false);
|
|
7967
|
+
setLoading(false);
|
|
7968
|
+
el(live.current.front)?.pause();
|
|
7969
|
+
}, []);
|
|
7970
|
+
const seek = React.useCallback((to) => {
|
|
7971
|
+
const s = live.current;
|
|
7972
|
+
const found = locateInEdit(s.clips, s.times, Math.min(Math.max(to, 0), s.times.duration));
|
|
7973
|
+
if (!found) return;
|
|
7974
|
+
const { index: j, source } = found;
|
|
7975
|
+
const behind = 1 - s.front;
|
|
7976
|
+
const src = s.clips[j].src;
|
|
7977
|
+
const holdsSrc = (slot) => el(slot)?.getAttribute("src") === src;
|
|
7978
|
+
s.busy = true;
|
|
7979
|
+
try {
|
|
7980
|
+
setIdx(j);
|
|
7981
|
+
if (!holdsSrc(s.front) && (s.holds[behind] === j || holdsSrc(behind))) {
|
|
7982
|
+
hold(behind, j, source);
|
|
7983
|
+
bringForward(behind);
|
|
7984
|
+
} else hold(s.front, j, source);
|
|
7985
|
+
setTime(editTimeOf(s.clips, s.times, j, source));
|
|
7986
|
+
prepareBehind(j);
|
|
7987
|
+
if (s.playing) playFront();
|
|
7988
|
+
} finally {
|
|
7989
|
+
s.busy = false;
|
|
7990
|
+
}
|
|
7991
|
+
}, [
|
|
7992
|
+
bringForward,
|
|
7993
|
+
hold,
|
|
7994
|
+
playFront,
|
|
7995
|
+
prepareBehind,
|
|
7996
|
+
setIdx
|
|
7997
|
+
]);
|
|
7998
|
+
const step = React.useCallback((count) => {
|
|
7999
|
+
if (!fps) return;
|
|
8000
|
+
pause();
|
|
8001
|
+
seek(timeRef.current + count / fps);
|
|
8002
|
+
}, [
|
|
8003
|
+
fps,
|
|
8004
|
+
pause,
|
|
8005
|
+
seek
|
|
8006
|
+
]);
|
|
8007
|
+
const setVolume = React.useCallback((v) => {
|
|
8008
|
+
const s = live.current;
|
|
8009
|
+
s.volume = v;
|
|
8010
|
+
setVolumeState(v);
|
|
8011
|
+
refs.forEach((r, slot) => {
|
|
8012
|
+
const e = r.current;
|
|
8013
|
+
if (!e) return;
|
|
8014
|
+
e.volume = Math.max(0, Math.min(1, v / 100));
|
|
8015
|
+
if (!s.quiet[slot]) muteFor(e, v);
|
|
8016
|
+
});
|
|
8017
|
+
}, [refs]);
|
|
8018
|
+
const retry = React.useCallback(() => {
|
|
8019
|
+
const s = live.current;
|
|
8020
|
+
setError(null);
|
|
8021
|
+
for (const slot of [0, 1]) {
|
|
8022
|
+
const v = el(slot);
|
|
8023
|
+
if (v) v.removeAttribute("src");
|
|
8024
|
+
}
|
|
8025
|
+
s.holds = [null, null];
|
|
8026
|
+
seek(timeRef.current);
|
|
8027
|
+
}, [seek]);
|
|
8028
|
+
const owner = useKeyOwner(keys, playing);
|
|
8029
|
+
const regionProps = React.useMemo(() => ({
|
|
8030
|
+
onFocusCapture: owner.claim,
|
|
8031
|
+
onPointerDownCapture: owner.claim
|
|
8032
|
+
}), [owner.claim]);
|
|
8033
|
+
return {
|
|
8034
|
+
slots: [{
|
|
8035
|
+
ref: a,
|
|
8036
|
+
front: front === 0
|
|
8037
|
+
}, {
|
|
8038
|
+
ref: b,
|
|
8039
|
+
front: front === 1
|
|
8040
|
+
}],
|
|
8041
|
+
time,
|
|
8042
|
+
duration: times.duration,
|
|
8043
|
+
index,
|
|
8044
|
+
starts: times.at,
|
|
8045
|
+
playing,
|
|
8046
|
+
ended: !playing && clips.length > 0 && time >= times.duration - 1e-6,
|
|
8047
|
+
loading,
|
|
8048
|
+
error,
|
|
8049
|
+
volume,
|
|
8050
|
+
play,
|
|
8051
|
+
pause,
|
|
8052
|
+
toggle: () => live.current.playing ? pause() : play(),
|
|
8053
|
+
seek,
|
|
8054
|
+
step,
|
|
8055
|
+
setVolume,
|
|
8056
|
+
retry,
|
|
8057
|
+
ownsKeys: owner.owns,
|
|
8058
|
+
regionProps
|
|
8059
|
+
};
|
|
8060
|
+
}
|
|
8061
|
+
/** Plays an edit list (stretches of files) as one timeline with no gap at the cuts, with a seek bar marked at every clip, frame steps and the page's keys. */
|
|
8062
|
+
function EditListPlayer({ clips, label, empty, aspect = 16 / 9, fps, onClipChange, shortcuts = true, playerRef, className }) {
|
|
8063
|
+
const edit = useEditList(clips, {
|
|
8064
|
+
fps,
|
|
8065
|
+
onClipChange,
|
|
8066
|
+
keys: shortcuts
|
|
8067
|
+
});
|
|
8068
|
+
React.useImperativeHandle(playerRef, () => edit, [edit]);
|
|
8069
|
+
const marks = React.useMemo(() => clips.map((c, i) => ({
|
|
8070
|
+
time: edit.starts[i],
|
|
8071
|
+
label: c.label ?? `Clip ${i + 1}`,
|
|
8072
|
+
kind: "scene"
|
|
8073
|
+
})), [clips, edit.starts]);
|
|
8074
|
+
const toClip = (dir) => {
|
|
8075
|
+
const i = edit.index;
|
|
8076
|
+
if (dir < 0) {
|
|
8077
|
+
const into = edit.time - edit.starts[i];
|
|
8078
|
+
edit.seek(edit.starts[into > 1 || i === 0 ? i : i - 1]);
|
|
8079
|
+
} else if (i + 1 < clips.length) edit.seek(edit.starts[i + 1]);
|
|
8080
|
+
};
|
|
8081
|
+
const frame = fps ? 1 / fps : void 0;
|
|
8082
|
+
const keyList = [
|
|
8083
|
+
{
|
|
8084
|
+
keys: [" ", "k"],
|
|
8085
|
+
label: "Play or pause",
|
|
8086
|
+
run: edit.toggle
|
|
8087
|
+
},
|
|
8088
|
+
{
|
|
8089
|
+
keys: ["j"],
|
|
8090
|
+
label: "Back 10 seconds",
|
|
8091
|
+
run: () => edit.seek(edit.time - 10)
|
|
8092
|
+
},
|
|
8093
|
+
{
|
|
8094
|
+
keys: ["l"],
|
|
8095
|
+
label: "Forward 10 seconds",
|
|
8096
|
+
run: () => edit.seek(edit.time + 10)
|
|
8097
|
+
},
|
|
8098
|
+
{
|
|
8099
|
+
keys: ["p"],
|
|
8100
|
+
label: "Previous clip",
|
|
8101
|
+
run: () => toClip(-1)
|
|
8102
|
+
},
|
|
8103
|
+
{
|
|
8104
|
+
keys: ["n"],
|
|
8105
|
+
label: "Next clip",
|
|
8106
|
+
run: () => toClip(1)
|
|
8107
|
+
},
|
|
8108
|
+
...frame ? [{
|
|
8109
|
+
keys: [","],
|
|
8110
|
+
label: "Back one frame",
|
|
8111
|
+
run: () => edit.step(-1)
|
|
8112
|
+
}, {
|
|
8113
|
+
keys: ["."],
|
|
8114
|
+
label: "Forward one frame",
|
|
8115
|
+
run: () => edit.step(1)
|
|
8116
|
+
}] : [],
|
|
8117
|
+
{
|
|
8118
|
+
keys: ["Home"],
|
|
8119
|
+
label: "Go to start",
|
|
8120
|
+
run: () => edit.seek(0)
|
|
8121
|
+
},
|
|
8122
|
+
{
|
|
8123
|
+
keys: ["End"],
|
|
8124
|
+
label: "Go to end",
|
|
8125
|
+
run: () => edit.seek(edit.duration)
|
|
8126
|
+
}
|
|
8127
|
+
];
|
|
8128
|
+
useHotkeys(keyList, { enabled: shortcuts && edit.ownsKeys && clips.length > 0 });
|
|
8129
|
+
const current = edit.index >= 0 ? clips[edit.index] : void 0;
|
|
8130
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8131
|
+
role: "group",
|
|
8132
|
+
"aria-label": label,
|
|
8133
|
+
...edit.regionProps,
|
|
8134
|
+
className: cn("grid min-w-0 gap-2", className),
|
|
8135
|
+
children: [
|
|
8136
|
+
/* @__PURE__ */ jsxs("div", {
|
|
8137
|
+
className: "relative w-full overflow-hidden rounded-surface bg-surface-sunken",
|
|
8138
|
+
style: { aspectRatio: aspect },
|
|
8139
|
+
children: [
|
|
8140
|
+
edit.slots.map((slot, i) => /* @__PURE__ */ jsx("video", {
|
|
8141
|
+
ref: slot.ref,
|
|
8142
|
+
playsInline: true,
|
|
8143
|
+
preload: "auto",
|
|
8144
|
+
"aria-hidden": !slot.front,
|
|
8145
|
+
"data-front": slot.front ? "" : void 0,
|
|
8146
|
+
onClick: slot.front && clips.length ? edit.toggle : void 0,
|
|
8147
|
+
className: "absolute inset-0 size-full object-contain"
|
|
8148
|
+
}, i)),
|
|
8149
|
+
clips.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
8150
|
+
className: "absolute inset-0 grid place-items-center p-4 text-center type-body-sm text-muted-foreground",
|
|
8151
|
+
children: empty
|
|
8152
|
+
}),
|
|
8153
|
+
edit.loading && !edit.error && /* @__PURE__ */ jsx("div", {
|
|
8154
|
+
className: "pointer-events-none absolute top-3 left-3",
|
|
8155
|
+
children: /* @__PURE__ */ jsx(Status, {
|
|
8156
|
+
tone: "info",
|
|
8157
|
+
icon: LoaderCircle,
|
|
8158
|
+
children: "Loading"
|
|
8159
|
+
})
|
|
8160
|
+
})
|
|
8161
|
+
]
|
|
8162
|
+
}),
|
|
8163
|
+
edit.error && /* @__PURE__ */ jsx(Alert, {
|
|
8164
|
+
tone: edit.error.kind === "load" ? "danger" : "info",
|
|
8165
|
+
announce: true,
|
|
8166
|
+
action: edit.error.kind === "load" ? /* @__PURE__ */ jsx(Button, {
|
|
8167
|
+
size: "sm",
|
|
8168
|
+
onPress: edit.retry,
|
|
8169
|
+
children: "Try again"
|
|
8170
|
+
}) : void 0,
|
|
8171
|
+
children: edit.error.message
|
|
8172
|
+
}),
|
|
8173
|
+
/* @__PURE__ */ jsxs("div", {
|
|
8174
|
+
className: "flex min-w-0 items-center gap-3",
|
|
8175
|
+
children: [/* @__PURE__ */ jsx(SeekBar, {
|
|
8176
|
+
time: edit.time,
|
|
8177
|
+
duration: clips.length ? edit.duration : null,
|
|
8178
|
+
onSeek: edit.seek,
|
|
8179
|
+
marks,
|
|
8180
|
+
onMarkPress: (m) => edit.seek(m.time),
|
|
8181
|
+
step: 10,
|
|
8182
|
+
bigStep: 60,
|
|
8183
|
+
label: `Seek in ${label}`,
|
|
8184
|
+
disabled: clips.length === 0
|
|
8185
|
+
}), /* @__PURE__ */ jsx(TimeReadout, {
|
|
8186
|
+
time: edit.time,
|
|
8187
|
+
duration: clips.length ? edit.duration : null
|
|
8188
|
+
})]
|
|
8189
|
+
}),
|
|
8190
|
+
/* @__PURE__ */ jsxs("div", {
|
|
8191
|
+
className: "flex flex-wrap items-center gap-x-4 gap-y-2",
|
|
8192
|
+
children: [
|
|
8193
|
+
/* @__PURE__ */ jsxs(Toolbar, {
|
|
8194
|
+
label: "Playback",
|
|
8195
|
+
className: "gap-2",
|
|
8196
|
+
children: [
|
|
8197
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
8198
|
+
icon: SkipBack,
|
|
8199
|
+
label: "Previous clip",
|
|
8200
|
+
hint: "P",
|
|
8201
|
+
disabled: clips.length === 0,
|
|
8202
|
+
onPress: () => toClip(-1)
|
|
8203
|
+
}),
|
|
8204
|
+
frame && /* @__PURE__ */ jsx(IconButton, {
|
|
8205
|
+
icon: StepBack,
|
|
8206
|
+
label: "Back one frame",
|
|
8207
|
+
hint: ",",
|
|
8208
|
+
disabled: clips.length === 0,
|
|
8209
|
+
onPress: () => edit.step(-1)
|
|
8210
|
+
}),
|
|
8211
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
8212
|
+
icon: edit.playing ? Pause : Play,
|
|
8213
|
+
label: edit.playing ? "Pause" : "Play",
|
|
8214
|
+
hint: "Space",
|
|
8215
|
+
variant: "outline",
|
|
8216
|
+
disabled: clips.length === 0,
|
|
8217
|
+
onPress: edit.toggle
|
|
8218
|
+
}),
|
|
8219
|
+
frame && /* @__PURE__ */ jsx(IconButton, {
|
|
8220
|
+
icon: StepForward,
|
|
8221
|
+
label: "Forward one frame",
|
|
8222
|
+
hint: ".",
|
|
8223
|
+
disabled: clips.length === 0,
|
|
8224
|
+
onPress: () => edit.step(1)
|
|
8225
|
+
}),
|
|
8226
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
8227
|
+
icon: SkipForward,
|
|
8228
|
+
label: "Next clip",
|
|
8229
|
+
hint: "N",
|
|
8230
|
+
disabled: clips.length === 0 || edit.index >= clips.length - 1,
|
|
8231
|
+
onPress: () => toClip(1)
|
|
8232
|
+
})
|
|
8233
|
+
]
|
|
8234
|
+
}),
|
|
8235
|
+
current && /* @__PURE__ */ jsxs("span", {
|
|
8236
|
+
className: "min-w-0 truncate type-body-sm text-muted-foreground",
|
|
8237
|
+
children: [
|
|
8238
|
+
"Clip ",
|
|
8239
|
+
edit.index + 1,
|
|
8240
|
+
" of ",
|
|
8241
|
+
clips.length,
|
|
8242
|
+
current.label ? `: ${current.label}` : ""
|
|
8243
|
+
]
|
|
8244
|
+
}),
|
|
8245
|
+
/* @__PURE__ */ jsx("span", {
|
|
8246
|
+
className: "ml-auto flex items-center gap-x-3",
|
|
8247
|
+
children: /* @__PURE__ */ jsx(VolumeControl, {
|
|
8248
|
+
volume: edit.volume,
|
|
8249
|
+
onVolumeChange: edit.setVolume
|
|
8250
|
+
})
|
|
8251
|
+
})
|
|
8252
|
+
]
|
|
8253
|
+
})
|
|
8254
|
+
]
|
|
8255
|
+
});
|
|
8256
|
+
}
|
|
8257
|
+
|
|
7490
8258
|
// src/lib/timeline.ts
|
|
7491
8259
|
/** 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. */
|
|
7492
|
-
|
|
8260
|
+
const STEPS = [
|
|
7493
8261
|
.01,
|
|
7494
8262
|
.02,
|
|
7495
8263
|
.05,
|
|
@@ -7550,11 +8318,12 @@ function snapTo(time, points, pxPerUnit, thresholdPx = 8) {
|
|
|
7550
8318
|
};
|
|
7551
8319
|
}
|
|
7552
8320
|
/** Round away float noise from adding steps (0.1 + 0.2). */
|
|
7553
|
-
|
|
8321
|
+
const tidy = (n) => Math.round(n * 1e6) / 1e6;
|
|
8322
|
+
|
|
7554
8323
|
// src/components/timeline.tsx
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
8324
|
+
const EDGE_PX = 8;
|
|
8325
|
+
const DRAG_THRESHOLD = 3;
|
|
8326
|
+
const defaultFormat = (t) => tickLabel(t, 1);
|
|
7558
8327
|
/** Zoom state for a timeline: `zoomIn`, `zoomOut`, and `fit` to a viewport width. Pass `zoom` and `setZoom` as the timeline's `zoom` and `onZoomChange`. */
|
|
7559
8328
|
function useTimelineZoom({ initial = 20, min = .5, max = 400 } = {}) {
|
|
7560
8329
|
const [zoom, set] = React.useState(initial);
|
|
@@ -8190,7 +8959,8 @@ function Timeline({ label, lanes, items, from = 0, to, zoom, onZoomChange, posit
|
|
|
8190
8959
|
formatTime(info.next.start),
|
|
8191
8960
|
" to ",
|
|
8192
8961
|
formatTime(info.next.start + info.next.length),
|
|
8193
|
-
",
|
|
8962
|
+
",",
|
|
8963
|
+
" ",
|
|
8194
8964
|
laneLabel(info.next.lane)
|
|
8195
8965
|
] })
|
|
8196
8966
|
});
|
|
@@ -8240,10 +9010,11 @@ function LaneRow({ label, register, types, onHover, onLeave, onDropItems, childr
|
|
|
8240
9010
|
children
|
|
8241
9011
|
});
|
|
8242
9012
|
}
|
|
9013
|
+
|
|
8243
9014
|
// src/components/sortable-list.tsx
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
9015
|
+
const KIND = "strata-kind/";
|
|
9016
|
+
const ID = "strata-item/id";
|
|
9017
|
+
const LIST = "strata-list/";
|
|
8247
9018
|
/** 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. */
|
|
8248
9019
|
function SortableList({ label, items, getKey, getLabel, children, renderActions, empty, onReorder, onInsert, getKind = () => "item", accepts = [], refuses = {}, selectionMode = "none", selectedKeys, onSelectionChange, className }) {
|
|
8249
9020
|
const listId = React.useId();
|
|
@@ -8359,6 +9130,7 @@ function SortableList({ label, items, getKey, getLabel, children, renderActions,
|
|
|
8359
9130
|
})]
|
|
8360
9131
|
});
|
|
8361
9132
|
}
|
|
9133
|
+
|
|
8362
9134
|
// src/components/drag-source.tsx
|
|
8363
9135
|
/**
|
|
8364
9136
|
* The type every `DragSource` drag carries beside the app's own, so a drop target that takes only files (`FileDropZone`) can tell
|
|
@@ -8366,7 +9138,7 @@ function SortableList({ label, items, getKey, getLabel, children, renderActions,
|
|
|
8366
9138
|
* 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
|
|
8367
9139
|
* our own is the one that can be recognised for certain.
|
|
8368
9140
|
*/
|
|
8369
|
-
|
|
9141
|
+
const STRATA_DRAG_TYPE = "application/x-strata-drag";
|
|
8370
9142
|
/** 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. */
|
|
8371
9143
|
function DragSource({ label, items, onDragStart, onDragEnd, disabled, children, className }) {
|
|
8372
9144
|
const { dragProps, dragButtonProps, isDragging } = useDrag({
|
|
@@ -8398,6 +9170,7 @@ function DragSource({ label, items, onDragStart, onDragEnd, disabled, children,
|
|
|
8398
9170
|
})]
|
|
8399
9171
|
});
|
|
8400
9172
|
}
|
|
9173
|
+
|
|
8401
9174
|
// src/components/file-intake.tsx
|
|
8402
9175
|
/** The picker as a button. `children` is its visible name ("Add files"); `accept` narrows what the dialog shows. */
|
|
8403
9176
|
function FileButton({ accept, multiple = false, onFiles, icon: Icon, children, ...props }) {
|
|
@@ -8414,7 +9187,7 @@ function FileButton({ accept, multiple = false, onFiles, icon: Icon, children, .
|
|
|
8414
9187
|
})
|
|
8415
9188
|
});
|
|
8416
9189
|
}
|
|
8417
|
-
|
|
9190
|
+
const NEVER_CARRIED = "application/x-strata-never";
|
|
8418
9191
|
/** Whether a drag is the app's own, not files: it carries one of `refuse`, and the browser has not left its types unknown. */
|
|
8419
9192
|
function refusesDrag(types, refuse) {
|
|
8420
9193
|
return !types.has(NEVER_CARRIED) && refuse.some((type) => types.has(type));
|
|
@@ -8445,7 +9218,7 @@ function FileDropZone({ onFiles, acceptLabel, title, disabled, refuseTypes, chil
|
|
|
8445
9218
|
] })
|
|
8446
9219
|
});
|
|
8447
9220
|
}
|
|
8448
|
-
|
|
9221
|
+
const carriesFiles = (e, refuse) => {
|
|
8449
9222
|
const types = Array.from(e.dataTransfer?.types ?? []);
|
|
8450
9223
|
return types.includes("Files") && !refusesDrag({ has: (type) => types.includes(type) }, ["application/x-strata-drag", ...refuse]);
|
|
8451
9224
|
};
|
|
@@ -8521,7 +9294,7 @@ function FileDropOverlay({ onFiles, acceptLabel, disabled, refuseTypes }) {
|
|
|
8521
9294
|
})
|
|
8522
9295
|
});
|
|
8523
9296
|
}
|
|
8524
|
-
|
|
9297
|
+
const rowStatus = {
|
|
8525
9298
|
processing: {
|
|
8526
9299
|
tone: "info",
|
|
8527
9300
|
word: "Adding…",
|
|
@@ -8637,6 +9410,7 @@ function MissingFile({ name, accept, onRelink, thumbnail, className }) {
|
|
|
8637
9410
|
})]
|
|
8638
9411
|
});
|
|
8639
9412
|
}
|
|
9413
|
+
|
|
8640
9414
|
// src/lib/object-url.ts
|
|
8641
9415
|
/** 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. */
|
|
8642
9416
|
function useObjectUrl(data, type) {
|
|
@@ -8656,8 +9430,9 @@ function useObjectUrl(data, type) {
|
|
|
8656
9430
|
}, [data, type]);
|
|
8657
9431
|
return url;
|
|
8658
9432
|
}
|
|
9433
|
+
|
|
8659
9434
|
// src/components/pixel-image.tsx
|
|
8660
|
-
|
|
9435
|
+
const sizeOf = (p) => p.image ? {
|
|
8661
9436
|
width: p.image.width,
|
|
8662
9437
|
height: p.image.height,
|
|
8663
9438
|
data: p.image.data
|
|
@@ -8741,25 +9516,26 @@ function rgbaToBlob(width, height, rgba) {
|
|
|
8741
9516
|
el.toBlob((blob) => blob ? resolve(blob) : reject(/* @__PURE__ */ new Error("The picture could not be saved.")), "image/png");
|
|
8742
9517
|
});
|
|
8743
9518
|
}
|
|
9519
|
+
|
|
8744
9520
|
// src/components/byte-view.tsx
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
9521
|
+
const PER_ROW = 16;
|
|
9522
|
+
const ROW_PX = 20;
|
|
9523
|
+
const OVERSCAN = 4;
|
|
9524
|
+
const MAX_PX = 8e6;
|
|
9525
|
+
const tints = {
|
|
8750
9526
|
neutral: "bg-muted",
|
|
8751
9527
|
info: "bg-info-subtle",
|
|
8752
9528
|
success: "bg-success-subtle",
|
|
8753
9529
|
warning: "bg-warning-subtle",
|
|
8754
9530
|
danger: "bg-danger-subtle"
|
|
8755
9531
|
};
|
|
8756
|
-
|
|
9532
|
+
const cellStyle = (k) => ({
|
|
8757
9533
|
width: "2ch",
|
|
8758
9534
|
marginLeft: k === 8 ? "1ch" : void 0
|
|
8759
9535
|
});
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
9536
|
+
const hex = (n, width = 2) => n.toString(16).padStart(width, "0");
|
|
9537
|
+
const tintOf = (h) => h ? tints[h.tone ?? "neutral"] : void 0;
|
|
9538
|
+
const printable = (b) => b >= 32 && b < 127 ? String.fromCharCode(b) : "·";
|
|
8763
9539
|
/** 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 }`. */
|
|
8764
9540
|
function ByteView({ bytes, label, offset = 0, highlight, defaultSelection, onSelectionChange, height = 320, className }) {
|
|
8765
9541
|
const total = bytes.length;
|
|
@@ -8987,8 +9763,9 @@ function ByteView({ bytes, label, offset = 0, highlight, defaultSelection, onSel
|
|
|
8987
9763
|
})]
|
|
8988
9764
|
});
|
|
8989
9765
|
}
|
|
9766
|
+
|
|
8990
9767
|
// src/components/console.tsx
|
|
8991
|
-
|
|
9768
|
+
const LEVEL_WORD = {
|
|
8992
9769
|
warning: {
|
|
8993
9770
|
word: "Warning",
|
|
8994
9771
|
tone: "warning"
|
|
@@ -8998,7 +9775,7 @@ var LEVEL_WORD = {
|
|
|
8998
9775
|
tone: "danger"
|
|
8999
9776
|
}
|
|
9000
9777
|
};
|
|
9001
|
-
|
|
9778
|
+
const lineKey = (line) => String(line.id);
|
|
9002
9779
|
function readHistory(key) {
|
|
9003
9780
|
if (!key) return [];
|
|
9004
9781
|
try {
|
|
@@ -9189,9 +9966,10 @@ function Console({ label, lines, onCommand, complete, historyKey, height = 320,
|
|
|
9189
9966
|
]
|
|
9190
9967
|
});
|
|
9191
9968
|
}
|
|
9969
|
+
|
|
9192
9970
|
// src/components/shortcut-editor.tsx
|
|
9193
|
-
|
|
9194
|
-
|
|
9971
|
+
const idOf = (s) => s.id ?? s.label;
|
|
9972
|
+
const MODIFIER_KEYS = /* @__PURE__ */ new Set([
|
|
9195
9973
|
"Shift",
|
|
9196
9974
|
"Control",
|
|
9197
9975
|
"Alt",
|
|
@@ -9443,6 +10221,7 @@ function ShortcutEditor({ rebinding, label = "Keyboard shortcuts", className })
|
|
|
9443
10221
|
})]
|
|
9444
10222
|
});
|
|
9445
10223
|
}
|
|
10224
|
+
|
|
9446
10225
|
// src/lib/file-intake.ts
|
|
9447
10226
|
/** Whether a file matches one entry of an `accept` list: extension, exact type or `family/*`, ignoring case. */
|
|
9448
10227
|
function matchesAccept(file, accept) {
|
|
@@ -9455,8 +10234,8 @@ function matchesAccept(file, accept) {
|
|
|
9455
10234
|
return type === a;
|
|
9456
10235
|
});
|
|
9457
10236
|
}
|
|
9458
|
-
|
|
9459
|
-
|
|
10237
|
+
const MB = 1048576;
|
|
10238
|
+
const sizeWords = (bytes) => bytes >= MB ? `${(bytes / MB).toFixed(bytes >= 100 * MB ? 0 : 1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} kB`;
|
|
9460
10239
|
/** 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. */
|
|
9461
10240
|
function useFileIntake(options) {
|
|
9462
10241
|
const [outcomes, setOutcomes] = React.useState([]);
|
|
@@ -9592,6 +10371,7 @@ function useFileIntake(options) {
|
|
|
9592
10371
|
pending
|
|
9593
10372
|
]);
|
|
9594
10373
|
}
|
|
10374
|
+
|
|
9595
10375
|
// src/components/inspector.tsx
|
|
9596
10376
|
function readRemembered(key) {
|
|
9597
10377
|
if (!key) return {};
|
|
@@ -9603,7 +10383,7 @@ function readRemembered(key) {
|
|
|
9603
10383
|
return {};
|
|
9604
10384
|
}
|
|
9605
10385
|
}
|
|
9606
|
-
|
|
10386
|
+
const InspectorContext = React.createContext(null);
|
|
9607
10387
|
/** 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. */
|
|
9608
10388
|
function Inspector({ title, kind, empty, selectionKey, storageKey, actions, summary, children, className }) {
|
|
9609
10389
|
const headingId = React.useId();
|
|
@@ -9771,11 +10551,14 @@ function PropertyList({ items, label, className }) {
|
|
|
9771
10551
|
})
|
|
9772
10552
|
});
|
|
9773
10553
|
}
|
|
10554
|
+
|
|
9774
10555
|
// src/lib/grouped-grid-layout.ts
|
|
9775
10556
|
/** Keys of group headings start with this, so a tile key that is a plain id can never be mistaken for one. */
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
10557
|
+
const GROUP_PREFIX = "group";
|
|
10558
|
+
const groupKey = (group) => `${GROUP_PREFIX}${group}`;
|
|
10559
|
+
const isGroupKey = (key) => typeof key === "string" && key.startsWith("group");
|
|
10560
|
+
/** The height of a group's heading row, in px. */
|
|
10561
|
+
const HEADER_HEIGHT = 40;
|
|
9779
10562
|
/**
|
|
9780
10563
|
* Rows of equal height, each picture at its own shape (Google Photos, Lightroom): fill a row with
|
|
9781
10564
|
* pictures at the target height `rowHeight` until it is full, then scale the row's height so it spans
|
|
@@ -9928,31 +10711,32 @@ var GroupedGridLayout = class extends GridLayout {
|
|
|
9928
10711
|
return [...visible.filter((l) => l.key !== current.key), stuck];
|
|
9929
10712
|
}
|
|
9930
10713
|
};
|
|
10714
|
+
|
|
9931
10715
|
// src/components/tile-grid.tsx
|
|
9932
|
-
|
|
10716
|
+
const minWidth = {
|
|
9933
10717
|
sm: 96,
|
|
9934
10718
|
md: 144,
|
|
9935
10719
|
lg: 192
|
|
9936
10720
|
};
|
|
9937
|
-
|
|
10721
|
+
const aspectClass = {
|
|
9938
10722
|
square: "aspect-square",
|
|
9939
10723
|
portrait: "aspect-3/4",
|
|
9940
10724
|
landscape: "aspect-4/3"
|
|
9941
10725
|
};
|
|
9942
|
-
|
|
10726
|
+
const aspectRatio = {
|
|
9943
10727
|
square: 1,
|
|
9944
10728
|
portrait: 4 / 3,
|
|
9945
10729
|
landscape: 3 / 4
|
|
9946
10730
|
};
|
|
9947
|
-
|
|
10731
|
+
const thumbnailAspect = {
|
|
9948
10732
|
square: 1,
|
|
9949
10733
|
portrait: 3 / 4,
|
|
9950
10734
|
landscape: 4 / 3
|
|
9951
10735
|
};
|
|
9952
|
-
|
|
9953
|
-
|
|
10736
|
+
const GAP = 12;
|
|
10737
|
+
const TILE_CHROME = 40;
|
|
9954
10738
|
/** A tile size as pixels: a named size's minimum width, or the number itself (a continuous size, issue #246). */
|
|
9955
|
-
|
|
10739
|
+
const tileWidth = (size) => typeof size === "number" ? size : minWidth[size];
|
|
9956
10740
|
/** `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. */
|
|
9957
10741
|
function tileLayoutOptions(tileSize, aspect) {
|
|
9958
10742
|
const w = tileWidth(tileSize);
|
|
@@ -10057,6 +10841,7 @@ function SelectableGridSkeleton({ count = 24, aspect = "square", tileSize = "md"
|
|
|
10057
10841
|
}, i))
|
|
10058
10842
|
});
|
|
10059
10843
|
}
|
|
10844
|
+
|
|
10060
10845
|
// src/components/selectable-grid.tsx
|
|
10061
10846
|
/** 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`. */
|
|
10062
10847
|
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 }) {
|
|
@@ -10498,8 +11283,11 @@ function TileBox({ label }) {
|
|
|
10498
11283
|
})
|
|
10499
11284
|
});
|
|
10500
11285
|
}
|
|
11286
|
+
|
|
10501
11287
|
// src/components/compare-parts.tsx
|
|
10502
|
-
|
|
11288
|
+
const VIEWPORT_HEIGHT = "max(16rem, calc(100svh - 14rem))";
|
|
11289
|
+
/** The least a frame is made, however little room is left: a pair this small can still be told apart. */
|
|
11290
|
+
const MIN_FIT = 120;
|
|
10503
11291
|
/** 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. */
|
|
10504
11292
|
function fitFrames({ space, chrome, rows, min = 120 }) {
|
|
10505
11293
|
return Math.max(min, Math.floor((space - chrome) / Math.max(1, rows)));
|
|
@@ -10684,7 +11472,7 @@ function Picture({ c, blind, missing, onNatural, imgRef, pixelated }) {
|
|
|
10684
11472
|
className: "absolute inset-0 size-full object-contain"
|
|
10685
11473
|
})] });
|
|
10686
11474
|
}
|
|
10687
|
-
|
|
11475
|
+
const frameSize = (frame) => {
|
|
10688
11476
|
const r = frame.current?.getBoundingClientRect();
|
|
10689
11477
|
return {
|
|
10690
11478
|
width: r?.width ?? 0,
|
|
@@ -10795,6 +11583,7 @@ function useWidth$1(ref) {
|
|
|
10795
11583
|
});
|
|
10796
11584
|
return width;
|
|
10797
11585
|
}
|
|
11586
|
+
|
|
10798
11587
|
// src/components/viewport.tsx
|
|
10799
11588
|
/** Zoom and pan held in React state, to give to every `ViewportFrame` that should move together. */
|
|
10800
11589
|
function useViewport(initial = FIT) {
|
|
@@ -10804,15 +11593,15 @@ function useViewport(initial = FIT) {
|
|
|
10804
11593
|
setViewport
|
|
10805
11594
|
};
|
|
10806
11595
|
}
|
|
10807
|
-
|
|
11596
|
+
const PAN_STEP = 48;
|
|
10808
11597
|
/** A pointer that moves further than this between down and up is a pan, not a click. */
|
|
10809
|
-
|
|
11598
|
+
const CLICK_SLOP = 4;
|
|
10810
11599
|
/** A press held longer than this is not a click. */
|
|
10811
|
-
|
|
11600
|
+
const CLICK_MAX_MS = 500;
|
|
10812
11601
|
/** A click counts only once this long has passed with no second press: a double click zooms instead. */
|
|
10813
|
-
|
|
11602
|
+
const DOUBLE_CLICK_MS = 300;
|
|
10814
11603
|
/** A clipped frame whose children zoom and pan together; the viewport is the caller's, so frames can share one. */
|
|
10815
|
-
|
|
11604
|
+
const ViewportFrame = React.forwardRef(function ViewportFrame({ label, aspect, viewport, setViewport, children, cover, overlay, maxHeight, onBox, outline, pick, className }, forwardedRef) {
|
|
10816
11605
|
const ref = React.useRef(null);
|
|
10817
11606
|
React.useImperativeHandle(forwardedRef, () => ref.current);
|
|
10818
11607
|
const latest = React.useRef(viewport);
|
|
@@ -11072,6 +11861,7 @@ var ViewportFrame = React.forwardRef(function ViewportFrame({ label, aspect, vie
|
|
|
11072
11861
|
]
|
|
11073
11862
|
});
|
|
11074
11863
|
});
|
|
11864
|
+
|
|
11075
11865
|
// src/components/lightbox.tsx
|
|
11076
11866
|
/** 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. */
|
|
11077
11867
|
function useLightboxUrl(items, { param = "view" } = {}) {
|
|
@@ -11093,7 +11883,7 @@ function useLightboxUrl(items, { param = "view" } = {}) {
|
|
|
11093
11883
|
show: (to) => set(to, false)
|
|
11094
11884
|
};
|
|
11095
11885
|
}
|
|
11096
|
-
|
|
11886
|
+
const NARROW = "(max-width: 719px)";
|
|
11097
11887
|
function useNarrow() {
|
|
11098
11888
|
const [narrow, setNarrow] = React.useState(() => typeof matchMedia === "function" && matchMedia(NARROW).matches);
|
|
11099
11889
|
React.useEffect(() => {
|
|
@@ -11135,7 +11925,7 @@ function Lightbox({ title, items, index, onIndexChange, open, onOpenChange, miss
|
|
|
11135
11925
|
items
|
|
11136
11926
|
]);
|
|
11137
11927
|
const go = (to) => onIndexChange(Math.min(Math.max(to, 0), last));
|
|
11138
|
-
const keys = React.useRef((
|
|
11928
|
+
const keys = React.useRef((() => {}));
|
|
11139
11929
|
keys.current = (e) => {
|
|
11140
11930
|
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
11141
11931
|
if (e.target.closest?.("[role=\"toolbar\"], [role=\"listbox\"], input, textarea, select, [contenteditable=\"true\"]")) return;
|
|
@@ -11293,8 +12083,9 @@ function ThumbnailStrip({ items, at, onPick, badge, label = "Pictures in this se
|
|
|
11293
12083
|
}, it.id))
|
|
11294
12084
|
});
|
|
11295
12085
|
}
|
|
12086
|
+
|
|
11296
12087
|
// src/components/view-options.tsx
|
|
11297
|
-
|
|
12088
|
+
const collator = new Intl.Collator(void 0, {
|
|
11298
12089
|
numeric: true,
|
|
11299
12090
|
sensitivity: "base"
|
|
11300
12091
|
});
|
|
@@ -11320,7 +12111,7 @@ function sortRows(rows, value, descending = false) {
|
|
|
11320
12111
|
});
|
|
11321
12112
|
return keyed.map((k) => k.row);
|
|
11322
12113
|
}
|
|
11323
|
-
|
|
12114
|
+
const storeKey = (id) => `strata-view:${id}`;
|
|
11324
12115
|
function readStore(id) {
|
|
11325
12116
|
try {
|
|
11326
12117
|
const raw = localStorage.getItem(storeKey(id));
|
|
@@ -11500,7 +12291,7 @@ function useUrlView(names) {
|
|
|
11500
12291
|
}, { replace: true })
|
|
11501
12292
|
};
|
|
11502
12293
|
}
|
|
11503
|
-
|
|
12294
|
+
const ASPECTS = {
|
|
11504
12295
|
square: "Square",
|
|
11505
12296
|
portrait: "Portrait",
|
|
11506
12297
|
landscape: "Landscape"
|
|
@@ -11622,13 +12413,14 @@ function ViewOptions({ view, shown, total, label = "View options", className })
|
|
|
11622
12413
|
]
|
|
11623
12414
|
});
|
|
11624
12415
|
}
|
|
12416
|
+
|
|
11625
12417
|
// src/components/choice-grid.tsx
|
|
11626
|
-
|
|
12418
|
+
const minSide = {
|
|
11627
12419
|
md: 120,
|
|
11628
12420
|
lg: 160
|
|
11629
12421
|
};
|
|
11630
|
-
|
|
11631
|
-
|
|
12422
|
+
const closed = (s) => s === "right" || s === "answer" || s === "picked";
|
|
12423
|
+
const columns = (size) => ({ gridTemplateColumns: `repeat(auto-fill, minmax(min(${minSide[size]}px, 100%), 1fr))` });
|
|
11632
12424
|
/** 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. */
|
|
11633
12425
|
function ChoiceGrid({ label, items, itemKey, itemLabel, renderPicture, state, marks, onChoose, size = "md", className }) {
|
|
11634
12426
|
const byKey = new Map(items.map((item) => [itemKey(item), item]));
|
|
@@ -11677,11 +12469,12 @@ function ChoiceGridSkeleton({ count = 4, size = "md", className }) {
|
|
|
11677
12469
|
children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx("span", { className: "block aspect-square rounded-overlay bg-muted" }, i))
|
|
11678
12470
|
});
|
|
11679
12471
|
}
|
|
12472
|
+
|
|
11680
12473
|
// src/components/place-board.tsx
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
12474
|
+
const pieceSide = 96;
|
|
12475
|
+
const placedSide = 72;
|
|
12476
|
+
const placedPicture = { "--type-picture-size": "2.5rem" };
|
|
12477
|
+
const placeSide = 160;
|
|
11685
12478
|
/** 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. */
|
|
11686
12479
|
function PlaceBoard({ label, pieces, pieceKey, pieceLabel, renderPiece, places, placeKey, placeLabel, renderPlace, placement, onMove, pileLabel, placeState = () => "open", marks, locked = false, className }) {
|
|
11687
12480
|
const [heldKey, setHeld] = React.useState(null);
|
|
@@ -11782,8 +12575,9 @@ function PlaceBoard({ label, pieces, pieceKey, pieceLabel, renderPiece, places,
|
|
|
11782
12575
|
})]
|
|
11783
12576
|
});
|
|
11784
12577
|
}
|
|
12578
|
+
|
|
11785
12579
|
// src/components/infinite-list.tsx
|
|
11786
|
-
|
|
12580
|
+
const PendingFocus = React.createContext(null);
|
|
11787
12581
|
function MoreFailed({ message, retry }) {
|
|
11788
12582
|
return /* @__PURE__ */ jsxs("div", {
|
|
11789
12583
|
className: "flex flex-wrap items-start gap-3 border-t border-border bg-danger-subtle px-3 py-2 text-danger",
|
|
@@ -11804,7 +12598,7 @@ function MoreFailed({ message, retry }) {
|
|
|
11804
12598
|
]
|
|
11805
12599
|
});
|
|
11806
12600
|
}
|
|
11807
|
-
|
|
12601
|
+
const defaultMoreError = (failure) => /* @__PURE__ */ jsx(MoreFailed, { ...failure });
|
|
11808
12602
|
/**
|
|
11809
12603
|
* The row after a cursor-paged list or grid: loads the next page as it nears the screen, shows
|
|
11810
12604
|
* `moreSkeleton` while it comes, says why it failed with Try again, offers Show more for the
|
|
@@ -11984,8 +12778,9 @@ function InfiniteList({ state, label, children, skeleton, empty, moreLabel, more
|
|
|
11984
12778
|
})
|
|
11985
12779
|
});
|
|
11986
12780
|
}
|
|
12781
|
+
|
|
11987
12782
|
// src/components/line-chart.tsx
|
|
11988
|
-
|
|
12783
|
+
const TONE_FILL = {
|
|
11989
12784
|
neutral: "var(--muted)",
|
|
11990
12785
|
info: "var(--info-subtle)",
|
|
11991
12786
|
success: "var(--success-subtle)",
|
|
@@ -12059,7 +12854,7 @@ function yScale(values, pin = {}) {
|
|
|
12059
12854
|
].map((i) => min + (max - min) * i / 4)
|
|
12060
12855
|
};
|
|
12061
12856
|
}
|
|
12062
|
-
|
|
12857
|
+
const linearScale = (values, pin) => {
|
|
12063
12858
|
const y = yScale(values, pin);
|
|
12064
12859
|
return {
|
|
12065
12860
|
...y,
|
|
@@ -12144,7 +12939,7 @@ function valueAt(series, x) {
|
|
|
12144
12939
|
return sorted[sorted.length - 1].y;
|
|
12145
12940
|
}
|
|
12146
12941
|
/** Roughly how wide a 12px caption label is, in px. jsdom cannot measure text, so the chart estimates. */
|
|
12147
|
-
|
|
12942
|
+
const labelWidth = (text) => text.length * 7;
|
|
12148
12943
|
/**
|
|
12149
12944
|
* The x ticks that fit at this width: every k-th tick, the smallest k for which neighbouring labels
|
|
12150
12945
|
* leave a gap, so the spacing stays even. `scale` maps an x value to a pixel.
|
|
@@ -12899,6 +13694,7 @@ function LineChartGroup({ label, charts, formatX, xLabel, xTicks, spans, marks,
|
|
|
12899
13694
|
children: stack
|
|
12900
13695
|
});
|
|
12901
13696
|
}
|
|
13697
|
+
|
|
12902
13698
|
// src/components/page-header.tsx
|
|
12903
13699
|
/** 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). */
|
|
12904
13700
|
function PageHeader({ title, scope, actions, finding, as: Heading = "h1" }) {
|
|
@@ -12928,6 +13724,7 @@ function PageHeader({ title, scope, actions, finding, as: Heading = "h1" }) {
|
|
|
12928
13724
|
})]
|
|
12929
13725
|
});
|
|
12930
13726
|
}
|
|
13727
|
+
|
|
12931
13728
|
// src/components/undo.tsx
|
|
12932
13729
|
/**
|
|
12933
13730
|
* Schedules a reversible removal to commit after a window unless undone, and owns which items
|
|
@@ -13093,6 +13890,7 @@ function UndoBar({ undoable, inline = false }) {
|
|
|
13093
13890
|
})
|
|
13094
13891
|
});
|
|
13095
13892
|
}
|
|
13893
|
+
|
|
13096
13894
|
// src/components/done.tsx
|
|
13097
13895
|
/** 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. */
|
|
13098
13896
|
function Done({ title, next, figure, actions, focusOnMount = true, className }) {
|
|
@@ -13129,6 +13927,7 @@ function Done({ title, next, figure, actions, focusOnMount = true, className })
|
|
|
13129
13927
|
]
|
|
13130
13928
|
});
|
|
13131
13929
|
}
|
|
13930
|
+
|
|
13132
13931
|
// src/components/app-shell.tsx
|
|
13133
13932
|
/** The app frame: product name, side nav on the page ground (a scrollable row on phones), optional top bar, and the main region. */
|
|
13134
13933
|
function AppShell({ product, nav, navLabel = "Main", topBar, children, className }) {
|
|
@@ -13209,6 +14008,7 @@ function Breadcrumb({ items }) {
|
|
|
13209
14008
|
})
|
|
13210
14009
|
});
|
|
13211
14010
|
}
|
|
14011
|
+
|
|
13212
14012
|
// src/components/tabs.tsx
|
|
13213
14013
|
/** Tabs whose selection lives in a URL search parameter (React Router), with the ARIA tabs keyboard model. */
|
|
13214
14014
|
function Tabs({ param, items, label, children, className }) {
|
|
@@ -13241,6 +14041,7 @@ function Tabs({ param, items, label, children, className }) {
|
|
|
13241
14041
|
})]
|
|
13242
14042
|
});
|
|
13243
14043
|
}
|
|
14044
|
+
|
|
13244
14045
|
// src/components/active-list.tsx
|
|
13245
14046
|
/** Tracks the active item in a list worked through from the keyboard: moving, roving focus, and moving on when the active item is removed. */
|
|
13246
14047
|
function useActiveItem(items, getKey, { initial, noun } = {}) {
|
|
@@ -13362,6 +14163,7 @@ function ActiveList({ label, active, empty, children, className }) {
|
|
|
13362
14163
|
})
|
|
13363
14164
|
});
|
|
13364
14165
|
}
|
|
14166
|
+
|
|
13365
14167
|
// src/query/outbox.ts
|
|
13366
14168
|
/** Whether a failure is the server's answer for good (refused) rather than for now (waiting). */
|
|
13367
14169
|
function isRefusal(error) {
|
|
@@ -13609,6 +14411,7 @@ function useOutbox(outbox) {
|
|
|
13609
14411
|
function useOutboxStarted(outbox) {
|
|
13610
14412
|
React.useEffect(() => outbox.start(), [outbox]);
|
|
13611
14413
|
}
|
|
14414
|
+
|
|
13612
14415
|
// src/components/outbox-status.tsx
|
|
13613
14416
|
/** 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. */
|
|
13614
14417
|
function OutboxStatus({ outbox, noun, className }) {
|
|
@@ -13665,6 +14468,7 @@ function OutboxStatus({ outbox, noun, className }) {
|
|
|
13665
14468
|
})]
|
|
13666
14469
|
});
|
|
13667
14470
|
}
|
|
14471
|
+
|
|
13668
14472
|
// src/query/reserve.ts
|
|
13669
14473
|
function defaultStorage() {
|
|
13670
14474
|
try {
|
|
@@ -13763,8 +14567,9 @@ function useReserve(reserve, key) {
|
|
|
13763
14567
|
}, [reserve]);
|
|
13764
14568
|
return React.useSyncExternalStore(subscribe, () => reserve.kept(key), () => 0);
|
|
13765
14569
|
}
|
|
14570
|
+
|
|
13766
14571
|
// src/lib/speech.ts
|
|
13767
|
-
|
|
14572
|
+
const partsOf = (saying) => (typeof saying === "string" ? [{ text: saying }] : [...saying]).filter((p) => p.text.trim() || p.clip);
|
|
13768
14573
|
/** 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. */
|
|
13769
14574
|
function textOf(saying) {
|
|
13770
14575
|
return partsOf(saying).map((p) => p.text.trim()).filter(Boolean).join(" ");
|
|
@@ -13773,7 +14578,7 @@ function textOf(saying) {
|
|
|
13773
14578
|
function canPlayClips() {
|
|
13774
14579
|
return typeof window !== "undefined" && typeof window.Audio === "function";
|
|
13775
14580
|
}
|
|
13776
|
-
|
|
14581
|
+
const allRecorded = (parts) => parts.length > 0 && parts.every((p) => p.clip);
|
|
13777
14582
|
/** Whether `saying` can be said here: every part recorded and audio plays, or the browser has speech and there are words. */
|
|
13778
14583
|
function canSay(saying) {
|
|
13779
14584
|
const parts = partsOf(saying);
|
|
@@ -13791,7 +14596,7 @@ function pickVoice(voices, lang) {
|
|
|
13791
14596
|
return voices.find((v) => v.lang.toLowerCase().replace("_", "-") === wanted) ?? voices.find((v) => v.lang.toLowerCase().replace("_", "-").split("-")[0] === base);
|
|
13792
14597
|
}
|
|
13793
14598
|
/** The recording playing now, so the next prompt or `stopSpeaking` can cut it off. */
|
|
13794
|
-
|
|
14599
|
+
let playing;
|
|
13795
14600
|
function speakText(text, { lang, rate = .9, onEnd }) {
|
|
13796
14601
|
if (!canSpeak() || !text.trim()) return false;
|
|
13797
14602
|
const synth = window.speechSynthesis;
|
|
@@ -13905,10 +14710,11 @@ function useSpeech({ lang, rate, muted = false } = {}) {
|
|
|
13905
14710
|
}, [])
|
|
13906
14711
|
};
|
|
13907
14712
|
}
|
|
14713
|
+
|
|
13908
14714
|
// src/query/clips.tsx
|
|
13909
14715
|
/** The query key of the clip list: invalidate it after a recording is kept, `queryClient.invalidateQueries({ queryKey: clipsQueryKey })`. */
|
|
13910
|
-
|
|
13911
|
-
|
|
14716
|
+
const clipsQueryKey = ["strata", "clips"];
|
|
14717
|
+
const Context$1 = React.createContext({
|
|
13912
14718
|
ready: true,
|
|
13913
14719
|
parts: (text) => [{
|
|
13914
14720
|
text,
|
|
@@ -13978,6 +14784,7 @@ function useSayOnShow(text, { muted = false } = {}) {
|
|
|
13978
14784
|
text
|
|
13979
14785
|
]);
|
|
13980
14786
|
}
|
|
14787
|
+
|
|
13981
14788
|
// src/components/say-again.tsx
|
|
13982
14789
|
/** 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. */
|
|
13983
14790
|
function SayAgain({ text, parts, verb = "Say", className, ...options }) {
|
|
@@ -13996,9 +14803,10 @@ function SayAgain({ text, parts, verb = "Say", className, ...options }) {
|
|
|
13996
14803
|
className
|
|
13997
14804
|
});
|
|
13998
14805
|
}
|
|
14806
|
+
|
|
13999
14807
|
// src/lib/recording.ts
|
|
14000
14808
|
/** The quietest level a speech meter draws, in dBFS: below it is silence for speech. */
|
|
14001
|
-
|
|
14809
|
+
const LEVEL_FLOOR_DB = -60;
|
|
14002
14810
|
/** Joins chunks of samples into one buffer, in order. */
|
|
14003
14811
|
function joinSamples(chunks) {
|
|
14004
14812
|
const out = new Float32Array(chunks.reduce((n, c) => n + c.length, 0));
|
|
@@ -14059,6 +14867,7 @@ function speechLevel(peak) {
|
|
|
14059
14867
|
advice: "The level suits speech."
|
|
14060
14868
|
};
|
|
14061
14869
|
}
|
|
14870
|
+
|
|
14062
14871
|
// src/components/recorder.tsx
|
|
14063
14872
|
/** Records one take at a time from the microphone, with its live level, as a lossless WAV. */
|
|
14064
14873
|
function useRecorder({ maxSeconds, microphone }) {
|
|
@@ -14152,8 +14961,8 @@ function useRecorder({ maxSeconds, microphone }) {
|
|
|
14152
14961
|
};
|
|
14153
14962
|
}
|
|
14154
14963
|
/** `InputLevel`'s "Too loud" notch: -3 dBFS on the meter's `LEVEL_FLOOR_DB`..0 scale. */
|
|
14155
|
-
|
|
14156
|
-
at: -
|
|
14964
|
+
const inputLevelThresholds = [{
|
|
14965
|
+
at: (-60 + 3) / -60,
|
|
14157
14966
|
tone: "danger",
|
|
14158
14967
|
label: "Too loud"
|
|
14159
14968
|
}];
|
|
@@ -14163,7 +14972,7 @@ function InputLevel({ level, seconds, maxSeconds, label = "Input level", classNa
|
|
|
14163
14972
|
return /* @__PURE__ */ jsx(Meter, {
|
|
14164
14973
|
label,
|
|
14165
14974
|
value: db - -60,
|
|
14166
|
-
max: 60,
|
|
14975
|
+
max: - -60,
|
|
14167
14976
|
thresholds: inputLevelThresholds,
|
|
14168
14977
|
valueText: `${format.integer(Math.round(db) || 0)}\u00a0dBFS`,
|
|
14169
14978
|
detail: `Recording ${format.runningTime(seconds)} of at most ${format.runningTime(maxSeconds)}`,
|
|
@@ -14189,13 +14998,14 @@ function TakeLevel({ peak, lead, className }) {
|
|
|
14189
14998
|
})]
|
|
14190
14999
|
});
|
|
14191
15000
|
}
|
|
15001
|
+
|
|
14192
15002
|
// src/lib/segmenter.ts
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
15003
|
+
const FRAME_SECONDS = .02;
|
|
15004
|
+
const ONSET_FRAMES = 3;
|
|
15005
|
+
const HYSTERESIS_DB = 6;
|
|
15006
|
+
const RISE_DB_PER_SECOND = 2.5;
|
|
15007
|
+
const FALL = .2;
|
|
15008
|
+
const SILENT_DB = -100;
|
|
14199
15009
|
/** The RMS of `frame` in dBFS, `SILENT_DB` for zeros. */
|
|
14200
15010
|
function rmsDb(frame) {
|
|
14201
15011
|
let sum = 0;
|
|
@@ -14331,6 +15141,7 @@ function createSegmenter(sampleRate, { onsetDb = 12, floorDb = -55, silenceSecon
|
|
|
14331
15141
|
}
|
|
14332
15142
|
};
|
|
14333
15143
|
}
|
|
15144
|
+
|
|
14334
15145
|
// src/components/auto-recorder.tsx
|
|
14335
15146
|
/** Listens all the time and hands over each stretch of speech as its own lossless take. */
|
|
14336
15147
|
function useAutoRecorder({ maxSeconds, onTake, paused = false, microphone, ...tuning }) {
|
|
@@ -14465,18 +15276,19 @@ function ListeningLevel({ state, maxSeconds, label = "Input level", className })
|
|
|
14465
15276
|
return /* @__PURE__ */ jsx(Meter, {
|
|
14466
15277
|
label,
|
|
14467
15278
|
value: db - -60,
|
|
14468
|
-
max: 60,
|
|
15279
|
+
max: - -60,
|
|
14469
15280
|
thresholds: inputLevelThresholds,
|
|
14470
15281
|
valueText: `${format.integer(Math.round(db) || 0)} dBFS`,
|
|
14471
15282
|
detail,
|
|
14472
15283
|
className
|
|
14473
15284
|
});
|
|
14474
15285
|
}
|
|
15286
|
+
|
|
14475
15287
|
// src/lib/image-diff.ts
|
|
14476
15288
|
/** The longest side, in pixels, a picture is compared at. */
|
|
14477
|
-
|
|
15289
|
+
const MAX_SIDE = 2048;
|
|
14478
15290
|
/** pixelmatch's own default colour distance below which two pixels are the same. */
|
|
14479
|
-
|
|
15291
|
+
const DEFAULT_TOLERANCE = .1;
|
|
14480
15292
|
/** 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. */
|
|
14481
15293
|
function resample(p, width, height) {
|
|
14482
15294
|
if (p.width === width && p.height === height) return p;
|
|
@@ -14541,6 +15353,7 @@ async function readPixels(src, maxSide = MAX_SIDE) {
|
|
|
14541
15353
|
height
|
|
14542
15354
|
};
|
|
14543
15355
|
}
|
|
15356
|
+
|
|
14544
15357
|
// src/components/difference.tsx
|
|
14545
15358
|
/** The pixels that differ between two pictures at a tolerance (0 to 1), read only while `enabled`. */
|
|
14546
15359
|
function useDifference(a, b, tolerance, enabled, read = readPixels) {
|
|
@@ -14597,8 +15410,9 @@ function DifferenceMarks({ difference }) {
|
|
|
14597
15410
|
className: "absolute inset-0 size-full object-contain"
|
|
14598
15411
|
});
|
|
14599
15412
|
}
|
|
15413
|
+
|
|
14600
15414
|
// src/components/compare-regions.tsx
|
|
14601
|
-
|
|
15415
|
+
const REGION_KEYS = [
|
|
14602
15416
|
"q",
|
|
14603
15417
|
"w",
|
|
14604
15418
|
"e",
|
|
@@ -14724,15 +15538,16 @@ function RegionChips({ state }) {
|
|
|
14724
15538
|
})
|
|
14725
15539
|
});
|
|
14726
15540
|
}
|
|
15541
|
+
|
|
14727
15542
|
// src/components/compare.tsx
|
|
14728
|
-
|
|
15543
|
+
const MODE_LABEL$1 = {
|
|
14729
15544
|
side: "Side by side",
|
|
14730
15545
|
swipe: "Swipe",
|
|
14731
15546
|
fade: "Fade",
|
|
14732
15547
|
blink: "Blink",
|
|
14733
15548
|
difference: "Difference"
|
|
14734
15549
|
};
|
|
14735
|
-
|
|
15550
|
+
const ALL_MODES = [
|
|
14736
15551
|
"side",
|
|
14737
15552
|
"swipe",
|
|
14738
15553
|
"fade",
|
|
@@ -15088,6 +15903,7 @@ function Compare({ label, a, b, blind, missing, mode, onModeChange, modes = ALL_
|
|
|
15088
15903
|
})
|
|
15089
15904
|
});
|
|
15090
15905
|
}
|
|
15906
|
+
|
|
15091
15907
|
// src/components/pair-vote.tsx
|
|
15092
15908
|
/** A blind pairwise judgment of two pictures: `Compare`, answer keys in its legend, and a vote bar that never leans on either side. */
|
|
15093
15909
|
function PairVote({ pair, skeleton, empty, onAnswer, pending, progress, flagReasons, preload, last, words, ...compare }) {
|
|
@@ -15257,7 +16073,11 @@ function Judged({ pair, onAnswer, pending, flagReasons, words, last, view }) {
|
|
|
15257
16073
|
onPick: pending ? void 0 : (side) => answer({ answer: side })
|
|
15258
16074
|
}, pair) });
|
|
15259
16075
|
}
|
|
15260
|
-
|
|
16076
|
+
|
|
16077
|
+
// src/lib/loudness.ts
|
|
16078
|
+
/** The most of a clip that is measured, in seconds. */
|
|
16079
|
+
const MAX_SECONDS = 120;
|
|
16080
|
+
const db$1 = (x) => x > 0 ? 20 * Math.log10(x) : -Infinity;
|
|
15261
16081
|
/** The RMS and peak of channel data (-1 to 1), over all channels together. */
|
|
15262
16082
|
function loudnessOf(channels) {
|
|
15263
16083
|
let sum = 0;
|
|
@@ -15291,7 +16111,7 @@ function matchGains(a, b) {
|
|
|
15291
16111
|
};
|
|
15292
16112
|
}
|
|
15293
16113
|
/** dB to a media element's volume (0 to 1). */
|
|
15294
|
-
|
|
16114
|
+
const gainToVolume = (decibels) => Math.min(1, Math.max(0, 10 ** (decibels / 20)));
|
|
15295
16115
|
/** Fetches and decodes a clip and measures it. Needs the Web Audio API; reads at most `MAX_SECONDS`. */
|
|
15296
16116
|
async function measureLoudness(src) {
|
|
15297
16117
|
const response = await fetch(src);
|
|
@@ -15305,8 +16125,9 @@ async function measureLoudness(src) {
|
|
|
15305
16125
|
context.close();
|
|
15306
16126
|
}
|
|
15307
16127
|
}
|
|
16128
|
+
|
|
15308
16129
|
// src/components/compare-audio.tsx
|
|
15309
|
-
|
|
16130
|
+
const db = (x) => `${Math.abs(x).toFixed(1)} dB`;
|
|
15310
16131
|
/** Two clips to judge by ear: one transport, a switch that keeps the playhead, a loop, and matched levels. */
|
|
15311
16132
|
function CompareAudio({ label, a, b, blind, missing, levelMatch = true, align = "auto", measure = measureLoudness, keys = true, extraShortcuts = [], footer, className }) {
|
|
15312
16133
|
const refA = React.useRef(null);
|
|
@@ -15619,9 +16440,10 @@ function CompareAudio({ label, a, b, blind, missing, levelMatch = true, align =
|
|
|
15619
16440
|
]
|
|
15620
16441
|
});
|
|
15621
16442
|
}
|
|
16443
|
+
|
|
15622
16444
|
// src/components/video-clock.tsx
|
|
15623
16445
|
/** Speeds offered by default: slow motion for sitting on a moment. */
|
|
15624
|
-
|
|
16446
|
+
const SLOW_RATES = [
|
|
15625
16447
|
.1,
|
|
15626
16448
|
.25,
|
|
15627
16449
|
.5,
|
|
@@ -16065,8 +16887,9 @@ function VideoControls({ clock, rates = SLOW_RATES, moments = [] }) {
|
|
|
16065
16887
|
]
|
|
16066
16888
|
})] });
|
|
16067
16889
|
}
|
|
16890
|
+
|
|
16068
16891
|
// src/components/compare-video-grid.tsx
|
|
16069
|
-
|
|
16892
|
+
const COLUMNS$1 = {
|
|
16070
16893
|
2: "sm:grid-cols-2",
|
|
16071
16894
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
16072
16895
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
@@ -16232,14 +17055,15 @@ function CompareVideoGrid({ label, items, reference, blind, missing, catchingUp
|
|
|
16232
17055
|
})
|
|
16233
17056
|
});
|
|
16234
17057
|
}
|
|
17058
|
+
|
|
16235
17059
|
// src/components/compare-video.tsx
|
|
16236
|
-
|
|
17060
|
+
const MODES = [
|
|
16237
17061
|
"side",
|
|
16238
17062
|
"swipe",
|
|
16239
17063
|
"fade",
|
|
16240
17064
|
"blink"
|
|
16241
17065
|
];
|
|
16242
|
-
|
|
17066
|
+
const MODE_LABEL = {
|
|
16243
17067
|
side: "Side by side",
|
|
16244
17068
|
swipe: "Swipe",
|
|
16245
17069
|
fade: "Fade",
|
|
@@ -16505,8 +17329,12 @@ function CompareVideo({ label, a, b, blind, missing, mode, onModeChange, rates =
|
|
|
16505
17329
|
})
|
|
16506
17330
|
});
|
|
16507
17331
|
}
|
|
16508
|
-
|
|
16509
|
-
|
|
17332
|
+
|
|
17333
|
+
// src/lib/text-diff.ts
|
|
17334
|
+
/** The most words in A times the most in B that are compared; a bigger pair is not. */
|
|
17335
|
+
const MAX_CELLS = 25e5;
|
|
17336
|
+
const tokens = (text) => text.split(/(\s+)/).filter((t) => t !== "");
|
|
17337
|
+
const isSpace = (t) => /^\s+$/.test(t);
|
|
16510
17338
|
/** Marks the words that differ between two texts, or returns null when the pair is too long to compare. */
|
|
16511
17339
|
function diffWords(a, b) {
|
|
16512
17340
|
const ta = tokens(a);
|
|
@@ -16557,6 +17385,7 @@ function diffWords(a, b) {
|
|
|
16557
17385
|
changedB: rb.changed
|
|
16558
17386
|
};
|
|
16559
17387
|
}
|
|
17388
|
+
|
|
16560
17389
|
// src/components/compare-text.tsx
|
|
16561
17390
|
function Words({ segments, changed }) {
|
|
16562
17391
|
return /* @__PURE__ */ jsx(Fragment, { children: segments.map((s, i) => changed && s.changed ? /* @__PURE__ */ jsx("mark", {
|
|
@@ -16687,8 +17516,9 @@ function CompareText({ label, a, b, blind, reference, defaultDiff = false, tooLo
|
|
|
16687
17516
|
]
|
|
16688
17517
|
});
|
|
16689
17518
|
}
|
|
17519
|
+
|
|
16690
17520
|
// src/components/compare-grid.tsx
|
|
16691
|
-
|
|
17521
|
+
const COLUMNS = {
|
|
16692
17522
|
2: "sm:grid-cols-2",
|
|
16693
17523
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
16694
17524
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
@@ -16783,8 +17613,9 @@ function CompareGrid({ label, items, blind, missing, actions, columns = 3, regio
|
|
|
16783
17613
|
})
|
|
16784
17614
|
});
|
|
16785
17615
|
}
|
|
17616
|
+
|
|
16786
17617
|
// src/components/workspace.tsx
|
|
16787
|
-
|
|
17618
|
+
const readPersisted = (key) => {
|
|
16788
17619
|
const empty = {
|
|
16789
17620
|
sizes: {},
|
|
16790
17621
|
collapsed: {}
|
|
@@ -16860,13 +17691,13 @@ function useWorkspaceState(persist) {
|
|
|
16860
17691
|
narrowOpen
|
|
16861
17692
|
]);
|
|
16862
17693
|
}
|
|
16863
|
-
|
|
16864
|
-
|
|
17694
|
+
const StateContext = React.createContext(null);
|
|
17695
|
+
const useState_ = () => {
|
|
16865
17696
|
const state = React.useContext(StateContext);
|
|
16866
17697
|
if (!state) throw new Error("strata-react: a Pane or Split must be inside a Workspace.");
|
|
16867
17698
|
return state;
|
|
16868
17699
|
};
|
|
16869
|
-
|
|
17700
|
+
const SlotContext = React.createContext({
|
|
16870
17701
|
direction: "row",
|
|
16871
17702
|
edge: "only",
|
|
16872
17703
|
stacked: false
|
|
@@ -16927,7 +17758,7 @@ function WorkspaceBar({ title, status, actions, end, className }) {
|
|
|
16927
17758
|
]
|
|
16928
17759
|
});
|
|
16929
17760
|
}
|
|
16930
|
-
|
|
17761
|
+
const iconsFor = (direction, edge, stacked) => {
|
|
16931
17762
|
if (stacked || direction === "column") return edge === "start" ? [PanelTopClose, PanelTopOpen] : [PanelBottomClose, PanelBottomOpen];
|
|
16932
17763
|
return edge === "end" ? [PanelRightClose, PanelRightOpen] : [PanelLeftClose, PanelLeftOpen];
|
|
16933
17764
|
};
|
|
@@ -16997,8 +17828,8 @@ function Pane({ id, name, grow, size = 280, min, max, collapsible, defaultCollap
|
|
|
16997
17828
|
})]
|
|
16998
17829
|
});
|
|
16999
17830
|
}
|
|
17000
|
-
|
|
17001
|
-
|
|
17831
|
+
const isPane = (c) => React.isValidElement(c) && c.type === Pane;
|
|
17832
|
+
const clamp = (n, lo, hi) => Math.min(Math.max(n, lo), hi);
|
|
17002
17833
|
function Separator$1({ pane, direction, sign, container }) {
|
|
17003
17834
|
const state = useState_();
|
|
17004
17835
|
const [moving, setMoving] = React.useState(false);
|
|
@@ -17120,8 +17951,9 @@ function Split({ direction, className, children }) {
|
|
|
17120
17951
|
children: out
|
|
17121
17952
|
});
|
|
17122
17953
|
}
|
|
17954
|
+
|
|
17123
17955
|
// src/components/history.tsx
|
|
17124
|
-
|
|
17956
|
+
const compose = (older, newer) => ({
|
|
17125
17957
|
label: older.label,
|
|
17126
17958
|
key: older.key,
|
|
17127
17959
|
undo: () => {
|
|
@@ -17285,6 +18117,7 @@ function useHistoryState(initial, options) {
|
|
|
17285
18117
|
history
|
|
17286
18118
|
};
|
|
17287
18119
|
}
|
|
18120
|
+
|
|
17288
18121
|
// src/components/save.tsx
|
|
17289
18122
|
/** Saves `value` after changes settle, never two at once, and says where it stands. The document's first `value` counts as saved. */
|
|
17290
18123
|
function useAutoSave({ value, save, delayMs = 1500, equals = Object.is, describeError = describeActionError }) {
|
|
@@ -17394,7 +18227,7 @@ function useLeaveGuard(active) {
|
|
|
17394
18227
|
return () => window.removeEventListener("beforeunload", onBeforeUnload);
|
|
17395
18228
|
}, [active]);
|
|
17396
18229
|
}
|
|
17397
|
-
|
|
18230
|
+
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";
|
|
17398
18231
|
/**
|
|
17399
18232
|
* The sign of whether the work is safe: "Saved 10:42", "Saving…", "Unsaved changes", or "Not saved"
|
|
17400
18233
|
* with the reason and "Try again". Fixed width, so it never moves what is beside it. Announces a
|
|
@@ -17462,8 +18295,9 @@ function SaveStatus({ state, onRetry, className }) {
|
|
|
17462
18295
|
]
|
|
17463
18296
|
});
|
|
17464
18297
|
}
|
|
18298
|
+
|
|
17465
18299
|
// src/lib/rich-text.ts
|
|
17466
|
-
|
|
18300
|
+
const WORD = /[\p{L}\p{N}_-]/u;
|
|
17467
18301
|
/** Finds ids in `text`, longest first, never inside a longer word. Overlaps go to the earlier, longer match. */
|
|
17468
18302
|
function matchEntities(text, matcher) {
|
|
17469
18303
|
if (!matcher) return [];
|
|
@@ -17627,8 +18461,9 @@ function parseRichText(text, matcher) {
|
|
|
17627
18461
|
function plainText(text) {
|
|
17628
18462
|
return text.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/\*\*|`/g, "").replace(/^\s*(?:[-*]|\d+[.)])\s+/gm, "").replace(/\s+/g, " ").trim();
|
|
17629
18463
|
}
|
|
18464
|
+
|
|
17630
18465
|
// src/components/conversation.tsx
|
|
17631
|
-
|
|
18466
|
+
const LINK = "text-primary underline underline-offset-2 hover:no-underline";
|
|
17632
18467
|
function renderInline(nodes, onOpen, keyBase = "") {
|
|
17633
18468
|
return nodes.map((n, i) => {
|
|
17634
18469
|
const key = `${keyBase}${i}`;
|
|
@@ -17678,7 +18513,7 @@ function RichText({ children, entities, onOpen, className }) {
|
|
|
17678
18513
|
children: renderBlocks(blocks, onOpen)
|
|
17679
18514
|
});
|
|
17680
18515
|
}
|
|
17681
|
-
|
|
18516
|
+
const NEAR_BOTTOM = 24;
|
|
17682
18517
|
/** 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. */
|
|
17683
18518
|
function Conversation({ label, turns, answerName, personName = "You", entities, onOpen, onRetry, empty, lookedUpLabel = "What it looked up", className }) {
|
|
17684
18519
|
const box = React.useRef(null);
|
|
@@ -17885,8 +18720,9 @@ function Composer({ label, onSend, answering = false, onStop, answeringReason, s
|
|
|
17885
18720
|
]
|
|
17886
18721
|
});
|
|
17887
18722
|
}
|
|
18723
|
+
|
|
17888
18724
|
// src/lib/region.ts
|
|
17889
|
-
|
|
18725
|
+
const HANDLES = [
|
|
17890
18726
|
"nw",
|
|
17891
18727
|
"n",
|
|
17892
18728
|
"ne",
|
|
@@ -18024,7 +18860,7 @@ function lerpRect(a, b, t, easing = "ease-in-out") {
|
|
|
18024
18860
|
};
|
|
18025
18861
|
}
|
|
18026
18862
|
/** True when two rectangles are the same to the unit's thousandth. */
|
|
18027
|
-
|
|
18863
|
+
const sameRect = (a, b) => [
|
|
18028
18864
|
"x",
|
|
18029
18865
|
"y",
|
|
18030
18866
|
"w",
|
|
@@ -18094,7 +18930,7 @@ function joinRects(a, b) {
|
|
|
18094
18930
|
};
|
|
18095
18931
|
}
|
|
18096
18932
|
/** The x of the gutter between two windows: halfway between the left one's right edge and the right one's left edge. */
|
|
18097
|
-
|
|
18933
|
+
const gutterOf = (left, right) => (left.x + left.w + right.x) / 2;
|
|
18098
18934
|
/** 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. */
|
|
18099
18935
|
function moveGutter(left, right, dx, { bounds, min }) {
|
|
18100
18936
|
const mw = min?.w ?? 0;
|
|
@@ -18110,8 +18946,9 @@ function moveGutter(left, right, dx, { bounds, min }) {
|
|
|
18110
18946
|
w: right.w - d
|
|
18111
18947
|
}];
|
|
18112
18948
|
}
|
|
18949
|
+
|
|
18113
18950
|
// src/components/region-editor.tsx
|
|
18114
|
-
|
|
18951
|
+
const TONE = {
|
|
18115
18952
|
neutral: {
|
|
18116
18953
|
edge: "var(--foreground)",
|
|
18117
18954
|
fill: "var(--muted)"
|
|
@@ -18133,7 +18970,7 @@ var TONE = {
|
|
|
18133
18970
|
fill: "var(--danger-subtle)"
|
|
18134
18971
|
}
|
|
18135
18972
|
};
|
|
18136
|
-
|
|
18973
|
+
const CURSOR = {
|
|
18137
18974
|
n: "ns-resize",
|
|
18138
18975
|
s: "ns-resize",
|
|
18139
18976
|
e: "ew-resize",
|
|
@@ -18143,7 +18980,7 @@ var CURSOR = {
|
|
|
18143
18980
|
nw: "nwse-resize",
|
|
18144
18981
|
se: "nwse-resize"
|
|
18145
18982
|
};
|
|
18146
|
-
|
|
18983
|
+
const HANDLE_AT = {
|
|
18147
18984
|
nw: "left-0 top-0 -translate-x-1/2 -translate-y-1/2",
|
|
18148
18985
|
n: "left-1/2 top-0 -translate-x-1/2 -translate-y-1/2",
|
|
18149
18986
|
ne: "right-0 top-0 translate-x-1/2 -translate-y-1/2",
|
|
@@ -18153,9 +18990,9 @@ var HANDLE_AT = {
|
|
|
18153
18990
|
sw: "left-0 bottom-0 -translate-x-1/2 translate-y-1/2",
|
|
18154
18991
|
w: "left-0 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
18155
18992
|
};
|
|
18156
|
-
|
|
18993
|
+
const round = (n) => format.integer(Math.round(n));
|
|
18157
18994
|
/** A window said in words. */
|
|
18158
|
-
|
|
18995
|
+
const describeRegion = (r) => `${r.label}: ${round(r.w)} wide by ${round(r.h)} high, ${round(r.x)} across and ${round(r.y)} down`;
|
|
18159
18996
|
/** 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. */
|
|
18160
18997
|
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 = {
|
|
18161
18998
|
one: "Page",
|
|
@@ -18766,6 +19603,7 @@ function RegionEditor({ label, children, size, regions, onChange, selectedId, on
|
|
|
18766
19603
|
]
|
|
18767
19604
|
});
|
|
18768
19605
|
}
|
|
19606
|
+
|
|
18769
19607
|
// src/lib/book.ts
|
|
18770
19608
|
/**
|
|
18771
19609
|
* The pages shown together, as indexes into the set. In a spread the first page stands alone on
|
|
@@ -18783,7 +19621,7 @@ function viewsOf(count, spread) {
|
|
|
18783
19621
|
function viewOf(index, spread) {
|
|
18784
19622
|
return spread ? index <= 0 ? 0 : Math.floor((index + 1) / 2) : Math.max(index, 0);
|
|
18785
19623
|
}
|
|
18786
|
-
|
|
19624
|
+
const norm = (s) => s.trim().toLowerCase();
|
|
18787
19625
|
/**
|
|
18788
19626
|
* Finds the page a person typed. A printed label wins ("iv", "12") because that is what is printed
|
|
18789
19627
|
* on the page they are looking at; otherwise it is the scan's own position ("22" is the 22nd
|
|
@@ -18799,7 +19637,7 @@ function findPage(pages, query) {
|
|
|
18799
19637
|
return scan >= 0 ? scan : null;
|
|
18800
19638
|
}
|
|
18801
19639
|
/** A page said in words: "Page 22 (12)" or "Page 22" with no printed label. */
|
|
18802
|
-
|
|
19640
|
+
const pageName = (p, word = "Page") => `${word} ${p.scan}${p.printed ? ` (${p.printed})` : ""}`;
|
|
18803
19641
|
/** Where the viewer is, in words: "Page 22 (12) of 44", or "Pages 22 and 23 of 44" for a spread. */
|
|
18804
19642
|
function sayPosition(shown, total, word = "Page", plural = "Pages") {
|
|
18805
19643
|
if (shown.length === 0) return "";
|
|
@@ -18807,6 +19645,7 @@ function sayPosition(shown, total, word = "Page", plural = "Pages") {
|
|
|
18807
19645
|
const label = (p) => `${p.scan}${p.printed ? ` (${p.printed})` : ""}`;
|
|
18808
19646
|
return `${plural} ${label(shown[0])} and ${label(shown[1])} of ${total}`;
|
|
18809
19647
|
}
|
|
19648
|
+
|
|
18810
19649
|
// src/components/book-viewer.tsx
|
|
18811
19650
|
/** 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. */
|
|
18812
19651
|
function useBookUrl(count, { param = "page" } = {}) {
|
|
@@ -19035,6 +19874,7 @@ function BookViewer({ label, pages, index, onIndexChange, missing, layout = "spr
|
|
|
19035
19874
|
]
|
|
19036
19875
|
});
|
|
19037
19876
|
}
|
|
19877
|
+
|
|
19038
19878
|
// src/components/box-overlay.tsx
|
|
19039
19879
|
/** Holds the active and pointed box for a `BoxOverlay` and the `BoxList` beside it. */
|
|
19040
19880
|
function useBoxes(initial = null) {
|
|
@@ -19058,14 +19898,14 @@ function useBoxes(initial = null) {
|
|
|
19058
19898
|
choose
|
|
19059
19899
|
]);
|
|
19060
19900
|
}
|
|
19061
|
-
|
|
19901
|
+
const STROKE = {
|
|
19062
19902
|
neutral: "var(--foreground)",
|
|
19063
19903
|
info: "var(--info)",
|
|
19064
19904
|
success: "var(--success)",
|
|
19065
19905
|
warning: "var(--warning)",
|
|
19066
19906
|
danger: "var(--danger)"
|
|
19067
19907
|
};
|
|
19068
|
-
|
|
19908
|
+
const FILL = {
|
|
19069
19909
|
neutral: "var(--muted)",
|
|
19070
19910
|
info: "var(--info-subtle)",
|
|
19071
19911
|
success: "var(--success-subtle)",
|
|
@@ -19178,6 +20018,7 @@ function BoxList({ label, boxes, state, renderBox, className }) {
|
|
|
19178
20018
|
})
|
|
19179
20019
|
});
|
|
19180
20020
|
}
|
|
20021
|
+
|
|
19181
20022
|
// src/components/boxed-picture.tsx
|
|
19182
20023
|
/** 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`. */
|
|
19183
20024
|
function BoxedPicture({ label, src, alt, missing, of, boxes, state, boxesLabel, zoom = true, margin = .75, maxHeight = "70svh", onChoose, className }) {
|
|
@@ -19243,8 +20084,9 @@ function BoxedPicture({ label, src, alt, missing, of, boxes, state, boxesLabel,
|
|
|
19243
20084
|
})]
|
|
19244
20085
|
});
|
|
19245
20086
|
}
|
|
20087
|
+
|
|
19246
20088
|
// src/lib/sequence.ts
|
|
19247
|
-
|
|
20089
|
+
const EPS = 1e-9;
|
|
19248
20090
|
/** The grid point nearest to `time`, or `time` itself when there is no grid. */
|
|
19249
20091
|
function snapToGrid(time, grid) {
|
|
19250
20092
|
if (grid === void 0) return time;
|
|
@@ -19306,9 +20148,10 @@ function settleCut(wanted, grid, room) {
|
|
|
19306
20148
|
limit: held.limit
|
|
19307
20149
|
};
|
|
19308
20150
|
}
|
|
20151
|
+
|
|
19309
20152
|
// src/components/sequence-timeline.tsx
|
|
19310
|
-
|
|
19311
|
-
|
|
20153
|
+
const seconds = (n) => `${tidy(Math.round(n * 10) / 10)} s`;
|
|
20154
|
+
const at = (t) => tickLabel(t, .1);
|
|
19312
20155
|
/** 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. */
|
|
19313
20156
|
function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .1, grid, step = .1, selected = [], onSelectRange, renderItem, height = "5rem", className }) {
|
|
19314
20157
|
const start = items[0]?.start ?? 0;
|
|
@@ -19514,12 +20357,13 @@ function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength = .
|
|
|
19514
20357
|
]
|
|
19515
20358
|
});
|
|
19516
20359
|
}
|
|
20360
|
+
|
|
19517
20361
|
// src/components/tree.tsx
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
20362
|
+
const Context = React.createContext(null);
|
|
20363
|
+
const useCtx = () => React.useContext(Context);
|
|
20364
|
+
const NOTE = "\0";
|
|
20365
|
+
const isNote = (key) => key.includes(NOTE);
|
|
20366
|
+
const ROW = "flex min-h-(--control-h-sm) min-w-0 items-center gap-1 rounded-control pr-2 type-body-sm";
|
|
19523
20367
|
function Row$1({ level, children }) {
|
|
19524
20368
|
return /* @__PURE__ */ jsx("div", {
|
|
19525
20369
|
className: ROW,
|
|
@@ -19928,17 +20772,18 @@ function Tree({ label, roots, useChildren, nodeKey, nodeLabel, isBranch, renderN
|
|
|
19928
20772
|
]
|
|
19929
20773
|
});
|
|
19930
20774
|
}
|
|
20775
|
+
|
|
19931
20776
|
// src/components/folder-picker.tsx
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
20777
|
+
const SEP = "/";
|
|
20778
|
+
const parts = (path) => path.split(SEP).filter(Boolean);
|
|
20779
|
+
const join = (parent, name) => `${parent === SEP ? "" : parent}${SEP}${name}`;
|
|
19935
20780
|
/** The parent of a path, or `null` at the top. */
|
|
19936
|
-
|
|
20781
|
+
const parentOf = (path) => {
|
|
19937
20782
|
const p = parts(path);
|
|
19938
20783
|
return p.length <= 1 ? null : `${SEP}${p.slice(0, -1).join(SEP)}`;
|
|
19939
20784
|
};
|
|
19940
20785
|
/** Every folder from the top down to `path`, which the tree must have open to show it. */
|
|
19941
|
-
|
|
20786
|
+
const ancestorsOf = (path) => parts(path).slice(0, -1).map((_, i, a) => `${SEP}${a.slice(0, i + 1).join(SEP)}`);
|
|
19942
20787
|
/** 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. */
|
|
19943
20788
|
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 }) {
|
|
19944
20789
|
const useFolders = (path) => {
|
|
@@ -20158,6 +21003,6 @@ function FolderPicker({ label, useFolders: useListing, value, onChange, onChoose
|
|
|
20158
21003
|
]
|
|
20159
21004
|
});
|
|
20160
21005
|
}
|
|
20161
|
-
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 };
|
|
20162
21006
|
|
|
21007
|
+
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, EditListPlayer, 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, continues, countMarks, createApi, createFormat, createOutbox, createQueryClient, createReserve, createSegmenter, createTypedApi, crossedThreshold, currentItem, describeActionError, describeHttpError, describeRegion, describeWorkflowSummary, detectPlatform, diffWords, differences, diskThresholds, drawRect, ease, editTimeOf, editTimes, 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, locateInEdit, logScale, loudnessOf, marksFor, matchEntities, matchGains, matchesAccept, matchesChord, measureLoudness, moveGutter, moveRect, nextBreak, 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, useEditList, 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 };
|
|
20163
21008
|
//# sourceMappingURL=index.js.map
|