@mistriwork/kit 1.0.0-rc.58 → 1.0.0-rc.60

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 (164) hide show
  1. package/dist/client/app.js +16 -3
  2. package/dist/client/audience.d.ts +1 -0
  3. package/dist/client/audience.js +10 -0
  4. package/dist/client/brandLook.css +49 -1
  5. package/dist/client/components/AppColumnMenuPopups.js +46 -11
  6. package/dist/client/components/AppList.d.ts +3 -1
  7. package/dist/client/components/AppList.js +92 -19
  8. package/dist/client/components/CardsList.js +14 -1
  9. package/dist/client/components/Chart.css +4 -0
  10. package/dist/client/components/Chart.d.ts +4 -4
  11. package/dist/client/components/Chart.js +30 -9
  12. package/dist/client/components/Content.js +4 -2
  13. package/dist/client/components/DateField.css +1 -1
  14. package/dist/client/components/DateField.js +1 -0
  15. package/dist/client/components/DefinedFields.js +2 -2
  16. package/dist/client/components/Diagram.css +82 -0
  17. package/dist/client/components/Diagram.d.ts +1 -0
  18. package/dist/client/components/Diagram.js +1 -0
  19. package/dist/client/components/Dressed.js +1 -1
  20. package/dist/client/components/Editable.js +7 -3
  21. package/dist/client/components/Export.js +1 -1
  22. package/dist/client/components/FilterBoxes.js +2 -2
  23. package/dist/client/components/FilterRail.css +1 -1
  24. package/dist/client/components/FilterRail.js +6 -4
  25. package/dist/client/components/Gallery.css +171 -0
  26. package/dist/client/components/Gallery.d.ts +1 -0
  27. package/dist/client/components/Gallery.js +1 -0
  28. package/dist/client/components/Grid.d.ts +2 -1
  29. package/dist/client/components/Grid.js +78 -24
  30. package/dist/client/components/GridCellEditor.js +4 -2
  31. package/dist/client/components/GridSelection.d.ts +4 -7
  32. package/dist/client/components/GridSelection.js +45 -3
  33. package/dist/client/components/LandingSurface.css +2 -2
  34. package/dist/client/components/LayoutBuilder.css +225 -0
  35. package/dist/client/components/LayoutBuilder.d.ts +1 -0
  36. package/dist/client/components/LayoutBuilder.js +1 -0
  37. package/dist/client/components/ListColumns.d.ts +12 -0
  38. package/dist/client/components/ListColumns.js +61 -0
  39. package/dist/client/components/ListFilterBar.css +43 -16
  40. package/dist/client/components/ListFilterBar.js +45 -23
  41. package/dist/client/components/MultiStepForm.css +22 -22
  42. package/dist/client/components/NewRecord.js +120 -104
  43. package/dist/client/components/Notes.css +9 -0
  44. package/dist/client/components/Notes.d.ts +6 -2
  45. package/dist/client/components/Notes.js +10 -6
  46. package/dist/client/components/OverflowMenu.js +16 -11
  47. package/dist/client/components/PageFields.js +19 -4
  48. package/dist/client/components/PageRelated.d.ts +8 -1
  49. package/dist/client/components/PageRelated.js +46 -33
  50. package/dist/client/components/PageSections.js +18 -5
  51. package/dist/client/components/Palette.js +1 -1
  52. package/dist/client/components/Prefs.d.ts +10 -0
  53. package/dist/client/components/Prefs.js +33 -23
  54. package/dist/client/components/PresentationSwitch.js +4 -0
  55. package/dist/client/components/Prompt.js +4 -4
  56. package/dist/client/components/RecordGone.js +4 -4
  57. package/dist/client/components/RecordPicker.js +24 -6
  58. package/dist/client/components/RecordSummaries.js +31 -5
  59. package/dist/client/components/RecordTrailNav.js +4 -0
  60. package/dist/client/components/RichTextEditor.css +2 -2
  61. package/dist/client/components/RichTextEditor.js +18 -19
  62. package/dist/client/components/Rooms.js +27 -6
  63. package/dist/client/components/SectionPeriod.css +1 -1
  64. package/dist/client/components/SetFieldDialog.js +1 -1
  65. package/dist/client/components/Sidebar.js +15 -5
  66. package/dist/client/components/SuggestBox.js +2 -2
  67. package/dist/client/components/TableRoom.d.ts +5 -1
  68. package/dist/client/components/TableRoom.js +29 -10
  69. package/dist/client/components/TableView.js +6 -2
  70. package/dist/client/components/ThMenu.js +26 -15
  71. package/dist/client/components/Tour.css +96 -0
  72. package/dist/client/components/Tour.d.ts +1 -0
  73. package/dist/client/components/Tour.js +1 -0
  74. package/dist/client/components/TreePicker.css +1 -1
  75. package/dist/client/components/TreePicker.js +27 -20
  76. package/dist/client/components/Value.js +4 -1
  77. package/dist/client/components/WorkflowStatus.js +8 -4
  78. package/dist/client/components/appListModel.d.ts +4 -0
  79. package/dist/client/components/appRooms.d.ts +2 -0
  80. package/dist/client/components/appRooms.js +2 -0
  81. package/dist/client/components/boardNew.d.ts +5 -0
  82. package/dist/client/components/boardNew.js +5 -0
  83. package/dist/client/components/conditionWords.d.ts +10 -0
  84. package/dist/client/components/conditionWords.js +20 -0
  85. package/dist/client/components/dashboardModel.d.ts +8 -0
  86. package/dist/client/components/dashboardModel.js +28 -1
  87. package/dist/client/components/editInteraction.d.ts +1 -1
  88. package/dist/client/components/editInteraction.js +1 -1
  89. package/dist/client/components/gridSizing.d.ts +14 -20
  90. package/dist/client/components/gridSizing.js +147 -108
  91. package/dist/client/components/pageContext.d.ts +3 -2
  92. package/dist/client/components/pageModel.d.ts +2 -0
  93. package/dist/client/components/pickerStaleness.d.ts +11 -1
  94. package/dist/client/components/pickerStaleness.js +12 -2
  95. package/dist/client/components/rowTitle.d.ts +2 -0
  96. package/dist/client/components/rowTitle.js +10 -0
  97. package/dist/client/components/textMeasure.js +72 -3
  98. package/dist/client/components/useConditionWords.d.ts +5 -0
  99. package/dist/client/components/useConditionWords.js +3 -1
  100. package/dist/client/components/useGridKeyboard.js +5 -0
  101. package/dist/client/components/useMediaQuery.d.ts +2 -0
  102. package/dist/client/components/useMediaQuery.js +2 -0
  103. package/dist/client/components/valueModel.d.ts +1 -0
  104. package/dist/client/components/valueModel.js +39 -4
  105. package/dist/client/composer.css +2 -2
  106. package/dist/client/copy/es.js +3 -3
  107. package/dist/client/copy/filters/components/ListFilterBar.d.ts +1 -0
  108. package/dist/client/copy/filters/components/ListFilterBar.js +1 -0
  109. package/dist/client/copy/forms/components/DateField.d.ts +2 -0
  110. package/dist/client/copy/forms/components/DateField.js +2 -0
  111. package/dist/client/copy/forms/components/NewRecord.d.ts +8 -0
  112. package/dist/client/copy/forms/components/NewRecord.js +2 -0
  113. package/dist/client/copy/lists/components/AppList.d.ts +2 -0
  114. package/dist/client/copy/lists/components/AppList.js +2 -0
  115. package/dist/client/copy/lists/components/GridSelection.d.ts +1 -0
  116. package/dist/client/copy/lists/components/GridSelection.js +1 -0
  117. package/dist/client/copy/lists/components/ListColumns.d.ts +5 -0
  118. package/dist/client/copy/lists/components/ListColumns.js +7 -0
  119. package/dist/client/copy/lists/components/TableRoom.d.ts +3 -1
  120. package/dist/client/copy/lists/components/TableRoom.js +3 -1
  121. package/dist/client/copy/record/components/PageHistory.d.ts +2 -2
  122. package/dist/client/copy/record/components/PageHistory.js +4 -2
  123. package/dist/client/copy/record/components/WorkflowStatus.d.ts +1 -0
  124. package/dist/client/copy/record/components/WorkflowStatus.js +1 -0
  125. package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +1 -0
  126. package/dist/client/copy/shell/components/MobileNavDrawer.js +2 -0
  127. package/dist/client/core.d.ts +2 -1
  128. package/dist/client/core.js +46 -2
  129. package/dist/client/customThemes.css +3 -3
  130. package/dist/client/dom.js +5 -5
  131. package/dist/client/features.css +220 -356
  132. package/dist/client/fonts/Manrope-OFL.txt +93 -0
  133. package/dist/client/fonts/faces.css +10 -1
  134. package/dist/client/fonts/manrope-latin.woff2 +0 -0
  135. package/dist/client/formControls.css +4 -4
  136. package/dist/client/help.css +2 -2
  137. package/dist/client/ledgerLook.css +28 -0
  138. package/dist/client/locale.d.ts +2 -10
  139. package/dist/client/locale.js +0 -0
  140. package/dist/client/lumenLook.css +295 -105
  141. package/dist/client/manropeFace.css +32 -0
  142. package/dist/client/messages.d.ts +3 -3
  143. package/dist/client/messages.js +3 -3
  144. package/dist/client/navigationHold.d.ts +9 -0
  145. package/dist/client/navigationHold.js +46 -3
  146. package/dist/client/page.css +107 -357
  147. package/dist/client/palette.js +31 -6
  148. package/dist/client/partsLook.css +60 -60
  149. package/dist/client/sageLook.css +101 -32
  150. package/dist/client/shellHost.d.ts +2 -2
  151. package/dist/client/shellHost.js +2 -2
  152. package/dist/client/shellMode.d.ts +9 -0
  153. package/dist/client/shellMode.js +2 -0
  154. package/dist/client/structure.css +282 -201
  155. package/dist/client/style.css +75 -224
  156. package/dist/client/themeFamilies.css +471 -66
  157. package/dist/client/tilesLook.css +502 -0
  158. package/dist/client/visualTheme.js +5 -2
  159. package/dist/client/visualThemes.css +38 -34
  160. package/dist/client/workbenchLook.css +12 -12
  161. package/dist/client/workshopLook.css +3 -8
  162. package/dist/vite.d.ts +1 -20
  163. package/dist/vite.js +33 -3
  164. package/package.json +8 -7
