viewkitjs 0.33.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/package.json +1 -1
  3. package/views/README.md +1 -1
  4. package/views/dist/atoms/Avatar.js +2 -1
  5. package/views/dist/atoms/RelationChip.d.ts +2 -0
  6. package/views/dist/atoms/RelationChip.js +5 -0
  7. package/views/dist/atoms/RowMenu.d.ts +1 -1
  8. package/views/dist/atoms/RowMenu.js +15 -3
  9. package/views/dist/atoms/defaults.js +2 -0
  10. package/views/dist/atoms/types.d.ts +40 -4
  11. package/views/dist/cells/relation-wrap.js +9 -2
  12. package/views/dist/contract.d.ts +27 -14
  13. package/views/dist/contract.js +40 -4
  14. package/views/dist/controls/alert/alert.js +2 -1
  15. package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
  16. package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
  17. package/views/dist/controls/avatar/avatar-mark.js +5 -0
  18. package/views/dist/controls/avatar/avatar.d.ts +7 -4
  19. package/views/dist/controls/avatar/avatar.js +10 -4
  20. package/views/dist/controls/avatar/looks.d.ts +1 -1
  21. package/views/dist/controls/avatar/looks.js +3 -0
  22. package/views/dist/controls/avatar/record-mark.d.ts +16 -0
  23. package/views/dist/controls/avatar/record-mark.js +13 -0
  24. package/views/dist/controls/avatar/tokens.d.ts +12 -0
  25. package/views/dist/controls/avatar/tokens.js +3 -0
  26. package/views/dist/controls/avatar.css +54 -17
  27. package/views/dist/controls/bulk-bar/bulk-bar.js +29 -27
  28. package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
  29. package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
  30. package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
  31. package/views/dist/controls/compound-editor/map-parts-body.js +6 -1
  32. package/views/dist/controls/compound-editor/name-parts.js +2 -1
  33. package/views/dist/controls/compound-editor/place-parts.js +2 -2
  34. package/views/dist/controls/compound-editor/range-parts.js +10 -9
  35. package/views/dist/controls/controls.d.ts +2 -0
  36. package/views/dist/controls/controls.js +2 -0
  37. package/views/dist/controls/customize/customize.d.ts +14 -5
  38. package/views/dist/controls/customize/customize.js +19 -20
  39. package/views/dist/controls/customize/map-customize-body.d.ts +2 -2
  40. package/views/dist/controls/customize/map-customize-body.js +15 -13
  41. package/views/dist/controls/customize/words.d.ts +3 -3
  42. package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
  43. package/views/dist/controls/date-editor/date-editor.js +13 -7
  44. package/views/dist/controls/date-editor/map-calendar.js +2 -0
  45. package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
  46. package/views/dist/controls/date-editor/map-date-body.js +7 -3
  47. package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
  48. package/views/dist/controls/filter-editor/filter-editor.js +4 -6
  49. package/views/dist/controls/filter-editor/map-filter-body.d.ts +2 -0
  50. package/views/dist/controls/filter-editor/map-filter-body.js +7 -4
  51. package/views/dist/controls/filter-editor/parts.d.ts +4 -2
  52. package/views/dist/controls/filter-editor/parts.js +8 -7
  53. package/views/dist/controls/group-editor/group-editor.js +2 -1
  54. package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
  55. package/views/dist/controls/group-editor/map-group-body.js +5 -1
  56. package/views/dist/controls/index.d.ts +1 -1
  57. package/views/dist/controls/input/input.js +2 -1
  58. package/views/dist/controls/internal/head-button.d.ts +9 -0
  59. package/views/dist/controls/internal/head-button.js +13 -0
  60. package/views/dist/controls/internal/map-panel-controls.js +9 -5
  61. package/views/dist/controls/internal/panel-controls.d.ts +38 -6
  62. package/views/dist/controls/internal/panel-controls.js +191 -19
  63. package/views/dist/controls/links-editor/links-editor.js +5 -7
  64. package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
  65. package/views/dist/controls/links-editor/map-links-body.js +5 -1
  66. package/views/dist/controls/menu/menu.d.ts +5 -1
  67. package/views/dist/controls/menu/menu.js +4 -3
  68. package/views/dist/controls/modal/modal.js +5 -3
  69. package/views/dist/controls/number-editor/map-number-body.js +5 -1
  70. package/views/dist/controls/number-editor/number-editor.js +6 -6
  71. package/views/dist/controls/pane/map-pane.d.ts +3 -0
  72. package/views/dist/controls/pane/map-pane.js +5 -0
  73. package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
  74. package/views/dist/controls/picker/map-fields-body.js +30 -2
  75. package/views/dist/controls/picker/map-picker.d.ts +8 -3
  76. package/views/dist/controls/picker/map-picker.js +14 -3
  77. package/views/dist/controls/picker/picker.js +11 -8
  78. package/views/dist/controls/picker/rows.d.ts +7 -2
  79. package/views/dist/controls/picker.css +10 -1
  80. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
  81. package/views/dist/controls/quick-filters/map-quick-filters-body.js +9 -4
  82. package/views/dist/controls/quick-filters/quick-filters.js +8 -6
  83. package/views/dist/controls/quick-filters/reminder.js +2 -2
  84. package/views/dist/controls/quick-filters/rules.d.ts +4 -1
  85. package/views/dist/controls/quick-filters/words.d.ts +2 -0
  86. package/views/dist/controls/quick-filters/words.js +1 -0
  87. package/views/dist/controls/select/select.d.ts +3 -0
  88. package/views/dist/controls/select/select.js +9 -3
  89. package/views/dist/controls/setting-row/looks.js +5 -5
  90. package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
  91. package/views/dist/controls/setting-row/setting-row.js +3 -1
  92. package/views/dist/controls/setting-row.css +3 -2
  93. package/views/dist/controls/sheet/bottom-sheet.d.ts +3 -1
  94. package/views/dist/controls/sheet/bottom-sheet.js +2 -2
  95. package/views/dist/controls/sort-editor/map-sort-body.js +4 -4
  96. package/views/dist/controls/sort-editor/sort-editor.d.ts +2 -0
  97. package/views/dist/controls/sort-editor/sort-editor.js +4 -5
  98. package/views/dist/controls/text-editor/map-text-body.js +5 -1
  99. package/views/dist/controls/text-editor/text-editor.js +5 -4
  100. package/views/dist/controls/toolbar/toolbar.d.ts +29 -14
  101. package/views/dist/controls/toolbar/toolbar.js +17 -22
  102. package/views/dist/controls/toolbar.css +0 -5
  103. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  104. package/views/dist/controls/tooltip/map-tooltip.js +4 -2
  105. package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
  106. package/views/dist/controls/values-editor/map-values-body.js +5 -1
  107. package/views/dist/controls/values-editor/values-editor.js +8 -7
  108. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
  109. package/views/dist/controls/views-list/map-view-menu.js +6 -2
  110. package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
  111. package/views/dist/controls/views-list/map-views-list-body.js +6 -5
  112. package/views/dist/controls/views-list/view-menu.js +3 -4
  113. package/views/dist/controls/views-list/views-list.js +2 -2
  114. package/views/dist/display/option-badges.d.ts +16 -0
  115. package/views/dist/display/option-badges.js +11 -0
  116. package/views/dist/display/relation-link.d.ts +12 -0
  117. package/views/dist/display/relation-link.js +17 -0
  118. package/views/dist/display/relation.d.ts +1 -1
  119. package/views/dist/display/relation.js +10 -3
  120. package/views/dist/display/select.js +1 -8
  121. package/views/dist/editors/EditorPanel.js +4 -4
  122. package/views/dist/editors/RangeEditor.d.ts +3 -0
  123. package/views/dist/editors/RangeEditor.js +2 -2
  124. package/views/dist/editors/SelectEditor.d.ts +2 -2
  125. package/views/dist/editors/SelectEditor.js +1 -1
  126. package/views/dist/editors/TextEditor.js +4 -2
  127. package/views/dist/editors/ValueListEditor.js +2 -1
  128. package/views/dist/field-row/FieldRow.js +32 -5
  129. package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
  130. package/views/dist/grid/chrome/GridAddColumn.js +9 -6
  131. package/views/dist/grid/chrome/GridCellEditors.js +1 -1
  132. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
  133. package/views/dist/grid/chrome/GridCellOutline.js +16 -6
  134. package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
  135. package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
  136. package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
  137. package/views/dist/grid/chrome/GridFooter.js +4 -4
  138. package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
  139. package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
  140. package/views/dist/grid/chrome/GridHeader.js +1 -2
  141. package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
  142. package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
  143. package/views/dist/grid/chrome/GridRow.js +5 -3
  144. package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
  145. package/views/dist/grid/chrome/GridRowActions.js +2 -2
  146. package/views/dist/grid/chrome/GridRowCells.js +3 -2
  147. package/views/dist/grid/chrome/GridStructure.js +1 -1
  148. package/views/dist/grid/chrome/GridTable.js +32 -20
  149. package/views/dist/grid/chrome/checks.d.ts +1 -1
  150. package/views/dist/grid/chrome/checks.js +4 -1
  151. package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
  152. package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
  153. package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
  154. package/views/dist/grid/chrome/grid-hover.js +14 -4
  155. package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
  156. package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
  157. package/views/dist/grid/chrome/grid-table-props.d.ts +10 -2
  158. package/views/dist/grid/grid.css +6 -0
  159. package/views/dist/grid/looks.d.ts +3 -1
  160. package/views/dist/grid/looks.js +10 -4
  161. package/views/dist/list/layer.d.ts +8 -0
  162. package/views/dist/list/layer.js +7 -0
  163. package/views/dist/list/list.d.ts +6 -2
  164. package/views/dist/list/list.js +6 -2
  165. package/views/dist/list/parts.js +3 -2
  166. package/views/dist/list/store.d.ts +1 -1
  167. package/views/dist/list/toolbar.js +51 -20
  168. package/views/dist/list/views.js +1 -0
  169. package/views/dist/panels/availability.d.ts +5 -0
  170. package/views/dist/panels/availability.js +4 -5
  171. package/views/dist/panels/customize-body.d.ts +4 -0
  172. package/views/dist/panels/customize-body.js +13 -11
  173. package/views/dist/panels/model.d.ts +9 -4
  174. package/views/dist/panels/react/customize-body.js +5 -2
  175. package/views/dist/panels/react/customize.d.ts +5 -0
  176. package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
  177. package/views/dist/panels/react/filter/FilterEditor.js +7 -0
  178. package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
  179. package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
  180. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +17 -1
  181. package/views/dist/panels/react/toolbar/Toolbar.d.ts +15 -1
  182. package/views/dist/panels/react/toolbar/Toolbar.js +24 -9
  183. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +3 -2
  184. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
  185. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +14 -6
  186. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
  187. package/views/dist/panels/react/toolbar/ToolbarFilters.js +21 -10
  188. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +6 -1
  189. package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
  190. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  191. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  192. package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
  193. package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
  194. package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
  195. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
  196. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +7 -6
  197. package/views/dist/panels/react/toolbar/context.d.ts +21 -0
  198. package/views/dist/panels/react/toolbar/context.js +4 -0
  199. package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
  200. package/views/dist/panels/react/toolbar/pane-host.js +17 -0
  201. package/views/dist/panels/react/toolbar/panel-part.js +3 -2
  202. package/views/dist/panels/react/views-row/ViewPicker.js +13 -5
  203. package/views/dist/panels/react.d.ts +2 -2
  204. package/views/dist/panels/settings/layout.js +6 -38
  205. package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
  206. package/views/dist/panels/toolbar/page-resets.js +62 -0
  207. package/views/dist/panels/toolbar/same-item.d.ts +7 -0
  208. package/views/dist/panels/toolbar/same-item.js +9 -0
  209. package/views/dist/panels/view-state.d.ts +4 -0
  210. package/views/dist/provider/ViewsProvider.d.ts +9 -3
  211. package/views/dist/provider/ViewsProvider.js +13 -2
  212. package/views/dist/provider/components.d.ts +59 -8
  213. package/views/dist/provider/components.js +1 -1
  214. package/views/dist/react.d.ts +2 -2
  215. package/views/dist/styles.css +194 -100
  216. package/views/dist/styles.unlayered.css +194 -100
  217. package/views/docs/contract.md +96 -27
  218. package/views/docs/controls/alert-dialog.md +4 -0
  219. package/views/docs/controls/alert.md +4 -0
  220. package/views/docs/controls/avatar.md +3 -0
  221. package/views/docs/controls/bulk-bar.md +7 -1
  222. package/views/docs/controls/compound-editor.md +2 -0
  223. package/views/docs/controls/customize.md +3 -1
  224. package/views/docs/controls/date-editor.md +2 -0
  225. package/views/docs/controls/filter-editor.md +1 -1
  226. package/views/docs/controls/group-editor.md +2 -0
  227. package/views/docs/controls/links-editor.md +2 -0
  228. package/views/docs/controls/menu.md +3 -1
  229. package/views/docs/controls/modal.md +4 -0
  230. package/views/docs/controls/number-editor.md +2 -0
  231. package/views/docs/controls/pane.md +1 -1
  232. package/views/docs/controls/picker.md +2 -0
  233. package/views/docs/controls/quick-filters.md +4 -2
  234. package/views/docs/controls/sheet.md +1 -1
  235. package/views/docs/controls/text-editor.md +3 -1
  236. package/views/docs/controls/toolbar.md +4 -0
  237. package/views/docs/controls/values-editor.md +2 -0
  238. package/views/docs/controls/views-list.md +2 -0
  239. package/views/docs/guides/atoms.md +54 -3
  240. package/views/docs/guides/display.md +1 -1
  241. package/views/docs/guides/looks.md +1 -1
  242. package/views/docs/guides/the-grid.md +4 -2
  243. package/views/docs/guides/the-provider.md +4 -4
  244. package/views/docs/index.md +2 -2
  245. package/views/docs/install.md +198 -104
  246. package/views/docs/reference/controls.md +21 -17
  247. package/views/docs/reference/editors-range.md +1 -1
  248. package/views/docs/reference/field-row.md +1 -1
  249. package/views/docs/reference/grid.md +2 -1
  250. package/views/docs/reference/list.md +7 -5
  251. package/views/docs/reference/looks.md +6 -6
  252. package/views/docs/reference/panels-react.md +17 -15
  253. package/views/docs/reference/panels.md +4 -4
  254. package/views/docs/reference/react.md +15 -12
  255. package/views/docs/reference/views.md +6 -4
  256. package/views/docs/reshaping.md +32 -5
  257. package/views/skills/views/SKILL.md +3 -3
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { resolveViewsMessage } from "../../contract.js";
5
5
  import { ViewsContext } from "../../provider/context.js";
