diff --git a/package.json b/package.json index 5cfcce90..3366bfa2 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dependencies": { "@aws-sdk/client-s3": "3.525.0", "@aws-sdk/s3-request-presigner": "3.525.0", - "@next/bundle-analyzer": "14.1.1", + "@next/bundle-analyzer": "14.1.0", "@radix-ui/react-dropdown-menu": "^2.0.6", "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/forms": "^0.5.7", @@ -39,7 +39,7 @@ "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "nanoid": "^5.0.6", - "next": "14.1.1-canary.82", + "next": "14.1.2-canary.0", "next-auth": "5.0.0-beta.13", "next-themes": "^0.2.1", "postcss": "8.4.35", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d46078e1..0d13b3ad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: 3.525.0 version: 3.525.0 '@next/bundle-analyzer': - specifier: 14.1.1 - version: 14.1.1 + specifier: 14.1.0 + version: 14.1.0 '@radix-ui/react-dropdown-menu': specifier: ^2.0.6 version: 2.0.6(@types/react-dom@18.2.19)(@types/react@18.2.61)(react-dom@18.2.0)(react@18.2.0) @@ -49,7 +49,7 @@ dependencies: version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) '@vercel/analytics': specifier: ^1.2.2 - version: 1.2.2(next@14.1.1-canary.82)(react@18.2.0) + version: 1.2.2(next@14.1.2-canary.0)(react@18.2.0) '@vercel/blob': specifier: ^0.22.1 version: 0.22.1 @@ -58,7 +58,7 @@ dependencies: version: 0.7.2 '@vercel/speed-insights': specifier: ^1.0.10 - version: 1.0.10(next@14.1.1-canary.82)(react@18.2.0) + version: 1.0.10(next@14.1.2-canary.0)(react@18.2.0) autoprefixer: specifier: 10.4.18 version: 10.4.18(postcss@8.4.35) @@ -96,14 +96,14 @@ dependencies: specifier: ^5.0.6 version: 5.0.6 next: - specifier: 14.1.1-canary.82 - version: 14.1.1-canary.82(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) + specifier: 14.1.2-canary.0 + version: 14.1.2-canary.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) next-auth: specifier: 5.0.0-beta.13 - version: 5.0.0-beta.13(next@14.1.1-canary.82)(react@18.2.0) + version: 5.0.0-beta.13(next@14.1.2-canary.0)(react@18.2.0) next-themes: specifier: ^0.2.1 - version: 0.2.1(next@14.1.1-canary.82)(react-dom@18.2.0)(react@18.2.0) + version: 0.2.1(next@14.1.2-canary.0)(react-dom@18.2.0)(react@18.2.0) postcss: specifier: 8.4.35 version: 8.4.35 @@ -1557,8 +1557,8 @@ packages: '@types/pg': 8.6.6 dev: false - /@next/bundle-analyzer@14.1.1: - resolution: {integrity: sha512-vM8PLggRNodmJo8FJy6+Bnv4jWsVtOuH87naJA7/sdmBUZrBk2fj3xkI1zwarWzDAYzNYTxiMRGVioyNPxBvXg==} + /@next/bundle-analyzer@14.1.0: + resolution: {integrity: sha512-RJWjnlMp/1WSW0ahAdawV22WgJiC6BVaFS5Xfhw6gP7NJEX3cAJjh4JqSHKGr8GnLNRaFCVTQdDPoX84E421BA==} dependencies: webpack-bundle-analyzer: 4.10.1 transitivePeerDependencies: @@ -1566,8 +1566,8 @@ packages: - utf-8-validate dev: false - /@next/env@14.1.1-canary.82: - resolution: {integrity: sha512-OK0KO4+lv4AjP8zpRIdS1YquDDFmilKnzqNv1NlR79+0co2KTV7pn0u6LSNVsiBrXww8q6aalhtZa9Tz5pj40Q==} + /@next/env@14.1.2-canary.0: + resolution: {integrity: sha512-GksEcic0fH3exEHdjfhghOZHC3IUASUnz0STQGit2TzjgMhZC3fWMXWyPt2xQU3F19jBfnKA+g60tV3PWEfN7A==} dev: false /@next/eslint-plugin-next@14.1.1: @@ -1576,8 +1576,8 @@ packages: glob: 10.3.10 dev: false - /@next/swc-darwin-arm64@14.1.1-canary.82: - resolution: {integrity: sha512-S+HGDBC4tFw0akrApxVklCdZqGF/0cgM5FZM4Swp1Py4iMg17lAr1dnu2DI5tiVB20unw/OG0+eZqL2hQjIg6Q==} + /@next/swc-darwin-arm64@14.1.2-canary.0: + resolution: {integrity: sha512-i/6NuE+p/VATZzUP0dx3gxqXaXUptySr5MmbLWSXC5KNB7vhtIBxk5xeGjCyEEDP5Gcwf6ZCGjc6l9f5fTdFiQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -1585,8 +1585,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@14.1.1-canary.82: - resolution: {integrity: sha512-wel5hJsgj9AsfEmjhi+go/bjGU1q8XhMLSJFa1lBIg0pSthiBo2f65QZHbJ1JMp+myeyevQTZJwnY26Pqj72jA==} + /@next/swc-darwin-x64@14.1.2-canary.0: + resolution: {integrity: sha512-emWPPk7joEKL9CLuikr2tQaWiguBI6rGBDW08KISmXvQWbuIMaQyjVVwrJjKBrYMwUbL1JxJAStkIUYLIFMuKA==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -1594,8 +1594,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@14.1.1-canary.82: - resolution: {integrity: sha512-pY04ow2mRWe8L4yjRs4fu1SAUY+Yq3OJhBg5uKnBJJLTnBsRRpH/Cc1Px+pzwEdArTDkAa7A+T6ihzqbU/hOOQ==} + /@next/swc-linux-arm64-gnu@14.1.2-canary.0: + resolution: {integrity: sha512-bjHae2PnQztYfZzF+nhL8UhpS8H0cQBmxu9E6P4aAYMPQeG2g1rgM52g3UJCQ7O+5G4XK44Y6CVEBe1g1t8tlw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1603,8 +1603,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@14.1.1-canary.82: - resolution: {integrity: sha512-AEOMP4L9ks63RAPkdA/FC15AdXXR4c+KyvPgzzZZTSisx+YAgu9KUtA7EARTAb7H4AMcvoNeiCUX/jIU5mbnag==} + /@next/swc-linux-arm64-musl@14.1.2-canary.0: + resolution: {integrity: sha512-S/Q5wbDumlFETuFGsmtj3T4MqCqn9vV4LWBXp2B7wCIZTIvgm5KKG7sPUDiaNoTqlg/bm7Af69M4Nma3BICfcg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1612,8 +1612,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@14.1.1-canary.82: - resolution: {integrity: sha512-345q+ubhbELBfBGPHRI4+Jxb8YLzjTGajnPMhLBYC3a+2yUP+R9Q+EWhurX5WOZLlzb69exGP35gv9e1JOiy1A==} + /@next/swc-linux-x64-gnu@14.1.2-canary.0: + resolution: {integrity: sha512-vc5nx1olDSQIiKnaoLpfbQON9M4Db2kqU231fkvTYqIc2e91hjBcNXK13pNXa8AwpA+c1FoXvwGj4MxA81v3gQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1621,8 +1621,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@14.1.1-canary.82: - resolution: {integrity: sha512-ptrxuPJWPQUbirI1r5TEln69Zr+rOBEXKXrTpGbviXk2cIWyZvZbn678/hAsZUoy34Lhar20CY23iuYX0er8lQ==} + /@next/swc-linux-x64-musl@14.1.2-canary.0: + resolution: {integrity: sha512-6bVFiJWD0pHK951ud8tbQI5gJ855roIRoParDAG/xdYY7qqOSZwkEqStaWEKhyE6ognOFYf38zEmudP5EgCp8Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1630,8 +1630,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@14.1.1-canary.82: - resolution: {integrity: sha512-IorBFBQtuTbQajOUVZ7TFB/beQfxb/RwnJOX1wpdvPgVB6ESPB9q0HmZottCCEl/5WdOHCjS/e7cunRF9QdK+Q==} + /@next/swc-win32-arm64-msvc@14.1.2-canary.0: + resolution: {integrity: sha512-HFAc0Exwo0sF9Nhjq3GsffGUzxFLfqyBubjqDGSAuFvcPrSftbkTk8KOhvGkuiAzjB0RwN51OkycIKHa+7ROyg==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -1639,8 +1639,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@14.1.1-canary.82: - resolution: {integrity: sha512-6YW5MvIoK3CYy8O6W8G5qaXKXC8eLQ3m6D/9VhLDsSyNCNirbnxzJ7lvIG1gK+k8Jl14LKo28NXQFhE+EIzddg==} + /@next/swc-win32-ia32-msvc@14.1.2-canary.0: + resolution: {integrity: sha512-xH8iffclOzAwhkz5L0Xta7GdtVeKYT4GvGXdNSVGeXrBEuhoVnk5hi+zxiSTgXe2ChmmMJZvrD7UWUObwDKm2A==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -1648,8 +1648,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@14.1.1-canary.82: - resolution: {integrity: sha512-oJsRbo8ywJCC6Xz5GW49r2mRnTcqWmHVUsi5U1ZTBY5JhRJw+ciLlP0YNb8PIrzaBwQE5vidloTcWxGHjd8A0w==} + /@next/swc-win32-x64-msvc@14.1.2-canary.0: + resolution: {integrity: sha512-sWwJzFthnGGB4grYxlK7V6tK2k7DvqfUkdYsPtXV5SorR7gmzbmWbFB2nCpC9a5brJhS3oaAZwdY3++8yMMn6Q==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -3254,7 +3254,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: false - /@vercel/analytics@1.2.2(next@14.1.1-canary.82)(react@18.2.0): + /@vercel/analytics@1.2.2(next@14.1.2-canary.0)(react@18.2.0): resolution: {integrity: sha512-X0rctVWkQV1e5Y300ehVNqpOfSOufo7ieA5PIdna8yX/U7Vjz0GFsGf4qvAhxV02uQ2CVt7GYcrFfddXXK2Y4A==} peerDependencies: next: '>= 13' @@ -3265,7 +3265,7 @@ packages: react: optional: true dependencies: - next: 14.1.1-canary.82(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) + next: 14.1.2-canary.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 server-only: 0.0.1 dev: false @@ -3290,7 +3290,7 @@ packages: ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) dev: false - /@vercel/speed-insights@1.0.10(next@14.1.1-canary.82)(react@18.2.0): + /@vercel/speed-insights@1.0.10(next@14.1.2-canary.0)(react@18.2.0): resolution: {integrity: sha512-4uzdKB0RW6Ff2FkzshzjZ+RlJfLPxgm/00i0XXgxfMPhwnnsk92YgtqsxT9OcPLdJUyVU1DqFlSWWjIQMPkh0g==} requiresBuild: true peerDependencies: @@ -3314,7 +3314,7 @@ packages: vue-router: optional: true dependencies: - next: 14.1.1-canary.82(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) + next: 14.1.2-canary.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 dev: false @@ -3705,7 +3705,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001585 + caniuse-lite: 1.0.30001591 electron-to-chromium: 1.4.664 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.3) @@ -3797,10 +3797,6 @@ packages: engines: {node: '>=16'} dev: false - /caniuse-lite@1.0.30001585: - resolution: {integrity: sha512-yr2BWR1yLXQ8fMpdS/4ZZXpseBgE7o4g41x3a6AJOqZuOi+iE/WdJYAuZ6Y95i4Ohd2Y+9MzIWRR+uGABH4s3Q==} - dev: false - /caniuse-lite@1.0.30001591: resolution: {integrity: sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==} dev: false @@ -6224,7 +6220,7 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: false - /next-auth@5.0.0-beta.13(next@14.1.1-canary.82)(react@18.2.0): + /next-auth@5.0.0-beta.13(next@14.1.2-canary.0)(react@18.2.0): resolution: {integrity: sha512-2m2Gq69WQ0YXcHCCpHn2y5z1bxSlqD/XOuAgrdtz49/VIAdTFFeYZz97RYqf6xMF8VGmoG32VUnJ6LzaHk6Fwg==} peerDependencies: '@simplewebauthn/browser': ^9.0.1 @@ -6241,24 +6237,24 @@ packages: optional: true dependencies: '@auth/core': 0.27.0 - next: 14.1.1-canary.82(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) + next: 14.1.2-canary.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 dev: false - /next-themes@0.2.1(next@14.1.1-canary.82)(react-dom@18.2.0)(react@18.2.0): + /next-themes@0.2.1(next@14.1.2-canary.0)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} peerDependencies: next: '*' react: '*' react-dom: '*' dependencies: - next: 14.1.1-canary.82(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) + next: 14.1.2-canary.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /next@14.1.1-canary.82(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-60ESrlfPEPrSgkjVB6Sn7giBFPD2IbGNc/ANhwoC6acbMNXSolZ7lPNEWDHZ+toUEHe93SgyEGmW3AYozjcOEw==} + /next@14.1.2-canary.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-+Tc629I4tASzM6ovZhdlfGh5mO0hr4+eap0boQCjfbSTzCSdd3V2Qbumucm8FME1+oDrpZnORyedXGZetFnKyw==} engines: {node: '>=18.17.0'} hasBin: true peerDependencies: @@ -6272,7 +6268,7 @@ packages: sass: optional: true dependencies: - '@next/env': 14.1.1-canary.82 + '@next/env': 14.1.2-canary.0 '@swc/helpers': 0.5.5 busboy: 1.6.0 caniuse-lite: 1.0.30001591 @@ -6282,15 +6278,15 @@ packages: react-dom: 18.2.0(react@18.2.0) styled-jsx: 5.1.1(@babel/core@7.23.9)(react@18.2.0) optionalDependencies: - '@next/swc-darwin-arm64': 14.1.1-canary.82 - '@next/swc-darwin-x64': 14.1.1-canary.82 - '@next/swc-linux-arm64-gnu': 14.1.1-canary.82 - '@next/swc-linux-arm64-musl': 14.1.1-canary.82 - '@next/swc-linux-x64-gnu': 14.1.1-canary.82 - '@next/swc-linux-x64-musl': 14.1.1-canary.82 - '@next/swc-win32-arm64-msvc': 14.1.1-canary.82 - '@next/swc-win32-ia32-msvc': 14.1.1-canary.82 - '@next/swc-win32-x64-msvc': 14.1.1-canary.82 + '@next/swc-darwin-arm64': 14.1.2-canary.0 + '@next/swc-darwin-x64': 14.1.2-canary.0 + '@next/swc-linux-arm64-gnu': 14.1.2-canary.0 + '@next/swc-linux-arm64-musl': 14.1.2-canary.0 + '@next/swc-linux-x64-gnu': 14.1.2-canary.0 + '@next/swc-linux-x64-musl': 14.1.2-canary.0 + '@next/swc-win32-arm64-msvc': 14.1.2-canary.0 + '@next/swc-win32-ia32-msvc': 14.1.2-canary.0 + '@next/swc-win32-x64-msvc': 14.1.2-canary.0 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros diff --git a/src/components/CanvasBlurCapture.tsx b/src/components/CanvasBlurCapture.tsx index fa8650bb..a47d6a2a 100644 --- a/src/components/CanvasBlurCapture.tsx +++ b/src/components/CanvasBlurCapture.tsx @@ -24,7 +24,7 @@ export default function CanvasBlurCapture({ quality?: number }) { const refCanvas = useRef(null); - const refImage = useRef(null); + const refImage = useRef(typeof Image !== 'undefined' ? new Image() : null); const refTimeouts = useRef([]); const refShouldCapture = useRef(true); @@ -51,7 +51,8 @@ export default function CanvasBlurCapture({ -edgeCompensation, -edgeCompensation, width + edgeCompensation * 2, - width * image.height / image.width + edgeCompensation * 2, + width * refImage.current.height / refImage.current.width + + edgeCompensation * 2, ); refTimeouts.current.forEach(clearTimeout); onCapture(canvas.toDataURL('image/jpeg', quality)); @@ -70,11 +71,11 @@ export default function CanvasBlurCapture({ } }; - const image = new Image(); - image.crossOrigin = 'anonymous'; - image.src = imageUrl; - image.onload = capture; - refImage.current = image; + if (refImage.current) { + refImage.current.crossOrigin = 'anonymous'; + refImage.current.src = imageUrl; + refImage.current.onload = capture; + } // Attempt delayed capture in case image.onload never fires refTimeouts.current.push(setTimeout(capture, RETRY_DELAY));