Repository navigation
v4.7.0
Version 4.7.0 – Adds six new hooks that extend async handling, page‑unload protection, fullscreen control, map state, roving focus navigation, and split‑pane resizing.
useAsync– runs an async task after commit when itsdepschange, keeps{ value, error, status }in state, aborts any pending run ifdepschange, the hook is disabled, or the component unmounts, and preserves the previousvaluewhile a new run is pending.useBeforeUnload– asks the browser to confirm before the page unloads whileenabledis true (e.g., unsaved changes); nobeforeunloadlistener is attached when it is false.useFullscreen– shows an element full screen using the Fullscreen API; returnsisFullscreen(kept in sync withfullscreenchange, including Esc),isSupported,enter,exit,toggle, and the last rejected request aserror; is SSR‑safe.useMap– manages key‑value pairs in state (theuseSetcounterpart); providesset,update,delete,setAll, andclearthat produce a newMapon every change, keep the current one when nothing changes, and maintain a single identity for the life of the component.useRovingFocus– implements a roving tabindex: one Tab stop for a group of items, arrow keys for orientation, Home/End to move focus, remembers the item the user left, skips disabled items, wraps withloop, swaps Left/Right in a right‑to‑left container, and supports a controlledactiveIndex.useSplitResize– resizes two panes with a separator by pointer (mouse, touch, pen) or keyboard, in percent of the container; supports side‑by‑side and stacked layouts, right‑to‑left containers, a controlledsize, andonResizeEndfor persisting the size.
What's Changed
- docs: list coding-style sections H and I in AGENTS.md by @pjb0811 in #282
- ci: run the type check through pnpm exec by @pjb0811 in #288
- docs: remove emoji from the README feature, contributing and docs-link lines by @pjb0811 in #287
- docs: link the public skills repository and list repo-settings by @pjb0811 in #289
- chore: sort and wrap Tailwind classes inside cn() and cva() calls by @pjb0811 in #290
- feat: add useSplitResize for resizing two panes with a separator by @pjb0811 in #291
- feat: add useMap for key-value pairs held in state by @pjb0811 in #298
- feat: add useBeforeUnload for warning before leaving with unsaved changes by @pjb0811 in #299
- feat: add useFullscreen for showing an element full screen by @pjb0811 in #300
- feat: add useAsync that runs an async task and ignores stale results by @pjb0811 in #301
- feat: add useRovingFocus for arrow-key focus within a group of items by @pjb0811 in #302
- chore: version packages by @github-actions[bot] in #292
Full Changelog: v4.6.0...v4.7.0