viewkitjs 0.33.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 (257) hide show
  1. package/CHANGELOG.md +139 -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 +27 -14
  13. package/views/dist/contract.js +40 -4
  14. package/views/dist/controls/alert/alert.js +2 -1
  15. package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
  16. package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
  17. package/views/dist/controls/avatar/avatar-mark.js +5 -0
  18. package/views/dist/controls/avatar/avatar.d.ts +7 -4
  19. package/views/dist/controls/avatar/avatar.js +10 -4
  20. package/views/dist/controls/avatar/looks.d.ts +1 -1
  21. package/views/dist/controls/avatar/looks.js +3 -0
  22. package/views/dist/controls/avatar/record-mark.d.ts +16 -0
  23. package/views/dist/controls/avatar/record-mark.js +13 -0
  24. package/views/dist/controls/avatar/tokens.d.ts +12 -0
  25. package/views/dist/controls/avatar/tokens.js +3 -0
  26. package/views/dist/controls/avatar.css +54 -17
  27. package/views/dist/controls/bulk-bar/bulk-bar.js +29 -27
  28. package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
  29. package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
  30. package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
  31. package/views/dist/controls/compound-editor/map-parts-body.js +6 -1
  32. package/views/dist/controls/compound-editor/name-parts.js +2 -1
  33. package/views/dist/controls/compound-editor/place-parts.js +2 -2
  34. package/views/dist/controls/compound-editor/range-parts.js +10 -9
  35. package/views/dist/controls/controls.d.ts +2 -0
  36. package/views/dist/controls/controls.js +2 -0
  37. package/views/dist/controls/customize/customize.d.ts +14 -5
  38. package/views/dist/controls/customize/customize.js +19 -20
  39. package/views/dist/controls/customize/map-customize-body.d.ts +2 -2
  40. package/views/dist/controls/customize/map-customize-body.js +15 -13
  41. package/views/dist/controls/customize/words.d.ts +3 -3
  42. package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
  43. package/views/dist/controls/date-editor/date-editor.js +13 -7
  44. package/views/dist/controls/date-editor/map-calendar.js +2 -0
  45. package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
  46. package/views/dist/controls/date-editor/map-date-body.js +7 -3
  47. package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
  48. package/views/dist/controls/filter-editor/filter-editor.js +4 -6
  49. package/views/dist/controls/filter-editor/map-filter-body.d.ts +2 -0
  50. package/views/dist/controls/filter-editor/map-filter-body.js +7 -4
  51. package/views/dist/controls/filter-editor/parts.d.ts +4 -2
  52. package/views/dist/controls/filter-editor/parts.js +8 -7
  53. package/views/dist/controls/group-editor/group-editor.js +2 -1
  54. package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
  55. package/views/dist/controls/group-editor/map-group-body.js +5 -1
  56. package/views/dist/controls/index.d.ts +1 -1
  57. package/views/dist/controls/input/input.js +2 -1
  58. package/views/dist/controls/internal/head-button.d.ts +9 -0
  59. package/views/dist/controls/internal/head-button.js +13 -0
  60. package/views/dist/controls/internal/map-panel-controls.js +9 -5
  61. package/views/dist/controls/internal/panel-controls.d.ts +38 -6
  62. package/views/dist/controls/internal/panel-controls.js +191 -19
  63. package/views/dist/controls/links-editor/links-editor.js +5 -7
  64. package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
  65. package/views/dist/controls/links-editor/map-links-body.js +5 -1
  66. package/views/dist/controls/menu/menu.d.ts +5 -1
  67. package/views/dist/controls/menu/menu.js +4 -3
  68. package/views/dist/controls/modal/modal.js +5 -3
  69. package/views/dist/controls/number-editor/map-number-body.js +5 -1
  70. package/views/dist/controls/number-editor/number-editor.js +6 -6
  71. package/views/dist/controls/pane/map-pane.d.ts +3 -0
  72. package/views/dist/controls/pane/map-pane.js +5 -0
  73. package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
  74. package/views/dist/controls/picker/map-fields-body.js +30 -2
  75. package/views/dist/controls/picker/map-picker.d.ts +8 -3
  76. package/views/dist/controls/picker/map-picker.js +14 -3
  77. package/views/dist/controls/picker/picker.js +11 -8
  78. package/views/dist/controls/picker/rows.d.ts +7 -2
  79. package/views/dist/controls/picker.css +10 -1
  80. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
  81. package/views/dist/controls/quick-filters/map-quick-filters-body.js +9 -4
  82. package/views/dist/controls/quick-filters/quick-filters.js +8 -6
  83. package/views/dist/controls/quick-filters/reminder.js +2 -2
  84. package/views/dist/controls/quick-filters/rules.d.ts +4 -1
  85. package/views/dist/controls/quick-filters/words.d.ts +2 -0
  86. package/views/dist/controls/quick-filters/words.js +1 -0
  87. package/views/dist/controls/select/select.d.ts +3 -0
  88. package/views/dist/controls/select/select.js +9 -3
  89. package/views/dist/controls/setting-row/looks.js +5 -5
  90. package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
  91. package/views/dist/controls/setting-row/setting-row.js +3 -1
  92. package/views/dist/controls/setting-row.css +3 -2
  93. package/views/dist/controls/sheet/bottom-sheet.d.ts +3 -1
  94. package/views/dist/controls/sheet/bottom-sheet.js +2 -2
  95. package/views/dist/controls/sort-editor/map-sort-body.js +4 -4
  96. package/views/dist/controls/sort-editor/sort-editor.d.ts +2 -0
  97. package/views/dist/controls/sort-editor/sort-editor.js +4 -5
  98. package/views/dist/controls/text-editor/map-text-body.js +5 -1
  99. package/views/dist/controls/text-editor/text-editor.js +5 -4
  100. package/views/dist/controls/toolbar/toolbar.d.ts +29 -14
  101. package/views/dist/controls/toolbar/toolbar.js +17 -22
  102. package/views/dist/controls/toolbar.css +0 -5
  103. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  104. package/views/dist/controls/tooltip/map-tooltip.js +4 -2
  105. package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
  106. package/views/dist/controls/values-editor/map-values-body.js +5 -1
  107. package/views/dist/controls/values-editor/values-editor.js +8 -7
  108. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
  109. package/views/dist/controls/views-list/map-view-menu.js +6 -2
  110. package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
  111. package/views/dist/controls/views-list/map-views-list-body.js +6 -5
  112. package/views/dist/controls/views-list/view-menu.js +3 -4
  113. package/views/dist/controls/views-list/views-list.js +2 -2
  114. package/views/dist/display/option-badges.d.ts +16 -0
  115. package/views/dist/display/option-badges.js +11 -0
  116. package/views/dist/display/relation-link.d.ts +12 -0
  117. package/views/dist/display/relation-link.js +17 -0
  118. package/views/dist/display/relation.d.ts +1 -1
  119. package/views/dist/display/relation.js +10 -3
  120. package/views/dist/display/select.js +1 -8
  121. package/views/dist/editors/EditorPanel.js +4 -4
  122. package/views/dist/editors/RangeEditor.d.ts +3 -0
  123. package/views/dist/editors/RangeEditor.js +2 -2
  124. package/views/dist/editors/SelectEditor.d.ts +2 -2
  125. package/views/dist/editors/SelectEditor.js +1 -1
  126. package/views/dist/editors/TextEditor.js +4 -2
  127. package/views/dist/editors/ValueListEditor.js +2 -1
  128. package/views/dist/field-row/FieldRow.js +32 -5
  129. package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
  130. package/views/dist/grid/chrome/GridAddColumn.js +9 -6
  131. package/views/dist/grid/chrome/GridCellEditors.js +1 -1
  132. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
  133. package/views/dist/grid/chrome/GridCellOutline.js +16 -6
  134. package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
  135. package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
  136. package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
  137. package/views/dist/grid/chrome/GridFooter.js +4 -4
  138. package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
  139. package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
  140. package/views/dist/grid/chrome/GridHeader.js +1 -2
  141. package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
  142. package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
  143. package/views/dist/grid/chrome/GridRow.js +5 -3
  144. package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
  145. package/views/dist/grid/chrome/GridRowActions.js +2 -2
  146. package/views/dist/grid/chrome/GridRowCells.js +3 -2
  147. package/views/dist/grid/chrome/GridStructure.js +1 -1
  148. package/views/dist/grid/chrome/GridTable.js +32 -20
  149. package/views/dist/grid/chrome/checks.d.ts +1 -1
  150. package/views/dist/grid/chrome/checks.js +4 -1
  151. package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
  152. package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
  153. package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
  154. package/views/dist/grid/chrome/grid-hover.js +14 -4
  155. package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
  156. package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
  157. package/views/dist/grid/chrome/grid-table-props.d.ts +10 -2
  158. package/views/dist/grid/grid.css +6 -0
  159. package/views/dist/grid/looks.d.ts +3 -1
  160. package/views/dist/grid/looks.js +10 -4
  161. package/views/dist/list/layer.d.ts +8 -0
  162. package/views/dist/list/layer.js +7 -0
  163. package/views/dist/list/list.d.ts +6 -2
  164. package/views/dist/list/list.js +6 -2
  165. package/views/dist/list/parts.js +3 -2
  166. package/views/dist/list/store.d.ts +1 -1
  167. package/views/dist/list/toolbar.js +51 -20
  168. package/views/dist/list/views.js +1 -0
  169. package/views/dist/panels/availability.d.ts +5 -0
  170. package/views/dist/panels/availability.js +4 -5
  171. package/views/dist/panels/customize-body.d.ts +4 -0
  172. package/views/dist/panels/customize-body.js +13 -11
  173. package/views/dist/panels/model.d.ts +9 -4
  174. package/views/dist/panels/react/customize-body.js +5 -2
  175. package/views/dist/panels/react/customize.d.ts +5 -0
  176. package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
  177. package/views/dist/panels/react/filter/FilterEditor.js +7 -0
  178. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
  179. package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
  180. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +17 -1
  181. package/views/dist/panels/react/toolbar/Toolbar.d.ts +15 -1
  182. package/views/dist/panels/react/toolbar/Toolbar.js +24 -9
  183. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +3 -2
  184. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
  185. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +14 -6
  186. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
  187. package/views/dist/panels/react/toolbar/ToolbarFilters.js +21 -10
  188. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +6 -1
  189. package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
  190. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  191. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  192. package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
  193. package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
  194. package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
  195. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
  196. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +7 -6
  197. package/views/dist/panels/react/toolbar/context.d.ts +21 -0
  198. package/views/dist/panels/react/toolbar/context.js +4 -0
  199. package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
  200. package/views/dist/panels/react/toolbar/pane-host.js +17 -0
  201. package/views/dist/panels/react/toolbar/panel-part.js +3 -2
  202. package/views/dist/panels/react/views-row/ViewPicker.js +13 -5
  203. package/views/dist/panels/react.d.ts +2 -2
  204. package/views/dist/panels/settings/layout.js +6 -38
  205. package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
  206. package/views/dist/panels/toolbar/page-resets.js +62 -0
  207. package/views/dist/panels/toolbar/same-item.d.ts +7 -0
  208. package/views/dist/panels/toolbar/same-item.js +9 -0
  209. package/views/dist/panels/view-state.d.ts +4 -0
  210. package/views/dist/provider/ViewsProvider.d.ts +9 -3
  211. package/views/dist/provider/ViewsProvider.js +13 -2
  212. package/views/dist/provider/components.d.ts +59 -8
  213. package/views/dist/provider/components.js +1 -1
  214. package/views/dist/react.d.ts +2 -2
  215. package/views/dist/styles.css +194 -100
  216. package/views/dist/styles.unlayered.css +194 -100
  217. package/views/docs/contract.md +96 -27
  218. package/views/docs/controls/alert-dialog.md +4 -0
  219. package/views/docs/controls/alert.md +4 -0
  220. package/views/docs/controls/avatar.md +3 -0
  221. package/views/docs/controls/bulk-bar.md +7 -1
  222. package/views/docs/controls/compound-editor.md +2 -0
  223. package/views/docs/controls/customize.md +3 -1
  224. package/views/docs/controls/date-editor.md +2 -0
  225. package/views/docs/controls/filter-editor.md +1 -1
  226. package/views/docs/controls/group-editor.md +2 -0
  227. package/views/docs/controls/links-editor.md +2 -0
  228. package/views/docs/controls/menu.md +3 -1
  229. package/views/docs/controls/modal.md +4 -0
  230. package/views/docs/controls/number-editor.md +2 -0
  231. package/views/docs/controls/pane.md +1 -1
  232. package/views/docs/controls/picker.md +2 -0
  233. package/views/docs/controls/quick-filters.md +4 -2
  234. package/views/docs/controls/sheet.md +1 -1
  235. package/views/docs/controls/text-editor.md +3 -1
  236. package/views/docs/controls/toolbar.md +4 -0
  237. package/views/docs/controls/values-editor.md +2 -0
  238. package/views/docs/controls/views-list.md +2 -0
  239. package/views/docs/guides/atoms.md +54 -3
  240. package/views/docs/guides/display.md +1 -1
  241. package/views/docs/guides/looks.md +1 -1
  242. package/views/docs/guides/the-grid.md +4 -2
  243. package/views/docs/guides/the-provider.md +4 -4
  244. package/views/docs/index.md +2 -2
  245. package/views/docs/install.md +198 -104
  246. package/views/docs/reference/controls.md +21 -17
  247. package/views/docs/reference/editors-range.md +1 -1
  248. package/views/docs/reference/field-row.md +1 -1
  249. package/views/docs/reference/grid.md +2 -1
  250. package/views/docs/reference/list.md +7 -5
  251. package/views/docs/reference/looks.md +6 -6
  252. package/views/docs/reference/panels-react.md +17 -15
  253. package/views/docs/reference/panels.md +4 -4
  254. package/views/docs/reference/react.md +15 -12
  255. package/views/docs/reference/views.md +6 -4
  256. package/views/docs/reshaping.md +32 -5
  257. package/views/skills/views/SKILL.md +3 -3
