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

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 (58) hide show
  1. package/dist/client/app.js +2 -1
  2. package/dist/client/components/AppList.js +12 -1
  3. package/dist/client/components/Dressed.js +3 -0
  4. package/dist/client/components/Editable.js +3 -2
  5. package/dist/client/components/ErrorBoundary.js +1 -1
  6. package/dist/client/components/Grid.d.ts +15 -1
  7. package/dist/client/components/Grid.js +44 -7
  8. package/dist/client/components/NewRecord.d.ts +3 -1
  9. package/dist/client/components/NewRecord.js +16 -5
  10. package/dist/client/components/PageFlowDiagram.css +1 -1
  11. package/dist/client/components/PageTimeline.js +18 -4
  12. package/dist/client/components/RecordSummaries.d.ts +5 -3
  13. package/dist/client/components/RecordSummaries.js +11 -2
  14. package/dist/client/components/TableRoom.d.ts +4 -1
  15. package/dist/client/components/TableRoom.js +10 -5
  16. package/dist/client/components/TableView.d.ts +4 -2
  17. package/dist/client/components/TableView.js +3 -3
  18. package/dist/client/components/TimelineReactions.css +49 -0
  19. package/dist/client/components/TimelineReactions.d.ts +18 -0
  20. package/dist/client/components/TimelineReactions.js +58 -0
  21. package/dist/client/components/TreePicker.css +25 -0
  22. package/dist/client/components/TreePicker.d.ts +59 -0
  23. package/dist/client/components/TreePicker.js +407 -0
  24. package/dist/client/components/Value.js +33 -2
  25. package/dist/client/components/appListModel.d.ts +2 -0
  26. package/dist/client/components/chromeIcons.d.ts +1 -0
  27. package/dist/client/components/chromeIcons.js +1 -0
  28. package/dist/client/components/inputRenderers.d.ts +7 -1
  29. package/dist/client/components/inputRenderers.js +2 -0
  30. package/dist/client/components/pageModel.d.ts +4 -0
  31. package/dist/client/components/reactionTally.d.ts +20 -0
  32. package/dist/client/components/reactionTally.js +46 -0
  33. package/dist/client/components/useGridGroups.d.ts +11 -0
  34. package/dist/client/components/useGridGroups.js +70 -0
  35. package/dist/client/components/useGridKeyboard.d.ts +2 -0
  36. package/dist/client/components/useGridKeyboard.js +18 -1
  37. package/dist/client/components/valueModel.d.ts +10 -3
  38. package/dist/client/components/valueModel.js +21 -1
  39. package/dist/client/copy/forms/components/TreePicker.d.ts +9 -0
  40. package/dist/client/copy/forms/components/TreePicker.js +11 -0
  41. package/dist/client/copy/lists/components/Grid.d.ts +1 -1
  42. package/dist/client/copy/lists/components/Grid.js +1 -1
  43. package/dist/client/copy/lists/components/useGridGroups.d.ts +3 -0
  44. package/dist/client/copy/lists/components/useGridGroups.js +5 -0
  45. package/dist/client/copy/record/components/TimelineReactions.d.ts +7 -0
  46. package/dist/client/copy/record/components/TimelineReactions.js +6 -0
  47. package/dist/client/copy/record/components/Value.d.ts +3 -0
  48. package/dist/client/copy/record/components/Value.js +3 -0
  49. package/dist/client/copy/shell/components/ErrorBoundary.d.ts +1 -1
  50. package/dist/client/copy/shell/components/ErrorBoundary.js +1 -1
  51. package/dist/client/features.css +35 -1
  52. package/dist/client/index.html +1 -1
  53. package/dist/client/page.css +3 -2
  54. package/dist/client/shellHost.d.ts +1 -1
  55. package/dist/client/shellHost.js +1 -1
  56. package/dist/client/structure.css +11 -3
  57. package/dist/client/style.css +11 -2
  58. package/package.json +3 -3
@@ -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
  });
