@agimon-ai/po-native-dashboard 0.0.0-alpha.10

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.
Files changed (59) hide show
  1. package/LICENSE +149 -0
  2. package/README.md +5 -0
  3. package/dist/components/ActivityPanel.d.mts +10 -0
  4. package/dist/components/ActivityPanel.d.mts.map +1 -0
  5. package/dist/components/ActivityPanel.mjs +50 -0
  6. package/dist/components/ActivityPanel.mjs.map +1 -0
  7. package/dist/components/CaptureTray.d.mts +12 -0
  8. package/dist/components/CaptureTray.d.mts.map +1 -0
  9. package/dist/components/CaptureTray.mjs +112 -0
  10. package/dist/components/CaptureTray.mjs.map +1 -0
  11. package/dist/components/CompletionSheet.d.mts +46 -0
  12. package/dist/components/CompletionSheet.d.mts.map +1 -0
  13. package/dist/components/CompletionSheet.mjs +392 -0
  14. package/dist/components/CompletionSheet.mjs.map +1 -0
  15. package/dist/components/Composer.d.mts +49 -0
  16. package/dist/components/Composer.d.mts.map +1 -0
  17. package/dist/components/Composer.mjs +451 -0
  18. package/dist/components/Composer.mjs.map +1 -0
  19. package/dist/components/DialogSheet.d.mts +23 -0
  20. package/dist/components/DialogSheet.d.mts.map +1 -0
  21. package/dist/components/DialogSheet.mjs +115 -0
  22. package/dist/components/DialogSheet.mjs.map +1 -0
  23. package/dist/components/MessageActionsSheet.d.mts +16 -0
  24. package/dist/components/MessageActionsSheet.d.mts.map +1 -0
  25. package/dist/components/MessageActionsSheet.mjs +26 -0
  26. package/dist/components/MessageActionsSheet.mjs.map +1 -0
  27. package/dist/components/MoveSessionSheet.d.mts +17 -0
  28. package/dist/components/MoveSessionSheet.d.mts.map +1 -0
  29. package/dist/components/MoveSessionSheet.mjs +145 -0
  30. package/dist/components/MoveSessionSheet.mjs.map +1 -0
  31. package/dist/components/SessionMenus.d.mts +76 -0
  32. package/dist/components/SessionMenus.d.mts.map +1 -0
  33. package/dist/components/SessionMenus.mjs +1187 -0
  34. package/dist/components/SessionMenus.mjs.map +1 -0
  35. package/dist/components/TimelineItem.d.mts +39 -0
  36. package/dist/components/TimelineItem.d.mts.map +1 -0
  37. package/dist/components/TimelineItem.mjs +278 -0
  38. package/dist/components/TimelineItem.mjs.map +1 -0
  39. package/dist/components/sessionGroups.mjs +20 -0
  40. package/dist/components/sessionGroups.mjs.map +1 -0
  41. package/dist/components/sessionTimeline.mjs +20 -0
  42. package/dist/components/sessionTimeline.mjs.map +1 -0
  43. package/dist/components/slotProps.d.mts +23 -0
  44. package/dist/components/slotProps.d.mts.map +1 -0
  45. package/dist/components/slotProps.mjs +68 -0
  46. package/dist/components/slotProps.mjs.map +1 -0
  47. package/dist/index.d.mts +13 -0
  48. package/dist/index.mjs +14 -0
  49. package/dist/screens/SessionScreen.d.mts +63 -0
  50. package/dist/screens/SessionScreen.d.mts.map +1 -0
  51. package/dist/screens/SessionScreen.mjs +562 -0
  52. package/dist/screens/SessionScreen.mjs.map +1 -0
  53. package/dist/screens/SessionsScreen.d.mts +47 -0
  54. package/dist/screens/SessionsScreen.d.mts.map +1 -0
  55. package/dist/screens/SessionsScreen.mjs +1433 -0
  56. package/dist/screens/SessionsScreen.mjs.map +1 -0
  57. package/dist/slotProps.d.mts +2 -0
  58. package/dist/slotProps.mjs +3 -0
  59. package/package.json +92 -0
