From 8bd0e68bc5a78f8b9b3ea10210ad876151849d7a Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Mon, 30 Dec 2024 13:30:39 +0200 Subject: [PATCH] chore: bump @floating-ui/dom (#33458) Co-authored-by: John Kreitlow <863023+radium-v@users.noreply.github.com> --- ...-f474a804-4972-4d68-b0dc-f1d699251a90.json | 7 +++++ package.json | 2 +- .../react-positioning/package.json | 2 +- .../src/middleware/matchTargetSize.test.ts | 10 +++---- .../react-positioning/src/utils/devtools.ts | 4 +-- .../src/utils/getFloatingUIOffset.test.ts | 4 +-- .../src/utils/getFloatingUIOffset.ts | 4 +-- yarn.lock | 29 ++++++++++--------- 8 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 change/@fluentui-react-positioning-f474a804-4972-4d68-b0dc-f1d699251a90.json diff --git a/change/@fluentui-react-positioning-f474a804-4972-4d68-b0dc-f1d699251a90.json b/change/@fluentui-react-positioning-f474a804-4972-4d68-b0dc-f1d699251a90.json new file mode 100644 index 00000000000000..c76bca52bb3cc9 --- /dev/null +++ b/change/@fluentui-react-positioning-f474a804-4972-4d68-b0dc-f1d699251a90.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: bump @floating-ui/dom", + "packageName": "@fluentui/react-positioning", + "email": "863023+radium-v@users.noreply.github.com", + "dependentChangeType": "none" +} diff --git a/package.json b/package.json index 5fb8c55d042bb5..adb02e985a423c 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@dnd-kit/core": "^6.0.8", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.1", - "@floating-ui/dom": "1.2.0", + "@floating-ui/dom": "1.6.12", "@fluentui/react-icons": "^2.0.245", "@griffel/babel-preset": "1.5.8", "@griffel/eslint-plugin": "^1.6.4", diff --git a/packages/react-components/react-positioning/package.json b/packages/react-components/react-positioning/package.json index 184e18b96209c1..2c34e23a8c5483 100644 --- a/packages/react-components/react-positioning/package.json +++ b/packages/react-components/react-positioning/package.json @@ -16,7 +16,7 @@ "@fluentui/scripts-api-extractor": "*" }, "dependencies": { - "@floating-ui/dom": "^1.2.0", + "@floating-ui/dom": "^1.6.12", "@floating-ui/devtools": "0.2.1", "@fluentui/react-shared-contexts": "^9.21.2", "@fluentui/react-theme": "^9.1.24", diff --git a/packages/react-components/react-positioning/src/middleware/matchTargetSize.test.ts b/packages/react-components/react-positioning/src/middleware/matchTargetSize.test.ts index bf7e1845c1a1aa..dcc335cf4cb544 100644 --- a/packages/react-components/react-positioning/src/middleware/matchTargetSize.test.ts +++ b/packages/react-components/react-positioning/src/middleware/matchTargetSize.test.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import type { MiddlewareArguments } from '@floating-ui/dom'; +import type { MiddlewareState } from '@floating-ui/dom'; import { matchTargetSize, matchTargetSizeCssVar } from './matchTargetSize'; describe('matchTargetSize', () => { @@ -21,7 +21,7 @@ describe('matchTargetSize', () => { reference: { width: referenceWidth }, floating: { width: '1px' }, }, - } as unknown as MiddlewareArguments; + } as unknown as MiddlewareState; const result = await middlewareFn(middlewareArguments); @@ -52,7 +52,7 @@ describe('matchTargetSize', () => { reference: { width: referenceWidth }, floating: { width: '1px' }, }, - } as unknown as MiddlewareArguments; + } as unknown as MiddlewareState; const result = await middlewareFn(middlewareArguments); @@ -82,7 +82,7 @@ describe('matchTargetSize', () => { reference: { width: referenceWidth }, floating: { width: referenceWidth }, }, - } as unknown as MiddlewareArguments; + } as unknown as MiddlewareState; const result = await middlewareFn(middlewareArguments); @@ -103,7 +103,7 @@ describe('matchTargetSize', () => { reference: { width: referenceWidth }, floating: { width: '1px' }, }, - } as unknown as MiddlewareArguments; + } as unknown as MiddlewareState; const result = await middlewareFn(middlewareArguments); diff --git a/packages/react-components/react-positioning/src/utils/devtools.ts b/packages/react-components/react-positioning/src/utils/devtools.ts index c14372cbd7e492..0efaaa642e6195 100644 --- a/packages/react-components/react-positioning/src/utils/devtools.ts +++ b/packages/react-components/react-positioning/src/utils/devtools.ts @@ -1,10 +1,10 @@ -import type { MiddlewareArguments } from '@floating-ui/dom'; +import type { MiddlewareState } from '@floating-ui/dom'; import type { PositioningOptions } from '../types'; import { isHTMLElement } from '@fluentui/react-utilities'; import { listScrollParents } from './listScrollParents'; import { fromFloatingUIPlacement } from './fromFloatingUIPlacement'; -export const devtoolsCallback = (options: PositioningOptions) => (middlewareState: MiddlewareArguments) => { +export const devtoolsCallback = (options: PositioningOptions) => (middlewareState: MiddlewareState) => { const { elements: { floating, reference }, } = middlewareState; diff --git a/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.test.ts b/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.test.ts index 365f3b59b73c13..4c81d9004bf1ef 100644 --- a/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.test.ts +++ b/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.test.ts @@ -1,9 +1,9 @@ -import { MiddlewareArguments } from '@floating-ui/dom'; +import { MiddlewareState } from '@floating-ui/dom'; import { OffsetFunction } from '../types'; import { FloatingUIOffsetFunction, getFloatingUIOffset } from './getFloatingUIOffset'; describe('getFloatingUIOffset', () => { - const testMiddlewareArgs: MiddlewareArguments = { + const testMiddlewareArgs: MiddlewareState = { elements: { reference: document.createElement('div'), floating: document.createElement('div'), diff --git a/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts b/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts index d18e827ab0d9c9..04ace8eea99abc 100644 --- a/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts +++ b/packages/react-components/react-positioning/src/utils/getFloatingUIOffset.ts @@ -1,5 +1,5 @@ import type { Offset } from '../types'; -import type { MiddlewareArguments } from '@floating-ui/dom'; +import type { MiddlewareState } from '@floating-ui/dom'; import { fromFloatingUIPlacement } from './fromFloatingUIPlacement'; /** * Type taken from Floating UI since they are not exported @@ -30,7 +30,7 @@ export type FloatingUIOffsetValue = /** * Type taken from Floating UI since they are not exported */ -export type FloatingUIOffsetFunction = (args: MiddlewareArguments) => FloatingUIOffsetValue; +export type FloatingUIOffsetFunction = (args: MiddlewareState) => FloatingUIOffsetValue; /** * Shim to transform offset values from this library to Floating UI diff --git a/yarn.lock b/yarn.lock index 58916fa64f8bdc..31f07cb8d3396b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1877,24 +1877,25 @@ resolved "https://registry.yarnpkg.com/@fal-works/esbuild-plugin-global-externals/-/esbuild-plugin-global-externals-2.1.2.tgz#c05ed35ad82df8e6ac616c68b92c2282bd083ba4" integrity sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ== -"@floating-ui/core@^1.2.0": - version "1.6.6" - resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.6.tgz#f6edf703c8acb73e3802cf558c88ddb7cddc4f67" - integrity sha512-Vkvsw6EcpMHjvZZdMkSY+djMGFbt7CRssW99Ne8tar2WLnZ/l3dbxeTShbLQj+/s35h+Qb4cmnob+EzwtjrXGQ== +"@floating-ui/core@^1.6.0": + version "1.6.8" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.6.8.tgz#aa43561be075815879305965020f492cdb43da12" + integrity sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA== dependencies: - "@floating-ui/utils" "^0.2.6" + "@floating-ui/utils" "^0.2.8" "@floating-ui/devtools@0.2.1": version "0.2.1" resolved "https://registry.yarnpkg.com/@floating-ui/devtools/-/devtools-0.2.1.tgz#3e8023e09ede273a7aa426e7911f3dac630024c5" integrity sha512-8PHJLbD6VhBh+LJ1uty/Bz30qs02NXCE5u8WpOhSewlYXUWl03GNXknr9AS2yaAWJEQaY27x7eByJs44gODBcw== -"@floating-ui/dom@1.2.0", "@floating-ui/dom@^1.0.0", "@floating-ui/dom@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.2.0.tgz#a60212069cc58961c478037c30eba4b191c75316" - integrity sha512-QXzg57o1cjLz3cGETzKXjI3kx1xyS49DW9l7kV2jw2c8Yftd434t2hllX0sVGn2Q8MtcW/4pNm8bfE1/4n6mng== +"@floating-ui/dom@1.6.12", "@floating-ui/dom@^1.0.0", "@floating-ui/dom@^1.6.12": + version "1.6.12" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.6.12.tgz#6333dcb5a8ead3b2bf82f33d6bc410e95f54e556" + integrity sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w== dependencies: - "@floating-ui/core" "^1.2.0" + "@floating-ui/core" "^1.6.0" + "@floating-ui/utils" "^0.2.8" "@floating-ui/react-dom@^2.0.0": version "2.1.1" @@ -1903,10 +1904,10 @@ dependencies: "@floating-ui/dom" "^1.0.0" -"@floating-ui/utils@^0.2.6": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.6.tgz#1898a31c7e17a50384147a02a4e6264b1b1a0291" - integrity sha512-0KI3zGxIUs1KDR/pjQPdJH4Z8nGBm0yJ5WRoRfdw1Kzeh45jkIfA0rmD0kBF6fKHH+xaH7g8y4jIXyAV5MGK3g== +"@floating-ui/utils@^0.2.8": + version "0.2.8" + resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.8.tgz#21a907684723bbbaa5f0974cf7730bd797eb8e62" + integrity sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig== "@fluentui/dom-utilities@^1.1.1": version "1.1.1"