@@ -0,0 +1,3 @@
1
+ export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly noGroupValue: "No {caption}";
3
+ }>;
@@ -0,0 +1,5 @@
1
+ /** What a grouped grid's heads say (useGridGroups.ts), in the lists and grid 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
+ noGroupValue: 'No {caption}',
5
+ });
@@ -0,0 +1,7 @@
1
+ export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly reactions: "Reactions";
3
+ readonly reactionCount: {
4
+ readonly one: "{kind}, {count} reaction";
5
+ readonly other: "{kind}, {count} reactions";
6
+ };
7
+ }>;
@@ -0,0 +1,6 @@
1
+ /** What TimelineReactions says, in the record page 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
+ reactions: 'Reactions',
5
+ reactionCount: { one: '{kind}, {count} reaction', other: '{kind}, {count} reactions' },
6
+ });
@@ -1,4 +1,7 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
2
  readonly openReference: "Open {label} ({table} {key})";
3
3
  readonly openTableKey: "Open {table} {key}";
4
+ readonly copyValue: "Copy {label}";
5
+ readonly copiedValue: "Copied {label}.";
6
+ readonly findOnAMap: "Find on a map";
4
7
  }>;
@@ -3,4 +3,7 @@ import { defineMessages } from '../../../messages.js';
3
3
  export const say = defineMessages({
4
4
  openReference: 'Open {label} ({table} {key})',
5
5
  openTableKey: 'Open {table} {key}',
6
+ copyValue: 'Copy {label}',
7
+ copiedValue: 'Copied {label}.',
8
+ findOnAMap: 'Find on a map',
6
9
  });
@@ -1,4 +1,4 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
- readonly tablewalkASectionCould: "a section could not be drawn.";
2
+ readonly aSectionCouldNotBeDrawn: "a section could not be drawn.";
3
3
  readonly unknownError: "Unknown error";
4
4
  }>;
@@ -1,6 +1,6 @@
1
1
  /** What ErrorBoundary says, in the shell room (packages/kit/src/client/messages.ts says how the catalog is split). */
2
2
  import { defineMessages } from '../../../messages.js';
3
3
  export const say = defineMessages({
4
- tablewalkASectionCould: 'a section could not be drawn.',
4
+ aSectionCouldNotBeDrawn: 'a section could not be drawn.',
5
5
  unknownError: 'Unknown error',
6
6
  });
@@ -1138,7 +1138,7 @@ body.app-mobile-nav .sidebar-reveal { display: none; }
1138
1138
  body.app-mobile-nav .topnav { display: flex; flex: none; align-self: center; margin: 0; min-width: auto; }
1139
1139
  .tn-mobile-menu { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 36px; padding: 0 var(--space-3); border: 0; background: transparent; color: var(--ink-muted); font: var(--type-ui) var(--sans); }
1140
1140
  .tn-mobile-menu:hover { color: var(--ink); background: var(--raised); }
1141
- .tn-mobile-menu .tw-icon { width: 17px; height: 17px; }
1141
+ .tn-mobile-menu .mistri-icon { width: 17px; height: 17px; }
1142
1142
  .modal.mobile-nav-drawer { position: fixed; inset: 0 auto 0 0; width: min(20rem, calc(100% - 44px)); height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; transform: none; background: var(--surface); box-shadow: var(--shadow-modal); }
1143
1143
  body.app-mobile-nav .topnav { order: -1; }
1144
1144
  body.app-mobile-nav .brand { flex: 1; min-width: 0; }
