@mistriwork/kit 1.0.0-rc.18 → 1.0.0-rc.20

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.
@@ -94,6 +94,7 @@ export function Editable({ table, row, column, recordKey, onSaved, app = false,
94
94
  setPickerGeneration((generation) => generation + 1);
95
95
  }, [discarded, column.references]);
96
96
  const errorId = useId();
97
+ const nameId = useId();
97
98
  const dateId = useId();
98
99
  /* A box the browser cannot read (badInput), or the calendar's text box
99
100
  holding what is not a date (its own validity), is not a value to save. */
@@ -291,7 +292,7 @@ export function Editable({ table, row, column, recordKey, onSaved, app = false,
291
292
  /* Formatted text holds links and blocks of its own, so it is not drawn inside a button either; nor is a value
292
293
  with its own copy button. */
293
294
  const followed = column.references || shownRule?.format === 'richText' || shownRule?.copy || linkFor(column.name, shownValue, shownRule, true);
294
- return surface(followed && shownValue !== null && shownValue !== undefined ? (_jsxs("div", { className: "inline-field", children: [_jsx("div", { className: "inline-field-value", children: body }), _jsx("button", { ref: launcher, type: "button", className: "inline-edit-button", "aria-label": say('edit', { label }), title: say('edit', { label }), disabled: applying, onClick: () => setOpened(true), children: "\u270E" })] })) : (_jsx("button", { ref: launcher, type: "button", className: "inline-edit-value", "aria-label": say('edit', { label }), title: say('edit', { label }), disabled: applying, onClick: () => setOpened(true), children: body })));
295
+ return surface(followed && shownValue !== null && shownValue !== undefined ? (_jsxs("div", { className: "inline-field", children: [_jsx("div", { className: "inline-field-value", children: body }), _jsx("button", { ref: launcher, type: "button", className: "inline-edit-button", "aria-label": say('edit', { label }), title: say('edit', { label }), disabled: applying, onClick: () => setOpened(true), children: "\u270E" })] })) : (_jsx("button", { ref: launcher, id: `${nameId}-edit`, type: "button", className: "inline-edit-value", "aria-label": say('edit', { label }), "aria-labelledby": `${nameId}-edit ${nameId}-value`, title: say('edit', { label }), disabled: applying, onClick: () => setOpened(true), children: _jsx("span", { id: `${nameId}-value`, style: { display: 'contents' }, children: body }) })));
295
296
  }
296
297
  const wrap = (editor) => surface(_jsxs(_Fragment, { children: [inline ? (_jsxs("div", { className: "inline-field inline-field-open", children: [editor, _jsx("button", { type: "button", className: "inline-edit-button", "aria-label": say('doneEditing', { label }), title: say('doneEditing', { label }), disabled: dirty || applying, onClick: () => setOpened(false), children: "\u2713" })] })) : (editor), error && (_jsx("span", { id: errorId, className: "edit-field-error", role: "alert", children: error }))] }));
297
298
  /* The App's own input for this column (`resources.<name>.inputs`): it hands back a value the draft
@@ -106,6 +106,7 @@ function openNeighbor(from, backward) {
106
106
  export function GridCellEdit({ table, row, column, recordKey, draw, byName = false, valueLabel, }) {
107
107
  const client = useQueryClient();
108
108
  const errorId = useId();
109
+ const nameId = useId();
109
110
  const label = columnLabel(table.id, column.name) ?? humanName(column.name);
110
111
  const stored = said(row[column.name]);
111
112
  const [editing, setEditing] = useState(false);
@@ -265,10 +266,10 @@ export function GridCellEdit({ table, row, column, recordKey, draw, byName = fal
265
266
  : draw({ value: shown.value, label: shown.label });
266
267
  /* The cell's value is the button: a click edits it rather than opening
267
268
  the row, and the grid's Enter and F2 press it (useGridKeyboard). */
268
- return (_jsx("button", { ref: launcher, type: "button", className: "cell-edit-launch", "aria-label": say('edit', { label }), "data-cell-opens": "", "data-cell-edits": "", onClick: (event) => {
269
+ return (_jsx("button", { ref: launcher, id: `${nameId}-edit`, type: "button", className: "cell-edit-launch", "aria-label": say('edit', { label }), "aria-labelledby": `${nameId}-edit ${nameId}-value`, "data-cell-opens": "", "data-cell-edits": "", onClick: (event) => {
269
270
  event.stopPropagation();
270
271
  open();
271
- }, children: body }));
272
+ }, children: _jsx("span", { id: `${nameId}-value`, style: { display: 'contents' }, children: body }) }));
272
273
  }
