@mistriwork/kit 1.0.0-rc.19 → 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.
- package/dist/client/components/Editable.js +2 -1
- package/dist/client/components/GridCellEditor.js +3 -2
- package/dist/client/components/PageRelated.js +3 -0
- package/dist/client/components/Palette.js +4 -2
- package/dist/client/index.html +2 -0
- package/dist/client/plexMono.css +17 -0
- package/dist/client/themeFamilies.css +27 -0
- package/dist/client/writePaths.d.ts +1 -1
- package/dist/client/writePaths.js +3 -0
- package/package.json +3 -3
|
@@ -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);
|
|
@@ -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
|
-
|
|
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
|
};
|
package/dist/client/index.html
CHANGED
|
@@ -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
|
|
@@ -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
|
|
@@ -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.
|
|
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.
|
|
87
|
-
"@mistriwork/ui": "1.0.0-rc.
|
|
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
|
},
|