@@ -0,0 +1,1187 @@
1
+ import { MoveSessionSheet } from "./MoveSessionSheet.mjs";
2
+ import { createProblem, sessionGroupOptions } from "./sessionGroups.mjs";
3
+ import { View } from "react-native-unistyles/components/native/View";
4
+ import { Text } from "react-native-unistyles/components/native/Text";
5
+ import { Button, CheckIcon, EditIcon, FolderIcon, Input, Label, ListRow, PlusIcon, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, Spinner, Textarea, TrashIcon, fontOf } from "@agimon-ai/po-native-components";
6
+ import { StyleSheet } from "react-native-unistyles";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { Pressable } from "react-native-unistyles/components/native/Pressable";
9
+ import { useEffect, useState } from "react";
10
+
11
+ //#region src/components/SessionMenus.tsx
12
+ function Items({ items, disabled = false }) {
13
+ return /* @__PURE__ */ jsx(View, {
14
+ style: styles.list,
15
+ children: items.map((item, index) => /* @__PURE__ */ jsxs(Pressable, {
16
+ accessibilityRole: "button",
17
+ accessibilityState: { disabled: disabled || item.disabled === true },
18
+ disabled: disabled || item.disabled,
19
+ onPress: item.onPress,
20
+ style: ({ pressed }) => [
21
+ styles.item,
22
+ index > 0 && styles.divider,
23
+ pressed && styles.pressed
24
+ ],
25
+ children: [/* @__PURE__ */ jsx(Text, {
26
+ style: styles.itemLabel(item.danger === true, disabled || item.disabled === true),
27
+ children: item.label
28
+ }), item.hint ? /* @__PURE__ */ jsx(Text, {
29
+ style: styles.meta,
30
+ children: item.hint
31
+ }) : null]
32
+ }, item.label))
33
+ });
34
+ }
35
+ /** A session card's ⋮: the cockpit's rename, groups, resume, restart and remove, with remove confirmed first. */
36
+ function SessionMenuSheet({ session, actions, onGroups, scope, onClose }) {
37
+ const [step, setStep] = useState("menu");
38
+ const [draft, setDraft] = useState("");
39
+ const [busy, setBusy] = useState(false);
40
+ const [error, setError] = useState("");
41
+ const close = () => {
42
+ if (busy) return;
43
+ setStep("menu");
44
+ setError("");
45
+ onClose();
46
+ };
47
+ const name = session?.name || "Untitled";
48
+ const remove = async () => {
49
+ if (session === null) return;
50
+ setBusy(true);
51
+ setError("");
52
+ const result = await actions.removeSession(session.id);
53
+ setBusy(false);
54
+ if (result !== void 0) {
55
+ setError(result.error);
56
+ return;
57
+ }
58
+ setStep("menu");
59
+ onClose();
60
+ };
61
+ if (step === "move" && session) return /* @__PURE__ */ jsx(MoveSessionSheet, {
62
+ name,
63
+ workspaceName: session.move?.workspaceName ?? "this workspace",
64
+ destinations: session.move?.destinations ?? [],
65
+ blocked: !session.move || session.move.blocked,
66
+ moving: busy,
67
+ error,
68
+ onClose: close,
69
+ onMove: async (workspaceId) => {
70
+ if (busy || !actions.moveSession || !session.move || session.move.blocked || !session.move.destinations.some((workspace) => workspace.id === workspaceId)) return;
71
+ setBusy(true);
72
+ setError("");
73
+ try {
74
+ const result = await actions.moveSession(session.id, workspaceId);
75
+ if (result) setError(result.error);
76
+ else {
77
+ setStep("menu");
78
+ onClose();
79
+ }
80
+ } catch (cause) {
81
+ setError(cause instanceof Error ? cause.message : "Could not move the session.");
82
+ } finally {
83
+ setBusy(false);
84
+ }
85
+ }
86
+ });
87
+ return /* @__PURE__ */ jsx(Sheet, {
88
+ open: session !== null,
89
+ onOpenChange: (open) => !open && close(),
90
+ children: /* @__PURE__ */ jsx(SheetContent, { children: session === null ? null : step === "rename" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Rename session" }) }), /* @__PURE__ */ jsxs(SheetBody, {
91
+ style: styles.body,
92
+ children: [/* @__PURE__ */ jsx(Input, {
93
+ value: draft,
94
+ onChangeText: setDraft,
95
+ autoFocus: true,
96
+ accessibilityLabel: "Session name"
97
+ }), /* @__PURE__ */ jsx(Button, {
98
+ variant: "primary",
99
+ size: "lg",
100
+ disabled: draft.trim() === "",
101
+ onPress: () => {
102
+ actions.renameSession(session.id, draft);
103
+ close();
104
+ },
105
+ children: "Rename"
106
+ })]
107
+ })] }) : step === "confirm" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Remove session" }) }), /* @__PURE__ */ jsxs(SheetBody, {
108
+ style: styles.body,
109
+ children: [
110
+ /* @__PURE__ */ jsxs(Text, {
111
+ style: styles.text,
112
+ children: [
113
+ "This stops ",
114
+ /* @__PURE__ */ jsx(Text, {
115
+ style: styles.strong,
116
+ children: name
117
+ }),
118
+ " and removes it from the list. Anything it is running ends now. You can restore it for 7 days."
119
+ ]
120
+ }),
121
+ error ? /* @__PURE__ */ jsx(Text, {
122
+ style: styles.error,
123
+ accessibilityRole: "alert",
124
+ children: error
125
+ }) : null,
126
+ /* @__PURE__ */ jsx(Button, {
127
+ variant: "danger",
128
+ size: "lg",
129
+ loading: busy,
130
+ loadingLabel: "Removing",
131
+ onPress: () => void remove(),
132
+ children: "Remove"
133
+ }),
134
+ /* @__PURE__ */ jsx(Button, {
135
+ variant: "ghost",
136
+ size: "lg",
137
+ disabled: busy,
138
+ onPress: () => setStep("menu"),
139
+ children: "Cancel"
140
+ })
141
+ ]
142
+ })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, {
143
+ numberOfLines: 1,
144
+ children: name
145
+ }) }), /* @__PURE__ */ jsxs(SheetBody, {
146
+ style: styles.body,
147
+ children: [
148
+ scope ? /* @__PURE__ */ jsx(Text, {
149
+ style: styles.meta,
150
+ children: scope
151
+ }) : null,
152
+ error ? /* @__PURE__ */ jsx(Text, {
153
+ style: styles.error,
154
+ accessibilityRole: "alert",
155
+ children: error
156
+ }) : null,
157
+ /* @__PURE__ */ jsx(Items, {
158
+ disabled: busy,
159
+ items: [
160
+ ...actions.setSessionRole && session.coordinatorEligible === true ? [{
161
+ label: session.coordinator ? "Make regular session" : "Make coordinator",
162
+ hint: session.restartBlocked || session.restarting ? "Not while a turn runs or restarts" : void 0,
163
+ disabled: busy || session.restarting || session.restartBlocked === true || session.status.startsWith("running"),
164
+ onPress: async () => {
165
+ if (busy) return;
166
+ setBusy(true);
167
+ setError("");
168
+ try {
169
+ const result = await actions.setSessionRole(session.id, !session.coordinator);
170
+ if (result) setError(result.error);
171
+ else onClose();
172
+ } catch (cause) {
173
+ setError(cause instanceof Error ? cause.message : "Could not change session role");
174
+ } finally {
175
+ setBusy(false);
176
+ }
177
+ }
178
+ }] : [],
179
+ {
180
+ label: "Rename",
181
+ onPress: () => {
182
+ setDraft(session.name);
183
+ setStep("rename");
184
+ }
185
+ },
186
+ ...onGroups ? [{
187
+ label: "Groups",
188
+ hint: "Sessions in a group can message each other",
189
+ onPress: () => {
190
+ close();
191
+ onGroups(session);
192
+ }
193
+ }] : [],
194
+ {
195
+ label: "Resume",
196
+ hint: "Open an earlier conversation in this session",
197
+ onPress: () => {
198
+ close();
199
+ actions.resumeSession(session.id);
200
+ }
201
+ },
202
+ ...actions.moveSession && session.move ? [{
203
+ label: "Move to workspace…",
204
+ disabled: session.restarting || session.move.blocked,
205
+ onPress: () => setStep("move")
206
+ }] : [],
207
+ {
208
+ label: "Restart",
209
+ hint: session.restartBlocked ? "Not while a turn runs" : "Reloads extensions",
210
+ disabled: session.restarting || session.restartBlocked === true,
211
+ onPress: () => {
212
+ close();
213
+ actions.restartSession(session.id);
214
+ }
215
+ },
216
+ {
217
+ label: "Remove",
218
+ danger: true,
219
+ onPress: () => setStep("confirm")
220
+ }
221
+ ]
222
+ })
223
+ ]
224
+ })] }) })
225
+ });
226
+ }
227
+ /** A workspace's ⋮: resume a saved conversation here, or remove the workspace after confirming. */
228
+ function WorkspaceMenuSheet({ workspace, actions, onClose }) {
229
+ const [confirming, setConfirming] = useState(false);
230
+ const [busy, setBusy] = useState(false);
231
+ const [error, setError] = useState("");
232
+ const close = () => {
233
+ if (busy) return;
234
+ setConfirming(false);
235
+ setError("");
236
+ onClose();
237
+ };
238
+ const remove = async () => {
239
+ if (workspace === null) return;
240
+ setBusy(true);
241
+ setError("");
242
+ const result = await actions.deleteWorkspace(workspace.id);
243
+ setBusy(false);
244
+ if (result !== void 0) {
245
+ setError(result.error);
246
+ return;
247
+ }
248
+ setConfirming(false);
249
+ onClose();
250
+ };
251
+ return /* @__PURE__ */ jsx(Sheet, {
252
+ open: workspace !== null,
253
+ onOpenChange: (open) => !open && close(),
254
+ children: /* @__PURE__ */ jsx(SheetContent, { children: workspace === null ? null : confirming ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Remove workspace" }) }), /* @__PURE__ */ jsxs(SheetBody, {
255
+ style: styles.body,
256
+ children: [
257
+ /* @__PURE__ */ jsxs(Text, {
258
+ style: styles.text,
259
+ children: [
260
+ "This removes ",
261
+ /* @__PURE__ */ jsx(Text, {
262
+ style: styles.strong,
263
+ children: workspace.name
264
+ }),
265
+ " and all its sessions from Po. Running work will stop. Files at ",
266
+ /* @__PURE__ */ jsx(Text, {
267
+ style: styles.mono,
268
+ children: workspace.root
269
+ }),
270
+ " stay on disk."
271
+ ]
272
+ }),
273
+ error ? /* @__PURE__ */ jsx(Text, {
274
+ style: styles.error,
275
+ accessibilityRole: "alert",
276
+ children: error
277
+ }) : null,
278
+ /* @__PURE__ */ jsx(Button, {
279
+ variant: "danger",
280
+ size: "lg",
281
+ loading: busy,
282
+ loadingLabel: "Removing",
283
+ onPress: () => void remove(),
284
+ children: "Remove"
285
+ }),
286
+ /* @__PURE__ */ jsx(Button, {
287
+ variant: "ghost",
288
+ size: "lg",
289
+ disabled: busy,
290
+ onPress: () => setConfirming(false),
291
+ children: "Cancel"
292
+ })
293
+ ]
294
+ })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, {
295
+ numberOfLines: 1,
296
+ children: workspace.name
297
+ }) }), /* @__PURE__ */ jsxs(SheetBody, {
298
+ style: styles.body,
299
+ children: [error ? /* @__PURE__ */ jsx(Text, {
300
+ style: styles.error,
301
+ accessibilityRole: "alert",
302
+ children: error
303
+ }) : null, /* @__PURE__ */ jsx(Items, {
304
+ disabled: busy,
305
+ items: [
306
+ ...actions.addCoordinator && workspace.canAddCoordinator === true ? [{
307
+ label: "Add coordinator",
308
+ disabled: busy || !workspace.available,
309
+ onPress: async () => {
310
+ if (busy) return;
311
+ setBusy(true);
312
+ setError("");
313
+ try {
314
+ const result = await actions.addCoordinator(workspace.id);
315
+ if (result) setError(result.error);
316
+ else onClose();
317
+ } catch (cause) {
318
+ setError(cause instanceof Error ? cause.message : "Could not add coordinator");
319
+ } finally {
320
+ setBusy(false);
321
+ }
322
+ }
323
+ }] : [],
324
+ {
325
+ label: "Resume session",
326
+ disabled: !workspace.available,
327
+ onPress: () => {
328
+ close();
329
+ actions.resumeInWorkspace(workspace.id);
330
+ }
331
+ },
332
+ {
333
+ label: "Remove workspace",
334
+ danger: true,
335
+ onPress: () => setConfirming(true)
336
+ }
337
+ ]
338
+ })]
339
+ })] }) })
340
+ });
341
+ }
342
+ /**
343
+ * The cockpit's groups dialog as a sheet. Rows check groups on and off and the typed name can
344
+ * become a new one; rename and delete act on every session in the group at once, the checks wait for Save.
345
+ */
346
+ function SessionGroupsSheet({ session, sessions, actions, onClose }) {
347
+ const [forId, setForId] = useState(null);
348
+ const [value, setValue] = useState([]);
349
+ const [query, setQuery] = useState("");
350
+ const [renaming, setRenaming] = useState();
351
+ const [deleting, setDeleting] = useState();
352
+ const [error, setError] = useState("");
353
+ const [busy, setBusy] = useState(false);
354
+ if ((session?.id ?? null) !== forId) {
355
+ setForId(session?.id ?? null);
356
+ setValue([...session?.groups ?? []]);
357
+ setQuery("");
358
+ setRenaming(void 0);
359
+ setDeleting(void 0);
360
+ setError("");
361
+ }
362
+ const close = () => {
363
+ if (!busy) onClose();
364
+ };
365
+ const rowCancel = () => {
366
+ setRenaming(void 0);
367
+ setDeleting(void 0);
368
+ };
369
+ const run = async (work, done) => {
370
+ setBusy(true);
371
+ setError("");
372
+ const result = await work();
373
+ setBusy(false);
374
+ if (result === void 0) done();
375
+ else setError(result.error);
376
+ };
377
+ const typed = query.trim();
378
+ const options = session === null ? [] : sessionGroupOptions(sessions, session.id, value);
379
+ const shown = options.filter((group) => group.name.includes(typed));
380
+ const canCreate = typed !== "" && !options.some((group) => group.name === typed);
381
+ const problem = canCreate ? createProblem(typed, value.length) : void 0;
382
+ const toggle = (group) => {
383
+ setError("");
384
+ if (value.includes(group)) setValue(value.filter((name) => name !== group));
385
+ else if (value.length >= 8) setError(createProblem("", value.length) ?? "");
386
+ else setValue([...value, group]);
387
+ };
388
+ const create = () => {
389
+ if (!canCreate || problem !== void 0) return;
390
+ setValue([...value, typed]);
391
+ setQuery("");
392
+ };
393
+ const renameConfirm = () => {
394
+ if (renaming === void 0) return;
395
+ const to = renaming.draft.trim();
396
+ if (to === "" || to === renaming.group) return rowCancel();
397
+ run(() => actions.renameGroup(renaming.group, to), () => {
398
+ setValue((current) => [...new Set(current.map((name) => name === renaming.group ? to : name))]);
399
+ rowCancel();
400
+ });
401
+ };
402
+ const deleteConfirm = () => {
403
+ if (deleting === void 0) return;
404
+ run(() => actions.deleteGroup(deleting), () => {
405
+ setValue((current) => current.filter((name) => name !== deleting));
406
+ rowCancel();
407
+ });
408
+ };
409
+ return /* @__PURE__ */ jsx(Sheet, {
410
+ open: session !== null,
411
+ onOpenChange: (open) => !open && close(),
412
+ children: /* @__PURE__ */ jsx(SheetContent, { children: session === null ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Session groups" }) }), /* @__PURE__ */ jsxs(SheetBody, {
413
+ style: styles.body,
414
+ children: [
415
+ /* @__PURE__ */ jsx(Text, {
416
+ style: styles.meta,
417
+ children: "Sessions that share a group can message each other."
418
+ }),
419
+ /* @__PURE__ */ jsx(Input, {
420
+ value: query,
421
+ onChangeText: setQuery,
422
+ placeholder: value.length === 0 ? "Find or create a group" : "Add another",
423
+ autoCapitalize: "none",
424
+ autoCorrect: false,
425
+ returnKeyType: "done",
426
+ onSubmitEditing: () => {
427
+ if (canCreate) create();
428
+ else if (shown[0] !== void 0) {
429
+ toggle(shown[0].name);
430
+ setQuery("");
431
+ }
432
+ },
433
+ accessibilityLabel: "Find or create a group"
434
+ }),
435
+ shown.length > 0 || canCreate ? /* @__PURE__ */ jsxs(View, {
436
+ style: styles.list,
437
+ children: [shown.map((group, index) => {
438
+ const on = value.includes(group.name);
439
+ const total = group.members.length + (on ? 1 : 0);
440
+ const reach = total === 1 ? "its one session" : `all ${String(total)} sessions`;
441
+ const edge = index > 0 && styles.divider;
442
+ if (renaming?.group === group.name) return /* @__PURE__ */ jsxs(View, {
443
+ style: [styles.rowEdit, edge],
444
+ children: [
445
+ /* @__PURE__ */ jsx(Input, {
446
+ value: renaming.draft,
447
+ onChangeText: (draft) => setRenaming({
448
+ ...renaming,
449
+ draft
450
+ }),
451
+ autoFocus: true,
452
+ autoCapitalize: "none",
453
+ autoCorrect: false,
454
+ onSubmitEditing: renameConfirm,
455
+ accessibilityLabel: `Rename ${group.name}`
456
+ }),
457
+ /* @__PURE__ */ jsxs(Text, {
458
+ style: styles.meta,
459
+ children: [
460
+ "Renames it on ",
461
+ reach,
462
+ "."
463
+ ]
464
+ }),
465
+ /* @__PURE__ */ jsxs(View, {
466
+ style: styles.rowActions,
467
+ children: [/* @__PURE__ */ jsx(Button, {
468
+ variant: "ghost",
469
+ size: "sm",
470
+ disabled: busy,
471
+ onPress: rowCancel,
472
+ children: "Cancel"
473
+ }), /* @__PURE__ */ jsx(Button, {
474
+ variant: "outline",
475
+ size: "sm",
476
+ disabled: renaming.draft.trim() === "",
477
+ loading: busy,
478
+ loadingLabel: "Renaming",
479
+ onPress: renameConfirm,
480
+ children: "Rename"
481
+ })]
482
+ })
483
+ ]
484
+ }, group.name);
485
+ if (deleting === group.name) return /* @__PURE__ */ jsxs(View, {
486
+ style: [styles.rowEdit, edge],
487
+ children: [/* @__PURE__ */ jsxs(Text, {
488
+ style: styles.text,
489
+ children: [
490
+ "Remove ",
491
+ /* @__PURE__ */ jsx(Text, {
492
+ style: styles.strong,
493
+ children: group.name
494
+ }),
495
+ " from ",
496
+ reach,
497
+ "? They can no longer message through it."
498
+ ]
499
+ }), /* @__PURE__ */ jsxs(View, {
500
+ style: styles.rowActions,
501
+ children: [/* @__PURE__ */ jsx(Button, {
502
+ variant: "ghost",
503
+ size: "sm",
504
+ disabled: busy,
505
+ onPress: rowCancel,
506
+ children: "Cancel"
507
+ }), /* @__PURE__ */ jsx(Button, {
508
+ variant: "danger",
509
+ size: "sm",
510
+ loading: busy,
511
+ loadingLabel: "Deleting",
512
+ onPress: deleteConfirm,
513
+ children: "Delete"
514
+ })]
515
+ })]
516
+ }, group.name);
517
+ return /* @__PURE__ */ jsx(ListRow, {
518
+ title: group.name,
519
+ description: group.members.length === 0 ? "No other sessions yet" : group.members.join(", "),
520
+ selected: on,
521
+ leading: /* @__PURE__ */ jsx(View, {
522
+ style: styles.check,
523
+ children: on ? /* @__PURE__ */ jsx(CheckIcon, {
524
+ size: 16,
525
+ color: "green"
526
+ }) : null
527
+ }),
528
+ trailing: /* @__PURE__ */ jsxs(View, {
529
+ style: styles.rowActions,
530
+ children: [/* @__PURE__ */ jsx(Button, {
531
+ variant: "ghost",
532
+ size: "icon",
533
+ accessibilityLabel: `Rename ${group.name}`,
534
+ onPress: () => {
535
+ setDeleting(void 0);
536
+ setRenaming({
537
+ group: group.name,
538
+ draft: group.name
539
+ });
540
+ },
541
+ children: /* @__PURE__ */ jsx(EditIcon, {
542
+ size: 16,
543
+ color: "dim"
544
+ })
545
+ }), /* @__PURE__ */ jsx(Button, {
546
+ variant: "ghost",
547
+ size: "icon",
548
+ accessibilityLabel: `Delete ${group.name}`,
549
+ onPress: () => {
550
+ setRenaming(void 0);
551
+ setDeleting(group.name);
552
+ },
553
+ children: /* @__PURE__ */ jsx(TrashIcon, {
554
+ size: 16,
555
+ color: "dim"
556
+ })
557
+ })]
558
+ }),
559
+ disclosure: false,
560
+ onPress: () => toggle(group.name),
561
+ style: edge
562
+ }, group.name);
563
+ }), canCreate ? /* @__PURE__ */ jsx(ListRow, {
564
+ title: /* @__PURE__ */ jsxs(Text, {
565
+ style: styles.create(problem === void 0),
566
+ numberOfLines: 1,
567
+ children: [
568
+ "Create group “",
569
+ typed,
570
+ "”"
571
+ ]
572
+ }),
573
+ description: problem === void 0 ? void 0 : /* @__PURE__ */ jsx(Text, {
574
+ style: styles.error,
575
+ children: problem
576
+ }),
577
+ leading: /* @__PURE__ */ jsx(PlusIcon, {
578
+ size: 16,
579
+ color: problem === void 0 ? "magenta" : "faint"
580
+ }),
581
+ disabled: problem !== void 0,
582
+ disclosure: false,
583
+ onPress: create,
584
+ style: shown.length > 0 && styles.divider
585
+ }) : null]
586
+ }) : null,
587
+ /* @__PURE__ */ jsxs(Text, {
588
+ style: styles.meta,
589
+ children: [
590
+ value.length,
591
+ " of ",
592
+ 8,
593
+ " groups"
594
+ ]
595
+ }),
596
+ error ? /* @__PURE__ */ jsx(Text, {
597
+ style: styles.error,
598
+ accessibilityRole: "alert",
599
+ children: error
600
+ }) : null,
601
+ /* @__PURE__ */ jsx(Button, {
602
+ variant: "primary",
603
+ size: "lg",
604
+ loading: busy && renaming === void 0 && deleting === void 0,
605
+ loadingLabel: "Saving",
606
+ disabled: busy,
607
+ onPress: () => void run(() => actions.setSessionGroups(session.id, value), onClose),
608
+ children: "Save"
609
+ })
610
+ ]
611
+ })] }) })
612
+ });
613
+ }
614
+ /** A pending setup's ⋮: it has no runtime, so removing it is the only action, as in the cockpit. */
615
+ function SetupMenuSheet({ target, removePendingSetup, onClose }) {
616
+ const [busy, setBusy] = useState(false);
617
+ const [error, setError] = useState("");
618
+ const close = () => {
619
+ if (busy) return;
620
+ setError("");
621
+ onClose();
622
+ };
623
+ const remove = async () => {
624
+ if (target === null) return;
625
+ setBusy(true);
626
+ setError("");
627
+ const result = await removePendingSetup(target.sessionId, target.setup.id);
628
+ setBusy(false);
629
+ if (result === void 0) onClose();
630
+ else setError(result.error);
631
+ };
632
+ return /* @__PURE__ */ jsx(Sheet, {
633
+ open: target !== null,
634
+ onOpenChange: (open) => !open && close(),
635
+ children: /* @__PURE__ */ jsx(SheetContent, { children: target === null ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, {
636
+ numberOfLines: 1,
637
+ children: target.setup.name
638
+ }) }), /* @__PURE__ */ jsxs(SheetBody, {
639
+ style: styles.body,
640
+ children: [/* @__PURE__ */ jsx(Items, { items: [{
641
+ label: busy ? "Removing…" : "Remove setup",
642
+ danger: true,
643
+ disabled: busy,
644
+ onPress: () => void remove()
645
+ }] }), error ? /* @__PURE__ */ jsx(Text, {
646
+ style: styles.error,
647
+ accessibilityRole: "alert",
648
+ children: error
649
+ }) : null]
650
+ })] }) })
651
+ });
652
+ }
653
+ const SUGGESTION_DEBOUNCE_MS = 120;
654
+ const TRAILING_SEPARATORS = /\/+$/u;
655
+ function folderName(path) {
656
+ const trimmed = path.trim().replace(TRAILING_SEPARATORS, "");
657
+ return trimmed.slice(trimmed.lastIndexOf("/") + 1) || trimmed;
658
+ }
659
+ /** The cockpit's folder browser, in place: up, into a child, or use the current folder. */
660
+ function FolderBrowser({ start, listDirectory, onSelect }) {
661
+ const [target, setTarget] = useState(start);
662
+ const [listing, setListing] = useState(null);
663
+ const [error, setError] = useState("");
664
+ useEffect(() => {
665
+ let stale = false;
666
+ listDirectory(target).then((result) => {
667
+ if (stale) return;
668
+ if ("error" in result) setError(result.error);
669
+ else {
670
+ setError("");
671
+ setListing(result);
672
+ }
673
+ });
674
+ return () => {
675
+ stale = true;
676
+ };
677
+ }, [target, listDirectory]);
678
+ const parent = listing?.parent;
679
+ return /* @__PURE__ */ jsxs(View, {
680
+ style: styles.list,
681
+ children: [
682
+ /* @__PURE__ */ jsxs(View, {
683
+ style: styles.browserHead,
684
+ children: [/* @__PURE__ */ jsx(Text, {
685
+ style: styles.path,
686
+ numberOfLines: 1,
687
+ ellipsizeMode: "head",
688
+ children: listing?.path ?? "Loading…"
689
+ }), /* @__PURE__ */ jsx(Button, {
690
+ size: "sm",
691
+ disabled: listing === null,
692
+ onPress: () => listing !== null && onSelect(listing.path),
693
+ children: "Use this folder"
694
+ })]
695
+ }),
696
+ error ? /* @__PURE__ */ jsx(Text, {
697
+ style: [styles.error, styles.inset],
698
+ accessibilityRole: "alert",
699
+ children: error
700
+ }) : null,
701
+ parent === void 0 ? null : /* @__PURE__ */ jsx(ListRow, {
702
+ title: "Parent folder",
703
+ disclosure: false,
704
+ onPress: () => setTarget(parent),
705
+ style: styles.divider
706
+ }),
707
+ listing?.directories.length === 0 ? /* @__PURE__ */ jsx(Text, {
708
+ style: [styles.meta, styles.inset],
709
+ children: "No folders here"
710
+ }) : null,
711
+ listing?.directories.map((directory) => /* @__PURE__ */ jsx(ListRow, {
712
+ title: folderName(directory),
713
+ leading: /* @__PURE__ */ jsx(FolderIcon, {
714
+ size: 16,
715
+ color: "dim"
716
+ }),
717
+ onPress: () => setTarget(directory),
718
+ style: styles.divider
719
+ }, directory))
720
+ ]
721
+ });
722
+ }
723
+ /** The approved native composition, shared by the real sheet and deterministic stories. */
724
+ function AddWorkspaceView({ open, path, name, instructions, rows, discovering, error, busy, manual, canSubmit, onPathChange, onNameChange, onInstructionsChange, onBrowse, onToggle, onSubmit, onClose, folderContent }) {
725
+ const count = rows.filter((row) => row.checked && !row.workspaceId).length;
726
+ const retry = rows.some((row) => row.error);
727
+ return /* @__PURE__ */ jsx(Sheet, {
728
+ open,
729
+ onOpenChange: (next) => !next && !busy && onClose(),
730
+ children: /* @__PURE__ */ jsxs(SheetContent, { children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: "Add workspace" }) }), /* @__PURE__ */ jsxs(SheetBody, {
731
+ style: styles.body,
732
+ children: [
733
+ /* @__PURE__ */ jsxs(View, {
734
+ style: styles.field,
735
+ children: [/* @__PURE__ */ jsx(Label, { children: "Folder" }), /* @__PURE__ */ jsxs(View, {
736
+ style: styles.pathRow,
737
+ children: [/* @__PURE__ */ jsx(Input, {
738
+ value: path,
739
+ onChangeText: onPathChange,
740
+ disabled: busy,
741
+ placeholder: "~/workspace/my-project",
742
+ autoCapitalize: "none",
743
+ autoCorrect: false,
744
+ accessibilityLabel: "Workspace folder",
745
+ style: styles.admissionPathInput
746
+ }), /* @__PURE__ */ jsx(Button, {
747
+ variant: "outline",
748
+ disabled: busy,
749
+ onPress: onBrowse,
750
+ children: "Browse"
751
+ })]
752
+ })]
753
+ }),
754
+ folderContent,
755
+ discovering ? /* @__PURE__ */ jsxs(View, {
756
+ style: styles.pathRow,
757
+ children: [/* @__PURE__ */ jsx(Spinner, { label: "Reading workspace declarations" }), /* @__PURE__ */ jsx(Text, {
758
+ style: styles.meta,
759
+ children: "Reading workspace declarations…"
760
+ })]
761
+ }) : null,
762
+ error ? /* @__PURE__ */ jsx(Text, {
763
+ accessibilityRole: "alert",
764
+ style: styles.error,
765
+ children: error
766
+ }) : null,
767
+ rows.length > 0 ? /* @__PURE__ */ jsxs(View, {
768
+ style: styles.field,
769
+ children: [
770
+ /* @__PURE__ */ jsx(Label, { children: "Workspaces" }),
771
+ /* @__PURE__ */ jsx(Text, {
772
+ style: styles.meta,
773
+ children: "Declared in .po/config.yaml. Choose which to add."
774
+ }),
775
+ rows.map((entry) => {
776
+ const added = entry.workspaceId !== void 0;
777
+ return /* @__PURE__ */ jsxs(View, { children: [/* @__PURE__ */ jsx(Pressable, {
778
+ accessibilityRole: "checkbox",
779
+ accessibilityLabel: `${entry.name}${added ? ", Added" : ""}`,
780
+ accessibilityHint: entry.instructions,
781
+ accessibilityState: {
782
+ checked: entry.checked,
783
+ disabled: added || busy
784
+ },
785
+ disabled: added || busy,
786
+ onPress: () => onToggle(entry.name),
787
+ children: /* @__PURE__ */ jsx(ListRow, {
788
+ title: entry.name,
789
+ disclosure: false,
790
+ description: /* @__PURE__ */ jsx(Text, {
791
+ numberOfLines: 1,
792
+ style: styles.meta,
793
+ children: entry.instructions
794
+ }),
795
+ leading: entry.checked ? /* @__PURE__ */ jsx(CheckIcon, {
796
+ size: 18,
797
+ color: "green"
798
+ }) : /* @__PURE__ */ jsx(View, { style: styles.unchecked }),
799
+ trailing: added ? /* @__PURE__ */ jsx(Text, {
800
+ style: styles.meta,
801
+ children: "Added"
802
+ }) : void 0,
803
+ style: styles.admissionRow
804
+ })
805
+ }), entry.error ? /* @__PURE__ */ jsx(Text, {
806
+ accessibilityRole: "alert",
807
+ style: styles.error,
808
+ children: entry.error
809
+ }) : null] }, entry.name);
810
+ })
811
+ ]
812
+ }) : null,
813
+ manual ? /* @__PURE__ */ jsxs(Fragment, { children: [
814
+ /* @__PURE__ */ jsxs(View, {
815
+ style: styles.field,
816
+ children: [/* @__PURE__ */ jsx(Label, { children: "Name" }), /* @__PURE__ */ jsx(Input, {
817
+ value: name,
818
+ onChangeText: onNameChange,
819
+ disabled: busy,
820
+ placeholder: "my-project",
821
+ autoCapitalize: "none",
822
+ autoCorrect: false,
823
+ accessibilityLabel: "Workspace name"
824
+ })]
825
+ }),
826
+ /* @__PURE__ */ jsxs(View, {
827
+ style: styles.field,
828
+ children: [
829
+ /* @__PURE__ */ jsx(Label, { children: "Instructions (optional)" }),
830
+ /* @__PURE__ */ jsx(Textarea, {
831
+ rows: 3,
832
+ value: instructions,
833
+ onChangeText: onInstructionsChange,
834
+ disabled: busy,
835
+ accessibilityLabel: "Workspace instructions"
836
+ }),
837
+ /* @__PURE__ */ jsx(Text, {
838
+ style: styles.meta,
839
+ children: "For main sessions in this workspace."
840
+ })
841
+ ]
842
+ }),
843
+ path.trim() === "" && name.trim() !== "" ? /* @__PURE__ */ jsxs(Text, {
844
+ style: styles.meta,
845
+ children: ["Creates ", /* @__PURE__ */ jsxs(Text, {
846
+ style: styles.mono,
847
+ children: ["~/.po/workspace/", name.trim()]
848
+ })]
849
+ }) : null
850
+ ] }) : null,
851
+ /* @__PURE__ */ jsx(Button, {
852
+ variant: "primary",
853
+ size: "lg",
854
+ disabled: !canSubmit,
855
+ loading: busy,
856
+ loadingLabel: "Adding",
857
+ onPress: onSubmit,
858
+ children: rows.length > 0 ? `${retry ? "Retry" : "Add"} ${count} workspace${count === 1 ? "" : "s"}` : "Add workspace"
859
+ })
860
+ ]
861
+ })] })
862
+ });
863
+ }
864
+ /** Discovery is optional so fetched templates still work with older phone providers. */
865
+ function AddWorkspaceSheet({ open, actions, onClose }) {
866
+ const [name, setName] = useState("");
867
+ const [nameEdited, setNameEdited] = useState(false);
868
+ const [path, setPath] = useState("");
869
+ const [instructions, setInstructions] = useState("");
870
+ const [discoveryRevision, setDiscoveryRevision] = useState(0);
871
+ const [browsing, setBrowsing] = useState(false);
872
+ const [suggestions, setSuggestions] = useState([]);
873
+ const [busy, setBusy] = useState(false);
874
+ const [error, setError] = useState("");
875
+ const [discovery, setDiscovery] = useState();
876
+ const { searchDirectories, discoverWorkspaces, addDeclaredWorkspaces } = actions;
877
+ const supportsDiscovery = discoverWorkspaces !== void 0 && addDeclaredWorkspaces !== void 0;
878
+ const shownName = nameEdited ? name : folderName(path);
879
+ const trimmedPath = path.trim().replace(TRAILING_SEPARATORS, "") || (path.trim() === "" ? "" : "/");
880
+ const current = discovery?.path === trimmedPath ? discovery : void 0;
881
+ const discovering = supportsDiscovery && trimmedPath !== "" && current === void 0;
882
+ const rows = current?.rows ?? [];
883
+ const manual = !discovering && !current?.error && rows.length === 0;
884
+ const canSubmit = !busy && !discovering && !current?.error && (rows.length > 0 ? rows.some((row) => row.checked && !row.workspaceId) : trimmedPath !== "" || shownName.trim() !== "");
885
+ useEffect(() => {
886
+ if (!open || !supportsDiscovery || trimmedPath === "" || discoverWorkspaces === void 0) return;
887
+ let stale = false;
888
+ const timer = setTimeout(() => {
889
+ discoverWorkspaces(trimmedPath).then((result) => {
890
+ if (stale) return;
891
+ setDiscovery({
892
+ path: trimmedPath,
893
+ root: "root" in result ? result.root : trimmedPath,
894
+ rows: "declarations" in result ? result.declarations.map((row) => ({
895
+ ...row,
896
+ checked: true
897
+ })) : [],
898
+ error: "error" in result ? result.error : ""
899
+ });
900
+ }, () => {
901
+ if (!stale) setDiscovery({
902
+ path: trimmedPath,
903
+ root: trimmedPath,
904
+ rows: [],
905
+ error: "Could not read workspace declarations. Choose the folder again to retry."
906
+ });
907
+ });
908
+ }, SUGGESTION_DEBOUNCE_MS);
909
+ return () => {
910
+ stale = true;
911
+ clearTimeout(timer);
912
+ };
913
+ }, [
914
+ open,
915
+ trimmedPath,
916
+ supportsDiscovery,
917
+ discoverWorkspaces,
918
+ discoveryRevision
919
+ ]);
920
+ useEffect(() => {
921
+ if (!open || path.trim() === "") return;
922
+ let stale = false;
923
+ const timer = setTimeout(async () => {
924
+ const found = await searchDirectories(path.trim());
925
+ if (!stale) setSuggestions(found.filter((directory) => directory !== path.trim()));
926
+ }, SUGGESTION_DEBOUNCE_MS);
927
+ return () => {
928
+ stale = true;
929
+ clearTimeout(timer);
930
+ };
931
+ }, [
932
+ open,
933
+ path,
934
+ searchDirectories
935
+ ]);
936
+ const changePath = (next) => {
937
+ setPath(next);
938
+ setDiscovery(void 0);
939
+ setSuggestions([]);
940
+ setError("");
941
+ setDiscoveryRevision((revision) => revision + 1);
942
+ };
943
+ const finish = () => {
944
+ setName("");
945
+ setNameEdited(false);
946
+ setPath("");
947
+ setInstructions("");
948
+ setBrowsing(false);
949
+ setSuggestions([]);
950
+ setError("");
951
+ setDiscovery(void 0);
952
+ onClose();
953
+ };
954
+ const submit = async () => {
955
+ if (!canSubmit) return;
956
+ setBusy(true);
957
+ setError("");
958
+ try {
959
+ if (rows.length > 0 && addDeclaredWorkspaces !== void 0 && current !== void 0) {
960
+ const selected = rows.filter((row) => row.checked && !row.workspaceId);
961
+ const { results } = await addDeclaredWorkspaces({
962
+ path: current.root,
963
+ names: selected.map((row) => row.name)
964
+ });
965
+ const updated = rows.map((row) => {
966
+ if (!selected.includes(row)) return row;
967
+ const result = results.find((entry) => entry.name === row.name);
968
+ return {
969
+ ...row,
970
+ workspaceId: result?.workspaceId,
971
+ error: result?.error ?? (result?.workspaceId ? void 0 : "Could not add this workspace. Try again.")
972
+ };
973
+ });
974
+ setDiscovery({
975
+ ...current,
976
+ rows: updated
977
+ });
978
+ if (updated.some((row) => row.checked && !row.workspaceId)) return;
979
+ } else {
980
+ const result = await actions.addWorkspace({
981
+ name: shownName.trim(),
982
+ ...trimmedPath === "" ? {} : { path: trimmedPath },
983
+ ...instructions === "" ? {} : { instructions }
984
+ });
985
+ if (result !== void 0) {
986
+ setError(result.error);
987
+ return;
988
+ }
989
+ }
990
+ finish();
991
+ } catch {
992
+ setError("Could not add the workspace. Try again.");
993
+ } finally {
994
+ setBusy(false);
995
+ }
996
+ };
997
+ return /* @__PURE__ */ jsx(AddWorkspaceView, {
998
+ open,
999
+ path,
1000
+ name: shownName,
1001
+ instructions,
1002
+ rows,
1003
+ discovering,
1004
+ error: current?.error || error,
1005
+ busy,
1006
+ manual,
1007
+ canSubmit,
1008
+ onPathChange: changePath,
1009
+ onNameChange: (next) => {
1010
+ setNameEdited(true);
1011
+ setName(next);
1012
+ },
1013
+ onInstructionsChange: setInstructions,
1014
+ onBrowse: () => setBrowsing((value) => !value),
1015
+ onToggle: (name) => current && setDiscovery({
1016
+ ...current,
1017
+ rows: rows.map((row) => row.name === name && !row.workspaceId ? {
1018
+ ...row,
1019
+ checked: !row.checked
1020
+ } : row)
1021
+ }),
1022
+ onSubmit: () => void submit(),
1023
+ onClose: finish,
1024
+ folderContent: busy ? null : browsing ? /* @__PURE__ */ jsx(FolderBrowser, {
1025
+ ...trimmedPath.startsWith("/") ? { start: trimmedPath } : {},
1026
+ listDirectory: actions.listDirectory,
1027
+ onSelect: (selected) => {
1028
+ changePath(selected);
1029
+ setBrowsing(false);
1030
+ }
1031
+ }) : suggestions.length > 0 ? /* @__PURE__ */ jsx(View, {
1032
+ style: styles.list,
1033
+ accessibilityLabel: "Matching folders",
1034
+ children: suggestions.map((directory, index) => /* @__PURE__ */ jsx(ListRow, {
1035
+ title: /* @__PURE__ */ jsx(Text, {
1036
+ style: styles.path,
1037
+ numberOfLines: 1,
1038
+ ellipsizeMode: "head",
1039
+ children: directory
1040
+ }),
1041
+ disclosure: false,
1042
+ onPress: () => changePath(`${directory}/`),
1043
+ style: index > 0 && styles.divider
1044
+ }, directory))
1045
+ }) : null
1046
+ });
1047
+ }
1048
+ const styles = StyleSheet.create((theme) => {
1049
+ const sans = fontOf(theme.fontFamily.sans);
1050
+ const text = (size, color) => ({
1051
+ fontFamily: sans,
1052
+ fontSize: theme.fontSize[size],
1053
+ lineHeight: theme.lineHeight[size],
1054
+ color
1055
+ });
1056
+ return {
1057
+ body: {
1058
+ gap: theme.spacing(3),
1059
+ uni__dependencies: [0]
1060
+ },
1061
+ list: {
1062
+ borderRadius: theme.borderRadius.lg,
1063
+ borderWidth: 1,
1064
+ borderColor: theme.colors["border-soft"],
1065
+ overflow: "hidden",
1066
+ uni__dependencies: [0]
1067
+ },
1068
+ item: {
1069
+ minHeight: 48,
1070
+ justifyContent: "center",
1071
+ gap: 2,
1072
+ paddingHorizontal: theme.spacing(4),
1073
+ paddingVertical: theme.spacing(2.5),
1074
+ uni__dependencies: [0]
1075
+ },
1076
+ divider: {
1077
+ borderTopWidth: StyleSheet.hairlineWidth,
1078
+ borderTopColor: theme.colors["border-soft"],
1079
+ uni__dependencies: [0]
1080
+ },
1081
+ field: {
1082
+ gap: theme.spacing(1.5),
1083
+ uni__dependencies: [0]
1084
+ },
1085
+ pathRow: {
1086
+ flexDirection: "row",
1087
+ alignItems: "center",
1088
+ gap: theme.spacing(2),
1089
+ uni__dependencies: [0]
1090
+ },
1091
+ pathInput: {
1092
+ flex: 1,
1093
+ minWidth: 0
1094
+ },
1095
+ admissionPathInput: {
1096
+ flex: 1,
1097
+ minWidth: 0,
1098
+ fontFamily: fontOf(theme.fontFamily.mono),
1099
+ uni__dependencies: [0]
1100
+ },
1101
+ admissionRow: {
1102
+ minHeight: 44,
1103
+ borderBottomWidth: StyleSheet.hairlineWidth,
1104
+ borderBottomColor: theme.colors["border-soft"],
1105
+ uni__dependencies: [0]
1106
+ },
1107
+ unchecked: {
1108
+ width: 18,
1109
+ height: 18,
1110
+ borderWidth: 1,
1111
+ borderColor: theme.colors.dim,
1112
+ uni__dependencies: [0]
1113
+ },
1114
+ browserHead: {
1115
+ flexDirection: "row",
1116
+ alignItems: "center",
1117
+ gap: theme.spacing(2),
1118
+ paddingHorizontal: theme.spacing(4),
1119
+ paddingVertical: theme.spacing(2),
1120
+ uni__dependencies: [0]
1121
+ },
1122
+ path: {
1123
+ ...text("sm", theme.colors.dim),
1124
+ fontFamily: fontOf(theme.fontFamily.mono),
1125
+ flexShrink: 1,
1126
+ flexGrow: 1,
1127
+ uni__dependencies: [0]
1128
+ },
1129
+ inset: {
1130
+ paddingHorizontal: theme.spacing(4),
1131
+ paddingBottom: theme.spacing(2),
1132
+ uni__dependencies: [0]
1133
+ },
1134
+ rowEdit: {
1135
+ gap: theme.spacing(2),
1136
+ paddingHorizontal: theme.spacing(4),
1137
+ paddingVertical: theme.spacing(3),
1138
+ uni__dependencies: [0]
1139
+ },
1140
+ rowActions: {
1141
+ flexDirection: "row",
1142
+ alignItems: "center",
1143
+ justifyContent: "flex-end",
1144
+ gap: theme.spacing(1),
1145
+ uni__dependencies: [0]
1146
+ },
1147
+ check: {
1148
+ width: 16,
1149
+ alignItems: "center"
1150
+ },
1151
+ create: (enabled) => text("base", enabled ? theme.colors.magenta : theme.colors.faint),
1152
+ pressed: {
1153
+ backgroundColor: theme.colors["tint-green"],
1154
+ uni__dependencies: [0]
1155
+ },
1156
+ itemLabel: (danger, disabled) => ({
1157
+ ...text("base", disabled ? theme.colors.faint : danger ? theme.colors.red : theme.colors.hi),
1158
+ fontWeight: theme.fontWeight.medium,
1159
+ uni__dependencies: [0]
1160
+ }),
1161
+ meta: text("sm", theme.colors.dim),
1162
+ text: {
1163
+ ...text("base", theme.colors.text),
1164
+ lineHeight: theme.lineHeightRelaxed.base,
1165
+ uni__dependencies: [0]
1166
+ },
1167
+ strong: {
1168
+ fontWeight: theme.fontWeight.semibold,
1169
+ color: theme.colors.hi,
1170
+ uni__dependencies: [0]
1171
+ },
1172
+ mono: {
1173
+ fontFamily: fontOf(theme.fontFamily.mono),
1174
+ color: theme.colors.hi,
1175
+ uni__dependencies: [0]
1176
+ },
1177
+ error: {
1178
+ ...text("sm", theme.colors.red),
1179
+ lineHeight: theme.lineHeightRelaxed.sm,
1180
+ uni__dependencies: [0]
1181
+ }
1182
+ };
1183
+ });
1184
+
1185
+ //#endregion
1186
+ export { AddWorkspaceSheet, AddWorkspaceView, SessionGroupsSheet, SessionMenuSheet, SetupMenuSheet, WorkspaceMenuSheet };
1187
+ //# sourceMappingURL=SessionMenus.mjs.map