273
274
  const change = (next) => {
274
275
  setDraft(next);
@@ -119,7 +119,7 @@ export function ListFilterBar(props) {
119
119
  const rest = idle.filter((box) => hidden.has(box.column));
120
120
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: mark, hidden: true }), searchBox, search && _jsx(FilterSlot, { ...props, box: search }), pickers
121
121
  .filter((box) => !hidden.has(box.column))
122
- .map((box) => (_jsx(FilterSlot, { ...props, box: box }, box.column))), rest.length > 0 && (_jsx("span", { className: "applist-slot applist-slot-more", children: _jsxs("button", { type: "button", className: "applist-add", "aria-haspopup": "dialog", "aria-label": say('moreFilters', { map: rest.map((box) => box.label).join(', ') }), onClick: onSheet, children: [_jsx("span", { className: "applist-add-mark", "aria-hidden": "true", children: "+" }), say('common.filter')] }) })), residueChip, clearAll] }));
122
+ .map((box) => (_jsx(FilterSlot, { ...props, box: box }, box.column))), rest.length > 0 && (_jsx("span", { className: "applist-slot applist-slot-more", children: _jsxs("button", { type: "button", className: "applist-add", "aria-haspopup": "dialog", "aria-label": say('moreFilters', { filter: say('common.filter'), map: rest.map((box) => box.label).join(', ') }), onClick: onSheet, children: [_jsx("span", { className: "applist-add-mark", "aria-hidden": "true", children: "+" }), say('common.filter')] }) })), residueChip, clearAll] }));
123
123
  }
124
124
  /**
125
125
  * One declared filter in its place in the row: its chip when it narrows the
@@ -633,6 +633,9 @@ function RelatedList({ section, plan, base, recordKey, onEdit, collapsed, counte
633
633
  const data = (await coreApi('/api/file/upload', {
634
634
  table: table.id,
635
635
  values: { ...creation.defaults, ...defaults },
636
+ /* The record this list is drawn on, said once: the server reads it as this reader and writes the link itself,
637
+ so the link above is only what the list believes. A tenant lease's upload says no parent yet. */
638
+ ...(lease ? {} : { parent: { table: base.id, key: recordKey, link: creation.bindings[0].column } }),
636
639
  ...ownedBy(connection),
637
640
  file: { name: picked.name, type: picked.type, data: await fileToBase64(picked) },
638
641
  }));
