Skip to content

v4.7.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 03:01
· 14 commits to main since this release
fb8fc77

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 its deps change, keeps { value, error, status } in state, aborts any pending run if deps change, the hook is disabled, or the component unmounts, and preserves the previous value while a new run is pending.
  • useBeforeUnload – asks the browser to confirm before the page unloads while enabled is true (e.g., unsaved changes); no beforeunload listener is attached when it is false.
  • useFullscreen – shows an element full screen using the Fullscreen API; returns isFullscreen (kept in sync with fullscreenchange, including Esc), isSupported, enter, exit, toggle, and the last rejected request as error; is SSR‑safe.
  • useMap – manages key‑value pairs in state (the useSet counterpart); provides set, update, delete, setAll, and clear that produce a new Map on 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 with loop, swaps Left/Right in a right‑to‑left container, and supports a controlled activeIndex.
  • 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 controlled size, and onResizeEnd for 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