@@ -25,7 +25,7 @@ import { viewLink } from './components/viewLink.js';
25
25
  import { Sidebar, moveSidebar, openSidebarChoice } from './components/Sidebar.js';
26
26
  import { setSidebarFilter } from './components/sidebarModel.js';
27
27
  import { $, allowMutationExit, api, backTo, connectionChanged, currentEntry, el, findTable, go, invalidateNavigation, pageView, render, setPaintHold, state, toast, } from './core.js';
28
- import { afterPaint, beforePaint, installNavigationHold } from './navigationHold.js';
28
+ import { afterPaint, beforePaint, installNavigationHold, yieldsFirst } from './navigationHold.js';
29
29
  import { setStartupProbe } from './startupHold.js';
30
30
  import { initWriteMode, prepareEditingExit } from './write.js';
31
31
  import { bootstrapRequestIdentity, initConnections, refreshConnections, syncConnectionControls } from './connectionList.js';
@@ -42,7 +42,8 @@ import { onDemand } from './components/onDemand.js';
42
42
  import { forgetPages, pagesFor, prefetchPages, recordPageId, whenPagesChange } from './page.js';
43
43
  import { listenForRecordPresses, prefetchRecordPage } from './recordPress.js';
44
44
  import { installShell, shell } from './shellMode.js';
45
- import { onLanguagePicked, subscribeMessages } from './messages.js';
45
+ import { message, onLanguagePicked, subscribeMessages } from './messages.js';
46
+ import { SETTINGS_PAGE } from './components/appRooms.js';
46
47
  import { applyDensity } from './density.js';
47
48
  import { applyTypography } from './typography.js';
48
49
  import { openPrefs } from './prefs.js';
@@ -302,7 +303,18 @@ function applyBrand() {
302
303
  label: () => say('preferences'),
303
304
  category: () => say('preferences.title'),
304
305
  detail: () => say('appearanceAndListSettings'),
305
- onSelect: openPrefs,
306
+ /* In an App the preferences are a section of its settings page (the App framework's SettingsRoom.tsx), which
307
+ has an address and room for the profile beside them. Where there is no such room, the Workbench and the
308
+ database browser, they stay the dialog; and for a signed-out visitor too, who has no settings to keep and
309
+ whose storefront page should stay under the choice being made. */
310
+ onSelect: () => {
311
+ if (!shell().inApp() || !shell().rooms.Settings || shell().publicVisitor())
312
+ return openPrefs();
313
+ const here = currentEntry();
314
+ if (here?.kind === 'page' && here.pageId === SETTINGS_PAGE)
315
+ return;
316
+ go({ ...pageView(SETTINGS_PAGE, undefined, undefined, message('common.settings')), tab: 'preferences' }, 'push');
317
+ },
306
318
  },
307
319
  ]);
308
320
  }
@@ -703,6 +715,7 @@ export async function boot(me, landingAt, installed) {
703
715
  setPaintHold({
704
716
  before: (roomChanged) => beforePaint(roomChanged, currentEntry(), state.stack.length),
705
717
  after: () => afterPaint(currentEntry(), state.stack.length),
718
+ yields: () => yieldsFirst(currentEntry()),
706
719
  });
707
720
  /* A press on a record begins reading its page, so the hold is short (recordCompose.ts). */
708
721
  listenForRecordPresses();
@@ -0,0 +1 @@
1
+ export declare function personFacing(): boolean;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Whether the screen is drawn for the App's own public: a signed-out visitor, or a reader whose every role says
3
+ * `portal: true` (the server decides, appAudience.ts, and says it as `viewerAudience`). Such a reader came for their
4
+ * own things, so the parts that are the office's tools ask this before they draw: the global search, a list's
5
+ * view switch and column chooser, a record's pager, the look picker. One question, asked in one place each.
6
+ */
7
+ import { shell } from './shellMode.js';
8
+ export function personFacing() {
9
+ return shell().app()?.viewerAudience === 'person';
10
+ }
@@ -7,6 +7,10 @@
7
7
  lookSheetReady). They stand in `look` as every look's rules do; the rules
8
8
  all the looks share stay in themeFamilies.css. */