@@ -1853,6 +1853,27 @@ body.session-locked > :not(#session-lock) { display: none !important; }
1853
1853
  .inline-edit-button:hover { border-color: var(--line); color: var(--accent-ink); }
1854
1854
  .inline-edit-value:focus-visible, .inline-edit-button:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
1855
1855
  .inline-field-open .cell-edit, .inline-field-open .cell-edit-control { min-width: 0; width: 100%; }
1856
+
1857
+ /* A postal address (`format: 'address'`) on its lines, as an envelope has it. A field's value box clips what falls
1858
+ outside it, and a link's underline sits below its last line's box: the room under it keeps that one underlined. */
1859
+ .value-address { display: inline-grid; padding-block-end: var(--space-1); }
1860
+ .value-address-line { display: block; }
1861
+
1862
+ /* A value with a copy button (`display: { <column>: { copy: true } }`): the button sits after the value at its first
1863
+ line (an address has several), its focus ring clear of the value, the size of a line's mark, and like the pencil waits for a pointer or keyboard focus at a desk and stays on
1864
+ touch. The copy is said by the toast, so the button itself never changes. */
1865
+ .value-copyable { display: inline-flex; align-items: flex-start; gap: var(--space-3); max-width: 100%; min-width: 0; }
1866
+ .value-copyable > :first-child { min-width: 0; overflow-wrap: anywhere; }
1867
+ .value-copy { flex: 0 0 24px; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: var(--field-radius, 2px); background: transparent; color: var(--ink-muted); }
1868
+ .value-copy:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
1869
+ @media (hover: hover) and (pointer: fine) {
1870
+ .value-copy { opacity: 0; }
1871
+ .value-copyable:hover .value-copy, .value-copyable:focus-within .value-copy, .inline-field:hover .value-copy, .inline-field:focus-within .value-copy { opacity: 1; }
1872
+ .value-copy:hover { border-color: var(--line); color: var(--accent-ink); }
1873
+ }
1874
+ @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
1875
+ .value-copy { transition: opacity var(--t-hover) var(--ease-out); }
1876
+ }
1856
1877
  /* The input takes the box the value's button stood in (32px: its 4px pad inside a 1px edge), not the control's own
1857
1878
  padding on top of that floor, which made it 4px taller and moved every row below it on opening and again on closing. */
1858
1879
  .inline-field-open input.cell-edit { padding-block: 0; }
