@mistriwork/kit 1.0.0-rc.57 → 1.0.0-rc.59

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 (158) hide show
  1. package/dist/client/app.js +14 -2
  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 +41 -11
  6. package/dist/client/components/AppList.d.ts +3 -1
  7. package/dist/client/components/AppList.js +77 -15
  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 +3 -1
  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 -1
  32. package/dist/client/components/GridSelection.js +20 -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 +39 -14
  40. package/dist/client/components/ListFilterBar.js +39 -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 +22 -4
  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 +8 -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 +1 -1
  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/valueModel.d.ts +1 -0
  102. package/dist/client/components/valueModel.js +39 -4
  103. package/dist/client/composer.css +2 -2
  104. package/dist/client/copy/es.js +3 -3
  105. package/dist/client/copy/filters/components/ListFilterBar.d.ts +1 -0
  106. package/dist/client/copy/filters/components/ListFilterBar.js +1 -0
  107. package/dist/client/copy/forms/components/DateField.d.ts +2 -0
  108. package/dist/client/copy/forms/components/DateField.js +2 -0
  109. package/dist/client/copy/forms/components/NewRecord.d.ts +8 -0
  110. package/dist/client/copy/forms/components/NewRecord.js +2 -0
  111. package/dist/client/copy/lists/components/AppList.d.ts +2 -0
  112. package/dist/client/copy/lists/components/AppList.js +2 -0
  113. package/dist/client/copy/lists/components/GridSelection.d.ts +1 -0
  114. package/dist/client/copy/lists/components/GridSelection.js +1 -0
  115. package/dist/client/copy/lists/components/ListColumns.d.ts +5 -0
  116. package/dist/client/copy/lists/components/ListColumns.js +7 -0
  117. package/dist/client/copy/lists/components/TableRoom.d.ts +3 -1
  118. package/dist/client/copy/lists/components/TableRoom.js +3 -1
  119. package/dist/client/copy/record/components/PageHistory.d.ts +2 -2
  120. package/dist/client/copy/record/components/PageHistory.js +4 -2
  121. package/dist/client/copy/record/components/WorkflowStatus.d.ts +1 -0
  122. package/dist/client/copy/record/components/WorkflowStatus.js +1 -0
  123. package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +1 -0
  124. package/dist/client/copy/shell/components/MobileNavDrawer.js +2 -0
  125. package/dist/client/customThemes.css +3 -3
  126. package/dist/client/dom.js +5 -5
  127. package/dist/client/features.css +216 -356
  128. package/dist/client/fonts/Manrope-OFL.txt +93 -0
  129. package/dist/client/fonts/faces.css +10 -1
  130. package/dist/client/fonts/manrope-latin.woff2 +0 -0
  131. package/dist/client/formControls.css +4 -4
  132. package/dist/client/help.css +2 -2
  133. package/dist/client/ledgerLook.css +28 -0
  134. package/dist/client/locale.d.ts +2 -10
  135. package/dist/client/locale.js +0 -0
  136. package/dist/client/lumenLook.css +295 -105
  137. package/dist/client/manropeFace.css +32 -0
  138. package/dist/client/messages.d.ts +3 -3
  139. package/dist/client/messages.js +3 -3
  140. package/dist/client/page.css +98 -354
  141. package/dist/client/palette.js +31 -6
  142. package/dist/client/partsLook.css +60 -60
  143. package/dist/client/sageLook.css +101 -32
  144. package/dist/client/shellHost.d.ts +2 -2
  145. package/dist/client/shellHost.js +2 -2
  146. package/dist/client/shellMode.d.ts +9 -0
  147. package/dist/client/shellMode.js +2 -0
  148. package/dist/client/structure.css +281 -201
  149. package/dist/client/style.css +75 -224
  150. package/dist/client/themeFamilies.css +471 -66
  151. package/dist/client/tilesLook.css +502 -0
  152. package/dist/client/visualTheme.js +5 -2
  153. package/dist/client/visualThemes.css +38 -34
  154. package/dist/client/workbenchLook.css +12 -12
  155. package/dist/client/workshopLook.css +3 -8
  156. package/dist/vite.d.ts +1 -20
  157. package/dist/vite.js +33 -3
  158. package/package.json +8 -7
@@ -21,8 +21,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
21
  import './TreePicker.css';
