Closed renovate[bot] closed 1 year ago
Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.
⚠ Warning: custom changes will be lost.
This PR contains the following updates:
^0.7.2
->^2.0.0
Release Notes
floating-ui/floating-ui (@floating-ui/react-dom)
### [`v2.0.1`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%402.0.1) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@2.0.0...@floating-ui/react-dom@2.0.1) #### Bug Fixes - fix: adjust types for new function options feature in `core`/`dom` 1.3.0 ([#2359](https://togithub.com/floating-ui/floating-ui/issues/2359)) ### [`v2.0.0`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%402.0.0) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.3.0...@floating-ui/react-dom@2.0.0) This release aims to simplify the API and remove some deprecated properties. If you've been using the `refs.set*` functions since their addition in January (`1.2.0`), then you can freely upgrade without changing any of your code. #### Breaking Changes - Default `x` and `y` coordinates to `0` instead of `null` ([#2300](https://togithub.com/floating-ui/floating-ui/issues/2300)) `isPositioned` lets you know if the floating element has been positioned. - Remove deprecated top-level `reference` and `floating` ref setters ([#2300](https://togithub.com/floating-ui/floating-ui/issues/2300)) These are in the `refs` object: - `reference` -> `refs.setReference` - `floating` -> `refs.setFloating` - `whileElementsMounted` type requires cleanup function ([#2300](https://togithub.com/floating-ui/floating-ui/issues/2300)) #### New Features - feat: `floatingStyles` object ([#2300](https://togithub.com/floating-ui/floating-ui/issues/2300)) Pre-configured positioning styles for the majority of cases: ```js const {refs, floatingStyles} = useFloating(); return ; ``` - feat: external element synchronization in the hook ([#2300](https://togithub.com/floating-ui/floating-ui/issues/2300)) Avoid using layout effects: ```js const {refs} = useFloating({ elements: { // Either can be specified optionally reference: referenceElement, floating: floatingElement, }, }); // refs.setReference / refs.setFloating can be mix and matched ``` #### Bug Fixes - fix(types): allow `null` for `arrow`'s `element` option ([#2300](https://togithub.com/floating-ui/floating-ui/issues/2300)) ### [`v1.3.0`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.3.0) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.2.2...@floating-ui/react-dom@1.3.0) #### New Features - feat: allow `platform` object to be passed to the `useFloating` hook ([#2176](https://togithub.com/floating-ui/floating-ui/issues/2176)) #### Bug Fixes - fix(types): re-export middleware options types ([#2175](https://togithub.com/floating-ui/floating-ui/issues/2175)) - fix(types): add `@deprecation` notice to non-ref nested element setters ([#2175](https://togithub.com/floating-ui/floating-ui/issues/2175)) ### [`v1.2.2`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.2.2) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.2.1...@floating-ui/react-dom@1.2.2) #### Bug Fixes - fix(types): allow `SVGElement` as the arrow ([#2146](https://togithub.com/floating-ui/floating-ui/issues/2146)) ### [`v1.2.1`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.2.1) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.2.0...@floating-ui/react-dom@1.2.1) #### Bug Fixes - fix: avoid `arrow` re-export collision ([#2113](https://togithub.com/floating-ui/floating-ui/issues/2113)) ### [`v1.2.0`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.2.0) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.1.2...@floating-ui/react-dom@1.2.0) #### New Features - feat: add element setters to `refs` object ([#2101](https://togithub.com/floating-ui/floating-ui/issues/2101)) ```js const {refs} = useFloating(); ``` These replace the `reference` and `floating` callback refs (which are now aliases) by being more explicit and less confusing regarding how refs are updated. The `refs` object contains: { reference: MutableRefObject, floating: MutableRefObject, setReference: (node) => void, setFloating: (node) => void, } - feat: return `elements` object from hook ([#2101](https://togithub.com/floating-ui/floating-ui/issues/2101)) If you need to read the elements during render, where refs are not suitable, these contain the elements rather than refs. ### [`v1.1.2`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.1.2) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.1.1...@floating-ui/react-dom@1.1.2) #### Bug Fixes - fix: sync `dataRef.current` to `isPositioned` ([#2098](https://togithub.com/floating-ui/floating-ui/issues/2098)) ### [`v1.1.1`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.1.1) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.1.0...@floating-ui/react-dom@1.1.1) #### Bug Fixes - fix: re-allow unstable `ref` callbacks (prevent infinite loop) ([#2087](https://togithub.com/floating-ui/floating-ui/issues/2087)) Since `v1.0.0` you didn't need to memoize the callback ref (although is recommended), but in `v1.1.0` this caused an infinite loop again: ```js ref={node => floating(node)} ``` #### Performance Improvements - perf: optimize calling `floating` and `reference` callback refs directly in render ([#2087](https://togithub.com/floating-ui/floating-ui/issues/2087)) The docs recommended to use effects to synchronize external elements, but now there's an optimization that allows you to call either during render without needing an effect: ```js function App({externalNode}) { const {reference} = useFloating(); // Works and is optimized, no effect needed reference(externalNode); } ``` ### [`v1.1.0`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.1.0) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.0.1...@floating-ui/react-dom@1.1.0) #### New Features - feat: add `open` option and `isPositioned` property to wait for the position to be ready. ([#2001](https://togithub.com/floating-ui/floating-ui/issues/2001)) `isPositioned` allows you to call `.scrollIntoView()` or `.focus()` on an element in an effect without causing unwanted scrolling. ```js const {isPositioned} = useFloating(); ``` This works identically to `x === null`, but now has the ability to also reset if it doesn't get unmounted based on some state: ```js const [open, setOpen] = useState(false); const {isPositioned} = useFloating({ // `isPositioned` is synchronized to this state/value, but // when it changes to `true`, it will wait for the position, // unlike when checking `open` directly. open }); React.useLayoutEffect(() => { if (isPositioned) { element.focus(); element.scrollIntoView(); } }, [isPositioned]); ``` This means it will also work if the reference element moved from the first position after the floating element had been positioned for the first time, unlike `x === null`, making it as reliable as the `rAF` technique. For now, `null` remains as the original value of `x` and `y` only for SSR purposes, where the floating element is open already without a client interaction required, which can help with unmounting animations, since `isPositioned` doesn't wait. ```js ``` ### [`v1.0.1`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.0.1) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@1.0.0...@floating-ui/react-dom@1.0.1) #### Bug Fixes - fix: support falsy values in `middleware` option for conditionals ([#1954](https://togithub.com/floating-ui/floating-ui/issues/1954)) ### [`v1.0.0`](https://togithub.com/floating-ui/floating-ui/releases/tag/%40floating-ui/react-dom%401.0.0) [Compare Source](https://togithub.com/floating-ui/floating-ui/compare/@floating-ui/react-dom@0.7.2...@floating-ui/react-dom@1.0.0) #### Breaking Changes - `@floating-ui/core` bumped to `1.0.0` ([#1796](https://togithub.com/floating-ui/floating-ui/issues/1796)) - UMD package files now have `.umd` in the filename ([#1796](https://togithub.com/floating-ui/floating-ui/issues/1796)) #### Bug Fixes - fix: allow unstable inline ref callbacks ([#1796](https://togithub.com/floating-ui/floating-ui/issues/1796)) - fix: check `name` for middleware array comparisons ([#1796](https://togithub.com/floating-ui/floating-ui/issues/1796)) #### Performance Improvements - pkg: remove `use-isomorphic-layout-effect` from installed deps ([#1796](https://togithub.com/floating-ui/floating-ui/issues/1796))Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.