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.
@@ -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 j, Lock as G, RotateCcw as z } from "lucide-react";
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 B, AllCommunityModule as O } from "ag-grid-community";
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 A } from "../ag-grid-react/cell-renderers/index.js";
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
- B.registerModules([O, $]);
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(i) {
21
- const e = i.data;
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(i) {
31
- const e = i.data;
30
+ function te(s) {
31
+ const e = s.data;
32
32
  if (!e) return null;
33
- const c = i.recordingCommandId === e.id;
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: i.recordingLabel ?? "Press desired shortcut..." }) : /* @__PURE__ */ g(U, { 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 && i.onStartRecording(e.id);
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(), i.onStartRecording(e.id);
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: i.addShortcutLabel ?? "Add shortcut"
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(), i.onReset(e.id);
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(z, { className: "h-3 w-3" })
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(i) {
88
- const e = i.data;
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 se({
92
- className: i,
91
+ function le({
92
+ className: s,
93
93
  scopes: e,
94
94
  sources: c,
95
95
  renderStatus: a,
96
- recordingLabel: ie,
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: P = "Recording: Press shortcut or Esc",
102
- ...le
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), [d, l] = n.useState(null), T = n.useMemo(() => {
111
- let s = w();
112
- return e && (s = s.filter((t) => e.includes(t.scope))), c && (s = s.filter((t) => t.source && c.includes(t.source))), s.map((t) => {
113
- const u = C(t.id), f = t.source ?? "user", E = W[f] ?? t.source ?? "User", M = E.toLowerCase() === "user";
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: u,
120
- keybindingDisplay: u ? Q(u) : "",
119
+ keybinding: d,
120
+ keybindingDisplay: d ? Q(d) : "",
121
121
  scope: t.scope,
122
- source: E,
123
- sourceColor: M ? "primary" : "neutral",
124
- sourceIcon: M ? /* @__PURE__ */ r(_, { className: "h-3 w-3" }) : /* @__PURE__ */ r(K, { className: "h-3 w-3" }),
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((s) => {
132
- m(s), l(null);
133
- }, []), R = n.useCallback((s) => {
134
- S(s), l(null);
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 s = (t) => {
138
+ const l = (t) => {
139
139
  if (t.preventDefault(), t.stopPropagation(), t.key === "Escape") {
140
- m(null), l(null);
140
+ m(null), i(null);
141
141
  return;
142
142
  }
143
- const u = X(t);
144
- if (!u) return;
145
- if (Y(u)) {
146
- l({ type: "reserved", text: p }), m(null), setTimeout(() => l(null), 3e3);
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, u);
150
- f.success ? (m(null), l(null)) : f.conflict ? (l({
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(() => l(null), 3e3)) : f.reserved && (l({ type: "reserved", text: p }), m(null), setTimeout(() => l(null), 3e3));
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", s, !0), () => window.removeEventListener("keydown", s, !0);
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: (s) => {
166
- const t = s.data;
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: A,
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: A,
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 = d || o ? /* @__PURE__ */ g("div", { className: h(
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
- d?.type === "conflict" ? "bg-[#fef3c7] text-[#92400e]" : d?.type === "reserved" ? "bg-[#fee2e2] text-[#991b1b]" : o ? "bg-[#eff6ff] text-[#1e40af] animate-[pulse_1.5s_ease-in-out_infinite]" : ""
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
- d?.type === "conflict" ? /* @__PURE__ */ r(j, { className: "h-3.5 w-3.5 shrink-0" }) : d?.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,
248
- /* @__PURE__ */ r("span", { children: d ? d.text : P })
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", i), children: [
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: (s) => s.data.id,
274
+ getRowId: (l) => l.data.id,
264
275
  suppressRowClickSelection: !0,
265
276
  domLayout: "normal"
266
277
  }
267
278
  )
268
279
  ] });
269
280
  }
270
- se.displayName = "ShortcutSettings";
281
+ le.displayName = "ShortcutSettings";
271
282
  export {
272
- se as ShortcutSettings
283
+ le as ShortcutSettings
273
284
  };