22
22
  import { Fragment, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
23
23
  import { useQueryClient } from '@tanstack/react-query';
24
- import { Popover } from '@base-ui/react/popover';
25
- import { layoutViewport, zoomAnchor } from '@mistriwork/ui/internal/anchor.js';
24
+ import { Popover, PopoverContent } from '@ui-sdk/react/popover';
26
25
  import { viewportBox } from '@mistriwork/ui/internal/ruler.js';
27
26
  import { popupContainer, shellById } from '../shellHost.js';
28
27
  import { andQuery, quoteValue } from '@mistriwork/engine/shared/query.js';
@@ -355,8 +354,10 @@ export function TreePicker({ from, by, labelColumn, parent, where, ask, scope, v
355
354
  run();
356
355
  };
357
356
  /* The popup is as wide as the box, measured on the house ruler when it opens and again only when the box resizes:
358
- Base UI's own anchor width is recomputed as the rows arrive (Typeahead.tsx says why that loops). */
357
+ the anchor width the placement works out is read again as the rows arrive, and a width that follows it loops. */
359
358
  const frame = useRef(null);
359
+ /* What the popup is placed against, read each time it is placed: the frame is not there on the first draw. */
360
+ const [anchor] = useState(() => ({ getBoundingClientRect: () => frame.current?.getBoundingClientRect() ?? new DOMRect() }));
360
361
  const [width, setWidth] = useState(null);
361
362
  const [container, setContainer] = useState(null);
362
363
  useLayoutEffect(() => {
@@ -385,23 +386,29 @@ export function TreePicker({ from, by, labelColumn, parent, where, ask, scope, v
385
386
  setOpen(true);
386
387
  if (chosen !== undefined)
387
388
  onChange('');
388
- }, onClick: () => !disabled && setOpen(true), onBlur: close, onKeyDown: onKeyDown }), _jsx(Popover.Root, { open: open && !disabled, modal: false, onOpenChange: () => { }, children: _jsx(Popover.Portal, { container: container ?? popupContainer(), children: _jsx(Popover.Positioner, { anchor: () => (frame.current ? zoomAnchor(frame.current) : null), positionMethod: "fixed", side: "bottom", align: "start", sideOffset: 4, collisionBoundary: layoutViewport(), collisionPadding: 8, style: { zIndex: 40, width: width === null ? 'var(--anchor-width)' : `${width}px`, maxWidth: 'var(--available-width)' }, children: _jsx(Popover.Popup, { role: "presentation", initialFocus: false, finalFocus: false, className: "picker-popup tree-picker-popup", onMouseDown: (event) => event.preventDefault(), children: _jsx("ul", { id: listId, role: searching ? 'listbox' : 'tree', "aria-label": ariaLabel ?? listLabel, className: "picker-list", children: lines.map((line) => {
389
- const node = line.node;
390
- if (!node)
391
- return (_jsx("li", { role: "presentation", className: "picker-empty", style: { paddingInlineStart: indent(line.depth) }, children: line.note }, line.key));
392
- const lit = line === current;
393
- const opens = !searching && branch(node.key);
394
- return (_jsxs("li", { id: lineId(line), role: searching ? 'option' : 'treeitem', "aria-level": searching ? undefined : line.depth, "aria-expanded": opens ? opened.has(node.key) : undefined, "aria-selected": lit, className: `picker-option tree-picker-option${lit ? ' active' : ''}${node.key === chosen ? ' chosen' : ''}`, style: searching ? undefined : { paddingInlineStart: indent(line.depth) }, onClick: () => pick(node), children: [!searching && (_jsx("span", { className: `tree-picker-caret${opens ? '' : ' is-leaf'}`, "aria-hidden": "true", onClick: (event) => {
395
- event.stopPropagation();
396
- setActive(node.key);
397
- if (!opens)
398
- return;
399
- if (opened.has(node.key))
400
- fold(node.key);
401
- else
402
- expand(node.key);
403
- }, children: opens && _jsx(Icon, { name: opened.has(node.key) ? 'caret-down' : 'caret-right', size: 12 }) })), _jsx("span", { className: "picker-option-label", children: node.label }), line.path && line.path.length > 0 && (_jsx("span", { className: "picker-option-detail tree-picker-path", children: line.path.join(' › ') }))] }, line.key));
404
- }) }) }) }) }) })] }), said && (_jsx("p", { id: trailId, className: "tree-picker-trail", "aria-label": say('path'), children: trail.map((node, index) => (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { className: "tree-picker-sep", "aria-hidden": "true", children: "\u203A" })), _jsx("span", { children: node.label })] }, node.key))) }))] }));
389
+ }, onClick: () => !disabled && setOpen(true), onBlur: close, onKeyDown: onKeyDown }), _jsx(Popover, { open: open && !disabled, modal: false, dismissible: false, onOpenChange: () => { }, children: _jsx(PopoverContent
390
+ /* A popover's panel says it is a dialog named by its trigger. This one is neither: it is the box's
391
+ list, which the box names and owns, and the panel itself is nothing to a reader. */
392
+ , {
393
+ /* A popover's panel says it is a dialog named by its trigger. This one is neither: it is the box's
394
+ list, which the box names and owns, and the panel itself is nothing to a reader. */
395
+ render: (part) => _jsx("div", { ...part, role: "presentation", "aria-labelledby": undefined }), anchor: anchor, side: "bottom", align: "start", sideOffset: 4, collisionPadding: 8, container: container ?? popupContainer(), initialFocus: "none", finalFocus: "none", className: "picker-popup tree-picker-popup", style: { width: width === null ? 'var(--anchor-width)' : `${width}px`, maxWidth: 'var(--available-width)' }, onMouseDown: (event) => event.preventDefault(), children: _jsx("ul", { id: listId, role: searching ? 'listbox' : 'tree', "aria-label": ariaLabel ?? listLabel, className: "picker-list", children: lines.map((line) => {
396
+ const node = line.node;
397
+ if (!node)
398
+ return (_jsx("li", { role: "presentation", className: "picker-empty", style: { paddingInlineStart: indent(line.depth) }, children: line.note }, line.key));
399
+ const lit = line === current;
400
+ const opens = !searching && branch(node.key);
401
+ return (_jsxs("li", { id: lineId(line), role: searching ? 'option' : 'treeitem', "aria-level": searching ? undefined : line.depth, "aria-expanded": opens ? opened.has(node.key) : undefined, "aria-selected": lit, className: `picker-option tree-picker-option${lit ? ' active' : ''}${node.key === chosen ? ' chosen' : ''}`, style: searching ? undefined : { paddingInlineStart: indent(line.depth) }, onClick: () => pick(node), children: [!searching && (_jsx("span", { className: `tree-picker-caret${opens ? '' : ' is-leaf'}`, "aria-hidden": "true", onClick: (event) => {
402
+ event.stopPropagation();
403
+ setActive(node.key);
404
+ if (!opens)
405
+ return;
406
+ if (opened.has(node.key))
407
+ fold(node.key);
408
+ else
409
+ expand(node.key);
410
+ }, children: opens && _jsx(Icon, { name: opened.has(node.key) ? 'caret-down' : 'caret-right', size: 12 }) })), _jsx("span", { className: "picker-option-label", children: node.label }), line.path && line.path.length > 0 && (_jsx("span", { className: "picker-option-detail tree-picker-path", children: line.path.join(' › ') }))] }, line.key));
411
+ }) }) }) })] }), said && (_jsx("p", { id: trailId, className: "tree-picker-trail", "aria-label": say('path'), children: trail.map((node, index) => (_jsxs(Fragment, { children: [index > 0 && (_jsx("span", { className: "tree-picker-sep", "aria-hidden": "true", children: "\u203A" })), _jsx("span", { children: node.label })] }, node.key))) }))] }));
405
412
  }
