viewkitjs 0.32.0 → 0.33.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 (245) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/fields/dist/index.d.ts +1 -1
  3. package/fields/dist/index.js +1 -1
  4. package/fields/dist/query/evaluate.d.ts +7 -0
  5. package/fields/dist/query/exact-number.d.ts +8 -2
  6. package/fields/dist/query/exact-number.js +14 -1
  7. package/fields/dist/query/sort.js +13 -10
  8. package/fields/dist/registry.js +5 -1
  9. package/fields/dist/types.d.ts +4 -1
  10. package/fields/dist/zod.d.ts +5 -0
  11. package/fields/dist/zod.js +10 -1
  12. package/fields/docs/guides/contact-values.md +12 -0
  13. package/fields/docs/guides/field-types.md +1 -1
  14. package/fields/docs/guides/queries.md +3 -1
  15. package/fields/docs/reference/fields.md +1 -0
  16. package/package.json +1 -1
  17. package/postgres/dist/check.js +4 -1
  18. package/postgres/dist/definitions/formula-forms.js +3 -1
  19. package/postgres/dist/definitions/money.js +2 -1
  20. package/postgres/dist/page.js +6 -3
  21. package/postgres/dist/rules.d.ts +15 -1
  22. package/postgres/dist/rules.js +16 -0
  23. package/postgres/dist/sort.js +7 -2
  24. package/postgres/docs/guides/definitions.md +1 -1
  25. package/postgres/docs/guides/field-map.md +1 -1
  26. package/postgres/docs/reference/definitions.md +1 -1
  27. package/postgres/docs/reference/postgres.md +1 -1
  28. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  29. package/views/dist/atoms/ToolbarButton.js +4 -3
  30. package/views/dist/atoms/frame-parts.d.ts +6 -0
  31. package/views/dist/atoms/frame-parts.js +15 -0
  32. package/views/dist/atoms/types.d.ts +16 -7
  33. package/views/dist/cells/cell-title.d.ts +3 -1
  34. package/views/dist/cells/cell-title.js +2 -2
  35. package/views/dist/cells/cell-values.js +2 -2
  36. package/views/dist/contract.d.ts +31 -6
  37. package/views/dist/contract.js +123 -0
  38. package/views/dist/controls/button/map-button.js +2 -0
  39. package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
  40. package/views/dist/controls/checkbox/checkbox.js +2 -2
  41. package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
  42. package/views/dist/controls/compound-editor/name-parts.js +4 -4
  43. package/views/dist/controls/compound-editor/place-parts.js +19 -19
  44. package/views/dist/controls/compound-editor/range-parts.js +14 -14
  45. package/views/dist/controls/compound-editor/row.d.ts +3 -1
  46. package/views/dist/controls/compound-editor/row.js +2 -2
  47. package/views/dist/controls/controls.d.ts +2 -0
  48. package/views/dist/controls/controls.js +2 -0
  49. package/views/dist/controls/customize/customize.js +37 -35
  50. package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
  51. package/views/dist/controls/customize/map-customize-body.js +4 -0
  52. package/views/dist/controls/date-editor/date-days.js +2 -2
  53. package/views/dist/controls/date-editor/date-editor.js +18 -18
  54. package/views/dist/controls/date-editor/date-parts.js +6 -6
  55. package/views/dist/controls/date-editor/map-calendar.js +1 -1
  56. package/views/dist/controls/date-editor.css +2 -2
  57. package/views/dist/controls/field/field.d.ts +3 -0
  58. package/views/dist/controls/field/field.js +6 -6
  59. package/views/dist/controls/filter-editor/block.d.ts +2 -2
  60. package/views/dist/controls/filter-editor/block.js +5 -5
  61. package/views/dist/controls/filter-editor/filter-editor.js +31 -33
  62. package/views/dist/controls/filter-editor/how.d.ts +3 -1
  63. package/views/dist/controls/filter-editor/map-filter-body.d.ts +1 -0
  64. package/views/dist/controls/filter-editor/map-filter-body.js +7 -3
  65. package/views/dist/controls/filter-editor/map-rules.js +1 -1
  66. package/views/dist/controls/filter-editor/parts.js +2 -1
  67. package/views/dist/controls/group-editor/group-editor.js +15 -13
  68. package/views/dist/controls/index.d.ts +2 -0
  69. package/views/dist/controls/index.js +1 -0
  70. package/views/dist/controls/input/input.js +2 -2
  71. package/views/dist/controls/input/map-input.js +2 -0
  72. package/views/dist/controls/internal/editor-parts.js +1 -1
  73. package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
  74. package/views/dist/controls/internal/map-panel-controls.js +20 -0
  75. package/views/dist/controls/internal/panel-controls.d.ts +50 -0
  76. package/views/dist/controls/internal/panel-controls.js +197 -0
  77. package/views/dist/controls/internal/part-slot.d.ts +12 -0
  78. package/views/dist/controls/internal/part-slot.js +5 -0
  79. package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
  80. package/views/dist/controls/links-editor/links-editor.js +27 -27
  81. package/views/dist/controls/menu/map-menu.d.ts +2 -2
  82. package/views/dist/controls/menu/map-menu.js +15 -12
  83. package/views/dist/controls/menu/menu.d.ts +2 -0
  84. package/views/dist/controls/menu/menu.js +3 -3
  85. package/views/dist/controls/menu-list/menu-list.d.ts +14 -4
  86. package/views/dist/controls/menu-list/menu-list.js +23 -22
  87. package/views/dist/controls/notice/notice.d.ts +3 -1
  88. package/views/dist/controls/notice/notice.js +2 -2
  89. package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
  90. package/views/dist/controls/number-editor/number-editor.js +13 -13
  91. package/views/dist/controls/number-field/number-field.js +5 -3
  92. package/views/dist/controls/pane/pane.d.ts +4 -2
  93. package/views/dist/controls/pane/pane.js +4 -4
  94. package/views/dist/controls/picker/picker.d.ts +2 -0
  95. package/views/dist/controls/picker/picker.js +37 -36
  96. package/views/dist/controls/picker/rows.d.ts +4 -0
  97. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  98. package/views/dist/controls/popover/map-popover.js +4 -2
  99. package/views/dist/controls/quick-filters/quick-filters.js +4 -4
  100. package/views/dist/controls/radio/radio.d.ts +3 -0
  101. package/views/dist/controls/radio/radio.js +4 -3
  102. package/views/dist/controls/select/map-select.d.ts +3 -0
  103. package/views/dist/controls/select/map-select.js +8 -0
  104. package/views/dist/controls/select/select.d.ts +3 -0
  105. package/views/dist/controls/select/select.js +3 -3
  106. package/views/dist/controls/sheet/bottom-sheet.d.ts +5 -1
  107. package/views/dist/controls/sheet/bottom-sheet.js +2 -2
  108. package/views/dist/controls/sheet/map-sheet.js +1 -1
  109. package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
  110. package/views/dist/controls/sort-editor/map-sort-body.js +7 -3
  111. package/views/dist/controls/sort-editor/sort-editor.js +24 -26
  112. package/views/dist/controls/sort-editor.css +5 -0
  113. package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
  114. package/views/dist/controls/text-editor/text-editor.js +8 -8
  115. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +3 -3
  116. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +7 -6
  117. package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
  118. package/views/dist/controls/values-editor/values-editor.js +22 -22
  119. package/views/dist/controls/views-list/map-view-menu.js +1 -1
  120. package/views/dist/controls/views-list/view-menu.js +6 -6
  121. package/views/dist/controls/views-list/views-list.js +4 -4
  122. package/views/dist/editors/EditorPanel.js +1 -1
  123. package/views/dist/field-row/FieldRow.js +13 -0
  124. package/views/dist/fields/money.d.ts +5 -2
  125. package/views/dist/fields/money.js +14 -2
  126. package/views/dist/grid/chrome/GridTable.js +4 -1
  127. package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
  128. package/views/dist/grid/chrome/cell-clipboard.js +2 -2
  129. package/views/dist/grid/chrome/cells.js +3 -1
  130. package/views/dist/grid/chrome/grid-row-menu-items.js +1 -1
  131. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  132. package/views/dist/grid/chrome/useGridKeyboard.js +29 -6
  133. package/views/dist/grid/chrome/useGridTableInteractionModel.js +9 -2
  134. package/views/dist/grid/core/clipboard-model.d.ts +3 -1
  135. package/views/dist/grid/core/clipboard-model.js +9 -8
  136. package/views/dist/grid/core/editing-controller.d.ts +3 -0
  137. package/views/dist/grid/core/editing-controller.js +6 -0
  138. package/views/dist/grid/core/edits-sink.d.ts +19 -0
  139. package/views/dist/grid/core/edits-sink.js +2 -0
  140. package/views/dist/grid/core/spreadsheet-operations.js +1 -1
  141. package/views/dist/grid/core/useGridEditing.d.ts +5 -0
  142. package/views/dist/grid/core/useGridEditing.js +6 -0
  143. package/views/dist/list/answer.d.ts +40 -0
  144. package/views/dist/list/answer.js +43 -0
  145. package/views/dist/list/bulk-bar.d.ts +7 -0
  146. package/views/dist/list/bulk-bar.js +10 -0
  147. package/views/dist/list/columns.d.ts +24 -0
  148. package/views/dist/list/columns.js +27 -0
  149. package/views/dist/list/edits.d.ts +19 -0
  150. package/views/dist/list/edits.js +56 -0
  151. package/views/dist/list/grid.d.ts +11 -0
  152. package/views/dist/list/grid.js +76 -0
  153. package/views/dist/list/index.d.ts +14 -1
  154. package/views/dist/list/index.js +4 -1
  155. package/views/dist/list/link.d.ts +8 -0
  156. package/views/dist/list/link.js +78 -0
  157. package/views/dist/list/list.d.ts +70 -0
  158. package/views/dist/list/list.js +14 -0
  159. package/views/dist/list/parts.js +10 -3
  160. package/views/dist/list/root-base.d.ts +46 -0
  161. package/views/dist/list/root-base.js +137 -0
  162. package/views/dist/list/root.d.ts +35 -34
  163. package/views/dist/list/root.js +153 -113
  164. package/views/dist/list/source-answers.d.ts +39 -0
  165. package/views/dist/list/source-answers.js +225 -0
  166. package/views/dist/list/store.d.ts +37 -5
  167. package/views/dist/list/store.js +31 -0
  168. package/views/dist/list/toolbar.d.ts +3 -2
  169. package/views/dist/list/toolbar.js +14 -2
  170. package/views/dist/list/views-axis.js +4 -2
  171. package/views/dist/list/views.d.ts +7 -2
  172. package/views/dist/list/views.js +16 -5
  173. package/views/dist/model/column-capabilities.d.ts +13 -0
  174. package/views/dist/model/column-capabilities.js +23 -2
  175. package/views/dist/model/column-schema.d.ts +11 -1
  176. package/views/dist/model/view-rules.js +1 -0
  177. package/views/dist/panels/model.d.ts +2 -0
  178. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +8 -2
  179. package/views/dist/panels/react/toolbar/ReadyToolbar.js +2 -2
  180. package/views/dist/panels/react/toolbar/Toolbar.d.ts +8 -1
  181. package/views/dist/panels/react/toolbar/Toolbar.js +12 -3
  182. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
  183. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  184. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
  185. package/views/dist/panels/react/toolbar/ToolbarButton.js +4 -1
  186. package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
  187. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -1
  188. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
  189. package/views/dist/panels/react/toolbar/ToolbarFilters.js +2 -2
  190. package/views/dist/panels/react/toolbar/ToolbarNew.js +1 -1
  191. package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
  192. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  193. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  194. package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
  195. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
  196. package/views/dist/panels/react/toolbar/context.d.ts +10 -1
  197. package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
  198. package/views/dist/panels/react/toolbar/panel-part.js +5 -3
  199. package/views/dist/panels/settings/filter-groups.js +6 -1
  200. package/views/dist/provider/ViewsProvider.d.ts +6 -2
  201. package/views/dist/provider/ViewsProvider.js +18 -1
  202. package/views/dist/provider/components.d.ts +59 -0
  203. package/views/dist/provider/components.js +1 -1
  204. package/views/dist/provider/context.d.ts +4 -1
  205. package/views/dist/provider/own-control.d.ts +4 -0
  206. package/views/dist/provider/own-control.js +7 -0
  207. package/views/dist/provider/select-items.d.ts +3 -0
  208. package/views/dist/provider/select-items.js +6 -0
  209. package/views/dist/react.d.ts +4 -2
  210. package/views/dist/react.js +2 -0
  211. package/views/dist/styles.css +86 -78
  212. package/views/dist/styles.unlayered.css +86 -78
  213. package/views/docs/contract.md +252 -5
  214. package/views/docs/controls/compound-editor.md +4 -0
  215. package/views/docs/controls/customize.md +6 -0
  216. package/views/docs/controls/date-editor.md +4 -0
  217. package/views/docs/controls/field.md +4 -0
  218. package/views/docs/controls/filter-editor.md +8 -0
  219. package/views/docs/controls/group-editor.md +6 -0
  220. package/views/docs/controls/input.md +4 -0
  221. package/views/docs/controls/links-editor.md +4 -0
  222. package/views/docs/controls/menu-list.md +8 -0
  223. package/views/docs/controls/menu.md +4 -0
  224. package/views/docs/controls/notice.md +4 -0
  225. package/views/docs/controls/number-editor.md +4 -0
  226. package/views/docs/controls/pane.md +4 -0
  227. package/views/docs/controls/picker.md +8 -0
  228. package/views/docs/controls/quick-filters.md +6 -0
  229. package/views/docs/controls/radio.md +4 -0
  230. package/views/docs/controls/select.md +8 -0
  231. package/views/docs/controls/sheet.md +4 -0
  232. package/views/docs/controls/sort-editor.md +8 -0
  233. package/views/docs/controls/text-editor.md +4 -0
  234. package/views/docs/controls/values-editor.md +4 -0
  235. package/views/docs/controls/views-list.md +6 -0
  236. package/views/docs/guides/the-grid.md +2 -2
  237. package/views/docs/guides/the-provider.md +19 -2
  238. package/views/docs/reference/controls.md +7 -5
  239. package/views/docs/reference/field-row.md +1 -1
  240. package/views/docs/reference/grid.md +1 -1
  241. package/views/docs/reference/list.md +141 -11
  242. package/views/docs/reference/panels-react.md +2 -2
  243. package/views/docs/reference/react.md +15 -9
  244. package/views/docs/reference/views.md +8 -4
  245. package/views/docs/reshaping.md +6 -1
