viewkitjs 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/package.json +1 -1
  3. package/views/dist/atoms/types.d.ts +32 -4
  4. package/views/dist/contract.d.ts +14 -8
  5. package/views/dist/contract.js +14 -1
  6. package/views/dist/controls/button/own-look-moved.d.ts +11 -0
  7. package/views/dist/controls/button/own-look-moved.js +3 -0
  8. package/views/dist/controls/date-editor/date-behaviour.d.ts +80 -0
  9. package/views/dist/controls/date-editor/date-behaviour.js +187 -0
  10. package/views/dist/controls/date-editor/date-editor.d.ts +3 -2
  11. package/views/dist/controls/date-editor/date-editor.js +29 -166
  12. package/views/dist/controls/field/field.d.ts +3 -2
  13. package/views/dist/controls/field/field.js +7 -2
  14. package/views/dist/controls/field/looks.d.ts +1 -1
  15. package/views/dist/controls/field/looks.js +5 -4
  16. package/views/dist/controls/field.css +4 -0
  17. package/views/dist/controls/filter-editor/filter-editor.js +2 -2
  18. package/views/dist/controls/filter-editor/parts.d.ts +2 -0
  19. package/views/dist/controls/filter-editor/parts.js +1 -1
  20. package/views/dist/controls/index.d.ts +3 -1
  21. package/views/dist/controls/index.js +3 -1
  22. package/views/dist/controls/inline-input.css +9 -0
  23. package/views/dist/controls/internal/phone.d.ts +1 -1
  24. package/views/dist/controls/internal/phone.js +3 -2
  25. package/views/dist/controls/list/tokens.d.ts +1 -1
  26. package/views/dist/controls/list/tokens.js +1 -1
  27. package/views/dist/controls/list.css +5 -2
  28. package/views/dist/controls/menu-list/menu-list.js +3 -2
  29. package/views/dist/controls/menu.css +4 -4
  30. package/views/dist/controls/pane.css +1 -1
  31. package/views/dist/controls/picker.css +5 -3
  32. package/views/dist/controls/popover/looks.d.ts +1 -1
  33. package/views/dist/controls/popover/looks.js +5 -0
  34. package/views/dist/controls/popover/tokens.d.ts +13 -1
  35. package/views/dist/controls/popover/tokens.js +4 -1
  36. package/views/dist/controls/popover.css +59 -8
  37. package/views/dist/controls/select/select.js +1 -1
  38. package/views/dist/controls/sort-editor.css +4 -2
  39. package/views/dist/controls/text-editor.css +6 -0
  40. package/views/dist/controls/toolbar/toolbar.d.ts +4 -2
  41. package/views/dist/controls/toolbar/toolbar.js +7 -2
  42. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +1 -1
  43. package/views/dist/controls/toolbar.css +5 -0
  44. package/views/dist/controls/tooltip/tokens.d.ts +1 -1
  45. package/views/dist/controls/tooltip/tokens.js +1 -1
  46. package/views/dist/controls/tooltip.css +5 -3
  47. package/views/dist/controls/values-editor.css +20 -5
  48. package/views/dist/display/entity-chip.d.ts +7 -1
  49. package/views/dist/display/entity-chip.js +2 -1
  50. package/views/dist/field-row/FieldRow.js +12 -8
  51. package/views/dist/grid/chrome/GridCellEditors.d.ts +4 -1
  52. package/views/dist/grid/chrome/GridCellEditors.js +3 -2
  53. package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -5
  54. package/views/dist/grid/chrome/GridCellOutline.js +3 -5
  55. package/views/dist/grid/chrome/GridChipsEditor.js +1 -1
  56. package/views/dist/grid/chrome/GridDateEditor.d.ts +1 -1
  57. package/views/dist/grid/chrome/GridDateEditor.js +1 -1
  58. package/views/dist/grid/chrome/GridLongTextEditor.d.ts +1 -1
  59. package/views/dist/grid/chrome/GridLongTextEditor.js +8 -5
  60. package/views/dist/grid/chrome/GridNameEditor.d.ts +1 -1
  61. package/views/dist/grid/chrome/GridNameEditor.js +1 -1
  62. package/views/dist/grid/chrome/GridNumberEditor.d.ts +1 -1
  63. package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
  64. package/views/dist/grid/chrome/GridPlaceEditor.d.ts +1 -1
  65. package/views/dist/grid/chrome/GridPlaceEditor.js +1 -1
  66. package/views/dist/grid/chrome/GridRangeEditor.d.ts +2 -2
  67. package/views/dist/grid/chrome/GridRangeEditor.js +1 -1
  68. package/views/dist/grid/chrome/GridRelationEditor.js +2 -2
  69. package/views/dist/grid/chrome/GridRowCells.js +6 -5
  70. package/views/dist/grid/chrome/GridSelectEditor.js +1 -1
  71. package/views/dist/grid/chrome/GridTable.d.ts +2 -1
  72. package/views/dist/grid/chrome/GridTable.js +7 -2
  73. package/views/dist/grid/chrome/GridTextEditor.d.ts +1 -1
  74. package/views/dist/grid/chrome/GridTextEditor.js +2 -2
  75. package/views/dist/grid/chrome/GridValueListEditor.d.ts +1 -1
  76. package/views/dist/grid/chrome/GridValueListEditor.js +1 -1
  77. package/views/dist/grid/chrome/grid-body-place.d.ts +7 -2
  78. package/views/dist/grid/chrome/grid-body-place.js +8 -4
  79. package/views/dist/grid/chrome/grid-cell-classes.js +2 -2
  80. package/views/dist/grid/chrome/grid-edit-session.d.ts +4 -0
  81. package/views/dist/grid/chrome/grid-edit-session.js +10 -1
  82. package/views/dist/grid/chrome/grid-editor-layer.d.ts +10 -0
  83. package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
  84. package/views/dist/grid/chrome/grid-fitted-box.d.ts +4 -4
  85. package/views/dist/grid/chrome/grid-fitted-box.js +1 -3
  86. package/views/dist/grid/chrome/grid-hover.d.ts +3 -3
  87. package/views/dist/grid/chrome/grid-hover.js +2 -3
  88. package/views/dist/grid/chrome/grid-row-props.d.ts +6 -2
  89. package/views/dist/grid/chrome/grid-styles.d.ts +1 -5
  90. package/views/dist/grid/chrome/grid-styles.js +0 -1
  91. package/views/dist/grid/chrome/useGridKeyboard.d.ts +0 -1
  92. package/views/dist/grid/chrome/useGridKeyboard.js +2 -10
  93. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +3 -1
  94. package/views/dist/grid/chrome/useGridTableInteractionModel.js +24 -1
  95. package/views/dist/grid/core/useGridEditing.d.ts +3 -0
  96. package/views/dist/grid/core/useGridEditing.js +2 -0
  97. package/views/dist/grid/grid.css +4 -19
  98. package/views/dist/internal/screen-forms.d.ts +11 -0
  99. package/views/dist/internal/screen-forms.js +31 -0
  100. package/views/dist/list/list.js +2 -1
  101. package/views/dist/list/parts.d.ts +8 -2
  102. package/views/dist/list/parts.js +31 -7
  103. package/views/dist/list/toolbar.js +7 -3
  104. package/views/dist/looks/index.d.ts +1 -0
  105. package/views/dist/looks/index.js +1 -0
  106. package/views/dist/panels/react/popover.d.ts +3 -1
  107. package/views/dist/panels/react/popover.js +2 -2
  108. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +6 -3
  109. package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
  110. package/views/dist/panels/react/toolbar/Toolbar.js +5 -1
  111. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
  112. package/views/dist/panels/react/toolbar/ToolbarButton.js +3 -2
  113. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -3
  114. package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
  115. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +1 -1
  116. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
  117. package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
  118. package/views/dist/panels/react/toolbar/ToolbarSave.js +28 -20
  119. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  120. package/views/dist/panels/react/toolbar/context.d.ts +3 -2
  121. package/views/dist/panels/react/views-row/FoldingViewRow.js +24 -7
  122. package/views/dist/panels/react/views-row/ViewPicker.js +1 -1
  123. package/views/dist/panels/react/views-row/more-views.d.ts +2 -0
  124. package/views/dist/panels/react/views-row/more-views.js +3 -0
  125. package/views/dist/panels/react.d.ts +1 -1
  126. package/views/dist/panels/toolbar/model.d.ts +2 -2
  127. package/views/dist/provider/components.d.ts +6 -6
  128. package/views/dist/provider/desktop.d.ts +2 -1
  129. package/views/dist/provider/desktop.js +5 -2
  130. package/views/dist/styles.css +181 -80
  131. package/views/dist/styles.unlayered.css +181 -80
  132. package/views/docs/contract.md +68 -20
  133. package/views/docs/controls/list.md +2 -0
  134. package/views/docs/controls/menu.md +2 -0
  135. package/views/docs/controls/picker.md +2 -0
  136. package/views/docs/controls/popover.md +7 -0
  137. package/views/docs/controls/tooltip.md +2 -0
  138. package/views/docs/guides/atoms.md +11 -10
  139. package/views/docs/guides/the-grid.md +7 -5
  140. package/views/docs/guides/the-provider.md +2 -2
  141. package/views/docs/reference/controls.md +11 -6
  142. package/views/docs/reference/display.md +1 -1
  143. package/views/docs/reference/field-row.md +1 -1
  144. package/views/docs/reference/list.md +5 -6
  145. package/views/docs/reference/looks.md +4 -1
  146. package/views/docs/reference/panels-react.md +5 -4
  147. package/views/docs/reference/panels.md +1 -1
  148. package/views/docs/reference/react.md +6 -6
  149. package/views/docs/reference/views.md +2 -2
  150. package/views/docs/reshaping.md +2 -2
  151. package/views/skills/views/SKILL.md +1 -1