@@ -0,0 +1,62 @@
1
+ import { applySettingsChange, settingsChange, } from "viewkitjs/fields/query";
2
+ import { columnsReset } from "../../model/settings-columns.js";
3
+ import { settingsCleared } from "./clear.js";
4
+ const KEYS = {
5
+ layout: ["layout", "look", "board", "calendar"],
6
+ columns: ["columns"],
7
+ filter: ["filter"],
8
+ sort: ["sorts", "rowOrderMode"],
9
+ group: ["group"],
10
+ };
11
+ const PAGES = Object.keys(KEYS);
12
+ function layerPart(page, layer, phone) {
13
+ if (page === "layout") {
14
+ const look = Object.keys(layer.look ?? {}).length > 0, phoneLayout = phone && layer.phoneLayout !== undefined;
15
+ return look || phoneLayout ? { look: {}, ...(phone && { phoneLayout: undefined }) } : null;
16
+ }
17
+ if (page === "columns")
18
+ return Object.keys(layer.widths ?? {}).length > 0 ? { widths: {} } : null;
19
+ if (page === "group")
20
+ return (layer.folded ?? []).length > 0 ? { folded: [] } : null;
21
+ return null;
22
+ }
23
+ function only(change, keys) {
24
+ const kept = Object.fromEntries(Object.entries(change).filter(([key]) => keys.includes(key)));
25
+ return Object.keys(kept).length > 0 ? kept : null;
26
+ }
27
+ const columnKey = (column) => `${column.key}\u0000${column.part ?? ""}`;
28
+ const withoutFigure = (columns) => columns.map(({ figure: _figure, ...rest }) => rest);
29
+ function columnsBack(now, baseline) {
30
+ const same = settingsChange({ columns: withoutFigure(now) }, { columns: withoutFigure(baseline) });
31
+ if (Object.keys(same).length === 0)
32
+ return null;
33
+ const figures = new Map(now.map((column) => [columnKey(column), column.figure]));
34
+ return {
35
+ columns: baseline.map((column) => {
36
+ const { figure: _figure, ...rest } = column;
37
+ const figure = figures.get(columnKey(column));
38
+ return figure === undefined ? rest : { ...rest, figure };
39
+ }),
40
+ };
41
+ }
42
+ export function pageResets(input, saved, { cleared = false, phone = false } = {}) {
43
+ const { settings, layer } = input;
44
+ const out = {};
45
+ let baseline = saved;
46
+ if (cleared)
47
+ baseline = applySettingsChange(settings, settingsCleared(input, "options", { phone }) ?? {});
48
+ if (!baseline)
49
+ return out;
50
+ const towards = settingsChange(settings, baseline);
51
+ for (const page of PAGES) {
52
+ if (cleared && page === "layout")
53
+ continue;
54
+ const change = page === "columns"
55
+ ? columnsBack(settings.columns, cleared ? applySettingsChange(settings, columnsReset(settings, input.columns)).columns : baseline.columns)
56
+ : only(towards, KEYS[page]);
57
+ const part = layerPart(page, layer, phone);
58
+ if (change || part)
59
+ out[page] = { change, layer: part };
60
+ }
61
+ return out;
62
+ }
@@ -0,0 +1,7 @@
1
+ import { type FilterTree } from "viewkitjs/fields/query";
2
+ type Item = FilterTree["items"][number];
3
+ /** Whether two filter items hold the same. */
4
+ export declare function sameFilterItem(a: Item, b: Item): boolean;
5
+ /** Whether the filter's top-level item at `index` is one of the saved filter's own. */
6
+ export declare function savedItem(tree: FilterTree, index: number, saved: FilterTree | undefined): boolean;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { settingsChange } from "viewkitjs/fields/query";
2
+ export function sameFilterItem(a, b) {
3
+ const one = (item) => ({ filter: { op: "and", items: [item] } });
4
+ return Object.keys(settingsChange(one(a), one(b))).length === 0;
5
+ }
6
+ export function savedItem(tree, index, saved) {
7
+ const item = tree.items[index];
8
+ return !!saved && item !== undefined && saved.items.some((own) => sameFilterItem(item, own));
9
+ }
@@ -1,3 +1,4 @@
1
+ import type { ListSettings } from "viewkitjs/fields/query";
1
2
  /**
2
3
  * THE VIEW AS A THING SHARED WITH OTHERS — how far what this person sees has
3
4
  * drifted from it, and the two verbs that settle the drift.
@@ -28,6 +29,9 @@ export type CollectionViewState = {
28
29
  onReset: () => void;
29
30
  /** Make what you see everyone's view. */
