@design.estate/dees-catalog 24.3.0 → 24.5.0
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_bundle/bundle.js +161 -259
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-7CM7S6EQ.js → chunk-LRGVCS7F.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-R6EBIDCM.js → chunk-PKH6IGY6.js} +347 -4
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-R6EBIDCM.js.map → chunk-PKH6IGY6.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-Z3DSEMNI.js → dees-modal-ORXOZADW.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-KPB3RVGL.js → dees-workspace-terminal-MUU2HDU3.js} +3 -3
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-appui/dees-appui/dees-appui.d.ts +42 -23
- package/dist_ts_web/elements/00group-appui/dees-appui/dees-appui.demo.js +2 -3
- package/dist_ts_web/elements/00group-appui/dees-appui/dees-appui.js +93 -81
- package/dist_ts_web/elements/00group-appui/dees-appui/shell.storage.d.ts +11 -4
- package/dist_ts_web/elements/00group-appui/dees-appui/shell.storage.js +32 -9
- package/dist_ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.d.ts +8 -1
- package/dist_ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.demo.js +7 -1
- package/dist_ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.js +18 -5
- package/dist_ts_web/elements/00group-input/dees-input-tags/dees-input-tags.d.ts +4 -13
- package/dist_ts_web/elements/00group-input/dees-input-tags/dees-input-tags.js +29 -174
- package/dist_ts_web/elements/00group-input/dees-input-text/dees-input-text.d.ts +41 -0
- package/dist_ts_web/elements/00group-input/dees-input-text/dees-input-text.demo.js +16 -1
- package/dist_ts_web/elements/00group-input/dees-input-text/dees-input-text.js +103 -3
- package/dist_ts_web/elements/00group-input/suggestion-list.d.ts +102 -0
- package/dist_ts_web/elements/00group-input/suggestion-list.js +300 -0
- package/dist_ts_web/elements/interfaces/appconfig.d.ts +28 -10
- package/package.json +1 -1
- package/readme.md +36 -7
- package/scripts/token-baseline.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-appui/dees-appui/dees-appui.demo.ts +1 -2
- package/ts_web/elements/00group-appui/dees-appui/dees-appui.ts +102 -89
- package/ts_web/elements/00group-appui/dees-appui/readme.md +42 -26
- package/ts_web/elements/00group-appui/dees-appui/shell.storage.ts +42 -11
- package/ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.demo.ts +6 -0
- package/ts_web/elements/00group-input/dees-input-multitoggle/dees-input-multitoggle.ts +24 -7
- package/ts_web/elements/00group-input/dees-input-tags/dees-input-tags.ts +27 -171
- package/ts_web/elements/00group-input/dees-input-text/dees-input-text.demo.ts +17 -0
- package/ts_web/elements/00group-input/dees-input-text/dees-input-text.ts +106 -1
- package/ts_web/elements/00group-input/suggestion-list.ts +323 -0
- package/ts_web/elements/interfaces/appconfig.ts +29 -10
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-7CM7S6EQ.js.map → chunk-LRGVCS7F.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-Z3DSEMNI.js.map → dees-modal-ORXOZADW.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-KPB3RVGL.js.map → dees-workspace-terminal-MUU2HDU3.js.map} +0 -0
|
@@ -43,7 +43,7 @@ import { dcLocalize } from '../../../i18n/localize.js';
|
|
|
43
43
|
|
|
44
44
|
// View registry for managing views
|
|
45
45
|
import { ViewRegistry } from './view.registry.js';
|
|
46
|
-
import { ShellStorage, paneWidthKey } from './shell.storage.js';
|
|
46
|
+
import { ShellStorage, paneWidthKey, type TShellPane } from './shell.storage.js';
|
|
47
47
|
import { createShellAddressing, resolveLocationBaseUrl, type IShellAddressing } from './shell.address.js';
|
|
48
48
|
|
|
49
49
|
// Import child components
|
|
@@ -203,6 +203,13 @@ const assertAsideAvailable = (
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
+
/**
|
|
207
|
+
* The side panel's first width a configuration sets: `asideWidth`, else the
|
|
208
|
+
* deprecated `assistant.width`, else the deprecated `activityLog.width`.
|
|
209
|
+
*/
|
|
210
|
+
const configuredAsideWidth = (config: interfaces.IAppConfig): number | undefined =>
|
|
211
|
+
config.asideWidth ?? config.assistant?.width ?? config.activityLog?.width;
|
|
212
|
+
|
|
206
213
|
/** A pane width is a finite number of pixels; anything else is refused rather than clamped. */
|
|
207
214
|
const assertFinitePaneWidth = (pane: interfaces.TAppuiPane, width: number): void => {
|
|
208
215
|
if (!Number.isFinite(width)) {
|
|
@@ -231,6 +238,7 @@ const assertValidConfig = (config: interfaces.IAppConfig): void => {
|
|
|
231
238
|
if (config.notFoundView && !config.views.some((view) => view.id === config.notFoundView)) {
|
|
232
239
|
throw new Error(`The not-found view "${config.notFoundView}" must be one of the configured views.`);
|
|
233
240
|
}
|
|
241
|
+
if (config.asideWidth !== undefined) assertFinitePaneWidth('aside', config.asideWidth);
|
|
234
242
|
if (config.activityLog?.width !== undefined) assertFinitePaneWidth('activity', config.activityLog.width);
|
|
235
243
|
if (config.assistant?.width !== undefined) assertFinitePaneWidth('assistant', config.assistant.width);
|
|
236
244
|
assertAsideAvailable(config.aside, config.assistant);
|
|
@@ -245,14 +253,15 @@ const assertValidConfig = (config: interfaces.IAppConfig): void => {
|
|
|
245
253
|
if (locale !== undefined) assertValidLocale(locale);
|
|
246
254
|
};
|
|
247
255
|
|
|
256
|
+
/** The pane a name stands for: `activity` and `assistant` are older names of the side panel. */
|
|
257
|
+
const shellPaneOf = (pane: interfaces.TAppuiPane): TShellPane => (pane === 'secondary' ? 'secondary' : 'aside');
|
|
258
|
+
|
|
248
259
|
/** What the shell knows about a pane a reader can resize. */
|
|
249
260
|
interface IResizablePane {
|
|
250
261
|
/** The id of the pane's element, which its handle names as the one it controls. */
|
|
251
262
|
elementId: string;
|
|
252
263
|
/** Which side of its handle the pane lies on. */
|
|
253
264
|
side: TResizeHandlePrimary;
|
|
254
|
-
/** The label that names the pane's handle. */
|
|
255
|
-
handleLabel: 'resizeSecondary' | 'resizeActivity' | 'resizeAssistant';
|
|
256
265
|
/** The width the pane starts at and a reset gives back, in CSS pixels. */
|
|
257
266
|
defaultWidth: number;
|
|
258
267
|
minWidth: number;
|
|
@@ -261,30 +270,21 @@ interface IResizablePane {
|
|
|
261
270
|
|
|
262
271
|
/**
|
|
263
272
|
* The panes a reader can resize. The section menu lies before its handle, on
|
|
264
|
-
* the content column's start edge; the side panel
|
|
265
|
-
*
|
|
273
|
+
* the content column's start edge; the side panel after its own, on the end
|
|
274
|
+
* edge. The panel has one width whichever tool it shows: a tool fills it,
|
|
275
|
+
* so opening, switching or closing a tool never moves it.
|
|
266
276
|
*/
|
|
267
|
-
const resizablePanes: Record<
|
|
277
|
+
const resizablePanes: Record<TShellPane, IResizablePane> = {
|
|
268
278
|
secondary: {
|
|
269
279
|
elementId: 'secondary-menu',
|
|
270
280
|
side: 'start',
|
|
271
|
-
handleLabel: 'resizeSecondary',
|
|
272
281
|
defaultWidth: 240,
|
|
273
282
|
minWidth: 180,
|
|
274
283
|
maxWidth: 400,
|
|
275
284
|
},
|
|
276
|
-
|
|
285
|
+
aside: {
|
|
277
286
|
elementId: sidePanelId,
|
|
278
287
|
side: 'end',
|
|
279
|
-
handleLabel: 'resizeActivity',
|
|
280
|
-
defaultWidth: 280,
|
|
281
|
-
minWidth: 240,
|
|
282
|
-
maxWidth: 480,
|
|
283
|
-
},
|
|
284
|
-
assistant: {
|
|
285
|
-
elementId: sidePanelId,
|
|
286
|
-
side: 'end',
|
|
287
|
-
handleLabel: 'resizeAssistant',
|
|
288
288
|
defaultWidth: 400,
|
|
289
289
|
minWidth: 320,
|
|
290
290
|
maxWidth: 640,
|
|
@@ -292,7 +292,7 @@ const resizablePanes: Record<interfaces.TAppuiPane, IResizablePane> = {
|
|
|
292
292
|
};
|
|
293
293
|
|
|
294
294
|
/** Every pane a reader can resize. */
|
|
295
|
-
const paneNames = Object.keys(resizablePanes) as
|
|
295
|
+
const paneNames = Object.keys(resizablePanes) as TShellPane[];
|
|
296
296
|
|
|
297
297
|
/** How far Shift and an Arrow key move a pane's edge; a plain Arrow key moves it the handle's 16px. */
|
|
298
298
|
const paneLargeStep = 64;
|
|
@@ -582,10 +582,9 @@ export class DeesAppui extends DeesElement {
|
|
|
582
582
|
|
|
583
583
|
/** The width of each resizable pane in CSS pixels, kept while a pane is hidden or collapsed. */
|
|
584
584
|
@state()
|
|
585
|
-
private accessor paneWidths: Record<
|
|
585
|
+
private accessor paneWidths: Record<TShellPane, number> = {
|
|
586
586
|
secondary: resizablePanes.secondary.defaultWidth,
|
|
587
|
-
|
|
588
|
-
assistant: resizablePanes.assistant.defaultWidth,
|
|
587
|
+
aside: resizablePanes.aside.defaultWidth,
|
|
589
588
|
};
|
|
590
589
|
|
|
591
590
|
constructor() {
|
|
@@ -777,11 +776,11 @@ export class DeesAppui extends DeesElement {
|
|
|
777
776
|
}
|
|
778
777
|
|
|
779
778
|
/* The side panel fills the shell's last track and clips what does not
|
|
780
|
-
fit it, so the track reveals the panel as it slides in while
|
|
781
|
-
keeps the width
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
779
|
+
fit it, so the track reveals the panel as it slides in while what it
|
|
780
|
+
holds keeps the panel's width: nothing in it reflows with the track.
|
|
781
|
+
It clips rather than hides its overflow, which would make it a scroll
|
|
782
|
+
container that focusing a tool mid-slide could scroll. Closed and slid
|
|
783
|
+
out, it leaves the rendering. */
|
|
785
784
|
.side-panel {
|
|
786
785
|
position: relative;
|
|
787
786
|
grid-area: 1 / 2;
|
|
@@ -802,25 +801,16 @@ export class DeesAppui extends DeesElement {
|
|
|
802
801
|
/* The panel's own rows, which continue the bars it stands beside: a
|
|
803
802
|
header as tall as the app bar and a footer as tall as the bottom bar,
|
|
804
803
|
drawing their lines where the bars draw theirs, and the tool between. */
|
|
805
|
-
/*
|
|
806
|
-
does not reflow, and
|
|
807
|
-
the narrower tool keeps the header across the panel while it
|
|
808
|
-
narrows. */
|
|
804
|
+
/* At the panel's width whichever tool it holds, so the panel slides over
|
|
805
|
+
a frame that does not reflow, and a switch moves nothing. */
|
|
809
806
|
.side-frame {
|
|
810
807
|
justify-self: start;
|
|
811
808
|
display: grid;
|
|
812
809
|
grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
|
|
810
|
+
width: var(--dees-appui-aside-width);
|
|
813
811
|
min-height: 0;
|
|
814
812
|
}
|
|
815
813
|
|
|
816
|
-
.side-frame[data-tool='activity'] {
|
|
817
|
-
width: max(100%, var(--dees-appui-activity-width));
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
.side-frame[data-tool='assistant'] {
|
|
821
|
-
width: max(100%, var(--dees-appui-assistant-width));
|
|
822
|
-
}
|
|
823
|
-
|
|
824
814
|
.side-header,
|
|
825
815
|
.side-footer {
|
|
826
816
|
display: flex;
|
|
@@ -948,29 +938,25 @@ export class DeesAppui extends DeesElement {
|
|
|
948
938
|
min-height: 0;
|
|
949
939
|
}
|
|
950
940
|
|
|
951
|
-
/* Both tools share one place and stay mounted and
|
|
952
|
-
keeps a draft, a scroll position and a stream, and
|
|
953
|
-
size fall to nothing. The tool the panel
|
|
954
|
-
transparent: transparency hides all it
|
|
955
|
-
would let a descendant that declares
|
|
956
|
-
drawer, show through. */
|
|
941
|
+
/* Both tools share one place at the panel's width and stay mounted and
|
|
942
|
+
laid out: a switch keeps a draft, a scroll position and a stream, and
|
|
943
|
+
no tool sees its size change or fall to nothing. The tool the panel
|
|
944
|
+
does not hold is inert and transparent: transparency hides all it
|
|
945
|
+
contains, where visibility would let a descendant that declares
|
|
946
|
+
itself visible, such as an open drawer, show through. */
|
|
957
947
|
.side-tool {
|
|
958
948
|
grid-area: 1 / 1;
|
|
959
949
|
justify-self: start;
|
|
960
950
|
display: grid;
|
|
961
951
|
grid-template: minmax(0, 1fr) / minmax(0, 1fr);
|
|
952
|
+
width: var(--dees-appui-aside-width);
|
|
962
953
|
min-height: 0;
|
|
963
954
|
}
|
|
964
955
|
|
|
965
|
-
.side-tool[data-tool='activity'] {
|
|
966
|
-
width: var(--dees-appui-activity-width);
|
|
967
|
-
}
|
|
968
|
-
|
|
969
956
|
/* The activity log draws the edge it shares with the content; an
|
|
970
957
|
assistant does not know it stands beside the content, so its place
|
|
971
958
|
draws that edge. */
|
|
972
959
|
.side-tool[data-tool='assistant'] {
|
|
973
|
-
width: var(--dees-appui-assistant-width);
|
|
974
960
|
border-inline-start: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
975
961
|
}
|
|
976
962
|
|
|
@@ -1351,7 +1337,7 @@ export class DeesAppui extends DeesElement {
|
|
|
1351
1337
|
@tray-toggle=${() => { void this.toggleTrayFromReader(); }}
|
|
1352
1338
|
></dees-appui-bottombar>
|
|
1353
1339
|
</div>
|
|
1354
|
-
${this.
|
|
1340
|
+
${this.isPaneResizable('aside') ? this.renderPaneHandle('aside') : ''}
|
|
1355
1341
|
<aside
|
|
1356
1342
|
id=${sidePanelId}
|
|
1357
1343
|
class="side-panel"
|
|
@@ -1381,14 +1367,14 @@ export class DeesAppui extends DeesElement {
|
|
|
1381
1367
|
}
|
|
1382
1368
|
|
|
1383
1369
|
/**
|
|
1384
|
-
* The shell's tracks: the workspace, and the side panel at
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
1387
|
-
* workspace instead.
|
|
1370
|
+
* The shell's tracks: the workspace, and the side panel at its width while it
|
|
1371
|
+
* shows a tool. Showing and closing the panel move that last track, through
|
|
1372
|
+
* the shell's transition; switching tools leaves it where it is. The compact
|
|
1373
|
+
* panel covers the workspace instead.
|
|
1388
1374
|
*/
|
|
1389
1375
|
private shellColumns(): string {
|
|
1390
1376
|
if (this.compact) return 'minmax(0, 1fr)';
|
|
1391
|
-
return `minmax(0, 1fr) ${this.aside ?
|
|
1377
|
+
return `minmax(0, 1fr) ${this.aside ? 'var(--dees-appui-aside-width)' : '0px'}`;
|
|
1392
1378
|
}
|
|
1393
1379
|
|
|
1394
1380
|
/** The workspace's tracks: one column when compact, else each shown menu and the content. */
|
|
@@ -1434,7 +1420,7 @@ export class DeesAppui extends DeesElement {
|
|
|
1434
1420
|
}
|
|
1435
1421
|
|
|
1436
1422
|
/**
|
|
1437
|
-
* A tool's place in the side panel, at the
|
|
1423
|
+
* A tool's place in the side panel, at the panel's width. Both places stay
|
|
1438
1424
|
* mounted; the one the panel does not hold is inert. A tool that asks to
|
|
1439
1425
|
* close the panel asks here.
|
|
1440
1426
|
*/
|
|
@@ -1453,15 +1439,15 @@ export class DeesAppui extends DeesElement {
|
|
|
1453
1439
|
* The separator on a pane's inner edge. What a reader asks for lands at
|
|
1454
1440
|
* once; a size that settles is reported to the host.
|
|
1455
1441
|
*/
|
|
1456
|
-
private renderPaneHandle(pane:
|
|
1457
|
-
const { elementId, side,
|
|
1442
|
+
private renderPaneHandle(pane: TShellPane): TemplateResult {
|
|
1443
|
+
const { elementId, side, defaultWidth, minWidth, maxWidth } = resizablePanes[pane];
|
|
1458
1444
|
return html`
|
|
1459
1445
|
<dees-resize-handle
|
|
1460
1446
|
class="pane-handle"
|
|
1461
1447
|
data-pane=${pane}
|
|
1462
1448
|
aria-controls=${elementId}
|
|
1463
1449
|
.primary=${side}
|
|
1464
|
-
.label=${this.word(
|
|
1450
|
+
.label=${this.word(this.paneHandleLabel(pane))}
|
|
1465
1451
|
.hint=${this.word('resizeReset')}
|
|
1466
1452
|
.value=${this.paneWidths[pane]}
|
|
1467
1453
|
.min=${minWidth}
|
|
@@ -2096,7 +2082,6 @@ export class DeesAppui extends DeesElement {
|
|
|
2096
2082
|
const content = assistant?.content;
|
|
2097
2083
|
const replaced = content !== this.assistantConfig?.content;
|
|
2098
2084
|
this.assistantConfig = assistant;
|
|
2099
|
-
if (assistant?.width !== undefined) this.applyPaneWidth('assistant', assistant.width);
|
|
2100
2085
|
if (!replaced) return;
|
|
2101
2086
|
this.handFocusOutOf('assistant');
|
|
2102
2087
|
this.assistantElement = typeof content === 'function' ? undefined : content;
|
|
@@ -2370,37 +2355,52 @@ export class DeesAppui extends DeesElement {
|
|
|
2370
2355
|
// ==========================================
|
|
2371
2356
|
|
|
2372
2357
|
/**
|
|
2373
|
-
* Size a pane — `secondary`, the section menu, `
|
|
2374
|
-
*
|
|
2375
|
-
*
|
|
2376
|
-
*
|
|
2358
|
+
* Size a pane — `secondary`, the section menu, or `aside`, the side panel,
|
|
2359
|
+
* whichever tool it shows — in CSS pixels, clamped to the pane's range and
|
|
2360
|
+
* rounded to whole pixels. The width lands at once, even while the pane is
|
|
2361
|
+
* hidden or collapsed, and the configured storage keeps it. Nothing is
|
|
2377
2362
|
* emitted: `pane-resize` reports what a reader did, so a host restoring a
|
|
2378
|
-
* width of its own never hears it echoed back.
|
|
2363
|
+
* width of its own never hears it echoed back. `activity` and `assistant`
|
|
2364
|
+
* are deprecated names of `aside`: they size the one side panel.
|
|
2379
2365
|
*/
|
|
2380
2366
|
public setPaneWidth(pane: interfaces.TAppuiPane, width: number): void {
|
|
2381
2367
|
assertFinitePaneWidth(pane, width);
|
|
2382
|
-
|
|
2383
|
-
this.
|
|
2368
|
+
const shellPane = shellPaneOf(pane);
|
|
2369
|
+
this.applyPaneWidth(shellPane, width);
|
|
2370
|
+
this.storePaneWidth(shellPane);
|
|
2384
2371
|
}
|
|
2385
2372
|
|
|
2386
|
-
/**
|
|
2373
|
+
/**
|
|
2374
|
+
* A pane's width in CSS pixels, kept while the pane is hidden or collapsed.
|
|
2375
|
+
* `activity` and `assistant` are deprecated names of `aside`: both answer
|
|
2376
|
+
* the side panel's one width.
|
|
2377
|
+
*/
|
|
2387
2378
|
public getPaneWidth(pane: interfaces.TAppuiPane): number {
|
|
2388
|
-
return this.paneWidths[pane];
|
|
2379
|
+
return this.paneWidths[shellPaneOf(pane)];
|
|
2389
2380
|
}
|
|
2390
2381
|
|
|
2391
2382
|
/**
|
|
2392
2383
|
* A pane can be resized while it stands open beside the content, never as a
|
|
2393
|
-
* compact drawer or overlay;
|
|
2384
|
+
* compact drawer or overlay; the side panel while it shows a tool.
|
|
2394
2385
|
*/
|
|
2395
|
-
private isPaneResizable(pane:
|
|
2386
|
+
private isPaneResizable(pane: TShellPane): boolean {
|
|
2396
2387
|
if (this.compact) return false;
|
|
2397
2388
|
return pane === 'secondary'
|
|
2398
2389
|
? this.secondaryMenuShown(this.chromeOnScreen()) && !this.secondarymenuCollapsed
|
|
2399
|
-
: this.aside
|
|
2390
|
+
: this.aside !== null;
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
/**
|
|
2394
|
+
* The words a pane's handle is named with. The side panel's names the tool a
|
|
2395
|
+
* reader sees beside it; either way it sizes the panel.
|
|
2396
|
+
*/
|
|
2397
|
+
private paneHandleLabel(pane: TShellPane): 'resizeSecondary' | 'resizeActivity' | 'resizeAssistant' {
|
|
2398
|
+
if (pane === 'secondary') return 'resizeSecondary';
|
|
2399
|
+
return this.asideTool === 'activity' ? 'resizeActivity' : 'resizeAssistant';
|
|
2400
2400
|
}
|
|
2401
2401
|
|
|
2402
2402
|
/** The one writer of the pane widths, whoever asks: a handle, `setPaneWidth()`, `configure()` or the storage. */
|
|
2403
|
-
private applyPaneWidth(pane:
|
|
2403
|
+
private applyPaneWidth(pane: TShellPane, width: number): void {
|
|
2404
2404
|
const { minWidth, maxWidth } = resizablePanes[pane];
|
|
2405
2405
|
const clamped = Math.min(maxWidth, Math.max(minWidth, Math.round(width)));
|
|
2406
2406
|
if (clamped === this.paneWidths[pane]) return;
|
|
@@ -2410,35 +2410,41 @@ export class DeesAppui extends DeesElement {
|
|
|
2410
2410
|
|
|
2411
2411
|
/**
|
|
2412
2412
|
* Puts the pane widths on the host as `--dees-appui-<pane>-width`, where the
|
|
2413
|
-
* grid, the panes and anybody reading the layout find them
|
|
2414
|
-
*
|
|
2415
|
-
*
|
|
2416
|
-
*
|
|
2417
|
-
*
|
|
2413
|
+
* grid, the panes and anybody reading the layout find them, the side panel's
|
|
2414
|
+
* also under the deprecated names `--dees-appui-activity-width` and
|
|
2415
|
+
* `--dees-appui-assistant-width`. The tracks and the section menu animate a
|
|
2416
|
+
* pane being shown or collapsed, but a width lands at once: `resizing`
|
|
2417
|
+
* switches those transitions off, and because a transition is decided when
|
|
2418
|
+
* styles resolve, the styles are resolved before `resizing` goes.
|
|
2418
2419
|
*/
|
|
2419
2420
|
private writePaneWidths(): void {
|
|
2420
2421
|
this.toggleAttribute('resizing', true);
|
|
2421
2422
|
for (const [pane, width] of Object.entries(this.paneWidths)) {
|
|
2422
2423
|
this.style.setProperty(`--dees-appui-${pane}-width`, `${width}px`);
|
|
2423
2424
|
}
|
|
2425
|
+
for (const tool of ['activity', 'assistant'] as const) {
|
|
2426
|
+
this.style.setProperty(`--dees-appui-${tool}-width`, `${this.paneWidths.aside}px`);
|
|
2427
|
+
}
|
|
2424
2428
|
// Reading any computed style resolves every pending one.
|
|
2425
2429
|
void getComputedStyle(this).display;
|
|
2426
2430
|
this.toggleAttribute('resizing', false);
|
|
2427
2431
|
}
|
|
2428
2432
|
|
|
2429
2433
|
/** Keeps a pane's width, as it now stands, in the configured storage. */
|
|
2430
|
-
private storePaneWidth(pane:
|
|
2434
|
+
private storePaneWidth(pane: TShellPane): void {
|
|
2431
2435
|
this.storage?.write(paneWidthKey(pane), this.paneWidths[pane]);
|
|
2432
2436
|
}
|
|
2433
2437
|
|
|
2434
2438
|
/**
|
|
2435
2439
|
* A reader settled a pane at a new width: the configured storage keeps it,
|
|
2436
|
-
* and the host hears it once, to keep it or to follow it.
|
|
2440
|
+
* and the host hears it once, to keep it or to follow it. The side panel is
|
|
2441
|
+
* reported under the name of the tool it shows, as hosts written while each
|
|
2442
|
+
* tool had a width of its own expect; either name is the panel's one width.
|
|
2437
2443
|
*/
|
|
2438
|
-
private reportPaneResize(pane:
|
|
2444
|
+
private reportPaneResize(pane: TShellPane): void {
|
|
2439
2445
|
this.storePaneWidth(pane);
|
|
2440
2446
|
this.dispatchEvent(new CustomEvent<interfaces.IPaneResizeEvent>('pane-resize', {
|
|
2441
|
-
detail: { pane, width: this.paneWidths[pane] },
|
|
2447
|
+
detail: { pane: pane === 'aside' ? this.asideTool : pane, width: this.paneWidths[pane] },
|
|
2442
2448
|
bubbles: true,
|
|
2443
2449
|
composed: true,
|
|
2444
2450
|
}));
|
|
@@ -2885,8 +2891,11 @@ export class DeesAppui extends DeesElement {
|
|
|
2885
2891
|
* `bottomBar` section replaces the bar's widgets and actions, the assistant
|
|
2886
2892
|
* is this call's or none, the side panel shows what `aside` says, the labels
|
|
2887
2893
|
* and the storage are this call's or none, and routing starts over. What the
|
|
2888
|
-
* storage holds wins over what the call sets, and nothing is written
|
|
2889
|
-
*
|
|
2894
|
+
* storage holds wins over what the call sets, and nothing is written but,
|
|
2895
|
+
* once, a side panel width the storage still keeps under a tool's old key,
|
|
2896
|
+
* which moves to the panel's own. The side panel's first width is
|
|
2897
|
+
* `asideWidth`, else the deprecated `assistant.width`, else the deprecated
|
|
2898
|
+
* `activityLog.width`. A configuration it cannot honour — a `notFoundView` that is not among
|
|
2890
2899
|
* `views`, a location base URL of another app, a width that is no finite
|
|
2891
2900
|
* number, `aside: 'assistant'` without an assistant, an assistant shortcut
|
|
2892
2901
|
* that names no key, `restoreLastView` without `storage`, a labels `locale`
|
|
@@ -2951,10 +2960,11 @@ export class DeesAppui extends DeesElement {
|
|
|
2951
2960
|
if (config.activityLog) {
|
|
2952
2961
|
this.activityLogToggleVisible = config.activityLog.toggle ?? true;
|
|
2953
2962
|
if (config.activityLog.live !== undefined) this.activityLogLive = config.activityLog.live;
|
|
2954
|
-
if (config.activityLog.width !== undefined) this.applyPaneWidth('activity', config.activityLog.width);
|
|
2955
2963
|
}
|
|
2956
2964
|
|
|
2957
|
-
// The side panel: the assistant this configuration offers, then what it shows.
|
|
2965
|
+
// The side panel: its one width, the assistant this configuration offers, then what it shows.
|
|
2966
|
+
const asideWidth = configuredAsideWidth(config);
|
|
2967
|
+
if (asideWidth !== undefined) this.applyPaneWidth('aside', asideWidth);
|
|
2958
2968
|
this.applyAssistantConfig(config.assistant);
|
|
2959
2969
|
this.applyAside(config.aside ?? null);
|
|
2960
2970
|
|
|
@@ -3004,8 +3014,9 @@ export class DeesAppui extends DeesElement {
|
|
|
3004
3014
|
* for a host whose storage scope changes while the shell runs: a reader who
|
|
3005
3015
|
* switches to another set of books, whose tray tabs are that set's. The
|
|
3006
3016
|
* shell reads what it restores from the new storage, as `configure()` does,
|
|
3007
|
-
* and writes nothing
|
|
3008
|
-
*
|
|
3017
|
+
* and writes nothing but, once, a side panel width the storage still keeps
|
|
3018
|
+
* under a tool's old key: the layout (both menus' collapse, the pane widths,
|
|
3019
|
+
* the side panel), where a key the new storage does not hold keeps what the shell
|
|
3009
3020
|
* shows, and, where the tray is offered, the tray's tabs, which belong to the
|
|
3010
3021
|
* storage: the tray empties at once and shows the new storage's tabs, or none.
|
|
3011
3022
|
* The last view is not read; the route stays. From here on every change is
|
|
@@ -3029,7 +3040,9 @@ export class DeesAppui extends DeesElement {
|
|
|
3029
3040
|
/**
|
|
3030
3041
|
* What a reader left the layout at, read from the configured storage over
|
|
3031
3042
|
* what the configuration set: both menus' collapse, the pane widths and what
|
|
3032
|
-
* the side panel shows. A
|
|
3043
|
+
* the side panel shows. A side panel width kept only under a tool's key from
|
|
3044
|
+
* before the panel had one width is taken once and kept under the panel's
|
|
3045
|
+
* (`ShellStorage.restore()`). A stored assistant the configuration no longer
|
|
3033
3046
|
* offers is stale, not an error, and leaves the panel as configured.
|
|
3034
3047
|
* Resolves once the storage answered every key.
|
|
3035
3048
|
*/
|
|
@@ -80,9 +80,10 @@ interface IAppConfig {
|
|
|
80
80
|
defaultView?: string; // the first screen when the address names none
|
|
81
81
|
notFoundView?: string; // where an address naming no screen lands; one of `views`
|
|
82
82
|
secondaryMenu?: ISecondaryMenuConfig; // { autoHide?: boolean } — on unless false: no section menu while the view has no sections
|
|
83
|
-
activityLog?: IActivityLogConfig; // { live?: boolean; toggle?: boolean; width?: number (
|
|
83
|
+
activityLog?: IActivityLogConfig; // { live?: boolean; toggle?: boolean; width?: number (deprecated: asideWidth) }
|
|
84
84
|
assistant?: IAppAssistantConfig; // the side panel's second tool; see Side Panel
|
|
85
85
|
aside?: TAppuiAside | null; // what the side panel shows first: 'activity', 'assistant' or nothing
|
|
86
|
+
asideWidth?: number; // the side panel's first width (px), whichever tool it shows
|
|
86
87
|
bottomBar?: IBottomBarConfig;
|
|
87
88
|
commands?: ICommand[]; // host commands in the command palette
|
|
88
89
|
tray?: boolean; // offers the tabs tray; see Tabs Tray
|
|
@@ -856,11 +857,11 @@ appui.configure({
|
|
|
856
857
|
assistant: {
|
|
857
858
|
content: chat, // or () => createChat(), called on the first show
|
|
858
859
|
iconName: 'lucide:Sparkles', // the default
|
|
859
|
-
width: 420, // its first width, within 320–640px
|
|
860
860
|
shortcut: 'Mod+J', // shows it, or closes it while shown; no default
|
|
861
861
|
focus: () => chat.focusComposer(), // where a reader who opens it lands
|
|
862
862
|
},
|
|
863
863
|
aside: 'activity', // what the panel shows first; unset shows nothing
|
|
864
|
+
asideWidth: 420, // its first width, within 320–640px, for either tool
|
|
864
865
|
});
|
|
865
866
|
|
|
866
867
|
appui.setAside('assistant'); // show a tool in place of the one shown
|
|
@@ -884,6 +885,11 @@ appui.addEventListener('aside-change', (event) => {
|
|
|
884
885
|
and `setAside('assistant')` throws without an assistant.
|
|
885
886
|
- **Both tools stay mounted.** The tool not shown is inert and transparent, never
|
|
886
887
|
removed, so a switch keeps a chat draft, a scroll position and a stream.
|
|
888
|
+
- **One width.** The panel has a width, and the tool it shows fills it: opening,
|
|
889
|
+
switching or closing a tool never changes it, only a reader's resize,
|
|
890
|
+
`setPaneWidth('aside', …)` or `asideWidth` (see [Layout](#layout)). The
|
|
891
|
+
deprecated `assistant.width` and `activityLog.width` set the same one width;
|
|
892
|
+
`asideWidth` wins over `assistant.width`, which wins over `activityLog.width`.
|
|
887
893
|
- **`setAside()` is silent.** It emits nothing, so a host restoring a stored state
|
|
888
894
|
never hears it echoed back, it stores nothing (see [Persistence](#persistence)),
|
|
889
895
|
and it does not take the focus into the tool.
|
|
@@ -957,10 +963,10 @@ Each type has a default icon that can be overridden:
|
|
|
957
963
|
|
|
958
964
|
## Layout
|
|
959
965
|
|
|
960
|
-
The section menu and the side panel
|
|
961
|
-
|
|
962
|
-
that a reader drags, or focuses and moves with the keyboard. The side panel has one
|
|
963
|
-
|
|
966
|
+
The section menu and the side panel can be resized. Each has a separator on its
|
|
967
|
+
inner edge, a [`dees-resize-handle`](../../00group-layout/dees-resize-handle/dees-resize-handle.ts),
|
|
968
|
+
that a reader drags, or focuses and moves with the keyboard. The side panel has one
|
|
969
|
+
width whichever tool it shows, so its separator sizes the panel for both tools.
|
|
964
970
|
|
|
965
971
|
| Key | Moves the separator |
|
|
966
972
|
| --- | --- |
|
|
@@ -972,14 +978,13 @@ which sizes the tool it shows; each tool keeps its own width.
|
|
|
972
978
|
| Pane | Default | Range |
|
|
973
979
|
| --- | --- | --- |
|
|
974
980
|
| `secondary`, the section menu | 240px | 180–400px |
|
|
975
|
-
| `
|
|
976
|
-
| `assistant`, the assistant | 400px | 320–640px |
|
|
981
|
+
| `aside`, the side panel, whichever tool it shows | 400px | 320–640px |
|
|
977
982
|
|
|
978
983
|
```typescript
|
|
979
|
-
appui.configure({ views, aside: 'activity',
|
|
984
|
+
appui.configure({ views, aside: 'activity', asideWidth: 360 }); // the panel's first width
|
|
980
985
|
appui.setPaneWidth('secondary', 320); // clamped to the range, in whole pixels
|
|
981
|
-
appui.getPaneWidth('
|
|
982
|
-
appui.setPaneWidth('
|
|
986
|
+
appui.getPaneWidth('aside'); // 360, also while the panel is closed
|
|
987
|
+
appui.setPaneWidth('aside', 480); // the panel's, for the activity log and the assistant alike
|
|
983
988
|
|
|
984
989
|
// A reader settled a pane at a new width: once per drag, once per key.
|
|
985
990
|
appui.addEventListener('pane-resize', (event) => {
|
|
@@ -988,6 +993,11 @@ appui.addEventListener('pane-resize', (event) => {
|
|
|
988
993
|
});
|
|
989
994
|
```
|
|
990
995
|
|
|
996
|
+
`'activity'` and `'assistant'` are deprecated names of `'aside'`, from when each tool
|
|
997
|
+
had a width of its own: `setPaneWidth()` and `getPaneWidth()` take them for the one
|
|
998
|
+
side panel width, and `pane-resize` still names the side panel by the tool it showed,
|
|
999
|
+
so hosts written for per-tool widths keep working; either name carries the one width.
|
|
1000
|
+
|
|
991
1001
|
A width lands at once, whoever sets it: the pane follows the pointer directly, and
|
|
992
1002
|
only showing, hiding and collapsing a pane animate. `setPaneWidth()` emits nothing,
|
|
993
1003
|
so a host restoring a stored width never hears it echoed back; a configured storage
|
|
@@ -997,10 +1007,10 @@ expanded, and both menus fold into their rail as one motion, the words fading wh
|
|
|
997
1007
|
the icons stay where they are.
|
|
998
1008
|
|
|
999
1009
|
The shell writes the widths into its own inline style as
|
|
1000
|
-
`--dees-appui-secondary-width
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1010
|
+
`--dees-appui-secondary-width` and `--dees-appui-aside-width`, for anything laid out
|
|
1011
|
+
beside the panes to read; the side panel's also as the deprecated
|
|
1012
|
+
`--dees-appui-activity-width` and `--dees-appui-assistant-width`. They are outputs,
|
|
1013
|
+
not settings: a width is set through `setPaneWidth()` or `asideWidth`. Set other inline styles on the shell property
|
|
1004
1014
|
by property (`style.height`, `styleMap`), because replacing the whole `style`
|
|
1005
1015
|
attribute takes the widths with it.
|
|
1006
1016
|
|
|
@@ -1044,18 +1054,23 @@ every value is JSON.
|
|
|
1044
1054
|
| --- | --- | --- |
|
|
1045
1055
|
| `dees-appui.mainMenuCollapsed` | `true` or `false` | `setMainMenuCollapsed()`, or a reader uses the main menu's own toggle |
|
|
1046
1056
|
| `dees-appui.secondaryMenuCollapsed` | `true` or `false` | `setSecondaryMenuCollapsed()`, or a reader uses the section menu's own toggle |
|
|
1047
|
-
| `dees-appui.secondaryPaneWidth`, `.
|
|
1057
|
+
| `dees-appui.secondaryPaneWidth`, `.asidePaneWidth` | whole CSS pixels | `setPaneWidth()`, or a reader settles a width on the pane's handle |
|
|
1048
1058
|
| `dees-appui.aside` | `"activity"`, `"assistant"` or `null` | a reader shows a tool or closes the side panel, as `aside-change` reports |
|
|
1049
1059
|
| `dees-appui.lastView` | `{ "viewId", "params", "query" }` | every activation while `restoreLastView` is set, the first screen's included, except the not-found view's |
|
|
1050
1060
|
| `dees-appui.trayTabs` | `[{ "key", "label", "iconName"?, "route": { "viewId", "params", "query" } }]` | every change of the tabs tray's tabs, by a reader or through the API |
|
|
1051
1061
|
|
|
1052
1062
|
- **Reading back.** `configure()` reads the layout keys and applies what they hold
|
|
1053
|
-
over what the configuration says: a stored width wins over `
|
|
1054
|
-
|
|
1063
|
+
over what the configuration says: a stored width wins over `asideWidth`, a
|
|
1064
|
+
stored side panel over `aside`. What an adapter answers
|
|
1055
1065
|
at once is in place when `configure()` returns, so the first render already shows
|
|
1056
1066
|
the reader's layout. A promise applies when it resolves, unless `configure()` ran
|
|
1057
1067
|
again or the key was written meanwhile; a menu restored that late folds with its
|
|
1058
1068
|
usual motion.
|
|
1069
|
+
- **Widths from before the side panel had one.** The shell asks for
|
|
1070
|
+
`.assistantPaneWidth` and `.activityPaneWidth`, which earlier versions wrote for
|
|
1071
|
+
each tool, together with `.asidePaneWidth`. While `.asidePaneWidth` holds
|
|
1072
|
+
nothing, it applies the first of them that holds a width and writes it under
|
|
1073
|
+
`.asidePaneWidth` once, which answers from then on. It never writes the old keys.
|
|
1059
1074
|
- **The last view** is read only when the address names no screen: a deep link
|
|
1060
1075
|
wins and the key is not even read. A promise is awaited inside the navigation
|
|
1061
1076
|
queue, so no screen and no menu row shows as current until it answers, and a
|
|
@@ -1063,7 +1078,8 @@ every value is JSON.
|
|
|
1063
1078
|
therefore settles every promise it returns. A stored route that no longer names a
|
|
1064
1079
|
screen — its view gone, a parameter missing, its `validateRoute` refusing — is
|
|
1065
1080
|
stale, not an error: the default view shows.
|
|
1066
|
-
- **What writes nothing:** `configure()`, restoring the layout
|
|
1081
|
+
- **What writes nothing:** `configure()`, restoring the layout (but for the one
|
|
1082
|
+
move of an old side panel width above), assigning a
|
|
1067
1083
|
property such as `mainmenuCollapsed` directly, a view's chrome starting over,
|
|
1068
1084
|
opening or closing a compact drawer, the widths a handle passes through before it
|
|
1069
1085
|
settles, and `setAside()`. The stored side panel is what a reader chose, so a
|
|
@@ -1284,10 +1300,10 @@ has the focus, and moves the focus into the content region.
|
|
|
1284
1300
|
loads; the message that stands in for a view that failed to load is a
|
|
1285
1301
|
`role="alert"`, so it is announced as it appears.
|
|
1286
1302
|
- Each resize handle is a focusable `separator` named "Resize section navigation",
|
|
1287
|
-
"Resize activity log" or "Resize
|
|
1288
|
-
|
|
1289
|
-
naming the pane — the side
|
|
1290
|
-
how to reset it.
|
|
1303
|
+
or after the tool the side panel shows, "Resize activity log" or "Resize
|
|
1304
|
+
assistant", with the pane's width and range in pixels as `aria-valuenow`,
|
|
1305
|
+
`aria-valuemin` and `aria-valuemax`, `aria-controls` naming the pane — the side
|
|
1306
|
+
panel, whichever tool it shows — and an `aria-description` saying how to reset it.
|
|
1291
1307
|
|
|
1292
1308
|
The names above are the English words; each comes from the catalog and can be a label (see [Labels](#labels)).
|
|
1293
1309
|
|
|
@@ -1786,11 +1802,11 @@ All interfaces are exported from `@design.estate/dees-catalog`:
|
|
|
1786
1802
|
- `IAppUser` - User configuration
|
|
1787
1803
|
- `IActivityEntry` - Activity log entry
|
|
1788
1804
|
- `IActivityLogAPI` - Activity log methods
|
|
1789
|
-
- `IActivityLogConfig` - Activity log configuration
|
|
1790
|
-
- `TAppuiPane` - A resizable pane: `'secondary' | 'activity'
|
|
1805
|
+
- `IActivityLogConfig` - Activity log configuration (`width` is deprecated: `asideWidth`)
|
|
1806
|
+
- `TAppuiPane` - A resizable pane: `'secondary' | 'aside'`; `'activity'` and `'assistant'` are deprecated names of `'aside'`
|
|
1791
1807
|
- `IPaneResizeEvent` - The detail of `pane-resize`: `{ pane, width }`
|
|
1792
1808
|
- `TAppuiAside` - A side panel tool: `'activity' | 'assistant'`
|
|
1793
|
-
- `IAppAssistantConfig` - The assistant: `content`, `iconName`, `
|
|
1809
|
+
- `IAppAssistantConfig` - The assistant: `content`, `iconName`, `shortcut`, `focus` (`width` is deprecated: `asideWidth`)
|
|
1794
1810
|
- `IAsideChangeEvent` - The detail of `aside-change`: `{ aside }`
|
|
1795
1811
|
- `IAsideToggleEvent` - The detail of the app bar's `aside-toggle`: `{ tool }`
|
|
1796
1812
|
- `IAppShellStorage` - The host's storage adapter: `read(key)` and `write(key, value)`, each at once or as a promise
|