@adea-ai/ui 0.144.1 → 0.145.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/components/composites/workspace-switcher/index.d.ts +2 -0
- package/dist/components/composites/workspace-switcher/index.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/index.js +3 -1
- package/dist/components/composites/workspace-switcher/workspace-order.d.ts +16 -0
- package/dist/components/composites/workspace-switcher/workspace-order.d.ts.map +1 -0
- package/dist/components/composites/workspace-switcher/workspace-order.js +24 -0
- package/dist/components/composites/workspace-switcher/workspace-order.js.map +1 -0
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts +31 -0
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -0
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +198 -0
- package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -0
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts +9 -0
- package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
- package/dist/components/composites/workspace-switcher/workspace-switcher.js +39 -4
- package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/r/registry.json +12 -0
- package/dist/r/src/components/composites/workspace-switcher/index.ts +5 -0
- package/dist/r/src/components/composites/workspace-switcher/workspace-order.ts +38 -0
- package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +204 -0
- package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +94 -60
- package/dist/r/workspace-switcher.json +12 -0
- package/package.json +1 -1
- package/registry.json +12 -0
- package/src/components/composites/workspace-switcher/index.ts +5 -0
- package/src/components/composites/workspace-switcher/workspace-order.ts +38 -0
- package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +204 -0
- package/src/components/composites/workspace-switcher/workspace-switcher.tsx +94 -60
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { WorkspaceSwitcher, type WorkspaceSwitcherItem, type WorkspaceSwitcherProps, } from './workspace-switcher';
|
|
2
|
+
export { WorkspaceReorderDialog, type WorkspaceReorderDialogProps, } from './workspace-reorder-dialog';
|
|
3
|
+
export { moveTarget, moveWorkspace, type WorkspaceMoveDirection } from './workspace-order';
|
|
2
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { moveTarget, moveWorkspace } from "./workspace-order.js";
|
|
2
|
+
import { WorkspaceReorderDialog } from "./workspace-reorder-dialog.js";
|
|
1
3
|
import { WorkspaceSwitcher } from "./workspace-switcher.js";
|
|
2
|
-
export { WorkspaceSwitcher };
|
|
4
|
+
export { WorkspaceReorderDialog, WorkspaceSwitcher, moveTarget, moveWorkspace };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ordering rules behind the workspace switcher's reorder dialog.
|
|
3
|
+
*
|
|
4
|
+
* Kept free of any view so the rules (a fixed workspace never moves and nothing
|
|
5
|
+
* moves past it) are held by unit tests rather than by clicking through a menu.
|
|
6
|
+
*/
|
|
7
|
+
export type WorkspaceOrderItem = {
|
|
8
|
+
id: string;
|
|
9
|
+
fixed?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type WorkspaceMoveDirection = 'up' | 'down';
|
|
12
|
+
/** The position a move would land on, or undefined when the move is not allowed. */
|
|
13
|
+
export declare function moveTarget(items: readonly WorkspaceOrderItem[], id: string, direction: WorkspaceMoveDirection): number | undefined;
|
|
14
|
+
/** The ids in their new order after one move, or undefined when the move is not allowed. */
|
|
15
|
+
export declare function moveWorkspace(items: readonly WorkspaceOrderItem[], id: string, direction: WorkspaceMoveDirection): string[] | undefined;
|
|
16
|
+
//# sourceMappingURL=workspace-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-order.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-order.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEhE,MAAM,MAAM,sBAAsB,GAAG,IAAI,GAAG,MAAM,CAAA;AAElD,oFAAoF;AACpF,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,sBAAsB,GAChC,MAAM,GAAG,SAAS,CAOpB;AAED,4FAA4F;AAC5F,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,sBAAsB,GAChC,MAAM,EAAE,GAAG,SAAS,CAQtB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/components/composites/workspace-switcher/workspace-order.ts
|
|
2
|
+
/** The position a move would land on, or undefined when the move is not allowed. */
|
|
3
|
+
function moveTarget(items, id, direction) {
|
|
4
|
+
const from = items.findIndex((item) => item.id === id);
|
|
5
|
+
if (from < 0 || items[from]?.fixed) return void 0;
|
|
6
|
+
const to = direction === "up" ? from - 1 : from + 1;
|
|
7
|
+
const neighbour = items[to];
|
|
8
|
+
if (!neighbour || neighbour.fixed) return void 0;
|
|
9
|
+
return to;
|
|
10
|
+
}
|
|
11
|
+
/** The ids in their new order after one move, or undefined when the move is not allowed. */
|
|
12
|
+
function moveWorkspace(items, id, direction) {
|
|
13
|
+
const to = moveTarget(items, id, direction);
|
|
14
|
+
if (to === void 0) return void 0;
|
|
15
|
+
const ids = items.map((item) => item.id);
|
|
16
|
+
const from = ids.indexOf(id);
|
|
17
|
+
ids.splice(from, 1);
|
|
18
|
+
ids.splice(to, 0, id);
|
|
19
|
+
return ids;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { moveTarget, moveWorkspace };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=workspace-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-order.js","names":[],"sources":["../../../../src/components/composites/workspace-switcher/workspace-order.ts"],"sourcesContent":["/**\n * The ordering rules behind the workspace switcher's reorder dialog.\n *\n * Kept free of any view so the rules (a fixed workspace never moves and nothing\n * moves past it) are held by unit tests rather than by clicking through a menu.\n */\nexport type WorkspaceOrderItem = { id: string; fixed?: boolean }\n\nexport type WorkspaceMoveDirection = 'up' | 'down'\n\n/** The position a move would land on, or undefined when the move is not allowed. */\nexport function moveTarget(\n items: readonly WorkspaceOrderItem[],\n id: string,\n direction: WorkspaceMoveDirection\n): number | undefined {\n const from = items.findIndex((item) => item.id === id)\n if (from < 0 || items[from]?.fixed) return undefined\n const to = direction === 'up' ? from - 1 : from + 1\n const neighbour = items[to]\n if (!neighbour || neighbour.fixed) return undefined\n return to\n}\n\n/** The ids in their new order after one move, or undefined when the move is not allowed. */\nexport function moveWorkspace(\n items: readonly WorkspaceOrderItem[],\n id: string,\n direction: WorkspaceMoveDirection\n): string[] | undefined {\n const to = moveTarget(items, id, direction)\n if (to === undefined) return undefined\n const ids = items.map((item) => item.id)\n const from = ids.indexOf(id)\n ids.splice(from, 1)\n ids.splice(to, 0, id)\n return ids\n}\n"],"mappings":";;AAWA,SAAgB,WACd,OACA,IACA,WACoB;CACpB,MAAM,OAAO,MAAM,WAAW,SAAS,KAAK,OAAO,EAAE;CACrD,IAAI,OAAO,KAAK,MAAM,KAAK,EAAE,OAAO,OAAO,KAAA;CAC3C,MAAM,KAAK,cAAc,OAAO,OAAO,IAAI,OAAO;CAClD,MAAM,YAAY,MAAM;CACxB,IAAI,CAAC,aAAa,UAAU,OAAO,OAAO,KAAA;CAC1C,OAAO;AACT;;AAGA,SAAgB,cACd,OACA,IACA,WACsB;CACtB,MAAM,KAAK,WAAW,OAAO,IAAI,SAAS;CAC1C,IAAI,OAAO,KAAA,GAAW,OAAO,KAAA;CAC7B,MAAM,MAAM,MAAM,KAAK,SAAS,KAAK,EAAE;CACvC,MAAM,OAAO,IAAI,QAAQ,EAAE;CAC3B,IAAI,OAAO,MAAM,CAAC;CAClB,IAAI,OAAO,IAAI,GAAG,EAAE;CACpB,OAAO;AACT"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Accessor } from 'solid-js';
|
|
2
|
+
export type WorkspaceReorderItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
fixed?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type WorkspaceReorderDialogProps = {
|
|
8
|
+
open: boolean;
|
|
9
|
+
onOpenChange(open: boolean): void;
|
|
10
|
+
workspaces: readonly WorkspaceReorderItem[];
|
|
11
|
+
/** Receives the full id order after one move. May be async; a rejection shows an error. */
|
|
12
|
+
onReorder(ids: readonly string[]): void | Promise<void>;
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Where focus returns on close; the menu item that opened the dialog is gone by then. */
|
|
15
|
+
restoreFocusRef?: Accessor<HTMLElement | undefined>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* WorkspaceReorderDialog.
|
|
19
|
+
*
|
|
20
|
+
* Ordering by buttons, not by dragging, so it works from the keyboard and with
|
|
21
|
+
* a screen reader: every row has a labelled Move up and Move down. Each move is
|
|
22
|
+
* reported to the host straight away (there is no Save), the moved row keeps
|
|
23
|
+
* focus on the control that was used, and the new position is announced.
|
|
24
|
+
*
|
|
25
|
+
* One save runs at a time, even across a close and reopen: the moves stay
|
|
26
|
+
* disabled until the host's promise settles. A save that finishes after the
|
|
27
|
+
* dialog has closed reports nothing here (the host owns any failure it wants
|
|
28
|
+
* to surface) and never moves focus.
|
|
29
|
+
*/
|
|
30
|
+
export declare function WorkspaceReorderDialog(props: WorkspaceReorderDialogProps): import("solid-js").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=workspace-reorder-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-reorder-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAwD,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAA;AAe9F,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAC3C,2FAA2F;IAC3F,SAAS,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0FAA0F;IAC1F,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;CACpD,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,kCA6JxE"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { Button } from "../../ui/button/button.js";
|
|
2
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, createDialogFocusRestoration } from "../../ui/dialog/dialog.js";
|
|
3
|
+
import { ActionButton } from "../action-button/action-button.js";
|
|
4
|
+
import { moveTarget, moveWorkspace } from "./workspace-order.js";
|
|
5
|
+
import { createComponent, effect, insert, setAttribute, template, use } from "solid-js/web";
|
|
6
|
+
import { ArrowDown, ArrowUp } from "lucide-solid";
|
|
7
|
+
import { For, Show, createEffect, createSignal, on, onCleanup } from "solid-js";
|
|
8
|
+
//#region src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx
|
|
9
|
+
var _tmpl$ = /*#__PURE__*/ template(`<ol class="flex flex-col gap-1"aria-label="Workspace order">`);
|
|
10
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<p role=status aria-live=polite class="min-h-5 text-xs text-muted-foreground">`);
|
|
11
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<p role=alert class="text-xs text-destructive">`);
|
|
12
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<li class="flex items-center gap-2 rounded-md border border-border px-3 py-1.5"><span class="min-w-0 flex-1 truncate text-sm">`);
|
|
13
|
+
var _tmpl$5 = /*#__PURE__*/ template(`<span class="text-xs text-muted-foreground">Always first`);
|
|
14
|
+
/**
|
|
15
|
+
* WorkspaceReorderDialog.
|
|
16
|
+
*
|
|
17
|
+
* Ordering by buttons, not by dragging, so it works from the keyboard and with
|
|
18
|
+
* a screen reader: every row has a labelled Move up and Move down. Each move is
|
|
19
|
+
* reported to the host straight away (there is no Save), the moved row keeps
|
|
20
|
+
* focus on the control that was used, and the new position is announced.
|
|
21
|
+
*
|
|
22
|
+
* One save runs at a time, even across a close and reopen: the moves stay
|
|
23
|
+
* disabled until the host's promise settles. A save that finishes after the
|
|
24
|
+
* dialog has closed reports nothing here (the host owns any failure it wants
|
|
25
|
+
* to surface) and never moves focus.
|
|
26
|
+
*/
|
|
27
|
+
function WorkspaceReorderDialog(props) {
|
|
28
|
+
const [status, setStatus] = createSignal("");
|
|
29
|
+
const [error, setError] = createSignal("");
|
|
30
|
+
const [pending, setPending] = createSignal(false);
|
|
31
|
+
let list;
|
|
32
|
+
let session = 0;
|
|
33
|
+
let disposed = false;
|
|
34
|
+
let frame;
|
|
35
|
+
createEffect(on(() => props.open, () => {
|
|
36
|
+
session += 1;
|
|
37
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
38
|
+
frame = void 0;
|
|
39
|
+
setStatus("");
|
|
40
|
+
setError("");
|
|
41
|
+
}, { defer: true }));
|
|
42
|
+
onCleanup(() => {
|
|
43
|
+
disposed = true;
|
|
44
|
+
session += 1;
|
|
45
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
46
|
+
});
|
|
47
|
+
const focus = createDialogFocusRestoration({
|
|
48
|
+
open: () => props.open,
|
|
49
|
+
restoreFocusRef: props.restoreFocusRef
|
|
50
|
+
});
|
|
51
|
+
const focusMove = (owner, id, direction) => {
|
|
52
|
+
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
53
|
+
frame = requestAnimationFrame(() => {
|
|
54
|
+
frame = void 0;
|
|
55
|
+
if (disposed || owner !== session || !props.open) return;
|
|
56
|
+
const row = list?.querySelector(`[data-reorder-id="${CSS.escape(id)}"]`);
|
|
57
|
+
const wanted = row?.querySelector(`[data-move="${direction}"]`);
|
|
58
|
+
const other = row?.querySelector(`[data-move="${direction === "up" ? "down" : "up"}"]`);
|
|
59
|
+
(wanted?.getAttribute("aria-disabled") === "true" ? other : wanted)?.focus({ preventScroll: true });
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const move = async (item, direction) => {
|
|
63
|
+
if (pending()) return;
|
|
64
|
+
const next = moveWorkspace(props.workspaces, item.id, direction);
|
|
65
|
+
if (!next) return;
|
|
66
|
+
const owner = session;
|
|
67
|
+
const current = () => !disposed && owner === session && props.open;
|
|
68
|
+
setError("");
|
|
69
|
+
setPending(true);
|
|
70
|
+
try {
|
|
71
|
+
await props.onReorder(next);
|
|
72
|
+
if (current()) setStatus(`Moved ${item.name} to position ${next.indexOf(item.id) + 1} of ${next.length}.`);
|
|
73
|
+
} catch {
|
|
74
|
+
if (current()) {
|
|
75
|
+
setStatus("");
|
|
76
|
+
setError("Could not save the order. Try again.");
|
|
77
|
+
}
|
|
78
|
+
} finally {
|
|
79
|
+
if (!disposed) setPending(false);
|
|
80
|
+
if (current()) focusMove(owner, item.id, direction);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
return createComponent(Dialog, {
|
|
84
|
+
get open() {
|
|
85
|
+
return props.open;
|
|
86
|
+
},
|
|
87
|
+
get onOpenChange() {
|
|
88
|
+
return props.onOpenChange;
|
|
89
|
+
},
|
|
90
|
+
get children() {
|
|
91
|
+
return createComponent(DialogContent, {
|
|
92
|
+
"class": "w-full max-w-sm",
|
|
93
|
+
onKeyDown: (event) => {
|
|
94
|
+
if (event.key === "Escape" && !event.defaultPrevented) {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
props.onOpenChange(false);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
get onOpenAutoFocus() {
|
|
100
|
+
return focus.onOpenAutoFocus;
|
|
101
|
+
},
|
|
102
|
+
get onCloseAutoFocus() {
|
|
103
|
+
return focus.onCloseAutoFocus;
|
|
104
|
+
},
|
|
105
|
+
get children() {
|
|
106
|
+
return [
|
|
107
|
+
createComponent(DialogHeader, { get children() {
|
|
108
|
+
return [createComponent(DialogTitle, { get children() {
|
|
109
|
+
return props.title ?? "Reorder workspaces";
|
|
110
|
+
} }), createComponent(DialogDescription, { children: "Move a workspace up or down. The order is saved as you go." })];
|
|
111
|
+
} }),
|
|
112
|
+
(() => {
|
|
113
|
+
var _el$ = _tmpl$();
|
|
114
|
+
use((el) => list = el, _el$);
|
|
115
|
+
insert(_el$, createComponent(For, {
|
|
116
|
+
get each() {
|
|
117
|
+
return props.workspaces;
|
|
118
|
+
},
|
|
119
|
+
children: (item) => (() => {
|
|
120
|
+
var _el$4 = _tmpl$4(), _el$5 = _el$4.firstChild;
|
|
121
|
+
insert(_el$5, () => item.name);
|
|
122
|
+
insert(_el$4, createComponent(Show, {
|
|
123
|
+
get when() {
|
|
124
|
+
return !item.fixed;
|
|
125
|
+
},
|
|
126
|
+
get fallback() {
|
|
127
|
+
return _tmpl$5();
|
|
128
|
+
},
|
|
129
|
+
get children() {
|
|
130
|
+
return createComponent(For, {
|
|
131
|
+
each: ["up", "down"],
|
|
132
|
+
children: (direction) => createComponent(ActionButton, {
|
|
133
|
+
variant: "ghost",
|
|
134
|
+
size: "icon-sm",
|
|
135
|
+
"data-move": direction,
|
|
136
|
+
get ["aria-label"]() {
|
|
137
|
+
return `Move ${item.name} ${direction}`;
|
|
138
|
+
},
|
|
139
|
+
tooltip: `Move ${direction}`,
|
|
140
|
+
get disabled() {
|
|
141
|
+
return pending() || moveTarget(props.workspaces, item.id, direction) === void 0;
|
|
142
|
+
},
|
|
143
|
+
onClick: () => void move(item, direction),
|
|
144
|
+
get children() {
|
|
145
|
+
return createComponent(Show, {
|
|
146
|
+
when: direction === "up",
|
|
147
|
+
get fallback() {
|
|
148
|
+
return createComponent(ArrowDown, { "aria-hidden": "true" });
|
|
149
|
+
},
|
|
150
|
+
get children() {
|
|
151
|
+
return createComponent(ArrowUp, { "aria-hidden": "true" });
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}), null);
|
|
159
|
+
effect(() => setAttribute(_el$4, "data-reorder-id", item.id));
|
|
160
|
+
return _el$4;
|
|
161
|
+
})()
|
|
162
|
+
}));
|
|
163
|
+
effect(() => setAttribute(_el$, "aria-busy", pending()));
|
|
164
|
+
return _el$;
|
|
165
|
+
})(),
|
|
166
|
+
(() => {
|
|
167
|
+
var _el$2 = _tmpl$2();
|
|
168
|
+
insert(_el$2, status);
|
|
169
|
+
return _el$2;
|
|
170
|
+
})(),
|
|
171
|
+
createComponent(Show, {
|
|
172
|
+
get when() {
|
|
173
|
+
return error();
|
|
174
|
+
},
|
|
175
|
+
get children() {
|
|
176
|
+
var _el$3 = _tmpl$3();
|
|
177
|
+
insert(_el$3, error);
|
|
178
|
+
return _el$3;
|
|
179
|
+
}
|
|
180
|
+
}),
|
|
181
|
+
createComponent(DialogFooter, { get children() {
|
|
182
|
+
return createComponent(DialogClose, {
|
|
183
|
+
as: Button,
|
|
184
|
+
variant: "outline",
|
|
185
|
+
size: "sm",
|
|
186
|
+
children: "Done"
|
|
187
|
+
});
|
|
188
|
+
} })
|
|
189
|
+
];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
export { WorkspaceReorderDialog };
|
|
197
|
+
|
|
198
|
+
//# sourceMappingURL=workspace-reorder-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-reorder-dialog.js","names":["ArrowDown","ArrowUp","For","Show","createEffect","createSignal","on","onCleanup","Accessor","Button","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","createDialogFocusRestoration","ActionButton","moveTarget","moveWorkspace","WorkspaceMoveDirection","WorkspaceReorderItem","id","name","fixed","WorkspaceReorderDialogProps","open","onOpenChange","workspaces","onReorder","ids","Promise","title","restoreFocusRef","HTMLElement","WorkspaceReorderDialog","props","status","setStatus","error","setError","pending","setPending","list","HTMLOListElement","session","disposed","frame","undefined","cancelAnimationFrame","defer","focus","focusMove","owner","direction","requestAnimationFrame","row","querySelector","CSS","escape","wanted","other","target","getAttribute","preventScroll","move","item","next","current","indexOf","length","_$createComponent","children","onKeyDown","event","KeyboardEvent","key","defaultPrevented","preventDefault","onOpenAutoFocus","onCloseAutoFocus","_el$","_tmpl$","_$use","el","_$insert","each","_el$4","_tmpl$4","_el$5","firstChild","when","fallback","_tmpl$5","const","variant","size","aria-label","tooltip","disabled","onClick","_$effect","_$setAttribute","_el$2","_tmpl$2","_el$3","_tmpl$3","as","_$createComponent","_$setAttribute"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx"],"sourcesContent":["import { ArrowDown, ArrowUp } from 'lucide-solid'\nimport { For, Show, createEffect, createSignal, on, onCleanup, type Accessor } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../../ui/dialog'\nimport { createDialogFocusRestoration } from '../../ui/dialog/dialog'\nimport { ActionButton } from '../action-button'\nimport { moveTarget, moveWorkspace, type WorkspaceMoveDirection } from './workspace-order'\n\nexport type WorkspaceReorderItem = {\n id: string\n name: string\n fixed?: boolean\n}\n\nexport type WorkspaceReorderDialogProps = {\n open: boolean\n onOpenChange(open: boolean): void\n workspaces: readonly WorkspaceReorderItem[]\n /** Receives the full id order after one move. May be async; a rejection shows an error. */\n onReorder(ids: readonly string[]): void | Promise<void>\n title?: string\n /** Where focus returns on close; the menu item that opened the dialog is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\n/**\n * WorkspaceReorderDialog.\n *\n * Ordering by buttons, not by dragging, so it works from the keyboard and with\n * a screen reader: every row has a labelled Move up and Move down. Each move is\n * reported to the host straight away (there is no Save), the moved row keeps\n * focus on the control that was used, and the new position is announced.\n *\n * One save runs at a time, even across a close and reopen: the moves stay\n * disabled until the host's promise settles. A save that finishes after the\n * dialog has closed reports nothing here (the host owns any failure it wants\n * to surface) and never moves focus.\n */\nexport function WorkspaceReorderDialog(props: WorkspaceReorderDialogProps) {\n const [status, setStatus] = createSignal('')\n const [error, setError] = createSignal('')\n const [pending, setPending] = createSignal(false)\n let list: HTMLOListElement | undefined\n // Each open and each close starts a new session. A save belongs to the session\n // it began in; once the dialog has closed (or closed and reopened) its result\n // no longer speaks for what is on screen, so it must not touch the status\n // line or focus. `pending` is deliberately not reset with the session: the\n // host's save is still running, so the next move waits for it instead of\n // running a second save beside it.\n let session = 0\n let disposed = false\n let frame: number | undefined\n\n createEffect(\n on(\n () => props.open,\n () => {\n session += 1\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n setStatus('')\n setError('')\n },\n { defer: true }\n )\n )\n onCleanup(() => {\n disposed = true\n session += 1\n if (frame !== undefined) cancelAnimationFrame(frame)\n })\n\n const focus = createDialogFocusRestoration({\n open: () => props.open,\n restoreFocusRef: props.restoreFocusRef,\n })\n\n const focusMove = (owner: number, id: string, direction: WorkspaceMoveDirection) => {\n // The host re-renders the rows with the new order; focus the same control\n // once it exists, or its sibling when the move reached an edge.\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = requestAnimationFrame(() => {\n frame = undefined\n if (disposed || owner !== session || !props.open) return\n const row = list?.querySelector<HTMLElement>(`[data-reorder-id=\"${CSS.escape(id)}\"]`)\n const wanted = row?.querySelector<HTMLElement>(`[data-move=\"${direction}\"]`)\n const other = row?.querySelector<HTMLElement>(\n `[data-move=\"${direction === 'up' ? 'down' : 'up'}\"]`\n )\n const target = wanted?.getAttribute('aria-disabled') === 'true' ? other : wanted\n target?.focus({ preventScroll: true })\n })\n }\n\n const move = async (item: WorkspaceReorderItem, direction: WorkspaceMoveDirection) => {\n if (pending()) return\n const next = moveWorkspace(props.workspaces, item.id, direction)\n if (!next) return\n const owner = session\n const current = () => !disposed && owner === session && props.open\n setError('')\n setPending(true)\n try {\n await props.onReorder(next)\n if (current())\n setStatus(`Moved ${item.name} to position ${next.indexOf(item.id) + 1} of ${next.length}.`)\n } catch {\n if (current()) {\n setStatus('')\n setError('Could not save the order. Try again.')\n }\n } finally {\n if (!disposed) setPending(false)\n if (current()) focusMove(owner, item.id, direction)\n }\n }\n\n return (\n <Dialog open={props.open} onOpenChange={props.onOpenChange}>\n <DialogContent\n class=\"w-full max-w-sm\"\n onKeyDown={(event: KeyboardEvent) => {\n // Tooltip help on a focused move control would otherwise take the first Escape.\n if (event.key === 'Escape' && !event.defaultPrevented) {\n event.preventDefault()\n props.onOpenChange(false)\n }\n }}\n onOpenAutoFocus={focus.onOpenAutoFocus}\n onCloseAutoFocus={focus.onCloseAutoFocus}\n >\n <DialogHeader>\n <DialogTitle>{props.title ?? 'Reorder workspaces'}</DialogTitle>\n <DialogDescription>\n Move a workspace up or down. The order is saved as you go.\n </DialogDescription>\n </DialogHeader>\n <ol\n ref={(el) => (list = el)}\n class=\"flex flex-col gap-1\"\n aria-label=\"Workspace order\"\n aria-busy={pending()}\n >\n <For each={props.workspaces}>\n {(item) => (\n <li\n data-reorder-id={item.id}\n class=\"flex items-center gap-2 rounded-md border border-border px-3 py-1.5\"\n >\n <span class=\"min-w-0 flex-1 truncate text-sm\">{item.name}</span>\n <Show\n when={!item.fixed}\n fallback={<span class=\"text-xs text-muted-foreground\">Always first</span>}\n >\n <For each={['up', 'down'] as const}>\n {(direction) => (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-sm\"\n data-move={direction}\n aria-label={`Move ${item.name} ${direction}`}\n tooltip={`Move ${direction}`}\n disabled={\n pending() ||\n moveTarget(props.workspaces, item.id, direction) === undefined\n }\n onClick={() => void move(item, direction)}\n >\n <Show when={direction === 'up'} fallback={<ArrowDown aria-hidden=\"true\" />}>\n <ArrowUp aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n )}\n </For>\n </Show>\n </li>\n )}\n </For>\n </ol>\n <p role=\"status\" aria-live=\"polite\" class=\"min-h-5 text-xs text-muted-foreground\">\n {status()}\n </p>\n <Show when={error()}>\n <p role=\"alert\" class=\"text-xs text-destructive\">\n {error()}\n </p>\n </Show>\n <DialogFooter>\n <DialogClose as={Button} variant=\"outline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AA;SAAA,CAAA,GAAA,IAAA;SAAAqG,aAAAC,aAAAf,OAAA,mBA1BYrB,KAAK5C,EAAE,CAAA;SAAA,OAAAiE;QAAA,EAAA,CAAA;OA8B3B,CAAA,CAAA;OAAAc,aAAAC,aAAArB,MAAA,aAnCQxC,QAAQ,CAAC,CAAA;OAAA,OAAAwC;MAAA,EAAA,CAAA;aAAA;OAAA,IAAAsB,QAAAC,QAAA;OAAAnB,OAAAkB,OAuCnBlE,MAAM;OAAA,OAAAkE;MAAA,EAAA,CAAA;MAAAhC,gBAERrE,MAAI;OAAA,IAACyF,OAAI;QAAA,OAAEpD,MAAM;OAAC;OAAA,IAAAiC,WAAA;QAAA,IAAAiC,QAAAC,QAAA;QAAArB,OAAAoB,OAEdlE,KAAK;QAAA,OAAAkE;OAAA;MAAA,CAAA;MAAAlC,gBAGT1D,cAAY,EAAA,IAAA2D,WAAA;OAAA,OAAAD,gBACV7D,aAAW;QAACiG,IAAInG;QAAQuF,SAAO;QAAWC,MAAI;QAAAxB,UAAA;OAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
|
|
@@ -21,6 +21,8 @@ export type WorkspaceSwitcherItem = {
|
|
|
21
21
|
mark: JSX.Element;
|
|
22
22
|
/** A quiet trailing readout in the row, e.g. an unread count. Optional. */
|
|
23
23
|
detail?: JSX.Element;
|
|
24
|
+
/** Pinned to the top of the order, e.g. Home: it cannot be moved and nothing moves above it. */
|
|
25
|
+
fixed?: boolean;
|
|
24
26
|
};
|
|
25
27
|
export type WorkspaceSwitcherProps = {
|
|
26
28
|
workspaces: readonly WorkspaceSwitcherItem[];
|
|
@@ -33,6 +35,13 @@ export type WorkspaceSwitcherProps = {
|
|
|
33
35
|
/** Offered beside the create action when present: open the current workspace's settings. */
|
|
34
36
|
onManage?(): void;
|
|
35
37
|
manageLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Offered when present and at least two workspaces can move: opens a dialog
|
|
40
|
+
* with Move up and Move down on each row. Receives the full id order after
|
|
41
|
+
* each move; the host saves it and passes the workspaces back in that order.
|
|
42
|
+
*/
|
|
43
|
+
onReorder?(ids: readonly string[]): void | Promise<void>;
|
|
44
|
+
reorderLabel?: string;
|
|
36
45
|
/** The menu's heading; also the trigger's accessible-name prefix. */
|
|
37
46
|
label?: string;
|
|
38
47
|
/** Shown while no workspace is current. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-switcher.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"workspace-switcher.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAiBnC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,gGAAgG;IAChG,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC5C,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eA2F9D"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu/dropdown-menu.js";
|
|
3
3
|
import { ActionButton } from "../action-button/action-button.js";
|
|
4
|
+
import { WorkspaceReorderDialog } from "./workspace-reorder-dialog.js";
|
|
4
5
|
import { createComponent, insert, memo, template } from "solid-js/web";
|
|
5
|
-
import { ChevronDown, Plus, Settings } from "lucide-solid";
|
|
6
|
+
import { ArrowDownUp, ChevronDown, Plus, Settings } from "lucide-solid";
|
|
6
7
|
import { For, Show, createSignal } from "solid-js";
|
|
7
8
|
//#region src/components/composites/workspace-switcher/workspace-switcher.tsx
|
|
8
9
|
var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true class="flex shrink-0">`);
|
|
@@ -10,9 +11,12 @@ var _tmpl$2 = /*#__PURE__*/ template(`<span class="min-w-0 max-w-40 truncate">`)
|
|
|
10
11
|
var _tmpl$3 = /*#__PURE__*/ template(`<span class="min-w-0 flex-1 truncate">`);
|
|
11
12
|
function WorkspaceSwitcher(props) {
|
|
12
13
|
const [open, setOpen] = createSignal(false);
|
|
14
|
+
const [reordering, setReordering] = createSignal(false);
|
|
15
|
+
let trigger;
|
|
13
16
|
const current = () => props.workspaces.find((item) => item.id === props.value);
|
|
14
17
|
const label = () => props.label ?? "Workspaces";
|
|
15
|
-
|
|
18
|
+
const canReorder = () => props.onReorder !== void 0 && props.workspaces.filter((item) => !item.fixed).length > 1;
|
|
19
|
+
return [createComponent(DropdownMenu, {
|
|
16
20
|
modal: false,
|
|
17
21
|
get open() {
|
|
18
22
|
return open();
|
|
@@ -26,6 +30,7 @@ function WorkspaceSwitcher(props) {
|
|
|
26
30
|
get disabled() {
|
|
27
31
|
return props.disabled;
|
|
28
32
|
},
|
|
33
|
+
ref: (el) => trigger = el,
|
|
29
34
|
"data-slot": "workspace-switcher",
|
|
30
35
|
get tooltip() {
|
|
31
36
|
return `Workspace: ${current()?.name ?? props.placeholder ?? "Choose workspace"}`;
|
|
@@ -112,7 +117,7 @@ function WorkspaceSwitcher(props) {
|
|
|
112
117
|
})];
|
|
113
118
|
} }), createComponent(Show, {
|
|
114
119
|
get when() {
|
|
115
|
-
return props.onCreate || props.onManage;
|
|
120
|
+
return props.onCreate || props.onManage || canReorder();
|
|
116
121
|
},
|
|
117
122
|
get children() {
|
|
118
123
|
return [
|
|
@@ -130,6 +135,19 @@ function WorkspaceSwitcher(props) {
|
|
|
130
135
|
});
|
|
131
136
|
}
|
|
132
137
|
}),
|
|
138
|
+
createComponent(Show, {
|
|
139
|
+
get when() {
|
|
140
|
+
return canReorder();
|
|
141
|
+
},
|
|
142
|
+
get children() {
|
|
143
|
+
return createComponent(DropdownMenuItem, {
|
|
144
|
+
onSelect: () => setReordering(true),
|
|
145
|
+
get children() {
|
|
146
|
+
return [createComponent(ArrowDownUp, { "aria-hidden": "true" }), memo(() => props.reorderLabel ?? "Reorder workspaces…")];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
133
151
|
createComponent(Show, {
|
|
134
152
|
get when() {
|
|
135
153
|
return props.onManage;
|
|
@@ -149,7 +167,24 @@ function WorkspaceSwitcher(props) {
|
|
|
149
167
|
}
|
|
150
168
|
})];
|
|
151
169
|
}
|
|
152
|
-
})
|
|
170
|
+
}), createComponent(Show, {
|
|
171
|
+
get when() {
|
|
172
|
+
return props.onReorder;
|
|
173
|
+
},
|
|
174
|
+
children: (onReorder) => createComponent(WorkspaceReorderDialog, {
|
|
175
|
+
get open() {
|
|
176
|
+
return reordering();
|
|
177
|
+
},
|
|
178
|
+
onOpenChange: setReordering,
|
|
179
|
+
get workspaces() {
|
|
180
|
+
return props.workspaces;
|
|
181
|
+
},
|
|
182
|
+
get onReorder() {
|
|
183
|
+
return onReorder();
|
|
184
|
+
},
|
|
185
|
+
restoreFocusRef: () => trigger
|
|
186
|
+
})
|
|
187
|
+
})];
|
|
153
188
|
}
|
|
154
189
|
//#endregion
|
|
155
190
|
export { WorkspaceSwitcher };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-switcher.js","names":["ChevronDown","Plus","Settings","JSX","For","Show","createSignal","cn","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","ActionButton","WorkspaceSwitcherItem","id","name","mark","Element","detail","WorkspaceSwitcherProps","workspaces","value","onValueChange","onCreate","createLabel","onManage","manageLabel","label","placeholder","disabled","class","WorkspaceSwitcher","props","open","setOpen","current","find","item","_$createComponent","modal","onOpenChange","children","as","variant","size","tooltip","aria-label","_el$","_tmpl$","_$insert","_el$2","_tmpl$2","align","sideOffset","onChange","String","each","closeOnSelect","data-workspace-id","_el$3","_el$4","_tmpl$3","when","onSelect","_$memo","_$createComponent","_$memo"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"sourcesContent":["import { ChevronDown, Plus, Settings } from 'lucide-solid'\nimport type { JSX } from 'solid-js'\nimport { For, Show, createSignal } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { ActionButton } from '../action-button'\n\n/**\n * WorkspaceSwitcher.\n *\n * The workspace picker that sits in the top bar beside the sidebar toggle. One\n * ghost button shows the current workspace's mark and name; pressing it opens a\n * radio list of the others. Choosing one only changes what the window is\n * looking at: the switcher reports the id and the host decides what that means,\n * which is why it carries no status of its own and never closes, restarts or\n * moves anything.\n *\n * It is deliberately the simple interaction (a single menu, not a nested\n * accordion): the sidebar below it already shows what is inside the chosen\n * workspace, so the switcher's only job is to name the workspace and let the\n * user change it.\n */\nexport type WorkspaceSwitcherItem = {\n id: string\n name: string\n /** The workspace's mark, drawn in the trigger and its row. Decorative. */\n mark: JSX.Element\n /** A quiet trailing readout in the row, e.g. an unread count. Optional. */\n detail?: JSX.Element\n}\n\nexport type WorkspaceSwitcherProps = {\n workspaces: readonly WorkspaceSwitcherItem[]\n /** The current workspace's id. */\n value: string | undefined\n onValueChange(id: string): void\n /** Offered at the foot of the menu when present. */\n onCreate?(): void\n createLabel?: string\n /** Offered beside the create action when present: open the current workspace's settings. */\n onManage?(): void\n manageLabel?: string\n /** The menu's heading; also the trigger's accessible-name prefix. */\n label?: string\n /** Shown while no workspace is current. */\n placeholder?: string\n disabled?: boolean\n class?: string\n}\n\nexport function WorkspaceSwitcher(props: WorkspaceSwitcherProps) {\n const [open, setOpen] = createSignal(false)\n const current = () => props.workspaces.find((item) => item.id === props.value)\n const label = () => props.label ?? 'Workspaces'\n\n return (\n <DropdownMenu modal={false} open={open()} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n as={ActionButton}\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled}\n data-slot=\"workspace-switcher\"\n tooltip={`Workspace: ${current()?.name ?? props.placeholder ?? 'Choose workspace'}`}\n aria-label={`Switch workspace, current: ${current()?.name ?? 'none'}`}\n class={cn('max-w-full min-w-0 shrink', props.class)}\n >\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {current()?.mark}\n </span>\n <span class=\"min-w-0 max-w-40 truncate\">\n {current()?.name ?? props.placeholder ?? 'Choose workspace'}\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" sideOffset={6} class=\"min-w-56\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>{label()}</DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={props.value}\n onChange={(value) => {\n setOpen(false)\n const id = String(value)\n if (id !== props.value) props.onValueChange(id)\n }}\n >\n <For each={props.workspaces}>\n {(item) => (\n <DropdownMenuRadioItem value={item.id} closeOnSelect data-workspace-id={item.id}>\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {item.mark}\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{item.name}</span>\n <Show when={item.detail}>{item.detail}</Show>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuGroup>\n <Show when={props.onCreate || props.onManage}>\n <DropdownMenuSeparator />\n <Show when={props.onCreate}>\n <DropdownMenuItem onSelect={() => props.onCreate?.()}>\n <Plus aria-hidden=\"true\" />\n {props.createLabel ?? 'New workspace'}\n </DropdownMenuItem>\n </Show>\n <Show when={props.onManage}>\n <DropdownMenuItem onSelect={() => props.onManage?.()}>\n <Settings aria-hidden=\"true\" />\n {props.manageLabel ?? 'Workspace settings…'}\n </DropdownMenuItem>\n </Show>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n"],"mappings":";;;;;;;;;;AA4DA,SAAgBoC,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,MAAMC,WAAWjC,aAAa,KAAK;CAC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AkB,WAAA;YAAA,OAAA,CAAAH,gBACjD1C,MAAI,EAAA,eAAA,OAAA,CAAA,GAAAoE,WACJhC,MAAMR,eAAe,eAAe,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA;QAAAc,gBAGxCtC,MAAI;SAAA,IAAC8D,OAAI;UAAA,OAAE9B,MAAMP;SAAQ;SAAA,IAAAgB,WAAA;UAAA,OAAAH,gBACvBhC,kBAAgB;WAACyD,gBAAgB/B,MAAMP,WAAW;WAAC,IAAAgB,WAAA;YAAA,OAAA,CAAAH,gBACjDzC,UAAQ,EAAA,eAAA,OAAA,CAAA,GAAAmE,WACRhC,MAAMN,eAAe,qBAAqB,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA;OAAA;MAAA;KAAA,CAAA,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
|
|
1
|
+
{"version":3,"file":"workspace-switcher.js","names":["ArrowDownUp","ChevronDown","Plus","Settings","JSX","For","Show","createSignal","cn","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","ActionButton","WorkspaceReorderDialog","WorkspaceSwitcherItem","id","name","mark","Element","detail","fixed","WorkspaceSwitcherProps","workspaces","value","onValueChange","onCreate","createLabel","onManage","manageLabel","onReorder","ids","Promise","reorderLabel","label","placeholder","disabled","class","WorkspaceSwitcher","props","open","setOpen","reordering","setReordering","trigger","HTMLElement","current","find","item","canReorder","undefined","filter","length","_$createComponent","modal","onOpenChange","children","as","variant","size","ref","el","tooltip","aria-label","_el$","_tmpl$","_$insert","_el$2","_tmpl$2","align","sideOffset","onChange","String","each","closeOnSelect","data-workspace-id","_el$3","_el$4","_tmpl$3","when","onSelect","_$memo","restoreFocusRef","_$createComponent","_$memo"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"sourcesContent":["import { ArrowDownUp, ChevronDown, Plus, Settings } from 'lucide-solid'\nimport type { JSX } from 'solid-js'\nimport { For, Show, createSignal } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { ActionButton } from '../action-button'\nimport { WorkspaceReorderDialog } from './workspace-reorder-dialog'\n\n/**\n * WorkspaceSwitcher.\n *\n * The workspace picker that sits in the top bar beside the sidebar toggle. One\n * ghost button shows the current workspace's mark and name; pressing it opens a\n * radio list of the others. Choosing one only changes what the window is\n * looking at: the switcher reports the id and the host decides what that means,\n * which is why it carries no status of its own and never closes, restarts or\n * moves anything.\n *\n * It is deliberately the simple interaction (a single menu, not a nested\n * accordion): the sidebar below it already shows what is inside the chosen\n * workspace, so the switcher's only job is to name the workspace and let the\n * user change it.\n */\nexport type WorkspaceSwitcherItem = {\n id: string\n name: string\n /** The workspace's mark, drawn in the trigger and its row. Decorative. */\n mark: JSX.Element\n /** A quiet trailing readout in the row, e.g. an unread count. Optional. */\n detail?: JSX.Element\n /** Pinned to the top of the order, e.g. Home: it cannot be moved and nothing moves above it. */\n fixed?: boolean\n}\n\nexport type WorkspaceSwitcherProps = {\n workspaces: readonly WorkspaceSwitcherItem[]\n /** The current workspace's id. */\n value: string | undefined\n onValueChange(id: string): void\n /** Offered at the foot of the menu when present. */\n onCreate?(): void\n createLabel?: string\n /** Offered beside the create action when present: open the current workspace's settings. */\n onManage?(): void\n manageLabel?: string\n /**\n * Offered when present and at least two workspaces can move: opens a dialog\n * with Move up and Move down on each row. Receives the full id order after\n * each move; the host saves it and passes the workspaces back in that order.\n */\n onReorder?(ids: readonly string[]): void | Promise<void>\n reorderLabel?: string\n /** The menu's heading; also the trigger's accessible-name prefix. */\n label?: string\n /** Shown while no workspace is current. */\n placeholder?: string\n disabled?: boolean\n class?: string\n}\n\nexport function WorkspaceSwitcher(props: WorkspaceSwitcherProps) {\n const [open, setOpen] = createSignal(false)\n const [reordering, setReordering] = createSignal(false)\n let trigger: HTMLElement | undefined\n const current = () => props.workspaces.find((item) => item.id === props.value)\n const label = () => props.label ?? 'Workspaces'\n const canReorder = () =>\n props.onReorder !== undefined && props.workspaces.filter((item) => !item.fixed).length > 1\n\n return (\n <>\n <DropdownMenu modal={false} open={open()} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n as={ActionButton}\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled}\n ref={(el: HTMLElement) => (trigger = el)}\n data-slot=\"workspace-switcher\"\n tooltip={`Workspace: ${current()?.name ?? props.placeholder ?? 'Choose workspace'}`}\n aria-label={`Switch workspace, current: ${current()?.name ?? 'none'}`}\n class={cn('max-w-full min-w-0 shrink', props.class)}\n >\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {current()?.mark}\n </span>\n <span class=\"min-w-0 max-w-40 truncate\">\n {current()?.name ?? props.placeholder ?? 'Choose workspace'}\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" sideOffset={6} class=\"min-w-56\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>{label()}</DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={props.value}\n onChange={(value) => {\n setOpen(false)\n const id = String(value)\n if (id !== props.value) props.onValueChange(id)\n }}\n >\n <For each={props.workspaces}>\n {(item) => (\n <DropdownMenuRadioItem value={item.id} closeOnSelect data-workspace-id={item.id}>\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {item.mark}\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{item.name}</span>\n <Show when={item.detail}>{item.detail}</Show>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuGroup>\n <Show when={props.onCreate || props.onManage || canReorder()}>\n <DropdownMenuSeparator />\n <Show when={props.onCreate}>\n <DropdownMenuItem onSelect={() => props.onCreate?.()}>\n <Plus aria-hidden=\"true\" />\n {props.createLabel ?? 'New workspace'}\n </DropdownMenuItem>\n </Show>\n <Show when={canReorder()}>\n <DropdownMenuItem onSelect={() => setReordering(true)}>\n <ArrowDownUp aria-hidden=\"true\" />\n {props.reorderLabel ?? 'Reorder workspaces…'}\n </DropdownMenuItem>\n </Show>\n <Show when={props.onManage}>\n <DropdownMenuItem onSelect={() => props.onManage?.()}>\n <Settings aria-hidden=\"true\" />\n {props.manageLabel ?? 'Workspace settings…'}\n </DropdownMenuItem>\n </Show>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n <Show when={props.onReorder}>\n {(onReorder) => (\n <WorkspaceReorderDialog\n open={reordering()}\n onOpenChange={setReordering}\n workspaces={props.workspaces}\n onReorder={onReorder()}\n restoreFocusRef={() => trigger}\n />\n )}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;AAsEA,SAAgB2C,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,MAAMC,WAAWvC,aAAa,KAAK;CAC1C,MAAM,CAACwC,YAAYC,iBAAiBzC,aAAa,KAAK;CACtD,IAAI0C;CACJ,MAAME,gBAAgBP,MAAMhB,WAAWwB,MAAMC,SAASA,KAAKhC,OAAOuB,MAAMf,KAAK;CAC7E,MAAMU,cAAcK,MAAML,SAAS;CACnC,MAAMe,mBACJV,MAAMT,cAAcoB,KAAAA,KAAaX,MAAMhB,WAAW4B,QAAQH,SAAS,CAACA,KAAK3B,KAAK,CAAC,CAAC+B,SAAS;CAE3F,OAAA,CAAAC,gBAEKjD,cAAY;EAACkD,OAAO;EAAK,IAAEd,OAAI;GAAA,OAAEA,KAAK;EAAC;EAAEe,cAAcd;EAAO,IAAAe,WAAA;GAAA,OAAA,CAAAH,gBAC5DzC,qBAAmB;IAClB6C,IAAI5C;IACJ6C,SAAO;IACPC,MAAI;I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;WAACyE,gBAAgBrC,cAAc,IAAI;WAAC,IAAAa,WAAA;YAAA,OAAA,CAAAH,gBAClD1D,aAAW,EAAA,eAAA,OAAA,CAAA,GAAAsF,WACX1C,MAAMN,gBAAgB,qBAAqB,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA;QAAAoB,gBAG/CpD,MAAI;SAAA,IAAC8E,OAAI;UAAA,OAAExC,MAAMX;SAAQ;SAAA,IAAA4B,WAAA;UAAA,OAAAH,gBACvB9C,kBAAgB;WAACyE,gBAAgBzC,MAAMX,WAAW;WAAC,IAAA4B,WAAA;YAAA,OAAA,CAAAH,gBACjDvD,UAAQ,EAAA,eAAA,OAAA,CAAA,GAAAmF,WACR1C,MAAMV,eAAe,qBAAqB,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA;OAAA;MAAA;KAAA,CAAA,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA,GAAAwB,gBAMpDpD,MAAI;EAAA,IAAC8E,OAAI;GAAA,OAAExC,MAAMT;EAAS;EAAA0B,WACvB1B,cAASuB,gBACRvC,wBAAsB;GAAA,IACrB0B,OAAI;IAAA,OAAEE,WAAW;GAAC;GAClBa,cAAcZ;GAAa,IAC3BpB,aAAU;IAAA,OAAEgB,MAAMhB;GAAU;GAAA,IAC5BO,YAAS;IAAA,OAAEA,UAAU;GAAC;GACtBoD,uBAAuBtC;EAAO,CAAA;CAEjC,CAAA,CAAA;AAIT"}
|
package/dist/index.js
CHANGED
|
@@ -189,9 +189,11 @@ import { UpdateChannelControl } from "./components/composites/update-dialog/chan
|
|
|
189
189
|
import { AboutDialog } from "./components/composites/about-dialog/about-dialog.js";
|
|
190
190
|
import { HelpCenter } from "./components/composites/help-center/help-center.js";
|
|
191
191
|
import { WorkspaceMark } from "./components/composites/workspace-mark/workspace-mark.js";
|
|
192
|
+
import { moveTarget, moveWorkspace } from "./components/composites/workspace-switcher/workspace-order.js";
|
|
193
|
+
import { WorkspaceReorderDialog } from "./components/composites/workspace-switcher/workspace-reorder-dialog.js";
|
|
192
194
|
import { WorkspaceSwitcher } from "./components/composites/workspace-switcher/workspace-switcher.js";
|
|
193
195
|
import { MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MarkImageError, centredSquare, checkMarkImageFile, isMarkImageDataUrl, markImageFromFile, markImageProblemCopy } from "./components/composites/icon-picker/image-data-url.js";
|
|
194
196
|
import { isShellIconKey, resolveShellIcon, shellIconEntries, shellIconLabel } from "./components/composites/icon-picker/shell-icons.js";
|
|
195
197
|
import { IconPicker, IconPickerDropdown } from "./components/composites/icon-picker/icon-picker.js";
|
|
196
198
|
import { AccentPicker } from "./components/composites/accent-picker/accent-picker.js";
|
|
197
|
-
export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceLine, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
|
199
|
+
export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceLine, TranscriptComposition, Tree, TreeRow, TreeRowActions, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createLayoutState, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizePreviewMiniPlayer, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
|
package/dist/r/registry.json
CHANGED
|
@@ -3268,6 +3268,8 @@
|
|
|
3268
3268
|
],
|
|
3269
3269
|
"registryDependencies": [
|
|
3270
3270
|
"@adea-ai/ui/action-button",
|
|
3271
|
+
"@adea-ai/ui/button",
|
|
3272
|
+
"@adea-ai/ui/dialog",
|
|
3271
3273
|
"@adea-ai/ui/dropdown-menu",
|
|
3272
3274
|
"lib"
|
|
3273
3275
|
],
|
|
@@ -3277,6 +3279,16 @@
|
|
|
3277
3279
|
"type": "registry:ui",
|
|
3278
3280
|
"target": "components/composites/workspace-switcher/index.ts"
|
|
3279
3281
|
},
|
|
3282
|
+
{
|
|
3283
|
+
"path": "src/components/composites/workspace-switcher/workspace-order.ts",
|
|
3284
|
+
"type": "registry:ui",
|
|
3285
|
+
"target": "components/composites/workspace-switcher/workspace-order.ts"
|
|
3286
|
+
},
|
|
3287
|
+
{
|
|
3288
|
+
"path": "src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx",
|
|
3289
|
+
"type": "registry:ui",
|
|
3290
|
+
"target": "components/composites/workspace-switcher/workspace-reorder-dialog.tsx"
|
|
3291
|
+
},
|
|
3280
3292
|
{
|
|
3281
3293
|
"path": "src/components/composites/workspace-switcher/workspace-switcher.tsx",
|
|
3282
3294
|
"type": "registry:ui",
|
|
@@ -3,3 +3,8 @@ export {
|
|
|
3
3
|
type WorkspaceSwitcherItem,
|
|
4
4
|
type WorkspaceSwitcherProps,
|
|
5
5
|
} from './workspace-switcher'
|
|
6
|
+
export {
|
|
7
|
+
WorkspaceReorderDialog,
|
|
8
|
+
type WorkspaceReorderDialogProps,
|
|
9
|
+
} from './workspace-reorder-dialog'
|
|
10
|
+
export { moveTarget, moveWorkspace, type WorkspaceMoveDirection } from './workspace-order'
|