strata-react 1.0.44 → 1.0.46
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 +2 -2
- package/UPGRADING.md +4 -0
- package/dist/components/conversation.d.ts +14 -0
- package/dist/components/selectable-grid.d.ts +18 -6
- package/dist/components/tile-grid.d.ts +9 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +537 -127
- package/dist/index.js.map +1 -1
- package/dist/lib/grouped-grid-layout.d.ts +44 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ thousands of lines. Such an app imports the same stylesheet **without the reset*
|
|
|
154
154
|
| 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 (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 |
|
|
155
155
|
| 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). |
|
|
156
156
|
| 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 |
|
|
157
|
-
| 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 `-` (`onTileSizeChange`), `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") |
|
|
157
|
+
| 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") |
|
|
158
158
|
| 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 |
|
|
159
159
|
| 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`) |
|
|
160
160
|
| 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) |
|
|
@@ -173,7 +173,7 @@ thousands of lines. Such an app imports the same stylesheet **without the reset*
|
|
|
173
173
|
| 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 |
|
|
174
174
|
| 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 |
|
|
175
175
|
| 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 |
|
|
176
|
-
| 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 |
|
|
176
|
+
| 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 |
|
|
177
177
|
| 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 |
|
|
178
178
|
| 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 |
|
|
179
179
|
| 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 |
|
package/UPGRADING.md
CHANGED
|
@@ -11,6 +11,10 @@ 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.44 (2026-11-14)
|
|
15
|
+
|
|
16
|
+
- `SelectableGrid` with `groupBy` is now one virtualised list: a group's heading is a row of the grid (not a `region` with its own list per group), so a test that looked for `getByRole("region", { name })` finds the heading row instead, and only the visible rows are in the DOM. Tiles `isSelectable` refuses are now focusable (not selectable) so the arrow keys land on them and their `unselectableReason` can be read; they were skipped before. The grouped baselines move.
|
|
17
|
+
|
|
14
18
|
## After v1.0.43 (2026-11-14)
|
|
15
19
|
|
|
16
20
|
- `toast.show(...)` with no `StrataToastRegion` mounted warns once in development ("nothing will be drawn") and still queues the toast; an app that called it before its region mounted will see the warning, and `renderWithStrata` keeps its region on by default so a test is unchanged.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EntityMatcher } from '../lib/rich-text';
|
|
2
|
+
import { AspectRatio } from './thumbnail';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
export type RichTextProps = {
|
|
4
5
|
/** The text, in the small subset: paragraphs, `- ` and `1. ` lists, **bold**, `code`, [links](https://…). */
|
|
@@ -11,13 +12,26 @@ export type RichTextProps = {
|
|
|
11
12
|
};
|
|
12
13
|
/** Draws a small safe subset of text (bold, code, lists, http links) and turns known ids into buttons. Never HTML: whatever the string holds is shown as text. */
|
|
13
14
|
export declare function RichText({ children, entities, onOpen, className }: RichTextProps): React.JSX.Element;
|
|
15
|
+
/** A picture shown with an answer (issue #257). */
|
|
16
|
+
export type ConversationImage = {
|
|
17
|
+
src: string;
|
|
18
|
+
/** What it shows, in words: the picture's accessible name and its visible caption. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** The full-size picture, when it is not `src`: the thumbnail becomes a link that opens it in a new tab. */
|
|
21
|
+
href?: string;
|
|
22
|
+
/** Width over height, so the box is its shape before the picture loads. Default 16/9. */
|
|
23
|
+
aspect?: AspectRatio;
|
|
24
|
+
};
|
|
14
25
|
/** One turn of the thread. `failed` cannot be written without the sentence saying what happened. */
|
|
15
26
|
export type ConversationTurn = {
|
|
16
27
|
id: string;
|
|
17
28
|
role: "person" | "answer";
|
|
18
29
|
time: Date | string | number;
|
|
19
30
|
text: string;
|
|
31
|
+
/** What the answer consulted, in a collapsed disclosure. Not for a picture that is the answer: use `images`. */
|
|
20
32
|
lookedUp?: React.ReactNode;
|
|
33
|
+
/** Pictures that are part of the answer, drawn under its text, always visible: lazy, each with its label as its name and caption, and a link to the full size when `href` is given. */
|
|
34
|
+
images?: readonly ConversationImage[];
|
|
21
35
|
} & ({
|
|
22
36
|
state?: "done";
|
|
23
37
|
} | {
|
|
@@ -2,7 +2,17 @@ import { RowSelection } from './data-table';
|
|
|
2
2
|
import { TileAspect, TileSize } from './tile-grid';
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
export type { TileAspect, TileSize };
|
|
5
|
-
export type SelectableGridProps<T> = {
|
|
5
|
+
export type SelectableGridProps<T> = SelectableGridBase<T> & ({
|
|
6
|
+
/** Default `square`. `portrait` is 3:4, `landscape` 4:3, or a width over height (`16 / 9`). */
|
|
7
|
+
aspect?: TileAspect | number;
|
|
8
|
+
naturalAspect?: never;
|
|
9
|
+
} | {
|
|
10
|
+
/** Each picture at its own shape, in rows of equal height that fill the width (Google Photos, Lightroom). `tileSize` is then the row height to aim for, and every row's pictures and heights are worked out from `naturalAspect` before anything loads, so nothing moves as pictures arrive. Virtualised always. */
|
|
11
|
+
aspect: "natural";
|
|
12
|
+
/** A picture's width over height, from the record (its pixel size), never from the loaded image. */
|
|
13
|
+
naturalAspect: (row: T) => number;
|
|
14
|
+
});
|
|
15
|
+
type SelectableGridBase<T> = {
|
|
6
16
|
/** Names the grid of tiles. */
|
|
7
17
|
label: string;
|
|
8
18
|
rows: T[];
|
|
@@ -13,8 +23,6 @@ export type SelectableGridProps<T> = {
|
|
|
13
23
|
detail?: (row: T) => React.ReactNode;
|
|
14
24
|
/** The chosen keys and how to change them, as `DataTable` takes them; `rowLabel` names each tile's box. */
|
|
15
25
|
selection: RowSelection<T>;
|
|
16
|
-
/** Default `square`. `portrait` is 3:4, `landscape` 4:3. */
|
|
17
|
-
aspect?: TileAspect;
|
|
18
26
|
/** Default `md`. Pixels for a continuous size: the minimum tile width, growing to fill the row. */
|
|
19
27
|
tileSize?: TileSize | number;
|
|
20
28
|
/** Asked to change the size by Ctrl/Cmd+wheel, `+` and `-`. Give a `useViewOptions` size back to `tileSize`; omit to leave the size fixed. */
|
|
@@ -27,9 +35,13 @@ export type SelectableGridProps<T> = {
|
|
|
27
35
|
selectionBehavior?: "toggle" | "replace";
|
|
28
36
|
/** Opens a tile: Enter, or a double click with `selectionBehavior="replace"`. */
|
|
29
37
|
onAction?: (row: T) => void;
|
|
30
|
-
/** A corner badge on the picture (top right): a `Status
|
|
38
|
+
/** A corner badge on the picture (top right): a `Status`, "RAW+JPG". */
|
|
31
39
|
badge?: (row: T) => React.ReactNode;
|
|
32
|
-
/**
|
|
40
|
+
/** A second corner (bottom right of the picture) for a count or a mark ("12", a flag), on a chip so it reads on any picture. */
|
|
41
|
+
mark?: (row: T) => React.ReactNode;
|
|
42
|
+
/** `cover` (default) crops the picture to fill its frame; `contain` fits the whole picture in it, letterboxed. */
|
|
43
|
+
fit?: "cover" | "contain";
|
|
44
|
+
/** Puts tiles under full-width headings, in the order the rows first show them. Virtualised like the ungrouped grid. */
|
|
33
45
|
groupBy?: (row: T) => string;
|
|
34
46
|
/** The words for a group's heading; default the group text. */
|
|
35
47
|
groupHeading?: (group: string, rows: T[]) => string;
|
|
@@ -42,4 +54,4 @@ export type SelectableGridProps<T> = {
|
|
|
42
54
|
className?: string;
|
|
43
55
|
};
|
|
44
56
|
/** A grid of pictures to choose from: each tile one labelled target, "Select all shown", Shift-click ranges, virtualised from `virtualizeFrom` tiles. Pair with `useSelection` and a `BulkBar`. */
|
|
45
|
-
export declare function SelectableGrid<T>({ label, rows, rowKey, renderImage, detail, selection, aspect, tileSize, onTileSizeChange, zoomRange, selectionMode, selectionBehavior, onAction, badge, groupBy, groupHeading, unselectableReason, virtualizeFrom, maxHeight, className, }: SelectableGridProps<T>): React.JSX.Element;
|
|
57
|
+
export declare function SelectableGrid<T>({ label, rows, rowKey, renderImage, detail, selection, aspect, naturalAspect, tileSize, onTileSizeChange, zoomRange, selectionMode, selectionBehavior, onAction, badge, mark, fit, groupBy, groupHeading, unselectableReason, virtualizeFrom, maxHeight, className, }: SelectableGridProps<T>): React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ export declare const aspectClass: Record<TileAspect, string>;
|
|
|
9
9
|
/** A tile size as pixels: a named size's minimum width, or the number itself (a continuous size, issue #246). */
|
|
10
10
|
export declare const tileWidth: (size: TileSize | number) => number;
|
|
11
11
|
/** `GridLayout` options for tiles of this size and aspect: they grow from the minimum width to fill the row, and each row is as tall as its tallest tile as measured. */
|
|
12
|
-
export declare function tileLayoutOptions(tileSize: TileSize | number, aspect: TileAspect): {
|
|
12
|
+
export declare function tileLayoutOptions(tileSize: TileSize | number, aspect: TileAspect | number): {
|
|
13
13
|
minItemSize: Size;
|
|
14
14
|
minSpace: Size;
|
|
15
15
|
};
|
|
@@ -56,4 +56,12 @@ export declare function TileGridSkeleton({ count, aspect, tileSize, className }:
|
|
|
56
56
|
tileSize?: TileSize;
|
|
57
57
|
className?: string;
|
|
58
58
|
}): React.JSX.Element;
|
|
59
|
+
/** The loading shape of a `SelectableGrid`: `count` picture boxes at the grid's tile size and shape, for a `DataView` skeleton. With `shapes` (widths over heights, cycled) the boxes are in rows at their own shapes, as `aspect="natural"` draws them. */
|
|
60
|
+
export declare function SelectableGridSkeleton({ count, aspect, tileSize, shapes, className }: {
|
|
61
|
+
count?: number;
|
|
62
|
+
aspect?: TileAspect | number;
|
|
63
|
+
tileSize?: TileSize | number;
|
|
64
|
+
shapes?: readonly number[];
|
|
65
|
+
className?: string;
|
|
66
|
+
}): React.JSX.Element;
|
|
59
67
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export { BulkBar, useSelection, useChoices, type InitialSelection, type Choices,
|
|
|
56
56
|
export type { Implies } from './lib/choice';
|
|
57
57
|
export { SelectableGrid, type SelectableGridProps, type TileAspect, type TileSize, } from './components/selectable-grid';
|
|
58
58
|
export { ViewOptions, useViewOptions, sortRows, type ViewOptionsProps, type ViewOptionsConfig, type ViewOptionsState, type ViewSort, type ViewGroup, type ViewGroupRows } from './components/view-options';
|
|
59
|
-
export { TileGrid, TileGridSkeleton, type TileGridProps } from './components/tile-grid';
|
|
59
|
+
export { TileGrid, TileGridSkeleton, SelectableGridSkeleton, type TileGridProps } from './components/tile-grid';
|
|
60
60
|
export { VirtualList } from './components/virtual-list';
|
|
61
61
|
export { InfiniteList, LoadMore, type InfiniteListProps, type LoadMoreProps } from './components/infinite-list';
|
|
62
62
|
export { LineChart, LineChartGroup, logScale, valueAt, type ChartMark, type ChartSpan, type GroupedChart, type LineChartGroupProps, type LineChartProps, type Point, type SpanTone, type YScale } from './components/line-chart';
|
|
@@ -90,7 +90,7 @@ export { differences, readPixels, resample, MAX_SIDE, DEFAULT_TOLERANCE, type Di
|
|
|
90
90
|
export { Workspace, Split, Pane, useWorkspaceState, type WorkspaceState, type PaneProps } from './components/workspace';
|
|
91
91
|
export { useHistory, useHistoryState, type History, type HistoryOptions, type HistoryStep, type HistoryStateOptions, type SetOptions, } from './components/history';
|
|
92
92
|
export { useAutoSave, useLeaveGuard, SaveStatus, type AutoSave, type AutoSaveOptions, type SaveState } from './components/save';
|
|
93
|
-
export { RichText, Conversation, Composer, type RichTextProps, type ConversationProps, type ConversationTurn, type ComposerProps } from './components/conversation';
|
|
93
|
+
export { RichText, Conversation, Composer, type RichTextProps, type ConversationProps, type ConversationTurn, type ConversationImage, type ComposerProps } from './components/conversation';
|
|
94
94
|
export { parseRichText, parseInline, matchEntities, safeHref, plainText, type EntityMatch, type EntityMatcher, type Block as RichBlock, type Inline as RichInline } from './lib/rich-text';
|
|
95
95
|
export { Lightbox, useLightboxUrl, type LightboxProps, type LightboxItem, type LightboxUrl } from './components/lightbox';
|
|
96
96
|
export { RegionEditor, describeRegion, type RegionEditorProps, type EditableRegion, type RegionTone } from './components/region-editor';
|