From bee63f961fe8800fdfea1a6543a0f687f68ca764 Mon Sep 17 00:00:00 2001 From: yousefed Date: Fri, 27 Feb 2026 21:23:23 +0100 Subject: [PATCH 1/3] fix: ai selections broken --- packages/react/package.json | 4 +- packages/xl-ai/package.json | 2 +- .../components/AIMenu/AIMenuController.tsx | 8 ++ pnpm-lock.yaml | 83 ++++++++++++------- 4 files changed, 66 insertions(+), 31 deletions(-) diff --git a/packages/react/package.json b/packages/react/package.json index 16296564e4..11f26b9303 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -60,8 +60,8 @@ "dependencies": { "@blocknote/core": "0.47.0", "@emoji-mart/data": "^1.2.1", - "@floating-ui/react": "^0.27.16", - "@floating-ui/utils": "0.2.10", + "@floating-ui/react": "^0.27.18", + "@floating-ui/utils": "^0.2.10", "@tanstack/react-store": "0.7.7", "@tiptap/core": "^3.13.0", "@tiptap/pm": "^3.13.0", diff --git a/packages/xl-ai/package.json b/packages/xl-ai/package.json index ce2c3994b7..44dcaecd0c 100644 --- a/packages/xl-ai/package.json +++ b/packages/xl-ai/package.json @@ -74,7 +74,7 @@ "@blocknote/core": "0.47.0", "@blocknote/mantine": "0.47.0", "@blocknote/react": "0.47.0", - "@floating-ui/react": "^0.26.28", + "@floating-ui/react": "^0.27.18", "@handlewithcare/prosemirror-suggest-changes": "^0.1.8", "@tiptap/core": "^3.13.0", "ai": "^6.0.5", diff --git a/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx b/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx index c2e005954b..b8648a2aeb 100644 --- a/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx +++ b/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx @@ -95,6 +95,14 @@ export const AIMenuController = (props: { // see https://floating-ui.com/docs/floatingfocusmanager#page-scrolls-to-top-when-opening-the-floating-element focusManagerProps: { disabled: false, + // needed for https://github.com/floating-ui/floating-ui/discussions/3213 + // (related: https://github.com/mui/base-ui/issues/3950) + getInsideElements: () => { + if (!editor.domElement) { + return []; + } + return [editor.domElement]; + }, ...props.floatingUIOptions?.focusManagerProps, }, }) satisfies FloatingUIOptions, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c75f0a6971..e5c53a8854 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -123,10 +123,10 @@ importers: version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react@19.2.3) '@liveblocks/react-blocknote': specifier: 3.7.1-tiptap3 - version: 3.7.1-tiptap3(721f821d7672e3f7ac2e97f398cd193d) + version: 3.7.1-tiptap3(29ccebc838195425361ba1e4659354fa) '@liveblocks/react-tiptap': specifier: 3.7.1-tiptap3 - version: 3.7.1-tiptap3(5b659a9c23caa66435ae020ce36bb966) + version: 3.7.1-tiptap3(4fd038a275a839b2ea05ca08bd1a7e88) '@liveblocks/react-ui': specifier: 3.7.1-tiptap3 version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -3565,10 +3565,10 @@ importers: version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react@19.2.3) '@liveblocks/react-blocknote': specifier: 3.7.1-tiptap3 - version: 3.7.1-tiptap3(721f821d7672e3f7ac2e97f398cd193d) + version: 3.7.1-tiptap3(29ccebc838195425361ba1e4659354fa) '@liveblocks/react-tiptap': specifier: 3.7.1-tiptap3 - version: 3.7.1-tiptap3(5b659a9c23caa66435ae020ce36bb966) + version: 3.7.1-tiptap3(4fd038a275a839b2ea05ca08bd1a7e88) '@liveblocks/react-ui': specifier: 3.7.1-tiptap3 version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -4826,10 +4826,10 @@ importers: specifier: ^1.2.1 version: 1.2.1 '@floating-ui/react': - specifier: ^0.27.16 - version: 0.27.16(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: ^0.27.18 + version: 0.27.18(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@floating-ui/utils': - specifier: 0.2.10 + specifier: ^0.2.10 version: 0.2.10 '@tanstack/react-store': specifier: 0.7.7 @@ -4842,7 +4842,7 @@ importers: version: 3.15.3 '@tiptap/react': specifier: ^3.13.0 - version: 3.15.3(@floating-ui/dom@1.7.4)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 3.15.3(@floating-ui/dom@1.7.5)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@types/use-sync-external-store': specifier: 1.5.0 version: 1.5.0 @@ -5093,8 +5093,8 @@ importers: specifier: 0.47.0 version: link:../react '@floating-ui/react': - specifier: ^0.26.28 - version: 0.26.28(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + specifier: ^0.27.18 + version: 0.27.18(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@handlewithcare/prosemirror-suggest-changes': specifier: ^0.1.8 version: 0.1.8(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-transform@1.10.5)(prosemirror-view@1.41.4) @@ -5665,10 +5665,10 @@ importers: version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react@19.2.3) '@liveblocks/react-blocknote': specifier: 3.7.1-tiptap3 - version: 3.7.1-tiptap3(721f821d7672e3f7ac2e97f398cd193d) + version: 3.7.1-tiptap3(29ccebc838195425361ba1e4659354fa) '@liveblocks/react-tiptap': specifier: 3.7.1-tiptap3 - version: 3.7.1-tiptap3(5b659a9c23caa66435ae020ce36bb966) + version: 3.7.1-tiptap3(4fd038a275a839b2ea05ca08bd1a7e88) '@liveblocks/react-ui': specifier: 3.7.1-tiptap3 version: 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -7582,17 +7582,23 @@ packages: '@floating-ui/core@1.7.3': resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==} + '@floating-ui/core@1.7.4': + resolution: {integrity: sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==} + '@floating-ui/dom@1.7.4': resolution: {integrity: sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==} + '@floating-ui/dom@1.7.5': + resolution: {integrity: sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==} + '@floating-ui/react-dom@2.1.6': resolution: {integrity: sha512-4JX6rEatQEvlmgU80wZyq9RT96HZJa88q8hp0pBd+LrczeDI4o6uA2M+uvxngVHo4Ihr8uibXxH6+70zhAFrVw==} peerDependencies: react: '>=16.8.0' react-dom: '>=16.8.0' - '@floating-ui/react@0.26.28': - resolution: {integrity: sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw==} + '@floating-ui/react-dom@2.1.7': + resolution: {integrity: sha512-0tLRojf/1Go2JgEVm+3Frg9A3IW8bJgKgdO0BN5RkF//ufuz2joZM63Npau2ff3J6lUVYgDSNzNkR+aH3IVfjg==} peerDependencies: react: '>=16.8.0' react-dom: '>=16.8.0' @@ -7603,6 +7609,12 @@ packages: react: '>=17.0.0' react-dom: '>=17.0.0' + '@floating-ui/react@0.27.18': + resolution: {integrity: sha512-xJWJxvmy3a05j643gQt+pRbht5XnTlGpsEsAPnMi5F5YTOEEJymA90uZKBD8OvIv5XvZ1qi4GcccSlqT3Bq44Q==} + peerDependencies: + react: '>=17.0.0' + react-dom: '>=17.0.0' + '@floating-ui/utils@0.2.10': resolution: {integrity: sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==} @@ -18903,24 +18915,31 @@ snapshots: dependencies: '@floating-ui/utils': 0.2.10 + '@floating-ui/core@1.7.4': + dependencies: + '@floating-ui/utils': 0.2.10 + '@floating-ui/dom@1.7.4': dependencies: '@floating-ui/core': 1.7.3 '@floating-ui/utils': 0.2.10 + '@floating-ui/dom@1.7.5': + dependencies: + '@floating-ui/core': 1.7.4 + '@floating-ui/utils': 0.2.10 + '@floating-ui/react-dom@2.1.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: '@floating-ui/dom': 1.7.4 react: 19.2.3 react-dom: 19.2.3(react@19.2.3) - '@floating-ui/react@0.26.28(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@floating-ui/react-dom@2.1.7(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: - '@floating-ui/react-dom': 2.1.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3) - '@floating-ui/utils': 0.2.10 + '@floating-ui/dom': 1.7.5 react: 19.2.3 react-dom: 19.2.3(react@19.2.3) - tabbable: 6.2.0 '@floating-ui/react@0.27.16(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: @@ -18930,6 +18949,14 @@ snapshots: react-dom: 19.2.3(react@19.2.3) tabbable: 6.2.0 + '@floating-ui/react@0.27.18(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + dependencies: + '@floating-ui/react-dom': 2.1.7(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@floating-ui/utils': 0.2.10 + react: 19.2.3 + react-dom: 19.2.3(react@19.2.3) + tabbable: 6.4.0 + '@floating-ui/utils@0.2.10': {} '@formatjs/fast-memoize@3.1.0': @@ -19288,14 +19315,14 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@liveblocks/react-blocknote@3.7.1-tiptap3(721f821d7672e3f7ac2e97f398cd193d)': + '@liveblocks/react-blocknote@3.7.1-tiptap3(29ccebc838195425361ba1e4659354fa)': dependencies: '@blocknote/core': link:packages/core '@blocknote/react': link:packages/react '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15) '@liveblocks/core': 3.7.1-tiptap3(@types/json-schema@7.0.15) '@liveblocks/react': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react@19.2.3) - '@liveblocks/react-tiptap': 3.7.1-tiptap3(5b659a9c23caa66435ae020ce36bb966) + '@liveblocks/react-tiptap': 3.7.1-tiptap3(4fd038a275a839b2ea05ca08bd1a7e88) '@liveblocks/react-ui': 3.7.1-tiptap3(@types/json-schema@7.0.15)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@liveblocks/yjs': 3.7.1-tiptap3(@types/json-schema@7.0.15)(yjs@13.6.29) '@tiptap/core': 3.15.3(@tiptap/pm@3.15.3) @@ -19319,7 +19346,7 @@ snapshots: - y-protocols - yjs - '@liveblocks/react-tiptap@3.7.1-tiptap3(5b659a9c23caa66435ae020ce36bb966)': + '@liveblocks/react-tiptap@3.7.1-tiptap3(4fd038a275a839b2ea05ca08bd1a7e88)': dependencies: '@floating-ui/react-dom': 2.1.6(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@liveblocks/client': 3.7.1-tiptap3(@types/json-schema@7.0.15) @@ -19333,7 +19360,7 @@ snapshots: '@tiptap/extension-collaboration': 2.26.1(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.29))(yjs@13.6.29)) '@tiptap/extension-collaboration-cursor': 2.26.1(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(y-prosemirror@1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.29))(yjs@13.6.29)) '@tiptap/pm': 3.15.3 - '@tiptap/react': 3.15.3(@floating-ui/dom@1.7.4)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@tiptap/react': 3.15.3(@floating-ui/dom@1.7.5)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@tiptap/suggestion': 2.26.1(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3) cmdk: 1.1.1(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) react: 19.2.3 @@ -22110,9 +22137,9 @@ snapshots: '@tiptap/pm': 3.15.3 y-prosemirror: 1.3.7(prosemirror-model@1.25.4)(prosemirror-state@1.4.4)(prosemirror-view@1.41.4)(y-protocols@1.0.6(yjs@13.6.29))(yjs@13.6.29) - '@tiptap/extension-floating-menu@3.15.3(@floating-ui/dom@1.7.4)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)': + '@tiptap/extension-floating-menu@3.15.3(@floating-ui/dom@1.7.5)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)': dependencies: - '@floating-ui/dom': 1.7.4 + '@floating-ui/dom': 1.7.5 '@tiptap/core': 3.15.3(@tiptap/pm@3.15.3) '@tiptap/pm': 3.15.3 optional: true @@ -22174,7 +22201,7 @@ snapshots: prosemirror-transform: 1.10.5 prosemirror-view: 1.41.4 - '@tiptap/react@3.15.3(@floating-ui/dom@1.7.4)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@tiptap/react@3.15.3(@floating-ui/dom@1.7.5)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3)(@types/react-dom@19.2.3(@types/react@19.2.8))(@types/react@19.2.8)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: '@tiptap/core': 3.15.3(@tiptap/pm@3.15.3) '@tiptap/pm': 3.15.3 @@ -22187,7 +22214,7 @@ snapshots: use-sync-external-store: 1.6.0(react@19.2.3) optionalDependencies: '@tiptap/extension-bubble-menu': 3.15.3(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3) - '@tiptap/extension-floating-menu': 3.15.3(@floating-ui/dom@1.7.4)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3) + '@tiptap/extension-floating-menu': 3.15.3(@floating-ui/dom@1.7.5)(@tiptap/core@3.15.3(@tiptap/pm@3.15.3))(@tiptap/pm@3.15.3) transitivePeerDependencies: - '@floating-ui/dom' @@ -22954,9 +22981,9 @@ snapshots: flatted: 3.3.3 pathe: 1.1.2 sirv: 3.0.2 - tinyglobby: 0.2.15 + tinyglobby: 0.2.12 tinyrainbow: 1.2.0 - vitest: 2.1.9(@types/node@25.0.7)(@vitest/ui@2.1.9)(jsdom@25.0.1(canvas@2.11.2(encoding@0.1.13)))(lightningcss@1.30.2)(msw@2.11.5(@types/node@25.0.7)(typescript@5.9.3))(terser@5.46.0) + vitest: 2.1.9(@types/node@25.3.0)(@vitest/ui@2.1.9)(jsdom@25.0.1(canvas@2.11.2(encoding@0.1.13)))(lightningcss@1.30.2)(msw@2.11.5(@types/node@25.3.0)(typescript@5.9.3))(terser@5.46.0) optional: true '@vitest/utils@2.1.9': From ad282a976ad1360c330ac1dad92012d7d059f0a9 Mon Sep 17 00:00:00 2001 From: yousefed Date: Fri, 27 Feb 2026 21:32:16 +0100 Subject: [PATCH 2/3] fix comment --- packages/xl-ai/src/components/AIMenu/AIMenuController.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx b/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx index b8648a2aeb..18d885c373 100644 --- a/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx +++ b/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx @@ -95,7 +95,7 @@ export const AIMenuController = (props: { // see https://floating-ui.com/docs/floatingfocusmanager#page-scrolls-to-top-when-opening-the-floating-element focusManagerProps: { disabled: false, - // needed for https://github.com/floating-ui/floating-ui/discussions/3213 + // needed for https://github.com/floating-ui/floating-ui/pull/3202 // (related: https://github.com/mui/base-ui/issues/3950) getInsideElements: () => { if (!editor.domElement) { From 88fc8749c9da31b917b540f33cb4504c861ddbb8 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Mon, 2 Mar 2026 08:56:04 +0100 Subject: [PATCH 3/3] chore: please the linter --- packages/xl-ai/src/components/AIMenu/AIMenuController.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx b/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx index 18d885c373..930c317fa6 100644 --- a/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx +++ b/packages/xl-ai/src/components/AIMenu/AIMenuController.tsx @@ -106,7 +106,7 @@ export const AIMenuController = (props: { ...props.floatingUIOptions?.focusManagerProps, }, }) satisfies FloatingUIOptions, - [ai, aiMenuState, blockId, props.floatingUIOptions], + [ai, aiMenuState, blockId, props.floatingUIOptions, editor.domElement], ); const Component = props.aiMenu || AIMenu;