@@ -37,6 +37,9 @@ export type ViewsButtonProps = {
37
37
  "aria-expanded"?: boolean;
38
38
  /** The part's name, `vk-grid-row-more` on a row's ⋯. */
39
39
  "data-slot"?: string;
40
+ /** Which one of a part that repeats, beside its `data-slot` (VK-1013: inside ViewKit's panels, under `panelControls`): a
41
+ * rule's field, an action's verb. Forward it to your element. */
42
+ "data-key"?: string;
40
43
  /** A state flag: `""` (present, no value) while the menu this button opens is open; absent when closed. */
41
44
  "data-open"?: "";
42
45
  /** True while a field row's write is pending: the button keeps its focus and takes no press. Forward it to your
@@ -87,6 +90,8 @@ export type ViewsPopoverProps = {
87
90
  /** The popup's own style, where a class cannot say it: a width that follows the cell it opens on. */
88
91
  style?: CSSProperties;
89
92
  className?: string;
93
+ /** Its name to a screen reader (VK-1013: Add sort's fields, inside a panel under `panelControls`): your popup's `aria-label`. */
94
+ label?: string;
90
95
  children: ReactNode;
91
96
  };
92
97
  /** The app mounts one tooltip provider above the views; a tooltip never mounts its own. Its child may be a plain
@@ -161,6 +166,9 @@ export type ViewsMenuItem = {
161
166
  * to find it). Called while the menu draws: return elements, call no hooks in it. Honoured on a plain row: a group, a
162
167
  * tick and a link draw as they are. A hint: an adapter that ignores it draws the label. */
