@mistriwork/kit 1.0.0-rc.14 → 1.0.0-rc.16

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 (79) hide show
  1. package/dist/client/app.js +2 -1
  2. package/dist/client/components/AppList.js +12 -1
  3. package/dist/client/components/ChartFigure.d.ts +3 -2
  4. package/dist/client/components/ChartFigure.js +7 -5
  5. package/dist/client/components/Dressed.js +3 -0
  6. package/dist/client/components/Editable.js +3 -2
  7. package/dist/client/components/ErrorBoundary.js +1 -1
  8. package/dist/client/components/Grid.d.ts +15 -1
  9. package/dist/client/components/Grid.js +44 -7
  10. package/dist/client/components/JsonView.d.ts +2 -1
  11. package/dist/client/components/JsonView.js +2 -2
  12. package/dist/client/components/NewRecord.d.ts +3 -1
  13. package/dist/client/components/NewRecord.js +16 -5
  14. package/dist/client/components/PageCurrent.d.ts +10 -1
  15. package/dist/client/components/PageCurrent.js +10 -6
  16. package/dist/client/components/PageFields.js +14 -3
  17. package/dist/client/components/PageFlowDiagram.css +1 -1
  18. package/dist/client/components/PageHead.js +10 -9
  19. package/dist/client/components/PageHeadline.d.ts +3 -1
  20. package/dist/client/components/PageHeadline.js +3 -2
  21. package/dist/client/components/PageMetrics.js +13 -4
  22. package/dist/client/components/PageRelated.js +17 -2
  23. package/dist/client/components/PageSectionBox.js +6 -3
  24. package/dist/client/components/PageSections.js +1 -1
  25. package/dist/client/components/PageTimeline.js +44 -17
  26. package/dist/client/components/RecordSummaries.d.ts +5 -3
  27. package/dist/client/components/RecordSummaries.js +11 -2
  28. package/dist/client/components/TableRoom.d.ts +4 -1
  29. package/dist/client/components/TableRoom.js +10 -5
  30. package/dist/client/components/TableView.d.ts +4 -2
  31. package/dist/client/components/TableView.js +3 -3
  32. package/dist/client/components/TimelineReactions.css +49 -0
  33. package/dist/client/components/TimelineReactions.d.ts +18 -0
  34. package/dist/client/components/TimelineReactions.js +58 -0
  35. package/dist/client/components/TreePicker.css +25 -0
  36. package/dist/client/components/TreePicker.d.ts +59 -0
  37. package/dist/client/components/TreePicker.js +407 -0
  38. package/dist/client/components/Value.d.ts +2 -0
  39. package/dist/client/components/Value.js +67 -7
  40. package/dist/client/components/appListModel.d.ts +2 -0
  41. package/dist/client/components/chromeIcons.d.ts +1 -0
  42. package/dist/client/components/chromeIcons.js +1 -0
  43. package/dist/client/components/dashboardModel.d.ts +2 -2
  44. package/dist/client/components/inputRenderers.d.ts +7 -1
  45. package/dist/client/components/inputRenderers.js +2 -0
  46. package/dist/client/components/jsonModel.d.ts +3 -0
  47. package/dist/client/components/jsonModel.js +8 -0
  48. package/dist/client/components/pageContext.js +2 -1
  49. package/dist/client/components/pageModel.d.ts +14 -5
  50. package/dist/client/components/reactionTally.d.ts +20 -0
  51. package/dist/client/components/reactionTally.js +46 -0
  52. package/dist/client/components/useGridGroups.d.ts +11 -0
  53. package/dist/client/components/useGridGroups.js +70 -0
  54. package/dist/client/components/useGridKeyboard.d.ts +2 -0
  55. package/dist/client/components/useGridKeyboard.js +18 -1
  56. package/dist/client/components/valueModel.d.ts +10 -3
  57. package/dist/client/components/valueModel.js +21 -1
  58. package/dist/client/copy/forms/components/TreePicker.d.ts +9 -0
  59. package/dist/client/copy/forms/components/TreePicker.js +11 -0
  60. package/dist/client/copy/lists/components/Grid.d.ts +1 -1
  61. package/dist/client/copy/lists/components/Grid.js +1 -1
  62. package/dist/client/copy/lists/components/useGridGroups.d.ts +3 -0
  63. package/dist/client/copy/lists/components/useGridGroups.js +5 -0
  64. package/dist/client/copy/record/components/PageTimeline.d.ts +1 -0
  65. package/dist/client/copy/record/components/PageTimeline.js +1 -0
  66. package/dist/client/copy/record/components/TimelineReactions.d.ts +7 -0
  67. package/dist/client/copy/record/components/TimelineReactions.js +6 -0
  68. package/dist/client/copy/record/components/Value.d.ts +3 -0
  69. package/dist/client/copy/record/components/Value.js +3 -0
  70. package/dist/client/copy/shell/components/ErrorBoundary.d.ts +1 -1
  71. package/dist/client/copy/shell/components/ErrorBoundary.js +1 -1
  72. package/dist/client/features.css +37 -1
  73. package/dist/client/index.html +1 -1
  74. package/dist/client/page.css +33 -4
  75. package/dist/client/shellHost.d.ts +1 -1
  76. package/dist/client/shellHost.js +1 -1
  77. package/dist/client/structure.css +18 -3
  78. package/dist/client/style.css +11 -2
  79. package/package.json +4 -4
@@ -9,22 +9,26 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  * the row, a click that goes there.
10
10
  */
11
11
  import { Fragment } from 'react';
12
- import { api, columnDisplay, emptyWord, findTable, openRecord, refsFrom, state } from '../core.js';
12
+ import { api, columnDisplay, columnLabel, emptyWord, findTable, humanName, openRecord, refsFrom, state, toast } from '../core.js';
13
13
  import { opensRecord } from '../recordIntent.js';
