viewkitjs 0.35.0 → 0.37.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 (256) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/MIGRATION.md +7 -0
  3. package/package.json +1 -1
  4. package/views/dist/atoms/types.d.ts +32 -4
  5. package/views/dist/contract.d.ts +32 -9
  6. package/views/dist/contract.js +35 -1
  7. package/views/dist/controls/avatar/avatar.d.ts +3 -1
  8. package/views/dist/controls/avatar/avatar.js +2 -2
  9. package/views/dist/controls/button/own-look-moved.d.ts +11 -0
  10. package/views/dist/controls/button/own-look-moved.js +3 -0
  11. package/views/dist/controls/compound-editor/map-parts-body.js +2 -0
  12. package/views/dist/controls/compound-editor/name-parts.js +1 -1
  13. package/views/dist/controls/compound-editor/place-parts.js +1 -1
  14. package/views/dist/controls/compound-editor/range-parts.js +1 -1
  15. package/views/dist/controls/compound-editor/words.d.ts +3 -0
  16. package/views/dist/controls/compound-editor/words.js +2 -0
  17. package/views/dist/controls/customize/customize.d.ts +10 -3
  18. package/views/dist/controls/customize/customize.js +147 -63
  19. package/views/dist/controls/customize/items.d.ts +49 -0
  20. package/views/dist/controls/customize/items.js +104 -0
  21. package/views/dist/controls/customize/map-customize-body.js +7 -4
  22. package/views/dist/controls/customize/words.d.ts +2 -0
  23. package/views/dist/controls/customize/words.js +1 -0
  24. package/views/dist/controls/date-editor/date-behaviour.d.ts +80 -0
  25. package/views/dist/controls/date-editor/date-behaviour.js +187 -0
  26. package/views/dist/controls/date-editor/date-editor.d.ts +3 -2
  27. package/views/dist/controls/date-editor/date-editor.js +29 -166
  28. package/views/dist/controls/field/field.d.ts +3 -2
  29. package/views/dist/controls/field/field.js +7 -2
  30. package/views/dist/controls/field/looks.d.ts +1 -1
  31. package/views/dist/controls/field/looks.js +5 -4
  32. package/views/dist/controls/field.css +4 -0
  33. package/views/dist/controls/filter-editor/block.js +5 -2
  34. package/views/dist/controls/filter-editor/filter-editor.d.ts +14 -1
  35. package/views/dist/controls/filter-editor/filter-editor.js +21 -13
  36. package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
  37. package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
  38. package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
  39. package/views/dist/controls/filter-editor/map-rules.js +18 -13
  40. package/views/dist/controls/filter-editor/parts.d.ts +2 -0
  41. package/views/dist/controls/filter-editor/parts.js +13 -12
  42. package/views/dist/controls/filter-editor/rules.d.ts +4 -4
  43. package/views/dist/controls/filter-editor/rules.js +6 -3
  44. package/views/dist/controls/filter-editor/words.d.ts +2 -0
  45. package/views/dist/controls/filter-editor/words.js +1 -0
  46. package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
  47. package/views/dist/controls/group-editor/group-editor.js +21 -15
  48. package/views/dist/controls/group-editor/map-group-body.js +1 -0
  49. package/views/dist/controls/index.d.ts +4 -2
  50. package/views/dist/controls/index.js +3 -1
  51. package/views/dist/controls/inline-input.css +9 -0
  52. package/views/dist/controls/internal/kit-words.d.ts +11 -0
  53. package/views/dist/controls/internal/kit-words.js +7 -0
  54. package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
  55. package/views/dist/controls/internal/map-panel-controls.js +14 -1
  56. package/views/dist/controls/internal/menu-items.d.ts +9 -0
  57. package/views/dist/controls/internal/menu-items.js +97 -0
  58. package/views/dist/controls/internal/panel-controls.js +1 -1
  59. package/views/dist/controls/internal/phone.d.ts +1 -1
  60. package/views/dist/controls/internal/phone.js +3 -2
  61. package/views/dist/controls/list/tokens.d.ts +1 -1
  62. package/views/dist/controls/list/tokens.js +1 -1
  63. package/views/dist/controls/list.css +5 -2
  64. package/views/dist/controls/menu/menu.d.ts +1 -1
  65. package/views/dist/controls/menu/menu.js +1 -1
  66. package/views/dist/controls/menu-list/menu-list.js +3 -2
  67. package/views/dist/controls/menu.css +4 -4
  68. package/views/dist/controls/number-editor/map-number-body.js +2 -0
  69. package/views/dist/controls/number-editor/number-editor.js +1 -1
  70. package/views/dist/controls/number-editor/words.d.ts +3 -0
  71. package/views/dist/controls/number-editor/words.js +2 -0
  72. package/views/dist/controls/pane.css +1 -1
  73. package/views/dist/controls/picker/fields-frame.d.ts +5 -0
  74. package/views/dist/controls/picker/fields-frame.js +30 -0
  75. package/views/dist/controls/picker/map-fields-body.js +3 -26
  76. package/views/dist/controls/picker/map-picker.d.ts +2 -1
  77. package/views/dist/controls/picker/map-picker.js +4 -2
  78. package/views/dist/controls/picker/picker.js +9 -2
  79. package/views/dist/controls/picker/rows.d.ts +3 -1
  80. package/views/dist/controls/picker.css +7 -3
  81. package/views/dist/controls/popover/looks.d.ts +1 -1
  82. package/views/dist/controls/popover/looks.js +5 -0
  83. package/views/dist/controls/popover/tokens.d.ts +13 -1
  84. package/views/dist/controls/popover/tokens.js +4 -1
  85. package/views/dist/controls/popover.css +59 -8
  86. package/views/dist/controls/select/map-select.d.ts +1 -1
  87. package/views/dist/controls/select/map-select.js +4 -1
  88. package/views/dist/controls/select/select.d.ts +2 -0
  89. package/views/dist/controls/select/select.js +4 -2
  90. package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
  91. package/views/dist/controls/sheet/bottom-sheet.js +3 -3
  92. package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
  93. package/views/dist/controls/sort-editor/sort-editor.d.ts +3 -1
  94. package/views/dist/controls/sort-editor/sort-editor.js +6 -4
  95. package/views/dist/controls/sort-editor.css +4 -2
  96. package/views/dist/controls/tag/tag.js +4 -2
  97. package/views/dist/controls/text-editor/map-text-body.js +4 -1
  98. package/views/dist/controls/text-editor/text-editor.js +2 -2
  99. package/views/dist/controls/text-editor/words.d.ts +3 -0
  100. package/views/dist/controls/text-editor/words.js +1 -1
  101. package/views/dist/controls/text-editor.css +6 -0
  102. package/views/dist/controls/toolbar/toolbar.d.ts +12 -4
  103. package/views/dist/controls/toolbar/toolbar.js +7 -2
  104. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +1 -1
  105. package/views/dist/controls/toolbar.css +5 -0
  106. package/views/dist/controls/tooltip/tokens.d.ts +1 -1
  107. package/views/dist/controls/tooltip/tokens.js +1 -1
  108. package/views/dist/controls/tooltip.css +5 -3
  109. package/views/dist/controls/values-editor.css +20 -5
  110. package/views/dist/controls/views-list/map-views-list-body.js +9 -1
  111. package/views/dist/controls/views-list/rules.d.ts +1 -0
  112. package/views/dist/controls/views-list/rules.js +2 -2
  113. package/views/dist/controls/views-list/view-menu.js +2 -2
  114. package/views/dist/controls/views-list/words.d.ts +4 -0
  115. package/views/dist/controls/views-list/words.js +2 -1
  116. package/views/dist/display/entity-chip.d.ts +7 -1
  117. package/views/dist/display/entity-chip.js +2 -1
  118. package/views/dist/display/option-badges.d.ts +3 -2
  119. package/views/dist/display/option-badges.js +2 -2
  120. package/views/dist/field-row/FieldRow.js +12 -8
  121. package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
  122. package/views/dist/grid/chrome/GridAddColumn.js +5 -4
  123. package/views/dist/grid/chrome/GridCellEditors.d.ts +4 -1
  124. package/views/dist/grid/chrome/GridCellEditors.js +3 -2
  125. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -5
  126. package/views/dist/grid/chrome/GridCellOutline.js +3 -5
  127. package/views/dist/grid/chrome/GridChipsEditor.js +1 -1
  128. package/views/dist/grid/chrome/GridDateEditor.d.ts +1 -1
  129. package/views/dist/grid/chrome/GridDateEditor.js +1 -1
  130. package/views/dist/grid/chrome/GridHeader.js +3 -1
  131. package/views/dist/grid/chrome/GridLongTextEditor.d.ts +1 -1
  132. package/views/dist/grid/chrome/GridLongTextEditor.js +8 -5
  133. package/views/dist/grid/chrome/GridNameEditor.d.ts +1 -1
  134. package/views/dist/grid/chrome/GridNameEditor.js +1 -1
  135. package/views/dist/grid/chrome/GridNumberEditor.d.ts +1 -1
  136. package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
  137. package/views/dist/grid/chrome/GridPlaceEditor.d.ts +1 -1
  138. package/views/dist/grid/chrome/GridPlaceEditor.js +1 -1
  139. package/views/dist/grid/chrome/GridRangeEditor.d.ts +2 -2
  140. package/views/dist/grid/chrome/GridRangeEditor.js +1 -1
  141. package/views/dist/grid/chrome/GridRelationEditor.js +2 -2
  142. package/views/dist/grid/chrome/GridRow.js +7 -1
  143. package/views/dist/grid/chrome/GridRowCells.js +6 -5
  144. package/views/dist/grid/chrome/GridSelectEditor.js +1 -1
  145. package/views/dist/grid/chrome/GridTable.d.ts +2 -1
  146. package/views/dist/grid/chrome/GridTable.js +7 -2
  147. package/views/dist/grid/chrome/GridTableSurface.js +2 -1
  148. package/views/dist/grid/chrome/GridTextEditor.d.ts +1 -1
  149. package/views/dist/grid/chrome/GridTextEditor.js +2 -2
  150. package/views/dist/grid/chrome/GridValueListEditor.d.ts +1 -1
  151. package/views/dist/grid/chrome/GridValueListEditor.js +1 -1
  152. package/views/dist/grid/chrome/grid-body-place.d.ts +7 -2
  153. package/views/dist/grid/chrome/grid-body-place.js +8 -4
  154. package/views/dist/grid/chrome/grid-cell-classes.js +2 -2
  155. package/views/dist/grid/chrome/grid-edit-session.d.ts +4 -0
  156. package/views/dist/grid/chrome/grid-edit-session.js +10 -1
  157. package/views/dist/grid/chrome/grid-editor-layer.d.ts +10 -0
  158. package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
  159. package/views/dist/grid/chrome/grid-fitted-box.d.ts +9 -6
  160. package/views/dist/grid/chrome/grid-fitted-box.js +15 -7
  161. package/views/dist/grid/chrome/grid-hover.d.ts +3 -3
  162. package/views/dist/grid/chrome/grid-hover.js +2 -3
  163. package/views/dist/grid/chrome/grid-row-props.d.ts +6 -2
  164. package/views/dist/grid/chrome/grid-styles.d.ts +1 -5
  165. package/views/dist/grid/chrome/grid-styles.js +0 -1
  166. package/views/dist/grid/chrome/grid-table-props.d.ts +6 -2
  167. package/views/dist/grid/chrome/useGridKeyboard.d.ts +0 -1
  168. package/views/dist/grid/chrome/useGridKeyboard.js +2 -10
  169. package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
  170. package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
  171. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +3 -1
  172. package/views/dist/grid/chrome/useGridTableInteractionModel.js +24 -1
  173. package/views/dist/grid/core/useGridEditing.d.ts +3 -0
  174. package/views/dist/grid/core/useGridEditing.js +2 -0
  175. package/views/dist/grid/grid-format-props.d.ts +1 -1
  176. package/views/dist/grid/grid-format-props.js +18 -5
  177. package/views/dist/grid/grid.css +9 -20
  178. package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
  179. package/views/dist/grid/useGridTableSettings.d.ts +1 -1
  180. package/views/dist/internal/screen-forms.d.ts +11 -0
  181. package/views/dist/internal/screen-forms.js +31 -0
  182. package/views/dist/list/list.js +4 -3
  183. package/views/dist/list/menu.d.ts +5 -4
  184. package/views/dist/list/parts.d.ts +8 -2
  185. package/views/dist/list/parts.js +31 -7
  186. package/views/dist/list/toolbar.js +11 -5
  187. package/views/dist/looks/index.d.ts +1 -0
  188. package/views/dist/looks/index.js +1 -0
  189. package/views/dist/panels/customize-body.d.ts +1 -1
  190. package/views/dist/panels/customize-body.js +8 -1
  191. package/views/dist/panels/model.d.ts +5 -0
  192. package/views/dist/panels/react/customize-body.js +11 -2
  193. package/views/dist/panels/react/customize.d.ts +3 -0
  194. package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
  195. package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
  196. package/views/dist/panels/react/filter/filter-body.js +3 -1
  197. package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
  198. package/views/dist/panels/react/filter/filter-part-body.js +2 -2
  199. package/views/dist/panels/react/popover.d.ts +3 -1
  200. package/views/dist/panels/react/popover.js +2 -2
  201. package/views/dist/panels/react/sort/SortEditor.js +3 -1
  202. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +15 -4
  203. package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
  204. package/views/dist/panels/react/toolbar/Toolbar.js +5 -1
  205. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
  206. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
  207. package/views/dist/panels/react/toolbar/ToolbarButton.js +3 -2
  208. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -3
  209. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +4 -1
  210. package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
  211. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +1 -1
  212. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  213. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  214. package/views/dist/panels/react/toolbar/ToolbarSave.js +28 -20
  215. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  216. package/views/dist/panels/react/toolbar/context.d.ts +3 -2
  217. package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
  218. package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
  219. package/views/dist/panels/react/views-row/FoldingViewRow.js +26 -11
  220. package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
  221. package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
  222. package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
  223. package/views/dist/panels/react/views-row/ViewPicker.js +7 -10
  224. package/views/dist/panels/react/views-row/more-views.d.ts +2 -0
  225. package/views/dist/panels/react/views-row/more-views.js +3 -0
  226. package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
  227. package/views/dist/panels/react/views-row/new-view.js +21 -0
  228. package/views/dist/panels/react.d.ts +1 -1
  229. package/views/dist/panels/toolbar/model.d.ts +2 -2
  230. package/views/dist/provider/components.d.ts +88 -8
  231. package/views/dist/provider/desktop.d.ts +2 -1
  232. package/views/dist/provider/desktop.js +5 -2
  233. package/views/dist/react.d.ts +1 -1
  234. package/views/dist/styles.css +198 -84
  235. package/views/dist/styles.unlayered.css +198 -84
  236. package/views/docs/contract.md +87 -32
  237. package/views/docs/controls/list.md +2 -0
  238. package/views/docs/controls/menu.md +2 -0
  239. package/views/docs/controls/picker.md +2 -0
  240. package/views/docs/controls/popover.md +7 -0
  241. package/views/docs/controls/tooltip.md +2 -0
  242. package/views/docs/guides/atoms.md +11 -10
  243. package/views/docs/guides/the-grid.md +7 -5
  244. package/views/docs/guides/the-provider.md +2 -2
  245. package/views/docs/reference/controls.md +24 -18
  246. package/views/docs/reference/display.md +1 -1
  247. package/views/docs/reference/field-row.md +1 -1
  248. package/views/docs/reference/grid.md +4 -4
  249. package/views/docs/reference/list.md +30 -11
  250. package/views/docs/reference/looks.md +4 -1
  251. package/views/docs/reference/panels-react.md +7 -6
  252. package/views/docs/reference/panels.md +2 -2
  253. package/views/docs/reference/react.md +22 -10
  254. package/views/docs/reference/views.md +2 -2
  255. package/views/docs/reshaping.md +2 -2
  256. package/views/skills/views/SKILL.md +1 -1