30
31
  onPublish: () => void;
32
+ /** The view's settings as saved: what each Customize page's Reset goes back to. Absent, its pages carry no Reset of
33
+ * their own; the first page's Reset still goes back through `onReset`. */
34
+ saved?: ListSettings;
31
35
  };
32
36
  /**
33
37
  * Export CSV, when the list offers one: the Customize panel's actions row and the phone sheet's foot. `count`
@@ -69,9 +69,15 @@ export type ViewsProviderProps = {
69
69
  * while rendering; until the first read a date that needs it draws its full form. A moment you hand is kept as it is:
70
70
  * hand a new one to move it. */
71
71
  now?: Date;
72
- /** Which of your own controls ViewKit's panels draw inside them (VK-1013): `true` for all five, or the names among `Button`,
73
- * `Select`, `Menu`, `Popover` and `Input`. Each is handed the map's props and the part's `data-slot` and `data-key`. A
74
- * control of `CONTROLS`' stays ViewKit's whatever this says. Absent, the panels draw ViewKit's own, as before. */
72
+ /** Which of your own controls ViewKit's panels and field editors draw inside them (VK-1013, VK-1021): `true` for all nine, or
73
+ * the names among `Button`, `Select`, `Menu`, `Popover`, `Input` (the panels' text boxes, and the filter's number and range
74
+ * boxes with ViewKit reading what is typed, VK-1018), `Calendar` (the date editor's month; the filter's range calendar reads
75
+ * your `Calendar` whatever this says), `Tooltip` (the panels' tooltips, a reason marked `reason`, VK-1015), `Avatar` (your `atoms.Avatar`, every record's mark the panels draw:
76
+ * the Picker's rows, the links editor, the bulk bar, the quick filters, VK-1044) and `RelationChip` (your
77
+ * `atoms.RelationChip`, every mentioned record ViewKit draws: a table's cell, a field row's value, `renderFieldValue`,
78
+ * VK-1053). Each is handed the map's props and the part's `data-slot` and `data-key`; the two atoms their data alone
79
+ * (`ViewsAvatarProps`, a pixel size; `ViewsRelationChipProps`). A control of `CONTROLS`' and ViewKit's own atoms stay
80
+ * ViewKit's whatever this says. Absent, they draw ViewKit's own, as before. */
75
81
  panelControls?: boolean | readonly PanelControlName[];
