strata-react 1.3.17 → 1.3.19

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 CHANGED
@@ -190,7 +190,7 @@ thousands of lines. Such an app imports the same stylesheet **without the reset*
190
190
  |---|---|---|
191
191
  | Actions | `Button`, `IconButton`, `RowAction`, `AsyncButton`, `useAsyncAction` | Default is `outline`; one filled button per view; `IconButton` requires `label`; `RowAction` is named for its row ("Withdraw Tom Ellery"); `AsyncButton` keeps one width through idle, pending, done and error, and announces `error` with its retry label; buttons carry `data-variant` and `AsyncButton` `data-phase` for tests; a `title` is refused (type `never`, and a development warning): a tip is a `Tooltip`, or `IconButton`'s `label` and `hint`; `useAsyncAction` returns `{ phase, run, error, thrown, fieldErrors, clearFieldError }` with a stable `run`, describes an `HttpError` in a sentence with the server's own reason for a 4xx (`describeActionError`, or the product's own `describeError`), and `validate` plus a server's 422 put messages on `fieldErrors` for each `Field` |
192
192
  | Form | `Field`, `Input`, `Textarea`, `NativeSelect`, `ChoiceGroup`, `Checkbox` | `Field` wires label, hint, error, `aria-describedby`, `aria-invalid`, and `action` puts a one-field form's button on the control's row with the hint and error under both; `Checkbox` requires `label` and is one target with it, and has a mixed state |
193
- | Status and figures | `Status`, `Metric`, `MetricStrip`, `Meter`, `crossedThreshold`, `CompositionBar`, `WorkflowSteps`, `JobsTable`, `ScheduleTable`, `SystemPanel`, `useSystemInfo`, `PauseButton` | A status is always a word; figures have no icons or sparklines; `Meter` is a `meter` named for what it measures, with its reading in words ("72% used"), threshold notches, and a `Status` word once a threshold is crossed (each threshold must name its state); `CompositionBar` is a stacked bar over a table naming every part, its amount and share, and names the remainder (`total` needs `restLabel`); a part that is there reads "<1%" and keeps a sliver, never "0%"; `JobStatus` is a long-running server job (its `progress` `{ done, total, current }` reads "12 of 40 done, 28 remaining · IMG_0412"; `useJobAction` starts one: busy until the server answers, a "queued" toast with a link to the jobs page, a "finished" toast when it ends): a required word per state beside the app's sentence, a progress bar when the total is known, each failure named with its reason, announced only when the item changes or the job ends; `WorkflowSteps` draws strata-python's shared `WorkflowRun` (`/api/workflows/<pipeline>/subjects/<id>`): each stage's state as a word, when it ran and how long it took, a failed stage's error with Try again, and Approve on a waiting gate (the first is the view's filled button), saying who approved or that its policy did; `JobsTable` is the shared jobs page (`GET /api/jobs`): each job's state as a word with its progress or error, and Cancel or Run again only where they apply. Both take the app's generated `Schema<"WorkflowRun">` and `Schema<"Task">` as they come; `ScheduleTable` is a machine's scheduled jobs (systemd timers, cron), not the queue: each job's last result as a word (OK, Failed, Running, Never run), when it last ran and when it runs next, the last two dropping on a phone; `SystemPanel` is strata-python's `GET /api/system` (`useSystemInfo()` reads it): version and commit, uptime, each folder as a `Meter` on shared disk limits ("Filling up", "Nearly full") or the word Missing, each service Up or Down with the server's reason, and the app's own `facts`; `PauseButton` takes the `Poll` from `usePoll` (passed to `useLoad({ poll })`): a fixed-name "Pause updates" toggle and "Updated 12:00" |
193
+ | Status and figures | `Status`, `Metric`, `MetricStrip`, `Meter`, `crossedThreshold`, `CompositionBar`, `WorkflowSteps`, `WorkflowSummary`, `JobsTable`, `ScheduleTable`, `SystemPanel`, `useSystemInfo`, `PauseButton` | A status is always a word; figures have no icons or sparklines; `Meter` is a `meter` named for what it measures, with its reading in words ("72% used"), threshold notches, and a `Status` word once a threshold is crossed (each threshold must name its state); `CompositionBar` is a stacked bar over a table naming every part, its amount and share, and names the remainder (`total` needs `restLabel`); a part that is there reads "<1%" and keeps a sliver, never "0%"; `JobStatus` is a long-running server job (its `progress` `{ done, total, current }` reads "12 of 40 done, 28 remaining · IMG_0412"; `useJobAction` starts one: busy until the server answers, a "queued" toast with a link to the jobs page, a "finished" toast when it ends): a required word per state beside the app's sentence, a progress bar when the total is known, each failure named with its reason, announced only when the item changes or the job ends; `WorkflowSteps` draws strata-python's shared `WorkflowRun` (`/api/workflows/<pipeline>/subjects/<id>`): each stage's state as a word, when it ran and how long it took, a failed stage's error with Try again, and Approve on a waiting gate (the first is the view's filled button), saying who approved or that its policy did; `JobsTable` is the shared jobs page (`GET /api/jobs`): each job's state as a word with its progress or error, and Cancel or Run again only where they apply. Both take the app's generated `Schema<"WorkflowRun">` and `Schema<"Task">` as they come; `ScheduleTable` is a machine's scheduled jobs (systemd timers, cron), not the queue: each job's last result as a word (OK, Failed, Running, Never run), when it last ran and when it runs next, the last two dropping on a phone; `SystemPanel` is strata-python's `GET /api/system` (`useSystemInfo()` reads it): version and commit, uptime, each folder as a `Meter` on shared disk limits ("Filling up", "Nearly full") or the word Missing, each service Up or Down with the server's reason, and the app's own `facts`; `PauseButton` takes the `Poll` from `usePoll` (passed to `useLoad({ poll })`): a fixed-name "Pause updates" toggle and "Updated 12:00" |
194
194
  | Data | `DataView`, `Load<T>`, `Stale`, `StaleNotice`, `LoadError`, `EmptyState`, `Skeleton`, `Thumbnail`, `ThumbnailSkeleton`, `DataTable`, `TableSkeleton`, `VirtualList`, `InfiniteList`, `LoadMore`, `useInView`, `LineChart` | `DataView` requires skeleton and empty, keeps data on screen under a `StaleNotice` (why, how old, Try again) when a refresh fails, and takes an `error` renderer for an app's own look of a failed read (default `LoadError`, always inside an alert); `Thumbnail` is a remote image in a box of fixed `aspect`, with a skeleton while it loads, the required `missing` words (or a `fallback` drawing, such as an avatar's initial) when it fails or `src` is null, required `alt`, `children` overlaid in its corners, and a request only once it nears the screen (`eager` for the first few); tables, lists and tile grids virtualise from 100 rows, on React Aria's Virtualizer; a `DataTable` is a React Aria table (a `grid`) over TanStack Table's data model; a `DataTable` column with `value` sorts by type with missing values last both ways and draws a placeholder (`missing`, default an en dash); `InfiniteList` loads the next page on approach, with a skeleton for it, a Try again row when it fails and a Show more button for the keyboard, and `scroll="page"` draws a grid that scrolls with the page; `LoadMore` is that next-page row for any list or grid; charts label values directly; `LineChart` can also follow an app's position (`current`), read a value at the pointer or by arrow keys (`readout`, one slider whose value text is the reading), report a picked x (`onPick`) and fill one flat area (`area`); `xLabel` names the x column of its table `Thumbnail`'s `src` may be a list tried in order, `onLoad` can reject a picture that loaded (a host's grey placeholder) and `onMissing` is told once when none worked; with `alt=""` and a `fallback` its missing state is presentational. `LoadMore` and `InfiniteList` can draw the Show more and loading rows the app's way (`more`, `loading`, and `ruled={false}` for no hairlines).; a `DataTable` column's `hideBelow="sm"` hides its header and cells together on a narrow screen (CSS only; a virtualised table drops the column by a media query), never a hand-written `matchMedia` filter |
195
195
  | Compare | `Compare`, `PairVote`, `PairJudge`, `CompareAudio`, `CompareText`, `CompareGrid`, `CompareVideoGrid`, `ViewportFrame`, `useViewport`, `FullscreenFrame`, `useDifference`, `differences` | Two pictures judged together: side by side, swipe (a divider that moves from the keyboard), fade, blink (`x` flips) and difference (a live difference blend with amplify, or pixelmatch's changed pixels with a tolerance and the share that differ; pixels are read only when that view is open, at most 2048 px on the long side, and a picture the browser will not let the page read says so in words); `maxHeight="fit"` measures the window for the pair and its surroundings instead of the `"viewport"` guess; `CompareGrid` is every candidate at once with the same zoom and full screen, and `actions` for what a tile offers; one zoom and pan for both sides (buttons, `+` `-` `0`, Ctrl-wheel or trackpad pinch, drag, arrow keys, double click, `1:1`), and full screen (the browser's Fullscreen API, a modal where there is none). `blind` is required: a blind comparison names pictures by `label` only and never writes the variant `id`, `note` or `alt`. A picture that fails shows the required `missing` words in its place; the keys come from one `Shortcut[]` shared with `KeysLegend`, and `keys={false}` leaves them to a surrounding screen. `PairVote` wraps `Compare` for a blind pairwise judgment: answer keys `a` `b` `t` `s` in Compare's one legend, a vote bar with no filled button, `pending`, a flag menu, a progress line, preload and Undo, and click to choose (a click on the picture you prefer, not a drag or double click; in swipe the side of the divider, in blink the side showing, none in fade or difference; `onPick` on `Compare` and `CompareVideo`, `pick={false}` turns it off). `CompareAudio` is one transport for two clips with an A/B switch that keeps the playhead (same time, or the same share when the lengths differ), a loop range and loudness matching (the louder clip turned down to the quieter, by RMS); `CompareText` is two texts scrolled together with a word diff and an optional reference; `PairJudge` is the answering around any of them; `CompareVideo` is two videos on one clock (play, pause, seek and speed drive both, the follower kept within a frame, both held while either waits for data) in side by side, swipe, fade and blink, with zoom and pan locked and nearest-neighbour pixels past 1:1, candidates of different sizes drawn in one box, one soundtrack (`audio`), and the same slots as the rest. `autoPlay` starts the pair once both can play (muted; not with reduced motion unless `"always"`) and `loopWhole` loops the whole clip when no range is set (also on `CompareVideoGrid`). Frame by frame (`,` `.`), a loop range the app can hold (`i` `o` `c`), speeds down to 0.1 and named `moments` are in it; `CompareVideoGrid` is every candidate's video at once on that one clock (one transport, one zoom, regions, a loop, stepping), light on the browser (metadata only until the first play, cells out of sight paused and left out of the sync, sound off unless `audio` names a cell, a cell that falls behind marked "Catching up"), with an optional `reference` drawn first, never blind and nearest-neighbour. `regions` (on `Compare`, `CompareVideo` and `CompareGrid`) names boxes in the source's coordinates to look at enlarged: chips, keys `q` `w` `e` `r` `y` `u`, nearest-neighbour drawing, the box outlined while its chip is pointed at, and Shift-drag to make another |
196
196
  | Selection | `useSelection`, `useChoices`, `BulkBar`, `SelectableGrid`, `DataTable`'s `selection` (`RowSelection<T>`) | Opt-in checkbox column with "Select all shown" that respects `isSelectable`; Shift-click or Shift+Space chooses or clears the run from the last row clicked, in the order shown; `initial` (keys or a test on the row) chooses a row the first time it appears, so it applies to data that loads later; the selection drops rows that are gone; `BulkBar` announces the count politely, and while it is up its one filled action is the view's only one (the screen's primary goes to `outline`); `SelectableGrid` is the same selection as a grid of pictures (`renderImage`), each tile one labelled target, virtualised from 100 tiles; as a photo grid it takes a pixel `tileSize` zoomed by Ctrl/Cmd+wheel, `+` and `-` and two-finger pinch (`onTileSizeChange`), `aspect="natural"` (rows of equal height, each picture at its `naturalAspect`), a marquee from between tiles, `selectionMode` and `selectionBehavior` (`replace` is the Finder's rules; `onAction` opens), `groupBy` (sticky headings with a group box and a fold), a corner `badge`, `unselectableReason`, and counts what a filter hides ("3 chosen are hidden by the filter"); `ViewOptions` with `useViewOptions` is the one toolbar for how it is looked at: sort (natural order, direction named for the key), group, size slider, aspect, grid or list and a filter with its count, kept in `localStorage` and optionally `?sort=…&group=…&size=…`, a "View" popover on a phone. A choice can imply others: `implies(key)` (on `useSelection`, and `useChoices` for a lazy tree) keeps what the person chose apart from what that brings in, follows it through, locks the implied keys (they only clear with what implied them), and gives `implied`, `because(key)`, `counts`, a `note` for the live region and `summary(noun, then)`, the line a destructive confirm can carry ("12 results will be forgotten: 8 chosen, 4 that depend on them") |
@@ -212,13 +212,13 @@ thousands of lines. Such an app imports the same stylesheet **without the reset*
212
212
  | Overlays | `Dialog`, `DialogProps`, `AlertDialog`, `Popover`, `Tooltip` | React Aria underneath. A dialog always has a title and, via `actions`'s close render prop, a way out; `closable={false}` while work cannot stop; `placement="end"` is a sheet. `AlertDialog` is the only confirm: required verb on the confirm button, Cancel focused first, no outside dismiss, stays open with the reason when an async confirm fails. `Popover` needs a `label`. `Tooltip` opens on hover and focus and `IconButton` uses it. All portal onto the `layer-*` stacking utilities |
213
213
  | Value controls | `NumberField`, `Slider`, `ColorField`, `SecretField` | Set a number or colour precisely, inside `Field`. `NumberField` and `Slider` are React Aria's; the number field runs with `commitBehavior="validate"`, so a typed value outside `min`/`max` is kept on screen, explained in the `Field` ("Enter a value from 0% to 500%.") and never passed to `onChange`. A value that is not known is `null` and shows an en dash, never 0 or NaN. Digits and decimal mark follow `locale`. The unit sits inside the control, and in the slider's spoken value when `Intl` has it (%, °, ms, s, kB, MB, GB, kbps, Mbps). Arrows step, Home/End jump to the limits; `Slider editable` adds a number field. `ColorField`: platform picker, typed hex that is normalised, app suggestions, and a contrast note against `against`. No motion on value changes. `NumberField` options for a value set a little at a time or that costs work to change: `nudge={[0.1, 1, 10]}` (a toolbar of named step buttons that repeat when held and stop at the limits), `suggestion={{ value, label, reason }}` (a row with the reason in words and Use this value, never applied by itself) and `preview` (changes wait behind Apply and Revert; `onChange` is Apply's). `SecretField` is a credential the server keeps and never shows again: not set, set (no characters, no length, no input in the DOM), a masked entry with a Show toggle named for what it reveals, `onSave` through `AsyncButton`, Replace, a confirmed Remove that says what stops working, and a Test whose result is text beside it; a set, untouched field reports nothing |
214
214
  | Notices and progress | `Alert`, `toast`, `StrataToastRegion`, `useClientWork`, `JobStatus` | Three weights. A `toast` confirms finished work and goes by itself (5 s plus 40 ms a character, 8 s minimum with an action, paused under the pointer or focus, always dismissable); it has no danger tone, because an error a person must act on is an inline `Alert` with its recovery as `action` (`announce` makes it `role="alert"` only when it answers something the person just did). `StrataToastRegion` goes once at the app root. `useClientWork` runs browser work with progress, cancel (aborts its `signal`, ends `cancelled`, never `failed`) and a double-start guard; `JobStatus` shows it exactly as it shows a server job, with `onCancel`, `cancelled` and `onDismiss` |
215
- | Media player | `MediaPlayer`, `useMediaElement`, `SPEECH_RATES`, `useMediaSpans`, `SpanActions`, `PlayerNotice`, `SpanStrip` | Play a file or a sequence of chapters without the event glue: the element, its state, Strata's controls (or the browser's own on a touch device, `controls="auto"`), a load error with Try again, `navigator.mediaSession` metadata, the seek bar spanning the whole sequence. `useMediaElement(ref)` alone follows an element drawn with the browser's controls `spans` and `spanKinds` mark stretches (an intro, a recap, a sponsor read) on the seek bar as named ranges in a status role's tone and act on them as playback reaches them: `auto` skips (or mutes, for `action: "mute"`) with "Skipped intro" and Undo, `ask` offers a Skip button over the picture and on the `s` key, `off` only draws; each is acted on once, `onSpan` reports `skipped`, `muted`, `undone` or `played`, and `SeekBar` takes `spans` too. `mediaRef` hands out the player's state and requests (an object ref holds the latest, no render of its own), `overlay` draws the app's own thing over the picture only, `heading` (title, subtitle, avatar, each a link, with the app's router `state`) is drawn across the top of a video while paused or the pointer moves, and a video keeps a 16:9 (or `aspect`) box before its metadata loads. A video has a Full screen button and the `f` key by default (`fullscreen={false}` removes them); on the picture a click plays or pauses, a double click toggles full screen and the wheel sets the volume while the player has focus. A kind's `colour` names a custom property of the app's theme (`"--seg-sponsor"`) instead of a tone, each range carries `data-kind`, and under the browser's own controls a `SpanStrip` under the picture draws the ranges. `start` begins a first load at a time (an attacher's `startAt`, or a seek once the metadata is in) and says "Picked up at 2:05" with Start over (`resumeWords`); `onProgress` reports the position and the seconds actually played through, each once, a skipped span counted (`useMediaElement` takes it too, with `markWatched`). The HLS attacher starts a `growing` source at its beginning, honours `config.startPosition` and takes `words` for its failures. |
215
+ | Media player | `MediaPlayer`, `useMediaElement`, `SPEECH_RATES`, `useMediaSpans`, `SpanActions`, `PlayerNotice`, `SpanStrip`, `MediaContents` | Play a file or a sequence of chapters without the event glue: `marks` puts one file's own chapters on the seek bar, and `MediaContents` lists them beside the player (the playing one marked, pressing one plays from its start, never scrolling the page); the element, its state, Strata's controls (or the browser's own on a touch device, `controls="auto"`), a load error with Try again, `navigator.mediaSession` metadata, the seek bar spanning the whole sequence. `useMediaElement(ref)` alone follows an element drawn with the browser's controls `spans` and `spanKinds` mark stretches (an intro, a recap, a sponsor read) on the seek bar as named ranges in a status role's tone and act on them as playback reaches them: `auto` skips (or mutes, for `action: "mute"`) with "Skipped intro" and Undo, `ask` offers a Skip button over the picture and on the `s` key, `off` only draws; each is acted on once, `onSpan` reports `skipped`, `muted`, `undone` or `played`, and `SeekBar` takes `spans` too. `mediaRef` hands out the player's state and requests (an object ref holds the latest, no render of its own), `overlay` draws the app's own thing over the picture only, `heading` (title, subtitle, avatar, each a link, with the app's router `state`) is drawn across the top of a video while paused or the pointer moves, and a video keeps a 16:9 (or `aspect`) box before its metadata loads. A video has a Full screen button and the `f` key by default (`fullscreen={false}` removes them); on the picture a click plays or pauses, a double click toggles full screen and the wheel sets the volume while the player has focus. A kind's `colour` names a custom property of the app's theme (`"--seg-sponsor"`) instead of a tone, each range carries `data-kind`, and under the browser's own controls a `SpanStrip` under the picture draws the ranges. `start` begins a first load at a time (an attacher's `startAt`, or a seek once the metadata is in) and says "Picked up at 2:05" with Start over (`resumeWords`); `onProgress` reports the position and the seconds actually played through, each once, a skipped span counted (`useMediaElement` takes it too, with `markWatched`). The HLS attacher starts a `growing` source at its beginning, honours `config.startPosition` and takes `words` for its failures. |
216
216
  | Media playback | `Transport`, `SeekBar`, `TimeReadout`, `VolumeControl`, `RateChoice`, `MediaStage`, `StageGuides`, `transportShortcuts`, `format.timecode` | The controls around anything that plays, wired to a player the app owns (HTML media, Web Audio, a canvas, a data replay). Every control is a named icon button in one toolbar; the play button's name is "Play" or "Pause". `SeekBar` has the formatted time as its accessible value, arrows step 5 s and Page keys 30 s by default, and optional marks. `VolumeControl` shows its percent, and muting remembers the level. `transportShortcuts` is the one list for `useHotkeys` and `KeysLegend` (Space and K, J and L, the arrows by a frame, Home and End). `format.timecode` prints m:ss, m:ss.mmm or m:ss:ff. `MediaStage` fits a picture of any aspect ratio into the pane with a letterbox on the sunken surface role, and takes overlays such as `StageGuides` |
217
217
  | Listening and reading | `Waveform`, `TranscriptView`, `PlayWindowButton`, `MediaGroup`, `FilmStrip`; `resamplePeaks`, `peaksFromAudio`, `peakGain`, `phraseAt`, `wordAt`, `pickEvenly`, `frameAt` | Timed media: a waveform from peaks or a decoded file (one slider, marks by line style, named spans, zoom, a keyboard-made range, a spectrogram underlay, `normalise` to draw quiet sound to fill the height and say by how much); `FilmStrip` is a row of frames from a stretch of video that fits its width (picked evenly), each with its time, pressing one seeks (`onSeek`, one tab stop with arrow keys), and the frame at `time` inside `span` is ringed; timed text that marks the heard word and plays from any word (modes, speakers, follow and Jump to now, virtualised), with doubtful words (dotted, named, counted, "Only doubtful"), a mark per phrase set from a row menu (`states`, `onPhraseState`), correction in place (Enter or F2, `onEdit`) and a hover and focus card (`renderCard`); `MediaPlayer window` plays one stretch of a file, `MediaGroup` lets one player play at a time, `PlayWindowButton` is a row's play control on a shared element; a review transcript needs no player (`time` and `onSeek` are optional), takes `marking` (words become `MarkableText` marks with ids `wordId(phraseId, index)`, selected across rows that are not mounted) and shows a corrected word (`word.correction`) dotted with the original on hover and `onCorrectionPress` to open it |
218
218
  | Streams | `MediaPlayer attach`/`growing`, `useAttachedSource`, `attachHls` (`strata-react/hls`) | A source the element cannot play is attached by an engine; a source still being made says so, shows what exists as ready, and waits at its end without ending |
219
219
  | 360 | `PanoramaViewer` (`strata-react/panorama`), `project`, `unproject`, `describeView` | A 360 picture or video as a controlled window (yaw, pitch, field of view), drag, wheel, pinch and keys, an overlay in the picture's coordinates, said in words, a flat fallback with no WebGL2 |
220
220
  | Conversation | `Conversation`, `Composer`, `RichText`; `matchEntities`, `parseRichText` | A question-and-answer thread: answers stream, finish or fail in place (Try again), one polite announcement per finished answer, following only while at the bottom (Jump to latest); answers can carry pictures (`images`, labelled, lazy, linked to full size) that stay visible beside the collapsed "looked up"; a composer that sends on Enter and is disabled with its reason while answering (Stop); a safe text subset (bold, code, lists, http links, never HTML) whose known ids, longest first and whole words only, become buttons |
221
- | Pictures from a set | `Lightbox` (`useLightboxUrl`), `BookViewer` (`useBookUrl`), `TileGrid`, `BoxOverlay`/`BoxList`/`useBoxes`, `RegionEditor`; `moveRect`, `resizeRect`, `lerpRect`, `turnedSize`, `turnRect`, `readingOrder`, `zoomToBox`, `findPage` | A picture opened from a grid in a full-size `Dialog` (previous/next, arrow keys, "3 of 40" or a position like "Page 22 (12) of 44", zoom and 1:1, details beside it, an overlay and actions for the item, a thumbnail strip, `?view=` in the URL, neighbours preloaded, a `missing` sentence, Compare ticked hand-off); a scanned book read inline as spreads or single pages with printed and scan names, go-to, `?page=` and a strip with badges; a grid of picture tiles that link (`TileGrid`, with `TileGridSkeleton`); read-only boxes on a picture linked to a list beside it; `RegionEditor` also turns the picture by an angle (the windows turn with it) and edits a spread's gutter; named windows drawn and moved on a picture by pointer, keys and numbers, with aspect and bounds held, and a from/to move with a Watch preview |
221
+ | Pictures from a set | `Lightbox` (`useLightboxUrl`), `BookViewer` (`useBookUrl`), `TileGrid`, `BoxOverlay`/`BoxList`/`useBoxes`, `BoxedPicture`, `RegionEditor`; `regionStyle`, `moveRect`, `resizeRect`, `lerpRect`, `turnedSize`, `turnRect`, `readingOrder`, `zoomToBox`, `findPage` | A picture opened from a grid in a full-size `Dialog` (previous/next, arrow keys, "3 of 40" or a position like "Page 22 (12) of 44", zoom and 1:1, details beside it, an overlay and actions for the item, a thumbnail strip, `?view=` in the URL, neighbours preloaded, a `missing` sentence, Compare ticked hand-off); a scanned book read inline as spreads or single pages with printed and scan names, go-to, `?page=` and a strip with badges; a grid of picture tiles that link (`TileGrid`, with `TileGridSkeleton`); read-only boxes on a picture linked to a list beside it, and the picture opened zoomed to one of them (a face in its photo, `BoxedPicture`); one box of a picture shown on its own in a `Thumbnail` (`region`); `RegionEditor` also turns the picture by an angle (the windows turn with it) and edits a spread's gutter; named windows drawn and moved on a picture by pointer, keys and numbers, with aspect and bounds held, and a from/to move with a Watch preview |
222
222
  | Sequences | `SequenceTimeline`; `snapToGrid`, `stepOnGrid`, `settleCut` | A gapless strip of windows whose cuts are sliders: dragged or stepped along a beat grid inside the room the app gives, the refusal said in words, both windows' new lengths announced; Shift+click chooses a run |
223
223
  | Browsing | `Tree`, `FolderPicker` | A hierarchy that loads as it opens (`current` + `onCurrentChange` is the row in view beside the ticked ones, `count` and `badge` per row, `sortChildren`, `reveal` of a deep link, `resolveBranch` so ticking a year says "2019 and its 91 folders" without opening them; a hook per open node; skeleton, Try again and empty rows; always virtualised); `choices` (from `useChoices`) chooses several: a checkbox per row, Shift ranges, a parent drawn mixed from what has loaded under it (ticking a branch never opened reads and opens it and chooses everything under it), "Select all shown", and rows the choice implies marked "Included because of …" in words and a server folder chooser on it: breadcrumb that is also editable text, Up, recents, New folder with the server's refusal on the field, Choose this folder; a `Folder` may carry a `badge` and `tone` ("project", as words), `canChoose` gives the reason the button is disabled beside it, `chooseLabel` names it, `onOpen` can answer `"choose"` to take a folder at once instead of entering it, and the listing may return a `footer` under the tree |
224
224
  | Marking text | `MarkableText`, `Mark`, `MarkSummary`; `rangeBetween` | Select words by drag, Shift+click and Shift+arrows (ids in document order, so it holds across virtualised rows), apply the app's marks from a bar or single-key chords, marks drawn by role, pattern and text, summarised and announced |
@@ -26,9 +26,11 @@ export type BoxOverlayProps = {
26
26
  state: BoxesState;
27
27
  /** A box was chosen (a click, Enter or Space): zoom to it, scroll a text pane. The state already holds it. */
28
28
  onChoose?: (box: PictureBox) => void;
29
+ /** Fill the pointed or chosen box with its tone's subtle colour. Default `true` (a line of text stays readable under it); `false` for what the box is about to be looked at, such as a face, which only a heavier outline marks. */
30
+ fillLit?: boolean;
29
31
  };
30
32
  /** Read-only boxes drawn as one SVG layer over a picture, inside `ViewportFrame` so they zoom with it: outline by tone, hover and choice shared with a `BoxList`, one tab stop with arrows in reading order. */
31
- export declare function BoxOverlay({ label, of, boxes, state, onChoose }: BoxOverlayProps): React.JSX.Element;
33
+ export declare function BoxOverlay({ label, of, boxes, state, onChoose, fillLit }: BoxOverlayProps): React.JSX.Element;
32
34
  export type BoxListProps = {
33
35
  /** Names the list: "Lines on this page". */
34
36
  label: string;
@@ -0,0 +1,34 @@
1
+ import { BoxesState } from './box-overlay';
2
+ import { PictureBox } from '../lib/boxes';
3
+ import * as React from "react";
4
+ export type BoxedPictureProps = {
5
+ /** Names the frame: "Photo 2026-03-14 09:12". */
6
+ label: string;
7
+ /** The picture; `null` when there is none (the boxes still show, on the `missing` words). */
8
+ src: string | readonly string[] | null;
9
+ /** What the picture shows, or `""` when `label` says it. */
10
+ alt: string;
11
+ /** The words when the picture cannot be shown: "Photo not kept". */
12
+ missing: string;
13
+ /** The picture's size in pixels; the boxes are in these units. */
14
+ of: {
15
+ w: number;
16
+ h: number;
17
+ };
18
+ boxes: readonly PictureBox[];
19
+ /** From `useBoxes`, shared with a `BoxList` if there is one; its `active` box is the one opened on. */
20
+ state: BoxesState;
21
+ /** Names the layer of boxes: "Faces in this photo". */
22
+ boxesLabel: string;
23
+ /** Zoom to the chosen box when it is chosen and when the picture opens on one. Default `true`. */
24
+ zoom?: boolean;
25
+ /** How much of the box's size to leave around it when zoomed, on every side. Default 0.75 (a face with its hair, shoulders and something of who is beside it). */
26
+ margin?: number;
27
+ /** The tallest the frame may be, as a CSS length. Default `"70svh"`. */
28
+ maxHeight?: string;
29
+ /** A box was chosen in the picture. */
30
+ onChoose?: (box: PictureBox) => void;
31
+ className?: string;
32
+ };
33
+ /** A picture with its boxes drawn on it, opened zoomed to the chosen one (a face in its photo): `ViewportFrame` + `BoxOverlay` + `zoomToBox`, with the picture's missing state. Pair it with a `BoxList` through one `useBoxes`. */
34
+ export declare function BoxedPicture({ label, src, alt, missing, of, boxes, state, boxesLabel, zoom, margin, maxHeight, onChoose, className }: BoxedPictureProps): React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ /** One stretch of the file: its id, title, span in seconds, and an optional line under the title. */
3
+ export type MediaContentsItem = {
4
+ id: string;
5
+ title: string;
6
+ start: number;
7
+ end: number;
8
+ /** Under the title: "3 scenes", "Grandma, the children". */
9
+ detail?: React.ReactNode;
10
+ };
11
+ /** The media contents' props. */
12
+ export type MediaContentsProps = {
13
+ /** Names the list: "Chapters of the tape". */
14
+ label: string;
15
+ /** The stretches in order. */
16
+ items: readonly MediaContentsItem[];
17
+ /** The playhead, seconds: the item holding it is marked current. */
18
+ time?: number;
19
+ /** Plays from a time (an item's start). */
20
+ onSeek: (time: number) => void;
21
+ /** Told which item was pressed, after `onSeek`, for an app that brings its own section into view. */
22
+ onSelect?: (id: string) => void;
23
+ className?: string;
24
+ };
25
+ /** The index of the item whose span holds `time`, or -1. */
26
+ export declare function currentItem(items: readonly Pick<MediaContentsItem, "start" | "end">[], time: number | undefined): number;
27
+ /** One media file's chapters as a list of contents beside its player: the one playing marked, and pressing one plays from its start. */
28
+ export declare function MediaContents({ label, items, time, onSeek, onSelect, className }: MediaContentsProps): React.JSX.Element;
@@ -202,6 +202,11 @@ export type MediaPlayerProps = {
202
202
  spans?: readonly MediaSpanData[];
203
203
  /** For each kind of span: its `label`, its `tone` (a status role) and what happens on reaching one: `"auto"` skips it (or mutes it, for a span whose `action` is `"mute"`) with "Skipped intro" and Undo, `"ask"` offers a Skip button over the picture (and the `s` key), `"off"` (default) only draws it. Keep the object stable (state or `useMemo`). */
204
204
  spanKinds?: Readonly<Record<string, SpanKind>>;
205
+ /** Named points of one file drawn on the seek bar (its chapters: "Christmas dinner" at 40:12); pressing one seeks there (strata-react issue #371). For a single `src` without a `window`: a sequence's own marks (each source's start) and a window's take their place. Keep the array stable. */
206
+ marks?: readonly {
207
+ time: number;
208
+ label: string;
209
+ }[];
205
210
  /** Told what was done with a span: `skipped`, `muted`, `undone` or `played`. */
206
211
  onSpan?: (span: MediaSpanData, what: SpanOutcome) => void;
207
212
  /** The Skip button's and the notice's words, in the product's language. */
@@ -239,4 +244,4 @@ export declare const SPEECH_RATES: readonly number[];
239
244
  * a touch device), with the failure to load shown and retried. For an editor or a replay, use the
240
245
  * parts and `useMediaElement` directly.
241
246
  */
242
- export declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, onSpan, spanWords, start, resumeWords, onProgress, progressEvery, mediaRef, heading, overlay, status, warning, aspect, fullscreen, className, }: MediaPlayerProps): React.JSX.Element;
247
+ export declare function MediaPlayer({ label, kind, src, sources, index: controlledIndex, onIndexChange, autoAdvance, controls, autoPlay, poster, session, rates, shortcuts, attach, growing, window: bound, loop, showFull, group, onTimeUpdate, onWindowEnd, onEnded, onTimeChange, spans, spanKinds, marks, onSpan, spanWords, start, resumeWords, onProgress, progressEvery, mediaRef, heading, overlay, status, warning, aspect, fullscreen, className, }: MediaPlayerProps): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { PictureRegion } from '../lib/boxes';
1
2
  import * as React from "react";
2
3
  /** Forgets which pictures `Thumbnail` has loaded, so a test that checks the loading state starts from nothing. `renderWithStrata` and `renderRoutes` call it. */
3
4
  export declare function forgetLoadedThumbnails(): void;
@@ -25,6 +26,8 @@ export type ThumbnailProps = {
25
26
  onLoad?: (image: HTMLImageElement, index: number) => boolean | void;
26
27
  /** Called once when the thumbnail ends in its missing state after a request failed or was rejected, never for a record with no source. */
27
28
  onMissing?: () => void;
29
+ /** Show one box of the picture, filling the thumbnail (a face from a photo): the picture's size, the box in its pixels and `pad`, how many times the box the crop is (default 1.6). `fit` does not apply. */
30
+ region?: PictureRegion;
28
31
  /** Overlays drawn above the image in the same box (a running time, a "Saved" badge), in place whether the image has loaded, failed or is missing. */
29
32
  children?: React.ReactNode;
30
33
  } & ({
@@ -39,7 +42,7 @@ export type ThumbnailProps = {
39
42
  fallback: React.ReactNode;
40
43
  });
41
44
  /** A box of fixed aspect ratio for a remote image: a skeleton until it loads, the `missing` words (or a `fallback`) if it cannot, a request only when it nears the screen, and `children` overlaid in its corners. `alt` and `missing` or `fallback` are required. */
42
- export declare function Thumbnail({ src, alt, missing, aspect, fit, srcSet, sizes, eager, rootMargin, className, fallback, onLoad, onMissing, children, }: ThumbnailProps): React.JSX.Element;
45
+ export declare function Thumbnail({ src, alt, missing, aspect, fit, srcSet, sizes, eager, rootMargin, className, fallback, onLoad, onMissing, region, children, }: ThumbnailProps): React.JSX.Element;
43
46
  /** The loading shape of a `Thumbnail`, for a `DataView` skeleton: the same box and aspect ratio, so nothing moves when the list arrives. */
44
47
  export declare function ThumbnailSkeleton({ aspect, className }: {
45
48
  aspect?: AspectRatio;
@@ -34,3 +34,38 @@ export type WorkflowStepsProps<S extends WorkflowStage> = {
34
34
  };
35
35
  /** A subject's stages through a strata-python pipeline, each with its state as a word, when it last ran, its error, and Approve on a waiting gate or Try again on a failed stage. */
36
36
  export declare function WorkflowSteps<S extends WorkflowStage>({ label, stages, onApprove, onRetry, words, now, className }: WorkflowStepsProps<S>): import('react').JSX.Element;
37
+ /** A whole run's state, for a list of subjects: a stage state that matters, or one of the run's own. */
38
+ export type WorkflowSummaryState = "running" | "failed" | "waiting" | "stale" | "done" | "partial" | "ready";
39
+ /** A run in a few words' worth of data: its state, the stage it is about, and how many stages are done of how many. */
40
+ export type WorkflowSummaryData<S extends WorkflowStage = WorkflowStage> = {
41
+ state: WorkflowSummaryState;
42
+ /** The stage the state is about: the one running or next, the failed one, the waiting gate, the stale one. */
43
+ stage?: S;
44
+ /** That stage's place, from 1. */
45
+ step?: number;
46
+ done: number;
47
+ total: number;
48
+ };
49
+ /** Reduces a run's stages to one state and the stage it is about. `running`: its job is queued or running. */
50
+ export declare function summariseWorkflow<S extends WorkflowStage>(stages: readonly S[], { running }?: {
51
+ running?: boolean;
52
+ }): WorkflowSummaryData<S>;
53
+ /** The summary's words: the stage words `WorkflowSteps` uses, and the run's own two. */
54
+ export type WorkflowSummaryWords = StageWords & {
55
+ running?: string;
56
+ partial?: string;
57
+ };
58
+ /** The sentence beside the word: which stage, and how far through. */
59
+ export declare function describeWorkflowSummary(s: WorkflowSummaryData): string | null;
60
+ /** The workflow summary's props. */
61
+ export type WorkflowSummaryProps = {
62
+ /** The run's stages: `WorkflowRun.stages`. */
63
+ stages: readonly WorkflowStage[];
64
+ /** Its job is queued or running (`WorkflowRun.job` in a state that has not ended). */
65
+ running?: boolean;
66
+ /** Renames the words. */
67
+ words?: WorkflowSummaryWords;
68
+ className?: string;
69
+ };
70
+ /** A subject's run through a strata-python pipeline in a few words, for a list of subjects: running (on which step), failed (which), waiting for review (which gate), out of date, part done, or done. */
71
+ export declare function WorkflowSummary({ stages, running, words, className }: WorkflowSummaryProps): import('react').JSX.Element;
package/dist/index.d.ts CHANGED
@@ -38,11 +38,13 @@ export { toast, toastTimeout, StrataToastRegion, type ToastContentProps, type St
38
38
  export { useClientWork, type ClientWork, type WorkContext, type WorkPhase } from './lib/client-work';
39
39
  export { JobStatus, jobProgressText, type JobStatusProps, type JobFailure, type JobProgress, type JobWords } from './components/job-status';
40
40
  export { useJobAction, type JobAction, type JobActionOptions } from './components/job-action';
41
+ export { WorkflowSummary, summariseWorkflow, describeWorkflowSummary, type WorkflowSummaryProps, type WorkflowSummaryData, type WorkflowSummaryState, type WorkflowSummaryWords } from './components/workflow-steps';
41
42
  export { WorkflowSteps, type WorkflowStepsProps, type WorkflowStage, type StageState, type StageWords } from './components/workflow-steps';
42
43
  export { JobsTable, type JobsTableProps, type JobRow } from './components/jobs-table';
43
44
  export { ScheduleTable, type ScheduleTableProps, type ScheduleRow } from './components/schedule-table';
44
45
  export { Thumbnail, ThumbnailSkeleton, type ThumbnailProps, type AspectRatio } from './components/thumbnail';
45
46
  export { FilmStrip, pickEvenly, frameAt, type FilmStripProps, type FilmFrame } from './components/film-strip';
47
+ export { MediaContents, currentItem, type MediaContentsProps, type MediaContentsItem } from './components/media-contents';
46
48
  export { DataTable, TableSkeleton, parseSort, serialiseSort, type CellValue, type Column, type Sort, type DataTableProps, type RowSelection, type RowExpansion, } from './components/data-table';
47
49
  export { MediaPlayer, useMediaElement, useAttachedSource, SPEECH_RATES, type MediaPlayerProps, type MediaElementState, type MediaElementOptions, type MediaWindow, type StreamContext, type StreamAttachment, type SourceAttacher, type MediaProblem, type MediaSource, type MediaSession, type MediaHeading, type MediaProgress, type ResumeWords } from './components/media-player';
48
50
  export { useMediaSpans, SpanActions, PlayerNotice, type SpanActionsNotice, type MediaSpanData, type SpanKind, type SpanBehaviour, type SpanOutcome, type SpanWords, type MediaSpansState } from './components/media-spans';
@@ -120,8 +122,9 @@ export { Lightbox, useLightboxUrl, type LightboxProps, type LightboxItem, type L
120
122
  export { RegionEditor, describeRegion, type RegionEditorProps, type EditableRegion, type RegionTone } from './components/region-editor';
121
123
  export { BookViewer, useBookUrl, type BookPage, type BookUrl, type BookViewerProps } from './components/book-viewer';
122
124
  export { findPage, pageName, sayPosition, viewOf, viewsOf, type PageNames } from './lib/book';
125
+ export { BoxedPicture, type BoxedPictureProps } from './components/boxed-picture';
123
126
  export { BoxOverlay, BoxList, useBoxes, type BoxOverlayProps, type BoxListProps, type BoxesState, type BoxSource } from './components/box-overlay';
124
- export { readingOrder, zoomToBox, type PictureBox, type BoxTone } from './lib/boxes';
127
+ export { readingOrder, zoomToBox, regionStyle, type PictureBox, type BoxTone, type PictureRegion } from './lib/boxes';
125
128
  export { moveRect, resizeRect, fitRect, drawRect, lerpRect, ease, turnedSize, turnRect, normaliseAngle, splitRect, joinRects, gutterOf, moveGutter, type Rect, type Handle, type RectLimits, type Easing } from './lib/region';
126
129
  export { SequenceTimeline, type SequenceTimelineProps, type SequenceItem, type CutRoom, type CutChange } from './components/sequence-timeline';
127
130
  export { snapToGrid, stepOnGrid, gridPoints, clampToRoom, settleCut, type Grid, type CutLimit } from './lib/sequence';