impact-nova 1.5.6 → 1.5.8

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.
Files changed (36) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +24 -39
  2. package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +39 -32
  3. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +47 -47
  4. package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.d.ts +16 -0
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.js +135 -0
  6. package/dist/components/ui/ag-grid-react/cell-renderers/editors/select-cell-editor.js +39 -36
  7. package/dist/components/ui/ag-grid-react/cell-renderers/index.d.ts +14 -1
  8. package/dist/components/ui/ag-grid-react/cell-renderers/index.js +41 -35
  9. package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.d.ts +31 -0
  10. package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +63 -0
  11. package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +18 -12
  12. package/dist/components/ui/badge.d.ts +2 -1
  13. package/dist/components/ui/badge.js +17 -12
  14. package/dist/components/ui/command-palette/command-palette-context.d.ts +4 -2
  15. package/dist/components/ui/command-palette/command-palette-context.js +76 -77
  16. package/dist/components/ui/command-palette/command-palette.d.ts +20 -4
  17. package/dist/components/ui/command-palette/command-palette.js +210 -180
  18. package/dist/components/ui/command-palette/index.d.ts +3 -3
  19. package/dist/components/ui/command-palette/index.js +43 -40
  20. package/dist/components/ui/command-palette/shortcut-registry.d.ts +15 -2
  21. package/dist/components/ui/command-palette/shortcut-registry.js +61 -35
  22. package/dist/components/ui/command-palette/shortcut-settings.d.ts +14 -3
  23. package/dist/components/ui/command-palette/shortcut-settings.js +97 -90
  24. package/dist/components/ui/command-palette/utils.d.ts +15 -0
  25. package/dist/components/ui/command-palette/utils.js +105 -70
  26. package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
  27. package/dist/components/ui/filter-strip/filter-strip.js +24 -22
  28. package/dist/components/ui/filter-strip/filter-tag-list.js +4 -4
  29. package/dist/components/ui/select/select.js +41 -41
  30. package/dist/components/ui/tabs.js +46 -45
  31. package/dist/icons/assets/command-pallet.svg.js +5 -0
  32. package/dist/icons/index.d.ts +2 -0
  33. package/dist/icons/index.js +146 -143
  34. package/dist/impact-nova.css +1 -1
  35. package/dist/index.js +100 -97
  36. package/package.json +1 -1
@@ -39,6 +39,21 @@ export interface CommandDefinition {
39
39
  */
40
40
  instance?: string;
41
41
  }
42
+ /**
43
+ * Storage adapter for shortcut overrides and recent commands.
44
+ * Allows consumers to provide their own persistence implementation
45
+ * (e.g., IndexedDB, backend API) instead of hardcoded localStorage.
46
+ */
47
+ export interface ShortcutStorageAdapter {
48
+ /** Load user-defined keybinding overrides */
49
+ getOverrides(): Map<string, KeyBinding> | null;
50
+ /** Save user-defined keybinding overrides */
51
+ saveOverrides(overrides: Map<string, KeyBinding>): void;
52
+ /** Load recent command IDs (most recent first) */
53
+ getRecentCommands(): string[] | null;
54
+ /** Save recent command IDs */
55
+ saveRecentCommands(ids: string[]): void;
56
+ }
42
57
  export declare function isMac(): boolean;
