modern-cmdk 1.2.1 → 1.2.3
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 +9 -5
- package/dist/codemod/cli.d.mts +1 -1
- package/dist/codemod/cli.mjs +14677 -61044
- package/dist/codemod/transforms/data-attrs.d.mts +4 -8
- package/dist/codemod/transforms/data-attrs.mjs +1 -2
- package/dist/codemod/transforms/forward-ref.d.mts +4 -8
- package/dist/codemod/transforms/forward-ref.mjs +1 -2
- package/dist/codemod/transforms/import-rewrite.d.mts +4 -8
- package/dist/codemod/transforms/import-rewrite.mjs +1 -2
- package/dist/codemod/transforms/should-filter.d.mts +3 -7
- package/dist/codemod/transforms/should-filter.mjs +1 -2
- package/dist/core/index.d.mts +149 -181
- package/dist/core/index.mjs +42 -47
- package/dist/react/index.d.mts +78 -217
- package/dist/react/index.mjs +141 -166
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
npm install modern-cmdk
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
> [!NOTE]
|
|
35
|
+
> `modern-cmdk` is ESM-only and declares `engines.node >= 26.4.0`. The optional WASM search
|
|
36
|
+
> engine (`modern-cmdk-search-wasm`) is experimental and not yet published to npm.
|
|
37
|
+
|
|
34
38
|
The package exports three entry points:
|
|
35
39
|
|
|
36
40
|
```ts
|
|
@@ -104,7 +108,7 @@ A ground-up rewrite of `cmdk` for **React 19**, **ES2026**, and **TypeScript 7**
|
|
|
104
108
|
| **Animations** | CSS transitions | GPU-composited: `@starting-style`, `scroll-timeline`, spring easing |
|
|
105
109
|
| **Keyboard** | External | Built-in registry, `Mod` key, conflict detection |
|
|
106
110
|
| **Accessibility** | Partial ARIA | Full WAI-ARIA combobox, `forced-colors`, `prefers-contrast` |
|
|
107
|
-
| **Bundle** | ~6 KB | Core ~6.
|
|
111
|
+
| **Bundle** | ~6 KB | Core ~6.4 KB, React ~9.8 KB |
|
|
108
112
|
| **TypeScript** | 4.x/5.x | 7.0, isolated declarations, branded types |
|
|
109
113
|
| **Cleanup** | Manual | `using`/`await using` (Explicit Resource Management) |
|
|
110
114
|
| **Error handling** | None | `CommandErrorBoundary` with fallback UI |
|
|
@@ -114,9 +118,9 @@ A ground-up rewrite of `cmdk` for **React 19**, **ES2026**, and **TypeScript 7**
|
|
|
114
118
|
|
|
115
119
|
## Features
|
|
116
120
|
|
|
117
|
-
- **Framework-agnostic core** -- Pure TypeScript state machine.
|
|
121
|
+
- **Framework-agnostic core** -- Pure TypeScript state machine. No DOM. No React. Portable to any runtime. The sole runtime dependency (`idb-keyval`) is lazy-loaded only if you opt into IndexedDB frecency persistence.
|
|
118
122
|
- **React 19 adapter** -- 14 compound components. `useSyncExternalStore`, `useTransition`, `useOptimistic`, `use()` for Suspense. React Compiler compatible.
|
|
119
|
-
- **Automatic virtualization** -- Variable-height virtual scrolling kicks in at 100
|
|
123
|
+
- **Automatic virtualization** -- Variable-height virtual scrolling kicks in at a configurable threshold (`virtualizeThreshold`, default 100). Handles 100K+ items smoothly with `content-visibility: auto`.
|
|
120
124
|
- **Fuzzy search** -- Built-in TypeScript scorer with incremental filtering. Optional Rust/WASM engine for sub-1ms on 100K items with graceful TS fallback _(experimental, not yet published to npm)_.
|
|
121
125
|
- **Frecency ranking** -- Frequency x recency with time-based exponential decay. Pluggable persistence (memory or IndexedDB).
|
|
122
126
|
- **Keyboard shortcuts** -- Built-in registry with cross-platform `Mod` key, conflict detection, and `RegExp.escape` parsing. Cross-browser helper functions for grouping and set operations.
|
|
@@ -191,8 +195,8 @@ machine.subscribe(() => {
|
|
|
191
195
|
| Search 100K items (WASM) | < 1 ms | ~0.7 ms |
|
|
192
196
|
| Filter 10K (incremental) | < 2 ms | ~1.1 ms |
|
|
193
197
|
| State update cycle | < 4 ms | ~2.3 ms |
|
|
194
|
-
| Core bundle (gzipped) | <= 6.5 KB | ~6.
|
|
195
|
-
| React bundle (gzipped) | <= 12 KB | ~
|
|
198
|
+
| Core bundle (gzipped) | <= 6.5 KB | ~6.4 KB |
|
|
199
|
+
| React bundle (gzipped) | <= 12 KB | ~9.8 KB |
|
|
196
200
|
|
|
197
201
|
CI enforces 5% warning / 15% failure regression thresholds with 3-run averaging.
|
|
198
202
|
|
package/dist/codemod/cli.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|