strata-react 1.0.38 → 1.0.40
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 +4 -4
- package/UPGRADING.md +5 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/checkbox.d.ts +3 -2
- package/dist/components/secret-field.d.ts +34 -0
- package/dist/components/selection.d.ts +45 -1
- package/dist/components/transcript-view.d.ts +18 -2
- package/dist/components/tree.d.ts +16 -6
- package/dist/components/value-controls.d.ts +20 -4
- package/dist/{query-CJ1pSPiC.js → errors-BunUBqpA.js} +5 -176
- package/dist/errors-BunUBqpA.js.map +1 -0
- package/dist/{field-7Z4N5r5g.js → field-DeKNvGox.js} +74 -5
- package/dist/field-DeKNvGox.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +735 -327
- package/dist/index.js.map +1 -1
- package/dist/lib/choice.d.ts +29 -0
- package/dist/lib/transcript.d.ts +16 -0
- package/dist/map.js +2 -2
- package/dist/panorama.js +2 -2
- package/dist/query-D163gXXZ.js +178 -0
- package/dist/query-D163gXXZ.js.map +1 -0
- package/dist/{run-DzyLrZlA.js → run-DEf1Vh0x.js} +10 -6
- package/dist/run-DEf1Vh0x.js.map +1 -0
- package/dist/testing.js +2 -2
- package/dist/{theme-CFNi6WUO.js → theme-DVaIxyNn.js} +6 -75
- package/dist/theme-DVaIxyNn.js.map +1 -0
- package/dist/value-controls-FO4zQiHP.js +735 -0
- package/dist/value-controls-FO4zQiHP.js.map +1 -0
- package/dist/visual-cli.js +1 -1
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/field-7Z4N5r5g.js.map +0 -1
- package/dist/query-CJ1pSPiC.js.map +0 -1
- package/dist/run-DzyLrZlA.js.map +0 -1
- package/dist/theme-CFNi6WUO.js.map +0 -1
- package/dist/value-controls-D6O9TsM6.js +0 -356
- package/dist/value-controls-D6O9TsM6.js.map +0 -1
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ strata-react is ESM-only (`exports` has only `import`), as is its peer `react-ro
|
|
|
130
130
|
| Status and figures | `Status`, `Metric`, `MetricStrip`, `Meter`, `crossedThreshold`, `CompositionBar` | 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: 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 |
|
|
131
131
|
| 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). |
|
|
132
132
|
| 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); `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 |
|
|
133
|
-
| Selection | `useSelection`, `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 |
|
|
133
|
+
| 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. 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") |
|
|
134
134
|
| Expansion | `Disclosure`, `useExpanded`, `DataTable`'s `expansion` (`RowExpansion<T>`) | Show more of one row in place. The toggle is a button with `aria-expanded`; the body is mounted only while open, so a request inside it runs on first open (unlike `<details>`, which mounts every closed body); `useExpanded({ param })` shares the open keys across a list or table and keeps them in the URL; a table's detail row spans the data columns and is measured when virtualised |
|
|
135
135
|
| Data loading | `StrataQueryProvider`, `createQueryClient`, `useLoad`, `useInfiniteLoad`, `useJob`, `toLoad`, `staleOf`, `fetchJson`, `HttpError`, `readErrorBody`, `fieldErrorsOf` | TanStack Query in, `Load<T>` out; a refetch that fails after a good read stays `ready` with `stale` set, never an error panel; `useInfiniteLoad` works out the cursor itself (after the last item held), merges pages by key and can `dismiss` an item at once; `useJob` polls a job's status only while it runs and invalidates the queries it changes once, when it ends; `fetchJson` reads an error response's body onto the `HttpError` (`body`, `reason`, `fieldErrors`, read by `readErrorBody` or the API's own `readError`) |
|
|
136
136
|
| Page and navigation | `AppShell`, `SideNav`, `Breadcrumb`, `Tabs`, `PageHeader`, `LinkCard`, `LinkCardList` | React Router; tab and sort state in the URL; a `LinkCard` is one link named by its title, described by its text and `Status` marks, with the whole card as the target (`to` a route, `href` elsewhere, marked with an arrow) |
|
|
@@ -142,17 +142,17 @@ strata-react is ESM-only (`exports` has only `import`), as is its peer `react-ro
|
|
|
142
142
|
| Toolbar and toggles | `Toolbar`, `ToolbarSeparator`, `Toggle`, `ToggleGroup`, `Switch` | A toolbar is one tab stop with arrows, Home and End inside; needs a `label`. `Toggle` (`aria-pressed`) and `ToggleGroup` (one of 2 to 7, always one chosen) show chosen as an ink border on a tint, never the filled primary, so they do not break the one-filled-button rule; an icon-only toggle still needs its `label` (shown as a tooltip). `Switch` is only for a setting that applies at once, label and control one target |
|
|
143
143
|
| Commands | `Command`, `useCommands`, `Menu`, `ContextMenu`, `CommandMenu`, `CommandLegend`, `formatChord`, `matchesChord` | A command is declared once (label or label function, chords, `disabled` with a reason, `destructive`, `checked`) and drives the key handler, dropdown and menu-bar menus, the context menu, the searchable command menu (Mod+K) and the legend, so they cannot disagree. Chords are written once ("Mod+Shift+Z") and shown per platform (⇧⌘Z, Ctrl+Shift+Z); they never fire while typing or during IME composition, and a chord the browser keeps (Ctrl+S) needs `claim: true`. `useHotkeys` is unchanged for single keys |
|
|
144
144
|
| 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 |
|
|
145
|
-
| Value controls | `NumberField`, `Slider`, `ColorField` | 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 |
|
|
145
|
+
| 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 |
|
|
146
146
|
| 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` |
|
|
147
147
|
| Media player | `MediaPlayer`, `useMediaElement`, `SPEECH_RATES`, `useMediaSpans`, `SpanActions` | 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, and a video keeps a 16:9 (or `aspect`) box before its metadata loads. The HLS attacher starts a `growing` source at its beginning, honours `config.startPosition` and takes `words` for its failures. |
|
|
148
148
|
| 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` |
|
|
149
|
-
| Listening and reading | `Waveform`, `TranscriptView`, `PlayWindowButton`, `MediaGroup`; `resamplePeaks`, `peaksFromAudio`, `phraseAt`, `wordAt` | 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); timed text that marks the heard word and plays from any word (modes, speakers, follow and Jump to now, virtualised); `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 |
|
|
149
|
+
| Listening and reading | `Waveform`, `TranscriptView`, `PlayWindowButton`, `MediaGroup`; `resamplePeaks`, `peaksFromAudio`, `phraseAt`, `wordAt` | 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); 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 |
|
|
150
150
|
| 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 |
|
|
151
151
|
| 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 |
|
|
152
152
|
| 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); 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 |
|
|
153
153
|
| Pictures from a set | `Lightbox`, `RegionEditor`; `moveRect`, `resizeRect`, `lerpRect` | A picture opened from a grid in a full-size `Dialog` (previous/next, arrow keys, "3 of 40", zoom and 1:1, details beside it, neighbours preloaded, a `missing` sentence, Compare ticked hand-off); 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 |
|
|
154
154
|
| 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 |
|
|
155
|
-
| Browsing | `Tree`, `FolderPicker` | A hierarchy that loads as it opens (a hook per open node; skeleton, Try again and empty rows; always virtualised) 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 |
|
|
155
|
+
| Browsing | `Tree`, `FolderPicker` | A hierarchy that loads as it opens (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 |
|
|
156
156
|
| 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 |
|
|
157
157
|
| Maps | `strata-react/map`: `RouteMap`; `geo`, `LatLng` (main entry) | Routes and a position that moves along them, on Leaflet (no react-leaflet), behind its own entry. Tiles are the app's (`tiles.light`, `tiles.dark`, each with its attribution); the dark scheme uses the dark set or a filter over the light one. Route colours are roles resolved at draw time; `values` with `colourScale` colour a route by value in runs of one step, with a key that names the steps; a single route gets direction chevrons and start/finish marks (a loop is one mark). The position is one marker moved with `setLatLng`: no route is redrawn for it (keep `routes` stable). As picture content (a route inset over footage): `zoom` sets any zoom (animate it per frame), `follow="centre"` holds the view exactly on a position with no animation (a frame is deterministic), and `positions` draws several, each tied to a route, in its colour and named in the text alternative; routes are not redrawn for any of it. Leaflet's keyboard pan and zoom stay; the map is named by `label` and described by a generated text alternative (routes, lengths, position along). Overlay slots `topEnd` and `bottomStart` avoid Leaflet's own controls and attribution. Leaflet's stylesheet is injected once, so an app imports nothing. `geo` (distance, bearing, bounds, `pointAlong`, `arrows`, `ends`) and `format.distance` need no map library |
|
|
158
158
|
| Timeline | `Timeline`, `useTimelineZoom`, `TimelineZoomControls`, `noOverlap` | Items with a start and a length in lanes on a zoomable time axis, for media edits, bookings, rotas and plans. The timeline draws and the app decides: every move, trim, lane change, selection and current-time change is reported (`onItemChange`, `onSelect`, `onPositionChange`) and the app applies it; `validate` refuses a change with a reason shown in words while it is made. One tab stop for the items; arrows move between them, Ctrl+arrows nudge and change lane, Alt+arrows trim, the current time is its own slider, `+` `-` `0` zoom, and each change is announced ("run-02.mp4 moved to 0:13"). The ruler picks steps people write on a scale so labels never collide. Lanes take drops from outside (`dropTypes`, `onDrop` with the lane and snapped time, `validateDrop`, and React Aria's keyboard drag landing at the current time), `laneRows` makes them taller, `kindColours` fixes each kind's stripe, and the header column fits its content. Only items near the view are rendered |
|
package/UPGRADING.md
CHANGED
|
@@ -11,6 +11,11 @@ time. While the version is 0.x, any release may break.
|
|
|
11
11
|
|
|
12
12
|
Every PR that changes what an app sees adds a line here (see `CLAUDE.md`, "Changelog").
|
|
13
13
|
|
|
14
|
+
## After v1.0.39 (2026-11-13)
|
|
15
|
+
|
|
16
|
+
- `Tree`'s props are now a union: give `selected` and `onSelect` (one chosen node) or `choices` from `useChoices` (several). Code that passed `selected` and `onSelect` compiles as before.
|
|
17
|
+
- `useSelection`'s `selected` includes keys implied by `implies` only when you pass `implies`; without it nothing changes. `NumberField`'s `onChange` may now return a promise (only `preview` mode awaits it). A transcript with `onEdit`, `renderCard` or `states` set draws a menu, an edit box and a card; one without them is unchanged, and the extra summary line and "Only doubtful" toggle appear only when a word is doubtful or a phrase has a `state`.
|
|
18
|
+
|
|
14
19
|
## After v0.1.17 (2026-11-11 to 2026-11-12)
|
|
15
20
|
|
|
16
21
|
- `RouteMap` now always has a tile under the last pixel column of the map (Leaflet could leave one bare, depending on the path the view took). A `RouteMap` baseline in a centred follow may gain one column of tile at the right edge.
|
|
@@ -11,6 +11,9 @@ export type ButtonProps = Omit<React.ComponentProps<"button">, "className" | "st
|
|
|
11
11
|
className?: string;
|
|
12
12
|
/** React Aria's press event (mouse, touch, pen and keyboard alike). `onClick` also works. */
|
|
13
13
|
onPress?: (event: PressEvent) => void;
|
|
14
|
+
/** When a press begins and ends: for a control that acts while held (a nudge that repeats). */
|
|
15
|
+
onPressStart?: (event: PressEvent) => void;
|
|
16
|
+
onPressEnd?: (event: PressEvent) => void;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
16
19
|
* A button with shadcn's variant names, built on React Aria's `Button` (press handling that behaves
|
|
@@ -31,8 +31,9 @@ export declare function useShiftNote(): {
|
|
|
31
31
|
* fight the table's own selection state. Not exported from the package: `DataTable` uses it.
|
|
32
32
|
* @internal
|
|
33
33
|
*/
|
|
34
|
-
export declare function TableSelectionCheckbox({ label, className, disabled }: {
|
|
34
|
+
export declare function TableSelectionCheckbox({ label, className, disabled, mixed }: {
|
|
35
35
|
label: string;
|
|
36
36
|
className?: string;
|
|
37
|
-
disabled?: boolean;
|
|
37
|
+
disabled?: boolean; /** Drawn mixed (a tree branch with some of its rows chosen); the surface decides, as React Aria has no parent-child rule. */
|
|
38
|
+
mixed?: boolean;
|
|
38
39
|
}): React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** What a `test` callback returns: the key works, or why it does not. */
|
|
3
|
+
export type SecretTestResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
message?: string;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
/** Props for `SecretField`. */
|
|
11
|
+
export type SecretFieldProps = {
|
|
12
|
+
/** What the secret is, singular, lower case or a name: "API key". Names the toggle, the buttons and the dialog. */
|
|
13
|
+
noun: string;
|
|
14
|
+
/** Whether the server holds one. Never the value. */
|
|
15
|
+
isSet: boolean;
|
|
16
|
+
/** When it was set, if the app knows: shown as "Set 12 Nov, 14:02". */
|
|
17
|
+
setAt?: Date | string | number | null;
|
|
18
|
+
/** The typed or pasted value, or `null` when nothing is being entered (cancelled, emptied). Not called while a set field is untouched. */
|
|
19
|
+
onChange?: (value: string | null) => void;
|
|
20
|
+
/** Send the typed value. A rejection's reason is the app's to put on the `Field` through `error`. Leave out when the form's own button saves it. */
|
|
21
|
+
onSave?: (value: string) => Promise<unknown>;
|
|
22
|
+
/** Take the stored one away, after the person confirms. Leave out to offer no Remove. */
|
|
23
|
+
onRemove?: () => void | Promise<unknown>;
|
|
24
|
+
/** What stops working once it is removed, in the product's words: "Map labels stop loading until a new key is set." Required with `onRemove`. */
|
|
25
|
+
consequence?: string;
|
|
26
|
+
/** Ask whether the key works. `null` means the stored one. */
|
|
27
|
+
test?: (value: string | null) => Promise<SecretTestResult>;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
id?: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
};
|
|
33
|
+
/** 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. */
|
|
34
|
+
export declare function SecretField({ noun, isSet, setAt, onChange, onSave, onRemove, consequence, test, disabled, id: idProp, name, className }: SecretFieldProps): React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Format } from '../lib/format';
|
|
2
|
+
import { Implies } from '../lib/choice';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
/** Which rows start chosen: their keys, or a test on each row. Either applies to a row the first time it appears. */
|
|
4
5
|
export type InitialSelection<T> = Iterable<string> | ((row: T) => boolean);
|
|
@@ -8,12 +9,30 @@ export type InitialSelection<T> = Iterable<string> | ((row: T) => boolean);
|
|
|
8
9
|
* the row) chooses each row the first time it appears, so a selection seeded from data that loads
|
|
9
10
|
* later, or a next page, still starts right.
|
|
10
11
|
*/
|
|
11
|
-
export declare function useSelection<T>(rows: readonly T[], rowKey: (row: T) => string, initial?: InitialSelection<T
|
|
12
|
+
export declare function useSelection<T>(rows: readonly T[], rowKey: (row: T) => string, initial?: InitialSelection<T>, { implies, format: fmt }?: {
|
|
13
|
+
implies?: Implies;
|
|
14
|
+
format?: Format;
|
|
15
|
+
}): {
|
|
12
16
|
selected: ReadonlySet<string>;
|
|
13
17
|
selectedRows: T[];
|
|
14
18
|
count: number;
|
|
15
19
|
onChange: (next: Set<string>) => void;
|
|
16
20
|
clear: () => void;
|
|
21
|
+
/** Keys that cannot be cleared on their own because something chosen implies them. */
|
|
22
|
+
implied: ReadonlySet<string>;
|
|
23
|
+
/** The chosen keys that bring `key` in (all of them), for the text that says why it is ticked. */
|
|
24
|
+
because: (key: string) => readonly string[];
|
|
25
|
+
counts: ChoiceCounts;
|
|
26
|
+
/** "12 results will be forgotten: 8 chosen, 4 that depend on them": the confirm's own words. */
|
|
27
|
+
summary: (noun: string | [one: string, many: string], then: string) => string;
|
|
28
|
+
/** A polite sentence about the last change ("3 more chosen because they depend on it"), for a live region. */
|
|
29
|
+
note: string;
|
|
30
|
+
};
|
|
31
|
+
/** The counts of a choice: what the person chose, what it brought in, and the whole. */
|
|
32
|
+
export type ChoiceCounts = {
|
|
33
|
+
chosen: number;
|
|
34
|
+
dependents: number;
|
|
35
|
+
total: number;
|
|
17
36
|
};
|
|
18
37
|
/** The part of a selection the surfaces drawing it (`DataTable`, `SelectableGrid`) need. */
|
|
19
38
|
type SelectionLike<T> = {
|
|
@@ -45,6 +64,31 @@ export declare function useSelectRows<T>(rows: readonly T[], rowKey: (row: T) =>
|
|
|
45
64
|
disabled: boolean;
|
|
46
65
|
};
|
|
47
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Choices that are not rows: the keys of a lazy tree, chosen before their rows have loaded. The same
|
|
69
|
+
* rules as `useSelection`'s `implies` (explicit and implied kept apart, implied keys locked, a
|
|
70
|
+
* summary and a note), with nothing to prune to. Spread into `Tree`'s `choices`. `initial` is what
|
|
71
|
+
* the app chose for the person; it is read once.
|
|
72
|
+
*/
|
|
73
|
+
export declare function useChoices({ initial, implies, format: fmt }?: {
|
|
74
|
+
initial?: Iterable<string>;
|
|
75
|
+
implies?: Implies;
|
|
76
|
+
format?: Format;
|
|
77
|
+
}): {
|
|
78
|
+
/** Everything chosen: what the person chose and what that implies. */
|
|
79
|
+
selected: ReadonlySet<string>;
|
|
80
|
+
count: number;
|
|
81
|
+
onChange: (next: ReadonlySet<string>) => void;
|
|
82
|
+
add: (keys: Iterable<string>) => void;
|
|
83
|
+
clear: () => void;
|
|
84
|
+
implied: ReadonlySet<string>;
|
|
85
|
+
because: (key: string) => readonly string[];
|
|
86
|
+
counts: ChoiceCounts;
|
|
87
|
+
summary: (noun: string | [one: string, many: string], then: string) => string;
|
|
88
|
+
note: string;
|
|
89
|
+
};
|
|
90
|
+
/** What `useChoices` returns: give it to `Tree`'s `choices`. */
|
|
91
|
+
export type Choices = ReturnType<typeof useChoices>;
|
|
48
92
|
/** The bar for a selection: a polite live count ("2 bookings selected"), the bulk actions, and Clear selection. Renders only the live region while nothing is chosen. */
|
|
49
93
|
export declare function BulkBar({ count, noun, onClear, children, format, className, }: {
|
|
50
94
|
count: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TranscriptGroup, TranscriptPhrase } from '../lib/transcript';
|
|
1
|
+
import { TranscriptGroup, TranscriptPhrase, TranscriptPhraseState } from '../lib/transcript';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
/** What a seek from the transcript says about where it came from. */
|
|
4
4
|
export type TranscriptSeek = {
|
|
@@ -28,9 +28,25 @@ export type TranscriptViewProps = {
|
|
|
28
28
|
announce?: boolean;
|
|
29
29
|
/** A control at the start of each phrase (a `PlayWindowButton`). */
|
|
30
30
|
renderPlay?: (phrase: TranscriptPhrase) => React.ReactNode;
|
|
31
|
+
/** Words under this confidence are doubtful (when they carry `confidence`). Default 0.6. */
|
|
32
|
+
doubtfulBelow?: number;
|
|
33
|
+
/** What a phrase can be marked, offered in each row's menu: `[{ id: "not-sung", label: "Not sung", tone: "neutral" }]`. */
|
|
34
|
+
states?: readonly TranscriptPhraseState[];
|
|
35
|
+
/** A phrase was marked with a state, or `null` when the mark was cleared. */
|
|
36
|
+
onPhraseState?: (phraseId: string, stateId: string | null) => void;
|
|
37
|
+
/** More controls at the end of each phrase (its own menu, a button). */
|
|
38
|
+
renderActions?: (phrase: TranscriptPhrase) => React.ReactNode;
|
|
39
|
+
/** The text of a phrase was corrected (Enter or F2 on its row). Say which mode it was in; word timings are the app's to keep. Leave out for a read-only transcript. */
|
|
40
|
+
onEdit?: (phraseId: string, text: string, from: {
|
|
41
|
+
mode: string;
|
|
42
|
+
}) => void;
|
|
43
|
+
/** Details shown on hover and focus: a clip's picture, real time, who spoke. Called only for the phrase it is open on. */
|
|
44
|
+
renderCard?: (phrase: TranscriptPhrase) => React.ReactNode;
|
|
45
|
+
/** How long hover or focus rests on a phrase before its card opens, ms. Default 500. */
|
|
46
|
+
cardDelay?: number;
|
|
31
47
|
/** Height of the scroll box once it is long enough to virtualise. Default 480. */
|
|
32
48
|
height?: number;
|
|
33
49
|
className?: string;
|
|
34
50
|
};
|
|
35
51
|
/** Timed text that follows playback: the heard word marked, any word or phrase pressed to play from, modes, speakers, follow and Jump to now. */
|
|
36
|
-
export declare function TranscriptView({ label, groups, time, onSeek, mode: controlledMode, onModeChange, modeLabels, speaker: controlledSpeaker, onSpeakerChange, follow, announce, renderPlay, height, className }: TranscriptViewProps): React.JSX.Element;
|
|
52
|
+
export declare function TranscriptView({ label, groups, time, onSeek, mode: controlledMode, onModeChange, modeLabels, speaker: controlledSpeaker, onSpeakerChange, follow, announce, renderPlay, doubtfulBelow, states, onPhraseState, renderActions, onEdit, renderCard, cardDelay, height, className }: TranscriptViewProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Choices } from './selection';
|
|
1
2
|
import { Load } from './data-view';
|
|
2
3
|
import { Expanded } from './disclosure';
|
|
3
4
|
import * as React from "react";
|
|
@@ -8,7 +9,19 @@ export type TreeNodeState = {
|
|
|
8
9
|
level: number;
|
|
9
10
|
branch: boolean;
|
|
10
11
|
};
|
|
11
|
-
export type TreeProps<N> = {
|
|
12
|
+
export type TreeProps<N> = TreeCommon<N> & ({
|
|
13
|
+
/** The chosen node's key, or `null`. */
|
|
14
|
+
selected: string | null;
|
|
15
|
+
/** A node was chosen. */
|
|
16
|
+
onSelect: (key: string, node: N) => void;
|
|
17
|
+
choices?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
/** Choose several, from `useChoices`: a checkbox per row, mixed parents, Shift ranges, "Select all shown", and keys the choice implies marked in words. Give this instead of `selected` and `onSelect`. */
|
|
20
|
+
choices: Choices;
|
|
21
|
+
selected?: undefined;
|
|
22
|
+
onSelect?: undefined;
|
|
23
|
+
});
|
|
24
|
+
type TreeCommon<N> = {
|
|
12
25
|
/** Names the tree for assistive technology: "Folders". Required. */
|
|
13
26
|
label: string;
|
|
14
27
|
/** The top level, as one read: the skeleton, the failure and Try again come from `DataView`'s `Load`. */
|
|
@@ -23,10 +36,6 @@ export type TreeProps<N> = {
|
|
|
23
36
|
isBranch?: (node: N) => boolean;
|
|
24
37
|
/** What a row shows after the icon. Default: the name, cut with an ellipsis. */
|
|
25
38
|
renderNode?: (node: N, state: TreeNodeState) => React.ReactNode;
|
|
26
|
-
/** The chosen node's key, or `null`. */
|
|
27
|
-
selected: string | null;
|
|
28
|
-
/** A node was chosen. */
|
|
29
|
-
onSelect: (key: string, node: N) => void;
|
|
30
39
|
/** Which nodes are open; from `useExpanded`, optionally in the URL. */
|
|
31
40
|
expanded: Expanded;
|
|
32
41
|
/** The skeleton row while a node's children load. Default: a muted bar. */
|
|
@@ -38,4 +47,5 @@ export type TreeProps<N> = {
|
|
|
38
47
|
className?: string;
|
|
39
48
|
};
|
|
40
49
|
/** A hierarchy whose children load as each node opens (a `useChildren` hook per open node): a skeleton row, a Try again row and an "empty" row per node, type-ahead and arrow keys, single selection, open state optionally in the URL, always virtualised. */
|
|
41
|
-
export declare function Tree<N>({ label, roots, useChildren, nodeKey, nodeLabel, isBranch, renderNode, selected, onSelect, expanded, loadingRow, emptyRow, height, className }: TreeProps<N>): React.JSX.Element;
|
|
50
|
+
export declare function Tree<N>({ label, roots, useChildren, nodeKey, nodeLabel, isBranch, renderNode, selected, onSelect, choices, expanded, loadingRow, emptyRow, height, className }: TreeProps<N>): React.JSX.Element;
|
|
51
|
+
export {};
|
|
@@ -15,8 +15,8 @@ export type RangeProps = {
|
|
|
15
15
|
export type NumberFieldProps = RangeProps & {
|
|
16
16
|
/** The current value; `null` when it is not known (shown as an en dash, not 0). */
|
|
17
17
|
value: number | null;
|
|
18
|
-
/** Receives a number inside the limits, or `null` when the field is cleared. Never NaN, never out of range. */
|
|
19
|
-
onChange: (value: number | null) => void
|
|
18
|
+
/** Receives a number inside the limits, or `null` when the field is cleared. Never NaN, never out of range. With `preview`, only Apply calls it, and it may return a promise. */
|
|
19
|
+
onChange: (value: number | null) => void | Promise<unknown>;
|
|
20
20
|
/** Decimal places to show and keep. Default the places in `step` (and `min`). */
|
|
21
21
|
places?: number;
|
|
22
22
|
/** An empty field is an error ("Enter a value.") rather than `null`. */
|
|
@@ -28,10 +28,26 @@ export type NumberFieldProps = RangeProps & {
|
|
|
28
28
|
name?: string;
|
|
29
29
|
/** `sm` is --control-h-sm, the height of a small `Toggle` or `IconButton` beside it. Default --control-h. */
|
|
30
30
|
size?: ControlSize;
|
|
31
|
+
/** Step buttons beside the field, each a size in the field's unit: `[0.1, 1, 10]` draws "−10 −1 −0.1 +0.1 +1 +10". Held, they repeat. They honour `min` and `max`. */
|
|
32
|
+
nudge?: readonly number[];
|
|
33
|
+
/** What the app suggests, drawn as a row under the field with "Use this value". `label` is the value as the person reads it ("+2.4 s"); `reason` says why, in words. Choosing it sets the field's value, which `preview` still holds back until Apply. */
|
|
34
|
+
suggestion?: {
|
|
35
|
+
value: number;
|
|
36
|
+
label?: string;
|
|
37
|
+
reason: string;
|
|
38
|
+
};
|
|
39
|
+
/** Hold changes back until the person applies them: shown while the value differs from `value` (the saved one), as a node or a function of the pending value. `onChange` is then called by Apply only. */
|
|
40
|
+
preview?: React.ReactNode | ((pending: number | null) => React.ReactNode);
|
|
41
|
+
/** Apply's words in preview mode, the same verb through its states. Default "Apply" → "Applying…" → "Applied". */
|
|
42
|
+
applyLabels?: {
|
|
43
|
+
idle: string;
|
|
44
|
+
pending: string;
|
|
45
|
+
done: string;
|
|
46
|
+
};
|
|
31
47
|
className?: string;
|
|
32
48
|
};
|
|
33
|
-
/** A number with a unit on React Aria's number field: typed input is validated, not clamped, so an out-of-range value is explained in the surrounding `Field` and never passed on; empty stays `null`. */
|
|
34
|
-
export declare function NumberField({ value, onChange, min, max, step, places, unit, locale, required, disabled, id: idProp, name, size, className, "aria-label": ariaLabel, }: NumberFieldProps): React.JSX.Element;
|
|
49
|
+
/** A number with a unit on React Aria's number field: typed input is validated, not clamped, so an out-of-range value is explained in the surrounding `Field` and never passed on; empty stays `null`. `nudge` adds step buttons that repeat when held, `suggestion` a value the app proposes with its reason, and `preview` holds changes back behind Apply and Revert. */
|
|
50
|
+
export declare function NumberField({ value, onChange, min, max, step, places, unit, locale, required, disabled, id: idProp, name, size, nudge, suggestion, preview, applyLabels, className, "aria-label": ariaLabel, }: NumberFieldProps): React.JSX.Element;
|
|
35
51
|
/** Props for `Slider`. */
|
|
36
52
|
export type SliderProps = RangeProps & {
|
|
37
53
|
value: number;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { c as cn } from "./field-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Button, Text, UNSTABLE_Toast, UNSTABLE_ToastContent, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion } from "react-aria-components";
|
|
1
|
+
import { c as Tooltip$1, u as cn } from "./field-DeKNvGox.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Button } from "react-aria-components";
|
|
5
4
|
import { cva } from "class-variance-authority";
|
|
6
|
-
import { CircleCheck, Info, TriangleAlert, X } from "lucide-react";
|
|
7
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { QueryClient, QueryClientProvider, useQuery } from "@tanstack/react-query";
|
|
9
6
|
// src/components/button.tsx
|
|
10
7
|
var buttonVariants = cva("inline-flex max-w-full shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control type-label transition-state press disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-(--control-icon) [&_svg]:shrink-0", {
|
|
11
8
|
variants: {
|
|
@@ -76,8 +73,6 @@ function RowAction({ label, subject, icon: Icon, variant = "ghost", size = "sm",
|
|
|
76
73
|
children: [Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }), label]
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
|
-
// src/lib/overlay.ts
|
|
80
|
-
var overlaySurface = "rounded-overlay border border-border bg-popover text-popover-foreground shadow-overlay enter-overlay";
|
|
81
76
|
// src/lib/errors.ts
|
|
82
77
|
/** Thrown by `fetchJson` on a non-2xx response; carries the status, the response body and the server's reason for `describeHttpError` and `describeActionError`. */
|
|
83
78
|
var HttpError = class extends Error {
|
|
@@ -156,172 +151,6 @@ var describeActionError = (error) => error instanceof HttpError ? error.status >
|
|
|
156
151
|
function fieldErrorsOf(error) {
|
|
157
152
|
return error instanceof HttpError ? error.fieldErrors : {};
|
|
158
153
|
}
|
|
159
|
-
|
|
160
|
-
var queue = new UNSTABLE_ToastQueue({ maxVisibleToasts: 3 });
|
|
161
|
-
/** Milliseconds a toast stays: 5 s plus 40 ms a character, to at most 15 s, and at least 8 s with an action. */
|
|
162
|
-
function toastTimeout(content) {
|
|
163
|
-
if (content.timeout !== void 0) return content.timeout;
|
|
164
|
-
const chars = content.title.length + (content.description?.length ?? 0) + (content.action?.label.length ?? 0);
|
|
165
|
-
return Math.max(content.action ? 8e3 : 0, Math.min(15e3, 5e3 + 40 * chars));
|
|
166
|
-
}
|
|
167
|
-
/** The toast queue: `toast.show({ title })` from anywhere; `toast.close(key)`; `toast.clear()`. */
|
|
168
|
-
var toast = {
|
|
169
|
-
/** Shows a toast and returns its key. */
|
|
170
|
-
show(content) {
|
|
171
|
-
return queue.add(content, { timeout: toastTimeout(content) });
|
|
172
|
-
},
|
|
173
|
-
close(key) {
|
|
174
|
-
queue.close(key);
|
|
175
|
-
},
|
|
176
|
-
clear() {
|
|
177
|
-
queue.clear();
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
var marks = {
|
|
181
|
-
info: {
|
|
182
|
-
icon: Info,
|
|
183
|
-
color: "text-info"
|
|
184
|
-
},
|
|
185
|
-
success: {
|
|
186
|
-
icon: CircleCheck,
|
|
187
|
-
color: "text-success"
|
|
188
|
-
},
|
|
189
|
-
warning: {
|
|
190
|
-
icon: TriangleAlert,
|
|
191
|
-
color: "text-warning"
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
/** The one place toasts appear. Render it once at the app root. A labelled landmark (F6), polite, above panes and the undo bar. */
|
|
195
|
-
function StrataToastRegion({ label = "Notifications", className }) {
|
|
196
|
-
return /* @__PURE__ */ jsx(UNSTABLE_ToastRegion, {
|
|
197
|
-
queue,
|
|
198
|
-
"aria-label": label,
|
|
199
|
-
className: cn("layer-bar fixed inset-x-4 top-4 grid justify-items-end gap-2 outline-none sm:inset-x-auto sm:top-auto sm:right-4 sm:bottom-4", className),
|
|
200
|
-
children: ({ toast: t }) => /* @__PURE__ */ jsxs(UNSTABLE_Toast, {
|
|
201
|
-
toast: t,
|
|
202
|
-
className: cn("flex w-full max-w-sm items-start gap-3 p-3 outline-none focus-visible:outline-2 focus-visible:outline-ring", overlaySurface),
|
|
203
|
-
children: [
|
|
204
|
-
(() => {
|
|
205
|
-
const { icon: Icon, color } = marks[t.content.tone ?? "info"];
|
|
206
|
-
return /* @__PURE__ */ jsx(Icon, {
|
|
207
|
-
"aria-hidden": true,
|
|
208
|
-
className: cn("mt-0.5 size-4 shrink-0", color)
|
|
209
|
-
});
|
|
210
|
-
})(),
|
|
211
|
-
/* @__PURE__ */ jsxs(UNSTABLE_ToastContent, {
|
|
212
|
-
className: "grid min-w-0 flex-1 gap-0.5",
|
|
213
|
-
children: [/* @__PURE__ */ jsx(Text, {
|
|
214
|
-
slot: "title",
|
|
215
|
-
className: "type-label",
|
|
216
|
-
children: t.content.title
|
|
217
|
-
}), t.content.description && /* @__PURE__ */ jsx(Text, {
|
|
218
|
-
slot: "description",
|
|
219
|
-
className: "type-body-sm text-muted-foreground",
|
|
220
|
-
children: t.content.description
|
|
221
|
-
})]
|
|
222
|
-
}),
|
|
223
|
-
t.content.action && /* @__PURE__ */ jsx(Button$1, {
|
|
224
|
-
size: "sm",
|
|
225
|
-
onPress: () => {
|
|
226
|
-
t.content.action?.onPress();
|
|
227
|
-
queue.close(t.key);
|
|
228
|
-
},
|
|
229
|
-
children: t.content.action.label
|
|
230
|
-
}),
|
|
231
|
-
/* @__PURE__ */ jsx(Button, {
|
|
232
|
-
slot: "close",
|
|
233
|
-
"aria-label": "Dismiss",
|
|
234
|
-
className: "grid size-6 shrink-0 cursor-pointer place-items-center rounded-control text-muted-foreground transition-state hover:bg-muted hover:text-foreground",
|
|
235
|
-
children: /* @__PURE__ */ jsx(X, {
|
|
236
|
-
"aria-hidden": true,
|
|
237
|
-
className: "size-4"
|
|
238
|
-
})
|
|
239
|
-
})
|
|
240
|
-
]
|
|
241
|
-
})
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
// src/query/index.tsx
|
|
245
|
-
/** A QueryClient with Strata's defaults: one retry, 30 s stale time, no refetch on window focus. */
|
|
246
|
-
function createQueryClient(overrides) {
|
|
247
|
-
return new QueryClient({
|
|
248
|
-
...overrides,
|
|
249
|
-
defaultOptions: {
|
|
250
|
-
...overrides?.defaultOptions,
|
|
251
|
-
queries: {
|
|
252
|
-
retry: 1,
|
|
253
|
-
staleTime: 3e4,
|
|
254
|
-
refetchOnWindowFocus: false,
|
|
255
|
-
...overrides?.defaultOptions?.queries
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
/** Provides a query client (Strata's defaults unless one is passed) to the app. */
|
|
261
|
-
function StrataQueryProvider({ client, children }) {
|
|
262
|
-
const [fallback] = React.useState(() => client ?? createQueryClient());
|
|
263
|
-
return /* @__PURE__ */ jsx(QueryClientProvider, {
|
|
264
|
-
client: client ?? fallback,
|
|
265
|
-
children
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Turns a TanStack query result into the `Load<T>` that `DataView` takes; errors are described for a person by `describe`.
|
|
270
|
-
* A refetch that fails after data arrived stays `ready`, with `stale` saying why and when the data was read.
|
|
271
|
-
*/
|
|
272
|
-
function toLoad(query, describe = describeHttpError) {
|
|
273
|
-
if (query.status === "success") return {
|
|
274
|
-
status: "ready",
|
|
275
|
-
data: query.data
|
|
276
|
-
};
|
|
277
|
-
if (query.status === "error" && query.data !== void 0) return {
|
|
278
|
-
status: "ready",
|
|
279
|
-
data: query.data,
|
|
280
|
-
stale: staleOf(query, describe)
|
|
281
|
-
};
|
|
282
|
-
if (query.status === "error") return {
|
|
283
|
-
status: "error",
|
|
284
|
-
message: describe(query.error),
|
|
285
|
-
retry: () => void query.refetch()
|
|
286
|
-
};
|
|
287
|
-
return { status: "loading" };
|
|
288
|
-
}
|
|
289
|
-
/** The `Stale` of a query whose refetch failed after a good read. Shared by `toLoad` and `useInfiniteLoad`. */
|
|
290
|
-
function staleOf(query, describe = describeHttpError) {
|
|
291
|
-
return {
|
|
292
|
-
message: describe(query.error),
|
|
293
|
-
readAt: new Date(query.dataUpdatedAt),
|
|
294
|
-
retry: () => void query.refetch(),
|
|
295
|
-
retrying: query.isFetching
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
/** `useQuery`, returned as a `Load<T>` for `DataView`. */
|
|
299
|
-
function useLoad(options) {
|
|
300
|
-
const { describeError, ...rest } = options;
|
|
301
|
-
return toLoad(useQuery(rest), describeError);
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* fetch() that throws an HttpError on a non-2xx response and parses JSON: the queryFn default, and the usual commit for a write.
|
|
305
|
-
* A 204 or empty body resolves to undefined. An error response's body is read onto the HttpError (`body`, `reason`, `fieldErrors`).
|
|
306
|
-
*/
|
|
307
|
-
async function fetchJson(input, init, { readError = readErrorBody } = {}) {
|
|
308
|
-
const headers = new Headers(init?.headers);
|
|
309
|
-
if (!headers.has("Accept")) headers.set("Accept", "application/json");
|
|
310
|
-
const res = await fetch(input, {
|
|
311
|
-
...init,
|
|
312
|
-
headers
|
|
313
|
-
});
|
|
314
|
-
if (!res.ok) {
|
|
315
|
-
const raw = await res.text().catch(() => "");
|
|
316
|
-
let body = raw || void 0;
|
|
317
|
-
try {
|
|
318
|
-
if (raw) body = JSON.parse(raw);
|
|
319
|
-
} catch {}
|
|
320
|
-
throw new HttpError(res.status, res.statusText, String(input), body, readError(body));
|
|
321
|
-
}
|
|
322
|
-
const text = res.status === 204 ? "" : await res.text();
|
|
323
|
-
return text ? JSON.parse(text) : void 0;
|
|
324
|
-
}
|
|
325
|
-
export { IconButton as _, toLoad as a, toast as c, describeActionError as d, describeHttpError as f, Button$1 as g, overlaySurface as h, staleOf as i, toastTimeout as l, readErrorBody as m, createQueryClient as n, useLoad as o, fieldErrorsOf as p, fetchJson as r, StrataToastRegion as s, StrataQueryProvider as t, HttpError as u, RowAction as v, buttonVariants as y };
|
|
154
|
+
export { readErrorBody as a, RowAction as c, fieldErrorsOf as i, buttonVariants as l, describeActionError as n, Button$1 as o, describeHttpError as r, IconButton as s, HttpError as t };
|
|
326
155
|
|
|
327
|
-
//# sourceMappingURL=
|
|
156
|
+
//# sourceMappingURL=errors-BunUBqpA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-BunUBqpA.js","names":["Button","AriaButton","Tooltip"],"sources":["../src/components/button.tsx","../src/lib/errors.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Button as AriaButton, type PressEvent } from \"react-aria-components\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { IconComponent } from \"../lib/icon\";\nimport { cn } from \"../lib/utils\";\nimport type { ControlSize } from \"../lib/control\";\nimport { Tooltip } from \"./tooltip\";\n\n// Variant names are shadcn's, so copied code and agents' prior knowledge still work. Two things\n// differ on purpose:\n// 1. The default variant is `outline`, not the filled accent. A bare <Button> is the restrained\n// one; the accent (`variant=\"default\"`) has to be asked for, once per view. Generated app screens\n// put the accent on every button; 12 of 23 real product screens had no filled primary at all.\n// 2. Heights come from --control-h, shared with Input and NativeSelect, so density changes move\n// every control together.\n// 3. React Aria is the primitives layer (CLAUDE.md, \"The stack\"): behaviour and accessibility come\n// from it, the look from our tokens. `asChild`/`Slot` is gone; a button that navigates is a link.\n// 4. `press`: the button gives 2% under a click or a finger, over 100ms. Buttons are used tens of\n// times a day, so that is all the motion they get (character.md, the frequency budget).\nexport const buttonVariants = cva(\n \"inline-flex max-w-full shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-control type-label transition-state press disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-(--control-icon) [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary-10\",\n outline: \"border border-input bg-background text-foreground hover:bg-muted\",\n secondary: \"bg-muted text-foreground hover:bg-neutral-4\",\n ghost: \"text-foreground hover:bg-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-danger\",\n link: \"h-auto px-0 text-primary-11 underline underline-offset-4 hover:text-primary-12\",\n },\n size: {\n default: \"h-(--control-h) px-(--control-px)\",\n sm: \"h-(--control-h-sm) px-(--control-px-sm)\",\n icon: \"size-(--control-h)\",\n \"icon-sm\": \"size-(--control-h-sm)\",\n },\n },\n defaultVariants: { variant: \"outline\", size: \"default\" },\n },\n);\n\nexport type ButtonProps = Omit<React.ComponentProps<\"button\">, \"className\" | \"style\"> &\n VariantProps<typeof buttonVariants> & {\n className?: string;\n /** React Aria's press event (mouse, touch, pen and keyboard alike). `onClick` also works. */\n onPress?: (event: PressEvent) => void;\n /** When a press begins and ends: for a control that acts while held (a nudge that repeats). */\n onPressStart?: (event: PressEvent) => void;\n onPressEnd?: (event: PressEvent) => void;\n };\n\n/**\n * A button with shadcn's variant names, built on React Aria's `Button` (press handling that behaves\n * the same for mouse, touch, pen and keyboard, focus-visible and hover state). The default variant is\n * `outline`; ask for the filled accent (`variant=\"default\"`) once per view. `type` defaults to `button`.\n * `onClick` and `disabled` are the DOM names and keep working; `onPress` is also accepted.\n */\nexport function Button({ className, variant, size, type = \"button\", disabled, children, ...props }: ButtonProps) {\n // data-variant says which variant was drawn, so a test can check \"one filled button per view\"\n // without reading class names (strata-react issue #48, `filledButtons` in strata-react/testing).\n return (\n <AriaButton\n type={type}\n isDisabled={disabled}\n data-variant={variant ?? \"outline\"}\n className={cn(buttonVariants({ variant, size }), className)}\n {...(props as object)}\n >\n {/* A text label that cannot fit its column is cut with an ellipsis, not drawn past the button (issue #116). */}\n {typeof children === \"string\" ? <span className=\"min-w-0 truncate\">{children}</span> : children}\n </AriaButton>\n );\n}\n\n// An icon-only button cannot be written without a name: `label` is required by the type, becomes\n// the accessible name and is shown as a `Tooltip` on hover and keyboard focus, so the name and the\n// visible hint come from one string and cannot drift. This makes the most common generated\n// accessibility defect (an unlabelled icon button) a compile error instead of an audit finding.\nexport type IconButtonProps = Omit<ButtonProps, \"size\" | \"children\" | \"aria-label\"> & {\n /** `sm` is --control-h-sm, the height of a small `Toggle` or `Button`, for a toolbar or property row. Default --control-h. */\n size?: ControlSize;\n icon: IconComponent;\n label: string;\n /** Shown after the label in its tooltip, muted: \"Ctrl+Z\". */\n hint?: React.ReactNode;\n};\n\n/** An icon-only button. `label` is required and becomes the accessible name and the tooltip (hover and keyboard focus); `hint` adds a muted aside to it, such as a shortcut. */\nexport function IconButton({ icon: Icon, label, hint, variant = \"ghost\", size = \"default\", ...props }: IconButtonProps) {\n return (\n <Tooltip label={label} hint={hint}>\n <Button size={size === \"sm\" ? \"icon-sm\" : \"icon\"} variant={variant} aria-label={label} {...props}>\n <Icon aria-hidden />\n </Button>\n </Tooltip>\n );\n}\n\n// A row action says what it does in the row (\"Withdraw\") and whom it does it to in its name\n// (\"Withdraw Tom Ellery\"): a table of eight \"Withdraw\" buttons is eight identical names in a\n// screen reader's list of controls. The name is an aria-label that starts with the visible verb,\n// so it meets WCAG 2.5.3 (label in name) and voice control still finds it by \"Withdraw\". Visually\n// hidden suffix text is not used: a hidden span joined to the verb did not form a name with its\n// space in dom-testing-library (strata-react issue #11). Ghost and small, one per row, shown only\n// on the rows where it applies; an icon-only row action is an `IconButton` whose `label` names the\n// row the same way. It keeps the row's pitch: rows with and without the action are the same height.\nexport type RowActionProps = Omit<ButtonProps, \"children\" | \"aria-label\"> & {\n /** The visible verb, sentence case: \"Withdraw\", \"Remove\". */\n label: string;\n /** What the row is, as a person would say it: \"Tom Ellery\", \"Moonbeam\". Completes the accessible name. */\n subject: string;\n icon?: IconComponent;\n};\n\n/** A small ghost action for one table row: shows `label`, and is named \"`label` `subject`\" so every row's action has its own name. */\nexport function RowAction({ label, subject, icon: Icon, variant = \"ghost\", size = \"sm\", className, ...props }: RowActionProps) {\n // -my-1.5 lets the 32px button sit in the 20px line of a table row, inside the row's padding, so\n // rows with an action keep the same pitch as rows without one.\n return (\n <Button variant={variant} size={size} aria-label={`${label} ${subject}`} className={cn(\"-my-1.5\", className)} {...props}>\n {Icon && <Icon aria-hidden />}\n {label}\n </Button>\n );\n}\n","// Errors, described for a person. Anything that fails in front of someone (a load in DataView, an\n// action in AsyncButton) says what happened in a sentence, in the product's words, not the\n// developer's: `HttpError`'s own message (\"409 Conflict from /api/bookings\") is for logs. Loads\n// and actions share HttpError's status sentences, so the same failure reads the same everywhere,\n// and differ only in what is true afterwards: a failed load changed nothing, while a failed action\n// may have reached the server, so its sentence does not promise that.\n//\n// A server's own reason beats the status text (strata-react issue #42, from python-app-template).\n// FastAPI and most JSON APIs say why a 4xx happened in the body (`{\"detail\": \"the data folder must\n// be an absolute path\"}`), and a client that drops it has to repeat every server rule to show the\n// person anything better than \"Bad Request\", which drifts and cannot cover rules only the server\n// can check. So `fetchJson` reads an error response's body, `HttpError` keeps it with the reason\n// and any per-field messages found in it, and the sentences below use the reason for a 4xx.\n// Per-field messages (FastAPI's 422 `detail: [{loc, msg}]`) are keyed by field name, so\n// `useAsyncAction`'s `fieldErrors` can put each under its `Field`, never in a toast. A 5xx body is\n// not shown: it is usually a stack trace or a proxy's HTML page, and is kept on `body` for logs.\n\n/** What `readErrorBody` finds in an error response: the server's sentence, and messages per field. */\nexport type ErrorBody = {\n /** Why the server refused, in its own words. */\n reason?: string;\n /** Messages for individual fields, keyed by field name (`\"name\"`, `\"address.city\"`). */\n fields?: Record<string, string>;\n};\n\n/** Thrown by `fetchJson` on a non-2xx response; carries the status, the response body and the server's reason for `describeHttpError` and `describeActionError`. */\nexport class HttpError extends Error {\n /** The server's sentence for why it refused, from the body (`detail`, `message`, `error`), if it gave one. */\n readonly reason?: string;\n /** Messages for individual fields from the body (FastAPI's 422 `detail: [{loc, msg}]`), keyed by field name. Empty when there are none. */\n readonly fieldErrors: Readonly<Record<string, string>>;\n\n constructor(\n readonly status: number,\n readonly statusText: string,\n readonly url: string,\n /** The response body: parsed JSON when it was JSON, else its text; undefined when empty. */\n readonly body?: unknown,\n found: ErrorBody = readErrorBody(body),\n ) {\n super(`${status} ${statusText} from ${url}`);\n this.name = \"HttpError\";\n this.reason = found.reason;\n this.fieldErrors = found.fields ?? {};\n }\n}\n\nconst text = (value: unknown) => (typeof value === \"string\" && value.trim() ? value.trim() : undefined);\n\n/** A field name from a FastAPI/pydantic `loc`: the path after where it came from (`[\"body\", \"address\", \"city\"]` is `\"address.city\"`). */\nfunction fieldName(loc: unknown) {\n if (!Array.isArray(loc)) return undefined;\n const path = loc.map(String);\n if ([\"body\", \"query\", \"path\", \"header\", \"cookie\", \"form\"].includes(path[0]) && path.length > 1) path.shift();\n return path.join(\".\") || undefined;\n}\n\n/**\n * The default reading of an error body, for the shapes most JSON APIs use: `{ detail: \"…\" }`\n * (FastAPI), `{ message: \"…\" }`, `{ error: \"…\" }` or `{ error: { message: \"…\" } }` for the reason,\n * and FastAPI's validation list `{ detail: [{ loc, msg }] }` for per-field messages. A short\n * plain-text body (not HTML) is taken as the reason too. Pass your own to `fetchJson` for other APIs.\n */\nexport function readErrorBody(body: unknown): ErrorBody {\n if (typeof body === \"string\") {\n const t = text(body);\n return t && t.length <= 300 && !t.startsWith(\"<\") ? { reason: t } : {};\n }\n if (!body || typeof body !== \"object\") return {};\n const b = body as Record<string, unknown>;\n if (Array.isArray(b.detail)) {\n const fields: Record<string, string> = {};\n for (const item of b.detail as unknown[]) {\n const entry = item as { loc?: unknown; msg?: unknown } | null;\n const name = fieldName(entry?.loc);\n const msg = text(entry?.msg);\n if (name && msg && !fields[name]) fields[name] = msg;\n }\n return { fields };\n }\n const nested = b.error && typeof b.error === \"object\" ? text((b.error as Record<string, unknown>).message) : undefined;\n return { reason: text(b.detail) ?? text(b.message) ?? text(b.error) ?? nested };\n}\n\n/** Writes an error for a person: what happened, in a sentence. A product passes its own words. */\nexport type DescribeError = (error: unknown) => string;\n\n/** A sentence ends once: \"…absolute path\" and \"…absolute path.\" both end in one full stop. */\nconst sentence = (s: string) => (/[.!?…]$/.test(s) ? s : `${s}.`);\n\nfunction refused(error: HttpError) {\n if (error.reason) return `The request was refused: ${sentence(error.reason)}`;\n if (Object.keys(error.fieldErrors).length) return \"The request was refused: check the fields marked.\";\n return `The request was refused (${error.status}): ${error.statusText || \"no reason given\"}.`;\n}\n\n/** The default `DescribeError` for loads: the HTTP status in a sentence (with the server's reason for a 4xx), else the error's message, else a plain fallback. */\nexport const describeHttpError: DescribeError = (error) =>\n error instanceof HttpError\n ? error.status >= 500\n ? `The server could not answer (${error.status}). Nothing was changed.`\n : refused(error)\n : error instanceof Error && error.message\n ? error.message\n : \"The data could not be loaded. Nothing was changed.\";\n\n/** The default for `useAsyncAction`: the HTTP status in a sentence (with the server's reason for a 4xx), else the thrown Error's message, else undefined (the retry label alone). */\nexport const describeActionError = (error: unknown): string | undefined =>\n error instanceof HttpError\n ? error.status >= 500\n ? `The server could not answer (${error.status}).`\n : refused(error)\n : error instanceof Error && error.message\n ? error.message\n : undefined;\n\n/** Messages for individual fields carried by what was thrown: an `HttpError`'s `fieldErrors`, else none. */\nexport function fieldErrorsOf(error: unknown): Readonly<Record<string, string>> {\n return error instanceof HttpError ? error.fieldErrors : {};\n}\n"],"mappings":";;;;;;AAmBA,IAAa,iBAAiB,IAC5B,oRACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SAAS;GACT,WAAW;GACX,OAAO;GACP,aAAa;GACb,MAAM;EACR;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,MAAM;GACN,WAAW;EACb;CACF;CACA,iBAAiB;EAAE,SAAS;EAAW,MAAM;CAAU;AACzD,CACF;;;;;;;AAkBA,SAAgBA,SAAO,EAAE,WAAW,SAAS,MAAM,OAAO,UAAU,UAAU,UAAU,GAAG,SAAsB;CAG/G,OACE,oBAACC,QAAD;EACQ;EACN,YAAY;EACZ,gBAAc,WAAW;EACzB,WAAW,GAAG,eAAe;GAAE;GAAS;EAAK,CAAC,GAAG,SAAS;EAC1D,GAAK;EAGJ,UAAA,OAAO,aAAa,WAAW,oBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,IAAI;CAC7E,CAAA;AAEhB;;AAgBA,SAAgB,WAAW,EAAE,MAAM,MAAM,OAAO,MAAM,UAAU,SAAS,OAAO,WAAW,GAAG,SAA0B;CACtH,OACE,oBAACC,WAAD;EAAgB;EAAa;EAC3B,UAAA,oBAACF,UAAD;GAAQ,MAAM,SAAS,OAAO,YAAY;GAAiB;GAAS,cAAY;GAAO,GAAI;GACzF,UAAA,oBAAC,MAAD,EAAM,eAAA,KAAa,CAAA;EACb,CAAA;CACD,CAAA;AAEb;;AAmBA,SAAgB,UAAU,EAAE,OAAO,SAAS,MAAM,MAAM,UAAU,SAAS,OAAO,MAAM,WAAW,GAAG,SAAyB;CAG7H,OACE,qBAACA,UAAD;EAAiB;EAAe;EAAM,cAAY,GAAG,MAAM,GAAG;EAAW,WAAW,GAAG,WAAW,SAAS;EAAG,GAAI;EAAlH,UAAA,CACG,QAAQ,oBAAC,MAAD,EAAM,eAAA,KAAa,CAAA,GAC3B,KACK;;AAEZ;;;ACnGA,IAAa,YAAb,cAA+B,MAAM;CAOxB;CACA;CACA;CAEA;;CATX;;CAEA;CAEA,YACE,QACA,YACA,KAEA,MACA,QAAmB,cAAc,IAAI,GACrC;EACA,MAAM,GAAG,OAAO,GAAG,WAAW,QAAQ,KAAK;EAPlC,KAAA,SAAA;EACA,KAAA,aAAA;EACA,KAAA,MAAA;EAEA,KAAA,OAAA;EAIT,KAAK,OAAO;EACZ,KAAK,SAAS,MAAM;EACpB,KAAK,cAAc,MAAM,UAAU,CAAC;CACtC;AACF;AAEA,IAAM,QAAQ,UAAoB,OAAO,UAAU,YAAY,MAAM,KAAK,IAAI,MAAM,KAAK,IAAI,KAAA;;AAG7F,SAAS,UAAU,KAAc;CAC/B,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,OAAO,KAAA;CAChC,MAAM,OAAO,IAAI,IAAI,MAAM;CAC3B,IAAI;EAAC;EAAQ;EAAS;EAAQ;EAAU;EAAU;CAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,KAAK,SAAS,GAAG,KAAK,MAAM;CAC3G,OAAO,KAAK,KAAK,GAAG,KAAK,KAAA;AAC3B;;;;;;;AAQA,SAAgB,cAAc,MAA0B;CACtD,IAAI,OAAO,SAAS,UAAU;EAC5B,MAAM,IAAI,KAAK,IAAI;EACnB,OAAO,KAAK,EAAE,UAAU,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC;CACvE;CACA,IAAI,CAAC,QAAQ,OAAO,SAAS,UAAU,OAAO,CAAC;CAC/C,MAAM,IAAI;CACV,IAAI,MAAM,QAAQ,EAAE,MAAM,GAAG;EAC3B,MAAM,SAAiC,CAAC;EACxC,KAAK,MAAM,QAAQ,EAAE,QAAqB;GACxC,MAAM,QAAQ;GACd,MAAM,OAAO,UAAU,OAAO,GAAG;GACjC,MAAM,MAAM,KAAK,OAAO,GAAG;GAC3B,IAAI,QAAQ,OAAO,CAAC,OAAO,OAAO,OAAO,QAAQ;EACnD;EACA,OAAO,EAAE,OAAO;CAClB;CACA,MAAM,SAAS,EAAE,SAAS,OAAO,EAAE,UAAU,WAAW,KAAM,EAAE,MAAkC,OAAO,IAAI,KAAA;CAC7G,OAAO,EAAE,QAAQ,KAAK,EAAE,MAAM,KAAK,KAAK,EAAE,OAAO,KAAK,KAAK,EAAE,KAAK,KAAK,OAAO;AAChF;;AAMA,IAAM,YAAY,MAAe,UAAU,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE;AAE9D,SAAS,QAAQ,OAAkB;CACjC,IAAI,MAAM,QAAQ,OAAO,4BAA4B,SAAS,MAAM,MAAM;CAC1E,IAAI,OAAO,KAAK,MAAM,WAAW,CAAC,CAAC,QAAQ,OAAO;CAClD,OAAO,4BAA4B,MAAM,OAAO,KAAK,MAAM,cAAc,kBAAkB;AAC7F;;AAGA,IAAa,qBAAoC,UAC/C,iBAAiB,YACb,MAAM,UAAU,MACd,gCAAgC,MAAM,OAAO,2BAC7C,QAAQ,KAAK,IACf,iBAAiB,SAAS,MAAM,UAC9B,MAAM,UACN;;AAGR,IAAa,uBAAuB,UAClC,iBAAiB,YACb,MAAM,UAAU,MACd,gCAAgC,MAAM,OAAO,MAC7C,QAAQ,KAAK,IACf,iBAAiB,SAAS,MAAM,UAC9B,MAAM,UACN,KAAA;;AAGR,SAAgB,cAAc,OAAkD;CAC9E,OAAO,iBAAiB,YAAY,MAAM,cAAc,CAAC;AAC3D"}
|