modern-cmdk 1.1.3 → 1.1.4
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/codemod/cli.mjs +2 -1
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.mjs +2 -2
- package/dist/react/index.mjs +4 -4
- package/package.json +1 -1
package/dist/codemod/cli.mjs
CHANGED
|
@@ -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
|
-
|
|
89735
|
+
const existing = result[key];
|
|
89736
|
+
if (existing) existing.push(item);
|
|
89736
89737
|
else result[key] = [item];
|
|
89737
89738
|
}
|
|
89738
89739
|
return result;
|
package/dist/core/index.d.mts
CHANGED
|
@@ -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
|
|
345
|
-
*
|
|
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
|
package/dist/core/index.mjs
CHANGED
|
@@ -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
|
|
322
|
-
*
|
|
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);
|
package/dist/react/index.mjs
CHANGED
|
@@ -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
|
|
290
|
-
*
|
|
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
|
-
|
|
1880
|
+
filteredIds
|
|
1881
1881
|
]);
|
|
1882
1882
|
const virtualizedStateCtx = useMemo(() => ({
|
|
1883
1883
|
...stateCtx,
|