@fungi.computer/tourtois 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppPane.js +9 -4
- package/dist/AppWorkbench.js +3 -1
- package/dist/use-window-motion.d.ts +3 -3
- package/dist/use-window-motion.js +20 -4
- package/package.json +8 -7
package/dist/AppPane.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Alert } from "@fungi.computer/caps/components/alert";
|
|
3
|
+
import { Button } from "@fungi.computer/caps/components/button";
|
|
2
4
|
import { IconButton } from "@fungi.computer/caps/components/icon-button";
|
|
3
5
|
import { AppStatusBar, AppStatusItem, StatusBarChip, StatusBarPicker, } from "@fungi.computer/caps/blocks/app-status-bar";
|
|
4
6
|
import { Sigil } from "@fungi.computer/sigils";
|
|
@@ -87,7 +89,7 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
87
89
|
minima: { width: 320, height: 360 },
|
|
88
90
|
}, { participating: projection.status !== "minimized" });
|
|
89
91
|
const layout = useMaosaicoLayout();
|
|
90
|
-
const element = useWindowMotion(binding, layout.interacting);
|
|
92
|
+
const element = useWindowMotion(binding, layout.interacting, layout.bounds);
|
|
91
93
|
const zoomed = layout.zoomedId === projection.windowId;
|
|
92
94
|
const zoom = () => {
|
|
93
95
|
layout.zoom(zoomed ? null : projection.windowId);
|
|
@@ -176,9 +178,12 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
176
178
|
}, onClose: close }) }) }), projection.status === "loading" ||
|
|
177
179
|
projection.status === "getting-ready" ? (_jsxs("div", { className: "tourtois-app-loading", role: "status", children: [_jsx(AppIcon, { roles: projection.launch.roles, icon: icon }), _jsxs("div", { children: [_jsx("strong", { children: projection.status === "getting-ready"
|
|
178
180
|
? "Getting ready…"
|
|
179
|
-
: `Opening ${projection.launch.title}…` }), _jsx("span", { children: "Preparing this App for your workspace." })] })] })) : null, projection.status === "error" &&
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
: `Opening ${projection.launch.title}…` }), _jsx("span", { children: "Preparing this App for your workspace." })] })] })) : null, projection.status === "error" ? (_jsx("div", { className: "tourtois-window-status", children: _jsx(Alert, { tone: "warning", title: projection.error instanceof AppError &&
|
|
182
|
+
projection.error.code === "DISCONNECTED"
|
|
183
|
+
? "This App lost its connection."
|
|
184
|
+
: windowStatusLabel(projection), description: "Check your connection and the host before reloading. A request may have completed even if its reply did not arrive; check its result before repeating it.", children: _jsx("div", { style: { marginTop: "var(--spacing-md)" }, children: _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
185
|
+
window.location.reload();
|
|
186
|
+
}, children: "Reload workspace" }) }) }) })) : null, _jsx(WindowBody, { ref: containerRef, className: "tourtois-pane-body", hidden: projection.status === "error" }), _jsx(WindowStatusBar, { projection: projection, onReload: nextLaunch && nextLaunch.releaseId !== projection.launch.releaseId
|
|
182
187
|
? () => {
|
|
183
188
|
void manager
|
|
184
189
|
.replace(projection.windowId, nextLaunch)
|
package/dist/AppWorkbench.js
CHANGED
|
@@ -83,6 +83,8 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
83
83
|
selectionRefreshes.current.delete(window.windowId);
|
|
84
84
|
}, [appProjection]);
|
|
85
85
|
const [appStatus, setAppStatus] = useState(null);
|
|
86
|
+
// Browser network state cannot establish host reachability (notably local
|
|
87
|
+
// Oyster on loopback). Show recovery only for an observed App failure.
|
|
86
88
|
useEffect(() => {
|
|
87
89
|
if (!appStatus)
|
|
88
90
|
return;
|
|
@@ -531,7 +533,7 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
531
533
|
}, onOpenPermissions: () => {
|
|
532
534
|
openAppPermissions(activeWindow.launch.surfaceId);
|
|
533
535
|
} }, activeWindow.windowId)) : null, systemMenuItems: systemMenuItems }), noticeContainer
|
|
534
|
-
? createPortal(_jsx(Toaster, { id: "workbench-notices", position: "bottom-right", offset: 24, mobileOffset: 24, closeButton: true }), noticeContainer)
|
|
536
|
+
? createPortal(_jsx(Toaster, { id: "workbench-notices", position: "bottom-right", offset: 24, mobileOffset: 24, style: { fontFamily: "var(--font-sans)" }, closeButton: true }), noticeContainer)
|
|
535
537
|
: null, _jsxs("div", { className: "relative min-h-0 flex-1", children: [_jsx(MaosaicoRegion, { layer: "desktop", style: { position: "absolute", inset: 0 }, "data-desktop-visibility": visibility, ref: desktopRef, "aria-hidden": covered ? true : undefined, children: _jsx(Desktop, { phone: phone, editing: desktopEditing, onEditingChange: setDesktopEditing, onOwner: receiveDesktopOwner, launcherItems: launchableItems, onAllApps: () => {
|
|
536
538
|
setAppDialOpen(true);
|
|
537
539
|
}, paused: covered, apps: windowApps, needsUpdate: needsUpdate, onAppSettings: (app) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { MaosaicoItemBinding } from "@fungi.computer/maosaico";
|
|
2
|
-
/** Animate
|
|
3
|
-
export declare function useWindowMotion(binding: MaosaicoItemBinding, interacting: boolean): import("react").RefObject<HTMLElement>;
|
|
1
|
+
import type { Bounds, MaosaicoItemBinding } from "@fungi.computer/maosaico";
|
|
2
|
+
/** Animate rearrangements; follow workspace resizing, gestures and reduced motion directly. */
|
|
3
|
+
export declare function useWindowMotion(binding: MaosaicoItemBinding, interacting: boolean, bounds: Bounds): import("react").RefObject<HTMLElement>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { animate } from "animejs";
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
-
/** Animate
|
|
4
|
-
export function useWindowMotion(binding, interacting) {
|
|
3
|
+
/** Animate rearrangements; follow workspace resizing, gestures and reduced motion directly. */
|
|
4
|
+
export function useWindowMotion(binding, interacting, bounds) {
|
|
5
5
|
const element = useRef(null);
|
|
6
6
|
const placed = useRef(false);
|
|
7
|
+
const parentSize = useRef({ width: 0, height: 0 });
|
|
7
8
|
const [reduced, setReduced] = useState(true);
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
const media = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
@@ -17,21 +18,36 @@ export function useWindowMotion(binding, interacting) {
|
|
|
17
18
|
};
|
|
18
19
|
}, []);
|
|
19
20
|
const { x, y, width, height } = binding.frame;
|
|
21
|
+
const { width: workspaceWidth, height: workspaceHeight } = bounds;
|
|
20
22
|
useLayoutEffect(() => {
|
|
21
23
|
if (!element.current || !binding.visible)
|
|
22
24
|
return;
|
|
25
|
+
const size = { width: workspaceWidth, height: workspaceHeight };
|
|
26
|
+
const resized = size.width !== parentSize.current.width ||
|
|
27
|
+
size.height !== parentSize.current.height;
|
|
28
|
+
parentSize.current = size;
|
|
23
29
|
const motion = animate(element.current, {
|
|
24
30
|
x,
|
|
25
31
|
y,
|
|
26
32
|
width,
|
|
27
33
|
height,
|
|
28
|
-
duration: !placed.current || interacting || reduced ? 0 : 200,
|
|
34
|
+
duration: !placed.current || interacting || reduced || resized ? 0 : 200,
|
|
29
35
|
ease: "outQuad",
|
|
30
36
|
});
|
|
31
37
|
placed.current = true;
|
|
32
38
|
return () => {
|
|
33
39
|
motion.cancel();
|
|
34
40
|
};
|
|
35
|
-
}, [
|
|
41
|
+
}, [
|
|
42
|
+
x,
|
|
43
|
+
y,
|
|
44
|
+
width,
|
|
45
|
+
height,
|
|
46
|
+
binding.visible,
|
|
47
|
+
interacting,
|
|
48
|
+
reduced,
|
|
49
|
+
workspaceWidth,
|
|
50
|
+
workspaceHeight,
|
|
51
|
+
]);
|
|
36
52
|
return element;
|
|
37
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/tourtois",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Tourtois: the trusted desktop shell for Oyster and Fungi, with host-supplied Settings sections",
|
|
6
6
|
"type": "module",
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"@fungi.computer/caps": "0.7.1",
|
|
83
83
|
"@fungi.computer/ear-tag": "0.1.0",
|
|
84
84
|
"@fungi.computer/gills": "0.2.1",
|
|
85
|
-
"@fungi.computer/maosaico": "0.1.
|
|
86
|
-
"@fungi.computer/parakeet": "0.8.
|
|
85
|
+
"@fungi.computer/maosaico": "0.1.1",
|
|
86
|
+
"@fungi.computer/parakeet": "0.8.2",
|
|
87
87
|
"@fungi.computer/puffball": "0.5.1",
|
|
88
|
-
"@fungi.computer/shiitake": "0.11.
|
|
88
|
+
"@fungi.computer/shiitake": "0.11.1",
|
|
89
89
|
"@fungi.computer/sigils": "0.3.0",
|
|
90
90
|
"@fungi.computer/sprite": "0.2.0",
|
|
91
91
|
"@fungi.computer/sprite-zdog": "0.3.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"react": "^18.3.1 || ^19.2.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@fungi.computer/oyster": "0.
|
|
109
|
+
"@fungi.computer/oyster": "0.13.1",
|
|
110
110
|
"@cloudflare/workers-types": "5.20260828.1",
|
|
111
111
|
"@fungi.computer/forage": "0.3.1",
|
|
112
112
|
"@fungi.computer/mycelium": "0.3.4",
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
"workbench:build": "ladle build --outDir ../../.botanical/tourtois-ladle",
|
|
241
241
|
"test:overlay-layering": "node test/overlay-layering.browser.mjs",
|
|
242
242
|
"test:window-new-version": "node test/window-new-version.browser.mjs",
|
|
243
|
-
"test:workbench": "node test/workbench.browser.mjs && node test/desktop-gills.browser.mjs && node test/app-directory-isolation.browser.mjs && node test/workflows-launcher-icon.browser.mjs && node test/landing-bugs.browser.mjs && node test/show-desktop.browser.mjs && node test/window-stack.browser.mjs && node test/window-chrome-back.browser.mjs && node test/app-bar-menu.browser.mjs && node test/launcher-gill.browser.mjs && node test/desktop-storage.browser.mjs && node test/desktop-method-editing.browser.mjs && node test/phone-layout.browser.mjs && node test/phone-app-switcher.browser.mjs && node test/computer-choice.browser.mjs",
|
|
243
|
+
"test:workbench": "node test/workbench.browser.mjs && node test/desktop-gills.browser.mjs && node test/app-directory-isolation.browser.mjs && node test/workflows-launcher-icon.browser.mjs && node test/landing-bugs.browser.mjs && node test/show-desktop.browser.mjs && node test/window-stack.browser.mjs && node test/window-chrome-back.browser.mjs && node test/app-bar-menu.browser.mjs && node test/launcher-gill.browser.mjs && node test/desktop-storage.browser.mjs && node test/desktop-method-editing.browser.mjs && node test/phone-layout.browser.mjs && node test/phone-app-switcher.browser.mjs && node test/computer-choice.browser.mjs && node test/window-resize.browser.mjs",
|
|
244
244
|
"test": "pnpm run test:unit && pnpm run test:merge",
|
|
245
245
|
"test:settings-icons": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/tourtois-ladle --origin-env TOURTOIS_WORKBENCH_URL test/settings-icons.browser.mjs",
|
|
246
246
|
"format:check": "node ../../tooling/repository/scripts/format-package-check.mjs",
|
|
@@ -249,6 +249,7 @@
|
|
|
249
249
|
"test:nightly": "node test/permission-matrix.browser.mjs && node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/tourtois-ladle --origin-env TOURTOIS_WORKBENCH_URL test/member-avatar.browser.mjs test/settings-icons.browser.mjs && node test/overlay-layering.browser.mjs",
|
|
250
250
|
"test:unit": "vitest run",
|
|
251
251
|
"test:merge": "node test/layout-backend.native.mjs && node --import tsx test/desktop-refresh.native.mjs",
|
|
252
|
-
"test:app-call-permissions": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/tourtois-ladle --origin-env TOURTOIS_WORKBENCH_URL test/app-call-permissions.browser.mjs"
|
|
252
|
+
"test:app-call-permissions": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/tourtois-ladle --origin-env TOURTOIS_WORKBENCH_URL test/app-call-permissions.browser.mjs",
|
|
253
|
+
"test:window-resize": "node --import tsx ../../tooling/repository/scripts/workbench-proofs.mjs --output ../../.botanical/tourtois-ladle --origin-env TOURTOIS_WORKBENCH_URL test/window-resize.browser.mjs"
|
|
253
254
|
}
|
|
254
255
|
}
|