@mistriwork/kit 1.0.0-rc.64 → 1.0.0-rc.65
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/CardsList.js +9 -3
- package/dist/client/components/Palette.js +8 -5
- package/dist/client/features.css +1 -1
- package/dist/client/page.css +3 -0
- package/dist/client/themeFamilies.css +21 -0
- package/dist/vite.d.ts +10 -0
- package/dist/vite.js +13 -3
- package/package.json +3 -3
|
@@ -145,6 +145,12 @@ export function CardsList({ table, rows, spec, interactive = true, recordNavigat
|
|
|
145
145
|
const caption = (name) => columnLabel(table.id, name) ?? humanName(name.split('.').pop() ?? name);
|
|
146
146
|
const present = (row, name) => row[name] !== null && row[name] !== undefined && row[name] !== '';
|
|
147
147
|
const canOpen = interactive || recordNavigation;
|
|
148
|
+
/* The title is the record's label, and a column that is the title is not said again under it: the card leaves its own
|
|
149
|
+
name out of its figure, summary, lines and foot (a phone's summaries do the same, RecordSummaries.tsx). */
|
|
150
|
+
const apart = (names) => names?.filter((name) => name !== spec.primary);
|
|
151
|
+
const summary = apart(spec.facts);
|
|
152
|
+
const lines = apart(spec.lines);
|
|
153
|
+
const footer = apart(spec.footer);
|
|
148
154
|
/* A fact as a card says it, on its line under the figure or along the foot: its value, and its own word after it
|
|
149
155
|
("1 owner") or before it ("Born …") as its caption for everyone; without one, the caption only assistive
|
|
150
156
|
technology hears. */
|
|
@@ -186,7 +192,7 @@ export function CardsList({ table, rows, spec, interactive = true, recordNavigat
|
|
|
186
192
|
const tile = spec.media === 'icon';
|
|
187
193
|
const hasMedia = image !== undefined || avatar;
|
|
188
194
|
/* The summary as words, masked where its rule says: the whole of it rides the title attribute, since three lines may not hold it. */
|
|
189
|
-
const description = spec.description && present(row, spec.description)
|
|
195
|
+
const description = spec.description && spec.description !== spec.primary && present(row, spec.description)
|
|
190
196
|
? (maskedText(columnDisplay(table.id, spec.description), row[spec.description]) ??
|
|
191
197
|
String(row[spec.description]))
|
|
192
198
|
: undefined;
|
|
@@ -196,8 +202,8 @@ export function CardsList({ table, rows, spec, interactive = true, recordNavigat
|
|
|
196
202
|
? { name: dressed.icon, label: dressed.label, tone: dressed.kind === 'tone' ? dressed.tone : undefined }
|
|
197
203
|
: null;
|
|
198
204
|
const badge = spec.badge && row[spec.badge] != null && row[spec.badge] !== '' ? (_jsx("span", { className: "cards-badge", children: said(row, spec.badge) })) : null;
|
|
199
|
-
return (_jsx("li", { className: "cards-item", ...(win.windowed ? { 'data-index': win.lineOf(index), ref: win.measure } : {}), ...(id ? ordering.item(id) : {}), onKeyDown: id ? (event) => ordering.keyDown(event, id) : undefined, children: _jsxs("article", { className: `cards-card${hasMedia ? ' has-media' : ''}${avatar ? ' cards-profile' : ''}${changedRows.has(row) ? ` row-changed-${changedRows.get(row)}` : ''}`, children: [hasMedia && _jsx(CardPicture, { src: src, avatar: avatar, title: title, first: index < FIRST_ROW }), id && ordering.menu(id), _jsxs("div", { className: "cards-body", children: [tile && (_jsx("span", { className: `cards-tile${mark?.tone ? ` tone-${mark.tone}` : ''}`, children: mark && _jsx(Icon, { name: mark.name, label: mark.label, size: 22 }) })), _jsxs("h3", { className: "cards-title", children: [mark && !tile && _jsx(Icon, { name: mark.name, label: mark.label, className: "cards-icon" }), canOpen && key ? (_jsx("button", { type: "button", className: "cards-open", "data-order-focus": "", "aria-keyshortcuts": ordering.shortcuts, "data-opens": opensRecord(table.id, key), onClick: () => void openRecord(table.id, key, title, 'push', { records, list }), children: title })) : (_jsx("span", { children: title }))] }), titleSecond !== undefined && _jsx("p", { className: "cards-subtitle", children: titleSecond }), description !== undefined && (_jsx("p", { className: "cards-description", title: description, children: description })), (!hasMedia || avatar) && badge, spec.value && row[spec.value] != null && _jsx("p", { className: "cards-value", children: saidWithSecond(row, spec.value) }),
|
|
200
|
-
?
|
|
205
|
+
return (_jsx("li", { className: "cards-item", ...(win.windowed ? { 'data-index': win.lineOf(index), ref: win.measure } : {}), ...(id ? ordering.item(id) : {}), onKeyDown: id ? (event) => ordering.keyDown(event, id) : undefined, children: _jsxs("article", { className: `cards-card${hasMedia ? ' has-media' : ''}${avatar ? ' cards-profile' : ''}${changedRows.has(row) ? ` row-changed-${changedRows.get(row)}` : ''}`, children: [hasMedia && _jsx(CardPicture, { src: src, avatar: avatar, title: title, first: index < FIRST_ROW }), id && ordering.menu(id), _jsxs("div", { className: "cards-body", children: [tile && (_jsx("span", { className: `cards-tile${mark?.tone ? ` tone-${mark.tone}` : ''}`, children: mark && _jsx(Icon, { name: mark.name, label: mark.label, size: 22 }) })), _jsxs("h3", { className: "cards-title", children: [mark && !tile && _jsx(Icon, { name: mark.name, label: mark.label, className: "cards-icon" }), canOpen && key ? (_jsx("button", { type: "button", className: "cards-open", "data-order-focus": "", "aria-keyshortcuts": ordering.shortcuts, "data-opens": opensRecord(table.id, key), onClick: () => void openRecord(table.id, key, title, 'push', { records, list }), children: title })) : (_jsx("span", { children: title }))] }), titleSecond !== undefined && _jsx("p", { className: "cards-subtitle", children: titleSecond }), description !== undefined && (_jsx("p", { className: "cards-description", title: description, children: description })), (!hasMedia || avatar) && badge, spec.value && spec.value !== spec.primary && row[spec.value] != null && (_jsx("p", { className: "cards-value", children: saidWithSecond(row, spec.value) })), summary?.some((name) => present(row, name)) ? (_jsx("p", { className: "cards-summary", children: summary.filter((name) => present(row, name)).map((name) => fact(row, name, 'cards-summary-item')) })) : null, lines?.length ? (_jsx("dl", { className: "cards-facts", children: lines.map((name) => (_jsxs("div", { className: "cards-fact", children: [_jsx("dt", { children: caption(name) }), _jsx("dd", { children: saidWithSecond(row, name) })] }, name))) })) : null] }), footer?.length ? (_jsx("p", { className: "cards-foot", children: footer.some((name) => present(row, name))
|
|
206
|
+
? footer.filter((name) => present(row, name)).map((name) => fact(row, name, 'cards-foot-item'))
|
|
201
207
|
: '\u00a0' })) : null, hasMedia && !avatar && badge] }) }, key ? JSON.stringify(key) : index));
|
|
202
208
|
}), win.after > 0 && _jsx("li", { className: "cards-spacer", "aria-hidden": "true", style: { height: `${win.after}px` } })] }), ordering.live] }));
|
|
203
209
|
}
|
|
@@ -31,9 +31,12 @@ const MOST = { recent: 4, pages: 8, create: 5, commands: 4, records: 9 };
|
|
|
31
31
|
const FIRST_PAGES = 5;
|
|
32
32
|
/** Once a word is typed the list is what it names, not a shortlist: every page the word matches stays reachable, the
|
|
33
33
|
cap only keeps a one-letter term from drawing a screenful. (The shortlist above capped a typed App at eight pages,
|
|
34
|
-
and the ninth named by the word could not be reached by any word.) Records
|
|
35
|
-
a
|
|
36
|
-
const MOST_TYPED = { recent: MOST.recent, pages: 60, create: 20, commands: 20, records:
|
|
34
|
+
and the ninth named by the word could not be reached by any word.) Records too: nine across every list hid the
|
|
35
|
+
tenth row a word named in a list of one, so the database is asked for what fills twenty, the lists sharing it. */
|
|
36
|
+
const MOST_TYPED = { recent: MOST.recent, pages: 60, create: 20, commands: 20, records: 20 };
|
|
37
|
+
/** Rows asked of each list: the typed records' room shared among them, never fewer than three, so one list fills it and
|
|
38
|
+
eight lists still each say what they hold. */
|
|
39
|
+
const perList = (lists) => Math.max(3, Math.ceil(MOST_TYPED.records / Math.max(1, lists)));
|
|
37
40
|
const groupOf = (item) => item.kind === 'page' ? 'pages' : item.kind === 'create' ? 'create' : item.kind === 'record' ? 'records' : 'commands';
|
|
38
41
|
function groupWord(group) {
|
|
39
42
|
switch (group) {
|
|
@@ -173,7 +176,7 @@ export function Palette({ prefill = '', onClose }) {
|
|
|
173
176
|
return;
|
|
174
177
|
}
|
|
175
178
|
const timer = setTimeout(() => {
|
|
176
|
-
void findAcross(tables, term,
|
|
179
|
+
void findAcross(tables, term, perList(tables.length)).then((found) => {
|
|
177
180
|
if (mine !== recordToken.current)
|
|
178
181
|
return;
|
|
179
182
|
const hits = found.map((own, at) => own.map((each) => ({
|
|
@@ -184,7 +187,7 @@ export function Palette({ prefill = '', onClose }) {
|
|
|
184
187
|
icon: tables[at].room.icon,
|
|
185
188
|
run: each.open,
|
|
186
189
|
})));
|
|
187
|
-
setRecords({ term, items: interleaved(hits,
|
|
190
|
+
setRecords({ term, items: interleaved(hits, MOST_TYPED.records) });
|
|
188
191
|
});
|
|
189
192
|
}, prefill && query === prefill ? 0 : 180);
|
|
190
193
|
return () => clearTimeout(timer);
|
package/dist/client/features.css
CHANGED
|
@@ -916,7 +916,7 @@ td.dressed { white-space: nowrap; }
|
|
|
916
916
|
td.has-more { white-space: normal; }
|
|
917
917
|
/* The name over its folded columns takes a second line rather than an ellipsis: a folded row is two lines already,
|
|
918
918
|
and "Redgate Analytics Holdi…" stood cut over a detail line that wrapped whole beneath it (G187). */
|
|
919
|
-
td.has-more .cell-main { white-space: normal; text-overflow: clip; }
|
|
919
|
+
td.has-more .cell-main { white-space: normal; text-overflow: clip; flex: none; }
|
|
920
920
|
.cell-more { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font: 400 var(--text-xs)/1.35 var(--sans); color: var(--ink-muted); }
|
|
921
921
|
.cell-more-item { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); min-width: 0; }
|
|
922
922
|
.cell-more-head { color: var(--ink-subtle); }
|
package/dist/client/page.css
CHANGED
|
@@ -2876,6 +2876,9 @@
|
|
|
2876
2876
|
-webkit-line-clamp: 3;
|
|
2877
2877
|
line-clamp: 3;
|
|
2878
2878
|
overflow: hidden;
|
|
2879
|
+
/* Whole lines inside the card, never shrunk by the column it stands in: a flex item that clips (overflow) may
|
|
2880
|
+
shrink below its content, and the third line was cut through the middle over the card's rule. */
|
|
2881
|
+
flex: none;
|
|
2879
2882
|
}
|
|
2880
2883
|
.cards-value {
|
|
2881
2884
|
margin: 0;
|
|
@@ -1186,6 +1186,27 @@ html:root[data-theme-style][data-look-tabs='pill'] :is(.tab, :where(body.app-mod
|
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
1188
|
@layer structure {
|
|
1189
|
+
/* `recipes.pane: 'edge'`: the room runs to the window's right and bottom edges, so no band of the menu's ground
|
|
1190
|
+
frames it. The one line left is between the menu and the room; the bar keeps its rule over the room. A raised
|
|
1191
|
+
look's lift (lumenLook.css) belongs to a pane that stands on something, so it goes with the inset. In the
|
|
1192
|
+
structure layer, over the pane it undoes (structure.css), and said here, where the menu's test looks for it. */
|
|
1193
|
+
:root[data-look-pane='edge'] body.app-sidebar-shell .layout > .pane-bar {
|
|
1194
|
+
margin: 0;
|
|
1195
|
+
border: 0;
|
|
1196
|
+
border-left: 1px solid var(--line);
|
|
1197
|
+
border-radius: 0;
|
|
1198
|
+
}
|
|
1199
|
+
:root[data-look-pane='edge'] body.app-sidebar-shell .layout > .content {
|
|
1200
|
+
margin: 0;
|
|
1201
|
+
border: 0;
|
|
1202
|
+
border-left: 1px solid var(--line);
|
|
1203
|
+
border-top: var(--pane-rule, 1px solid var(--line));
|
|
1204
|
+
border-radius: 0;
|
|
1205
|
+
box-shadow: none;
|
|
1206
|
+
}
|
|
1207
|
+
:root[data-look-pane='edge'] body.app-sidebar-shell.page-bare .layout > .content {
|
|
1208
|
+
border: 0;
|
|
1209
|
+
}
|
|
1189
1210
|
/* The figures of a row stand on one line and a trend stands beside its figure, in every look that sets the label
|
|
1190
1211
|
over the figure (said here and not in structure.css: a rule that names a treatment lives where the menu's test
|
|
1191
1212
|
looks for it). Under the figure, the trend made its tile a line taller than the rest and the row as tall as
|
package/dist/vite.d.ts
CHANGED
|
@@ -59,6 +59,16 @@ interface Surfaces {
|
|
|
59
59
|
surfaces: Readonly<Record<string, readonly string[]>>;
|
|
60
60
|
/** Pairs of surfaces whose shared modules are the entry's. */
|
|
61
61
|
sharedWithEntry?: readonly (readonly [string, string])[];
|
|
62
|
+
/**
|
|
63
|
+
* Parts of their own that some surfaces draw on their first page and the rest only on demand, by name: what the
|
|
64
|
+
* roots reach that the entry does not hold and that no surface outside `with` reaches statically. Without it, the
|
|
65
|
+
* first surface to reach such a module claims it, and every other surface's part fetched on demand that uses it
|
|
66
|
+
* imports that whole surface's chunk.
|
|
67
|
+
*/
|
|
68
|
+
parts?: Readonly<Record<string, {
|
|
69
|
+
readonly roots: readonly string[];
|
|
70
|
+
readonly with: readonly string[];
|
|
71
|
+
}>>;
|
|
62
72
|
}
|
|
63
73
|
/**
|
|
64
74
|
* The maps keep our own sources and drop the libraries'.
|
package/dist/vite.js
CHANGED
|
@@ -89,7 +89,11 @@ export function noDevtoolsClient() {
|
|
|
89
89
|
* which every App page runs before anything else;
|
|
90
90
|
* surfaces in the order given, each takes what it reaches that no earlier part has (`surfaces`), except what two
|
|
91
91
|
* of them both reach where the product says that is the entry's (`sharedWithEntry`): an App's shell
|
|
92
|
-
* and its public pages, both first pages, so neither fetches a third chunk they share
|
|
92
|
+
* and its public pages, both first pages, so neither fetches a third chunk they share;
|
|
93
|
+
* parts named pieces some surfaces draw on their first page and the others only on demand (`parts`): what
|
|
94
|
+
* their roots reach that no surface outside `with` reaches statically. Before them the first surface
|
|
95
|
+
* to reach such a module took it, and the other surface's part fetched on demand imported that whole
|
|
96
|
+
* surface's chunk to use it (an App's form room took the public pages along).
|
|
93
97
|
*
|
|
94
98
|
* Reachability is read once, from the finished module graph, over static imports only: a part loaded on demand
|
|
95
99
|
* (components/onDemand.tsx) stays a chunk of its own, as it always was. The server names a path's surface in the page
|
|
@@ -105,7 +109,7 @@ export function noDevtoolsClient() {
|
|
|
105
109
|
*/
|
|
106
110
|
const BARRELS = [/\/node_modules\/@ui-sdk\/core\/dist\/(?:renderer|index)\.js$/];
|
|
107
111
|
const barrel = (id) => BARRELS.some((one) => one.test(id));
|
|
108
|
-
function surfaces({ index = [], surfaces: parts, sharedWithEntry = [] }) {
|
|
112
|
+
function surfaces({ index = [], surfaces: parts, sharedWithEntry = [], parts: shared = {} }) {
|
|
109
113
|
const names = Object.keys(parts);
|
|
110
114
|
const home = new Map();
|
|
111
115
|
const plugin = {
|
|
@@ -141,6 +145,12 @@ function surfaces({ index = [], surfaces: parts, sharedWithEntry = [] }) {
|
|
|
141
145
|
for (const id of from.get(a))
|
|
142
146
|
if (from.get(b).has(id))
|
|
143
147
|
home.set(id, 'index');
|
|
148
|
+
for (const [name, part] of Object.entries(shared)) {
|
|
149
|
+
const others = names.filter((surface) => !part.with.includes(surface)).map((surface) => from.get(surface));
|
|
150
|
+
for (const id of reach(rooted(name, part.roots), entry))
|
|
151
|
+
if (!home.has(id) && !others.some((surface) => surface.has(id)))
|
|
152
|
+
home.set(id, name);
|
|
153
|
+
}
|
|
144
154
|
for (const name of names)
|
|
145
155
|
for (const id of from.get(name))
|
|
146
156
|
if (!home.has(id))
|
|
@@ -149,7 +159,7 @@ function surfaces({ index = [], surfaces: parts, sharedWithEntry = [] }) {
|
|
|
149
159
|
};
|
|
150
160
|
/* Highest first: a group takes its modules' dependencies with it unless a group before it has them, so the entry's
|
|
151
161
|
are claimed before any surface's. */
|
|
152
|
-
const order = ['index', ...names];
|
|
162
|
+
const order = ['index', ...Object.keys(shared), ...names];
|
|
153
163
|
const groups = order.map((name, i) => ({ name, priority: order.length - i, test: (id) => home.get(id) === name }));
|
|
154
164
|
return { plugin, groups };
|
|
155
165
|
}
|
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.65",
|
|
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": {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"./package.json": "./package.json"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@mistriwork/engine": "1.0.0-rc.
|
|
89
|
-
"@mistriwork/ui": "1.0.0-rc.
|
|
88
|
+
"@mistriwork/engine": "1.0.0-rc.65",
|
|
89
|
+
"@mistriwork/ui": "1.0.0-rc.65",
|
|
90
90
|
"intl-messageformat": "12.1.2",
|
|
91
91
|
"qrcode-generator": "^2.0.4"
|
|
92
92
|
},
|