@burdenoff/fe-libs 2026.1023.4 → 2026.1023.6
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/CommandPalette.d.ts +25 -2
- package/dist/chrome/CommandPalette.js +70 -57
- package/dist/chrome/GlobalSearch.js +74 -73
- package/dist/chrome/NotificationCenter.js +76 -71
- package/dist/chrome/index.d.ts +1 -1
- package/dist/chrome.js +40 -40
- package/dist/shared/assistant/createSandboxAssistantTransport.js +1 -1
- package/dist/shared/assistant/pageContextKeys.d.ts +14 -1
- package/dist/shared/assistant/pageContextKeys.js +11 -2
- package/dist/shared/assistant/ui/voice/VoiceMiniController.js +1 -1
- package/dist/shared/hooks/shell/globalSearchError.d.ts +11 -0
- package/dist/shared/hooks/shell/globalSearchError.js +10 -0
- package/dist/shared/hooks/shell/useGlobalSearch.d.ts +2 -0
- package/dist/shared/hooks/shell/useGlobalSearch.js +48 -38
- package/dist/shared/navigation/inAppPath.d.ts +33 -0
- package/dist/shared/navigation/inAppPath.js +32 -0
- package/dist/shared-assistant.js +297 -297
- package/dist/shell-native/deep-link-context.js +2 -1
- package/dist/shell-native/deep-link.d.ts +2 -6
- package/dist/shell-native/deep-link.js +19 -26
- package/dist/shell-native.js +3 -2
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { KeyboardShortcut as HelpShortcut } from '../shared/keyboard/types';
|
|
2
3
|
/**
|
|
3
4
|
* Represents a single command action
|
|
4
5
|
*/
|
|
@@ -34,12 +35,34 @@ export interface CommandPaletteProps {
|
|
|
34
35
|
readonly placeholder?: string;
|
|
35
36
|
/** Custom class name */
|
|
36
37
|
readonly className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Shortcut that opens and closes the palette. Defaults to
|
|
40
|
+
* `COMMAND_PALETTE_SHORTCUT` (Cmd/Ctrl+Shift+K): Cmd/Ctrl+K belongs to
|
|
41
|
+
* Global Search in every shell, so the palette cannot share it.
|
|
42
|
+
*/
|
|
43
|
+
readonly toggleShortcut?: string;
|
|
37
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The palette's default open/close shortcut: Cmd+Shift+K on macOS,
|
|
47
|
+
* Ctrl+Shift+K elsewhere. Cmd/Ctrl+K is Global Search's.
|
|
48
|
+
*/
|
|
49
|
+
export declare const COMMAND_PALETTE_SHORTCUT = "mod+shift+k";
|
|
50
|
+
/**
|
|
51
|
+
* The palette shortcut as a keyboard-help entry, for a shell's DISPLAY-ONLY
|
|
52
|
+
* shortcut list (the palette registers the key itself; do not pass this to
|
|
53
|
+
* `useKeyboardShortcuts`, its action does nothing).
|
|
54
|
+
*/
|
|
55
|
+
export declare const COMMAND_PALETTE_HELP_SHORTCUT: HelpShortcut;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a keyboard event matches a shortcut (exported for tests).
|
|
58
|
+
*/
|
|
59
|
+
export declare function matchShortcut(event: KeyboardEvent, keys: string): boolean;
|
|
38
60
|
/**
|
|
39
61
|
* CommandPalette Component
|
|
40
62
|
*
|
|
41
63
|
* Provides a keyboard-accessible command palette with:
|
|
42
|
-
* -
|
|
64
|
+
* - Its own open/close shortcut (Cmd/Ctrl+Shift+K by default; Cmd/Ctrl+K is
|
|
65
|
+
* Global Search)
|
|
43
66
|
* - Action-specific shortcuts
|
|
44
67
|
* - Fuzzy search across commands
|
|
45
68
|
* - Grouped command sections
|
|
@@ -60,4 +83,4 @@ export interface CommandPaletteProps {
|
|
|
60
83
|
* <CommandPalette actions={actions} />
|
|
61
84
|
* ```
|
|
62
85
|
*/
|
|
63
|
-
export declare function CommandPalette({ actions, shortcuts, placeholder, className, }: CommandPaletteProps): ReactNode;
|
|
86
|
+
export declare function CommandPalette({ actions, shortcuts, placeholder, className, toggleShortcut, }: CommandPaletteProps): ReactNode;
|
|
@@ -5,7 +5,19 @@ import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "r
|
|
|
5
5
|
import { Search as o, X as s } from "lucide-react";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
7
|
//#region src/chrome/CommandPalette.tsx
|
|
8
|
-
|
|
8
|
+
var u = "mod+shift+k", d = {
|
|
9
|
+
id: "command-palette",
|
|
10
|
+
keys: {
|
|
11
|
+
mac: ["cmd+shift+k"],
|
|
12
|
+
windows: ["ctrl+shift+k"],
|
|
13
|
+
linux: ["ctrl+shift+k"]
|
|
14
|
+
},
|
|
15
|
+
description: "Open Command Palette",
|
|
16
|
+
category: "Search",
|
|
17
|
+
action: () => void 0,
|
|
18
|
+
global: !0
|
|
19
|
+
};
|
|
20
|
+
function f(e) {
|
|
9
21
|
let t = e.toLowerCase().split("+").map((e) => e.trim()), n = t.length - 1;
|
|
10
22
|
return {
|
|
11
23
|
mod: t.includes("mod"),
|
|
@@ -16,52 +28,52 @@ function u(e) {
|
|
|
16
28
|
key: t[n] || ""
|
|
17
29
|
};
|
|
18
30
|
}
|
|
19
|
-
function
|
|
20
|
-
let n =
|
|
21
|
-
return n.mod && !(e.metaKey || e.ctrlKey) || n.ctrl && !e.ctrlKey || n.alt
|
|
31
|
+
function p(e, t) {
|
|
32
|
+
let n = f(t);
|
|
33
|
+
return n.mod && !(e.metaKey || e.ctrlKey) || n.ctrl && !e.ctrlKey || n.alt !== e.altKey || n.shift !== e.shiftKey || n.meta && !e.metaKey || !e.key ? !1 : e.key.toLowerCase() === n.key;
|
|
22
34
|
}
|
|
23
|
-
function
|
|
24
|
-
let
|
|
35
|
+
function m({ actions: d, shortcuts: f = [], placeholder: m, className: h, toggleShortcut: g = u }) {
|
|
36
|
+
let _ = e(), [v, y] = a(!1), [b, x] = a(""), [S, C] = a(0), w = i(() => d.filter((e) => !e.hidden), [d]), T = n(async (e) => {
|
|
25
37
|
try {
|
|
26
|
-
await e.action(),
|
|
38
|
+
await e.action(), y(!1);
|
|
27
39
|
} catch (e) {
|
|
28
40
|
console.error("Failed to execute command:", e);
|
|
29
41
|
}
|
|
30
|
-
}, []),
|
|
31
|
-
if (!
|
|
32
|
-
let e =
|
|
33
|
-
return
|
|
42
|
+
}, []), E = i(() => {
|
|
43
|
+
if (!b.trim()) return w;
|
|
44
|
+
let e = b.toLowerCase();
|
|
45
|
+
return w.filter((t) => {
|
|
34
46
|
let n = t.label.toLowerCase().includes(e), r = t.keywords?.some((t) => t.toLowerCase().includes(e)), i = t.description?.toLowerCase().includes(e);
|
|
35
47
|
return n || r || i;
|
|
36
48
|
});
|
|
37
|
-
}, [
|
|
49
|
+
}, [w, b]);
|
|
38
50
|
r(() => {
|
|
39
|
-
|
|
40
|
-
}, [
|
|
51
|
+
v || (x(""), C(0));
|
|
52
|
+
}, [v]), r(() => {
|
|
41
53
|
let e = (e) => {
|
|
42
|
-
if ((e
|
|
43
|
-
e.preventDefault(),
|
|
54
|
+
if (p(e, g)) {
|
|
55
|
+
e.preventDefault(), y((e) => !e);
|
|
44
56
|
return;
|
|
45
57
|
}
|
|
46
|
-
if (
|
|
47
|
-
if (e.key === "Escape") e.preventDefault(),
|
|
48
|
-
else if (e.key === "ArrowDown") e.preventDefault(),
|
|
49
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
58
|
+
if (v) {
|
|
59
|
+
if (e.key === "Escape") e.preventDefault(), y(!1);
|
|
60
|
+
else if (e.key === "ArrowDown") e.preventDefault(), C((e) => e < E.length - 1 ? e + 1 : e);
|
|
61
|
+
else if (e.key === "ArrowUp") e.preventDefault(), C((e) => e > 0 ? e - 1 : e);
|
|
50
62
|
else if (e.key === "Enter") {
|
|
51
63
|
e.preventDefault();
|
|
52
|
-
let t =
|
|
53
|
-
t &&
|
|
64
|
+
let t = E[S];
|
|
65
|
+
t && T(t);
|
|
54
66
|
}
|
|
55
67
|
return;
|
|
56
68
|
}
|
|
57
|
-
for (let t of f) if (
|
|
69
|
+
for (let t of f) if (p(e, t.keys)) {
|
|
58
70
|
e.preventDefault();
|
|
59
|
-
let n =
|
|
60
|
-
n &&
|
|
71
|
+
let n = w.find((e) => e.id === t.actionId);
|
|
72
|
+
n && T(n);
|
|
61
73
|
return;
|
|
62
74
|
}
|
|
63
|
-
for (let t of
|
|
64
|
-
e.preventDefault(),
|
|
75
|
+
for (let t of w) if (t.shortcut && p(e, t.shortcut)) {
|
|
76
|
+
e.preventDefault(), T(t);
|
|
65
77
|
return;
|
|
66
78
|
}
|
|
67
79
|
};
|
|
@@ -69,25 +81,26 @@ function f({ actions: u, shortcuts: f = [], placeholder: p, className: m }) {
|
|
|
69
81
|
document.removeEventListener("keydown", e);
|
|
70
82
|
};
|
|
71
83
|
}, [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
T,
|
|
85
|
+
E,
|
|
86
|
+
v,
|
|
87
|
+
S,
|
|
76
88
|
f,
|
|
77
|
-
|
|
89
|
+
g,
|
|
90
|
+
w
|
|
78
91
|
]);
|
|
79
|
-
let
|
|
92
|
+
let D = i(() => E.reduce((e, t) => {
|
|
80
93
|
let n = t.section || "Actions";
|
|
81
94
|
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
82
|
-
}, {}), [
|
|
95
|
+
}, {}), [E]);
|
|
83
96
|
if (r(() => {
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
let
|
|
97
|
+
C(0);
|
|
98
|
+
}, [E]), !v) return null;
|
|
99
|
+
let O = 0;
|
|
87
100
|
return /* @__PURE__ */ c("div", {
|
|
88
|
-
className: t("fixed inset-0 z-[9999] flex items-center justify-center bg-bg-overlay backdrop-blur-md", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
89
|
-
onClick: () =>
|
|
90
|
-
"data-state":
|
|
101
|
+
className: t("fixed inset-0 z-[9999] flex items-center justify-center bg-bg-overlay backdrop-blur-md", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", h),
|
|
102
|
+
onClick: () => y(!1),
|
|
103
|
+
"data-state": v ? "open" : "closed",
|
|
91
104
|
role: "dialog",
|
|
92
105
|
"aria-modal": "true",
|
|
93
106
|
children: /* @__PURE__ */ c("div", {
|
|
@@ -102,37 +115,37 @@ function f({ actions: u, shortcuts: f = [], placeholder: p, className: m }) {
|
|
|
102
115
|
/* @__PURE__ */ c(o, { className: "size-4 mr-2 flex-shrink-0 text-text-muted" }),
|
|
103
116
|
/* @__PURE__ */ c("input", {
|
|
104
117
|
type: "text",
|
|
105
|
-
placeholder:
|
|
106
|
-
value:
|
|
107
|
-
onChange: (e) =>
|
|
118
|
+
placeholder: m ?? _("search.commandPlaceholder", "Type a command or search..."),
|
|
119
|
+
value: b,
|
|
120
|
+
onChange: (e) => x(e.target.value),
|
|
108
121
|
className: "flex-1 bg-transparent py-3.5 text-sm text-text-primary outline-none placeholder:text-text-placeholder",
|
|
109
122
|
autoFocus: !0
|
|
110
123
|
}),
|
|
111
|
-
|
|
124
|
+
b && /* @__PURE__ */ c("button", {
|
|
112
125
|
type: "button",
|
|
113
|
-
onClick: () =>
|
|
126
|
+
onClick: () => x(""),
|
|
114
127
|
className: "ml-2 rounded-button p-1 text-text-muted hover:bg-bg-sunken hover:text-text-primary transition-colors",
|
|
115
|
-
"aria-label":
|
|
128
|
+
"aria-label": _("common.clearSearch", "Clear search"),
|
|
116
129
|
children: /* @__PURE__ */ c(s, { className: "size-4" })
|
|
117
130
|
})
|
|
118
131
|
]
|
|
119
132
|
}),
|
|
120
133
|
/* @__PURE__ */ l("div", {
|
|
121
134
|
className: "max-h-96 overflow-y-auto p-2",
|
|
122
|
-
children: [
|
|
135
|
+
children: [E.length === 0 && /* @__PURE__ */ c("div", {
|
|
123
136
|
className: "py-6 text-center text-sm text-text-muted",
|
|
124
|
-
children:
|
|
125
|
-
}), Object.entries(
|
|
137
|
+
children: _("search.noCommandsFound", "No commands found.")
|
|
138
|
+
}), Object.entries(D).map(([e, n]) => /* @__PURE__ */ l("div", {
|
|
126
139
|
className: "mb-2 last:mb-0",
|
|
127
140
|
children: [/* @__PURE__ */ c("div", {
|
|
128
141
|
className: "px-2 py-1.5 text-[11px] font-medium uppercase tracking-wider text-text-muted",
|
|
129
142
|
children: e
|
|
130
143
|
}), n.map((e) => {
|
|
131
|
-
let n = e.icon, r =
|
|
132
|
-
return
|
|
144
|
+
let n = e.icon, r = O;
|
|
145
|
+
return O++, /* @__PURE__ */ l("button", {
|
|
133
146
|
type: "button",
|
|
134
|
-
onClick: () => void
|
|
135
|
-
className: t("w-full flex items-start gap-3 px-2.5 py-2 text-sm rounded-button transition-colors text-left", r ===
|
|
147
|
+
onClick: () => void T(e),
|
|
148
|
+
className: t("w-full flex items-start gap-3 px-2.5 py-2 text-sm rounded-button transition-colors text-left", r === S ? "bg-[var(--color-accent-soft)] text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
136
149
|
children: [
|
|
137
150
|
n && /* @__PURE__ */ c(n, { className: "size-4 mt-0.5 flex-shrink-0" }),
|
|
138
151
|
/* @__PURE__ */ l("div", {
|
|
@@ -163,7 +176,7 @@ function f({ actions: u, shortcuts: f = [], placeholder: p, className: m }) {
|
|
|
163
176
|
children: "↑↓"
|
|
164
177
|
}),
|
|
165
178
|
" ",
|
|
166
|
-
|
|
179
|
+
_("search.navigate", "Navigate")
|
|
167
180
|
] }),
|
|
168
181
|
/* @__PURE__ */ l("div", { children: [
|
|
169
182
|
/* @__PURE__ */ c("kbd", {
|
|
@@ -171,7 +184,7 @@ function f({ actions: u, shortcuts: f = [], placeholder: p, className: m }) {
|
|
|
171
184
|
children: "Enter"
|
|
172
185
|
}),
|
|
173
186
|
" ",
|
|
174
|
-
|
|
187
|
+
_("search.execute", "Execute")
|
|
175
188
|
] }),
|
|
176
189
|
/* @__PURE__ */ l("div", { children: [
|
|
177
190
|
/* @__PURE__ */ c("kbd", {
|
|
@@ -179,7 +192,7 @@ function f({ actions: u, shortcuts: f = [], placeholder: p, className: m }) {
|
|
|
179
192
|
children: "Esc"
|
|
180
193
|
}),
|
|
181
194
|
" ",
|
|
182
|
-
|
|
195
|
+
_("common.close", "Close")
|
|
183
196
|
] })
|
|
184
197
|
]
|
|
185
198
|
})
|
|
@@ -189,4 +202,4 @@ function f({ actions: u, shortcuts: f = [], placeholder: p, className: m }) {
|
|
|
189
202
|
});
|
|
190
203
|
}
|
|
191
204
|
//#endregion
|
|
192
|
-
export {
|
|
205
|
+
export { d as COMMAND_PALETTE_HELP_SHORTCUT, u as COMMAND_PALETTE_SHORTCUT, m as CommandPalette };
|
|
@@ -5,106 +5,107 @@ import { useGlobalUiOrNull as n } from "../shared/providers/shell/GlobalUiProvid
|
|
|
5
5
|
import { useAssistantControl as r } from "../shared/assistant/appControls/useAssistantControl.js";
|
|
6
6
|
import { EscapeLayer as i } from "../shared/components/EscapeLayer.js";
|
|
7
7
|
import { SHELL_OVERLAY_LAYER_CLASS as a } from "./shellOverlayLayer.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { GlobalSearchError as o } from "../shared/hooks/shell/globalSearchError.js";
|
|
9
|
+
import { debounce as s, isSearchResults as c } from "./globalSearch/utils.js";
|
|
10
|
+
import { SearchInput as l } from "./globalSearch/SearchInput.js";
|
|
11
|
+
import { CategoryTabs as u } from "./globalSearch/CategoryTabs.js";
|
|
12
|
+
import { SearchModeBar as d } from "./globalSearch/SearchModeBar.js";
|
|
13
|
+
import { AdvancedFiltersPanel as f } from "./globalSearch/AdvancedFiltersPanel.js";
|
|
14
|
+
import { ResultsList as p } from "./globalSearch/ResultsList.js";
|
|
15
|
+
import { useAdvancedFilters as m } from "./globalSearch/useAdvancedFilters.js";
|
|
16
|
+
import { useCallback as h, useEffect as g, useMemo as _, useState as v } from "react";
|
|
17
|
+
import { ExternalLink as y } from "lucide-react";
|
|
18
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
18
19
|
//#region src/chrome/GlobalSearch.tsx
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
r("header.search",
|
|
22
|
-
!
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
let
|
|
20
|
+
function S({ open: S, onClose: C, categories: w = [], placeholder: T, recentSearches: E = [], onSearch: D, onSelect: O, onViewAllResults: k, className: A }) {
|
|
21
|
+
let j = e(), [M, N] = v(""), [P, F] = v(void 0), [I, L] = v([]), [R, z] = v(!1), [B, V] = v(null), [H, U] = v(!1), W = m(), { buildFilters: G, reset: K, searchMode: q, setSearchMode: J } = W, Y = n()?.openGlobalSearch, [X, Z] = v(null);
|
|
22
|
+
r("header.search", _(() => Y ? { run: ({ query: e }) => (Z(e === null ? null : { query: e }), Y(), { status: "done" }) } : null, [Y])), g(() => {
|
|
23
|
+
!S || !X || (N(X.query), Z(null));
|
|
24
|
+
}, [S, X]), g(() => {
|
|
25
|
+
S || (N(""), F(void 0), L([]), V(null), U(!1), K());
|
|
26
|
+
}, [S, K]);
|
|
27
|
+
let Q = _(() => s(async (e, t, n) => {
|
|
27
28
|
if (!e.trim()) {
|
|
28
|
-
|
|
29
|
+
L([]), V(null);
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
z(!0), V(null);
|
|
32
33
|
try {
|
|
33
|
-
let r = await
|
|
34
|
-
if (!
|
|
35
|
-
|
|
34
|
+
let r = await D(e, t, n);
|
|
35
|
+
if (!c(r)) throw TypeError(j("search.invalidResults", "Invalid search results format"));
|
|
36
|
+
L(r);
|
|
36
37
|
} catch (e) {
|
|
37
|
-
|
|
38
|
+
V(e instanceof o ? e.reason === "NO_WORKSPACE_CONTEXT" ? j("search.noWorkspace", "Select a workspace to search it.") : j("search.unavailable", "Search is unavailable right now. Try again in a moment.") : e instanceof Error ? e.message : j("search.failed", "Search failed")), L([]), console.error("Search error:", e);
|
|
38
39
|
} finally {
|
|
39
|
-
|
|
40
|
+
z(!1);
|
|
40
41
|
}
|
|
41
|
-
}, 300), [
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
}, 300), [D, j]);
|
|
43
|
+
g(() => {
|
|
44
|
+
Q(M, P, G());
|
|
44
45
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
M,
|
|
47
|
+
P,
|
|
48
|
+
Q,
|
|
49
|
+
G
|
|
49
50
|
]);
|
|
50
|
-
let
|
|
51
|
+
let $ = _(() => I.reduce((e, t) => {
|
|
51
52
|
let n = t.category;
|
|
52
53
|
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
53
|
-
}, {}), [
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
return
|
|
54
|
+
}, {}), [I]), ee = h((e) => {
|
|
55
|
+
O(e), C();
|
|
56
|
+
}, [O, C]);
|
|
57
|
+
return S ? /* @__PURE__ */ b(i, {
|
|
57
58
|
modal: !0,
|
|
58
|
-
onDismiss:
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
className: t("fixed inset-0 flex items-center justify-center bg-bg-overlay backdrop-blur-md", a, "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
61
|
-
onClick:
|
|
62
|
-
"data-state":
|
|
59
|
+
onDismiss: C,
|
|
60
|
+
children: /* @__PURE__ */ b("div", {
|
|
61
|
+
className: t("fixed inset-0 flex items-center justify-center bg-bg-overlay backdrop-blur-md", a, "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", A),
|
|
62
|
+
onClick: C,
|
|
63
|
+
"data-state": S ? "open" : "closed",
|
|
63
64
|
role: "dialog",
|
|
64
65
|
"aria-modal": "true",
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ b("div", {
|
|
66
67
|
className: "w-full max-w-lg mx-4 max-h-[85dvh] overflow-hidden",
|
|
67
68
|
onClick: (e) => e.stopPropagation(),
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ x("div", {
|
|
69
70
|
className: "overflow-hidden rounded-2xl border border-border-subtle bg-bg-elevated shadow-[var(--shadow-elevation-5)]",
|
|
70
71
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
value:
|
|
73
|
-
placeholder:
|
|
74
|
-
onChange:
|
|
75
|
-
onClear: () =>
|
|
72
|
+
/* @__PURE__ */ b(l, {
|
|
73
|
+
value: M,
|
|
74
|
+
placeholder: T ?? j("search.globalPlaceholder", "Search everything..."),
|
|
75
|
+
onChange: N,
|
|
76
|
+
onClear: () => N("")
|
|
76
77
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
categories:
|
|
79
|
-
selectedCategory:
|
|
80
|
-
onSelect:
|
|
78
|
+
/* @__PURE__ */ b(u, {
|
|
79
|
+
categories: w,
|
|
80
|
+
selectedCategory: P,
|
|
81
|
+
onSelect: F
|
|
81
82
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
searchMode:
|
|
84
|
-
onSearchModeChange:
|
|
85
|
-
showAdvanced:
|
|
86
|
-
onToggleAdvanced: () =>
|
|
83
|
+
/* @__PURE__ */ b(d, {
|
|
84
|
+
searchMode: q,
|
|
85
|
+
onSearchModeChange: J,
|
|
86
|
+
showAdvanced: H,
|
|
87
|
+
onToggleAdvanced: () => U((e) => !e)
|
|
87
88
|
}),
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
loading:
|
|
91
|
-
error:
|
|
92
|
-
query:
|
|
93
|
-
results:
|
|
94
|
-
groupedResults:
|
|
95
|
-
recentSearches:
|
|
96
|
-
onRecentSelect:
|
|
97
|
-
onResultSelect:
|
|
89
|
+
H && /* @__PURE__ */ b(f, { filters: W }),
|
|
90
|
+
/* @__PURE__ */ b(p, {
|
|
91
|
+
loading: R,
|
|
92
|
+
error: B,
|
|
93
|
+
query: M,
|
|
94
|
+
results: I,
|
|
95
|
+
groupedResults: $,
|
|
96
|
+
recentSearches: E,
|
|
97
|
+
onRecentSelect: N,
|
|
98
|
+
onResultSelect: ee
|
|
98
99
|
}),
|
|
99
|
-
|
|
100
|
+
M && I.length > 0 && k && /* @__PURE__ */ b("div", {
|
|
100
101
|
className: "border-t border-border-subtle p-2",
|
|
101
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ x("button", {
|
|
102
103
|
type: "button",
|
|
103
104
|
onClick: () => {
|
|
104
|
-
|
|
105
|
+
k(M, G(), P), C();
|
|
105
106
|
},
|
|
106
107
|
className: "w-full flex items-center justify-center gap-2 py-2 text-sm font-medium text-text-link hover:bg-bg-sunken rounded-button transition-colors",
|
|
107
|
-
children: [/* @__PURE__ */ y
|
|
108
|
+
children: [/* @__PURE__ */ b(y, { className: "size-4" }), j("search.viewAllResults", "View all results")]
|
|
108
109
|
})
|
|
109
110
|
})
|
|
110
111
|
]
|
|
@@ -114,4 +115,4 @@ function x({ open: x, onClose: S, categories: C = [], placeholder: w, recentSear
|
|
|
114
115
|
}) : null;
|
|
115
116
|
}
|
|
116
117
|
//#endregion
|
|
117
|
-
export {
|
|
118
|
+
export { S as GlobalSearch };
|
|
@@ -1,83 +1,88 @@
|
|
|
1
1
|
import { desktopSetBadgeCount as e } from "../shared/native/desktop.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
2
|
+
import { navigateInApp as t } from "../shared/navigation/inAppPath.js";
|
|
3
|
+
import { useAssistantControl as n } from "../shared/assistant/appControls/useAssistantControl.js";
|
|
4
|
+
import { BellButton as r } from "./notificationCenter/BellButton.js";
|
|
5
|
+
import { sortNotifications as i } from "./notificationCenter/constants.js";
|
|
6
|
+
import { NotificationFilters as a } from "./notificationCenter/NotificationFilters.js";
|
|
7
|
+
import { NotificationFooter as o } from "./notificationCenter/NotificationFooter.js";
|
|
8
|
+
import { NotificationHeader as s } from "./notificationCenter/NotificationHeader.js";
|
|
9
|
+
import { NotificationList as c } from "./notificationCenter/NotificationList.js";
|
|
10
|
+
import { NotificationPanel as l } from "./notificationCenter/NotificationPanel.js";
|
|
11
|
+
import { useNotificationCenter as u } from "./notificationCenter/useNotificationCenter.js";
|
|
12
|
+
import { useOutsideClickClose as d, usePanelChrome as f } from "./notificationCenter/usePanelChrome.js";
|
|
13
|
+
import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
14
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
15
|
//#region src/chrome/NotificationCenter.tsx
|
|
15
|
-
var
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
let { isMobile:
|
|
19
|
-
|
|
20
|
-
let { notifications:
|
|
21
|
-
client:
|
|
22
|
-
isOpen:
|
|
23
|
-
lazy:
|
|
24
|
-
filterTab:
|
|
25
|
-
typeFilter:
|
|
26
|
-
appFilter:
|
|
16
|
+
var b = ({ client: b, onViewAll: x, compact: S = !1, pollInterval: C = 3e4, lazy: w = !1 }) => {
|
|
17
|
+
let T = g(null), [E, D] = _(!1), [O, k] = _("all"), [A, j] = _("ALL"), [M, N] = _("ALL"), [P, F] = _("newest"), I = p(() => D(!1), []), L = p(() => D((e) => !e), []);
|
|
18
|
+
n("header.notifications", h(() => ({ run: () => E ? { status: "already" } : (D(!0), { status: "done" }) }), [E]));
|
|
19
|
+
let { isMobile: R } = f();
|
|
20
|
+
d(E, R, T, I);
|
|
21
|
+
let { notifications: z, unreadCount: B, countsByApp: V, totalCount: H, loading: U, error: W, fetchNotifications: G, handleMarkAsRead: K, handleMarkAllAsRead: q, handleDelete: J } = u({
|
|
22
|
+
client: b,
|
|
23
|
+
isOpen: E,
|
|
24
|
+
lazy: w,
|
|
25
|
+
filterTab: O,
|
|
26
|
+
typeFilter: A,
|
|
27
|
+
appFilter: M
|
|
27
28
|
});
|
|
28
|
-
|
|
29
|
-
e(
|
|
30
|
-
}, [
|
|
31
|
-
let
|
|
29
|
+
m(() => {
|
|
30
|
+
e(B);
|
|
31
|
+
}, [B]);
|
|
32
|
+
let Y = p((e) => {
|
|
33
|
+
if (t(e)) {
|
|
34
|
+
D(!1);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
32
37
|
window.open(e, "_blank", "noopener,noreferrer");
|
|
33
|
-
}, []),
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
ref:
|
|
38
|
+
}, []), X = p(() => {
|
|
39
|
+
D(!1), x?.();
|
|
40
|
+
}, [x]), Z = i(z, P), Q = Object.entries(V).filter(([e]) => e && e !== "null").sort((e, t) => t[1] - e[1]);
|
|
41
|
+
return /* @__PURE__ */ y("div", {
|
|
42
|
+
ref: T,
|
|
38
43
|
className: "relative",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
40
|
-
unreadCount:
|
|
41
|
-
isOpen:
|
|
42
|
-
onToggle:
|
|
43
|
-
}),
|
|
44
|
-
isMobile:
|
|
45
|
-
onClose:
|
|
46
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ v(r, {
|
|
45
|
+
unreadCount: B,
|
|
46
|
+
isOpen: E,
|
|
47
|
+
onToggle: L
|
|
48
|
+
}), E && /* @__PURE__ */ v(l, {
|
|
49
|
+
isMobile: R,
|
|
50
|
+
onClose: I,
|
|
51
|
+
children: /* @__PURE__ */ y("div", {
|
|
47
52
|
className: "flex flex-col h-full",
|
|
48
53
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
isMobile:
|
|
51
|
-
unreadCount:
|
|
52
|
-
onClose:
|
|
53
|
-
onMarkAllAsRead:
|
|
54
|
+
/* @__PURE__ */ v(s, {
|
|
55
|
+
isMobile: R,
|
|
56
|
+
unreadCount: B,
|
|
57
|
+
onClose: I,
|
|
58
|
+
onMarkAllAsRead: q
|
|
54
59
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
filterTab:
|
|
57
|
-
typeFilter:
|
|
58
|
-
appFilter:
|
|
59
|
-
sortBy:
|
|
60
|
-
appNames:
|
|
61
|
-
onFilterTabChange:
|
|
62
|
-
onTypeFilterChange:
|
|
63
|
-
onAppFilterChange:
|
|
64
|
-
onSortByChange:
|
|
60
|
+
/* @__PURE__ */ v(a, {
|
|
61
|
+
filterTab: O,
|
|
62
|
+
typeFilter: A,
|
|
63
|
+
appFilter: M,
|
|
64
|
+
sortBy: P,
|
|
65
|
+
appNames: Q,
|
|
66
|
+
onFilterTabChange: k,
|
|
67
|
+
onTypeFilterChange: j,
|
|
68
|
+
onAppFilterChange: N,
|
|
69
|
+
onSortByChange: F
|
|
65
70
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
loading:
|
|
68
|
-
error:
|
|
69
|
-
notifications:
|
|
70
|
-
filterTab:
|
|
71
|
-
typeFilter:
|
|
72
|
-
appFilter:
|
|
73
|
-
onRetry:
|
|
74
|
-
onMarkAsRead:
|
|
75
|
-
onDelete:
|
|
76
|
-
onRedirect:
|
|
71
|
+
/* @__PURE__ */ v(c, {
|
|
72
|
+
loading: U,
|
|
73
|
+
error: W,
|
|
74
|
+
notifications: Z,
|
|
75
|
+
filterTab: O,
|
|
76
|
+
typeFilter: A,
|
|
77
|
+
appFilter: M,
|
|
78
|
+
onRetry: G,
|
|
79
|
+
onMarkAsRead: K,
|
|
80
|
+
onDelete: J,
|
|
81
|
+
onRedirect: Y
|
|
77
82
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
totalCount:
|
|
80
|
-
onViewAll:
|
|
83
|
+
/* @__PURE__ */ v(o, {
|
|
84
|
+
totalCount: H,
|
|
85
|
+
onViewAll: x ? X : void 0
|
|
81
86
|
})
|
|
82
87
|
]
|
|
83
88
|
})
|
|
@@ -85,4 +90,4 @@ var y = ({ client: y, onViewAll: b, compact: x = !1, pollInterval: S = 3e4, lazy
|
|
|
85
90
|
});
|
|
86
91
|
};
|
|
87
92
|
//#endregion
|
|
88
|
-
export {
|
|
93
|
+
export { b as NotificationCenter };
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export { FooterBar } from './FooterBar';
|
|
|
51
51
|
export { Footer, DEFAULT_FOOTER_COLUMNS, DEFAULT_SOCIAL_LINKS } from './Footer';
|
|
52
52
|
export { SideNavigation } from './SideNavigation';
|
|
53
53
|
export { GlobalSearch } from './GlobalSearch';
|
|
54
|
-
export { CommandPalette } from './CommandPalette';
|
|
54
|
+
export { CommandPalette, COMMAND_PALETTE_SHORTCUT, COMMAND_PALETTE_HELP_SHORTCUT, } from './CommandPalette';
|
|
55
55
|
export { Breadcrumbs } from './Breadcrumbs';
|
|
56
56
|
export { NavLink } from './NavLink';
|
|
57
57
|
export { Tabs } from './Tabs';
|