@@ -150,7 +150,7 @@ export type ViewsMenuItem = {
150
150
  * disables every row under it: the provider hands the app's `Menu` those rows already `disabled`. */
151
151
  children?: ViewsMenuItem[];
152
152
  /** A group (`children`) that opens its rows beside the menu, one level in, rather than in place: its row
153
- * shows its label and `detail` and opens on a hover, a press or →. A hint: an adapter with no flyouts
153
+ * shows its label and `detail` and opens on a hover or →. A hint: an adapter with no flyouts
154
154
  * draws the group in place under its label, as every group is drawn. Ignored on a row with no `children`. */
155
155
  beside?: boolean;
156
156
  /** A checkable row (`checked` set) that leaves the menu open when picked, so several can be ticked in
@@ -476,7 +476,7 @@ type ViewsPartsBodyCommon = {
476
476
  /** The field's name: the body's accessible name, a sheet's title. */
477
477
  label: string;
478
478
  /** The edit is finished: the editor closes and saves what was handed. With no argument it closes as Enter does
479
- * (the grid moves one row down); `"pick"` closes as a pick (a band picked), which moves nowhere. */
479
+ * (the grid writes and keeps the cell); `"pick"` closes as a pick (a band picked), the same. */
480
480
  onDone: (how?: "pick") => void;
481
481
  /** It may be emptied: every box cleared is a clear. */
482
482
  empty: boolean;
@@ -579,7 +579,7 @@ export type ViewsValuesBodyProps = {
579
579
  value: readonly ViewsValueLine[];
580
580
  /** Every change as it is made, the whole list each time. A line handed as it was drawn keeps what is stored. */
581
581
  onValueChange: (value: readonly ViewsValueLine[]) => void;
582
- /** The edit is finished: the editor closes as Enter does (the grid moves one row down) and saves what was handed. */
582
+ /** The edit is finished: the editor closes as Enter does (the grid writes and keeps the cell) and saves what was handed. */
583
583
  onDone: () => void;
584
584
  /** Why a value would be refused, in the app's words, or null when it reads: check each value as it is added or changed. */
585
585
  check: (value: string) => string | null;
@@ -617,7 +617,7 @@ export type ViewsTextBodyProps = {
617
617
  value: string;
618
618
  /** Every change as it is made, the whole text each time. */
619
619
  onValueChange: (value: string) => void;
620
- /** The edit is finished: the editor closes as Enter does (the grid moves one row down) and saves what was handed. */
620
+ /** The edit is finished: the editor closes as Enter does (the grid writes and keeps the cell) and saves what was handed. */
621
621
  onDone: () => void;
622
622
  /** Why a value would be refused, in the app's words, or null when it reads. The editor checks again at the close. */
623
623
  check: (value: string) => string | null;
@@ -657,7 +657,7 @@ export type ViewsNumberBodyProps = {
657
657
  /** Every change as it is made: the number, null when emptied, `NaN` for text that reads as no number (a close on it
658
658
  * changes nothing); and the unit when it is one of `units`. */
659
659
  onValueChange: (value: number | null, unit?: string) => void;
660
- /** The edit is finished: the editor closes as Enter does (the grid moves one row down) and saves what was handed. */
660
+ /** The edit is finished: the editor closes as Enter does (the grid writes and keeps the cell) and saves what was handed. */
661
661
  onDone: () => void;
662
662
  /** Why a value would be refused, in the app's words, or null when it reads. The editor checks again at the close. */
663
663
  check: (value: number | null, unit?: string) => string | null;
@@ -721,6 +721,49 @@ export type ViewsBodyStep = {
721
721
  title: string;
722
722
  onBack: () => void;
723
723
  };
724
+ /** Which of the sort editor's menus a function is handed (VK-1063): a rule's ⋯ (a phone's and the narrow form's: a computer's rule
725
+ * has × and no ⋯), its `field` the sort's key (`rules[].value`), `index` its place; or a set-aside rule's ⋯, its `field` the
726
+ * rule's stored `fieldKey`. */
727
+ export type ViewsSortEditorItemsContext = ({
728
+ menu: "rule";
729
+ field: string;
730
+ index: number;
731
+ } | {
732
+ menu: "aside";
733
+ field: string;
734
+ }) & {
735
+ form: "computer" | "phone";
736
+ };
737
+ /** Which of the filter editor's menus (VK-1063): a rule's ⋮ or a set-aside rule's, named by its field (`field`, the rule's
738
+ * `fieldKey`; its `part`; the `relation` it stands under), or a group's actions; each by its `path` in the filter the body is handed
739
+ * (`ViewsFilterBodyProps.filter`): its indices through `items` and a relation rule's `where.items`, the whole filter `[]`. */
740
+ export type ViewsFilterEditorItemsContext = ({
741
+ menu: "rule" | "aside";
742
+ field: string;
743
+ part?: string;
744
+ relation?: string;
745
+ path: number[];
746
+ } | {
747
+ menu: "group";
748
+ path: number[];
749
+ }) & {
750
+ form: "computer" | "phone";
751
+ };
752
+ /** Which of the group editor's rows (VK-1063): its settings (`field`, the field grouped by), or its foot (Remove grouping). */
753
+ export type ViewsGroupEditorItemsContext = ({
754
+ menu: "settings";
755
+ field?: string;
756
+ } | {
757
+ menu: "foot";
758
+ }) & {
759
+ form: "computer" | "phone";
760
+ };
761
+ /** The sort editor's menus reshaped: handed a menu's default items, it hands back the items drawn. Pure, no hooks. */
762
+ export type ViewsSortEditorItems = (items: ViewsMenuItem[], ctx: ViewsSortEditorItemsContext) => ViewsMenuItem[];
763
+ /** The filter editor's menus reshaped. */
764
+ export type ViewsFilterEditorItems = (items: ViewsMenuItem[], ctx: ViewsFilterEditorItemsContext) => ViewsMenuItem[];
765
+ /** The group editor's rows reshaped. */
766
+ export type ViewsGroupEditorItems = (items: ViewsMenuItem[], ctx: ViewsGroupEditorItemsContext) => ViewsMenuItem[];
724
767
  /** The sort editor's body, which your app draws (`SortBody`): what the sort pill opens on a computer and in the phone's
725
768
  * Sheet, in place of ViewKit's own. A panel's body, as every panel's: handed the panel's state as data, it hands back
726
769
  * the whole new value, every change as it is made; ViewKit keeps the rules, the save and what ✕ takes back to. Its
@@ -777,6 +820,9 @@ export type ViewsSortBodyProps = {
777
820
  * ✓; under `bar` your own head does. Escape calls `onBack`; a swipe still closes the whole sheet, keeping the rules.
778
821
  * Absent on a computer. */
779
822
  onStepChange?: (step: ViewsBodyStep | null) => void;
823
+ /** Its menus as data (`menus.sortEditor`, VK-1063): a rule's ⋯ and a set-aside rule's, reshaped. `CONTROLS.SortBody` draws
824
+ * what it hands back; a body of your own may honour it. */
825
+ items?: ViewsSortEditorItems;
780
826
  };
781
827
  /** The quick filters' body, which your app draws (`QuickFiltersBody`): what the quick filters' button opens on a
782
828
  * computer and in the phone's Sheet, in place of ViewKit's own panel. A panel's body, as every panel's: handed the
@@ -912,6 +958,9 @@ export type ViewsFilterBodyProps = {
912
958
  * are back. The sheet's head shows the step's title, Back in ✕'s place and ✓; Escape calls onBack; a swipe still closes
913
959
  * the whole sheet, keeping the filter. Absent on a computer. */
914
960
  onStepChange?: (step: ViewsBodyStep | null) => void;
961
+ /** Its menus as data (`menus.filterEditor`, VK-1063): a rule's ⋮, a set-aside rule's and a group's actions, reshaped.
962
+ * `CONTROLS.FilterBody` draws what it hands back; a body of your own may honour it. */
963
+ items?: ViewsFilterEditorItems;
915
964
  };
916
965
  /** A field as the field list's body is handed it (`ViewsFieldsBodyProps.fields`). */
917
966
  export type ViewsFieldsBodyField = {
@@ -945,6 +994,9 @@ export type ViewsFieldsBodyProps = {
945
994
  fields: readonly ViewsFieldsBodyField[];
946
995
  /** The field being changed (a rule's field): ticked, and pickable. Absent where a pick adds. */
947
996
  own?: string;
997
+ /** For a rule on a related record's field, the relation `own` stands under: its key, as `onPick` hands it back, so the
998
+ * far field is ticked and never a field of the list's own with the same key. Absent for the list's own field. */
999
+ ownRelation?: string;
948
1000
  form: "computer" | "phone";
949
1001
  /** A field picked: its key, and, for a relation's far field, the far field's key. A key not handed, or one handed
950
1002
  * `disabled`, writes nothing. */
@@ -966,6 +1018,9 @@ export type ViewsFilterPartBodyProps = {
966
1018
  /** The field it names (for a far rule, the relation's far field): its `type` says the ways and the value each
967
1019
  * stores. */
968
1020
  field: Omit<ViewsFilterBodyField, "far">;
1021
+ /** For a far rule (Company › Industry), the relation's field key it stands under ("company"), as `FilterBody`'s
1022
+ * `ruleValue` hands it: whose values to offer. Absent for a rule on the list's own field. */
1023
+ relation?: string;
969
1024
  /** The ways its field offers, in order: each its operator and its words. */
970
1025
  ways: readonly {
971
1026
  value: FilterRule["operator"];
@@ -1255,9 +1310,31 @@ export type ViewsGroupBodyProps = {
1255
1310
  /** Tell what holds you that you stand on a level of your own (Group by's fields, an order's choices): its head shows the
1256
1311
  * level's name and its Back calls onBack; hand null once you are back. On a computer and a phone. */
1257
1312
  onStepChange?: (step: ViewsBodyStep | null) => void;
1313
+ /** Its rows as data (`menus.groupEditor`, VK-1063): its settings and its foot, reshaped. `CONTROLS.GroupBody` draws what it
1314
+ * hands back; a body of your own may honour it. */
1315
+ items?: ViewsGroupEditorItems;
1316
+ };
1317
+ /** Where a Customize body stands: its list, a section's page, or `page:<key>`, a page of the app's own (VK-1062). */
1318
+ export type ViewsCustomizePage = "list" | "layout" | "columns" | "filter" | "sort" | "group" | `page:${string}`;
1319
+ /** A row of Customize as data (VK-1062): a menu's row (`ViewsMenuItem`), its value in the brand while it differs from the
1320
+ * view as saved (`inForce`), and on Customize's list a page of the app's own (`page`), opened by the row and titled by its
1321
+ * `label`. A row whose key is one of Customize's own (list.md, Default keys) is ViewKit's row, with this item's words, icon,
1322
+ * value, mark and divider. */
1323
+ export type ViewsCustomizeItem = Omit<ViewsMenuItem, "children"> & {
1324
+ inForce?: boolean;
1325
+ /** On Customize's list alone: a page of the app's own, or a function handed its Back. */
1326
+ page?: ReactNode | ((back: () => void) => ReactNode);
1327
+ children?: ViewsCustomizeItem[];
1328
+ };
1329
+ /** Which of Customize's rows a function is handed: its list, Layout's page, or Columns' page; the form; the layout in use. */
1330
+ export type ViewsCustomizeItemsContext = {
1331
+ page: "list" | "layout" | "columns";
1332
+ form: "computer" | "phone";
1333
+ layout?: string;
1258
1334
  };
1259
- /** Where a Customize body stands: its list, or a section's page. */
1260
- export type ViewsCustomizePage = "list" | "layout" | "columns" | "filter" | "sort" | "group";
1335
+ /** Customize's rows reshaped: handed a page's default rows, it hands back the rows that page draws. Called as Customize draws:
1336
+ * pure and cheap, no hooks. */
1337
+ export type ViewsCustomizeItems = (items: ViewsCustomizeItem[], ctx: ViewsCustomizeItemsContext) => ViewsCustomizeItem[];
1261
1338
  /** A setting turned on or off in Customize (Show counts, a layout's Freeze first column, a column's Show time): the
1262
1339
  * panels' `ToggleConfig`, written out here. `onChange` writes it; `reset`, where present, takes it back to the
1263
1340
  * reader's default; `section`, the heading it stands under, where it has one. */
@@ -1497,6 +1574,9 @@ export type ViewsCustomizeBodyProps = {
1497
1574
  /** On a phone where the sheet's head doesn't draw it (`sheetActions: "bar"`): its ✕, closing it, for your body's own
1498
1575
  * head. Absent on a computer, and under `head`, where the sheet holds it. */
1499
1576
  actions?: ViewsSheetActions;
1577
+ /** Customize's rows as data (`menus.customize`, VK-1062): the list's and Layout's and Columns' pages' rows, reshaped.
1578
+ * `CONTROLS.CustomizeBody` draws what it hands back; a body of your own may honour it. */
1579
+ items?: ViewsCustomizeItems;
1500
1580
  /** The view's name, as the app hands it through the toolbar (`viewName`): draw it, renamed in place, only with `onRename`. */
1501
1581
  name?: string;
1502
1582
  /** Renames the view (the toolbar's `onRenameView`): handed only where the app can rename it. */
@@ -1630,7 +1710,7 @@ export type ViewsComponents = {
1630
1710
  Checkbox: ComponentType<ViewsCheckboxProps>;
1631
1711
  Menu: ComponentType<ViewsMenuProps>;
1632
1712
  /** @deprecated Read by nothing: the grid's menus are your `Menu` and every list an editor opens is your `Picker`.
1633
- * Leave it out; it goes at a later minor. */
1713
+ * Leave it out; it goes in a later release that breaks something anyway. */
1634
1714
  Command?: ViewsCommandParts;
1635
1715
  /** Optional: the filter's month draws through it (the date editor opens `DateBody`). Reached without one, it throws
1636
1716
  * an error naming it. */
@@ -5,7 +5,8 @@ export { DEFAULT_DESKTOP_QUERY } from "../internal/phone-line.js";
5
5
  * The package's own: no entry point exports it. */
6
6
  export declare function isDesktopNow(query: string): boolean;
7
7
  /** Whether the screen is a desktop, by the provider's `desktopQuery`: true where there is no
8
- * `matchMedia`. It follows the query's changes. The package's own: no entry point exports it. */
8
+ * `matchMedia`; inside a `ScreenForms` twin while the page comes alive, the screen it is told. It follows the query's
9
+ * changes. The package's own: no entry point exports it. */
9
10
  export declare function useDesktop(): boolean;
10
11
  /** Whether `query` matches the screen, following its changes. `fallback` is the answer where the screen
11
12
  * can't be asked (a server render, no `matchMedia`). The package's own: no entry point exports it. */
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { useCallback, useSyncExternalStore } from "react";
2
+ import { useCallback, useContext, useSyncExternalStore } from "react";
3
+ import { ScreenTold } from "../internal/screen-forms.js";
3
4
  import { useViews } from "./context.js";
4
5
  export { DEFAULT_DESKTOP_QUERY } from "../internal/phone-line.js";
5
6
  function canAsk() {
@@ -10,7 +11,9 @@ export function isDesktopNow(query) {
10
11
  }
11
12
  export function useDesktop() {
12
13
  const { desktopQuery } = useViews();
13
- return useMediaQuery(desktopQuery, true);
14
+ const told = useContext(ScreenTold);
15
+ const desktop = useMediaQuery(desktopQuery, true);
16
+ return told ? told === "computer" : desktop;
14
17
  }
15
18
  export function useMediaQuery(query, fallback) {
16
19
  const subscribe = useCallback((onChange) => {
@@ -6,7 +6,7 @@ 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, ViewsPaneProps, 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, ViewsCustomizeItem, ViewsCustomizeItems, ViewsCustomizeItemsContext, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterEditorItems, ViewsFilterEditorItemsContext, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupEditorItems, ViewsGroupEditorItemsContext, 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, ViewsSortEditorItems, ViewsSortEditorItemsContext, 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";