76
82
  children: ReactNode;
77
83
  };
@@ -60,10 +60,13 @@ export function ViewsProvider({ children, components, conventions = DEFAULT_CONV
60
60
  Calendar: components.Calendar ?? MISSING_CALENDAR_COMPONENT,
61
61
  }), [components]);
62
62
  const optedKey = opted === true ? "all" : opted ? opted.join(",") : "";
63
+ const ownAvatar = merged.Avatar !== DEFAULT_VIEWS_ATOMS.Avatar;
64
+ const ownRelationChip = merged.RelationChip !== DEFAULT_VIEWS_ATOMS.RelationChip;
63
65
  const panelControls = useMemo(() => {
64
66
  const names = optedKey === "all" ? PANEL_CONTROL_NAMES : (optedKey ? optedKey.split(",") : []);
65
- return new Set(PANEL_CONTROL_NAMES.filter((name) => names.includes(name) && components[name] != null && !isOwnControl(components[name])));
66
- }, [optedKey, components]);
67
+ const apps = (name) => name === "Avatar" ? ownAvatar : name === "RelationChip" ? ownRelationChip : components[name] != null && !isOwnControl(components[name]);
68
+ return new Set(PANEL_CONTROL_NAMES.filter((name) => names.includes(name) && apps(name)));
69
+ }, [optedKey, components, ownAvatar, ownRelationChip]);
67
70
  const strandedSelect = components.Select != null && !isOwnControl(components.Select) && !panelControls.has("Select");