9
9
  @layer look {
10
+ /* A dark bar is the look's one hard edge: the pane's bar is ruled in the ink under it (structure.css). */
11
+ :root[data-look-bar='dark'] {
12
+ --pane-rule: 2px solid var(--ink);
13
+ }
10
14
  /* A bar in the navigation's colour, with light text, the brand in the bar's ink. */
11
15
  :root[data-look-bar='dark'] .topbar {
12
16
  background: var(--nav-ground);
@@ -32,6 +36,12 @@
32
36
  border-color: var(--nav-line);
33
37
  color: var(--nav-ink);
34
38
  box-shadow: none;
39
+ /* As tall as the search beside them: a key padded as the page's buttons are stood 6px over the box it is drawn
40
+ like, on a bar with 4px to spare. */
41
+ padding-block: var(--space-2);
42
+ }
43
+ :root[data-look-bar='dark'] .app-mode .topbar :is(.new-menu, .tenant-control-host) {
44
+ align-self: center;
35
45
  }
36
46
  :root[data-look-bar='dark'] .app-mode .topbar :is(.new-menu-trigger, .tenant-control-trigger):hover {
37
47
  background: color-mix(in srgb, var(--nav-ink) 14%, transparent);
@@ -70,8 +80,46 @@
70
80
  border-top: 2px solid var(--ink);
71
81
  border-radius: 0;
72
82
  box-shadow: none;
83
+ /* Open under its rule: the words start where the rule does, as a printed figure's do, and a label has the
84
+ card's whole width before it wraps and sets its figure a line under its neighbours'. */
85
+ padding-inline: 0;
73
86
  }
74
- :root[data-look-table='tinted'] tbody tr:hover td {
87
+ /* `plain`: a figure open on the page with no box and no rule, the gap alone between it and the next. */
88
+ :root[data-look-stat='plain'] .dash-strip .home-card:nth-child(n) {
89
+ background: transparent;
90
+ border: 0;
91
+ border-radius: 0;
92
+ box-shadow: none;
93
+ padding-inline: 0;
94
+ }
95
+ /* A record's summary is the record's own row of figures: set as the dashboard's are, a size down, each under a
96
+ hairline (lumenLook.css does the same for `divided`). Prose in a summary is a paragraph, never a figure. */
97
+ :root[data-look-stat='ruled'] .page-field-summary .page-field {
98
+ padding-top: var(--space-3);
99
+ border-top: 1px solid var(--line-strong);
100
+ }
101
+ :root:is([data-look-stat='ruled'], [data-look-stat='plain']) .page-field-summary .page-field:not(.page-field-prose) > dd {
102
+ font-family: var(--type-figure-font, inherit);
103
+ font-size: var(--text-xl);
104
+ font-weight: var(--type-figure-weight, 600);
105
+ letter-spacing: var(--type-figure-tracking, -0.012em);
106
+ line-height: 1.2;
107
+ }
108
+ /* Open on the page there is no box to fit: the record's figures are set at the figure's own size. */
109
+ :root[data-look-stat='plain'] .page-field-summary .page-field:not(.page-field-prose) > dd {
110
+ font-size: var(--type-figure-size, var(--text-xl));
111
+ }
112
+ /* A figure with a tone is a word in a colour, on the line its neighbours stand on: as a centred inline box it sat
113
+ a pixel and a half under an untoned figure beside it. */
114
+ :root:is([data-look-stat='ruled'], [data-look-stat='plain']) .page-field-summary .page-field > dd > .tone-figure {
115
+ display: inline;
116
+ vertical-align: baseline;
117
+ }
118
+ /* An amount is set in the figures' face wherever a record says one (themeFamilies.css); here it is the figure. */
119
+ :root:root:is([data-look-stat='ruled'], [data-look-stat='plain']) .app-mode .page-field-summary .page-field > dd :is(.num-value, .date-value) {
120
+ font-family: inherit;
121
+ }
122
+ :root[data-look-table='tinted'] tbody tr:hover td:where(:not([data-slot])) {
75
123
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
76
124
  }
77
125
  :root[data-look-table='tinted'] .row-host .row-select {
@@ -8,10 +8,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
8
8
  * is hovered, focused or opened, and a list's first page carries only the
9
9
  * buttons.
10
10
  */
11
- import { Fragment, useRef } from 'react';
12
- import { Menu } from '@base-ui/react/menu';
13
- import { Popover } from '@base-ui/react/popover';
14
- import { layoutViewport, zoomAnchor } from '@mistriwork/ui/internal/anchor.js';
11
+ import { Fragment, useEffect, useRef, useState } from 'react';
12
+ import { createMenuController, Menu, MenuContent, MenuItem, MenuSeparator } from '@ui-sdk/react/menu';
13
+ import { createPopoverController, Popover, PopoverContent } from '@ui-sdk/react/popover';
15
14
  import { columnDisplay, findTable, labelColumn } from '../core.js';
16
15
  import { nextSort, sortDirection } from '../clauses.js';
17
16
  import { mentionsColumn, ownedTails, withCondition } from '../filterbar.js';
@@ -22,11 +21,37 @@ import { appMenuEntries, sortWords } from './appColumnMenuModel.js';
22
21
  import { facetActive } from './filterRailModel.js';
23
22
  import { useConditionWords } from './useConditionWords.js';
24
23
  import { say as sayCopy } from '../copy/columnMenu/components/AppColumnMenuPopups.js';
25
- import { popupContainer } from '../shellHost.js';
24
+ import { popupContainer, portalRoot } from '../shellHost.js';
25
+ /* Where the menu and the filter are drawn: out of the table, by name. UI SDK draws a layer where its trigger is
26
+ unless it is told where, and the ⌄ is in a column's head: a form drawn there is a form inside whatever the grid
27
+ stands in, and every key pressed in the layer went up through the table. The dialog the grid is in keeps the
28
+ layer, so it stays inside that dialog's focus. */
29
+ const layerHost = (trigger) => trigger?.closest('dialog, [role="dialog"]') ?? popupContainer() ?? portalRoot();
26
30
  /* How a flag's two values read where no display rule words them. */
27
31
  const FLAG_WORDS = { true: sayCopy('common.yes'), false: sayCopy('common.no') };
28
32
  export function AppColumnMenuPopups({ host, button, open, setOpen, handBack, name, label, kind, meta, sortable, current, columns, drawnBy, }) {
29
33
  const popup = useRef(null);
34
+ /* Neither layer has a trigger of its own (the ⌄ is AppColumnMenu's, which holds the open state), so each is
35
+ opened and closed through a controller: a layer that is simply drawn open is given no focus, and these are
36
+ asked for by a press, so the keyboard has to arrive in them. */
37
+ const [menu] = useState(() => createMenuController());
38
+ const [filter] = useState(() => createPopoverController());
39
+ useEffect(() => {
40
+ if (open === 'menu')
41
+ void menu.open({ anchor: button.current ?? undefined, focus: 'popup' });
42
+ else
43
+ menu.close();
44
+ if (open === 'filter')
45
+ void filter.open({ anchor: button.current ?? undefined });
46
+ else
47
+ filter.close();
48
+ }, [open, menu, filter, button]);
49
+ /* The keyboard goes back to the ⌄, unless what was chosen takes it on (the popover, the rail's facet). Said
50
+ here and not left to the menu: choosing an entry takes this whole part off the page, menu and all. */
51
+ const giveBack = () => {
52
+ if (handBack.current && button.current?.isConnected)
53
+ button.current.focus();
54
+ };
30
55
  /* The column's own conditions, said as its chip says them, beside Clear filter. */
31
56
  const tails = host.current ? ownedTails(host.current.refinement, name) : [];
32
57
  const { speaker, sayTails } = useConditionWords(host.current?.table, tails.map((tail) => `${name} ${tail}`));
@@ -75,6 +100,7 @@ export function AppColumnMenuPopups({ host, button, open, setOpen, handBack, nam
75
100
  return;
76
101
  }
77
102
  setOpen(null);
103
+ giveBack();
78
104
  if ((key === 'asc' || key === 'desc') && sortPath)
79
105
  h.navigate(nextSort(h.query, sortPath, key), name);
80
106
  else if (key === 'clear')
@@ -82,11 +108,20 @@ export function AppColumnMenuPopups({ host, button, open, setOpen, handBack, nam
82
108
  else if (key === 'pin')
83
109
  togglePin(h.table, columns, name, h.listKey);
84
110
  };
85
- return (_jsxs(_Fragment, { children: [_jsx(Menu.Root, { open: open === 'menu', onOpenChange: (next) => {
86
- if (!next)
87
- setOpen((was) => (was === 'menu' ? null : was));
88
- }, children: _jsx(Menu.Portal, { container: popupContainer(), children: _jsx(Menu.Positioner, { anchor: () => (button.current ? zoomAnchor(button.current) : null), positionMethod: "fixed", side: "bottom", align: "start", sideOffset: 4, collisionBoundary: layoutViewport(), collisionPadding: 12, style: { zIndex: 40 }, children: _jsx(Menu.Popup, { className: "th-menu th-menu-app", "aria-label": sayCopy('labelColumn', { label }), finalFocus: () => (handBack.current && button.current?.isConnected ? button.current : false), children: entries.map((entry, i) => (_jsxs(Fragment, { children: [entry.key === 'pin' && i > 0 ? _jsx(Menu.Separator, { className: "th-menu-sep" }) : null, _jsxs(Menu.Item, { render: _jsx("button", { type: "button", className: `th-menu-item${entry.key === 'pin' ? ' th-menu-quiet' : ''}` }), nativeButton: true, closeOnClick: false, onClick: () => choose(entry.key), "aria-label": entry.detail ? `${entry.label}: ${entry.detail}` : undefined, children: [_jsx("span", { className: "th-menu-label", children: entry.label }), entry.detail ? _jsx("span", { className: "th-menu-said", children: entry.detail }) : null] })] }, entry.key))) }) }) }) }), box && open === 'filter' && (_jsx(Popover.Root, { open: true, onOpenChange: (next) => {
111
+ return (_jsxs(_Fragment, { children: [_jsx(Menu, { controller: menu, onOpenChange: (next, details) => {
112
+ if (next)
113
+ return;
114
+ setOpen((was) => (was === 'menu' ? null : was));
115
+ /* Escape is a step back to where the reader was; a press elsewhere has already said where it is going. */
116
+ if (details.reason === 'escape-key')
117
+ giveBack();
118
+ }, children: _jsx(MenuContent, { className: "th-menu th-menu-app", "aria-label": sayCopy('labelColumn', { label }), anchor: button.current, side: "bottom", align: "start", sideOffset: 4, collisionPadding: 12, container: layerHost(button.current), finalFocus: () => (handBack.current && button.current?.isConnected ? button.current : null), children: entries.map((entry, i) => (_jsxs(Fragment, { children: [entry.key === 'pin' && i > 0 ? _jsx(MenuSeparator, { className: "th-menu-sep" }) : null, _jsxs(MenuItem, { render: _jsx("button", { type: "button" }), className: `th-menu-item${entry.key === 'pin' ? ' th-menu-quiet' : ''}`, closeOnSelect: false, onSelect: () => choose(entry.key), "aria-label": entry.detail ? `${entry.label}: ${entry.detail}` : undefined, children: [_jsx("span", { className: "th-menu-label", children: entry.label }), entry.detail ? _jsx("span", { className: "th-menu-said", children: entry.detail }) : null] })] }, entry.key))) }) }), _jsx(Popover, { controller: filter, onOpenChange: (next) => {
89
119
  if (!next)
90
- setOpen(null);
91
- }, children: _jsx(Popover.Portal, { container: popupContainer(), children: _jsx(Popover.Positioner, { anchor: () => (button.current ? zoomAnchor(button.current) : null), positionMethod: "fixed", side: "bottom", align: "start", sideOffset: 6, collisionBoundary: layoutViewport(), collisionPadding: 8, style: { zIndex: 40 }, children: _jsx(Popover.Popup, { ref: popup, className: "filter-pop", "aria-label": sayCopy('filterBy', { label }), initialFocus: () => popup.current?.querySelector('input:not([type="hidden"]):not([aria-hidden="true"])') ?? popup.current ?? true, finalFocus: () => (button.current?.isConnected ? button.current : false), children: _jsx(h.Picker, { box: box, table: h.table, refinement: h.refinement, standing: h.standing, unit: h.unitOf(name), owned: mentionsColumn(h.tabQuery, name), apply: (text) => h.apply(text, name), close: () => setOpen(null) }) }) }) }) }))] }));
120
+ setOpen((was) => (was === 'filter' ? null : was));
121
+ }, children: box && (_jsx(PopoverContent, { ref: popup, className: "filter-pop", "aria-label": sayCopy('filterBy', { label }), anchor: button.current, side: "bottom", align: "start", sideOffset: 6, collisionPadding: 8, container: layerHost(button.current), initialFocus: () => popup.current?.querySelector('input:not([type="hidden"]):not([aria-hidden="true"])') ?? popup.current, finalFocus: () => (button.current?.isConnected ? button.current : null), children: _jsx(h.Picker, { box: box, table: h.table, refinement: h.refinement, standing: h.standing, unit: h.unitOf(name), owned: mentionsColumn(h.tabQuery, name),
122
+ /* Closed as it applies, as a sort from the menu is: a refinement keeps the room, and the header with it. */
123
+ apply: (text) => {
124
+ setOpen(null);
125
+ h.apply(text, name);
126
+ }, close: () => setOpen(null) }) })) })] }));
92
127
  }
@@ -15,6 +15,8 @@ interface AppListProps {
15
15
  inDashboard?: boolean;
16
16
  /** Rows the list matched, once known, for a heading drawn outside the list (a dashboard section's count). */
17
17
  onTotal?: (total: number | undefined) => void;
18
+ /** The list's summary strip, drawn between its heading and its tabs (Rooms.tsx, through the shell's slot). */
19
+ summary?: ReactNode;
18
20
  }
19
- export declare function AppList({ entry, spec, navigate, embedded, newButton, inDashboard, onTotal }: AppListProps): import("react").JSX.Element;
21
+ export declare function AppList({ entry, spec, navigate, embedded, newButton, inDashboard, onTotal, summary }: AppListProps): import("react").JSX.Element;
20
22
  export {};
@@ -20,7 +20,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
20
20
  * the list's question as text, so opening one is the ordinary list address.
21
21
  */
22
22
  import { filterLabel } from '@mistriwork/engine/shared/listFilters.js';
23
- import { BoardNewForm } from './boardNew.js';
23
+ import { BoardNewForm, BoardTotal } from './boardNew.js';
24
24
  import { useMessageLanguage } from './useMessageLanguage.js';
25
25
  import { createPortal } from 'react-dom';
26
26
  import { listControlsRef, listHeadRef, useCrumbSlots } from './crumbSlot.js';
@@ -48,6 +48,8 @@ import { onDemand } from './onDemand.js';
48
48
  import { useGridGroups } from './useGridGroups.js';
49
49
  import { ListSubtitles } from './listSubtitles.js';
50
50
  import { LayoutSwitch, useListLayout } from './LayoutSwitch.js';
51
+ import { ListColumns, useListColumns } from './ListColumns.js';
52
+ import { personFacing } from '../audience.js';
51
53
  const DefinedBoxes = onDemand(() => import('./DefinedFields.js'), 'DefinedBoxes', { quiet: true });
52
54
  /* A list's single `per` value (`category_id = 3`), which picks the fields a row-defined column's boxes are. */
53
55
  function oneValue(tail) {
@@ -67,6 +69,7 @@ import { renamedView, useSavedViews, withView, withoutView, writeSavedViews } fr
67
69
  import { PHONE_QUERY, RAIL_QUERY, useMediaQuery } from './useMediaQuery.js';
68
70
  import { TableRoom } from './TableRoom.js';
69
71
  import { RowOpensContext } from './rowOpens.js';
72
+ import { RowTitleContext } from './rowTitle.js';
70
73
  import { ListEmpty } from './ListEmpty.js';
71
74
  import { Empty } from './Notes.js';
72
75
  import { Button } from '@mistriwork/ui/Button.js';
@@ -150,9 +153,49 @@ function TabCount({ counted }) {
150
153
  /* The number in a box of its own, over the room a tab keeps for it (features.css). */
151
154
  return _jsx("span", { className: "tab-count", children: said && _jsx("span", { children: said }) });
152
155
  }
153
- export function AppList({ entry, spec, navigate, embedded = false, newButton, inDashboard = false, onTotal }) {
156
+ /* The switch's width where a list has drawn one, by the list's table: a list is made again on a change of tab, and
157
+ the room it held would be forgotten with it. */
158
+ const switchRoom = new Map();
159
+ /**
160
+ * Where a phone's Records/Table switch is drawn, at the end of the tabs' line. The list draws the switch once it has
161
+ * rows (TableView), so on every change of tab it left the line while the rows came and took its place again after:
162
+ * the strip beside it was a switch wider for those frames, and a tab came out from under More and went back. Once
163
+ * the switch has stood here its room is held (`data-held`, and its width) for as long as the page lives.
164
+ */
165
+ function PresentationHost({ list }) {
166
+ const host = useRef(null);
167
+ const [room, setRoom] = useState(() => switchRoom.get(list));
168
+ useEffect(() => {
169
+ const node = host.current;
170
+ if (!node)
171
+ return;
172
+ const hold = () => {
173
+ const drawn = node.firstElementChild;
174
+ // Layout pixels in, layout pixels out: nothing of the screen's is read.
175
+ const width = drawn?.offsetWidth;
176
+ if (!width)
177
+ return;
178
+ switchRoom.set(list, width);
179
+ setRoom(width);
180
+ };
181
+ hold();
182
+ const seen = new MutationObserver(hold);
183
+ seen.observe(node, { childList: true });
184
+ return () => seen.disconnect();
185
+ }, [list]);
186
+ // One function for the element's life: the slot is told of the element when it comes and when it goes, not on every draw.
187
+ const place = useCallback((node) => {
188
+ host.current = node;
189
+ listControlsRef(node);
190
+ }, []);
191
+ return (_jsx("span", { className: "applist-presentation", ref: place, "data-held": room ? '' : undefined, style: room ? { minWidth: room } : undefined }));
192
+ }
193
+ export function AppList({ entry, spec, navigate, embedded = false, newButton, inDashboard = false, onTotal, summary }) {
154
194
  useMessageLanguage();
155
- const caption = spec.label;
195
+ /* A refusal standing in place of the rows titles the room (TableRoom.tsx): the label made from an address that
196
+ names nothing the reader may see is not a name. */
197
+ const [refusedAs, setRefusedAs] = useState(null);
198
+ const caption = refusedAs ?? spec.label;
156
199
  /* A list whose machine has a handful of open states may be read as a board too (listInference.ts): the reader's
157
200
  choice, kept in their browser per view, as a board's folds are. */
158
201
  const boardable = Boolean(spec.asBoard && !spec.presentation && !embedded && !inDashboard);
@@ -188,7 +231,10 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
188
231
  const [gridResult, setGridResult] = useState();
189
232
  const connection = state.activeConnection;
190
233
  const gridCurrent = gridResult?.query === entry.query && gridResult.connection === connection ? gridResult : undefined;
234
+ /* A board reads no total; it says its lanes' sum here once they are counted (boardNew.ts). */
235
+ const [boardTotal, setBoardTotal] = useState(null);
191
236
  const gridTotal = gridCurrent?.total;
237
+ const titleTotal = presented?.kind === 'board' ? (boardTotal ?? undefined) : gridTotal;
192
238
  const gridCapped = gridCurrent?.capped === true;
193
239
  const [advancedOpen, setAdvanced] = useState(false);
194
240
  const rail = useRef(null);
@@ -207,6 +253,13 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
207
253
  .map((box) => (box.kind === 'text' && spec.suggest?.[box.column] ? { ...box, suggest: spec.suggest[box.column] } : box))
208
254
  : [], [table, names.join(','), spec, definedBoxes]);
209
255
  const [edits, setEdits] = useState({});
256
+ /* A new question keeps the room (Rooms.tsx), so what was typed toward the last one is let go here, as a room
257
+ started over let it go: a chip's × must not leave its words standing in the box. */
258
+ const [editsAsked, setEditsAsked] = useState(entry.query);
259
+ if (editsAsked !== entry.query) {
260
+ setEditsAsked(entry.query);
261
+ setEdits({});
262
+ }
210
263
  const editsNow = useRef(edits);
211
264
  editsNow.current = edits;
212
265
  const touched = (column) => column in editsNow.current;
@@ -292,7 +345,7 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
292
345
  }
293
346
  if (residueChip)
294
347
  chips.push(residueChip);
295
- const chipList = chips.map((c) => (_jsxs("span", { className: "applist-chip", children: [_jsx("span", { className: "applist-chip-text", children: c.text }), _jsx("button", { type: "button", className: "applist-chip-x", "aria-label": say('common.remove2', { text: c.text }), onClick: c.remove, children: "\u00D7" })] }, c.text)));
348
+ const chipList = chips.map((c) => (_jsxs("span", { className: "applist-chip", title: c.text, children: [_jsx("span", { className: "applist-chip-text", children: c.text }), _jsx("button", { type: "button", className: "applist-chip-x", "aria-label": say('common.remove2', { text: c.text }), onClick: c.remove, children: "\u00D7" })] }, c.text)));
296
349
  const isDefault = canonicalize(entry.query) === canonicalize(appListQuery(spec, 0));
297
350
  const exactTab = litTab >= 0 && canonicalize(refinement) === canonicalize(tabs[litTab].query ?? '');
298
351
  const offerSave = savable && !(isDefault || exactTab || yourLit >= 0 || !refinement);
@@ -388,7 +441,7 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
388
441
  return;
389
442
  writeViews.mutate((views) => renamedView(views, view.name, String(name)));
390
443
  };
391
- /* The paint that replaced the one this person was using: put focus back
444
+ /* The paint that answered the control this person was using: put focus back
392
445
  on the twin of the control they used — in a rail, the very value. */
393
446
  useEffect(() => {
394
447
  if (!refocus)
@@ -414,7 +467,7 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
414
467
  }
415
468
  }
416
469
  refocus = null;
417
- }, []);
470
+ }, [entry.query]);
418
471
  /* The grid: rows only — an entry can carry a workbench tab (diagram,
419
472
  definition) across the mode flip, and the diagram under the app's
420
473
  filter boxes was a surface those controls cannot filter. The keys the
@@ -438,6 +491,10 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
438
491
  ]),
439
492
  ].filter((name) => !chosen.has(name))
440
493
  : named;
494
+ /* The columns the reader left out (ListColumns.tsx): offered where the view names its columns and draws them as a
495
+ table on its own page. A choice of how to read the list, so the rows are asked for as they were. */
496
+ const choosable = !embedded && !inDashboard && !presented && table && (spec.show?.length ?? 0) > 2 ? spec.show : [];
497
+ const [leftOut, setLeftOut] = useListColumns(spec.id, choosable);
441
498
  /* A join table's list opens what each row is about, by its name where the list shows it. */
442
499
  const rowOpens = useMemo(() => spec.opens
443
500
  ? {
@@ -605,8 +662,8 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
605
662
  unchanged. The search box is this room's state, so each character typed
606
663
  redrew the room and, with it, the whole grid under the box; now a
607
664
  keystroke redraws the box and the chips, and the rows are left alone. */
608
- const hideKey = hide.join('\n');
609
- const keptHide = useMemo(() => hide, [hideKey]); // eslint-disable-line react-hooks/exhaustive-deps
665
+ const hideKey = [...hide, ...leftOut].join('\n');
666
+ const keptHide = useMemo(() => [...hide, ...leftOut], [hideKey]); // eslint-disable-line react-hooks/exhaustive-deps
610
667
  const totalsKey = totals ? JSON.stringify(totals) : '';
611
668
  const keptTotals = useMemo(() => totals, [totalsKey]); // eslint-disable-line react-hooks/exhaustive-deps
612
669
  const onGridNow = useRef(onGrid);
@@ -640,9 +697,9 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
640
697
  void client.invalidateQueries({
641
698
  queryKey: ['count', connection ?? ''],
642
699
  });
643
- } }) })), _jsx(BoardNewForm.Provider, { value: offersNew ? (spec.form ?? {}) : null, children: _jsx(RowOpensContext.Provider, { value: rowOpens, children: _jsx(ListSubtitles.Provider, { value: spec.subtitles, children: _jsx(TableRoom, { entry: gridEntry, sizing: spec.sizing, chrome: false, summaries: true, inset: !inDashboard, embedded: inDashboard, hide: keptHide, referenceLabels: referenceLabels, totals: keptTotals, ...(gridGroup ? { group: gridGroup } : {}), density: spec.density,
644
- /* A ⋯ with nothing a reader may run is a dead control and a reserved column; the App payload already says what they may run. */
645
- rowActions: Boolean(spec.rowActions && !presented && !embedded && mayRunAny(shell().app(), entry.table, spec.actions ?? [])), editable: presented || embedded ? undefined : spec.editable, inCrumbs: inCrumbs, onResult: keptOnGrid, presentation: embedded ? undefined : presented, present: shell().present ?? undefined, empty: embedded ? undefined : narrowedPast ? (noMatches) : authoredEmpty ? (_jsx(ListEmpty, { spec: authoredEmpty })) : ((nothingYet ?? tabEmpty)), actions: embedded ? undefined : spec.actions, listLabel: caption, order: embedded ? undefined : spec.order, export: exportOff ? false : undefined, interactive: embedded ? false : undefined }) }) }) })] })), [
700
+ } }) })), _jsx(BoardTotal.Provider, { value: ownList ? setBoardTotal : null, children: _jsx(BoardNewForm.Provider, { value: offersNew ? (spec.form ?? {}) : null, children: _jsx(RowOpensContext.Provider, { value: rowOpens, children: _jsx(RowTitleContext.Provider, { value: spec.primary, children: _jsx(ListSubtitles.Provider, { value: spec.subtitles, children: _jsx(TableRoom, { entry: gridEntry, sizing: spec.sizing, chrome: false, summaries: true, inset: !inDashboard, embedded: inDashboard, hide: keptHide, referenceLabels: referenceLabels, totals: keptTotals, ...(gridGroup ? { group: gridGroup } : {}), density: spec.density,
701
+ /* A ⋯ with nothing a reader may run is a dead control and a reserved column; the App payload already says what they may run. */
702
+ rowActions: Boolean(spec.rowActions && !presented && !embedded && mayRunAny(shell().app(), entry.table, spec.actions ?? [])), editable: presented || embedded ? undefined : spec.editable, inCrumbs: inCrumbs, onResult: keptOnGrid, onRefused: setRefusedAs, presentation: embedded ? undefined : presented, present: shell().present ?? undefined, empty: embedded ? undefined : narrowedPast ? (noMatches) : authoredEmpty ? (_jsx(ListEmpty, { spec: authoredEmpty })) : ((nothingYet ?? tabEmpty)), actions: embedded ? undefined : spec.actions, listLabel: caption, order: embedded ? undefined : spec.order, export: exportOff ? false : undefined, interactive: embedded ? false : undefined }) }) }) }) }) })] })), [
646
703
  gridPage,
647
704
  gridSize,
648
705
  embedded,
@@ -669,11 +726,23 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
669
726
  rowOpens,
670
727
  ]);
