@burdenoff/fe-libs 2026.1113.8 → 2026.1113.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.
- package/dist/chrome/shell/WorkspaceMenu.d.ts +15 -1
- package/dist/chrome/shell/WorkspaceMenu.js +322 -240
- package/dist/chrome/shell/useWorkspaceMenuControls.d.ts +10 -0
- package/dist/chrome/shell/useWorkspaceMenuControls.js +39 -0
- package/dist/chrome/shell/useWorkspaceMenuLists.d.ts +33 -0
- package/dist/chrome/shell/useWorkspaceMenuLists.js +59 -0
- package/dist/chrome/shell/workspaceMenuLists.d.ts +61 -0
- package/dist/chrome/shell/workspaceMenuLists.js +31 -0
- package/dist/chrome/shellLabelManifest.d.ts +7 -0
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.d.ts +7 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +214 -212
- package/dist/shared/assistant/ui/AssistantHeader.d.ts +2 -1
- package/dist/shared/assistant/ui/AssistantHeader.js +1 -1
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +46 -2
- package/dist/shared/assistant/ui/AssistantOverlay.js +359 -307
- package/dist/shared/assistant/ui/AssistantPageHost.d.ts +11 -0
- package/dist/shared/assistant/ui/AssistantPageHost.js +17 -0
- package/dist/shared/assistant/ui/assistantPageSurface.d.ts +11 -0
- package/dist/shared/assistant/ui/assistantPageSurface.js +10 -0
- package/dist/shared/assistant/ui/compact/AssistantCompactHeader.d.ts +2 -1
- package/dist/shared/assistant/ui/compact/AssistantCompactHeader.js +2 -2
- package/dist/shared/assistant/ui/compact/AssistantMenuView.d.ts +5 -2
- package/dist/shared/assistant/ui/compact/AssistantMenuView.js +4 -4
- package/dist/shared-assistant.js +69 -67
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
export type WorkspaceMenuListName = 'workspaces' | 'projects' | 'organizations';
|
|
3
|
+
/** A row of a list: a workspace, a project or an organization. */
|
|
4
|
+
export interface WorkspaceMenuListItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
/** A list's search box. */
|
|
9
|
+
export interface WorkspaceMenuListSearch {
|
|
10
|
+
name: WorkspaceMenuListName;
|
|
11
|
+
label: string;
|
|
12
|
+
query: string;
|
|
13
|
+
onQueryChange(query: string): void;
|
|
14
|
+
/** The "No matches" line, or null while something matches. */
|
|
15
|
+
noMatch: string | null;
|
|
16
|
+
}
|
|
17
|
+
/** One list, as the menu renders it. */
|
|
18
|
+
export interface WorkspaceMenuListView {
|
|
19
|
+
/** The rows that show: those matching the search, or all of them. */
|
|
20
|
+
shown: readonly WorkspaceMenuListItem[];
|
|
21
|
+
/** The search box, or null (not opted in, or five rows or fewer). */
|
|
22
|
+
search: WorkspaceMenuListSearch | null;
|
|
23
|
+
/** A search is typed (not blank). */
|
|
24
|
+
filtering: boolean;
|
|
25
|
+
/** Spread on each row: its keys go to the box (nothing without one). */
|
|
26
|
+
rowProps: {
|
|
27
|
+
onKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare function useWorkspaceMenuLists(enabled: boolean, lists: Readonly<Record<WorkspaceMenuListName, readonly WorkspaceMenuListItem[]>>): Record<WorkspaceMenuListName, WorkspaceMenuListView> & {
|
|
31
|
+
/** Empty every search box (the menu closed). */
|
|
32
|
+
clear(): void;
|
|
33
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useShellLabel as e } from "../../shared/providers/shell/useShellLabel.js";
|
|
2
|
+
import { filterWorkspaceMenuItems as t, focusWorkspaceMenuSearch as n, isFirstWorkspaceMenuRow as r, isWorkspaceMenuSearchKey as i, workspaceMenuListSearchable as a, workspaceMenuSearchText as o } from "./workspaceMenuLists.js";
|
|
3
|
+
import { useState as s } from "react";
|
|
4
|
+
// src/chrome/shell/useWorkspaceMenuLists.ts
|
|
5
|
+
var c = {
|
|
6
|
+
workspaces: "",
|
|
7
|
+
projects: "",
|
|
8
|
+
organizations: ""
|
|
9
|
+
};
|
|
10
|
+
function l(l, u) {
|
|
11
|
+
let d = e(), [f, p] = s(c), m = {
|
|
12
|
+
workspaces: d("shell.workspaceMenu.searchWorkspaces", "Search workspaces"),
|
|
13
|
+
projects: d("shell.workspaceMenu.searchProjects", "Search projects"),
|
|
14
|
+
organizations: d("shell.workspaceMenu.searchOrganizations", "Search organizations")
|
|
15
|
+
}, h = d("shell.workspaceMenu.noMatch", "No matches"), g = (e) => {
|
|
16
|
+
let s = u[e];
|
|
17
|
+
if (!l || !a(s.length)) return {
|
|
18
|
+
shown: s,
|
|
19
|
+
search: null,
|
|
20
|
+
filtering: !1,
|
|
21
|
+
rowProps: {}
|
|
22
|
+
};
|
|
23
|
+
let c = f[e], d = t(s, c), g = o(c) !== "";
|
|
24
|
+
return {
|
|
25
|
+
shown: d,
|
|
26
|
+
filtering: g,
|
|
27
|
+
search: {
|
|
28
|
+
name: e,
|
|
29
|
+
label: m[e],
|
|
30
|
+
query: c,
|
|
31
|
+
onQueryChange: (t) => p((n) => n[e] === t ? n : {
|
|
32
|
+
...n,
|
|
33
|
+
[e]: t
|
|
34
|
+
}),
|
|
35
|
+
noMatch: d.length === 0 && g ? h : null
|
|
36
|
+
},
|
|
37
|
+
rowProps: { onKeyDown: (t) => {
|
|
38
|
+
if (t.key === "ArrowUp" && r(t.currentTarget)) {
|
|
39
|
+
n(t.currentTarget) && t.preventDefault();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!i(t)) return;
|
|
43
|
+
t.preventDefault();
|
|
44
|
+
let a = t.key;
|
|
45
|
+
p((t) => ({
|
|
46
|
+
...t,
|
|
47
|
+
[e]: t[e] + a
|
|
48
|
+
})), n(t.currentTarget);
|
|
49
|
+
} }
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
workspaces: g("workspaces"),
|
|
54
|
+
projects: g("projects"),
|
|
55
|
+
organizations: g("organizations"),
|
|
56
|
+
clear: () => p(c)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export { l as useWorkspaceMenuLists };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The searchable lists of `WorkspaceMenu` (BOFF-13461, Navigation v2): the
|
|
3
|
+
* matching rule and the keyboard moves between a list's search box and its rows.
|
|
4
|
+
*
|
|
5
|
+
* Opt-in: only a menu given `searchableLists` uses any of this.
|
|
6
|
+
*
|
|
7
|
+
* ★ The rows live in a Radix menu, which owns Tab (it is refused inside a menu),
|
|
8
|
+
* the arrow keys between rows and typeahead (a letter moves to the row that
|
|
9
|
+
* starts with it). A search box needs three more moves, all handled here:
|
|
10
|
+
* - a letter typed on a row of a searchable list goes into that list's search
|
|
11
|
+
* box (type to search, in place of typeahead);
|
|
12
|
+
* - ArrowUp on the list's first row, and back, ArrowDown or Enter in the box,
|
|
13
|
+
* move between the box and the rows;
|
|
14
|
+
* - every other key typed in the box stays in the box, so the menu's typeahead
|
|
15
|
+
* (and a sub-menu's ArrowLeft) never steals what the person is typing.
|
|
16
|
+
* Escape and Tab still reach the menu: Escape closes it, as it always did.
|
|
17
|
+
*
|
|
18
|
+
* Plain DOM helpers, no React: the rows are found from the element that got
|
|
19
|
+
* the key, inside the nearest element marked `data-shell-menu-list`.
|
|
20
|
+
*/
|
|
21
|
+
/** A list gets a search box once it has more rows than this. */
|
|
22
|
+
export declare const WORKSPACE_MENU_SEARCH_THRESHOLD = 5;
|
|
23
|
+
/** Marks a list (search box and rows) for the keyboard helpers below. */
|
|
24
|
+
export declare const WORKSPACE_MENU_LIST_ATTR = "data-shell-menu-list";
|
|
25
|
+
/** Does a list of `count` rows get a search box? */
|
|
26
|
+
export declare function workspaceMenuListSearchable(count: number): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Case- and accent-insensitive text to match on: "Équipe" and "equipe" are the
|
|
29
|
+
* same search, as are "Sales" and "sales".
|
|
30
|
+
*/
|
|
31
|
+
export declare function workspaceMenuSearchText(text: string): string;
|
|
32
|
+
/** The items whose name contains the query (as literal text); every item for a blank query. */
|
|
33
|
+
export declare function filterWorkspaceMenuItems<T extends {
|
|
34
|
+
name: string;
|
|
35
|
+
}>(items: readonly T[], query: string): readonly T[];
|
|
36
|
+
/** The keys a row hands to its list's search box: one printable character, not Space, no shortcut. */
|
|
37
|
+
export declare function isWorkspaceMenuSearchKey(event: {
|
|
38
|
+
key: string;
|
|
39
|
+
ctrlKey: boolean;
|
|
40
|
+
metaKey: boolean;
|
|
41
|
+
altKey: boolean;
|
|
42
|
+
}): boolean;
|
|
43
|
+
/** What the keyboard helpers read of an element: a browser `Element` is one. */
|
|
44
|
+
export type WorkspaceMenuListNode = Pick<Element, 'closest' | 'querySelector'>;
|
|
45
|
+
/** Focus the search box of the list `from` is in. Returns whether there was one. */
|
|
46
|
+
export declare function focusWorkspaceMenuSearch(from: WorkspaceMenuListNode): boolean;
|
|
47
|
+
/** Focus the first row of the list `from` is in. Returns whether there was one. */
|
|
48
|
+
export declare function focusFirstWorkspaceMenuRow(from: WorkspaceMenuListNode): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* In a search box: ArrowDown or Enter go to the list's first row; Escape and
|
|
51
|
+
* Tab reach the menu (Escape closes it, as before); every other key stays in
|
|
52
|
+
* the box, so the menu's typeahead never takes what is being typed.
|
|
53
|
+
*/
|
|
54
|
+
export declare function onWorkspaceMenuSearchKeyDown(event: {
|
|
55
|
+
key: string;
|
|
56
|
+
currentTarget: WorkspaceMenuListNode;
|
|
57
|
+
preventDefault(): void;
|
|
58
|
+
stopPropagation(): void;
|
|
59
|
+
}): void;
|
|
60
|
+
/** Is `row` the first row of its list? */
|
|
61
|
+
export declare function isFirstWorkspaceMenuRow(row: WorkspaceMenuListNode): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var e = "data-shell-menu-list", t = "[role=\"menuitem\"]";
|
|
2
|
+
function n(e) {
|
|
3
|
+
return e > 5;
|
|
4
|
+
}
|
|
5
|
+
function r(e) {
|
|
6
|
+
return e.normalize("NFKD").replace(/\p{M}/gu, "").toLocaleLowerCase().trim();
|
|
7
|
+
}
|
|
8
|
+
function i(e, t) {
|
|
9
|
+
let n = r(t);
|
|
10
|
+
return n ? e.filter((e) => r(e.name).includes(n)) : e;
|
|
11
|
+
}
|
|
12
|
+
function a(e) {
|
|
13
|
+
return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
14
|
+
}
|
|
15
|
+
var o = (t) => t.closest(`[${e}]`);
|
|
16
|
+
function s(e) {
|
|
17
|
+
let t = o(e)?.querySelector("input[type=\"search\"]");
|
|
18
|
+
return t ? (t.focus({ preventScroll: !0 }), !0) : !1;
|
|
19
|
+
}
|
|
20
|
+
function c(e) {
|
|
21
|
+
let n = o(e)?.querySelector(t);
|
|
22
|
+
return n ? (n.focus(), !0) : !1;
|
|
23
|
+
}
|
|
24
|
+
function l(e) {
|
|
25
|
+
e.key === "ArrowDown" || e.key === "Enter" ? (e.preventDefault(), c(e.currentTarget)) : e.key !== "Escape" && e.key !== "Tab" && e.stopPropagation();
|
|
26
|
+
}
|
|
27
|
+
function u(e) {
|
|
28
|
+
let n = o(e)?.querySelector(t);
|
|
29
|
+
return n != null && n === e;
|
|
30
|
+
}
|
|
31
|
+
export { e as WORKSPACE_MENU_LIST_ATTR, i as filterWorkspaceMenuItems, c as focusFirstWorkspaceMenuRow, s as focusWorkspaceMenuSearch, u as isFirstWorkspaceMenuRow, a as isWorkspaceMenuSearchKey, l as onWorkspaceMenuSearchKeyDown, n as workspaceMenuListSearchable, r as workspaceMenuSearchText };
|
|
@@ -31,3 +31,10 @@ export declare const SHELL_LABELS_ADDED_BOFF_8060: readonly string[];
|
|
|
31
31
|
* English.
|
|
32
32
|
*/
|
|
33
33
|
export declare const SHELL_LABELS_ADDED_BOFF_10854: readonly string[];
|
|
34
|
+
/**
|
|
35
|
+
* The keys `WorkspaceMenu`'s opt-in searchable lists and "New project" added
|
|
36
|
+
* (BOFF-13461). Not in any dictionary yet: seed them into `workspaces` (and a
|
|
37
|
+
* product's curated words, where it keeps its own). Until then each renders its
|
|
38
|
+
* English.
|
|
39
|
+
*/
|
|
40
|
+
export declare const SHELL_LABELS_ADDED_BOFF_13461: readonly string[];
|
|
@@ -351,6 +351,8 @@ export * from './ui/AIAssistantPanel';
|
|
|
351
351
|
export * from './ui/assistantOverlayState';
|
|
352
352
|
export * from './ui/useAssistantLauncherLift';
|
|
353
353
|
export * from './ui/AssistantOverlay';
|
|
354
|
+
export * from './ui/AssistantPageHost';
|
|
355
|
+
export * from './ui/assistantPageSurface';
|
|
354
356
|
export * from './ui/assistantPanelLoader';
|
|
355
357
|
export * from './ui/AssistantPanelPlaceholder';
|
|
356
358
|
export * from './openui/generativeUi';
|
|
@@ -156,6 +156,13 @@ export type AIAssistantPanelProps = PanelProps & {
|
|
|
156
156
|
windowView?: AssistantWindowView | null;
|
|
157
157
|
/** Compact: the person picked Chat or Avatar in the pill, so the host remembers it (and only then). */
|
|
158
158
|
onWindowViewChange?: (view: AssistantWindowView) => void;
|
|
159
|
+
/**
|
|
160
|
+
* BOFF-13461: a page hosts this panel (`AssistantPageHost`, through the
|
|
161
|
+
* overlay's page surface). It fills the host and shows no Close, no Dock or
|
|
162
|
+
* Panel layout, no Expand (and, being the full panel, no Minimize); Escape
|
|
163
|
+
* backs out of its layers but never closes it. Absent: the panel of before.
|
|
164
|
+
*/
|
|
165
|
+
pageHosted?: boolean;
|
|
159
166
|
};
|
|
160
167
|
/**
|
|
161
168
|
* The panel.
|