deckhearth/lib
Randall Stillwell 72fe6d1be0 fix(use-focus-trap): preserve named useFocusTrap export for ScannerPageView
The portfolio squash inadvertently overwrote the pre-existing
lib/use-focus-trap.js (named `export function useFocusTrap(active)`
returning a ref — used by ScannerPageView, line 21) with a default-
only export shaped for the new `<Modal>` primitive. Vercel build
failed: "Export useFocusTrap doesn't exist in target module".

Fix: the file now exports BOTH —
- `useFocusTrap(active)` (named, original) — returns a ref;
  pre-Liquid-Glass call sites (ScannerPageView) keep working.
- `useFocusTrapContainer({ active, containerRef, ... })` (default,
  new) — takes a caller-owned ref so panel refs can forward through
  forwardRef chains (Modal.js consumes this shape).

Both hooks are commented to document which to use when. Modal.js
imports default already, so no change needed there.

Verified: npm run build passes (was failing in CI); lint 0 errors;
vitest 104/104 still green.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 19:59:40 -05:00
..
card-import Normalize collector numbers in catalog match and harden scanner adds. (#53) 2026-05-28 14:45:55 -05:00
flags bootstrap: agent pipeline v0.5.0 + ship-readiness review 2026-05-23 02:31:26 -05:00
auth-secret.js fix(auth): centralize JWT secret + 24h TTL (Brief 1 of fix-auth-bypass) 2026-05-23 10:40:50 -05:00
card-catalog-match.js Normalize collector numbers in catalog match and harden scanner adds. (#53) 2026-05-28 14:45:55 -05:00
card-number-utils.js Normalize collector numbers in catalog match and harden scanner adds. (#53) 2026-05-28 14:45:55 -05:00
card-text-match.js fix(scanner): Layer-1 SQL, printing picker, and rate-limit storm (#39) 2026-05-27 13:10:46 -05:00
collection-cards-csv.js Extract collection CSV export helper (Brief 1). (#80) 2026-06-03 16:53:01 -05:00
collection-tag-input.js Extract CollectionsCreateModal and tag helpers (Brief 1). (#82) 2026-06-03 16:53:08 -05:00
collection-vocabulary.js Vocabulary cleanup follow-up (#55) 2026-05-29 10:01:03 -05:00
deck-builder-stats.js refactor(deck-builder): extract stats lib and stats bar (Brief 1) (#89) 2026-06-03 17:24:40 -05:00
mana-symbols.js Major Scanner Improvements 2025-07-29 14:19:48 -05:00
ocr-worker.js feat(scanner): AI Gateway vision + Layer-1 Tesseract/pg_trgm OCR (#38) 2026-05-27 12:59:59 -05:00
permission-middleware.js refactor(auth): add withAdmin() wrapper for admin API routes. (#68) 2026-06-02 12:42:22 -05:00
rate-limit.js fix(security): stop leaking Gemini API key to browsers (#34) 2026-05-27 08:41:48 -05:00
scan-capture-upload.js refactor(scanner): extract disambiguation dialog and upload helpers. (#67) 2026-06-02 11:01:32 -05:00
scan-vision.js fix(scanner): catalog gap review path + not-listed disambiguation (#40) 2026-05-27 13:42:51 -05:00
scanner-card-detection.js refactor(scanner): extract camera lifecycle hook (Brief 4) (#71) 2026-06-02 15:44:56 -05:00
scanner-card-identify.js refactor(scanner): extract card identification pipeline (Brief 3) (#70) 2026-06-02 15:34:13 -05:00
scanner-route-api.js refactor(scanner): extract session and route API libs (page Brief 1) (#74) 2026-06-02 16:15:27 -05:00
scanner-session.js refactor(scanner): extract session and route API libs (page Brief 1) (#74) 2026-06-02 16:15:27 -05:00
slug-utils.js 🔗 Implement Collection Slug URLs 2025-07-26 22:06:52 -05:00
theme-context.js fix(lint): clear lib/config baseline and make CI lint blocking. (#63) 2026-06-02 01:03:42 -05:00
use-auth.js fix(lint): clear lib/config baseline and make CI lint blocking. (#63) 2026-06-02 01:03:42 -05:00
use-camera-scanner.js refactor(scanner): extract camera lifecycle hook (Brief 4) (#71) 2026-06-02 15:44:56 -05:00
use-card-detail.js refactor(card): useCardDetail + CardDetailView (Brief 3) (#86) 2026-06-03 17:10:13 -05:00
use-card-editor.js refactor(card-editor): useCardEditor + CardEditorView (Brief 3) (#94) 2026-06-03 18:18:31 -05:00
use-cards-page.js Extract AuthenticatedCards into hook + view (cards Brief 3). (#79) 2026-06-03 12:49:25 -05:00
use-collection-view.js refactor(collection): useCollectionView + view (Brief 3) (#88) 2026-06-03 17:10:20 -05:00
use-collections-page.js refactor(collections): useCollectionsPage + view (Brief 3) (#87) 2026-06-03 17:10:17 -05:00
use-deck-builder.js refactor(deck-builder): useDeckBuilder + DeckBuilderView (Brief 3) (#93) 2026-06-03 18:18:28 -05:00
use-focus-trap.js fix(use-focus-trap): preserve named useFocusTrap export for ScannerPageView 2026-06-03 19:59:40 -05:00
use-scanner-identification.js refactor(scanner): extract identification hook (Brief 5) (#72) 2026-06-02 15:59:03 -05:00
use-scanner-queue.js refactor(scanner): extract useScannerQueue hook (page Brief 2) (#75) 2026-06-02 21:28:24 -05:00