14
- import { dressFor, linkFor, maskedText, ruleSays } from './valueModel.js';
14
+ import { dressFor, linkFor, maskedText, ruleSays, subtitlePath, wordFor } from './valueModel.js';
15
15
  import { rowCurrency } from '@mistriwork/engine/shared/money.js';
16
16
  import { dueOpen } from './dueOpen.js';
17
17
  import { JsonValue } from './JsonValue.js';
18
- import { jsonValueOf, previewOf } from './jsonModel.js';
18
+ import { itemsText, jsonValueOf, previewOf } from './jsonModel.js';
19
19
  import { TAGS_TYPE, tagChips } from '@mistriwork/engine/shared/tagLists.js';
20
20
  import { AvatarText, Dressed, Said } from './Dressed.js';
21
21
  import { ValueSlot } from './valueRenderers.js';
22
+ import { Icon } from './Icon.js';
22
23
  import { say } from '../copy/record/components/Value.js';
23
24
  import { shellBody } from '../shellHost.js';
24
25
  /* Drawn here and in the grid; the rules that draw them read no global (Dressed.tsx). */
25
26
  export { AvatarText, Dressed };
26
27
  /** A value that is a link: mail, a call, or a web page, which opens beside the App rather than in place of it. */
27
28
  function ValueLink({ link }) {
29
+ /* An address is drawn on its lines, as it is written on an envelope, and opens a map search beside the App. */
30
+ if (link.kind === 'address')
31
+ return (_jsx("a", { className: "value-link value-address", href: link.href, target: "_blank", rel: "noopener noreferrer", title: say('findOnAMap'), children: (link.lines ?? [link.text]).map((line, index) => (_jsx("span", { className: "value-address-line", children: line }, index))) }));
28
32
  const text = breakable(link.text);
29
33
  /* The break points are not words: the link is named by its text whole. */
30
34
  const named = { title: link.text, ...(typeof text === 'string' ? {} : { 'aria-label': link.text }) };
@@ -42,8 +46,45 @@ function breakable(text) {
42
46
  }
43
47
  /** A value as the record and the page show it: dressed when the app says, plain otherwise. */
44
48
  export function Value(props) {
45
- const { col, value, tableId, compact = false } = props;
49
+ const { subtitled, row, col } = props;
50
+ const body = _jsx(BareValue, { ...props });
51
+ const rule = subtitled && props.tableId !== undefined ? columnDisplay(props.tableId, col?.name ?? '') : null;
52
+ const path = subtitlePath(rule, col?.name ?? '');
53
+ const second = path !== undefined && row && Object.hasOwn(row, path) ? row[path] : undefined;
54
+ if (second === null || second === undefined || second === '')
55
+ return body;
56
+ return (_jsxs("span", { className: "value-subtitled", children: [body, _jsx("span", { className: "value-sub", children: String(second) })] }));
57
+ }
58
+ function BareValue(props) {
59
+ const { col, value, tableId, compact = false, links = !compact } = props;
46
60
  const rule = tableId === undefined ? null : columnDisplay(tableId, col?.name ?? '');
61
+ const drawn = _jsx(DrawnValue, { ...props, rule: rule });
62
+ /* A rule's `copy` puts a copy button beside the value — not where the value stands inside a target of its own (a
63
+ card, a row that opens: a button in a button is neither), and not for a value a mask hides. */
64
+ if (!rule?.copy ||
65
+ !links ||
66
+ value === null ||
67
+ value === undefined ||
68
+ value === '' ||
69
+ maskedText(rule, value) !== undefined ||
70
+ !shellBody().classList.contains('app-mode'))
71
+ return drawn;
72
+ return (_jsxs("span", { className: "value-copyable", children: [drawn, _jsx(CopyValue, { value: value, label: columnLabel(tableId, col?.name ?? '') ?? humanName(col?.name ?? '') })] }));
73
+ }
74
+ /** The stored value to the clipboard, as stored: an id past 2^53 arrives as a string and is copied as one. */
75
+ function CopyValue({ value, label }) {
76
+ const named = say('copyValue', { label });
77
+ return (_jsx("button", { type: "button", className: "value-copy", "aria-label": named, title: named, onClick: () => {
78
+ const text = typeof value === 'object' ? JSON.stringify(value) : String(value);
79
+ navigator.clipboard
80
+ .writeText(text)
81
+ .then(() => toast(say('copiedValue', { label })))
82
+ /* The clipboard can be refused — an insecure origin, a permission denied; the value is on screen. */
83
+ .catch(() => toast(say('common.theBrowserRefusedClipboard'), 'error'));
84
+ }, children: _jsx(Icon, { name: "copy", size: 16 }) }));
85
+ }
86
+ function DrawnValue(props) {
87
+ const { col, value, tableId, compact = false, rule } = props;
47
88
  /* The App's own renderer, where its display rule names one: the value drawn
48
89
  the platform's way until it has arrived, and whenever it cannot draw. An
49
90
  empty value is the platform's to say, as it is in a grid cell. */
@@ -71,10 +112,29 @@ function PlatformValue({ col, value, tableId, compact = false, links = !compact,
71
112
  return (_jsx("span", { className: "null", title: "null", children: emptyWord() }));
72
113
  return (_jsx("span", { className: "value-tags", children: chips.map((chip) => (_jsx("span", { className: `record-tag tone tone-${chip.tone ?? 'neutral'}`, children: chip.label }, chip.label))) }));
73
114
  }
74
- const json = jsonValueOf(col, value);
75
- if (json)
76
- return compact ? _jsx("span", { className: "json-preview-text", children: previewOf(json.value) }) : _jsx(JsonValue, { value: json.value });
77
115
  const declared = tableId === undefined ? null : columnDisplay(tableId, col?.name ?? '');
116
+ const json = jsonValueOf(col, value);
117
+ if (json) {
118
+ /* A list of plain values (roles, tags, sizes) is its values, each said in the rule's words as a single value is
119
+ (`values`, `humanize`), plainly: Raw and Copy belong to a document whose braces a reader may want, and are
120
+ not drawn over a row of chips. */
121
+ const items = Array.isArray(json.value) && json.value.length && json.value.every((item) => item === null || typeof item !== 'object');
122
+ const shown = items
123
+ ? json.value.map((item) => (typeof item === 'string' ? (wordFor(declared, item) ?? item) : item))
124
+ : json.value;
125
+ /* Where there is one line (a cell, a header's fact, a figure) a list of plain values is its words, comma between,
126
+ with no brackets: "Ram, Truck". Chips are for a field block, where there is room for them; `format: 'items'`
127
+ asks for one item per line there instead, as a text of lines is said. */
128
+ if (items && compact) {
129
+ const text = itemsText(shown);
130
+ return (_jsx("span", { className: "json-preview-text", title: text, children: text }));
131
+ }
132
+ if (items && declared?.format === 'items')
133
+ return (_jsx("ul", { className: "value-items", children: shown.map((item, index) => (_jsx("li", { children: String(item) }, index))) }));
134
+ if (compact)
135
+ return _jsx("span", { className: "json-preview-text", children: previewOf(shown) });
136
+ return _jsx(JsonValue, { value: shown, bar: !items });
137
+ }
78
138
  /* A money column whose currency is the record's own: the code its row holds. */
79
139
  const owned = declared?.currencyColumn && row
80
140
  ? { ...declared, currency: rowCurrency(declared, row, declared.currency ?? '') || undefined }
@@ -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 column the grid's rows are grouped by: read in its order, each group under a head with its count and subtotals. */
23
+ group?: string;
22
24
  /** Row height; 'comfortable' is the default. */
23
25
  density?: 'comfortable' | 'compact';
24
26
  /** A ⋯ menu at the end of each row with the record's own actions. */
@@ -6,6 +6,7 @@ export declare const CHROME_ICON_GLYPHS: {
6
6
  'calendar-blank': [string[], string[]];
7
7
  bell: [string[], string[]];
8
8
  'check-circle': [string[], string[]];
9
+ copy: [string[], string[]];
9
10
  gear: [string[], string[]];
10
11
  list: [string[], string[]];
11
12
  lock: [string[], string[]];
@@ -6,6 +6,7 @@ export const CHROME_ICON_GLYPHS = {
6
6
  'calendar-blank': [["M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"], ["M208,28H188V24a12,12,0,0,0-24,0v4H92V24a12,12,0,0,0-24,0v4H48A20,20,0,0,0,28,48V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V48A20,20,0,0,0,208,28ZM68,52a12,12,0,0,0,24,0h72a12,12,0,0,0,24,0h16V76H52V52ZM52,204V100H204V204Z"]],
7
7
  'bell': [["M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"], ["M225.29,165.93C216.61,151,212,129.57,212,104a84,84,0,0,0-168,0c0,25.58-4.59,47-13.27,61.93A20.08,20.08,0,0,0,30.66,186,19.77,19.77,0,0,0,48,196H84.18a44,44,0,0,0,87.64,0H208a19.77,19.77,0,0,0,17.31-10A20.08,20.08,0,0,0,225.29,165.93ZM128,212a20,20,0,0,1-19.6-16h39.2A20,20,0,0,1,128,212ZM54.66,172C63.51,154,68,131.14,68,104a60,60,0,0,1,120,0c0,27.13,4.48,50,13.33,68Z"]],
8
8
  'check-circle': [["M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"], ["M176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51ZM236,128A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z"]],
9
+ 'copy': [["M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"], ["M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"]],
9
10
  'gear': [["M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"], ["M128,76a52,52,0,1,0,52,52A52.06,52.06,0,0,0,128,76Zm0,80a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm92-27.21v-1.58l14-17.51a12,12,0,0,0,2.23-10.59A111.75,111.75,0,0,0,225,71.89,12,12,0,0,0,215.89,66L193.61,63.5l-1.11-1.11L190,40.1A12,12,0,0,0,184.11,31a111.67,111.67,0,0,0-27.23-11.27A12,12,0,0,0,146.3,22L128.79,36h-1.58L109.7,22a12,12,0,0,0-10.59-2.23A111.75,111.75,0,0,0,71.89,31.05,12,12,0,0,0,66,40.11L63.5,62.39,62.39,63.5,40.1,66A12,12,0,0,0,31,71.89,111.67,111.67,0,0,0,19.77,99.12,12,12,0,0,0,22,109.7l14,17.51v1.58L22,146.3a12,12,0,0,0-2.23,10.59,111.75,111.75,0,0,0,11.29,27.22A12,12,0,0,0,40.11,190l22.28,2.48,1.11,1.11L66,215.9A12,12,0,0,0,71.89,225a111.67,111.67,0,0,0,27.23,11.27A12,12,0,0,0,109.7,234l17.51-14h1.58l17.51,14a12,12,0,0,0,10.59,2.23A111.75,111.75,0,0,0,184.11,225a12,12,0,0,0,5.91-9.06l2.48-22.28,1.11-1.11L215.9,190a12,12,0,0,0,9.06-5.91,111.67,111.67,0,0,0,11.27-27.23A12,12,0,0,0,234,146.3Zm-24.12-4.89a70.1,70.1,0,0,1,0,8.2,12,12,0,0,0,2.61,8.22l12.84,16.05A86.47,86.47,0,0,1,207,166.86l-20.43,2.27a12,12,0,0,0-7.65,4,69,69,0,0,1-5.8,5.8,12,12,0,0,0-4,7.65L166.86,207a86.47,86.47,0,0,1-10.49,4.35l-16.05-12.85a12,12,0,0,0-7.5-2.62c-.24,0-.48,0-.72,0a70.1,70.1,0,0,1-8.2,0,12.06,12.06,0,0,0-8.22,2.6L99.63,211.33A86.47,86.47,0,0,1,89.14,207l-2.27-20.43a12,12,0,0,0-4-7.65,69,69,0,0,1-5.8-5.8,12,12,0,0,0-7.65-4L49,166.86a86.47,86.47,0,0,1-4.35-10.49l12.84-16.05a12,12,0,0,0,2.61-8.22,70.1,70.1,0,0,1,0-8.2,12,12,0,0,0-2.61-8.22L44.67,99.63A86.47,86.47,0,0,1,49,89.14l20.43-2.27a12,12,0,0,0,7.65-4,69,69,0,0,1,5.8-5.8,12,12,0,0,0,4-7.65L89.14,49a86.47,86.47,0,0,1,10.49-4.35l16.05,12.85a12.06,12.06,0,0,0,8.22,2.6,70.1,70.1,0,0,1,8.2,0,12,12,0,0,0,8.22-2.6l16.05-12.85A86.47,86.47,0,0,1,166.86,49l2.27,20.43a12,12,0,0,0,4,7.65,69,69,0,0,1,5.8,5.8,12,12,0,0,0,7.65,4L207,89.14a86.47,86.47,0,0,1,4.35,10.49l-12.84,16.05A12,12,0,0,0,195.88,123.9Z"]],
10
11
  'list': [["M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"], ["M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128ZM40,76H216a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24ZM216,180H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"]],
11
12
  'lock': [["M208,80H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Zm-68-56a12,12,0,1,1-12-12A12,12,0,0,1,140,152Z"], ["M208,76H180V56A52,52,0,0,0,76,56V76H48A20,20,0,0,0,28,96V208a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V96A20,20,0,0,0,208,76ZM100,56a28,28,0,0,1,56,0V76H100ZM204,204H52V100H204Zm-60-52a16,16,0,1,1-16-16A16,16,0,0,1,144,152Z"]],
@@ -83,8 +83,8 @@ export interface Section {
83
83
  label: string;
84
84
  view: string;
85
85
  };
86
- /** note: the dashboard's banner, its tag and its picture. */
87
- variant?: 'banner';
86
+ /** note: quiet or callout, or the banner a `banner()` is served as, with its tag and its picture. */
87
+ variant?: 'quiet' | 'callout' | 'banner';
88
88
  eyebrow?: string;
89
89
  image?: import('@mistriwork/engine/shared/servedApp.js').LandingImage;
90
90
  error?: string;
@@ -29,14 +29,20 @@ interface InputComponentProps {
29
29
  required: boolean;
30
30
  /** The field's caption, for a control that names itself. */
31
31
  label: string;
32
- /** The column, or the command's input, it stands for. */
32
+ /** The column, or the command's input, it stands for. A command's input carries the rule a built-in input reads
33
+ from a column's display rule (a rating's `outOf`), having no column to read it from. */
33
34
  field: {
34
35
  name: string;
35
36
  resource?: string;
37
+ rule?: {
38
+ outOf?: number;
39
+ };
36
40
  };
37
41
  /** Which form: a record's edit, a New form, or a command's. */
38
42
  context: 'edit' | 'new' | 'command';
39
43
  }
44
+ /** The input component id of the platform's own input for a format: what a command's field drawn as one asks for. */
45
+ export declare const builtInInputId: (format: string) => string;
40
46
  /** The App's input component for a resource's column, where it declares one (`resources.<name>.inputs`), else the
41
47
  platform's own for the column's display rule, where it has one (a rating's stars, a slider, a color). */
42
48
  export declare function columnInput(tableId: string, column: string): string | undefined;
@@ -5,6 +5,8 @@ import { componentSlot } from './componentSlot.js';
5
5
  /* The platform's own inputs for a display rule's formats — stars, a slider, a color, a time, a month, a year, a JSON document — are
6
6
  named like this and loaded like an author's, from one chunk of their own (builtInInputs.tsx). */
7
7
  const BUILT_IN = 'mistri:';
8
+ /** The input component id of the platform's own input for a format: what a command's field drawn as one asks for. */
9
+ export const builtInInputId = (format) => `${BUILT_IN}${format}`;
8
10
  const Slot = componentSlot({
9
11
  className: 'custom-input',
10
12
  load: (id) => (id.startsWith(BUILT_IN) ? shell().components.builtIn(id.slice(BUILT_IN.length)) : shell().components.load(id)),
@@ -68,6 +68,9 @@ export declare function countLabel(value: object, locale?: string): string;
68
68
  * the document is and a value out of context says nothing.
69
69
  */
70
70
  export declare function previewOf(value: object): string;
71
+ /** A list of plain values said as words, comma between: where one line is all there is room for (a cell, a header's
72
+ fact, a figure). A null among them is a gap nobody reads. */
73
+ export declare function itemsText(items: readonly unknown[]): string;
71
74
  /** What a scalar is best shown as. */
72
75
  export type Scalar = {
73
76
  kind: 'null';
@@ -189,6 +189,14 @@ export function previewOf(value) {
189
189
  const more = keys.length - shown.length;
190
190
  return `{ ${shown.join(', ')}${more ? `, +${more}` : ''} }`;
191
191
  }
192
+ /** A list of plain values said as words, comma between: where one line is all there is room for (a cell, a header's
193
+ fact, a figure). A null among them is a gap nobody reads. */
194
+ export function itemsText(items) {
195
+ return items
196
+ .filter((item) => item !== null && item !== undefined)
197
+ .map((item) => String(item))
198
+ .join(', ');
199
+ }
192
200
  export function scalarOf(value, locale) {
193
201
  if (value === null || value === undefined)
194
202
  return { kind: 'null' };
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { createContext, useContext } from 'react';
11
11
  import { ownedBy } from '../requestIdentity.js';
12
- import { api as request, findTable, labelPath, recordLabel, state } from '../core.js';
12
+ import { api as request, columnDisplay, findTable, labelPath, recordLabel, state } from '../core.js';
13
13
  import { humanName } from '@mistriwork/engine/shared/model.js';
14
14
  import { shell } from '../shellMode.js';
15
15
  import { resourceOf } from './appRooms.js';
@@ -43,5 +43,6 @@ export function recordReadNames() {
43
43
  namePath: (table) => labelPath(table),
44
44
  table: (id) => findTable(id),
45
45
  defined: (id) => resourceOf(shell().app(), id)?.defined,
46
+ display: (id, column) => columnDisplay(id, column),
46
47
  };
47
48
  }
@@ -12,6 +12,9 @@ export interface PageSection {
12
12
  sort?: string;
13
13
  height?: number;
14
14
  target?: number;
15
+ /** A line chart's curve and a donut's middle words, as a dashboard chart's. */
16
+ curve?: 'smooth' | 'straight';
17
+ total?: string;
15
18
  /** A note's words, mark and one way on. */
16
19
  text?: string;
17
20
  icon?: import('@mistriwork/engine/shared/appIcons.js').AppIconName;
@@ -42,8 +45,8 @@ export interface PageSection {
42
45
  from: string;
43
46
  path: string;
44
47
  at: string;
45
- show: string;
46
- detail?: string;
48
+ text: string;
49
+ badge?: string;
47
50
  by?: string;
48
51
  filter?: string;
49
52
  side?: string;
@@ -58,6 +61,8 @@ export interface PageSection {
58
61
  compact?: Record<string, string[]>;
59
62
  /** The other party's rows, drawn against the far edge: asked by the server as each stream's `side` read (SectionPlan). */
60
63
  side?: string;
64
+ /** Reactions under each entry, their columns named by the server (page.ts timelineReactions). */
65
+ reactions?: import('@mistriwork/engine/shared/pageModel.js').TimelineReactions;
61
66
  filter?: string;
62
67
  fn?: string;
63
68
  column?: string;
@@ -82,15 +87,17 @@ export interface PageSection {
82
87
  headerActions?: string[];
83
88
  /** A headline's second figure, its figure's earlier value, and small print. */
84
89
  subfigure?: string;
90
+ subtitle?: string;
85
91
  was?: string;
86
92
  note?: string;
87
93
  /** A similar list: rows of the page's own table sharing the record's `same` values, `near` its numbers. */
88
94
  similar?: import('@mistriwork/engine/shared/pageModel.js').PageSimilar;
95
+ opens?: string;
89
96
  workflow?: ResolvedWorkflowStatus;
90
97
  create?: RelatedCreate<string>;
91
98
  empty?: import('@mistriwork/engine/shared/listPresentations.js').AppListEmpty;
92
99
  /** Authored `empty: 'hide' | 'collapse'`: the list is left out, or said in one line, while it has no rows. */
93
- emptyMode?: 'hide' | 'collapse';
100
+ emptyMode?: 'hide' | 'collapse' | 'show';
94
101
  /** The rows under a header for each record they share (shared/pageModel.ts, PageGroup); `limit` is then the rows to a group. */
95
102
  group?: import('@mistriwork/engine/shared/pageModel.js').PageGroup;
96
103
  /** Columns summed in the list's footer, over every row it matches. */
@@ -140,8 +147,8 @@ export interface SectionPlan {
140
147
  view?: ViewDef;
141
148
  from: string;
142
149
  at: string;
143
- show: string;
144
- detail?: string;
150
+ text: string;
151
+ badge?: string;
145
152
  by?: string;
146
153
  /** A timeline's `side`: the stream's key columns, and its read narrowed to the other party's rows. */
147
154
  key?: string[];
@@ -150,6 +157,8 @@ export interface SectionPlan {
150
157
  empty?: boolean;
151
158
  view?: ViewDef;
152
159
  };
160
+ /** The column the section's reactions name this stream's rows by, read with them (pagePlans.ts). */
161
+ reacts?: string;
153
162
  }>;
154
163
  /** A custom section's reads, each planned as a list, by name. */
155
164
  reads?: Record<string, {
@@ -0,0 +1,20 @@
1
+ import type { TimelineReactions as Reactions } from '@mistriwork/engine/shared/pageModel.js';
2
+ /** An entry as the reactions name it: the column of its table `whose` refers to (its key), and its value there. */
3
+ export interface ReactionEntry {
4
+ column: string;
5
+ value: string | number;
6
+ }
7
+ /** Every entry's counts by kind, and the kinds the reader gave, keyed by `entryKey`. */
8
+ export interface ReactionTally {
9
+ counts: ReadonlyMap<string, number>;
10
+ mine: ReadonlySet<string>;
11
+ }
12
+ export declare const entryKey: (entry: string | number, kind: string) => string;
13
+ /**
14
+ * The tally for these entries, and whether it is still on its way: a reader who may not read the reactions gets none
15
+ * (and is not kept waiting), and the entries draw no row.
16
+ */
17
+ export declare function useReactionTally(reactions: Reactions | undefined, entries: ReadonlyArray<string | number>): {
18
+ tally?: ReactionTally;
19
+ waiting: boolean;
20
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The page's reactions, counted: one breakdown over every entry on the page by kind, and the reader's own beside it
3
+ * (`<by> = me`), asked in the same moment so they travel as one request (breakdownBatch.ts). On the page's own path,
4
+ * so a timeline holds its rows until the counts are in and nothing moves when they come; the row that draws them is a
5
+ * part of its own (TimelineReactions.tsx).
6
+ */
7
+ import { useQuery } from '@tanstack/react-query';
8
+ import { andQuery, quoteValue } from '@mistriwork/engine/shared/query.js';
9
+ import { batchedBreakdown } from '../breakdownBatch.js';
10
+ /* The query language's word for the signed-in reader: their row of `auth.me`'s table, read where the rows are. */
11
+ const ME = 'me';
12
+ export const entryKey = (entry, kind) => JSON.stringify([String(entry), kind]);
13
+ /* A breakdown's rows as [entry, kind, count]: its first two columns are the keys it was asked by, the last the count. */
14
+ function tallied(answer) {
15
+ const data = answer;
16
+ if (data.errors?.length || !data.columns || data.columns.length < 3)
17
+ throw new Error('reactions');
18
+ const [entry, kind] = data.columns;
19
+ const count = data.columns.at(-1);
20
+ return (data.rows ?? []).map((row) => [String(row[entry]), String(row[kind]), Number(row[count]) || 0]);
21
+ }
22
+ /**
23
+ * The tally for these entries, and whether it is still on its way: a reader who may not read the reactions gets none
24
+ * (and is not kept waiting), and the entries draw no row.
25
+ */
26
+ export function useReactionTally(reactions, entries) {
27
+ const asked = Boolean(reactions?.whose && reactions.by && reactions.column && entries.length);
28
+ const tally = useQuery({
29
+ queryKey: ['page-reactions', reactions, entries],
30
+ enabled: asked,
31
+ queryFn: async () => {
32
+ const { from, whose, by, column, kinds } = reactions;
33
+ const these = andQuery(`${whose} in (${entries.map(quoteValue).join(', ')})`, `${column} in (${kinds.map(quoteValue).join(', ')})`);
34
+ const most = entries.length * kinds.length;
35
+ const ask = (narrow) => batchedBreakdown({ text: [from, narrow, 'count by', `${whose}, ${column}`].join(' '), limit: most });
36
+ const [all, own] = await Promise.all([ask(these), ask(andQuery(these, `${by} = ${ME}`))]);
37
+ return {
38
+ counts: new Map(tallied(all).map(([entry, kind, count]) => [entryKey(entry, kind), count])),
39
+ mine: new Set(tallied(own).flatMap(([entry, kind, count]) => (count > 0 ? [entryKey(entry, kind)] : []))),
40
+ };
41
+ },
42
+ staleTime: 0,
43
+ retry: false,
44
+ });
45
+ return { ...(asked && tally.isSuccess ? { tally: tally.data } : {}), waiting: asked && tally.isPending };
46
+ }
@@ -0,0 +1,11 @@
1
+ import type { TableMeta } from '@mistriwork/engine/shared/schema.js';
2
+ import type { GridGroup } from './Grid.js';
3
+ export declare function useGridGroups({ column, table, query, totals, connection, }: {
4
+ /** The view's `group`; absent, the grid is not grouped and nothing is asked. */
5
+ column: string | undefined;
6
+ table: TableMeta | undefined;
7
+ /** The list's question as the reader has it: its conditions are the heads' too, its sort and page are not. */
8
+ query: string;
9
+ totals: readonly string[] | undefined;
10
+ connection: string | null | undefined;
11
+ }): GridGroup | undefined;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * A grouped grid's heads (a list view's `group`): one breakdown of the group's column over everything the list's
3
+ * conditions match — each value's rows counted and each `totals` column summed — never a read per group. Asked in the
4
+ * list's own query family, as the footer's sums are, so a write that redraws the rows redraws the heads with them.
5
+ * The rows themselves are read in the group's order (listQuestion.ts groupedQuestion, in TableRoom.tsx), so the grid
6
+ * draws a head wherever a run of one value begins (Grid.tsx `group`).
7
+ */
8
+ import { useMemo } from 'react';
9
+ import { useQuery } from '@tanstack/react-query';
10
+ import { humanName } from '@mistriwork/engine/shared/model.js';
11
+ import { api, columnDisplay, columnLabel, state } from '../core.js';
12
+ import { splitQuery } from '../clauses.js';
13
+ import { presentationColumns } from './columnPresentation.js';
14
+ import { groupLabel } from './valueModel.js';
15
+ import { say } from '../copy/lists/components/useGridGroups.js';
16
+ /** The most groups one list's heads are read for: past it a run of rows still stands under its value, uncounted. */
17
+ const GROUP_HEADS = 500;
18
+ const keyText = (value) => (value === null || value === undefined ? '\u0000' : String(value));
19
+ export function useGridGroups({ column, table, query, totals, connection, }) {
20
+ const tableId = table?.id ?? '';
21
+ const text = column
22
+ ? [
23
+ tableId,
24
+ splitQuery(query).filter,
25
+ ['count as group_rows', ...(totals ?? []).map((name, i) => `sum ${name} as total_${i}`)].join(', '),
26
+ `by ${column}`,
27
+ ]
28
+ .filter(Boolean)
29
+ .join(' ')
30
+ : '';
31
+ const answer = useQuery({
32
+ queryKey: ['run', connection ?? '', 'groups', text],
33
+ queryFn: async () => {
34
+ const data = (await api('/api/breakdown', { text, limit: GROUP_HEADS }));
35
+ return data.errors?.length ? null : data;
36
+ },
37
+ enabled: Boolean(column && table),
38
+ });
39
+ const heads = answer.data;
40
+ return useMemo(() => {
41
+ if (!column || !table)
42
+ return undefined;
43
+ const keyName = heads?.columns?.[0];
44
+ const counted = new Map((heads?.rows ?? []).map((row) => [keyText(keyName ? row[keyName] : undefined), row]));
45
+ const names = keyName ? heads?.names?.[keyName] : undefined;
46
+ const display = columnDisplay(tableId, column);
47
+ const allowed = presentationColumns(state.schema, table, [column]).get(column)?.allowed;
48
+ /* "No stage": the column's caption in its sentence, an acronym kept as it is (PageGroups.tsx's rule). */
49
+ const caption = columnLabel(tableId, column) ?? humanName(column.replace(/_id$/, ''));
50
+ const noValue = say('noGroupValue', { caption: /^[A-Z][a-z]/.test(caption) ? caption[0].toLowerCase() + caption.slice(1) : caption });
51
+ return {
52
+ column,
53
+ head: (value) => {
54
+ const label = value === null || value === undefined
55
+ ? noValue
56
+ : names && Object.hasOwn(names, String(value))
57
+ ? names[String(value)]
58
+ : groupLabel(display, value, allowed);
59
+ const row = counted.get(keyText(value));
60
+ if (!row)
61
+ return { label };
62
+ return {
63
+ label,
64
+ count: Number(row.group_rows) || 0,
65
+ ...(totals?.length ? { sums: Object.fromEntries(totals.map((name, i) => [name, row[`total_${i}`] ?? 0])) } : {}),
66
+ };
67
+ },
68
+ };
69
+ }, [column, table, tableId, heads, totals]);
70
+ }
@@ -27,6 +27,8 @@ interface GridKeyboardOptions {
27
27
  /** So a screen reader hears "of 63,010" rather than "of 20". */
28
28
  totalRows?: number;
29
29
  firstRow: number;
30
+ /** Rows the cursor passes over: a folded group's (Grid.tsx `group`), which are not drawn. */
31
+ skip?: (index: number) => boolean;
30
32
  }
31
33
  export declare function useGridKeyboard(tableRef: RefObject<HTMLTableElement | null>, wrapRef: RefObject<HTMLElement | null>, opts: GridKeyboardOptions): void;
32
34
  export {};
@@ -27,6 +27,9 @@ export function useGridKeyboard(tableRef, wrapRef, opts) {
27
27
  send the reader back to the top-left corner. */
28
28
  const cursor = useRef({ row: -1, col: 0 });
29
29
  const { rowCount, columnCount, offset, onOpen, onPeek, totalRows, firstRow } = opts;
30
+ /* Read when a key is pressed, so a group folded or opened does not rebind the grid's keys. */
31
+ const skip = useRef(opts.skip);
32
+ skip.current = opts.skip;
30
33
  useEffect(() => {
31
34
  const table = tableRef.current;
32
35
  const wrap = wrapRef.current;
@@ -85,9 +88,23 @@ export function useGridKeyboard(tableRef, wrapRef, opts) {
85
88
  cell.focus({ preventScroll: true });
86
89
  cell.scrollIntoView({ block: 'nearest', inline: 'nearest' });
87
90
  };
91
+ /* The nearest row that is drawn, on from `row` the way the cursor travels, else back the other way; a folded
92
+ group's rows are stepped over as if they were not there. */
93
+ const drawnRow = (row, way) => {
94
+ const passes = skip.current;
95
+ if (!passes)
96
+ return row;
97
+ for (const step of [way, -way]) {
98
+ for (let at = row; at >= 0 && at < rowCount; at += step)
99
+ if (!passes(at))
100
+ return at;
101
+ }
102
+ return cursor.current.row;
103
+ };
88
104
  const moveTo = (nextRow, nextCol) => {
105
+ const row = Math.max(0, Math.min(rowCount - 1, nextRow));
89
106
  cursor.current = {
90
- row: Math.max(0, Math.min(rowCount - 1, nextRow)),
107
+ row: drawnRow(row, row < cursor.current.row ? -1 : 1),
91
108
  col: Math.max(0, Math.min(columnCount - 1, nextCol)),
92
109
  };
93
110
  focusCell();
@@ -82,6 +82,8 @@ export interface DisplayRule {
82
82
  table: string;
83
83
  key: string;
84
84
  };
85
+ /** A copy button beside the value on a record. */
86
+ copy?: boolean;
85
87
  }
86
88
  /**
87
89
  * How a set of dates drawn together is said: one way down a column. A relative date is said from today only where
@@ -210,6 +212,10 @@ export type Dress = {
210
212
  kind: 'items';
211
213
  items: string[];
212
214
  text: string;
215
+ } | {
216
+ kind: 'address';
217
+ lines: string[];
218
+ text: string;
213
219
  } | {
214
220
  kind: 'avatars';
215
221
  names: string[];
@@ -283,11 +289,11 @@ export type Said = {
283
289
  prose: boolean;
284
290
  };
285
291
  export declare function sayValue(col: ColumnMeta | undefined, value: unknown): Said;
286
- /** The values a reader acts on rather than reads: an address to write to, a number to call, a page to open. */
287
- type LinkKind = 'email' | 'phone' | 'url';
292
+ /** The values a reader acts on rather than reads: an address to write to, a number to call, a page to open, a place to find. */
293
+ type LinkKind = 'email' | 'phone' | 'url' | 'address';
288
294
  /**
289
295
  * A value as a link, when it is one: a rule's `format: 'email' | 'phone' |
290
- * 'url'`, or — where `infer` (an App) — a column named like one. Only a
296
+ * 'url' | 'address'` (an address opens a map search for it), or — where `infer` (an App) — a column named like one. Only a
291
297
  * value of the right shape is linked, so a note typed into an email column
292
298
  * stays text, and only https and http open: a column cannot hand the page a
293
299
  * `javascript:` address. The Workbench shows the data exactly and infers
@@ -297,4 +303,5 @@ export declare function linkFor(column: string | undefined, value: unknown, rule
297
303
  kind: LinkKind;
298
304
  href: string;
299
305
  text: string;
306
+ lines?: string[];
300
307
  } | null;
@@ -440,6 +440,10 @@ function ownDrawing(rule, value, text) {
440
440
  }
441
441
  case 'qr':
442
442
  return text.trim() ? { kind: 'qr', text } : null;
443
+ case 'address': {
444
+ const lines = addressLines(text);
445
+ return lines.length ? { kind: 'address', lines, text: lines.join(', ') } : null;
446
+ }
443
447
  }
444
448
  return undefined;
445
449
  }
@@ -517,6 +521,16 @@ export function sayValue(col, value) {
517
521
  return { kind: 'long', text };
518
522
  return { kind: 'text', text, prose: /\s/.test(text.trim()) };
519
523
  }
524
+ /** A postal address's lines as typed: one part per line, blank lines and stray spaces gone. */
525
+ function addressLines(text) {
526
+ return text
527
+ .split(/\r?\n/)
528
+ .map((line) => line.trim().replace(/\s+/g, ' '))
529
+ .filter(Boolean);
530
+ }
531
+ /* A map search for an address, opened beside the App: a link, so nothing is fetched to draw the value and the
532
+ reader's own maps take it from there. */
533
+ const MAP_SEARCH = 'https://www.google.com/maps/search/?api=1&query=';
520
534
  const EMAIL = /^[^\s@<>()"',;:]+@[^\s@<>()"',;:]+\.[^\s@<>()"',;:]+$/;
521
535
  const PHONE = /^\+?[\d\s().-]+$/;
522
536
  const WEB = /^(https?:\/\/)?[\p{L}\p{N}-]+(\.[\p{L}\p{N}-]+)+(:\d+)?([/?#]\S*)?$/iu;
@@ -529,7 +543,7 @@ const NAMED = [
529
543
  ];
530
544
  /**
531
545
  * A value as a link, when it is one: a rule's `format: 'email' | 'phone' |
532
- * 'url'`, or — where `infer` (an App) — a column named like one. Only a
546
+ * 'url' | 'address'` (an address opens a map search for it), or — where `infer` (an App) — a column named like one. Only a
533
547
  * value of the right shape is linked, so a note typed into an email column
534
548
  * stays text, and only https and http open: a column cannot hand the page a
535
549
  * `javascript:` address. The Workbench shows the data exactly and infers
@@ -552,6 +566,12 @@ export function linkFor(column, value, rule, infer = false) {
552
566
  return { kind, href: `mailto:${text}`, text };
553
567
  if (kind === 'phone' && PHONE.test(text) && text.replace(/\D/g, '').length >= 5)
554
568
  return { kind, href: `tel:${text.replace(/[^\d+]/g, '')}`, text };
569
+ if (format === 'address') {
570
+ const lines = addressLines(text);
571
+ return lines.length
572
+ ? { kind: 'address', href: `${MAP_SEARCH}${encodeURIComponent(lines.join(', '))}`, text: lines.join(', '), lines }
573
+ : null;
574
+ }
555
575
  if (kind === 'url' && WEB.test(text)) {
556
576
  const href = /^https?:\/\//i.test(text) ? text : `https://${text}`;
557
577
  return { kind, href, text: text.replace(/^https?:\/\//i, '').replace(/\/$/, '') };
@@ -0,0 +1,9 @@
1
+ export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly choose: "Choose…";
3
+ readonly loading: "Loading…";
4
+ readonly couldNotLoad: "The choices could not be loaded.";
5
+ readonly nothingToChoose: "Nothing to choose from.";
6
+ readonly noMatches: "Nothing matches.";
7
+ readonly firstOnly: "The first {count} only. Type to search.";
8
+ readonly path: "Path";
9
+ }>;
@@ -0,0 +1,11 @@
1
+ /** What TreePicker says, in the forms room (packages/kit/src/client/messages.ts says how the catalog is split). */
2
+ import { defineMessages } from '../../../messages.js';
3
+ export const say = defineMessages({
4
+ choose: 'Choose…',
5
+ loading: 'Loading…',
6
+ couldNotLoad: 'The choices could not be loaded.',
7
+ nothingToChoose: 'Nothing to choose from.',
8
+ noMatches: 'Nothing matches.',
9
+ firstOnly: 'The first {count} only. Type to search.',
10
+ path: 'Path',
11
+ });
@@ -26,5 +26,5 @@ export declare const say: import("../../../messages.js").RoomMessage<{
26
26
  readonly one: "{count} row, drawn as you scroll.";
27
27
  readonly other: "{count} rows, drawn as you scroll.";
28
28
  };
29
- readonly defaultOrderRowsHaveToCome: "default order — rows have to come back in some order, and this is the one tablewalk chose";
29
+ readonly defaultOrderRowsHaveToCome: "default order — rows have to come back in some order, and this is the one used when none is asked for";
30
30
  }>;
@@ -25,5 +25,5 @@ export const say = defineMessages({
25
25
  resizeColumnHint: 'Drag or use arrow keys to resize {name}; double-click or Alt+Backspace to restore its fitted width',
26
26
  actions: 'Actions',
27
27
  rowsDrawnAsYouScroll: { one: '{count} row, drawn as you scroll.', other: '{count} rows, drawn as you scroll.' },
28
- defaultOrderRowsHaveToCome: 'default order — rows have to come back in some order, and this is the one tablewalk chose',
28
+ defaultOrderRowsHaveToCome: 'default order — rows have to come back in some order, and this is the one used when none is asked for',
29
29
  });