68
71
  const warnedSelect = useRef(false);
69
72
  useEffect(() => {
@@ -72,6 +75,14 @@ export function ViewsProvider({ children, components, conventions = DEFAULT_CONV
72
75
  warnedSelect.current = true;
73
76
  console.warn("ViewKit: components.Select is drawn only inside ViewKit's panels, and panelControls doesn't name \"Select\", so it is never drawn.");
74
77
  }, [strandedSelect]);
78
+ const strandedAtoms = carried === undefined && atoms?.ToolbarButton === undefined && Object.values(components).some(isOwnControl);
79
+ const warnedAtoms = useRef(false);
80
+ useEffect(() => {
81
+ if (!strandedAtoms || warnedAtoms.current || process.env.NODE_ENV === "production")
82
+ return;
83
+ warnedAtoms.current = true;
84
+ console.warn("ViewKit: components holds ViewKit's own controls but none of their atoms, which a map spread from CONTROLS doesn't carry, so the toolbar draws ViewKit's plain button and the Toolbar's look options don't apply. Hand them beside it: atoms={{ ...CONTROL_ATOMS, ...yours }}.");
85
+ }, [strandedAtoms]);
75
86
  const hosted = useRef({});
76
87
  const mounted = useSyncExternalStore(NO_SUBSCRIBE, IN_BROWSER, ON_SERVER);
77
88
  const onHostReady = useCallback((p) => {
@@ -100,6 +100,10 @@ export type ViewsPopoverProps = {
100
100
  export type ViewsTooltipProps = {
101
101
  content: ReactNode;
102
102
  children: ReactElement;
103
+ /** Its content says why what it names can't be used (Add sort at its most, a rule set aside): a longer line, which your tooltip
104
+ * may wrap and draw in its regular weight, as ViewKit's own does. Handed inside ViewKit's panels, under `panelControls`
105
+ * (VK-1015). */
106
+ reason?: boolean;
103
107
  side?: ViewsSide;
104
108
  align?: ViewsAlign;
105
109
  delayMs?: number;
@@ -401,7 +405,9 @@ export type ViewsLinksBodyProps = {
401
405
  /** In the phone's sheet: the step of your own you stand on (a link's roles), or `null` once you are back. */
402
406
  onStepChange?: (step: ViewsBodyStep | null) => void;
403
407
  };
404
- /** A calendar over ISO days (`YYYY-MM-DD`) and months (`YYYY-MM`); the app's date library stays its own. */
408
+ /** A calendar over ISO days (`YYYY-MM-DD`) and months (`YYYY-MM`); the app's date library stays its own. The filter's range
409
+ * calendar draws it as it is; inside the field editors (VK-1021) it draws the date editor's month, its head and its days, only
410
+ * where the provider's `panelControls` names `Calendar`. */
405
411
  export type ViewsCalendarProps = {
406
412
  value: string | null;
407
413
  onChange: (day: string | null) => void;
@@ -419,6 +425,9 @@ export type ViewsCalendarProps = {
419
425
  * its week as this locale does; an adapter may ignore it and keep its calendar's own. */
420
426
  locale: string;
421
427
  className?: string;
428
+ /** The part's public name where ViewKit names it (VK-1021: `vk-calendar`, the date editor's month under the provider's
429
+ * `panelControls`): draw it on your calendar's root as its `data-slot`. */
430
+ "data-slot"?: string;
422
431
  };
423
432
  /** A quick pick a date body offers: a day the editor names, or `none`, which empties the field. `next-monday` is the
424
433
  * Monday after today (a week on when today is one); `in-a-week` is a week from today (today + 7 on the
@@ -546,6 +555,10 @@ export type ViewsPartsBodyProps = ViewsPartsBodyCommon & ({
546
555
  low: number | null;
547
556
  high: number | null;
548
557
  }[];
558
+ /** The least each end may hold: with `max`, the field's limits: each end steps within them, as the number body's box does, and a typed end outside them is drawn back to them as the box is left (VK-904). Absent where the field states none. */
559
+ min?: number;
560
+ /** The most each end may hold (`min`). Absent where the field states none. */
561
+ max?: number;
549
562
  });
550
563
  /** One value of a list a values body holds: its text, its label where it has one, and whether it is the main one. */
551
564
  export type ViewsValueLine = {
@@ -574,7 +587,8 @@ export type ViewsValuesBodyProps = {
574
587
  labels: boolean;
575
588
  /** `one`: the field holds one value: one line, no label, no main mark, no line to add another while it holds one. */
576
589
  holds: "one" | "several";
577
- /** A phone's country, where a number typed without its country code is read (RO). */
590
+ /** A phone's country, where a number typed without its country code is read (RO): the record's, else the conventions'
591
+ * `region`. ViewKit's own body starts a new number on it. */
578
592
  region?: string;
579
593
  /** It may be emptied: every value removed is a clear. */
580
594
  empty: boolean;
@@ -607,7 +621,8 @@ export type ViewsTextBodyProps = {
607
621
  onDone: () => void;
608
622
  /** Why a value would be refused, in the app's words, or null when it reads. The editor checks again at the close. */
609
623
  check: (value: string) => string | null;
610
- /** A phone's country, where a number typed without its country code is read (RO). */
624
+ /** A phone's country, where a number typed without its country code is read (RO): the record's, else the conventions'
625
+ * `region`. ViewKit's own body starts a new number on it. */
611
626
  region?: string;
612
627
  /** What was typed on what opened it, already the value. */
613
628
  typed?: string;
@@ -684,6 +699,9 @@ export type ViewsCollapseProps = {
684
699
  export type ViewsSheetAction = {
685
700
  label: string;
686
701
  onPress: () => void;
702
+ /** The action's public name (VK-1021): `vk-editor-close`, `vk-editor-save` or `vk-editor-back` on an editor panel's ✕, ✓
703
+ * and Back. Draw it on your button as its `data-slot`. */
704
+ slot?: string;
687
705
  };
688
706
  /** The editor panel's ✕ and ✓. `close` throws the edit away, as a swipe does; `done` closes it as
689
707
  * done, and is absent where the body saves on its pick (a pick of one), which needs no ✓. A toolbar panel's sheet
@@ -1249,6 +1267,7 @@ export type ViewsCustomizeToggle = {
1249
1267
  value: boolean;
1250
1268
  onChange: (next: boolean) => void;
1251
1269
  icon?: ReactNode;
1270
+ /** @deprecated Handed by nothing since a toggle carries no way back of its own (VK-1033). To be removed in a later release. */
1252
1271
  reset?: () => void;
1253
1272
  section?: string;
1254
1273
  };
@@ -1288,7 +1307,8 @@ export type ViewsCustomizeLayout = {
1288
1307
  choices: readonly ViewsCustomizeChoice[];
1289
1308
  /** Its row spacing, where the layout has one. */
1290
1309
  density?: ViewsCustomizeChoice;
1291
- /** The reader's own settings over a shared view ("For you"), with Reset where any is set. */
1310
+ /** @deprecated Handed by nothing since Customize's Layout page ends at its toggles (VK-1033). To be removed in a later
1311
+ * release. */
1292
1312
  personal?: {
1293
1313
  label: string;
1294
1314
  toggles: readonly ViewsCustomizeToggle[];
@@ -1456,7 +1476,14 @@ export type ViewsCustomizeBodyProps = {
1456
1476
  pending: boolean;
1457
1477
  onReset: () => void;
1458
1478
  onPublish: () => void;
1479
+ /** The reader's own layer holds something: Reset stands (and empties it), Save only for `changes` (VK-1034). */
1480
+ layered?: boolean;
1459
1481
  };
1482
+ /** Each page's own Reset, back to the view as saved (with no saved view, to the first page's Clear), each only while
1483
+ * that page differs; drawn on its page in the first page's Reset's word and look (VK-1034). Handed (even empty), the
1484
+ * body draws these alone, and no Clear all of the sort's or the filter's; not handed (a view without its saved
1485
+ * settings), the body keeps `columns.reset` and Clear all. */
1486
+ resets?: Partial<Record<"layout" | "columns" | "filter" | "sort" | "group", () => void>>;
1460
1487
  /** The foot's words: `kit` for Clear and Save, `none` for none (they stand elsewhere); absent, Reset and Set default
1461
1488
  * for everyone. */
1462
1489
  foot?: "kit" | "none";
@@ -1547,7 +1574,8 @@ export type ViewsSelectItem = {
1547
1574
  level?: ViewsSelectItem[];
1548
1575
  };
1549
1576
  /** The components map's `Select` (VK-1013): pick one value, or several, from a list. ViewKit's panels draw it under the
1550
- * provider's `panelControls` for the boxes that pick (the sort's field and direction, the filter's field, way and choices). */
1577
+ * provider's `panelControls` for the boxes that pick (the sort's field and direction, the filter's field, way and choices, New
1578
+ * view's columns). */
1551
1579
  export type ViewsSelectProps = {
1552
1580
  items: ViewsSelectItem[];
1553
1581
  /** One value, several (with `multiple`), or none. */
@@ -1567,12 +1595,16 @@ export type ViewsSelectProps = {
1567
1595
  size?: "sm" | "default";
1568
1596
  className?: string;
1569
1597
  "aria-label"?: string;
1598
+ /** Inside a ViewKit field (the place editor's country, VK-1022), the id its label names: put it on the box a person presses. */
1599
+ id?: string;
1570
1600
  /** The part's public name (`vk-sort-field`) and which one: draw them on the box a person presses. */
1571
1601
  "data-slot"?: string;
1572
1602
  "data-key"?: string;
1573
1603
  };
1574
- /** The controls ViewKit's panels can draw as the app's own, under the provider's `panelControls` (VK-1013). */
1575
- export type PanelControlName = "Button" | "Select" | "Menu" | "Popover" | "Input";
1604
+ /** The controls ViewKit's panels and field editors can draw as the app's own, under the provider's `panelControls` (VK-1013;
1605
+ * `Calendar`, the date editor's month, VK-1021; `Tooltip`, the panels' tooltips, VK-1015); `Avatar`, the atom, every record's
1606
+ * mark the panels draw (VK-1044); and `RelationChip`, the atom, every mentioned record ViewKit draws (VK-1053). */
1607
+ export type PanelControlName = "Button" | "Select" | "Menu" | "Popover" | "Input" | "Calendar" | "Tooltip" | "Avatar" | "RelationChip";
1576
1608
  export declare const PANEL_CONTROL_NAMES: readonly PanelControlName[];
1577
1609
  /** What the components map's `RowsWait` is handed: a grid's rows, and whether new ones are loading. */
1578
1610
  export type ViewsRowsWaitProps = {
@@ -1692,11 +1724,30 @@ export type ViewsComponents = {
1692
1724
  * draws it in its own place, in the box that holds it, at every count (zero included, so it can leave), handed its props;
1693
1725
  * left out, ViewKit draws its own bar, portalled to the screen's foot. */
1694
1726
  SelectionBar?: ComponentType<ViewsSelectionBarProps>;
1727
+ /** Optional: the Pane (CONTROLS: ViewKit's), a panel standing at the right edge of the list's box, the list in use beside
1728
+ * it. Handed one, a toolbar with `customizeIn: "pane"` opens Customize in it on a computer; left out, Customize opens in
1729
+ * the `Popover` as before. */
1730
+ Pane?: ComponentType<ViewsPaneProps>;
1731
+ };
1732
+ /** What the components map's `Pane` is handed (VK-1026): a toolbar panel standing at the right edge of the list's box, under
1733
+ * the toolbar, the list in use beside it, on a computer (`customizeIn: "pane"`: Customize). */
1734
+ export type ViewsPaneProps = {
1735
+ open: boolean;
1736
+ /** It closes from inside (Escape, its ✕): set `open` from it. */
1737
+ onOpenChange: (open: boolean) => void;
1738
+ /** The list's box it stands in: positioned, holding the grid, never scrolling itself. Null until it is on the page: draw
1739
+ * nothing. */
1740
+ container: HTMLElement | null;
1741
+ /** The part's button that opened it (⋯ while the part is folded into it): give it the focus back as it closes from inside. */
1742
+ opener: HTMLElement | null;
1743
+ /** Its name to a screen reader: the part's label. */
1744
+ label: string;
1745
+ children: ReactNode;
1695
1746
  };
1696
1747
  /** The selection bar's props, as your `SelectionBar` is handed them: ViewKit's `SelectionBar`'s own. */
1697
1748
  export type ViewsSelectionBarProps = SelectionBarProps;
1698
1749
  /** The map as the views read it: `Input` and `Calendar` always filled, the app's or the
1699
- * package's own; `RowsWait`, `GroupBody`, `SearchField`, `PortsHost`, `SelectionBar` and `ViewMenu` as the app handed them. */
1750
+ * package's own; `RowsWait`, `GroupBody`, `SearchField`, `PortsHost`, `SelectionBar`, `ViewMenu` and `Pane` as the app handed them. */
1700
1751
  export type ViewsResolvedComponents = ViewsComponents & {
1701
1752
  Input: ComponentType<ViewsInputProps>;
1702
1753
  Calendar: ComponentType<ViewsCalendarProps>;
@@ -1,4 +1,4 @@
1
- export const PANEL_CONTROL_NAMES = ["Button", "Select", "Menu", "Popover", "Input"];
1
+ export const PANEL_CONTROL_NAMES = ["Button", "Select", "Menu", "Popover", "Input", "Calendar", "Tooltip", "Avatar", "RelationChip"];
2
2
  const _requiredMatchContract = true;
3
3
  const _optionalMatchContract = true;
4
4
  void _requiredMatchContract;
@@ -6,10 +6,10 @@ export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
6
6
  export { PANEL_CONTROL_NAMES } from "./provider/components.js";
7
7
  export { flatSelectItems } from "./provider/select-items.js";
8
8
  export type { ViewsSeveralValues } from "./display/fit-values.js";
9
- export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeField, ViewsCustomizeFields, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsPortsHostProps, PanelControlName, ViewsSelectionBarProps, ViewsSelectItem, ViewsSelectProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, ViewsViewChange, ViewsViewLayout, ViewsViewMenuProps, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
9
+ export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeField, ViewsCustomizeFields, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsPortsHostProps, PanelControlName, ViewsSelectionBarProps, ViewsSelectItem, ViewsSelectProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, ViewsViewChange, ViewsViewLayout, ViewsViewMenuProps, ViewsPaneProps, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
10
10
  export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
11
11
  export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
12
12
  export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
13
13
  export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
14
- export type { ViewsAtoms, ViewsAvatarProps, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsCellMoreProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusOption, ViewsStatusPlace, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, ViewsPillProps, ViewsRangeCalendarProps, ViewsToolbarButtonProps, ViewsToolbarButtonPart, ViewsFramePart, } from "./atoms/types.js";
14
+ export type { ViewsAtoms, ViewsAvatarProps, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsRelationChipProps, ViewsRelationChipLinkProps, ViewsCellMoreProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusOption, ViewsStatusPlace, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, ViewsPillProps, ViewsRangeCalendarProps, ViewsToolbarButtonProps, ViewsToolbarButtonPart, ViewsFramePart, } from "./atoms/types.js";
15
15
  export type { ComponentName, PortName, ViewsIconName, ViewsMessage, ViewsMessageResolver } from "./contract.js";