impact-nova 1.5.6 → 1.5.7

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,158 +1,167 @@
1
- import { jsx as r, jsxs as h, Fragment as N } from "react/jsx-runtime";
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 L, Monitor as F, AlertTriangle as I, Lock as R, RotateCcw as U } from "lucide-react";
4
- import { cn as p } from "../../../lib/utils.js";
5
- import { ModuleRegistry as _, AllCommunityModule as K } from "ag-grid-community";
6
- import { AllEnterpriseModule as j } from "ag-grid-enterprise";
7
- import { DataTable as z, DataTableContent as B } from "../data-table/data-table.js";
8
- import { AG_CELL_NO_PADDING as S } from "../ag-grid-react/cell-renderers/index.js";
9
- import { Kbd as O } from "./kbd.js";
10
- import { useCommandPalette as $ } from "./command-palette-context.js";
11
- import { keybindingToString as H, keybindingFromEvent as V, isReservedShortcut as W } from "./utils.js";
12
- import { BadgeCellRenderer as q } from "../ag-grid-react/cell-renderers/badge-cell-renderer.js";
13
- _.registerModules([K, j]);
14
- const J = {
3
+ import { User as _, Monitor as K, AlertTriangle as j, Lock as G, RotateCcw as z } from "lucide-react";
4
+ import { cn as h } from "../../../lib/utils.js";
5
+ import { ModuleRegistry as B, AllCommunityModule as O } from "ag-grid-community";
6
+ import { AllEnterpriseModule as $ } from "ag-grid-enterprise";
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";
9
+ import { Kbd as q } from "./kbd.js";
10
+ import { useCommandPalette as J } from "./command-palette-context.js";
11
+ import { keybindingToString as Q, keybindingFromEvent as X, isReservedShortcut as Y } from "./utils.js";
12
+ import { BadgeCellRenderer as Z } from "../ag-grid-react/cell-renderers/badge-cell-renderer.js";
13
+ B.registerModules([O, $]);
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 Q(l) {
21
- const e = l.data;
22
- return e ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
23
- !e.customisable && /* @__PURE__ */ r(R, { className: "h-3 w-3 text-[#9ca3af] shrink-0" }),
24
- /* @__PURE__ */ h("div", { className: "flex flex-col min-w-0 gap-0", children: [
20
+ function ee(i) {
21
+ const e = i.data;
22
+ return e ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
23
+ !e.customisable && /* @__PURE__ */ r(G, { className: "h-3 w-3 text-[#9ca3af] shrink-0" }),
24
+ /* @__PURE__ */ g("div", { className: "flex flex-col min-w-0 gap-0", children: [
25
25
  /* @__PURE__ */ r("span", { className: "truncate font-medium text-[#374151] text-xs leading-tight", children: e.command }),
26
26
  e.description && /* @__PURE__ */ r("span", { className: "truncate text-[10px] text-[#9ca3af] leading-tight", children: e.description })
27
27
  ] })
28
28
  ] }) : null;
29
29
  }
30
- function X(l) {
31
- const e = l.data;
30
+ function te(i) {
31
+ const e = i.data;
32
32
  if (!e) return null;
33
- const c = l.recordingCommandId === e.id;
34
- return /* @__PURE__ */ r("div", { className: p(
33
+ const c = i.recordingCommandId === e.id;
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" : ""
37
37
  ), children: /* @__PURE__ */ r(
38
38
  "div",
39
39
  {
40
- className: p(
40
+ className: h(
41
41
  "flex items-center justify-between w-full h-7 rounded-[8px] px-1.5 group/row relative",
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: "Press desired shortcut..." }) : /* @__PURE__ */ h(N, { children: [
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: [
46
46
  e.keybinding ? /* @__PURE__ */ r(
47
47
  "button",
48
48
  {
49
+ type: "button",
49
50
  onClick: (a) => {
50
- a.stopPropagation(), e.customisable && l.onStartRecording(e.id);
51
+ a.stopPropagation(), e.customisable && i.onStartRecording(e.id);
51
52
  },
52
53
  disabled: !e.customisable,
53
- className: p(
54
+ className: h(
54
55
  "flex items-center justify-end h-full w-full text-right",
55
56
  e.customisable ? "cursor-pointer" : "cursor-default opacity-70"
56
57
  ),
57
- children: /* @__PURE__ */ r(O, { keybinding: e.keybinding, size: "sm" })
58
+ children: /* @__PURE__ */ r(q, { keybinding: e.keybinding, size: "sm" })
58
59
  }
59
60
  ) : e.customisable ? /* @__PURE__ */ r(
60
61
  "button",
61
62
  {
63
+ type: "button",
62
64
  onClick: (a) => {
63
- a.stopPropagation(), l.onStartRecording(e.id);
65
+ a.stopPropagation(), i.onStartRecording(e.id);
64
66
  },
65
67
  className: "flex items-center justify-end h-full w-full text-xs text-[#9ca3af] hover:text-[#4259ee] transition-colors cursor-pointer text-right",
66
- children: "Add shortcut"
68
+ children: i.addShortcutLabel ?? "Add shortcut"
67
69
  }
68
70
  ) : /* @__PURE__ */ r("span", { className: "text-xs text-transparent", children: "--" }),
69
71
  e.hasOverride && e.customisable && !c && /* @__PURE__ */ r(
70
72
  "button",
71
73
  {
74
+ type: "button",
72
75
  onClick: (a) => {
73
- a.stopPropagation(), l.onReset(e.id);
76
+ a.stopPropagation(), i.onReset(e.id);
74
77
  },
75
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",
76
79
  title: "Reset to default",
77
- children: /* @__PURE__ */ r(U, { className: "h-3 w-3" })
80
+ children: /* @__PURE__ */ r(z, { className: "h-3 w-3" })
78
81
  }
79
82
  )
80
83
  ] })
81
84
  }
82
85
  ) });
83
86
  }
84
- function Y(l) {
85
- const e = l.data;
87
+ function re(i) {
88
+ const e = i.data;
86
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;
87
90
  }
88
- function Z({
89
- className: l,
91
+ function se({
92
+ className: i,
90
93
  scopes: e,
91
94
  sources: c,
92
95
  renderStatus: a,
93
- ...k
96
+ recordingLabel: ie,
97
+ pressShortcutLabel: b,
98
+ addShortcutLabel: x,
99
+ conflictWarnLabel: y = "Conflicts with other shortcuts",
100
+ reservedWarnLabel: p = "This shortcut is reserved by the browser",
101
+ recordingInstruction: P = "Recording: Press shortcut or Esc",
102
+ ...le
94
103
  }) {
95
104
  const {
96
- getSettingsCommands: E,
97
- getEffectiveKeybinding: M,
98
- updateKeybinding: g,
99
- resetKeybinding: b,
100
- version: A
101
- } = $(), [o, f] = n.useState(null), [d, i] = n.useState(null), G = n.useMemo(() => {
102
- let s = E();
105
+ getSettingsCommands: w,
106
+ getEffectiveKeybinding: C,
107
+ updateKeybinding: v,
108
+ resetKeybinding: S,
109
+ version: D
110
+ } = J(), [o, m] = n.useState(null), [d, l] = n.useState(null), T = n.useMemo(() => {
111
+ let s = w();
103
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) => {
104
- const u = M(t.id), m = t.source ?? "user", C = J[m] ?? t.source ?? "User", v = C.toLowerCase() === "user";
113
+ const u = C(t.id), f = t.source ?? "user", E = W[f] ?? t.source ?? "User", M = E.toLowerCase() === "user";
105
114
  return {
106
115
  id: t.id,
107
116
  command: t.label,
108
117
  description: t.description || "",
109
118
  category: t.category || "General",
110
119
  keybinding: u,
111
- keybindingDisplay: u ? H(u) : "",
120
+ keybindingDisplay: u ? Q(u) : "",
112
121
  scope: t.scope,
113
- source: C,
114
- sourceColor: v ? "primary" : "neutral",
115
- sourceIcon: v ? /* @__PURE__ */ r(L, { className: "h-3 w-3" }) : /* @__PURE__ */ r(F, { className: "h-3 w-3" }),
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" }),
116
125
  customisable: t.customisable !== !1,
117
126
  passive: t.passive === !0,
118
127
  hasOverride: t.keybinding !== void 0,
119
128
  _def: t
120
129
  };
121
130
  });
122
- }, [A, e, c]), x = n.useCallback((s) => {
123
- f(s), i(null);
124
- }, []), y = n.useCallback((s) => {
125
- b(s), i(null);
126
- }, [b]);
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);
135
+ }, [S]);
127
136
  n.useEffect(() => {
128
137
  if (!o) return;
129
138
  const s = (t) => {
130
139
  if (t.preventDefault(), t.stopPropagation(), t.key === "Escape") {
131
- f(null), i(null);
140
+ m(null), l(null);
132
141
  return;
133
142
  }
134
- const u = V(t);
143
+ const u = X(t);
135
144
  if (!u) return;
136
- if (W(u)) {
137
- i({ type: "reserved", text: "This shortcut is reserved by the browser and cannot be used" }), f(null), setTimeout(() => i(null), 3e3);
145
+ if (Y(u)) {
146
+ l({ type: "reserved", text: p }), m(null), setTimeout(() => l(null), 3e3);
138
147
  return;
139
148
  }
140
- const m = g(o, u);
141
- m.success ? (f(null), i(null)) : m.conflict ? (i({
149
+ const f = v(o, u);
150
+ f.success ? (m(null), l(null)) : f.conflict ? (l({
142
151
  type: "conflict",
143
- text: `Conflicts with "${m.conflict.conflictingLabel}" in ${m.conflict.scope} scope`
144
- }), f(null), setTimeout(() => i(null), 3e3)) : m.reserved && (i({ type: "reserved", text: "This shortcut is reserved by the browser" }), f(null), setTimeout(() => i(null), 3e3));
152
+ text: y
153
+ }), m(null), setTimeout(() => l(null), 3e3)) : f.reserved && (l({ type: "reserved", text: p }), m(null), setTimeout(() => l(null), 3e3));
145
154
  };
146
155
  return window.addEventListener("keydown", s, !0), () => window.removeEventListener("keydown", s, !0);
147
- }, [o, g]);
148
- const P = n.useMemo(() => [
156
+ }, [o, v, p, y]);
157
+ const F = n.useMemo(() => [
149
158
  {
150
159
  field: "command",
151
160
  headerName: "Command",
152
161
  flex: 1,
153
162
  minWidth: 200,
154
163
  filter: "agTextColumnFilter",
155
- cellRenderer: Q,
164
+ cellRenderer: ee,
156
165
  filterValueGetter: (s) => {
157
166
  const t = s.data;
158
167
  return t ? `${t.command} ${t.description}` : "";
@@ -170,12 +179,14 @@ function Z({
170
179
  width: 180,
171
180
  type: "rightAligned",
172
181
  filter: "agTextColumnFilter",
173
- cellRenderer: X,
174
- cellClass: S,
182
+ cellRenderer: te,
183
+ cellClass: A,
175
184
  cellRendererParams: {
176
185
  recordingCommandId: o,
177
- onStartRecording: x,
178
- onReset: y
186
+ onStartRecording: N,
187
+ onReset: R,
188
+ recordingLabel: b,
189
+ addShortcutLabel: x
179
190
  },
180
191
  sortable: !0
181
192
  },
@@ -184,15 +195,15 @@ function Z({
184
195
  headerName: "Scope",
185
196
  width: 100,
186
197
  filter: "agSetColumnFilter",
187
- cellRenderer: Y
198
+ cellRenderer: re
188
199
  },
189
200
  {
190
201
  field: "source",
191
202
  headerName: "Source",
192
203
  width: 130,
193
204
  filter: "agSetColumnFilter",
194
- cellClass: S,
195
- cellRenderer: q,
205
+ cellClass: A,
206
+ cellRenderer: Z,
196
207
  cellRendererParams: {
197
208
  variant: "subtle",
198
209
  colorField: "sourceColor",
@@ -212,16 +223,16 @@ function Z({
212
223
  isMultiSelect: !0
213
224
  }
214
225
  }
215
- ], [o, x, y]), T = n.useMemo(() => ({
226
+ ], [o, N, R, b, x]), L = n.useMemo(() => ({
216
227
  filter: {
217
228
  filterModel: {
218
229
  source: {
219
230
  filterType: "set",
220
- values: ["System", "User", "AG Grid"]
231
+ values: ["User", "AG Grid"]
221
232
  }
222
233
  }
223
234
  }
224
- }), []), D = n.useMemo(() => ({
235
+ }), []), I = n.useMemo(() => ({
225
236
  sortable: !0,
226
237
  resizable: !0,
227
238
  filter: !0,
@@ -229,26 +240,22 @@ function Z({
229
240
  isSearchable: !0,
230
241
  advanceSearchEnabled: !0
231
242
  }
232
- }), []), w = d || o ? /* @__PURE__ */ h("div", { className: p(
243
+ }), []), k = d || o ? /* @__PURE__ */ g("div", { className: h(
233
244
  "px-3 py-1.5 text-[10px] md:text-sm font-medium rounded-md whitespace-nowrap flex items-center gap-2",
234
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]" : ""
235
246
  ), children: [
236
- d?.type === "conflict" ? /* @__PURE__ */ r(I, { className: "h-3.5 w-3.5 shrink-0" }) : d?.type === "reserved" ? /* @__PURE__ */ r(R, { className: "h-3.5 w-3.5 shrink-0" }) : o ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
237
- /* @__PURE__ */ r("span", { children: d ? d.text : /* @__PURE__ */ h(N, { children: [
238
- /* @__PURE__ */ r("strong", { children: "Recording:" }),
239
- " Press shortcut or ",
240
- /* @__PURE__ */ r("strong", { children: "Esc" })
241
- ] }) })
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 })
242
249
  ] }) : null;
243
- return /* @__PURE__ */ h(z, { className: p("flex flex-col w-full h-full border-t-0", l), ...k, children: [
244
- a ? a(w) : w,
250
+ return /* @__PURE__ */ g(H, { className: h("flex flex-col w-full h-full border-t-0", i), children: [
251
+ a ? a(k) : k,
245
252
  /* @__PURE__ */ r(
246
- B,
253
+ V,
247
254
  {
248
- rowData: G,
249
- columnDefs: P,
250
- defaultColDef: D,
251
- initialState: T,
255
+ rowData: T,
256
+ columnDefs: F,
257
+ defaultColDef: I,
258
+ initialState: L,
252
259
  rowHeight: 44,
253
260
  animateRows: !1,
254
261
  rowSelection: "single",
@@ -260,7 +267,7 @@ function Z({
260
267
  )
261
268
  ] });
262
269
  }
263
- Z.displayName = "ShortcutSettings";
270
+ se.displayName = "ShortcutSettings";
264
271
  export {
265
- Z as ShortcutSettings
272
+ se as ShortcutSettings
266
273
  };
@@ -1,3 +1,3 @@
1
1
  import { FilterStripProps } from '../types/filter-strip.types';
2
- declare const FilterStrip: ({ filters, onFilterRemove, onAllFiltersClick, savedFilters, recentFilters, onApplySavedFilter, onSavedFilterSearch, onSavedFiltersScroll, onViewAll, selectedFilter, onSelectedFilterChange, onDropdownOpenChange, isLoadingFilterPreferencesList, isLoading, className, }: FilterStripProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const FilterStrip: ({ filters, onFilterRemove, onAllFiltersClick, savedFilters, recentFilters, onApplySavedFilter, onSavedFilterSearch, onSavedFiltersScroll, onViewAll, onOverflowClick, selectedFilter, onSelectedFilterChange, onDropdownOpenChange, isLoadingFilterPreferencesList, isLoading, className, }: FilterStripProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export { FilterStrip };
@@ -1,12 +1,12 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { ListFilter as k } from "lucide-react";
2
+ import { ListFilter as u } from "lucide-react";
3
3
  import { cn as a } from "../../../lib/utils.js";
4
- import { Button as u } from "../button.js";
4
+ import { Button as b } from "../button.js";
5
5
  import { Skeleton as t } from "../skeleton.js";
6
- import { FilterSummary as b } from "./filter-summary.js";
7
- import { FilterTagList as F } from "./filter-tag-list.js";
8
- import { useImpactNovaI18n as S } from "../../../i18n/ImpactNovaI18nContext.js";
9
- const T = ({
6
+ import { FilterSummary as F } from "./filter-summary.js";
7
+ import { FilterTagList as S } from "./filter-tag-list.js";
8
+ import { useImpactNovaI18n as y } from "../../../i18n/ImpactNovaI18nContext.js";
9
+ const q = ({
10
10
  filters: l,
11
11
  onFilterRemove: m,
12
12
  onAllFiltersClick: n,
@@ -16,15 +16,16 @@ const T = ({
16
16
  onSavedFilterSearch: f,
17
17
  onSavedFiltersScroll: h,
18
18
  onViewAll: d,
19
- selectedFilter: w,
20
- onSelectedFilterChange: x,
21
- onDropdownOpenChange: N,
22
- isLoadingFilterPreferencesList: g,
23
- isLoading: v,
19
+ onOverflowClick: w,
20
+ selectedFilter: x,
21
+ onSelectedFilterChange: N,
22
+ onDropdownOpenChange: g,
23
+ isLoadingFilterPreferencesList: v,
24
+ isLoading: k,
24
25
  className: r
25
26
  }) => {
26
- const { t: s } = S();
27
- return v ? /* @__PURE__ */ e(
27
+ const { t: s } = y();
28
+ return k ? /* @__PURE__ */ e(
28
29
  "div",
29
30
  {
30
31
  "data-component": "filter-strip",
@@ -59,37 +60,38 @@ const T = ({
59
60
  ),
60
61
  children: [
61
62
  /* @__PURE__ */ e(
62
- b,
63
+ F,
63
64
  {
64
- selectedFilter: w,
65
- onSelectedFilterChange: x,
65
+ selectedFilter: x,
66
+ onSelectedFilterChange: N,
66
67
  savedFilters: p,
67
68
  recentFilters: c,
68
69
  onApplySavedFilter: o,
69
70
  onSavedFilterSearch: f,
70
71
  onSavedFiltersScroll: h,
71
- onDropdownOpenChange: N,
72
- isLoadingFilterPreferencesList: g
72
+ onDropdownOpenChange: g,
73
+ isLoadingFilterPreferencesList: v
73
74
  }
74
75
  ),
75
76
  /* @__PURE__ */ e("div", { className: "h-4 w-[1px] bg-[#e6e8f0] mx-1 shrink-0" }),
76
77
  /* @__PURE__ */ e(
77
- F,
78
+ S,
78
79
  {
79
80
  filters: l,
80
81
  onFilterRemove: m,
82
+ onOverflowClick: w,
81
83
  onViewAll: d
82
84
  }
83
85
  ),
84
86
  /* @__PURE__ */ e("div", { className: "h-4 w-[1px] bg-[#e6e8f0] mx-1 shrink-0" }),
85
87
  /* @__PURE__ */ i(
86
- u,
88
+ b,
87
89
  {
88
90
  variant: "tertiary",
89
91
  onClick: n,
90
92
  "data-component": "filter-strip-all-filters",
91
93
  children: [
92
- /* @__PURE__ */ e(k, { className: "h-4 w-4" }),
94
+ /* @__PURE__ */ e(u, { className: "h-4 w-4" }),
93
95
  s("filterStrip.allFilters")
94
96
  ]
95
97
  }
@@ -99,5 +101,5 @@ const T = ({
99
101
  );
100
102
  };
101
103
  export {
102
- T as FilterStrip
104
+ q as FilterStrip
103
105
  };
@@ -111,8 +111,8 @@ const O = ({
111
111
  ) : (
112
112
  // Client-side overflow: Popover
113
113
  /* @__PURE__ */ o(k, { children: [
114
- /* @__PURE__ */ r(S, { asChild: !0, children: /* @__PURE__ */ o(v, { children: [
115
- /* @__PURE__ */ r(u, { asChild: !0, children: /* @__PURE__ */ r(
114
+ /* @__PURE__ */ o(v, { children: [
115
+ /* @__PURE__ */ r(u, { asChild: !0, children: /* @__PURE__ */ r(S, { asChild: !0, children: /* @__PURE__ */ r(
116
116
  b,
117
117
  {
118
118
  variant: "secondary",
@@ -121,12 +121,12 @@ const O = ({
121
121
  className: "whitespace-nowrap bg-[#eceefd] text-[#4259ee] hover:bg-[#dce1fc] border-0 h-6 px-2 text-xs font-medium font-['Manrope'] cursor-pointer",
122
122
  children: w
123
123
  }
124
- ) }),
124
+ ) }) }),
125
125
  /* @__PURE__ */ o(f, { variant: "tertiary", side: "top", children: [
126
126
  t.length,
127
127
  " more filters"
128
128
  ] })
129
- ] }) }),
129
+ ] }),
130
130
  /* @__PURE__ */ r(
131
131
  O,
132
132
  {