43
58
  /**
44
59
  * Get the display symbol for a modifier or special key.
@@ -2,7 +2,7 @@ let f = null;
2
2
  function u() {
3
3
  return f !== null ? f : typeof navigator > "u" ? !1 : (f = /mac|ipod|iphone|ipad/i.test(navigator.platform ?? navigator.userAgent ?? ""), f);
4
4
  }
5
- const d = {
5
+ const p = {
6
6
  meta: "⌘",
7
7
  ctrl: "⌃",
8
8
  alt: "⌥",
@@ -33,45 +33,62 @@ const d = {
33
33
  tab: "Tab",
34
34
  space: "Space"
35
35
  };
36
- function i(t) {
37
- return (u() ? d : w)[t.toLowerCase()] ?? t.toUpperCase();
36
+ function h(t) {
37
+ return (u() ? p : w)[t.toLowerCase()] ?? t.toUpperCase();
38
38
  }
39
39
  function C(t) {
40
40
  const e = [];
41
- return u() ? (t.ctrl && e.push(i("ctrl")), t.alt && e.push(i("alt")), t.shift && e.push(i("shift")), t.meta && e.push(i("meta"))) : ((t.meta || t.ctrl) && e.push(i("ctrl")), t.alt && e.push(i("alt")), t.shift && e.push(i("shift"))), e.push(i(t.key)), e;
41
+ return u() ? (t.ctrl && e.push(h("ctrl")), t.alt && e.push(h("alt")), t.shift && e.push(h("shift")), t.meta && e.push(h("meta"))) : ((t.meta || t.ctrl) && e.push(h("ctrl")), t.alt && e.push(h("alt")), t.shift && e.push(h("shift"))), e.push(h(t.key)), e;
42
42
  }
43
- function W(t) {
43
+ function F(t) {
44
44
  const e = C(t);
45
45
  return u() ? e.join("") : e.join("+");
46
46
  }
47
- function O(t, e) {
48
- if (!(t.key.toLowerCase() === e.key.toLowerCase())) return !1;
49
- const o = !!e.meta, a = !!e.ctrl, s = !!e.alt, c = !!e.shift;
47
+ function K(t, e) {
48
+ let o = t.key.toLowerCase() === e.key.toLowerCase();
49
+ if (!o && e.alt && u()) {
50
+ const n = t.code, i = e.key.toLowerCase();
51
+ n.startsWith("Key") ? o = n.slice(3).toLowerCase() === i : n.startsWith("Digit") ? o = n.slice(5) === i : o = ({
52
+ Comma: ",",
53
+ Period: ".",
54
+ Slash: "/",
55
+ Backslash: "\\",
56
+ BracketLeft: "[",
57
+ BracketRight: "]",
58
+ Semicolon: ";",
59
+ Quote: "'",
60
+ Backquote: "`",
61
+ Minus: "-",
62
+ Equal: "="
63
+ }[n] ?? n.toLowerCase()) === i;
64
+ }
65
+ if (!o) return !1;
66
+ const a = !!e.meta, r = !!e.ctrl, s = !!e.alt, c = !!e.shift;
50
67
  if (u())
51
- return t.metaKey === o && t.ctrlKey === a && t.altKey === s && t.shiftKey === c;
52
- const h = o || a;
53
- return t.ctrlKey === h && t.altKey === s && t.shiftKey === c && !t.metaKey;
68
+ return t.metaKey === a && t.ctrlKey === r && t.altKey === s && t.shiftKey === c;
69
+ const m = a || r;
70
+ return t.ctrlKey === m && t.altKey === s && t.shiftKey === c && !t.metaKey;
54
71
  }
55
72
  function k(t) {
56
- const e = { key: "" }, r = t.includes("+") ? t.split("+").map((o) => o.trim()) : S(t);
57
- for (const o of r) {
58
- const a = o.toLowerCase();
59
- a === "⌘" || a === "meta" || a === "cmd" || a === "command" ? e.meta = !0 : a === "⌃" || a === "ctrl" || a === "control" ? e.ctrl = !0 : a === "⌥" || a === "alt" || a === "option" ? e.alt = !0 : a === "⇧" || a === "shift" ? e.shift = !0 : e.key = o;
73
+ const e = { key: "" }, o = t.includes("+") ? t.split("+").map((a) => a.trim()) : S(t);
74
+ for (const a of o) {
75
+ const r = a.toLowerCase();
76
+ r === "⌘" || r === "meta" || r === "cmd" || r === "command" ? e.meta = !0 : r === "⌃" || r === "ctrl" || r === "control" ? e.ctrl = !0 : r === "⌥" || r === "alt" || r === "option" ? e.alt = !0 : r === "⇧" || r === "shift" ? e.shift = !0 : e.key = a;
60
77
  }
61
78
  return e;
62
79
  }
63
80
  function S(t) {
64
- const e = ["⌘", "⌃", "⌥", "⇧"], r = [];
65
- let o = t;
66
- for (const a of e)
67
- o.includes(a) && (r.push(a), o = o.replace(a, ""));
68
- return o.trim() && r.push(o.trim()), r;
81
+ const e = ["⌘", "⌃", "⌥", "⇧"], o = [];
82
+ let a = t;
83
+ for (const r of e)
84
+ a.includes(r) && (o.push(r), a = a.replace(r, ""));
85
+ return a.trim() && o.push(a.trim()), o;
69
86
  }
70
- function K(t, e) {
87
+ function O(t, e) {
71
88
  return t.key.toLowerCase() === e.key.toLowerCase() && !!t.meta == !!e.meta && !!t.ctrl == !!e.ctrl && !!t.alt == !!e.alt && !!t.shift == !!e.shift;
72
89
  }
73
- function R(t) {
74
- return (/* @__PURE__ */ new Set([
90
+ function L(t) {
91
+ if ((/* @__PURE__ */ new Set([
75
92
  "Control",
76
93
  "Shift",
77
94
  "Alt",
@@ -79,8 +96,26 @@ function R(t) {
79
96
  "CapsLock",
80
97
  "NumLock",
81
98
  "ScrollLock"
82
- ])).has(t.key) ? null : {
83
- key: t.key,
99
+ ])).has(t.key)) return null;
100
+ let o = t.key;
101
+ if (t.altKey && u()) {
102
+ const a = t.code;
103
+ a.startsWith("Key") ? o = a.slice(3).toLowerCase() : a.startsWith("Digit") ? o = a.slice(5) : o = {
104
+ Comma: ",",
105
+ Period: ".",
106
+ Slash: "/",
107
+ Backslash: "\\",
108
+ BracketLeft: "[",
109
+ BracketRight: "]",
110
+ Semicolon: ";",
111
+ Quote: "'",
112
+ Backquote: "`",
113
+ Minus: "-",
114
+ Equal: "="
115
+ }[a] ?? o;
116
+ }
117
+ return {
118
+ key: o,
84
119
  meta: u() ? t.metaKey : !1,
85
120
  ctrl: u() ? t.ctrlKey : t.ctrlKey || t.metaKey,
86
121
  alt: t.altKey,
@@ -164,66 +199,66 @@ const b = [
164
199
  ], g = new Set(
165
200
  b.map((t) => t.shortcut)
166
201
  );
167
- function p(t) {
202
+ function d(t) {
168
203
  const e = [];
169
204
  return (t.meta || t.ctrl) && e.push("meta"), t.alt && e.push("alt"), t.shift && e.push("shift"), e.push(t.key.toLowerCase()), e.join("+");
170
205
  }
171
- function L(t) {
172
- const e = p(t);
206
+ function R(t) {
207
+ const e = d(t);
173
208
  return g.has(e) || g.has(e.replace("meta+", "ctrl+"));
174
209
  }
175
- function M(t) {
176
- const e = p(t);
210
+ function B(t) {
211
+ const e = d(t);
177
212
  return b.find(
178
- (r) => r.shortcut === e || r.shortcut === e.replace("meta+", "ctrl+")
213
+ (o) => o.shortcut === e || o.shortcut === e.replace("meta+", "ctrl+")
179
214
  );
180
215
  }
181
216
  function T(t, e) {
182
217
  if (!t) return { score: 0, matches: [] };
183
- const r = t.toLowerCase(), o = e.toLowerCase();
184
- let a = 0;
185
- for (const l of r) {
186
- const m = o.indexOf(l, a);
187
- if (m === -1) return null;
188
- a = m + 1;
218
+ const o = t.toLowerCase(), a = e.toLowerCase();
219
+ let r = 0;
220
+ for (const l of o) {
221
+ const y = a.indexOf(l, r);
222
+ if (y === -1) return null;
223
+ r = y + 1;
189
224
  }
190
- let s = 0, c = 0, h = 0;
191
- const y = [];
192
- let n = -1;
193
- for (let l = 0; l < e.length && c < r.length; l++)
194
- o[l] === r[c] ? (s += 1, h++, h > 1 && (s += h), (l === 0 || /[\s\-_./:]/.test(e[l - 1])) && (s += 5), e[l] === t[c] && (s += 0.5), n === -1 && (n = l), c++) : (n !== -1 && (y.push([n, l - 1]), n = -1), h = 0);
195
- return n !== -1 && y.push([n, n + (c - y.reduce((l, m) => l + (m[1] - m[0] + 1), 0)) - 1]), c < r.length ? null : (o.startsWith(r) && (s += 10), s += Math.max(0, 5 - (e.length - t.length) * 0.1), { score: s, matches: y });
196
- }
197
- function D(t, e, r) {
198
- if (!e.trim()) return t.map((a) => ({ item: a, score: 0, matches: [] }));
199
- const o = [];
200
- for (const a of t) {
201
- const s = r(a), c = T(e, s);
202
- c && o.push({ item: a, score: c.score, matches: c.matches });
225
+ let s = 0, c = 0, m = 0;
226
+ const n = [];
227
+ let i = -1;
228
+ for (let l = 0; l < e.length && c < o.length; l++)
229
+ a[l] === o[c] ? (s += 1, m++, m > 1 && (s += m), (l === 0 || /[\s\-_./:]/.test(e[l - 1])) && (s += 5), e[l] === t[c] && (s += 0.5), i === -1 && (i = l), c++) : (i !== -1 && (n.push([i, l - 1]), i = -1), m = 0);
230
+ return i !== -1 && n.push([i, i + (c - n.reduce((l, y) => l + (y[1] - y[0] + 1), 0)) - 1]), c < o.length ? null : (a.startsWith(o) && (s += 10), s += Math.max(0, 5 - (e.length - t.length) * 0.1), { score: s, matches: n });
231
+ }
232
+ function M(t, e, o) {
233
+ if (!e.trim()) return t.map((r) => ({ item: r, score: 0, matches: [] }));
234
+ const a = [];
235
+ for (const r of t) {
236
+ const s = o(r), c = T(e, s);
237
+ c && a.push({ item: r, score: c.score, matches: c.matches });
203
238
  }
204
- return o.sort((a, s) => s.score - a.score), o;
239
+ return a.sort((r, s) => s.score - r.score), a;
205
240
  }
206
- const F = {
241
+ const W = {
207
242
  global: 0,
208
243
  module: 1,
209
244
  page: 2,
210
245
  modal: 3
211
246
  };
212
- function E(t) {
213
- return F[t];
247
+ function D(t) {
248
+ return W[t];
214
249
  }
215
- function B(t) {
250
+ function E(t) {
216
251
  const e = [];
217
- return t.forEach((r, o) => {
218
- e.push({ commandId: o, keybinding: r });
252
+ return t.forEach((o, a) => {
253
+ e.push({ commandId: a, keybinding: o });
219
254
  }), JSON.stringify(e);
220
255
  }
221
256
  function x(t) {
222
257
  const e = /* @__PURE__ */ new Map();
223
258
  try {
224
- const r = JSON.parse(t);
225
- for (const o of r)
226
- e.set(o.commandId, o.keybinding);
259
+ const o = JSON.parse(t);
260
+ for (const a of o)
261
+ e.set(a.commandId, a.keybinding);
227
262
  } catch {
228
263
  }
229
264
  return e;
@@ -231,18 +266,18 @@ function x(t) {
231
266
  export {
232
267
  b as BROWSER_SHORTCUTS,
233
268
  x as deserialiseOverrides,
234
- D as fuzzyFilter,
269
+ M as fuzzyFilter,
235
270
  T as fuzzyScore,
236
- M as getBrowserShortcutInfo,
237
- i as getKeySymbol,
271
+ B as getBrowserShortcutInfo,
272
+ h as getKeySymbol,
238
273
  u as isMac,
239
- L as isReservedShortcut,
240
- R as keybindingFromEvent,
241
- W as keybindingToString,
274
+ R as isReservedShortcut,
275
+ L as keybindingFromEvent,
276
+ F as keybindingToString,
242
277
  C as keybindingToSymbols,
243
- K as keybindingsEqual,
244
- O as matchesKeybinding,
278
+ O as keybindingsEqual,
279
+ K as matchesKeybinding,
245
280
  k as parseKeybinding,
246
- E as scopePriority,
247
- B as serialiseOverrides
281
+ D as scopePriority,
282
+ E as serialiseOverrides
248
283
  };
@@ -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
  {