@liberation-data/desk 0.38.0 → 0.39.1
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/README.md +3 -1
- package/dist/css/overlays.css +16 -0
- package/dist/css/windows.css +31 -7
- package/dist/desk.css +47 -7
- package/dist/react/overlays.d.ts.map +1 -1
- package/dist/react/overlays.js +1 -1
- package/dist/react/overlays.js.map +1 -1
- package/dist/react/split.d.ts +10 -5
- package/dist/react/split.d.ts.map +1 -1
- package/dist/react/split.js +26 -21
- package/dist/react/split.js.map +1 -1
- package/llms.txt +3 -2
- package/package.json +1 -1
- package/src/css/overlays.css +16 -0
- package/src/css/windows.css +31 -7
- package/src/react/overlays.tsx +2 -1
- package/src/react/split.tsx +39 -27
package/README.md
CHANGED
|
@@ -311,7 +311,9 @@ in this browser, so the section opens the way it was left.
|
|
|
311
311
|
|
|
312
312
|
`size` is where the side section starts (280px), `min` the narrowest it goes (200px), and `max` the most of
|
|
313
313
|
the window it may take, as CSS (`50%`), so a width remembered from a big screen still leaves room on a
|
|
314
|
-
small one. `at="end"` puts it on the right.
|
|
314
|
+
small one. `at="end"` puts it on the right. `orientation="vertical"` puts one above the other instead, such as an
|
|
315
|
+
editor over the results it runs: `at` is then the top or the bottom, the sizes are heights, and the edge moves up
|
|
316
|
+
and down. Dragging from one section to the other is the ordinary
|
|
315
317
|
`useDragSource` and `useDropTarget` (see [Dragging between windows](#dragging-between-windows)), which
|
|
316
318
|
works the same inside one window. The garage sample's Workshop window is Service beside Rides.
|
|
317
319
|
|
package/dist/css/overlays.css
CHANGED
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
|
|
37
37
|
.desk-sheet-scrim {
|
|
38
38
|
place-items: start center;
|
|
39
|
+
/* One row the height of the window, so a sheet can be held to it rather than run past its foot. */
|
|
40
|
+
grid-template-rows: minmax(0, 1fr);
|
|
39
41
|
padding: var(--desk-space-4);
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -67,9 +69,23 @@
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
.desk-sheet {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
max-height: 100%;
|
|
70
75
|
animation: desk-sheet-in .22s var(--desk-ease);
|
|
71
76
|
}
|
|
72
77
|
|
|
78
|
+
/*
|
|
79
|
+
* What the sheet asks, between its title and its buttons: scrolled when the window is too short for it. It reaches the
|
|
80
|
+
* sheet's edges, its padding in place of the sheet's, so a focus ring at a field's edge is not cut off by the scroll.
|
|
81
|
+
*/
|
|
82
|
+
.desk-sheet-body {
|
|
83
|
+
min-height: 0;
|
|
84
|
+
overflow-y: auto;
|
|
85
|
+
margin: 0 calc(-1 * var(--desk-space-4));
|
|
86
|
+
padding: 3px var(--desk-space-4);
|
|
87
|
+
}
|
|
88
|
+
|
|
73
89
|
.desk-alert {
|
|
74
90
|
width: min(380px, 100%);
|
|
75
91
|
text-align: center;
|
package/dist/css/windows.css
CHANGED
|
@@ -175,15 +175,15 @@
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
/* The note gives up the spare room; the (i) keeps its place at the end of the bar. */
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
.desk-window-info {
|
|
178
|
+
/*
|
|
179
|
+
* The (i) is the bar's last word, at its trailing end, with or without a note before it. It sits in its popover's
|
|
180
|
+
* anchor, so the anchor is what the bar lays out: a margin on the button inside it would move nothing.
|
|
181
|
+
*/
|
|
182
|
+
.desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
183
183
|
margin-left: auto;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
.desk-window-note ~ .desk-window-info {
|
|
186
|
+
.desk-window-note ~ .desk-popover-anchor:has(> .desk-window-info) {
|
|
187
187
|
margin-left: var(--desk-space-2);
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
.desk-window-progress-fill { transition: none; }
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
.desk-window-info + .desk-window-actions,
|
|
262
|
+
.desk-popover-anchor:has(> .desk-window-info) + .desk-window-actions,
|
|
263
263
|
.desk-window-note + .desk-window-actions {
|
|
264
264
|
margin-left: var(--desk-space-1);
|
|
265
265
|
}
|
|
@@ -414,6 +414,30 @@
|
|
|
414
414
|
grid-template-columns: minmax(0, 1fr) auto var(--desk-split-size);
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
+
/* One above the other: the same, in rows. */
|
|
418
|
+
.desk-split[data-orientation="vertical"] {
|
|
419
|
+
grid-template-columns: minmax(0, 1fr);
|
|
420
|
+
grid-template-rows: var(--desk-split-size) auto minmax(0, 1fr);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.desk-split[data-orientation="vertical"][data-at="end"] {
|
|
424
|
+
grid-template-rows: minmax(0, 1fr) auto var(--desk-split-size);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.desk-split[data-orientation="vertical"] > .desk-split-edge {
|
|
428
|
+
width: auto;
|
|
429
|
+
height: 1px;
|
|
430
|
+
cursor: row-resize;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.desk-split[data-orientation="vertical"] > .desk-split-edge::before {
|
|
434
|
+
inset: -6px 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.desk-split[data-orientation="vertical"][data-dragging] {
|
|
438
|
+
cursor: row-resize;
|
|
439
|
+
}
|
|
440
|
+
|
|
417
441
|
.desk-split[data-dragging] {
|
|
418
442
|
user-select: none;
|
|
419
443
|
cursor: col-resize;
|
package/dist/desk.css
CHANGED
|
@@ -328,15 +328,15 @@
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/* The note gives up the spare room; the (i) keeps its place at the end of the bar. */
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
.desk-window-info {
|
|
331
|
+
/*
|
|
332
|
+
* The (i) is the bar's last word, at its trailing end, with or without a note before it. It sits in its popover's
|
|
333
|
+
* anchor, so the anchor is what the bar lays out: a margin on the button inside it would move nothing.
|
|
334
|
+
*/
|
|
335
|
+
.desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
336
336
|
margin-left: auto;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
.desk-window-note ~ .desk-window-info {
|
|
339
|
+
.desk-window-note ~ .desk-popover-anchor:has(> .desk-window-info) {
|
|
340
340
|
margin-left: var(--desk-space-2);
|
|
341
341
|
}
|
|
342
342
|
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
.desk-window-progress-fill { transition: none; }
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
.desk-window-info + .desk-window-actions,
|
|
415
|
+
.desk-popover-anchor:has(> .desk-window-info) + .desk-window-actions,
|
|
416
416
|
.desk-window-note + .desk-window-actions {
|
|
417
417
|
margin-left: var(--desk-space-1);
|
|
418
418
|
}
|
|
@@ -567,6 +567,30 @@
|
|
|
567
567
|
grid-template-columns: minmax(0, 1fr) auto var(--desk-split-size);
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
+
/* One above the other: the same, in rows. */
|
|
571
|
+
.desk-split[data-orientation="vertical"] {
|
|
572
|
+
grid-template-columns: minmax(0, 1fr);
|
|
573
|
+
grid-template-rows: var(--desk-split-size) auto minmax(0, 1fr);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.desk-split[data-orientation="vertical"][data-at="end"] {
|
|
577
|
+
grid-template-rows: minmax(0, 1fr) auto var(--desk-split-size);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.desk-split[data-orientation="vertical"] > .desk-split-edge {
|
|
581
|
+
width: auto;
|
|
582
|
+
height: 1px;
|
|
583
|
+
cursor: row-resize;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.desk-split[data-orientation="vertical"] > .desk-split-edge::before {
|
|
587
|
+
inset: -6px 0;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.desk-split[data-orientation="vertical"][data-dragging] {
|
|
591
|
+
cursor: row-resize;
|
|
592
|
+
}
|
|
593
|
+
|
|
570
594
|
.desk-split[data-dragging] {
|
|
571
595
|
user-select: none;
|
|
572
596
|
cursor: col-resize;
|
|
@@ -3011,6 +3035,8 @@
|
|
|
3011
3035
|
|
|
3012
3036
|
.desk-sheet-scrim {
|
|
3013
3037
|
place-items: start center;
|
|
3038
|
+
/* One row the height of the window, so a sheet can be held to it rather than run past its foot. */
|
|
3039
|
+
grid-template-rows: minmax(0, 1fr);
|
|
3014
3040
|
padding: var(--desk-space-4);
|
|
3015
3041
|
}
|
|
3016
3042
|
|
|
@@ -3042,9 +3068,23 @@
|
|
|
3042
3068
|
}
|
|
3043
3069
|
|
|
3044
3070
|
.desk-sheet {
|
|
3071
|
+
display: flex;
|
|
3072
|
+
flex-direction: column;
|
|
3073
|
+
max-height: 100%;
|
|
3045
3074
|
animation: desk-sheet-in .22s var(--desk-ease);
|
|
3046
3075
|
}
|
|
3047
3076
|
|
|
3077
|
+
/*
|
|
3078
|
+
* What the sheet asks, between its title and its buttons: scrolled when the window is too short for it. It reaches the
|
|
3079
|
+
* sheet's edges, its padding in place of the sheet's, so a focus ring at a field's edge is not cut off by the scroll.
|
|
3080
|
+
*/
|
|
3081
|
+
.desk-sheet-body {
|
|
3082
|
+
min-height: 0;
|
|
3083
|
+
overflow-y: auto;
|
|
3084
|
+
margin: 0 calc(-1 * var(--desk-space-4));
|
|
3085
|
+
padding: 3px var(--desk-space-4);
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3048
3088
|
.desk-alert {
|
|
3049
3089
|
width: min(380px, 100%);
|
|
3050
3090
|
text-align: center;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlays.d.ts","sourceRoot":"","sources":["../../src/react/overlays.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,C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MAAM,IAAI,CAAA;KAAE,CAAA;IAC3E,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAErE,UAAU,QAAQ;IAChB,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAA;IACnC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAID,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAkB3E;AAED,wBAAgB,QAAQ,IAAI,QAAQ,CAInC"}
|
package/dist/react/overlays.js
CHANGED
|
@@ -99,7 +99,7 @@ export function Sheet({ open, onDismiss, title, description, actions, children }
|
|
|
99
99
|
useFocusTrap(panel, open && host !== null);
|
|
100
100
|
if (!open || !host)
|
|
101
101
|
return null;
|
|
102
|
-
return createPortal(_jsx("div", { className: "desk-sheet-scrim", children: _jsxs("div", { ref: panel, role: "dialog", "aria-modal": "true", "aria-labelledby": `${id}-title`, className: "desk-sheet", children: [_jsx("h2", { id: `${id}-title`, className: "desk-sheet-title", children: title }), description && _jsx("p", { className: "desk-sheet-description", children: description }), children, actions && _jsx("div", { className: "desk-sheet-actions", children: actions })] }) }), host);
|
|
102
|
+
return createPortal(_jsx("div", { className: "desk-sheet-scrim", children: _jsxs("div", { ref: panel, role: "dialog", "aria-modal": "true", "aria-labelledby": `${id}-title`, className: "desk-sheet", children: [_jsx("h2", { id: `${id}-title`, className: "desk-sheet-title", children: title }), description && _jsx("p", { className: "desk-sheet-description", children: description }), _jsx("div", { className: "desk-sheet-body", children: children }), actions && _jsx("div", { className: "desk-sheet-actions", children: actions })] }) }), host);
|
|
103
103
|
}
|
|
104
104
|
export function Alert({ open, title, message, confirmLabel, onConfirm, onCancel, cancelLabel = 'Cancel', destructive }) {
|
|
105
105
|
const id = useId();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlays.js","sourceRoot":"","sources":["../../src/react/overlays.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE5H,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AA+BtD,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO,EAAE,QAAQ,EAAgB;IAC1H,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAClB,MAAM,MAAM,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC1C,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7C,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAEzB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAE,EAAE;YAC5C,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AK,CAAC,MAAM,IAAI,CACf,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,MAAM,EAAC,OAAO,EACd,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAA;oBACxB,SAAS,EAAE,CAAA;gBACb,CAAC,YAEA,KAAK,CAAC,MAAM,CAAC,KAAK,GACZ,CACV,EACD,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,gBAAY,SAAS,EAAC,OAAO,EAAE,SAAS,uBAElE,IACL,CACP,CAAA;AACH,CAAC"}
|
package/dist/react/split.d.ts
CHANGED
|
@@ -4,22 +4,27 @@ export interface SplitProps {
|
|
|
4
4
|
readonly side: ReactNode;
|
|
5
5
|
/** The rest of the window: what the side panel chooses for. */
|
|
6
6
|
readonly children: ReactNode;
|
|
7
|
-
/** Which edge the side panel stands at. Default `start`. */
|
|
7
|
+
/** Which edge the side panel stands at: the left or right, or with `orientation="vertical"` the top or bottom. Default `start`. */
|
|
8
8
|
readonly at?: 'start' | 'end';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* `horizontal` (the default) puts the panels side by side; `vertical` puts one above the other, as an editor
|
|
11
|
+
* over what it runs. The sizes are then heights, and the edge between them moves up and down.
|
|
12
|
+
*/
|
|
13
|
+
readonly orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
/** The side panel's width, or height when vertical, in px, until it is dragged. Default 280. */
|
|
10
15
|
readonly size?: number;
|
|
11
16
|
/** The narrowest it can be dragged to. Default 200. */
|
|
12
17
|
readonly min?: number;
|
|
13
18
|
/**
|
|
14
|
-
* The most of the window it may take, as CSS: `50%` (the default), `420px`. A
|
|
19
|
+
* The most of the window it may take, as CSS: `50%` (the default), `420px`. A size remembered from
|
|
15
20
|
* a big screen never leaves a small one without room for the rest.
|
|
16
21
|
*/
|
|
17
22
|
readonly max?: string;
|
|
18
|
-
/** Remembers the
|
|
23
|
+
/** Remembers the size in this browser under this key, so the panel opens at the size it was left at. */
|
|
19
24
|
readonly remember?: string;
|
|
20
25
|
/** What the edge is called to assistive technology. Default "Resize". */
|
|
21
26
|
readonly label?: string;
|
|
22
27
|
readonly className?: string;
|
|
23
28
|
}
|
|
24
|
-
export declare function Split({ side, children, at, size, min, max, remember, label, className }: SplitProps): import("react").JSX.Element;
|
|
29
|
+
export declare function Split({ side, children, at, orientation, size, min, max, remember, label, className }: SplitProps): import("react").JSX.Element;
|
|
25
30
|
//# sourceMappingURL=split.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/react/split.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYvG,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,
|
|
1
|
+
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/react/split.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYvG,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,mIAAmI;IACnI,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAChD,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,uDAAuD;IACvD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,wGAAwG;IACxG,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AA2BD,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAY,EAAE,WAA0B,EAAE,IAAU,EAAE,GAAS,EAAE,GAAW,EAAE,QAAQ,EAAE,KAAgB,EAAE,SAAS,EAAE,EAAE,UAAU,+BA0GxK"}
|
package/dist/react/split.js
CHANGED
|
@@ -8,38 +8,41 @@ function recall(name, fallback, min) {
|
|
|
8
8
|
return fallback;
|
|
9
9
|
try {
|
|
10
10
|
const stored = Number(globalThis.localStorage?.getItem(key(name)));
|
|
11
|
-
// Storage is outside the program: anything that is not a usable
|
|
11
|
+
// Storage is outside the program: anything that is not a usable size is none.
|
|
12
12
|
return Number.isFinite(stored) && stored >= min ? stored : fallback;
|
|
13
13
|
}
|
|
14
14
|
catch {
|
|
15
15
|
return fallback;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
function keep(name,
|
|
18
|
+
function keep(name, extent) {
|
|
19
19
|
if (!name)
|
|
20
20
|
return;
|
|
21
21
|
try {
|
|
22
|
-
globalThis.localStorage?.setItem(key(name), String(
|
|
22
|
+
globalThis.localStorage?.setItem(key(name), String(extent));
|
|
23
23
|
}
|
|
24
24
|
catch {
|
|
25
25
|
// Private windows and full storage: the panel still resizes, it just opens at its default.
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
export function Split({ side, children, at = 'start', size = 280, min = 200, max = '50%', remember, label = 'Resize', className }) {
|
|
28
|
+
export function Split({ side, children, at = 'start', orientation = 'horizontal', size = 280, min = 200, max = '50%', remember, label = 'Resize', className }) {
|
|
29
|
+
const vertical = orientation === 'vertical';
|
|
30
|
+
const measure = (box) => (vertical ? box?.height : box?.width);
|
|
29
31
|
const initial = Math.max(min, size);
|
|
30
|
-
|
|
32
|
+
// The side panel's width, or its height when vertical.
|
|
33
|
+
const [extent, setExtent] = useState(() => recall(remember, initial, min));
|
|
31
34
|
const root = useRef(null);
|
|
32
35
|
const panel = useRef(null);
|
|
33
36
|
const length = (px) => `min(${px}px, ${max})`;
|
|
34
37
|
const commit = (next) => {
|
|
35
38
|
const clamped = Math.max(min, Math.round(next));
|
|
36
|
-
|
|
39
|
+
setExtent(clamped);
|
|
37
40
|
keep(remember, clamped);
|
|
38
41
|
};
|
|
39
42
|
/*
|
|
40
43
|
* While dragging, only the variable on this element changes, so the panels follow the pointer
|
|
41
|
-
* without re-rendering what is in them; the
|
|
42
|
-
* the
|
|
44
|
+
* without re-rendering what is in them; the size is committed once, on release. It starts from
|
|
45
|
+
* the size as drawn, which `max` may have capped, so the edge never lags behind the pointer.
|
|
43
46
|
*/
|
|
44
47
|
const startDrag = (event) => {
|
|
45
48
|
if (event.button !== 0)
|
|
@@ -47,15 +50,16 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
47
50
|
event.preventDefault();
|
|
48
51
|
const handle = event.currentTarget;
|
|
49
52
|
const element = root.current;
|
|
50
|
-
const origin = panel.current?.getBoundingClientRect()
|
|
51
|
-
const
|
|
53
|
+
const origin = measure(panel.current?.getBoundingClientRect()) ?? extent;
|
|
54
|
+
const start = vertical ? event.clientY : event.clientX;
|
|
52
55
|
let next = origin;
|
|
53
56
|
handle.setPointerCapture?.(event.pointerId);
|
|
54
57
|
if (element)
|
|
55
58
|
element.dataset.dragging = '';
|
|
56
59
|
const onMove = (move) => {
|
|
57
|
-
// Towards the middle is
|
|
58
|
-
const
|
|
60
|
+
// Towards the middle is bigger, whichever edge the panel is at.
|
|
61
|
+
const now = vertical ? move.clientY : move.clientX;
|
|
62
|
+
const pulled = at === 'start' ? now - start : start - now;
|
|
59
63
|
next = Math.max(min, origin + pulled);
|
|
60
64
|
element?.style.setProperty('--desk-split-size', length(next));
|
|
61
65
|
};
|
|
@@ -65,8 +69,8 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
65
69
|
handle.removeEventListener('pointercancel', onUp);
|
|
66
70
|
if (element)
|
|
67
71
|
delete element.dataset.dragging;
|
|
68
|
-
// Back to what React drew, so the commit is what draws the new
|
|
69
|
-
element?.style.setProperty('--desk-split-size', length(
|
|
72
|
+
// Back to what React drew, so the commit is what draws the new size, and a click draws nothing.
|
|
73
|
+
element?.style.setProperty('--desk-split-size', length(extent));
|
|
70
74
|
if (Math.round(next) !== Math.round(origin))
|
|
71
75
|
commit(next);
|
|
72
76
|
};
|
|
@@ -74,11 +78,12 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
74
78
|
handle.addEventListener('pointerup', onUp);
|
|
75
79
|
handle.addEventListener('pointercancel', onUp);
|
|
76
80
|
};
|
|
77
|
-
// The edge is a separator that can be focused, so the
|
|
81
|
+
// The edge is a separator that can be focused, so the size can be set without a pointer.
|
|
78
82
|
const onKeyDown = (event) => {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const
|
|
83
|
+
const [forward, back] = vertical ? ['ArrowDown', 'ArrowUp'] : ['ArrowRight', 'ArrowLeft'];
|
|
84
|
+
const wider = at === 'start' ? forward : back;
|
|
85
|
+
const narrower = at === 'start' ? back : forward;
|
|
86
|
+
const drawn = measure(panel.current?.getBoundingClientRect()) || extent;
|
|
82
87
|
if (event.key === wider)
|
|
83
88
|
commit(drawn + STEP);
|
|
84
89
|
else if (event.key === narrower)
|
|
@@ -92,10 +97,10 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
92
97
|
event.preventDefault();
|
|
93
98
|
};
|
|
94
99
|
const sidePanel = (_jsx("div", { ref: panel, className: "desk-split-panel", "data-side": "", children: side }, "side"));
|
|
95
|
-
const edge = (_jsx("div", { role: "separator", "aria-orientation":
|
|
96
|
-
// Back to the
|
|
100
|
+
const edge = (_jsx("div", { role: "separator", "aria-orientation": vertical ? 'horizontal' : 'vertical', "aria-label": label, "aria-valuenow": extent, "aria-valuemin": min, tabIndex: 0, className: "desk-split-edge", onPointerDown: startDrag, onKeyDown: onKeyDown,
|
|
101
|
+
// Back to the size it started at, as a double-click on a divider does on a Mac.
|
|
97
102
|
onDoubleClick: () => commit(initial) }, "edge"));
|
|
98
103
|
const main = (_jsx("div", { className: "desk-split-panel", children: children }, "main"));
|
|
99
|
-
return (_jsx("div", { ref: root, className: ['desk-split', className].filter(Boolean).join(' '), "data-at": at, style: { '--desk-split-size': length(
|
|
104
|
+
return (_jsx("div", { ref: root, className: ['desk-split', className].filter(Boolean).join(' '), "data-at": at, "data-orientation": orientation, style: { '--desk-split-size': length(extent) }, children: at === 'start' ? [sidePanel, edge, main] : [main, edge, sidePanel] }));
|
|
100
105
|
}
|
|
101
106
|
//# sourceMappingURL=split.js.map
|
package/dist/react/split.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split.js","sourceRoot":"","sources":["../../src/react/split.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"split.js","sourceRoot":"","sources":["../../src/react/split.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAyCxC,2CAA2C;AAC3C,MAAM,IAAI,GAAG,EAAE,CAAA;AAEf,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,cAAc,IAAI,EAAE,CAAA;AAElD,SAAS,MAAM,CAAC,IAAwB,EAAE,QAAgB,EAAE,GAAW;IACrE,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAA;IAC1B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAA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,CAAA;IACD,MAAM,IAAI,GAAG,CACX,cAAgB,SAAS,EAAC,kBAAkB,YACzC,QAAQ,IADF,MAAM,CAET,CACP,CAAA;IAED,OAAO,CACL,cACE,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aACrD,EAAE,sBACO,WAAW,EAC7B,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,EAAmB,YAG9D,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,GAC/D,CACP,CAAA;AACH,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -299,10 +299,11 @@ window; `lazyWindow` retries its import on reload, unlike `React.lazy`, which ca
|
|
|
299
299
|
<PaneHeader title={ReactNode} actions?={ReactNode} /> // the pane's title and its Refresh, on one row
|
|
300
300
|
<Section title={ReactNode} actions?={ReactNode}>{content}</Section> // a titled group inside a pane
|
|
301
301
|
<Toolbar label?={string} trailing?={ReactNode}>{controls}</Toolbar> // className="desk-grow" takes spare room
|
|
302
|
-
<Split side={ReactNode} at?={'start'|'end'} size?={280} min?={200} max?={'50%'} remember?={key} label?={string}>{rest}</Split>
|
|
302
|
+
<Split side={ReactNode} at?={'start'|'end'} orientation?={'horizontal'|'vertical'} size?={280} min?={200} max?={'50%'} remember?={key} label?={string}>{rest}</Split>
|
|
303
303
|
// two sections of one app in one window, with a draggable edge between them (arrow keys, Home, Enter or
|
|
304
304
|
// double-click to reset); remember keeps the width in localStorage. Drag and drop between the sections is
|
|
305
|
-
// useDragSource/useDropTarget as anywhere else.
|
|
305
|
+
// useDragSource/useDropTarget as anywhere else. orientation="vertical" stacks them (at=start is the top) and
|
|
306
|
+
// the sizes are heights: an editor over what it runs. One app, one window: use this, not two windows side by side.
|
|
306
307
|
<Page label?={string} fill?>{long text}</Page> // a sheet for text read at length, on --desk-page; fill = at least the room's height
|
|
307
308
|
// --desk-page-tint (4% light, 5% dark) is how much --desk-accent is mixed into the page; 0% for the neutral alone.
|
|
308
309
|
// text size by class, never px: desk-text-body | desk-text-small | desk-text-caption, plus desk-text-muted.
|
package/package.json
CHANGED
package/src/css/overlays.css
CHANGED
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
|
|
36
36
|
.desk-sheet-scrim {
|
|
37
37
|
place-items: start center;
|
|
38
|
+
/* One row the height of the window, so a sheet can be held to it rather than run past its foot. */
|
|
39
|
+
grid-template-rows: minmax(0, 1fr);
|
|
38
40
|
padding: var(--desk-space-4);
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -66,9 +68,23 @@
|
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
.desk-sheet {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
max-height: 100%;
|
|
69
74
|
animation: desk-sheet-in .22s var(--desk-ease);
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
/*
|
|
78
|
+
* What the sheet asks, between its title and its buttons: scrolled when the window is too short for it. It reaches the
|
|
79
|
+
* sheet's edges, its padding in place of the sheet's, so a focus ring at a field's edge is not cut off by the scroll.
|
|
80
|
+
*/
|
|
81
|
+
.desk-sheet-body {
|
|
82
|
+
min-height: 0;
|
|
83
|
+
overflow-y: auto;
|
|
84
|
+
margin: 0 calc(-1 * var(--desk-space-4));
|
|
85
|
+
padding: 3px var(--desk-space-4);
|
|
86
|
+
}
|
|
87
|
+
|
|
72
88
|
.desk-alert {
|
|
73
89
|
width: min(380px, 100%);
|
|
74
90
|
text-align: center;
|
package/src/css/windows.css
CHANGED
|
@@ -174,15 +174,15 @@
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
/* The note gives up the spare room; the (i) keeps its place at the end of the bar. */
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
.desk-window-info {
|
|
177
|
+
/*
|
|
178
|
+
* The (i) is the bar's last word, at its trailing end, with or without a note before it. It sits in its popover's
|
|
179
|
+
* anchor, so the anchor is what the bar lays out: a margin on the button inside it would move nothing.
|
|
180
|
+
*/
|
|
181
|
+
.desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
182
182
|
margin-left: auto;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.desk-window-note ~ .desk-window-info {
|
|
185
|
+
.desk-window-note ~ .desk-popover-anchor:has(> .desk-window-info) {
|
|
186
186
|
margin-left: var(--desk-space-2);
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
.desk-window-progress-fill { transition: none; }
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
.desk-window-info + .desk-window-actions,
|
|
261
|
+
.desk-popover-anchor:has(> .desk-window-info) + .desk-window-actions,
|
|
262
262
|
.desk-window-note + .desk-window-actions {
|
|
263
263
|
margin-left: var(--desk-space-1);
|
|
264
264
|
}
|
|
@@ -413,6 +413,30 @@
|
|
|
413
413
|
grid-template-columns: minmax(0, 1fr) auto var(--desk-split-size);
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
/* One above the other: the same, in rows. */
|
|
417
|
+
.desk-split[data-orientation="vertical"] {
|
|
418
|
+
grid-template-columns: minmax(0, 1fr);
|
|
419
|
+
grid-template-rows: var(--desk-split-size) auto minmax(0, 1fr);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.desk-split[data-orientation="vertical"][data-at="end"] {
|
|
423
|
+
grid-template-rows: minmax(0, 1fr) auto var(--desk-split-size);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.desk-split[data-orientation="vertical"] > .desk-split-edge {
|
|
427
|
+
width: auto;
|
|
428
|
+
height: 1px;
|
|
429
|
+
cursor: row-resize;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.desk-split[data-orientation="vertical"] > .desk-split-edge::before {
|
|
433
|
+
inset: -6px 0;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.desk-split[data-orientation="vertical"][data-dragging] {
|
|
437
|
+
cursor: row-resize;
|
|
438
|
+
}
|
|
439
|
+
|
|
416
440
|
.desk-split[data-dragging] {
|
|
417
441
|
user-select: none;
|
|
418
442
|
cursor: col-resize;
|
package/src/react/overlays.tsx
CHANGED
|
@@ -158,7 +158,8 @@ export function Sheet({ open, onDismiss, title, description, actions, children }
|
|
|
158
158
|
<div ref={panel} role="dialog" aria-modal="true" aria-labelledby={`${id}-title`} className="desk-sheet">
|
|
159
159
|
<h2 id={`${id}-title`} className="desk-sheet-title">{title}</h2>
|
|
160
160
|
{description && <p className="desk-sheet-description">{description}</p>}
|
|
161
|
-
{
|
|
161
|
+
{/* Only this scrolls, so a sheet taller than its window keeps its title and its buttons in sight. */}
|
|
162
|
+
<div className="desk-sheet-body">{children}</div>
|
|
162
163
|
{actions && <div className="desk-sheet-actions">{actions}</div>}
|
|
163
164
|
</div>
|
|
164
165
|
</div>,
|
package/src/react/split.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import type { CSSProperties, KeyboardEvent, PointerEvent as ReactPointerEvent, R
|
|
|
7
7
|
*
|
|
8
8
|
* They are one app, so they are one window: they open, close, minimize and move together, and
|
|
9
9
|
* nothing can pull them apart. Only the edge between them moves, and it is remembered, so the side
|
|
10
|
-
* panel opens at the
|
|
10
|
+
* panel opens at the size it was left at. Dragging things from one panel to the other is the
|
|
11
11
|
* ordinary drag and drop (`useDragSource`, `useDropTarget`), which does not care where its ends are.
|
|
12
12
|
*/
|
|
13
13
|
|
|
@@ -16,18 +16,23 @@ export interface SplitProps {
|
|
|
16
16
|
readonly side: ReactNode
|
|
17
17
|
/** The rest of the window: what the side panel chooses for. */
|
|
18
18
|
readonly children: ReactNode
|
|
19
|
-
/** Which edge the side panel stands at. Default `start`. */
|
|
19
|
+
/** Which edge the side panel stands at: the left or right, or with `orientation="vertical"` the top or bottom. Default `start`. */
|
|
20
20
|
readonly at?: 'start' | 'end'
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* `horizontal` (the default) puts the panels side by side; `vertical` puts one above the other, as an editor
|
|
23
|
+
* over what it runs. The sizes are then heights, and the edge between them moves up and down.
|
|
24
|
+
*/
|
|
25
|
+
readonly orientation?: 'horizontal' | 'vertical'
|
|
26
|
+
/** The side panel's width, or height when vertical, in px, until it is dragged. Default 280. */
|
|
22
27
|
readonly size?: number
|
|
23
28
|
/** The narrowest it can be dragged to. Default 200. */
|
|
24
29
|
readonly min?: number
|
|
25
30
|
/**
|
|
26
|
-
* The most of the window it may take, as CSS: `50%` (the default), `420px`. A
|
|
31
|
+
* The most of the window it may take, as CSS: `50%` (the default), `420px`. A size remembered from
|
|
27
32
|
* a big screen never leaves a small one without room for the rest.
|
|
28
33
|
*/
|
|
29
34
|
readonly max?: string
|
|
30
|
-
/** Remembers the
|
|
35
|
+
/** Remembers the size in this browser under this key, so the panel opens at the size it was left at. */
|
|
31
36
|
readonly remember?: string
|
|
32
37
|
/** What the edge is called to assistive technology. Default "Resize". */
|
|
33
38
|
readonly label?: string
|
|
@@ -43,53 +48,57 @@ function recall(name: string | undefined, fallback: number, min: number): number
|
|
|
43
48
|
if (!name) return fallback
|
|
44
49
|
try {
|
|
45
50
|
const stored = Number(globalThis.localStorage?.getItem(key(name)))
|
|
46
|
-
// Storage is outside the program: anything that is not a usable
|
|
51
|
+
// Storage is outside the program: anything that is not a usable size is none.
|
|
47
52
|
return Number.isFinite(stored) && stored >= min ? stored : fallback
|
|
48
53
|
} catch {
|
|
49
54
|
return fallback
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
function keep(name: string | undefined,
|
|
58
|
+
function keep(name: string | undefined, extent: number) {
|
|
54
59
|
if (!name) return
|
|
55
60
|
try {
|
|
56
|
-
globalThis.localStorage?.setItem(key(name), String(
|
|
61
|
+
globalThis.localStorage?.setItem(key(name), String(extent))
|
|
57
62
|
} catch {
|
|
58
63
|
// Private windows and full storage: the panel still resizes, it just opens at its default.
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
export function Split({ side, children, at = 'start', size = 280, min = 200, max = '50%', remember, label = 'Resize', className }: SplitProps) {
|
|
67
|
+
export function Split({ side, children, at = 'start', orientation = 'horizontal', size = 280, min = 200, max = '50%', remember, label = 'Resize', className }: SplitProps) {
|
|
68
|
+
const vertical = orientation === 'vertical'
|
|
69
|
+
const measure = (box: DOMRect | undefined) => (vertical ? box?.height : box?.width)
|
|
63
70
|
const initial = Math.max(min, size)
|
|
64
|
-
|
|
71
|
+
// The side panel's width, or its height when vertical.
|
|
72
|
+
const [extent, setExtent] = useState(() => recall(remember, initial, min))
|
|
65
73
|
const root = useRef<HTMLDivElement>(null)
|
|
66
74
|
const panel = useRef<HTMLDivElement>(null)
|
|
67
75
|
const length = (px: number) => `min(${px}px, ${max})`
|
|
68
76
|
|
|
69
77
|
const commit = (next: number) => {
|
|
70
78
|
const clamped = Math.max(min, Math.round(next))
|
|
71
|
-
|
|
79
|
+
setExtent(clamped)
|
|
72
80
|
keep(remember, clamped)
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
/*
|
|
76
84
|
* While dragging, only the variable on this element changes, so the panels follow the pointer
|
|
77
|
-
* without re-rendering what is in them; the
|
|
78
|
-
* the
|
|
85
|
+
* without re-rendering what is in them; the size is committed once, on release. It starts from
|
|
86
|
+
* the size as drawn, which `max` may have capped, so the edge never lags behind the pointer.
|
|
79
87
|
*/
|
|
80
88
|
const startDrag = (event: ReactPointerEvent<HTMLDivElement>) => {
|
|
81
89
|
if (event.button !== 0) return
|
|
82
90
|
event.preventDefault()
|
|
83
91
|
const handle = event.currentTarget
|
|
84
92
|
const element = root.current
|
|
85
|
-
const origin = panel.current?.getBoundingClientRect()
|
|
86
|
-
const
|
|
93
|
+
const origin = measure(panel.current?.getBoundingClientRect()) ?? extent
|
|
94
|
+
const start = vertical ? event.clientY : event.clientX
|
|
87
95
|
let next = origin
|
|
88
96
|
handle.setPointerCapture?.(event.pointerId)
|
|
89
97
|
if (element) element.dataset.dragging = ''
|
|
90
98
|
const onMove = (move: PointerEvent) => {
|
|
91
|
-
// Towards the middle is
|
|
92
|
-
const
|
|
99
|
+
// Towards the middle is bigger, whichever edge the panel is at.
|
|
100
|
+
const now = vertical ? move.clientY : move.clientX
|
|
101
|
+
const pulled = at === 'start' ? now - start : start - now
|
|
93
102
|
next = Math.max(min, origin + pulled)
|
|
94
103
|
element?.style.setProperty('--desk-split-size', length(next))
|
|
95
104
|
}
|
|
@@ -98,8 +107,8 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
98
107
|
handle.removeEventListener('pointerup', onUp)
|
|
99
108
|
handle.removeEventListener('pointercancel', onUp)
|
|
100
109
|
if (element) delete element.dataset.dragging
|
|
101
|
-
// Back to what React drew, so the commit is what draws the new
|
|
102
|
-
element?.style.setProperty('--desk-split-size', length(
|
|
110
|
+
// Back to what React drew, so the commit is what draws the new size, and a click draws nothing.
|
|
111
|
+
element?.style.setProperty('--desk-split-size', length(extent))
|
|
103
112
|
if (Math.round(next) !== Math.round(origin)) commit(next)
|
|
104
113
|
}
|
|
105
114
|
handle.addEventListener('pointermove', onMove)
|
|
@@ -107,11 +116,12 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
107
116
|
handle.addEventListener('pointercancel', onUp)
|
|
108
117
|
}
|
|
109
118
|
|
|
110
|
-
// The edge is a separator that can be focused, so the
|
|
119
|
+
// The edge is a separator that can be focused, so the size can be set without a pointer.
|
|
111
120
|
const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
|
|
112
|
-
const
|
|
113
|
-
const
|
|
114
|
-
const
|
|
121
|
+
const [forward, back] = vertical ? ['ArrowDown', 'ArrowUp'] : ['ArrowRight', 'ArrowLeft']
|
|
122
|
+
const wider = at === 'start' ? forward : back
|
|
123
|
+
const narrower = at === 'start' ? back : forward
|
|
124
|
+
const drawn = measure(panel.current?.getBoundingClientRect()) || extent
|
|
115
125
|
if (event.key === wider) commit(drawn + STEP)
|
|
116
126
|
else if (event.key === narrower) commit(drawn - STEP)
|
|
117
127
|
else if (event.key === 'Home') commit(min)
|
|
@@ -129,15 +139,16 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
129
139
|
<div
|
|
130
140
|
key="edge"
|
|
131
141
|
role="separator"
|
|
132
|
-
|
|
142
|
+
// The edge runs across the way the panels are laid out: a vertical edge between panels side by side.
|
|
143
|
+
aria-orientation={vertical ? 'horizontal' : 'vertical'}
|
|
133
144
|
aria-label={label}
|
|
134
|
-
aria-valuenow={
|
|
145
|
+
aria-valuenow={extent}
|
|
135
146
|
aria-valuemin={min}
|
|
136
147
|
tabIndex={0}
|
|
137
148
|
className="desk-split-edge"
|
|
138
149
|
onPointerDown={startDrag}
|
|
139
150
|
onKeyDown={onKeyDown}
|
|
140
|
-
// Back to the
|
|
151
|
+
// Back to the size it started at, as a double-click on a divider does on a Mac.
|
|
141
152
|
onDoubleClick={() => commit(initial)}
|
|
142
153
|
/>
|
|
143
154
|
)
|
|
@@ -152,7 +163,8 @@ export function Split({ side, children, at = 'start', size = 280, min = 200, max
|
|
|
152
163
|
ref={root}
|
|
153
164
|
className={['desk-split', className].filter(Boolean).join(' ')}
|
|
154
165
|
data-at={at}
|
|
155
|
-
|
|
166
|
+
data-orientation={orientation}
|
|
167
|
+
style={{ '--desk-split-size': length(extent) } as CSSProperties}
|
|
156
168
|
>
|
|
157
169
|
{/* In reading order, so Tab walks the panels the way they are drawn. */}
|
|
158
170
|
{at === 'start' ? [sidePanel, edge, main] : [main, edge, sidePanel]}
|