@@ -124,10 +124,12 @@ export function Palette({ prefill = '', onClose }) {
124
124
  if (!app)
125
125
  return;
126
126
  let live = true;
127
- void import('./newMenuModel.js').then((model) => {
127
+ /* The New items are extra: a palette closed (or a page left) before the chunk arrives, or a chunk a redeploy took
128
+ away, leaves them out rather than raising an uncaught rejection. */
129
+ import('./newMenuModel.js').then((model) => {
128
130
  if (live)
129
131
  setMade(model.newPaletteItems(app));
130
- });
132
+ }, () => { });
131
133
  return () => {
132
134
  live = false;
133
135
  };
@@ -1,5 +1,5 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
- readonly moreFilters: "More filters: {map}";
2
+ readonly moreFilters: "{filter}: {map}";
3
3
  readonly search: "Search {listLabel}…";
4
4
  readonly labelEquals: "{label} equals…";
5
5
  readonly takesANumber: "{label} takes a number.";
@@ -1,7 +1,8 @@
1
1
  /** What ListFilterBar says, in the filter rail 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
- moreFilters: 'More filters: {map}',
4
+ // Starts with the button's visible word (WCAG 2.5.3, label in name): {filter} is the word it shows.
5
+ moreFilters: '{filter}: {map}',
5
6
  search: 'Search {listLabel}…',
6
7
  labelEquals: '{label} equals…',
7
8
  takesANumber: '{label} takes a number.',
@@ -126,6 +126,8 @@
126
126
  <link rel="stylesheet" href="/page.css" />
127
127
  <link rel="stylesheet" href="/visualThemes.css" />
128
128
  <link rel="stylesheet" href="/themeFamilies.css" />
129
+ <!-- Served page only: config/vite.embed.config.ts reads links written `rel href` in a row, and this one is not, to keep the font bytes out of the shell. -->
130
+ <link href="/plexMono.css" rel="stylesheet" data-served-only />
129
131
  <link rel="stylesheet" href="/customThemes.css" />
130
132
  <link rel="stylesheet" href="/structure.css" />
131
133
  <link
@@ -200,7 +200,9 @@
200
200
  }
201
201
  :root[data-look-avatar='round'] .sidebar-identity-mark {
202
202
  border-radius: 50%;
203
- background: var(--accent-soft);
203
+ /* The menu's accent on a 12% tint of itself, so the mark keeps its contrast on any menu ground; the round
204
+ check in theme.ts models exactly this pair. */
205
+ background: color-mix(in srgb, var(--current-ink) 12%, transparent);
204
206
  color: var(--current-ink);
205
207
  }
206
208
  /* The topbar's own items when the menu is a bar. */
@@ -953,6 +953,32 @@
953
953
  font-variant-caps: var(--part-avatar-caps);
954
954
  letter-spacing: var(--part-avatar-tracking);
955
955
  }
956
+ :root[data-parts~="identityMark:ground"] .app-mode .sidebar-identity-mark {
957
+ background: var(--part-identityMark-ground);
958
+ }
959
+ :root[data-parts~="identityMark:ink"] .app-mode .sidebar-identity-mark {
960
+ color: var(--part-identityMark-ink);
961
+ }
962
+ :root[data-parts~="identityMark:edge"] .app-mode .sidebar-identity-mark {
963
+ border-color: var(--part-identityMark-edge);
964
+ }
965
+ :root[data-parts~="identityMark:radius"] .app-mode .sidebar-identity-mark {
966
+ border-radius: var(--part-identityMark-radius);
967
+ }
968
+ :root[data-parts~="identityMark:lift"] .app-mode .sidebar-identity-mark {
969
+ box-shadow: var(--part-identityMark-lift);
970
+ }
971
+ :root[data-parts~="identityMark:face"] .app-mode .sidebar-identity-mark {
972
+ font-family: var(--part-identityMark-face);
973
+ }
974
+ :root[data-parts~="identityMark:weight"] .app-mode .sidebar-identity-mark {
975
+ font-weight: var(--part-identityMark-weight);
976
+ }
977
+ :root[data-parts~="identityMark:case"] .app-mode .sidebar-identity-mark {
978
+ text-transform: var(--part-identityMark-transform);
979
+ font-variant-caps: var(--part-identityMark-caps);
980
+ letter-spacing: var(--part-identityMark-tracking);
981
+ }
956
982
  :root[data-parts~="menu:ground"] .app-mode .tn-pop,
957
983
  :root[data-parts~="menu:ground"] .app-mode .th-menu,