@@ -52,7 +52,5 @@ export function ToolbarFilterAdd({ filterTree, onHeldChange, open, onOpenChange,
52
52
  const why = details?.reason;
53
53
  if (!next && why !== "outside-press" && why !== "focus-out")
54
54
  hangsAt.anchor.current?.focus({ preventScroll: true });
55
- }, anchor: hangsAt.anchor, ...hangs, ...(opens === "filters"
56
- ? { chrome: "panel", className: "w-fit max-w-[calc(100vw-2rem)]" }
57
- : { chrome: "menu" }), panelData: { "data-slot": "vk-toolbar-filters-panel" }, children: list }))] }));
55
+ }, anchor: hangsAt.anchor, ...hangs, chrome: "menu", ...(opens === "filters" && { className: "w-(--vk-panel-w,fit-content) max-w-[calc(100vw-2rem)]" }), panelData: { "data-slot": "vk-toolbar-filters-panel" }, children: list }))] }));
58
56
  }
@@ -33,5 +33,5 @@ export function ToolbarOptions({ view, viewFoot, footClear, resets, layered, cus
33
33
  };
34
34
  return (_jsx(ToolbarPanelPart, { panelKey: "options", slot: "vk-toolbar-options", part: "options", icon: _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: name, word: name, count: count, onClear: clear, dot: !!view && view.changes > 0, open: holdsOpen ? open : ownOpen, onOpenChange: handleOpenChange, host: host, popoverClassName: widthClassName
35
35
  ? viewOptionsPopoverClassName(page, widthClassName)
36
- : viewOptionsPopoverClassName(null, "w-75"), onSheetEscape: step.escapeBack, children: ({ fill, close, closeButton }) => (_jsx(PanelStepHold.Provider, { value: step, children: _jsx(ViewOptionsPanelContent, { ...inputs, activePanel: page, onOpenPanel: setPage, anyActive: view ? view.changes > 0 : count > 0, clearAll: clear, foldFilters: foldFilters, onClose: close, closeButton: closeButton, fill: fill, view: view, viewFoot: viewFoot, footClear: footClear, ...(resets && { resets }), ...(layered && { layered }), ...(customizeItems && { customizeItems }), fieldEditor: fieldEditor, ...(viewName !== undefined && { viewName }), ...(onRenameView && { onRenameView }), ...(onCopyLink && { onCopyLink }), ...(onExport && { onExport }), ...(exportCount !== undefined && { exportCount }) }) })) }));
36
+ : viewOptionsPopoverClassName(null, "w-(--vk-panel-w,calc(var(--spacing)*75))"), onSheetEscape: step.escapeBack, children: ({ fill, close, closeButton }) => (_jsx(PanelStepHold.Provider, { value: step, children: _jsx(ViewOptionsPanelContent, { ...inputs, activePanel: page, onOpenPanel: setPage, anyActive: view ? view.changes > 0 : count > 0, clearAll: clear, foldFilters: foldFilters, onClose: close, closeButton: closeButton, fill: fill, view: view, viewFoot: viewFoot, footClear: footClear, ...(resets && { resets }), ...(layered && { layered }), ...(customizeItems && { customizeItems }), fieldEditor: fieldEditor, ...(viewName !== undefined && { viewName }), ...(onRenameView && { onRenameView }), ...(onCopyLink && { onCopyLink }), ...(onExport && { onExport }), ...(exportCount !== undefined && { exportCount }) }) })) }));
37
37
  }
