diff --git a/package.json b/package.json index 8af9b373a..146108ea3 100644 --- a/package.json +++ b/package.json @@ -94,6 +94,9 @@ "postcss": "8.4.49", "swr": "2.2.6-beta.4", "use-sync-external-store": "1.4.0" + }, + "patchedDependencies": { + "@radix-ui/react-presence@1.1.1": "patches/@radix-ui__react-presence@1.1.1.patch" } } } diff --git a/patches/@radix-ui__react-presence@1.1.1.patch b/patches/@radix-ui__react-presence@1.1.1.patch new file mode 100644 index 000000000..0e6b9a113 --- /dev/null +++ b/patches/@radix-ui__react-presence@1.1.1.patch @@ -0,0 +1,34 @@ +diff --git a/dist/index.js b/dist/index.js +index 5d139c059b54dd3a6578121a95386241e82c87c7..741e7250d91d95c4fd94ac7b11d5f8c342255694 100644 +--- a/dist/index.js ++++ b/dist/index.js +@@ -145,7 +145,11 @@ function usePresence(present) { + return { + isPresent: ["mounted", "unmountSuspended"].includes(state), + ref: React2.useCallback((node2) => { +- if (node2) stylesRef.current = getComputedStyle(node2); ++ if (node2) { ++ stylesRef.current = getComputedStyle(node2); ++ } else { ++ stylesRef.current = {}; ++ } + setNode(node2); + }, []) + }; +diff --git a/dist/index.mjs b/dist/index.mjs +index 5ab5280818c2471068756b1122c11463b5e19a18..03073875f284f40abf15c72c7fea2292ee63e518 100644 +--- a/dist/index.mjs ++++ b/dist/index.mjs +@@ -110,7 +110,11 @@ function usePresence(present) { + return { + isPresent: ["mounted", "unmountSuspended"].includes(state), + ref: React2.useCallback((node2) => { +- if (node2) stylesRef.current = getComputedStyle(node2); ++ if (node2) { ++ stylesRef.current = getComputedStyle(node2); ++ } else { ++ stylesRef.current = {} as any; ++ } + setNode(node2); + }, []) + }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 47d9e245b..bb95f6149 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,6 +10,11 @@ overrides: swr: 2.2.6-beta.4 use-sync-external-store: 1.4.0 +patchedDependencies: + '@radix-ui/react-presence@1.1.1': + hash: st3oteh4egccjals34fuqqdkii + path: patches/@radix-ui__react-presence@1.1.1.patch + importers: .: @@ -4291,7 +4296,7 @@ snapshots: '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-portal': 1.1.2(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) + '@radix-ui/react-presence': 1.1.1(patch_hash=st3oteh4egccjals34fuqqdkii)(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-primitive': 2.0.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-slot': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) @@ -4383,7 +4388,7 @@ snapshots: '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-popper': 1.2.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-portal': 1.1.2(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) + '@radix-ui/react-presence': 1.1.1(patch_hash=st3oteh4egccjals34fuqqdkii)(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-primitive': 2.0.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-slot': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) @@ -4424,7 +4429,7 @@ snapshots: '@types/react': 19.0.1 '@types/react-dom': 19.0.2(@types/react@19.0.1) - '@radix-ui/react-presence@1.1.1(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204)': + '@radix-ui/react-presence@1.1.1(patch_hash=st3oteh4egccjals34fuqqdkii)(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204)': dependencies: '@radix-ui/react-compose-refs': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) @@ -4514,7 +4519,7 @@ snapshots: '@radix-ui/react-id': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-popper': 1.2.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-portal': 1.1.2(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) + '@radix-ui/react-presence': 1.1.1(patch_hash=st3oteh4egccjals34fuqqdkii)(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-primitive': 2.0.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0-rc-1c9b1387-20241204(react@19.0.0-rc-1c9b1387-20241204))(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-slot': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204) '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@19.0.1)(react@19.0.0-rc-1c9b1387-20241204)