406
413
  /* A level's inset: the caret column stands under its parent's name. */
407
414
  const indent = (depth) => `calc(var(--space-2) + ${(depth - 1) * 18}px)`;
@@ -42,7 +42,10 @@ function ValueLink({ link }) {
42
42
  marks — where a reader sees the parts — and nowhere else unless one part
43
43
  alone is wider than its column (overflow-wrap). The text is unchanged. */
44
44
  function breakable(text) {
45
- const parts = text.split(/(?<=[@/])|(?=[.\-_?#&=])/);
45
+ /* A mail address breaks after its @ and nowhere else: offered its dots too, a card a few letters short broke
46
+ "name@example" from ".test", the address's last four letters alone on a line. */
47
+ const mail = /^[^@/\s]+@[^@/\s]+$/.test(text);
48
+ const parts = text.split(mail ? /(?<=@)/ : /(?<=[@/])|(?=[.\-_?#&=])/);
46
49
  if (parts.length < 2)
47
50
  return text;
48
51
  return parts.map((part, index) => (_jsxs(Fragment, { children: [index > 0 && _jsx("wbr", {}), part] }, index)));
@@ -18,7 +18,11 @@ import { useLayoutEffect, useRef } from 'react';
18
18
  import { workflowLabel } from '@mistriwork/engine/shared/pageModel.js';
19
19
  import { say } from '../copy/record/components/WorkflowStatus.js';
20
20
  export function WorkflowStatus({ definition, value, reachable, }) {
21
- const current = definition.steps.findIndex((step) => step.value === value);
21
+ /* The road, and the ways off it: an outcome is never the next numbered step. */
22
+ const road = definition.steps.filter((step) => !step.outcome);
23
+ const outcomes = definition.steps.filter((step) => step.outcome);
24
+ const current = road.findIndex((step) => step.value === value);
25
+ const ended = outcomes.some((step) => step.value === value);
22
26
  const known = current !== -1;
23
27
  /* On a narrow screen the strip is one line that scrolls sideways (page.css); the current step is brought into
24
28
  view by moving the strip alone, never the page, so a record opened at "Negotiation" shows Negotiation. */
@@ -34,13 +38,13 @@ export function WorkflowStatus({ definition, value, reachable, }) {
34
38
  ol.scrollLeft = Math.max(0, from.offsetLeft - ol.offsetLeft);
35
39
  edges(ol);
36
40
  }, [current]);
37
- if (definition.steps.length < 3)
41
+ if (road.length < 3)
38
42
  return null;
39
- return (_jsxs("div", { className: "workflow-status", children: [_jsx("ol", { ref: strip, onScroll: (event) => edges(event.currentTarget), "aria-label": say('workflowStatus'), className: "workflow-steps", "data-scrolls": "", "data-ordered": definition.ordered === true || undefined, children: definition.steps.map((step, index) => {
43
+ return (_jsxs("div", { className: "workflow-status", children: [_jsx("ol", { ref: strip, onScroll: (event) => edges(event.currentTarget), "aria-label": say('workflowStatus'), className: "workflow-steps", "data-scrolls": "", "data-ordered": definition.ordered === true || undefined, children: road.map((step, index) => {
40
44
  const passed = definition.ordered === true && known && index < current;
41
45
  const next = index !== current && reachable?.has(String(step.value)) === true;
42
46
  return (_jsxs("li", { "aria-current": index === current ? 'step' : undefined, "data-passed": passed || undefined, "data-reachable": next || undefined, children: [_jsx("span", { className: "workflow-marker", "aria-hidden": "true" }), step.label, passed && _jsxs("span", { className: "visually-hidden", children: [" ", say('passed')] }), next && _jsxs("span", { className: "visually-hidden", children: [" ", say('availableFromHere')] })] }, step.value));
43
- }) }), !known && (_jsxs("p", { className: "workflow-unmapped", role: "status", children: [say('currentState'), " ", value === null || value === undefined || value === '' ? say('notSet') : workflowLabel(String(value))] }))] }));
47
+ }) }), outcomes.length > 0 && (_jsx("ul", { className: "workflow-outcomes", "aria-label": say('otherOutcomes'), children: outcomes.map((step) => (_jsx("li", { "aria-current": step.value === value ? 'step' : undefined, children: step.label }, step.value))) })), !known && !ended && (_jsxs("p", { className: "workflow-unmapped", role: "status", children: [say('currentState'), " ", value === null || value === undefined || value === '' ? say('notSet') : workflowLabel(String(value))] }))] }));
44
48
  }
45
49
  /* Which ends of a scrolling strip have more beyond them, for its fade (page.css). */
46
50
  function edges(ol) {
@@ -19,6 +19,8 @@ export interface ListSpec {
19
19
  icon?: string;
20
20
  /** Columns summed in the grid's footer, over the whole query. */
21
21
  totals?: string[];
22
+ /** The list's summary: a dashboard's metrics, as the App serves them, drawn through the shell's slot (Rooms.tsx). */
23
+ summary?: readonly unknown[];
22
24
  /** The column the grid's rows are grouped by: read in its order, each group under a head with its count and subtotals. */
23
25
  group?: string;
24
26
  /** Row height; 'comfortable' is the default. */
@@ -32,6 +34,8 @@ export interface ListSpec {
32
34
  /** A text filter's suggestions: the columns whose values it offers as the reader types. */
33
35
  suggest?: Record<string, readonly string[]>;
34
36
  advancedFilters?: boolean;
37
+ /** The shown column a row is titled by where the list is read as records (rowTitle.ts); absent, the record's name. */
38
+ primary?: string;
35
39
  /** A split's single keys: a key → the id of an action of the picked record. */
36
40
  keys?: Record<string, string>;
37
41
  /** false draws the list without its title; it stays for a screen reader. */
@@ -63,6 +63,8 @@ export declare const INBOX_PAGE = "app:inbox";
63
63
  export declare const ASSISTANT_PAGE = "app:assistant";
64
64
  /** The page id the Directory rides (Directory.tsx): every list, page and New of a menu past a dozen places. */
65
65
  export declare const DIRECTORY_PAGE = "app:directory";
66
+ /** The page id the reader's settings ride (SettingsRoom.tsx): their profile and their preferences, at `/{app}/settings`. */
67
+ export declare const SETTINGS_PAGE = "app:settings";
66
68
  /** Whether a room is the assistant's page. */
67
69
  export declare const isAssistantRoom: (room: object) => room is AssistantRoom;
68
70
  /** Whether a room is one of the App's lists: neither a dashboard, a form nor the assistant's page. */
@@ -24,6 +24,8 @@ export const INBOX_PAGE = 'app:inbox';
24
24
  export const ASSISTANT_PAGE = 'app:assistant';
25
25
  /** The page id the Directory rides (Directory.tsx): every list, page and New of a menu past a dozen places. */
26
26
  export const DIRECTORY_PAGE = 'app:directory';
27
+ /** The page id the reader's settings ride (SettingsRoom.tsx): their profile and their preferences, at `/{app}/settings`. */
28
+ export const SETTINGS_PAGE = 'app:settings';
27
29
  /** Whether a room is the assistant's page. */
28
30
  export const isAssistantRoom = (room) => Object.hasOwn(room, 'assistant');
29
31
  /** Whether a room is one of the App's lists: neither a dashboard, a form nor the assistant's page. */
@@ -1,2 +1,7 @@
1
1
  import type { FormSpec } from './NewRecordButton.js';
2
2
  export declare const BoardNewForm: import("react").Context<FormSpec>;
3
+ /**
4
+ * How many cards a board holds across its lanes, said back to the list that drew it: a board reads no total of its
5
+ * own (it counts its lanes in one breakdown), so the count beside the room's title is the lanes' sum.
6
+ */
7
+ export declare const BoardTotal: import("react").Context<(total: number | null) => void>;
@@ -6,3 +6,8 @@
6
6
  */
7
7
  import { createContext } from 'react';
8
8
  export const BoardNewForm = createContext(null);
9
+ /**
10
+ * How many cards a board holds across its lanes, said back to the list that drew it: a board reads no total of its
11
+ * own (it counts its lanes in one breakdown), so the count beside the room's title is the lanes' sum.
12
+ */
13
+ export const BoardTotal = createContext(null);
@@ -20,6 +20,16 @@ export { andWords };
20
20
  * (`= open`, `!= a` and `!= b`, `>= 5` and `<= 9`) — as one phrase.
21
21
  */
22
22
  export declare function sayTails(sp: ConditionSpeaker | null, column: string, tails: readonly string[]): string;
23
+ /**
24
+ * The same conditions as a filter chip says them: the column's label, which stays put whatever is asked, and what is
25
+ * asked of it. Values chosen from a list come apart, so a chip can say the first and count the rest ("Building:
26
+ * Alder Court +2"); anything else is the phrase without its label ("Due: in the last 30 days", "Rent: up to $1,500").
27
+ */
28
+ export declare function sayChip(sp: ConditionSpeaker | null, column: string, tails: readonly string[]): {
29
+ label: string;
30
+ value: string;
31
+ values?: string[];
32
+ };
23
33
  /** One top-level condition of a filter — `status != done`, an or-group, a bracketed and — in words. */
24
34
  export declare function sayCondition(sp: ConditionSpeaker | null, condition: string): string;
25
35
  /** Each condition of a filter's text (no table name), in words. */
@@ -240,6 +240,26 @@ export function sayTails(sp, column, tails) {
240
240
  return sp.label(column);
241
241
  return sayReads(sp, column, tails.map(readTail));
242
242
  }
243
+ /**
244
+ * The same conditions as a filter chip says them: the column's label, which stays put whatever is asked, and what is
245
+ * asked of it. Values chosen from a list come apart, so a chip can say the first and count the rest ("Building:
246
+ * Alder Court +2"); anything else is the phrase without its label ("Due: in the last 30 days", "Rent: up to $1,500").
247
+ */
248
+ export function sayChip(sp, column, tails) {
249
+ const whole = sayTails(sp, column, tails);
250
+ const who = sp ? subject(sp, column) : null;
251
+ if (!sp || !who)
252
+ return { label: '', value: whole };
253
+ const label = sp.label(who.column);
254
+ const reads = tails.map(readTail);
255
+ const only = reads.length === 1 ? reads[0] : null;
256
+ const value = (v) => sayValue(sp, who.column, who.meta, v);
257
+ if (only?.op === 'in')
258
+ return { label, value: joined(only.values.map(value), 'filter.or'), values: only.values.map(value) };
259
+ if (only?.op === '=' && !datePhrase(only.value))
260
+ return { label, value: value(only.value), values: [value(only.value)] };
261
+ return { label, value: whole.startsWith(label) ? whole.slice(label.length).trim() : whole };
262
+ }
243
263
  function sayReads(sp, column, reads) {
244
264
  const who = subject(sp, column);
245
265
  if (!who || !reads.length || reads.some((read) => !read))
@@ -78,6 +78,8 @@ export interface Section {
78
78
  };
79
79
  targetWhole?: true;
80
80
  show?: string[];
81
+ /** A rows section: the shown column a row is titled by (`primary`), in place of the first shown. */
82
+ primary?: string;
81
83
  labels?: Record<string, string>;
82
84
  sort?: string;
83
85
  text?: string;
@@ -242,6 +244,12 @@ export declare function metricWindow(title: string, section: Pick<Section, 'quer
242
244
  title: string;
243
245
  note?: string;
244
246
  };
247
+ /**
248
+ * Whether a figure's own query already says a time ("placed_at = last 7 days", "due_on = this month", "= today"):
249
+ * such a card is about that time whatever the picker above says, so it is never captioned "Right now" — "Sales,
250
+ * past 7 days" over "Right now" was two times on one card.
251
+ */
252
+ export declare function saysOwnTime(query: string | undefined): boolean;
245
253
  /**
246
254
  * The window a section's own query sets on its `over` column — "last 90
247
255
  * days" — which its title says while the reader has picked none, so a card
@@ -154,6 +154,24 @@ export function sayer(section, measured,
154
154
  const said = figureSayer(dress, section.unit, whole ? EXACT : compact ? CARD_COMPACT : card ? (section.figure === 'compact' ? CARD_COMPACT : EXACT) : COMPACT_FROM,
155
155
  /* `figure: 'whole'` rounds a card's money to the major unit: a six-figure sum with cents wrapped in a quarter-width card. */
156
156
  card && !whole && section.figure === 'whole' ? false : undefined);
157
+ /* A card's exact money that is whole is said whole: a headline reads "$56,130", and "$56,130.00" beside a strip's
158
+ other figures read as a second format. A figure with cents keeps them, and a table's cell is not a card. Each
159
+ card still measures alone, so the rule holds before its neighbours answer. */
160
+ const headline = card && !whole && !section.figure && dress?.format === 'money'
161
+ ? (v) => {
162
+ if (v instanceof CurrencyFigures || v === null || v === undefined || v === '')
163
+ return said(v);
164
+ const minor = dress.minor ? 10 ** currencyDigits(dress.currency || defaultCurrency()) : 1;
165
+ /* Read off the digits where the figure is text: a sum past 2^53 is whole as a number whatever its cents. */
166
+ const round = minor === 1 && typeof v === 'string'
167
+ ? /^\s*[+-]?\d+(\.0+)?\s*$/.test(v)
168
+ : Number.isSafeInteger(Number(v)) && Number(v) % minor === 0;
169
+ if (!round)
170
+ return said(v);
171
+ const text = dressedFigure(dress, v, false, EXACT);
172
+ return text === null ? said(v) : section.unit ? withUnit(text, section.unit) : text;
173
+ }
174
+ : said;
157
175
  /* Figures said side by side, in one form: where every one is a thousand or more, money drops its cents, so
158
176
  "$67,713.40" never stands beside "$17,970" in one breakdown; else every figure says cents if one has some. */
159
177
  const among = (values) => {
@@ -170,7 +188,7 @@ export function sayer(section, measured,
170
188
  const one = (v) => dressedFigure(dress, v, cents, compact ? CARD_COMPACT : COMPACT_FROM) ?? said(v);
171
189
  return section.unit ? (v) => withUnit(one(v), section.unit) : one;
172
190
  };
173
- return Object.assign(said, { tick: tickSayer(dress, section.unit), among });
191
+ return Object.assign(headline === said ? said : (v) => headline(v), { tick: tickSayer(dress, section.unit), among });
174
192
  }
175
193
  /**
176
194
  * How an axis says one of its round levels (shared/niceTicks.ts): compact
@@ -285,6 +303,15 @@ export function metricWindow(title, section, windowNow) {
285
303
  return { title, note: authored.charAt(0).toUpperCase() + authored.slice(1) };
286
304
  return { title };
287
305
  }
306
+ /**
307
+ * Whether a figure's own query already says a time ("placed_at = last 7 days", "due_on = this month", "= today"):
308
+ * such a card is about that time whatever the picker above says, so it is never captioned "Right now" — "Sales,
309
+ * past 7 days" over "Right now" was two times on one card.
310
+ */
311
+ export function saysOwnTime(query) {
312
+ return (!!query &&
313
+ /(?:=|\bin\b)\s*(?:(?:last|past|this|next)\s+(?:\d+\s+)?(?:day|week|month|quarter|year)s?|today|yesterday|tomorrow)\b/i.test(query));
314
+ }
288
315
  /** The window phrase a query gives its `over` column (`close_date = last 90 days` → "last 90 days"). */
289
316
  function authoredWindow(query, over) {
290
317
  const column = over.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
@@ -9,7 +9,7 @@ interface EditInteractionOptions {
9
9
  onCancel: () => void;
10
10
  }
11
11
  /** A blur is evidence to examine, not permission to submit. Focus and pointer
12
- * ownership are checked after Base UI has settled selection/return focus. */
12
+ * ownership are checked after the control has settled selection/return focus. */
13
13
  export declare function useEditInteraction(options: EditInteractionOptions): {
14
14
  root: import("react").RefObject<HTMLDivElement>;
15
15
  popupRef: (node: HTMLDivElement | null) => void;
@@ -11,7 +11,7 @@ const action = (target) => target instanceof Element &&
11
11
  (!target.closest('[data-edit-field]') &&
12
12
  target.closest('button, summary, .clickable, [role="button"], [role="menuitem"], [role="tab"], [tabindex]:not([tabindex="-1"]), input, select, textarea')));
13
13
  /** A blur is evidence to examine, not permission to submit. Focus and pointer
14
- * ownership are checked after Base UI has settled selection/return focus. */
14
+ * ownership are checked after the control has settled selection/return focus. */
15
15
  export function useEditInteraction(options) {
16
16
  const latest = useRef(options);
17
17
  latest.current = options;
@@ -1,19 +1,12 @@
1
1
  /**
2
2
  * How a grid's columns share their room: each column's floor from its head and its values, the width it would like,
3
- * and which give way first when the room is short. An App's head may wrap to two lines, so its floor is its widest
4
- * line, and the wrap is taken only when the heads set on one line would run past the room.
3
+ * and which give way first when the room is short. A row is one line and so is a head: nothing wraps, a figure, a
4
+ * date and a chip keep their whole width, and what is cut is secondary text, with the whole value on hover.
5
5
  */
6
6
  interface GridColumnSize {
7
7
  label: string;
8
8
  /** The label as the head sets it, measured in the head's own font, case and tracking; absent, its characters are counted. */
9
9
  headWidth?: number;
10
- /** An App's head may wrap to two lines, so its floor is the label's widest line when broken at the best word, not the whole label. `headWrap` is that line measured like `headWidth`; absent, its characters are counted. */
11
- wrapHead?: boolean;
12
- headWrap?: number;
13
- /** An App's text column whose values may wrap at their words: where the heads wrapped still run past the room, its
14
- floor is its widest value's two-line width rather than its whole width, so the value is kept whole on two lines
15
- rather than cut or scrolled to. The row's name is the first to take it (sizeHints); never a chip or a figure. */
16
- wrapValues?: boolean;
17
10
  kind: string;
18
11
  values: unknown[];
19
12
  /** The second line a display rule draws under each value, in the smaller type. */
@@ -21,13 +14,19 @@ interface GridColumnSize {
21
14
  /** The words the totals row draws under the column, in its heavier weight: a sum is wider than any row it adds up,
22
15
  and a total cut to "$102,795...." is the one figure that must be read whole. */
23
16
  total?: string;
17
+ /** The cell's own padding, both sides, as its row draws it; absent, 24px. */
18
+ pad?: number;
19
+ /** Measured: what the head stands its label off its edges by (the cell's padding and its sort's), and the width of
20
+ the sort's arrow in the head's face. A look that pads a head's leading edge, or sets its arrow wider, took the
21
+ room from the label: "Code" over a short key was cut to "Co…" under its own arrow. */
22
+ headPad?: number;
23
+ arrow?: number;
24
24
  /** Values drawn as tone chips: the dot, padding and border are width too. */
25
25
  chip?: boolean;
26
26
  /** Measured in the first row: what a chip draws beyond its words (the dot, gap and padding of the look wearing it). */
27
27
  chipExtra?: number;
28
28
  controls?: boolean;
29
- /** What the sort draws beside the label on its line, the gap before it included: a reference's arrow. A head that
30
- wraps keeps it beside the label's line, so it is room on both floors. */
29
+ /** What the sort draws beside the label on its line, the gap before it included: a reference's arrow. */
31
30
  mark?: number;
32
31
  /** What stands in the head's flow beside the sort on a device that cannot hover (its caret and move buttons,
33
32
  style.css): room on both floors, as `mark` is. */
@@ -54,11 +53,8 @@ export declare const GRID_TRAIL_WIDTH = 44;
54
53
  `--grid-head-char` (themeFamilies.css), which the grid reads where it
55
54
  measures its room. */
56
55
  export declare const GRID_HEAD_CHAR = 7;
57
- /**
58
- * The width of a label's widest line when it is broken into two at the best word: the narrowest a head can be
59
- * and still read as at most two lines. One word cannot break, so it is its own width. `width` measures a piece.
60
- */
61
- export declare function twoLineWidth(label: string, width: (text: string) => number): number;
56
+ /** Whether every value is digits in groups: figures with the marks that set them apart, and nothing to read as words. */
57
+ export declare function isGroupedNumber(values: readonly string[]): boolean;
62
58
  /** Measures a text in the grid's cell font, in pixels (Grid.tsx, a canvas). */
63
59
  export type TextMeasure = (text: string) => number;
64
60
  /** Bounded hints: readable minima survive small containers. Text is measured in
@@ -69,8 +65,7 @@ export declare function columnSizeHint(column: GridColumnSize, headChar?: number
69
65
  minimum: number;
70
66
  wanted: number;
71
67
  least: number;
72
- whole?: number;
73
- twoLines?: number;
68
+ head: number;
74
69
  };
75
70
  /**
76
71
  * The columns an embedded grid keeps in its width: a dashboard's list in half
@@ -81,7 +76,7 @@ export declare function columnSizeHint(column: GridColumnSize, headChar?: number
81
76
  * which was the one a reader came to it for. Null when all fit, or before
82
77
  * the room is measured.
83
78
  */
84
- export declare function keepFitting(columns: GridColumnSize[], available: number, expandable?: boolean, trailing?: boolean, headChar?: number, measure?: (text: string, column: number) => number): boolean[] | null;
79
+ export declare function keepFitting(columns: GridColumnSize[], available: number, expandable?: boolean, trailing?: boolean, headChar?: number, measure?: (text: string, column: number) => number, cut?: boolean): boolean[] | null;
85
80
  /** A fold decided: what it kept, at what width, for which columns and rows (`of`, compared by identity). */
86
81
  export interface FoldHeld {
87
82
  kept: boolean[];
@@ -102,7 +97,6 @@ export declare function holdFold(held: FoldHeld | null, next: boolean[] | null,
102
97
  export declare function fitGridColumns(columns: GridColumnSize[], available: number, expandable?: boolean, trailing?: boolean, headChar?: number, measure?: (text: string, column: number) => number, squeezeName?: boolean): {
103
98
  width: number;
104
99
  columns: number[];
105
- wraps: boolean[];
106
100
  };
107
101
  /**
108
102
  * How many of a cell's tag chips are drawn whole in `room`: as many as fit