@mistriwork/kit 1.0.0-rc.21 → 1.0.0-rc.22
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/dashboardModel.d.ts +1 -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 +38 -0
- package/dist/client/structure.css +6 -1
- package/dist/client/uiBridge.d.ts +22 -19
- 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) ||
|
|
@@ -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
|
@@ -1331,6 +1331,44 @@ body.app-custom-gutter .topbar[data-header-width="content"] { --app-shell-outer-
|
|
|
1331
1331
|
/* The focus ring hugs the label instead of the full-height slot, whose
|
|
1332
1332
|
ring crossed into the row below. */
|
|
1333
1333
|
.tn-item:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -6px; border-radius: var(--radius-panel); }
|
|
1334
|
+
/* Workspaces (WorkspaceSwitcher.tsx): the products of one App as links in the bar, after the mark, the current one marked
|
|
1335
|
+
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
|
|
1336
|
+
the room goes under More (useTabFold.ts). The host is empty until the App has two to pick from. */
|
|
1337
|
+
.workspace-host { display: flex; align-items: center; flex: 1 1 0; min-width: 0; }
|
|
1338
|
+
.workspace-tabs { min-width: 0; flex: 1 1 auto; }
|
|
1339
|
+
.workspace-strip { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
|
|
1340
|
+
.workspace-tab {
|
|
1341
|
+
position: relative; flex: none; height: 32px; box-sizing: border-box;
|
|
1342
|
+
display: inline-flex; align-items: center; gap: var(--space-2);
|
|
1343
|
+
padding: 0 var(--space-3); border-radius: var(--radius);
|
|
1344
|
+
font: var(--text-base) var(--mono); color: var(--ink-muted);
|
|
1345
|
+
background: none; border: none; text-decoration: none; white-space: nowrap; cursor: pointer;
|
|
1346
|
+
}
|
|
1347
|
+
@media (hover: hover) { .workspace-tab:hover { color: var(--ink); } }
|
|
1348
|
+
.workspace-tab[aria-current="page"] { color: var(--ink); }
|
|
1349
|
+
.workspace-tab[aria-current="page"]::after {
|
|
1350
|
+
content: ''; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0; height: 2px;
|
|
1351
|
+
border-radius: min(2px, var(--radius)); background: var(--accent);
|
|
1352
|
+
}
|
|
1353
|
+
.workspace-tab:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -2px; }
|
|
1354
|
+
.workspace-tab .nav-icon { flex: none; width: 15px; height: 15px; color: inherit; }
|
|
1355
|
+
.workspace-more { flex: none; }
|
|
1356
|
+
/* The caret the Export button wears, so More reads as a menu and not a fourth workspace. */
|
|
1357
|
+
.workspace-more .workspace-tab::after { content: "▾"; color: var(--ink-subtle); }
|
|
1358
|
+
/* At the top of a phone's drawer: a list, one row each, icon and label with the label wrapping whole, the current one
|
|
1359
|
+
marked in weight, and a rule before that workspace's entries. */
|
|
1360
|
+
.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; }
|
|
1361
|
+
.workspace-list { display: flex; flex-direction: column; gap: 1px; margin: 0; padding: 0; list-style: none; }
|
|
1362
|
+
.workspace-list .workspace-tab {
|
|
1363
|
+
display: flex; width: 100%; height: auto; min-height: 44px; padding: var(--space-3); border-radius: var(--radius);
|
|
1364
|
+
white-space: normal; overflow-wrap: anywhere; text-align: left; color: var(--ink); font: var(--type-ui)/1.35 var(--sans);
|
|
1365
|
+
}
|
|
1366
|
+
/* Current is said in weight and a neutral fill, not the accent: the entry below keeps the accent's bar, and two
|
|
1367
|
+
marks in colour in one drawer both shout. */
|
|
1368
|
+
.workspace-list .workspace-tab[aria-current="page"] { background: var(--row-hover); color: var(--ink); font-weight: 600; }
|
|
1369
|
+
.workspace-list .workspace-tab[aria-current="page"] .nav-icon { color: var(--ink); }
|
|
1370
|
+
.workspace-list .workspace-tab[aria-current="page"]::after { content: none; }
|
|
1371
|
+
.workspace-list .nav-icon { width: var(--icon-ui); height: var(--icon-ui); color: var(--ink-muted); }
|
|
1334
1372
|
.tn-caret { color: var(--ink-subtle); margin-left: var(--space-2); font-size: var(--text-xs); }
|
|
1335
1373
|
/* Menu icons (NavGlyph.tsx) in the top bar and its menus: before the words,
|
|
1336
1374
|
quieter than them, in the current entry's own color. */
|
|
@@ -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,26 +15,29 @@ 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;
|
|
21
33
|
label: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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;
|
|
35
|
-
label: string;
|
|
36
|
-
}> | undefined;
|
|
37
|
-
};
|
|
34
|
+
}> | undefined;
|
|
35
|
+
}
|
|
36
|
+
/** 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. */
|
|
37
|
+
interface CommandHost {
|
|
38
|
+
command: (ref: string, page?: string) => CommandHandle;
|
|
39
|
+
/** A fixed action found on one of the resources `reads` names (any, without them). */
|
|
40
|
+
action: (ref: string, reads?: readonly string[]) => CommandHandle;
|
|
38
41
|
openForm: (view: string, prefill: Readonly<Record<string, string | number>>) => void;
|
|
39
42
|
}
|
|
40
43
|
interface Bridge {
|
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.22",
|
|
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.22",
|
|
87
|
+
"@mistriwork/ui": "1.0.0-rc.22",
|
|
88
88
|
"intl-messageformat": "12.1.2",
|
|
89
89
|
"qrcode-generator": "^2.0.4"
|
|
90
90
|
},
|