Skip to content

Commit 84d4f90

Browse files
committed
chore: add changelog for 1.4.0
1 parent a744817 commit 84d4f90

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

lib/CHANGELOG.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# @omsimos/react-highlight-popover
22

3+
## 1.4.0
4+
5+
### Minor Changes
6+
7+
- ### Performance Improvements 🚀
8+
- Reduced unnecessary renders by skipping popover position and selection updates when nothing changed.
9+
- Added a safeguarded `requestAnimationFrame` throttle so multiple `selectionchange` events collapse into a single render and any pending frame is cancelled on unmount.
10+
11+
- ### Lifecycle Reliability ✅
12+
- Ensured selection lifecycle callbacks only fire on real visibility transitions and always emit `onPopoverHide` during teardown.
13+
- Prevented duplicate processing when range boundary points remain unchanged, keeping drag interactions smooth.
14+
15+
- ### Compatibility 🔁
16+
- Expanded peer dependency support to include React 19 while keeping full compatibility with React 17 and 18.
17+
318
## 1.3.2
419

520
### Patch Changes
621

722
- ### Bug Fixes 🐞
8-
923
- **Removed Redundant Click-Outside Logic**:
1024
- The `useEffect` that handled clicks outside the popover has been removed. This was causing issues where clicking outside on elements with `user-select: none` would unintentionally close the popover, even though the text remained highlighted.
1125
- Since clicking outside naturally removes text selection, the previous logic was redundant and caused bugs by closing the popover prematurely.
@@ -23,7 +37,6 @@
2337
### Patch Changes
2438

2539
- ### Bug Fixes 🐞
26-
2740
- **Removed Unintended `.mjs` File**: An unnecessary file was unintentionally included in the v1.3.0 build. This patch removes the file, ensuring a cleaner build and reducing the package size.
2841

2942
## Upgrade Instructions
@@ -39,14 +52,12 @@
3952
### Minor Changes
4053

4154
- ### Performance Improvements 🚀
42-
4355
- **Memoized Components**: Both the main `HighlightPopover` component and the new `PopoverContent` component are now memoized using `React.memo()`, significantly reducing unnecessary re-renders.
4456
- **Optimized Event Handling**: The `selectionchange` event listener now uses `requestAnimationFrame` to batch updates, reducing the frequency of calculations and improving overall performance.
4557
- **Reduced State Updates**: The `handleSelection` function now checks conditions before updating state, minimizing unnecessary renders.
4658
- **Memoized Context Value**: The `contextValue` is now memoized to prevent unnecessary re-renders of context consumers.
4759

4860
### Documentation 📚
49-
5061
- **Updated Basic Example**: The basic usage example in the documentation now demonstrates the use of the `useHighlightPopover` hook, providing a more comprehensive illustration of the component's capabilities.
5162

5263
## Upgrade Instructions
@@ -62,15 +73,12 @@
6273
### Minor Changes
6374

6475
- ### New Features 🚀
65-
6676
- **Alignment Prop for Popover**: Introduced a new `alignment` prop that allows for positioning the popover relative to the selected text. Supported values: `'left'`, `'center'`, `'right'`. The default is set to `'center'`.
6777

6878
### Bug Fixes 🐞
69-
7079
- **Resolved ARIA Typo**: Fixed a typo in the ARIA attribute to improve accessibility.
7180

7281
### Under The Hood 🔧
73-
7482
- **ESM-Only Package**: The package has been converted to ESM-only, improving compatibility with modern JavaScript environments.
7583
- **Minified Package Output**: Reduced the bundle size by minifying the package output, leading to better performance and faster load times.
7684

@@ -118,15 +126,13 @@ npm install @omsimos/react-highlight-popover@latest
118126
We're excited to announce the initial release of React Highlight Popover, a customizable, headless React component for creating popovers on text selection, with zero dependencies!
119127

120128
## 🎉 Highlights
121-
122129
- **Headless Component**: Maximum flexibility for styling and integration
123130
- **Zero Dependencies**: Only React as a peer dependency
124131
- **Customizable**: Fine-tune behavior with props and callbacks
125132
- **Lightweight**: Minimal impact on your bundle size
126133
- **TypeScript Support**: Full type definitions included
127134

128135
## 🚀 Features
129-
130136
- Easy-to-use React component
131137
- Fully customizable popover content and styling
132138
- Configurable minimum selection length
@@ -171,7 +177,6 @@ npm install @omsimos/react-highlight-popover@latest
171177
## 📝 Changelog
172178

173179
### v1.0.0
174-
175180
- Initial release of React Highlight Popover
176181
- Implemented core HighlightPopover component
177182
- Added useHighlightPopover hook for accessing internal state

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@omsimos/react-highlight-popover",
3-
"version": "1.3.2",
3+
"version": "1.4.0",
44
"main": "dist/index.js",
55
"module": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)