viewkitjs 0.34.0 → 0.35.0

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.
Files changed (198) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/package.json +1 -1
  3. package/views/README.md +1 -1
  4. package/views/dist/atoms/Avatar.js +2 -1
  5. package/views/dist/atoms/RelationChip.d.ts +2 -0
  6. package/views/dist/atoms/RelationChip.js +5 -0
  7. package/views/dist/atoms/RowMenu.d.ts +1 -1
  8. package/views/dist/atoms/RowMenu.js +15 -3
  9. package/views/dist/atoms/defaults.js +2 -0
  10. package/views/dist/atoms/types.d.ts +40 -4
  11. package/views/dist/cells/relation-wrap.js +9 -2
  12. package/views/dist/contract.d.ts +9 -6
  13. package/views/dist/contract.js +4 -2
  14. package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
  15. package/views/dist/controls/avatar/avatar-mark.js +5 -0
  16. package/views/dist/controls/avatar/avatar.d.ts +7 -4
  17. package/views/dist/controls/avatar/avatar.js +10 -4
  18. package/views/dist/controls/avatar/looks.d.ts +1 -1
  19. package/views/dist/controls/avatar/looks.js +3 -0
  20. package/views/dist/controls/avatar/record-mark.d.ts +16 -0
  21. package/views/dist/controls/avatar/record-mark.js +13 -0
  22. package/views/dist/controls/avatar/tokens.d.ts +12 -0
  23. package/views/dist/controls/avatar/tokens.js +3 -0
  24. package/views/dist/controls/avatar.css +54 -17
  25. package/views/dist/controls/bulk-bar/bulk-bar.js +4 -5
  26. package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
  27. package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
  28. package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
  29. package/views/dist/controls/compound-editor/map-parts-body.js +6 -1
  30. package/views/dist/controls/compound-editor/name-parts.js +2 -1
  31. package/views/dist/controls/compound-editor/place-parts.js +2 -2
  32. package/views/dist/controls/compound-editor/range-parts.js +10 -9
  33. package/views/dist/controls/customize/customize.d.ts +14 -5
  34. package/views/dist/controls/customize/customize.js +11 -14
  35. package/views/dist/controls/customize/map-customize-body.js +12 -11
  36. package/views/dist/controls/customize/words.d.ts +3 -3
  37. package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
  38. package/views/dist/controls/filter-editor/filter-editor.js +4 -6
  39. package/views/dist/controls/filter-editor/parts.d.ts +1 -1
  40. package/views/dist/controls/filter-editor/parts.js +4 -4
  41. package/views/dist/controls/index.d.ts +1 -1
  42. package/views/dist/controls/internal/map-panel-controls.js +9 -5
  43. package/views/dist/controls/internal/panel-controls.d.ts +27 -3
  44. package/views/dist/controls/internal/panel-controls.js +141 -12
  45. package/views/dist/controls/links-editor/links-editor.js +5 -7
  46. package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
  47. package/views/dist/controls/links-editor/map-links-body.js +5 -1
  48. package/views/dist/controls/menu/menu.d.ts +3 -0
  49. package/views/dist/controls/menu/menu.js +2 -1
  50. package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
  51. package/views/dist/controls/picker/map-fields-body.js +5 -1
  52. package/views/dist/controls/picker/map-picker.d.ts +8 -3
  53. package/views/dist/controls/picker/map-picker.js +14 -3
  54. package/views/dist/controls/picker/picker.js +11 -8
  55. package/views/dist/controls/picker/rows.d.ts +7 -2
  56. package/views/dist/controls/quick-filters/map-quick-filters-body.js +2 -1
  57. package/views/dist/controls/quick-filters/quick-filters.js +4 -4
  58. package/views/dist/controls/quick-filters/reminder.js +2 -2
  59. package/views/dist/controls/quick-filters/rules.d.ts +4 -1
  60. package/views/dist/controls/quick-filters/words.d.ts +2 -0
  61. package/views/dist/controls/quick-filters/words.js +1 -0
  62. package/views/dist/controls/select/select.d.ts +3 -0
  63. package/views/dist/controls/select/select.js +9 -3
  64. package/views/dist/controls/sort-editor/sort-editor.d.ts +2 -0
  65. package/views/dist/controls/sort-editor/sort-editor.js +4 -5
  66. package/views/dist/controls/toolbar/toolbar.d.ts +25 -12
  67. package/views/dist/controls/toolbar/toolbar.js +15 -20
  68. package/views/dist/controls/toolbar.css +0 -5
  69. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  70. package/views/dist/controls/tooltip/map-tooltip.js +4 -2
  71. package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
  72. package/views/dist/controls/values-editor/map-values-body.js +5 -1
  73. package/views/dist/controls/values-editor/values-editor.js +8 -7
  74. package/views/dist/display/option-badges.d.ts +16 -0
  75. package/views/dist/display/option-badges.js +11 -0
  76. package/views/dist/display/relation-link.d.ts +12 -0
  77. package/views/dist/display/relation-link.js +17 -0
  78. package/views/dist/display/relation.d.ts +1 -1
  79. package/views/dist/display/relation.js +10 -3
  80. package/views/dist/display/select.js +1 -8
  81. package/views/dist/editors/EditorPanel.js +1 -1
  82. package/views/dist/editors/RangeEditor.d.ts +3 -0
  83. package/views/dist/editors/RangeEditor.js +2 -2
  84. package/views/dist/editors/SelectEditor.d.ts +2 -2
  85. package/views/dist/editors/SelectEditor.js +1 -1
  86. package/views/dist/editors/TextEditor.js +4 -2
  87. package/views/dist/editors/ValueListEditor.js +2 -1
  88. package/views/dist/field-row/FieldRow.js +32 -5
  89. package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
  90. package/views/dist/grid/chrome/GridAddColumn.js +9 -6
  91. package/views/dist/grid/chrome/GridCellEditors.js +1 -1
  92. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
  93. package/views/dist/grid/chrome/GridCellOutline.js +16 -6
  94. package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
  95. package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
  96. package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
  97. package/views/dist/grid/chrome/GridFooter.js +4 -4
  98. package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
  99. package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
  100. package/views/dist/grid/chrome/GridHeader.js +1 -2
  101. package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
  102. package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
  103. package/views/dist/grid/chrome/GridRow.js +5 -3
  104. package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
  105. package/views/dist/grid/chrome/GridRowActions.js +2 -2
  106. package/views/dist/grid/chrome/GridRowCells.js +3 -2
  107. package/views/dist/grid/chrome/GridStructure.js +1 -1
  108. package/views/dist/grid/chrome/GridTable.js +32 -20
  109. package/views/dist/grid/chrome/checks.d.ts +1 -1
  110. package/views/dist/grid/chrome/checks.js +4 -1
  111. package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
  112. package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
  113. package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
  114. package/views/dist/grid/chrome/grid-hover.js +14 -4
  115. package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
  116. package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
  117. package/views/dist/grid/chrome/grid-table-props.d.ts +10 -2
  118. package/views/dist/grid/grid.css +6 -0
  119. package/views/dist/grid/looks.d.ts +3 -1
  120. package/views/dist/grid/looks.js +10 -4
  121. package/views/dist/list/layer.d.ts +8 -0
  122. package/views/dist/list/layer.js +7 -0
  123. package/views/dist/list/store.d.ts +1 -1
  124. package/views/dist/list/toolbar.js +44 -19
  125. package/views/dist/list/views.js +1 -0
  126. package/views/dist/panels/availability.d.ts +5 -0
  127. package/views/dist/panels/availability.js +4 -5
  128. package/views/dist/panels/customize-body.d.ts +4 -0
  129. package/views/dist/panels/customize-body.js +13 -11
  130. package/views/dist/panels/model.d.ts +9 -4
  131. package/views/dist/panels/react/customize-body.js +5 -2
  132. package/views/dist/panels/react/customize.d.ts +5 -0
  133. package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
  134. package/views/dist/panels/react/filter/FilterEditor.js +7 -0
  135. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
  136. package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
  137. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +4 -1
  138. package/views/dist/panels/react/toolbar/Toolbar.d.ts +11 -1
  139. package/views/dist/panels/react/toolbar/Toolbar.js +16 -6
  140. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
  141. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +12 -5
  142. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
  143. package/views/dist/panels/react/toolbar/ToolbarFilters.js +18 -8
  144. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +6 -1
  145. package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
  146. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  147. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  148. package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
  149. package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
  150. package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
  151. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
  152. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +4 -4
  153. package/views/dist/panels/react/views-row/ViewPicker.js +13 -5
  154. package/views/dist/panels/react.d.ts +1 -1
  155. package/views/dist/panels/settings/layout.js +6 -38
  156. package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
  157. package/views/dist/panels/toolbar/page-resets.js +62 -0
  158. package/views/dist/panels/toolbar/same-item.d.ts +7 -0
  159. package/views/dist/panels/toolbar/same-item.js +9 -0
  160. package/views/dist/panels/view-state.d.ts +4 -0
  161. package/views/dist/provider/ViewsProvider.d.ts +9 -4
  162. package/views/dist/provider/ViewsProvider.js +13 -2
  163. package/views/dist/provider/components.d.ts +27 -5
  164. package/views/dist/provider/components.js +1 -1
  165. package/views/dist/react.d.ts +1 -1
  166. package/views/dist/styles.css +98 -23
  167. package/views/dist/styles.unlayered.css +98 -23
  168. package/views/docs/contract.md +38 -25
  169. package/views/docs/controls/avatar.md +3 -0
  170. package/views/docs/controls/bulk-bar.md +3 -1
  171. package/views/docs/controls/compound-editor.md +2 -0
  172. package/views/docs/controls/customize.md +1 -1
  173. package/views/docs/controls/filter-editor.md +1 -1
  174. package/views/docs/controls/links-editor.md +2 -0
  175. package/views/docs/controls/pane.md +1 -1
  176. package/views/docs/controls/picker.md +2 -0
  177. package/views/docs/controls/quick-filters.md +1 -1
  178. package/views/docs/controls/text-editor.md +1 -1
  179. package/views/docs/controls/values-editor.md +2 -0
  180. package/views/docs/guides/atoms.md +54 -3
  181. package/views/docs/guides/display.md +1 -1
  182. package/views/docs/guides/looks.md +1 -1
  183. package/views/docs/guides/the-grid.md +4 -2
  184. package/views/docs/guides/the-provider.md +2 -2
  185. package/views/docs/index.md +2 -2
  186. package/views/docs/install.md +198 -104
  187. package/views/docs/reference/controls.md +17 -15
  188. package/views/docs/reference/editors-range.md +1 -1
  189. package/views/docs/reference/field-row.md +1 -1
  190. package/views/docs/reference/grid.md +2 -1
  191. package/views/docs/reference/list.md +2 -2
  192. package/views/docs/reference/looks.md +5 -5
  193. package/views/docs/reference/panels-react.md +13 -12
  194. package/views/docs/reference/panels.md +4 -4
  195. package/views/docs/reference/react.md +10 -8
  196. package/views/docs/reference/views.md +2 -2
  197. package/views/docs/reshaping.md +22 -6
  198. package/views/skills/views/SKILL.md +2 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,116 @@ Until 0.19.0 ViewKit shipped as three packages; their changes are in [fields/CHA
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.35.0] — 2026-12-04
9
+
10
+ ### Added
11
+
12
+ - `viewkitjs/views/react`: the provider's `panelControls` can name `Tooltip`. Your components map's `Tooltip` then draws the tooltips inside ViewKit's panels: Add sort at its most, a set-aside sort's and filter rule's why, and Add filter on a relation the list no longer lists. It is handed `content`, `side`, `align`, and `reason` where the words say why something can't be used. A tooltip ViewKit's own would never show (Add sort while it can be used) is no tooltip at all, its child drawn alone. `PANEL_CONTROL_NAMES` holds `Tooltip`.
13
+ - `viewkitjs/views/react`: `ViewsTooltipProps.reason`, a tooltip whose content says why what it names can't be used: a longer line to wrap. The kit's map Tooltip (`CONTROLS.Tooltip`) draws it as ViewKit's own reason does.
14
+ - `viewkitjs/views/react`: the provider's `panelControls` now draws your own `Button`, `Menu`, `Popover`, `Select` and `Input` inside the Picker (wherever a ViewKit body holds it: an editor's list, the text and number editors' country and currency lists, the filter's value Pickers, the sort's Add sort fields), the name and place parts, and the values and links editors, each handed its part's `data-slot` and `data-key`. Inside a ViewKit field your Input or Select is handed the `id` its label names (`ViewsSelectProps.id`). Nothing changes without it.
15
+ - `viewkitjs/views/panels/react`: the list's toolbar takes `overflow` (`ToolbarOverflow`, on `Toolbar`, `ReadyToolbar`, `ListToolbar` and `List`'s `toolbar`), the ⋯ it draws when its parts don't fit as you draw it: `icon` (your glyph over your `icons.more`), `className`, or `button`, your own button drawn in place of your `ToolbarButton` and handed the very props it would get (`part: "more"` and `ref` included). Handed nothing, ⋯ draws as before.
16
+ - `viewkitjs/views/controls`: `ToolbarControl` takes `overflow` (`ToolbarOverflowControl`), the same for the kit's Toolbar: your glyph over ViewKit's dots, your class, or your whole button, handed the Toolbar button's props (spread them on yours, `ref` included). Handed nothing, ViewKit's own ⋯ as before.
17
+ - `CollectionViewState.saved`: the view's settings as saved. Hand it in your view state and each Customize page gets its own Reset. ViewKit's own saved views fill it. Without it, the first page's Reset still works through `onReset`.
18
+ - Each Customize page (Layout, Columns, Filter, Sort, Group) has its own Reset while that page differs from the view as saved. With no saved view, the page goes back to what the first page's Clear gives: Filter, Sort and Group emptied, Columns back to its declared columns. A page's Reset also empties its own part of the reader's layer: Layout their look (and on a phone their phone's layout), Columns their widths, Group their folds. It says the first page's word, "Reset" on a shared view and "Clear" with none, and it looks the same and stands in the same place. A Customize body of your own is handed them as `resets`; the default Customize takes them as `CustomizeProps.resets`, drawn as `data-slot="vk-customize-action"` with `data-key="page-reset"`. Handed at all (even empty), they are the only page Resets; ViewKit's toolbar hands none where a shown view gives no `saved`.
19
+ - The sort and filter editors take `clearAll` (default on). Set it to `false` to hide their Clear all.
20
+ - `ToolbarOptions`, `ViewOptionsPanelContent` and `ToolbarSave` take `layered`: the reader's own layer holds something. The ready toolbar sets it.
21
+ - `viewkitjs/views/controls`: `ToolbarControl` takes `moreViews` and `moreFilters` (`ToolbarMoreControl`), the "+N" its view tabs fold into and the "+N filters" its filters fold into, as you draw them: your class, or your whole button, handed the Toolbar button's props (spread them on yours: `ref`, its words, and what its Menu or `onMoreViews` sets to open from it). Handed nothing, both draw as before, the same elements to the attribute.
22
+
23
+ ```tsx
24
+ <ToolbarControl label="Deals" moreViews={{ button: MyPlus }} moreFilters={{ className: "my-more-filters" }}>
25
+ …
26
+ </ToolbarControl>
27
+ ```
28
+ - `viewkitjs/views`: the Avatar draws a record's own icon, after Attio. Hand a person or a record its object's icon (`icon`) and, if you like, its object's colour (`colour`), and with no photo or logo it draws that icon on a ground that shows in dark too. Three new looks on `AVATAR_LOOKS`, set once on the frame, decide how: With no picture (`data-avatar-mark`: `icon`, the default, or `initials`, the name's letters as before), Ground (`data-avatar-ground`: `quiet` for Quiet grey, the default, `grey`, `outline` or `colour` for the object's colour's fill) and Icon colour (`data-avatar-icon-colour`: `grey`, the default, or `colour` for the object's colour's strong ink). A person keeps its circle; a photo or a logo (`src`) always wins. An Avatar handed no icon draws its letters exactly as before.
29
+ - `viewkitjs/views`: the Avatar reads three more tokens, `--vk-neutral-hovered` (Quiet grey), `--vk-neutral-bold` (Grey) and `--vk-border-input` (Outline's edge), each declared by the ready stylesheet.
30
+ - `viewkitjs/views/react`: the provider's `panelControls` can name `Avatar`. Your `atoms.Avatar` then draws every record's mark ViewKit's panels draw: the Picker's rows, the links editor's, the bulk bar's choices, the quick filters' values and their reminder's. It is handed data only: the record's `label`, its `avatarUrl`, its `kind` as your app names it (a deal stays a deal, where ViewKit's own draws every record as a person or a company), the panel's size in pixels and ViewKit's own Avatar as its `fallback`. ViewKit's own Avatar atom is never counted as yours. Left out, the panels draw ViewKit's Avatar exactly as before, even where you hand an `Avatar` atom for the chips.
31
+ - `viewkitjs/views/react`: `ViewsAvatarProps`' `size` takes 20, 24, 32 or 40 beside `chip` and `glyph`: the panels' sizes, handed only where `panelControls` names `Avatar`. `PANEL_CONTROL_NAMES` holds `Avatar`.
32
+ - `viewkitjs/views/controls`: a `SelectItem`'s `avatar` says its mark is your own Avatar atom; a typed Select's chip draws it again at `chip`. `PickerAs`' avatar and `QuickMark`'s face carry the record's `kind`, and `QuickMark` its `src`, for your atom.
33
+ - `ToolbarSortPill` takes `changed` and `ToolbarFilterAdd` takes `changed`: each is lit by it, whatever it would light by on its own.
34
+ - `ToolbarFilters` takes `saved`, the saved view's filter. Its own top-level filters stand in Customize, not on the bar. An edited one stands on the bar as edited, and every write is still the whole filter's. `foldableFilters(tree, held, saved?)` counts the same.
35
+ - `ToolbarFilterAdd` takes `opens`: `"fields"` (the default, as before) or `"filters"`. With `"filters"`, it opens the whole filter editor, your `FilterBody` on every rule of the view, edited as Customize's Filter edits it, with Add filter under the rules.
36
+ - `viewkitjs/views/controls`: `CustomizeProps.differs`, a section that differs from the view as saved: its value in the brand. Absent, Layout and Columns carry no mark.
37
+ - `viewkitjs/views/grid`: `GridTable` takes `rowHighlight`, which row the grid tints. `"hover"`, the default, tints the row under the pointer, as before. `"active"` tints the active row alone, which carries `data-active` (`GRID_STATES` gains `active`): the row a person last pressed, anywhere on it, or the picked cell's row, so the keyboard moves it too. It keeps its tint through a press outside the grid and Escape, until another row is pressed or picked, and no row tints under the pointer or as your `hoveredRow`; the row's box, ⋯ and the name's actions still show under the pointer.
38
+ - `viewkitjs/views/grid`: two options on `GRID_LOOKS`. Row highlight (`highlight`: `hover`, the default, or `active`), which `gridLookProps` hands `GridTable` as `rowHighlight`, so `GRID_LOOK_READ` and `GridLookWorn` gain `highlight` and `GridLookProps` gains `rowHighlight`. Add calculation (`offer`: `hover`, the default, or `always`), the look stylesheet's: under `always` every empty footer cell shows its offer ("+ Add calculation" under Figures `value`, "Calculate" otherwise) at rest, and opens the same picker. Wear it without looks as `data-grid-offer="always"` on a frame round the grid. Both looks, `attio` and `portal`, keep `hover` for both.
39
+ - `viewkitjs/views/panels/react`: `ToolbarSort` takes `bar` and `changed`. Handed `bar`, the one-rule sort reads on the filter bar as a several-sorts list's pill does: "Sorted by **Name**", in the bar's sort place (`data-slot="vk-toolbar-sort-pill"`), opening the same one-rule panel. `changed` lights it as you say, over its own rule (the list's default sort).
40
+ - `viewkitjs/views/react`: a new atom, `RelationChip`, a mentioned record. ViewKit places a mentioned record and hands its data; your app draws it. Where the provider's `panelControls` names `RelationChip`, your `atoms.RelationChip` draws every relation ViewKit draws: a table's cell (one and many, and the +N list), a field row's value (Record details), `renderFieldValue` (a highlight) and a user field's chip. It is handed `ViewsRelationChipProps`: `relation` (`id`, `label`, `entity`, `avatarUrl`), `roles` (a link's, each its `value` and `label`), `size` (`chip` in a cell or a highlight, `row` in a field row), `render`, the host's link where it has one (a cell whose host opens its relations, a bare button whose press is the host's; your `RelationLink` or a host's `relationWrap` around your chip; none for an inert fact or where the host's own element owns the click), and `fallback`, ViewKit's own chip. `ViewsRelationChipLinkProps` is what your chip hands that link. The default, `DEFAULT_VIEWS_ATOMS.RelationChip`, draws its `fallback`, and ViewKit's own atom is never counted as yours. Left out, or handed without naming it, every place draws exactly as before. A typed Select's chip is not one of them: a control stands without the provider, and your own Select draws your own mark.
41
+ - `viewkitjs/views/react`: `PANEL_CONTROL_NAMES` and `PanelControlName` hold `RelationChip`; `ATOM_NAMES` (`viewkitjs/views`) holds `RelationChip`.
42
+ - `viewkitjs/views`: the `RowMenu` atom takes `onOpenChange`, to call with `true` as its menu opens and `false` as it closes. While it is open, the grid draws the row it is aimed at as under the pointer, `data-hovered` with its tint and its ⋯. ViewKit's own `RowMenu` calls it; an atom of yours that doesn't behaves as before.
43
+ - `viewkitjs/views/controls`: `pickerItemsOf(items, { cells: true })` reads a coloured or slotted row as its cell draws it (the Picker's row `as: { chip }`); without `cells`, as before. The Picker's `PickerAs` takes `{ chip: ReactNode }`, drawn in place of the row's words.
44
+ - `viewkitjs/views/react`: a `PartsBody`'s `range` kind (`ViewsPartsBodyProps`) is handed the field's limits, `min` and `max`, where the field states them (`validation.min` and `.max`; a percent range 0 and 100 unless it says otherwise). Your body may step each end within them, as the number body's box does.
45
+ - `viewkitjs/views/editors/range`: `RangeEditor` takes `min` and `max` and hands them to the body. The grid's and a field row's range editors hand the field's own (`numberBounds(field)`). A host of your own (a card's range editor) can hand them the same way.
46
+
47
+ ### Changed
48
+
49
+ - `viewkitjs/views/react`: a components map spread from `CONTROLS` carries none of `CONTROL_ATOMS`, so its toolbar draws ViewKit's plain button and the Toolbar's look options don't apply. In development the provider now says so once, where the map holds ViewKit's own controls, carries no atoms and the app hands no `ToolbarButton` of its own. Hand them beside the map: `components={{ ...CONTROLS, ...own }} atoms={CONTROL_ATOMS}`. The kit's `ToolbarButton` atom draws a count as a count, never the ✕ that clears it.
50
+ - `viewkitjs/views/react`: `panelControls={true}` now names `Tooltip` too. With your own `Tooltip` in the map, `true` draws the panels' tooltips with it.
51
+ - `viewkitjs/views/controls`: where the provider's `panelControls` names `Input`, the filter's number and range boxes are your `Input` too: a rule's number, a range's From and To, and the filter bar's typed number. Your Input is handed `inputMode="decimal"` and the text typed. ViewKit reads it as a number by the provider's conventions, rounded where the field takes whole numbers, hands the number (or none) at each change, and steps it with ↑ and ↓ (Shift by 10). Before, these boxes stayed ViewKit's Number field whatever `panelControls` said. With `Input` not named, they draw as before.
52
+ - `viewkitjs/views`: under the provider's `panelControls` your `Menu` is now handed a menu's groups, its rows of actions and of choices one level in (`children` with `beside`) and its links (`href`), which it was left without (VK-1022).
53
+ - An app that opted in to `panelControls` on 0.33.0 for the sort and filter panels now sees its own `Button` inside their Pickers too (Add sort's fields, a filter's values): a level's Back, Retry and Clear all; their search box and rows stay ViewKit's.
54
+ - Under `panelControls`, a popover ViewKit opens from its own button (the links editor's field list) is opened by ViewKit at your Button and handed its `anchor`, whether or not `Popover` is named; a busy button (the Picker's Add while it adds) is handed `aria-busy` and `aria-disabled`; a button drawn as a link (the values editor's Open) stays ViewKit's.
55
+ - `viewkitjs/views/controls`: the bulk bar (`CONTROLS.SelectionBar`) draws your own controls under the provider's `panelControls`. Every verb, Delete, More, the phone pill's ✕ and Actions is your `Button`, each handed its part's `data-slot` (`vk-bulk-verb` with its place as `data-key`, `vk-bulk-delete`, `vk-bulk-more`, `vk-bulk-clear`, `vk-bulk-actions`), and the bar's Toolbar still holds it: one Tab stop, the arrows, Home and End. Forward the `ref` your Button is handed, or the arrows skip it. The bar measures how many verbs fit with your Button too. More's and a group's rows are your `Menu`, a group's verbs and a field's values one level in; a field's list stands in your `Popover` on a computer. The count, the Toast and a phone's field sheet stay ViewKit's, and so does Delete's question, its buttons yours. With nothing opted in, or with `components={CONTROLS}`, the bar draws exactly as before.
56
+ - `viewkitjs/views/controls`: `ToolbarControl` is the bar above a list and nothing else: `fill` (the row's worded buttons growing to share it) and `more` (entries ⋯ always holds at the row's end) are gone, and with them the `data-fill` rule in `toolbar.css`. A row of a page's actions is your own, on your Button, with a menu of yours for what doesn't show:
57
+
58
+ ```tsx
59
+ // Before
60
+ <ToolbarControl label="Record" fill more={[{ icon: null, label: "Merge records" }]}>
61
+ <ToolbarButtonControl label="Compose email" icon={mail}>Compose email</ToolbarButtonControl>
62
+ </ToolbarControl>
63
+
64
+ // After
65
+ <div className="record-actions">
66
+ <Button icon={mail}>Compose email</Button>
67
+ <Menu label="More of the record" entries={[{ icon: null, label: "Merge records" }]} />
68
+ </div>
69
+ ```
70
+
71
+ - `viewkitjs/views/controls`: `toolbarSteps(items, fill)` takes the items alone: `toolbarSteps(items)`.
72
+ - Customize's Layout page now ends at its toggles, in every app: the "For you" heading, "On your phone", "Use what the view says" and a toggle's own "Reset …" row are gone. `settingsPanels(…).layout` no longer builds a `personal` section, and Vertical borders no longer carries a `reset`. Customize's Reset is the way back. The `vk-customize-toggle-reset` part is no longer drawn.
73
+ - On a phone, Customize's Layout picker names and writes the phone's own layout: `mobileValue` through `onMobileChange`, among `mobileOptions` with `mobileRefused`, each the computer's where absent; a toggle marked `desktopOnly` is left out, and a Layout marked `desktopOnly` with no phone value stands nowhere. Layout's settings and Columns follow the layout the phone draws. A pick on the phone never changes the computer's layout, nor a pick on the computer the phone's. With one layout offered, a phone draws no cards to pick. `settingsPanels(…).layout` offers the phone the list's own `layouts`, never more: its `mobileValue` is the person's pick where the list still offers it, else a table read as rows where rows are offered, else the computer's layout. An app drawing its own layouts reads the phone's from the person's layer, `applyPersonalLayer(settings, layer, { phone: true }).settings.layout`.
74
+ - Deprecated, read by nothing and removed in a later release: `LayoutConfig.personal`, `LayoutPersonalConfig`, `resolvePersonalSection`, `ToggleConfig.reset`, a Customize body's `layout.personal` and toggle `reset`, the default Customize's `CustomizeLayoutSettings.personal` and `CustomizeToggle.reset`, and its words `personalReset` and `toggleReset`. Code that sets them still compiles and draws nothing; delete those lines.
75
+ - Customize's first-page Reset (and the bar's Clear, and the ✕ on the Customize button, which do the same) now puts back the view as saved and the reader's own layer too: their column widths, the groups they folded, their own look and their phone's layout. This happens in every app. When only that layer differs (a dragged width, a folded group), Reset stands alone, with no Save, on the bar's Clear too. A phone's own layout counts only on a phone.
76
+ - Inside Customize, the Sort and Filter pages no longer carry Clear all wherever Customize is handed its pages' Resets (ViewKit's toolbar, with no saved view or with a view that gives `saved`); their page's Reset stands in its place. Without them, Customize keeps Clear all. The toolbar's own Sort and Filter popovers keep theirs.
77
+ - Customize's Columns page no longer carries "Reset columns" at its heading; its page's Reset stands in its place. `CustomizeProps.columnsReset` and a Customize body's `columns.reset` are deprecated: they are read as Columns' page Reset only where no `resets` is handed at all. A column's figure, set from the grid's footer, is not part of Columns' Reset; the first page's Reset takes it back. The word `columnsReset` is deprecated and drawn nowhere.
78
+ - `viewkitjs/views`: a record's Avatar handed both an `icon` and a `colour` used to stand on its colour's fill; it now stands on Quiet grey with a grey icon unless the frame picks Ground `colour` and Icon colour `colour`. A person handed an `icon` now draws it on the same ground instead of on its tone.
79
+ - `viewkitjs/views/react`: `panelControls={true}` now names `Avatar` too. With your own `Avatar` atom handed, `true` draws the panels' record marks with it.
80
+ - `viewkitjs/views/controls`: a typed Select's chip finds a picture by a flag ViewKit's Avatar carries, not by which component it is, so it also holds across two copies of the package.
81
+ - `viewkitjs/views/controls`: a square Avatar at 16 and 20 rounds its corners one step more: Small 3px, Medium (the default) 6px, Large 9px, Extra large 12px, where Medium was Small's 3px. Every other size draws as before. A company's or a record's mark in a chip, a Picker's row or a typed Select now reads less square.
82
+ - In every app on ViewKit's toolbar (Mihai's look, the default on a computer), the toolbar shows only what differs from the saved view: the open view's `saved` settings, or with no saved view the list's defaults.
83
+ - At rest nothing is lit and no filter bar stands.
84
+ - Sort and Filter on the row light while they differ.
85
+ - A changed sort comes onto the filter bar ("Sorted by …") with Clear and Save.
86
+ - The bar holds only the filters that aren't the saved view's own.
87
+ - Something taken away (a saved filter removed) brings Clear and Save alone.
88
+ - Customize's foot now holds Reset and Save, with the stale note, while anything differs, even when the bar stands with its own Clear and Save.
89
+ - A shown view handed without `saved` keeps the older lighting.
90
+ - On a phone, Sort lights the same way; Filter's badge still counts the filters.
91
+ - In every app on ViewKit's toolbar (Mihai's look, on a computer), Filter on the row now opens the view's filters, editable, with Add filter under them, as Sort opens its rules. With no filter it opens the editor's fields. The bar's + still adds one filter from the fields. On a phone, Filter's sheet already opened the editor on every rule.
92
+ - `viewkitjs/views/react`: `CONTROLS.CustomizeBody` marks a section (its value in the brand) only while it differs from the view as saved: the same `resets` its pages' Reset stands for. A saved view's own filter and sort show in the normal colour at rest; a section changed, or one whose saved part was taken away, shows in the brand. Layout and Columns are marked too. With no `resets` handed (a view without its saved settings), a section is marked while something is set in it, as before.
93
+ - `viewkitjs/views/grid`: with the lines between the columns on (`verticalBorders`), the last column now draws the same line as the others, so the table is closed on its right: in the rows, in the header where you hand `headerVerticalBorders`, and in the footer. The footer, which drew no lines before, now draws the rows' column lines and a line under itself, pinned (`pinFooter`) or not. A grid with `verticalBorders` off draws exactly as before.
94
+ - `viewkitjs/views/react`: `panelControls={true}` now names `RelationChip` too. With your own `RelationChip` atom handed, `true` draws every mentioned record with it.
95
+ - `viewkitjs/views/controls`: `CONTROLS.Picker` draws a select's, a multiselect's and a status's options as their cells do, with your `Tag` and `StatusBadge` atoms: each option in its colour (one your field doesn't declare in the colour its cell derives for it), a status's words and mark in its slot's colour, a `pending` step the same in the list as in the cell. Before, the list drew every option as a plain chip and a status's words uncoloured. An app with its own `Tag` or `StatusBadge` atom now sees it in the list too.
96
+ - `viewkitjs/views`: an archived option a record still holds keeps the colour its field declares in the select editor's list, as in its cell.
97
+ - `viewkitjs/views/grid`: a multiselect cell's editor names a value no option names as its cell does, as stored (an open field's `north` stays `north`, a stray code stays its code), where it prettified it (`North`); an option it does name, by its label.
98
+ - `viewkitjs/views/controls`: `--vk-shadow-menu`'s dark default drops its 1px ring and is `0 8px 24px hsl(0 0% 0% / 0.5)`. The Pane, the bulk bar's tray and pill, the quick filters' reminder and the text editor's note each draw their own 1px edge, so in the dark they showed a 2px double edge; they now draw one. A pixel comparison of those surfaces in the dark moves by that ring. Light is unchanged. An app that sets `--vk-shadow-menu` itself sees no change.
99
+ - `viewkitjs/views`: a phone's text and values bodies are handed the region a number typed without its country code is read in: the record's (`region` on the column or the field row), else your conventions' `region`. Before, only the record's reached them, so ViewKit's Values editor started a new phone line on the country last kept or the browser's (an en-US browser's "US +1") though your conventions said otherwise. With neither, as before. An app's own `TextBody` or `ValuesBody` now sees `region` where only the conventions hand one.
100
+ - `viewkitjs/views`: the install page is now the six steps an app writes for a whole list (the package with its peers, the stylesheet, the provider with `CONTROLS`, the fields, `<List>` and `listHandler`), a table of what each requires, and where to change each of the four things an app shapes: sizes and colours, its own controls, each menu's and panel's content and order, and the layout. It no longer asks for an adapter: `CONTROLS` fills every control. An app that lets its own Tailwind compile ViewKit (`@source`) is told it declares the controls' tokens (`VK_CONTROL_TOKENS`) too, whose defaults are the ready stylesheet's.
101
+ - `viewkitjs/views`: on a phone at the default `sheetActions: "bar"`, an editor's sheet has one head: the editor's bar holds its ✕ (‹ on a step), its name (`data-slot="vk-editor-title"`) and its ✓ in one row, and your `Sheet` is handed the name in words alone (`label`, no `title`), so by its contract it heads nothing over it. Before, a sheet that drew its own head on a title stood a second row, with a second ✕, over the bar. Under `sheetActions: "head"` nothing changes. A `Sheet` of yours that draws a title from `label` alone now draws it over the bar's.
102
+ - Deprecated, read by nothing and removed in a later release: the message key `views.grid.edit-value` ("Edit value"). A writable long text edits in the text body, and the grid's read-only long-text panel names its box `views.grid.value`. A wording record that names the key still compiles, and ViewKit never shows it; delete that line.
103
+
104
+ ### Fixed
105
+
106
+ - `viewkitjs/views/panels/react`, `viewkitjs/views/list`: a list built with `severalSorts={false}` shows its changed sort on the filter bar ("Sorted by Name") with Clear · Save, as a several-sorts list does, and Clear brings back the saved sort. Its row's Sort lights while the sort differs from the saved view, as the several-sorts row's has since VK-1046, not whenever the list sorts other than its default. With `bar: "always"` its sort stands on the bar at rest too. A list with nothing to sort by draws no sort and no separator on the bar.
107
+ - `viewkitjs/views/panels/react`: with no column a rule may name (every column one the list can't filter), the filter bar draws no + and no empty Filter, which opened a list of greyed fields alone; a set-aside filter still stands. The row's Filter and the phone's sheet already drew nothing then.
108
+ - `viewkitjs/views/grid`: a row's ⋯ no longer fades out under the row menu it opened. While the menu is open, from the ⋯, a right-click or the menu key, the row keeps its hover tint and its ⋯ wherever the pointer goes, and both go when the menu closes.
109
+ - `viewkitjs/views/field-row`: a Tab pressed at once after a pick by the keys in a field row moves on from that row. The pick's editor still fades out for a moment, and a Tab in that gap used to leave the focus back on the row the pick closed (a deal's Stage, where Outcome was next). The Tab is now taken from the row's button once the button is back, so the focus lands on the next control (Shift-Tab, the one before), as a later Tab does. With no Tab, the focus still comes back to the row, and a press on it while it saves still opens nothing.
110
+ - `viewkitjs/views/panels/react`: `ViewPicker` with no view yet opens ViewKit's New view form from its + where the axis hands `verbs` and the components map draws `ViewMenu`, as the views row's + does. On a phone, a ready List whose views store holds no view drew a New view button that did nothing.
111
+ - `viewkitjs/views/styles.unlayered.css`: 0.20.0 called it the same look outside any layer. Only ViewKit's classes sit outside any layer: its reset stays in `base › viewkit`, its `--vk-*` defaults in `components › viewkit` and Tailwind's `@property` fallbacks in `properties`, so an app's own reset and colours still win.
112
+ - `viewkitjs/views/controls`: `CONTROLS.QuickFiltersBody` says "Nothing to pick." (`views.panels.filter-no-options`, in your words) for a field with no value to pick, where it drew an empty list. A search that finds nothing still says "Nothing matches.". `QuickFiltersWords` takes `nothing` for those words.
113
+ - `viewkitjs/views/controls`: `CONTROLS.PartsBody`'s range ends now step within the field's limits with ↑ and ↓, on a computer's boxes, its pair and a phone's card. Before, a headcount range stepped below 0 and the save then refused it. An end typed outside the limits is drawn back to them as its box is left, as the number body's box does.
114
+ - `viewkitjs/views/panels`: the quick filters opened in your own host (`hosts.quick`, or `ToolbarQuickFilters`' `host`) on a computer stand under the panels' header again, their name and a ✕ that closes the host, as the plain panel drew them before `QuickFiltersBody` took over. ViewKit's own Popover is unchanged, and so is a phone. Your own `QuickFiltersBody` in such a host stands under that header too. `QuickFiltersPanel` takes `inHost` for a holder of your own.
115
+ - `viewkitjs/views/grid`: a column's menu, a group's ⋯ menu and "+ Add column" hand your `Menu` the rows they were closed on, no longer an empty list, so a `Menu` that plays an exit shows its rows on its way out, and a focus on one of them stays in it until it has gone, then comes back to the header cell, the ⋯ or the +.
116
+ - `viewkitjs/views/grid`: a group band's ⋯ menu stays where it opened while its Show toggles turn figures on and off. Each figure widens the band's label and moves the ⋯; the menu now opens at the ⋯ and holds that place. Your `Menu` is handed an element standing where the ⋯ stood as its `anchor`, no longer the ⋯ itself.
117
+
8
118
  ## [0.34.0] — 2026-12-03
9
119
 
10
120
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewkitjs",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "ViewKit — typed fields, the grid and its editors, and a list's SQL for record lists, in one package: viewkitjs/fields, viewkitjs/views and viewkitjs/postgres. By Sheaf.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
package/views/README.md CHANGED
@@ -54,7 +54,7 @@ Then mount `ViewsProvider` once with your primitives and draw `GridTable` from `
54
54
  The package ships its documentation in `docs/`, starting at [docs/index.md](./docs/index.md). Every example in it is compiled and run against the packed package before each release.
55
55
 
56
56
  - [Getting started](./docs/getting-started.md): install, fields bound to your rows, columns, your primitives, the provider and the grid.
57
- - [Install](./docs/install.md): the Tailwind line and the colour block.
57
+ - [Install](./docs/install.md): the six steps an app writes for a whole list, the four things it shapes, and your theme.
58
58
 
59
59
  Guides:
60
60
 
@@ -5,9 +5,10 @@ const SIZE = {
5
5
  chip: "h-4 w-4 -my-0.5 shrink-0 rounded-full object-cover",
6
6
  glyph: "h-(--vk-glyph,0.875rem) w-(--vk-glyph,0.875rem) shrink-0 rounded-full object-cover",
7
7
  };
8
+ const PIXELS = "shrink-0 rounded-full object-cover";
8
9
  export function DefaultAvatar({ avatarUrl, size, fallback }) {
9
10
  const [broken, setBroken] = useState(false);
10
11
  if (!avatarUrl || broken)
11
12
  return _jsx(_Fragment, { children: fallback ?? null });
12
- return (_jsx("img", { src: avatarUrl, alt: "", "data-slot": "vk-avatar", className: SIZE[size], draggable: false, onError: () => setBroken(true) }));
13
+ return (_jsx("img", { src: avatarUrl, alt: "", "data-slot": "vk-avatar", className: typeof size === "number" ? PIXELS : SIZE[size], style: typeof size === "number" ? { width: size, height: size } : undefined, draggable: false, onError: () => setBroken(true) }));
13
14
  }
@@ -0,0 +1,2 @@
1
+ import type { ViewsRelationChipProps } from "./types.js";
2
+ export declare function DefaultRelationChip({ fallback }: ViewsRelationChipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
+ export function DefaultRelationChip({ fallback }) {
4
+ return _jsx(_Fragment, { children: fallback });
5
+ }
@@ -6,4 +6,4 @@ import type { ViewsRowMenuProps } from "./types.js";
6
6
  * Delete, and the grid's `row-delete` under `menus.row`.
7
7
  */
8
8
  export declare function deleteAsking({ messages, ports }: Pick<ReturnType<typeof useViews>, "messages" | "ports">, onDelete: (rowId: string) => Promise<void>, rowId: string, deleteLabel?: string): void;
9
- export declare function DefaultRowMenu({ children, rowId, items, openHref, onDelete, deleteLabel }: ViewsRowMenuProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DefaultRowMenu({ children, rowId, items, openHref, onDelete, deleteLabel, onOpenChange }: ViewsRowMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useRef, useState } from "react";
3
+ import { useEffect, useRef, useState } from "react";
4
4
  import { useViews } from "../provider/context.js";
5
5
  const OPEN_GRACE_MS = 300;
6
6
  function inGraceSince(openedAt) {
@@ -50,7 +50,7 @@ export function deleteAsking({ messages, ports }, onDelete, rowId, deleteLabel)
50
50
  return new Promise((resolve) => resolve(onDelete(rowId))).catch(() => ports.toast.error(messages({ key: "views.menus.row-delete-failed" })));
51
51
  });
52
52
  }
53
- export function DefaultRowMenu({ children, rowId, items, openHref, onDelete, deleteLabel }) {
53
+ export function DefaultRowMenu({ children, rowId, items, openHref, onDelete, deleteLabel, onOpenChange }) {
54
54
  const views = useViews();
55
55
  const { components, icons, messages } = views;
56
56
  const { Menu } = components;
@@ -91,6 +91,18 @@ export function DefaultRowMenu({ children, rowId, items, openHref, onDelete, del
91
91
  const rows = toMenuItems(entries).map((row) => (row.onSelect ? { ...row, onSelect: guarded(row.onSelect) } : row));
92
92
  if (point && rows.length === 0)
93
93
  setPoint(null);
94
+ const open = point !== null && rows.length > 0;
95
+ const told = useRef(false);
96
+ const tell = useRef(onOpenChange);
97
+ useEffect(() => {
98
+ tell.current = onOpenChange;
99
+ });
100
+ useEffect(() => {
101
+ if (told.current === open)
102
+ return;
103
+ told.current = open;
104
+ tell.current?.(open);
105
+ }, [open]);
94
106
  return (_jsxs("div", { ref: wrapper, "data-slot": "vk-row-menu", onPointerDownCapture: (event) => {
95
107
  lastPress.current = event.pointerType;
96
108
  }, onKeyDownCapture: () => {
@@ -111,7 +123,7 @@ export function DefaultRowMenu({ children, rowId, items, openHref, onDelete, del
111
123
  if (wrapper.current?.contains(event.target))
112
124
  return;
113
125
  event.stopPropagation();
114
- }, children: [children, _jsx(Menu, { open: point !== null && rows.length > 0, onOpenChange: (open) => {
126
+ }, children: [children, _jsx(Menu, { open: open, onOpenChange: (open) => {
115
127
  if (!open)
116
128
  setPoint(null);
117
129
  }, anchor: point, items: rows, label: messages({ key: "views.menus.row-menu" }) })] }));
@@ -10,6 +10,7 @@ import { DefaultLoadMore } from "./LoadMore.js";
10
10
  import { DefaultPlatformMark } from "./PlatformMark.js";
11
11
  import { DefaultRangeCalendar } from "./RangeCalendar.js";
12
12
  import { DefaultRelationLink } from "./RelationLink.js";
13
+ import { DefaultRelationChip } from "./RelationChip.js";
13
14
  import { DefaultRelationRoles } from "./RelationRoles.js";
14
15
  import { DefaultCellMore } from "./CellMore.js";
15
16
  import { DefaultRow, DefaultRowContent } from "./Row.js";
@@ -32,6 +33,7 @@ export const DEFAULT_VIEWS_ATOMS = {
32
33
  CommandMenu: DefaultCommandMenu,
33
34
  RelationLink: DefaultRelationLink,
34
35
  RelationRoles: DefaultRelationRoles,
36
+ RelationChip: DefaultRelationChip,
35
37
  CellMore: DefaultCellMore,
36
38
  Loading: DefaultLoading,
37
39
  LoadMore: DefaultLoadMore,
@@ -1,4 +1,4 @@
1
- import type { ComponentType, KeyboardEvent, MouseEventHandler, MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent, ReactElement, ReactNode, Ref, RefObject } from "react";
1
+ import type { ComponentType, HTMLAttributes, KeyboardEvent, MouseEventHandler, MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent, ReactElement, ReactNode, Ref, RefObject } from "react";
2
2
  import type { LinkPlatform, RelationValue } from "viewkitjs/fields";
3
3
  import type { CategoryColor } from "viewkitjs/fields/design/category-colors";
4
4
  import type { StatusSlot } from "viewkitjs/fields/design/status-slots";
@@ -57,7 +57,8 @@ export type ViewsTickBoxProps = {
57
57
  className?: string;
58
58
  };
59
59
  /** A person's or a record's picture: a user's, a relation's and an actor's chip, and the name's when the list
60
- * hands the row's avatar. Paint only: whatever wraps it owns the click. */
60
+ * hands the row's avatar; and, where the provider's `panelControls` names `Avatar`, every record's mark ViewKit's panels draw
61
+ * (VK-1044). Data only, never ViewKit's look. Paint only: whatever wraps it owns the click. */
61
62
  export type ViewsAvatarProps = {
62
63
  /** Whose picture: the name the chip or the row shows, for initials. */
63
64
  label: string;
@@ -66,8 +67,10 @@ export type ViewsAvatarProps = {
66
67
  /** The record's kind as your app names it, for the avatar's shape: a relation's `entity`, `user` for a member,
67
68
  * an actor's type. */
68
69
  kind?: string;
69
- /** `chip`: inside a chip, 16px by default. `glyph`: before the name, at `--vk-glyph`. */
70
- size: "chip" | "glyph";
70
+ /** `chip`: inside a chip, 16px by default. `glyph`: before the name, at `--vk-glyph`. A number: a record's mark inside
71
+ * ViewKit's panels (the Picker's rows, the links editor, the bulk bar, the quick filters), in pixels, where the provider's
72
+ * `panelControls` names `Avatar` (VK-1044): 20 on a computer's rows, 24 on a phone's, 40 in a phone's Picker. */
73
+ size: "chip" | "glyph" | 20 | 24 | 32 | 40;
71
74
  /** The glyph the chip or the name draws with no picture. The default draws it when the picture is missing or
72
75
  * fails to load; yours may draw it for a kind it doesn't dress (an automation, say). */
73
76
  fallback?: ReactNode;
@@ -145,6 +148,34 @@ export type ViewsRelationLinkProps = {
145
148
  relation: RelationValue;
146
149
  children: ReactNode;
147
150
  };
151
+ /** What a mentioned record's chip hands the host's link it draws itself as (`ViewsRelationChipProps.render`): its own element's
152
+ * props, its words and mark in `children`, its class, its `data-*`, its ref. The link spreads them on its own element. */
153
+ export type ViewsRelationChipLinkProps = HTMLAttributes<HTMLElement> & {
154
+ ref?: Ref<HTMLElement>;
155
+ children?: ReactNode;
156
+ [data: `data-${string}`]: unknown;
157
+ };
158
+ /** A mentioned record (VK-1053): every relation ViewKit draws, in a table's cell (one and many, and the +N list), a field
159
+ * row's value and `renderFieldValue` (a highlight), and a user field's chip, where the provider's `panelControls` names
160
+ * `RelationChip`. ViewKit places it and hands its data; your app draws it. Left out, ViewKit draws its own chip, as before. */
161
+ export type ViewsRelationChipProps = {
162
+ /** The record: its `id`, its `label`, its kind as your app names it (`entity`: a relation's kind, `user` for a member) and
163
+ * its picture (`avatarUrl`), as the value holds them. */
164
+ relation: RelationValue;
165
+ /** A link's roles, in order, each its stored value and its label: on a `many` relation that declares `links`; else none. */
166
+ roles: readonly {
167
+ value: string;
168
+ label: string;
169
+ }[];
170
+ /** `chip`: in a table's cell or a highlight. `row`: a field row's value (Record details). */
171
+ size: "chip" | "row";
172
+ /** The host's link, where it has one: draw your chip through it, handing it your element's props, and it draws the host's
173
+ * element (a button that opens the record, the app's `RelationLink`, a host's own wrap) with them. Absent: an inert fact
174
+ * (no link, or a host whose own element owns the click). ViewKit never makes one up. */
175
+ render?: (props: ViewsRelationChipLinkProps) => ReactElement;
176
+ /** ViewKit's own chip, as it would draw it here, link included: for a kind your chip doesn't dress. */
177
+ fallback: ReactNode;
178
+ };
148
179
  /** A link's roles, drawn inside its chip after the record's name: each role's stored value and its label (the
149
180
  * field's `links.roles`, else the value itself). Handed only when the link holds one or more, on a many relation
150
181
  * that declares `links`. The default draws their labels in the subtle colour after a middle dot; an app swaps in
@@ -243,6 +274,10 @@ export type ViewsRowMenuProps = {
243
274
  * can't select, and there from the first render where it can, so a long-press is armed before any press.
244
275
  * The default doesn't use it: on a phone the ⋯ is the way in. */
245
276
  onToggleSelect?: () => void;
277
+ /** Tell it when the menu opens (`true`) and when it closes (`false`): while it is open, the grid draws the row it is
278
+ * aimed at as under the pointer (`data-hovered`, its tint and its ⋯), wherever the pointer goes. ViewKit's own
279
+ * calls it; an atom of yours that doesn't leaves the row to the real pointer, as before. */
280
+ onOpenChange?: (open: boolean) => void;
246
281
  };
247
282
  /** Picks one value: its label, a second line, a right-hand `meta` (a sample, a count), the check when chosen. */
248
283
  export type ViewsChoiceRowProps = {
@@ -490,6 +525,7 @@ export type ViewsAtoms = {
490
525
  CommandMenu: ComponentType<ViewsCommandMenuProps>;
491
526
  RelationLink: ComponentType<ViewsRelationLinkProps>;
492
527
  RelationRoles: ComponentType<ViewsRelationRolesProps>;
528
+ RelationChip: ComponentType<ViewsRelationChipProps>;
493
529
  CellMore: ComponentType<ViewsCellMoreProps>;
494
530
  Loading: ComponentType<ViewsLoadingProps>;
495
531
  LoadMore: ComponentType<ViewsLoadMoreProps>;
@@ -3,18 +3,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { CHIP_INTERACTIVE } from "../internal/chip.js";
4
4
  import { cx } from "../internal/cx.js";
5
5
  import { ELEMENT_RESET } from "../internal/reset.js";
6
+ import { withRelationLink } from "../display/relation-link.js";
6
7
  import { useViews } from "../provider/context.js";
7
8
  export function listRelationWrap(opts) {
8
9
  if (opts?.slotOwnsClick)
9
10
  return undefined;
10
11
  const onOpenRelation = opts?.onOpenRelation;
11
12
  if (onOpenRelation) {
12
- return function openRelationWrap(relation, chip) {
13
+ return withRelationLink(function openRelationWrap(relation, chip) {
13
14
  return (_jsx("button", { type: "button", "data-no-nav": true, "data-slot": "vk-relation-link", title: relation.label, onClick: (event) => {
14
15
  event.stopPropagation();
15
16
  onOpenRelation(relation);
16
17
  }, className: cx(ELEMENT_RESET, CHIP_INTERACTIVE), children: chip }));
17
- };
18
+ }, (relation) => function openRelationLink({ className, onClick, ref, ...props }) {
19
+ return (_jsx("button", { ref: ref, type: "button", "data-no-nav": true, "data-slot": "vk-relation-link", title: relation.label, ...props, className: cx(ELEMENT_RESET, className), onClick: (event) => {
20
+ event.stopPropagation();
21
+ onClick?.(event);
22
+ onOpenRelation(relation);
23
+ } }));
24
+ });
18
25
  }
19
26
  return function appRelationWrap(relation, chip) {
20
27
  return _jsx(AppRelationLink, { relation: relation, children: chip });
@@ -13,7 +13,7 @@ export declare const VK_PREFIX: "vk";
13
13
  export declare const GRID_SLOTS: readonly ["vk-grid", "vk-grid-pan", "vk-grid-scroll", "vk-grid-head", "vk-grid-header", "vk-grid-header-cell", "vk-grid-row", "vk-grid-rows", "vk-grid-gap", "vk-grid-cell", "vk-grid-title", "vk-grid-group", "vk-grid-group-head", "vk-grid-group-header", "vk-grid-group-count", "vk-grid-group-figure", "vk-grid-group-dot", "vk-grid-footer", "vk-grid-footer-cell", "vk-grid-figure-label", "vk-grid-figure-value", "vk-grid-figure-pick", "vk-grid-rail", "vk-grid-frozen-shadow", "vk-grid-name-check", "vk-grid-tail", "vk-grid-row-more", "vk-grid-editor", "vk-grid-outline", "vk-grid-resize-handle", "vk-grid-pager", "vk-grid-pager-range", "vk-grid-pager-size", "vk-grid-pager-previous", "vk-grid-pager-next"];
14
14
  export type GridSlot = (typeof GRID_SLOTS)[number];
15
15
  /** The flags the rendering styles, as `data-*` attributes present when true. */
16
- export declare const GRID_STATES: readonly ["focused", "selected", "hovered", "editing", "in-range", "range-edge", "pending", "invalid", "dragging", "empty", "frozen", "frozen-edge", "scrolled", "parked", "collapsed", "stuck", "open", "desktop"];
16
+ export declare const GRID_STATES: readonly ["focused", "selected", "hovered", "active", "editing", "in-range", "range-edge", "pending", "invalid", "dragging", "empty", "frozen", "frozen-edge", "scrolled", "parked", "collapsed", "stuck", "open", "desktop"];
17
17
  export type GridState = (typeof GRID_STATES)[number];
18
18
  /** The CSS variables the package owns: geometry and density. Its colours are `VK_COLOURS`, which the app declares.
19
19
  * The last three are `densityStyle`'s, written on the root of a rows view an app draws itself. */
@@ -116,7 +116,7 @@ export type ComponentName = (typeof COMPONENT_NAMES)[number];
116
116
  export declare const OPTIONAL_COMPONENT_NAMES: readonly ["Input", "Select", "Command", "Calendar", "RowsWait", "GroupBody", "SearchField", "PortsHost", "SelectionBar", "ViewMenu", "Pane"];
117
117
  export type OptionalComponentName = (typeof OPTIONAL_COMPONENT_NAMES)[number];
118
118
  /** The pieces the rendering is built from, and the app's own pieces it cannot draw itself (a command cell's verb menu, the row's right-click menu, where a relation goes, a wait, how a list asks for more), and the rows the panels draw with. Each ships as a default; an app swaps any of them through the provider's `atoms`. */
119
- export declare const ATOM_NAMES: readonly ["Row", "RowContent", "TickBox", "StatusBadge", "StatusMarker", "Tag", "List", "CommandMenu", "RelationLink", "RelationRoles", "CellMore", "Loading", "LoadMore", "PlatformMark", "RowMenu", "SelectionSheet", "ChoiceRow", "CheckRow", "RadioRow", "DirectionButton", "MenuRow", "ToggleRow", "PanelSearch", "Pill", "RangeCalendar", "ToolbarButton", "Avatar"];
119
+ export declare const ATOM_NAMES: readonly ["Row", "RowContent", "TickBox", "StatusBadge", "StatusMarker", "Tag", "List", "CommandMenu", "RelationLink", "RelationRoles", "RelationChip", "CellMore", "Loading", "LoadMore", "PlatformMark", "RowMenu", "SelectionSheet", "ChoiceRow", "CheckRow", "RadioRow", "DirectionButton", "MenuRow", "ToggleRow", "PanelSearch", "Pill", "RangeCalendar", "ToolbarButton", "Avatar"];
120
120
  export type AtomName = (typeof ATOM_NAMES)[number];
121
121
  /** The parts inside the default panels, by panel (VK-988): each its public `data-slot`, prefixed with the panel's own short name.
122
122
  * A part that repeats also says which one it is (`data-key`) and, a sort or filter rule, its place (`data-index`). */
@@ -124,14 +124,14 @@ export declare const PANEL_SLOTS: {
124
124
  readonly sort: readonly ["vk-sort", "vk-sort-rules", "vk-sort-rule", "vk-sort-grip", "vk-sort-field", "vk-sort-direction", "vk-sort-remove", "vk-sort-rule-open", "vk-sort-rule-more", "vk-sort-rule-action", "vk-sort-direction-option", "vk-sort-add", "vk-sort-clear", "vk-sort-foot", "vk-sort-none", "vk-sort-head"];
125
125
  readonly filter: readonly ["vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-quantifier", "vk-filter-group-more", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-filter-head", "vk-filter-part-value", "vk-filter-part-pair"];
126
126
  readonly group: readonly ["vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove"];
127
- readonly customize: readonly ["vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-toggle-reset", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale", "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot"];
127
+ readonly customize: readonly ["vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale", "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot"];
128
128
  readonly viewsList: readonly ["vk-views-list", "vk-views-list-row", "vk-views-list-head"];
129
129
  readonly viewMenu: readonly ["vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act"];
130
130
  readonly quick: readonly ["vk-quick", "vk-quick-field", "vk-quick-search", "vk-quick-value", "vk-quick-count", "vk-quick-clear", "vk-quick-none", "vk-quick-head", "vk-quick-strip", "vk-quick-values"];
131
131
  };
132
132
  export type PanelSlot = (typeof PANEL_SLOTS)[keyof typeof PANEL_SLOTS][number];
133
133
  /** The default atoms' `data-slot` values: prefixed, like the grid's. */
134
- export declare const ATOM_SLOTS: readonly ["vk-row", "vk-row-content", "vk-tick", "vk-avatar", "vk-status", "vk-marker", "vk-tag", "vk-list", "vk-command-menu", "vk-relation-link", "vk-relation-roles", "vk-loading", "vk-load-more", "vk-platform", "vk-row-menu", "vk-choice-row", "vk-check-row", "vk-radio-row", "vk-direction", "vk-menu-row", "vk-toggle-row", "vk-panel-search", "vk-selection-sheet", "vk-pill", "vk-views-row", "vk-views-more", "vk-cell-more", "vk-show-more", "vk-phone", "vk-conversion", "vk-field-retry", "vk-views-chip", "vk-views-add", "vk-range-calendar", "vk-toolbar-button", "vk-toolbar-word", "vk-toolbar-count", "vk-toolbar-dot", "vk-toolbar-words", "vk-toolbar-more", "vk-toolbar-chevron", "vk-toolbar", "vk-toolbar-line", "vk-toolbar-cluster", "vk-toolbar-search", "vk-toolbar-search-field", "vk-toolbar-search-clear", "vk-toolbar-search-spinner", "vk-toolbar-new", "vk-toolbar-options", "vk-toolbar-options-panel", "vk-toolbar-sort", "vk-toolbar-sort-panel", "vk-toolbar-sort-pill", "vk-toolbar-sort-add", "vk-sort-head", "vk-filter-head", "vk-toolbar-quick", "vk-toolbar-quick-panel", "vk-quick-filters-reminder", "vk-quick-filters-reminder-open", "vk-quick-filters-reminder-clear", "vk-toolbar-filter", "vk-toolbar-filter-panel", "vk-toolbar-advanced-filter", "vk-toolbar-advanced-filter-panel", "vk-toolbar-filters", "vk-toolbar-filter-rule", "vk-toolbar-filter-aside", "vk-toolbar-filter-add", "vk-toolbar-more-filters", "vk-toolbar-filters-panel", "vk-toolbar-overflow", "vk-toolbar-separator", "vk-toolbar-save", "vk-toolbar-clear", "vk-toolbar-save-button", "vk-filter-convert", "vk-sort", "vk-sort-rules", "vk-sort-rule", "vk-sort-grip", "vk-sort-field", "vk-sort-direction", "vk-sort-remove", "vk-sort-rule-open", "vk-sort-rule-more", "vk-sort-rule-action", "vk-sort-direction-option", "vk-sort-add", "vk-sort-clear", "vk-sort-foot", "vk-sort-none", "vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-group-more", "vk-filter-quantifier", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove", "vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-toggle-reset", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale", "vk-views-list", "vk-views-list-row", "vk-views-list-head", "vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act", "vk-quick", "vk-quick-field", "vk-quick-search", "vk-quick-value", "vk-quick-count", "vk-quick-clear", "vk-quick-none", "vk-quick-head", "vk-filter-part-value", "vk-filter-part-pair", "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot", "vk-quick-strip", "vk-quick-values"];
134
+ export declare const ATOM_SLOTS: readonly ["vk-row", "vk-row-content", "vk-tick", "vk-avatar", "vk-status", "vk-marker", "vk-tag", "vk-list", "vk-command-menu", "vk-relation-link", "vk-relation-roles", "vk-loading", "vk-load-more", "vk-platform", "vk-row-menu", "vk-choice-row", "vk-check-row", "vk-radio-row", "vk-direction", "vk-menu-row", "vk-toggle-row", "vk-panel-search", "vk-selection-sheet", "vk-pill", "vk-views-row", "vk-views-more", "vk-cell-more", "vk-show-more", "vk-phone", "vk-conversion", "vk-field-retry", "vk-views-chip", "vk-views-add", "vk-range-calendar", "vk-toolbar-button", "vk-toolbar-word", "vk-toolbar-count", "vk-toolbar-dot", "vk-toolbar-words", "vk-toolbar-more", "vk-toolbar-chevron", "vk-toolbar", "vk-toolbar-line", "vk-toolbar-cluster", "vk-toolbar-search", "vk-toolbar-search-field", "vk-toolbar-search-clear", "vk-toolbar-search-spinner", "vk-toolbar-new", "vk-toolbar-options", "vk-toolbar-options-panel", "vk-toolbar-sort", "vk-toolbar-sort-panel", "vk-toolbar-sort-pill", "vk-toolbar-sort-add", "vk-sort-head", "vk-filter-head", "vk-toolbar-quick", "vk-toolbar-quick-panel", "vk-quick-filters-reminder", "vk-quick-filters-reminder-open", "vk-quick-filters-reminder-clear", "vk-toolbar-filter", "vk-toolbar-filter-panel", "vk-toolbar-advanced-filter", "vk-toolbar-advanced-filter-panel", "vk-toolbar-filters", "vk-toolbar-filter-rule", "vk-toolbar-filter-aside", "vk-toolbar-filter-add", "vk-toolbar-more-filters", "vk-toolbar-filters-panel", "vk-toolbar-overflow", "vk-toolbar-separator", "vk-toolbar-save", "vk-toolbar-clear", "vk-toolbar-save-button", "vk-filter-convert", "vk-sort", "vk-sort-rules", "vk-sort-rule", "vk-sort-grip", "vk-sort-field", "vk-sort-direction", "vk-sort-remove", "vk-sort-rule-open", "vk-sort-rule-more", "vk-sort-rule-action", "vk-sort-direction-option", "vk-sort-add", "vk-sort-clear", "vk-sort-foot", "vk-sort-none", "vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-group-more", "vk-filter-quantifier", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove", "vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale", "vk-views-list", "vk-views-list-row", "vk-views-list-head", "vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act", "vk-quick", "vk-quick-field", "vk-quick-search", "vk-quick-value", "vk-quick-count", "vk-quick-clear", "vk-quick-none", "vk-quick-head", "vk-filter-part-value", "vk-filter-part-pair", "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot", "vk-quick-strip", "vk-quick-values"];
135
135
  export type AtomSlot = (typeof ATOM_SLOTS)[number];
136
136
  /** The parts of the bulk bar (`CONTROLS.SelectionBar`, `BulkBar`) and of what it opens (VK-1023): each part's public `data-slot`,
137
137
  * in every form (a computer's bar, the phone's tray and pill). A verb's button and a menu's row say which one they are by
@@ -158,7 +158,7 @@ export declare const EDITOR_PART_SLOTS: {
158
158
  };
159
159
  /** The editor panel's `data-slot` values: prefixed, like the grid's. Then the frames an app's body or a read-only editor stands
160
160
  * in, and the parts inside the default field editors. */
161
- export declare const EDITOR_SLOTS: readonly ["vk-editor-panel", "vk-editor-bar", "vk-editor-refusal", "vk-text-editor", "vk-date-editor", "vk-text-body", "vk-number-body", "vk-parts-body", "vk-values-body", "vk-links-body", ...("vk-editor-close" | "vk-editor-save" | "vk-editor-back" | "vk-editor-cancel" | "vk-date" | "vk-calendar" | "vk-date-line" | "vk-date-reads" | "vk-date-error" | "vk-date-time" | "vk-date-head" | "vk-date-prev" | "vk-date-next" | "vk-date-month" | "vk-date-year" | "vk-date-days" | "vk-date-weekdays" | "vk-date-day" | "vk-date-choices" | "vk-date-choice" | "vk-date-quarters" | "vk-date-quarter" | "vk-date-parts" | "vk-date-part" | "vk-date-segment" | "vk-date-sep" | "vk-date-picks" | "vk-date-pick" | "vk-date-card" | "vk-date-wheels" | "vk-date-wheel" | "vk-date-wheel-row" | "vk-text" | "vk-text-box" | "vk-text-country" | "vk-text-dial" | "vk-text-note" | "vk-number" | "vk-number-box" | "vk-number-currency" | "vk-number-unit" | "vk-parts" | "vk-parts-field" | "vk-parts-box" | "vk-parts-line" | "vk-parts-own" | "vk-parts-card" | "vk-parts-pair" | "vk-parts-note" | "vk-parts-bands" | "vk-values" | "vk-values-rows" | "vk-values-row" | "vk-values-value" | "vk-values-edit" | "vk-values-label" | "vk-values-main" | "vk-values-pill" | "vk-values-acts" | "vk-values-grip" | "vk-values-copy" | "vk-values-open" | "vk-values-remove" | "vk-values-line" | "vk-values-code" | "vk-values-prefix" | "vk-values-add" | "vk-values-back" | "vk-values-error" | "vk-links" | "vk-links-search" | "vk-links-list" | "vk-links-head" | "vk-links-rows" | "vk-links-row" | "vk-links-name" | "vk-links-field" | "vk-links-value" | "vk-links-control" | "vk-links-pop" | "vk-links-lead" | "vk-links-remove" | "vk-links-config" | "vk-links-more" | "vk-links-action" | "vk-links-step" | "vk-links-back" | "vk-links-unlink" | "vk-links-offers" | "vk-links-offer" | "vk-links-offer-action" | "vk-links-note" | "vk-links-retry" | "vk-picker" | "vk-picker-search" | "vk-picker-list" | "vk-picker-chips" | "vk-picker-chip" | "vk-picker-option" | "vk-picker-parent" | "vk-picker-empty" | "vk-picker-add" | "vk-picker-create" | "vk-picker-action" | "vk-picker-group" | "vk-picker-heading" | "vk-picker-card" | "vk-picker-selected" | "vk-picker-tick" | "vk-picker-row-more" | "vk-picker-more" | "vk-picker-back" | "vk-picker-count" | "vk-picker-clear" | "vk-picker-lead" | "vk-picker-lead-make" | "vk-picker-message" | "vk-picker-retry" | "vk-picker-loading" | "vk-picker-foot")[]];
161
+ export declare const EDITOR_SLOTS: readonly ["vk-editor-panel", "vk-editor-bar", "vk-editor-title", "vk-editor-refusal", "vk-text-editor", "vk-date-editor", "vk-text-body", "vk-number-body", "vk-parts-body", "vk-values-body", "vk-links-body", ...("vk-editor-close" | "vk-editor-save" | "vk-editor-back" | "vk-editor-cancel" | "vk-date" | "vk-calendar" | "vk-date-line" | "vk-date-reads" | "vk-date-error" | "vk-date-time" | "vk-date-head" | "vk-date-prev" | "vk-date-next" | "vk-date-month" | "vk-date-year" | "vk-date-days" | "vk-date-weekdays" | "vk-date-day" | "vk-date-choices" | "vk-date-choice" | "vk-date-quarters" | "vk-date-quarter" | "vk-date-parts" | "vk-date-part" | "vk-date-segment" | "vk-date-sep" | "vk-date-picks" | "vk-date-pick" | "vk-date-card" | "vk-date-wheels" | "vk-date-wheel" | "vk-date-wheel-row" | "vk-text" | "vk-text-box" | "vk-text-country" | "vk-text-dial" | "vk-text-note" | "vk-number" | "vk-number-box" | "vk-number-currency" | "vk-number-unit" | "vk-parts" | "vk-parts-field" | "vk-parts-box" | "vk-parts-line" | "vk-parts-own" | "vk-parts-card" | "vk-parts-pair" | "vk-parts-note" | "vk-parts-bands" | "vk-values" | "vk-values-rows" | "vk-values-row" | "vk-values-value" | "vk-values-edit" | "vk-values-label" | "vk-values-main" | "vk-values-pill" | "vk-values-acts" | "vk-values-grip" | "vk-values-copy" | "vk-values-open" | "vk-values-remove" | "vk-values-line" | "vk-values-code" | "vk-values-prefix" | "vk-values-add" | "vk-values-back" | "vk-values-error" | "vk-links" | "vk-links-search" | "vk-links-list" | "vk-links-head" | "vk-links-rows" | "vk-links-row" | "vk-links-name" | "vk-links-field" | "vk-links-value" | "vk-links-control" | "vk-links-pop" | "vk-links-lead" | "vk-links-remove" | "vk-links-config" | "vk-links-more" | "vk-links-action" | "vk-links-step" | "vk-links-back" | "vk-links-unlink" | "vk-links-offers" | "vk-links-offer" | "vk-links-offer-action" | "vk-links-note" | "vk-links-retry" | "vk-picker" | "vk-picker-search" | "vk-picker-list" | "vk-picker-chips" | "vk-picker-chip" | "vk-picker-option" | "vk-picker-parent" | "vk-picker-empty" | "vk-picker-add" | "vk-picker-create" | "vk-picker-action" | "vk-picker-group" | "vk-picker-heading" | "vk-picker-card" | "vk-picker-selected" | "vk-picker-tick" | "vk-picker-row-more" | "vk-picker-more" | "vk-picker-back" | "vk-picker-count" | "vk-picker-clear" | "vk-picker-lead" | "vk-picker-lead-make" | "vk-picker-message" | "vk-picker-retry" | "vk-picker-loading" | "vk-picker-foot")[]];
162
162
  export type EditorSlot = (typeof EDITOR_SLOTS)[number];
163
163
  /** The editor panel's states. `vk-body` names the app's own body a popover holds (`picker`, `parts`, `values` or `links`). */
164
164
  export declare const EDITOR_STATES: readonly ["vk-body"];
@@ -673,7 +673,10 @@ export type ViewsMessage = {
673
673
  key: "views.grid.change-value";
674
674
  } | {
675
675
  key: "views.grid.value";
676
- } | {
676
+ }
677
+ /** @deprecated Read by nothing since VK-893: a writable long text edits in the text body, and the read-only panel names its box
678
+ * `views.grid.value`. Kept so an app's wording record that names it still compiles; removed in a later release (VK-899). */
679
+ | {
677
680
  key: "views.grid.edit-value";
678
681
  } | {
679
682
  key: "views.grid.read-only";
@@ -40,6 +40,7 @@ export const GRID_STATES = [
40
40
  "focused",
41
41
  "selected",
42
42
  "hovered",
43
+ "active",
43
44
  "editing",
44
45
  "in-range",
45
46
  "range-edge",
@@ -256,6 +257,7 @@ export const ATOM_NAMES = [
256
257
  "CommandMenu",
257
258
  "RelationLink",
258
259
  "RelationRoles",
260
+ "RelationChip",
259
261
  "CellMore",
260
262
  "Loading",
261
263
  "LoadMore",
@@ -279,7 +281,7 @@ export const PANEL_SLOTS = {
279
281
  filter: ["vk-filter", "vk-filter-rules", "vk-filter-item", "vk-filter-rule", "vk-filter-where", "vk-filter-joined", "vk-filter-join", "vk-filter-field", "vk-filter-how", "vk-filter-value", "vk-filter-rule-more", "vk-filter-rule-action", "vk-filter-group", "vk-filter-group-head", "vk-filter-quantifier", "vk-filter-group-more", "vk-filter-group-action", "vk-filter-delete", "vk-filter-add", "vk-filter-clear", "vk-filter-foot", "vk-filter-none", "vk-filter-excluded", "vk-filter-head",
280
282
  "vk-filter-part-value", "vk-filter-part-pair"],
281
283
  group: ["vk-group", "vk-group-setting", "vk-group-choice", "vk-group-heading", "vk-group-value", "vk-group-hide-all", "vk-group-remove"],
282
- customize: ["vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-toggle-reset", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale",
284
+ customize: ["vk-customize", "vk-customize-head", "vk-customize-title", "vk-customize-back", "vk-customize-close", "vk-customize-layout-button", "vk-customize-name", "vk-customize-heading", "vk-customize-section", "vk-customize-field", "vk-customize-toggle", "vk-customize-choice", "vk-customize-option", "vk-customize-layout", "vk-customize-column", "vk-customize-search", "vk-customize-columns-action", "vk-customize-foot", "vk-customize-changes", "vk-customize-action", "vk-customize-stale",
283
285
  "vk-customize-none", "vk-customize-rows", "vk-customize-columns-foot"],
284
286
  viewsList: ["vk-views-list", "vk-views-list-row", "vk-views-list-head"],
285
287
  viewMenu: ["vk-view-menu", "vk-view-menu-row", "vk-view-menu-name", "vk-view-menu-layout", "vk-view-menu-columns", "vk-view-menu-act"],
@@ -421,7 +423,6 @@ export const ATOM_SLOTS = [
421
423
  "vk-customize-section",
422
424
  "vk-customize-field",
423
425
  "vk-customize-toggle",
424
- "vk-customize-toggle-reset",
425
426
  "vk-customize-choice",
426
427
  "vk-customize-option",
427
428
  "vk-customize-layout",
@@ -500,6 +501,7 @@ export const EDITOR_PART_SLOTS = {
500
501
  export const EDITOR_SLOTS = [
501
502
  "vk-editor-panel",
502
503
  "vk-editor-bar",
504
+ "vk-editor-title",
503
505
  "vk-editor-refusal",
504
506
  "vk-text-editor",
505
507
  "vk-date-editor",
@@ -0,0 +1,4 @@
1
+ /** The component itself, flagged as a picture that takes the Avatar's pixel sizes. */
2
+ export declare function markAvatar<C extends object>(component: C): C;
3
+ /** Whether a component is flagged as a picture that takes the Avatar's pixel sizes. */
4
+ export declare const isAvatarMark: (component: unknown) => boolean;
@@ -0,0 +1,5 @@
1
+ const AVATAR_MARK = Symbol.for("viewkitjs.views.avatar-mark");
2
+ export function markAvatar(component) {
3
+ return Object.defineProperty(component, AVATAR_MARK, { value: true, enumerable: false });
4
+ }
5
+ export const isAvatarMark = (component) => (typeof component === "function" || (typeof component === "object" && component !== null)) && component[AVATAR_MARK] === true;
@@ -24,12 +24,15 @@ export interface AvatarProps {
24
24
  id?: string;
25
25
  /** The tone itself, where the app keeps it. */
26
26
  tone?: 1 | 2 | 3 | 4 | 5 | 6;
27
- /** A square's own colour (a team's letter, an app's or an object's icon, the workspace's initials on the colour picked
28
- * for it): the square on the hue's fill, what it holds in the hue's strong ink, with no edge. A person keeps their tone. */
27
+ /** A square's own colour (a team's letter, the workspace's initials on the colour picked for it): the square on the hue's
28
+ * fill, its letter in the hue's strong ink, with no edge. A person keeps their tone. With an `icon`, a person's or a thing's,
29
+ * it is the object's colour, which the frame's Ground and Icon colour may draw it in (looks.ts). */
29
30
  colour?: AvatarColour;
30
- /** A photo or a logo, filling the same shape. */
31
+ /** A photo or a logo, filling the same shape; it always wins. */
31
32
  src?: string;
32
- /** A record with no name: its kind's icon instead of a letter. */
33
+ /** Its object's icon (a deal's, a company's, a person's), drawn when there is no picture: on a person or a thing, by the
34
+ * frame's With no picture, Ground and Icon colour (looks.ts), Quiet grey and a grey ink with nothing set; the workspace's and
35
+ * an agent's own mark. */
33
36
  icon?: React.ReactNode;
34
37
  /** Whether a person is here now: here, a green dot; away, a hollow ring; offline, leave it out. Wins over a badge. */
35
38
  presence?: AvatarPresence;