@mistriwork/kit 1.0.0-rc.13 → 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 (75) hide show
  1. package/dist/client/app.js +2 -1
  2. package/dist/client/components/AppList.js +12 -1
  3. package/dist/client/components/Composer.js +2 -2
  4. package/dist/client/components/Diagram.js +1 -1
  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 +71 -8
  10. package/dist/client/components/NewRecord.d.ts +3 -1
  11. package/dist/client/components/NewRecord.js +16 -5
  12. package/dist/client/components/PageFlowDiagram.css +1 -1
  13. package/dist/client/components/PageTimeline.js +18 -4
  14. package/dist/client/components/RecordSummaries.d.ts +5 -3
  15. package/dist/client/components/RecordSummaries.js +11 -2
  16. package/dist/client/components/Summary.js +1 -1
  17. package/dist/client/components/TableRoom.d.ts +4 -1
  18. package/dist/client/components/TableRoom.js +10 -5
  19. package/dist/client/components/TableView.d.ts +4 -2
  20. package/dist/client/components/TableView.js +3 -3
  21. package/dist/client/components/TimelineReactions.css +49 -0
  22. package/dist/client/components/TimelineReactions.d.ts +18 -0
  23. package/dist/client/components/TimelineReactions.js +58 -0
  24. package/dist/client/components/TreePicker.css +25 -0
  25. package/dist/client/components/TreePicker.d.ts +59 -0
  26. package/dist/client/components/TreePicker.js +407 -0
  27. package/dist/client/components/Value.js +33 -2
  28. package/dist/client/components/appListModel.d.ts +2 -0
  29. package/dist/client/components/chromeIcons.d.ts +1 -0
  30. package/dist/client/components/chromeIcons.js +1 -0
  31. package/dist/client/components/gridSizing.d.ts +3 -0
  32. package/dist/client/components/gridSizing.js +1 -1
  33. package/dist/client/components/inputRenderers.d.ts +7 -1
  34. package/dist/client/components/inputRenderers.js +2 -0
  35. package/dist/client/components/pageModel.d.ts +4 -0
  36. package/dist/client/components/reactionTally.d.ts +20 -0
  37. package/dist/client/components/reactionTally.js +46 -0
  38. package/dist/client/components/useGridGroups.d.ts +11 -0
  39. package/dist/client/components/useGridGroups.js +70 -0
  40. package/dist/client/components/useGridKeyboard.d.ts +2 -0
  41. package/dist/client/components/useGridKeyboard.js +18 -1
  42. package/dist/client/components/valueModel.d.ts +10 -3
  43. package/dist/client/components/valueModel.js +21 -1
  44. package/dist/client/copy/forms/components/TreePicker.d.ts +9 -0
  45. package/dist/client/copy/forms/components/TreePicker.js +11 -0
  46. package/dist/client/copy/lists/components/Grid.d.ts +1 -1
  47. package/dist/client/copy/lists/components/Grid.js +1 -1
  48. package/dist/client/copy/lists/components/useGridGroups.d.ts +3 -0
  49. package/dist/client/copy/lists/components/useGridGroups.js +5 -0
  50. package/dist/client/copy/record/components/TimelineReactions.d.ts +7 -0
  51. package/dist/client/copy/record/components/TimelineReactions.js +6 -0
  52. package/dist/client/copy/record/components/Value.d.ts +3 -0
  53. package/dist/client/copy/record/components/Value.js +3 -0
  54. package/dist/client/copy/shell/components/ErrorBoundary.d.ts +1 -1
  55. package/dist/client/copy/shell/components/ErrorBoundary.js +1 -1
  56. package/dist/client/copy/shell/visualTheme.d.ts +2 -0
  57. package/dist/client/copy/shell/visualTheme.js +2 -0
  58. package/dist/client/copy/workbench/components/Composer.d.ts +2 -2
  59. package/dist/client/copy/workbench/components/Composer.js +2 -2
  60. package/dist/client/copy/workbench/components/Diagram.d.ts +1 -1
  61. package/dist/client/copy/workbench/components/Diagram.js +1 -1
  62. package/dist/client/copy/workbench/components/Summary.d.ts +3 -3
  63. package/dist/client/copy/workbench/components/Summary.js +3 -3
  64. package/dist/client/features.css +41 -4
  65. package/dist/client/fonts/faces.css +53 -0
  66. package/dist/client/index.html +1 -1
  67. package/dist/client/page.css +3 -2
  68. package/dist/client/shellHost.d.ts +1 -1
  69. package/dist/client/shellHost.js +1 -1
  70. package/dist/client/structure.css +11 -3
  71. package/dist/client/style.css +11 -2
  72. package/dist/client/visualTheme.d.ts +29 -0
  73. package/dist/client/visualTheme.js +94 -17
  74. package/dist/client/visualThemes.css +2 -1
  75. package/package.json +10 -3
