viewkitjs 0.29.0 → 0.30.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 (287) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/MIGRATION.md +97 -8
  3. package/package.json +1 -1
  4. package/views/dist/cells/cell-format.d.ts +2 -2
  5. package/views/dist/cells/cell-values.js +0 -2
  6. package/views/dist/contract.d.ts +15 -18
  7. package/views/dist/contract.js +13 -27
  8. package/views/dist/controls/controls.d.ts +2 -4
  9. package/views/dist/controls/controls.js +2 -2
  10. package/views/dist/controls/customize/customize.d.ts +51 -0
  11. package/views/dist/controls/customize/customize.js +128 -23
  12. package/views/dist/controls/customize/map-customize-body.d.ts +0 -3
  13. package/views/dist/controls/customize/map-customize-body.js +46 -11
  14. package/views/dist/controls/customize/map-ranges.d.ts +23 -0
  15. package/views/dist/controls/customize/map-ranges.js +41 -0
  16. package/views/dist/controls/customize/rules.d.ts +17 -1
  17. package/views/dist/controls/customize/rules.js +2 -0
  18. package/views/dist/controls/customize/words.d.ts +7 -0
  19. package/views/dist/controls/customize/words.js +5 -0
  20. package/views/dist/controls/customize.css +3 -0
  21. package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
  22. package/views/dist/controls/filter-editor/filter-editor.js +1 -0
  23. package/views/dist/controls/filter-editor/rules.d.ts +1 -2
  24. package/views/dist/controls/index.d.ts +8 -8
  25. package/views/dist/controls/index.js +8 -8
  26. package/views/dist/controls/menu-list/menu-list.d.ts +16 -1
  27. package/views/dist/controls/menu-list/menu-list.js +26 -8
  28. package/views/dist/controls/menu-list.css +8 -0
  29. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +1 -1
  30. package/views/dist/controls/quick-filters/map-quick-filters-body.js +6 -3
  31. package/views/dist/controls/sheet/map-sheet.js +1 -1
  32. package/views/dist/controls/text-editor/map-text-body.d.ts +1 -1
  33. package/views/dist/controls/text-editor/map-text-body.js +2 -2
  34. package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
  35. package/views/dist/controls/text-editor/text-editor.js +16 -2
  36. package/views/dist/controls/text-editor.css +11 -0
  37. package/views/dist/controls/values-editor/values.js +6 -2
  38. package/views/dist/display/options.d.ts +1 -1
  39. package/views/dist/display/rich-text.js +0 -1
  40. package/views/dist/editors/ChipsEditor.d.ts +4 -5
  41. package/views/dist/editors/ChipsEditor.js +12 -78
  42. package/views/dist/editors/DateEditor.d.ts +12 -16
  43. package/views/dist/editors/DateEditor.js +40 -191
  44. package/views/dist/editors/EditorPanel.d.ts +2 -6
  45. package/views/dist/editors/EditorPanel.js +2 -2
  46. package/views/dist/editors/LocationEditor.d.ts +11 -19
  47. package/views/dist/editors/LocationEditor.js +19 -211
  48. package/views/dist/editors/NameEditor.d.ts +8 -16
  49. package/views/dist/editors/NameEditor.js +11 -100
  50. package/views/dist/editors/NumberEditor.d.ts +14 -21
  51. package/views/dist/editors/NumberEditor.js +22 -49
  52. package/views/dist/editors/RangeEditor.d.ts +9 -33
  53. package/views/dist/editors/RangeEditor.js +12 -97
  54. package/views/dist/editors/RelationEditor.d.ts +6 -9
  55. package/views/dist/editors/RelationEditor.js +11 -30
  56. package/views/dist/editors/RelationSetEditor.d.ts +13 -24
  57. package/views/dist/editors/RelationSetEditor.js +33 -101
  58. package/views/dist/editors/SelectEditor.d.ts +15 -17
  59. package/views/dist/editors/SelectEditor.js +15 -94
  60. package/views/dist/editors/TextEditor.d.ts +23 -26
  61. package/views/dist/editors/TextEditor.js +11 -48
  62. package/views/dist/editors/ValueListEditor.d.ts +14 -23
  63. package/views/dist/editors/ValueListEditor.js +16 -202
  64. package/views/dist/editors/body-panel.d.ts +13 -7
  65. package/views/dist/editors/body-panel.js +3 -7
  66. package/views/dist/editors/edit-cores.d.ts +15 -15
  67. package/views/dist/editors/edit-cores.js +14 -14
  68. package/views/dist/editors/number-body.d.ts +1 -1
  69. package/views/dist/editors/number-step.d.ts +0 -34
  70. package/views/dist/editors/number-step.js +0 -37
  71. package/views/dist/editors/option-add-flow.d.ts +1 -13
  72. package/views/dist/editors/option-add-flow.js +0 -22
  73. package/views/dist/editors/relation-links-body.d.ts +2 -3
  74. package/views/dist/editors/relation-picker.d.ts +13 -3
  75. package/views/dist/editors/relation-source.d.ts +0 -22
  76. package/views/dist/editors/relation-source.js +0 -21
  77. package/views/dist/field-row/FieldRow.js +5 -6
  78. package/views/dist/field-row/FieldRowLane.js +0 -1
  79. package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
  80. package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
  81. package/views/dist/field-row/editors/RowDateEditor.js +2 -2
  82. package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
  83. package/views/dist/field-row/editors/RowNameEditor.js +7 -12
  84. package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
  85. package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
  86. package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
  87. package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
  88. package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
  89. package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
  90. package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
  91. package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
  92. package/views/dist/field-row/editors/RowTextEditor.js +3 -4
  93. package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
  94. package/views/dist/field-row/field-row-button.d.ts +6 -9
  95. package/views/dist/field-row/field-row-button.js +1 -6
  96. package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
  97. package/views/dist/field-row/row-target.d.ts +0 -7
  98. package/views/dist/field-row/row-target.js +0 -2
  99. package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
  100. package/views/dist/grid/chrome/GridAddColumn.js +8 -66
  101. package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
  102. package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
  103. package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
  104. package/views/dist/grid/chrome/GridCellEditors.js +12 -12
  105. package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
  106. package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
  107. package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
  108. package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
  109. package/views/dist/grid/chrome/GridDateEditor.js +3 -3
  110. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
  111. package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
  112. package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
  113. package/views/dist/grid/chrome/GridHeader.js +2 -2
  114. package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
  115. package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
  116. package/views/dist/grid/chrome/GridNameEditor.js +4 -4
  117. package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
  118. package/views/dist/grid/chrome/GridNumberEditor.js +3 -4
  119. package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
  120. package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
  121. package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
  122. package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
  123. package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
  124. package/views/dist/grid/chrome/GridRow.js +0 -3
  125. package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
  126. package/views/dist/grid/chrome/GridRowActions.js +0 -5
  127. package/views/dist/grid/chrome/GridRowCells.js +9 -6
  128. package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
  129. package/views/dist/grid/chrome/GridStructure.js +0 -1
  130. package/views/dist/grid/chrome/GridTable.js +1 -1
  131. package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
  132. package/views/dist/grid/chrome/GridTextEditor.js +4 -17
  133. package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
  134. package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
  135. package/views/dist/grid/chrome/grid-body-place.js +4 -8
  136. package/views/dist/grid/chrome/grid-button.d.ts +7 -10
  137. package/views/dist/grid/chrome/grid-button.js +1 -6
  138. package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
  139. package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
  140. package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
  141. package/views/dist/grid/chrome/grid-group-menu-parts.d.ts +5 -9
  142. package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
  143. package/views/dist/grid/chrome/grid-hover.js +0 -1
  144. package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
  145. package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
  146. package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
  147. package/views/dist/grid/chrome/grid-styles.js +0 -1
  148. package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
  149. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
  150. package/views/dist/grid/core/editing-controller.d.ts +2 -1
  151. package/views/dist/grid/core/editing-controller.js +10 -2
  152. package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
  153. package/views/dist/grid/core/refusal-sentence.js +2 -2
  154. package/views/dist/grid/core/write-states.d.ts +3 -1
  155. package/views/dist/grid/core/write-states.js +6 -2
  156. package/views/dist/grid/grid.css +1 -1
  157. package/views/dist/model/body-frame.d.ts +0 -32
  158. package/views/dist/model/body-frame.js +1 -15
  159. package/views/dist/model/column-inspect.d.ts +5 -5
  160. package/views/dist/model/column-inspect.js +2 -2
  161. package/views/dist/panels/customize-body.d.ts +1 -10
  162. package/views/dist/panels/customize-body.js +0 -3
  163. package/views/dist/panels/filter/MenuSelect.js +0 -5
  164. package/views/dist/panels/filter/RangeFilterBody.js +0 -1
  165. package/views/dist/panels/filter/details.d.ts +1 -5
  166. package/views/dist/panels/filter/details.js +0 -13
  167. package/views/dist/panels/filter/filter-list.d.ts +0 -1
  168. package/views/dist/panels/filter/filter-list.js +1 -1
  169. package/views/dist/panels/panel-button.d.ts +10 -12
  170. package/views/dist/panels/panel-button.js +1 -6
  171. package/views/dist/panels/react/chrome.d.ts +0 -17
  172. package/views/dist/panels/react/chrome.js +0 -8
  173. package/views/dist/panels/react/customize-body.d.ts +9 -12
  174. package/views/dist/panels/react/customize-body.js +57 -11
  175. package/views/dist/panels/react/customize.d.ts +9 -12
  176. package/views/dist/panels/react/customize.js +3 -112
  177. package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
  178. package/views/dist/panels/react/filter/FilterEditor.js +6 -330
  179. package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
  180. package/views/dist/panels/react/filter/FilterFieldList.js +27 -59
  181. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
  182. package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
  183. package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
  184. package/views/dist/panels/react/filter/editor-ctx.js +5 -33
  185. package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
  186. package/views/dist/panels/react/filter/filter-part-body.js +0 -5
  187. package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
  188. package/views/dist/panels/react/filter/rule-writes.js +4 -95
  189. package/views/dist/panels/react/order-details.d.ts +1 -26
  190. package/views/dist/panels/react/order-details.js +3 -69
  191. package/views/dist/panels/react/panel-header.js +0 -1
  192. package/views/dist/panels/react/popover.d.ts +4 -7
  193. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
  194. package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -137
  195. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
  196. package/views/dist/panels/react/sort/SortEditor.js +8 -245
  197. package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
  198. package/views/dist/panels/react/sort/SortFieldList.js +11 -25
  199. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +2 -2
  200. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -16
  201. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  202. package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
  203. package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
  204. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
  205. package/views/dist/panels/react/view-actions.js +0 -1
  206. package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
  207. package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
  208. package/views/dist/panels/react/views-row/ViewPicker.js +7 -43
  209. package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
  210. package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
  211. package/views/dist/panels/react/views-row/menu-classes.js +0 -2
  212. package/views/dist/panels/react.d.ts +5 -12
  213. package/views/dist/panels/react.js +5 -12
  214. package/views/dist/provider/ViewsProvider.d.ts +2 -46
  215. package/views/dist/provider/ViewsProvider.js +2 -22
  216. package/views/dist/provider/components.d.ts +153 -106
  217. package/views/dist/provider/context.d.ts +1 -21
  218. package/views/dist/provider/missing-slot.d.ts +3 -7
  219. package/views/dist/provider/missing-slot.js +2 -9
  220. package/views/dist/react.d.ts +1 -2
  221. package/views/dist/selection/SelectionBar.js +2 -3
  222. package/views/dist/styles.css +40 -168
  223. package/views/dist/styles.unlayered.css +40 -168
  224. package/views/docs/contract.md +99 -123
  225. package/views/docs/getting-started.md +222 -2
  226. package/views/docs/guides/cells.md +222 -2
  227. package/views/docs/guides/display.md +1 -1
  228. package/views/docs/guides/editors.md +235 -20
  229. package/views/docs/guides/ports.md +1 -1
  230. package/views/docs/guides/selection.md +1 -1
  231. package/views/docs/guides/the-grid.md +14 -16
  232. package/views/docs/guides/the-provider.md +9 -15
  233. package/views/docs/reference/cells.md +1 -1
  234. package/views/docs/reference/controls.md +26 -13
  235. package/views/docs/reference/editors-chips.md +2 -2
  236. package/views/docs/reference/editors-date.md +4 -4
  237. package/views/docs/reference/editors-location.md +4 -7
  238. package/views/docs/reference/editors-name.md +3 -5
  239. package/views/docs/reference/editors-number.md +10 -10
  240. package/views/docs/reference/editors-panel.md +3 -3
  241. package/views/docs/reference/editors-range.md +3 -5
  242. package/views/docs/reference/editors-relation.md +4 -4
  243. package/views/docs/reference/editors-select.md +3 -3
  244. package/views/docs/reference/editors-text.md +3 -4
  245. package/views/docs/reference/editors-value-list.md +3 -3
  246. package/views/docs/reference/field-row.md +1 -1
  247. package/views/docs/reference/grid.md +2 -2
  248. package/views/docs/reference/panels-react.md +20 -34
  249. package/views/docs/reference/react.md +11 -18
  250. package/views/docs/reference/views.md +5 -5
  251. package/views/skills/views/SKILL.md +1 -1
  252. package/views/dist/editors/relation-panel.d.ts +0 -69
  253. package/views/dist/editors/relation-panel.js +0 -46
  254. package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
  255. package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
  256. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
  257. package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
  258. package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
  259. package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
  260. package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
  261. package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
  262. package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
  263. package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
  264. package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
  265. package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
  266. package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
  267. package/views/dist/grid/chrome/GridFlyout.js +0 -80
  268. package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
  269. package/views/dist/grid/chrome/GridMenuRow.js +0 -15
  270. package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
  271. package/views/dist/grid/chrome/grid-menu-search.js +0 -7
  272. package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
  273. package/views/dist/panels/react/GroupBucketsList.js +0 -44
  274. package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
  275. package/views/dist/panels/react/LayoutColumnsList.js +0 -101
  276. package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
  277. package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
  278. package/views/dist/panels/react/drag.d.ts +0 -2
  279. package/views/dist/panels/react/drag.js +0 -5
  280. package/views/dist/panels/react/layout-detail.d.ts +0 -4
  281. package/views/dist/panels/react/layout-detail.js +0 -29
  282. package/views/dist/panels/react/root-list.d.ts +0 -6
  283. package/views/dist/panels/react/root-list.js +0 -31
  284. package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
  285. package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
  286. package/views/dist/panels/react/view-footer.d.ts +0 -20
  287. package/views/dist/panels/react/view-footer.js +0 -41
