modern-cmdk 1.1.3 → 1.1.5

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/README.md CHANGED
@@ -104,7 +104,7 @@ A ground-up rewrite of `cmdk` for **React 19**, **ES2026**, and **TypeScript 6**
104
104
  | **Animations** | CSS transitions | GPU-composited: `@starting-style`, `scroll-timeline`, spring easing |
105
105
  | **Keyboard** | External | Built-in registry, `Mod` key, conflict detection |
106
106
  | **Accessibility** | Partial ARIA | Full WAI-ARIA combobox, `forced-colors`, `prefers-contrast` |
107
- | **Bundle** | ~6 KB | Core ~5.2 KB, React ~6.3 KB |
107
+ | **Bundle** | ~6 KB | Core ~6.3 KB, React ~25.2 KB |
108
108
  | **TypeScript** | 4.x/5.x | 6.0, isolated declarations, branded types |
109
109
  | **Cleanup** | Manual | `using`/`await using` (Explicit Resource Management) |
110
110
  | **Error handling** | None | `CommandErrorBoundary` with fallback UI |
@@ -191,8 +191,8 @@ machine.subscribe(() => {
191
191
  | Search 100K items (WASM) | < 1 ms | ~0.7 ms |
192
192
  | Filter 10K (incremental) | < 2 ms | ~1.1 ms |
193
193
  | State update cycle | < 4 ms | ~2.3 ms |
194
- | Core bundle (gzipped) | <= 6 KB | ~5.2 KB |
195
- | React bundle (gzipped) | <= 25 KB | ~6.3 KB |
194
+ | Core bundle (gzipped) | <= 6.5 KB | ~6.3 KB |
195
+ | React bundle (gzipped) | <= 25.5 KB | ~25.2 KB |
196
196
 
197
197
  CI enforces 5% warning / 15% failure regression thresholds with 3-run averaging.
198
198
 
@@ -89732,7 +89732,8 @@ function objectGroupBy(items, keyFn) {
89732
89732
  const result = Object.create(null);
89733
89733
  for (const item of items) {
89734
89734
  const key = keyFn(item);
89735
- if (key in result) result[key].push(item);
89735
+ const existing = result[key];
89736
+ if (existing) existing.push(item);
89736
89737
  else result[key] = [item];
89737
89738
  }
89738
89739
  return result;
@@ -341,8 +341,8 @@ declare function matchesShortcut(event: KeyboardEvent, shortcut: ParsedShortcut)
341
341
  declare function findMatchingShortcut(event: KeyboardEvent, shortcuts: readonly ParsedShortcut[]): ParsedShortcut | null;
342
342
  /**
343
343
  * Detects conflicting shortcut bindings by grouping on their normalized form
344
- * via Map.groupBy (ES2026). Returns only groups with two or more colliding shortcuts.
345
- * Map.groupBy returns a Map directly — no Object.entries conversion needed.
344
+ * via mapGroupBy helper. Returns only groups with two or more colliding shortcuts.
345
+ * mapGroupBy returns a Map directly — no Object.entries conversion needed.
346
346
  */
347
347
  declare function detectConflicts(shortcuts: readonly ParsedShortcut[]): ReadonlyMap<string, readonly ParsedShortcut[]>;
348
348
  //#endregion
@@ -318,8 +318,8 @@ function findMatchingShortcut(event, shortcuts) {
318
318
  }
319
319
  /**
320
320
  * Detects conflicting shortcut bindings by grouping on their normalized form
321
- * via Map.groupBy (ES2026). Returns only groups with two or more colliding shortcuts.
322
- * Map.groupBy returns a Map directly — no Object.entries conversion needed.
321
+ * via mapGroupBy helper. Returns only groups with two or more colliding shortcuts.
322
+ * mapGroupBy returns a Map directly — no Object.entries conversion needed.
323
323
  */
324
324
  function detectConflicts(shortcuts) {
325
325
  const grouped = mapGroupBy(shortcuts, (s) => s.normalized);
@@ -286,8 +286,8 @@ function matchesShortcut(event, shortcut) {
286
286
  }
287
287
  /**
288
288
  * Detects conflicting shortcut bindings by grouping on their normalized form
289
- * via Map.groupBy (ES2026). Returns only groups with two or more colliding shortcuts.
290
- * Map.groupBy returns a Map directly — no Object.entries conversion needed.
289
+ * via mapGroupBy helper. Returns only groups with two or more colliding shortcuts.
290
+ * mapGroupBy returns a Map directly — no Object.entries conversion needed.
291
291
  */
292
292
  function detectConflicts(shortcuts) {
293
293
  const grouped = mapGroupBy(shortcuts, (s) => s.normalized);
@@ -1855,12 +1855,12 @@ function CommandList({ ref, children, virtualize, estimateSize = 44, overscan =
1855
1855
  ...style,
1856
1856
  "--command-list-height": `${height.toFixed(1)}px`
1857
1857
  }), [style, height]);
1858
+ const filteredIds = stateCtx.state.filteredIds;
1858
1859
  const { visibleIdSet, virtualPositionMap } = useMemo(() => {
1859
1860
  if (!shouldVirtualize) return {
1860
1861
  visibleIdSet: null,
1861
1862
  virtualPositionMap: null
1862
1863
  };
1863
- const { filteredIds } = stateCtx.state;
1864
1864
  const idSet = /* @__PURE__ */ new Set();
1865
1865
  const posMap = /* @__PURE__ */ new Map();
1866
1866
  for (const vItem of virtualizer.virtualItems) {
@@ -1877,7 +1877,7 @@ function CommandList({ ref, children, virtualize, estimateSize = 44, overscan =
1877
1877
  }, [
1878
1878
  shouldVirtualize,
1879
1879
  virtualizer.virtualItems,
1880
- stateCtx.state.filteredIds
1880
+ filteredIds
1881
1881
  ]);
1882
1882
  const virtualizedStateCtx = useMemo(() => ({
1883
1883
  ...stateCtx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modern-cmdk",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "description": "The definitive command palette engine for the modern web",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/ABCrimson/modern-cmdk/issues"
10
10
  },
11
11
  "engines": {
12
- "node": ">=22.0.0"
12
+ "node": ">=25.8.0"
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public"