@liberation-data/desk 0.45.0 → 0.46.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 +58 -6
- package/dist/core/hosted.d.ts +15 -0
- package/dist/core/hosted.d.ts.map +1 -1
- package/dist/core/hosted.js +28 -0
- package/dist/core/hosted.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/theme.d.ts +15 -0
- package/dist/core/theme.d.ts.map +1 -1
- package/dist/core/theme.js +73 -1
- package/dist/core/theme.js.map +1 -1
- package/dist/css/shell.css +89 -0
- package/dist/host/checkTheme.d.ts +2 -7
- package/dist/host/checkTheme.d.ts.map +1 -1
- package/dist/host/checkTheme.js +3 -27
- package/dist/host/checkTheme.js.map +1 -1
- package/dist/host/router.d.ts +1 -0
- package/dist/host/router.d.ts.map +1 -1
- package/dist/host/router.js +11 -0
- package/dist/host/router.js.map +1 -1
- package/dist/react/context.d.ts +6 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +5 -3
- package/dist/react/context.js.map +1 -1
- package/dist/react/hostApp.d.ts +3 -1
- package/dist/react/hostApp.d.ts.map +1 -1
- package/dist/react/hostApp.js +3 -2
- package/dist/react/hostApp.js.map +1 -1
- package/dist/react/hosted.d.ts +10 -3
- package/dist/react/hosted.d.ts.map +1 -1
- package/dist/react/hosted.js +68 -8
- package/dist/react/hosted.js.map +1 -1
- package/dist/react/shell.d.ts +3 -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/dist/shell/HostOverview.d.ts +41 -0
- package/dist/shell/HostOverview.d.ts.map +1 -0
- package/dist/shell/HostOverview.js +219 -0
- package/dist/shell/HostOverview.js.map +1 -0
- package/dist/shell/HostShell.d.ts +3 -1
- package/dist/shell/HostShell.d.ts.map +1 -1
- package/dist/shell/HostShell.js +6 -4
- package/dist/shell/HostShell.js.map +1 -1
- package/dist/shell/index.d.ts +4 -0
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -0
- package/dist/shell/index.js.map +1 -1
- package/dist/shell/zoom.d.ts +62 -0
- package/dist/shell/zoom.d.ts.map +1 -0
- package/dist/shell/zoom.js +116 -0
- package/dist/shell/zoom.js.map +1 -0
- package/llms.txt +9 -4
- package/package.json +12 -7
- package/src/core/hosted.ts +33 -0
- package/src/core/index.ts +1 -1
- package/src/core/theme.ts +69 -1
- package/src/css/shell.css +89 -0
- package/src/host/checkTheme.ts +3 -25
- package/src/host/router.ts +12 -0
- package/src/react/context.tsx +9 -2
- package/src/react/hostApp.tsx +3 -2
- package/src/react/hosted.tsx +68 -8
- package/src/react/shell.tsx +4 -2
- package/src/shell/HostOverview.tsx +317 -0
- package/src/shell/HostShell.tsx +8 -5
- package/src/shell/index.ts +18 -0
- package/src/shell/zoom.ts +151 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
|
+
import { applyTheme } from '../core/theme.js';
|
|
4
|
+
import { animate, linear, pageClock } from './motion.js';
|
|
5
|
+
import { CAPTURE_WAIT_MS, overviewTiles, planZoom, poseAt } from './zoom.js';
|
|
6
|
+
const CLOSED = { zoom: 0, centre: 0, fog: 0, opacity: 1 };
|
|
7
|
+
const NONE = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
8
|
+
const prefersLessMotion = () => typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
9
|
+
const pageHidden = () => typeof document !== 'undefined' && document.visibilityState === 'hidden';
|
|
10
|
+
/** Resolves once a picture is decoded and ready to draw without a blank frame, or after `ms` regardless. */
|
|
11
|
+
function decoded(url, ms) {
|
|
12
|
+
if (!url || typeof Image === 'undefined')
|
|
13
|
+
return Promise.resolve();
|
|
14
|
+
const image = new Image();
|
|
15
|
+
image.src = url;
|
|
16
|
+
const decode = typeof image.decode === 'function' ? image.decode().catch(() => { }) : Promise.resolve();
|
|
17
|
+
let timer;
|
|
18
|
+
return Promise.race([decode, new Promise(resolve => (timer = setTimeout(resolve, ms)))]).finally(() => clearTimeout(timer));
|
|
19
|
+
}
|
|
20
|
+
export function HostOverview(props) {
|
|
21
|
+
const { workspaces, current, snapshots = {}, request, theme, insets = NONE } = props;
|
|
22
|
+
useLayoutEffect(() => {
|
|
23
|
+
if (theme)
|
|
24
|
+
applyTheme(theme);
|
|
25
|
+
}, [theme]);
|
|
26
|
+
const indexOf = (id) => Math.max(0, workspaces.findIndex(w => w.id === id));
|
|
27
|
+
const latest = useRef(props);
|
|
28
|
+
latest.current = props;
|
|
29
|
+
const layer = useRef(null);
|
|
30
|
+
const fog = useRef(null);
|
|
31
|
+
const tiles = useRef([]);
|
|
32
|
+
const pose = useRef({ ...CLOSED, centre: indexOf(current) });
|
|
33
|
+
const running = useRef(null);
|
|
34
|
+
const [open, setOpen] = useState(false);
|
|
35
|
+
const [said, setSaid] = useState('');
|
|
36
|
+
const captured = useRef(null);
|
|
37
|
+
// Whether onCover has been said since the overlay last cleared: a move asked for mid-flight carries on.
|
|
38
|
+
const covered = useRef(false);
|
|
39
|
+
// Where the focus was before the overlay, to give it back when it clears.
|
|
40
|
+
const returnTo = useRef(null);
|
|
41
|
+
/** Draws a pose: writes transforms and opacities straight to the tiles, which the compositor moves. */
|
|
42
|
+
const paint = (at) => {
|
|
43
|
+
pose.current = at;
|
|
44
|
+
const width = layer.current?.clientWidth || 1;
|
|
45
|
+
if (fog.current)
|
|
46
|
+
fog.current.style.opacity = String(at.fog);
|
|
47
|
+
overviewTiles(workspaces.length, at, width).forEach((place, i) => {
|
|
48
|
+
const tile = tiles.current[i];
|
|
49
|
+
if (!tile)
|
|
50
|
+
return;
|
|
51
|
+
tile.style.transform = `translate3d(${place.x}px, 0, ${place.z}px) scale(${place.scale})`;
|
|
52
|
+
tile.style.opacity = String(place.opacity * at.opacity);
|
|
53
|
+
tile.style.zIndex = String(place.layer);
|
|
54
|
+
tile.style.setProperty('--desk-overview-depth', String(at.zoom));
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
/** Runs a move to a pose, from where things stand. */
|
|
58
|
+
const move = (to, reduced) => {
|
|
59
|
+
running.current?.stop();
|
|
60
|
+
const plan = planZoom(pose.current, to, reduced);
|
|
61
|
+
if (!plan.phases.length || pageHidden() || latest.current.visible === false) {
|
|
62
|
+
paint(to);
|
|
63
|
+
return Promise.resolve('jumped');
|
|
64
|
+
}
|
|
65
|
+
const run = animate({ durationMs: plan.durationMs, curve: linear(plan.durationMs), step: p => paint(poseAt(plan, p * plan.durationMs)), clock: pageClock() });
|
|
66
|
+
running.current = run;
|
|
67
|
+
return run.done;
|
|
68
|
+
};
|
|
69
|
+
useLayoutEffect(() => {
|
|
70
|
+
if (props.pose)
|
|
71
|
+
paint(props.pose);
|
|
72
|
+
});
|
|
73
|
+
// A fresh capture of the current workspace has come in.
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
captured.current?.();
|
|
76
|
+
}, [snapshots[current]]);
|
|
77
|
+
useLayoutEffect(() => {
|
|
78
|
+
if (!request || props.pose) {
|
|
79
|
+
running.current?.stop();
|
|
80
|
+
covered.current = false;
|
|
81
|
+
setOpen(false);
|
|
82
|
+
setSaid('');
|
|
83
|
+
pose.current = { ...CLOSED, centre: indexOf(current) };
|
|
84
|
+
if (document.activeElement === document.body)
|
|
85
|
+
returnTo.current?.focus();
|
|
86
|
+
returnTo.current = null;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
returnTo.current ??= document.activeElement;
|
|
90
|
+
// A move asked for while the overview is open: the tiles take no clicks on the way.
|
|
91
|
+
setOpen(false);
|
|
92
|
+
let cancelled = false;
|
|
93
|
+
const cover = () => {
|
|
94
|
+
if (covered.current)
|
|
95
|
+
return;
|
|
96
|
+
covered.current = true;
|
|
97
|
+
latest.current.onCover?.();
|
|
98
|
+
};
|
|
99
|
+
const reduced = latest.current.reducedMotion ?? prefersLessMotion();
|
|
100
|
+
const jump = pageHidden() || latest.current.visible === false;
|
|
101
|
+
const here = indexOf(current);
|
|
102
|
+
const target = request.kind === 'switch' ? indexOf(request.to) : here;
|
|
103
|
+
// A switch with nothing to see, or a reduced-motion switch, needs no capture of where we are.
|
|
104
|
+
if (request.kind === 'switch' && (jump || reduced)) {
|
|
105
|
+
// A jump waits a microtask too, after any cleanup, so StrictMode's rerun arrives once.
|
|
106
|
+
if (!jump)
|
|
107
|
+
paint({ zoom: 0, centre: target, fog: 0, opacity: 0 });
|
|
108
|
+
void (jump ? Promise.resolve() : move({ zoom: 0, centre: target, fog: 0, opacity: 1 }, true)).then(() => {
|
|
109
|
+
if (cancelled)
|
|
110
|
+
return;
|
|
111
|
+
cover();
|
|
112
|
+
latest.current.onArrive(request.to);
|
|
113
|
+
});
|
|
114
|
+
return () => void (cancelled = true);
|
|
115
|
+
}
|
|
116
|
+
// Asked mid-flight, the views are already covered: carry on from where the tiles are, no capture.
|
|
117
|
+
const already = covered.current;
|
|
118
|
+
// First motion at once: the fog starts coming in while the current workspace is captured.
|
|
119
|
+
if (!already)
|
|
120
|
+
paint({ zoom: 0, centre: here, fog: 0, opacity: 0 });
|
|
121
|
+
const haze = jump || reduced || already ? null : animate({ durationMs: CAPTURE_WAIT_MS, curve: linear(CAPTURE_WAIT_MS), step: p => paint({ ...pose.current, fog: p * 0.6 }) });
|
|
122
|
+
const before = latest.current.snapshots?.[current];
|
|
123
|
+
let waiting;
|
|
124
|
+
let given;
|
|
125
|
+
const fresh = already
|
|
126
|
+
? Promise.resolve()
|
|
127
|
+
: new Promise(resolve => {
|
|
128
|
+
captured.current = () => {
|
|
129
|
+
if (latest.current.snapshots?.[current] !== before)
|
|
130
|
+
resolve();
|
|
131
|
+
};
|
|
132
|
+
waiting = setTimeout(resolve, CAPTURE_WAIT_MS);
|
|
133
|
+
const answer = latest.current.onWantCapture?.(current);
|
|
134
|
+
if (answer && typeof answer.then === 'function') {
|
|
135
|
+
answer.then(url => {
|
|
136
|
+
if (typeof url === 'string')
|
|
137
|
+
given = url;
|
|
138
|
+
resolve();
|
|
139
|
+
}, () => resolve());
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
void fresh
|
|
143
|
+
.then(() => (already ? undefined : decoded(given ?? latest.current.snapshots?.[current], CAPTURE_WAIT_MS)))
|
|
144
|
+
.then(async () => {
|
|
145
|
+
if (cancelled)
|
|
146
|
+
return;
|
|
147
|
+
haze?.stop();
|
|
148
|
+
captured.current = null;
|
|
149
|
+
if (!reduced && !already) {
|
|
150
|
+
// The picture exactly over the live view: nothing changes on screen, and the views can go.
|
|
151
|
+
paint({ ...pose.current, opacity: 1 });
|
|
152
|
+
cover();
|
|
153
|
+
}
|
|
154
|
+
if (request.kind === 'switch') {
|
|
155
|
+
await move({ zoom: 0, centre: target, fog: 1, opacity: 1 }, false);
|
|
156
|
+
if (!cancelled)
|
|
157
|
+
latest.current.onArrive(request.to);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
await move({ zoom: 1, centre: here, fog: 1, opacity: 1 }, reduced);
|
|
161
|
+
if (cancelled)
|
|
162
|
+
return;
|
|
163
|
+
cover();
|
|
164
|
+
setOpen(true);
|
|
165
|
+
setSaid(`Overview, ${workspaces.length} workspaces`);
|
|
166
|
+
});
|
|
167
|
+
return () => {
|
|
168
|
+
cancelled = true;
|
|
169
|
+
haze?.stop();
|
|
170
|
+
running.current?.stop();
|
|
171
|
+
clearTimeout(waiting);
|
|
172
|
+
captured.current = null;
|
|
173
|
+
};
|
|
174
|
+
// A new request object is a new move; the rest is read when it starts.
|
|
175
|
+
}, [request, Boolean(props.pose)]);
|
|
176
|
+
// Once the tiles can take it, the focus goes to the current one.
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (open)
|
|
179
|
+
tiles.current[indexOf(latest.current.current)]?.focus();
|
|
180
|
+
}, [open]);
|
|
181
|
+
const reduced = () => latest.current.reducedMotion ?? prefersLessMotion();
|
|
182
|
+
const choose = (i) => {
|
|
183
|
+
if (!open)
|
|
184
|
+
return;
|
|
185
|
+
setOpen(false);
|
|
186
|
+
const id = workspaces[i].id;
|
|
187
|
+
// Cleared or replaced on the way (the move stopped): the host has moved on, so no arrival.
|
|
188
|
+
void move({ zoom: 0, centre: i, fog: 1, opacity: 1 }, reduced()).then(how => how !== 'stopped' && latest.current.onArrive(id));
|
|
189
|
+
};
|
|
190
|
+
const onKeyDown = (event) => {
|
|
191
|
+
if (!open)
|
|
192
|
+
return;
|
|
193
|
+
const index = tiles.current.indexOf(document.activeElement);
|
|
194
|
+
if (event.key === 'Escape') {
|
|
195
|
+
event.preventDefault();
|
|
196
|
+
return choose(indexOf(current));
|
|
197
|
+
}
|
|
198
|
+
const next = event.key === 'ArrowRight' ? Math.min(index + 1, workspaces.length - 1)
|
|
199
|
+
: event.key === 'ArrowLeft' ? Math.max(index - 1, 0)
|
|
200
|
+
: event.key === 'Home' ? 0
|
|
201
|
+
: event.key === 'End' ? workspaces.length - 1
|
|
202
|
+
: null;
|
|
203
|
+
if (next === null || index < 0)
|
|
204
|
+
return;
|
|
205
|
+
event.preventDefault();
|
|
206
|
+
// The one Tab stop goes with the focus, as in the switcher.
|
|
207
|
+
tiles.current.forEach((tile, i) => tile && (tile.tabIndex = i === next ? 0 : -1));
|
|
208
|
+
tiles.current[next]?.focus();
|
|
209
|
+
// The row follows the focus, so the chosen tile comes to the centre.
|
|
210
|
+
void move({ ...pose.current, zoom: 1, centre: next }, false);
|
|
211
|
+
};
|
|
212
|
+
if (!request && !props.pose)
|
|
213
|
+
return null;
|
|
214
|
+
return (_jsxs("div", { ref: layer, className: "desk-overview", style: { top: insets.top, right: insets.right, bottom: insets.bottom, left: insets.left }, role: "dialog", "aria-label": "Overview", "aria-modal": open || undefined, onKeyDown: onKeyDown, children: [_jsx("div", { ref: fog, className: "desk-overview-fog" }), workspaces.map((w, i) => {
|
|
215
|
+
const picture = snapshots[w.id];
|
|
216
|
+
return (_jsxs("button", { ref: el => void (tiles.current[i] = el), type: "button", className: "desk-overview-tile", tabIndex: open && i === indexOf(current) ? 0 : -1, "aria-current": w.id === current ? 'true' : undefined, "aria-label": w.title, disabled: !open, "data-state": w.state, onClick: () => choose(i), children: [_jsx("span", { className: "desk-overview-shadow", "aria-hidden": "true" }), picture ? (_jsx("img", { src: picture, alt: "", draggable: false })) : (_jsxs("span", { className: "desk-overview-note", "aria-hidden": "true", children: [_jsx("strong", { children: w.title }), w.state === 'live' ? 'Live' : null] })), _jsx("span", { className: "desk-overview-title", "aria-hidden": "true", children: w.title })] }, w.id));
|
|
217
|
+
}), _jsx("div", { className: "desk-shell-announce", role: "status", "aria-live": "polite", children: said })] }));
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=HostOverview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HostOverview.js","sourceRoot":"","sources":["../../src/shell/HostOverview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAsD5E,MAAM,MAAM,GAAiB,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAA;AACvE,MAAM,IAAI,GAAgB,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAA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C,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,oBAAoB,EAC9B,QAAQ,EAAE,IAAI,IAAI,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBACnC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,gBACvC,CAAC,CAAC,KAAK,EACnB,QAAQ,EAAE,CAAC,IAAI,gBACH,CAAC,CAAC,KAAK,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,aAExB,eAAM,SAAS,EAAC,sBAAsB,iBAAa,MAAM,GAAG,EAC3D,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,EAAE,EAAC,SAAS,EAAE,KAAK,GAAI,CAC/C,CAAC,CAAC,CAAC,CACF,gBAAM,SAAS,EAAC,oBAAoB,iBAAa,MAAM,aACrD,2BAAS,CAAC,CAAC,KAAK,GAAU,EACzB,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAC9B,CACR,EACD,eAAM,SAAS,EAAC,qBAAqB,iBAAa,MAAM,YACrD,CAAC,CAAC,KAAK,GACH,KAtBF,CAAC,CAAC,EAAE,CAuBF,CACV,CAAA;YACH,CAAC,CAAC,EACF,cAAK,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAC,QAAQ,eAAW,QAAQ,YAClE,IAAI,GACD,IACF,CACP,CAAA;AACH,CAAC"}
|
|
@@ -43,8 +43,10 @@ export interface HostShellProps {
|
|
|
43
43
|
readonly onInsets?: (insets: ShellInsets) => void;
|
|
44
44
|
/** The switching keys; the platform's defaults if left out, none at all with null. */
|
|
45
45
|
readonly keys?: SwitchKeys | null;
|
|
46
|
-
/** How a click in the switcher switches. */
|
|
46
|
+
/** How a click in the switcher switches: through the overview by default; the keys always slide. */
|
|
47
47
|
readonly clickSwitch?: SwitchHow;
|
|
48
|
+
/** The overview key was pressed on this page; a host catches it first when an app has focus. */
|
|
49
|
+
readonly onOverview?: () => void;
|
|
48
50
|
readonly dockSide?: DockSide;
|
|
49
51
|
}
|
|
50
52
|
/** An app's dock entries, as data, turned back into entries the drawn dock draws; choosing one asks the host. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostShell.d.ts","sourceRoot":"","sources":["../../src/shell/HostShell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAgB,MAAM,mBAAmB,CAAA;AAE/F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAGjD,OAAO,KAAK,EAAE,SAAS,EAAY,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAe3C,uDAAuD;AACvD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,mCAAmC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,iDAAiD;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,yGAAyG;IACzG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,WAAW,CAAA;CACnD;AAED,0FAA0F;AAC1F,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC,kGAAkG;AAClG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAA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EAAE,MAAM,CAAC,CAAC,CAAA;IACrD,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,KAAK,IAAI,CAAA;IACvD,6GAA6G;IAC7G,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAClF,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;IACjD,sFAAsF;IACtF,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACjC,oGAAoG;IACpG,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;IAChC,gGAAgG;IAChG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAC7B;AAKD,iHAAiH;AACjH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,EAAE,CAgB7G;AAID,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAO9C"}
|
package/dist/shell/HostShell.js
CHANGED
|
@@ -30,7 +30,7 @@ export function HostShell(props) {
|
|
|
30
30
|
// Its own desk, never hosted: this page is the host's, drawing for the apps.
|
|
31
31
|
return (_jsx(DeskProvider, { host: null, look: props.theme?.look ?? 'auto', children: _jsx(Shell, { ...props }) }));
|
|
32
32
|
}
|
|
33
|
-
function Shell({ workspaces, current, chrome, theme, onSwitch, onCommand, onInsets, keys, clickSwitch = '
|
|
33
|
+
function Shell({ workspaces, current, chrome, theme, onSwitch, onCommand, onInsets, onOverview, keys, clickSwitch = 'zoom', dockSide = 'left' }) {
|
|
34
34
|
useLayoutEffect(() => {
|
|
35
35
|
if (theme)
|
|
36
36
|
applyTheme(theme);
|
|
@@ -52,16 +52,18 @@ function Shell({ workspaces, current, chrome, theme, onSwitch, onCommand, onInse
|
|
|
52
52
|
return;
|
|
53
53
|
const onKey = (event) => {
|
|
54
54
|
const action = switchKeyAction(event, bound);
|
|
55
|
-
if (action
|
|
55
|
+
if (!action)
|
|
56
56
|
return;
|
|
57
|
-
const to = neighbour(workspaces, current, action);
|
|
58
57
|
event.preventDefault();
|
|
58
|
+
if (action === 'overview')
|
|
59
|
+
return onOverview?.();
|
|
60
|
+
const to = neighbour(workspaces, current, action);
|
|
59
61
|
if (to)
|
|
60
62
|
onSwitch(to.id, 'slide');
|
|
61
63
|
};
|
|
62
64
|
window.addEventListener('keydown', onKey);
|
|
63
65
|
return () => window.removeEventListener('keydown', onKey);
|
|
64
|
-
}, [bound, workspaces, current, onSwitch]);
|
|
66
|
+
}, [bound, workspaces, current, onSwitch, onOverview]);
|
|
65
67
|
const root = useRef(null);
|
|
66
68
|
useInsets(root, dockSide, onInsets);
|
|
67
69
|
return (_jsxs("div", { ref: root, className: "desk-shell", "data-dock-side": dockSide, children: [_jsx("div", { className: "desk-shell-bar", children: _jsx(Switcher, { workspaces: workspaces, current: current, onChoose: id => id !== current && onSwitch(id, clickSwitch) }) }), _jsx(Dock, { entries: entries, side: dockSide, label: `${workspaces.find(w => w.id === current)?.title ?? 'App'} dock` }), _jsx("div", { className: "desk-shell-announce", role: "status", "aria-live": "polite", children: arrived })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HostShell.js","sourceRoot":"","sources":["../../src/shell/HostShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG7E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,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O,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzE,MAAM,EAAE,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5E,CAAA;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YAClC,IAAI,GAAG,KAAK,IAAI,CAAC,OAAO;gBAAE,OAAM;YAChC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAA;YAClB,QAAQ,CAAC,MAAM,CAAC,CAAA;QAClB,CAAC,CAAA;QACD,OAAO,EAAE,CAAA;QACT,IAAI,OAAO,cAAc,KAAK,WAAW;YAAE,OAAM;QACjD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAA;QAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACpB,EAAE,CAAC,gBAAgB,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QAC1F,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAA;IACpC,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export { dockFromHost, HostShell } from './HostShell.js';
|
|
2
|
+
export { HostOverview } from './HostOverview.js';
|
|
3
|
+
export type { HostOverviewProps, OverviewRequest } from './HostOverview.js';
|
|
2
4
|
export type { HostShellProps, ShellInsets, ShellWorkspace, SwitchHow } from './HostShell.js';
|
|
3
5
|
export { neighbour, platformOf, switchKeyAction, switchKeys } from './keys.js';
|
|
4
6
|
export type { KeyInput, ShellPlatform, SwitchKey, SwitchKeys } from './keys.js';
|
|
5
7
|
export { animate, FADE_MS, linear, pageClock, SLIDE_MS, slideOffsets, slidePlan, spring, timerClock } from './motion.js';
|
|
6
8
|
export type { Animation, AnimateOptions, FrameClock, SlideOffsets, SlidePlan } from './motion.js';
|
|
9
|
+
export { CAPTURE_WAIT_MS, cubicBezier, easeIn, easeInOut, easeOut, OVERVIEW_SCALE, overviewTiles, planZoom, poseAt, ZOOM_ACROSS_MS, ZOOM_FADE_MS, ZOOM_IN_MS, ZOOM_OUT_MS, } from './zoom.js';
|
|
10
|
+
export type { OverviewPose, TilePlace, ZoomPhase, ZoomPlan } from './zoom.js';
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxD,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC5F,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC9E,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxH,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC3E,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC5F,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC9E,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxH,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjG,OAAO,EACL,eAAe,EACf,WAAW,EACX,MAAM,EACN,SAAS,EACT,OAAO,EACP,cAAc,EACd,aAAa,EACb,QAAQ,EACR,MAAM,EACN,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/shell/index.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* app does, and nothing in core or react imports it.
|
|
5
5
|
*/
|
|
6
6
|
export { dockFromHost, HostShell } from './HostShell.js';
|
|
7
|
+
export { HostOverview } from './HostOverview.js';
|
|
7
8
|
export { neighbour, platformOf, switchKeyAction, switchKeys } from './keys.js';
|
|
8
9
|
export { animate, FADE_MS, linear, pageClock, SLIDE_MS, slideOffsets, slidePlan, spring, timerClock } from './motion.js';
|
|
10
|
+
export { CAPTURE_WAIT_MS, cubicBezier, easeIn, easeInOut, easeOut, OVERVIEW_SCALE, overviewTiles, planZoom, poseAt, ZOOM_ACROSS_MS, ZOOM_FADE_MS, ZOOM_IN_MS, ZOOM_OUT_MS, } from './zoom.js';
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
package/dist/shell/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE9E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExH,OAAO,EACL,eAAe,EACf,WAAW,EACX,MAAM,EACN,SAAS,EACT,OAAO,EACP,cAAc,EACd,aAAa,EACb,QAAQ,EACR,MAAM,EACN,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Zooming out, moving across, zooming in, and the capture wait, in ms. */
|
|
2
|
+
export declare const ZOOM_OUT_MS = 200;
|
|
3
|
+
export declare const ZOOM_ACROSS_MS = 250;
|
|
4
|
+
export declare const ZOOM_IN_MS = 200;
|
|
5
|
+
/** How long to wait for a fresh capture of the current workspace before zooming from the picture already held. */
|
|
6
|
+
export declare const CAPTURE_WAIT_MS = 100;
|
|
7
|
+
/** Reduced motion: every move is this cross-fade, in place. */
|
|
8
|
+
export declare const ZOOM_FADE_MS = 120;
|
|
9
|
+
/** A CSS `cubic-bezier`, as a function of time from 0 to 1. */
|
|
10
|
+
export declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number;
|
|
11
|
+
export declare const easeOut: (t: number) => number;
|
|
12
|
+
export declare const easeIn: (t: number) => number;
|
|
13
|
+
export declare const easeInOut: (t: number) => number;
|
|
14
|
+
export interface OverviewPose {
|
|
15
|
+
/** 0 is a full-size desktop, 1 the overview. */
|
|
16
|
+
readonly zoom: number;
|
|
17
|
+
/** The index of the centred workspace; fractional while the row moves. */
|
|
18
|
+
readonly centre: number;
|
|
19
|
+
readonly fog: number;
|
|
20
|
+
readonly opacity: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ZoomPhase {
|
|
23
|
+
readonly name: 'out' | 'across' | 'in' | 'fade';
|
|
24
|
+
readonly durationMs: number;
|
|
25
|
+
readonly from: OverviewPose;
|
|
26
|
+
readonly to: OverviewPose;
|
|
27
|
+
readonly ease: (t: number) => number;
|
|
28
|
+
}
|
|
29
|
+
export interface ZoomPlan {
|
|
30
|
+
readonly phases: readonly ZoomPhase[];
|
|
31
|
+
readonly durationMs: number;
|
|
32
|
+
/** The pose asked for: what poseAt gives for a plan with nothing to do (no phases). */
|
|
33
|
+
readonly to: OverviewPose;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* How to get from one pose to another. Out of a full-size desktop first if the row must move or the
|
|
37
|
+
* overview is the goal (200 ms, ease-out); across if another workspace is to be centred (250 ms,
|
|
38
|
+
* ease-in-out); then in, if the goal is a desktop (200 ms, ease-in). A click on another workspace is
|
|
39
|
+
* all three, about 650 ms. Under reduced motion it is one 120 ms fade in at the goal.
|
|
40
|
+
*/
|
|
41
|
+
export declare function planZoom(from: OverviewPose, to: OverviewPose, reducedMotion?: boolean): ZoomPlan;
|
|
42
|
+
/** Where a plan stands `elapsedMs` after it started: its goal from its duration on. */
|
|
43
|
+
export declare function poseAt(plan: ZoomPlan, elapsedMs: number): OverviewPose;
|
|
44
|
+
/** One tile as drawn: offsets in px from the desktop area's centre, a scale, and an opacity. */
|
|
45
|
+
export interface TilePlace {
|
|
46
|
+
readonly x: number;
|
|
47
|
+
/** Into the screen, under the layer's perspective: negative is further back. */
|
|
48
|
+
readonly z: number;
|
|
49
|
+
readonly scale: number;
|
|
50
|
+
readonly opacity: number;
|
|
51
|
+
/** Paint order: the centred tile on top. */
|
|
52
|
+
readonly layer: number;
|
|
53
|
+
}
|
|
54
|
+
/** The centred tile's scale in the overview, and how much space is between tiles. */
|
|
55
|
+
export declare const OVERVIEW_SCALE = 0.62;
|
|
56
|
+
/**
|
|
57
|
+
* Every tile's place at a pose, for a desktop area `width` px wide. At zoom 0 the centred tile fills
|
|
58
|
+
* the area and its neighbours sit just beside it, as in the slide; at 1 the row floats in the fog,
|
|
59
|
+
* neighbours further back, smaller and fainter, and nothing rotates.
|
|
60
|
+
*/
|
|
61
|
+
export declare function overviewTiles(count: number, pose: OverviewPose, width: number): TilePlace[];
|
|
62
|
+
//# sourceMappingURL=zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../src/shell/zoom.ts"],"names":[],"mappings":"AAaA,2EAA2E;AAC3E,eAAO,MAAM,WAAW,MAAM,CAAA;AAC9B,eAAO,MAAM,cAAc,MAAM,CAAA;AACjC,eAAO,MAAM,UAAU,MAAM,CAAA;AAC7B,kHAAkH;AAClH,eAAO,MAAM,eAAe,MAAM,CAAA;AAClC,+DAA+D;AAC/D,eAAO,MAAM,YAAY,MAAM,CAAA;AAE/B,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EA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AED,gGAAgG;AAChG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,qFAAqF;AACrF,eAAO,MAAM,cAAc,OAAO,CAAA;AAOlC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAa3F"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* THE OVERVIEW AND THE ZOOM, AS NUMBERS.
|
|
3
|
+
*
|
|
4
|
+
* A live view can't be scaled (smaller bounds relay it out), so the zoom is drawn with pictures on an
|
|
5
|
+
* overlay: the current workspace's capture sits exactly over its live view, shrinks back into a fog
|
|
6
|
+
* where the workspaces float, the row moves across, and the target grows back to full size, where the
|
|
7
|
+
* host swaps its live view in. This file is where everything stands at each moment, with no DOM: the
|
|
8
|
+
* overlay draws from it, and a host can read the same plan to know how long a move takes.
|
|
9
|
+
*
|
|
10
|
+
* A pose is one moment: how far zoomed out (0 is a full-size desktop, 1 the overview), which workspace
|
|
11
|
+
* is centred (fractional while the row moves), how much fog shows, and how opaque the tiles are.
|
|
12
|
+
*/
|
|
13
|
+
/** Zooming out, moving across, zooming in, and the capture wait, in ms. */
|
|
14
|
+
export const ZOOM_OUT_MS = 200;
|
|
15
|
+
export const ZOOM_ACROSS_MS = 250;
|
|
16
|
+
export const ZOOM_IN_MS = 200;
|
|
17
|
+
/** How long to wait for a fresh capture of the current workspace before zooming from the picture already held. */
|
|
18
|
+
export const CAPTURE_WAIT_MS = 100;
|
|
19
|
+
/** Reduced motion: every move is this cross-fade, in place. */
|
|
20
|
+
export const ZOOM_FADE_MS = 120;
|
|
21
|
+
/** A CSS `cubic-bezier`, as a function of time from 0 to 1. */
|
|
22
|
+
export function cubicBezier(x1, y1, x2, y2) {
|
|
23
|
+
const at = (a, b, s) => 3 * a * s * (1 - s) ** 2 + 3 * b * s * s * (1 - s) + s ** 3;
|
|
24
|
+
return t => {
|
|
25
|
+
if (t <= 0)
|
|
26
|
+
return 0;
|
|
27
|
+
if (t >= 1)
|
|
28
|
+
return 1;
|
|
29
|
+
// Find s with x(s) = t by bisection: x is increasing, and 20 halvings are well under a pixel.
|
|
30
|
+
let lo = 0;
|
|
31
|
+
let hi = 1;
|
|
32
|
+
for (let i = 0; i < 20; i++) {
|
|
33
|
+
const mid = (lo + hi) / 2;
|
|
34
|
+
if (at(x1, x2, mid) < t)
|
|
35
|
+
lo = mid;
|
|
36
|
+
else
|
|
37
|
+
hi = mid;
|
|
38
|
+
}
|
|
39
|
+
return at(y1, y2, (lo + hi) / 2);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export const easeOut = cubicBezier(0, 0, 0.58, 1);
|
|
43
|
+
export const easeIn = cubicBezier(0.42, 0, 1, 1);
|
|
44
|
+
export const easeInOut = cubicBezier(0.42, 0, 0.58, 1);
|
|
45
|
+
const straight = (t) => Math.min(1, Math.max(0, t));
|
|
46
|
+
/**
|
|
47
|
+
* How to get from one pose to another. Out of a full-size desktop first if the row must move or the
|
|
48
|
+
* overview is the goal (200 ms, ease-out); across if another workspace is to be centred (250 ms,
|
|
49
|
+
* ease-in-out); then in, if the goal is a desktop (200 ms, ease-in). A click on another workspace is
|
|
50
|
+
* all three, about 650 ms. Under reduced motion it is one 120 ms fade in at the goal.
|
|
51
|
+
*/
|
|
52
|
+
export function planZoom(from, to, reducedMotion = false) {
|
|
53
|
+
if (reducedMotion) {
|
|
54
|
+
const phases = [{ name: 'fade', durationMs: ZOOM_FADE_MS, from: { ...to, opacity: 0 }, to: { ...to, opacity: 1 }, ease: straight }];
|
|
55
|
+
return { phases, durationMs: ZOOM_FADE_MS, to };
|
|
56
|
+
}
|
|
57
|
+
const phases = [];
|
|
58
|
+
let at = from;
|
|
59
|
+
const go = (name, durationMs, ease, next) => {
|
|
60
|
+
phases.push({ name, durationMs, from: at, to: next, ease });
|
|
61
|
+
at = next;
|
|
62
|
+
};
|
|
63
|
+
const moves = from.centre !== to.centre;
|
|
64
|
+
if (at.zoom < 1 && (moves || to.zoom === 1))
|
|
65
|
+
go('out', ZOOM_OUT_MS, easeOut, { zoom: 1, centre: at.centre, fog: Math.max(at.fog, to.fog), opacity: 1 });
|
|
66
|
+
if (moves)
|
|
67
|
+
go('across', ZOOM_ACROSS_MS, easeInOut, { ...at, centre: to.centre });
|
|
68
|
+
if (to.zoom < at.zoom)
|
|
69
|
+
go('in', ZOOM_IN_MS, easeIn, { ...to, centre: to.centre });
|
|
70
|
+
return { phases, durationMs: phases.reduce((total, p) => total + p.durationMs, 0), to };
|
|
71
|
+
}
|
|
72
|
+
const lerp = (a, b, t) => a + (b - a) * t;
|
|
73
|
+
/** Where a plan stands `elapsedMs` after it started: its goal from its duration on. */
|
|
74
|
+
export function poseAt(plan, elapsedMs) {
|
|
75
|
+
let left = elapsedMs;
|
|
76
|
+
for (const phase of plan.phases) {
|
|
77
|
+
if (left < phase.durationMs) {
|
|
78
|
+
const t = phase.ease(left / phase.durationMs);
|
|
79
|
+
return {
|
|
80
|
+
zoom: lerp(phase.from.zoom, phase.to.zoom, t),
|
|
81
|
+
centre: lerp(phase.from.centre, phase.to.centre, t),
|
|
82
|
+
fog: lerp(phase.from.fog, phase.to.fog, t),
|
|
83
|
+
opacity: lerp(phase.from.opacity, phase.to.opacity, t),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
left -= phase.durationMs;
|
|
87
|
+
}
|
|
88
|
+
return plan.phases.at(-1)?.to ?? plan.to;
|
|
89
|
+
}
|
|
90
|
+
/** The centred tile's scale in the overview, and how much space is between tiles. */
|
|
91
|
+
export const OVERVIEW_SCALE = 0.62;
|
|
92
|
+
const GAP = 1.08;
|
|
93
|
+
/** Each step away from the centre: this far back, this much smaller, this much fainter. */
|
|
94
|
+
const STEP_BACK = 80;
|
|
95
|
+
const STEP_SCALE = 0.92;
|
|
96
|
+
const STEP_OPACITY = 0.85;
|
|
97
|
+
/**
|
|
98
|
+
* Every tile's place at a pose, for a desktop area `width` px wide. At zoom 0 the centred tile fills
|
|
99
|
+
* the area and its neighbours sit just beside it, as in the slide; at 1 the row floats in the fog,
|
|
100
|
+
* neighbours further back, smaller and fainter, and nothing rotates.
|
|
101
|
+
*/
|
|
102
|
+
export function overviewTiles(count, pose, width) {
|
|
103
|
+
const scale = lerp(1, OVERVIEW_SCALE, pose.zoom);
|
|
104
|
+
const pitch = width * lerp(1, OVERVIEW_SCALE * GAP, pose.zoom);
|
|
105
|
+
return Array.from({ length: count }, (_, i) => {
|
|
106
|
+
const away = Math.min(Math.abs(i - pose.centre), 2);
|
|
107
|
+
return {
|
|
108
|
+
x: Math.round((i - pose.centre) * pitch),
|
|
109
|
+
z: -STEP_BACK * away * pose.zoom,
|
|
110
|
+
scale: scale * lerp(1, STEP_SCALE ** away, pose.zoom),
|
|
111
|
+
opacity: lerp(1, STEP_OPACITY ** away, pose.zoom),
|
|
112
|
+
layer: count - Math.round(Math.abs(i - pose.centre)),
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.js","sourceRoot":"","sources":["../../src/shell/zoom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;AACjC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;AAC7B,kHAAkH;A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AE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;QACnD,OAAO;YACL,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;YACxC,CAAC,EAAE,CAAC,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC,IAAI;YAChC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,EAAE,UAAU,IAAI,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;YACrD,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,YAAY,IAAI,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;YACjD,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;SACrD,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -381,17 +381,21 @@ useWindowMenus(menus: Menu[]) // inside a window: its menus join the bar while
|
|
|
381
381
|
// about: { name, version?, links, note? (text only), facts: { title?, facts: { name, value, link?, copy?: false }[] }[] | null } from the app declaration; facts null while read, [] for nothing to report. Hosted implies themeFromHost; the primary declares themeFromHost: false to keep its Appearance and its own theme.
|
|
382
382
|
interface DeskHostBridge { version: 1; send(m: AppToHost): void; onMessage(l: (m: HostToApp) => void): () => void }
|
|
383
383
|
connectHost(bridge): HostClient // core, for a page without React; DeskProvider calls it
|
|
384
|
-
useHost(): HostClient | null // publish(topic, payload); subscribe(publisher: appId | 'primary', topic, handler); onCommand; setChrome
|
|
385
|
-
|
|
384
|
+
useHost(): HostClient | null // publish(topic, payload); subscribe(publisher: appId | 'primary', topic, handler); onCommand; setChrome; primary(): boolean | null; onRole(l: (primary) => void)
|
|
385
|
+
// connectHost sends { kind: 'hello' }; the host answers { kind: 'role', primary: boolean }, again on any change (createBroadcastRouter does; a host without it must). No answer: nothing published by default.
|
|
386
|
+
// The primary publishes appliedTheme(root?) (scheme, look, --desk-* tokens as worn; url() tokens and fonts left out) by default, again on change; <DeskShell|DeskProvider publishTheme={false}> turns it off
|
|
387
|
+
useHosted(): boolean; useHostBroadcast(publisher, topic, handler); usePublishTheme(theme: DeskTheme | null) // publishes this theme instead of appliedTheme while mounted
|
|
386
388
|
interface DeskTheme { mode: 'light'|'dark'; look: Look; tokens: Record<`--${string}`, string>; fonts?: { family; src; weight?; style? }[]; wallpaper?: string }
|
|
387
389
|
<DeskShell onTheme={theme => …}> // keep some looks of your own; mode and look always apply. Default: applyTheme(theme)
|
|
388
390
|
hostDockModel(entries, state): { model: HostDockEntry[]; run: Map<id, DockItem> } // the dock as data, as HostedDock sends it
|
|
389
391
|
// '@liberation-data/desk/host' (the host's half): createBroadcastRouter({ deliver, chrome?: (appId, chrome, dropped: string[]) => void, check?, maxPayload?, limits?: { burst?, perSecond?, topics?, maxTopics? }, clock? }), router.limited(appId), checkTheme(theme, origin), checkChrome(chrome, origin): { ok: true, chrome, dropped } | { ok: false, reason }, createMemoryHost()
|
|
390
|
-
// '@liberation-data/desk/shell' (the host's page only, with css/shell.css): <HostShell workspaces={{ id, title, accent?, icon?, primary?, state: 'live'|'suspended'|'discarded' }[]} current chrome={Record<appId, DeskChrome|null>} theme? snapshots?={Record<id, imageUrl>} keys?={SwitchKeys|null} clickSwitch?={'slide'} dockSide? onSwitch={(id, how) => …} onCommand={(appId, 'dock'|'menu'|'settings', itemId) => …} onInsets?={({ top, right, bottom, left }) => …} />
|
|
392
|
+
// '@liberation-data/desk/shell' (the host's page only, with css/shell.css): <HostShell workspaces={{ id, title, accent?, icon?, primary?, state: 'live'|'suspended'|'discarded' }[]} current chrome={Record<appId, DeskChrome|null>} theme? snapshots?={Record<id, imageUrl>} keys?={SwitchKeys|null} clickSwitch?={'zoom'|'slide'} dockSide? onSwitch={(id, how) => …} onOverview?={() => …} onCommand={(appId, 'dock'|'menu'|'settings', itemId) => …} onInsets?={({ top, right, bottom, left }) => …} />
|
|
391
393
|
// It draws the current app's dock and a switcher (one Tab stop, arrows/Home/End, title announced once on arrival); the host moves the views and passes the new current.
|
|
392
394
|
// switchKeys(platformOf(process.platform)): mac Ctrl+Opt+←/→/↑, Linux Super+Alt, Windows Ctrl+Alt; switchKeyAction(pageEvent | electronInput, keys): 'previous'|'next'|'overview'|null (key releases ignored); neighbour(workspaces, current, step) | null at the ends
|
|
393
395
|
// slidePlan(reducedMotion): { kind: 'slide', 350 } | { kind: 'fade', 120 }; spring(ms, from?, velocity?) → t => progress, no overshoot; slideOffsets(progress, 1|-1, width): { leaving, arriving } whole px, no gap: clip views to the desktop area or they cover the dock
|
|
394
396
|
// animate({ durationMs, step, curve?, clock?: pageClock()|timerClock(), timeoutMs? = 250 }): { done: 'finished'|'jumped'|'stopped', progress(), stop() }; jumps to 1 when frames stop
|
|
397
|
+
// <HostOverview workspaces current snapshots?={Record<id, imageUrl>} request={{ kind: 'open' } | { kind: 'switch', to } | null} theme? insets? visible? reducedMotion? pose? onWantCapture?={id => …} onCover?={() => …} onArrive={id => …} /> // an overlay over the views; capture on onWantCapture into snapshots and return a promise of its URL (an identical picture still counts; waits 100 ms at most), hide views on onCover, swap the view in and clear request on onArrive; each once per move; the host revokes its own snapshot URLs
|
|
398
|
+
// planZoom(from, to, reducedMotion?): { phases: out 200 / across 250 / in 200 | fade 120, durationMs, to }; poseAt(plan, ms): { zoom, centre, fog, opacity }; overviewTiles(count, pose, width): { x, z, scale, opacity, layer }[]
|
|
395
399
|
// Rate limits per publisher+topic: 20 then 10/s (theme 2 then 1/s), 64 topics at once; over it the latest is held (never queued), so subscribers end on the last value; order holds within a topic.
|
|
396
400
|
// register({ id, origin, primary?, publishes? }): the primary's publishes must include 'theme'. A deliver that throws for one app still lets the rest hear; the error is thrown after.
|
|
397
401
|
// chrome(appId, null) when an app is unregistered: stop drawing its chrome. The primary's last theme is kept while it is down and replayed to subscribers of 'primary'.
|
|
@@ -751,4 +755,5 @@ in the accessibility tree.
|
|
|
751
755
|
- `npm run size` enforces a budget on each entry, measured gzipped without comments (so explanations cost nothing): core 13.5 KiB, react 70.5, css 14, fx 4, host 7.5; each is the measured size plus 1 KiB, rounded up to a half.
|
|
752
756
|
- `fx.play` never resumes audio itself: outside a press a browser's resume may never settle. Call
|
|
753
757
|
`fx.unlock()` at startup, or nothing sounds until a press after the sound was due.
|
|
754
|
-
- The package is ESM
|
|
758
|
+
- The package is ESM, with `"sideEffects": ["**/*.css"]`. CommonJS code (an Electron main process) can `require()` every
|
|
759
|
+
entry on Node 22.12 or later.
|