@liberation-data/desk 0.42.0 → 0.43.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/README.md +95 -5
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/scheme.d.ts +12 -0
- package/dist/core/scheme.d.ts.map +1 -0
- package/dist/core/scheme.js +15 -0
- package/dist/core/scheme.js.map +1 -0
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/css/apps.css +149 -0
- package/dist/css/overlays.css +6 -0
- package/dist/css/windows.css +21 -0
- package/dist/desk.css +176 -0
- package/dist/react/Desktop.d.ts.map +1 -1
- package/dist/react/Desktop.js +13 -2
- package/dist/react/Desktop.js.map +1 -1
- package/dist/react/Dock.d.ts +6 -1
- package/dist/react/Dock.d.ts.map +1 -1
- package/dist/react/Dock.js +9 -1
- package/dist/react/Dock.js.map +1 -1
- package/dist/react/MenuBar.d.ts +1 -1
- package/dist/react/MenuBar.d.ts.map +1 -1
- package/dist/react/MenuBar.js +19 -5
- package/dist/react/MenuBar.js.map +1 -1
- package/dist/react/app.d.ts +174 -0
- package/dist/react/app.d.ts.map +1 -0
- package/dist/react/app.js +146 -0
- package/dist/react/app.js.map +1 -0
- package/dist/react/appPanels.d.ts +22 -0
- package/dist/react/appPanels.d.ts.map +1 -0
- package/dist/react/appPanels.js +114 -0
- package/dist/react/appPanels.js.map +1 -0
- package/dist/react/appearance.d.ts +55 -0
- package/dist/react/appearance.d.ts.map +1 -0
- package/dist/react/appearance.js +140 -0
- package/dist/react/appearance.js.map +1 -0
- package/dist/react/codeBlock.d.ts.map +1 -1
- package/dist/react/codeBlock.js +6 -60
- package/dist/react/codeBlock.js.map +1 -1
- package/dist/react/context.d.ts +9 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +47 -3
- package/dist/react/context.js.map +1 -1
- package/dist/react/copy.d.ts +22 -0
- package/dist/react/copy.d.ts.map +1 -0
- package/dist/react/copy.js +68 -0
- package/dist/react/copy.js.map +1 -0
- package/dist/react/documentTitle.d.ts.map +1 -1
- package/dist/react/documentTitle.js +4 -1
- package/dist/react/documentTitle.js.map +1 -1
- package/dist/react/index.d.ts +7 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +5 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/layers.d.ts.map +1 -1
- package/dist/react/layers.js +7 -2
- package/dist/react/layers.js.map +1 -1
- package/dist/react/overlays.d.ts.map +1 -1
- package/dist/react/overlays.js +29 -12
- package/dist/react/overlays.js.map +1 -1
- package/dist/react/shell.d.ts +4 -1
- package/dist/react/shell.d.ts.map +1 -1
- package/dist/react/shell.js +2 -2
- package/dist/react/shell.js.map +1 -1
- package/llms.txt +46 -5
- package/package.json +1 -1
- package/src/core/index.ts +2 -0
- package/src/core/scheme.ts +21 -0
- package/src/core/types.ts +6 -0
- package/src/css/apps.css +149 -0
- package/src/css/overlays.css +6 -0
- package/src/css/windows.css +21 -0
- package/src/react/Desktop.tsx +21 -3
- package/src/react/Dock.tsx +11 -1
- package/src/react/MenuBar.tsx +20 -5
- package/src/react/app.tsx +284 -0
- package/src/react/appPanels.tsx +197 -0
- package/src/react/appearance.tsx +204 -0
- package/src/react/codeBlock.tsx +7 -65
- package/src/react/context.tsx +55 -3
- package/src/react/copy.ts +81 -0
- package/src/react/documentTitle.ts +4 -1
- package/src/react/index.ts +27 -0
- package/src/react/layers.ts +7 -2
- package/src/react/overlays.tsx +30 -12
- package/src/react/shell.tsx +5 -2
package/dist/react/overlays.js
CHANGED
|
@@ -29,19 +29,31 @@ export function Popover({ open, onOpenChange, label, trigger, placement = 'below
|
|
|
29
29
|
if (anchor && element)
|
|
30
30
|
placePopover(anchor, element, placement, align);
|
|
31
31
|
}, [placement, align]);
|
|
32
|
-
// Measured once it exists, then kept beside its control while anything under it scrolls
|
|
32
|
+
// Measured once it exists, then kept beside its control while anything under it scrolls, and placed again
|
|
33
|
+
// when what it shows changes size: content that grows after opening (a live note) still fits, or scrolls.
|
|
33
34
|
useLayoutEffect(() => {
|
|
34
35
|
if (!open)
|
|
35
36
|
return;
|
|
36
37
|
place();
|
|
38
|
+
// Scrolling under it moves its control, so it follows. Its own scrolling doesn't: placing it again then would
|
|
39
|
+
// lose where it was scrolled to (see placePopover), so a popover that scrolls could never be scrolled.
|
|
40
|
+
const onScroll = (event) => {
|
|
41
|
+
if (!panel.current?.contains(event.target))
|
|
42
|
+
place();
|
|
43
|
+
};
|
|
37
44
|
addEventListener('resize', place);
|
|
38
|
-
document.addEventListener('scroll',
|
|
45
|
+
document.addEventListener('scroll', onScroll, true);
|
|
46
|
+
const content = panel.current?.firstElementChild;
|
|
47
|
+
const observer = typeof ResizeObserver === 'undefined' || !content ? null : new ResizeObserver(() => place());
|
|
48
|
+
if (observer && content)
|
|
49
|
+
observer.observe(content);
|
|
39
50
|
return () => {
|
|
40
51
|
removeEventListener('resize', place);
|
|
41
|
-
document.removeEventListener('scroll',
|
|
52
|
+
document.removeEventListener('scroll', onScroll, true);
|
|
53
|
+
observer?.disconnect();
|
|
42
54
|
};
|
|
43
55
|
}, [open, place]);
|
|
44
|
-
return (_jsxs("span", { className: "desk-popover-anchor", children: [trigger({ ref: button, 'aria-haspopup': 'dialog', 'aria-expanded': open, onClick: () => onOpenChange(!open) }), open && typeof document !== 'undefined' && createPortal(_jsx("div", { ref: panel, role: "dialog", "aria-label": label, className: "desk-popover", "data-placement": placement, "data-align": align, children: children }), document.body)] }));
|
|
56
|
+
return (_jsxs("span", { className: "desk-popover-anchor", children: [trigger({ ref: button, 'aria-haspopup': 'dialog', 'aria-expanded': open, onClick: () => onOpenChange(!open) }), open && typeof document !== 'undefined' && createPortal(_jsx("div", { ref: panel, role: "dialog", "aria-label": label, className: "desk-popover", "data-placement": placement, "data-align": align, tabIndex: -1, children: _jsx("div", { className: "desk-popover-content", children: children }) }), document.body)] }));
|
|
45
57
|
}
|
|
46
58
|
const POPOVER_GAP = 6;
|
|
47
59
|
const POPOVER_MARGIN = 8;
|
|
@@ -49,18 +61,22 @@ const POPOVER_MARGIN = 8;
|
|
|
49
61
|
* A popover floats OVER its window rather than inside it. Drawn in the window's content it made that
|
|
50
62
|
* content taller or wider, so opening an (i) grew a scrollbar or pushed the layout — the window
|
|
51
63
|
* changed size to make room for a note about it. Here it is fixed to the viewport, kept inside the
|
|
52
|
-
* window it belongs to
|
|
53
|
-
*
|
|
64
|
+
* window it belongs to and inside the viewport (a window can reach past the screen's foot), flipped to
|
|
65
|
+
* the other side when its side has no room, and held to the room its side has: what doesn't fit scrolls
|
|
66
|
+
* within it, never off the screen.
|
|
54
67
|
*/
|
|
55
68
|
function placePopover(anchor, element, placement, align) {
|
|
56
69
|
const box = anchor.getBoundingClientRect();
|
|
57
70
|
const frame = anchor.closest(`[${WINDOW_ATTRIBUTE}]`)?.getBoundingClientRect();
|
|
58
71
|
const bounds = {
|
|
59
|
-
left: (frame?.left ?? 0) + POPOVER_MARGIN,
|
|
60
|
-
top: (frame?.top ?? 0) + POPOVER_MARGIN,
|
|
61
|
-
right: (frame?.right ?? innerWidth) - POPOVER_MARGIN,
|
|
62
|
-
bottom: (frame?.bottom ?? innerHeight) - POPOVER_MARGIN,
|
|
72
|
+
left: Math.max(frame?.left ?? 0, 0) + POPOVER_MARGIN,
|
|
73
|
+
top: Math.max(frame?.top ?? 0, 0) + POPOVER_MARGIN,
|
|
74
|
+
right: Math.min(frame?.right ?? innerWidth, innerWidth) - POPOVER_MARGIN,
|
|
75
|
+
bottom: Math.min(frame?.bottom ?? innerHeight, innerHeight) - POPOVER_MARGIN,
|
|
63
76
|
};
|
|
77
|
+
// Measured at its full height, which means letting go of its limit for a moment: that would reset where it is
|
|
78
|
+
// scrolled to, so that is kept and given back.
|
|
79
|
+
const scrolled = element.scrollTop;
|
|
64
80
|
element.style.maxHeight = '';
|
|
65
81
|
const { width, height } = element.getBoundingClientRect();
|
|
66
82
|
const roomBelow = bounds.bottom - box.bottom - POPOVER_GAP;
|
|
@@ -75,8 +91,9 @@ function placePopover(anchor, element, placement, align) {
|
|
|
75
91
|
const left = Math.max(bounds.left, Math.min(preferred, bounds.right - width));
|
|
76
92
|
element.style.left = `${left}px`;
|
|
77
93
|
element.style.top = `${below ? box.bottom + POPOVER_GAP : box.top - POPOVER_GAP - shown}px`;
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
// Always held to its room, not only when it overflows now: content that grows later scrolls inside it.
|
|
95
|
+
element.style.maxHeight = `${room}px`;
|
|
96
|
+
element.scrollTop = scrolled;
|
|
80
97
|
element.dataset.side = side;
|
|
81
98
|
}
|
|
82
99
|
export function Sheet({ open, onDismiss, title, description, actions, children }) {
|
|
@@ -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,K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package/dist/react/shell.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Desk } from '../core/desk.js';
|
|
|
3
3
|
import type { Bus } from '../core/events.js';
|
|
4
4
|
import type { LookChoice } from '../core/look.js';
|
|
5
5
|
import type { Holdable } from '../core/services.js';
|
|
6
|
+
import type { DeskApp } from './app.js';
|
|
6
7
|
import type { DeskOptions } from '../core/types.js';
|
|
7
8
|
export interface DeskShellProps {
|
|
8
9
|
/** An existing desk. One is made from `options` when this is left out. */
|
|
@@ -16,8 +17,10 @@ export interface DeskShellProps {
|
|
|
16
17
|
readonly look?: LookChoice;
|
|
17
18
|
/** What the desk keeps going while it is on screen. See `DeskProviderProps.services`. */
|
|
18
19
|
readonly services?: readonly Holdable[];
|
|
20
|
+
/** What the app says about itself, for its About and its Settings. See `DeskProviderProps.app`. */
|
|
21
|
+
readonly app?: DeskApp;
|
|
19
22
|
readonly children: ReactNode;
|
|
20
23
|
}
|
|
21
24
|
/** Everything an app needs around it, in one component: the desk, its bus, and toasts. */
|
|
22
|
-
export declare function DeskShell({ desk, options, bus, toasts, look, services, children }: DeskShellProps): import("react").JSX.Element;
|
|
25
|
+
export declare function DeskShell({ desk, options, bus, toasts, look, services, app, children }: DeskShellProps): import("react").JSX.Element;
|
|
23
26
|
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/react/shell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAA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AAE,WAAW,CAAA;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAA;IAClB,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,kGAAkG;IAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAA;IAC1B,yFAAyF;IACzF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;IACvC,mGAAmG;IACnG,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B;AAED,0FAA0F;AAC1F,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAa,EAAE,IAAa,EAAE,QAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAI3H"}
|
package/dist/react/shell.js
CHANGED
|
@@ -5,9 +5,9 @@ import { DeskProvider } from './context.js';
|
|
|
5
5
|
import { BusProvider } from './events.js';
|
|
6
6
|
import { ToastProvider } from './overlays.js';
|
|
7
7
|
/** Everything an app needs around it, in one component: the desk, its bus, and toasts. */
|
|
8
|
-
export function DeskShell({ desk, options, bus, toasts = true, look = 'auto', services = [], children }) {
|
|
8
|
+
export function DeskShell({ desk, options, bus, toasts = true, look = 'auto', services = [], app, children }) {
|
|
9
9
|
const [made] = useState(() => desk ?? createDesk(options));
|
|
10
10
|
const inner = toasts ? _jsx(ToastProvider, { children: children }) : children;
|
|
11
|
-
return _jsx(DeskProvider, { desk: made, look: look, services: services, children: bus ? _jsx(BusProvider, { bus: bus, children: inner }) : inner });
|
|
11
|
+
return _jsx(DeskProvider, { desk: made, look: look, services: services, ...(app ? { app } : {}), children: bus ? _jsx(BusProvider, { bus: bus, children: inner }) : inner });
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=shell.js.map
|
package/dist/react/shell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/react/shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/react/shell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAO5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAmB7C,0FAA0F;AAC1F,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAkB;IAC1H,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAA;IAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,KAAC,aAAa,cAAE,QAAQ,GAAiB,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC3E,OAAO,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YAAG,GAAG,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,GAAG,EAAE,GAAG,YAAG,KAAK,GAAe,CAAC,CAAC,CAAC,KAAK,GAAgB,CAAA;AACxK,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -177,6 +177,7 @@ formatShortcut('mod+comma', apple?): string // '⌘,' or 'Ctrl+,'
|
|
|
177
177
|
isApplePlatform(): boolean // the KEYBOARD; the look is separate
|
|
178
178
|
deviceLook(): Look // 'mac' | 'gnome' | 'windows' for this device
|
|
179
179
|
lookFor(platform, userAgent): Look // the same, pure; resolveLook('auto' | Look): Look
|
|
180
|
+
COLOR_SCHEME_KEY; LOOK_KEY; COLOR_SCHEME_SCRIPT // Appearance's storage keys and <head> script; see Settings and About
|
|
180
181
|
isInstalledApp(): boolean // gate ⌘W / ⌘` on this; never take ⌘T or ⌘N
|
|
181
182
|
titleCase('ride card'): string // 'Ride Card' — app and window names; a document keeps its own name
|
|
182
183
|
isTitleCase(name): boolean // for a test over the names an app defines
|
|
@@ -253,8 +254,8 @@ watchAttention(desk, id, onAttended): () => void // at once if attended, the
|
|
|
253
254
|
### Shell
|
|
254
255
|
|
|
255
256
|
```tsx
|
|
256
|
-
<DeskShell desk?={Desk} options?={DeskOptions} bus?={Bus} toasts?={true} look?={'auto'} services?={Service[]}>
|
|
257
|
-
<DeskProvider desk={desk} look?={'auto'} services?={Service[]}> // or options={…} to make one
|
|
257
|
+
<DeskShell desk?={Desk} options?={DeskOptions} bus?={Bus} toasts?={true} look?={'auto'} services?={Service[]} app?={DeskApp}> // app: see Settings and About
|
|
258
|
+
<DeskProvider desk={desk} look?={'auto'} services?={Service[]} app?={DeskApp}> // or options={…} to make one
|
|
258
259
|
useDesk(): Desk
|
|
259
260
|
useLook(): 'mac' | 'gnome' | 'windows' // resolved; the device's outside a desk
|
|
260
261
|
useDeskState(): DeskState
|
|
@@ -269,8 +270,9 @@ useWindowInfo(info: ReactNode): boolean // this view's (i) in place
|
|
|
269
270
|
title={(id) => ReactNode}
|
|
270
271
|
note?={(id) => ReactNode} // quiet text in the title bar: what this window is looking at
|
|
271
272
|
info?={(id) => ReactNode} // an (i) on the bar's far edge from the controls (end on mac, start on gnome/windows): what this window IS
|
|
272
|
-
limits?={(id) => ({ maxWidth?, maxHeight?, minWidth?, minHeight? } | null)} // a window with a natural
|
|
273
|
-
// size is never stretched past it; filled, it centres
|
|
273
|
+
limits?={(id) => ({ maxWidth?, maxHeight?, minWidth?, minHeight?, fitContent? } | null)} // a window with a natural
|
|
274
|
+
// size is never stretched past it; filled, it centres; fitContent:
|
|
275
|
+
// centred, it is as tall as its content up to maxHeight
|
|
274
276
|
actions?={(id) => ReactNode} // window-wide controls in the title bar
|
|
275
277
|
loading?={(id) => ReactNode} // inside a window while its code loads
|
|
276
278
|
failed?={(id, error, reload) => ReactNode} // inside a window that could not open
|
|
@@ -391,6 +393,45 @@ Command items are enabled via `canPerform` as the menu opens, and menus bind the
|
|
|
391
393
|
menu does not take focus from the key window, so a chosen command reaches the same responder a shortcut
|
|
392
394
|
would. `items` as a function is re-read on every open.
|
|
393
395
|
|
|
396
|
+
### Settings and About
|
|
397
|
+
|
|
398
|
+
```tsx
|
|
399
|
+
<DeskShell app={DeskApp}> // or DeskProvider app={…}; read on every render, so it may change
|
|
400
|
+
interface DeskApp { name; icon?; version?; description?; links?: { label, url }[]; legal?;
|
|
401
|
+
note?: ReactNode; // a line under the links, not copied
|
|
402
|
+
facts?: () => AboutSection[] | null; // a HOOK, called inside the About panel; null = still reading, [] = nothing, no Copy
|
|
403
|
+
settings?: AppSettings } // leave out: no gear, no "Settings…", no ⌘,
|
|
404
|
+
interface AboutSection { title?; facts: { name; value: string; note?: ReactNode; link?: { label, url }; copy?: false }[] } // copy:false = shown, not copied; note and link never copied
|
|
405
|
+
interface AppSettings { sections?: SettingsSection[]; layout?: 'panel' | 'sidebar'; badge?: ReactNode;
|
|
406
|
+
open?: (route?: string) => void } // open: the app's own Settings window; Desk draws none
|
|
407
|
+
interface SettingsSection { id; title; group?; icon?; badge?; content: ReactNode } // id = the route of `settings`
|
|
408
|
+
// AppSettings.appearance?: true | { scheme?; look?; sounds?: Fx; soundsDescription?; theme?: ReactNode } // Desk's first section
|
|
409
|
+
// DeskApp.themeFromHost?: boolean // receives its theme from a host: no scheme/look/theme rows (sounds stay); default: found from the bridge
|
|
410
|
+
useColorScheme(): 'system'|'light'|'dark'; colorScheme(); setColorScheme(s) // localStorage desk.scheme; data-theme on the root
|
|
411
|
+
useLookChoice(): LookChoice | null; lookChoice(); setLookChoice(l) // localStorage desk.look; replaces the `look` prop
|
|
412
|
+
COLOR_SCHEME_SCRIPT; COLOR_SCHEME_KEY = 'desk.scheme'; LOOK_KEY = 'desk.look' // also from the core entry (no React)
|
|
413
|
+
// script: for <head>, the remembered scheme before first paint; keys: for migrations
|
|
414
|
+
<AppearanceSettings rows look /> // the rows, for an app's own Settings window
|
|
415
|
+
dockSettings(): DockEntry // where the gear goes among the system items; default just before About
|
|
416
|
+
SETTINGS_WINDOW = 'settings'; ABOUT_WINDOW = 'about'; SettingsCommand = 'desk.settings'; SYSTEM_GROUP = 'system'
|
|
417
|
+
PANEL_LIMITS; SIDEBAR_LIMITS // the windows' sizes (the panel fits its content); Desktop `limits` for those ids overrides
|
|
418
|
+
openAbout(desk) // About as the dock opens it: a centred panel, or forward where it is
|
|
419
|
+
useOpenSettings(): (route?) => void // Settings as the gear opens it (the app's own `open` too); nothing without settings
|
|
420
|
+
appWindowTitle(app, id): string | null // 'Settings' / 'About' for Desk's windows, for a Window menu's title function
|
|
421
|
+
<AboutContent />; <SettingsContent />; aboutText(app, sections): string
|
|
422
|
+
useDeskApp(): DeskApp | null
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Declared, Desk adds: in the Dock, the gear (when there are settings) and About as the last items of the system
|
|
426
|
+
group (entries after `dockSeparator('system')`; a separator and group of their own when there is none); in the
|
|
427
|
+
MenuBar's app menu (first with `emphasis`, else one is made, named `name`) "About <name>", separator,
|
|
428
|
+
"Settings…" (mod+comma), separator, then the app's items; Desktop draws the `about` and (with `settings` and no `open`) `settings` windows as
|
|
429
|
+
centred panels (sidebar layout: a bigger window with a Sidebar grouped by `group`). Gear, menu and ⌘, focus an
|
|
430
|
+
open panel where it is. ⌘, is bound by the provider on the command, so it works with no MenuBar; the menu item only
|
|
431
|
+
shows it. A `host` menu bar gets the same items through the same publish; the host owns ⌘, while it is up.
|
|
432
|
+
With facts, About has Copy: name + version, then each section's copyable facts. Never put credentials in facts.
|
|
433
|
+
Don't also add your own About/Settings dock or menu items: they would be there twice.
|
|
434
|
+
|
|
394
435
|
### Commands and input
|
|
395
436
|
|
|
396
437
|
```tsx
|
|
@@ -670,7 +711,7 @@ in the accessibility tree.
|
|
|
670
711
|
- A `DeskProvider` already carries an event bus; `BusProvider` is only for supplying or sharing one.
|
|
671
712
|
- `renderWindow` must be stable (module scope or `useCallback`) for the memoisation to hold.
|
|
672
713
|
- `parse`/`syncWithLocation` warn once when no `isKnown` is given: unknown ids from a URL are then trusted.
|
|
673
|
-
- `npm run size` enforces a gzipped budget: core
|
|
714
|
+
- `npm run size` enforces a gzipped budget: core 17 KiB, react 88 KiB, css 24 KiB, fx 5 KiB.
|
|
674
715
|
- `fx.play` never resumes audio itself: outside a press a browser's resume may never settle. Call
|
|
675
716
|
`fx.unlock()` at startup, or nothing sounds until a press after the sound was due.
|
|
676
717
|
- The package is ESM only, with `"sideEffects": ["**/*.css"]`.
|
package/package.json
CHANGED
package/src/core/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type { Bus, DeskEvent, EventHandler, InputDescription, SubscribeOptions }
|
|
|
35
35
|
export { bindShortcuts, formatShortcut, isApplePlatform, isInstalledApp, matchesShortcut, parseShortcut } from './shortcuts.js'
|
|
36
36
|
export type { Keymap, Shortcut, ShortcutOptions } from './shortcuts.js'
|
|
37
37
|
export { deviceLook, lookFor, resolveLook } from './look.js'
|
|
38
|
+
export { COLOR_SCHEME_KEY, COLOR_SCHEME_SCRIPT, LOOK_KEY } from './scheme.js'
|
|
39
|
+
export type { ColorScheme } from './scheme.js'
|
|
38
40
|
export type { Look, LookChoice } from './look.js'
|
|
39
41
|
export { parse, serialize, syncWithLocation } from './location.js'
|
|
40
42
|
export { isTitleCase, titleCase } from './titles.js'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The colour scheme and the look a person chooses in Settings' Appearance, as this browser keeps them. They
|
|
3
|
+
* are here, with no React, for a page's server-rendered `<head>` and for an app moving a choice it kept under
|
|
4
|
+
* a key of its own: write it to these keys once, and Appearance shows and applies it.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Light, dark, or the system's, which the stylesheet follows through `prefers-color-scheme`. */
|
|
8
|
+
export type ColorScheme = 'system' | 'light' | 'dark'
|
|
9
|
+
|
|
10
|
+
/** Where the chosen colour scheme is kept in localStorage: `light` or `dark`; absent for the system's. */
|
|
11
|
+
export const COLOR_SCHEME_KEY = 'desk.scheme'
|
|
12
|
+
|
|
13
|
+
/** Where the chosen look is kept in localStorage: `auto`, `mac`, `gnome` or `windows`; absent while the app's own stands. */
|
|
14
|
+
export const LOOK_KEY = 'desk.look'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* For the page's `<head>`, before anything paints: the remembered scheme on the root as `data-theme`, so a dark
|
|
18
|
+
* choice does not open light for a moment while the app loads.
|
|
19
|
+
*/
|
|
20
|
+
export const COLOR_SCHEME_SCRIPT =
|
|
21
|
+
`try{var s=localStorage.getItem(${JSON.stringify(COLOR_SCHEME_KEY)});if(s=="light"||s=="dark")document.documentElement.setAttribute("data-theme",s)}catch(e){}`
|
package/src/core/types.ts
CHANGED
|
@@ -72,4 +72,10 @@ export interface WindowLimits {
|
|
|
72
72
|
readonly minHeight?: number
|
|
73
73
|
readonly maxWidth?: number
|
|
74
74
|
readonly maxHeight?: number
|
|
75
|
+
/**
|
|
76
|
+
* As tall as its content, up to `maxHeight`, while it sits centred: a short form is not a tall window with
|
|
77
|
+
* room to spare under it. Taller content scrolls inside it as usual. A window dragged or resized free takes
|
|
78
|
+
* the height it is given.
|
|
79
|
+
*/
|
|
80
|
+
readonly fitContent?: boolean
|
|
75
81
|
}
|
package/src/css/apps.css
CHANGED
|
@@ -54,3 +54,152 @@
|
|
|
54
54
|
border: 0;
|
|
55
55
|
background: var(--desk-surface);
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
/* ── About and Settings, from what the app declares ── */
|
|
59
|
+
|
|
60
|
+
.desk-about-body {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: var(--desk-space-4);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.desk-about-brand {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--desk-space-1);
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.desk-about-icon {
|
|
75
|
+
display: grid;
|
|
76
|
+
place-items: center;
|
|
77
|
+
width: 96px;
|
|
78
|
+
height: 96px;
|
|
79
|
+
margin-bottom: var(--desk-space-2);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.desk-about-icon > svg,
|
|
83
|
+
.desk-about-icon > img {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.desk-about-name {
|
|
89
|
+
margin: 0;
|
|
90
|
+
font-size: var(--desk-text-display);
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.desk-about-version,
|
|
95
|
+
.desk-about-description {
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.desk-about-links {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
gap: var(--desk-space-2) var(--desk-space-4);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.desk-about-links a {
|
|
107
|
+
color: var(--desk-accent);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/*
|
|
111
|
+
* Name and value in two columns; a note sits under its value. Every section shares one grid, through
|
|
112
|
+
* subgrid, so the names are one column down the whole panel, as wide as the longest of them.
|
|
113
|
+
*/
|
|
114
|
+
.desk-about-sections {
|
|
115
|
+
display: grid;
|
|
116
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
117
|
+
column-gap: var(--desk-space-3);
|
|
118
|
+
row-gap: var(--desk-space-4);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.desk-about-sections > section {
|
|
122
|
+
grid-column: 1 / -1;
|
|
123
|
+
display: grid;
|
|
124
|
+
grid-template-columns: subgrid;
|
|
125
|
+
/* normal: the panel's column gap, so a section's own gap does not shift its values off the column. */
|
|
126
|
+
column-gap: normal;
|
|
127
|
+
row-gap: var(--desk-space-2);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.desk-about-sections > section > * {
|
|
131
|
+
grid-column: 1 / -1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.desk-about-facts {
|
|
135
|
+
display: grid;
|
|
136
|
+
grid-template-columns: subgrid;
|
|
137
|
+
column-gap: normal;
|
|
138
|
+
row-gap: var(--desk-space-1);
|
|
139
|
+
margin: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* A browser without subgrid: each section is its own grid, and a floor under the names keeps them close. */
|
|
143
|
+
@supports not (grid-template-columns: subgrid) {
|
|
144
|
+
.desk-about-facts {
|
|
145
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
146
|
+
column-gap: var(--desk-space-3);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.desk-about-facts dt {
|
|
150
|
+
min-width: 9rem;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.desk-about-facts > div {
|
|
155
|
+
display: contents;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.desk-about-facts dt {
|
|
159
|
+
color: var(--desk-muted);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.desk-about-facts dd {
|
|
163
|
+
margin: 0;
|
|
164
|
+
overflow-wrap: anywhere;
|
|
165
|
+
user-select: text;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.desk-about-fact-note {
|
|
169
|
+
display: block;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.desk-about-note {
|
|
173
|
+
margin: 0;
|
|
174
|
+
text-align: center;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.desk-about-legal {
|
|
178
|
+
margin: 0;
|
|
179
|
+
text-align: center;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.desk-about-foot {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: var(--desk-space-3);
|
|
186
|
+
padding: var(--desk-space-3) var(--desk-space-4);
|
|
187
|
+
border-top: 1px solid var(--desk-rule);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* What Copy copies, out of sight: selected in place of the panel where there is no clipboard. */
|
|
191
|
+
.desk-about-copied {
|
|
192
|
+
position: absolute;
|
|
193
|
+
width: 1px;
|
|
194
|
+
height: 1px;
|
|
195
|
+
margin: -1px;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
clip-path: inset(50%);
|
|
198
|
+
white-space: pre;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.desk-settings-page {
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
gap: var(--desk-space-5);
|
|
205
|
+
}
|
package/src/css/overlays.css
CHANGED
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
background: var(--desk-surface);
|
|
21
21
|
box-shadow: var(--desk-shadow-floating);
|
|
22
22
|
animation: desk-menu-in .14s var(--desk-ease);
|
|
23
|
+
overscroll-behavior: contain;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Focused only so its keys scroll it (see Popover); the open dialog is its own sign of where focus is. */
|
|
27
|
+
.desk-popover:focus {
|
|
28
|
+
outline: none;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/* A sheet belongs to its window: the scrim covers that window and nothing else. */
|
package/src/css/windows.css
CHANGED
|
@@ -746,6 +746,27 @@ button.desk-widget:hover {
|
|
|
746
746
|
overflow: hidden;
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
+
/*
|
|
750
|
+
* A centred window that fits its content (`fitContent`) is as tall as what is in it, up to its max-height.
|
|
751
|
+
* Its height comes from its content rather than the content from its height, so a pane in it is not 100% of
|
|
752
|
+
* anything: it takes its own height and gives way, with the middle scrolling, once the window is at its cap.
|
|
753
|
+
*/
|
|
754
|
+
.desk-window[data-fit] {
|
|
755
|
+
height: fit-content;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.desk-window[data-fit] > .desk-body {
|
|
759
|
+
flex: 0 1 auto;
|
|
760
|
+
display: flex;
|
|
761
|
+
flex-direction: column;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
.desk-window[data-fit] > .desk-body > * {
|
|
765
|
+
flex: 0 1 auto;
|
|
766
|
+
height: auto;
|
|
767
|
+
min-height: 0;
|
|
768
|
+
}
|
|
769
|
+
|
|
749
770
|
.desk-toolbar {
|
|
750
771
|
display: flex;
|
|
751
772
|
align-items: center;
|
package/src/react/Desktop.tsx
CHANGED
|
@@ -10,6 +10,9 @@ import type { Widget, WidgetCorner } from './widgets.js'
|
|
|
10
10
|
import { arrangement, areaAround } from './arrange.js'
|
|
11
11
|
import { InfoTip } from './infoTip.js'
|
|
12
12
|
import { useDesk, useDeskState, useLook, WindowContext } from './context.js'
|
|
13
|
+
import type { DeskApp } from './app.js'
|
|
14
|
+
import { ABOUT_WINDOW, appWindowLimits, appWindowTitle, desksWindow, SETTINGS_WINDOW, useDeskApp } from './app.js'
|
|
15
|
+
import { AboutContent, SettingsContent } from './appPanels.js'
|
|
13
16
|
import { WindowBoundary } from './windowBoundary.js'
|
|
14
17
|
import { TitleProgress } from './windowProgress.js'
|
|
15
18
|
import type { WindowProgress } from './windowProgress.js'
|
|
@@ -100,6 +103,11 @@ function arrangementArea(stage: HTMLElement) {
|
|
|
100
103
|
return { x: left, y: top, width: stage.clientWidth - left - right, height: stage.clientHeight - top - bottom, gap }
|
|
101
104
|
}
|
|
102
105
|
|
|
106
|
+
const systemLimits = (app: DeskApp | null, id: WindowId): WindowLimits | null => {
|
|
107
|
+
const which = desksWindow(app, id)
|
|
108
|
+
return which ? appWindowLimits(app, which) : null
|
|
109
|
+
}
|
|
110
|
+
|
|
103
111
|
const halfFrame = (stage: HTMLElement, side: 'start' | 'end'): Frame => {
|
|
104
112
|
const area = arrangementArea(stage)
|
|
105
113
|
const width = (area.width - area.gap) / 2
|
|
@@ -112,6 +120,15 @@ export function Desktop({ renderWindow, title, note, info, actions, limits, empt
|
|
|
112
120
|
const stage = useRef<HTMLDivElement>(null)
|
|
113
121
|
const touch = useMediaQuery(TOUCH)
|
|
114
122
|
const mode: DeskLayout = layout === 'auto' ? (touch ? 'fullscreen' : 'desktop') : layout
|
|
123
|
+
// About and Settings, when the app has declared itself: Desk draws them, unless the app's Settings is its own.
|
|
124
|
+
const app = useDeskApp()
|
|
125
|
+
const ownsAbout = app !== null
|
|
126
|
+
const ownsSettings = desksWindow(app, SETTINGS_WINDOW) !== null
|
|
127
|
+
const render = useCallback(
|
|
128
|
+
(id: WindowId): ReactNode =>
|
|
129
|
+
ownsAbout && id === ABOUT_WINDOW ? <AboutContent /> : ownsSettings && id === SETTINGS_WINDOW ? <SettingsContent /> : renderWindow(id),
|
|
130
|
+
[renderWindow, ownsAbout, ownsSettings],
|
|
131
|
+
)
|
|
115
132
|
|
|
116
133
|
useLayoutEffect(() => {
|
|
117
134
|
desk.setStage(() => ({ width: stage.current?.clientWidth ?? 1024, height: stage.current?.clientHeight ?? 768 }))
|
|
@@ -215,15 +232,15 @@ export function Desktop({ renderWindow, title, note, info, actions, limits, empt
|
|
|
215
232
|
// touch, and minimizing, are the same thing to everything below this line.
|
|
216
233
|
hidden={(mode === 'fullscreen' && window.id !== focused) || isMinimized(state, window.id)}
|
|
217
234
|
minimized={isMinimized(state, window.id)}
|
|
218
|
-
title={title(window.id)}
|
|
235
|
+
title={appWindowTitle(app, window.id) ?? title(window.id)}
|
|
219
236
|
note={note?.(window.id)}
|
|
220
237
|
info={info?.(window.id)}
|
|
221
|
-
limits={limits?.(window.id) ??
|
|
238
|
+
limits={limits?.(window.id) ?? systemLimits(app, window.id)}
|
|
222
239
|
actions={actions?.(window.id)}
|
|
223
240
|
>
|
|
224
241
|
{/* Memoised on the id and the render function: moving or focusing a window
|
|
225
242
|
re-renders its chrome, never the app's content inside it. */}
|
|
226
|
-
<WindowContent id={window.id} render={
|
|
243
|
+
<WindowContent id={window.id} render={render} loading={loading} failed={failed} />
|
|
227
244
|
</WindowView>
|
|
228
245
|
))}
|
|
229
246
|
</div>
|
|
@@ -531,6 +548,7 @@ function WindowView({ window, layout, hidden, minimized, depth, focused, title,
|
|
|
531
548
|
className="desk-window"
|
|
532
549
|
data-mode={layout === 'fullscreen' ? 'fullscreen' : live ? 'floating' : window.mode}
|
|
533
550
|
data-centred={centred || undefined}
|
|
551
|
+
data-fit={(centred && limits?.fitContent) || undefined}
|
|
534
552
|
data-hidden={hidden || undefined}
|
|
535
553
|
data-minimized={minimized || undefined}
|
|
536
554
|
inert={hidden || undefined}
|
package/src/react/Dock.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react'
|
|
|
2
2
|
import type { KeyboardEvent, ReactNode } from 'react'
|
|
3
3
|
import { focusedId, instancesOf, isMinimized, windowType } from '../core/desk.js'
|
|
4
4
|
import type { DeskState, WindowId } from '../core/types.js'
|
|
5
|
+
import { ABOUT_WINDOW, openPanel, openSettings, placeAppDockItems, useDeskApp } from './app.js'
|
|
5
6
|
import { useDesk, useDeskState } from './context.js'
|
|
6
7
|
import { useContextMenu } from './contextMenu.js'
|
|
7
8
|
import { useDragSource, useDropTarget } from './dnd.js'
|
|
@@ -59,6 +60,8 @@ export type DockEntry =
|
|
|
59
60
|
| ({ readonly type: 'item' } & DockItem)
|
|
60
61
|
| ({ readonly type: 'stack' } & DockStack)
|
|
61
62
|
| { readonly type: 'separator'; readonly id: string }
|
|
63
|
+
/** Where the app wants its Settings item: see `dockSettings()`. */
|
|
64
|
+
| { readonly type: 'settings'; readonly id: string }
|
|
62
65
|
|
|
63
66
|
export const dockItem = (item: DockItem): DockEntry => ({ type: 'item', ...item })
|
|
64
67
|
export const dockStack = (stack: DockStack): DockEntry => ({ type: 'stack', ...stack })
|
|
@@ -119,8 +122,15 @@ function roveFocus(event: KeyboardEvent<HTMLElement>, keys: { next: string[]; pr
|
|
|
119
122
|
target.focus()
|
|
120
123
|
}
|
|
121
124
|
|
|
122
|
-
export function Dock({ entries, label = 'Dock', placement = 'overlay', side = 'left', className, pins }: DockProps) {
|
|
125
|
+
export function Dock({ entries: given, label = 'Dock', placement = 'overlay', side = 'left', className, pins }: DockProps) {
|
|
123
126
|
const vertical = side !== 'bottom'
|
|
127
|
+
const desk = useDesk()
|
|
128
|
+
const app = useDeskApp()
|
|
129
|
+
// Settings and About, where every Desk app has them, when the app has declared itself.
|
|
130
|
+
const entries = placeAppDockItems(given, app, {
|
|
131
|
+
settings: () => openSettings(desk, app),
|
|
132
|
+
about: () => openPanel(desk, ABOUT_WINDOW),
|
|
133
|
+
})
|
|
124
134
|
const [openStack, setOpenStack] = useState<string | null>(null)
|
|
125
135
|
const firstFocusable = entries.find(e => e.type !== 'separator')?.id
|
|
126
136
|
const { dropProps } = useDropTarget({
|