@@ -1,12 +1,11 @@
1
1
  import type { ComponentType, ReactNode } from "react";
2
2
  import type { CloseReason } from "viewkitjs/fields";
3
3
  import type { ViewsLink, ViewsLinkRole, ViewsLinksBodyProps } from "../provider/components.js";
4
- import { type RelationHeld } from "./relation-picker.js";
5
- import type { RelationCreate } from "./relation-panel.js";
4
+ import { type RelationCreate, type RelationHeld } from "./relation-picker.js";
6
5
  import type { RelationCandidate, RelationSource } from "./relation-source.js";
7
6
  /**
8
7
  * A SET'S LINKS THROUGH THE APP'S OWN LINKS BODY — what stands where `RelationPickerBody` stands when the field declares
9
- * `links` and the app hands a `LinksBody`. The rows are the Picker's (`useRelationRows`); the body is handed each link's
8
+ * `links`. The rows are the Picker's (`useRelationRows`); the body is handed each link's
10
9
  * roles, the field's roles and the lead, and hands back the whole list. A link whose record it never handed, or a
11
10
  * repeat, is dropped here; what a role and the lead may be is the core's. Framed as every app body is (`BodyFrame`):
12
11
  * Escape and Tab are the editor's, a marked level's or a popup's Escape the body's. The package's own.
@@ -1,7 +1,18 @@
1
1
  import type { ComponentType, ReactNode } from "react";
2
2
  import type { ViewsPickerAction, ViewsPickerItem, ViewsPickerProps } from "../provider/components.js";
3
- import type { RelationCreate } from "./relation-panel.js";
4
3
  import { type RelationCandidate, type RelationSource } from "./relation-source.js";
4
+ /**
5
+ * A create row for "it isn't in the list yet": the host opens its own create
6
+ * form with what was typed already filled. The app's body draws it as an action
7
+ * after the rows (`ViewsPickerAction`). A press asks the host to close (the core
8
+ * says what that close means), then `onCreate` runs.
9
+ */
10
+ export type RelationCreate = {
11
+ /** The row's words; receives the trimmed query. */
12
+ label: (query: string) => string;
13
+ /** Runs AFTER the host has been asked to close, with the trimmed query. */
14
+ onCreate: (query: string) => void;
15
+ };
5
16
  /** A held record as the body shows it: from its candidate where the page has it, else from its link. */