958
984
  :root[data-parts~="menu:ground"] .app-mode .page-actions-menu {
@@ -0,0 +1,17 @@
1
+ /* IBM Plex Mono, 400 and 500, for a data column (themeFamilies.css, `--figures`). Linked by the served page alone (index.html):
2
+ the embed shell leaves it out so the font bytes stay out of its chunk, and a host gets the same faces from
3
+ fonts/faces.css. */
4
+ @font-face {
5
+ font-family: 'IBM Plex Mono';
6
+ font-style: normal;
7
+ font-weight: 400;
8
+ font-display: swap;
9
+ src: url('./fonts/ibm-plex-mono-400.woff2') format('woff2');
10
+ }
11
+ @font-face {
12
+ font-family: 'IBM Plex Mono';
13
+ font-style: normal;
14
+ font-weight: 500;
15
+ font-display: swap;
16
+ src: url('./fonts/ibm-plex-mono-500.woff2') format('woff2');
17
+ }
@@ -1,4 +1,21 @@
1
1
  /* Each look (style.css names the order). */
2
+ /* IBM Plex Mono for a data column (SIL Open Font License; its text in fonts/IBMPlexMono-OFL.txt and dist/client/fonts/):
3
+ the ids, codes, numbers and dates a list's cells and a record's values set apart (`--figures`, below). A face is
4
+ fetched when a line is drawn in its family, so a page with no such cell asks for nothing, and the sheets of the
5
+ looks that already ship it (ledgerLook.css, the Workbench's) declare the same files. The two faces are in
6
+ plexMono.css, linked by the served page only: an embedding host brings them with fonts/faces.css, as it does every
7
+ other kit face, rather than the shell carrying the bytes. `swap`, with the face a line
8
+ is set in until it arrives measured to it: Courier New's advance is 600 units, as Plex Mono's, so only the ascent
9
+ and descent are said (1025 and 275 of 1000, no line gap), and a figure swaps in without a column or a line moving. */
10
+ @font-face {
11
+ font-family: 'IBM Plex Mono Fallback';
12
+ font-weight: 100 900;
13
+ src: local('Courier New'), local('CourierNewPSMT'), local('Liberation Mono'), local('LiberationMono'), local('Courier');
14
+ size-adjust: 100%;
15
+ ascent-override: 102.5%;
16
+ descent-override: 27.5%;
17
+ line-gap-override: 0%;
18
+ }
2
19
  @layer look {
3
20
  /* Structural identities for the built-in looks, which dress Apps only
4
21
  (docs/design.md, Tokens): every rule keys on a look being worn
@@ -694,6 +711,16 @@
694
711
  html:root[data-type-data~='figures'] .app-mode :is(td.mono, .num-value, .date-value, .id-value) {
695
712
  font-family: var(--mono);
696
713
  }
714
+ /* A data column in Plex Mono, in every look and only there: the ids, codes and numbers a table's cells set apart
715
+ (`td.mono`, Grid.tsx) and the figures, dates and keys of a record's fields and header facts. Words, headings and
716
+ a stat's hero figure keep their theme's faces. A theme whose data face reaches figures says its own, above. */
717
+ .app-mode {
718
+ --figures: 'IBM Plex Mono', 'IBM Plex Mono Fallback', var(--code);
719
+ }
720
+ .app-mode td.mono,
721
+ .app-mode :is(.page-field > dd, .page-head-facts) :is(.num-value, .date-value, .id-value) {
722
+ font-family: var(--figures);
723
+ }
697
724
 
698
725
  /* ---------- Meaning (recipes.status = dot) ---------- */
699
726
  /* A status in a cell or a field is a dot and its word, the word in the ink at the cell's weight: only the dot
@@ -20,6 +20,11 @@
20
20
  a host's look (`registerHostLooks`, worn in `theme` under `data-host-look`), so a host look over it says only what
21
21
  it changes: a palette is colour alone, and the structure below is shared.
22
22
 
23
+ A host with looks of its own (the standalone database browser: blueprint, console, folio) relies on the keying:
24
+ every rule below also needs the root to wear no `data-host-look`, or Instrument's own (`instrument`,
25
+ `instrument-*`), so a foreign host look is drawn by that host alone and this sheet adds nothing under it. The
26
+ condition is one `:where()`, which weighs nothing, so the rules compete as they did before it.
27
+
23
28
  Bends, each on purpose:
24
29
  - The column heads stand on a tinted band: with hairlines between columns, a band is what tells the head from the
25
30
  first row at a glance without a heavier rule.
@@ -33,7 +38,7 @@
33
38
  @import './fonts/faces.css';
34
39
 
35
40
  @layer look {
36
- :root:not([data-visual-theme]) {
41
+ :root:not([data-visual-theme]):where(:not([data-host-look]), [data-host-look='instrument'], [data-host-look^='instrument-']) {
37
42
  --face-ui: Inter, 'Inter Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
38
43
  --sans: var(--face-ui);
39
44
  /* The kit's seam for a host look's data face (tokens.css): every chrome string the code face set reads it, so
@@ -71,7 +76,7 @@
71
76
  --scrim: rgb(16 20 28 / 0.32);
72
77
  }
73
78
  @media (prefers-color-scheme: dark) {
74
- :root:not([data-visual-theme]):not([data-theme='light']) {
79
+ :root:not([data-visual-theme]):where(:not([data-host-look]), [data-host-look='instrument'], [data-host-look^='instrument-']):not([data-theme='light']) {
75
80
  --ground: #101010;
76
81
  --surface: #151515;
77
82
  --raised: #1d1d1d;
@@ -101,7 +106,7 @@
101
106
  --scrim: rgb(0 0 0 / 0.55);
102
107
  }
103
108
  }
104
- :root:not([data-visual-theme])[data-theme='dark'] {
109
+ :root:not([data-visual-theme]):where(:not([data-host-look]), [data-host-look='instrument'], [data-host-look^='instrument-'])[data-theme='dark'] {
105
110
  --ground: #101010;
106
111
  --surface: #151515;
107
112
  --raised: #1d1d1d;
@@ -131,7 +136,7 @@
131
136
  --scrim: rgb(0 0 0 / 0.55);
132
137
  }
133
138
 
134
- :root:not([data-visual-theme]) {
139
+ :root:not([data-visual-theme]):where(:not([data-host-look]), [data-host-look='instrument'], [data-host-look^='instrument-']) {
135
140
  & body {
136
141
  font-feature-settings: 'cv11', 'ss03';
137
142
  -webkit-font-smoothing: antialiased;
@@ -6,7 +6,7 @@
6
6
  * operations changed a record and left the page's answers standing.
7
7
  */
8
8
  /** The mutations a tenant's transport carries; `/api/commands/prepare` is among them but writes nothing. */
9
- export declare const MUTATION_PATHS: readonly ['/api/update', '/api/insert', '/api/file/upload', '/api/delete', '/api/revert', '/api/import', '/api/commands/prepare', '/api/commands/execute', '/api/commands/status'];
9
+ export declare const MUTATION_PATHS: readonly ['/api/update', '/api/insert', '/api/file/upload', '/api/delete', '/api/revert', '/api/import', '/api/commands/prepare', '/api/commands/execute', '/api/commands/status', '/api/commands/draft', '/api/commands/files'];
10
10
  /**
11
11
  * Whether a request changes data, so what was read before it is not the record any more.
12
12
  * `/api/commands/prepare` only checks; `/api/revert` writes only when it confirms
@@ -16,6 +16,9 @@ export const MUTATION_PATHS = [
16
16
  '/api/commands/prepare',
17
17
  '/api/commands/execute',
18
18
  '/api/commands/status',
19
+ '/api/commands/draft',
20
+ // Holds a file for a command; changes no record, but is sent as a write so a stale answer is not kept beside it.
21
+ '/api/commands/files',
19
22
  ];
20
23
  /* Writes the transport does not carry: a record flow, an agent's tool call and an HTTP operation run the App's own work. */
21
24
  const OTHER_WRITES = new Set(['/api/record-flows/start', '/api/agent/call', '/api/http/operation']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/kit",
3
- "version": "1.0.0-rc.18",
3
+ "version": "1.0.0-rc.20",
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": {
@@ -83,8 +83,8 @@
83
83
  "./package.json": "./package.json"
84
84
  },
85
85
  "dependencies": {
86
- "@mistriwork/engine": "1.0.0-rc.18",
87
- "@mistriwork/ui": "1.0.0-rc.18",
86
+ "@mistriwork/engine": "1.0.0-rc.20",
87
+ "@mistriwork/ui": "1.0.0-rc.20",
88
88
  "intl-messageformat": "12.1.2",
89
89
  "qrcode-generator": "^2.0.4"
90
90
  },