671
728
  /* A signed-out visitor reads the storefront, not the tool (docs/design.md,
672
- public pages): a match count chip and a favourites star are an
673
- operator's furniture there. */
729
+ public pages): a favourites star is an operator's furniture there. How
730
+ many homes or cars there are is the storefront's own fact, so the count
731
+ stays beside the title for a visitor too. */
674
732
  const visitor = shell().publicVisitor();
675
- const title = (_jsxs(_Fragment, { children: [_jsx("h1", { className: `applist-title${spec.heading === false ? ' visually-hidden' : ''}`, children: caption }), typeof gridTotal === 'number' && !visitor && spec.heading !== false && (_jsxs("span", { className: "applist-count", title: say('rowsTheTabAndFilters'), children: [formatNumber(gridTotal), gridCapped ? '+' : ''] })), spec.favorite && spec.id && !visitor && _jsx(FavoriteStar, { favorite: { kind: 'view', view: spec.id, label: caption }, name: caption })] }));
676
- return (_jsxs(_Fragment, { children: [boundNames.map((name) => (_jsx(DefinedBoxes, { column: name, binding: bound[name], per: bound[name].per ? oneValue(conditionTail(refinement, bound[name].per)) : undefined, onBoxes: onDefinedBoxes }, name))), inBar && createPortal(title, crumbs.note), inCrumbs && !spec.quickAdd && newButton && createPortal(newButton, (crumbs.tools ?? crumbs.head)), _jsxs("div", { className: `applist-head${inBar ? ' in-crumbs' : ''}`, children: [!inBar && !inDashboard && (_jsxs("div", { className: "applist-head-row", ref: head, children: [title, ownList ? _jsx("div", { className: "applist-head-tools", ref: listHeadRef }) : !spec.quickAdd && newButton] })), !beside && !chipsInBar && _jsx("div", { className: "applist-chips", children: chipList })] }), _jsxs("div", { className: "applist-controls", role: "group", "aria-label": say('listControls', { caption }), children: [(tabs.length > 1 || yours.length > 0) && (_jsxs("div", { className: "tabs folds", ref: tabStrip, children: [_jsxs("div", { className: "tabs-row", role: "tablist", children: [tabs.map((tab, i) => (_jsxs("button", { type: "button", role: "tab", className: "tab", "aria-selected": i === litTab && yourLit === -1, onClick: () => pickTab(i), ...foldMark(i), children: [_jsx("span", { children: tab.label }), _jsx(TabCount, { counted: countOf(i) })] }, tab.label))), yours.length > 0 && (_jsxs("span", { className: "tab-group", ...foldMark(tabs.length), "aria-hidden": "true", children: [tabs.length > 1 && _jsx("span", { className: "tab-divider" }), _jsx("span", { className: "tab-group-label", children: store === 'account' ? say('myViews') : say('savedViews') })] })), yours.map((f, i) => (_jsxs("span", { className: "tab-wrap", role: "presentation", ...foldMark(savedAt + i), children: [_jsxs("button", { type: "button", role: "tab", className: "tab tab-yours", "aria-selected": i === yourLit, title: `${viewWords(f.query) || say('everything')} — ${store === 'account' ? say('yourView') : say('aSavedView')}`, onClick: () => {
733
+ const scopeCount = narrowedPast && litTab >= 0 && yourLit === -1 ? countOf(litTab) : undefined;
734
+ const scopeTotal = scopeCount && !scopeCount.capped ? scopeCount.total : undefined;
735
+ const title = (_jsxs(_Fragment, { children: [_jsx("h1", { className: `applist-title${spec.heading === false ? ' visually-hidden' : ''}`, children: caption }), typeof titleTotal === 'number' && spec.heading !== false && (_jsxs("span", { className: "applist-count", title: say('rowsTheTabAndFilters'), children: [formatNumber(titleTotal), gridCapped ? '+' : ''] })), typeof titleTotal === 'number' && spec.heading !== false && typeof scopeTotal === 'number' && scopeTotal !== titleTotal && (_jsx("span", { className: "applist-count-of", children: say('ofTotal', { total: formatNumber(scopeTotal) }) })), spec.favorite && spec.id && !visitor && _jsx(FavoriteStar, { favorite: { kind: 'view', view: spec.id, label: caption }, name: caption })] }));
736
+ /* The list's kept questions and the two verbs that keep one, at the head of the page's verbs: what a reader has
737
+ saved, then Save and Rename. The saved ones are tabs too, after the list's own; the verbs stood at the end of
738
+ the filter bar, where they came and went with the question and moved the controls beside them. */
739
+ const viewsMenu = ownList && savable ? (_jsxs(DropMenu, { className: "applist-views", triggerClassName: "export-summary", label: _jsxs(_Fragment, { children: [_jsx("svg", { className: "applist-verb-mark", viewBox: "0 0 16 16", width: "16", height: "16", "aria-hidden": "true", children: _jsx("path", { d: "M4.5 2.5h7v11L8 11l-3.5 2.5z", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinejoin: "round" }) }), _jsx("span", { className: "export-word", children: say('views') })] }), popupClassName: "page-actions-popup", align: "end", children: [yours.length > 0 && (_jsx(DropGroup, { labelClassName: "more-group-label", label: store === 'account' ? say('myViews') : say('savedViews'), children: yours.map((view) => (_jsx(DropItem, { className: "page-actions-item", onClick: () => {
740
+ state.page = 0;
741
+ apply(view.query);
742
+ }, children: view.name }, view.name))) })), _jsx(DropItem, { className: "page-actions-item", disabled: !offerSave, title: store === 'account' ? say('keepThisTabIts') : say('keepThisTabItsFilters'), onClick: () => void save(), children: say('saveView') }), yourLit >= 0 && (_jsx(DropItem, { className: "page-actions-item", onClick: () => void rename(yours[yourLit]), children: say('renameView') }))] })) : null;
743
+ const pageVerbs = !spec.quickAdd && newButton;
744
+ return (_jsxs(_Fragment, { children: [boundNames.map((name) => (_jsx(DefinedBoxes, { column: name, binding: bound[name], per: bound[name].per ? oneValue(conditionTail(refinement, bound[name].per)) : undefined, onBoxes: onDefinedBoxes }, name))), inBar && createPortal(title, crumbs.note), inBar &&
745
+ createPortal(_jsxs(_Fragment, { children: [viewsMenu, pageVerbs] }), crumbs.tools), _jsxs("div", { className: `applist-head${inBar ? ' in-crumbs' : ''}`, children: [!inBar && !inDashboard && (_jsxs("div", { className: "applist-head-row", ref: head, children: [title, ownList ? (_jsxs("div", { className: "applist-head-tools", children: [viewsMenu, _jsx("span", { className: "applist-head-slot", ref: listHeadRef }), pageVerbs] })) : (pageVerbs)] })), !beside && !chipsInBar && _jsx("div", { className: "applist-chips", children: chipList })] }), summary, _jsxs("div", { className: "applist-controls", role: "group", "aria-label": say('listControls', { caption }), children: [(tabs.length > 1 || yours.length > 0) && (_jsxs("div", { className: "tabs folds", ref: tabStrip, children: [_jsxs("div", { className: "tabs-row", role: "tablist", children: [tabs.map((tab, i) => (_jsxs("button", { type: "button", role: "tab", className: "tab", "aria-selected": i === litTab && yourLit === -1, onClick: () => pickTab(i), ...foldMark(i), children: [_jsx("span", { children: tab.label }), _jsx(TabCount, { counted: countOf(i) })] }, tab.label))), yours.length > 0 && (_jsxs("span", { className: "tab-group", ...foldMark(tabs.length), "aria-hidden": "true", children: [tabs.length > 1 && _jsx("span", { className: "tab-divider" }), _jsx("span", { className: "tab-group-label", children: store === 'account' ? say('myViews') : say('savedViews') })] })), yours.map((f, i) => (_jsxs("span", { className: "tab-wrap", role: "presentation", ...foldMark(savedAt + i), children: [_jsxs("button", { type: "button", role: "tab", className: "tab tab-yours", "aria-selected": i === yourLit, title: `${viewWords(f.query) || say('everything')} — ${store === 'account' ? say('yourView') : say('aSavedView')}`, onClick: () => {
677
746
  if (i !== yourLit) {
678
747
  state.page = 0;
679
748
  apply(f.query);
@@ -699,7 +768,7 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
699
768
  // the sticky trail, leaving the same control impossible to close.
700
769
  if (!showAdvanced)
701
770
  setTimeout(() => filter.current?.focus({ preventScroll: true }), 0);
702
- }, children: say('advanced') })), offerSave && (_jsx("button", { type: "button", className: "applist-toggle", title: store === 'account' ? say('keepThisTabIts') : say('keepThisTabItsFilters'), onClick: () => void save(), children: say('saveView') })), savable && yourLit >= 0 && (_jsx("button", { type: "button", className: "applist-toggle", onClick: () => void rename(yours[yourLit]), children: say('renameView') }))] })] }), _jsx("div", { className: "applist-advanced", hidden: !showAdvanced, children: _jsx("input", { ref: filter, type: "text", className: "applist-filter", defaultValue: refinement, placeholder: naming ? say('contains', { naming }) : say('filterRecords'), "aria-label": say('filter', { caption }),
771
+ }, children: say('advanced') })), choosable.length > 0 && !personFacing() && (_jsx(ListColumns, { columns: choosable.map((name) => ({ name, label: captionOf(name) })), hidden: leftOut, onChange: setLeftOut, caption: caption }))] })] }), _jsx("div", { className: "applist-advanced", hidden: !showAdvanced, children: _jsx("input", { ref: filter, type: "text", className: "applist-filter", defaultValue: refinement, placeholder: naming ? say('contains', { naming }) : say('filterRecords'), "aria-label": say('filter', { caption }),
703
772
  /* The form has no submit button and, beside the search box, two
704
773
  fields, so Enter submits by hand rather than by implicit submission. */
705
774
  onKeyDown: (e) => {
@@ -707,11 +776,15 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
707
776
  e.preventDefault();
708
777
  form.current?.requestSubmit();
709
778
  }
710
- } }) })] })), inCrumbs && _jsx("span", { className: "applist-presentation", ref: listControlsRef })] }), beside && railProps ? (_jsxs("div", { className: "applist-body has-rail", children: [_jsx("aside", { className: "filter-rail", ref: rail, "aria-label": say('captionFilters', { caption }), children: _jsx(FilterRail, { ...railProps, clearAll: false, onChange: apply, status: matched }) }), _jsxs("div", { className: "applist-results", children: [_jsxs("div", { className: "applist-results-head", children: [_jsxs("div", { className: "applist-chips", role: "group", "aria-label": say('filtersApplied', { caption }), children: [chipList, narrowed > 0 && (_jsx("button", { type: "button", className: "applist-chips-clear", onClick: () => apply(clearFacets(refinement, boxes.map((box) => box.column), tabQuery)), children: say('list.clearAll') }))] }), spec.sorts?.length ? (_jsx(SortMenu, { sorts: spec.sorts, sort: spec.sort, query: entry.query, onPick: (query) => {
779
+ } }, refinement) })] })), inCrumbs && _jsx(PresentationHost, { list: viewKey })] }), beside && railProps ? (_jsxs("div", { className: "applist-body has-rail", children: [_jsx("aside", { className: "filter-rail", ref: rail, "aria-label": say('captionFilters', { caption }), children: _jsx(FilterRail, { ...railProps, clearAll: false, onChange: apply, status: matched }) }), _jsxs("div", { className: "applist-results", children: [_jsxs("div", { className: "applist-results-head", children: [_jsxs("div", { className: "applist-chips", role: "group", "aria-label": say('filtersApplied', { caption }), children: [chipList, narrowed > 0 && (_jsx("button", { type: "button", className: "applist-chips-clear", onClick: () => apply(clearFacets(refinement, boxes.map((box) => box.column), tabQuery)), children: say('list.clearAll') }))] }), spec.sorts?.length ? (_jsx(SortMenu, { sorts: spec.sorts, sort: spec.sort, query: entry.query, onPick: (query) => {
711
780
  walk.page = 0;
712
781
  navigate(query);
713
- } })) : null] }), _jsx(AppColumnMenuContext.Provider, { value: menuHost, children: grid })] })] })) : (_jsx(AppColumnMenuContext.Provider, { value: menuHost, children: grid })), sheet && railProps && (_jsx(FilterSheet, { ...railProps, boxes: railed ? boxes : boxes.filter((box) => box !== searchBox), onClose: () => setSheet(false), onApply: (text) => {
782
+ } })) : null] }), _jsx(AppColumnMenuContext.Provider, { value: menuHost, children: grid })] })] })) : (_jsx(AppColumnMenuContext.Provider, { value: menuHost, children: grid })), sheet && railProps && (_jsx(FilterSheet, { ...railProps, boxes: railed ? boxes : boxes.filter((box) => box !== searchBox), onClose: () => setSheet(false),
783
+ /* The sheet goes in the click's own frame and the list is asked after it is painted: the rows stand
784
+ as they were until the new answer arrives either way, and asked inside the click, the sheet stood
785
+ over the list while the whole list redrew under it (a phone's filter, test/built-client-vitals.mjs). */
786
+ onApply: (text) => {
714
787
  setSheet(false);
715
- apply(text);
788
+ requestAnimationFrame(() => setTimeout(() => apply(text), 0));
716
789
  } }))] }));
717
790
  }
@@ -153,7 +153,20 @@ export function CardsList({ table, rows, spec, interactive = true, recordNavigat
153
153
  ? factWord(spec.factLabels[name], row[name], columnDisplay(table.id, name))
154
154
  : undefined;
155
155
  const before = word !== undefined && spec.factLabels[name].position === 'before';
156
- return (_jsxs("span", { className: className, children: [word === undefined && _jsxs("span", { className: "visually-hidden", children: [caption(name), ": "] }), before && _jsxs("span", { className: "cards-summary-word", children: [word, " "] }), said(row, name), word !== undefined && !before && _jsxs("span", { className: "cards-summary-word", children: [" ", word] })] }, name));
156
+ /* A number that says nothing of what it counts ("2", among "2 ba" and "1,240 sq ft") is said with its column's
157
+ own caption before it, "Beds 2": a unit, a format or a word of its own already says what a value is. */
158
+ const display = word === undefined
159
+ ? columnDisplay(table.id, name)
160
+ : null;
161
+ /* On the summary line, where the facts stand together; the foot's values keep their captions for assistive
162
+ technology alone, as they have. */
163
+ const bare = className === 'cards-summary-item' &&
164
+ word === undefined &&
165
+ typeof row[name] === 'number' &&
166
+ !display?.unit &&
167
+ !display?.format &&
168
+ !(display?.values && Object.hasOwn(display.values, String(row[name])));
169
+ return (_jsxs("span", { className: className, children: [word === undefined && !bare && _jsxs("span", { className: "visually-hidden", children: [caption(name), ": "] }), bare && _jsxs("span", { className: "cards-summary-word", children: [caption(name), " "] }), before && _jsxs("span", { className: "cards-summary-word", children: [word, " "] }), said(row, name), word !== undefined && !before && _jsxs("span", { className: "cards-summary-word", children: [" ", word] })] }, name));
157
170
  };
158
171
  // A long page is drawn a line of cards at a time; the page itself is unchanged (useRowWindow.ts).
159
172
  const win = useRowWindow(rows.length, {
@@ -13,10 +13,14 @@
13
13
  .chart-bar-guide { stroke: var(--ink-muted); stroke-width: 1; stroke-dasharray: 3 3; }
14
14
  .chart-bar-tip rect { fill: var(--ink); rx: min(10px, var(--radius)); }
15
15
  .chart-bar-tip text { font: 500 var(--text-xs) var(--sans); fill: var(--ground); }
16
+ /* At rest the value in hand is the plot's headline, not a pill: nothing stands over a bar until the pointer names one. */
17
+ .chart-bar-tip.is-rest text { fill: var(--ink); }
16
18
  .chart-x-tick.is-active { fill: var(--ink); }
17
19
  /* Stacked columns: each series its token in every column; the current column is named by its tick and its pill, not by a tint. */
18
20
  .chart-columns { display: grid; gap: var(--space-3h); min-width: 0; }
21
+ /* A column is one shape: its parts are square where they meet and its top part takes the bar's small corner. */
19
22
  .chart-column-part { rx: 0; }
23
+ .chart-column-part.is-top { rx: min(3px, var(--radius)); }
20
24
  /* A column that drills: a door over its whole band (the hit rect is clear), the pointer saying it goes somewhere, and
21
25
  while it holds the keyboard the house ring round the band, as a line's point widens its stroke. */
22
26
  .chart-column-door { cursor: pointer; outline: none; }
@@ -80,10 +80,10 @@ export interface PartialPeriods {
80
80
  * Bars: one series, a bar per group — how much each week or each stage
81
81
  * holds, where a line says how a number moved. Over calendar buckets one bar
82
82
  * is the current one, drawn in the ink while the rest stay quiet: the last
83
- * (the period in hand) until the pointer names another. Its value is said in
84
- * a pill over it, and a guide runs from it across the levels, so the reader
85
- * can read it off the scale without a tooltip's delay; there the pill is
86
- * information, not a hover effect, so it is always there. Over categories (a
83
+ * (the period in hand) until the pointer names another. Its value is always
84
+ * said, so the reader has it without a tooltip's delay: at rest as the plot's
85
+ * headline in the corner over the levels, and in a pill over the bar the
86
+ * pointer names. A guide runs from the bar across the levels. Over categories (a
87
87
  * stage, a source) no bar is the one in hand — the last is only last in the
88
88
  * vocabulary — so at rest none is inked, with no pill and no guide, until the
89
89
  * pointer names one. Nothing moves (motion rule 8).