@@ -11,7 +11,7 @@ export declare function ToolbarQuickFilters({ quickFilters, open, onOpenChange,
11
11
  host?: ToolbarPanelHost;
12
12
  /** The button's glyph; absent, the filter row's category glyph. */
13
13
  icon?: ReactNode;
14
- /** `null`: its icon alone, its words its name to a screen reader, unless it was placed `words: "both"` (VK-967); absent,
14
+ /** `null`: its icon alone, its words its name to a screen reader, unless it was placed `words: "both"` (VK-967) or `"word"` (VK-970); absent,
15
15
  * its icon and its words. */
16
16
  word?: null;
17
17
  }): ReactNode;
@@ -14,5 +14,5 @@ export function ToolbarQuickFilters({ quickFilters, open, onOpenChange, host, ic
14
14
  return null;
15
15
  const Glyph = icons.filterCategory;
16
16
  const label = quickFilters.label ?? messages({ key: "views.panels.quick-filters" });
17
- return (_jsx(ToolbarPanelPart, { panelKey: "quick", slot: "vk-toolbar-quick", part: "quick", icon: icon ?? _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: label, word: word === null && slot.words !== "both" ? null : label, changed: holdStands(quickFilters.hold), open: open, onOpenChange: onOpenChange, host: host, children: ({ close, closeButton }) => (_jsx(QuickFiltersPanel, { quickFilters: quickFilters, form: phone ? "phone" : "computer", onDone: close, closeButton: closeButton, inHost: !!host })) }));
17
+ return (_jsx(ToolbarPanelPart, { panelKey: "quick", slot: "vk-toolbar-quick", part: "quick", icon: icon ?? _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: label, word: word === null && slot.words !== "both" && slot.words !== "word" ? null : label, changed: holdStands(quickFilters.hold), open: open, onOpenChange: onOpenChange, host: host, children: ({ close, closeButton }) => (_jsx(QuickFiltersPanel, { quickFilters: quickFilters, form: phone ? "phone" : "computer", onDone: close, closeButton: closeButton, inHost: !!host })) }));
18
18
  }
@@ -1,10 +1,12 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { CollectionViewState } from "../../view-state.js";
3
- export declare function ToolbarSave({ view, layered, onClear, }: {
3
+ export declare function ToolbarSave({ view, layered, onClear, only, }: {
4
4
  /** The shared view this list shows: Clear is its `onReset`, Save its `onPublish`. */
5
5
  view?: CollectionViewState;
6
6
  /** With no shared view, what Clear does: the list back to its default. Absent, nothing to clear. */
7
7
  onClear?: () => void;
8
8
  /** The reader's own layer holds something (VK-1034): on a shared view Clear stands for it too, Save doesn't. */
9
9
  layered?: boolean;
10
+ /** One half alone, where the app placed Clear and Save apart (VK-970): `clear` or `save`. Absent, both in one box. */
11
+ only?: "clear" | "save";
10
12
  }): ReactNode;
@@ -4,7 +4,7 @@ import { useViews } from "../../../provider/context.js";
4
4
  import { drawPanelButton } from "../../panel-button.js";
5
5
  import { useToolbarSlot } from "./context.js";
6
6
  import { ToolbarButton } from "./ToolbarButton.js";
7
- export function ToolbarSave({ view, layered = false, onClear, }) {
7
+ export function ToolbarSave({ view, layered = false, onClear, only, }) {
8
8
  const views = useViews();
9
9
  const { messages } = views;
10
10
  const { appFrame } = useToolbarSlot();
@@ -16,24 +16,32 @@ export function ToolbarSave({ view, layered = false, onClear, }) {
16
16
  if (appFrame) {
17
17
  const clearWord = messages({ key: "views.panels.view-clear" });
18
18
  const saveWord = messages({ key: "views.panels.view-save" });
19
- return (_jsxs("span", { "data-slot": "vk-toolbar-save", className: "inline-flex shrink-0 items-center gap-2", children: [_jsx(ToolbarButton, { icon: null, label: clearWord, part: "clear", disabled: pending, onClick: clear, children: clearWord }), publish && (_jsx(ToolbarButton, { icon: null, label: saveWord, part: "save", disabled: pending, onClick: view.onPublish, children: saveWord }))] }));
19
+ const clearButton = (_jsx(ToolbarButton, { icon: null, label: clearWord, part: "clear", disabled: pending, onClick: clear, children: clearWord }));
20
+ const saveButton = publish && (_jsx(ToolbarButton, { icon: null, label: saveWord, part: "save", disabled: pending, onClick: view.onPublish, children: saveWord }));
21
+ if (only)
22
+ return only === "clear" ? clearButton : saveButton || null;
23
+ return (_jsxs("span", { "data-slot": "vk-toolbar-save", className: "inline-flex shrink-0 items-center gap-2", children: [clearButton, saveButton] }));
20
24
  }
21
- return (_jsxs("span", { "data-slot": "vk-toolbar-save", className: "inline-flex shrink-0 items-center gap-2", children: [drawPanelButton(views, {
22
- frame: "h-8 px-3",
23
- variant: "ghost",
24
- size: "sm",
25
- disabled: pending,
26
- onClick: clear,
27
- "data-slot": "vk-toolbar-clear",
28
- children: messages({ key: "views.panels.view-clear" }),
29
- }), publish &&
30
- drawPanelButton(views, {
31
- frame: "h-8 px-3",
32
- variant: "outline",
33
- size: "sm",
34
- disabled: pending,
35
- onClick: view.onPublish,
36
- "data-slot": "vk-toolbar-save-button",
37
- children: messages({ key: "views.panels.view-save" }),
38
- })] }));
25
+ const clearButton = drawPanelButton(views, {
26
+ frame: "h-8 px-3",
27
+ variant: "ghost",
28
+ size: "sm",
29
+ disabled: pending,
30
+ onClick: clear,
31
+ "data-slot": "vk-toolbar-clear",
32
+ children: messages({ key: "views.panels.view-clear" }),
33
+ });
34
+ const saveButton = publish &&
35
+ drawPanelButton(views, {
36
+ frame: "h-8 px-3",
37
+ variant: "outline",
38
+ size: "sm",
39
+ disabled: pending,
40
+ onClick: view.onPublish,
41
+ "data-slot": "vk-toolbar-save-button",
42
+ children: messages({ key: "views.panels.view-save" }),
43
+ });
44
+ if (only)
45
+ return only === "clear" ? clearButton : saveButton || null;
46
+ return (_jsxs("span", { "data-slot": "vk-toolbar-save", className: "inline-flex shrink-0 items-center gap-2", children: [clearButton, saveButton] }));
39
47
  }
@@ -43,7 +43,7 @@ export function ToolbarSearch({ value, onChange, placeholder, searching = false,
43
43
  setOpened(false);
44
44
  };
45
45
  if (!shown) {
46
- return (_jsx("div", { "data-slot": "vk-toolbar-search", className: "relative flex flex-none items-center", children: _jsx(ToolbarButton, { part: "search", icon: searching ? _jsx(LoadingRing, { label: busy, slot: "vk-toolbar-search-spinner", className: "h-4 w-4" }) : _jsx(Glass, { className: "h-4 w-4 shrink-0" }), label: name, word: slot.words === "both" ? undefined : null, onClick: () => {
46
+ return (_jsx("div", { "data-slot": "vk-toolbar-search", className: "relative flex flex-none items-center", children: _jsx(ToolbarButton, { part: "search", icon: searching ? _jsx(LoadingRing, { label: busy, slot: "vk-toolbar-search-spinner", className: "h-4 w-4" }) : _jsx(Glass, { className: "h-4 w-4 shrink-0" }), label: name, word: slot.words === "both" || slot.words === "word" ? undefined : null, onClick: () => {
47
47
  pressed.current = true;
48
48
  setOpened(true);
49
49
  } }) }));
@@ -29,8 +29,9 @@ export type ToolbarSlotState = {
29
29
  * part's chip, tabs, "+N" and "+", and Clear and Save draw through your `ToolbarButton`. */
30
30
  appFrame: boolean;
31
31
  /** Its words as it was placed (`ToolbarPlacement.words`, VK-967): `icon`, its icon alone; `both`, a part that is its icon
32
- * alone by default (the search, the quick filters' button) reads its word. Absent, its own. */
33
- words?: "both" | "icon";
32
+ * alone by default (the search, the quick filters' button) reads its word; `word`, its word alone, no icon, on every button
33
+ * of the part that has a word (VK-970). Absent, its own. */
34
+ words?: "both" | "icon" | "word";
34
35
  /** `false`: New stays on a phone's folding line instead of at the list's foot. */
35
36
  foot?: boolean;
36
37
  /** The key of the place it stands in (VK-984): a part whose button stands in more than one place (Sort's pill, a panel
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { useCallback, useLayoutEffect, useMemo, useRef, useState } from "react";
3
+ import { useCallback, useContext, useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { useViews } from "../../../provider/context.js";
5
5
  import { formatCount } from "../../../internal/count.js";
6
6
  import { drawPanelButton, PanelButton } from "../../panel-button.js";
@@ -10,6 +10,8 @@ import { PillGroup } from "./PillGroup.js";
10
10
  import { useAnchoredToggle } from "./use-anchored-toggle.js";
11
11
  import { ToolbarButton } from "../toolbar/ToolbarButton.js";
12
12
  import { useViewsRowInFrame } from "./in-frame.js";
13
+ import { MoreViews } from "./more-views.js";
14
+ import { cx } from "../../../internal/cx.js";
13
15
  import { ViewCreatePill } from "./ViewCreatePill.js";
14
16
  import { useNewView } from "./new-view.js";
15
17
  import { ViewPickerRow } from "./ViewPickerRow.js";
@@ -21,6 +23,7 @@ export function FoldingViewRow({ axis, folded: told }) {
21
23
  const [visible, setVisible] = useState(axis.options.length);
22
24
  const words = usePillWords(axis.hideCounts);
23
25
  const inFrame = useViewsRowInFrame();
26
+ const ownMore = useContext(MoreViews);
24
27
  const pills = useMemo(() => toPillOptions(axis.options, words), [axis.options, words]);
25
28
  const viewMenu = useMemo(() => (axis.verbs && views.components.ViewMenu ? { views: viewsListItemsOf(axis), value: axis.value, verbs: axis.verbs } : undefined), [axis, views.components.ViewMenu]);
26
29
  const newView = useNewView(axis);
@@ -93,19 +96,32 @@ export function FoldingViewRow({ axis, folded: told }) {
93
96
  const ordered = pills.filter(inBlock).map((pill) => (visibleValues.has(pill.value) ? dealt.shift() : pill.value));
94
97
  axis.onReorder(ordered);
95
98
  };
96
- return (_jsxs("div", { ref: hostRef, "data-slot": "vk-views-row", className: isTold ? "relative flex flex-none items-center gap-0.5" : "relative flex min-w-0 flex-1 items-center gap-0.5", children: [_jsx(PillGroup, { value: axis.value, options: shown, onChange: axis.onChange, variant: "plain", onReorder: axis.onReorder ? onPillReorder : undefined, canDrag: axis.canDrag, viewMenu: viewMenu }), folded.length > 0 && _jsx(FoldedViews, { axis: axis, options: foldedOptions, viewMenu: viewMenu }), newView.onCreate && _jsx(ViewCreatePill, { label: axis.createLabel, onClick: newView.onCreate }), newView.slot(hostRef), !isTold && (_jsx("div", { "aria-hidden": true, inert: true, className: "pointer-events-none absolute inset-0 overflow-hidden", style: { visibility: "hidden" }, children: _jsxs("div", { ref: measureRef, "data-slot": "vk-views-row", className: "pointer-events-none absolute left-0 top-0 flex items-center gap-0.5 whitespace-nowrap", children: [_jsx("div", { "data-measure-pills": true, className: "contents", children: _jsx(PillGroup, { value: axis.value, options: pills, onChange: () => { }, variant: "plain" }) }), inFrame ? (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: _jsx(MoreButton, { count: 99 }) })) : (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: drawPanelButton(views, {
97
- frame: MORE_CHIP_FRAME,
99
+ return (_jsxs("div", { ref: hostRef, "data-slot": "vk-views-row", className: isTold ? "relative flex flex-none items-center gap-0.5" : "relative flex min-w-0 flex-1 items-center gap-0.5", children: [_jsx(PillGroup, { value: axis.value, options: shown, onChange: axis.onChange, variant: "plain", onReorder: axis.onReorder ? onPillReorder : undefined, canDrag: axis.canDrag, viewMenu: viewMenu }), folded.length > 0 && _jsx(FoldedViews, { axis: axis, options: foldedOptions, viewMenu: viewMenu }), newView.onCreate && _jsx(ViewCreatePill, { label: axis.createLabel, onClick: newView.onCreate }), newView.slot(hostRef), !isTold && (_jsx("div", { "aria-hidden": true, inert: true, className: "pointer-events-none absolute inset-0 overflow-hidden", style: { visibility: "hidden" }, children: _jsxs("div", { ref: measureRef, "data-slot": "vk-views-row", className: "pointer-events-none absolute left-0 top-0 flex items-center gap-0.5 whitespace-nowrap", children: [_jsx("div", { "data-measure-pills": true, className: "contents", children: _jsx(PillGroup, { value: axis.value, options: pills, onChange: () => { }, variant: "plain" }) }), inFrame ? (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: _jsx(MoreButton, { count: 99 }) })) : (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: ownMore?.button ? (_jsx(ownMore.button, { ...ownMoreProps(views, 99, ownMore.className) })) : (drawPanelButton(views, {
100
+ frame: cx(MORE_CHIP_FRAME, ownMore?.className),
98
101
  variant: "ghost",
99
102
  size: "sm",
100
103
  "data-slot": "vk-views-more",
101
104
  children: moreChipInner(views, 99),
102
- }) })), axis.onCreate && (_jsx("span", { "data-measure-ghost": true, children: _jsx(ViewCreatePill, { label: axis.createLabel, onClick: () => { } }) }))] }) }))] }));
105
+ })) })), axis.onCreate && (_jsx("span", { "data-measure-ghost": true, children: _jsx(ViewCreatePill, { label: axis.createLabel, onClick: () => { } }) }))] }) }))] }));
103
106
  }
104
107
  const MORE_CHIP_FRAME = "h-8 shrink-0 gap-0.5 whitespace-nowrap px-2.5";
105
108
  function moreChipInner({ conventions, icons }, count) {
106
109
  const Chevron = icons.chevronDown;
107
110
  return (_jsxs(_Fragment, { children: ["+", formatCount(count, conventions), _jsx(Chevron, { className: "h-3.5 w-3.5 shrink-0 opacity-70" })] }));
108
111
  }
112
+ function ownMoreProps({ conventions, messages }, count, className) {
113
+ return {
114
+ part: "views-more",
115
+ icon: null,
116
+ word: null,
117
+ label: messages({ key: "views.panels.views-more", values: { count } }),
118
+ children: `+${formatCount(count, conventions)}`,
119
+ popup: "dialog",
120
+ open: false,
121
+ size: "sm",
122
+ ...(className && { className }),
123
+ };
124
+ }
109
125
  function MoreButton({ count, ref, open, onPointerDown, onClick, }) {
110
126
  const { conventions, messages } = useViews();
111
127
  return (_jsxs(ToolbarButton, { ref: ref, icon: null, label: messages({ key: "views.panels.views-more", values: { count } }), part: "views-more", popup: "dialog", open: Boolean(open), onPointerDown: onPointerDown, onClick: onClick, children: ["+", formatCount(count, conventions)] }));
@@ -117,13 +133,14 @@ function FoldedViews({ axis, options, viewMenu, }) {
117
133
  const anchor = useRef(null);
118
134
  const toggle = useAnchoredToggle(anchor);
119
135
  const inFrame = useViewsRowInFrame();
136
+ const ownMore = useContext(MoreViews);
120
137
  const holding = useRef(false);
121
138
  const onHold = useCallback((on) => {
122
139
  holding.current = on;
123
140
  }, []);
124
141
  const rowMenu = viewMenu && { ...viewMenu, onDone: toggle.close, onHold };
125
- return (_jsxs(_Fragment, { children: [inFrame ? (_jsx(MoreButton, { count: options.length, ref: anchor, open: toggle.open, onPointerDown: toggle.triggerProps.onPointerDown, onClick: toggle.triggerProps.onClick })) : (_jsx(PanelButton, { views: views, draw: {
126
- frame: MORE_CHIP_FRAME,
142
+ return (_jsxs(_Fragment, { children: [inFrame ? (_jsx(MoreButton, { count: options.length, ref: anchor, open: toggle.open, onPointerDown: toggle.triggerProps.onPointerDown, onClick: toggle.triggerProps.onClick })) : ownMore?.button ? (_jsx(ownMore.button, { ...ownMoreProps(views, options.length, ownMore.className), ref: anchor, open: toggle.open, onPointerDown: toggle.triggerProps.onPointerDown, onClick: toggle.triggerProps.onClick })) : (_jsx(PanelButton, { views: views, draw: {
143
+ frame: cx(MORE_CHIP_FRAME, ownMore?.className),
127
144
  variant: "ghost",
128
145
  size: "sm",
129
146
  ref: anchor,
@@ -135,7 +152,7 @@ function FoldedViews({ axis, options, viewMenu, }) {
135
152
  onPointerDown: toggle.triggerProps.onPointerDown,
136
153
  onClick: toggle.triggerProps.onClick,
137
154
  children: moreChipInner(views, options.length),
138
- } })), _jsx(Popover, { open: toggle.open, onOpenChange: toggle.onOpenChange, anchor: anchor, align: "start", sideOffset: 6, chrome: "menu", className: "w-64", onOutsidePress: () => (holding.current ? false : undefined), onEscape: () => (holding.current ? false : undefined), children: _jsx("div", { role: "listbox", "aria-label": messages({ key: "views.panels.views-more-list" }), className: VIEWS_LIST_CLASS, children: options.map((option) => (_jsx(ViewPickerRow, { option: option, active: option.value === axis.value, hideCounts: axis.hideCounts, viewMenu: rowMenu, onSelect: () => {
155
+ } })), _jsx(Popover, { open: toggle.open, onOpenChange: toggle.onOpenChange, anchor: anchor, align: "start", sideOffset: 6, chrome: "menu", className: "w-(--vk-panel-w,calc(var(--spacing)*64))", onOutsidePress: () => (holding.current ? false : undefined), onEscape: () => (holding.current ? false : undefined), children: _jsx("div", { role: "listbox", "aria-label": messages({ key: "views.panels.views-more-list" }), className: VIEWS_LIST_CLASS, children: options.map((option) => (_jsx(ViewPickerRow, { option: option, active: option.value === axis.value, hideCounts: axis.hideCounts, viewMenu: rowMenu, onSelect: () => {
139
156
  axis.onChange(option.value);
140
157
  toggle.close();
141
158
  } }, option.value))) }) })] }));
@@ -88,5 +88,5 @@ export function ViewPicker({ axis, className }) {
88
88
  close: { label: messages({ key: "views.panels.close" }), onPress: () => toggle.setOpen(false) },
89
89
  back: { label: messages({ key: "views.panels.back" }), onPress: step.back },
90
90
  },
91
- }), onSheetEscape: step.escapeBack, children: list })) : (_jsx(Popover, { open: toggle.open, onOpenChange: onOpenChange, anchor: anchor, align: "start", sideOffset: 6, chrome: "menu", className: "w-72", onOutsidePress: () => (holding.current ? false : undefined), onEscape: () => (holding.current ? false : undefined), children: list }))] }));
91
+ }), onSheetEscape: step.escapeBack, children: list })) : (_jsx(Popover, { open: toggle.open, onOpenChange: onOpenChange, anchor: anchor, align: "start", sideOffset: 6, chrome: "menu", className: "w-(--vk-panel-w,calc(var(--spacing)*72))", onOutsidePress: () => (holding.current ? false : undefined), onEscape: () => (holding.current ? false : undefined), children: list }))] }));
92
92
  }
@@ -0,0 +1,2 @@
1
+ import type { ToolbarMoreViews } from "../toolbar/Toolbar.js";
2
+ export declare const MoreViews: import("react").Context<ToolbarMoreViews | null>;
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import { createContext } from "react";
3
+ export const MoreViews = createContext(null);
@@ -27,7 +27,7 @@ export { ViewOptionsActions } from "./react/view-actions.js";
27
27
  export { ViewOptionsPopoverPanel, keepPanelOpenForPortals, useViewActivePanel, useViewOptionsPopover, viewOptionsPopoverClassName, } from "./react/popover.js";
28
28
  export type { ViewOptionsPopoverState } from "./react/popover.js";
29
29
  export { Toolbar, ToolbarSeparator } from "./react/toolbar/Toolbar.js";
30
- export type { ToolbarMore, ToolbarOverflow, ToolbarPart } from "./react/toolbar/Toolbar.js";
30
+ export type { ToolbarMore, ToolbarMoreViews, ToolbarOverflow, ToolbarPart } from "./react/toolbar/Toolbar.js";
31
31
  export { ToolbarButton } from "./react/toolbar/ToolbarButton.js";
32
32
  export { useToolbarPanel, useToolbarSlot } from "./react/toolbar/context.js";
33
33
  export { ToolbarRadioProvider, ToolbarSlotProvider } from "./react/toolbar/context.js";
@@ -17,8 +17,8 @@ export type ToolbarPlacement = {
17
17
  /** In the fold arrangement, it may fold into ⋯ when its line still has no room. */
18
18
  fold?: boolean;
19
19
  /** Its words, for a part whose button has a word (VK-967): `both`, as the look's words say (icon and word where they show);
20
- * `icon`, its icon alone whatever the look. Absent, the part's own. */
21
- words?: "both" | "icon";
20
+ * `icon`, its icon alone whatever the look; `word`, its word alone, no icon (VK-970). Absent, the part's own. */
21
+ words?: "both" | "icon" | "word";
22
22
  /** On a phone's folding line New stands at the list's foot, unless `false` keeps it on the line (VK-967). */
23
23
  foot?: boolean;
24
24
  };
@@ -150,7 +150,7 @@ export type ViewsMenuItem = {
150
150
  * disables every row under it: the provider hands the app's `Menu` those rows already `disabled`. */
151
151
  children?: ViewsMenuItem[];
152
152
  /** A group (`children`) that opens its rows beside the menu, one level in, rather than in place: its row
153
- * shows its label and `detail` and opens on a hover, a press or →. A hint: an adapter with no flyouts
153
+ * shows its label and `detail` and opens on a hover or →. A hint: an adapter with no flyouts
154
154
  * draws the group in place under its label, as every group is drawn. Ignored on a row with no `children`. */
155
155
  beside?: boolean;
156
156
  /** A checkable row (`checked` set) that leaves the menu open when picked, so several can be ticked in
@@ -476,7 +476,7 @@ type ViewsPartsBodyCommon = {
476
476
  /** The field's name: the body's accessible name, a sheet's title. */
477
477
  label: string;
478
478
  /** The edit is finished: the editor closes and saves what was handed. With no argument it closes as Enter does
479
- * (the grid moves one row down); `"pick"` closes as a pick (a band picked), which moves nowhere. */
479
+ * (the grid writes and keeps the cell); `"pick"` closes as a pick (a band picked), the same. */
480
480
  onDone: (how?: "pick") => void;
481
481
  /** It may be emptied: every box cleared is a clear. */
482
482
  empty: boolean;
@@ -579,7 +579,7 @@ export type ViewsValuesBodyProps = {
579
579
  value: readonly ViewsValueLine[];
580
580
  /** Every change as it is made, the whole list each time. A line handed as it was drawn keeps what is stored. */
581
581
  onValueChange: (value: readonly ViewsValueLine[]) => void;
582
- /** The edit is finished: the editor closes as Enter does (the grid moves one row down) and saves what was handed. */
582
+ /** The edit is finished: the editor closes as Enter does (the grid writes and keeps the cell) and saves what was handed. */
583
583
  onDone: () => void;
584
584
  /** Why a value would be refused, in the app's words, or null when it reads: check each value as it is added or changed. */
585
585
  check: (value: string) => string | null;
@@ -617,7 +617,7 @@ export type ViewsTextBodyProps = {
617
617
  value: string;
618
618
  /** Every change as it is made, the whole text each time. */
619
619
  onValueChange: (value: string) => void;
620
- /** The edit is finished: the editor closes as Enter does (the grid moves one row down) and saves what was handed. */
620
+ /** The edit is finished: the editor closes as Enter does (the grid writes and keeps the cell) and saves what was handed. */
621
621
  onDone: () => void;
622
622
  /** Why a value would be refused, in the app's words, or null when it reads. The editor checks again at the close. */
623
623
  check: (value: string) => string | null;
@@ -657,7 +657,7 @@ export type ViewsNumberBodyProps = {
657
657
  /** Every change as it is made: the number, null when emptied, `NaN` for text that reads as no number (a close on it
658
658
  * changes nothing); and the unit when it is one of `units`. */
659
659
  onValueChange: (value: number | null, unit?: string) => void;
660
- /** The edit is finished: the editor closes as Enter does (the grid moves one row down) and saves what was handed. */
660
+ /** The edit is finished: the editor closes as Enter does (the grid writes and keeps the cell) and saves what was handed. */
661
661
  onDone: () => void;
662
662
  /** Why a value would be refused, in the app's words, or null when it reads. The editor checks again at the close. */
663
663
  check: (value: number | null, unit?: string) => string | null;
@@ -1710,7 +1710,7 @@ export type ViewsComponents = {
1710
1710
  Checkbox: ComponentType<ViewsCheckboxProps>;
1711
1711
  Menu: ComponentType<ViewsMenuProps>;
1712
1712
  /** @deprecated Read by nothing: the grid's menus are your `Menu` and every list an editor opens is your `Picker`.
1713
- * Leave it out; it goes at a later minor. */
1713
+ * Leave it out; it goes in a later release that breaks something anyway. */
1714
1714
  Command?: ViewsCommandParts;
1715
1715
  /** Optional: the filter's month draws through it (the date editor opens `DateBody`). Reached without one, it throws
1716
1716
  * an error naming it. */
@@ -5,7 +5,8 @@ export { DEFAULT_DESKTOP_QUERY } from "../internal/phone-line.js";
5
5
  * The package's own: no entry point exports it. */
6
6
  export declare function isDesktopNow(query: string): boolean;
7
7
  /** Whether the screen is a desktop, by the provider's `desktopQuery`: true where there is no
8
- * `matchMedia`. It follows the query's changes. The package's own: no entry point exports it. */
8
+ * `matchMedia`; inside a `ScreenForms` twin while the page comes alive, the screen it is told. It follows the query's
9
+ * changes. The package's own: no entry point exports it. */
9
10
  export declare function useDesktop(): boolean;
10
11
  /** Whether `query` matches the screen, following its changes. `fallback` is the answer where the screen
11
12
  * can't be asked (a server render, no `matchMedia`). The package's own: no entry point exports it. */
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- import { useCallback, useSyncExternalStore } from "react";
2
+ import { useCallback, useContext, useSyncExternalStore } from "react";
3
+ import { ScreenTold } from "../internal/screen-forms.js";
3
4
  import { useViews } from "./context.js";
4
5
  export { DEFAULT_DESKTOP_QUERY } from "../internal/phone-line.js";
5
6
  function canAsk() {
@@ -10,7 +11,9 @@ export function isDesktopNow(query) {
10
11
  }
11
12
  export function useDesktop() {
12
13
  const { desktopQuery } = useViews();
13
- return useMediaQuery(desktopQuery, true);
14
+ const told = useContext(ScreenTold);
15
+ const desktop = useMediaQuery(desktopQuery, true);
16
+ return told ? told === "computer" : desktop;
14
17
  }
15
18
  export function useMediaQuery(query, fallback) {
16
19
  const subscribe = useCallback((onChange) => {