@@ -1893,6 +1914,19 @@ body.session-locked > :not(#session-lock) { display: none !important; }
1893
1914
  .grid-totals-label { font-weight: 500; color: var(--ink-muted); }
1894
1915
  .grid-totals-pending { color: var(--ink-subtle); }
1895
1916
 
1917
+ /* A grouped grid's heads (a list view's `group`): a hairline row over each run of one value, not a box and not a
1918
+ tint — the value, its count in the quiet figure face, and each subtotal under the column it sums. The value is the
1919
+ button that folds the group. */
1920
+ .grid-group-head td { border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
1921
+ .grid-group-toggle {
1922
+ display: inline-flex; align-items: baseline; gap: var(--space-2); min-height: 0; max-width: 100%; padding: 0; border: 0;
1923
+ background: none; font: inherit; font-weight: 600; color: var(--ink); text-align: start; cursor: pointer;
1924
+ }
1925
+ .grid-group-caret { align-self: center; flex: none; color: var(--ink-subtle); }
1926
+ .grid-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1927
+ .grid-group-count { flex: none; font: var(--text-xs) var(--mono); color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
1928
+ .grid-group-sum { font-weight: 600; }
1929
+
1896
1930
  /* A compact list's rows: structure.css, so no look's row padding outranks them. */
1897
1931
 
1898
1932
  /* A row's own menu: the trailing cell, hidden until the row is hovered or
@@ -195,7 +195,7 @@
195
195
  <!-- In an App the button is the search box (app.js adds .tn-search):
196
196
  a mark, a word and the key. A bare "⌘K" was a shortcut with no
197
197
  door; the Workbench keeps its key alone. -->
198
- <svg class="tw-icon tn-search-icon" aria-hidden="true" focusable="false" width="1em" height="1em" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>
198
+ <svg class="mistri-icon tn-search-icon" aria-hidden="true" focusable="false" width="1em" height="1em" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>
199
199
  <span class="tn-search-hint" aria-hidden="true">Search…</span>
200
200
  <span class="tn-search-key" aria-hidden="true">⌘K</span>
201
201
  </button>
@@ -3675,10 +3675,11 @@
3675
3675
  }
3676
3676
  /* An address is read whole or cut with an ellipsis (its title says the rest), never broken mid-word across two lines
3677
3677
  in a column of 8rem: an email takes the card's row. */
3678
- .page-card-fact:has(> dd > a.value-link:is([href^='mailto:'], [href^='http'])) {
3678
+ .page-card-fact:has(> dd > a.value-link:is([href^='mailto:'], [href^='http']):not(.value-address)) {
3679
3679
  grid-column: 1 / -1;
3680
3680
  }
3681
- .page-card-fact > dd > a.value-link:is([href^='mailto:'], [href^='http']) {
3681
+ /* A postal address is not cut: it stands on its own lines (Value.tsx). */
3682
+ .page-card-fact > dd > a.value-link:is([href^='mailto:'], [href^='http']):not(.value-address) {
3682
3683
  display: block;
3683
3684
  overflow: hidden;
3684
3685
  text-overflow: ellipsis;
@@ -8,7 +8,7 @@
8
8
  * Served, the page is the shell's own, and each of these is exactly the
9
9
  * global it names. They are gathered here so that the shell can one day run
10
10
  * inside a page that is not its own — a React host's route, with the host's
11
- * router owning the history, the host's `<title>`, a `.tw-root` element in
11
+ * router owning the history, the host's `<title>`, a `.mistri-root` element in
12
12
  * place of `<html>` — by changing this module rather than four hundred call
13
13
  * sites. test/check-client-host.mjs keeps it the only place: a new
14
14
  * `window.history`, `document.title`, `document.documentElement`, `document.body`,
@@ -8,7 +8,7 @@
8
8
  * Served, the page is the shell's own, and each of these is exactly the
9
9
  * global it names. They are gathered here so that the shell can one day run
10
10
  * inside a page that is not its own — a React host's route, with the host's
11
- * router owning the history, the host's `<title>`, a `.tw-root` element in
11
+ * router owning the history, the host's `<title>`, a `.mistri-root` element in
12
12
  * place of `<html>` — by changing this module rather than four hundred call
13
13
  * sites. test/check-client-host.mjs keeps it the only place: a new
14
14
  * `window.history`, `document.title`, `document.documentElement`, `document.body`,
@@ -485,6 +485,12 @@
485
485
  height: 20px;
486
486
  font-size: var(--text-xs);
487
487
  }
488
+ /* A group's head (Grid.tsx GroupHeadRow) is a hairline, not a row a reader opens: no look's row fill or hover tint
489
+ lands on it, here where it outranks them all. */
490
+ .table-wrap tbody tr.grid-group-head,
491
+ .table-wrap tbody tr.grid-group-head > td {
492
+ background: transparent;
493
+ }
488
494
 
489
495
  /* The folded and drill-in menus are used by thumb: their rows keep a 44px target in every look. */
490
496
  .topnav .tn-pop.tn-folded-pop .tn-popitem {
@@ -862,8 +868,8 @@
862
868
  figure 37px and a plain banner's action 33px: a field report's grade found them on every page. A date's calendar
863
869
  button is 30×40 inside its field and a New sheet's Close 23×25: the same grade found them on every form. A record's
864
870
  value link (a phone number, an address) is 18px, and the 32px pencil beside a link or a reference that edits it,
865
- which the same grade found on every lead: their hit areas are cut at their field's row, below, so a tall one
866
- never reaches into the next field's. */
871
+ which the same grade found on every lead, and a value's 24px copy button: their hit areas are cut at their
872
+ field's row, below, so a tall one never reaches into the next field's. */
867
873
  :where(
868
874
  .brand,
869
875
  .icon-button,
@@ -892,6 +898,7 @@
892
898
  .dashboard-note-action,
893
899
  .peekpanel-close,
894
900
  .inline-edit-button,
901
+ .value-copy,
895
902
  :is(.page-field, .page-card-fact) a.value-link
896
903
  ) {
897
904
  position: relative;
@@ -927,6 +934,7 @@
927
934
  .date-field-trigger,
928
935
  .peekpanel-close,
929
936
  .inline-edit-button,
937
+ .value-copy,
930
938
  :is(.page-field, .page-card-fact) a.value-link
931
939
  )::before {
932
940
  content: '';
@@ -937,7 +945,7 @@
937
945
  height: max(100%, 44px);
938
946
  transform: translate(-50%, -50%);
939
947
  }
940
- :is(.page-field, .page-card-fact):has(a.value-link, .inline-edit-button) {
948
+ :is(.page-field, .page-card-fact):has(a.value-link, .inline-edit-button, .value-copy) {
941
949
  clip-path: inset(0 -100vmax);
942
950
  }
943
951
  /* A folding section's heading draws its chevron on ::before, so its hit area is the ::after. A gantt bar is
@@ -1214,8 +1214,8 @@ td .ref { color: var(--link); text-decoration: underline; text-decoration-style:
1214
1214
  font: inherit; line-height: 1.4;
1215
1215
  }
1216
1216
  .step-control > :not(:first-child) { border-inline-start: 1px solid var(--line); }
1217
- .step-control .tw-icon, .crumb-back .tw-icon { flex: none; }
1218
- .step-control:dir(rtl) .tw-icon, .crumb-back:dir(rtl) .tw-icon { transform: scaleX(-1); }
1217
+ .step-control .mistri-icon, .crumb-back .mistri-icon { flex: none; }
1218
+ .step-control:dir(rtl) .mistri-icon, .crumb-back:dir(rtl) .mistri-icon { transform: scaleX(-1); }
1219
1219
  .step-label { min-inline-size: 0; overflow-wrap: anywhere; }
1220
1220
  .step-position {
1221
1221
  display: flex; align-items: center; justify-content: center;
@@ -1633,6 +1633,15 @@ button.danger { background: var(--status-critical); color: var(--surface); borde
1633
1633
  a phone's screen. */
1634
1634
  .record-summary { padding: var(--space-3h) 0 var(--space-4); border-top: 1px solid var(--line); }
1635
1635
  .record-summary:last-child { border-bottom: 1px solid var(--line); }
1636
+ /* A grouped list's head on a phone (RecordSummaries.tsx): the value, its count and subtotals on one wrapping line,
1637
+ over a stronger rule than a summary's — a hairline row as the grid's head is, not a box. */
1638
+ .record-summary-group {
1639
+ display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3);
1640
+ padding: var(--space-3) 0 var(--space-2); border-top: 1px solid var(--line-strong);
1641
+ }
1642
+ .record-summary-group-name { font: 600 var(--text-md)/1.45 var(--sans); color: var(--ink); }
1643
+ .record-summary-group-count { font: var(--text-xs) var(--mono); color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
1644
+ .record-summary-group-sum { font: var(--text-sm)/1.45 var(--sans); color: var(--ink-muted); }
1636
1645
  .record-summary.is-navigable { cursor: pointer; }
1637
1646
  .record-summary.is-navigable:active { background: var(--raised); }
1638
1647
  .record-summary-title { display: block; width: 100%; min-height: 32px; padding: var(--space-1h) 0; border: 0; border-radius: 0; background: none; text-align: left; font: 600 calc(15px * var(--type-k))/1.45 var(--sans); letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/kit",
3
- "version": "1.0.0-rc.14",
3
+ "version": "1.0.0-rc.15",
4
4
  "description": "The shared React client both shells are drawn with: the walk and the address, Grid, Value, the record page, lists, filters and charts.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {
@@ -82,8 +82,8 @@
82
82
  "./package.json": "./package.json"
83
83
  },
84
84
  "dependencies": {
85
- "@mistriwork/engine": "1.0.0-rc.14",
86
- "@mistriwork/ui": "1.0.0-rc.14",
85
+ "@mistriwork/engine": "1.0.0-rc.15",
86
+ "@mistriwork/ui": "1.0.0-rc.15",
87
87
  "intl-messageformat": "12.1.2",
88
88
  "qrcode-generator": "^2.0.4"
89
89
  },