@mcp-b/react-components 0.70.0 → 0.71.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/AgentComputer-CpS9R2KG.d.ts +305 -0
- package/dist/{AgentComputer-CFJxjMFE.js → AgentComputer-DZCyQkcE.js} +1850 -478
- package/dist/CommandPalette-DDctKdpC.d.ts +53 -0
- package/dist/ComputerCalendar-Ci7tLASe.js +1360 -0
- package/dist/ComputerCustomWallpaper-CnGQYHp0.js +518 -0
- package/dist/ComputerCustomWallpaper-D4lgwj2k.d.ts +18 -0
- package/dist/ComputerNotifications-q7eeELZ8.d.ts +41 -0
- package/dist/ComputerPresentation-BEQKYAjc.js +888 -0
- package/dist/{ExecutionResult-C7SzVquo.js → ExecutionResult-CXnGcmM4.js} +1 -1
- package/dist/{WorkspaceBrowser-ojoZy0uO.js → WorkspaceBrowser-mRScUczT.js} +5 -5
- package/dist/WorkspaceFileTransfer-D2cOoVyO.js +1625 -0
- package/dist/{WorkspaceMessageResponse-BoeeltJM.js → WorkspaceMessageResponse-CXGOQgpo.js} +1 -1
- package/dist/components/agents-sdk/AgentComputer.d.ts +2 -276
- package/dist/components/agents-sdk/AgentComputer.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/ComputerAutomations.d.ts +5 -15
- package/dist/components/agents-sdk/ComputerAutomations.js +164 -145
- package/dist/components/agents-sdk/ComputerCalendar.d.ts +1 -1
- package/dist/components/agents-sdk/ComputerCalendar.js +1 -1344
- package/dist/components/agents-sdk/ComputerCustomWallpaper.d.ts +2 -39
- package/dist/components/agents-sdk/ComputerCustomWallpaper.js +2 -522
- package/dist/components/agents-sdk/ComputerFiles.d.ts +18 -81
- package/dist/components/agents-sdk/ComputerFiles.js +365 -89
- package/dist/components/agents-sdk/ComputerHome.d.ts +6 -11
- package/dist/components/agents-sdk/ComputerHome.js +1 -89
- package/dist/components/agents-sdk/ComputerHost.d.ts +43 -0
- package/dist/components/agents-sdk/ComputerHost.js +97 -0
- package/dist/components/agents-sdk/ComputerLayout.d.ts +1 -1
- package/dist/components/agents-sdk/ComputerNotifications.d.ts +2 -54
- package/dist/components/agents-sdk/ComputerNotifications.js +1 -668
- package/dist/components/agents-sdk/ComputerPresentation.d.ts +2 -0
- package/dist/components/agents-sdk/ComputerPresentation.js +2 -0
- package/dist/components/agents-sdk/ComputerScreen.d.ts +14 -14
- package/dist/components/agents-sdk/ComputerScreen.js +109 -50
- package/dist/components/agents-sdk/ComputerSettings.d.ts +12 -40
- package/dist/components/agents-sdk/ComputerSettings.js +249 -1038
- package/dist/components/agents-sdk/ComputerSpotlight.d.ts +13 -15
- package/dist/components/agents-sdk/ComputerSpotlight.js +1 -231
- package/dist/components/agents-sdk/ComputerViewer.d.ts +13 -17
- package/dist/components/agents-sdk/ComputerViewer.js +176 -187
- package/dist/components/agents-sdk/ComputerWallpapers.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChat.js +2 -2
- package/dist/components/agents-sdk/EmployeeChrome.js +3 -3
- package/dist/components/agents-sdk/EmployeeSchedules.js +2 -2
- package/dist/components/agents-sdk/ExecutionBoard.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +2 -2
- package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -3
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/agents-sdk/ThinkScheduleActions.js +1 -1
- package/dist/components/agents-sdk/ThinkScheduleBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkScheduleDetail.js +4 -4
- package/dist/components/agents-sdk/ThinkScheduleForm.js +3 -3
- package/dist/components/agents-sdk/WorkspaceAutomation.js +3 -3
- package/dist/components/agents-sdk/WorkspaceAutomationTable.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceDesktop.d.ts +1 -5
- package/dist/components/agents-sdk/WorkspaceDesktop.js +53 -41
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -3
- package/dist/components/agents-sdk/WorkspaceFileCommands.js +1 -924
- package/dist/components/agents-sdk/WorkspaceFileDetails.js +1 -1
- package/dist/components/agents-sdk/WorkspaceFileTransfer.js +1 -504
- package/dist/components/agents-sdk/WorkspaceFileView.js +6 -6
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +9 -0
- package/dist/components/agents-sdk/WorkspaceLive.js +2 -177
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +1 -1
- package/dist/components/extension/FirstRunSetup.js +2 -2
- package/dist/components/foundations/ThemeProvider.d.ts +2 -0
- package/dist/components/foundations/ThemeProvider.js +2 -1
- package/dist/components/general-purpose/CommandPalette.d.ts +2 -52
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/WallpaperPicker.d.ts +33 -2
- package/dist/components/nanites/AgentConnection.js +1 -1
- package/dist/components/nanites/AgentToolDetail.js +1 -1
- package/dist/context-BWJpR084.js +94 -0
- package/dist/{parts-CPVz9l31.js → parts-DuT5-rDz.js} +1 -1
- package/dist/styles/agent-computer.css +16 -0
- package/dist/styles/computer-files.css +5 -0
- package/dist/styles/computer-notifications.css +1 -0
- package/dist/{workspace-drag-B6hMXUNt.js → workspace-drag-BNhZIN8F.js} +1 -1
- package/dist/{workspace-quick-look-DODjsfhH.js → workspace-quick-look-8cbGu1Xf.js} +2 -2
- package/package.json +2 -2
- package/dist/WallpaperPicker-C-FItmDS.d.ts +0 -34
- package/dist/automations-host-DPORjdc7.js +0 -17
- package/dist/context-Ddsp8HgD.js +0 -43
- package/dist/minute-clock-CXpRGCMF.js +0 -35
- package/dist/{Context-DQDumCV8.js → Context-CYUxZrwW.js} +1 -1
- package/dist/{ManagerOffice-kSK7vTBl.js → ManagerOffice-BJ2vs-Lr.js} +2 -2
- package/dist/{WorkspaceLink-DK9kdMUH.js → WorkspaceLink-DDkj-Tq5.js} +1 -1
|
@@ -0,0 +1,888 @@
|
|
|
1
|
+
import { O as FileIcon, d as BrainIcon, et as RefreshIcon, g as ChevronRightIcon, h as ChevronLeftIcon, it as SpinnerIcon, k as FolderIcon, mt as WarningIcon, n as ArrowDownIcon, o as ArrowUpIcon, u as BoxIcon } from "./icons-nLTnB9kd.js";
|
|
2
|
+
import { Checkbox } from "./components/foundations/Checkbox.js";
|
|
3
|
+
import { Button } from "./components/foundations/Button.js";
|
|
4
|
+
import { IconButton } from "./components/foundations/IconButton.js";
|
|
5
|
+
import { AppIcon } from "./components/foundations/AppIcon.js";
|
|
6
|
+
import { Tabs } from "./components/foundations/Tabs.js";
|
|
7
|
+
import { DEFAULT_COMPUTER_WALLPAPER } from "./components/agents-sdk/ComputerWallpapers.js";
|
|
8
|
+
import { t as readWallpaper } from "./ComputerCustomWallpaper-CnGQYHp0.js";
|
|
9
|
+
import { readComputerLayout } from "./components/agents-sdk/ComputerLayout.js";
|
|
10
|
+
import { AppTopBar } from "./components/general-purpose/AppTopBar.js";
|
|
11
|
+
import { ScreenStack } from "./components/general-purpose/ScreenStack.js";
|
|
12
|
+
import { COMPUTER_APP_IDS } from "./components/agents-sdk/ComputerAppIds.js";
|
|
13
|
+
import { c } from "react/compiler-runtime";
|
|
14
|
+
import { useId, useLayoutEffect, useRef } from "react";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useQuery } from "@tanstack/react-query";
|
|
17
|
+
//#region src/components/_internal/computer-apps/settings.tsx
|
|
18
|
+
/**
|
|
19
|
+
* Settings uses one Base UI Tabs owner on both platforms. The Mac presents
|
|
20
|
+
* those destinations in its familiar rail; the phone puts the same list at
|
|
21
|
+
* the root of an iOS navigation stack and pushes the selected pane.
|
|
22
|
+
*/
|
|
23
|
+
function SettingsLayout(t0) {
|
|
24
|
+
const $ = c(71);
|
|
25
|
+
const { views, view, onViewChange, detailOpen, onDetailOpenChange, phone, panels, footer } = t0;
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] !== view || $[1] !== views) {
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[3] !== view) {
|
|
30
|
+
t2 = (item) => item.value === view;
|
|
31
|
+
$[3] = view;
|
|
32
|
+
$[4] = t2;
|
|
33
|
+
} else t2 = $[4];
|
|
34
|
+
t1 = views.find(t2);
|
|
35
|
+
$[0] = view;
|
|
36
|
+
$[1] = views;
|
|
37
|
+
$[2] = t1;
|
|
38
|
+
} else t1 = $[2];
|
|
39
|
+
const label = t1.label;
|
|
40
|
+
const rootRef = useRef(null);
|
|
41
|
+
const previousPhone = useRef(phone);
|
|
42
|
+
const focusedControl = useRef(null);
|
|
43
|
+
let t2;
|
|
44
|
+
let t3;
|
|
45
|
+
if ($[5] !== detailOpen || $[6] !== phone) {
|
|
46
|
+
t2 = () => {
|
|
47
|
+
const root = rootRef.current;
|
|
48
|
+
const changedLayout = previousPhone.current !== phone;
|
|
49
|
+
previousPhone.current = phone;
|
|
50
|
+
if (changedLayout && root && focusedControl.current && !focusedControl.current.isConnected && root.ownerDocument.activeElement === root.ownerDocument.body) root.querySelector(phone && detailOpen ? "[data-screen=\"top\"] [data-nav-back]" : "[role=\"tab\"][aria-selected=\"true\"]")?.focus({ preventScroll: true });
|
|
51
|
+
};
|
|
52
|
+
t3 = [phone, detailOpen];
|
|
53
|
+
$[5] = detailOpen;
|
|
54
|
+
$[6] = phone;
|
|
55
|
+
$[7] = t2;
|
|
56
|
+
$[8] = t3;
|
|
57
|
+
} else {
|
|
58
|
+
t2 = $[7];
|
|
59
|
+
t3 = $[8];
|
|
60
|
+
}
|
|
61
|
+
useLayoutEffect(t2, t3);
|
|
62
|
+
let t4;
|
|
63
|
+
if ($[9] !== panels || $[10] !== phone || $[11] !== views) {
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[13] !== panels || $[14] !== phone) {
|
|
66
|
+
t5 = (t6) => {
|
|
67
|
+
const { value } = t6;
|
|
68
|
+
return /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
69
|
+
unstyled: phone,
|
|
70
|
+
className: "computer-settings__panel",
|
|
71
|
+
value,
|
|
72
|
+
children: panels[value]
|
|
73
|
+
}, value);
|
|
74
|
+
};
|
|
75
|
+
$[13] = panels;
|
|
76
|
+
$[14] = phone;
|
|
77
|
+
$[15] = t5;
|
|
78
|
+
} else t5 = $[15];
|
|
79
|
+
t4 = views.map(t5);
|
|
80
|
+
$[9] = panels;
|
|
81
|
+
$[10] = phone;
|
|
82
|
+
$[11] = views;
|
|
83
|
+
$[12] = t4;
|
|
84
|
+
} else t4 = $[12];
|
|
85
|
+
let t5;
|
|
86
|
+
if ($[16] !== t4) {
|
|
87
|
+
t5 = /* @__PURE__ */ jsx(Tabs.Panels, { children: t4 });
|
|
88
|
+
$[16] = t4;
|
|
89
|
+
$[17] = t5;
|
|
90
|
+
} else t5 = $[17];
|
|
91
|
+
const tabPanels = t5;
|
|
92
|
+
const t6 = phone ? "inset-group" : void 0;
|
|
93
|
+
let t7;
|
|
94
|
+
if ($[18] !== onDetailOpenChange || $[19] !== phone || $[20] !== views) {
|
|
95
|
+
let t8;
|
|
96
|
+
if ($[22] !== onDetailOpenChange || $[23] !== phone) {
|
|
97
|
+
t8 = (t9) => {
|
|
98
|
+
const { value: value_0, label: label_0, icon: Icon } = t9;
|
|
99
|
+
return /* @__PURE__ */ jsxs(Tabs.Tab, {
|
|
100
|
+
unstyled: true,
|
|
101
|
+
className: "computer-settings__destination",
|
|
102
|
+
value: value_0,
|
|
103
|
+
onClick: () => phone && onDetailOpenChange(true),
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx(Icon, { className: "computer-settings__destination-icon" }),
|
|
106
|
+
/* @__PURE__ */ jsx("span", { children: label_0 }),
|
|
107
|
+
phone ? /* @__PURE__ */ jsx(ChevronRightIcon, { className: "computer-settings__destination-chevron" }) : null
|
|
108
|
+
]
|
|
109
|
+
}, value_0);
|
|
110
|
+
};
|
|
111
|
+
$[22] = onDetailOpenChange;
|
|
112
|
+
$[23] = phone;
|
|
113
|
+
$[24] = t8;
|
|
114
|
+
} else t8 = $[24];
|
|
115
|
+
t7 = views.map(t8);
|
|
116
|
+
$[18] = onDetailOpenChange;
|
|
117
|
+
$[19] = phone;
|
|
118
|
+
$[20] = views;
|
|
119
|
+
$[21] = t7;
|
|
120
|
+
} else t7 = $[21];
|
|
121
|
+
let t8;
|
|
122
|
+
if ($[25] !== t6 || $[26] !== t7) {
|
|
123
|
+
t8 = /* @__PURE__ */ jsx(Tabs.List, {
|
|
124
|
+
unstyled: true,
|
|
125
|
+
className: "computer-settings__navigation",
|
|
126
|
+
"data-recipe": t6,
|
|
127
|
+
"aria-label": "Settings",
|
|
128
|
+
children: t7
|
|
129
|
+
});
|
|
130
|
+
$[25] = t6;
|
|
131
|
+
$[26] = t7;
|
|
132
|
+
$[27] = t8;
|
|
133
|
+
} else t8 = $[27];
|
|
134
|
+
const navigation = t8;
|
|
135
|
+
let t9;
|
|
136
|
+
if ($[28] !== footer) {
|
|
137
|
+
t9 = footer ? /* @__PURE__ */ jsx("p", {
|
|
138
|
+
className: "computer-settings__storage-status",
|
|
139
|
+
role: "status",
|
|
140
|
+
children: footer
|
|
141
|
+
}) : null;
|
|
142
|
+
$[28] = footer;
|
|
143
|
+
$[29] = t9;
|
|
144
|
+
} else t9 = $[29];
|
|
145
|
+
const footerNote = t9;
|
|
146
|
+
let t10;
|
|
147
|
+
let t11;
|
|
148
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
149
|
+
t10 = (event) => {
|
|
150
|
+
if (event.target instanceof HTMLElement) focusedControl.current = event.target;
|
|
151
|
+
};
|
|
152
|
+
t11 = (event_0) => {
|
|
153
|
+
if (!event_0.currentTarget.contains(event_0.relatedTarget)) focusedControl.current = null;
|
|
154
|
+
};
|
|
155
|
+
$[30] = t10;
|
|
156
|
+
$[31] = t11;
|
|
157
|
+
} else {
|
|
158
|
+
t10 = $[30];
|
|
159
|
+
t11 = $[31];
|
|
160
|
+
}
|
|
161
|
+
let t12;
|
|
162
|
+
if ($[32] !== view) {
|
|
163
|
+
t12 = {
|
|
164
|
+
ref: rootRef,
|
|
165
|
+
unstyled: true,
|
|
166
|
+
value: view,
|
|
167
|
+
orientation: "vertical",
|
|
168
|
+
onFocusCapture: t10,
|
|
169
|
+
onBlurCapture: t11
|
|
170
|
+
};
|
|
171
|
+
$[32] = view;
|
|
172
|
+
$[33] = t12;
|
|
173
|
+
} else t12 = $[33];
|
|
174
|
+
const rootProps = t12;
|
|
175
|
+
if (!phone) {
|
|
176
|
+
let t13;
|
|
177
|
+
if ($[34] !== onViewChange) {
|
|
178
|
+
t13 = (next) => onViewChange(next);
|
|
179
|
+
$[34] = onViewChange;
|
|
180
|
+
$[35] = t13;
|
|
181
|
+
} else t13 = $[35];
|
|
182
|
+
let t14;
|
|
183
|
+
if ($[36] !== navigation) {
|
|
184
|
+
t14 = /* @__PURE__ */ jsx("aside", {
|
|
185
|
+
className: "computer-settings__sidebar",
|
|
186
|
+
children: navigation
|
|
187
|
+
});
|
|
188
|
+
$[36] = navigation;
|
|
189
|
+
$[37] = t14;
|
|
190
|
+
} else t14 = $[37];
|
|
191
|
+
let t15;
|
|
192
|
+
if ($[38] !== footerNote || $[39] !== tabPanels) {
|
|
193
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
194
|
+
className: "computer-settings__detail",
|
|
195
|
+
children: [tabPanels, footerNote]
|
|
196
|
+
});
|
|
197
|
+
$[38] = footerNote;
|
|
198
|
+
$[39] = tabPanels;
|
|
199
|
+
$[40] = t15;
|
|
200
|
+
} else t15 = $[40];
|
|
201
|
+
let t16;
|
|
202
|
+
if ($[41] !== rootProps || $[42] !== t13 || $[43] !== t14 || $[44] !== t15) {
|
|
203
|
+
t16 = /* @__PURE__ */ jsxs(Tabs.Root, {
|
|
204
|
+
...rootProps,
|
|
205
|
+
className: "computer-settings computer-settings--desktop",
|
|
206
|
+
onValueChange: t13,
|
|
207
|
+
children: [t14, t15]
|
|
208
|
+
});
|
|
209
|
+
$[41] = rootProps;
|
|
210
|
+
$[42] = t13;
|
|
211
|
+
$[43] = t14;
|
|
212
|
+
$[44] = t15;
|
|
213
|
+
$[45] = t16;
|
|
214
|
+
} else t16 = $[45];
|
|
215
|
+
return t16;
|
|
216
|
+
}
|
|
217
|
+
let t13;
|
|
218
|
+
if ($[46] !== onDetailOpenChange || $[47] !== onViewChange) {
|
|
219
|
+
t13 = (next_0) => {
|
|
220
|
+
onViewChange(next_0);
|
|
221
|
+
onDetailOpenChange(true);
|
|
222
|
+
};
|
|
223
|
+
$[46] = onDetailOpenChange;
|
|
224
|
+
$[47] = onViewChange;
|
|
225
|
+
$[48] = t13;
|
|
226
|
+
} else t13 = $[48];
|
|
227
|
+
let t14;
|
|
228
|
+
if ($[49] !== detailOpen || $[50] !== onDetailOpenChange) {
|
|
229
|
+
t14 = detailOpen ? () => onDetailOpenChange(false) : void 0;
|
|
230
|
+
$[49] = detailOpen;
|
|
231
|
+
$[50] = onDetailOpenChange;
|
|
232
|
+
$[51] = t14;
|
|
233
|
+
} else t14 = $[51];
|
|
234
|
+
let t15;
|
|
235
|
+
let t16;
|
|
236
|
+
if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
|
|
237
|
+
t15 = /* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
238
|
+
className: "computer-settings__bar",
|
|
239
|
+
"aria-label": "Settings",
|
|
240
|
+
"data-nav-bar": "",
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ jsx(AppTopBar.Leading, {}),
|
|
243
|
+
/* @__PURE__ */ jsx(AppTopBar.Title, {
|
|
244
|
+
className: "computer-settings__root-title",
|
|
245
|
+
children: "Settings"
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ jsx(AppTopBar.Trailing, {})
|
|
248
|
+
]
|
|
249
|
+
});
|
|
250
|
+
t16 = /* @__PURE__ */ jsx("h1", { children: "Settings" });
|
|
251
|
+
$[52] = t15;
|
|
252
|
+
$[53] = t16;
|
|
253
|
+
} else {
|
|
254
|
+
t15 = $[52];
|
|
255
|
+
t16 = $[53];
|
|
256
|
+
}
|
|
257
|
+
let t17;
|
|
258
|
+
if ($[54] !== footerNote || $[55] !== navigation) {
|
|
259
|
+
t17 = /* @__PURE__ */ jsx(ScreenStack.Screen, { children: /* @__PURE__ */ jsxs("div", {
|
|
260
|
+
className: "computer-settings__screen computer-settings__screen--root",
|
|
261
|
+
children: [
|
|
262
|
+
t15,
|
|
263
|
+
t16,
|
|
264
|
+
navigation,
|
|
265
|
+
footerNote
|
|
266
|
+
]
|
|
267
|
+
}) }, "settings-root");
|
|
268
|
+
$[54] = footerNote;
|
|
269
|
+
$[55] = navigation;
|
|
270
|
+
$[56] = t17;
|
|
271
|
+
} else t17 = $[56];
|
|
272
|
+
let t18;
|
|
273
|
+
if ($[57] !== detailOpen || $[58] !== label || $[59] !== onDetailOpenChange || $[60] !== tabPanels || $[61] !== view) {
|
|
274
|
+
t18 = detailOpen ? /* @__PURE__ */ jsx(ScreenStack.Screen, { children: /* @__PURE__ */ jsxs("div", {
|
|
275
|
+
className: "computer-settings__screen",
|
|
276
|
+
children: [/* @__PURE__ */ jsxs(AppTopBar.Root, {
|
|
277
|
+
className: "computer-settings__bar",
|
|
278
|
+
"aria-label": label,
|
|
279
|
+
"data-nav-bar": "",
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
282
|
+
"data-nav-back": "",
|
|
283
|
+
label: "Settings",
|
|
284
|
+
onClick: () => onDetailOpenChange(false),
|
|
285
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
286
|
+
}) }),
|
|
287
|
+
/* @__PURE__ */ jsx(AppTopBar.Title, { children: label }),
|
|
288
|
+
/* @__PURE__ */ jsx(AppTopBar.Trailing, {})
|
|
289
|
+
]
|
|
290
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
291
|
+
className: "computer-settings__detail",
|
|
292
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
293
|
+
className: "sigvelo-visually-hidden",
|
|
294
|
+
children: label
|
|
295
|
+
}), tabPanels]
|
|
296
|
+
})]
|
|
297
|
+
}) }, `settings:${view}`) : null;
|
|
298
|
+
$[57] = detailOpen;
|
|
299
|
+
$[58] = label;
|
|
300
|
+
$[59] = onDetailOpenChange;
|
|
301
|
+
$[60] = tabPanels;
|
|
302
|
+
$[61] = view;
|
|
303
|
+
$[62] = t18;
|
|
304
|
+
} else t18 = $[62];
|
|
305
|
+
let t19;
|
|
306
|
+
if ($[63] !== t14 || $[64] !== t17 || $[65] !== t18) {
|
|
307
|
+
t19 = /* @__PURE__ */ jsxs(ScreenStack.Root, {
|
|
308
|
+
className: "computer-settings__stack",
|
|
309
|
+
"data-recipe": "fill-host",
|
|
310
|
+
onPop: t14,
|
|
311
|
+
children: [t17, t18]
|
|
312
|
+
});
|
|
313
|
+
$[63] = t14;
|
|
314
|
+
$[64] = t17;
|
|
315
|
+
$[65] = t18;
|
|
316
|
+
$[66] = t19;
|
|
317
|
+
} else t19 = $[66];
|
|
318
|
+
let t20;
|
|
319
|
+
if ($[67] !== rootProps || $[68] !== t13 || $[69] !== t19) {
|
|
320
|
+
t20 = /* @__PURE__ */ jsx(Tabs.Root, {
|
|
321
|
+
...rootProps,
|
|
322
|
+
className: "computer-settings computer-settings--phone",
|
|
323
|
+
onValueChange: t13,
|
|
324
|
+
children: t19
|
|
325
|
+
});
|
|
326
|
+
$[67] = rootProps;
|
|
327
|
+
$[68] = t13;
|
|
328
|
+
$[69] = t19;
|
|
329
|
+
$[70] = t20;
|
|
330
|
+
} else t20 = $[70];
|
|
331
|
+
return t20;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Settings' unified toolbar, as System Settings draws it: the sidebar column
|
|
335
|
+
* runs up under the traffic lights, and the bar over the detail names the pane
|
|
336
|
+
* on screen. A phone paints a bar per screen instead.
|
|
337
|
+
*/
|
|
338
|
+
function SettingsToolbar(t0) {
|
|
339
|
+
const $ = c(3);
|
|
340
|
+
const { label } = t0;
|
|
341
|
+
let t1;
|
|
342
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
343
|
+
t1 = /* @__PURE__ */ jsx("span", {
|
|
344
|
+
className: "computer-settings-toolbar__rail",
|
|
345
|
+
"aria-hidden": "true"
|
|
346
|
+
});
|
|
347
|
+
$[0] = t1;
|
|
348
|
+
} else t1 = $[0];
|
|
349
|
+
let t2;
|
|
350
|
+
if ($[1] !== label) {
|
|
351
|
+
t2 = /* @__PURE__ */ jsxs("div", {
|
|
352
|
+
className: "computer-settings-toolbar",
|
|
353
|
+
children: [t1, /* @__PURE__ */ jsx("span", {
|
|
354
|
+
className: "computer-settings-toolbar__title",
|
|
355
|
+
children: label
|
|
356
|
+
})]
|
|
357
|
+
});
|
|
358
|
+
$[1] = label;
|
|
359
|
+
$[2] = t2;
|
|
360
|
+
} else t2 = $[2];
|
|
361
|
+
return t2;
|
|
362
|
+
}
|
|
363
|
+
/** One row of the employee's inset group, a button when it opens something. */
|
|
364
|
+
function SettingsRow(t0) {
|
|
365
|
+
const $ = c(5);
|
|
366
|
+
const { icon, label, value, onClick } = t0;
|
|
367
|
+
let t1;
|
|
368
|
+
if ($[0] !== icon || $[1] !== label || $[2] !== onClick || $[3] !== value) {
|
|
369
|
+
t1 = onClick ? /* @__PURE__ */ jsxs(Button, {
|
|
370
|
+
className: "computer-employee-settings__row",
|
|
371
|
+
variant: "ghost",
|
|
372
|
+
color: "neutral",
|
|
373
|
+
onClick,
|
|
374
|
+
children: [
|
|
375
|
+
icon,
|
|
376
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
377
|
+
/* @__PURE__ */ jsx("span", {
|
|
378
|
+
className: "computer-employee-settings__value sigvelo-truncate",
|
|
379
|
+
children: value
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "computer-employee-settings__chevron" })
|
|
382
|
+
]
|
|
383
|
+
}) : /* @__PURE__ */ jsxs("span", {
|
|
384
|
+
className: "computer-employee-settings__row",
|
|
385
|
+
children: [
|
|
386
|
+
icon,
|
|
387
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
388
|
+
/* @__PURE__ */ jsx("span", {
|
|
389
|
+
className: "computer-employee-settings__value sigvelo-truncate",
|
|
390
|
+
children: value
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
});
|
|
394
|
+
$[0] = icon;
|
|
395
|
+
$[1] = label;
|
|
396
|
+
$[2] = onClick;
|
|
397
|
+
$[3] = value;
|
|
398
|
+
$[4] = t1;
|
|
399
|
+
} else t1 = $[4];
|
|
400
|
+
return t1;
|
|
401
|
+
}
|
|
402
|
+
/** The workspace folders that shape the employee, each opened in Files. */
|
|
403
|
+
const EMPLOYEE_FOLDERS = [
|
|
404
|
+
{
|
|
405
|
+
path: "/memory",
|
|
406
|
+
label: "Memory",
|
|
407
|
+
icon: BrainIcon,
|
|
408
|
+
one: "note",
|
|
409
|
+
other: "notes"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
path: "/skills",
|
|
413
|
+
label: "Skills",
|
|
414
|
+
icon: BoxIcon,
|
|
415
|
+
one: "skill",
|
|
416
|
+
other: "skills"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
path: "/projects",
|
|
420
|
+
label: "Projects",
|
|
421
|
+
icon: FolderIcon,
|
|
422
|
+
one: "project",
|
|
423
|
+
other: "projects"
|
|
424
|
+
}
|
|
425
|
+
];
|
|
426
|
+
const INSTRUCTIONS_PATH = "/SOUL.md";
|
|
427
|
+
async function countEntries(source, path) {
|
|
428
|
+
if (!await source.exists(path)) return 0;
|
|
429
|
+
return (await source.readDir(path, {
|
|
430
|
+
offset: 0,
|
|
431
|
+
limit: 200
|
|
432
|
+
})).length;
|
|
433
|
+
}
|
|
434
|
+
async function loadEmployeeFiles(source) {
|
|
435
|
+
const [instructions, ...counts] = await Promise.all([source.stat(INSTRUCTIONS_PATH).then((stat) => stat?.type === "file"), ...EMPLOYEE_FOLDERS.map((folder) => countEntries(source, folder.path))]);
|
|
436
|
+
return {
|
|
437
|
+
instructions,
|
|
438
|
+
counts
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
/** The employee as its workspace defines it: its instructions and the folders it works from. */
|
|
442
|
+
function EmployeeWorkspaceRows(t0) {
|
|
443
|
+
const $ = c(28);
|
|
444
|
+
const { source, sourceKey, open } = t0;
|
|
445
|
+
let t1;
|
|
446
|
+
if ($[0] !== sourceKey) {
|
|
447
|
+
t1 = [
|
|
448
|
+
"workspace",
|
|
449
|
+
sourceKey,
|
|
450
|
+
"computer-employee-settings"
|
|
451
|
+
];
|
|
452
|
+
$[0] = sourceKey;
|
|
453
|
+
$[1] = t1;
|
|
454
|
+
} else t1 = $[1];
|
|
455
|
+
let t2;
|
|
456
|
+
if ($[2] !== source) {
|
|
457
|
+
t2 = () => loadEmployeeFiles(source);
|
|
458
|
+
$[2] = source;
|
|
459
|
+
$[3] = t2;
|
|
460
|
+
} else t2 = $[3];
|
|
461
|
+
let t3;
|
|
462
|
+
if ($[4] !== t1 || $[5] !== t2) {
|
|
463
|
+
t3 = {
|
|
464
|
+
queryKey: t1,
|
|
465
|
+
queryFn: t2,
|
|
466
|
+
staleTime: Infinity
|
|
467
|
+
};
|
|
468
|
+
$[4] = t1;
|
|
469
|
+
$[5] = t2;
|
|
470
|
+
$[6] = t3;
|
|
471
|
+
} else t3 = $[6];
|
|
472
|
+
const files = useQuery(t3);
|
|
473
|
+
if (files.isPending) {
|
|
474
|
+
let t4;
|
|
475
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
476
|
+
t4 = /* @__PURE__ */ jsxs("li", {
|
|
477
|
+
className: "computer-employee-settings__status",
|
|
478
|
+
role: "status",
|
|
479
|
+
children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Loading the employee’s files"]
|
|
480
|
+
});
|
|
481
|
+
$[7] = t4;
|
|
482
|
+
} else t4 = $[7];
|
|
483
|
+
return t4;
|
|
484
|
+
}
|
|
485
|
+
if (files.isError) {
|
|
486
|
+
let t4;
|
|
487
|
+
let t5;
|
|
488
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
489
|
+
t4 = /* @__PURE__ */ jsx(WarningIcon, {});
|
|
490
|
+
t5 = /* @__PURE__ */ jsx("strong", { children: "Couldn’t read the employee’s files" });
|
|
491
|
+
$[8] = t4;
|
|
492
|
+
$[9] = t5;
|
|
493
|
+
} else {
|
|
494
|
+
t4 = $[8];
|
|
495
|
+
t5 = $[9];
|
|
496
|
+
}
|
|
497
|
+
let t6;
|
|
498
|
+
if ($[10] !== files) {
|
|
499
|
+
t6 = () => files.refetch();
|
|
500
|
+
$[10] = files;
|
|
501
|
+
$[11] = t6;
|
|
502
|
+
} else t6 = $[11];
|
|
503
|
+
let t7;
|
|
504
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
505
|
+
t7 = /* @__PURE__ */ jsx(RefreshIcon, {});
|
|
506
|
+
$[12] = t7;
|
|
507
|
+
} else t7 = $[12];
|
|
508
|
+
let t8;
|
|
509
|
+
if ($[13] !== t6) {
|
|
510
|
+
t8 = /* @__PURE__ */ jsxs("li", {
|
|
511
|
+
className: "computer-employee-settings__status",
|
|
512
|
+
role: "alert",
|
|
513
|
+
children: [t4, /* @__PURE__ */ jsxs("div", { children: [t5, /* @__PURE__ */ jsxs(Button, {
|
|
514
|
+
size: "sm",
|
|
515
|
+
variant: "ghost",
|
|
516
|
+
color: "neutral",
|
|
517
|
+
onClick: t6,
|
|
518
|
+
children: [t7, "Try again"]
|
|
519
|
+
})] })]
|
|
520
|
+
});
|
|
521
|
+
$[13] = t6;
|
|
522
|
+
$[14] = t8;
|
|
523
|
+
} else t8 = $[14];
|
|
524
|
+
return t8;
|
|
525
|
+
}
|
|
526
|
+
const { instructions, counts } = files.data;
|
|
527
|
+
let t4;
|
|
528
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
529
|
+
t4 = /* @__PURE__ */ jsx(FileIcon, { "aria-hidden": "true" });
|
|
530
|
+
$[15] = t4;
|
|
531
|
+
} else t4 = $[15];
|
|
532
|
+
const t5 = instructions ? "Open" : "Not set";
|
|
533
|
+
let t6;
|
|
534
|
+
if ($[16] !== instructions || $[17] !== open) {
|
|
535
|
+
t6 = instructions && open ? () => open(INSTRUCTIONS_PATH, "file") : void 0;
|
|
536
|
+
$[16] = instructions;
|
|
537
|
+
$[17] = open;
|
|
538
|
+
$[18] = t6;
|
|
539
|
+
} else t6 = $[18];
|
|
540
|
+
let t7;
|
|
541
|
+
if ($[19] !== t5 || $[20] !== t6) {
|
|
542
|
+
t7 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
|
|
543
|
+
icon: t4,
|
|
544
|
+
label: "Instructions",
|
|
545
|
+
value: t5,
|
|
546
|
+
onClick: t6
|
|
547
|
+
}) });
|
|
548
|
+
$[19] = t5;
|
|
549
|
+
$[20] = t6;
|
|
550
|
+
$[21] = t7;
|
|
551
|
+
} else t7 = $[21];
|
|
552
|
+
let t8;
|
|
553
|
+
if ($[22] !== counts || $[23] !== open) {
|
|
554
|
+
t8 = EMPLOYEE_FOLDERS.map((t9, index) => {
|
|
555
|
+
const { path, label, icon: Icon, one, other } = t9;
|
|
556
|
+
const count = counts[index];
|
|
557
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(SettingsRow, {
|
|
558
|
+
icon: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" }),
|
|
559
|
+
label,
|
|
560
|
+
value: count ? `${count} ${count === 1 ? one : other}` : "None",
|
|
561
|
+
onClick: count && open ? () => open(path, "directory") : void 0
|
|
562
|
+
}) }, path);
|
|
563
|
+
});
|
|
564
|
+
$[22] = counts;
|
|
565
|
+
$[23] = open;
|
|
566
|
+
$[24] = t8;
|
|
567
|
+
} else t8 = $[24];
|
|
568
|
+
let t9;
|
|
569
|
+
if ($[25] !== t7 || $[26] !== t8) {
|
|
570
|
+
t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
|
|
571
|
+
$[25] = t7;
|
|
572
|
+
$[26] = t8;
|
|
573
|
+
$[27] = t9;
|
|
574
|
+
} else t9 = $[27];
|
|
575
|
+
return t9;
|
|
576
|
+
}
|
|
577
|
+
/** A list of app ids small enough to be a Dock's. */
|
|
578
|
+
function readAppIds(value) {
|
|
579
|
+
return Array.isArray(value) && value.length <= 200 && value.every((id) => typeof id === "string") ? [...value] : null;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* A saved Dock arrangement, or null when it is not one. Ids the catalog no
|
|
583
|
+
* longer has are kept; the Dock drops them when it arranges.
|
|
584
|
+
*/
|
|
585
|
+
function readDockArrangement(value) {
|
|
586
|
+
if (!value || typeof value !== "object" || !("order" in value) || !("hidden" in value)) return null;
|
|
587
|
+
const order = readAppIds(value.order);
|
|
588
|
+
const hidden = readAppIds(value.hidden);
|
|
589
|
+
return order && hidden ? {
|
|
590
|
+
order,
|
|
591
|
+
hidden
|
|
592
|
+
} : null;
|
|
593
|
+
}
|
|
594
|
+
/** Apps a person can arrange: everything the Dock and Home list on their own. */
|
|
595
|
+
function dockEligible(apps) {
|
|
596
|
+
return apps.filter((app) => app.launcher !== "hidden" && !app.owner);
|
|
597
|
+
}
|
|
598
|
+
/** Known ids only, every eligible app ordered, and Settings never hidden. */
|
|
599
|
+
function normalizeDock(arrangement, apps) {
|
|
600
|
+
const ids = new Set(dockEligible(apps).map((app) => app.id));
|
|
601
|
+
const known = (list) => [...new Set(list)].filter((id) => ids.has(id));
|
|
602
|
+
return {
|
|
603
|
+
order: known([...arrangement.order, ...ids]),
|
|
604
|
+
hidden: known(arrangement.hidden).filter((id) => id !== COMPUTER_APP_IDS.settings)
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* The apps a person can arrange, in their order: `ordered` for Home and
|
|
609
|
+
* search, which keep showing hidden apps, and `docked` for the Dock.
|
|
610
|
+
*/
|
|
611
|
+
function arrangeDock(apps, arrangement) {
|
|
612
|
+
const { order, hidden } = normalizeDock(arrangement, apps);
|
|
613
|
+
const ordered = order.map((id) => apps.find((app) => app.id === id));
|
|
614
|
+
return {
|
|
615
|
+
ordered,
|
|
616
|
+
docked: ordered.filter((app) => !hidden.includes(app.id))
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
/** The Dock pane: show or hide each app and move it along the Dock. */
|
|
620
|
+
function DockSettings(t0) {
|
|
621
|
+
const $ = c(38);
|
|
622
|
+
const { apps, arrangement, onChange, phone, children } = t0;
|
|
623
|
+
const headingId = useId();
|
|
624
|
+
let eligible;
|
|
625
|
+
let t1;
|
|
626
|
+
let t2;
|
|
627
|
+
let t3;
|
|
628
|
+
let t4;
|
|
629
|
+
let t5;
|
|
630
|
+
let t6;
|
|
631
|
+
let t7;
|
|
632
|
+
let update;
|
|
633
|
+
if ($[0] !== apps || $[1] !== arrangement || $[2] !== headingId || $[3] !== onChange || $[4] !== phone) {
|
|
634
|
+
eligible = dockEligible(apps);
|
|
635
|
+
const { order, hidden } = normalizeDock(arrangement, apps);
|
|
636
|
+
const ordered = order.map((id) => eligible.find((app) => app.id === id));
|
|
637
|
+
let t8;
|
|
638
|
+
if ($[14] !== apps || $[15] !== onChange) {
|
|
639
|
+
t8 = (next) => onChange(normalizeDock(next, apps));
|
|
640
|
+
$[14] = apps;
|
|
641
|
+
$[15] = onChange;
|
|
642
|
+
$[16] = t8;
|
|
643
|
+
} else t8 = $[16];
|
|
644
|
+
update = t8;
|
|
645
|
+
const move = function move(id_0, direction) {
|
|
646
|
+
const next_0 = [...order];
|
|
647
|
+
const index = next_0.indexOf(id_0);
|
|
648
|
+
const destination = index + direction;
|
|
649
|
+
if (index < 0 || destination < 0 || destination >= next_0.length) return;
|
|
650
|
+
const [t9, t10] = [next_0[destination], next_0[index]];
|
|
651
|
+
next_0[index] = t9;
|
|
652
|
+
next_0[destination] = t10;
|
|
653
|
+
update({
|
|
654
|
+
order: next_0,
|
|
655
|
+
hidden
|
|
656
|
+
});
|
|
657
|
+
};
|
|
658
|
+
t3 = "computer-dock-settings";
|
|
659
|
+
t4 = phone ? "" : void 0;
|
|
660
|
+
t5 = headingId;
|
|
661
|
+
if ($[17] !== headingId) {
|
|
662
|
+
t6 = /* @__PURE__ */ jsx("h2", {
|
|
663
|
+
id: headingId,
|
|
664
|
+
children: "Dock"
|
|
665
|
+
});
|
|
666
|
+
$[17] = headingId;
|
|
667
|
+
$[18] = t6;
|
|
668
|
+
} else t6 = $[18];
|
|
669
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
670
|
+
t7 = /* @__PURE__ */ jsx("p", { children: "Choose the apps in the Dock. Hidden apps stay in Home and search." });
|
|
671
|
+
$[19] = t7;
|
|
672
|
+
} else t7 = $[19];
|
|
673
|
+
t1 = "computer-dock-settings__list";
|
|
674
|
+
t2 = ordered.map((app_0, index_0) => /* @__PURE__ */ jsxs("li", {
|
|
675
|
+
className: "computer-dock-settings__app",
|
|
676
|
+
children: [
|
|
677
|
+
/* @__PURE__ */ jsxs("div", {
|
|
678
|
+
className: "computer-dock-settings__identity",
|
|
679
|
+
children: [/* @__PURE__ */ jsx(AppIcon.Root, {
|
|
680
|
+
size: "sm",
|
|
681
|
+
"aria-hidden": "true",
|
|
682
|
+
children: app_0.icon
|
|
683
|
+
}), /* @__PURE__ */ jsx("span", { children: app_0.label })]
|
|
684
|
+
}),
|
|
685
|
+
/* @__PURE__ */ jsx("div", {
|
|
686
|
+
className: "computer-dock-settings__choices",
|
|
687
|
+
children: /* @__PURE__ */ jsxs("label", { children: [
|
|
688
|
+
/* @__PURE__ */ jsx(Checkbox.Root, {
|
|
689
|
+
checked: !hidden.includes(app_0.id),
|
|
690
|
+
disabled: app_0.id === COMPUTER_APP_IDS.settings,
|
|
691
|
+
onCheckedChange: (checked) => update({
|
|
692
|
+
order,
|
|
693
|
+
hidden: checked ? hidden.filter((id_1) => id_1 !== app_0.id) : [...hidden, app_0.id]
|
|
694
|
+
}),
|
|
695
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ jsxs("span", {
|
|
698
|
+
className: "sigvelo-visually-hidden",
|
|
699
|
+
children: [
|
|
700
|
+
"Show ",
|
|
701
|
+
app_0.label,
|
|
702
|
+
" in Dock"
|
|
703
|
+
]
|
|
704
|
+
}),
|
|
705
|
+
/* @__PURE__ */ jsx("span", {
|
|
706
|
+
"aria-hidden": "true",
|
|
707
|
+
children: "Show"
|
|
708
|
+
})
|
|
709
|
+
] })
|
|
710
|
+
}),
|
|
711
|
+
/* @__PURE__ */ jsxs("div", {
|
|
712
|
+
className: "computer-dock-settings__order",
|
|
713
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
714
|
+
label: `Move ${app_0.label} up`,
|
|
715
|
+
size: phone ? "xl" : "xs",
|
|
716
|
+
disabled: index_0 === 0,
|
|
717
|
+
focusableWhenDisabled: true,
|
|
718
|
+
variant: "ghost",
|
|
719
|
+
color: "neutral",
|
|
720
|
+
onClick: () => move(app_0.id, -1),
|
|
721
|
+
children: /* @__PURE__ */ jsx(ArrowUpIcon, {})
|
|
722
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
723
|
+
label: `Move ${app_0.label} down`,
|
|
724
|
+
size: phone ? "xl" : "xs",
|
|
725
|
+
disabled: index_0 === ordered.length - 1,
|
|
726
|
+
focusableWhenDisabled: true,
|
|
727
|
+
variant: "ghost",
|
|
728
|
+
color: "neutral",
|
|
729
|
+
onClick: () => move(app_0.id, 1),
|
|
730
|
+
children: /* @__PURE__ */ jsx(ArrowDownIcon, {})
|
|
731
|
+
})]
|
|
732
|
+
})
|
|
733
|
+
]
|
|
734
|
+
}, app_0.id));
|
|
735
|
+
$[0] = apps;
|
|
736
|
+
$[1] = arrangement;
|
|
737
|
+
$[2] = headingId;
|
|
738
|
+
$[3] = onChange;
|
|
739
|
+
$[4] = phone;
|
|
740
|
+
$[5] = eligible;
|
|
741
|
+
$[6] = t1;
|
|
742
|
+
$[7] = t2;
|
|
743
|
+
$[8] = t3;
|
|
744
|
+
$[9] = t4;
|
|
745
|
+
$[10] = t5;
|
|
746
|
+
$[11] = t6;
|
|
747
|
+
$[12] = t7;
|
|
748
|
+
$[13] = update;
|
|
749
|
+
} else {
|
|
750
|
+
eligible = $[5];
|
|
751
|
+
t1 = $[6];
|
|
752
|
+
t2 = $[7];
|
|
753
|
+
t3 = $[8];
|
|
754
|
+
t4 = $[9];
|
|
755
|
+
t5 = $[10];
|
|
756
|
+
t6 = $[11];
|
|
757
|
+
t7 = $[12];
|
|
758
|
+
update = $[13];
|
|
759
|
+
}
|
|
760
|
+
let t8;
|
|
761
|
+
if ($[20] !== t1 || $[21] !== t2) {
|
|
762
|
+
t8 = /* @__PURE__ */ jsx("ol", {
|
|
763
|
+
className: t1,
|
|
764
|
+
children: t2
|
|
765
|
+
});
|
|
766
|
+
$[20] = t1;
|
|
767
|
+
$[21] = t2;
|
|
768
|
+
$[22] = t8;
|
|
769
|
+
} else t8 = $[22];
|
|
770
|
+
let t9;
|
|
771
|
+
if ($[23] !== eligible || $[24] !== update) {
|
|
772
|
+
t9 = /* @__PURE__ */ jsx(Button, {
|
|
773
|
+
variant: "surface",
|
|
774
|
+
color: "neutral",
|
|
775
|
+
onClick: () => update({
|
|
776
|
+
order: eligible.map(_temp),
|
|
777
|
+
hidden: []
|
|
778
|
+
}),
|
|
779
|
+
children: "Reset Dock"
|
|
780
|
+
});
|
|
781
|
+
$[23] = eligible;
|
|
782
|
+
$[24] = update;
|
|
783
|
+
$[25] = t9;
|
|
784
|
+
} else t9 = $[25];
|
|
785
|
+
let t10;
|
|
786
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
787
|
+
t10 = /* @__PURE__ */ jsx("span", { children: "Settings stays in the Dock so you can restore hidden apps." });
|
|
788
|
+
$[26] = t10;
|
|
789
|
+
} else t10 = $[26];
|
|
790
|
+
let t11;
|
|
791
|
+
if ($[27] !== t9) {
|
|
792
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
793
|
+
className: "computer-dock-settings__reset",
|
|
794
|
+
children: [t9, t10]
|
|
795
|
+
});
|
|
796
|
+
$[27] = t9;
|
|
797
|
+
$[28] = t11;
|
|
798
|
+
} else t11 = $[28];
|
|
799
|
+
let t12;
|
|
800
|
+
if ($[29] !== children || $[30] !== t11 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8) {
|
|
801
|
+
t12 = /* @__PURE__ */ jsxs("section", {
|
|
802
|
+
className: t3,
|
|
803
|
+
"data-phone": t4,
|
|
804
|
+
"aria-labelledby": t5,
|
|
805
|
+
children: [
|
|
806
|
+
t6,
|
|
807
|
+
t7,
|
|
808
|
+
t8,
|
|
809
|
+
t11,
|
|
810
|
+
children
|
|
811
|
+
]
|
|
812
|
+
});
|
|
813
|
+
$[29] = children;
|
|
814
|
+
$[30] = t11;
|
|
815
|
+
$[31] = t3;
|
|
816
|
+
$[32] = t4;
|
|
817
|
+
$[33] = t5;
|
|
818
|
+
$[34] = t6;
|
|
819
|
+
$[35] = t7;
|
|
820
|
+
$[36] = t8;
|
|
821
|
+
$[37] = t12;
|
|
822
|
+
} else t12 = $[37];
|
|
823
|
+
return t12;
|
|
824
|
+
}
|
|
825
|
+
function _temp(app_1) {
|
|
826
|
+
return app_1.id;
|
|
827
|
+
}
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region src/components/agents-sdk/ComputerPresentation.ts
|
|
830
|
+
/** A computer nobody has arranged: Home, the Sigvelo background, the default Dock. */
|
|
831
|
+
const DEFAULT_COMPUTER_PRESENTATION = {
|
|
832
|
+
layout: null,
|
|
833
|
+
wallpaper: {
|
|
834
|
+
value: DEFAULT_COMPUTER_WALLPAPER,
|
|
835
|
+
custom: null
|
|
836
|
+
},
|
|
837
|
+
dock: {
|
|
838
|
+
order: [],
|
|
839
|
+
hidden: []
|
|
840
|
+
},
|
|
841
|
+
folders: {}
|
|
842
|
+
};
|
|
843
|
+
/** The most folder views a computer keeps; older ones fall back to their ancestors'. */
|
|
844
|
+
const MAX_FOLDER_VIEWS = 200;
|
|
845
|
+
function object(value) {
|
|
846
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
847
|
+
}
|
|
848
|
+
function readFolderView(value) {
|
|
849
|
+
if (!object(value) || value.layout !== "list" && value.layout !== "grid") return null;
|
|
850
|
+
const sort = value.sort;
|
|
851
|
+
if (!object(sort) || sort.by !== "name" && sort.by !== "kind" && sort.by !== "modified" && sort.by !== "size" || sort.direction !== "ascending" && sort.direction !== "descending") return null;
|
|
852
|
+
return {
|
|
853
|
+
layout: value.layout,
|
|
854
|
+
sort: {
|
|
855
|
+
by: sort.by,
|
|
856
|
+
direction: sort.direction
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
function readFolderViews(value) {
|
|
861
|
+
if (!object(value)) return null;
|
|
862
|
+
const entries = Object.entries(value);
|
|
863
|
+
if (entries.length > 200) return null;
|
|
864
|
+
const folders = {};
|
|
865
|
+
for (const [path, view] of entries) {
|
|
866
|
+
const folder = readFolderView(view);
|
|
867
|
+
if (!folder || !path.startsWith("/") || path.length > 1024) return null;
|
|
868
|
+
folders[path] = folder;
|
|
869
|
+
}
|
|
870
|
+
return folders;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* A saved presentation, rebuilt part by part from storage: a part that is not
|
|
874
|
+
* one falls back to its default alone, so a bad background never costs the
|
|
875
|
+
* windows.
|
|
876
|
+
*/
|
|
877
|
+
function readComputerPresentation(value) {
|
|
878
|
+
const saved = object(value) ? value : {};
|
|
879
|
+
const defaults = DEFAULT_COMPUTER_PRESENTATION;
|
|
880
|
+
return {
|
|
881
|
+
layout: readComputerLayout(saved.layout),
|
|
882
|
+
wallpaper: readWallpaper(saved.wallpaper) ?? defaults.wallpaper,
|
|
883
|
+
dock: readDockArrangement(saved.dock) ?? defaults.dock,
|
|
884
|
+
folders: readFolderViews(saved.folders) ?? defaults.folders
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
//#endregion
|
|
888
|
+
export { EmployeeWorkspaceRows as a, SettingsToolbar as c, DockSettings as i, arrangeDock as l, MAX_FOLDER_VIEWS as n, SettingsLayout as o, readComputerPresentation as r, SettingsRow as s, DEFAULT_COMPUTER_PRESENTATION as t };
|