impact-nova 1.6.0 → 1.6.2
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/calendar.js +354 -350
- package/dist/components/ui/command-palette/command-palette.js +53 -50
- package/dist/components/ui/command-palette/shortcut-settings.js +130 -123
- package/dist/components/ui/date-picker/multi-week-picker.js +30 -30
- package/dist/components/ui/date-picker/week-picker.js +45 -45
- package/package.json +1 -1
|
@@ -28,8 +28,8 @@ function fe({
|
|
|
28
28
|
commands: n,
|
|
29
29
|
placeholder: i = "Type a command or search...",
|
|
30
30
|
emptyTitle: m = "No results found",
|
|
31
|
-
emptyDescription:
|
|
32
|
-
recentGroupLabel:
|
|
31
|
+
emptyDescription: p = "Try a different search term",
|
|
32
|
+
recentGroupLabel: f = "Recently Used",
|
|
33
33
|
defaultGroupLabel: d = "Commands",
|
|
34
34
|
navigateLabel: I = "Navigate",
|
|
35
35
|
runLabel: z = "Run",
|
|
@@ -38,34 +38,37 @@ function fe({
|
|
|
38
38
|
onCommandExecute: O,
|
|
39
39
|
onOpenChange: W
|
|
40
40
|
}) {
|
|
41
|
-
const { open: E, setOpen: Y, getPaletteCommands: Z, getEffectiveKeybinding: G, registry: k } = ie(), [
|
|
41
|
+
const { open: E, setOpen: Y, getPaletteCommands: Z, getEffectiveKeybinding: G, registry: k } = ie(), [y, $] = r.useState(""), [N, g] = r.useState(0), A = r.useRef(null), F = r.useRef(null), j = r.useMemo(() => (n ?? Z()).filter((s) => {
|
|
42
|
+
const u = s.source ?? "user";
|
|
43
|
+
return u === "user" || u === "ag-grid";
|
|
44
|
+
}), [n, E]), q = r.useMemo(() => {
|
|
42
45
|
const t = le(
|
|
43
46
|
j,
|
|
44
|
-
|
|
47
|
+
y,
|
|
45
48
|
(s) => `${s.category ? s.category + ": " : ""}${s.label}${s.description ? " " + s.description : ""}`
|
|
46
49
|
);
|
|
47
|
-
if (!
|
|
48
|
-
const s = k.getRecentCommandIds(),
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
return
|
|
50
|
+
if (!y.trim()) {
|
|
51
|
+
const s = k.getRecentCommandIds(), u = new Set(s), x = [], C = [];
|
|
52
|
+
for (const h of t)
|
|
53
|
+
u.has(h.item.id) ? x.push(h) : C.push(h);
|
|
54
|
+
return x.sort((h, oe) => s.indexOf(h.item.id) - s.indexOf(oe.item.id)), [...x, ...C];
|
|
52
55
|
}
|
|
53
56
|
return t;
|
|
54
|
-
}, [j,
|
|
57
|
+
}, [j, y, k]), T = r.useMemo(
|
|
55
58
|
() => q.map((t) => t.item),
|
|
56
59
|
[q]
|
|
57
60
|
), ee = r.useMemo(
|
|
58
61
|
() => de({
|
|
59
62
|
filteredCommands: T,
|
|
60
|
-
emptyQuery: !
|
|
63
|
+
emptyQuery: !y.trim(),
|
|
61
64
|
recentCommandIds: k.getRecentCommandIds(),
|
|
62
|
-
recentGroupLabel:
|
|
65
|
+
recentGroupLabel: f,
|
|
63
66
|
defaultGroupLabel: d
|
|
64
67
|
}),
|
|
65
|
-
[T,
|
|
68
|
+
[T, y, k, f, d]
|
|
66
69
|
), { groups: te, orderedCommands: b } = ee, S = r.useRef({ ordered: b, index: N });
|
|
67
70
|
S.current = { ordered: b, index: N }, r.useEffect(() => {
|
|
68
|
-
E && ($(""),
|
|
71
|
+
E && ($(""), g(0), requestAnimationFrame(() => {
|
|
69
72
|
A.current?.focus();
|
|
70
73
|
}));
|
|
71
74
|
}, [E]);
|
|
@@ -75,28 +78,28 @@ function fe({
|
|
|
75
78
|
t.handler(), k.addRecentCommand(t.id), O?.(t), K(!1);
|
|
76
79
|
}, [k, O]), ae = r.useCallback(
|
|
77
80
|
(t) => {
|
|
78
|
-
const { ordered: s } = S.current,
|
|
81
|
+
const { ordered: s } = S.current, u = Math.max(s.length - 1, 0);
|
|
79
82
|
switch (t.key) {
|
|
80
83
|
case "ArrowDown": {
|
|
81
|
-
t.preventDefault(),
|
|
84
|
+
t.preventDefault(), g((x) => Math.min(x + 1, u));
|
|
82
85
|
break;
|
|
83
86
|
}
|
|
84
87
|
case "ArrowUp": {
|
|
85
|
-
t.preventDefault(),
|
|
88
|
+
t.preventDefault(), g((x) => Math.max(x - 1, 0));
|
|
86
89
|
break;
|
|
87
90
|
}
|
|
88
91
|
case "Enter": {
|
|
89
92
|
t.preventDefault();
|
|
90
|
-
const { ordered:
|
|
91
|
-
|
|
93
|
+
const { ordered: x, index: C } = S.current, h = x[C];
|
|
94
|
+
h && w(h);
|
|
92
95
|
break;
|
|
93
96
|
}
|
|
94
97
|
case "Home": {
|
|
95
|
-
t.preventDefault(),
|
|
98
|
+
t.preventDefault(), g(0);
|
|
96
99
|
break;
|
|
97
100
|
}
|
|
98
101
|
case "End": {
|
|
99
|
-
t.preventDefault(),
|
|
102
|
+
t.preventDefault(), g(u);
|
|
100
103
|
break;
|
|
101
104
|
}
|
|
102
105
|
}
|
|
@@ -104,10 +107,10 @@ function fe({
|
|
|
104
107
|
[w]
|
|
105
108
|
);
|
|
106
109
|
r.useEffect(() => {
|
|
107
|
-
|
|
108
|
-
}, [
|
|
110
|
+
g(0);
|
|
111
|
+
}, [y]), r.useEffect(() => {
|
|
109
112
|
const t = b.length;
|
|
110
|
-
|
|
113
|
+
g((s) => t === 0 ? 0 : Math.min(s, t - 1));
|
|
111
114
|
}, [b.length]), r.useLayoutEffect(() => {
|
|
112
115
|
const t = F.current;
|
|
113
116
|
if (!t) return;
|
|
@@ -120,16 +123,16 @@ function fe({
|
|
|
120
123
|
}, [N]);
|
|
121
124
|
const ne = r.useMemo(
|
|
122
125
|
() => ({
|
|
123
|
-
query:
|
|
126
|
+
query: y,
|
|
124
127
|
setQuery: $,
|
|
125
128
|
selectedIndex: N,
|
|
126
|
-
setSelectedIndex:
|
|
129
|
+
setSelectedIndex: g,
|
|
127
130
|
orderedCommands: b,
|
|
128
131
|
onExecute: w,
|
|
129
132
|
placeholder: i,
|
|
130
133
|
emptyTitle: m,
|
|
131
|
-
emptyDescription:
|
|
132
|
-
recentGroupLabel:
|
|
134
|
+
emptyDescription: p,
|
|
135
|
+
recentGroupLabel: f,
|
|
133
136
|
defaultGroupLabel: d,
|
|
134
137
|
navigateLabel: I,
|
|
135
138
|
runLabel: z,
|
|
@@ -137,14 +140,14 @@ function fe({
|
|
|
137
140
|
configureShortcutsLabel: D
|
|
138
141
|
}),
|
|
139
142
|
[
|
|
140
|
-
|
|
143
|
+
y,
|
|
141
144
|
N,
|
|
142
145
|
b,
|
|
143
146
|
w,
|
|
144
147
|
i,
|
|
145
148
|
m,
|
|
146
|
-
u,
|
|
147
149
|
p,
|
|
150
|
+
f,
|
|
148
151
|
d,
|
|
149
152
|
I,
|
|
150
153
|
z,
|
|
@@ -190,18 +193,18 @@ function fe({
|
|
|
190
193
|
),
|
|
191
194
|
/* @__PURE__ */ e(_, { ref: F, children: b.length === 0 ? /* @__PURE__ */ e(V, {}) : te.map((t, s) => /* @__PURE__ */ c(r.Fragment, { children: [
|
|
192
195
|
s > 0 && /* @__PURE__ */ e(X, {}),
|
|
193
|
-
/* @__PURE__ */ e(B, { heading: t.heading, children: t.items.map((
|
|
194
|
-
const C = t.rowStart +
|
|
196
|
+
/* @__PURE__ */ e(B, { heading: t.heading, children: t.items.map((u, x) => {
|
|
197
|
+
const C = t.rowStart + x, h = G(u.id);
|
|
195
198
|
return /* @__PURE__ */ e(
|
|
196
199
|
H,
|
|
197
200
|
{
|
|
198
|
-
command:
|
|
201
|
+
command: u,
|
|
199
202
|
isSelected: C === N,
|
|
200
|
-
onSelect: () => w(
|
|
201
|
-
onMouseEnter: () =>
|
|
202
|
-
keybinding:
|
|
203
|
+
onSelect: () => w(u),
|
|
204
|
+
onMouseEnter: () => g(C),
|
|
205
|
+
keybinding: h
|
|
203
206
|
},
|
|
204
|
-
|
|
207
|
+
u.id
|
|
205
208
|
);
|
|
206
209
|
}) })
|
|
207
210
|
] }, `${t.heading}-${t.rowStart}`)) }),
|
|
@@ -215,7 +218,7 @@ function fe({
|
|
|
215
218
|
fe.displayName = "CommandPalette";
|
|
216
219
|
const U = r.forwardRef(
|
|
217
220
|
({ className: o, placeholder: a, onValueChange: n, ...i }, m) => {
|
|
218
|
-
const { query:
|
|
221
|
+
const { query: p, setQuery: f } = r.useContext(R);
|
|
219
222
|
return /* @__PURE__ */ c(
|
|
220
223
|
"div",
|
|
221
224
|
{
|
|
@@ -230,9 +233,9 @@ const U = r.forwardRef(
|
|
|
230
233
|
"input",
|
|
231
234
|
{
|
|
232
235
|
ref: m,
|
|
233
|
-
value:
|
|
236
|
+
value: p,
|
|
234
237
|
onChange: (d) => {
|
|
235
|
-
|
|
238
|
+
f(d.target.value), n?.(d.target.value);
|
|
236
239
|
},
|
|
237
240
|
placeholder: a,
|
|
238
241
|
autoComplete: "off",
|
|
@@ -308,12 +311,12 @@ function xe({ source: o, isSelected: a }) {
|
|
|
308
311
|
) : null;
|
|
309
312
|
}
|
|
310
313
|
const H = r.forwardRef(
|
|
311
|
-
({ className: o, command: a, isSelected: n, onSelect: i, keybinding: m, ...
|
|
314
|
+
({ className: o, command: a, isSelected: n, onSelect: i, keybinding: m, ...p }, f) => {
|
|
312
315
|
const d = pe(a.source);
|
|
313
316
|
return /* @__PURE__ */ c(
|
|
314
317
|
"div",
|
|
315
318
|
{
|
|
316
|
-
ref:
|
|
319
|
+
ref: f,
|
|
317
320
|
role: "option",
|
|
318
321
|
"aria-selected": n,
|
|
319
322
|
"data-selected": n,
|
|
@@ -327,7 +330,7 @@ const H = r.forwardRef(
|
|
|
327
330
|
n ? "bg-brand text-brand-foreground" : d ? "text-content-muted hover:bg-canvas-muted" : "text-content-charcoal hover:bg-canvas-muted",
|
|
328
331
|
o
|
|
329
332
|
),
|
|
330
|
-
...
|
|
333
|
+
...p,
|
|
331
334
|
children: [
|
|
332
335
|
a.icon && /* @__PURE__ */ e("span", { className: l(
|
|
333
336
|
"flex h-4 w-4 shrink-0 items-center justify-center",
|
|
@@ -352,14 +355,14 @@ const H = r.forwardRef(
|
|
|
352
355
|
);
|
|
353
356
|
H.displayName = "CommandPaletteItem";
|
|
354
357
|
function L({ keybinding: o, isSelected: a, external: n, className: i, ...m }) {
|
|
355
|
-
const
|
|
358
|
+
const p = ce(o);
|
|
356
359
|
return /* @__PURE__ */ e(
|
|
357
360
|
"span",
|
|
358
361
|
{
|
|
359
362
|
className: l("ml-auto flex items-center gap-0.5 shrink-0", i),
|
|
360
363
|
"data-command-palette-shortcut": !0,
|
|
361
364
|
...m,
|
|
362
|
-
children:
|
|
365
|
+
children: p.map((f, d) => /* @__PURE__ */ e(
|
|
363
366
|
"kbd",
|
|
364
367
|
{
|
|
365
368
|
className: l(
|
|
@@ -367,9 +370,9 @@ function L({ keybinding: o, isSelected: a, external: n, className: i, ...m }) {
|
|
|
367
370
|
"transition-[color,background-color,border-color] duration-150 ease-out",
|
|
368
371
|
a ? "bg-canvas-elevated/20 text-brand-foreground border border-brand-foreground/30" : n ? "bg-canvas-muted text-stroke-hairline border border-stroke-hairline" : "bg-canvas-muted text-content-muted border border-stroke-hairline"
|
|
369
372
|
),
|
|
370
|
-
children:
|
|
373
|
+
children: f
|
|
371
374
|
},
|
|
372
|
-
`${
|
|
375
|
+
`${f}-${d}`
|
|
373
376
|
))
|
|
374
377
|
}
|
|
375
378
|
);
|
|
@@ -407,7 +410,7 @@ function X({ className: o, ...a }) {
|
|
|
407
410
|
}
|
|
408
411
|
X.displayName = "CommandPaletteSeparator";
|
|
409
412
|
function J({ className: o, ...a }) {
|
|
410
|
-
const { navigateLabel: n, runLabel: i, closeLabel: m, configureShortcutsLabel:
|
|
413
|
+
const { navigateLabel: n, runLabel: i, closeLabel: m, configureShortcutsLabel: p } = r.useContext(R);
|
|
411
414
|
return /* @__PURE__ */ c(
|
|
412
415
|
"div",
|
|
413
416
|
{
|
|
@@ -431,9 +434,9 @@ function J({ className: o, ...a }) {
|
|
|
431
434
|
/* @__PURE__ */ e(v, { keys: ["Escape"], size: "sm", variant: "muted" }),
|
|
432
435
|
/* @__PURE__ */ e("span", { children: m })
|
|
433
436
|
] }),
|
|
434
|
-
|
|
437
|
+
p && /* @__PURE__ */ c("span", { className: "ml-auto inline-flex items-center gap-1", children: [
|
|
435
438
|
/* @__PURE__ */ e(v, { keybinding: { key: "k", alt: !0 }, size: "sm", variant: "muted" }),
|
|
436
|
-
/* @__PURE__ */ e("span", { children:
|
|
439
|
+
/* @__PURE__ */ e("span", { children: p })
|
|
437
440
|
] })
|
|
438
441
|
]
|
|
439
442
|
}
|
|
@@ -1,171 +1,180 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as h, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { User as
|
|
4
|
-
import { cn as
|
|
3
|
+
import { User as z, Monitor as G, AlertTriangle as U, Lock as F, RotateCcw as q } from "lucide-react";
|
|
4
|
+
import { cn as p } from "../../../lib/utils.js";
|
|
5
5
|
import { ModuleRegistry as B, AllCommunityModule as $ } from "ag-grid-community";
|
|
6
6
|
import { AllEnterpriseModule as H } from "ag-grid-enterprise";
|
|
7
|
-
import { DataTable as V, DataTableContent as
|
|
8
|
-
import { AG_CELL_NO_PADDING as
|
|
9
|
-
import { Kbd as
|
|
10
|
-
import { useCommandPalette as
|
|
11
|
-
import { COMMAND_SOURCE_LABELS as
|
|
12
|
-
import { BadgeCellRenderer as
|
|
7
|
+
import { DataTable as V, DataTableContent as J } from "../data-table/data-table.js";
|
|
8
|
+
import { AG_CELL_NO_PADDING as A } from "../ag-grid-react/cell-renderers/index.js";
|
|
9
|
+
import { Kbd as Q } from "./kbd.js";
|
|
10
|
+
import { useCommandPalette as X } from "./command-palette-context.js";
|
|
11
|
+
import { COMMAND_SOURCE_LABELS as m, keybindingToString as Y, keybindingFromEvent as Z, isReservedShortcut as W } from "./utils.js";
|
|
12
|
+
import { BadgeCellRenderer as ee } from "../ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
13
13
|
B.registerModules([$, H]);
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
!
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ r("span", { className: "truncate font-medium text-content-charcoal text-xs leading-tight", children:
|
|
20
|
-
|
|
14
|
+
function te(l) {
|
|
15
|
+
const t = l.data;
|
|
16
|
+
return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
17
|
+
!t.customisable && /* @__PURE__ */ r(F, { className: "h-3 w-3 text-content-muted shrink-0" }),
|
|
18
|
+
/* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 gap-0", children: [
|
|
19
|
+
/* @__PURE__ */ r("span", { className: "truncate font-medium text-content-charcoal text-xs leading-tight", children: t.command }),
|
|
20
|
+
t.description && /* @__PURE__ */ r("span", { className: "truncate text-[10px] text-content-muted leading-tight", children: t.description })
|
|
21
21
|
] })
|
|
22
22
|
] }) : null;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */ r("div", { className:
|
|
24
|
+
function re(l) {
|
|
25
|
+
const t = l.data;
|
|
26
|
+
if (!t) return null;
|
|
27
|
+
const u = l.recordingCommandId === t.id;
|
|
28
|
+
return /* @__PURE__ */ r("div", { className: p(
|
|
29
29
|
"w-full h-full flex items-center ag-cell-inner-padding",
|
|
30
|
-
|
|
30
|
+
t.customisable ? "in-ag-editable-cell-highlight" : ""
|
|
31
31
|
), children: /* @__PURE__ */ r(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: p(
|
|
35
35
|
"flex items-center justify-between w-full h-7 rounded-[8px] px-1.5 group/row relative",
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
t.customisable ? "bg-canvas-elevated" : "bg-transparent",
|
|
37
|
+
u && "ring-1 ring-brand border border-brand"
|
|
38
38
|
),
|
|
39
|
-
children:
|
|
40
|
-
|
|
39
|
+
children: u ? /* @__PURE__ */ r("span", { className: "text-xs text-brand font-medium animate-pulse", children: l.recordingLabel ?? "Press desired shortcut..." }) : /* @__PURE__ */ h(j, { children: [
|
|
40
|
+
t.keybinding ? /* @__PURE__ */ r(
|
|
41
41
|
"button",
|
|
42
42
|
{
|
|
43
43
|
type: "button",
|
|
44
44
|
onClick: (o) => {
|
|
45
|
-
o.stopPropagation(),
|
|
45
|
+
o.stopPropagation(), t.customisable && l.onStartRecording(t.id);
|
|
46
46
|
},
|
|
47
|
-
disabled: !
|
|
48
|
-
className:
|
|
47
|
+
disabled: !t.customisable,
|
|
48
|
+
className: p(
|
|
49
49
|
"flex items-center justify-end h-full w-full text-right",
|
|
50
|
-
|
|
50
|
+
t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
|
|
51
51
|
),
|
|
52
|
-
children: /* @__PURE__ */ r(
|
|
52
|
+
children: /* @__PURE__ */ r(Q, { keybinding: t.keybinding, size: "sm" })
|
|
53
53
|
}
|
|
54
|
-
) :
|
|
54
|
+
) : t.customisable ? /* @__PURE__ */ r(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
57
57
|
type: "button",
|
|
58
58
|
onClick: (o) => {
|
|
59
|
-
o.stopPropagation(),
|
|
59
|
+
o.stopPropagation(), l.onStartRecording(t.id);
|
|
60
60
|
},
|
|
61
61
|
className: "flex items-center justify-end h-full w-full text-xs text-content-muted hover:text-brand transition-colors cursor-pointer text-right",
|
|
62
|
-
children:
|
|
62
|
+
children: l.addShortcutLabel ?? "Add shortcut"
|
|
63
63
|
}
|
|
64
64
|
) : /* @__PURE__ */ r("span", { className: "text-xs text-transparent", children: "--" }),
|
|
65
|
-
|
|
65
|
+
t.hasOverride && t.customisable && !u && /* @__PURE__ */ r(
|
|
66
66
|
"button",
|
|
67
67
|
{
|
|
68
68
|
type: "button",
|
|
69
69
|
onClick: (o) => {
|
|
70
|
-
o.stopPropagation(),
|
|
70
|
+
o.stopPropagation(), l.onReset(t.id);
|
|
71
71
|
},
|
|
72
72
|
className: "absolute right-1 p-0.5 rounded bg-canvas-elevated hover:bg-canvas-muted hover:text-destructive cursor-pointer opacity-0 group-hover/row:opacity-100 transition-opacity z-10",
|
|
73
73
|
title: "Reset to default",
|
|
74
|
-
children: /* @__PURE__ */ r(
|
|
74
|
+
children: /* @__PURE__ */ r(q, { className: "h-3 w-3" })
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] })
|
|
78
78
|
}
|
|
79
79
|
) });
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
return
|
|
81
|
+
function ne(l) {
|
|
82
|
+
const t = l.data;
|
|
83
|
+
return t ? /* @__PURE__ */ r("div", { className: "flex items-center h-full", children: /* @__PURE__ */ r("span", { className: "text-xs text-content-muted capitalize", children: t.scope }) }) : null;
|
|
84
84
|
}
|
|
85
85
|
function le({
|
|
86
|
-
className:
|
|
87
|
-
scopes:
|
|
88
|
-
sources:
|
|
86
|
+
className: l,
|
|
87
|
+
scopes: t,
|
|
88
|
+
sources: u,
|
|
89
89
|
renderStatus: o,
|
|
90
|
-
recordingLabel:
|
|
91
|
-
pressShortcutLabel:
|
|
92
|
-
addShortcutLabel:
|
|
93
|
-
conflictWarnLabel:
|
|
90
|
+
recordingLabel: ae,
|
|
91
|
+
pressShortcutLabel: y,
|
|
92
|
+
addShortcutLabel: v,
|
|
93
|
+
conflictWarnLabel: w = "Conflicts with other shortcuts",
|
|
94
94
|
reservedWarnLabel: b = "This shortcut is reserved by the browser",
|
|
95
|
-
recordingInstruction:
|
|
96
|
-
...
|
|
95
|
+
recordingInstruction: L = "Recording: Press shortcut or Esc",
|
|
96
|
+
...se
|
|
97
97
|
}) {
|
|
98
98
|
const {
|
|
99
|
-
getSettingsCommands:
|
|
100
|
-
getEffectiveKeybinding:
|
|
101
|
-
updateKeybinding:
|
|
102
|
-
resetKeybinding:
|
|
103
|
-
version:
|
|
104
|
-
} =
|
|
105
|
-
let
|
|
106
|
-
return
|
|
107
|
-
const
|
|
99
|
+
getSettingsCommands: C,
|
|
100
|
+
getEffectiveKeybinding: S,
|
|
101
|
+
updateKeybinding: N,
|
|
102
|
+
resetKeybinding: R,
|
|
103
|
+
version: O
|
|
104
|
+
} = X(), [c, f] = i.useState(null), [d, a] = i.useState(null), x = i.useMemo(() => {
|
|
105
|
+
let n = C();
|
|
106
|
+
return n = n.filter((e) => {
|
|
107
|
+
const s = e.source ?? "user";
|
|
108
|
+
return s === "user" || s === "ag-grid";
|
|
109
|
+
}), t && (n = n.filter((e) => t.includes(e.scope))), u && (n = n.filter((e) => e.source && u.includes(e.source))), n.map((e) => {
|
|
110
|
+
const s = S(e.id), g = e.source ?? "user", D = m[g] ?? g ?? "User", T = D.toLowerCase() === "user";
|
|
108
111
|
return {
|
|
109
|
-
id:
|
|
110
|
-
command:
|
|
111
|
-
description:
|
|
112
|
-
category:
|
|
113
|
-
keybinding:
|
|
114
|
-
keybindingDisplay:
|
|
115
|
-
scope:
|
|
116
|
-
source:
|
|
117
|
-
sourceColor:
|
|
118
|
-
sourceIcon:
|
|
119
|
-
customisable:
|
|
120
|
-
passive:
|
|
121
|
-
hasOverride:
|
|
122
|
-
_def:
|
|
112
|
+
id: e.id,
|
|
113
|
+
command: e.label,
|
|
114
|
+
description: e.description || "",
|
|
115
|
+
category: e.category || "General",
|
|
116
|
+
keybinding: s,
|
|
117
|
+
keybindingDisplay: s ? Y(s) : "",
|
|
118
|
+
scope: e.scope,
|
|
119
|
+
source: D,
|
|
120
|
+
sourceColor: T ? "primary" : "neutral",
|
|
121
|
+
sourceIcon: T ? /* @__PURE__ */ r(z, { className: "h-3 w-3" }) : /* @__PURE__ */ r(G, { className: "h-3 w-3" }),
|
|
122
|
+
customisable: e.customisable !== !1,
|
|
123
|
+
passive: e.passive === !0,
|
|
124
|
+
hasOverride: e.keybinding !== void 0,
|
|
125
|
+
_def: e
|
|
123
126
|
};
|
|
124
127
|
});
|
|
125
|
-
}, [
|
|
126
|
-
f(
|
|
127
|
-
}, []),
|
|
128
|
-
|
|
129
|
-
}, [
|
|
128
|
+
}, [O, t, u, C, S]), k = i.useCallback((n) => {
|
|
129
|
+
f(n), a(null);
|
|
130
|
+
}, []), M = i.useCallback((n) => {
|
|
131
|
+
R(n), a(null);
|
|
132
|
+
}, [R]);
|
|
130
133
|
i.useEffect(() => {
|
|
131
134
|
if (!c) return;
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
f(null),
|
|
135
|
+
const n = (e) => {
|
|
136
|
+
if (e.preventDefault(), e.stopPropagation(), e.key === "Escape") {
|
|
137
|
+
f(null), a(null);
|
|
135
138
|
return;
|
|
136
139
|
}
|
|
137
|
-
const
|
|
138
|
-
if (!
|
|
139
|
-
if (
|
|
140
|
-
|
|
140
|
+
const s = Z(e);
|
|
141
|
+
if (!s) return;
|
|
142
|
+
if (W(s)) {
|
|
143
|
+
a({ type: "reserved", text: b }), f(null), setTimeout(() => a(null), 3e3);
|
|
141
144
|
return;
|
|
142
145
|
}
|
|
143
|
-
const g =
|
|
144
|
-
g.success ? (f(null),
|
|
146
|
+
const g = N(c, s);
|
|
147
|
+
g.success ? (f(null), a(null)) : g.conflict ? (a({
|
|
145
148
|
type: "conflict",
|
|
146
|
-
text:
|
|
147
|
-
}), f(null), setTimeout(() =>
|
|
149
|
+
text: w
|
|
150
|
+
}), f(null), setTimeout(() => a(null), 3e3)) : g.reserved && (a({ type: "reserved", text: b }), f(null), setTimeout(() => a(null), 3e3));
|
|
148
151
|
};
|
|
149
|
-
return window.addEventListener("keydown",
|
|
150
|
-
}, [c,
|
|
151
|
-
const _ = i.useMemo(() => [
|
|
152
|
+
return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
|
|
153
|
+
}, [c, N, b, w]);
|
|
154
|
+
const E = i.useMemo(() => Array.from(new Set(x.map((e) => e.category))).sort().map((e) => ({ label: e, value: e })), [x]), _ = i.useMemo(() => [
|
|
152
155
|
{
|
|
153
156
|
field: "command",
|
|
154
157
|
headerName: "Command",
|
|
155
158
|
flex: 1,
|
|
156
159
|
minWidth: 200,
|
|
157
160
|
filter: "agTextColumnFilter",
|
|
158
|
-
cellRenderer:
|
|
159
|
-
filterValueGetter: (
|
|
160
|
-
const
|
|
161
|
-
return
|
|
161
|
+
cellRenderer: te,
|
|
162
|
+
filterValueGetter: (n) => {
|
|
163
|
+
const e = n.data;
|
|
164
|
+
return e ? `${e.command} ${e.description}` : "";
|
|
162
165
|
}
|
|
163
166
|
},
|
|
164
167
|
{
|
|
165
168
|
field: "category",
|
|
166
169
|
headerName: "Category",
|
|
167
170
|
width: 140,
|
|
168
|
-
filter: "agSetColumnFilter"
|
|
171
|
+
filter: "agSetColumnFilter",
|
|
172
|
+
headerComponentParams: {
|
|
173
|
+
isSearchable: !0,
|
|
174
|
+
advanceSearchEnabled: !0,
|
|
175
|
+
selectOptions: E,
|
|
176
|
+
isMultiSelect: !0
|
|
177
|
+
}
|
|
169
178
|
},
|
|
170
179
|
{
|
|
171
180
|
field: "keybindingDisplay",
|
|
@@ -173,14 +182,14 @@ function le({
|
|
|
173
182
|
width: 180,
|
|
174
183
|
type: "rightAligned",
|
|
175
184
|
filter: "agTextColumnFilter",
|
|
176
|
-
cellRenderer:
|
|
177
|
-
cellClass:
|
|
185
|
+
cellRenderer: re,
|
|
186
|
+
cellClass: A,
|
|
178
187
|
cellRendererParams: {
|
|
179
188
|
recordingCommandId: c,
|
|
180
|
-
onStartRecording:
|
|
181
|
-
onReset:
|
|
182
|
-
recordingLabel:
|
|
183
|
-
addShortcutLabel:
|
|
189
|
+
onStartRecording: k,
|
|
190
|
+
onReset: M,
|
|
191
|
+
recordingLabel: y,
|
|
192
|
+
addShortcutLabel: v
|
|
184
193
|
},
|
|
185
194
|
sortable: !0
|
|
186
195
|
},
|
|
@@ -189,7 +198,7 @@ function le({
|
|
|
189
198
|
headerName: "Scope",
|
|
190
199
|
width: 100,
|
|
191
200
|
filter: "agSetColumnFilter",
|
|
192
|
-
cellRenderer:
|
|
201
|
+
cellRenderer: ne,
|
|
193
202
|
headerComponentParams: {
|
|
194
203
|
isSearchable: !0,
|
|
195
204
|
advanceSearchEnabled: !0,
|
|
@@ -207,8 +216,8 @@ function le({
|
|
|
207
216
|
headerName: "Source",
|
|
208
217
|
width: 130,
|
|
209
218
|
filter: "agSetColumnFilter",
|
|
210
|
-
cellClass:
|
|
211
|
-
cellRenderer:
|
|
219
|
+
cellClass: A,
|
|
220
|
+
cellRenderer: ee,
|
|
212
221
|
cellRendererParams: {
|
|
213
222
|
variant: "subtle",
|
|
214
223
|
colorField: "sourceColor",
|
|
@@ -220,24 +229,22 @@ function le({
|
|
|
220
229
|
isSearchable: !0,
|
|
221
230
|
advanceSearchEnabled: !0,
|
|
222
231
|
selectOptions: [
|
|
223
|
-
{ label:
|
|
224
|
-
{ label:
|
|
225
|
-
{ label: a["ag-grid"], value: a["ag-grid"] },
|
|
226
|
-
{ label: a.browser, value: a.browser }
|
|
232
|
+
{ label: m.user, value: m.user },
|
|
233
|
+
{ label: m["ag-grid"], value: m["ag-grid"] }
|
|
227
234
|
],
|
|
228
235
|
isMultiSelect: !0
|
|
229
236
|
}
|
|
230
237
|
}
|
|
231
|
-
], [c,
|
|
238
|
+
], [c, k, M, y, v, E]), I = i.useMemo(() => ({
|
|
232
239
|
filter: {
|
|
233
240
|
filterModel: {
|
|
234
241
|
source: {
|
|
235
242
|
filterType: "set",
|
|
236
|
-
values: [
|
|
243
|
+
values: [m.user, m["ag-grid"]]
|
|
237
244
|
}
|
|
238
245
|
}
|
|
239
246
|
}
|
|
240
|
-
}), []),
|
|
247
|
+
}), []), K = i.useMemo(() => ({
|
|
241
248
|
sortable: !0,
|
|
242
249
|
resizable: !0,
|
|
243
250
|
filter: !0,
|
|
@@ -245,27 +252,27 @@ function le({
|
|
|
245
252
|
isSearchable: !0,
|
|
246
253
|
advanceSearchEnabled: !0
|
|
247
254
|
}
|
|
248
|
-
}), []),
|
|
255
|
+
}), []), P = d || c ? /* @__PURE__ */ h("div", { className: p(
|
|
249
256
|
"px-3 py-1.5 text-[10px] md:text-sm font-medium rounded-md whitespace-nowrap flex items-center gap-2",
|
|
250
|
-
|
|
257
|
+
d?.type === "conflict" ? "bg-feedback-warning-surface text-content" : d?.type === "reserved" ? "bg-feedback-error-surface text-destructive" : c ? "bg-feedback-info-surface text-brand animate-[pulse_1.5s_ease-in-out_infinite]" : ""
|
|
251
258
|
), children: [
|
|
252
|
-
|
|
253
|
-
/* @__PURE__ */ r("span", { children:
|
|
259
|
+
d?.type === "conflict" ? /* @__PURE__ */ r(U, { className: "h-3.5 w-3.5 shrink-0" }) : d?.type === "reserved" ? /* @__PURE__ */ r(F, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
260
|
+
/* @__PURE__ */ r("span", { children: d ? d.text : L })
|
|
254
261
|
] }) : null;
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
o ? o(
|
|
262
|
+
return /* @__PURE__ */ h(V, { className: p("flex flex-col w-full h-full border-t-0", l), children: [
|
|
263
|
+
o ? o(P) : P,
|
|
257
264
|
/* @__PURE__ */ r(
|
|
258
|
-
|
|
265
|
+
J,
|
|
259
266
|
{
|
|
260
|
-
rowData:
|
|
267
|
+
rowData: x,
|
|
261
268
|
columnDefs: _,
|
|
262
|
-
defaultColDef:
|
|
269
|
+
defaultColDef: K,
|
|
263
270
|
initialState: I,
|
|
264
271
|
rowHeight: 44,
|
|
265
272
|
animateRows: !1,
|
|
266
273
|
rowSelection: "single",
|
|
267
274
|
suppressCellFocus: !0,
|
|
268
|
-
getRowId: (
|
|
275
|
+
getRowId: (n) => n.data.id,
|
|
269
276
|
suppressRowClickSelection: !0,
|
|
270
277
|
domLayout: "normal"
|
|
271
278
|
}
|