@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,518 @@
|
|
|
1
|
+
import { Button } from "./components/foundations/Button.js";
|
|
2
|
+
import { Radio, RadioGroup } from "./components/foundations/RadioGroup.js";
|
|
3
|
+
import { Slider } from "./components/foundations/Slider.js";
|
|
4
|
+
import { COMPUTER_WALLPAPERS, DEFAULT_COMPUTER_WALLPAPER } from "./components/agents-sdk/ComputerWallpapers.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { useEffect, useEffectEvent, useId, useRef, useState } from "react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
const MAX_IMAGE_BYTES = 10485760;
|
|
9
|
+
async function prepareWallpaper(file) {
|
|
10
|
+
if (!file.size || file.size > MAX_IMAGE_BYTES) throw new Error("Choose an image smaller than 10 MB.");
|
|
11
|
+
const bytes = new Uint8Array(await file.slice(0, 12).arrayBuffer());
|
|
12
|
+
const isPng = [
|
|
13
|
+
137,
|
|
14
|
+
80,
|
|
15
|
+
78,
|
|
16
|
+
71,
|
|
17
|
+
13,
|
|
18
|
+
10,
|
|
19
|
+
26,
|
|
20
|
+
10
|
|
21
|
+
].every((byte, index) => bytes[index] === byte);
|
|
22
|
+
const isJpeg = bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255;
|
|
23
|
+
const isWebp = [
|
|
24
|
+
82,
|
|
25
|
+
73,
|
|
26
|
+
70,
|
|
27
|
+
70
|
|
28
|
+
].every((byte, index) => bytes[index] === byte) && [
|
|
29
|
+
87,
|
|
30
|
+
69,
|
|
31
|
+
66,
|
|
32
|
+
80
|
|
33
|
+
].every((byte, index) => bytes[index + 8] === byte);
|
|
34
|
+
if (!(file.type === "image/png" && isPng || file.type === "image/jpeg" && isJpeg || file.type === "image/webp" && isWebp)) throw new Error("Choose a PNG, JPEG, or WebP image.");
|
|
35
|
+
let bitmap;
|
|
36
|
+
try {
|
|
37
|
+
bitmap = await createImageBitmap(file);
|
|
38
|
+
} catch {
|
|
39
|
+
throw new Error("This image couldn’t be opened. Choose another image.");
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
if (!bitmap.width || !bitmap.height || bitmap.width * bitmap.height > 4e7) throw new Error("Choose an image with fewer than 40 million pixels.");
|
|
43
|
+
const canvas = document.createElement("canvas");
|
|
44
|
+
const context = canvas.getContext("2d");
|
|
45
|
+
if (!context) throw new Error("Your browser couldn’t prepare this image.");
|
|
46
|
+
for (const edge of [
|
|
47
|
+
1600,
|
|
48
|
+
1200,
|
|
49
|
+
800
|
|
50
|
+
]) {
|
|
51
|
+
const scale = Math.min(1, edge / Math.max(bitmap.width, bitmap.height));
|
|
52
|
+
canvas.width = Math.max(1, Math.round(bitmap.width * scale));
|
|
53
|
+
canvas.height = Math.max(1, Math.round(bitmap.height * scale));
|
|
54
|
+
context.fillStyle = "#171c22";
|
|
55
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
56
|
+
context.drawImage(bitmap, 0, 0, canvas.width, canvas.height);
|
|
57
|
+
const dataUrl = canvas.toDataURL("image/jpeg", .82);
|
|
58
|
+
if (dataUrl.startsWith("data:image/jpeg;base64,") && dataUrl.length <= 75e4) return {
|
|
59
|
+
label: file.name.trim().slice(0, 240) || "Custom image",
|
|
60
|
+
dataUrl,
|
|
61
|
+
fit: "fill",
|
|
62
|
+
x: 50,
|
|
63
|
+
y: 50
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
throw new Error("This image is too detailed to save. Choose a smaller image.");
|
|
67
|
+
} finally {
|
|
68
|
+
bitmap.close();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function customOption(image) {
|
|
72
|
+
return {
|
|
73
|
+
value: "custom",
|
|
74
|
+
label: image.label,
|
|
75
|
+
background: `url("${image.dataUrl}") ${image.x}% ${image.y}% / ${image.fit === "fill" ? "cover" : "contain"} no-repeat #171c22`
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** The desktop background with a person's own image: `AgentComputer`'s wallpaper and Settings' fields. */
|
|
79
|
+
function useComputerWallpaper(wallpaper, onChange) {
|
|
80
|
+
const $ = c(81);
|
|
81
|
+
const uploadButtonId = useId();
|
|
82
|
+
const uploadInput = useRef(null);
|
|
83
|
+
const helpId = useId();
|
|
84
|
+
const errorId = useId();
|
|
85
|
+
const uploadRevision = useRef(0);
|
|
86
|
+
const [uploading, setUploading] = useState(false);
|
|
87
|
+
const [uploadError, setUploadError] = useState("");
|
|
88
|
+
const { value, custom: saved } = wallpaper;
|
|
89
|
+
const [position, setPosition] = useState(null);
|
|
90
|
+
let t0;
|
|
91
|
+
if ($[0] !== position || $[1] !== saved) {
|
|
92
|
+
t0 = saved && position?.dataUrl === saved.dataUrl ? {
|
|
93
|
+
...saved,
|
|
94
|
+
x: position.x ?? saved.x,
|
|
95
|
+
y: position.y ?? saved.y
|
|
96
|
+
} : saved;
|
|
97
|
+
$[0] = position;
|
|
98
|
+
$[1] = saved;
|
|
99
|
+
$[2] = t0;
|
|
100
|
+
} else t0 = $[2];
|
|
101
|
+
const custom = t0;
|
|
102
|
+
const customUrl = saved?.dataUrl;
|
|
103
|
+
let t1;
|
|
104
|
+
if ($[3] !== onChange || $[4] !== value) {
|
|
105
|
+
t1 = () => {
|
|
106
|
+
onChange({
|
|
107
|
+
value: value === "custom" ? DEFAULT_COMPUTER_WALLPAPER : value,
|
|
108
|
+
custom: null
|
|
109
|
+
});
|
|
110
|
+
setUploadError("The saved image couldn’t be opened. Choose a new image.");
|
|
111
|
+
};
|
|
112
|
+
$[3] = onChange;
|
|
113
|
+
$[4] = value;
|
|
114
|
+
$[5] = t1;
|
|
115
|
+
} else t1 = $[5];
|
|
116
|
+
const dropUnreadable = useEffectEvent(t1);
|
|
117
|
+
let t2;
|
|
118
|
+
if ($[6] !== customUrl || $[7] !== dropUnreadable) {
|
|
119
|
+
t2 = () => {
|
|
120
|
+
if (!customUrl) return;
|
|
121
|
+
let active = true;
|
|
122
|
+
const image = new Image();
|
|
123
|
+
image.src = customUrl;
|
|
124
|
+
image.decode().catch(() => {
|
|
125
|
+
if (!active) return;
|
|
126
|
+
dropUnreadable();
|
|
127
|
+
});
|
|
128
|
+
return () => {
|
|
129
|
+
active = false;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
$[6] = customUrl;
|
|
133
|
+
$[7] = dropUnreadable;
|
|
134
|
+
$[8] = t2;
|
|
135
|
+
} else t2 = $[8];
|
|
136
|
+
let t3;
|
|
137
|
+
if ($[9] !== customUrl) {
|
|
138
|
+
t3 = [customUrl];
|
|
139
|
+
$[9] = customUrl;
|
|
140
|
+
$[10] = t3;
|
|
141
|
+
} else t3 = $[10];
|
|
142
|
+
useEffect(t2, t3);
|
|
143
|
+
let t4;
|
|
144
|
+
let t5;
|
|
145
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
146
|
+
t4 = () => () => {
|
|
147
|
+
uploadRevision.current = uploadRevision.current + 1;
|
|
148
|
+
};
|
|
149
|
+
t5 = [];
|
|
150
|
+
$[11] = t4;
|
|
151
|
+
$[12] = t5;
|
|
152
|
+
} else {
|
|
153
|
+
t4 = $[11];
|
|
154
|
+
t5 = $[12];
|
|
155
|
+
}
|
|
156
|
+
useEffect(t4, t5);
|
|
157
|
+
const customLabel = custom?.label;
|
|
158
|
+
const customFit = custom?.fit;
|
|
159
|
+
const customX = custom?.x;
|
|
160
|
+
const customY = custom?.y;
|
|
161
|
+
let t6;
|
|
162
|
+
if ($[13] !== customFit || $[14] !== customLabel || $[15] !== customUrl || $[16] !== customX || $[17] !== customY) {
|
|
163
|
+
t6 = customUrl !== void 0 && customLabel !== void 0 && customFit !== void 0 && customX !== void 0 && customY !== void 0 ? [...COMPUTER_WALLPAPERS, customOption({
|
|
164
|
+
dataUrl: customUrl,
|
|
165
|
+
label: customLabel,
|
|
166
|
+
fit: customFit,
|
|
167
|
+
x: customX,
|
|
168
|
+
y: customY
|
|
169
|
+
})] : COMPUTER_WALLPAPERS;
|
|
170
|
+
$[13] = customFit;
|
|
171
|
+
$[14] = customLabel;
|
|
172
|
+
$[15] = customUrl;
|
|
173
|
+
$[16] = customX;
|
|
174
|
+
$[17] = customY;
|
|
175
|
+
$[18] = t6;
|
|
176
|
+
} else t6 = $[18];
|
|
177
|
+
const wallpapers = t6;
|
|
178
|
+
let t7;
|
|
179
|
+
if ($[19] !== value || $[20] !== wallpapers) {
|
|
180
|
+
let t8;
|
|
181
|
+
if ($[22] !== value) {
|
|
182
|
+
t8 = (wallpaper_0) => wallpaper_0.value === value;
|
|
183
|
+
$[22] = value;
|
|
184
|
+
$[23] = t8;
|
|
185
|
+
} else t8 = $[23];
|
|
186
|
+
t7 = wallpapers.find(t8);
|
|
187
|
+
$[19] = value;
|
|
188
|
+
$[20] = wallpapers;
|
|
189
|
+
$[21] = t7;
|
|
190
|
+
} else t7 = $[21];
|
|
191
|
+
const selected = t7;
|
|
192
|
+
let t8;
|
|
193
|
+
if ($[24] !== onChange) {
|
|
194
|
+
t8 = function save(next, image_0) {
|
|
195
|
+
setPosition(null);
|
|
196
|
+
onChange({
|
|
197
|
+
value: next,
|
|
198
|
+
custom: image_0
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
$[24] = onChange;
|
|
202
|
+
$[25] = t8;
|
|
203
|
+
} else t8 = $[25];
|
|
204
|
+
const save = t8;
|
|
205
|
+
let t9;
|
|
206
|
+
if ($[26] !== save || $[27] !== saved || $[28] !== wallpapers) {
|
|
207
|
+
t9 = function select(next_0) {
|
|
208
|
+
if (!wallpapers.some((wallpaper_1) => wallpaper_1.value === next_0)) return;
|
|
209
|
+
uploadRevision.current = uploadRevision.current + 1;
|
|
210
|
+
setUploading(false);
|
|
211
|
+
save(next_0, saved);
|
|
212
|
+
};
|
|
213
|
+
$[26] = save;
|
|
214
|
+
$[27] = saved;
|
|
215
|
+
$[28] = wallpapers;
|
|
216
|
+
$[29] = t9;
|
|
217
|
+
} else t9 = $[29];
|
|
218
|
+
const select = t9;
|
|
219
|
+
let t10;
|
|
220
|
+
if ($[30] !== save || $[31] !== saved) {
|
|
221
|
+
t10 = function updateCustom(patch, t11) {
|
|
222
|
+
const persist = t11 === void 0 ? true : t11;
|
|
223
|
+
if (!saved) return;
|
|
224
|
+
if (persist) save("custom", {
|
|
225
|
+
...saved,
|
|
226
|
+
...patch
|
|
227
|
+
});
|
|
228
|
+
else setPosition((current) => ({
|
|
229
|
+
...current,
|
|
230
|
+
...patch,
|
|
231
|
+
dataUrl: saved.dataUrl
|
|
232
|
+
}));
|
|
233
|
+
};
|
|
234
|
+
$[30] = save;
|
|
235
|
+
$[31] = saved;
|
|
236
|
+
$[32] = t10;
|
|
237
|
+
} else t10 = $[32];
|
|
238
|
+
const updateCustom = t10;
|
|
239
|
+
let t11;
|
|
240
|
+
if ($[33] !== save) {
|
|
241
|
+
t11 = async function upload(file) {
|
|
242
|
+
const revision = uploadRevision.current = uploadRevision.current + 1;
|
|
243
|
+
setUploading(true);
|
|
244
|
+
setUploadError("");
|
|
245
|
+
const prepared = await prepareWallpaper(file).then(_temp, _temp2);
|
|
246
|
+
if (revision !== uploadRevision.current) return;
|
|
247
|
+
if ("image" in prepared) save("custom", prepared.image);
|
|
248
|
+
else setUploadError(prepared.error instanceof Error ? prepared.error.message : "This image couldn’t be opened.");
|
|
249
|
+
setUploading(false);
|
|
250
|
+
};
|
|
251
|
+
$[33] = save;
|
|
252
|
+
$[34] = t11;
|
|
253
|
+
} else t11 = $[34];
|
|
254
|
+
const upload = t11;
|
|
255
|
+
const t12 = `${helpId}${uploadError ? ` ${errorId}` : ""}`;
|
|
256
|
+
let t13;
|
|
257
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
258
|
+
t13 = () => uploadInput.current?.click();
|
|
259
|
+
$[35] = t13;
|
|
260
|
+
} else t13 = $[35];
|
|
261
|
+
let t14;
|
|
262
|
+
if ($[36] !== t12 || $[37] !== uploadButtonId || $[38] !== uploading) {
|
|
263
|
+
t14 = /* @__PURE__ */ jsx(Button, {
|
|
264
|
+
id: uploadButtonId,
|
|
265
|
+
size: "xs",
|
|
266
|
+
variant: "surface",
|
|
267
|
+
color: "neutral",
|
|
268
|
+
disabled: uploading,
|
|
269
|
+
"aria-describedby": t12,
|
|
270
|
+
onClick: t13,
|
|
271
|
+
children: "Use your own image…"
|
|
272
|
+
});
|
|
273
|
+
$[36] = t12;
|
|
274
|
+
$[37] = uploadButtonId;
|
|
275
|
+
$[38] = uploading;
|
|
276
|
+
$[39] = t14;
|
|
277
|
+
} else t14 = $[39];
|
|
278
|
+
let t15;
|
|
279
|
+
if ($[40] !== uploading) {
|
|
280
|
+
t15 = uploading ? /* @__PURE__ */ jsx("p", {
|
|
281
|
+
role: "status",
|
|
282
|
+
children: "Preparing background…"
|
|
283
|
+
}) : null;
|
|
284
|
+
$[40] = uploading;
|
|
285
|
+
$[41] = t15;
|
|
286
|
+
} else t15 = $[41];
|
|
287
|
+
let t16;
|
|
288
|
+
if ($[42] !== errorId || $[43] !== uploadError) {
|
|
289
|
+
t16 = uploadError ? /* @__PURE__ */ jsx("p", {
|
|
290
|
+
id: errorId,
|
|
291
|
+
role: "alert",
|
|
292
|
+
children: uploadError
|
|
293
|
+
}) : null;
|
|
294
|
+
$[42] = errorId;
|
|
295
|
+
$[43] = uploadError;
|
|
296
|
+
$[44] = t16;
|
|
297
|
+
} else t16 = $[44];
|
|
298
|
+
let t17;
|
|
299
|
+
if ($[45] !== t14 || $[46] !== t15 || $[47] !== t16) {
|
|
300
|
+
t17 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
301
|
+
t14,
|
|
302
|
+
t15,
|
|
303
|
+
t16
|
|
304
|
+
] });
|
|
305
|
+
$[45] = t14;
|
|
306
|
+
$[46] = t15;
|
|
307
|
+
$[47] = t16;
|
|
308
|
+
$[48] = t17;
|
|
309
|
+
} else t17 = $[48];
|
|
310
|
+
const uploadControls = t17;
|
|
311
|
+
const t18 = Boolean(uploadError);
|
|
312
|
+
const t19 = `${helpId}${uploadError ? ` ${errorId}` : ""}`;
|
|
313
|
+
let t20;
|
|
314
|
+
if ($[49] !== upload) {
|
|
315
|
+
t20 = (event) => {
|
|
316
|
+
const file_0 = event.currentTarget.files?.[0];
|
|
317
|
+
event.currentTarget.value = "";
|
|
318
|
+
if (file_0) upload(file_0);
|
|
319
|
+
};
|
|
320
|
+
$[49] = upload;
|
|
321
|
+
$[50] = t20;
|
|
322
|
+
} else t20 = $[50];
|
|
323
|
+
let t21;
|
|
324
|
+
if ($[51] !== t18 || $[52] !== t19 || $[53] !== t20 || $[54] !== uploadButtonId || $[55] !== uploading) {
|
|
325
|
+
t21 = /* @__PURE__ */ jsx("input", {
|
|
326
|
+
ref: uploadInput,
|
|
327
|
+
hidden: true,
|
|
328
|
+
"aria-labelledby": uploadButtonId,
|
|
329
|
+
type: "file",
|
|
330
|
+
accept: "image/png,image/jpeg,image/webp",
|
|
331
|
+
disabled: uploading,
|
|
332
|
+
"aria-invalid": t18,
|
|
333
|
+
"aria-describedby": t19,
|
|
334
|
+
onChange: t20
|
|
335
|
+
});
|
|
336
|
+
$[51] = t18;
|
|
337
|
+
$[52] = t19;
|
|
338
|
+
$[53] = t20;
|
|
339
|
+
$[54] = uploadButtonId;
|
|
340
|
+
$[55] = uploading;
|
|
341
|
+
$[56] = t21;
|
|
342
|
+
} else t21 = $[56];
|
|
343
|
+
let t22;
|
|
344
|
+
if ($[57] !== helpId) {
|
|
345
|
+
t22 = /* @__PURE__ */ jsx("p", {
|
|
346
|
+
id: helpId,
|
|
347
|
+
className: "sigvelo-visually-hidden",
|
|
348
|
+
children: "PNG, JPEG, or WebP, up to 10 MB. Images are dimmed to keep desktop labels readable."
|
|
349
|
+
});
|
|
350
|
+
$[57] = helpId;
|
|
351
|
+
$[58] = t22;
|
|
352
|
+
} else t22 = $[58];
|
|
353
|
+
let t23;
|
|
354
|
+
if ($[59] !== custom || $[60] !== save || $[61] !== updateCustom || $[62] !== uploadButtonId || $[63] !== value) {
|
|
355
|
+
t23 = custom ? /* @__PURE__ */ jsxs("section", {
|
|
356
|
+
className: "computer-wallpapers__custom",
|
|
357
|
+
"aria-label": "Custom background",
|
|
358
|
+
children: [value === "custom" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(RadioGroup.Root, {
|
|
359
|
+
className: "computer-wallpapers__placement",
|
|
360
|
+
value: custom.fit,
|
|
361
|
+
onValueChange: (fit) => {
|
|
362
|
+
if (fit === "fill" || fit === "fit") updateCustom({ fit });
|
|
363
|
+
},
|
|
364
|
+
"aria-label": "Image placement",
|
|
365
|
+
children: [/* @__PURE__ */ jsxs("label", {
|
|
366
|
+
className: "computer-wallpapers__choice",
|
|
367
|
+
children: [/* @__PURE__ */ jsx(Radio.Root, {
|
|
368
|
+
value: "fill",
|
|
369
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, {})
|
|
370
|
+
}), "Fill the screen (crop edges)"]
|
|
371
|
+
}), /* @__PURE__ */ jsxs("label", {
|
|
372
|
+
className: "computer-wallpapers__choice",
|
|
373
|
+
children: [/* @__PURE__ */ jsx(Radio.Root, {
|
|
374
|
+
value: "fit",
|
|
375
|
+
children: /* @__PURE__ */ jsx(Radio.Indicator, {})
|
|
376
|
+
}), "Fit the entire image"]
|
|
377
|
+
})]
|
|
378
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
379
|
+
className: "computer-wallpapers__crop",
|
|
380
|
+
children: ["x", "y"].map((axis) => /* @__PURE__ */ jsxs(Slider.Root, {
|
|
381
|
+
value: custom[axis],
|
|
382
|
+
min: 0,
|
|
383
|
+
max: 100,
|
|
384
|
+
step: 1,
|
|
385
|
+
onValueChange: (position_0) => updateCustom({ [axis]: position_0 }, false),
|
|
386
|
+
onValueCommitted: (position_1) => updateCustom({ [axis]: position_1 }),
|
|
387
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
388
|
+
className: "computer-wallpapers__crop-label",
|
|
389
|
+
children: [/* @__PURE__ */ jsx(Slider.Label, { children: axis === "x" ? "Horizontal position" : "Vertical position" }), /* @__PURE__ */ jsxs("span", { children: [custom[axis], "%"] })]
|
|
390
|
+
}), /* @__PURE__ */ jsx(Slider.Control, {
|
|
391
|
+
className: "computer-wallpapers__crop-control",
|
|
392
|
+
children: /* @__PURE__ */ jsxs(Slider.Track, { children: [/* @__PURE__ */ jsx(Slider.Indicator, {}), /* @__PURE__ */ jsx(Slider.Thumb, {})] })
|
|
393
|
+
})]
|
|
394
|
+
}, axis))
|
|
395
|
+
})] }) : null, /* @__PURE__ */ jsxs("div", {
|
|
396
|
+
className: "computer-wallpapers__actions",
|
|
397
|
+
children: [value === "custom" ? /* @__PURE__ */ jsx(Button, {
|
|
398
|
+
variant: "surface",
|
|
399
|
+
color: "neutral",
|
|
400
|
+
onClick: () => updateCustom({
|
|
401
|
+
x: 50,
|
|
402
|
+
y: 50
|
|
403
|
+
}),
|
|
404
|
+
children: "Center image"
|
|
405
|
+
}) : null, /* @__PURE__ */ jsx(Button, {
|
|
406
|
+
variant: "surface",
|
|
407
|
+
color: "neutral",
|
|
408
|
+
onClick: () => {
|
|
409
|
+
uploadRevision.current = uploadRevision.current + 1;
|
|
410
|
+
setUploading(false);
|
|
411
|
+
setUploadError("");
|
|
412
|
+
save(DEFAULT_COMPUTER_WALLPAPER, null);
|
|
413
|
+
requestAnimationFrame(() => uploadInput.current?.ownerDocument.getElementById(uploadButtonId)?.focus());
|
|
414
|
+
},
|
|
415
|
+
children: "Remove custom image"
|
|
416
|
+
})]
|
|
417
|
+
})]
|
|
418
|
+
}) : null;
|
|
419
|
+
$[59] = custom;
|
|
420
|
+
$[60] = save;
|
|
421
|
+
$[61] = updateCustom;
|
|
422
|
+
$[62] = uploadButtonId;
|
|
423
|
+
$[63] = value;
|
|
424
|
+
$[64] = t23;
|
|
425
|
+
} else t23 = $[64];
|
|
426
|
+
let t24;
|
|
427
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
|
428
|
+
t24 = /* @__PURE__ */ jsx("p", {
|
|
429
|
+
className: "computer-wallpapers__hint",
|
|
430
|
+
role: "status",
|
|
431
|
+
children: "Applies immediately to this desktop and its phone Home screen."
|
|
432
|
+
});
|
|
433
|
+
$[65] = t24;
|
|
434
|
+
} else t24 = $[65];
|
|
435
|
+
let t25;
|
|
436
|
+
if ($[66] !== t21 || $[67] !== t22 || $[68] !== t23) {
|
|
437
|
+
t25 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
438
|
+
t21,
|
|
439
|
+
t22,
|
|
440
|
+
t23,
|
|
441
|
+
t24
|
|
442
|
+
] });
|
|
443
|
+
$[66] = t21;
|
|
444
|
+
$[67] = t22;
|
|
445
|
+
$[68] = t23;
|
|
446
|
+
$[69] = t25;
|
|
447
|
+
} else t25 = $[69];
|
|
448
|
+
const details = t25;
|
|
449
|
+
let t26;
|
|
450
|
+
if ($[70] !== details || $[71] !== uploadControls) {
|
|
451
|
+
t26 = /* @__PURE__ */ jsxs("div", {
|
|
452
|
+
className: "computer-wallpapers__controls",
|
|
453
|
+
children: [uploadControls, details]
|
|
454
|
+
});
|
|
455
|
+
$[70] = details;
|
|
456
|
+
$[71] = uploadControls;
|
|
457
|
+
$[72] = t26;
|
|
458
|
+
} else t26 = $[72];
|
|
459
|
+
let t27;
|
|
460
|
+
if ($[73] !== select || $[74] !== t26 || $[75] !== value || $[76] !== wallpapers) {
|
|
461
|
+
t27 = {
|
|
462
|
+
wallpapers,
|
|
463
|
+
wallpaper: value,
|
|
464
|
+
onWallpaperChange: select,
|
|
465
|
+
display: t26
|
|
466
|
+
};
|
|
467
|
+
$[73] = select;
|
|
468
|
+
$[74] = t26;
|
|
469
|
+
$[75] = value;
|
|
470
|
+
$[76] = wallpapers;
|
|
471
|
+
$[77] = t27;
|
|
472
|
+
} else t27 = $[77];
|
|
473
|
+
let t28;
|
|
474
|
+
if ($[78] !== selected || $[79] !== t27) {
|
|
475
|
+
t28 = {
|
|
476
|
+
selected,
|
|
477
|
+
settings: t27
|
|
478
|
+
};
|
|
479
|
+
$[78] = selected;
|
|
480
|
+
$[79] = t27;
|
|
481
|
+
$[80] = t28;
|
|
482
|
+
} else t28 = $[80];
|
|
483
|
+
return t28;
|
|
484
|
+
}
|
|
485
|
+
function _temp2(error) {
|
|
486
|
+
return { error };
|
|
487
|
+
}
|
|
488
|
+
function _temp(image_1) {
|
|
489
|
+
return { image: image_1 };
|
|
490
|
+
}
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region src/components/agents-sdk/ComputerCustomWallpaper.tsx
|
|
493
|
+
function readCustomWallpaper(image) {
|
|
494
|
+
if (!image || typeof image !== "object" || !("label" in image && "dataUrl" in image && "fit" in image && "x" in image && "y" in image) || typeof image.label !== "string" || !image.label.trim() || image.label.length > 240 || typeof image.dataUrl !== "string" || image.dataUrl.length > 75e4 || !/^data:image\/jpeg;base64,[a-z0-9+/]+=*$/i.test(image.dataUrl) || image.fit !== "fill" && image.fit !== "fit" || ![image.x, image.y].every((position) => typeof position === "number" && Number.isFinite(position) && position >= 0 && position <= 100)) return null;
|
|
495
|
+
const header = atob(image.dataUrl.slice(23, 31));
|
|
496
|
+
if (header.charCodeAt(0) !== 255 || header.charCodeAt(1) !== 216 || header.charCodeAt(2) !== 255) return null;
|
|
497
|
+
const { label, dataUrl, fit } = image;
|
|
498
|
+
return {
|
|
499
|
+
label,
|
|
500
|
+
dataUrl,
|
|
501
|
+
fit,
|
|
502
|
+
x: image.x,
|
|
503
|
+
y: image.y
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
/** A saved background, or null when it names no wallpaper this desktop has. */
|
|
507
|
+
function readWallpaper(value) {
|
|
508
|
+
if (!value || typeof value !== "object" || !("value" in value) || !("custom" in value)) return null;
|
|
509
|
+
const custom = value.custom === null ? null : readCustomWallpaper(value.custom);
|
|
510
|
+
if (value.custom !== null && !custom) return null;
|
|
511
|
+
if (value.value === "custom" ? !custom : !COMPUTER_WALLPAPERS.some((w) => w.value === value.value)) return null;
|
|
512
|
+
return {
|
|
513
|
+
value: value.value,
|
|
514
|
+
custom
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
//#endregion
|
|
518
|
+
export { useComputerWallpaper as n, readWallpaper as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/agents-sdk/ComputerCustomWallpaper.d.ts
|
|
2
|
+
/** A person's own background image, prepared for bounded browser storage. */
|
|
3
|
+
interface CustomWallpaper {
|
|
4
|
+
label: string;
|
|
5
|
+
dataUrl: string;
|
|
6
|
+
fit: "fill" | "fit";
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
/** The chosen background, and the person's own image if they added one. */
|
|
11
|
+
interface ComputerWallpaper {
|
|
12
|
+
value: string;
|
|
13
|
+
custom: CustomWallpaper | null;
|
|
14
|
+
}
|
|
15
|
+
/** A saved background, or null when it names no wallpaper this desktop has. */
|
|
16
|
+
declare function readWallpaper(value: unknown): ComputerWallpaper | null;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CustomWallpaper as n, readWallpaper as r, ComputerWallpaper as t };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/agents-sdk/ComputerNotifications.d.ts
|
|
3
|
+
/** A source-owned notification. Opening or dismissing its banner never resolves the work. */
|
|
4
|
+
interface ComputerNotification {
|
|
5
|
+
id: string;
|
|
6
|
+
/** The app it comes from, leading its card. */
|
|
7
|
+
source: string;
|
|
8
|
+
title: string;
|
|
9
|
+
body: string;
|
|
10
|
+
/** When it arrived, in epoch milliseconds; shown as a time of day in the computer's zone. */
|
|
11
|
+
at: number;
|
|
12
|
+
/** The source app's artwork. */
|
|
13
|
+
icon: ReactNode;
|
|
14
|
+
/** What opening it does, as the banner's keyboard action: "Open waiting tab". */
|
|
15
|
+
action: string;
|
|
16
|
+
/** Opens what it is about; its window grows out of the banner or card. */
|
|
17
|
+
onOpen: (from: Element) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The menu bar's date and time, as macOS ends its status items: "Mon Sep 7
|
|
21
|
+
* 9:41 AM", in a `<time>` with the instant shown, ticking on the minute, on
|
|
22
|
+
* the `ComputerHost`'s clock. `ComputerNotifications` draws it.
|
|
23
|
+
*/
|
|
24
|
+
declare function ComputerClock(): import("react").JSX.Element;
|
|
25
|
+
interface ComputerNotificationsProps {
|
|
26
|
+
/** Newest first. A new id raises a banner once; an id that leaves takes its banner with it. */
|
|
27
|
+
items: readonly ComputerNotification[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Notification Center behind the menu-bar clock, which opens it as macOS's
|
|
31
|
+
* does, and the banners that announce each new notification, portalled into
|
|
32
|
+
* the computer. `AgentComputer` draws it from its `notifications`.
|
|
33
|
+
*/
|
|
34
|
+
declare function ComputerNotifications({ items }: ComputerNotificationsProps): import("react").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* The menu bar's Appearance extra: the theme, and the way to Settings ›
|
|
37
|
+
* Appearance for the background. `AgentComputer` draws it under a Settings Host.
|
|
38
|
+
*/
|
|
39
|
+
declare function ComputerAppearanceMenu(): import("react").JSX.Element | null;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ComputerNotificationsProps as a, ComputerNotifications as i, ComputerClock as n, ComputerNotification as r, ComputerAppearanceMenu as t };
|