impact-nova 1.5.13 → 1.5.14
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 +2 -3
- package/dist/components/ui/command-palette/command-palette.d.ts +5 -2
- package/dist/components/ui/command-palette/command-palette.js +242 -225
- package/dist/components/ui/command-palette/shortcut-settings.js +69 -58
- package/dist/components/ui/sidebar.js +145 -152
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { jsx as r, jsxs as g, Fragment as U } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { User as _, Monitor as K, AlertTriangle as
|
|
3
|
+
import { User as _, Monitor as K, AlertTriangle as O, Lock as G, RotateCcw as j } from "lucide-react";
|
|
4
4
|
import { cn as h } from "../../../lib/utils.js";
|
|
5
|
-
import { ModuleRegistry as
|
|
5
|
+
import { ModuleRegistry as z, AllCommunityModule as B } from "ag-grid-community";
|
|
6
6
|
import { AllEnterpriseModule as $ } from "ag-grid-enterprise";
|
|
7
7
|
import { DataTable as H, DataTableContent as V } from "../data-table/data-table.js";
|
|
8
|
-
import { AG_CELL_NO_PADDING as
|
|
8
|
+
import { AG_CELL_NO_PADDING as P } from "../ag-grid-react/cell-renderers/index.js";
|
|
9
9
|
import { Kbd as q } from "./kbd.js";
|
|
10
10
|
import { useCommandPalette as J } from "./command-palette-context.js";
|
|
11
11
|
import { keybindingToString as Q, keybindingFromEvent as X, isReservedShortcut as Y } from "./utils.js";
|
|
12
12
|
import { BadgeCellRenderer as Z } from "../ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
13
|
-
|
|
13
|
+
z.registerModules([B, $]);
|
|
14
14
|
const W = {
|
|
15
15
|
system: "System",
|
|
16
16
|
user: "User",
|
|
17
17
|
"ag-grid": "AG Grid",
|
|
18
18
|
browser: "Browser"
|
|
19
19
|
};
|
|
20
|
-
function ee(
|
|
21
|
-
const e =
|
|
20
|
+
function ee(s) {
|
|
21
|
+
const e = s.data;
|
|
22
22
|
return e ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
23
23
|
!e.customisable && /* @__PURE__ */ r(G, { className: "h-3 w-3 text-[#9ca3af] shrink-0" }),
|
|
24
24
|
/* @__PURE__ */ g("div", { className: "flex flex-col min-w-0 gap-0", children: [
|
|
@@ -27,10 +27,10 @@ function ee(i) {
|
|
|
27
27
|
] })
|
|
28
28
|
] }) : null;
|
|
29
29
|
}
|
|
30
|
-
function te(
|
|
31
|
-
const e =
|
|
30
|
+
function te(s) {
|
|
31
|
+
const e = s.data;
|
|
32
32
|
if (!e) return null;
|
|
33
|
-
const c =
|
|
33
|
+
const c = s.recordingCommandId === e.id;
|
|
34
34
|
return /* @__PURE__ */ r("div", { className: h(
|
|
35
35
|
"w-full h-full flex items-center ag-cell-inner-padding",
|
|
36
36
|
e.customisable ? "in-ag-editable-cell-highlight" : ""
|
|
@@ -42,13 +42,13 @@ function te(i) {
|
|
|
42
42
|
e.customisable ? "bg-white" : "bg-transparent",
|
|
43
43
|
c && "ring-1 ring-[#4259ee] border border-[#4259ee]"
|
|
44
44
|
),
|
|
45
|
-
children: c ? /* @__PURE__ */ r("span", { className: "text-xs text-[#4259ee] font-medium animate-pulse", children:
|
|
45
|
+
children: c ? /* @__PURE__ */ r("span", { className: "text-xs text-[#4259ee] font-medium animate-pulse", children: s.recordingLabel ?? "Press desired shortcut..." }) : /* @__PURE__ */ g(U, { children: [
|
|
46
46
|
e.keybinding ? /* @__PURE__ */ r(
|
|
47
47
|
"button",
|
|
48
48
|
{
|
|
49
49
|
type: "button",
|
|
50
50
|
onClick: (a) => {
|
|
51
|
-
a.stopPropagation(), e.customisable &&
|
|
51
|
+
a.stopPropagation(), e.customisable && s.onStartRecording(e.id);
|
|
52
52
|
},
|
|
53
53
|
disabled: !e.customisable,
|
|
54
54
|
className: h(
|
|
@@ -62,10 +62,10 @@ function te(i) {
|
|
|
62
62
|
{
|
|
63
63
|
type: "button",
|
|
64
64
|
onClick: (a) => {
|
|
65
|
-
a.stopPropagation(),
|
|
65
|
+
a.stopPropagation(), s.onStartRecording(e.id);
|
|
66
66
|
},
|
|
67
67
|
className: "flex items-center justify-end h-full w-full text-xs text-[#9ca3af] hover:text-[#4259ee] transition-colors cursor-pointer text-right",
|
|
68
|
-
children:
|
|
68
|
+
children: s.addShortcutLabel ?? "Add shortcut"
|
|
69
69
|
}
|
|
70
70
|
) : /* @__PURE__ */ r("span", { className: "text-xs text-transparent", children: "--" }),
|
|
71
71
|
e.hasOverride && e.customisable && !c && /* @__PURE__ */ r(
|
|
@@ -73,33 +73,33 @@ function te(i) {
|
|
|
73
73
|
{
|
|
74
74
|
type: "button",
|
|
75
75
|
onClick: (a) => {
|
|
76
|
-
a.stopPropagation(),
|
|
76
|
+
a.stopPropagation(), s.onReset(e.id);
|
|
77
77
|
},
|
|
78
78
|
className: "absolute right-1 p-0.5 rounded bg-white hover:bg-[#f3f4f6] hover:text-[#ef4444] cursor-pointer opacity-0 group-hover/row:opacity-100 transition-opacity z-10",
|
|
79
79
|
title: "Reset to default",
|
|
80
|
-
children: /* @__PURE__ */ r(
|
|
80
|
+
children: /* @__PURE__ */ r(j, { className: "h-3 w-3" })
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
] })
|
|
84
84
|
}
|
|
85
85
|
) });
|
|
86
86
|
}
|
|
87
|
-
function re(
|
|
88
|
-
const e =
|
|
87
|
+
function re(s) {
|
|
88
|
+
const e = s.data;
|
|
89
89
|
return e ? /* @__PURE__ */ r("div", { className: "flex items-center h-full", children: /* @__PURE__ */ r("span", { className: "text-xs text-[#6b7280] capitalize", children: e.scope }) }) : null;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
className:
|
|
91
|
+
function le({
|
|
92
|
+
className: s,
|
|
93
93
|
scopes: e,
|
|
94
94
|
sources: c,
|
|
95
95
|
renderStatus: a,
|
|
96
|
-
recordingLabel:
|
|
96
|
+
recordingLabel: se,
|
|
97
97
|
pressShortcutLabel: b,
|
|
98
98
|
addShortcutLabel: x,
|
|
99
99
|
conflictWarnLabel: y = "Conflicts with other shortcuts",
|
|
100
100
|
reservedWarnLabel: p = "This shortcut is reserved by the browser",
|
|
101
|
-
recordingInstruction:
|
|
102
|
-
...
|
|
101
|
+
recordingInstruction: A = "Recording: Press shortcut or Esc",
|
|
102
|
+
...ie
|
|
103
103
|
}) {
|
|
104
104
|
const {
|
|
105
105
|
getSettingsCommands: w,
|
|
@@ -107,52 +107,52 @@ function se({
|
|
|
107
107
|
updateKeybinding: v,
|
|
108
108
|
resetKeybinding: S,
|
|
109
109
|
version: D
|
|
110
|
-
} = J(), [o, m] = n.useState(null), [
|
|
111
|
-
let
|
|
112
|
-
return e && (
|
|
113
|
-
const
|
|
110
|
+
} = J(), [o, m] = n.useState(null), [u, i] = n.useState(null), T = n.useMemo(() => {
|
|
111
|
+
let l = w();
|
|
112
|
+
return e && (l = l.filter((t) => e.includes(t.scope))), c && (l = l.filter((t) => t.source && c.includes(t.source))), l.map((t) => {
|
|
113
|
+
const d = C(t.id), f = t.source ?? "user", M = W[f] ?? t.source ?? "User", E = M.toLowerCase() === "user";
|
|
114
114
|
return {
|
|
115
115
|
id: t.id,
|
|
116
116
|
command: t.label,
|
|
117
117
|
description: t.description || "",
|
|
118
118
|
category: t.category || "General",
|
|
119
|
-
keybinding:
|
|
120
|
-
keybindingDisplay:
|
|
119
|
+
keybinding: d,
|
|
120
|
+
keybindingDisplay: d ? Q(d) : "",
|
|
121
121
|
scope: t.scope,
|
|
122
|
-
source:
|
|
123
|
-
sourceColor:
|
|
124
|
-
sourceIcon:
|
|
122
|
+
source: M,
|
|
123
|
+
sourceColor: E ? "primary" : "neutral",
|
|
124
|
+
sourceIcon: E ? /* @__PURE__ */ r(_, { className: "h-3 w-3" }) : /* @__PURE__ */ r(K, { className: "h-3 w-3" }),
|
|
125
125
|
customisable: t.customisable !== !1,
|
|
126
126
|
passive: t.passive === !0,
|
|
127
127
|
hasOverride: t.keybinding !== void 0,
|
|
128
128
|
_def: t
|
|
129
129
|
};
|
|
130
130
|
});
|
|
131
|
-
}, [D, e, c, w, C]), N = n.useCallback((
|
|
132
|
-
m(
|
|
133
|
-
}, []), R = n.useCallback((
|
|
134
|
-
S(
|
|
131
|
+
}, [D, e, c, w, C]), N = n.useCallback((l) => {
|
|
132
|
+
m(l), i(null);
|
|
133
|
+
}, []), R = n.useCallback((l) => {
|
|
134
|
+
S(l), i(null);
|
|
135
135
|
}, [S]);
|
|
136
136
|
n.useEffect(() => {
|
|
137
137
|
if (!o) return;
|
|
138
|
-
const
|
|
138
|
+
const l = (t) => {
|
|
139
139
|
if (t.preventDefault(), t.stopPropagation(), t.key === "Escape") {
|
|
140
|
-
m(null),
|
|
140
|
+
m(null), i(null);
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
if (!
|
|
145
|
-
if (Y(
|
|
146
|
-
|
|
143
|
+
const d = X(t);
|
|
144
|
+
if (!d) return;
|
|
145
|
+
if (Y(d)) {
|
|
146
|
+
i({ type: "reserved", text: p }), m(null), setTimeout(() => i(null), 3e3);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
const f = v(o,
|
|
150
|
-
f.success ? (m(null),
|
|
149
|
+
const f = v(o, d);
|
|
150
|
+
f.success ? (m(null), i(null)) : f.conflict ? (i({
|
|
151
151
|
type: "conflict",
|
|
152
152
|
text: y
|
|
153
|
-
}), m(null), setTimeout(() =>
|
|
153
|
+
}), m(null), setTimeout(() => i(null), 3e3)) : f.reserved && (i({ type: "reserved", text: p }), m(null), setTimeout(() => i(null), 3e3));
|
|
154
154
|
};
|
|
155
|
-
return window.addEventListener("keydown",
|
|
155
|
+
return window.addEventListener("keydown", l, !0), () => window.removeEventListener("keydown", l, !0);
|
|
156
156
|
}, [o, v, p, y]);
|
|
157
157
|
const F = n.useMemo(() => [
|
|
158
158
|
{
|
|
@@ -162,8 +162,8 @@ function se({
|
|
|
162
162
|
minWidth: 200,
|
|
163
163
|
filter: "agTextColumnFilter",
|
|
164
164
|
cellRenderer: ee,
|
|
165
|
-
filterValueGetter: (
|
|
166
|
-
const t =
|
|
165
|
+
filterValueGetter: (l) => {
|
|
166
|
+
const t = l.data;
|
|
167
167
|
return t ? `${t.command} ${t.description}` : "";
|
|
168
168
|
}
|
|
169
169
|
},
|
|
@@ -180,7 +180,7 @@ function se({
|
|
|
180
180
|
type: "rightAligned",
|
|
181
181
|
filter: "agTextColumnFilter",
|
|
182
182
|
cellRenderer: te,
|
|
183
|
-
cellClass:
|
|
183
|
+
cellClass: P,
|
|
184
184
|
cellRendererParams: {
|
|
185
185
|
recordingCommandId: o,
|
|
186
186
|
onStartRecording: N,
|
|
@@ -195,14 +195,25 @@ function se({
|
|
|
195
195
|
headerName: "Scope",
|
|
196
196
|
width: 100,
|
|
197
197
|
filter: "agSetColumnFilter",
|
|
198
|
-
cellRenderer: re
|
|
198
|
+
cellRenderer: re,
|
|
199
|
+
headerComponentParams: {
|
|
200
|
+
isSearchable: !0,
|
|
201
|
+
advanceSearchEnabled: !0,
|
|
202
|
+
selectOptions: [
|
|
203
|
+
{ label: "Global", value: "global" },
|
|
204
|
+
{ label: "Module", value: "module" },
|
|
205
|
+
{ label: "Page", value: "page" },
|
|
206
|
+
{ label: "Modal", value: "modal" }
|
|
207
|
+
],
|
|
208
|
+
isMultiSelect: !0
|
|
209
|
+
}
|
|
199
210
|
},
|
|
200
211
|
{
|
|
201
212
|
field: "source",
|
|
202
213
|
headerName: "Source",
|
|
203
214
|
width: 130,
|
|
204
215
|
filter: "agSetColumnFilter",
|
|
205
|
-
cellClass:
|
|
216
|
+
cellClass: P,
|
|
206
217
|
cellRenderer: Z,
|
|
207
218
|
cellRendererParams: {
|
|
208
219
|
variant: "subtle",
|
|
@@ -240,14 +251,14 @@ function se({
|
|
|
240
251
|
isSearchable: !0,
|
|
241
252
|
advanceSearchEnabled: !0
|
|
242
253
|
}
|
|
243
|
-
}), []), k =
|
|
254
|
+
}), []), k = u || o ? /* @__PURE__ */ g("div", { className: h(
|
|
244
255
|
"px-3 py-1.5 text-[10px] md:text-sm font-medium rounded-md whitespace-nowrap flex items-center gap-2",
|
|
245
|
-
|
|
256
|
+
u?.type === "conflict" ? "bg-[#fef3c7] text-[#92400e]" : u?.type === "reserved" ? "bg-[#fee2e2] text-[#991b1b]" : o ? "bg-[#eff6ff] text-[#1e40af] animate-[pulse_1.5s_ease-in-out_infinite]" : ""
|
|
246
257
|
), children: [
|
|
247
|
-
|
|
248
|
-
/* @__PURE__ */ r("span", { children:
|
|
258
|
+
u?.type === "conflict" ? /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(G, { className: "h-3.5 w-3.5 shrink-0" }) : o ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
259
|
+
/* @__PURE__ */ r("span", { children: u ? u.text : A })
|
|
249
260
|
] }) : null;
|
|
250
|
-
return /* @__PURE__ */ g(H, { className: h("flex flex-col w-full h-full border-t-0",
|
|
261
|
+
return /* @__PURE__ */ g(H, { className: h("flex flex-col w-full h-full border-t-0", s), children: [
|
|
251
262
|
a ? a(k) : k,
|
|
252
263
|
/* @__PURE__ */ r(
|
|
253
264
|
V,
|
|
@@ -260,14 +271,14 @@ function se({
|
|
|
260
271
|
animateRows: !1,
|
|
261
272
|
rowSelection: "single",
|
|
262
273
|
suppressCellFocus: !0,
|
|
263
|
-
getRowId: (
|
|
274
|
+
getRowId: (l) => l.data.id,
|
|
264
275
|
suppressRowClickSelection: !0,
|
|
265
276
|
domLayout: "normal"
|
|
266
277
|
}
|
|
267
278
|
)
|
|
268
279
|
] });
|
|
269
280
|
}
|
|
270
|
-
|
|
281
|
+
le.displayName = "ShortcutSettings";
|
|
271
282
|
export {
|
|
272
|
-
|
|
283
|
+
le as ShortcutSettings
|
|
273
284
|
};
|