@mistriwork/kit 1.0.0-rc.36 → 1.0.0-rc.38
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/Crumbs.js +12 -0
- package/dist/client/components/MultiStepForm.js +1 -1
- package/dist/client/components/PageEmptyRun.d.ts +9 -0
- package/dist/client/components/PageEmptyRun.js +20 -9
- package/dist/client/components/PageRelated.js +15 -3
- package/dist/client/components/PageSections.js +24 -6
- package/dist/client/components/Palette.js +27 -14
- package/dist/client/components/Sidebar.js +5 -5
- package/dist/client/components/dashboardModel.d.ts +2 -0
- package/dist/client/components/recordSearch.d.ts +14 -1
- package/dist/client/components/recordSearch.js +29 -4
- package/dist/client/copy/shell/components/Palette.d.ts +1 -0
- package/dist/client/copy/shell/components/Palette.js +2 -0
- package/dist/client/features.css +4 -0
- package/dist/client/fileSource.d.ts +8 -0
- package/dist/client/fileSource.js +31 -9
- package/dist/client/index.html +7 -5
- package/dist/client/partsLook.css +26 -0
- package/dist/client/structure.css +20 -0
- package/dist/client/style.css +6 -1
- package/package.json +3 -3
|
@@ -80,6 +80,12 @@ function trailSetting() {
|
|
|
80
80
|
return { top: true, home: true };
|
|
81
81
|
return { top: said?.top ?? false, home: said?.home ?? false };
|
|
82
82
|
}
|
|
83
|
+
function bareAt(entry) {
|
|
84
|
+
if (!entry || entry.kind !== 'page' || entry.table || !entry.pageId)
|
|
85
|
+
return false;
|
|
86
|
+
const app = shell().app();
|
|
87
|
+
return (app && dashboardAt(app, entry.pageId)?.layout) === 'bare';
|
|
88
|
+
}
|
|
83
89
|
// Indices stay the walk's own: only the selected row is left off the end.
|
|
84
90
|
const trailOf = (walked) => (splitSelection(walked) ? walked.slice(0, -1) : walked);
|
|
85
91
|
/**
|
|
@@ -92,6 +98,12 @@ export function crumbBarShown(walked) {
|
|
|
92
98
|
const setting = trailSetting();
|
|
93
99
|
if (!setting)
|
|
94
100
|
return false;
|
|
101
|
+
/* A bare page owns the window, and the bar is part of the frame it takes out of the flow (features.css hides the
|
|
102
|
+
sidebar and top bar, not this). Drawn over it, the sticky bar sat on top of the page's own controls and took their
|
|
103
|
+
clicks once the walk had a second step — a param set with `push` — so the page's own layout decides, whatever the
|
|
104
|
+
setting or the history. */
|
|
105
|
+
if (bareAt(walked.at(-1)))
|
|
106
|
+
return false;
|
|
95
107
|
if (setting.top)
|
|
96
108
|
return true;
|
|
97
109
|
const stack = trailOf(walked);
|
|
@@ -212,5 +212,5 @@ export function MultiStepForm({ steps, children, step, initialStep = 0, onStepCh
|
|
|
212
212
|
busyLabel: last ? say('common.saving') : say('common.checking'),
|
|
213
213
|
} })] }));
|
|
214
214
|
}
|
|
215
|
-
return (_jsxs("section", { ref: root, className: `multi-step-form ${className}`.trim(), ...(intake ? { 'data-style': 'intake' } : {}), "aria-labelledby": titleId, children: [aside, intake ? (_jsxs(_Fragment, { children: [note, _jsxs("div", { className: "intake-head", children: [progressRow, _jsx(StepHeader, { level: 2, id: titleId, title: heading, ...(active.lead ? { lead: active.lead } : {}) })] })] })) : (_jsxs("div", { className: "multi-step-heading", children: [progressRow, _jsx("h2", { id: titleId, children: active.
|
|
215
|
+
return (_jsxs("section", { ref: root, className: `multi-step-form ${className}`.trim(), ...(intake ? { 'data-style': 'intake' } : {}), "aria-labelledby": titleId, children: [aside, intake ? (_jsxs(_Fragment, { children: [note, _jsxs("div", { className: "intake-head", children: [progressRow, _jsx(StepHeader, { level: 2, id: titleId, title: heading, ...(active.lead ? { lead: active.lead } : {}) })] })] })) : (_jsxs("div", { className: "multi-step-heading", children: [progressRow, _jsx("h2", { id: titleId, children: heading }), active.lead && _jsx("p", { className: "multi-step-lead", children: active.lead })] })), panelNode, problemNode, hostSaid, _jsxs("div", { className: "multi-step-actions form-actions", children: [leading, current > 0 && (_jsx(Button, { intent: "quiet", className: "multi-step-back", disabled: pending, onClick: () => void move('previous'), children: previousLabel })), last ? (_jsx(Button, { intent: "primary", busy: pending, busyLabel: say('common.saving'), onClick: () => void complete(), children: primaryWords })) : (_jsx(Button, { intent: "primary", busy: pending, busyLabel: say('common.checking'), onClick: () => void move('next'), children: primaryWords }))] })] }));
|
|
216
216
|
}
|
|
@@ -5,6 +5,15 @@ interface RunItem {
|
|
|
5
5
|
section: PageSection;
|
|
6
6
|
index: number;
|
|
7
7
|
}
|
|
8
|
+
/** What a list is, for deciding: waiting to know, with rows (or broken, which it says itself), or empty. */
|
|
9
|
+
export type Standing = 'wait' | 'rows' | 'empty' | 'gone';
|
|
10
|
+
/**
|
|
11
|
+
* Where each list of a run stands: asked the question the list asks itself (the same query, so the answer is shared),
|
|
12
|
+
* and its `when` asked of the record. The run's items and their standing, by position.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useStandings(items: RunItem[], plans: SectionPlan[], base: TableMeta, recordKey: Record<string, unknown>,
|
|
15
|
+
/** The lists whose rows are asked for: a strip of tabs fetches each when opened, so it asks only for the ones it must decide on. */
|
|
16
|
+
decide?: (item: RunItem) => boolean): Standing[];
|
|
8
17
|
export declare function EmptyRun({ items, plans, base, recordKey, draw, rescue, }: {
|
|
9
18
|
items: RunItem[];
|
|
10
19
|
plans: SectionPlan[];
|
|
@@ -11,7 +11,9 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
* - a tab keeps at least one list: where a tab holds nothing but lists and they are all empty, they are said in a
|
|
12
12
|
* line rather than leaving the tab blank.
|
|
13
13
|
*
|
|
14
|
-
* Inside a `listTabs` strip
|
|
14
|
+
* Inside a `listTabs` strip a list is a tab, and the tab follows the same answers (`useStandings`): a list whose `when` is
|
|
15
|
+
* not met has no tab, and an empty one that hides has none unless the reader may add to it. One that collapses keeps its
|
|
16
|
+
* tab, which says the list is empty (PageSections.tsx).
|
|
15
17
|
*/
|
|
16
18
|
import { shellRoot } from '../shellHost.js';
|
|
17
19
|
import { useContext } from 'react';
|
|
@@ -32,8 +34,13 @@ function said(names) {
|
|
|
32
34
|
return names.join(', ');
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Where each list of a run stands: asked the question the list asks itself (the same query, so the answer is shared),
|
|
39
|
+
* and its `when` asked of the record. The run's items and their standing, by position.
|
|
40
|
+
*/
|
|
41
|
+
export function useStandings(items, plans, base, recordKey,
|
|
42
|
+
/** The lists whose rows are asked for: a strip of tabs fetches each when opened, so it asks only for the ones it must decide on. */
|
|
43
|
+
decide = () => true) {
|
|
37
44
|
const api = usePageApi();
|
|
38
45
|
const context = useContext(PageRenderContext);
|
|
39
46
|
const planOf = (item) => plans.find((p) => p.index === item.index) ?? { index: item.index };
|
|
@@ -48,14 +55,14 @@ export function EmptyRun({ items, plans, base, recordKey, draw, rescue, }) {
|
|
|
48
55
|
return {
|
|
49
56
|
queryKey: ['page-list', 'groups', groups, 0],
|
|
50
57
|
queryFn: () => api('/api/breakdown', groupsBody(groups, 0)),
|
|
51
|
-
enabled: !plan.empty && !plan.error,
|
|
58
|
+
enabled: !plan.empty && !plan.error && decide(item),
|
|
52
59
|
staleTime: 0,
|
|
53
60
|
};
|
|
54
61
|
}
|
|
55
62
|
return {
|
|
56
63
|
queryKey: ['page-list', view, 0],
|
|
57
64
|
queryFn: () => api('/api/view/run', { view: view, offset: 0 }),
|
|
58
|
-
enabled: !plan.empty && !plan.error && Boolean(view),
|
|
65
|
+
enabled: !plan.empty && !plan.error && Boolean(view) && decide(item),
|
|
59
66
|
staleTime: 0,
|
|
60
67
|
};
|
|
61
68
|
}),
|
|
@@ -68,12 +75,12 @@ export function EmptyRun({ items, plans, base, recordKey, draw, rescue, }) {
|
|
|
68
75
|
staleTime: 0,
|
|
69
76
|
})),
|
|
70
77
|
});
|
|
71
|
-
|
|
78
|
+
return items.map((_, i) => {
|
|
72
79
|
const { section } = items[i];
|
|
73
80
|
const plan = planOf(items[i]);
|
|
74
81
|
if (section.when && gates[i].data !== true)
|
|
75
82
|
return gates[i].isPending ? 'wait' : 'gone';
|
|
76
|
-
if (plan.error)
|
|
83
|
+
if (plan.error || !decide(items[i]))
|
|
77
84
|
return 'rows';
|
|
78
85
|
if (plan.empty)
|
|
79
86
|
return 'empty';
|
|
@@ -86,8 +93,12 @@ export function EmptyRun({ items, plans, base, recordKey, draw, rescue, }) {
|
|
|
86
93
|
if (grouped)
|
|
87
94
|
return got && !('errors' in got) && got.rows.length === 0 ? 'empty' : 'rows';
|
|
88
95
|
return got && 'view' in got && got.rows.length === 0 ? 'empty' : 'rows';
|
|
89
|
-
};
|
|
90
|
-
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
export function EmptyRun({ items, plans, base, recordKey, draw, rescue, }) {
|
|
99
|
+
useMessageLanguage();
|
|
100
|
+
const context = useContext(PageRenderContext);
|
|
101
|
+
const states = useStandings(items, plans, base, recordKey);
|
|
91
102
|
/* Nothing here is drawn as a list: the run is all that stands in its tab, so it may not vanish. */
|
|
92
103
|
const nothingElse = rescue && states.every((state) => state === 'empty' || state === 'gone') && states.includes('empty');
|
|
93
104
|
const door = (item) => relatedDoor(item.section, base, recordKey, { preview: context.preview, actions: context.actions }).door;
|
|
@@ -9,7 +9,7 @@ import { PresentationSwitch } from './PresentationSwitch.js';
|
|
|
9
9
|
import { useContext, useMemo, useRef, useState } from 'react';
|
|
10
10
|
import { keepPreviousData, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
11
11
|
import { ownedBy } from '../requestIdentity.js';
|
|
12
|
-
import { columnLabel, recordLabel, api as coreApi, findTable, openRecord, rowLabel, state, writeAllowed } from '../core.js';
|
|
12
|
+
import { columnDisplay, columnLabel, recordLabel, api as coreApi, findTable, openRecord, rowLabel, state, writeAllowed } from '../core.js';
|
|
13
13
|
import { relatedRows } from '../prefs.js';
|
|
14
14
|
import { formatBytes, formatNumber, formatRelativeDay } from '../locale.js';
|
|
15
15
|
import { columnKind, linkTarget } from '@mistriwork/engine/shared/schema.js';
|
|
@@ -34,6 +34,7 @@ import { pluralOf, recordNoun } from '@mistriwork/engine/shared/appNoun.js';
|
|
|
34
34
|
import { canInsert, openRelatedRecord } from '../insert.js';
|
|
35
35
|
import { formShownFields } from '@mistriwork/engine/shared/form.js';
|
|
36
36
|
import { pinnedBy, sectionClass } from './pageModel.js';
|
|
37
|
+
import { groupLabel } from './valueModel.js';
|
|
37
38
|
import { CurrentCard } from './PageCurrent.js';
|
|
38
39
|
import { PageRenderContext, recordReadNames, spoken, usePageApi } from './pageContext.js';
|
|
39
40
|
import { Loading, SectionBox } from './PageSectionBox.js';
|
|
@@ -557,6 +558,15 @@ function RelatedList({ section, plan, base, recordKey, onEdit, collapsed, counte
|
|
|
557
558
|
return error.message;
|
|
558
559
|
}
|
|
559
560
|
};
|
|
561
|
+
/* A column of a file's row said as the resource dresses it — `display.values`, a vocabulary's words — for a second line
|
|
562
|
+
or a caption, undefined where the rule has no word for it (a date or a size has its own reading). */
|
|
563
|
+
const worded = (column, value) => {
|
|
564
|
+
if (!table)
|
|
565
|
+
return undefined;
|
|
566
|
+
const text = String(value);
|
|
567
|
+
const said = groupLabel(columnDisplay(table.id, column), value, table.columns.find((candidate) => candidate.name === column)?.allowed);
|
|
568
|
+
return said === text ? undefined : said;
|
|
569
|
+
};
|
|
560
570
|
const lease = filesOnLease();
|
|
561
571
|
const attachments = file && table
|
|
562
572
|
? rows.flatMap((row) => {
|
|
@@ -570,7 +580,9 @@ function RelatedList({ section, plan, base, recordKey, onEdit, collapsed, counte
|
|
|
570
580
|
!hidden.includes(column) &&
|
|
571
581
|
row[column] != null &&
|
|
572
582
|
row[column] !== '')
|
|
573
|
-
.map((column) => column === file.size
|
|
583
|
+
.map((column) => column === file.size
|
|
584
|
+
? formatBytes(Number(row[column]))
|
|
585
|
+
: (worded(column, row[column]) ?? formatRelativeDay(String(row[column])) ?? String(row[column])));
|
|
574
586
|
const href = served(`/api/file?${new URLSearchParams({ ...ownedBy(owner), table: table.id, key: JSON.stringify(rowKey) })}`);
|
|
575
587
|
const type = file.type && typeof row[file.type] === 'string' ? row[file.type] : undefined;
|
|
576
588
|
return [
|
|
@@ -614,7 +626,7 @@ function RelatedList({ section, plan, base, recordKey, onEdit, collapsed, counte
|
|
|
614
626
|
row[column] != null &&
|
|
615
627
|
row[column] !== '' &&
|
|
616
628
|
captions(column))
|
|
617
|
-
.map((column) => String(row[column]));
|
|
629
|
+
.map((column) => worded(column, row[column]) ?? String(row[column]));
|
|
618
630
|
const alt = words[0] ?? String(row[file.name] ?? '');
|
|
619
631
|
return [
|
|
620
632
|
{
|
|
@@ -20,8 +20,8 @@ import { FieldsSection } from './PageFields.js';
|
|
|
20
20
|
import { BreakdownSection, ChartSection, MetricSection } from './PageMetrics.js';
|
|
21
21
|
import { DashboardNote } from './DashboardNote.js';
|
|
22
22
|
import { TimelineSection } from './PageTimeline.js';
|
|
23
|
-
import { ListSection, RelatedCount, useRelatedCounts } from './PageRelated.js';
|
|
24
|
-
import { EmptyRun } from './PageEmptyRun.js';
|
|
23
|
+
import { ListSection, RelatedCount, relatedDoor, useRelatedCounts } from './PageRelated.js';
|
|
24
|
+
import { EmptyRun, useStandings } from './PageEmptyRun.js';
|
|
25
25
|
import { useMessageLanguage } from './useMessageLanguage.js';
|
|
26
26
|
import { useTabFold } from './useTabFold.js';
|
|
27
27
|
import { DropItem, DropMenu } from '@mistriwork/ui/DropMenu.js';
|
|
@@ -208,8 +208,24 @@ export function TabStrip({ tabs, name, entry, onTab, draw, scoped, eager = [], c
|
|
|
208
208
|
}, children: tab.label }, tab.key))) }), _jsx("div", { className: "page-tab-more", "data-fold-more": "", "data-folded": folded.size ? undefined : '', "aria-hidden": !folded.size || undefined, children: _jsx(DropMenu, { className: "page-tab-more-menu", triggerClassName: "page-tab", label: message('common.more'), popupClassName: "page-actions-popup", align: "end", children: tabs.map((tab, i) => folded.has(i) ? (_jsx(DropItem, { className: "page-actions-item", onClick: () => show(i), children: tab.label }, tab.key)) : null) }) })] }), _jsx("div", { className: "page-tabpanels", children: tabs.map((tab, i) => (_jsx("div", { className: "page-tabpanel", role: "tabpanel", id: `${id}-tabpanel-${i}`, "aria-labelledby": `${id}-tab-${i}`, tabIndex: i === active ? 0 : -1, hidden: i !== active, inert: i !== active, "aria-hidden": i !== active, children: drawn.has(i) ? draw(i) : null }, tab.key))) })] }));
|
|
209
209
|
}
|
|
210
210
|
/** A run of lists as tabs: the names across the top, one table under them, fetched when opened. */
|
|
211
|
-
function ListTabs({ items, entry, onTab, draw, scoped, counting, pages, }) {
|
|
211
|
+
function ListTabs({ items: run, plans, base, recordKey, entry, onTab, draw, scoped, counting, pages, }) {
|
|
212
212
|
useMessageLanguage();
|
|
213
|
+
const context = useContext(PageRenderContext);
|
|
214
|
+
/* A list stands in a strip as it stands outside one: its `when` unmet leaves it no tab, and one that hides while empty
|
|
215
|
+
has none until it has rows, unless the reader may add to it (a door is never taken away). A list the page is still
|
|
216
|
+
asking about is left out until it is known, so a tab arrives rather than goes. */
|
|
217
|
+
const hiding = (item) => item.section.kind === 'list' && item.section.emptyMode === 'hide';
|
|
218
|
+
const standing = useStandings(run, plans, base, recordKey, hiding);
|
|
219
|
+
const items = run.filter((item, i) => {
|
|
220
|
+
const hides = hiding(item);
|
|
221
|
+
if (standing[i] === 'gone')
|
|
222
|
+
return false;
|
|
223
|
+
if (standing[i] === 'wait')
|
|
224
|
+
return !item.section.when && !hides;
|
|
225
|
+
if (standing[i] === 'empty' && hides)
|
|
226
|
+
return Boolean(relatedDoor(item.section, base, recordKey, { preview: context.preview, actions: context.actions }).door);
|
|
227
|
+
return true;
|
|
228
|
+
});
|
|
213
229
|
/* The token is the source's words (apps.ts keepAddresses), so an address names one tab in every language. */
|
|
214
230
|
const named = (item) => item.section.kind === 'history'
|
|
215
231
|
? HISTORY_TAB
|
|
@@ -230,6 +246,8 @@ function ListTabs({ items, entry, onTab, draw, scoped, counting, pages, }) {
|
|
|
230
246
|
label: (_jsxs(_Fragment, { children: [word(item), counted(item)] })),
|
|
231
247
|
}));
|
|
232
248
|
const strip = withPageTabs(tabs, (i) => draw(items[i]), pages);
|
|
249
|
+
if (!strip.tabs.length)
|
|
250
|
+
return null;
|
|
233
251
|
return _jsx(TabStrip, { tabs: strip.tabs, name: "Related lists", entry: entry, onTab: onTab, draw: strip.draw, scoped: scoped });
|
|
234
252
|
}
|
|
235
253
|
/** The record's sections as tabs: a panel is sections again, laid out as the page lays them out. */
|
|
@@ -312,8 +330,8 @@ export function Sections({ page, base, recordKey: key, plans, entry, onLabel, on
|
|
|
312
330
|
place on the page, and a tab strip spans it whole. The Workbench's
|
|
313
331
|
builder gives every list it adds a width, so there a width is not a
|
|
314
332
|
placement anyone chose, and its lists keep the strip. */
|
|
315
|
-
/* A list that says what it does while empty (`empty: 'hide' | 'collapse'`) is a tab like any other
|
|
316
|
-
|
|
333
|
+
/* A list that says what it does while empty (`empty: 'hide' | 'collapse'`) is a tab like any other. The strip then
|
|
334
|
+
follows the list's own answers (ListTabs): `hide` leaves no tab while it has no rows, `collapse` keeps the tab. */
|
|
317
335
|
const tabbed = (section) => tabbedSection(section, inAppPage(), inferred);
|
|
318
336
|
/* Outside a strip, such a list is left out or said in one line with its neighbours (PageEmptyRun.tsx). */
|
|
319
337
|
const emptyable = (section) => section.kind === 'list' && Boolean(section.emptyMode) && (section.presentation !== 'card' || section.emptyMode === 'hide');
|
|
@@ -348,7 +366,7 @@ export function Sections({ page, base, recordKey: key, plans, entry, onLabel, on
|
|
|
348
366
|
if (listTabs && autoTabs && listRuns.has(i) && (listRuns.get(i) ?? 0) >= (pageTabs.length ? 1 : 2)) {
|
|
349
367
|
if (!strip) {
|
|
350
368
|
strip = [];
|
|
351
|
-
laid.push(_jsx(ListTabs, { items: strip, entry: entry, onTab: onTab, draw: draw, scoped: scoped, counting: inferred ? { base, recordKey: key } : undefined, pages: grouped ? undefined : takePageTabs() }, `tabs-${i}`));
|
|
369
|
+
laid.push(_jsx(ListTabs, { items: strip, plans: plans, base: base, recordKey: key, entry: entry, onTab: onTab, draw: draw, scoped: scoped, counting: inferred ? { base, recordKey: key } : undefined, pages: grouped ? undefined : takePageTabs() }, `tabs-${i}`));
|
|
352
370
|
}
|
|
353
371
|
strip.push(item);
|
|
354
372
|
leave = null;
|
|
@@ -12,7 +12,7 @@ import { humanName } from '@mistriwork/engine/shared/model.js';
|
|
|
12
12
|
import { isAppIcon } from '@mistriwork/engine/shared/appIcons.js';
|
|
13
13
|
import { shell } from '../shellMode.js';
|
|
14
14
|
import { findTable, openRecord } from '../core.js';
|
|
15
|
-
import {
|
|
15
|
+
import { findAcross, searchedTables } from './recordSearch.js';
|
|
16
16
|
import { appRooms, isListRoom } from './appRooms.js';
|
|
17
17
|
import { Icon } from './Icon.js';
|
|
18
18
|
import { whenMenuChanges } from '../menu.js';
|
|
@@ -108,9 +108,20 @@ function kindWord(kind) {
|
|
|
108
108
|
return kind;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
+
/** The tables the term is searched in: every list the reader's menu holds, up to the search's own ceiling (recordSearch.ts),
|
|
112
|
+
and how many past it are left out. */
|
|
111
113
|
function recordTables() {
|
|
112
114
|
const app = shell().inApp() ? shell().app() : null;
|
|
113
|
-
return app ?
|
|
115
|
+
return app ? searchedTables(app) : { tables: [], left: 0 };
|
|
116
|
+
}
|
|
117
|
+
/** The hits one from each table in turn, so the few a palette shows are not the first tables' alone. */
|
|
118
|
+
function interleaved(lists, most) {
|
|
119
|
+
const out = [];
|
|
120
|
+
for (let at = 0; out.length < most && lists.some((each) => at < each.length); at++)
|
|
121
|
+
for (const each of lists)
|
|
122
|
+
if (at < each.length && out.length < most)
|
|
123
|
+
out.push(each[at]);
|
|
124
|
+
return out;
|
|
114
125
|
}
|
|
115
126
|
export function Palette({ prefill = '', onClose }) {
|
|
116
127
|
const input = useRef(null);
|
|
@@ -151,23 +162,24 @@ export function Palette({ prefill = '', onClose }) {
|
|
|
151
162
|
useEffect(() => {
|
|
152
163
|
const term = query.trim();
|
|
153
164
|
const mine = ++recordToken.current;
|
|
154
|
-
const tables = recordTables();
|
|
165
|
+
const { tables } = recordTables();
|
|
155
166
|
if (term.length < 2 || !tables.length) {
|
|
156
167
|
setRecords({ term, items: [] });
|
|
157
168
|
return;
|
|
158
169
|
}
|
|
159
170
|
const timer = setTimeout(() => {
|
|
160
|
-
void
|
|
161
|
-
kind: 'record',
|
|
162
|
-
label: found.label,
|
|
163
|
-
search: '',
|
|
164
|
-
detail: `${humanName(findable.table.name)} · ${Object.values(found.key).join('/')}`,
|
|
165
|
-
icon: findable.room.icon,
|
|
166
|
-
run: found.open,
|
|
167
|
-
})))).then((hits) => {
|
|
171
|
+
void findAcross(tables, term, 3).then((found) => {
|
|
168
172
|
if (mine !== recordToken.current)
|
|
169
173
|
return;
|
|
170
|
-
|
|
174
|
+
const hits = found.map((own, at) => own.map((each) => ({
|
|
175
|
+
kind: 'record',
|
|
176
|
+
label: each.label,
|
|
177
|
+
search: '',
|
|
178
|
+
detail: `${humanName(tables[at].table.name)} · ${Object.values(each.key).join('/')}`,
|
|
179
|
+
icon: tables[at].room.icon,
|
|
180
|
+
run: each.open,
|
|
181
|
+
})));
|
|
182
|
+
setRecords({ term, items: interleaved(hits, MOST.records) });
|
|
171
183
|
});
|
|
172
184
|
}, prefill && query === prefill ? 0 : 180);
|
|
173
185
|
return () => clearTimeout(timer);
|
|
@@ -186,7 +198,8 @@ export function Palette({ prefill = '', onClose }) {
|
|
|
186
198
|
the box never named. Until the hits answer this text, "nothing matches"
|
|
187
199
|
is not yet true either. */
|
|
188
200
|
const hits = offeredChoices({ typed: term, asked: records.term, rows: records.items, label: (item) => item.label });
|
|
189
|
-
const
|
|
201
|
+
const { tables: searched, left } = recordTables();
|
|
202
|
+
const settled = hits.answered || term.length < 2 || !searched.length;
|
|
190
203
|
/* An App's rows stand in groups, each ranked within itself: where the reader was (only before they type — typing is
|
|
191
204
|
asking for something else), the pages, what they can make, the commands, and the records the words found. A room
|
|
192
205
|
they were just in is under Recent and not again under Pages. */
|
|
@@ -272,5 +285,5 @@ export function Palette({ prefill = '', onClose }) {
|
|
|
272
285
|
return (_jsxs("div", { className: `palette-item${i === current ? ' active' : ''}`, id: `palette-o${i}`, role: "option", "aria-selected": i === current, "aria-labelledby": `palette-o${i}-name`, "aria-describedby": detail ? `palette-o${i}-line` : undefined, "data-group": group, onClick: () => choose(i), onMouseMove: () => setActive(i), children: [_jsx("span", { className: "palette-icon", "aria-hidden": "true", children: isAppIcon(item.icon) ? _jsx(Icon, { name: item.icon, size: 16 }) : null }), _jsx("span", { className: "palette-label", id: `palette-o${i}-name`, children: item.label }), detail ? (_jsx("span", { className: "palette-detail", id: `palette-o${i}-line`, children: detail })) : null] }, `${group}:${item.kind}:${item.label}:${at}`));
|
|
273
286
|
})] }, group));
|
|
274
287
|
})
|
|
275
|
-
: shown.map((item, i) => (_jsxs("div", { className: `palette-item${i === current ? ' active' : ''}`, id: `palette-o${i}`, role: "option", "aria-selected": i === current, onClick: () => choose(i), onMouseMove: () => setActive(i), children: [_jsx("span", { className: `palette-kind kind-${item.kind}`, children: kindWord(item.kind) }), _jsx("span", { className: "palette-label", children: item.label }), item.detail ? _jsx("span", { className: "palette-detail", children: item.detail }) : null] }, `${item.kind}:${item.label}:${i}`))) }), inApp ? (_jsxs("div", { className: "palette-foot", "aria-hidden": "true", children: [_jsxs("span", { className: "palette-hint", children: [_jsx("kbd", { children: "\u2191" }), _jsx("kbd", { children: "\u2193" }), " ", say('hintMove')] }), _jsxs("span", { className: "palette-hint", children: [_jsx("kbd", { children: "\u21B5" }), " ", say('hintOpen')] }), _jsxs("span", { className: "palette-hint", children: [_jsx("kbd", { children: say('keyEscape') }), " ", say('hintClose')] })] })) : null] }) }));
|
|
288
|
+
: shown.map((item, i) => (_jsxs("div", { className: `palette-item${i === current ? ' active' : ''}`, id: `palette-o${i}`, role: "option", "aria-selected": i === current, onClick: () => choose(i), onMouseMove: () => setActive(i), children: [_jsx("span", { className: `palette-kind kind-${item.kind}`, children: kindWord(item.kind) }), _jsx("span", { className: "palette-label", children: item.label }), item.detail ? _jsx("span", { className: "palette-detail", children: item.detail }) : null] }, `${item.kind}:${item.label}:${i}`))) }), inApp && left > 0 ? (_jsx("p", { className: "palette-note", role: "note", children: say('searchedSome', { searched: searched.length, total: searched.length + left }) })) : null, inApp ? (_jsxs("div", { className: "palette-foot", "aria-hidden": "true", children: [_jsxs("span", { className: "palette-hint", children: [_jsx("kbd", { children: "\u2191" }), _jsx("kbd", { children: "\u2193" }), " ", say('hintMove')] }), _jsxs("span", { className: "palette-hint", children: [_jsx("kbd", { children: "\u21B5" }), " ", say('hintOpen')] }), _jsxs("span", { className: "palette-hint", children: [_jsx("kbd", { children: say('keyEscape') }), " ", say('hintClose')] })] })) : null] }) }));
|
|
276
289
|
}
|
|
@@ -276,11 +276,11 @@ export function Sidebar({ host, footerHost: suppliedFooterHost, onSelect, tabNav
|
|
|
276
276
|
function TableRow({ item, index, current, active, rail, quiet, title, onSelect, tabNavigation = false, }) {
|
|
277
277
|
const row = useRef(null);
|
|
278
278
|
const snapshot = rowCount(item, undefined);
|
|
279
|
-
/* Named by its label
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
/* Named by its label and then its count, in the order they are drawn: the name holds the words the row shows
|
|
280
|
+
("Website 1"), as WCAG 2.5.3 asks, so a voice command that reads the screen finds it. The label alone, with
|
|
281
|
+
the count said as a description, was "Website" under a row that reads "Website 1". */
|
|
282
282
|
const labelId = useId(), countId = useId();
|
|
283
|
-
return (_jsxs("button", { ref: row, type: "button", "data-table": item.table, "data-navq": item.navq, "data-table-index": index, tabIndex: tabNavigation ? 0 : -1, "aria-current": current ? 'true' : 'false', "aria-labelledby": labelId
|
|
283
|
+
return (_jsxs("button", { ref: row, type: "button", "data-table": item.table, "data-navq": item.navq, "data-table-index": index, tabIndex: tabNavigation ? 0 : -1, "aria-current": current ? 'true' : 'false', "aria-labelledby": `${labelId} ${countId}`, className: active ? 'active' : undefined, title: title, onClick: item.entry
|
|
284
284
|
? /* A list opens on its first tab — the app decided what matters
|
|
285
285
|
most — not on the bare unfiltered table. */
|
|
286
286
|
() => {
|
|
@@ -292,7 +292,7 @@ function TableRow({ item, index, current, active, rail, quiet, title, onSelect,
|
|
|
292
292
|
() => {
|
|
293
293
|
go(tableView(item.table, undefined, stickyTab()), 'reset');
|
|
294
294
|
onSelect?.();
|
|
295
|
-
}, children: [_jsx(NavGlyph, { icon: item.icon, label: item.label, railed: rail, color: item.navColor }), _jsx("span", { className: "nav-label", id: labelId, children: item.label }), item.tag === 'view' ? (_jsx("span", { className: "view-tag", id: countId, children: say('view') })) : item.counted ? (_jsx(LiveCount, { item: item, spec: item.counted, row: row, quiet: quiet, id: countId })) : snapshot != null ? (_jsx("span", { className: "rows", id: countId, children: snapshot })) : null] }));
|
|
295
|
+
}, children: [_jsx(NavGlyph, { icon: item.icon, label: item.label, railed: rail, color: item.navColor }), _jsx("span", { className: "nav-label", id: labelId, children: item.label }), ' ', item.tag === 'view' ? (_jsx("span", { className: "view-tag", id: countId, children: say('view') })) : item.counted ? (_jsx(LiveCount, { item: item, spec: item.counted, row: row, quiet: quiet, id: countId })) : snapshot != null ? (_jsx("span", { className: "rows", id: countId, children: snapshot })) : null] }));
|
|
296
296
|
}
|
|
297
297
|
/** Its own component, so only a counted row holds a query. */
|
|
298
298
|
function LiveCount({ item, spec, row, quiet, id, }) {
|
|
@@ -114,6 +114,8 @@ export interface Section {
|
|
|
114
114
|
/** find: the tables its box searches (DashboardFind.tsx), and the box's words before anything is typed. */
|
|
115
115
|
searched?: string[];
|
|
116
116
|
placeholder?: string;
|
|
117
|
+
/** integrations: the ones the settings form shows, in this order (IntegrationsForm.tsx); every one without it. */
|
|
118
|
+
integrations?: string[];
|
|
117
119
|
}
|
|
118
120
|
/** The chart shapes a part on demand draws (ChartShapes.tsx), so a dashboard of lines and bars never fetches it. */
|
|
119
121
|
export declare const EXTRA_SHAPES: readonly string[];
|
|
@@ -17,8 +17,21 @@ export interface Found {
|
|
|
17
17
|
key: Record<string, unknown>;
|
|
18
18
|
open: () => void;
|
|
19
19
|
}
|
|
20
|
-
/** The tables
|
|
20
|
+
/** The most tables one search asks at once, and how many of them are in flight together: a search is one request per
|
|
21
|
+
table, and an App's menu may hold a few dozen lists. */
|
|
22
|
+
export declare const SEARCHED_MOST = 24;
|
|
23
|
+
/** The tables whose records the reader may find: those of `tables` (ids), or of the App's menu, at most `most`. */
|
|
21
24
|
export declare function findableTables(app: ServedApp, tables?: readonly string[], most?: number): Findable[];
|
|
25
|
+
/** The tables a search over the whole menu asks, and how many it leaves out past SEARCHED_MOST (so it can say so). */
|
|
26
|
+
export declare function searchedTables(app: ServedApp): {
|
|
27
|
+
tables: Findable[];
|
|
28
|
+
left: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* `limit` records of each table whose names hold `term`, the tables asked a few at a time and answered in the menu's
|
|
32
|
+
* order. A refusal answers nothing for its table (findRecords), never the whole search's failure.
|
|
33
|
+
*/
|
|
34
|
+
export declare function findAcross(findables: readonly Findable[], term: string, limit: number, concurrency?: number): Promise<Found[][]>;
|
|
22
35
|
/**
|
|
23
36
|
* The line a hit says under its name: what its list says first under a
|
|
24
37
|
* card's title — a cards description, else the first of its lines — or its
|
|
@@ -21,8 +21,12 @@ function findableOf(room) {
|
|
|
21
21
|
const label = table ? (labelPath(table) ?? primaryKey(table)[0]) : undefined;
|
|
22
22
|
return table && label && primaryKey(table).length ? { table, label, room } : undefined;
|
|
23
23
|
}
|
|
24
|
-
/** The tables
|
|
25
|
-
|
|
24
|
+
/** The most tables one search asks at once, and how many of them are in flight together: a search is one request per
|
|
25
|
+
table, and an App's menu may hold a few dozen lists. */
|
|
26
|
+
export const SEARCHED_MOST = 24;
|
|
27
|
+
const SEARCH_CONCURRENCY = 6;
|
|
28
|
+
/** Every table the reader may find records of: those of `tables` (ids), or of every list the menu holds, in its order. */
|
|
29
|
+
function findableAll(app, tables) {
|
|
26
30
|
const seen = new Set();
|
|
27
31
|
const out = [];
|
|
28
32
|
const rooms = listRooms(app, Boolean(tables));
|
|
@@ -33,11 +37,32 @@ export function findableTables(app, tables, most = 6) {
|
|
|
33
37
|
const found = findableOf(room);
|
|
34
38
|
if (found)
|
|
35
39
|
out.push(found);
|
|
36
|
-
if (out.length >= most)
|
|
37
|
-
break;
|
|
38
40
|
}
|
|
39
41
|
return out;
|
|
40
42
|
}
|
|
43
|
+
/** The tables whose records the reader may find: those of `tables` (ids), or of the App's menu, at most `most`. */
|
|
44
|
+
export function findableTables(app, tables, most = SEARCHED_MOST) {
|
|
45
|
+
return findableAll(app, tables).slice(0, most);
|
|
46
|
+
}
|
|
47
|
+
/** The tables a search over the whole menu asks, and how many it leaves out past SEARCHED_MOST (so it can say so). */
|
|
48
|
+
export function searchedTables(app) {
|
|
49
|
+
const every = findableAll(app);
|
|
50
|
+
return { tables: every.slice(0, SEARCHED_MOST), left: Math.max(0, every.length - SEARCHED_MOST) };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* `limit` records of each table whose names hold `term`, the tables asked a few at a time and answered in the menu's
|
|
54
|
+
* order. A refusal answers nothing for its table (findRecords), never the whole search's failure.
|
|
55
|
+
*/
|
|
56
|
+
export async function findAcross(findables, term, limit, concurrency = SEARCH_CONCURRENCY) {
|
|
57
|
+
const answers = findables.map(() => []);
|
|
58
|
+
let next = 0;
|
|
59
|
+
const worker = async () => {
|
|
60
|
+
for (let at = next++; at < findables.length; at = next++)
|
|
61
|
+
answers[at] = await findRecords(findables[at], term, limit);
|
|
62
|
+
};
|
|
63
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, findables.length) }, worker));
|
|
64
|
+
return answers;
|
|
65
|
+
}
|
|
41
66
|
/**
|
|
42
67
|
* The line a hit says under its name: what its list says first under a
|
|
43
68
|
* card's title — a cards description, else the first of its lines — or its
|
|
@@ -3,6 +3,7 @@ export declare const say: import("../../../messages.js").RoomMessage<{
|
|
|
3
3
|
readonly goToATable: "Go to a table, view, saved filter or database…";
|
|
4
4
|
readonly nothingMatches: "Nothing matches \"{term}\".";
|
|
5
5
|
readonly nothingToGo: "Nothing to go to.";
|
|
6
|
+
readonly searchedSome: "Records are searched in {searched} of {total} lists.";
|
|
6
7
|
readonly kindPage: "page";
|
|
7
8
|
readonly kindView: "view";
|
|
8
9
|
readonly kindTable: "table";
|
|
@@ -5,6 +5,8 @@ export const say = defineMessages({
|
|
|
5
5
|
goToATable: 'Go to a table, view, saved filter or database…',
|
|
6
6
|
nothingMatches: 'Nothing matches "{term}".',
|
|
7
7
|
nothingToGo: 'Nothing to go to.',
|
|
8
|
+
/* An App with more lists than one search asks: the ones left out are said, not silently unsearched. */
|
|
9
|
+
searchedSome: 'Records are searched in {searched} of {total} lists.',
|
|
8
10
|
/* The badge on each row says what it opens, in the reader's words rather than the registry's identifiers. */
|
|
9
11
|
kindPage: 'page',
|
|
10
12
|
kindView: 'view',
|
package/dist/client/features.css
CHANGED
|
@@ -2166,6 +2166,10 @@ body.app-mode th .pk { display: none; }
|
|
|
2166
2166
|
/* The stepper's step: the bar, then its name set tight, the step's one strong thing. */
|
|
2167
2167
|
.multi-step-heading { display: grid; gap: var(--space-5); }
|
|
2168
2168
|
.multi-step-heading h2 { margin: 0; font-size: 1.25rem; line-height: 1.15; letter-spacing: var(--track-display); text-wrap: balance; }
|
|
2169
|
+
.multi-step-heading .multi-step-lead { margin: calc(var(--space-2) - var(--space-5)) 0 0; max-width: 60ch; font-size: var(--text-md); line-height: 1.5; color: var(--ink-muted); text-wrap: pretty; }
|
|
2170
|
+
/* A row of two fields (`show: [['a', 'b']]`) in a stepper is spaced as the fields around it are: forms.css gave it a
|
|
2171
|
+
16px gap both ways, so the pair stood closer than the stack above and below it. */
|
|
2172
|
+
.multi-step-form:not([data-style='intake']) .form-columns { column-gap: var(--space-4); row-gap: var(--field-gap); }
|
|
2169
2173
|
|
|
2170
2174
|
/* A page's steps beside the form (MultiStepForm.tsx): drawn always, shown only where the page is wide enough for both
|
|
2171
2175
|
(structure.css lays the column out), so a page's first frame is the same at any width. Their dress is here. */
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/** Whether files here travel on a tenant lease rather than by address. */
|
|
2
2
|
export declare const filesOnLease: () => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* A picture's address on the lease as it stands, for a caller that answers
|
|
5
|
+
* while it draws (a free-form page's `useFile`): the blob's address once it
|
|
6
|
+
* has been read, else undefined, with the read started and `drawn` called
|
|
7
|
+
* when it lands so the caller draws again. A picture that cannot be read
|
|
8
|
+
* stays undefined and never calls `drawn`, so a failure is not a loop.
|
|
9
|
+
*/
|
|
10
|
+
export declare function pictureOnLeaseNow(table: string, key: Record<string, unknown>, variant: 'thumb' | undefined, drawn: () => void): string | undefined;
|
|
3
11
|
/**
|
|
4
12
|
* A picture's address, to draw in place: the file route's inline mode, or on
|
|
5
13
|
* a lease the blob it was read into — undefined until it has been, and when
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
* lease as base64 (`/api/file/read`), made a blob here, and drawn or saved
|
|
10
10
|
* from the blob's own address, which no other page and no other tenant can
|
|
11
11
|
* open. A picture read once is kept for the page's life, a few hundred at
|
|
12
|
-
* most, so a list that scrolls back does not read it again.
|
|
12
|
+
* most, so a list that scrolls back does not read it again. A free-form
|
|
13
|
+
* page's `useFile` draws from the same blobs (pictureOnLeaseNow): a signed
|
|
14
|
+
* address an `<img>` could fetch would be a second way into a tenant's files,
|
|
15
|
+
* one that outlives the lease and travels with a copied link.
|
|
13
16
|
*/
|
|
14
17
|
import { useEffect, useState } from 'react';
|
|
15
18
|
import { api } from './core.js';
|
|
@@ -52,7 +55,7 @@ async function fileOnLease(table, key, options = {}) {
|
|
|
52
55
|
const type = typeof reply.type === 'string' && /^image\/(png|jpeg|gif|webp|avif|bmp)$/.test(reply.type) ? reply.type : 'application/octet-stream';
|
|
53
56
|
return { blob: new Blob([bytesOf(reply.data)], { type }), name: reply.name };
|
|
54
57
|
}
|
|
55
|
-
/* Pictures read on the lease, by what they were read as; the oldest is let go past the most kept. */
|
|
58
|
+
/* Pictures read on the lease, by what they were read as, with the address once it is known; the oldest is let go past the most kept. */
|
|
56
59
|
const KEPT = 300;
|
|
57
60
|
const pictures = new Map();
|
|
58
61
|
/* The lease a picture was read on: another account or tenant reads its own. */
|
|
@@ -61,7 +64,7 @@ function pictureOnLease(table, key, variant) {
|
|
|
61
64
|
const identity = captureSessionIdentity();
|
|
62
65
|
if (keptFor !== identity) {
|
|
63
66
|
for (const kept of pictures.values())
|
|
64
|
-
void kept.then(URL.revokeObjectURL, () => { });
|
|
67
|
+
void kept.read.then(URL.revokeObjectURL, () => { });
|
|
65
68
|
pictures.clear();
|
|
66
69
|
keptFor = identity;
|
|
67
70
|
}
|
|
@@ -69,15 +72,34 @@ function pictureOnLease(table, key, variant) {
|
|
|
69
72
|
const kept = pictures.get(name);
|
|
70
73
|
if (kept)
|
|
71
74
|
return kept;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
const picture = {
|
|
76
|
+
read: fileOnLease(table, key, { inline: true, ...(variant ? { variant } : {}) }).then(({ blob }) => {
|
|
77
|
+
picture.src = URL.createObjectURL(blob);
|
|
78
|
+
return picture.src;
|
|
79
|
+
}),
|
|
80
|
+
};
|
|
81
|
+
picture.read.catch(() => pictures.get(name) === picture && pictures.delete(name));
|
|
82
|
+
pictures.set(name, picture);
|
|
75
83
|
if (pictures.size > KEPT) {
|
|
76
84
|
const [oldest, gone] = pictures.entries().next().value;
|
|
77
85
|
pictures.delete(oldest);
|
|
78
|
-
void gone.then(URL.revokeObjectURL, () => { });
|
|
86
|
+
void gone.read.then(URL.revokeObjectURL, () => { });
|
|
79
87
|
}
|
|
80
|
-
return
|
|
88
|
+
return picture;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A picture's address on the lease as it stands, for a caller that answers
|
|
92
|
+
* while it draws (a free-form page's `useFile`): the blob's address once it
|
|
93
|
+
* has been read, else undefined, with the read started and `drawn` called
|
|
94
|
+
* when it lands so the caller draws again. A picture that cannot be read
|
|
95
|
+
* stays undefined and never calls `drawn`, so a failure is not a loop.
|
|
96
|
+
*/
|
|
97
|
+
export function pictureOnLeaseNow(table, key, variant, drawn) {
|
|
98
|
+
const picture = pictureOnLease(table, key, variant);
|
|
99
|
+
if (picture.src !== undefined)
|
|
100
|
+
return picture.src;
|
|
101
|
+
picture.read.then(drawn, () => { });
|
|
102
|
+
return undefined;
|
|
81
103
|
}
|
|
82
104
|
/**
|
|
83
105
|
* A picture's address, to draw in place: the file route's inline mode, or on
|
|
@@ -93,7 +115,7 @@ export function usePictureAddress(table, key, connection, variant) {
|
|
|
93
115
|
if (!lease || !table || !key)
|
|
94
116
|
return;
|
|
95
117
|
let current = true;
|
|
96
|
-
pictureOnLease(table, key, variant).then((src) => current && setDrawn({ name, src }), () => current && setDrawn(undefined));
|
|
118
|
+
pictureOnLease(table, key, variant).read.then((src) => current && setDrawn({ name, src }), () => current && setDrawn(undefined));
|
|
97
119
|
return () => {
|
|
98
120
|
current = false;
|
|
99
121
|
};
|
package/dist/client/index.html
CHANGED
|
@@ -139,12 +139,14 @@
|
|
|
139
139
|
<div id="startup-status" role="status"><div class="startup-skeleton" aria-hidden="true"><i class="st-band"></i><div class="st-page"><b class="st-title"></b><b class="st-line"></b><div class="st-figures"><b></b><b></b><b></b></div><b class="st-row"></b><b class="st-row"></b><b class="st-row"></b><b class="st-row"></b><b class="st-row"></b></div></div><p>Loading...</p><a href="" hidden>Reload</a></div>
|
|
140
140
|
<!-- A pane the server drew (a public page, server/publicRender.ts) is the page without scripts too. -->
|
|
141
141
|
<noscript><style>#startup-status { display: none !important; } #content[data-ssr] { visibility: visible !important; }</style>JavaScript is required to open this application.</noscript>
|
|
142
|
-
<!-- The first stop on the page, so a keyboard gets past the top bar and
|
|
143
|
-
the sidebar's list of tables in one press. app.js moves the focus
|
|
144
|
-
itself: following the fragment would be a navigation the router
|
|
145
|
-
hears. -->
|
|
146
|
-
<a class="skip-link" href="#content">Skip to content</a>
|
|
147
142
|
<header class="topbar">
|
|
143
|
+
<!-- The first stop on the page, so a keyboard gets past the top bar and
|
|
144
|
+
the sidebar's list of tables in one press. app.js moves the focus
|
|
145
|
+
itself: following the fragment would be a navigation the router
|
|
146
|
+
hears. It is inside the banner, not before it: a link outside every
|
|
147
|
+
landmark is content a screen reader's landmark list skips (axe's
|
|
148
|
+
"region" rule). It is fixed, so it takes no room in the bar. -->
|
|
149
|
+
<a class="skip-link" href="#content">Skip to content</a>
|
|
148
150
|
<button type="button" class="brand" id="home-button" title="Back to the schema (h)">
|
|
149
151
|
<span class="brand-mark"></span>
|
|
150
152
|
<span class="brand-name">tablewalk</span>
|
|
@@ -1073,4 +1073,30 @@
|
|
|
1073
1073
|
font-variant-caps: var(--part-chart-caps);
|
|
1074
1074
|
letter-spacing: var(--part-chart-tracking);
|
|
1075
1075
|
}
|
|
1076
|
+
:root[data-parts~="kicker:ground"] .app-mode .form-page .eyebrow {
|
|
1077
|
+
background: var(--part-kicker-ground);
|
|
1078
|
+
}
|
|
1079
|
+
:root[data-parts~="kicker:ink"] .app-mode .form-page .eyebrow {
|
|
1080
|
+
color: var(--part-kicker-ink);
|
|
1081
|
+
}
|
|
1082
|
+
:root[data-parts~="kicker:edge"] .app-mode .form-page .eyebrow {
|
|
1083
|
+
border-color: var(--part-kicker-edge);
|
|
1084
|
+
}
|
|
1085
|
+
:root[data-parts~="kicker:radius"] .app-mode .form-page .eyebrow {
|
|
1086
|
+
border-radius: var(--part-kicker-radius);
|
|
1087
|
+
}
|
|
1088
|
+
:root[data-parts~="kicker:lift"] .app-mode .form-page .eyebrow {
|
|
1089
|
+
box-shadow: var(--part-kicker-lift);
|
|
1090
|
+
}
|
|
1091
|
+
:root[data-parts~="kicker:face"] .app-mode .form-page .eyebrow {
|
|
1092
|
+
font-family: var(--part-kicker-face);
|
|
1093
|
+
}
|
|
1094
|
+
:root[data-parts~="kicker:weight"] .app-mode .form-page .eyebrow {
|
|
1095
|
+
font-weight: var(--part-kicker-weight);
|
|
1096
|
+
}
|
|
1097
|
+
:root[data-parts~="kicker:case"] .app-mode .form-page .eyebrow {
|
|
1098
|
+
text-transform: var(--part-kicker-transform);
|
|
1099
|
+
font-variant-caps: var(--part-kicker-caps);
|
|
1100
|
+
letter-spacing: var(--part-kicker-tracking);
|
|
1101
|
+
}
|
|
1076
1102
|
}
|
|
@@ -147,6 +147,26 @@
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/* Between a phone and a desk the bar's controls are not one row by rule, and a long App name beside the tenant's
|
|
151
|
+
control and the account ran past the window's edge: at 768px the page scrolled sideways (a field report). It wraps:
|
|
152
|
+
what does not fit stands on a second line at the right (the actions' own auto margin), and the name gives way
|
|
153
|
+
first, to an ellipsis. A bar that fits is one row as before; a phone's is always one (below). */
|
|
154
|
+
@media (min-width: 601px) and (max-width: 768px) {
|
|
155
|
+
body.app-mode .topbar {
|
|
156
|
+
flex-wrap: wrap;
|
|
157
|
+
row-gap: var(--space-1);
|
|
158
|
+
}
|
|
159
|
+
body.app-mode .topbar .brand {
|
|
160
|
+
min-width: 0;
|
|
161
|
+
max-width: 100%;
|
|
162
|
+
}
|
|
163
|
+
body.app-mode .topbar .brand-name {
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
text-overflow: ellipsis;
|
|
166
|
+
white-space: nowrap;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
150
170
|
/* A phone's App bar is one row in every App, whichever shell it has on a
|
|
151
171
|
desk: the menu's mark first, the brand taking the room, then search, the
|
|
152
172
|
settings and the account at the right edge. A top-bar App had put its
|
package/dist/client/style.css
CHANGED
|
@@ -397,6 +397,8 @@ html[data-starting] .content.nav-holding.nav-holding-focusable > :not(.nav-held)
|
|
|
397
397
|
background: none; border: none; padding: var(--space-1) 5px;
|
|
398
398
|
color: var(--link); font: inherit; font-family: var(--mono);
|
|
399
399
|
cursor: pointer; border-radius: min(3px, var(--radius));
|
|
400
|
+
/* A step of the trail is a target (WCAG 2.5.8): at the small text sizes its line and padding came to 22px. */
|
|
401
|
+
min-block-size: 24px; box-sizing: border-box;
|
|
400
402
|
}
|
|
401
403
|
.crumbs > button:hover { background: var(--raised); }
|
|
402
404
|
/* The chevron is the only separator, and it is set lighter and roomier than
|
|
@@ -624,6 +626,7 @@ html[data-starting] .content.nav-holding.nav-holding-focusable > :not(.nav-held)
|
|
|
624
626
|
.palette-item.active .palette-label { color: var(--accent-ink); }
|
|
625
627
|
.palette-detail { font: var(--text-xs) var(--mono); color: var(--ink-subtle); }
|
|
626
628
|
.palette-empty { padding: var(--space-5); margin: 0; font-size: var(--text-sm); color: var(--ink-muted); }
|
|
629
|
+
.palette-note { padding: var(--space-2) var(--space-3h); margin: 0; font-size: var(--text-xs); color: var(--ink-subtle); }
|
|
627
630
|
|
|
628
631
|
/* An App's palette (Palette.tsx, `palette-grouped`; the Workbench keeps the flat list above): rows in groups under
|
|
629
632
|
quiet headings, each with the mark its room or table has in the menu, the kind said in the line under the name and
|
|
@@ -2295,7 +2298,7 @@ body.app-mode .page-head.has-record + .page-body { padding-bottom: calc(132px +
|
|
|
2295
2298
|
.command-field .field-control { width: 100%; box-sizing: border-box; }
|
|
2296
2299
|
.command-field input[type="checkbox"] { width: auto; justify-self: start; }
|
|
2297
2300
|
.command-field textarea { resize: vertical; }
|
|
2298
|
-
.command-help { color: var(--ink-muted); font-size: var(--text-sm); }
|
|
2301
|
+
.command-help { max-width: 70ch; color: var(--ink-muted); font-size: var(--text-sm); }
|
|
2299
2302
|
/* A group is a section of the form: a hairline seams it from what comes
|
|
2300
2303
|
before and its label heads it, the way a record page's sections read — no
|
|
2301
2304
|
box around it. A repeating group's rows are seamed the same way, each with
|
|
@@ -3213,6 +3216,7 @@ tr.expanded > td { border-bottom-color: transparent; background: var(--accent-so
|
|
|
3213
3216
|
color: var(--ink);
|
|
3214
3217
|
padding: var(--space-1) var(--space-2);
|
|
3215
3218
|
border-radius: var(--radius);
|
|
3219
|
+
min-block-size: 24px; box-sizing: border-box;
|
|
3216
3220
|
}
|
|
3217
3221
|
/* Inline SVG sits on the text baseline by default and leaves descender space
|
|
3218
3222
|
under it, which is the other half of the same misalignment. */
|
|
@@ -3388,6 +3392,7 @@ tr.expanded > td { border-bottom-color: transparent; background: var(--accent-so
|
|
|
3388
3392
|
vanishes the moment somebody types into it. */
|
|
3389
3393
|
.field-hint {
|
|
3390
3394
|
display: block;
|
|
3395
|
+
max-width: 70ch;
|
|
3391
3396
|
margin-top: var(--space-2);
|
|
3392
3397
|
font-size: var(--text-xs);
|
|
3393
3398
|
line-height: 1.45;
|
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.38",
|
|
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.38",
|
|
87
|
+
"@mistriwork/ui": "1.0.0-rc.38",
|
|
88
88
|
"intl-messageformat": "12.1.2",
|
|
89
89
|
"qrcode-generator": "^2.0.4"
|
|
90
90
|
},
|