@liberation-data/desk 0.42.0 → 0.44.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 +312 -5
- package/dist/core/hosted.d.ts +222 -0
- package/dist/core/hosted.d.ts.map +1 -0
- package/dist/core/hosted.js +166 -0
- package/dist/core/hosted.js.map +1 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/location.d.ts +8 -1
- package/dist/core/location.d.ts.map +1 -1
- package/dist/core/location.js +18 -2
- package/dist/core/location.js.map +1 -1
- package/dist/core/preferences.d.ts +27 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +121 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/scheme.d.ts +18 -0
- package/dist/core/scheme.d.ts.map +1 -0
- package/dist/core/scheme.js +24 -0
- package/dist/core/scheme.js.map +1 -0
- package/dist/core/theme.d.ts +41 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/theme.js +56 -0
- package/dist/core/theme.js.map +1 -0
- package/dist/core/themeChange.d.ts +25 -0
- package/dist/core/themeChange.d.ts.map +1 -0
- package/dist/core/themeChange.js +49 -0
- package/dist/core/themeChange.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 +183 -0
- package/dist/css/overlays.css +6 -0
- package/dist/css/shell.css +100 -0
- package/dist/css/tokens.css +10 -0
- package/dist/css/windows.css +21 -0
- package/dist/desk.css +220 -0
- package/dist/fx/fx.d.ts.map +1 -1
- package/dist/fx/fx.js +7 -31
- package/dist/fx/fx.js.map +1 -1
- package/dist/host/checkChrome.d.ts +20 -0
- package/dist/host/checkChrome.d.ts.map +1 -0
- package/dist/host/checkChrome.js +219 -0
- package/dist/host/checkChrome.js.map +1 -0
- package/dist/host/checkTheme.d.ts +35 -0
- package/dist/host/checkTheme.d.ts.map +1 -0
- package/dist/host/checkTheme.js +128 -0
- package/dist/host/checkTheme.js.map +1 -0
- package/dist/host/index.d.ts +7 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +8 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/router.d.ts +99 -0
- package/dist/host/router.d.ts.map +1 -0
- package/dist/host/router.js +279 -0
- package/dist/host/router.js.map +1 -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 +26 -2
- package/dist/react/Dock.d.ts.map +1 -1
- package/dist/react/Dock.js +23 -27
- 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 +36 -6
- package/dist/react/MenuBar.js.map +1 -1
- package/dist/react/app.d.ts +215 -0
- package/dist/react/app.d.ts.map +1 -0
- package/dist/react/app.js +192 -0
- package/dist/react/app.js.map +1 -0
- package/dist/react/appFrame.d.ts +11 -7
- package/dist/react/appFrame.d.ts.map +1 -1
- package/dist/react/appFrame.js +24 -6
- package/dist/react/appFrame.js.map +1 -1
- package/dist/react/appPanels.d.ts +25 -0
- package/dist/react/appPanels.d.ts.map +1 -0
- package/dist/react/appPanels.js +123 -0
- package/dist/react/appPanels.js.map +1 -0
- package/dist/react/appearance.d.ts +61 -0
- package/dist/react/appearance.d.ts.map +1 -0
- package/dist/react/appearance.js +119 -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 +23 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +108 -5
- 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/dockStatus.d.ts +19 -0
- package/dist/react/dockStatus.d.ts.map +1 -0
- package/dist/react/dockStatus.js +25 -0
- package/dist/react/dockStatus.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/frameMenus.d.ts +28 -0
- package/dist/react/frameMenus.d.ts.map +1 -0
- package/dist/react/frameMenus.js +85 -0
- package/dist/react/frameMenus.js.map +1 -0
- package/dist/react/hostApp.d.ts +15 -0
- package/dist/react/hostApp.d.ts.map +1 -0
- package/dist/react/hostApp.js +77 -0
- package/dist/react/hostApp.js.map +1 -0
- package/dist/react/hostDock.d.ts +25 -0
- package/dist/react/hostDock.d.ts.map +1 -0
- package/dist/react/hostDock.js +98 -0
- package/dist/react/hostDock.js.map +1 -0
- package/dist/react/hostMenu.d.ts +2 -36
- package/dist/react/hostMenu.d.ts.map +1 -1
- package/dist/react/hostMenu.js.map +1 -1
- package/dist/react/hosted.d.ts +28 -0
- package/dist/react/hosted.d.ts.map +1 -0
- package/dist/react/hosted.js +53 -0
- package/dist/react/hosted.js.map +1 -0
- package/dist/react/index.d.ts +12 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +8 -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 +16 -1
- package/dist/react/shell.d.ts.map +1 -1
- package/dist/react/shell.js +19 -3
- package/dist/react/shell.js.map +1 -1
- package/dist/react/windowMenus.d.ts +19 -0
- package/dist/react/windowMenus.d.ts.map +1 -0
- package/dist/react/windowMenus.js +88 -0
- package/dist/react/windowMenus.js.map +1 -0
- package/dist/shell/HostShell.d.ts +53 -0
- package/dist/shell/HostShell.d.ts.map +1 -0
- package/dist/shell/HostShell.js +116 -0
- package/dist/shell/HostShell.js.map +1 -0
- package/dist/shell/index.d.ts +7 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +9 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/keys.d.ts +47 -0
- package/dist/shell/keys.d.ts.map +1 -0
- package/dist/shell/keys.js +68 -0
- package/dist/shell/keys.js.map +1 -0
- package/dist/shell/motion.d.ts +72 -0
- package/dist/shell/motion.d.ts.map +1 -0
- package/dist/shell/motion.js +118 -0
- package/dist/shell/motion.js.map +1 -0
- package/llms.txt +84 -9
- package/package.json +10 -1
- package/src/core/hosted.ts +351 -0
- package/src/core/index.ts +29 -0
- package/src/core/location.ts +23 -3
- package/src/core/preferences.ts +132 -0
- package/src/core/scheme.ts +32 -0
- package/src/core/theme.ts +91 -0
- package/src/core/themeChange.ts +59 -0
- package/src/core/types.ts +6 -0
- package/src/css/apps.css +183 -0
- package/src/css/overlays.css +6 -0
- package/src/css/shell.css +99 -0
- package/src/css/tokens.css +10 -0
- package/src/css/windows.css +21 -0
- package/src/fx/fx.ts +7 -25
- package/src/host/checkChrome.ts +257 -0
- package/src/host/checkTheme.ts +134 -0
- package/src/host/index.ts +10 -0
- package/src/host/router.ts +374 -0
- package/src/react/Desktop.tsx +21 -3
- package/src/react/Dock.tsx +40 -24
- package/src/react/MenuBar.tsx +39 -6
- package/src/react/app.tsx +354 -0
- package/src/react/appFrame.tsx +39 -14
- package/src/react/appPanels.tsx +210 -0
- package/src/react/appearance.tsx +195 -0
- package/src/react/codeBlock.tsx +7 -65
- package/src/react/context.tsx +131 -4
- package/src/react/copy.ts +81 -0
- package/src/react/dockStatus.ts +42 -0
- package/src/react/documentTitle.ts +4 -1
- package/src/react/frameMenus.ts +100 -0
- package/src/react/hostApp.tsx +89 -0
- package/src/react/hostDock.tsx +118 -0
- package/src/react/hostMenu.ts +3 -38
- package/src/react/hosted.tsx +65 -0
- package/src/react/index.ts +34 -0
- package/src/react/layers.ts +7 -2
- package/src/react/overlays.tsx +30 -12
- package/src/react/shell.tsx +33 -3
- package/src/react/windowMenus.ts +107 -0
- package/src/shell/HostShell.tsx +220 -0
- package/src/shell/index.ts +11 -0
- package/src/shell/keys.ts +101 -0
- package/src/shell/motion.ts +163 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { themeChanged, watchThemeChanges } from './themeChange.js';
|
|
2
|
+
/**
|
|
3
|
+
* A wallpaper that names an image, rather than being a colour or gradient: a `data:` URI, a URL on any
|
|
4
|
+
* scheme with a host (an Electron app's `app://` too), or a path.
|
|
5
|
+
*/
|
|
6
|
+
export const isImageRef = (wallpaper) => /^(data:|[a-z][\w+.-]*:\/\/|\/)/i.test(wallpaper);
|
|
7
|
+
/**
|
|
8
|
+
* The part of a theme every hosted app wears whatever else it does: light or dark, and the
|
|
9
|
+
* platform chrome. One desktop light and the next dark would look broken as they slide past each
|
|
10
|
+
* other, so these are not the app's to decline.
|
|
11
|
+
*/
|
|
12
|
+
export function applyThemeBasics(theme, root = document.documentElement) {
|
|
13
|
+
watchThemeChanges(root.ownerDocument);
|
|
14
|
+
root.dataset.theme = theme.mode;
|
|
15
|
+
root.dataset.look = theme.look;
|
|
16
|
+
root.style.colorScheme = theme.mode;
|
|
17
|
+
}
|
|
18
|
+
const applied = new WeakMap();
|
|
19
|
+
/**
|
|
20
|
+
* Wears a whole theme: the basics, every token on the root, its fonts, and its wallpaper as
|
|
21
|
+
* `--desk-wallpaper`. Tokens a previous theme set and this one does not are removed, so switching
|
|
22
|
+
* back and forth leaves nothing behind. The default way a hosted app takes the theme it is sent.
|
|
23
|
+
* New colours under the same scheme and look still fire `desk-themechange`, for a canvas to repaint.
|
|
24
|
+
*/
|
|
25
|
+
export function applyTheme(theme, root = document.documentElement) {
|
|
26
|
+
const was = root.style.cssText;
|
|
27
|
+
applyThemeBasics(theme, root);
|
|
28
|
+
const before = applied.get(root);
|
|
29
|
+
for (const name of before?.tokens ?? [])
|
|
30
|
+
if (!(name in theme.tokens))
|
|
31
|
+
root.style.removeProperty(name);
|
|
32
|
+
for (const [name, value] of Object.entries(theme.tokens))
|
|
33
|
+
root.style.setProperty(name, value);
|
|
34
|
+
if (theme.wallpaper === undefined)
|
|
35
|
+
root.style.removeProperty('--desk-wallpaper');
|
|
36
|
+
else
|
|
37
|
+
root.style.setProperty('--desk-wallpaper', isImageRef(theme.wallpaper) ? `url(${JSON.stringify(theme.wallpaper)})` : theme.wallpaper);
|
|
38
|
+
const fonts = root.ownerDocument.fonts;
|
|
39
|
+
for (const face of before?.fonts ?? [])
|
|
40
|
+
fonts?.delete(face);
|
|
41
|
+
const faces = [];
|
|
42
|
+
if (fonts && typeof FontFace !== 'undefined') {
|
|
43
|
+
for (const font of theme.fonts ?? []) {
|
|
44
|
+
const face = new FontFace(font.family, `url(${JSON.stringify(font.src)})`, {
|
|
45
|
+
...(font.weight === undefined ? {} : { weight: font.weight }),
|
|
46
|
+
...(font.style === undefined ? {} : { style: font.style }),
|
|
47
|
+
});
|
|
48
|
+
fonts.add(face);
|
|
49
|
+
faces.push(face);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
applied.set(root, { tokens: Object.keys(theme.tokens), fonts: faces });
|
|
53
|
+
if (root.style.cssText !== was)
|
|
54
|
+
themeChanged(root.ownerDocument);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/core/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAuClE;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAiB,EAAW,EAAE,CAAC,iCAAiC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAE3G;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAu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}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Look } from './look.js';
|
|
2
|
+
/** The event's name, on `document`. */
|
|
3
|
+
export declare const THEME_CHANGE = "desk-themechange";
|
|
4
|
+
/** What a `desk-themechange` carries: the scheme and look now drawn. */
|
|
5
|
+
export interface ThemeChange {
|
|
6
|
+
readonly scheme: 'light' | 'dark';
|
|
7
|
+
readonly look: Look;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The scheme and look drawn now, read as the stylesheet reads them: `data-theme` when it is light or dark,
|
|
11
|
+
* else the system's; `data-look`, else `mac`, which is what desk.css draws without one.
|
|
12
|
+
*/
|
|
13
|
+
export declare function drawnTheme(doc?: Document): ThemeChange;
|
|
14
|
+
/**
|
|
15
|
+
* Starts firing `desk-themechange` on `doc` whenever the drawn scheme or look changes, once per change.
|
|
16
|
+
* Desk starts it when a desk mounts or a theme is applied; calling it again does nothing.
|
|
17
|
+
*/
|
|
18
|
+
export declare function watchThemeChanges(doc?: Document): void;
|
|
19
|
+
/**
|
|
20
|
+
* Fires `desk-themechange` now, if `doc` is watched, though the scheme and look are unchanged: for new
|
|
21
|
+
* colours the root's attributes don't show. Synchronous, so the observer's later look finds nothing new
|
|
22
|
+
* and a theme that also changed the scheme is still one event.
|
|
23
|
+
*/
|
|
24
|
+
export declare const themeChanged: (doc?: Document) => void;
|
|
25
|
+
//# sourceMappingURL=themeChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeChange.d.ts","sourceRoot":"","sources":["../../src/core/themeChange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAarC,uCAAuC;AACvC,eAAO,MAAM,YAAY,qBAAqB,CAAA;AAE9C,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAA;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CACpB;AAID;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,GAAE,QAAmB,GAAG,WAAW,CAKhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,QAAmB,GAAG,IAAI,CAYhE;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAS,QAAQ,KAAc,IAA+B,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ONE EVENT FOR EVERY CHANGE TO WHAT IS DRAWN, FOR CODE OUTSIDE REACT.
|
|
3
|
+
*
|
|
4
|
+
* Code that draws its own pixels (a canvas) must repaint when the colours change. Every source of a
|
|
5
|
+
* change ends on the root: a host's theme and the person's choice stamp `data-theme`, a look stamps
|
|
6
|
+
* `data-look`, and with neither the system's scheme shows through the stylesheet's media query. So one
|
|
7
|
+
* watcher of those, not a dispatch from each path, sees them all, and fires only when the scheme or
|
|
8
|
+
* look actually drawn has changed. The one change the root's attributes don't show is a host's theme
|
|
9
|
+
* with new colours under the same scheme and look, so `applyTheme` says so itself (`themeChanged`).
|
|
10
|
+
*/
|
|
11
|
+
/** The event's name, on `document`. */
|
|
12
|
+
export const THEME_CHANGE = 'desk-themechange';
|
|
13
|
+
const checks = new WeakMap();
|
|
14
|
+
/**
|
|
15
|
+
* The scheme and look drawn now, read as the stylesheet reads them: `data-theme` when it is light or dark,
|
|
16
|
+
* else the system's; `data-look`, else `mac`, which is what desk.css draws without one.
|
|
17
|
+
*/
|
|
18
|
+
export function drawnTheme(doc = document) {
|
|
19
|
+
const root = doc.documentElement;
|
|
20
|
+
const set = root.dataset.theme;
|
|
21
|
+
const scheme = set === 'light' || set === 'dark' ? set : globalThis.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
22
|
+
return { scheme, look: root.dataset.look ?? 'mac' };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Starts firing `desk-themechange` on `doc` whenever the drawn scheme or look changes, once per change.
|
|
26
|
+
* Desk starts it when a desk mounts or a theme is applied; calling it again does nothing.
|
|
27
|
+
*/
|
|
28
|
+
export function watchThemeChanges(doc = document) {
|
|
29
|
+
if (checks.has(doc) || typeof MutationObserver === 'undefined')
|
|
30
|
+
return;
|
|
31
|
+
let last = drawnTheme(doc);
|
|
32
|
+
const check = (always) => {
|
|
33
|
+
const now = drawnTheme(doc);
|
|
34
|
+
if (!always && now.scheme === last.scheme && now.look === last.look)
|
|
35
|
+
return;
|
|
36
|
+
last = now;
|
|
37
|
+
doc.dispatchEvent(new CustomEvent(THEME_CHANGE, { detail: now }));
|
|
38
|
+
};
|
|
39
|
+
checks.set(doc, check);
|
|
40
|
+
new MutationObserver(() => check()).observe(doc.documentElement, { attributes: true, attributeFilter: ['data-theme', 'data-look'] });
|
|
41
|
+
globalThis.matchMedia?.('(prefers-color-scheme: dark)').addEventListener?.('change', () => check());
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Fires `desk-themechange` now, if `doc` is watched, though the scheme and look are unchanged: for new
|
|
45
|
+
* colours the root's attributes don't show. Synchronous, so the observer's later look finds nothing new
|
|
46
|
+
* and a theme that also changed the scheme is still one event.
|
|
47
|
+
*/
|
|
48
|
+
export const themeChanged = (doc = document) => checks.get(doc)?.(true);
|
|
49
|
+
//# sourceMappingURL=themeChange.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeChange.js","sourceRoot":"","sources":["../../src/core/themeChange.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,uCAAuC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAA;AAQ9C,MAAM,MAAM,GAAG,IAAI,OAAO,EAAwC,CAAA;AAElE;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,GAAG,GAAa,QAAQ;IACjD,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,CAAA;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,OAA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AU,EAAE,CAAC,8BAA8B,CAAC,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAA;AACrG,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAa,QAAQ,EAAQ,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -71,5 +71,11 @@ export interface WindowLimits {
|
|
|
71
71
|
readonly minHeight?: number;
|
|
72
72
|
readonly maxWidth?: number;
|
|
73
73
|
readonly maxHeight?: number;
|
|
74
|
+
/**
|
|
75
|
+
* As tall as its content, up to `maxHeight`, while it sits centred: a short form is not a tall window with
|
|
76
|
+
* room to spare under it. Taller content scrolls inside it as usual. A window dragged or resized free takes
|
|
77
|
+
* the height it is given.
|
|
78
|
+
*/
|
|
79
|
+
readonly fitContent?: boolean;
|
|
74
80
|
}
|
|
75
81
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAA;AAE7B,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,MAAM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AAI,CAAC,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAA;IACtB,mGAAmG;IACnG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,uGAAuG;AACvG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B"}
|
package/dist/css/apps.css
CHANGED
|
@@ -55,3 +55,186 @@
|
|
|
55
55
|
border: 0;
|
|
56
56
|
background: var(--desk-surface);
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
/* ── About and Settings, from what the app declares ── */
|
|
60
|
+
|
|
61
|
+
.desk-about-body {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: var(--desk-space-4);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.desk-about-brand {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: var(--desk-space-1);
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.desk-about-icon {
|
|
76
|
+
display: grid;
|
|
77
|
+
place-items: center;
|
|
78
|
+
width: 96px;
|
|
79
|
+
height: 96px;
|
|
80
|
+
margin-bottom: var(--desk-space-2);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.desk-about-icon > svg,
|
|
84
|
+
.desk-about-icon > img {
|
|
85
|
+
width: 100%;
|
|
86
|
+
height: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.desk-about-name {
|
|
90
|
+
margin: 0;
|
|
91
|
+
font-size: var(--desk-text-display);
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* A wordmark: as wide as it is drawn, up to the panel, at a heading's height. The name stays, for screen readers. */
|
|
96
|
+
.desk-about-wordmark {
|
|
97
|
+
display: grid;
|
|
98
|
+
place-items: center;
|
|
99
|
+
max-width: 100%;
|
|
100
|
+
height: 40px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.desk-about-wordmark > svg,
|
|
104
|
+
.desk-about-wordmark > img {
|
|
105
|
+
height: 100%;
|
|
106
|
+
width: auto;
|
|
107
|
+
max-width: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.desk-about-name-hidden {
|
|
111
|
+
position: absolute;
|
|
112
|
+
width: 1px;
|
|
113
|
+
height: 1px;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
clip-path: inset(50%);
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.desk-about-version,
|
|
120
|
+
.desk-about-description {
|
|
121
|
+
margin: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.desk-about-links {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-wrap: wrap;
|
|
127
|
+
justify-content: center;
|
|
128
|
+
gap: var(--desk-space-2) var(--desk-space-4);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* The app's links, and a fact's: one colour for every link on the panel. */
|
|
132
|
+
.desk-about-links a,
|
|
133
|
+
.desk-about-fact-note a {
|
|
134
|
+
color: var(--desk-accent);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* A group's heading takes a line of its own above its links. */
|
|
138
|
+
.desk-about-links-heading {
|
|
139
|
+
flex-basis: 100%;
|
|
140
|
+
margin: 0;
|
|
141
|
+
text-align: center;
|
|
142
|
+
font-weight: 500;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/*
|
|
146
|
+
* Name and value in two columns; a note sits under its value. Every section shares one grid, through
|
|
147
|
+
* subgrid, so the names are one column down the whole panel, as wide as the longest of them.
|
|
148
|
+
*/
|
|
149
|
+
.desk-about-sections {
|
|
150
|
+
display: grid;
|
|
151
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
152
|
+
column-gap: var(--desk-space-3);
|
|
153
|
+
row-gap: var(--desk-space-4);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.desk-about-sections > section {
|
|
157
|
+
grid-column: 1 / -1;
|
|
158
|
+
display: grid;
|
|
159
|
+
grid-template-columns: subgrid;
|
|
160
|
+
/* normal: the panel's column gap, so a section's own gap does not shift its values off the column. */
|
|
161
|
+
column-gap: normal;
|
|
162
|
+
row-gap: var(--desk-space-2);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.desk-about-sections > section > * {
|
|
166
|
+
grid-column: 1 / -1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.desk-about-facts {
|
|
170
|
+
display: grid;
|
|
171
|
+
grid-template-columns: subgrid;
|
|
172
|
+
column-gap: normal;
|
|
173
|
+
row-gap: var(--desk-space-1);
|
|
174
|
+
margin: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* A browser without subgrid: each section is its own grid, and a floor under the names keeps them close. */
|
|
178
|
+
@supports not (grid-template-columns: subgrid) {
|
|
179
|
+
.desk-about-facts {
|
|
180
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
181
|
+
column-gap: var(--desk-space-3);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.desk-about-facts dt {
|
|
185
|
+
min-width: 9rem;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.desk-about-facts > div {
|
|
190
|
+
display: contents;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.desk-about-facts dt {
|
|
194
|
+
color: var(--desk-muted);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.desk-about-facts dd {
|
|
198
|
+
margin: 0;
|
|
199
|
+
overflow-wrap: anywhere;
|
|
200
|
+
user-select: text;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.desk-about-fact-note {
|
|
204
|
+
display: block;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.desk-about-note {
|
|
208
|
+
margin: 0;
|
|
209
|
+
text-align: center;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.desk-about-legal {
|
|
213
|
+
margin: 0;
|
|
214
|
+
text-align: center;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.desk-about-foot {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: var(--desk-space-3);
|
|
221
|
+
padding: var(--desk-space-3) var(--desk-space-4);
|
|
222
|
+
border-top: 1px solid var(--desk-rule);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* What Copy copies, out of sight: selected in place of the panel where there is no clipboard. */
|
|
226
|
+
.desk-about-copied {
|
|
227
|
+
position: absolute;
|
|
228
|
+
width: 1px;
|
|
229
|
+
height: 1px;
|
|
230
|
+
margin: -1px;
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
clip-path: inset(50%);
|
|
233
|
+
white-space: pre;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.desk-settings-page {
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
gap: var(--desk-space-5);
|
|
240
|
+
}
|
package/dist/css/overlays.css
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
background: var(--desk-surface);
|
|
22
22
|
box-shadow: var(--desk-shadow-floating);
|
|
23
23
|
animation: desk-menu-in .14s var(--desk-ease);
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Focused only so its keys scroll it (see Popover); the open dialog is its own sign of where focus is. */
|
|
28
|
+
.desk-popover:focus {
|
|
29
|
+
outline: none;
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
/* A sheet belongs to its window: the scrim covers that window and nothing else. */
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* @liberation-data/desk — shell.css */
|
|
2
|
+
/*
|
|
3
|
+
* The shell of a host running several Desk apps: one dock and one switcher around their views. Not part
|
|
4
|
+
* of desk.css, since no app draws it: the host's page imports `@liberation-data/desk/css/shell.css`
|
|
5
|
+
* after desk.css.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.desk-shell {
|
|
9
|
+
position: fixed;
|
|
10
|
+
inset: 0;
|
|
11
|
+
font-family: var(--desk-font);
|
|
12
|
+
color: var(--desk-ink);
|
|
13
|
+
background: var(--desk-ground);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.desk-shell-bar {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
padding: var(--desk-space-2) var(--desk-space-3);
|
|
21
|
+
border-bottom: 1px solid var(--desk-rule);
|
|
22
|
+
background: var(--desk-titlebar);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.desk-shell-switcher {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: var(--desk-space-1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.desk-shell-workspace {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
gap: var(--desk-space-2);
|
|
34
|
+
padding: var(--desk-space-1) var(--desk-space-3);
|
|
35
|
+
border: 1px solid transparent;
|
|
36
|
+
border-radius: 999px;
|
|
37
|
+
background: none;
|
|
38
|
+
color: var(--desk-muted);
|
|
39
|
+
font: inherit;
|
|
40
|
+
font-size: var(--desk-text-small);
|
|
41
|
+
cursor: default;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.desk-shell-workspace:hover {
|
|
45
|
+
color: var(--desk-ink);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.desk-shell-workspace[aria-current="true"] {
|
|
49
|
+
border-color: var(--desk-rule);
|
|
50
|
+
background: var(--desk-surface);
|
|
51
|
+
color: var(--desk-ink);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.desk-shell-workspace:focus-visible {
|
|
55
|
+
outline: 2px solid var(--desk-accent);
|
|
56
|
+
outline-offset: 2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.desk-shell-workspace img,
|
|
60
|
+
.desk-shell-mark {
|
|
61
|
+
width: 14px;
|
|
62
|
+
height: 14px;
|
|
63
|
+
border-radius: 4px;
|
|
64
|
+
flex: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.desk-shell-mark {
|
|
68
|
+
background: var(--desk-accent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Asleep or closed: there, and a visit away, but not running. */
|
|
72
|
+
.desk-shell-workspace:not([data-state="live"]) span {
|
|
73
|
+
opacity: 0.7;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.desk-shell-initial {
|
|
77
|
+
display: grid;
|
|
78
|
+
place-items: center;
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
font-size: var(--desk-text-lead);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.desk-shell-dot {
|
|
86
|
+
display: inline-block;
|
|
87
|
+
width: 8px;
|
|
88
|
+
height: 8px;
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
background: currentcolor;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.desk-shell-announce {
|
|
94
|
+
position: absolute;
|
|
95
|
+
width: 1px;
|
|
96
|
+
height: 1px;
|
|
97
|
+
overflow: hidden;
|
|
98
|
+
clip-path: inset(50%);
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
}
|
package/dist/css/tokens.css
CHANGED
|
@@ -88,6 +88,12 @@
|
|
|
88
88
|
--desk-widget-width: 200px;
|
|
89
89
|
/* Room the stage leaves at the bottom for something of the app's own. An overlay dock makes its own. */
|
|
90
90
|
--desk-inset-bottom: 0px;
|
|
91
|
+
/* An overview of workspaces: tiles over a radial haze from fog to its far edge, in the theme's own
|
|
92
|
+
colours. The ground with a trace of the accent, moved toward mid grey so it reads as haze rather
|
|
93
|
+
than as the desktop; the far edge darker; the tiles' shadow a tint, not a box-shadow. */
|
|
94
|
+
--desk-overview-fog: color-mix(in oklab, color-mix(in oklab, var(--desk-ground) 82%, var(--desk-accent) 18%) 88%, #808080);
|
|
95
|
+
--desk-overview-fog-far: color-mix(in oklab, var(--desk-overview-fog) 92%, #000);
|
|
96
|
+
--desk-overview-shadow: rgb(0 0 0 / 0.28);
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
@media (prefers-color-scheme: dark) {
|
|
@@ -119,6 +125,8 @@
|
|
|
119
125
|
--desk-code-keyword: #d2a8ff;
|
|
120
126
|
--desk-code-number: #ffab70;
|
|
121
127
|
--desk-code-key: #7cc4ff;
|
|
128
|
+
--desk-overview-fog-far: color-mix(in oklab, var(--desk-overview-fog) 90%, #000);
|
|
129
|
+
--desk-overview-shadow: rgb(0 0 0 / 0.55);
|
|
122
130
|
}
|
|
123
131
|
}
|
|
124
132
|
|
|
@@ -150,4 +158,6 @@
|
|
|
150
158
|
--desk-code-keyword: #d2a8ff;
|
|
151
159
|
--desk-code-number: #ffab70;
|
|
152
160
|
--desk-code-key: #7cc4ff;
|
|
161
|
+
--desk-overview-fog-far: color-mix(in oklab, var(--desk-overview-fog) 90%, #000);
|
|
162
|
+
--desk-overview-shadow: rgb(0 0 0 / 0.55);
|
|
153
163
|
}
|
package/dist/css/windows.css
CHANGED
|
@@ -747,6 +747,27 @@ button.desk-widget:hover {
|
|
|
747
747
|
overflow: hidden;
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
+
/*
|
|
751
|
+
* A centred window that fits its content (`fitContent`) is as tall as what is in it, up to its max-height.
|
|
752
|
+
* Its height comes from its content rather than the content from its height, so a pane in it is not 100% of
|
|
753
|
+
* anything: it takes its own height and gives way, with the middle scrolling, once the window is at its cap.
|
|
754
|
+
*/
|
|
755
|
+
.desk-window[data-fit] {
|
|
756
|
+
height: fit-content;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.desk-window[data-fit] > .desk-body {
|
|
760
|
+
flex: 0 1 auto;
|
|
761
|
+
display: flex;
|
|
762
|
+
flex-direction: column;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.desk-window[data-fit] > .desk-body > * {
|
|
766
|
+
flex: 0 1 auto;
|
|
767
|
+
height: auto;
|
|
768
|
+
min-height: 0;
|
|
769
|
+
}
|
|
770
|
+
|
|
750
771
|
.desk-toolbar {
|
|
751
772
|
display: flex;
|
|
752
773
|
align-items: center;
|