@mistriwork/kit 1.0.0-rc.21 → 1.0.0-rc.23
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/Grid.js +9 -0
- package/dist/client/components/MultiStepForm.d.ts +3 -1
- package/dist/client/components/MultiStepForm.js +2 -2
- package/dist/client/components/PageSections.js +44 -9
- package/dist/client/components/QueueList.css +6 -11
- package/dist/client/components/appRooms.d.ts +12 -1
- package/dist/client/components/appRooms.js +12 -1
- package/dist/client/components/dashboardModel.d.ts +6 -0
- package/dist/client/components/gridSizing.d.ts +2 -0
- package/dist/client/components/gridSizing.js +18 -7
- package/dist/client/components/navigationTree.d.ts +2 -0
- package/dist/client/components/navigationTree.js +1 -0
- package/dist/client/components/sidebarModel.d.ts +12 -0
- package/dist/client/components/sidebarModel.js +65 -1
- package/dist/client/components/workspaces.d.ts +30 -0
- package/dist/client/components/workspaces.js +28 -0
- package/dist/client/copy/shell/components/WorkspaceSwitcher.d.ts +3 -0
- package/dist/client/copy/shell/components/WorkspaceSwitcher.js +10 -0
- package/dist/client/features.css +42 -0
- package/dist/client/shellMode.d.ts +5 -0
- package/dist/client/shellMode.js +1 -0
- package/dist/client/structure.css +6 -1
- package/dist/client/uiBridge.d.ts +57 -17
- package/package.json +3 -3
|
@@ -141,6 +141,13 @@ function drawnWords(display, plan, value, label) {
|
|
|
141
141
|
const dress = dressFor(display, value);
|
|
142
142
|
if (!dress && plan.kind === 'number' && value != null)
|
|
143
143
|
return numberShown(value, plan) ?? value;
|
|
144
|
+
/* A date is drawn as the cell says it ("Aug 22, 2026", in the data face), not as it is stored ("2026-08-22"):
|
|
145
|
+
a column sized by the stored form was cut to "Aug 22, 20…" once the data face ran wider than the sans. */
|
|
146
|
+
if (!dress && plan.kind === 'date' && value != null) {
|
|
147
|
+
const raw = String(value);
|
|
148
|
+
const near = shellBody().classList.contains('app-mode') ? sayNearDay(raw, Boolean(plan.showTime)) : null;
|
|
149
|
+
return near?.text ?? (plan.showTime ? formatDateTime(raw) : formatDate(raw));
|
|
150
|
+
}
|
|
144
151
|
return (dress?.kind === 'tone' || dress?.kind === 'word' || dress?.kind === 'mark' ? dress.label : dress?.text) ?? value;
|
|
145
152
|
}
|
|
146
153
|
/** A row's folded columns, each drawn as its own cell would draw it, for the detail line under the row's name. */
|
|
@@ -671,6 +678,8 @@ export function Grid({ table, data, hide, labels, totals, totalsLabel = say('tot
|
|
|
671
678
|
const dress = dressFor(display, row[name]);
|
|
672
679
|
return dress ? drawsWords(dress) : plan.kind === 'number' && numberShown(row[name], plan) != null;
|
|
673
680
|
}),
|
|
681
|
+
/* A date no rule dresses is drawn as the cell formats it, and sized by that. */
|
|
682
|
+
drawnDate: plan.kind === 'date' && !labelColumn && !display?.component,
|
|
674
683
|
status: !labelColumn &&
|
|
675
684
|
plan.kind !== 'number' &&
|
|
676
685
|
(Boolean(display?.tone && !display.format && !display.bar) ||
|
|
@@ -44,6 +44,8 @@ interface MultiStepFormProps<Field extends string = string> {
|
|
|
44
44
|
an h2 and the actions stay in the flow, at the dialog's foot, beside the host's `leading` (a host with one keeps
|
|
45
45
|
them in the flow too). A page also draws the steps beside the form where it is wide enough; a dialog never. */
|
|
46
46
|
presentation?: 'page' | 'dialog';
|
|
47
|
+
/** A page's intake heading: 1, the room's own; 2 under a page that already has its h1 (a page's `<Steps>`). */
|
|
48
|
+
headingLevel?: 1 | 2;
|
|
47
49
|
/** A page's steps beside the form: what a step already answered said in a line under its name (the host's words,
|
|
48
50
|
from its draft), or nothing. Asked with the step being answered, so a host says nothing on its review. */
|
|
49
51
|
summarize?: (step: FormStep<Field>, active: FormStep<Field>) => string | undefined;
|
|
@@ -55,5 +57,5 @@ interface MultiStepFormProps<Field extends string = string> {
|
|
|
55
57
|
* surrounding New/command/business form supplies those through children and
|
|
56
58
|
* validateStep, so moving between steps cannot create a second write path.
|
|
57
59
|
*/
|
|
58
|
-
export declare function MultiStepForm<Field extends string = string>({ steps, children, step, initialStep, onStepChange, validateStep, onComplete, nextLabel, previousLabel, completeLabel, className, leading, said: hostSaid, style, note, isStepEmpty, presentation, summarize, }: MultiStepFormProps<Field>): import("react").JSX.Element;
|
|
60
|
+
export declare function MultiStepForm<Field extends string = string>({ steps, children, step, initialStep, onStepChange, validateStep, onComplete, nextLabel, previousLabel, completeLabel, className, leading, said: hostSaid, style, note, isStepEmpty, presentation, headingLevel, summarize, }: MultiStepFormProps<Field>): import("react").JSX.Element;
|
|
59
61
|
export {};
|
|
@@ -40,7 +40,7 @@ function safeIndex(index, length) {
|
|
|
40
40
|
* surrounding New/command/business form supplies those through children and
|
|
41
41
|
* validateStep, so moving between steps cannot create a second write path.
|
|
42
42
|
*/
|
|
43
|
-
export function MultiStepForm({ steps, children, step, initialStep = 0, onStepChange, validateStep, onComplete, nextLabel, previousLabel = say('common.back'), completeLabel = say('common.save'), className = '', leading, said: hostSaid, style = 'stepper', note, isStepEmpty, presentation = 'page', summarize, }) {
|
|
43
|
+
export function MultiStepForm({ steps, children, step, initialStep = 0, onStepChange, validateStep, onComplete, nextLabel, previousLabel = say('common.back'), completeLabel = say('common.save'), className = '', leading, said: hostSaid, style = 'stepper', note, isStepEmpty, presentation = 'page', headingLevel = 1, summarize, }) {
|
|
44
44
|
const id = useId();
|
|
45
45
|
const boundedSteps = steps.slice(0, MAX_RENDERED_STEPS);
|
|
46
46
|
const controlled = step !== undefined;
|
|
@@ -205,7 +205,7 @@ export function MultiStepForm({ steps, children, step, initialStep = 0, onStepCh
|
|
|
205
205
|
}) }) }) })) : null;
|
|
206
206
|
// A host with its own way out (Cancel) or a dialog keeps the actions in the flow, at its foot; a page's bar sticks.
|
|
207
207
|
if (intake && !inDialog && !leading) {
|
|
208
|
-
return (_jsxs("section", { ref: root, className: `multi-step-form ${className}`.trim(), "data-style": "intake", "aria-labelledby": titleId, children: [aside, note, _jsxs("div", { className: "intake-head", children: [progressRow, _jsx(StepHeader, { id: titleId, title: heading, ...(active.lead ? { lead: active.lead } : {}) })] }), panelNode, problemNode, hostSaid, _jsx(ActionBar, { className: "intake-actions", ...(current > 0 ? { back: { label: previousLabel, onClick: () => void move('previous') } } : {}), primary: {
|
|
208
|
+
return (_jsxs("section", { ref: root, className: `multi-step-form ${className}`.trim(), "data-style": "intake", "aria-labelledby": titleId, children: [aside, note, _jsxs("div", { className: "intake-head", children: [progressRow, _jsx(StepHeader, { level: headingLevel, id: titleId, title: heading, ...(active.lead ? { lead: active.lead } : {}) })] }), panelNode, problemNode, hostSaid, _jsx(ActionBar, { className: "intake-actions", ...(current > 0 ? { back: { label: previousLabel, onClick: () => void move('previous') } } : {}), primary: {
|
|
209
209
|
label: primaryWords,
|
|
210
210
|
onClick: () => void (last ? complete() : move('next')),
|
|
211
211
|
busy: pending,
|
|
@@ -32,7 +32,7 @@ import { assertNever } from '@mistriwork/engine/shared/model.js';
|
|
|
32
32
|
import { appTargetFields } from '@mistriwork/engine/shared/appLinks.js';
|
|
33
33
|
import { readPageFields } from './pageFieldsRead.js';
|
|
34
34
|
import { pathEqualityFilter } from '../resourceRequests.js';
|
|
35
|
-
import { resourceOf } from './appRooms.js';
|
|
35
|
+
import { recordTabs, resourceOf } from './appRooms.js';
|
|
36
36
|
/* A record's history, fetched the first time a page holds one. */
|
|
37
37
|
const RecordHistory = onDemand(() => import('./PageHistory.js'), 'RecordHistory');
|
|
38
38
|
/* A record's flow runs, fetched the first time a page holds one. */
|
|
@@ -162,6 +162,11 @@ function NoteSection({ section, page, base, recordKey }) {
|
|
|
162
162
|
const row = readable && (!isCurrent || isCurrent()) && data.data && 'view' in data.data ? data.data.rows[0] : undefined;
|
|
163
163
|
return (_jsx("section", { className: sectionClass(section), children: _jsx(DashboardNote, { title: section.title, text: section.text ?? '', icon: section.icon, variant: section.variant, action: preview && section.action && 'to' in section.action ? undefined : section.action, row: row }) }));
|
|
164
164
|
}
|
|
165
|
+
/** A strip's own tabs, then the record's page tabs after them: one strip, each panel drawn by whichever owns it. */
|
|
166
|
+
const withPageTabs = (tabs, draw, pages = []) => ({
|
|
167
|
+
tabs: [...tabs, ...pages.map(({ key, token, label }) => ({ key, token, label }))],
|
|
168
|
+
draw: (i) => (i < tabs.length ? draw(i) : pages[i - tabs.length].draw()),
|
|
169
|
+
});
|
|
165
170
|
/** Names across the top, one panel under them, each panel drawn the first time it is opened (or at once, where `eager`). */
|
|
166
171
|
export function TabStrip({ tabs, name, entry, onTab, draw, scoped, eager = [], className = '', }) {
|
|
167
172
|
const id = useId();
|
|
@@ -203,7 +208,7 @@ export function TabStrip({ tabs, name, entry, onTab, draw, scoped, eager = [], c
|
|
|
203
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))) })] }));
|
|
204
209
|
}
|
|
205
210
|
/** A run of lists as tabs: the names across the top, one table under them, fetched when opened. */
|
|
206
|
-
function ListTabs({ items, entry, onTab, draw, scoped, counting, }) {
|
|
211
|
+
function ListTabs({ items, entry, onTab, draw, scoped, counting, pages, }) {
|
|
207
212
|
useMessageLanguage();
|
|
208
213
|
/* The token is the source's words (apps.ts keepAddresses), so an address names one tab in every language. */
|
|
209
214
|
const named = (item) => item.section.kind === 'history'
|
|
@@ -224,10 +229,11 @@ function ListTabs({ items, entry, onTab, draw, scoped, counting, }) {
|
|
|
224
229
|
token: scoped ? `section:${item.index}` : named(item),
|
|
225
230
|
label: (_jsxs(_Fragment, { children: [word(item), counted(item)] })),
|
|
226
231
|
}));
|
|
227
|
-
|
|
232
|
+
const strip = withPageTabs(tabs, (i) => draw(items[i]), pages);
|
|
233
|
+
return _jsx(TabStrip, { tabs: strip.tabs, name: "Related lists", entry: entry, onTab: onTab, draw: strip.draw, scoped: scoped });
|
|
228
234
|
}
|
|
229
235
|
/** The record's sections as tabs: a panel is sections again, laid out as the page lays them out. */
|
|
230
|
-
function SectionTabs({ groups, entry, onTab, lay, scoped, }) {
|
|
236
|
+
function SectionTabs({ groups, entry, onTab, lay, scoped, pages, }) {
|
|
231
237
|
useMessageLanguage();
|
|
232
238
|
/* Tokened by the tab's source words (apps.ts keepAddresses): an address names one tab in every language. */
|
|
233
239
|
const tabs = groups.map((group) => ({
|
|
@@ -239,7 +245,8 @@ function SectionTabs({ groups, entry, onTab, lay, scoped, }) {
|
|
|
239
245
|
fields are what name the record in its head, and one row costs nothing.
|
|
240
246
|
A panel of lists still costs nothing until it is opened. */
|
|
241
247
|
const eager = groups.flatMap((group, i) => (group.items.some(({ section }) => section.kind === 'fields') ? [i] : []));
|
|
242
|
-
|
|
248
|
+
const strip = withPageTabs(tabs, (i) => _jsx("div", { className: "page-tab-sections", children: lay(groups[i].items) }), pages);
|
|
249
|
+
return (_jsx(TabStrip, { tabs: strip.tabs, name: "Record sections", entry: entry, onTab: onTab, scoped: scoped, eager: eager, className: " page-tabs-sections", draw: strip.draw }));
|
|
243
250
|
}
|
|
244
251
|
export function Sections({ page, base, recordKey: key, plans, entry, onLabel, onEdit, onTab, region, onSectionLabel, titleOwner, onTitleEditor, only, }) {
|
|
245
252
|
/* Hidden sections are dropped here: hiding is a layout decision, and the
|
|
@@ -253,6 +260,28 @@ export function Sections({ page, base, recordKey: key, plans, entry, onLabel, on
|
|
|
253
260
|
!(section.kind === 'fields' && section.presentation === 'header') &&
|
|
254
261
|
(!region || (section.region ?? 'main') === region));
|
|
255
262
|
const firstFields = shown.find(({ section }) => section.kind === 'fields')?.index;
|
|
263
|
+
/* The App's free-form pages placed as this record's tabs (pages/<list view>/[id]/<tab>.page.tsx), in the main
|
|
264
|
+
column only. They join the record's first strip of tabs, its named sections' or else its lists'; a record with
|
|
265
|
+
no strip gets one of its own after its sections. Each is said by its word in the address
|
|
266
|
+
(/compass/accounts/13/pipeline), and is drawn the first time it is opened, as any tab is. */
|
|
267
|
+
const RecordTab = shell().rooms.RecordTab;
|
|
268
|
+
const app = shell().inApp() ? shell().app() : null;
|
|
269
|
+
let pageTabs = RecordTab && app && region !== 'aside' && !only
|
|
270
|
+
? recordTabs(app, base.id).map((dashboard) => ({
|
|
271
|
+
key: `page:${dashboard.id}`,
|
|
272
|
+
token: dashboard.page.record.tab,
|
|
273
|
+
label: dashboard.label,
|
|
274
|
+
draw: () => _jsx(RecordTab, { dashboard: dashboard, recordKey: key }),
|
|
275
|
+
}))
|
|
276
|
+
: [];
|
|
277
|
+
/** The page tabs, handed once to the first strip that asks: no record says one of them twice. */
|
|
278
|
+
const takePageTabs = () => {
|
|
279
|
+
if (!pageTabs.length)
|
|
280
|
+
return undefined;
|
|
281
|
+
const taken = pageTabs;
|
|
282
|
+
pageTabs = [];
|
|
283
|
+
return taken;
|
|
284
|
+
};
|
|
256
285
|
/* Only the aside's strips are scoped: the main column is the page, with or
|
|
257
286
|
without an aside beside it, so its tabs keep their words in the address
|
|
258
287
|
(/accounts/26/opportunities), never an index. */
|
|
@@ -317,7 +346,7 @@ export function Sections({ page, base, recordKey: key, plans, entry, onLabel, on
|
|
|
317
346
|
if (listTabs && autoTabs && listRuns.has(i) && (listRuns.get(i) ?? 0) > 1) {
|
|
318
347
|
if (!strip) {
|
|
319
348
|
strip = [];
|
|
320
|
-
laid.push(_jsx(ListTabs, { items: strip, entry: entry, onTab: onTab, draw: draw, scoped: scoped, counting: inferred ? { base, recordKey: key } : undefined }, `tabs-${i}`));
|
|
349
|
+
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}`));
|
|
321
350
|
}
|
|
322
351
|
strip.push(item);
|
|
323
352
|
leave = null;
|
|
@@ -354,10 +383,16 @@ export function Sections({ page, base, recordKey: key, plans, entry, onLabel, on
|
|
|
354
383
|
else
|
|
355
384
|
groups.push({ name, items: [item] });
|
|
356
385
|
}
|
|
357
|
-
if (groups.length < 2)
|
|
358
|
-
|
|
386
|
+
if (groups.length < 2) {
|
|
387
|
+
const laid = lay(shown, true);
|
|
388
|
+
const own = takePageTabs();
|
|
389
|
+
if (own)
|
|
390
|
+
laid.push(_jsx(TabStrip, { tabs: own, name: "Record pages", entry: entry, onTab: onTab, scoped: scoped, draw: (i) => own[i].draw() }, "page-tabs"));
|
|
391
|
+
return _jsx(_Fragment, { children: laid });
|
|
392
|
+
}
|
|
359
393
|
const first = shown.findIndex((item) => item.section.tab);
|
|
360
|
-
|
|
394
|
+
const pages = takePageTabs();
|
|
395
|
+
return (_jsxs(_Fragment, { children: [lay(shown.slice(0, first), true), _jsx(SectionTabs, { groups: groups, entry: entry, onTab: onTab, scoped: scoped, lay: (items) => lay(items, false, true), pages: pages }), lay(shown.slice(first).filter((item) => !item.section.tab), true)] }));
|
|
361
396
|
}
|
|
362
397
|
/** A run of metrics is one item, not several: a strip with a line of its own. */
|
|
363
398
|
function MetricRun({ items, draw }) {
|
|
@@ -109,14 +109,9 @@
|
|
|
109
109
|
.queue-pick-list .queue-pick[aria-current='true'] { background: var(--selected, color-mix(in srgb, var(--accent) 10%, transparent)); }
|
|
110
110
|
.queue-pick-list .queue-pick > .avatar-value { flex: none; }
|
|
111
111
|
.queue-pick-list .queue-pick > .avatar-value .avatar-text { display: none; }
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.queue-pick
|
|
116
|
-
.queue-pick
|
|
117
|
-
.queue-pick-list .queue-
|
|
118
|
-
.queue-pick-list .queue-pick { padding: var(--space-3h) var(--space-4); }
|
|
119
|
-
.queue-pick-list .queue-pick:hover { background: var(--hover, color-mix(in srgb, var(--ink) 4%, transparent)); }
|
|
120
|
-
.queue-pick-list .queue-pick[aria-current='true'] { background: var(--selected, color-mix(in srgb, var(--accent) 10%, transparent)); }
|
|
121
|
-
.queue-pick-list .queue-pick > .avatar-value { flex: none; }
|
|
122
|
-
.queue-pick-list .queue-pick > .avatar-value .avatar-text { display: none; }
|
|
112
|
+
/* The primary takes the row and each line sits under it on one line of its own: side by side, a short value such as a
|
|
113
|
+
date was squeezed beside the title until it broke word by word. A long line is cut at the edge; the record beside the
|
|
114
|
+
list holds all of it. */
|
|
115
|
+
.queue-pick-list .queue-pick { flex-wrap: wrap; row-gap: var(--space-1); }
|
|
116
|
+
.queue-pick-list .queue-pick > strong { flex: 1 1 100%; min-width: 0; }
|
|
117
|
+
.queue-pick-list .queue-pick > span { flex: 1 1 100%; max-width: 100%; overflow: hidden; color: var(--ink-muted); font-size: var(--text-sm); white-space: nowrap; text-overflow: ellipsis; }
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* resolved to those rooms. Pure over the payload, and computed once per
|
|
7
7
|
* served App, so every reader compares the same objects.
|
|
8
8
|
*/
|
|
9
|
-
import { ASSISTANT_ROOM, type ServedApp as ServedAppShape, type ServedDashboardView, type ServedFormView, type ServedResource } from '@mistriwork/engine/shared/servedApp.js';
|
|
9
|
+
import { ASSISTANT_ROOM, type ServedApp as ServedAppShape, type ServedDashboardView, type ServedFormView, type ServedRecordTab, type ServedResource } from '@mistriwork/engine/shared/servedApp.js';
|
|
10
10
|
import { type NavigationNode, type AvailableNavigationNode } from './navigationTree.js';
|
|
11
11
|
import type { ListSpec } from './appListModel.js';
|
|
12
12
|
import type { BoundAppTarget } from '@mistriwork/engine/shared/appLinks.js';
|
|
@@ -85,6 +85,17 @@ export declare function viewRoom<A extends ServedApp>(app: A, key: string): Room
|
|
|
85
85
|
export declare function dashboardAt<A extends ServedApp>(app: A, pageId: string | undefined): DashboardOf<A> | undefined;
|
|
86
86
|
/** The signed-in form a `form-<view key>` page id names, or undefined. */
|
|
87
87
|
export declare function formAt<A extends ServedApp>(app: A, pageId: string | undefined): ServedForm<A> | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* The free-form pages that are tabs of a record of this table
|
|
90
|
+
* (`pages/<list view>/[id]/<tab>.page.tsx`), in the App's order. The served
|
|
91
|
+
* App holds only the pages this reader may open, so a tab they may not
|
|
92
|
+
* read is not among them, as a view they may not read is not in the menu.
|
|
93
|
+
*/
|
|
94
|
+
export declare function recordTabs<A extends ServedApp>(app: A, tableId: string): Array<DashboardOf<A> & {
|
|
95
|
+
page: {
|
|
96
|
+
record: ServedRecordTab;
|
|
97
|
+
};
|
|
98
|
+
}>;
|
|
88
99
|
/**
|
|
89
100
|
* Every room the App lists, in the menu's order, then the views nav does not
|
|
90
101
|
* reference — the home of an App without nav among them. A list view only a
|
|
@@ -86,6 +86,16 @@ export function formAt(app, pageId) {
|
|
|
86
86
|
const room = key === undefined ? undefined : viewRoom(app, key);
|
|
87
87
|
return room && isFormView(room) ? room : undefined;
|
|
88
88
|
}
|
|
89
|
+
const isRecordTab = (room) => 'sections' in room && Boolean(room.page?.record);
|
|
90
|
+
/**
|
|
91
|
+
* The free-form pages that are tabs of a record of this table
|
|
92
|
+
* (`pages/<list view>/[id]/<tab>.page.tsx`), in the App's order. The served
|
|
93
|
+
* App holds only the pages this reader may open, so a tab they may not
|
|
94
|
+
* read is not among them, as a view they may not read is not in the menu.
|
|
95
|
+
*/
|
|
96
|
+
export function recordTabs(app, tableId) {
|
|
97
|
+
return [...roomsByKey(app).values()].filter((room) => isRecordTab(room) && room.page.record.table === tableId);
|
|
98
|
+
}
|
|
89
99
|
const listedRooms = new WeakMap();
|
|
90
100
|
/**
|
|
91
101
|
* Every room the App lists, in the menu's order, then the views nav does not
|
|
@@ -99,7 +109,8 @@ export function appRooms(served) {
|
|
|
99
109
|
let held = listedRooms.get(app);
|
|
100
110
|
if (!held) {
|
|
101
111
|
const embeddedOnly = embeddedOnlyViews(app, app.home === undefined ? [] : [app.home]);
|
|
102
|
-
|
|
112
|
+
// A record's tab is drawn on its record's page: it needs a record, so no menu or palette lists it.
|
|
113
|
+
held = [...roomsByKey(app).values()].filter((room) => !embeddedOnly.has(room.id) && !isRecordTab(room));
|
|
103
114
|
listedRooms.set(app, held);
|
|
104
115
|
}
|
|
105
116
|
return held;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FigureFormat } from '@mistriwork/engine/shared/model.js';
|
|
2
|
+
import type { ServedRecordTab } from '@mistriwork/engine/shared/servedApp.js';
|
|
2
3
|
import { breakdownText, sectionPeriod, windowed } from '@mistriwork/engine/shared/dashboardAsks.js';
|
|
3
4
|
interface DisplayRule {
|
|
4
5
|
format?: string;
|
|
@@ -129,6 +130,8 @@ export interface DashboardDef {
|
|
|
129
130
|
/** The head's form (`head`): `compact`, the title alone on one line with its verbs and no intro; `own`, a page that
|
|
130
131
|
draws its own head (`head: false`), its title kept for a screen reader and its intro left to it (DashHead.tsx). */
|
|
131
132
|
head?: 'compact' | 'own';
|
|
133
|
+
/** A free-form page that owns the whole window (`layout: 'bare'`): the shell draws no sidebar and no top bar around it. */
|
|
134
|
+
layout?: 'bare';
|
|
132
135
|
/** Plain text, authored with the dashboard and served only with it. */
|
|
133
136
|
description?: string;
|
|
134
137
|
sections: Section[];
|
|
@@ -147,9 +150,12 @@ export interface DashboardDef {
|
|
|
147
150
|
page?: {
|
|
148
151
|
reads: string[];
|
|
149
152
|
commands: string[];
|
|
153
|
+
actions?: string[];
|
|
150
154
|
params: string[];
|
|
151
155
|
loader?: string;
|
|
152
156
|
public?: true;
|
|
157
|
+
/** A record's tab (pages/<list view>/[id]/<tab>.page.tsx): drawn in that record's tab strip, never as a room. */
|
|
158
|
+
record?: ServedRecordTab;
|
|
153
159
|
};
|
|
154
160
|
error?: string;
|
|
155
161
|
}
|
|
@@ -41,6 +41,8 @@ interface GridColumnSize {
|
|
|
41
41
|
status?: boolean;
|
|
42
42
|
/** Every value is the words the cell draws ("4 weeks ago", "$22,495"), not a raw value it formats, and nothing beside them (a bar, a ring, an App's own renderer). */
|
|
43
43
|
dressed?: boolean;
|
|
44
|
+
/** A date no rule dresses: its values are the words the cell draws ("Aug 22, 2026"), measured in the cell's font. */
|
|
45
|
+
drawnDate?: boolean;
|
|
44
46
|
}
|
|
45
47
|
export declare const GRID_SIZE_SAMPLE = 40;
|
|
46
48
|
export declare const GRID_EXPANDER_WIDTH = 32;
|
|
@@ -87,7 +87,15 @@ export function columnSizeHint(column, headChar = GRID_HEAD_CHAR, measure, squee
|
|
|
87
87
|
return fixed(Math.max(headLeast, width), Math.max(header, width));
|
|
88
88
|
}
|
|
89
89
|
if (column.kind === 'date') {
|
|
90
|
-
const
|
|
90
|
+
const usual = column.showTime ? 176 : 112;
|
|
91
|
+
/* Drawn by the cell in its own font, a date is as wide as it measures: the data face runs wider than the sans
|
|
92
|
+
the usual width was set for, and "Aug 22, 2026" was cut to "Aug 22, 20…" at 1280. It never takes less than the
|
|
93
|
+
usual width, which a relative date's words (above) may. */
|
|
94
|
+
const width = measured && column.dressed
|
|
95
|
+
? Math.min(usual, textWidth + 24)
|
|
96
|
+
: measured && column.drawnDate
|
|
97
|
+
? Math.max(usual, Math.min(column.showTime ? 240 : 176, textWidth + 24))
|
|
98
|
+
: usual;
|
|
91
99
|
return fixed(Math.max(headLeast, width), Math.max(header, width));
|
|
92
100
|
}
|
|
93
101
|
/* A number measured as it is drawn ("$22,495", "18,340 mi") is as wide as
|
|
@@ -150,26 +158,29 @@ export function columnSizeHint(column, headChar = GRID_HEAD_CHAR, measure, squee
|
|
|
150
158
|
* the other text values on two lines too; and only then the secondary text given way to its head, cut. A table whose heads fit whole keeps them on
|
|
151
159
|
* one line, as it always did, and a value is cut only where nothing else spares the sideways scroll.
|
|
152
160
|
*/
|
|
153
|
-
function sizeHints(columns, room, headChar, measure, squeezeName = false) {
|
|
161
|
+
function sizeHints(columns, room, headChar, measure, squeezeName = false, cut = true) {
|
|
154
162
|
/* `values` says whose words may take their two-line floor: nobody's, only the row's name, or every text column's. */
|
|
155
163
|
const hints = (heads, values) => columns.map((column, index) => columnSizeHint({
|
|
156
164
|
...column,
|
|
157
165
|
wrapHead: heads && column.wrapHead,
|
|
158
166
|
wrapValues: column.wrapValues && (values === 'all' || (values === 'title' && Boolean(column.title))),
|
|
159
167
|
}, headChar, measure && ((text) => measure(text, index)), squeezeName));
|
|
168
|
+
/* Whether the secondary text may be cut to its head to spare the room. A table that can fold its columns asks no:
|
|
169
|
+
the documented order folds before it cuts, and a table sized as cut already fits, so it never folds one. */
|
|
170
|
+
const way = (list, space) => (cut ? giveWay(list, space) : list);
|
|
160
171
|
const fits = (list) => list.reduce((sum, hint) => sum + hint.minimum, 0) <= room;
|
|
161
172
|
const whole = hints(false, 'none');
|
|
162
173
|
if (fits(whole) || !columns.some((column) => column.wrapHead || column.wrapValues))
|
|
163
|
-
return
|
|
174
|
+
return way(whole, room);
|
|
164
175
|
const heads = hints(true, 'none');
|
|
165
176
|
if (fits(heads) || !columns.some((column) => column.wrapValues))
|
|
166
|
-
return
|
|
177
|
+
return way(heads, room);
|
|
167
178
|
/* The row's name is the most important text in the row, so it takes its second line before a short secondary value
|
|
168
179
|
(a person's two-word name) is given one: the others keep their floors while the name's alone still spares the room. */
|
|
169
180
|
const named = hints(true, 'title');
|
|
170
181
|
if (columns.some((column) => column.title && column.wrapValues) && fits(named))
|
|
171
|
-
return
|
|
172
|
-
return
|
|
182
|
+
return way(named, room);
|
|
183
|
+
return way(hints(true, 'all'), room);
|
|
173
184
|
}
|
|
174
185
|
/* Where the minima together run past the room, the secondary text columns
|
|
175
186
|
give way, the last first, down to their heads; the name, the chips and the
|
|
@@ -200,7 +211,7 @@ export function keepFitting(columns, available, expandable = false, trailing = f
|
|
|
200
211
|
if (!(available > 0))
|
|
201
212
|
return null;
|
|
202
213
|
let room = available - (expandable ? GRID_EXPANDER_WIDTH : 0) - (trailing ? GRID_TRAIL_WIDTH : 0);
|
|
203
|
-
const hints = sizeHints(columns, room, headChar, measure);
|
|
214
|
+
const hints = sizeHints(columns, room, headChar, measure, false, false);
|
|
204
215
|
if (hints.reduce((sum, hint) => sum + hint.minimum, 0) <= room)
|
|
205
216
|
return null;
|
|
206
217
|
const kept = columns.map((column, index) => index === 0 || Boolean(column.title) || Boolean(column.status));
|
|
@@ -19,6 +19,8 @@ export type AvailableNavigationNode<T> = {
|
|
|
19
19
|
placement?: 'footer';
|
|
20
20
|
inline?: true;
|
|
21
21
|
folded?: true;
|
|
22
|
+
/** A top-level group the header's switcher picks (workspaces.ts): the sidebar lists only the current one's children. */
|
|
23
|
+
workspace?: true;
|
|
22
24
|
children: AvailableNavigationNode<T>[];
|
|
23
25
|
};
|
|
24
26
|
export type NavigationNode<T> = {
|
|
@@ -20,6 +20,7 @@ export function navigationTree(nav, entryOf, targetOf) {
|
|
|
20
20
|
...(node.placement ? { placement: node.placement } : {}),
|
|
21
21
|
...(node.inline ? { inline: true } : {}),
|
|
22
22
|
...(node.folded ? { folded: true } : {}),
|
|
23
|
+
...(node.workspace ? { workspace: true } : {}),
|
|
23
24
|
children,
|
|
24
25
|
},
|
|
25
26
|
]
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { tableView } from '../core.js';
|
|
23
23
|
import { type ListSpec } from './appListModel.js';
|
|
24
|
+
import { type MenuEntry, type ShownApp } from './appRooms.js';
|
|
24
25
|
import type { Favorite } from './favorites.js';
|
|
25
26
|
import type { NavCount, NavCountSpec } from './navCounts.js';
|
|
27
|
+
import { type Workspace } from './workspaces.js';
|
|
26
28
|
type SidebarItem = ({
|
|
27
29
|
kind: 'target';
|
|
28
30
|
label: string;
|
|
@@ -95,6 +97,16 @@ export type TableItem = Extract<SidebarItem, {
|
|
|
95
97
|
}>;
|
|
96
98
|
/** The rows, top to bottom, for the filter text as typed. */
|
|
97
99
|
export declare function sidebarItems(filterText: string): SidebarItem[];
|
|
100
|
+
/**
|
|
101
|
+
* The header's switcher: the workspaces this reader may open, in the App's order, and the current one. Null where the App has
|
|
102
|
+
* none, or this reader sees only one (then the sidebar is that workspace's entries and nothing is switched).
|
|
103
|
+
*/
|
|
104
|
+
export declare function workspaceSwitcher(app: ShownApp): {
|
|
105
|
+
spaces: Workspace<MenuEntry>[];
|
|
106
|
+
current: string;
|
|
107
|
+
} | null;
|
|
108
|
+
/** The reader chose a workspace in the switcher: it is current before the walk moves, which matters where a room is in two. */
|
|
109
|
+
export declare function chooseWorkspace(app: ShownApp, id: string): void;
|
|
98
110
|
export declare function setSidebarGroupCollapsed(id: string, collapsed: boolean, foldedByDefault?: boolean): void;
|
|
99
111
|
export declare const tableRows: (items: SidebarItem[]) => TableItem[];
|
|
100
112
|
/** App menus retain their icons when folded unless explicitly opted out. */
|
|
@@ -25,10 +25,12 @@ import { appListFor, appListQuery, currentNavIndex } from './appListModel.js';
|
|
|
25
25
|
import { menuCount } from '@mistriwork/engine/shared/menuCounts.js';
|
|
26
26
|
import { ASSISTANT_PAGE, DIRECTORY_PAGE, appMenu, dashViewKey, formViewKey, hasRooms, homeRoom, isAssistantRoom, isListRoom, } from './appRooms.js';
|
|
27
27
|
import { isServedForm as isFormView } from '@mistriwork/engine/shared/servedApp.js';
|
|
28
|
+
import { navigationPaths } from './navigationTree.js';
|
|
28
29
|
import { shownFavorites } from './favoriteNav.js';
|
|
29
30
|
import { formatApprox, formatNumber } from '../locale.js';
|
|
30
31
|
import { say } from '../copy/shell/components/sidebarModel.js';
|
|
31
32
|
import { shellBody } from '../shellHost.js';
|
|
33
|
+
import { inWorkspace, workspacesHolding, workspacesOf } from './workspaces.js';
|
|
32
34
|
/** The rows, top to bottom, for the filter text as typed. */
|
|
33
35
|
export function sidebarItems(filterText) {
|
|
34
36
|
const needle = filterText.trim().toLowerCase();
|
|
@@ -115,7 +117,11 @@ export function sidebarItems(filterText) {
|
|
|
115
117
|
items.push({ kind: 'group', label: say('common.favorites') }, ...starred.map((favorite) => ({ kind: 'favorite', favorite, label: favorite.label })));
|
|
116
118
|
matches += starred.length;
|
|
117
119
|
/* A target into another App of the suite leads where the shell says (shellMode.ts `navTargets`), and nowhere where it has none. */
|
|
118
|
-
const
|
|
120
|
+
const whole = menuOf(app);
|
|
121
|
+
/* With workspaces the sidebar is one product's menu: the model reduces the list, so the rail, the filter, the counts and
|
|
122
|
+
the arrow-key skim all work on what is drawn. */
|
|
123
|
+
const spaces = workspacesOf(whole);
|
|
124
|
+
const menu = spaces ? inWorkspace(spaces, currentWorkspaceId(spaces, app)) : whole;
|
|
119
125
|
/* A footer group is drawn last, after a gap that takes the room left over: Settings and Help stay at the foot
|
|
120
126
|
however short the menu. Its heading is anchored there, under its rows, so it opens upward: the gap gives up
|
|
121
127
|
what the rows take, and the heading a person pressed stays where they pressed it. The heading still comes
|
|
@@ -150,6 +156,64 @@ export function sidebarItems(filterText) {
|
|
|
150
156
|
items.push({ kind: 'note', text: say('noMatches') });
|
|
151
157
|
return items;
|
|
152
158
|
}
|
|
159
|
+
/* ---------- workspaces ---------- */
|
|
160
|
+
/** The App's nav as the sidebar draws it, whole: a target into another App of the suite leads where the shell says (shellMode.ts `navTargets`). */
|
|
161
|
+
const menuOf = (app) => appMenu(app, shell().slots.navTargets?.hrefs(app, state.schema) ?? leadsNowhere);
|
|
162
|
+
/* The workspace the reader was last in, by App, for a room no workspace holds (a view served outside nav, reached by ⌘K or a
|
|
163
|
+
link). In memory and per tab: the workspace is never in the address, so a reload begins from the room's own. */
|
|
164
|
+
const lastWorkspace = new Map();
|
|
165
|
+
let observedWalk = -1;
|
|
166
|
+
const workspaceMemoryKey = (app) => JSON.stringify([state.activeConnection, app.id ?? app.name]);
|
|
167
|
+
/** The view id of the room on screen, as nav names it: a dashboard or form's key, or the list the walk's query leads. */
|
|
168
|
+
function currentRoomId(menu, app) {
|
|
169
|
+
const page = currentDashView() ?? currentFormView();
|
|
170
|
+
if (page)
|
|
171
|
+
return page;
|
|
172
|
+
const lists = menu.spaces.flatMap((space) => navigationPaths(space.children).map(({ entry }) => entry)).filter(isListRoom);
|
|
173
|
+
const here = currentEntry();
|
|
174
|
+
if (here?.table)
|
|
175
|
+
return lists[currentNavIndex(lists, here.table, here.query ?? '', here.view)]?.id;
|
|
176
|
+
const home = here ? undefined : homeRoom(app);
|
|
177
|
+
return home && isListRoom(home) ? home.id : undefined;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Which workspace is current: the one whose subtree holds the room on screen; where a page is in several, the one the
|
|
181
|
+
* reader is already in; where it is in none, the one they were last in, else the first.
|
|
182
|
+
*/
|
|
183
|
+
function currentWorkspaceId(menu, app) {
|
|
184
|
+
const key = workspaceMemoryKey(app);
|
|
185
|
+
const last = lastWorkspace.get(key);
|
|
186
|
+
/* Read again only when the walk has moved: between a choice in the switcher and the walk following it, the room on screen
|
|
187
|
+
is still the old one, and reading it would take the choice back. */
|
|
188
|
+
if (last !== undefined && observedWalk === walkVersion() && menu.spaces.some((space) => space.id === last))
|
|
189
|
+
return last;
|
|
190
|
+
observedWalk = walkVersion();
|
|
191
|
+
const room = currentRoomId(menu, app);
|
|
192
|
+
const holding = room === undefined ? [] : workspacesHolding(menu, room);
|
|
193
|
+
const chosen = (last !== undefined && holding.includes(last) ? last : holding[0]) ??
|
|
194
|
+
(menu.spaces.some((space) => space.id === last) ? last : undefined) ??
|
|
195
|
+
menu.spaces[0].id;
|
|
196
|
+
lastWorkspace.set(key, chosen);
|
|
197
|
+
return chosen;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The header's switcher: the workspaces this reader may open, in the App's order, and the current one. Null where the App has
|
|
201
|
+
* none, or this reader sees only one (then the sidebar is that workspace's entries and nothing is switched).
|
|
202
|
+
*/
|
|
203
|
+
export function workspaceSwitcher(app) {
|
|
204
|
+
const menu = workspacesOf(menuOf(app));
|
|
205
|
+
if (!menu || menu.spaces.length < 2)
|
|
206
|
+
return null;
|
|
207
|
+
return { spaces: menu.spaces, current: currentWorkspaceId(menu, app) };
|
|
208
|
+
}
|
|
209
|
+
/** The reader chose a workspace in the switcher: it is current before the walk moves, which matters where a room is in two. */
|
|
210
|
+
export function chooseWorkspace(app, id) {
|
|
211
|
+
lastWorkspace.set(workspaceMemoryKey(app), id);
|
|
212
|
+
observedWalk = walkVersion();
|
|
213
|
+
cursor = -1;
|
|
214
|
+
cursorAt = walkVersion();
|
|
215
|
+
tell();
|
|
216
|
+
}
|
|
153
217
|
/* Stable authored group IDs, scoped to the App/connection, survive label and
|
|
154
218
|
ordering changes. Storage is optional; folding remains usable when blocked.
|
|
155
219
|
What is kept is the person's departure from the App's default: a group's id
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspaces: top-level groups that say `workspace: true`, each a product of its own in one App (a service desk and a
|
|
3
|
+
* CRM). The header's switcher picks one and the sidebar lists only its entries, so a reader sees one product's menu at a
|
|
4
|
+
* time rather than every product's at once. Pure, over the menu as the nav tree draws it: which workspace is current is
|
|
5
|
+
* the walk's to say (sidebarModel.ts), and a workspace with nothing this reader may open is already gone from the tree.
|
|
6
|
+
*/
|
|
7
|
+
import { type AvailableNavigationNode } from './navigationTree.js';
|
|
8
|
+
export interface Workspace<T> {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
children: AvailableNavigationNode<T>[];
|
|
13
|
+
}
|
|
14
|
+
export interface WorkspaceMenu<T> {
|
|
15
|
+
/** In the order the App declares them. */
|
|
16
|
+
spaces: Workspace<T>[];
|
|
17
|
+
/** What stands outside every workspace and so shows in each: the footer group, and the assistant's room where nav does not place it. */
|
|
18
|
+
outside: AvailableNavigationNode<T>[];
|
|
19
|
+
}
|
|
20
|
+
/** The menu's workspaces, or null when the App declares none (every menu before this one). */
|
|
21
|
+
export declare function workspacesOf<T>(menu: readonly AvailableNavigationNode<T>[]): WorkspaceMenu<T> | null;
|
|
22
|
+
/**
|
|
23
|
+
* The menu one workspace shows: its entries as if they were the whole nav, then what stands outside. A footer group is
|
|
24
|
+
* told from the rest by its placement where the sidebar draws them (sidebarModel.ts), so order here does not matter.
|
|
25
|
+
*/
|
|
26
|
+
export declare function inWorkspace<T>(menu: WorkspaceMenu<T>, id: string): AvailableNavigationNode<T>[];
|
|
27
|
+
/** The workspaces whose subtree holds a room, by its view id: more than one where a page is both teams'. */
|
|
28
|
+
export declare function workspacesHolding<T extends {
|
|
29
|
+
id: string;
|
|
30
|
+
}>(menu: WorkspaceMenu<T>, room: string): string[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspaces: top-level groups that say `workspace: true`, each a product of its own in one App (a service desk and a
|
|
3
|
+
* CRM). The header's switcher picks one and the sidebar lists only its entries, so a reader sees one product's menu at a
|
|
4
|
+
* time rather than every product's at once. Pure, over the menu as the nav tree draws it: which workspace is current is
|
|
5
|
+
* the walk's to say (sidebarModel.ts), and a workspace with nothing this reader may open is already gone from the tree.
|
|
6
|
+
*/
|
|
7
|
+
import { navigationPaths } from './navigationTree.js';
|
|
8
|
+
/** The menu's workspaces, or null when the App declares none (every menu before this one). */
|
|
9
|
+
export function workspacesOf(menu) {
|
|
10
|
+
const spaces = menu.flatMap((node) => node.kind === 'group' && node.workspace
|
|
11
|
+
? [{ id: node.id, label: node.label, ...(node.icon ? { icon: node.icon } : {}), children: node.children }]
|
|
12
|
+
: []);
|
|
13
|
+
if (!spaces.length)
|
|
14
|
+
return null;
|
|
15
|
+
return { spaces, outside: menu.filter((node) => !(node.kind === 'group' && node.workspace)) };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The menu one workspace shows: its entries as if they were the whole nav, then what stands outside. A footer group is
|
|
19
|
+
* told from the rest by its placement where the sidebar draws them (sidebarModel.ts), so order here does not matter.
|
|
20
|
+
*/
|
|
21
|
+
export function inWorkspace(menu, id) {
|
|
22
|
+
const space = menu.spaces.find((candidate) => candidate.id === id) ?? menu.spaces[0];
|
|
23
|
+
return [...space.children, ...menu.outside];
|
|
24
|
+
}
|
|
25
|
+
/** The workspaces whose subtree holds a room, by its view id: more than one where a page is both teams'. */
|
|
26
|
+
export function workspacesHolding(menu, room) {
|
|
27
|
+
return menu.spaces.filter((space) => navigationPaths(space.children).some(({ entry }) => entry.id === room)).map((space) => space.id);
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** What WorkspaceSwitcher says, in the shell room (packages/kit/src/client/messages.ts says how the catalog is split). */
|
|
2
|
+
import { defineMessages } from '../../../messages.js';
|
|
3
|
+
export const say = defineMessages({
|
|
4
|
+
workspaces: 'Workspaces',
|
|
5
|
+
}, {
|
|
6
|
+
/* The words a visitor sees in the shell; the rest are said in English. */
|
|
7
|
+
es: {
|
|
8
|
+
workspaces: 'Espacios de trabajo',
|
|
9
|
+
},
|
|
10
|
+
});
|
package/dist/client/features.css
CHANGED
|
@@ -799,6 +799,10 @@ body.first-run #db-label {
|
|
|
799
799
|
.dash-body { padding: 0 var(--space-4h) var(--space-4h); }
|
|
800
800
|
/* A free-form page (definePage) is its component on the page body, in a dashboard's gutters. */
|
|
801
801
|
.free-page-body { padding: 0 var(--space-4h) 56px; }
|
|
802
|
+
/* A bare page (definePage layout: 'bare'): the room owns the window. The sidebar, its reveal, the bars and the menu leave the
|
|
803
|
+
flow; the skip link, the pane and its focus are the shell's still. */
|
|
804
|
+
body.page-bare :is(.topbar, .sidebar, .sidebar-reveal, #topnav, #explain-pane) { display: none; }
|
|
805
|
+
.free-page-body.is-bare { padding: 0; }
|
|
802
806
|
/* The title shares the body's centered 76rem column — a head pinned to
|
|
803
807
|
the pane edge over a centered grid read as two different screens. */
|
|
804
808
|
.dash-head { margin-top: var(--space-2h); margin-bottom: var(--space-6); width: 100%; }
|
|
@@ -1331,6 +1335,44 @@ body.app-custom-gutter .topbar[data-header-width="content"] { --app-shell-outer-
|
|
|
1331
1335
|
/* The focus ring hugs the label instead of the full-height slot, whose
|
|
1332
1336
|
ring crossed into the row below. */
|
|
1333
1337
|
.tn-item:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -6px; border-radius: var(--radius-panel); }
|
|
1338
|
+
/* Workspaces (WorkspaceSwitcher.tsx): the products of one App as links in the bar, after the mark, the current one marked
|
|
1339
|
+
as the top bar marks its room — ink, and a short accent line on the bar's edge. A label is never cut: what does not fit
|
|
1340
|
+
the room goes under More (useTabFold.ts). The host is empty until the App has two to pick from. */
|
|
1341
|
+
.workspace-host { display: flex; align-items: center; flex: 1 1 0; min-width: 0; }
|
|
1342
|
+
.workspace-tabs { min-width: 0; flex: 1 1 auto; }
|
|
1343
|
+
.workspace-strip { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
|
|
1344
|
+
.workspace-tab {
|
|
1345
|
+
position: relative; flex: none; height: 32px; box-sizing: border-box;
|
|
1346
|
+
display: inline-flex; align-items: center; gap: var(--space-2);
|
|
1347
|
+
padding: 0 var(--space-3); border-radius: var(--radius);
|
|
1348
|
+
font: var(--text-base) var(--mono); color: var(--ink-muted);
|
|
1349
|
+
background: none; border: none; text-decoration: none; white-space: nowrap; cursor: pointer;
|
|
1350
|
+
}
|
|
1351
|
+
@media (hover: hover) { .workspace-tab:hover { color: var(--ink); } }
|
|
1352
|
+
.workspace-tab[aria-current="page"] { color: var(--ink); }
|
|
1353
|
+
.workspace-tab[aria-current="page"]::after {
|
|
1354
|
+
content: ''; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0; height: 2px;
|
|
1355
|
+
border-radius: min(2px, var(--radius)); background: var(--accent);
|
|
1356
|
+
}
|
|
1357
|
+
.workspace-tab:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -2px; }
|
|
1358
|
+
.workspace-tab .nav-icon { flex: none; width: 15px; height: 15px; color: inherit; }
|
|
1359
|
+
.workspace-more { flex: none; }
|
|
1360
|
+
/* The caret the Export button wears, so More reads as a menu and not a fourth workspace. */
|
|
1361
|
+
.workspace-more .workspace-tab::after { content: "▾"; color: var(--ink-subtle); }
|
|
1362
|
+
/* At the top of a phone's drawer: a list, one row each, icon and label with the label wrapping whole, the current one
|
|
1363
|
+
marked in weight, and a rule before that workspace's entries. */
|
|
1364
|
+
.workspace-tabs-drawer { flex: none; padding: var(--space-3) var(--space-3) 0; border-bottom: 1px solid var(--line); padding-bottom: var(--space-3); box-sizing: border-box; }
|
|
1365
|
+
.workspace-list { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; }
|
|
1366
|
+
.workspace-list .workspace-tab {
|
|
1367
|
+
display: flex; width: 100%; height: auto; min-height: 44px; padding: var(--space-3); border-radius: var(--radius);
|
|
1368
|
+
white-space: normal; overflow-wrap: anywhere; text-align: left; color: var(--ink); font: var(--type-ui)/1.35 var(--sans);
|
|
1369
|
+
}
|
|
1370
|
+
/* Current is said in weight and a neutral fill, not the accent: the entry below keeps the accent's bar, and two
|
|
1371
|
+
marks in colour in one drawer both shout. */
|
|
1372
|
+
.workspace-list .workspace-tab[aria-current="page"] { background: var(--row-hover); color: var(--ink); font-weight: 600; }
|
|
1373
|
+
.workspace-list .workspace-tab[aria-current="page"] .nav-icon { color: var(--ink); }
|
|
1374
|
+
.workspace-list .workspace-tab[aria-current="page"]::after { content: none; }
|
|
1375
|
+
.workspace-list .nav-icon { width: var(--icon-ui); height: var(--icon-ui); color: var(--ink-muted); }
|
|
1334
1376
|
.tn-caret { color: var(--ink-subtle); margin-left: var(--space-2); font-size: var(--text-xs); }
|
|
1335
1377
|
/* Menu icons (NavGlyph.tsx) in the top bar and its menus: before the words,
|
|
1336
1378
|
quieter than them, in the current entry's own color. */
|
|
@@ -230,6 +230,11 @@ interface AppRoomSlots {
|
|
|
230
230
|
entry: PageEntry | RowEntry;
|
|
231
231
|
document: NonNullable<ReturnType<typeof documentAt>>;
|
|
232
232
|
}> | null;
|
|
233
|
+
/** A free-form page that is a tab of a record (RecordTabPage.tsx), drawn in the record page's tab strip. */
|
|
234
|
+
RecordTab: ComponentType<{
|
|
235
|
+
dashboard: DashboardDef;
|
|
236
|
+
recordKey: Record<string, unknown>;
|
|
237
|
+
}> | null;
|
|
233
238
|
}
|
|
234
239
|
/** An App's components, fetched for the kit's slots; the Workbench draws none. */
|
|
235
240
|
export interface AppComponents {
|
package/dist/client/shellMode.js
CHANGED
|
@@ -319,8 +319,13 @@
|
|
|
319
319
|
.page-tab-more {
|
|
320
320
|
flex: 0 0 auto;
|
|
321
321
|
}
|
|
322
|
+
/* The workspaces' strip in the bar: it fits the room between the mark and the bar's keys, the rest under More. */
|
|
323
|
+
.workspace-strip.folds {
|
|
324
|
+
position: relative;
|
|
325
|
+
overflow: clip;
|
|
326
|
+
}
|
|
322
327
|
/* A folded tab keeps its width, measured, out of the row; More is measured the same way while nothing is under it. */
|
|
323
|
-
:is(.page-tabstrip, .tabs).folds [data-folded] {
|
|
328
|
+
:is(.page-tabstrip, .tabs, .workspace-strip).folds [data-folded] {
|
|
324
329
|
position: absolute;
|
|
325
330
|
top: 0;
|
|
326
331
|
inset-inline-start: 0;
|
|
@@ -15,27 +15,67 @@ type CommandOutcome = {
|
|
|
15
15
|
challenge?: string;
|
|
16
16
|
}): Promise<CommandOutcome>;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
interface CommandHandle {
|
|
19
|
+
label: string;
|
|
20
|
+
granted: boolean;
|
|
21
|
+
available(key: Readonly<Record<string, unknown>>): Promise<boolean>;
|
|
22
|
+
run(key: Readonly<Record<string, unknown>>, input?: Readonly<Record<string, unknown>>, options?: {
|
|
23
|
+
label?: string;
|
|
24
|
+
challenge?: string;
|
|
25
|
+
attempt?: string;
|
|
26
|
+
}): Promise<CommandOutcome>;
|
|
27
|
+
open(key: Readonly<Record<string, unknown>>, input?: Readonly<Record<string, unknown>>, options?: {
|
|
28
|
+
label?: string;
|
|
29
|
+
attempt?: string;
|
|
30
|
+
}): Promise<CommandOutcome>;
|
|
31
|
+
choices?(field: string): ReadonlyArray<{
|
|
32
|
+
value: string | number | boolean;
|
|
33
|
+
label: string;
|
|
34
|
+
}> | undefined;
|
|
35
|
+
}
|
|
36
|
+
interface FormHandle {
|
|
37
|
+
state(): Promise<{
|
|
21
38
|
label: string;
|
|
22
39
|
granted: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
label?: string;
|
|
26
|
-
challenge?: string;
|
|
27
|
-
attempt?: string;
|
|
28
|
-
}): Promise<CommandOutcome>;
|
|
29
|
-
open(key: Readonly<Record<string, unknown>>, input?: Readonly<Record<string, unknown>>, options?: {
|
|
30
|
-
label?: string;
|
|
31
|
-
attempt?: string;
|
|
32
|
-
}): Promise<CommandOutcome>;
|
|
33
|
-
choices?(field: string): ReadonlyArray<{
|
|
34
|
-
value: string | number | boolean;
|
|
40
|
+
steps: ReadonlyArray<{
|
|
41
|
+
id: string;
|
|
35
42
|
label: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
43
|
+
}>;
|
|
44
|
+
draft: {
|
|
45
|
+
saved: readonly string[];
|
|
46
|
+
step: string | null;
|
|
47
|
+
expiresAt: string | null;
|
|
48
|
+
} | null;
|
|
49
|
+
pending: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
open(input?: Readonly<Record<string, unknown>>, options?: {
|
|
52
|
+
at?: string;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
status: 'done';
|
|
55
|
+
message?: string;
|
|
56
|
+
} | {
|
|
57
|
+
status: 'received';
|
|
58
|
+
reference: string;
|
|
59
|
+
message?: string;
|
|
60
|
+
} | {
|
|
61
|
+
status: 'processing';
|
|
62
|
+
message: string;
|
|
63
|
+
} | {
|
|
64
|
+
status: 'saved';
|
|
65
|
+
saved: readonly string[];
|
|
66
|
+
} | {
|
|
67
|
+
status: 'closed';
|
|
68
|
+
}>;
|
|
69
|
+
startOver(): Promise<boolean>;
|
|
70
|
+
}
|
|
71
|
+
/** What sdk/commands.tsx hands the SDK's host: a command, or a fixed action, as a component holds it, and a form over the page. */
|
|
72
|
+
interface CommandHost {
|
|
73
|
+
command: (ref: string, page?: string) => CommandHandle;
|
|
74
|
+
/** A fixed action found on one of the resources `reads` names (any, without them). */
|
|
75
|
+
action: (ref: string, reads?: readonly string[]) => CommandHandle;
|
|
38
76
|
openForm: (view: string, prefill: Readonly<Record<string, string | number>>) => void;
|
|
77
|
+
/** A form view a page declares, with its draft. */
|
|
78
|
+
form: (view: string) => FormHandle;
|
|
39
79
|
}
|
|
40
80
|
interface Bridge {
|
|
41
81
|
activeApp: () => unknown;
|
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.23",
|
|
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.23",
|
|
87
|
+
"@mistriwork/ui": "1.0.0-rc.23",
|
|
88
88
|
"intl-messageformat": "12.1.2",
|
|
89
89
|
"qrcode-generator": "^2.0.4"
|
|
90
90
|
},
|