|
1 | 1 | # @omsimos/react-highlight-popover |
2 | 2 |
|
| 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 | + |
3 | 18 | ## 1.3.2 |
4 | 19 |
|
5 | 20 | ### Patch Changes |
6 | 21 |
|
7 | 22 | - ### Bug Fixes 🐞 |
8 | | - |
9 | 23 | - **Removed Redundant Click-Outside Logic**: |
10 | 24 | - 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. |
11 | 25 | - Since clicking outside naturally removes text selection, the previous logic was redundant and caused bugs by closing the popover prematurely. |
|
23 | 37 | ### Patch Changes |
24 | 38 |
|
25 | 39 | - ### Bug Fixes 🐞 |
26 | | - |
27 | 40 | - **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. |
28 | 41 |
|
29 | 42 | ## Upgrade Instructions |
|
39 | 52 | ### Minor Changes |
40 | 53 |
|
41 | 54 | - ### Performance Improvements 🚀 |
42 | | - |
43 | 55 | - **Memoized Components**: Both the main `HighlightPopover` component and the new `PopoverContent` component are now memoized using `React.memo()`, significantly reducing unnecessary re-renders. |
44 | 56 | - **Optimized Event Handling**: The `selectionchange` event listener now uses `requestAnimationFrame` to batch updates, reducing the frequency of calculations and improving overall performance. |
45 | 57 | - **Reduced State Updates**: The `handleSelection` function now checks conditions before updating state, minimizing unnecessary renders. |
46 | 58 | - **Memoized Context Value**: The `contextValue` is now memoized to prevent unnecessary re-renders of context consumers. |
47 | 59 |
|
48 | 60 | ### Documentation 📚 |
49 | | - |
50 | 61 | - **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. |
51 | 62 |
|
52 | 63 | ## Upgrade Instructions |
|
62 | 73 | ### Minor Changes |
63 | 74 |
|
64 | 75 | - ### New Features 🚀 |
65 | | - |
66 | 76 | - **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'`. |
67 | 77 |
|
68 | 78 | ### Bug Fixes 🐞 |
69 | | - |
70 | 79 | - **Resolved ARIA Typo**: Fixed a typo in the ARIA attribute to improve accessibility. |
71 | 80 |
|
72 | 81 | ### Under The Hood 🔧 |
73 | | - |
74 | 82 | - **ESM-Only Package**: The package has been converted to ESM-only, improving compatibility with modern JavaScript environments. |
75 | 83 | - **Minified Package Output**: Reduced the bundle size by minifying the package output, leading to better performance and faster load times. |
76 | 84 |
|
@@ -118,15 +126,13 @@ npm install @omsimos/react-highlight-popover@latest |
118 | 126 | 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! |
119 | 127 |
|
120 | 128 | ## 🎉 Highlights |
121 | | - |
122 | 129 | - **Headless Component**: Maximum flexibility for styling and integration |
123 | 130 | - **Zero Dependencies**: Only React as a peer dependency |
124 | 131 | - **Customizable**: Fine-tune behavior with props and callbacks |
125 | 132 | - **Lightweight**: Minimal impact on your bundle size |
126 | 133 | - **TypeScript Support**: Full type definitions included |
127 | 134 |
|
128 | 135 | ## 🚀 Features |
129 | | - |
130 | 136 | - Easy-to-use React component |
131 | 137 | - Fully customizable popover content and styling |
132 | 138 | - Configurable minimum selection length |
@@ -171,7 +177,6 @@ npm install @omsimos/react-highlight-popover@latest |
171 | 177 | ## 📝 Changelog |
172 | 178 |
|
173 | 179 | ### v1.0.0 |
174 | | - |
175 | 180 | - Initial release of React Highlight Popover |
176 | 181 | - Implemented core HighlightPopover component |
177 | 182 | - Added useHighlightPopover hook for accessing internal state |
|
0 commit comments