v1.3.0
This release marks a significant milestone with the introduction of a vast array of new hooks, a dedicated CLI for managing them, and a complete overhaul of the documentation website using Nuxt.
New Features
New Hooks
We have significantly expanded the library with hooks covering media, UI, system utilities, and storage:
- Media & Network:
- useConferenceSystem: Manages video/audio quality based on network conditions.
- useMediaQuality: Manages media stream quality settings.
- useNetworkInformation: Tracks network status and connection details.
- useScreenShare: Captures and manages screen sharing functionality.
- useUserMedia: Accesses user media streams (camera/microphone).
- useScreen: General screen management utilities.
- UI & DOM:
- usePortal: Renders components outside the main DOM hierarchy.
- useClickAway: Detects clicks outside of a specific target.
- useWindowSize: Tracks window dimensions.
- useScrollLock: Prevents scrolling on the body.
- useTernaryDarkMode: Handles ternary dark mode options (system/dark/light).
- useBreakpoint: Utilities for responsive design breakpoints.
- State & Lifecycle:
- useToggle: Manages boolean toggle state.
- useStep: Manages step-based navigation.
- useUnmount: Executes cleanup logic on component unmount.
- useTimeout: Manages timeouts safely in components.
- useCountdown & useCounter: Timer and counter logic.
- System & Utilities:
- useKbd: Keyboard key mapping and Mac/Non-Mac environment detection.
- useRoleGuard: Implements Role-Based Access Control (RBAC) with redirection and user management.
- useSymbol: Manages unique ES6 symbols and utilities.
- useSSR: Environment detection for Server-Side Rendering.
- useScript: Dynamic script loading.
- useCookie & useSessionStorage: Storage management.
- useCopyToClipboard: Clipboard operations.
- useForkRef: Utility to merge refs.
- withDefaults: Utility helper for merging props with default values.
CLI Integration
A new CLI tool has been implemented to streamline the usage of hooks:
- New Commands: Added
init,add, andlistcommands. - Dependency Management: The
addcommand now processes hook dependencies and includesinstallNpmDependenciesutility. - User Experience: Enhanced user prompts and added
orafor loading states. - Optimization:
downloadHooknow fetches metadata without writing unnecessary files to the filesystem.
Documentation & Website
- New Architecture: Initial setup of the
wwwapplication using Nuxt and TypeScript. - Categorization: Hooks are now better organized into categories (Utilities, Storage, Uncategorized) in the sidebar.
- Registry: Added JSON schema for registry item definitions.
- New Tools: Implemented
get-pageandlist-pagestools for retrieving docs content. - Visuals: Added project icon, favicon, and a new Releases page.
Improvements & Refactoring
- Metadata: Refactored metadata files for
useSymbol,useTernaryDarkMode,useUserMedia, and others to improve readability and import structures. - Performance:
useConferenceSystemanduseMediaQualitynow include better logic for adaptive quality. - Dependencies:
- Added
react-domas a dependency in the root. - Added
git-clifffor changelog generation. - Configured
renovate.jsonfor dependency management.
- Added
- Fixes:
- Removed unnecessary
pathrequirement from file properties in JSON schema. - Updated
downloadHookto fetch metadata cleanly.
- Removed unnecessary
Full Changelog: https://github.com/sseuniverse/sse-hooks/compare/v1.2.0...v1.3.0