impact-nova 1.5.10 → 1.5.13
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/ui/command-palette/command-palette.js +217 -203
- package/dist/components/ui/command-palette/shortcut-registry.d.ts +1 -0
- package/dist/components/ui/command-palette/shortcut-registry.js +30 -20
- package/dist/components/ui/filter-panel/filter-panel.js +11 -6
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +28 -24
- package/dist/components/ui/sheet.js +44 -43
- package/dist/components/ui/types/filter-panel.types.d.ts +1 -0
- package/dist/components/ui/types/filter-strip.types.d.ts +4 -0
- package/dist/icons/assets/circleCross.svg.js +5 -0
- package/dist/icons/assets/circleTick.svg.js +5 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +201 -197
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as f, Fragment as le } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import { Search as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { useCommandPalette as
|
|
7
|
-
import { Kbd as
|
|
8
|
-
import { fuzzyFilter as
|
|
9
|
-
const
|
|
3
|
+
import * as R from "@radix-ui/react-dialog";
|
|
4
|
+
import { Search as U } from "lucide-react";
|
|
5
|
+
import { cn as c } from "../../../lib/utils.js";
|
|
6
|
+
import { useCommandPalette as de } from "./command-palette-context.js";
|
|
7
|
+
import { Kbd as S } from "./kbd.js";
|
|
8
|
+
import { fuzzyFilter as me, keybindingToSymbols as fe } from "./utils.js";
|
|
9
|
+
const D = r.createContext({
|
|
10
10
|
query: "",
|
|
11
11
|
setQuery: () => {
|
|
12
12
|
},
|
|
@@ -17,142 +17,156 @@ const E = r.createContext({
|
|
|
17
17
|
onExecute: () => {
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
function
|
|
20
|
+
function ue({
|
|
21
21
|
className: o,
|
|
22
22
|
children: a,
|
|
23
23
|
commands: n,
|
|
24
24
|
placeholder: i = "Type a command or search...",
|
|
25
|
-
emptyTitle:
|
|
26
|
-
emptyDescription:
|
|
27
|
-
recentGroupLabel:
|
|
28
|
-
defaultGroupLabel:
|
|
29
|
-
navigateLabel:
|
|
30
|
-
runLabel:
|
|
31
|
-
closeLabel:
|
|
32
|
-
onCommandExecute:
|
|
33
|
-
onOpenChange:
|
|
25
|
+
emptyTitle: l = "No results found",
|
|
26
|
+
emptyDescription: y = "Try a different search term",
|
|
27
|
+
recentGroupLabel: d = "Recently Used",
|
|
28
|
+
defaultGroupLabel: C = "Commands",
|
|
29
|
+
navigateLabel: O = "Navigate",
|
|
30
|
+
runLabel: A = "Run",
|
|
31
|
+
closeLabel: F = "Close",
|
|
32
|
+
onCommandExecute: j,
|
|
33
|
+
onOpenChange: G
|
|
34
34
|
}) {
|
|
35
|
-
const { open:
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const { open: M, setOpen: L, getPaletteCommands: ee, getEffectiveKeybinding: te, registry: k } = de(), [w, q] = r.useState(""), [v, N] = r.useState(0), $ = r.useRef(null), K = r.useRef(null), T = r.useMemo(() => n ?? ee(), [n, M]), B = r.useMemo(() => {
|
|
36
|
+
const e = me(
|
|
37
|
+
T,
|
|
38
|
+
w,
|
|
39
39
|
(s) => `${s.category ? s.category + ": " : ""}${s.label}${s.description ? " " + s.description : ""}`
|
|
40
40
|
);
|
|
41
|
-
if (!
|
|
42
|
-
const s =
|
|
43
|
-
for (const
|
|
44
|
-
|
|
45
|
-
return
|
|
41
|
+
if (!w.trim()) {
|
|
42
|
+
const s = k.getRecentCommandIds(), E = new Set(s), p = [], b = [];
|
|
43
|
+
for (const x of e)
|
|
44
|
+
E.has(x.item.id) ? p.push(x) : b.push(x);
|
|
45
|
+
return p.sort((x, z) => s.indexOf(x.item.id) - s.indexOf(z.item.id)), [...p, ...b];
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
for (const
|
|
52
|
-
const
|
|
53
|
-
|
|
47
|
+
return e;
|
|
48
|
+
}, [T, w, k]), u = r.useMemo(() => B.map((e) => e.item), [B]), ae = r.useMemo(() => {
|
|
49
|
+
const e = /* @__PURE__ */ new Map(), s = new Set(k.getRecentCommandIds());
|
|
50
|
+
if (w.trim())
|
|
51
|
+
for (const m of u) {
|
|
52
|
+
const h = m.category || C;
|
|
53
|
+
e.has(h) || e.set(h, []), e.get(h).push(m);
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
for (const
|
|
60
|
-
const
|
|
61
|
-
|
|
56
|
+
const m = u.filter((g) => s.has(g.id));
|
|
57
|
+
m.length > 0 && e.set(d, m);
|
|
58
|
+
const h = u.filter((g) => !s.has(g.id));
|
|
59
|
+
for (const g of h) {
|
|
60
|
+
const P = g.category || C;
|
|
61
|
+
e.has(P) || e.set(P, []), e.get(P).push(g);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const E = { modal: 4, page: 3, module: 2, global: 1 }, p = { user: 2, "ag-grid": 1, browser: 0, system: 0 }, b = /* @__PURE__ */ new Map();
|
|
65
|
+
for (const [m, h] of e.entries()) {
|
|
66
|
+
let g = -1;
|
|
67
|
+
for (const P of h) {
|
|
68
|
+
const ie = E[P.scope] ?? 1, ce = p[P.source ?? "user"] ?? 0;
|
|
69
|
+
g = Math.max(g, ie * 10 + ce);
|
|
62
70
|
}
|
|
71
|
+
b.set(m, g);
|
|
63
72
|
}
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
const x = /* @__PURE__ */ new Map(), z = e.get(d);
|
|
74
|
+
z && x.set(d, z);
|
|
75
|
+
const oe = Array.from(e.entries()).filter(([m]) => m !== d).sort(([m], [h]) => (b.get(h) ?? 0) - (b.get(m) ?? 0));
|
|
76
|
+
for (const [m, h] of oe)
|
|
77
|
+
x.set(m, h);
|
|
78
|
+
return x;
|
|
79
|
+
}, [u, w, k, d, C]);
|
|
66
80
|
r.useEffect(() => {
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
M && (q(""), N(0), requestAnimationFrame(() => {
|
|
82
|
+
$.current?.focus();
|
|
69
83
|
}));
|
|
70
|
-
}, [
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
switch (
|
|
84
|
+
}, [M]);
|
|
85
|
+
const Q = (e) => {
|
|
86
|
+
L(e), G?.(e);
|
|
87
|
+
}, I = r.useCallback((e) => {
|
|
88
|
+
e.handler(), k.addRecentCommand(e.id), j?.(e), Q(!1);
|
|
89
|
+
}, [k, j]), ne = r.useCallback((e) => {
|
|
90
|
+
switch (e.key) {
|
|
77
91
|
case "ArrowDown": {
|
|
78
|
-
|
|
92
|
+
e.preventDefault(), N((s) => Math.min(s + 1, u.length - 1));
|
|
79
93
|
break;
|
|
80
94
|
}
|
|
81
95
|
case "ArrowUp": {
|
|
82
|
-
|
|
96
|
+
e.preventDefault(), N((s) => Math.max(s - 1, 0));
|
|
83
97
|
break;
|
|
84
98
|
}
|
|
85
99
|
case "Enter": {
|
|
86
|
-
|
|
87
|
-
const s =
|
|
88
|
-
s &&
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
const s = u[v];
|
|
102
|
+
s && I(s);
|
|
89
103
|
break;
|
|
90
104
|
}
|
|
91
105
|
case "Home": {
|
|
92
|
-
|
|
106
|
+
e.preventDefault(), N(0);
|
|
93
107
|
break;
|
|
94
108
|
}
|
|
95
109
|
case "End": {
|
|
96
|
-
|
|
110
|
+
e.preventDefault(), N(Math.max(u.length - 1, 0));
|
|
97
111
|
break;
|
|
98
112
|
}
|
|
99
113
|
}
|
|
100
|
-
}, [
|
|
114
|
+
}, [u, v, I]);
|
|
101
115
|
r.useEffect(() => {
|
|
102
|
-
|
|
103
|
-
}, [
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
106
|
-
const s =
|
|
116
|
+
N(0);
|
|
117
|
+
}, [w]), r.useEffect(() => {
|
|
118
|
+
const e = K.current;
|
|
119
|
+
if (!e) return;
|
|
120
|
+
const s = e.querySelector('[data-selected="true"]');
|
|
107
121
|
s && s.scrollIntoView({ block: "nearest" });
|
|
108
|
-
}, [
|
|
109
|
-
const
|
|
122
|
+
}, [v]);
|
|
123
|
+
const se = r.useMemo(
|
|
110
124
|
() => ({
|
|
111
|
-
query:
|
|
112
|
-
setQuery:
|
|
113
|
-
selectedIndex:
|
|
114
|
-
setSelectedIndex:
|
|
115
|
-
flatItems:
|
|
116
|
-
onExecute:
|
|
125
|
+
query: w,
|
|
126
|
+
setQuery: q,
|
|
127
|
+
selectedIndex: v,
|
|
128
|
+
setSelectedIndex: N,
|
|
129
|
+
flatItems: u,
|
|
130
|
+
onExecute: I,
|
|
117
131
|
placeholder: i,
|
|
118
|
-
emptyTitle:
|
|
119
|
-
emptyDescription:
|
|
120
|
-
recentGroupLabel:
|
|
121
|
-
defaultGroupLabel:
|
|
122
|
-
navigateLabel:
|
|
123
|
-
runLabel:
|
|
124
|
-
closeLabel:
|
|
132
|
+
emptyTitle: l,
|
|
133
|
+
emptyDescription: y,
|
|
134
|
+
recentGroupLabel: d,
|
|
135
|
+
defaultGroupLabel: C,
|
|
136
|
+
navigateLabel: O,
|
|
137
|
+
runLabel: A,
|
|
138
|
+
closeLabel: F
|
|
125
139
|
}),
|
|
126
140
|
[
|
|
127
|
-
b,
|
|
128
141
|
w,
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
v,
|
|
143
|
+
u,
|
|
144
|
+
I,
|
|
131
145
|
i,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
l,
|
|
147
|
+
y,
|
|
148
|
+
d,
|
|
149
|
+
C,
|
|
150
|
+
O,
|
|
151
|
+
A,
|
|
152
|
+
F
|
|
139
153
|
]
|
|
140
|
-
),
|
|
141
|
-
return /* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
154
|
+
), re = r.Children.count(a) > 0;
|
|
155
|
+
return /* @__PURE__ */ t(R.Root, { open: M, onOpenChange: Q, children: /* @__PURE__ */ f(R.Portal, { children: [
|
|
156
|
+
/* @__PURE__ */ t(
|
|
157
|
+
R.Overlay,
|
|
144
158
|
{
|
|
145
159
|
className: "fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
146
160
|
}
|
|
147
161
|
),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
|
|
162
|
+
/* @__PURE__ */ f(
|
|
163
|
+
R.Content,
|
|
150
164
|
{
|
|
151
165
|
"aria-describedby": void 0,
|
|
152
166
|
"data-command-palette": !0,
|
|
153
167
|
"data-component": "command-palette",
|
|
154
|
-
onKeyDown:
|
|
155
|
-
className:
|
|
168
|
+
onKeyDown: ne,
|
|
169
|
+
className: c(
|
|
156
170
|
"fixed left-[50%] top-[20%] z-50 w-full max-w-[640px] -translate-x-1/2",
|
|
157
171
|
"rounded-xl border border-[#d1d5db] bg-white shadow-2xl overflow-hidden",
|
|
158
172
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
@@ -165,74 +179,74 @@ function oe({
|
|
|
165
179
|
),
|
|
166
180
|
style: { transformOrigin: "top center" },
|
|
167
181
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
|
|
182
|
+
/* @__PURE__ */ t(R.Title, { className: "sr-only", children: "Command Palette" }),
|
|
183
|
+
/* @__PURE__ */ t(D.Provider, { value: se, children: re ? a : /* @__PURE__ */ f(le, { children: [
|
|
184
|
+
/* @__PURE__ */ t(
|
|
185
|
+
W,
|
|
172
186
|
{
|
|
173
|
-
ref:
|
|
187
|
+
ref: $,
|
|
174
188
|
placeholder: i
|
|
175
189
|
}
|
|
176
190
|
),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
const
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
|
|
191
|
+
/* @__PURE__ */ t(H, { ref: K, children: u.length === 0 ? /* @__PURE__ */ t(X, {}) : Array.from(ae.entries()).map(([e, s], E) => /* @__PURE__ */ f(r.Fragment, { children: [
|
|
192
|
+
E > 0 && /* @__PURE__ */ t(Y, {}),
|
|
193
|
+
/* @__PURE__ */ t(V, { heading: e, children: s.map((p) => {
|
|
194
|
+
const b = u.indexOf(p), x = te(p.id);
|
|
195
|
+
return /* @__PURE__ */ t(
|
|
196
|
+
_,
|
|
183
197
|
{
|
|
184
|
-
command:
|
|
185
|
-
isSelected:
|
|
186
|
-
onSelect: () =>
|
|
187
|
-
onMouseEnter: () =>
|
|
188
|
-
keybinding:
|
|
198
|
+
command: p,
|
|
199
|
+
isSelected: b === v,
|
|
200
|
+
onSelect: () => I(p),
|
|
201
|
+
onMouseEnter: () => N(b),
|
|
202
|
+
keybinding: x
|
|
189
203
|
},
|
|
190
|
-
|
|
204
|
+
p.id
|
|
191
205
|
);
|
|
192
206
|
}) })
|
|
193
|
-
] },
|
|
194
|
-
/* @__PURE__ */
|
|
207
|
+
] }, e)) }),
|
|
208
|
+
/* @__PURE__ */ t(Z, {})
|
|
195
209
|
] }) })
|
|
196
210
|
]
|
|
197
211
|
}
|
|
198
212
|
)
|
|
199
213
|
] }) });
|
|
200
214
|
}
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
({ className: o, placeholder: a, onValueChange: n, ...i },
|
|
204
|
-
const { query:
|
|
205
|
-
return /* @__PURE__ */
|
|
215
|
+
ue.displayName = "CommandPalette";
|
|
216
|
+
const W = r.forwardRef(
|
|
217
|
+
({ className: o, placeholder: a, onValueChange: n, ...i }, l) => {
|
|
218
|
+
const { query: y, setQuery: d } = r.useContext(D);
|
|
219
|
+
return /* @__PURE__ */ f(
|
|
206
220
|
"div",
|
|
207
221
|
{
|
|
208
|
-
className:
|
|
222
|
+
className: c(
|
|
209
223
|
"flex items-center gap-3 border-b border-[#e5e7eb] px-4",
|
|
210
224
|
o
|
|
211
225
|
),
|
|
212
226
|
"data-command-palette-input": !0,
|
|
213
227
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ t(U, { className: "h-4 w-4 shrink-0 text-[#9ca3af]" }),
|
|
229
|
+
/* @__PURE__ */ t(
|
|
216
230
|
"input",
|
|
217
231
|
{
|
|
218
|
-
ref:
|
|
219
|
-
value:
|
|
220
|
-
onChange: (
|
|
221
|
-
|
|
232
|
+
ref: l,
|
|
233
|
+
value: y,
|
|
234
|
+
onChange: (C) => {
|
|
235
|
+
d(C.target.value), n?.(C.target.value);
|
|
222
236
|
},
|
|
223
237
|
placeholder: a,
|
|
224
238
|
autoComplete: "off",
|
|
225
239
|
autoCorrect: "off",
|
|
226
240
|
spellCheck: !1,
|
|
227
|
-
className:
|
|
241
|
+
className: c(
|
|
228
242
|
"flex h-12 w-full bg-transparent py-3 text-sm font-medium outline-none",
|
|
229
243
|
"placeholder:text-[#9ca3af]"
|
|
230
244
|
),
|
|
231
245
|
...i
|
|
232
246
|
}
|
|
233
247
|
),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
|
|
248
|
+
/* @__PURE__ */ t(
|
|
249
|
+
S,
|
|
236
250
|
{
|
|
237
251
|
keybinding: { key: "Escape" },
|
|
238
252
|
size: "sm",
|
|
@@ -245,14 +259,14 @@ const K = r.forwardRef(
|
|
|
245
259
|
);
|
|
246
260
|
}
|
|
247
261
|
);
|
|
248
|
-
|
|
249
|
-
const
|
|
262
|
+
W.displayName = "CommandPaletteInput";
|
|
263
|
+
const H = r.forwardRef(({ className: o, children: a, ...n }, i) => /* @__PURE__ */ t(
|
|
250
264
|
"div",
|
|
251
265
|
{
|
|
252
266
|
ref: i,
|
|
253
267
|
role: "listbox",
|
|
254
268
|
"data-command-palette-list": !0,
|
|
255
|
-
className:
|
|
269
|
+
className: c(
|
|
256
270
|
"max-h-[360px] overflow-y-auto overscroll-contain py-1",
|
|
257
271
|
o
|
|
258
272
|
),
|
|
@@ -260,37 +274,37 @@ const T = r.forwardRef(({ className: o, children: a, ...n }, i) => /* @__PURE__
|
|
|
260
274
|
children: a
|
|
261
275
|
}
|
|
262
276
|
));
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
({ className: o, heading: a, children: n, ...i },
|
|
277
|
+
H.displayName = "CommandPaletteList";
|
|
278
|
+
const V = r.forwardRef(
|
|
279
|
+
({ className: o, heading: a, children: n, ...i }, l) => /* @__PURE__ */ f(
|
|
266
280
|
"div",
|
|
267
281
|
{
|
|
268
|
-
ref:
|
|
282
|
+
ref: l,
|
|
269
283
|
role: "group",
|
|
270
284
|
"aria-label": a,
|
|
271
285
|
"data-command-palette-group": !0,
|
|
272
|
-
className:
|
|
286
|
+
className: c("py-1", o),
|
|
273
287
|
...i,
|
|
274
288
|
children: [
|
|
275
|
-
a && /* @__PURE__ */
|
|
289
|
+
a && /* @__PURE__ */ t("div", { className: "px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-[#9ca3af]", children: a }),
|
|
276
290
|
n
|
|
277
291
|
]
|
|
278
292
|
}
|
|
279
293
|
)
|
|
280
294
|
);
|
|
281
|
-
|
|
282
|
-
const
|
|
295
|
+
V.displayName = "CommandPaletteGroup";
|
|
296
|
+
const pe = {
|
|
283
297
|
browser: "Browser",
|
|
284
298
|
"ag-grid": "AG Grid",
|
|
285
299
|
system: "System"
|
|
286
300
|
};
|
|
287
|
-
function
|
|
301
|
+
function xe({ source: o, isSelected: a }) {
|
|
288
302
|
if (!o || o === "user") return null;
|
|
289
|
-
const n =
|
|
290
|
-
return n ? /* @__PURE__ */
|
|
303
|
+
const n = pe[o];
|
|
304
|
+
return n ? /* @__PURE__ */ t(
|
|
291
305
|
"span",
|
|
292
306
|
{
|
|
293
|
-
className:
|
|
307
|
+
className: c(
|
|
294
308
|
"shrink-0 rounded px-1.5 py-px text-[9px] font-medium leading-tight tracking-wide",
|
|
295
309
|
a ? "text-white/50" : "text-[#9ca3af] border border-[#e5e7eb]"
|
|
296
310
|
),
|
|
@@ -298,135 +312,135 @@ function le({ source: o, isSelected: a }) {
|
|
|
298
312
|
}
|
|
299
313
|
) : null;
|
|
300
314
|
}
|
|
301
|
-
const
|
|
302
|
-
({ className: o, command: a, isSelected: n, onSelect: i, keybinding:
|
|
315
|
+
const _ = r.forwardRef(
|
|
316
|
+
({ className: o, command: a, isSelected: n, onSelect: i, keybinding: l, ...y }, d) => /* @__PURE__ */ f(
|
|
303
317
|
"div",
|
|
304
318
|
{
|
|
305
|
-
ref:
|
|
319
|
+
ref: d,
|
|
306
320
|
role: "option",
|
|
307
321
|
"aria-selected": n,
|
|
308
322
|
"data-selected": n,
|
|
309
323
|
"data-command-palette-item": !0,
|
|
310
324
|
"data-command-id": a.id,
|
|
311
325
|
onClick: i,
|
|
312
|
-
className:
|
|
326
|
+
className: c(
|
|
313
327
|
"flex items-center gap-3 cursor-pointer px-4 py-2 text-sm",
|
|
314
328
|
"transition-colors duration-75",
|
|
315
329
|
n ? "bg-[#4259ee] text-white" : "text-[#374151] hover:bg-[#f3f4f6]",
|
|
316
330
|
o
|
|
317
331
|
),
|
|
318
|
-
...
|
|
332
|
+
...y,
|
|
319
333
|
children: [
|
|
320
|
-
a.icon && /* @__PURE__ */
|
|
334
|
+
a.icon && /* @__PURE__ */ t("span", { className: c(
|
|
321
335
|
"flex h-4 w-4 shrink-0 items-center justify-center",
|
|
322
336
|
n ? "text-white" : "text-[#6b7280]"
|
|
323
337
|
), children: a.icon }),
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
a.description && /* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ f("div", { className: "flex flex-1 flex-col min-w-0", children: [
|
|
339
|
+
/* @__PURE__ */ t("span", { className: "truncate font-medium", children: a.label }),
|
|
340
|
+
a.description && /* @__PURE__ */ t("span", { className: c(
|
|
327
341
|
"truncate text-xs",
|
|
328
342
|
n ? "text-white/70" : "text-[#9ca3af]"
|
|
329
343
|
), children: a.description })
|
|
330
344
|
] }),
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
|
|
345
|
+
/* @__PURE__ */ t(xe, { source: a.source, isSelected: n }),
|
|
346
|
+
l && /* @__PURE__ */ t(J, { keybinding: l, isSelected: n })
|
|
333
347
|
]
|
|
334
348
|
}
|
|
335
349
|
)
|
|
336
350
|
);
|
|
337
|
-
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
return /* @__PURE__ */
|
|
351
|
+
_.displayName = "CommandPaletteItem";
|
|
352
|
+
function J({ keybinding: o, isSelected: a, className: n, ...i }) {
|
|
353
|
+
const l = fe(o);
|
|
354
|
+
return /* @__PURE__ */ t(
|
|
341
355
|
"span",
|
|
342
356
|
{
|
|
343
|
-
className:
|
|
357
|
+
className: c("ml-auto flex items-center gap-0.5 shrink-0", n),
|
|
344
358
|
"data-command-palette-shortcut": !0,
|
|
345
359
|
...i,
|
|
346
|
-
children:
|
|
360
|
+
children: l.map((y, d) => /* @__PURE__ */ t(
|
|
347
361
|
"kbd",
|
|
348
362
|
{
|
|
349
|
-
className:
|
|
363
|
+
className: c(
|
|
350
364
|
"inline-flex min-w-[20px] items-center justify-center rounded px-1 h-[20px] text-[10px] font-mono leading-none",
|
|
351
365
|
a ? "bg-white/20 text-white border border-white/30" : "bg-[#f4f5f7] text-[#6b7280] border border-[#d1d5db]"
|
|
352
366
|
),
|
|
353
|
-
children:
|
|
367
|
+
children: y
|
|
354
368
|
},
|
|
355
|
-
`${
|
|
369
|
+
`${y}-${d}`
|
|
356
370
|
))
|
|
357
371
|
}
|
|
358
372
|
);
|
|
359
373
|
}
|
|
360
|
-
|
|
361
|
-
function
|
|
362
|
-
const { emptyTitle: n, emptyDescription: i } = r.useContext(
|
|
363
|
-
return /* @__PURE__ */
|
|
374
|
+
J.displayName = "CommandPaletteShortcut";
|
|
375
|
+
function X({ className: o, ...a }) {
|
|
376
|
+
const { emptyTitle: n, emptyDescription: i } = r.useContext(D);
|
|
377
|
+
return /* @__PURE__ */ f(
|
|
364
378
|
"div",
|
|
365
379
|
{
|
|
366
380
|
"data-command-palette-empty": !0,
|
|
367
|
-
className:
|
|
381
|
+
className: c(
|
|
368
382
|
"flex flex-col items-center justify-center py-12 text-center text-sm text-[#9ca3af]",
|
|
369
383
|
o
|
|
370
384
|
),
|
|
371
385
|
...a,
|
|
372
386
|
children: [
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ t(U, { className: "h-8 w-8 mb-3 text-[#d1d5db]" }),
|
|
388
|
+
/* @__PURE__ */ t("p", { className: "font-medium", children: n }),
|
|
389
|
+
/* @__PURE__ */ t("p", { className: "text-xs mt-1", children: i })
|
|
376
390
|
]
|
|
377
391
|
}
|
|
378
392
|
);
|
|
379
393
|
}
|
|
380
|
-
|
|
381
|
-
function
|
|
382
|
-
return /* @__PURE__ */
|
|
394
|
+
X.displayName = "CommandPaletteEmpty";
|
|
395
|
+
function Y({ className: o, ...a }) {
|
|
396
|
+
return /* @__PURE__ */ t(
|
|
383
397
|
"div",
|
|
384
398
|
{
|
|
385
399
|
"data-command-palette-separator": !0,
|
|
386
|
-
className:
|
|
400
|
+
className: c("h-px bg-[#e5e7eb] mx-2", o),
|
|
387
401
|
...a
|
|
388
402
|
}
|
|
389
403
|
);
|
|
390
404
|
}
|
|
391
|
-
|
|
392
|
-
function
|
|
393
|
-
const { navigateLabel: n, runLabel: i, closeLabel:
|
|
394
|
-
return /* @__PURE__ */
|
|
405
|
+
Y.displayName = "CommandPaletteSeparator";
|
|
406
|
+
function Z({ className: o, ...a }) {
|
|
407
|
+
const { navigateLabel: n, runLabel: i, closeLabel: l } = r.useContext(D);
|
|
408
|
+
return /* @__PURE__ */ f(
|
|
395
409
|
"div",
|
|
396
410
|
{
|
|
397
411
|
"data-command-palette-footer": !0,
|
|
398
|
-
className:
|
|
412
|
+
className: c(
|
|
399
413
|
"flex items-center gap-4 border-t border-[#e5e7eb] px-4 py-2 text-[11px] text-[#9ca3af]",
|
|
400
414
|
o
|
|
401
415
|
),
|
|
402
416
|
...a,
|
|
403
417
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ f("span", { className: "inline-flex items-center gap-1", children: [
|
|
419
|
+
/* @__PURE__ */ t(S, { keys: ["↑"], size: "sm", variant: "muted" }),
|
|
420
|
+
/* @__PURE__ */ t(S, { keys: ["↓"], size: "sm", variant: "muted" }),
|
|
421
|
+
/* @__PURE__ */ t("span", { children: n })
|
|
408
422
|
] }),
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ f("span", { className: "inline-flex items-center gap-1", children: [
|
|
424
|
+
/* @__PURE__ */ t(S, { keys: ["↵"], size: "sm", variant: "muted" }),
|
|
425
|
+
/* @__PURE__ */ t("span", { children: i })
|
|
412
426
|
] }),
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ f("span", { className: "inline-flex items-center gap-1", children: [
|
|
428
|
+
/* @__PURE__ */ t(S, { keys: ["Escape"], size: "sm", variant: "muted" }),
|
|
429
|
+
/* @__PURE__ */ t("span", { children: l })
|
|
416
430
|
] })
|
|
417
431
|
]
|
|
418
432
|
}
|
|
419
433
|
);
|
|
420
434
|
}
|
|
421
|
-
|
|
435
|
+
Z.displayName = "CommandPaletteFooter";
|
|
422
436
|
export {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
437
|
+
ue as CommandPalette,
|
|
438
|
+
X as CommandPaletteEmpty,
|
|
439
|
+
Z as CommandPaletteFooter,
|
|
440
|
+
V as CommandPaletteGroup,
|
|
441
|
+
W as CommandPaletteInput,
|
|
442
|
+
_ as CommandPaletteItem,
|
|
443
|
+
H as CommandPaletteList,
|
|
444
|
+
Y as CommandPaletteSeparator,
|
|
445
|
+
J as CommandPaletteShortcut
|
|
432
446
|
};
|
|
@@ -50,6 +50,7 @@ export declare class ShortcutRegistry {
|
|
|
50
50
|
popScope(scope: ShortcutScope): void;
|
|
51
51
|
getActiveScopes(): ShortcutScope[];
|
|
52
52
|
getHighestActiveScope(): ShortcutScope;
|
|
53
|
+
private getHighestActiveScopePriority;
|
|
53
54
|
getCommand(id: string): CommandDefinition | undefined;
|
|
54
55
|
getAllCommands(): CommandDefinition[];
|
|
55
56
|
/**
|