6
17
  export type RelationHeld = {
7
18
  id: string;
@@ -30,8 +41,7 @@ export declare function useRelationRows({ candidates, query, held, kindGlyph, cr
30
41
  actions?: ViewsPickerAction[];
31
42
  };
32
43
  /**
33
- * A RELATION'S LIST THROUGH THE APP'S OWN PICKER — what stands where `RelationPanel` stands when the app hands
34
- * a `Picker`. ViewKit still filters a static source (by label, as its own list does) and fetches a remote one
44
+ * A RELATION'S LIST THROUGH THE APP'S OWN PICKER. ViewKit filters a static source (by label, as its own list does) and fetches a remote one
35
45
  * (`useRemotePage`: the debounce, the abort, the paging), so the body draws the rows it is handed and reports
36
46
  * each typed query back. Held records come first, by the same search rule; the host's create rows become the
37
47
  * body's actions. What a pick means is the core's: this hands it ids it handed out, nothing else.
@@ -46,25 +46,3 @@ export declare function useRemotePage(source: RelationSource, query: string): Re
46
46
  loadMore: () => void;
47
47
  retry: () => void;
48
48
  };
49
- /**
50
- * The end of the list came into view — ask for the next page.
51
- *
52
- * `shared/list`'s `LazyLoadSentinel` is the house version of this and it is
53
- * deliberately NOT reused: a core may not import from the list (the field
54
- * folder compiles on its own, `tsconfig.fields.json`), so the discipline is
55
- * copied rather than the file.
56
- *
57
- * The copied part that matters: the handler is read through a ref so the
58
- * observer is built ONCE. Every host writes its search inline, so a re-render
59
- * would otherwise disconnect and rebuild the observer — and an
60
- * IntersectionObserver delivers its first callback on a later frame, so a
61
- * panel that re-renders steadily can lose that race indefinitely and simply
62
- * never load a second page, with no error and no symptom beyond "it stops at
63
- * page one". The long version of that reasoning is in `LazyLoadSentinel.tsx`.
64
- *
65
- * No `root`: the observer resolves against the viewport, clipped by the
66
- * scrolling ancestor — which here is the panel's own list.
67
- */
68
- export declare function EndOfListSentinel({ onReveal }: {
69
- onReveal: () => void;
70
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { useCallback, useEffect, useRef, useState } from "react";
4
3
  export const RELATION_SEARCH_DEBOUNCE_MS = 200;
5
4
  export const RELATION_PAGE_SIZE = 20;
@@ -89,23 +88,3 @@ export function useRemotePage(source, query) {
89
88
  }, [remote, run]);
90
89
  return { ...page, searching: remote && (page.searching || query !== page.asked), loadMore, retry };
91
90
  }
92
- export function EndOfListSentinel({ onReveal }) {
93
- const ref = useRef(null);
94
- const onRevealRef = useRef(onReveal);
95
- useEffect(() => {
96
- onRevealRef.current = onReveal;
97
- });
98
- useEffect(() => {
99
- const el = ref.current;
100
- if (!el)
101
- return;
102
- const observer = new IntersectionObserver((entries) => {
103
- for (const entry of entries)
104
- if (entry.isIntersecting)
105
- onRevealRef.current();
106
- }, { rootMargin: "80px 0px" });
107
- observer.observe(el);
108
- return () => observer.disconnect();
109
- }, []);
110
- return _jsx("div", { ref: ref, "aria-hidden": true, className: "h-px" });
111
- }
@@ -16,7 +16,7 @@ import { FIELD_ROW_FRAME, FIELD_ROW_FRAME_BESIDE, FIELD_ROW_FRAME_UNDER, FieldRo
16
16
  import { FieldRowLane } from "./FieldRowLane.js";
17
17
  import { FieldWriteReconciliationRequired, } from "../fields/write-target.js";
18
18
  import { OpenValueAction, isOpenableType } from "../editors/open-value.js";
19
- import { FIELD_ROW_TARGET as TARGET, FIELD_ROW_TARGET_BESIDE as TARGET_BESIDE, FIELD_ROW_TARGET_UNDER as TARGET_UNDER, } from "./row-target.js";
19
+ import { FIELD_ROW_TARGET as TARGET } from "./row-target.js";
20
20
  import { settlementAttributes, useRowSettlement } from "./useRowSettlement.js";
21
21
  import { EditLeaveContext, useEditLeaveScope } from "../editors/leave-scope.js";
22
22
  const EDITOR_PANEL = '[data-slot="vk-editor-panel"]';
@@ -36,7 +36,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
36
36
  const { field } = binding;
37
37
  const views = useViews();
38
38
  const desktop = useDesktop();
39
- const { atoms, components, conventions, icons, messages, fieldRowCheckboxes } = views;
39
+ const { atoms, components, conventions, icons, messages } = views;
40
40
  const { CommandMenu } = atoms;
41
41
  const { AppIcon } = components;
42
42
  const [editing, setEditing] = useState(false);
@@ -158,7 +158,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
158
158
  ...opts,
159
159
  currency: opts?.currency ?? (fieldOwnsCurrency || unread ? undefined : binding.unit?.read(row)),
160
160
  ...(valueInButton ? { slotOwnsClick: true } : {}),
161
- ...(fieldRowCheckboxes === "checkbox" ? { booleanCheckbox: FieldRowCheckbox } : {}),
161
+ booleanCheckbox: FieldRowCheckbox,
162
162
  };
163
163
  const editsInPlace = writable && shownDef.type !== "boolean" && !hasMenu && !unread && !isEmpty;
164
164
  const openType = editsInPlace && singleLink && isOpenableType(shownDef.type) ? shownDef.type : null;
@@ -198,7 +198,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
198
198
  const glyph = binding.icon ? (_jsx(AppIcon, { name: binding.icon, className: "h-3.5 w-3.5 text-(color:--vk-fg-subtlest)" })) : (_jsx(TypeGlyph, { className: "h-3.5 w-3.5 text-(color:--vk-fg-subtlest)" }));
199
199
  const menuItems = fieldRowMenuItems(menu, ready, messages);
200
200
  const valueNode = (_jsxs("span", { ref: valueRef, className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { className: "min-w-0 wrap-break-word", children: body }), meta ? _jsx("span", { className: "shrink-0 text-xs text-(color:--vk-fg-subtle)", children: meta }) : null] }));
