@fungi.computer/tourtois 0.9.3 → 0.11.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/dist/AppAccessConsent.d.ts +10 -2
- package/dist/AppAccessConsent.js +50 -41
- package/dist/AppPane.js +10 -2
- package/dist/AppWorkbench.js +57 -6
- package/dist/DesktopMenuBar.d.ts +2 -1
- package/dist/DesktopMenuBar.js +3 -1
- package/dist/TeamDesktop.js +2 -1
- package/dist/WorkbenchAppBar.js +2 -2
- package/dist/chrome.css +4 -18
- package/dist/desktop/Desktop.js +122 -50
- package/dist/desktop/arrange-toolbar.d.ts +19 -0
- package/dist/desktop/arrange-toolbar.js +63 -0
- package/dist/desktop/arrange.css +145 -0
- package/dist/desktop/launcher-gill.js +9 -2
- package/dist/desktop/row-gill.js +5 -1
- package/dist/desktop/welcome.css +70 -0
- package/dist/desktop/welcome.d.ts +20 -0
- package/dist/desktop/welcome.js +61 -0
- package/dist/desktop/widget-picker.d.ts +19 -0
- package/dist/desktop/widget-picker.js +40 -0
- package/dist/desktop-layout.d.ts +1 -0
- package/dist/desktop-layout.js +11 -2
- package/dist/layers.d.ts +5 -0
- package/dist/layers.js +10 -2
- package/dist/oyster-platform-controls.js +22 -1
- package/dist/oyster-setup.d.ts +41 -0
- package/dist/oyster-setup.js +39 -0
- package/dist/platform-controls.d.ts +2 -0
- package/dist/platform-controls.js +11 -2
- package/dist/shell.css +29 -20
- package/dist/status-bar.js +20 -19
- package/package.json +22 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentAccessOperation, AppPermissionOutcome, ComputerAccessOperation } from "@fungi.computer/agar";
|
|
1
|
+
import type { AgentAccessOperation, AppPermissionOutcome, AppPermissionRequest, ComputerAccessOperation } from "@fungi.computer/agar";
|
|
2
2
|
import type { AppAgentPermission, AppComputerPermission } from "@fungi.computer/nacre/app-directory";
|
|
3
3
|
export declare const consentableAgentOperations: (requested: readonly AgentAccessOperation[], declared: readonly string[]) => readonly AgentAccessOperation[];
|
|
4
4
|
export declare const consentableComputerOperations: (requested: readonly ComputerAccessOperation[], declared: readonly string[]) => readonly ComputerAccessOperation[];
|
|
@@ -9,10 +9,18 @@ export declare function consentedAgentPermission(current: AppAgentPermission, of
|
|
|
9
9
|
* access; a real Computer selection is the owner's choice and never widened.
|
|
10
10
|
*/
|
|
11
11
|
export declare function consentedComputerPermission(current: AppComputerPermission | null, offered: readonly ComputerAccessOperation[]): AppComputerPermission | "covered" | "customize";
|
|
12
|
+
/** Every right the request names, in plain words, in a stable order. */
|
|
13
|
+
export declare function plainRights(request: {
|
|
14
|
+
agents: readonly AgentAccessOperation[];
|
|
15
|
+
computers: readonly ComputerAccessOperation[];
|
|
16
|
+
others?: AppPermissionRequest | undefined;
|
|
17
|
+
}): readonly string[];
|
|
12
18
|
export type AppAccessRequest = Readonly<{
|
|
13
19
|
appName: string;
|
|
14
20
|
agents: readonly AgentAccessOperation[];
|
|
15
21
|
computers: readonly ComputerAccessOperation[];
|
|
22
|
+
/** Git, Workflow, event and generation rights asked for in the same request. */
|
|
23
|
+
others?: AppPermissionRequest | undefined;
|
|
16
24
|
/** A host refusal is visible and cannot be converted into an Allow. */
|
|
17
25
|
refusal?: Readonly<{
|
|
18
26
|
code: string;
|
|
@@ -22,7 +30,7 @@ export type AppAccessRequest = Readonly<{
|
|
|
22
30
|
allow: () => Promise<boolean>;
|
|
23
31
|
settle: (outcome: AppPermissionOutcome) => void;
|
|
24
32
|
}>;
|
|
25
|
-
/** One-click host consent
|
|
33
|
+
/** One-click host consent: one sheet listing every right in plain words. */
|
|
26
34
|
export declare function AppAccessConsent({ request, }: {
|
|
27
35
|
request: AppAccessRequest | null;
|
|
28
36
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/AppAccessConsent.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "@fungi.computer/caps/components/button";
|
|
3
3
|
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogTitle, } from "@fungi.computer/caps/components/dialog";
|
|
4
|
-
import { WindowFrame
|
|
5
|
-
import { useState } from "react";
|
|
4
|
+
import { WindowFrame } from "@fungi.computer/caps/components/window";
|
|
5
|
+
import { useRef, useState } from "react";
|
|
6
6
|
const directoryOperations = ["agent.list"];
|
|
7
7
|
const sessionOperations = ["agent.read", "agent.send", "agent.manage"];
|
|
8
8
|
const agentOperations = [
|
|
@@ -67,25 +67,42 @@ const rightNames = {
|
|
|
67
67
|
"computer.writeFile": "change their files",
|
|
68
68
|
"computer.execute": "run commands on them",
|
|
69
69
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
/** Plain words for the Git, Workflow, event and generation rights. */
|
|
71
|
+
const otherRightNames = {
|
|
72
|
+
"git.repository": "save its work in Git repositories",
|
|
73
|
+
"workflow.publish": "publish workflows",
|
|
74
|
+
"workflow.arm": "let workflows start on their own",
|
|
75
|
+
"workflow.run": "run workflows",
|
|
76
|
+
"app.events.emit": "send events to your other Apps",
|
|
77
|
+
"llm.generation": "write with an AI model",
|
|
78
|
+
"media.generation": "make images and videos",
|
|
79
|
+
"media.share": "share what it makes",
|
|
78
80
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
/** Every right the request names, in plain words, in a stable order. */
|
|
82
|
+
export function plainRights(request) {
|
|
83
|
+
const others = request.others;
|
|
84
|
+
const named = [
|
|
85
|
+
...(others?.git ?? []),
|
|
86
|
+
...(others?.workflows ?? []),
|
|
87
|
+
...(others?.events ?? []),
|
|
88
|
+
...(others?.generation ?? []),
|
|
89
|
+
];
|
|
90
|
+
const agentRights = agentOperations
|
|
91
|
+
.filter((operation) => request.agents.includes(operation))
|
|
92
|
+
.map((operation) => rightNames[operation]);
|
|
93
|
+
const computerRights = computerOperations
|
|
94
|
+
.filter((operation) => request.computers.includes(operation))
|
|
95
|
+
.map((operation) => rightNames[operation]);
|
|
96
|
+
const otherRights = Object.entries(otherRightNames)
|
|
97
|
+
.filter(([operation]) => named.includes(operation))
|
|
98
|
+
.map(([, words]) => words);
|
|
99
|
+
return [...agentRights, ...computerRights, ...otherRights];
|
|
100
|
+
}
|
|
101
|
+
/** One-click host consent: one sheet listing every right in plain words. */
|
|
86
102
|
export function AppAccessConsent({ request, }) {
|
|
87
103
|
const [saving, setSaving] = useState(false);
|
|
88
104
|
const [failed, setFailed] = useState(false);
|
|
105
|
+
const approve = useRef(null);
|
|
89
106
|
const settle = (outcome) => {
|
|
90
107
|
setSaving(false);
|
|
91
108
|
setFailed(false);
|
|
@@ -94,28 +111,20 @@ export function AppAccessConsent({ request, }) {
|
|
|
94
111
|
return (_jsx(Dialog, { open: request !== null, onOpenChange: (next) => {
|
|
95
112
|
if (!next && !saving)
|
|
96
113
|
settle("declined");
|
|
97
|
-
}, children:
|
|
98
|
-
|
|
99
|
-
: "" }),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
else {
|
|
114
|
-
settle("declined");
|
|
115
|
-
}
|
|
116
|
-
}, () => {
|
|
117
|
-
setSaving(false);
|
|
118
|
-
setFailed(true);
|
|
119
|
-
});
|
|
120
|
-
}, children: saving ? "Allowing…" : "Allow" })] })] })] }) }));
|
|
114
|
+
}, children: _jsx(DialogContent, { render: _jsx(WindowFrame, { floating: true }), keepMounted: false, className: "tourtois-app-consent", initialFocus: approve, children: _jsxs("div", { className: "tourtois-app-consent-body", children: [_jsx(DialogTitle, { children: request ? `Approve ${request.appName}'s permissions?` : "" }), _jsx(DialogDescription, { children: request ? `${request.appName} would like to:` : "" }), request !== null ? (_jsx("ul", { className: "tourtois-app-consent-rights text-sm", children: plainRights(request).map((right) => (_jsx("li", { children: right }, right))) })) : null, _jsx("p", { className: "text-sm", children: "You can change this later in System Settings." }), request?.refusal !== undefined ? (_jsx("p", { role: "alert", "data-refusal-code": request.refusal.code, children: request.refusal.message })) : null, failed ? (_jsx("p", { role: "alert", children: "Access could not be saved. Try again." })) : null, _jsxs(DialogFooter, { className: "tourtois-app-consent-footer", children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: saving, onClick: () => {
|
|
115
|
+
settle("customize");
|
|
116
|
+
}, children: "Customize\u2026" }), _jsxs("div", { className: "tourtois-app-consent-decision", children: [_jsx(Button, { variant: "ghost", disabled: saving, onClick: () => {
|
|
117
|
+
settle("declined");
|
|
118
|
+
}, children: "Not now" }), _jsx(Button, { ref: approve, disabled: saving || request === null || request.refusal !== undefined, onClick: () => {
|
|
119
|
+
if (request === null || request.refusal !== undefined)
|
|
120
|
+
return;
|
|
121
|
+
setSaving(true);
|
|
122
|
+
setFailed(false);
|
|
123
|
+
void request.allow().then((saved) => {
|
|
124
|
+
settle(saved ? "granted" : "declined");
|
|
125
|
+
}, () => {
|
|
126
|
+
setSaving(false);
|
|
127
|
+
setFailed(true);
|
|
128
|
+
});
|
|
129
|
+
}, children: saving ? "Approving…" : "Approve" })] })] })] }) }) }));
|
|
121
130
|
}
|
package/dist/AppPane.js
CHANGED
|
@@ -15,6 +15,7 @@ import { AppIcon } from "./app-icon.js";
|
|
|
15
15
|
import { useWindowMotion } from "./use-window-motion.js";
|
|
16
16
|
import { backHint } from "./shell-commands.js";
|
|
17
17
|
import { createAppWindowManager, } from "./app-windows.js";
|
|
18
|
+
import { useDismissOverlays } from "./layers.js";
|
|
18
19
|
import { launchComputerId } from "./app-launch.js";
|
|
19
20
|
/**
|
|
20
21
|
* The App's own path, commands and state, when it publishes them; an App
|
|
@@ -62,6 +63,7 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
62
63
|
const containerRef = useRef(null);
|
|
63
64
|
const popover = useLayer("popover");
|
|
64
65
|
const [computerPickerOpen, setComputerPickerOpen] = useState(false);
|
|
66
|
+
const dismissOthers = useDismissOverlays();
|
|
65
67
|
useEffect(() => {
|
|
66
68
|
if (projection.launch.computers === undefined)
|
|
67
69
|
return;
|
|
@@ -192,7 +194,11 @@ export function AppPane({ projection, nextLaunch, icon, manager, onError, index,
|
|
|
192
194
|
onError("App could not be reloaded.");
|
|
193
195
|
});
|
|
194
196
|
}
|
|
195
|
-
: undefined, computerPickerOpen: computerPickerOpen, onComputerPickerOpenChange:
|
|
197
|
+
: undefined, computerPickerOpen: computerPickerOpen, onComputerPickerOpenChange: (open) => {
|
|
198
|
+
if (open)
|
|
199
|
+
dismissOthers();
|
|
200
|
+
setComputerPickerOpen(open);
|
|
201
|
+
}, onSelectComputer: (computerId) => {
|
|
196
202
|
onSelectComputer(projection.windowId, computerId);
|
|
197
203
|
}, surface: () => containerRef.current, onAction: (action) => {
|
|
198
204
|
void manager
|
|
@@ -250,7 +256,9 @@ export function WindowStatusBar({ projection, onSelectComputer, onAction, surfac
|
|
|
250
256
|
item.kind === "text" &&
|
|
251
257
|
item.id === "documents"));
|
|
252
258
|
const appReadouts = end.length === 0 ? undefined : end.map(render);
|
|
253
|
-
return (_jsx(AppStatusBar, { className: "tourtois-window-status-bar", "aria-label": `${title} status`, attachment:
|
|
259
|
+
return (_jsx(AppStatusBar, { className: "tourtois-window-status-bar", "aria-label": `${title} status`, attachment:
|
|
260
|
+
// One Computer is not a choice: the picker appears from two.
|
|
261
|
+
computers === undefined || computers.length === 1 ? undefined : (_jsx(StatusBarPicker, { ...(computerPickerOpen === undefined
|
|
254
262
|
? {}
|
|
255
263
|
: { open: computerPickerOpen }), ...(onComputerPickerOpenChange === undefined
|
|
256
264
|
? {}
|
package/dist/AppWorkbench.js
CHANGED
|
@@ -3,6 +3,7 @@ import { desktopSettingsHandler } from "./desktop/consent.js";
|
|
|
3
3
|
import { AppError } from "@fungi.computer/agar";
|
|
4
4
|
import {} from "@fungi.computer/caps/blocks/app-bar";
|
|
5
5
|
import { ResizeHandle } from "@fungi.computer/caps/components/resize-handle";
|
|
6
|
+
import { LoadingState } from "@fungi.computer/caps/blocks/loading-state";
|
|
6
7
|
import { toast, Toaster } from "@fungi.computer/caps/components/toaster";
|
|
7
8
|
import { WindowSnapPreview } from "@fungi.computer/caps/components/window";
|
|
8
9
|
import { MaosaicoRegion, useLayer, useMaosaicoLayout, } from "@fungi.computer/maosaico";
|
|
@@ -27,11 +28,35 @@ import { useAppWindowManager } from "./useAppWindowManager.js";
|
|
|
27
28
|
import { useDirectoryCommands } from "./useDirectoryCommands.js";
|
|
28
29
|
const emptyAppBarLabel = (loading, failed) => {
|
|
29
30
|
if (loading)
|
|
30
|
-
return "Loading Apps
|
|
31
|
+
return _jsx(LoadingState, { message: "Loading Apps\u2026" });
|
|
31
32
|
if (failed)
|
|
32
33
|
return "Apps unavailable";
|
|
33
34
|
return "Apps will appear here when available.";
|
|
34
35
|
};
|
|
36
|
+
/** "Edit avatar…" exists only where the host backs avatar Settings. */
|
|
37
|
+
const avatarMenuAction = (platform, open) => platform.sections === undefined || platform.sections.includes("avatar")
|
|
38
|
+
? open
|
|
39
|
+
: undefined;
|
|
40
|
+
/** Choosing Floating with nothing open would otherwise show no change. */
|
|
41
|
+
function announceFloating(tiled, projection) {
|
|
42
|
+
if (!tiled && !hasVisibleAppWindows(projection))
|
|
43
|
+
toast("New windows will float", {
|
|
44
|
+
id: "workbench-layout",
|
|
45
|
+
toasterId: "workbench-notices",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Windows cover the desktop, so Show desktop runs before arranging it. */
|
|
49
|
+
function arrangeDesktop(hide, arrange, onFailure) {
|
|
50
|
+
const hiding = hide();
|
|
51
|
+
if (!hiding) {
|
|
52
|
+
arrange();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
void hiding.then(arrange).catch((cause) => {
|
|
56
|
+
console.error("Arrange desktop could not show the desktop", cause);
|
|
57
|
+
onFailure("The desktop could not be shown. Try again.");
|
|
58
|
+
});
|
|
59
|
+
}
|
|
35
60
|
/** Phone Home uses the same public shell command as the keyboard. */
|
|
36
61
|
function phoneShowDesktop(phone, covered, host, onFailure) {
|
|
37
62
|
if (!phone || !covered || !host)
|
|
@@ -116,6 +141,29 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
116
141
|
else
|
|
117
142
|
toast(message, notice);
|
|
118
143
|
}, [appStatus]);
|
|
144
|
+
const editAvatar = avatarMenuAction(platform, () => {
|
|
145
|
+
menuAction(() => {
|
|
146
|
+
setSettingsLocation({ category: "avatar" });
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
const hideVisibleWindows = () => {
|
|
150
|
+
if (!hasVisibleAppWindows(appWindows.read()))
|
|
151
|
+
return null;
|
|
152
|
+
layout.zoom(null);
|
|
153
|
+
const hiding = appWindows.hideAll();
|
|
154
|
+
afterHide("");
|
|
155
|
+
return hiding;
|
|
156
|
+
};
|
|
157
|
+
/** A menu command's failure is a notice, never only a console line. */
|
|
158
|
+
const menuAction = (run) => {
|
|
159
|
+
try {
|
|
160
|
+
run();
|
|
161
|
+
}
|
|
162
|
+
catch (cause) {
|
|
163
|
+
console.error("Menu action failed", cause);
|
|
164
|
+
setAppStatus(cause instanceof Error ? cause : "That could not be completed.");
|
|
165
|
+
}
|
|
166
|
+
};
|
|
119
167
|
const reconciledDirectoryRef = useRef(null);
|
|
120
168
|
const focusWindow = useCallback((id) => {
|
|
121
169
|
focus(id);
|
|
@@ -509,20 +557,23 @@ export function AppWorkbench({ paneLayerRef, phone, teamId, teamName, initialCom
|
|
|
509
557
|
label: "Open Apps",
|
|
510
558
|
icon: (_jsx(OwnSprite, { "aria-hidden": "true", style: { width: "100%", height: "100%" } })),
|
|
511
559
|
} }), onOpenSettings: () => {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}, focusedId: activeWindow?.windowId ?? null, title: activeWindow?.launch.title ?? "Apps", tiled: mode === "tiled", onLayoutChange: onLayoutChange
|
|
560
|
+
menuAction(() => {
|
|
561
|
+
setSettingsLocation({ category: "home" });
|
|
562
|
+
});
|
|
563
|
+
}, onEditAvatar: editAvatar, focusedId: activeWindow?.windowId ?? null, title: activeWindow?.launch.title ?? "Apps", tiled: mode === "tiled", onLayoutChange: onLayoutChange
|
|
516
564
|
? (tiled) => {
|
|
517
565
|
layout.zoom(null);
|
|
518
566
|
onLayoutChange(tiled);
|
|
567
|
+
announceFloating(tiled, appProjection);
|
|
519
568
|
}
|
|
520
569
|
: undefined, onRestoreLayout: layout.zoomedId
|
|
521
570
|
? () => {
|
|
522
571
|
layout.zoom(null);
|
|
523
572
|
}
|
|
524
573
|
: undefined, onArrangeDesktop: () => {
|
|
525
|
-
|
|
574
|
+
arrangeDesktop(hideVisibleWindows, () => {
|
|
575
|
+
setDesktopEditing(true);
|
|
576
|
+
}, setAppStatus);
|
|
526
577
|
}, focusedControls: activeWindow ? (_jsx(FocusedWindowControls, { projection: activeWindow, app: directory.find((app) => app.surfaceId === activeWindow.launch.surfaceId), onOpenSettings: () => {
|
|
527
578
|
const app = directory.find((item) => item.surfaceId === activeWindow.launch.surfaceId);
|
|
528
579
|
setSettingsLocation({
|
package/dist/DesktopMenuBar.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export declare function DesktopMenuBar({ teamName, focusedId, title, appBar, til
|
|
|
12
12
|
onArrangeDesktop?: (() => void) | undefined;
|
|
13
13
|
focusedControls?: ReactNode;
|
|
14
14
|
onOpenSettings: () => void;
|
|
15
|
-
|
|
15
|
+
/** Absent when the host offers no avatar Settings. */
|
|
16
|
+
onEditAvatar?: (() => void) | undefined;
|
|
16
17
|
systemMenuItems?: ReactNode;
|
|
17
18
|
onShowDesktop?: (() => void) | undefined;
|
|
18
19
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/DesktopMenuBar.js
CHANGED
|
@@ -15,9 +15,11 @@ export function DesktopMenuBar({ teamName, focusedId, title, appBar, tiled, onLa
|
|
|
15
15
|
const [layoutOpen, setLayoutOpen] = useState(false);
|
|
16
16
|
return (_jsxs(ShellMenuBar, { children: [_jsxs(DropdownMenu, { modal: false, open: systemOpen, onOpenChange: setSystemOpen, children: [_jsxs(DropdownMenuTrigger, { className: "tourtois-system-menu-trigger", render: _jsx(Button, { size: "menubar", variant: "ghost" }), "aria-label": "Team and account menu", "aria-description": "Current Team: " + teamName, title: teamName, children: [_jsx(MushroomMark, {}), _jsx("span", { className: "tourtois-team-name truncate", children: teamName })] }), _jsxs(DropdownMenuContent, { align: "start", container: popover,
|
|
17
17
|
// A sibling App click keeps focus there; Escape still returns here.
|
|
18
|
-
finalFocus: (interaction) => interaction === "keyboard" && document.hasFocus(), children: [_jsx(DropdownMenuItem, { onSelect: onOpenSettings, children: "System Settings\u2026" }), _jsx(DropdownMenuItem, { onSelect: onEditAvatar, children: "Edit avatar\u2026" }), systemMenuItems] })] }), appBar, onShowDesktop ? (_jsx(IconButton, { size: "responsive", icon: _jsx(Home, {}), "aria-label": "Show desktop", title: "Show desktop", onClick: onShowDesktop })) : null, _jsx("strong", { className: "tourtois-focused-app", children: title }), _jsx(FocusedAppMenus, {}, `menus:${focusedId ?? "shell"}`), onLayoutChange || onRestoreLayout || onArrangeDesktop ? (_jsxs(DropdownMenu, { modal: false, open: layoutOpen, onOpenChange: setLayoutOpen, children: [_jsx(DropdownMenuTrigger, { render: _jsx(Button, { size: "menubar", variant: "ghost" }), children: "Layout" }), _jsxs(DropdownMenuContent, { align: "start", container: popover, finalFocus: (interaction) => interaction === "keyboard" && document.hasFocus(), children: [onLayoutChange ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuCheckboxItem, { checked: tiled, onCheckedChange: () => {
|
|
18
|
+
finalFocus: (interaction) => interaction === "keyboard" && document.hasFocus(), children: [_jsx(DropdownMenuItem, { onSelect: onOpenSettings, children: "System Settings\u2026" }), onEditAvatar ? (_jsx(DropdownMenuItem, { onSelect: onEditAvatar, children: "Edit avatar\u2026" })) : null, systemMenuItems] })] }), appBar, onShowDesktop ? (_jsx(IconButton, { size: "responsive", icon: _jsx(Home, {}), "aria-label": "Show desktop", title: "Show desktop", onClick: onShowDesktop })) : null, _jsx("strong", { className: "tourtois-focused-app", children: title }), _jsx(FocusedAppMenus, {}, `menus:${focusedId ?? "shell"}`), onLayoutChange || onRestoreLayout || onArrangeDesktop ? (_jsxs(DropdownMenu, { modal: false, open: layoutOpen, onOpenChange: setLayoutOpen, children: [_jsx(DropdownMenuTrigger, { "data-layout-menu": true, render: _jsx(Button, { size: "menubar", variant: "ghost" }), children: "Layout" }), _jsxs(DropdownMenuContent, { align: "start", container: popover, finalFocus: (interaction) => interaction === "keyboard" && document.hasFocus(), children: [onLayoutChange ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuCheckboxItem, { checked: tiled, onCheckedChange: () => {
|
|
19
19
|
onLayoutChange(true);
|
|
20
|
+
setLayoutOpen(false);
|
|
20
21
|
}, children: "Tiled" }), _jsx(DropdownMenuCheckboxItem, { checked: !tiled, onCheckedChange: () => {
|
|
21
22
|
onLayoutChange(false);
|
|
23
|
+
setLayoutOpen(false);
|
|
22
24
|
}, children: "Floating" })] })) : null, onRestoreLayout ? (_jsx(DropdownMenuItem, { onSelect: onRestoreLayout, children: "Restore layout" })) : null, onArrangeDesktop ? (_jsx(DropdownMenuItem, { onSelect: onArrangeDesktop, children: "Arrange desktop" })) : null] })] }, `window:${focusedId ?? "shell"}`)) : null, focusedControls] }));
|
|
23
25
|
}
|
package/dist/TeamDesktop.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
5
5
|
import { MaosaicoRoot } from "@fungi.computer/maosaico";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
7
7
|
import { AppWorkbench } from "./AppWorkbench.js";
|
|
8
|
+
import { WelcomeProvider } from "./desktop/welcome.js";
|
|
8
9
|
function useWorkbenchBounds() {
|
|
9
10
|
const ref = useRef(null);
|
|
10
11
|
const [bounds, setBounds] = useState({ height: 0, width: 0 });
|
|
@@ -35,5 +36,5 @@ export function TeamTourtois({ children, teamId, teamName, extraLaunchers, setti
|
|
|
35
36
|
});
|
|
36
37
|
return (_jsx("main", { className: "tourtois-shell", "data-tourtois-shell": true, children: _jsxs(TourtoisLayers, { children: [_jsx("div", { className: "tourtois-workbench", children: _jsx(MaosaicoRoot, { bounds: bounds, containerRef: paneLayerRef, tiling: tiled || phone
|
|
37
38
|
? { mainSize: Math.max(0, Math.min(640, bounds.width)), gap: 8 }
|
|
38
|
-
: undefined, children: _jsx(AppWorkbench, { paneLayerRef: paneLayerRef, phone: phone, teamId: teamId, teamName: teamName ?? teamId, initialComputerId: data?.[0]?.computerId ?? null, computers: data ?? [], computersUnavailable: isLoading || isError, onLayoutChange: phone ? undefined : setTiled, platform: platform, desktopStorage: desktopStorage, desktopMethods: desktopMethods, gills: gills, ...(extraLaunchers ? { extraLaunchers } : {}), ...(settingsLaunchers ? { settingsLaunchers } : {}), ...(systemMenuItems ? { systemMenuItems } : {}), directoryReader: directoryReader, ...(takeAppOpenRequest ? { takeAppOpenRequest } : {}) }) }) }), children] }) }));
|
|
39
|
+
: undefined, children: _jsx(WelcomeProvider, { teamId: teamId, storage: desktopStorage, children: _jsx(AppWorkbench, { paneLayerRef: paneLayerRef, phone: phone, teamId: teamId, teamName: teamName ?? teamId, initialComputerId: data?.[0]?.computerId ?? null, computers: data ?? [], computersUnavailable: isLoading || isError, onLayoutChange: phone ? undefined : setTiled, platform: platform, desktopStorage: desktopStorage, desktopMethods: desktopMethods, gills: gills, ...(extraLaunchers ? { extraLaunchers } : {}), ...(settingsLaunchers ? { settingsLaunchers } : {}), ...(systemMenuItems ? { systemMenuItems } : {}), directoryReader: directoryReader, ...(takeAppOpenRequest ? { takeAppOpenRequest } : {}) }) }) }) }), children] }) }));
|
|
39
40
|
}
|
package/dist/WorkbenchAppBar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { AppBar } from "@fungi.computer/caps/blocks/app-bar";
|
|
3
|
-
import {
|
|
3
|
+
import { Button } from "@fungi.computer/caps/components/button";
|
|
4
4
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, } from "@fungi.computer/caps/components/dropdown-menu";
|
|
5
5
|
import { useLayer } from "@fungi.computer/maosaico";
|
|
6
6
|
import { Check, PanelsTopLeft } from "lucide-react";
|
|
@@ -8,5 +8,5 @@ import { Check, PanelsTopLeft } from "lucide-react";
|
|
|
8
8
|
export function WorkbenchAppBar({ phone, ...props }) {
|
|
9
9
|
const popover = useLayer("popover");
|
|
10
10
|
const collapsed = phone && props.windows.length > 0;
|
|
11
|
-
return (_jsxs(_Fragment, { children: [collapsed ? (_jsxs(DropdownMenu, { modal: false, children: [
|
|
11
|
+
return (_jsxs(_Fragment, { children: [collapsed ? (_jsxs(DropdownMenu, { modal: false, children: [_jsxs(DropdownMenuTrigger, { render: _jsx(Button, { size: "menubar", variant: "ghost" }), "aria-label": "Switch open Apps", title: "Switch open Apps", children: [_jsx("span", { "aria-hidden": "true", className: "grid size-5 place-items-center [&_svg]:size-full", children: props.windows.find((item) => item.active)?.icon ?? (_jsx(PanelsTopLeft, {})) }), _jsx("span", { className: "tourtois-windows-label", children: "Windows" })] }), _jsxs(DropdownMenuContent, { container: popover, align: "start", children: [props.windows.map((item) => (_jsxs(DropdownMenuItem, { role: "menuitemradio", "aria-checked": item.active ?? false, "aria-current": item.active ? "page" : undefined, onSelect: item.onSelect, children: [_jsx("span", { "aria-hidden": "true", className: "grid size-7 shrink-0 place-items-center [&_svg]:size-5", children: item.icon }), _jsx("span", { className: "flex-1", children: item.label }), item.active ? _jsx(Check, { "aria-hidden": "true", size: 16 }) : null] }, item.id))), _jsx(DropdownMenuSeparator, {}), props.windows.map((item) => item.onClose ? (_jsxs(DropdownMenuItem, { onSelect: item.onClose, children: ["Close ", item.label] }, item.id)) : null)] })] })) : null, _jsx(AppBar, { appsLabel: "Apps", ...props, windows: collapsed ? [] : props.windows })] }));
|
|
12
12
|
}
|
package/dist/chrome.css
CHANGED
|
@@ -131,23 +131,9 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
/*
|
|
135
|
-
|
|
136
|
-
.tourtois-
|
|
137
|
-
|
|
138
|
-
max-width: none;
|
|
139
|
-
}
|
|
140
|
-
.tourtois-status-chip[aria-pressed="true"],
|
|
141
|
-
.tourtois-status-chip[aria-expanded="true"] {
|
|
142
|
-
background: var(--color-base-300);
|
|
143
|
-
}
|
|
144
|
-
@media (max-width: 640px) {
|
|
145
|
-
.tourtois-status-chip:has(> svg) .tourtois-status-chip-label {
|
|
146
|
-
position: absolute;
|
|
147
|
-
width: 1px;
|
|
148
|
-
height: 1px;
|
|
149
|
-
overflow: hidden;
|
|
150
|
-
clip-path: inset(50%);
|
|
151
|
-
white-space: nowrap;
|
|
134
|
+
/* On the narrowest phones the bar keeps its icons; the tab's name is its tooltip. */
|
|
135
|
+
@media (max-width: 420px) {
|
|
136
|
+
.tourtois-windows-label {
|
|
137
|
+
display: none;
|
|
152
138
|
}
|
|
153
139
|
}
|