6
+ import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
6
7
  import { menuWordsOf, pickerItemsOf, pickerWordsOf } from "../picker/map-picker.js";
7
8
  import { BulkBar } from "./bulk-bar.js";
8
9
  export function bulkBarWordsOf(say) {
@@ -53,5 +54,5 @@ export function MapSelectionBar({ count, noun, onClear, verbs, busy, onDelete, d
53
54
  const words = React.useMemo(() => bulkBarWordsOf(messages), [messages]);
54
55
  const AppIcon = views?.components.AppIcon;
55
56
  const bulk = React.useMemo(() => bulkVerbsOf(verbs, AppIcon), [verbs, AppIcon]);
56
- return (_jsx(BulkBar, { count: count, onClear: onClear, verbs: bulk, words: words, ...(noun ? { noun } : {}), ...(busy !== undefined ? { busy } : {}), ...(onDelete ? { onDelete: runOf(onDelete) } : {}), ...(deleteLabel !== undefined ? { deleteLabel } : {}), ...(deleteLine !== undefined ? { deleteLine } : {}) }));
57
+ return (_jsx(PanelControlsFromViews, { children: _jsx(BulkBar, { count: count, onClear: onClear, verbs: bulk, words: words, ...(noun ? { noun } : {}), ...(busy !== undefined ? { busy } : {}), ...(onDelete ? { onDelete: runOf(onDelete) } : {}), ...(deleteLabel !== undefined ? { deleteLabel } : {}), ...(deleteLine !== undefined ? { deleteLine } : {}) }) }));
57
58
  }
@@ -65,6 +65,9 @@ export type CompoundEditorProps = PartsCommon & ({
65
65
  bands?: RangeBand[];
66
66
  /** It may be emptied; left out, it may. Can't, both ends cleared keeps the range it had, and says so. */
67
67
  empty?: boolean;
68
+ /** The least and most each end may hold: its boxes step within them, and an end typed outside is drawn back as the box is left. */
69
+ min?: number;
70
+ max?: number;
68
71
  });
69
72
  export type NamePartsProps = Extract<CompoundEditorProps, {
70
73
  kind: "name";
@@ -15,6 +15,6 @@ export declare function placeCountriesOf(p: PlaceBody): Country[];
15
15
  export declare function compoundEditorWordsOf(say: ViewsMessageResolver): CompoundEditorWords;
16
16
  /** ViewKit's parts body's props as the Compound editor's, held as a shell that keeps the draft. */
17
17
  export declare function partsBodyPropsOf(p: ViewsPartsBodyProps, words?: CompoundEditorWords): CompoundEditorProps;
18
- /** ViewKit's parts body, drawn as the Compound editor; on a phone, a place's lists' step told to its sheet. */
18
+ /** ViewKit's parts body, its controls the app's where the provider's `panelControls` names them (VK-1022). */
19
19
  export declare function MapPartsBody(props: ViewsPartsBodyProps): import("react/jsx-runtime").JSX.Element;
20
20
  export {};
@@ -1,10 +1,11 @@
1
1
  "use client";
2
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { resolveViewsMessage } from "../../contract.js";
5
5
  import { ViewsContext } from "../../provider/context.js";
6
6
  import { pickerWordsOf } from "../picker/map-picker.js";
7
7
  import { useToldStep } from "../internal/told-step.js";
8
+ import { PanelControlsFromViews } from "../internal/map-panel-controls.js";
8
9
  import { useCompoundEditor } from "./compound-editor.js";
9
10
  const NO_NAME = { given: "", family: "", full: "" };
10
11
  export function placeCountriesOf(p) {
@@ -58,9 +59,13 @@ export function partsBodyPropsOf(p, words) {
58
59
  return { ...common, kind: "place", value: codelessRegion(p), parts: [...p.parts], required: [...p.required], countries: placeCountriesOf(p),
59
60
  ...(p.opens ? { opens: p.opens } : {}), onValueChange: (v) => p.onValueChange(v ?? {}), onDone: () => p.onDone() };
60
61
  return { ...common, kind: "range", value: p.value, decimals: p.decimals, unit: p.unit, bands: p.bands ? [...p.bands] : undefined, empty: p.empty,
62
+ ...(p.min !== undefined ? { min: p.min } : {}), ...(p.max !== undefined ? { max: p.max } : {}),
61
63
  onValueChange: p.onValueChange, onDone: p.onDone };
62
64
  }
63
65
  export function MapPartsBody(props) {
66
+ return _jsx(PanelControlsFromViews, { children: _jsx(PartsBodyInner, { ...props }) });
67
+ }
68
+ function PartsBodyInner(props) {
64
69
  const messages = React.useContext(ViewsContext)?.messages ?? resolveViewsMessage;
65
70
  const words = React.useMemo(() => compoundEditorWordsOf(messages), [messages]);
66
71
  const parts = useCompoundEditor(partsBodyPropsOf(props, words));
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { midWord } from "../text-editor/check.js";
5
- import { Input } from "../input/input.js";
5
+ import { usePanelControls } from "../internal/panel-controls.js";
6
6
  import { SheetButton } from "../sheet/bottom-sheet.js";
7
7
  import { fullOf, keptName, nameOf, ownOf, sameName } from "./name.js";
8
8
  import { QuietField, PartsRow, MIHAI_CARD } from "./row.js";
@@ -20,6 +20,7 @@ const startOf = (value, typing) => ({
20
20
  });
21
21
  const NO_NAME = { full: "", given: "", family: "" };
22
22
  export function useNameParts(props, worn, wornAt) {
23
+ const { Input } = usePanelControls();
23
24
  const { label, value, onValueChange, onDone, empty = false, typing, autoFocus = true } = props;
24
25
  const phone = usePhoneForm(props.form), device = phoneMark(usePhoneForm()), fields = worn.boxes === "fields", shownAs = worn.shown === "shown";
25
26
  const shell = props.draft === "shell", w = compoundWords(props.words);
@@ -3,8 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import * as React from "react";
4
4
  import { midWord } from "../text-editor/check.js";
5
5
  import { Field, FieldRowsRow as FieldRow, FieldRows } from "../field/field.js";
6
- import { Input } from "../input/input.js";
7
- import { Select } from "../select/select.js";
6
+ import { usePanelControls } from "../internal/panel-controls.js";
8
7
  import { usePicker } from "../picker/picker.js";
9
8
  import { SheetButton } from "../sheet/bottom-sheet.js";
10
9
  import { Flag } from "../flag/flag.js";
@@ -21,6 +20,7 @@ const X = ["M18 6l-12 12", "M6 6l12 12"], TICK = ["M5 12l5 5l10 -10"];
21
20
  let EVERY = null;
22
21
  const TYPED = "\u0000typed";
23
22
  export function usePlaceParts(props, worn, wornAt) {
23
+ const { Input, Select } = usePanelControls();
24
24
  const { label, value, onValueChange, onDone, parts = PLACE_PARTS, autoFocus = true } = props;
25
25
  const phone = usePhoneForm(props.form), device = phoneMark(usePhoneForm()), fields = worn.boxes === "fields", first = worn.country === "first", attio = !first;
26
26
  const shell = props.draft === "shell", w = compoundWords(props.words);
@@ -20,6 +20,7 @@ export function useRangeParts(props, worn, wornAt) {
20
20
  const w = compoundWords(props.words), numberWords = { increase: w.increase, decrease: w.decrease, field: w.numberField };
21
21
  const ENDS = [["low", w.from], ["high", w.to]];
22
22
  const format = React.useMemo(() => bareOf(props.decimals), [props.decimals]);
23
+ const limits = { ...(props.min !== undefined ? { min: props.min } : {}), ...(props.max !== undefined ? { max: props.max } : {}) };
23
24
  const phone = usePhoneForm(props.form), device = phoneMark(usePhoneForm()), fields = worn.boxes === "fields";
24
25
  const shell = props.draft === "shell";
25
26
  const [now, setNow] = React.useState(value);
@@ -84,7 +85,7 @@ export function useRangeParts(props, worn, wornAt) {
84
85
  };
85
86
  const kit = { "data-parts-kind": "range", "data-parts-boxes": worn.boxes, role: "group", "aria-label": label };
86
87
  const note = unit && _jsx("p", { className: "o-compound-editor-note", "data-slot": "vk-parts-note", children: unit });
87
- const boxes = (arrows, onPhone) => (_jsx(PartsRow, { children: ENDS.map(([k, name], i) => (_jsx(QuietField, { label: name, form: onPhone ? "phone" : "computer", "data-slot": "vk-parts-field", "data-key": k, children: _jsx(EndField, { part: k, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, phone: onPhone, arrows: arrows, format: format }) }, k))) }));
88
+ const boxes = (arrows, onPhone) => (_jsx(PartsRow, { children: ENDS.map(([k, name], i) => (_jsx(QuietField, { label: name, form: onPhone ? "phone" : "computer", "data-slot": "vk-parts-field", "data-key": k, children: _jsx(EndField, { part: k, limits: limits, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, phone: onPhone, arrows: arrows, format: format }) }, k))) }));
88
89
  if (phone) {
89
90
  const body = (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "phone", ...device, onKeyDown: (e) => {
90
91
  if (e.key !== "Enter" || midWord(e.nativeEvent))
@@ -97,23 +98,23 @@ export function useRangeParts(props, worn, wornAt) {
97
98
  ends[1].focus({ preventScroll: true });
98
99
  else
99
100
  keep();
100
- }, children: [fields ? (_jsx(FieldRows, { look: MIHAI_CARD, className: "o-compound-editor-card", "data-slot": "vk-parts-card", children: ENDS.map(([k, name], i) => (_jsx(FieldRow, { label: name, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": k, labelClassName: "o-compound-editor-card-label", children: _jsx(CardEnd, { part: k, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) }, k))) })) : boxes(false, true), note, clearedNote, bandList] }));
101
+ }, children: [fields ? (_jsx(FieldRows, { look: MIHAI_CARD, className: "o-compound-editor-card", "data-slot": "vk-parts-card", children: ENDS.map(([k, name], i) => (_jsx(FieldRow, { label: name, className: "o-compound-editor-card-row", "data-slot": "vk-parts-field", "data-key": k, labelClassName: "o-compound-editor-card-label", children: _jsx(CardEnd, { part: k, limits: limits, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) }, k))) })) : boxes(false, true), note, clearedNote, bandList] }));
101
102
  if (shell)
102
103
  return { body, head: {} };
103
104
  return { body, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": "Close", icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": "Save", icon: glyph(TICK), onClick: keep }) } };
104
105
  }
105
- const body = (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "computer", ...device, onKeyDown: onKeyDown, onBlur: shell ? undefined : (e) => blurKeeps(settled, keep)(e), onFocus: () => { settled.current = false; }, children: [fields ? (_jsx("div", { className: "o-compound-editor-pair", "data-slot": "vk-parts-pair", children: ENDS.map(([k, name], i) => (_jsxs(React.Fragment, { children: [i === 1 && _jsx("span", { className: "o-compound-editor-dash", "aria-hidden": "true", children: "\u2013" }), _jsx(Field, { label: name, "data-slot": "vk-parts-field", "data-key": k, children: _jsx(PairField, { part: k, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) })] }, k))) })) : boxes(worn.arrows === "editing", false), note, clearedNote, bandList] }));
106
+ const body = (_jsxs("div", { ref: root, className: "o-compound-editor", "data-slot": "vk-parts", "data-kit": "compound-editor", ...kit, "data-parts-form": "computer", ...device, onKeyDown: onKeyDown, onBlur: shell ? undefined : (e) => blurKeeps(settled, keep)(e), onFocus: () => { settled.current = false; }, children: [fields ? (_jsx("div", { className: "o-compound-editor-pair", "data-slot": "vk-parts-pair", children: ENDS.map(([k, name], i) => (_jsxs(React.Fragment, { children: [i === 1 && _jsx("span", { className: "o-compound-editor-dash", "aria-hidden": "true", children: "\u2013" }), _jsx(Field, { label: name, "data-slot": "vk-parts-field", "data-key": k, children: _jsx(PairField, { part: k, limits: limits, words: numberWords, value: now[k], set: set(k), box: i === 0 ? first : undefined, format: format }) })] }, k))) })) : boxes(worn.arrows === "editing", false), note, clearedNote, bandList] }));
106
107
  return { body, head: {} };
107
108
  }
108
- function EndField({ part, words, value, set, box, phone, arrows, format }) {
109
+ function EndField({ part, words, value, set, box, limits, phone, arrows, format }) {
109
110
  const root = React.useCallback((el) => box?.(el?.querySelector("input") ?? null), [box]);
110
- return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: phone ? "lg" : "sm", align: "end", steppers: arrows ? "arrows" : false, autofill: false, value: value, onValueChange: (v) => set(v), format: format });
111
+ return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: phone ? "lg" : "sm", align: "end", steppers: arrows ? "arrows" : false, autofill: false, value: value, onValueChange: (v) => set(v), format: format, ...limits });
111
112
  }
112
- function CardEnd({ part, words, value, set, box, format }) {
113
+ function CardEnd({ part, words, value, set, box, limits, format }) {
113
114
  const root = React.useCallback((el) => box?.(el?.querySelector("input") ?? null), [box]);
114
- return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, chrome: "bare", autofill: false, value: value, onValueChange: (v) => set(v), format: format });
115
+ return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, chrome: "bare", autofill: false, value: value, onValueChange: (v) => set(v), format: format, ...limits });
115
116
  }
116
- function PairField({ part, words, value, set, box, format }) {
117
+ function PairField({ part, words, value, set, box, limits, format }) {
117
118
  const root = React.useCallback((el) => box?.(el?.querySelector("input") ?? null), [box]);
118
- return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: "sm", steppers: false, autofill: false, value: value, onValueChange: (v) => set(v), format: format });
119
+ return _jsx(NumberField, { ref: root, "data-slot": "vk-parts-box", "data-key": part, words: words, size: "sm", steppers: false, autofill: false, value: value, onValueChange: (v) => set(v), format: format, ...limits });
119
120
  }
@@ -4,6 +4,7 @@ import { MapMarkdown } from "./markdown/map-markdown.js";
4
4
  import { MapTooltip } from "./tooltip/map-tooltip.js";
5
5
  import { MapPopover } from "./popover/map-popover.js";
6
6
  import { MapSheet } from "./sheet/map-sheet.js";
7
+ import { MapPane } from "./pane/map-pane.js";
7
8
  import { MapCheckbox } from "./checkbox/map-checkbox.js";
8
9
  import { MapInput } from "./input/map-input.js";
9
10
  import { MapMenu } from "./menu/map-menu.js";
@@ -34,6 +35,7 @@ export declare const CONTROLS: {
34
35
  Tooltip: typeof MapTooltip;
35
36
  Popover: typeof MapPopover;
36
37
  Sheet: typeof MapSheet;
38
+ Pane: typeof MapPane;
37
39
  Input: typeof MapInput;
38
40
  Checkbox: typeof MapCheckbox;
39
41
  Menu: typeof MapMenu;
@@ -6,6 +6,7 @@ import { MapMarkdown } from "./markdown/map-markdown.js";
6
6
  import { MapTooltip } from "./tooltip/map-tooltip.js";
7
7
  import { MapPopover } from "./popover/map-popover.js";
8
8
  import { MapSheet } from "./sheet/map-sheet.js";
9
+ import { MapPane } from "./pane/map-pane.js";
9
10
  import { MapCheckbox } from "./checkbox/map-checkbox.js";
10
11
  import { MapInput } from "./input/map-input.js";
11
12
  import { MapMenu } from "./menu/map-menu.js";
@@ -36,6 +37,7 @@ export const CONTROLS = carryAtoms({
36
37
  Tooltip: MapTooltip,
37
38
  Popover: MapPopover,
38
39
  Sheet: MapSheet,
40
+ Pane: MapPane,
39
41
  Input: MapInput,
40
42
  Checkbox: MapCheckbox,
41
43
  Menu: MapMenu,
@@ -35,14 +35,16 @@ export interface CustomizeSection {
35
35
  back: () => void;
36
36
  } | null;
37
37
  }
38
- /** A setting turned on or off: its key, words, value and write; `icon`, its mark before its name; `reset`, its way back to the
39
- * reader's default; `section`, the heading it stands under. */
38
+ /** A setting turned on or off: its key, words, value and write; `icon`, its mark before its name; `section`, the heading it
39
+ * stands under. */
40
40
  export interface CustomizeToggle {
41
41
  key: string;
42
42
  label: string;
43
43
  value: boolean;
44
44
  onChange: (on: boolean) => void;
45
45
  icon?: React.ReactNode;
46
+ /** @deprecated Drawn nowhere since a toggle carries no way back of its own (VK-1033): Customize's Reset is the way back. To be
47
+ * removed in a later release. */
46
48
  reset?: () => void;
47
49
  section?: string;
48
50
  }
@@ -57,11 +59,11 @@ export interface CustomizeChoice {
57
59
  }[];
58
60
  onChange: (value: string) => void;
59
61
  }
60
- /** Layout's own settings, in place of a table's Freeze and Wrap: its pick-one settings, its toggles, and For you, the reader's own
61
- * over a shared view, with its way back. */
62
+ /** Layout's own settings, in place of a table's Freeze and Wrap: its pick-one settings and its toggles. */
62
63
  export interface CustomizeLayoutSettings {
63
64
  toggles: CustomizeToggle[];
64
65
  choices: CustomizeChoice[];
66
+ /** @deprecated Drawn nowhere since the Layout page ends at its toggles (VK-1033). To be removed in a later release. */
65
67
  personal?: {
66
68
  label: string;
67
69
  toggles: CustomizeToggle[];
@@ -131,7 +133,14 @@ export interface CustomizeProps {
131
133
  toggles?: CustomizeToggle[];
132
134
  /** Layout's own settings, in place of a table's Freeze and Wrap from the view. */
133
135
  layoutSettings?: CustomizeLayoutSettings;
134
- /** Columns' way back to the view's own columns, while they differ from it. */
136
+ /** Each page's own Reset, while that page differs from the view as saved (VK-1034): drawn on its screen, in the first
137
+ * page's Reset's word and look and place, never on a level the screen opened in place. Handed (even empty), these
138
+ * alone stand: `columnsReset` is not read. */
139
+ resets?: Partial<Record<Exclude<CustomizeScreen, "list">, () => void>>;
140
+ /** A section differs from the view as saved (VK-1048): its value in the brand. Absent, Layout and Columns carry no mark;
141
+ * Filter, Sort and Group carry their own section's `inForce`. */
142
+ differs?: Partial<Record<Exclude<CustomizeScreen, "list">, boolean>>;
143
+ /** @deprecated Columns' page Reset where no `resets` is handed at all. To be removed in a later release. */
135
144
  columnsReset?: () => void;
136
145
  /** A card's field starting a new line, turned on or off (its column's `line`, VK-890). */
137
146
  onLineChange?: (id: string) => void;
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Button } from "../button/button.js";
5
4
  import { glyph } from "../internal/editor-parts.js";
6
5
  import { Icon } from "../internal/icons.js";
7
6
  import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
8
- import { Input, InputGroup, InputGroupAddon } from "../input/input.js";
7
+ import { InputGroup, InputGroupAddon } from "../input/input.js";
8
+ import { usePanelControls } from "../internal/panel-controls.js";
9
9
  import { MENU_LIST_CARD_FRAME } from "../menu-list/looks.js";
10
10
  import { MenuList, MenuListPanelRows } from "../menu-list/menu-list.js";
11
11
  import { Notice } from "../notice/notice.js";
@@ -40,8 +40,9 @@ const LAYOUT_MARKS = {
40
40
  };
41
41
  export const layoutMark = (id) => (LAYOUT_MARKS[id] ? glyph([LAYOUT_MARKS[id]]) : undefined);
42
42
  export function useCustomize(props) {
43
- const { view, onViewChange, layouts, filter, sort, group, changed = false, onReset, onSave, pending = false, stale = false, exportCount, onCopyLink, onExport, toggles, layoutSettings, columnsReset, onLineChange, columnsFoot, fields = [], foldFields = false, onClose, onScreenChange } = props;
43
+ const { view, onViewChange, layouts, filter, sort, group, changed = false, onReset, onSave, pending = false, stale = false, exportCount, onCopyLink, onExport, toggles, layoutSettings, columnsReset, resets, differs, onLineChange, columnsFoot, fields = [], foldFields = false, onClose, onScreenChange } = props;
44
44
  const w = customizeWords(props.words);
45
+ const { Button, Input } = usePanelControls();
45
46
  const host = React.useContext(PhoneHost), small = usePhone(), phone = (props.form ?? (host || small ? "phone" : "computer")) === "phone";
46
47
  const inPane = React.useContext(InPane);
47
48
  const [place, worn] = useCustomizeWorn();
@@ -119,10 +120,7 @@ export function useCustomize(props) {
119
120
  const layout = layouts.find((l) => l.id === view.layout) ?? layouts[0];
120
121
  const part = (slot, key) => ({ slot: { slot, ...(key !== undefined ? { key } : {}) } });
121
122
  const section = (label, icon, s, key) => s ? [{ kind: "actions", icon, label, detail: s.says, inForce: s.inForce, entries: [], ...part("vk-customize-section", key) }] : [];
122
- const toggleRows = (ts) => ts.flatMap((t) => [
123
- { kind: "check", label: t.label, checked: t.value, onCheckedChange: (on) => t.onChange(on), ...(t.icon != null && { icon: t.icon }), ...part("vk-customize-toggle", t.key) },
124
- ...(t.reset ? [{ icon: null, label: w.toggleReset(t.label), onSelect: t.reset, ...part("vk-customize-toggle-reset", t.key) }] : []),
125
- ]);
123
+ const toggleRows = (ts) => ts.map((t) => ({ kind: "check", label: t.label, checked: t.value, onCheckedChange: (on) => t.onChange(on), ...(t.icon != null && { icon: t.icon }), ...part("vk-customize-toggle", t.key) }));
126
124
  const sectionsOfToggles = (ts) => [...new Set(ts.flatMap((t) => (t.section ? [t.section] : [])))];
127
125
  const checks = toggles
128
126
  ? [...toggleRows(toggles.filter((t) => !t.section)),
@@ -147,8 +145,8 @@ export function useCustomize(props) {
147
145
  const inForceFields = filterFields.filter((f) => f.inForce).length;
148
146
  const foldedFilter = folded ? { says: inForceFields ? String(inForceFields) : w.none, inForce: inForceFields > 0 } : undefined;
149
147
  const sections = [
150
- ...(hasLayout ? [{ kind: "actions", icon: layout?.mark, label: w.layout, detail: layout?.name, entries: [], ...part("vk-customize-section", "layout") }] : []),
151
- ...(hasColumns ? [{ kind: "actions", icon: COLUMNS, label: w.columns, detail: columnsSay(view.columns, w), entries: [], ...part("vk-customize-section", "columns") }] : []),
148
+ ...(hasLayout ? [{ kind: "actions", icon: layout?.mark, label: w.layout, detail: layout?.name, inForce: !!differs?.layout, entries: [], ...part("vk-customize-section", "layout") }] : []),
149
+ ...(hasColumns ? [{ kind: "actions", icon: COLUMNS, label: w.columns, detail: columnsSay(view.columns, w), inForce: !!differs?.columns, entries: [], ...part("vk-customize-section", "columns") }] : []),
152
150
  ...(folded ? [] : fieldEntries(filterFields, true)),
153
151
  ...section(w.filter, _jsx(Icon, { name: "filter" }), filter ?? foldedFilter, "filter"), ...section(w.sort, _jsx(Icon, { name: "sort" }), sort, "sort"), ...section(w.group, GROUP, group, "group"),
154
152
  ...(folded ? [] : fieldEntries(afterFields)),
@@ -206,7 +204,7 @@ export function useCustomize(props) {
206
204
  setChoosing(null);
207
205
  setBack(true);
208
206
  } }, [column, col]);
209
- const allChoices = screen === "layout" ? (layoutSettings ? [...layoutSettings.choices, ...(layoutSettings.personal?.choices ?? [])] : []) : col?.settings?.choices ?? [];
207
+ const allChoices = screen === "layout" ? layoutSettings?.choices ?? [] : col?.settings?.choices ?? [];
210
208
  const choiceRows = new Map();
211
209
  const choiceOpened = (e) => { const c = choiceRows.get(e); if (c) {
212
210
  setBack(false);
@@ -234,10 +232,9 @@ export function useCustomize(props) {
234
232
  const ownSettings = (settings, name, lead = [], own) => {
235
233
  const bare = settings.toggles.filter((t) => !t.section), sectioned = sectionsOfToggles(settings.toggles);
236
234
  const first = [...lead, ...settings.choices.map(choiceRow), ...toggleRows(bare)];
237
- const you = settings.personal, yours = you ? [...you.choices.map(choiceRow), ...toggleRows(you.toggles), ...(you.onReset ? [{ icon: null, label: w.personalReset, onSelect: you.onReset, ...part("vk-customize-toggle-reset", "personal") }] : [])] : [];
238
- return _jsxs(_Fragment, { children: [first.length > 0 && _jsxs(_Fragment, { children: [!own && headingWords(name, own === undefined ? layout?.id ?? name : name), rowsList(own?.list ?? w.layoutSettings(name), first)] }), sectioned.map((s) => _jsxs(React.Fragment, { children: [headingWords(s, s), rowsList(s, toggleRows(settings.toggles.filter((t) => t.section === s)))] }, s)), you && yours.length > 0 && _jsxs(_Fragment, { children: [headingWords(you.label, "you"), rowsList(you.label, yours)] })] });
235
+ return _jsxs(_Fragment, { children: [first.length > 0 && _jsxs(_Fragment, { children: [!own && headingWords(name, own === undefined ? layout?.id ?? name : name), rowsList(own?.list ?? w.layoutSettings(name), first)] }), sectioned.map((s) => _jsxs(React.Fragment, { children: [headingWords(s, s), rowsList(s, toggleRows(settings.toggles.filter((t) => t.section === s)))] }, s))] });
239
236
  };
240
- const layoutScreen = (_jsxs(_Fragment, { children: [_jsx(RadioGroup, { tiles: true, "aria-label": w.layout, value: view.layout, onValueChange: (v) => { if (typeof v === "string")
237
+ const layoutScreen = (_jsxs(_Fragment, { children: [(!phone || layouts.length > 1) && _jsx(RadioGroup, { tiles: true, "aria-label": w.layout, value: view.layout, onValueChange: (v) => { if (typeof v === "string")
241
238
  change({ ...latest.view, layout: v }); }, children: layouts.map((l) => _jsx(Radio, { value: l.id, mark: l.mark, label: l.name, disabled: l.later, "data-slot": "vk-customize-layout", "data-key": l.id }, l.id)) }), layoutSettings ? ownSettings(layoutSettings, layout?.name ?? w.layout) : layout?.id === "table" && _jsxs(_Fragment, { children: [headingWords(layout.name, layout.id), rowsList(w.layoutSettings(layout.name), [
242
239
  { kind: "check", label: w.freeze, checked: view.freeze, onCheckedChange: (c) => change({ ...latest.view, freeze: c }), ...part("vk-customize-toggle", "freeze") },
243
240
  { kind: "check", label: w.wrap, checked: view.wrap, onCheckedChange: (c) => change({ ...latest.view, wrap: c }), ...part("vk-customize-toggle", "wrap") },
@@ -279,21 +276,20 @@ export function useCustomize(props) {
279
276
  const columnsSearch = phone ? columnsBox : _jsx("div", { className: "o-customize-search", children: columnsBox });
280
277
  const shownActs = [
281
278
  ...(!searching && canHide ? [{ key: "hide-all", label: w.hideAll, onPress: () => press(latest.view.columns.filter((c) => c.shown && !c.locked).map((c) => c.id), false) }] : []),
282
- ...(!searching && columnsReset ? [{ key: "reset", label: w.columnsReset, onPress: columnsReset }] : []),
283
279
  ];
284
- const columnsScreen = (_jsxs(_Fragment, { children: [phone && columnsSearch, shownHere && _jsxs(_Fragment, { children: [heading(w.shownHeading, "shown", shownActs), rowsOf(w.shownHeading, true)] }), hiddenHere && _jsxs(_Fragment, { children: [heading(w.hiddenHeading, "hidden", !searching && canShow ? [{ key: "show-all", label: w.showAll, onPress: () => press(latest.view.columns.filter((c) => !c.shown).map((c) => c.id), true) }] : undefined), rowsOf(w.hiddenHeading, false)] }), !found.length && _jsx("p", { className: "o-customize-none", children: w.noColumn(find.trim()) }), columnsFoot != null && _jsx("div", { className: "o-customize-foot-rows", children: columnsFoot })] }));
280
+ const columnsScreen = (_jsxs(_Fragment, { children: [phone && columnsSearch, shownHere && _jsxs(_Fragment, { children: [heading(w.shownHeading, "shown", shownActs), rowsOf(w.shownHeading, true)] }), hiddenHere && _jsxs(_Fragment, { children: [heading(w.hiddenHeading, "hidden", !searching && canShow ? [{ key: "show-all", label: w.showAll, onPress: () => press(latest.view.columns.filter((c) => !c.shown).map((c) => c.id), true) }] : undefined), rowsOf(w.hiddenHeading, false)] }), !found.length && _jsx("p", { className: "o-customize-none", "data-slot": "vk-customize-none", "data-key": "columns", children: w.noColumn(find.trim()) }), columnsFoot != null && _jsx("div", { className: "o-customize-foot-rows", "data-slot": "vk-customize-columns-foot", children: columnsFoot })] }));
285
281
  const backFromColumn = () => { setBack(true); setFocusTo(col?.label ?? null); setColumn(null); setChoosing(null); };
286
- const columnLevel = col && (_jsxs(_Fragment, { children: [ownSettings(col.settings ?? { choices: [], toggles: [] }, col.label, col.locked ? [] : [{ kind: "check", label: w.columnShown, checked: held[col.id] ?? col.shown, onCheckedChange: (on) => press([col.id], on), ...part("vk-customize-toggle", "shown") }], { list: w.columnSettings(col.label) }), col.rows != null && _jsxs("div", { className: "o-customize-rows", children: [(!col.locked || columnOpensBySettings(col)) && _jsx("div", { role: "separator", className: "o-list-sep" }), col.rows] })] }));
282
+ const columnLevel = col && (_jsxs(_Fragment, { children: [ownSettings(col.settings ?? { choices: [], toggles: [] }, col.label, col.locked ? [] : [{ kind: "check", label: w.columnShown, checked: held[col.id] ?? col.shown, onCheckedChange: (on) => press([col.id], on), ...part("vk-customize-toggle", "shown") }], { list: w.columnSettings(col.label) }), col.rows != null && _jsxs("div", { className: "o-customize-rows", "data-slot": "vk-customize-rows", "data-key": col.id, children: [(!col.locked || columnOpensBySettings(col)) && _jsx("div", { role: "separator", className: "o-list-sep" }), col.rows] })] }));
287
283
  const rowsOfField = (label, rows) => (phone
288
284
  ? _jsx(MenuList, { label: label, entries: rows, words: w.rows }) : _jsx(MenuListPanelRows, { label: label, entries: rows, ticks: "box", words: w.rows }));
289
285
  const fieldScreen = field && (() => {
290
286
  const o = field.opens;
291
287
  if ("pick" in o)
292
- return o.pick.choices.length === 0 ? _jsx("p", { className: "o-customize-none", children: w.nothingToPick })
288
+ return o.pick.choices.length === 0 ? _jsx("p", { className: "o-customize-none", "data-slot": "vk-customize-none", "data-key": "choices", children: w.nothingToPick })
293
289
  : rowsOfField(field.label, [{ kind: "pick", value: o.pick.value, choices: o.pick.choices.map((c) => ({ ...c, ...part("vk-customize-option", c.value) })), onChoose: (v) => { if (v !== o.pick.value)
294
290
  o.pick.onChoose(v); backFromField(); } }]);
295
291
  if ("check" in o)
296
- return o.check.choices.length === 0 ? _jsx("p", { className: "o-customize-none", children: w.nothingToPick })
292
+ return o.check.choices.length === 0 ? _jsx("p", { className: "o-customize-none", "data-slot": "vk-customize-none", "data-key": "choices", children: w.nothingToPick })
297
293
  : rowsOfField(field.label, o.check.choices.map((c) => ({ kind: "check", label: c.label, ...(c.mark != null && { icon: c.mark }), ...part("vk-customize-option", c.value), checked: o.check.values.includes(c.value),
298
294
  onCheckedChange: (on) => o.check.onChange(on ? [...o.check.values, c.value] : o.check.values.filter((v) => v !== c.value)) })));
299
295
  return typeof o.body === "function" ? o.body(backFromField) : o.body;
@@ -312,20 +308,23 @@ export function useCustomize(props) {
312
308
  const named = worn.head === "name" && view.name !== "";
313
309
  const name = screen === "list" ? (named ? view.name : w.title) : level?.name ?? NAMES[screen];
314
310
  const titled = !named;
311
+ const pageReset = screen !== "list" && !level ? (resets ? resets[screen] : screen === "columns" ? columnsReset : undefined) : undefined;
312
+ const pageWords = (size) => pageReset && (_jsx("div", { className: "o-customize-words", "data-slot": "vk-customize-changes", children: _jsx(Button, { kind: "link", size: size, "data-slot": "vk-customize-action", "data-key": "page-reset", onClick: pageReset, disabled: pending, children: w.reset }) }));
315
313
  const step = choice ? (col ? `columns:${col.id}:${choice.key}` : `layout:${choice.key}`) : col ? `columns:${col.id}` : field ? `field:${field.key}` : screen;
316
314
  if (phone) {
317
315
  const body = (_jsx("div", { ref: placeRoot, className: "o-customize", "data-slot": "vk-customize", "data-kit": "customize", "data-customize-form": form, "data-customize-screen": screen, ...phoneMark(!!host || small), ...MENU_LIST_CARD_FRAME, children: _jsx(SheetStep, { step: step, back: back, children: _jsx("div", { className: "o-customize-step", children: content }) }) }));
318
- const foot = screen === "list" && (changed || footer.length) ? (_jsxs("div", { className: "o-customize-foot", "data-slot": "vk-customize-foot", ...MENU_LIST_CARD_FRAME, children: [changed && words("44"), footer.length > 0 && _jsx(MenuList, { label: w.share, entries: footer, words: w.rows })] })) : undefined;
316
+ const foot = screen === "list" && (changed || footer.length) ? (_jsxs("div", { className: "o-customize-foot", "data-slot": "vk-customize-foot", ...MENU_LIST_CARD_FRAME, children: [changed && words("44"), footer.length > 0 && _jsx(MenuList, { label: w.share, entries: footer, words: w.rows })] })) : pageReset ? _jsx("div", { className: "o-customize-foot", "data-slot": "vk-customize-foot", ...MENU_LIST_CARD_FRAME, children: pageWords("44") }) : undefined;
319
317
  return { body, title: name, head: screen === "list" ? { close: true } : { onBack: backTo, close: titled }, foot, level };
320
318
  }
321
319
  const title = (words) => (inPane ? _jsx(PaneTitle, { children: words }) : _jsx("h2", { className: "o-pane-title", children: words }));
322
320
  const xButton = (extra) => _jsx(Button, { kind: "quiet", shape: "icon", size: "sm", "data-slot": "vk-customize-close", "aria-label": w.close, icon: _jsx(Icon, { name: "x" }), ...extra });
323
321
  const close = inPane ? _jsx(PaneClose, { render: xButton() }) : onClose ? xButton({ onClick: onClose }) : null;
324
322
  const head = screen !== "list" ? (_jsxs(PaneHead, { className: "o-customize-head o-customize-head-screen", "data-slot": "vk-customize-head", children: [_jsx(Button, { ref: backButton, kind: "quiet", shape: "icon", size: "sm", "data-slot": "vk-customize-back", "aria-label": w.back, icon: _jsx(Icon, { name: "left" }), onClick: backTo }), _jsx("span", { className: "o-customize-title", "data-slot": "vk-customize-title", children: title(name) }), titled && close] })) : titled ? (_jsxs(PaneHead, { className: "o-customize-head o-customize-head-title", "data-slot": "vk-customize-head", children: [_jsx("span", { className: "o-customize-title", "data-slot": "vk-customize-title", children: title(w.title) }), close] })) : (_jsxs(PaneHead, { className: "o-customize-head o-customize-head-name", "data-slot": "vk-customize-head", children: [hasLayout && _jsx(Button, { kind: "outline", shape: "icon", size: "sm", "data-slot": "vk-customize-layout-button", "aria-label": w.layoutButton(layout?.name ?? ""), icon: layout?.mark, onClick: () => go("layout") }), _jsx(ViewName, { name: view.name, label: w.viewName, onRename: (n) => change({ ...latest.view, name: n }) })] }));
325
- const parts = (_jsxs(_Fragment, { children: [head, screen === "columns" && !col && columnsSearch, _jsx(PaneBody, { children: _jsx("div", { ref: placeRoot, className: "o-customize", "data-slot": "vk-customize", "data-kit": "customize", "data-customize-form": form, "data-customize-screen": screen, ...phoneMark(!!host || small), ...MENU_LIST_CARD_FRAME, children: _jsx(React.Fragment, { children: content }, step) }) }), screen === "list" && changed && words("xs"), footer.length > 0 && _jsx(PaneFoot, { "data-slot": "vk-customize-foot", children: _jsx(MenuListPanelRows, { label: w.share, entries: footer, words: w.rows }) })] }));
323
+ const parts = (_jsxs(_Fragment, { children: [head, screen === "columns" && !col && columnsSearch, _jsx(PaneBody, { children: _jsx("div", { ref: placeRoot, className: "o-customize", "data-slot": "vk-customize", "data-kit": "customize", "data-customize-form": form, "data-customize-screen": screen, ...phoneMark(!!host || small), ...MENU_LIST_CARD_FRAME, children: _jsx(React.Fragment, { children: content }, step) }) }), screen === "list" && changed && words("xs"), pageWords("xs"), footer.length > 0 && _jsx(PaneFoot, { "data-slot": "vk-customize-foot", children: _jsx(MenuListPanelRows, { label: w.share, entries: footer, words: w.rows }) })] }));
326
324
  return { body: inPane ? parts : _jsx("div", { className: "o-customize-frame", children: parts }), title: name, head: {}, level };
327
325
  }
328
326
  function ViewName({ name, label, onRename }) {
327
+ const { Input } = usePanelControls();
329
328
  const [draft, setDraft] = React.useState(name);
330
329
  React.useEffect(() => setDraft(name), [name]);
331
330
  const keep = () => { const n = draft.trim(); if (!n)
@@ -12,6 +12,6 @@ export declare function customizeWordsOf(say: ViewsMessageResolver): CustomizeWo
12
12
  * refused one writes nothing) and its columns that differs. Columns, one or several shown or hidden (Hide all, Show all) or moved,
13
13
  * through ViewKit's own, in one change. */
14
14
  export declare function customizeWriteOf(p: ViewsCustomizeBodyProps, own: CustomizeBodyOwn, now: CustomizeView, next: CustomizeView): (() => void) | null;
15
- /** ViewKit's Customize, its sort and filter drawing the app's controls where the provider's `panelControls` names them
16
- * (VK-1013); Customize's own controls stay ViewKit's for now (VK-1014). */
15
+ /** ViewKit's Customize, drawing the app's controls where the provider's `panelControls` names them (VK-1013, VK-1014): its own,
16
+ * and its sort's, filter's and group's. */
17
17
  export declare function MapCustomizeBody(props: ViewsCustomizeBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,7 @@ import { groupLabel } from "../group-editor/rules.js";
12
12
  import { glyph, X } from "../internal/editor-parts.js";
13
13
  import { useToldStep } from "../internal/told-step.js";
14
14
  import { HeaderBar } from "../phone-header/header-bar.js";
15
- import { SheetButton } from "../sheet/bottom-sheet.js";
15
+ import { PanelHeadButton } from "../internal/head-button.js";
16
16
  import { SheetPartsFrom } from "../sheet/sheet-parts.js";
17
17
  import { sortEditorPropsOf, sortEditorWordsOf } from "../sort-editor/map-sort-body.js";
18
18
  import { sortLabel } from "../sort-editor/rules.js";
@@ -98,14 +98,12 @@ export function customizeWriteOf(p, own, now, next) {
98
98
  return null;
99
99
  return () => viewKit.onColumnsChange(next.columns.map((c) => ({ id: c.id, hidden: !c.shown })));
100
100
  }
101
- const toggleOf = (t) => ({ key: t.key, label: t.label, value: t.value, onChange: t.onChange, ...(t.icon != null && { icon: t.icon }), ...(t.reset && { reset: t.reset }), ...(t.section && { section: t.section }) });
101
+ const toggleOf = (t) => ({ key: t.key, label: t.label, value: t.value, onChange: t.onChange, ...(t.icon != null && { icon: t.icon }), ...(t.section && { section: t.section }) });
102
102
  const choiceOf = (c) => ({ key: c.key, label: c.label, value: c.value, options: [...c.options], onChange: c.onChange });
103
103
  function layoutSettingsOf(layout) {
104
104
  return {
105
105
  choices: [...(layout.density ? [choiceOf(layout.density)] : []), ...layout.choices.map(choiceOf)],
106
106
  toggles: layout.toggles.map(toggleOf),
107
- ...(layout.personal && { personal: { label: layout.personal.label, toggles: layout.personal.toggles.map(toggleOf), choices: layout.personal.choices.map(choiceOf),
108
- ...(layout.personal.onReset && { onReset: layout.personal.onReset }) } }),
109
107
  };
110
108
  }
111
109
  const NO_SORT = { label: "", options: [], rules: [], setAside: [], max: 1, addSort: true, onRulesChange() { } };
@@ -127,25 +125,27 @@ function CustomizeBodyInner(props) {
127
125
  const groupWords = React.useMemo(() => groupEditorWordsOf(say), [say]);
128
126
  const wayWord = (operator) => (views?.conventions ? views.conventions.messages({ key: "filter.operator", values: { operator } }) : operator.replace(/_/g, " "));
129
127
  const editorForm = phone ? "phone" : "narrow";
128
+ const marked = (page) => (p.resets ? !!p.resets[page] : undefined);
130
129
  const sortProps = sortEditorPropsOf({ ...(p.sort ?? NO_SORT), form: p.form, onDone: stay }, sortWords, say);
131
- const sorting = useSortEditor({ ...sortProps, form: editorForm, onDone: undefined });
130
+ const clearAll = !p.resets;
131
+ const sorting = useSortEditor({ ...sortProps, form: editorForm, onDone: undefined, clearAll });
132
132
  const sortSaid = sortLabel(sortProps.rules, sortProps.fields);
133
- const sort = p.sort && { says: sortSaid ? `${sortSaid.first}${sortSaid.more ? ` +${sortSaid.more}` : ""}` : w.none, inForce: !!sortSaid,
133
+ const sort = p.sort && { says: sortSaid ? `${sortSaid.first}${sortSaid.more ? ` +${sortSaid.more}` : ""}` : w.none, inForce: marked("sort") ?? !!sortSaid,
134
134
  opens: sorting.body, level: levelOf(sorting) };
135
135
  const filterHanded = { ...(p.filter ?? NO_FILTER), form: p.form, onDone: stay };
136
136
  const map = useMapFilterBody(filterHanded, filterWords, say, views?.components.AppIcon, wayWord);
137
137
  const filtering = useFilterEditor({ label: filterHanded.label, fields: map.kit.fields, filter: map.filter, levels: filterHanded.levels, form: editorForm, onFilterChange: map.change,
138
- own: map.own, words: filterWords });
138
+ own: map.own, words: filterWords, clearAll });
139
139
  const ruleCount = rulesOf(map.filter).length;
140
- const filter = p.filter && { says: ruleCount > 0 ? String(ruleCount) : w.none, inForce: ruleCount > 0, opens: filtering.body, level: levelOf(filtering) };
140
+ const filter = p.filter && { says: ruleCount > 0 ? String(ruleCount) : w.none, inForce: marked("filter") ?? ruleCount > 0, opens: filtering.body, level: levelOf(filtering) };
141
141
  const groupProps = groupEditorPropsOf({ ...(p.group ?? NO_GROUP), form: p.form, onDone: stay }, groupWords);
142
142
  const grouping = useGroupEditor(groupProps);
143
- const group = p.group && { says: groupLabel(groupProps.group, groupProps.fields, w.none), inForce: p.group.group.value !== "none",
143
+ const group = p.group && { says: groupLabel(groupProps.group, groupProps.fields, w.none), inForce: marked("group") ?? p.group.group.value !== "none",
144
144
  opens: grouping.body, level: grouping.level };
145
145
  const view = { name: onRename ? name ?? "" : "", layout: p.layout?.value ?? "", columns: columnsOf(p, say), counts: false, freeze: false, wrap: false };
146
146
  const shared = p.view, kit = p.foot === "kit";
147
- const foot = shared ? (shared.changes > 0 && p.foot !== "none" ? {
148
- changed: true, onReset: shared.onReset, ...(shared.canPublish && { onSave: shared.onPublish }), pending: shared.pending, stale: shared.stale,
147
+ const foot = shared ? ((shared.changes > 0 || shared.layered) && p.foot !== "none" ? {
148
+ changed: true, onReset: shared.onReset, ...(shared.canPublish && shared.changes > 0 && { onSave: shared.onPublish }), pending: shared.pending, stale: shared.stale,
149
149
  words: { reset: say({ key: kit ? "views.panels.view-clear" : "views.panels.view-reset" }), save: say({ key: kit ? "views.panels.view-save" : shared.own ? "views.panels.view-save-own" : "views.panels.view-publish" }) },
150
150
  } : {}) : p.onClear && p.foot !== "none" ? { changed: true, onReset: p.onClear, words: { reset: say({ key: "views.panels.view-clear" }) } } : {};
151
151
  const { words: footWords, ...footProps } = foot;
@@ -177,13 +177,14 @@ function CustomizeBodyInner(props) {
177
177
  toggles: p.toggles.map(toggleOf),
178
178
  ...(p.layout && { layoutSettings: layoutSettingsOf(p.layout) }),
179
179
  ...(p.columns?.reset && { columnsReset: p.columns.reset }),
180
+ ...(p.resets && { resets: p.resets, differs: { layout: !!p.resets.layout, columns: !!p.resets.columns } }),
180
181
  ...(p.columns?.onStartsLineChange && { onLineChange: p.columns.onStartsLineChange }),
181
182
  ...(p.columns?.footer != null && { columnsFoot: p.columns.footer }),
182
183
  ...(fields.length > 0 && { fields, foldFields: p.fields.folded }),
183
184
  ...footProps,
184
185
  ...(exportCount !== undefined && { exportCount }), ...(onCopyLink && { onCopyLink }), ...(onExport && { onExport }),
185
186
  onClose: p.onDone, onScreenChange: p.onPageChange, screen: p.page, form: p.form,
186
- words: { ...w, ...(p.layout && { layout: p.layout.label }), ...(p.columns && { columns: p.columns.label }),
187
+ words: { ...w, reset: say({ key: shared && !kit ? "views.panels.view-reset" : "views.panels.view-clear" }), ...(p.layout && { layout: p.layout.label }), ...(p.columns && { columns: p.columns.label }),
187
188
  ...(p.layout && p.layout.value !== "table" && { shownHeading: say({ key: "views.panels.customize-shown-fields" }) }), ...footWords },
188
189
  });
189
190
  const told = parts.level;
@@ -195,5 +196,6 @@ function CustomizeBodyInner(props) {
195
196
  if (!phone || setParts)
196
197
  return _jsx(_Fragment, { children: parts.body });
197
198
  const { onBack, close } = parts.head;
198
- return (_jsxs(_Fragment, { children: [_jsx(HeaderBar, { className: "o-sheet-row o-customize-own-head", title: parts.title, left: onBack ? _jsx(SheetButton, { "aria-label": w.back, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack }) : close ? _jsx(SheetButton, { "aria-label": w.close, icon: glyph(X), onClick: p.onDone }) : _jsx("span", {}), right: close && onBack ? _jsx(SheetButton, { "aria-label": w.close, icon: glyph(X), onClick: p.onDone }) : _jsx("span", {}) }), parts.body, parts.foot] }));
199
+ return (_jsxs(_Fragment, { children: [_jsx(HeaderBar, { className: "o-sheet-row o-customize-own-head", title: parts.title, left: onBack ? _jsx(PanelHeadButton, { "data-slot": "vk-editor-back", "aria-label": w.back, className: "o-sheet-back", icon: glyph(BACK), onClick: onBack })
200
+ : close ? _jsx(PanelHeadButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: p.onDone }) : _jsx("span", {}), right: close && onBack ? _jsx(PanelHeadButton, { "data-slot": "vk-editor-close", "aria-label": w.close, icon: glyph(X), onClick: p.onDone }) : _jsx("span", {}) }), parts.body, parts.foot] }));
199
201
  }
@@ -42,11 +42,11 @@ export interface CustomizeWords {
42
42
  /** A table's two settings, as its own page draws them (the view's `freeze` and `wrap`). */
43
43
  freeze: string;
44
44
  wrap: string;
45
- /** For you's way back to the view's own settings. */
45
+ /** @deprecated Drawn nowhere since the Layout page ends at its toggles (VK-1033). To be removed in a later release. */
46
46
  personalReset: string;
47
- /** Columns' way back to the view's own columns. */
47
+ /** @deprecated Drawn nowhere since Columns resets through its page's Reset (VK-1034). To be removed in a later release. */
48
48
  columnsReset: string;
49
- /** A setting's way back to its default. */
49
+ /** @deprecated Drawn nowhere since a toggle carries no way back of its own (VK-1033). To be removed in a later release. */
50
50
  toggleReset: (label: string) => string;
51
51
  /** The shared view moved after the reader's changes began. */
52
52
  stale: string;
@@ -46,6 +46,9 @@ export interface DateEditorProps {
46
46
  words?: Partial<DateEditorWords>;
47
47
  /** The language its month and weekday names are written in (BCP 47); English unless said. */
48
48
  language?: string;
49
+ /** The conventions' locale (BCP 47), handed to an app's Calendar as the filter's calendar is handed it (VK-1021); its
50
+ * language unless said. */
51
+ locale?: string;
49
52
  }
50
53
  export interface DateEditorParts {
51
54
  body: React.ReactNode;