201
- const editButton = (shape, className, children) => (_jsx(FieldRowButton, { views: views, own: cx(className, "aria-disabled:pointer-events-none"), frame: cx(shape === "under"
201
+ const editButton = (shape, children) => (_jsx(FieldRowButton, { views: views, frame: cx(shape === "under"
202
202
  ? FIELD_ROW_FRAME_UNDER
203
203
  : shape === "beside"
204
204
  ? FIELD_ROW_FRAME_BESIDE
@@ -215,14 +215,13 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
215
215
  watchLeaving();
216
216
  return attempt(resolution);
217
217
  }, onClose: closed, message: message, kindIcon: kindIcon, openedByKey: byKey }) })) : hasMenu && !verbsInLane ? (_jsx(CommandMenu, { trigger: drawFieldRowButton(views, {
218
- own: TARGET,
219
218
  frame: FIELD_ROW_FRAME,
220
219
  variant: "ghost",
221
220
  size: "sm",
222
221
  "aria-label": field.label,
223
222
  disabled: !ready,
224
223
  children: valueNode,
225
- }), items: menuItems, align: "start" })) : writable && shownDef.type !== "boolean" ? (valueOverButton ? (_jsxs("div", { className: "relative min-w-0", children: [editButton("under", cx(TARGET_UNDER, "disabled:pointer-events-none")), _jsx("span", { "data-slot": "vk-row-value-layer", className: cx("pointer-events-none relative block min-w-0 [&_a]:pointer-events-auto [&_button]:pointer-events-auto", pending && "opacity-70"), children: valueNode })] })) : openType ? (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [editButton("beside", cx(TARGET_BESIDE, "disabled:pointer-events-none", pending && "opacity-70"), valueNode), _jsx(OpenValueAction, { type: openType, value: openValue, label: openLabel, compact: true })] })) : (editButton("target", cx(TARGET, "disabled:pointer-events-none", pending && "opacity-70"), valueNode))) : (_jsx("span", { className: "block min-w-0", children: valueNode })), !editing && note ? (_jsx(FieldNoteLine, { note: typeof note === "string" ? { text: note } : note })) : null, !editing && error && retryDraft ? (_jsx("div", { role: "alert", className: "mt-1 text-xs text-(color:--vk-danger)", children: _jsx("button", { type: "button", "data-slot": "vk-field-retry", onClick: () => {
224
+ }), items: menuItems, align: "start" })) : writable && shownDef.type !== "boolean" ? (valueOverButton ? (_jsxs("div", { className: "relative min-w-0", children: [editButton("under"), _jsx("span", { "data-slot": "vk-row-value-layer", className: cx("pointer-events-none relative block min-w-0 [&_a]:pointer-events-auto [&_button]:pointer-events-auto", pending && "opacity-70"), children: valueNode })] })) : openType ? (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [editButton("beside", valueNode), _jsx(OpenValueAction, { type: openType, value: openValue, label: openLabel, compact: true })] })) : (editButton("target", valueNode))) : (_jsx("span", { className: "block min-w-0", children: valueNode })), !editing && note ? (_jsx(FieldNoteLine, { note: typeof note === "string" ? { text: note } : note })) : null, !editing && error && retryDraft ? (_jsx("div", { role: "alert", className: "mt-1 text-xs text-(color:--vk-danger)", children: _jsx("button", { type: "button", "data-slot": "vk-field-retry", onClick: () => {
226
225
  setError(null);
227
226
  const retried = attempt({ kind: "commit", payload: retryDraft.commit });
228
227
  if (!retried.accepted)
@@ -10,7 +10,6 @@ export function FieldRowLane({ label, verbsInLane, hasMenu, items, ready, writab
10
10
  const More = icons.more;
11
11
  const Lock = icons.lock;
12
12
  return (_jsx("span", { className: "flex h-5 w-3 shrink-0 items-center justify-center", children: verbsInLane ? (_jsx(CommandMenu, { trigger: drawFieldRowButton(views, {
13
- own: "group -m-1 p-1",
14
13
  frame: "group -m-1 size-5 shrink-0",
15
14
  variant: "ghost",
16
15
  size: "icon",
@@ -8,9 +8,9 @@ import { EditorPanel } from "../../editors/EditorPanel.js";
8
8
  import { offeredValues, takesNewValues, useOpenValues } from "../../editors/open-values.js";
9
9
  import { OPTION_ROW_INSET } from "./host.js";
10
10
  import { useRowEditSession } from "./row-session.js";
11
- import { useBodyPanel } from "../../editors/body-panel.js";
11
+ import { bodyPanel } from "../../editors/body-panel.js";
12
12
  export function RowChipsEditor({ binding, field, initial, anchor, onAttempt, onClose, message, }) {
13
- const panel = useBodyPanel("picker", "w-64", "z-90");
13
+ const panel = bodyPanel("picker", "z-90");
14
14
  const editorRef = useRef(null);
15
15
  const anchorRef = useRef(null);
16
16
  const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
@@ -1,12 +1,12 @@
1
1
  import type { RowHostProps } from "./host.js";
2
2
  /**
3
- * The FIELD ROW's host around the shared `DateEditor` — the same calendar the
3
+ * The FIELD ROW's host around the shared `DateEditorHost` — the same date body the
4
4
  * grid cell and the form field open: a popover on a desktop, the sheet on a
5
5
  * phone (`EditorPanel`).
6
6
  *
7
7
  * TWO field types, one panel. They differ in what the row HOLDS, so they differ
8
8
  * only in what this host does with the answer: a `date` is a calendar day, so
9
- * the time the panel may have collected is trimmed off the payload and the chip
9
+ * the time the panel may have collected is trimmed off the payload and the time
10
10
  * starts empty (`timeOptional`); a `datetime` is an instant, so the commit
11
11
  * always carries one — the grid's mode, preserved.
12
12
  *
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from "react";
4
- import { DateEditor } from "../../editors/DateEditor.js";
4
+ import { DateEditorHost } from "../../editors/DateEditor.js";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
6
  import { useRowEditSession } from "./row-session.js";
7
7
  export function RowDateEditor({ field, initial, anchor, onAttempt, onClose, message, }) {
@@ -14,5 +14,5 @@ export function RowDateEditor({ field, initial, anchor, onAttempt, onClose, mess
14
14
  onClose,
15
15
  mapPayload: (payload) => (payload === "" ? null : dayOnly ? payload.slice(0, 10) : payload),
16
16
  });
17
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: "z-90 w-auto", children: (surface) => (_jsx(DateEditor, { ref: editorRef, label: field.label, initial: typeof initial === "string" && initial !== "" ? initial : undefined, timeOptional: dayOnly, dayOnly: dayOnly, clearable: !!field.nullable, fill: surface === "sheet", focusDate: !sheet, onRequestClose: close, message: message })) })] }));
17
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: "z-90 w-auto", children: () => (_jsx(DateEditorHost, { ref: editorRef, label: field.label, initial: typeof initial === "string" && initial !== "" ? initial : undefined, timeOptional: dayOnly, dayOnly: dayOnly, clearable: !!field.nullable, focusDate: !sheet, onRequestClose: close, message: message })) })] }));
18
18
  }
@@ -1,7 +1,4 @@
1
1
  import type { RowHostProps } from "./host.js";
2
- /** The FIELD ROW's host around the shared `NameEditor` — in place, like the
3
- * range host: three boxes replace the value where it sits, on every width.
4
- * With an app's parts body it opens anchored instead, as the place host does:
5
- * a popover under the value on a desktop, the sheet on a phone, the value on
6
- * screen. */
2
+ /** The FIELD ROW's host around the shared `NameEditor`: the app's parts body opens anchored, as the place host does:
3
+ * a popover under the value on a desktop, the sheet on a phone, the value on screen. */
7
4
  export declare function RowNameEditor<Row>({ field, initial, anchor, onAttempt, onClose, }: RowHostProps<Row, "name">): import("react/jsx-runtime").JSX.Element;
@@ -5,19 +5,14 @@ import { isNameValue } from "viewkitjs/fields";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
6
  import { NameEditor } from "../../editors/NameEditor.js";
7
7
  import { useViews } from "../../provider/context.js";
8
- import { ROW_BOX_FRAME } from "./row-frame.js";
9
- import { RowRefusal, useRowEditSession } from "./row-session.js";
10
- import { useBodyPanel } from "../../editors/body-panel.js";
8
+ import { useRowEditSession } from "./row-session.js";
9
+ import { bodyPanel } from "../../editors/body-panel.js";
11
10
  export function RowNameEditor({ field, initial, anchor, onAttempt, onClose, }) {
12
- const panel = useBodyPanel("parts", "w-80 p-2", "z-90 max-w-[calc(100vw-2rem)]");
13
- const { conventions, components } = useViews();
14
- const inPlace = !components.PartsBody;
11
+ const panel = bodyPanel("parts", "z-90 max-w-[calc(100vw-2rem)]");
12
+ const { conventions } = useViews();
15
13
  const editorRef = useRef(null);
16
14
  const anchorRef = useRef(null);
17
- const { session, close } = useRowEditSession({ editorRef, inPlace, onAttempt, onClose });
18
- const editor = (_jsx(NameEditor, { ref: editorRef, initial: isNameValue(initial) ? initial : null, allowEmpty: !!field.nullable, conventions: conventions, label: field.label, ...(inPlace && { boxClassName: ROW_BOX_FRAME }), onRequestClose: close }));
19
- if (!inPlace) {
20
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
21
- }
22
- return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [editor, _jsx(RowRefusal, { text: session.refusal })] }));
15
+ const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
16
+ const editor = (_jsx(NameEditor, { ref: editorRef, initial: isNameValue(initial) ? initial : null, allowEmpty: !!field.nullable, conventions: conventions, label: field.label, onRequestClose: close }));
17
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
23
18
  }
@@ -1,6 +1,6 @@
1
1
  import type { RowHostProps } from "./host.js";
2
2
  /**
3
- * The FIELD ROW's host around the shared `NumberEditor` — in place, on every
3
+ * The FIELD ROW's host around the shared `NumberEditorHost` — in place, on every
4
4
  * width: the core replaces the row's value rather than opening a panel over it.
5
5
  * Its close reasons are the keyboard's and the blur's, which the core names
6
6
  * itself, and the row's session takes only the first.
@@ -4,26 +4,26 @@ import { useRef } from "react";
4
4
  import { acceptFieldCommit } from "viewkitjs/fields";
5
5
  import { ConversionLine } from "../../display/converted.js";
6
6
  import { EditorPanel } from "../../editors/EditorPanel.js";
7
- import { NumberEditor } from "../../editors/NumberEditor.js";
7
+ import { NumberEditorHost } from "../../editors/NumberEditor.js";
8
8
  import { numberBounds } from "../../editors/number-body.js";
9
9
  import { durationUnitOf, numberEditCode, numberEditDecimals, numberEditInitial } from "../../fields/number-edit.js";
10
10
  import { useViews } from "../../provider/context.js";
11
11
  import { ROW_BOX_FRAME } from "./row-frame.js";
12
12
  import { RowRefusal, useRowEditSession } from "./row-session.js";
13
13
  export function RowNumberEditor({ binding, row, field, initial, conversion, onAttempt, onClose, }) {
14
- const { conventions, components } = useViews();
14
+ const { conventions } = useViews();
15
15
  const editorRef = useRef(null);
16
16
  const anchorRef = useRef(null);
17
17
  const { session, close } = useRowEditSession({ editorRef, inPlace: true, onAttempt, onClose });
18
18
  const decimals = numberEditDecimals(field);
19
19
  const durationUnit = durationUnitOf(field);
20
- const body = !!components.NumberBody && !durationUnit;
20
+ const body = !durationUnit;
21
21
  const unitOptions = binding.unit ? [...binding.unit.options] : undefined;
22
22
  const check = (value, unit) => {
23
23
  const read = acceptFieldCommit(field, { value, ...(unit === undefined ? {} : { unit }) }, { conventions, unitOptions });
24
24
  return read.ok ? null : read.reason;
25
25
  };
26
- return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(NumberEditor, { ref: editorRef, boxClassName: ROW_BOX_FRAME, initial: numberEditInitial(initial), unit: binding.unit?.read(row), unitOptions: unitOptions, code: binding.unit ? undefined : numberEditCode(field), decimals: decimals, durationUnit: durationUnit, allowEmpty: !!field.nullable, align: "start", conventions: conventions, ...numberBounds(field), ...(body
26
+ return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(NumberEditorHost, { ref: editorRef, boxClassName: ROW_BOX_FRAME, initial: numberEditInitial(initial), unit: binding.unit?.read(row), unitOptions: unitOptions, code: binding.unit ? undefined : numberEditCode(field), decimals: decimals, durationUnit: durationUnit, allowEmpty: !!field.nullable, align: "start", conventions: conventions, ...numberBounds(field), ...(body
27
27
  ? {
28
28
  type: field.type,
29
29
  label: field.label,
@@ -5,16 +5,16 @@ import { EditorPanel } from "../../editors/EditorPanel.js";
5
5
  import { LocationEditor } from "../../editors/LocationEditor.js";
6
6
  import { useViews } from "../../provider/context.js";
7
7
  import { useRowEditSession } from "./row-session.js";
8
- import { useBodyPanel } from "../../editors/body-panel.js";
8
+ import { bodyPanel } from "../../editors/body-panel.js";
9
9
  export function RowPlaceEditor({ field, initial, anchor, onAttempt, onClose, }) {
10
- const panel = useBodyPanel("parts", "w-96 p-2", "z-90 max-w-[calc(100vw-2rem)]");
10
+ const panel = bodyPanel("parts", "z-90 max-w-[calc(100vw-2rem)]");
11
11
  const { conventions } = useViews();
12
12
  const editorRef = useRef(null);
13
13
  const anchorRef = useRef(null);
14
14
  const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
15
15
  const place = initial && typeof initial === "object" && !Array.isArray(initial) ? initial : null;
16
16
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => {
17
- const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: place, allowEmpty: true, clearable: !!field.nullable, conventions: conventions, label: field.label, chrome: surface === "sheet" ? "field" : "bare", onRequestClose: close }));
17
+ const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: place, allowEmpty: true, conventions: conventions, label: field.label, onRequestClose: close }));
18
18
  return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
19
19
  } })] }));
20
20
  }
@@ -1,7 +1,4 @@
1
1
  import type { RowHostProps } from "./host.js";
2
- /** The FIELD ROW's host around the shared `RangeEditor` — in place, like the
3
- * number host: two boxes replace the value where it sits, on every width.
4
- * With an app's parts body it opens anchored instead, as the place host does:
5
- * a popover under the value on a desktop, the sheet on a phone, the value on
6
- * screen, the refusal drawn by the panel. */
2
+ /** The FIELD ROW's host around the shared `RangeEditor`: the app's parts body opens anchored, as the place host does:
3
+ * a popover under the value on a desktop, the sheet on a phone, the value on screen, the refusal drawn by the panel. */
7
4
  export declare function RowRangeEditor<Row>({ field, initial, anchor, onAttempt, onClose, }: RowHostProps<Row, "range">): import("react/jsx-runtime").JSX.Element;
@@ -5,21 +5,14 @@ import { isRangeValue, rangeDecimals } from "viewkitjs/fields";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
6
  import { RangeEditor } from "../../editors/RangeEditor.js";
7
7
  import { useViews } from "../../provider/context.js";
8
- import { ROW_BOX_FRAME } from "./row-frame.js";
9
- import { RowRefusal, useRowEditSession } from "./row-session.js";
10
- import { useBodyPanel } from "../../editors/body-panel.js";
11
- import { numberBounds } from "../../editors/number-body.js";
8
+ import { useRowEditSession } from "./row-session.js";
9
+ import { bodyPanel } from "../../editors/body-panel.js";
12
10
  export function RowRangeEditor({ field, initial, anchor, onAttempt, onClose, }) {
13
- const panel = useBodyPanel("parts", "w-80 p-2", "z-90 max-w-[calc(100vw-2rem)]");
14
- const { conventions, components } = useViews();
15
- const inPlace = !components.PartsBody;
11
+ const panel = bodyPanel("parts", "z-90 max-w-[calc(100vw-2rem)]");
12
+ const { conventions } = useViews();
16
13
  const editorRef = useRef(null);
17
14
  const anchorRef = useRef(null);
18
- const { session, close } = useRowEditSession({ editorRef, inPlace, onAttempt, onClose });
19
- const banded = (field.presets?.length ?? 0) > 0 && inPlace;
20
- const editor = (_jsx(RangeEditor, { ref: editorRef, initial: isRangeValue(initial) ? initial : null, decimals: rangeDecimals(field), allowEmpty: !!field.nullable, suffix: field.of === "percent" ? "%" : field.of === "currency" ? field.code?.fixed : undefined, align: "start", bands: field.presets, ...numberBounds(field), refusal: session.refusal, conventions: conventions, label: field.label, ...(inPlace && { boxClassName: ROW_BOX_FRAME }), onRequestClose: close }));
21
- if (!inPlace) {
22
- return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
23
- }
24
- return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [editor, !banded && _jsx(RowRefusal, { text: session.refusal })] }));
15
+ const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
16
+ const editor = (_jsx(RangeEditor, { ref: editorRef, initial: isRangeValue(initial) ? initial : null, decimals: rangeDecimals(field), allowEmpty: !!field.nullable, suffix: field.of === "percent" ? "%" : field.of === "currency" ? field.code?.fixed : undefined, bands: field.presets, conventions: conventions, label: field.label, onRequestClose: close }));
17
+ return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
25
18
  }
@@ -8,7 +8,7 @@ import { useKnownKinds } from "../../editors/relation-kinds.js";
8
8
  import { useViews } from "../../provider/context.js";
9
9
  import { OPTION_ROW_INSET } from "./host.js";
10
10
  import { useRowEditSession } from "./row-session.js";
11
- import { useBodyPanel, useSetBody } from "../../editors/body-panel.js";
11
+ import { bodyPanel, useSetBody } from "../../editors/body-panel.js";
12
12
  export function RowRelationEditor(props) {
13
13
  const { field } = props;
14
14
  if (field.type === "relation" && field.cardinality === "many")
@@ -22,7 +22,7 @@ function useKindGlyph(field, kindIcon) {
22
22
  return named ? (_jsx(components.AppIcon, { name: named, className: "h-3.5 w-3.5" })) : (_jsx(TypeGlyph, { className: "h-3.5 w-3.5" }));
23
23
  }
24
24
  function RowRelationOneEditor({ binding, field, initial, anchor, onAttempt, onClose, message, kindIcon, }) {
25
- const panel = useBodyPanel("picker", "w-64", "z-90");
25
+ const panel = bodyPanel("picker", "z-90");
26
26
  const editorRef = useRef(null);
27
27
  const anchorRef = useRef(null);
28
28
  const kindGlyph = useKindGlyph(field, kindIcon);
@@ -43,7 +43,7 @@ function RowRelationOneEditor({ binding, field, initial, anchor, onAttempt, onCl
43
43
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", alignOffset: -OPTION_ROW_INSET, sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, savesOnPick: true, children: _jsx(RelationEditor, { ref: editorRef, candidates: candidates, initial: relationIdOf(initial), clearable: !!field.nullable, kindGlyph: kindGlyph, focusSearch: !sheet, onRequestClose: close, message: message, label: field.label }) })] }));
44
44
  }
45
45
  function RowRelationSetEditor({ binding, field, initial, shown, anchor, onAttempt, onClose, message, kindIcon, }) {
46
- const panel = useBodyPanel(useSetBody(field.links), "w-64", "z-90");
46
+ const panel = bodyPanel(useSetBody(field.links), "z-90");
47
47
  const editorRef = useRef(null);
48
48
  const anchorRef = useRef(null);
49
49
  const kindGlyph = useKindGlyph(field, kindIcon);
@@ -8,9 +8,9 @@ import { useOpenValues } from "../../editors/open-values.js";
8
8
  import { SelectEditor, pickerOptionsFromField, } from "../../editors/SelectEditor.js";
9
9
  import { OPTION_ROW_INSET } from "./host.js";
10
10
  import { useRowEditSession } from "./row-session.js";
11
- import { useBodyPanel } from "../../editors/body-panel.js";
11
+ import { bodyPanel } from "../../editors/body-panel.js";
12
12
  export function RowSelectEditor({ binding, field, initial, anchor, onAttempt, onClose, message, openedByKey = false, }) {
13
- const panel = useBodyPanel("picker", "w-56", "z-90");
13
+ const panel = bodyPanel("picker", "z-90");
14
14
  const editorRef = useRef(null);
15
15
  const anchorRef = useRef(null);
16
16
  const known = useOpenValues(field);
@@ -1,6 +1,6 @@
1
1
  import type { RowHostProps } from "./host.js";
2
2
  /**
3
- * The FIELD ROW's host around the `TextEditor`, the one editor for a
3
+ * The FIELD ROW's host around the `TextEditorHost`, the one editor for a
4
4
  * `text`, a `url`, a `domain`, an `email`, a `phone` and a `rich_text` (typed as
5
5
  * its markdown). In place: the box replaces the value where it sits, on
6
6
  * every width; a record's row never opens a sheet for typing.
@@ -3,8 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from "react";
4
4
  import { acceptFieldCommit, phoneText } from "viewkitjs/fields";
5
5
  import { EditorPanel } from "../../editors/EditorPanel.js";
6
- import { TextEditor } from "../../editors/TextEditor.js";
7
- import { cx } from "../../internal/cx.js";
6
+ import { TextEditorHost } from "../../editors/TextEditor.js";
8
7
  import { useViews } from "../../provider/context.js";
9
8
  import { RowRefusal, useRowEditSession } from "./row-session.js";
10
9
  export function RowTextEditor({ field, binding, row, initial, onAttempt, onClose, }) {
@@ -13,7 +12,7 @@ export function RowTextEditor({ field, binding, row, initial, onAttempt, onClose
13
12
  const baseline = field.type === "phone" ? phoneText(initial, null) : typeof initial === "string" ? initial : "";
14
13
  const long = (field.type === "text" && !!field.format?.long) || field.type === "rich_text";
15
14
  const { session, close } = useRowEditSession({ editorRef, inPlace: true, onAttempt, onClose });
16
- const { components, conventions } = useViews();
15
+ const { conventions } = useViews();
17
16
  const region = binding.region?.(row) ?? undefined;
18
17
  const check = (text) => {
19
18
  if (text.trim() === "" || text === baseline)
@@ -21,5 +20,5 @@ export function RowTextEditor({ field, binding, row, initial, onAttempt, onClose
21
20
  const read = acceptFieldCommit(field, text, { conventions, region, stored: initial });
22
21
  return read.ok ? null : read.reason;
23
22
  };
24
- return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(TextEditor, { ref: editorRef, type: field.type, multiline: long, initial: baseline, label: field.label, rows: long ? 4 : undefined, maxLines: long ? 4 : undefined, onRequestClose: close, ...(components.TextBody ? { check, region, escapeKeeps: session.keeps ?? false } : {}), className: cx("w-full min-w-0 bg-transparent text-sm text-(color:--vk-fg) outline-hidden rounded-md px-2 -mx-2 py-1 -my-1", "ring ring-(color:--vk-border) focus:ring-(color:--vk-border-brand)", long && "resize-y") }), _jsx(RowRefusal, { text: session.refusal })] }));
23
+ return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(TextEditorHost, { ref: editorRef, type: field.type, multiline: long, initial: baseline, label: field.label, onRequestClose: close, check: check, region: region, escapeKeeps: session.keeps ?? false, place: "row" }), _jsx(RowRefusal, { text: session.refusal })] }));
25
24
  }
@@ -9,9 +9,9 @@ import { listOfOne, oneOfList } from "../../editors/values-body.js";
9
9
  import { useViews } from "../../provider/context.js";
10
10
  import { RowTextEditor } from "./RowTextEditor.js";
11
11
  import { useRowEditSession } from "./row-session.js";
12
- import { useBodyPanel } from "../../editors/body-panel.js";
12
+ import { bodyPanel } from "../../editors/body-panel.js";
13
13
  function RowValueListEditor({ field, binding, row, initial, anchor, onAttempt, onClose, holds = "several", }) {
14
- const panel = useBodyPanel("values", "w-96", "z-90 max-w-[calc(100vw-2rem)]");
14
+ const panel = bodyPanel("values", "z-90 max-w-[calc(100vw-2rem)]");
15
15
  const listRef = useRef(null);
16
16
  const one = holds === "one";
17
17
  const oneRef = useRef({ resolveClose: (reason) => oneOfList(listRef.current.resolveClose(reason)) });
@@ -19,10 +19,10 @@ function RowValueListEditor({ field, binding, row, initial, anchor, onAttempt, o
19
19
  const anchorRef = useRef(null);
20
20
  const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
21
21
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => {
22
- const editor = (_jsx(ValueListEditor, { ref: listRef, field: field, label: field.label, initial: one ? listOfOne(initial) : initial, labels: binding.labels !== false && !one, holds: holds, allowEmpty: true, region: binding.region?.(row), openLinks: surface === "sheet", escapeKeeps: session.keeps ?? false, onRequestClose: close }));
23
- if (surface !== "sheet" && panel.data["data-vk-body"])
22
+ const editor = (_jsx(ValueListEditor, { ref: listRef, field: field, label: field.label, initial: one ? listOfOne(initial) : initial, labels: binding.labels !== false && !one, holds: holds, allowEmpty: true, region: binding.region?.(row), escapeKeeps: session.keeps ?? false, onRequestClose: close }));
23
+ if (surface !== "sheet")
24
24
  return editor;
25
- return _jsx("div", { className: surface === "sheet" ? "px-4 pb-4" : "p-1.5", children: editor });
25
+ return _jsx("div", { className: "px-4 pb-4", children: editor });
26
26
  } })] }));
27
27
  }
28
28
  export function RowListOrText(props) {
@@ -1,11 +1,9 @@
1
1
  import type { MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref } from "react";
2
2
  import type { ViewsContextValue } from "../provider/context.js";
3
- /** What a field row's button reads from the provider: the app's `Button` and who draws. */
4
- export type FieldRowButtonViews = Pick<ViewsContextValue, "components" | "fieldRowButtons">;
3
+ /** What a field row's button reads from the provider: the app's `Button`. */
4
+ export type FieldRowButtonViews = Pick<ViewsContextValue, "components">;
5
5
  /** One button a field row draws itself, as each of its places describes it. */
6
6
  export type FieldRowButtonDraw = {
7
- /** Today's classes, without `ELEMENT_RESET`: drawn on ViewKit's own `<button>`. */
8
- own: string;
9
7
  /** The box ViewKit keeps on the app's `Button`: its size and its place. The look is the app's. */
10
8
  frame: string;
11
9
  variant: "ghost";
@@ -15,8 +13,7 @@ export type FieldRowButtonDraw = {
15
13
  "aria-disabled"?: boolean;
16
14
  "aria-label"?: string;
17
15
  "data-slot"?: string;
18
- /** Marks the press as the host's own: `data-no-nav` on ViewKit's button, on a `display: contents` span around the
19
- * app's. */
16
+ /** Marks the press as the host's own: `data-no-nav` on a `display: contents` span around the app's button. */
20
17
  noNav?: boolean;
21
18
  onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
22
19
  children?: ReactNode;
@@ -34,7 +31,7 @@ export declare function FieldRowButton({ views, ...draw }: FieldRowButtonDraw &
34
31
  views: FieldRowButtonViews;
35
32
  }): ReactElement;
36
33
  /**
37
- * Draws a button a field row draws itself: ViewKit's own `<button>` by default (the provider's `fieldRowButtons` is
38
- * `own`), exactly as on 0.5.0, or the app's `Button` with `fieldRowButtons: "button"`. A plain function, never a hook.
34
+ * Draws a button a field row draws itself: the app's `Button`, handed the row's box in its class. A plain function,
35
+ * never a hook.
39
36
  */
40
- export declare function drawFieldRowButton(views: FieldRowButtonViews, { own, frame, variant, size, noNav, children, ...props }: FieldRowButtonDraw): ReactElement;
37
+ export declare function drawFieldRowButton(views: FieldRowButtonViews, { frame, variant, size, noNav, children, ...props }: FieldRowButtonDraw): ReactElement;
@@ -1,17 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { cx } from "../internal/cx.js";
4
- import { ELEMENT_RESET } from "../internal/reset.js";
5
3
  export const FIELD_ROW_FRAME = "-mx-2 -my-1 flex h-auto min-h-7 w-[calc(100%+1rem)] min-w-0 items-center justify-start whitespace-normal px-2 py-1 text-left [font:inherit]";
6
4
  export const FIELD_ROW_FRAME_BESIDE = "-ml-2 -my-1 flex h-auto min-h-7 min-w-0 flex-1 items-center justify-start whitespace-normal px-2 py-1 text-left [font:inherit]";
7
5
  export const FIELD_ROW_FRAME_UNDER = "absolute -inset-x-2 -inset-y-1 h-auto w-auto p-0";
8
6
  export function FieldRowButton({ views, ...draw }) {
9
7
  return drawFieldRowButton(views, draw);
10
8
  }
11
- export function drawFieldRowButton(views, { own, frame, variant, size, noNav, children, ...props }) {
12
- if (views.fieldRowButtons !== "button") {
13
- return (_jsx("button", { type: "button", ...props, "data-no-nav": noNav || undefined, className: cx(ELEMENT_RESET, own), children: children }));
14
- }
9
+ export function drawFieldRowButton(views, { frame, variant, size, noNav, children, ...props }) {
15
10
  const { Button } = views.components;
16
11
  const button = (_jsx(Button, { type: "button", variant: variant, size: size, className: frame, ...props, children: children }));
17
12
  return noNav ? (_jsx("span", { className: "contents", "data-no-nav": true, children: button })) : (button);
@@ -1,7 +1,7 @@
1
1
  import type { ReactElement } from "react";
2
2
  import type { ViewsCheckboxProps } from "../provider/components.js";
3
3
  /**
4
- * A field row's yes/no as the app's `Checkbox` (the provider's `fieldRowCheckboxes` is `checkbox`). The display core
4
+ * A field row's yes/no as the app's `Checkbox`. The display core
5
5
  * hands its box `tabIndex` -1, right in a grid cell, whose own key flips it; a field row has no such key, so its box
6
6
  * stays a Tab stop, as the row's own switch is. One component at module level, so a redrawn row keeps the same
7
7
  * element type and the box stays mounted.
@@ -11,10 +11,3 @@
11
11
  * row's hover came up visibly short of its neighbours'.
12
12
  */
13
13
  export declare const FIELD_ROW_TARGET = "-mx-2 -my-1 flex min-h-7 w-[calc(100%+1rem)] min-w-0 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
14
- /** The same target sharing its line with a control beside it (a link's open action): it pulls back on its left
15
- * only and takes the room the control leaves. */
16
- export declare const FIELD_ROW_TARGET_BESIDE = "-ml-2 -my-1 flex min-h-7 min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
17
- /** The target laid UNDER a value whose own links and buttons must stay outside it (a rich text): an empty button
18
- * filling the value's footprint, padded out by the same amount as the target. The value's layer above it lets a
19
- * press on its text through, and its own links and buttons take theirs. */
20
- export declare const FIELD_ROW_TARGET_UNDER = "absolute -inset-x-2 -inset-y-1 rounded-md transition-colors hover:bg-(color:--vk-hovered)";
@@ -1,3 +1 @@
1
1
  export const FIELD_ROW_TARGET = "-mx-2 -my-1 flex min-h-7 w-[calc(100%+1rem)] min-w-0 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
2
- export const FIELD_ROW_TARGET_BESIDE = "-ml-2 -my-1 flex min-h-7 min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
3
- export const FIELD_ROW_TARGET_UNDER = "absolute -inset-x-2 -inset-y-1 rounded-md transition-colors hover:bg-(color:--vk-hovered)";
@@ -10,7 +10,8 @@ export declare function gridAddColumnNode(render: RenderAddColumn, columns: List
10
10
  /**
11
11
  * "+ ADD COLUMN" ON EVERY GRID: the header row's last cell, for anyone who reads the list. It lists the columns
12
12
  * this view hides and can show, and shows the one picked: a choice about the reader's own view, never a change
13
- * to a field, so it needs no admin and no server. Where a host mounts its own field editor, the header draws
13
+ * to a field, so it needs no admin and no server. It opens the app's `Menu`, on a desktop and a phone alike, handed
14
+ * the hidden columns as data (`gridAddColumnItems`). Where a host mounts its own field editor, the header draws
14
15
  * the host's instead (a relation's ›, Create new field), in the same look. Hiding is a column's own menu, the
15
16
  * order is dragging the header, and the whole list is the host's column list.
16
17
  */