163
168
  render?: () => ReactNode;
169
+ /** The row's public name where ViewKit names it (VK-1013: `vk-sort-rule-action`, a panel's menu under `panelControls`), its
170
+ * `key` saying which one: draw them on your row as its `data-slot` and `data-key`. */
171
+ slot?: string;
164
172
  };
165
173
  /** Opens at `anchor`, with no trigger child; a group opens beside it only where it asks to and the
166
174
  * adapter can. On Base UI, the menu's root, positioner and popup, the anchor handed to the positioner. */
@@ -175,6 +183,9 @@ export type ViewsMenuProps = {
175
183
  * menu the package opens hands one. */
176
184
  label?: string;
177
185
  className?: string;
186
+ /** The menu's public name where ViewKit names it (VK-988: `vk-view-menu`): draw it on your popup as its `data-slot`. ViewKit's
187
+ * own Menu also names each row `<name>-row`, which one by its item's `data-key`. */
188
+ "data-slot"?: string;
178
189
  };
179
190
  /** The command list's parts, the shape both cmdk-based shadcn copies already have. */
180
191
  export type ViewsCommandParts = {
@@ -812,6 +823,8 @@ export type ViewsFilterBodyField = {
812
823
  type: keyof typeof FILTER_OPERATORS;
813
824
  /** A relation's far fields, one level in: a rule on one is a relation rule (any, none or every where …). */
814
825
  far?: readonly ViewsFilterBodyField[];
826
+ /** A number field that holds whole numbers only (`isIntegerField`): your body's box takes whole numbers. Absent, any. */
827
+ integer?: true;
815
828
  /** A choice field's values (a status's, a select's, a person's, a record's), or a place's country's names (its `countryCode`
816
829
  * part, VK-735), each as the Picker draws it, where ViewKit holds
817
830
  * them as the list opens: your body may list them in the rule's value box. Absent where its values are read on demand, or the
@@ -1518,6 +1531,49 @@ export type ViewsInputProps = Omit<ComponentPropsWithRef<"input">, "children"> &
1518
1531
  * wears the app's field frame, as a form's input does. Default `bare`. */
1519
1532
  chrome?: "bare" | "field";
1520
1533
  };
1534
+ /** One row of a Select's list (VK-1013). `level` holds the rows one level in, under a row that is never picked itself (a
1535
+ * deal's Company › Region): draw them in place, or flatten them with `flatSelectItems`, each named by its path. */
1536
+ export type ViewsSelectItem = {
1537
+ value: string;
1538
+ label: string;
1539
+ /** Its mark before the words: a field's type, a direction's arrow. */
1540
+ icon?: ReactNode;
1541
+ /** A second line under the words ("Sorted"). */
1542
+ line?: string;
1543
+ /** The heading it stands under. */
1544
+ group?: string;
1545
+ /** It can't be picked: greyed, passed over by the keys. */
1546
+ disabled?: boolean;
1547
+ level?: ViewsSelectItem[];
1548
+ };
1549
+ /** 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). */
1551
+ export type ViewsSelectProps = {
1552
+ items: ViewsSelectItem[];
1553
+ /** One value, several (with `multiple`), or none. */
1554
+ value: string | string[] | null;
1555
+ /** A pick: one value, or the values now picked. */
1556
+ onValueChange: (value: string | string[] | null) => void;
1557
+ multiple?: boolean;
1558
+ /** What the box says with nothing picked. */
1559
+ placeholder?: string;
1560
+ disabled?: boolean;
1561
+ /** Its list held open or shut from outside, told every press that would open or shut it. On a phone a panel holds it
1562
+ * shut and turns its sheet to a step of its own on `onOpenChange(true)`: honour both when handed. */
1563
+ open?: boolean;
1564
+ onOpenChange?: (open: boolean) => void;
1565
+ /** The words of the search ViewKit's own Select shows over a long list ("Search deal fields"); yours may show one. */
1566
+ search?: string;
1567
+ size?: "sm" | "default";
1568
+ className?: string;
1569
+ "aria-label"?: string;
1570
+ /** The part's public name (`vk-sort-field`) and which one: draw them on the box a person presses. */
1571
+ "data-slot"?: string;
1572
+ "data-key"?: string;
1573
+ };
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";
1576
+ export declare const PANEL_CONTROL_NAMES: readonly PanelControlName[];
1521
1577
  /** What the components map's `RowsWait` is handed: a grid's rows, and whether new ones are loading. */
1522
1578
  export type ViewsRowsWaitProps = {
1523
1579
  /** New rows are loading: `children` are the old ones, inert. Draw how they wait (a bar along the top, the rows
@@ -1567,6 +1623,9 @@ export type ViewsComponents = {
1567
1623
  /** Optional: every editor's single-line box draws through it. Left out, the provider draws a
1568
1624
  * plain `<input>`. */
1569
1625
  Input?: ComponentType<ViewsInputProps>;
1626
+ /** Optional: the panels' boxes that pick (VK-1013), drawn only inside ViewKit's panels and only where the provider's
1627
+ * `panelControls` names `Select`. Left out, the panels draw ViewKit's own (`CONTROLS.Select`). */
1628
+ Select?: ComponentType<ViewsSelectProps>;
1570
1629
  /** Required: a whole pick list your app draws (`CONTROLS.Picker` is ViewKit's own). The select, several-values,
1571
1630
  * place and relation editors open it, handed their rows as data. */
1572
1631
  Picker: ComponentType<ViewsPickerProps>;
@@ -1,5 +1,5 @@
1
+ export const PANEL_CONTROL_NAMES = ["Button", "Select", "Menu", "Popover", "Input"];
1
2
  const _requiredMatchContract = true;
2
3
  const _optionalMatchContract = true;
3
4
  void _requiredMatchContract;
4
5
  void _optionalMatchContract;
5
- export {};
@@ -2,7 +2,7 @@ import type { FieldConventions } from "viewkitjs/fields";
2
2
  import type { ViewsMessageResolver } from "../contract.js";
3
3
  import type { ViewsAtoms } from "../atoms/types.js";
4
4
  import type { FieldPresentation } from "../display/options.js";
5
- import type { ViewsDatePicks, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetActionsPlace } from "./components.js";
5
+ import type { PanelControlName, ViewsDatePicks, ViewsResolvedComponents, ViewsSelectionBarSettings, ViewsSheetActionsPlace } from "./components.js";
6
6
  import type { ViewsIcons } from "./icons.js";
7
7
  import type { ViewsResolvedPorts } from "./ports.js";
8
8
  import type { ViewsEscapeRules } from "../editors/escape-rule.js";
@@ -40,6 +40,9 @@ export type ViewsContextValue = {
40
40
  selectionBar?: ViewsSelectionBarSettings;
41
41
  /** The quick days the date editors offer (`ViewsProvider`'s `datePicks`); absent, today, tomorrow and next Monday. */
42
42
  datePicks?: ViewsDatePicks;
43
+ /** The controls ViewKit's panels draw as the app's own (`ViewsProvider`'s `panelControls`, VK-1013): each name opted in whose
44
+ * control in `components` is the app's, never one of ViewKit's own. Empty unless the app opts in. */
45
+ panelControls: ReadonlySet<PanelControlName>;
43
46
  };
44
47
  export declare const ViewsContext: import("react").Context<ViewsContextValue | null>;
45
48
  export declare function useViews(): ViewsContextValue;
@@ -0,0 +1,4 @@
1
+ /** The control itself, marked as one of ViewKit's own. */
2
+ export declare function markOwnControl<C extends object>(control: C): C;
3
+ /** Whether a control is one of ViewKit's own map controls. */
4
+ export declare function isOwnControl(control: unknown): boolean;
@@ -0,0 +1,7 @@
1
+ const OWN_CONTROL = Symbol.for("viewkitjs.views.own-control");
2
+ export function markOwnControl(control) {
3
+ return Object.defineProperty(control, OWN_CONTROL, { value: true, enumerable: false });
4
+ }
5
+ export function isOwnControl(control) {
6
+ return (typeof control === "function" || (typeof control === "object" && control !== null)) && control[OWN_CONTROL] === true;
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { ViewsSelectItem } from "./components.js";
2
+ /** The rows with every level flattened, each named by its path. */
3
+ export declare function flatSelectItems(items: ViewsSelectItem[]): ViewsSelectItem[];
@@ -0,0 +1,6 @@
1
+ export function flatSelectItems(items) {
2
+ return flatUnder(items, []);
3
+ }
4
+ function flatUnder(items, path) {
5
+ return items.flatMap(({ level, ...row }) => level ? flatUnder(level, [...path, row.label]) : [path.length ? { ...row, label: [...path, row.label].join(" › ") } : row]);
6
+ }
@@ -3,11 +3,13 @@ export type { ViewsContextValue, ViewsProviderProps } from "./provider/ViewsProv
3
3
  export type { EditEscape, EditEscapeByEditor, ViewsEscapeRules } from "./editors/escape-rule.js";
4
4
  export type { ViewsOneValueEditors } from "./model/one-value.js";
5
5
  export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
6
+ export { PANEL_CONTROL_NAMES } from "./provider/components.js";
7
+ export { flatSelectItems } from "./provider/select-items.js";
6
8
  export type { ViewsSeveralValues } from "./display/fit-values.js";
7
- 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, ViewsSelectionBarProps, 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, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
8
10
  export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
9
11
  export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
10
12
  export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
11
13
  export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
12
- 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, } from "./atoms/types.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";
13
15
  export type { ComponentName, PortName, ViewsIconName, ViewsMessage, ViewsMessageResolver } from "./contract.js";
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  export { ViewsProvider, useViews } from "./provider/ViewsProvider.js";
3
3
  export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
4
+ export { PANEL_CONTROL_NAMES } from "./provider/components.js";
5
+ export { flatSelectItems } from "./provider/select-items.js";
4
6
  export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
5
7
  export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";