@@ -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
  });
@@ -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
  });
@@ -1,4 +1,6 @@
1
1
  export declare const say: import("../../messages.js").RoomMessage<{
2
2
  readonly default: "Default";
3
3
  readonly workbenchDefault: "Workbench default";
4
+ readonly hostLookId: "A host look's id is lowercase letters, digits and dashes: \"{id}\".";
5
+ readonly hostLookTaken: "The host look \"{id}\" has a name the picker already offers.";
4
6
  }>;
@@ -3,4 +3,6 @@ import { defineMessages } from '../../messages.js';
3
3
  export const say = defineMessages({
4
4
  default: 'Default',
5
5
  workbenchDefault: 'Workbench default',
6
+ hostLookId: 'A host look\'s id is lowercase letters, digits and dashes: "{id}".',
7
+ hostLookTaken: 'The host look "{id}" has a name the picker already offers.',
6
8
  });
@@ -54,9 +54,9 @@ export declare const say: import("../../../messages.js").RoomMessage<{
54
54
  readonly smallest: "Smallest {column}";
55
55
  readonly latest: "Latest {column}";
56
56
  readonly largest: "Largest {column}";
57
- readonly summarise: "Summarise…";
57
+ readonly summarize: "Summarize…";
58
58
  readonly aTotalAnAverage: "a total, an average, a range";
59
- readonly summariseName: "Summarise {name}";
59
+ readonly summarizeName: "Summarize {name}";
60
60
  readonly aViewIsOne: "A view is one row per {name}, ";
61
61
  readonly withAnyFieldFromAny: "with any field from any table it points at. Tick fields here; press “Add” beside a related table on the left to bring its fields into this list too.";
62
62
  readonly baseTableGroup: "base table";
@@ -50,9 +50,9 @@ export const say = defineMessages({
50
50
  smallest: 'Smallest {column}',
51
51
  latest: 'Latest {column}',
52
52
  largest: 'Largest {column}',
53
- summarise: 'Summarise…',
53
+ summarize: 'Summarize…',
54
54
  aTotalAnAverage: 'a total, an average, a range',
55
- summariseName: 'Summarise {name}',
55
+ summarizeName: 'Summarize {name}',
56
56
  aViewIsOne: 'A view is one row per {name}, ',
57
57
  withAnyFieldFromAny: 'with any field from any table it points at. Tick fields here; press “Add” beside a related table on the left to bring its fields into this list too.',
58
58
  baseTableGroup: 'base table',
@@ -17,7 +17,7 @@ export declare const say: import("../../../messages.js").RoomMessage<{
17
17
  readonly unknownTable: "Unknown table.";
18
18
  readonly hasNoForeignKeys: "{tableId} has no foreign keys in either direction.";
19
19
  readonly andWhatItTouches: "{name} and what it touches";
20
- readonly foreignKeyNeighbourhood: "Foreign key neighbourhood of {tableId}";
20
+ readonly foreignKeyNeighborhood: "Foreign key neighborhood of {tableId}";
21
21
  readonly points: "points at →";
22
22
  readonly pointed: "← pointed at by";
23
23
  readonly thisDatabaseHasNoTables: "This database has no tables.";
@@ -16,7 +16,7 @@ export const say = defineMessages({
16
16
  unknownTable: 'Unknown table.',
17
17
  hasNoForeignKeys: '{tableId} has no foreign keys in either direction.',
18
18
  andWhatItTouches: '{name} and what it touches',
19
- foreignKeyNeighbourhood: 'Foreign key neighbourhood of {tableId}',
19
+ foreignKeyNeighborhood: 'Foreign key neighborhood of {tableId}',
20
20
  points: 'points at →',
21
21
  pointed: '← pointed at by',
22
22
  thisDatabaseHasNoTables: 'This database has no tables.',
@@ -4,10 +4,10 @@ export declare const say: import("../../../messages.js").RoomMessage<{
4
4
  readonly queryLanguageParenQuestion: "Query language (?)";
5
5
  readonly open: "Open {id}";
6
6
  readonly showOrHideTheSummary: "Show or hide the summary";
7
- readonly centres: "centres on {name}";
8
- readonly theTableThatConnects: "The table that connects to the most, with names you can recognise rows by";
7
+ readonly centers: "centers on {name}";
8
+ readonly theTableThatConnects: "The table that connects to the most, with names you can recognize rows by";
9
9
  readonly start: "Start at {name} →";
10
- readonly centresOnLabel: "Centres on";
10
+ readonly centersOnLabel: "Centers on";
11
11
  readonly referencedByOtherTables: ", referenced by {incoming} other tables";
12
12
  readonly recordsEvents: "Records events in";
13
13
  readonly connectedThrough: "Connected through";
@@ -6,10 +6,10 @@ export const say = defineMessages({
6
6
  queryLanguageParenQuestion: 'Query language (?)',
7
7
  open: 'Open {id}',
8
8
  showOrHideTheSummary: 'Show or hide the summary',
9
- centres: 'centres on {name}',
10
- theTableThatConnects: 'The table that connects to the most, with names you can recognise rows by',
9
+ centers: 'centers on {name}',
10
+ theTableThatConnects: 'The table that connects to the most, with names you can recognize rows by',
11
11
  start: 'Start at {name} →',
12
- centresOnLabel: 'Centres on',
12
+ centersOnLabel: 'Centers on',
13
13
  referencedByOtherTables: ', referenced by {incoming} other tables',
14
14
  recordsEvents: 'Records events in',
15
15
  connectedThrough: 'Connected through',
@@ -1088,14 +1088,17 @@ body.type-sans {
1088
1088
  Tabular numerals keep columns of figures aligned, which is what makes
1089
1089
  a non-mono face survivable in a data tool. */
1090
1090
  --mono: "Inter", "IBM Plex Sans", "Segoe UI Variable Text", ui-sans-serif, system-ui, sans-serif;
1091
+ /* The reader's pick wins over a host look's data face (tokens.css). */
1092
+ --data-face: var(--mono);
1091
1093
  font-variant-numeric: tabular-nums;
1092
1094
  }
1093
1095
  /* The interface is sans everywhere (appnav points --mono at it). Code keeps
1094
1096
  the code face; in the database browser so do the short values a grid sets
1095
- apart — ids, dates, codes — as a data tool reads them. An App's lists read
1096
- as its theme dresses them. */
1097
+ apart — ids, dates, codes — as a data tool reads them, unless a host look
1098
+ names its data face (--data-face, tokens.css), which the reader's own pick
1099
+ overrides. An App's lists read as its theme dresses them. */
1097
1100
  body :is(.ddl, .explain, #query, .applist-filter, pre, code, kbd) { font-family: var(--code); }
1098
- body:not(.app-mode):not(.type-sans) td.mono { font-family: var(--code); font-size: var(--text-sm); }
1101
+ body:not(.app-mode):not(.type-sans) td.mono { font-family: var(--data-face, var(--code)); font-size: var(--text-sm); }
1099
1102
  body.type-sans .ddl,
1100
1103
  body.type-sans .explain,
1101
1104
  body.type-sans #query,
@@ -1135,7 +1138,7 @@ body.app-mobile-nav .sidebar-reveal { display: none; }
1135
1138
  body.app-mobile-nav .topnav { display: flex; flex: none; align-self: center; margin: 0; min-width: auto; }
1136
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); }
1137
1140
  .tn-mobile-menu:hover { color: var(--ink); background: var(--raised); }
1138
- .tn-mobile-menu .tw-icon { width: 17px; height: 17px; }
1141
+ .tn-mobile-menu .mistri-icon { width: 17px; height: 17px; }
1139
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); }
1140
1143
  body.app-mobile-nav .topnav { order: -1; }
1141
1144
  body.app-mobile-nav .brand { flex: 1; min-width: 0; }
@@ -1850,6 +1853,27 @@ body.session-locked > :not(#session-lock) { display: none !important; }
1850
1853
  .inline-edit-button:hover { border-color: var(--line); color: var(--accent-ink); }
1851
1854
  .inline-edit-value:focus-visible, .inline-edit-button:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 2px; }
1852
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
+ }
1853
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
1854
1878
  padding on top of that floor, which made it 4px taller and moved every row below it on opening and again on closing. */
1855
1879
  .inline-field-open input.cell-edit { padding-block: 0; }
@@ -1890,6 +1914,19 @@ body.session-locked > :not(#session-lock) { display: none !important; }
1890
1914
  .grid-totals-label { font-weight: 500; color: var(--ink-muted); }
1891
1915
  .grid-totals-pending { color: var(--ink-subtle); }
1892
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
+
1893
1930
  /* A compact list's rows: structure.css, so no look's row padding outranks them. */
1894
1931
 
1895
1932
  /* A row's own menu: the trailing cell, hidden until the row is hovered or
@@ -0,0 +1,53 @@
1
+ /* The kit's own faces, for a host product's look (`@mistriwork/kit/client/fonts/faces.css`): every font file the kit
2
+ ships, declared once each under the family names its looks use, so a look of the host's own can name Barlow, Barlow
3
+ Semi Condensed, IBM Plex Mono or Inter in a stack, as Workshop, Ledger and Lumen do. Each is under the SIL Open Font
4
+ License, whose text travels beside it (the *-OFL.txt files here; the kit's Vite preset copies them into the build).
5
+ A rule costs nothing until a line is drawn in its family, so importing this sheet fetches no font a page does not
6
+ set. The looks' own sheets (workshopLook.css, ledgerLook.css, lumenLook.css) keep their own rules and their cut
7
+ fallbacks, so a page wearing a kit look never loads this one. `swap`, as theirs: a host holds its page until its
8
+ look's sheet is in (visualTheme.ts registerHostLooks), so the face is mostly there by the first paint. */
9
+ @font-face {
10
+ font-family: Barlow;
11
+ font-style: normal;
12
+ font-weight: 400;
13
+ font-display: swap;
14
+ src: url('./barlow-400.woff2') format('woff2');
15
+ }
16
+ @font-face {
17
+ font-family: Barlow;
18
+ font-style: normal;
19
+ font-weight: 600;
20
+ font-display: swap;
21
+ src: url('./barlow-600.woff2') format('woff2');
22
+ }
23
+ @font-face {
24
+ font-family: 'Barlow Semi Condensed';
25
+ font-style: normal;
26
+ font-weight: 700;
27
+ font-display: swap;
28
+ src: url('./barlow-semi-condensed-700.woff2') format('woff2');
29
+ }
30
+ @font-face {
31
+ font-family: 'IBM Plex Mono';
32
+ font-style: normal;
33
+ font-weight: 400;
34
+ font-display: swap;
35
+ src: url('./ibm-plex-mono-400.woff2') format('woff2');
36
+ }
37
+ @font-face {
38
+ font-family: 'IBM Plex Mono';
39
+ font-style: normal;
40
+ font-weight: 500;
41
+ font-display: swap;
42
+ src: url('./ibm-plex-mono-500.woff2') format('woff2');
43
+ }
44
+ /* Latin, variable from 100 to 900, its `tnum` cut to the ten figures (lumenLook.css says why). */
45
+ @font-face {
46
+ font-family: Inter;
47
+ font-style: normal;
48
+ font-weight: 100 900;
49
+ font-display: swap;
50
+ src: url('./inter-latin.woff2') format('woff2');
51
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
52
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
53
+ }
@@ -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;