From 7ab5a89bdad6d423a324a94e1a67e89a6b8aaecf Mon Sep 17 00:00:00 2001 From: 1aron Date: Fri, 10 Nov 2023 17:09:48 +0800 Subject: [PATCH] Update website --- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- pnpm-lock.yaml | 185 ++++++++++++------ website/app/[locale]/(root)/play/Play.tsx | 29 +-- .../[locale]/(root)/play/[shareId]/page.tsx | 5 +- 6 files changed, 149 insertions(+), 82 deletions(-) diff --git a/examples/next.js-with-progressive-rendering/package.json b/examples/next.js-with-progressive-rendering/package.json index 324fecd4f..ae876e0e6 100644 --- a/examples/next.js-with-progressive-rendering/package.json +++ b/examples/next.js-with-progressive-rendering/package.json @@ -16,8 +16,8 @@ "@types/react": "^18.2.8", "@types/react-dom": "^18.2.4", "eslint": "^8.42.0", - "eslint-config-next": "^14.0.1", - "next": "^14.0.1", + "eslint-config-next": "^14.0.2", + "next": "^14.0.2", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.1.3" diff --git a/examples/next.js-with-runtime-rendering/package.json b/examples/next.js-with-runtime-rendering/package.json index a9e1faa1d..2b599b6c3 100644 --- a/examples/next.js-with-runtime-rendering/package.json +++ b/examples/next.js-with-runtime-rendering/package.json @@ -15,8 +15,8 @@ "@types/react": "^18.2.8", "@types/react-dom": "^18.2.4", "eslint": "^8.42.0", - "eslint-config-next": "^14.0.1", - "next": "^14.0.1", + "eslint-config-next": "^14.0.2", + "next": "^14.0.2", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.1.3" diff --git a/examples/next.js-with-static-extraction/package.json b/examples/next.js-with-static-extraction/package.json index 36e83d0df..9a33ff37e 100644 --- a/examples/next.js-with-static-extraction/package.json +++ b/examples/next.js-with-static-extraction/package.json @@ -15,8 +15,8 @@ "@types/react": "^18.2.8", "@types/react-dom": "^18.2.4", "eslint": "^8.42.0", - "eslint-config-next": "^14.0.1", - "next": "^14.0.1", + "eslint-config-next": "^14.0.2", + "next": "^14.0.2", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.1.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe403260b..4d4074b5e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,11 +289,11 @@ importers: specifier: ^8.42.0 version: 8.53.0 eslint-config-next: - specifier: ^14.0.1 - version: 14.0.1(eslint@8.53.0)(typescript@5.2.2) + specifier: ^14.0.2 + version: 14.0.2(eslint@8.53.0)(typescript@5.2.2) next: - specifier: ^14.0.1 - version: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.0.2 + version: 14.0.2(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -325,11 +325,11 @@ importers: specifier: ^8.42.0 version: 8.53.0 eslint-config-next: - specifier: ^14.0.1 - version: 14.0.1(eslint@8.53.0)(typescript@5.2.2) + specifier: ^14.0.2 + version: 14.0.2(eslint@8.53.0)(typescript@5.2.2) next: - specifier: ^14.0.1 - version: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.0.2 + version: 14.0.2(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -361,11 +361,11 @@ importers: specifier: ^8.42.0 version: 8.53.0 eslint-config-next: - specifier: ^14.0.1 - version: 14.0.1(eslint@8.53.0)(typescript@5.2.2) + specifier: ^14.0.2 + version: 14.0.2(eslint@8.53.0)(typescript@5.2.2) next: - specifier: ^14.0.1 - version: 14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) + specifier: ^14.0.2 + version: 14.0.2(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0) react: specifier: ^18.2.0 version: 18.2.0 @@ -4541,18 +4541,18 @@ packages: urlpattern-polyfill: 8.0.2 dev: true - /@next/env@14.0.1: - resolution: {integrity: sha512-Ms8ZswqY65/YfcjrlcIwMPD7Rg/dVjdLapMcSHG26W6O67EJDF435ShW4H4LXi1xKO1oRc97tLXUpx8jpLe86A==} + /@next/env@14.0.2: + resolution: {integrity: sha512-HAW1sljizEaduEOes/m84oUqeIDAUYBR1CDwu2tobNlNDFP3cSm9d6QsOsGeNlIppU1p/p1+bWbYCbvwjFiceA==} dev: false - /@next/eslint-plugin-next@14.0.1: - resolution: {integrity: sha512-bLjJMwXdzvhnQOnxvHoTTUh/+PYk6FF/DCgHi4BXwXCINer+o1ZYfL9aVeezj/oI7wqGJOqwGIXrlBvPbAId3w==} + /@next/eslint-plugin-next@14.0.2: + resolution: {integrity: sha512-APrYFsXfAhnysycqxHcpg6Y4i7Ukp30GzVSZQRKT3OczbzkqGjt33vNhScmgoOXYBU1CfkwgtXmNxdiwv1jKmg==} dependencies: glob: 7.1.7 dev: false - /@next/swc-darwin-arm64@14.0.1: - resolution: {integrity: sha512-JyxnGCS4qT67hdOKQ0CkgFTp+PXub5W1wsGvIq98TNbF3YEIN7iDekYhYsZzc8Ov0pWEsghQt+tANdidITCLaw==} + /@next/swc-darwin-arm64@14.0.2: + resolution: {integrity: sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -4560,8 +4560,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@14.0.1: - resolution: {integrity: sha512-625Z7bb5AyIzswF9hvfZWa+HTwFZw+Jn3lOBNZB87lUS0iuCYDHqk3ujuHCkiyPtSC0xFBtYDLcrZ11mF/ap3w==} + /@next/swc-darwin-x64@14.0.2: + resolution: {integrity: sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -4569,8 +4569,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@14.0.1: - resolution: {integrity: sha512-iVpn3KG3DprFXzVHM09kvb//4CNNXBQ9NB/pTm8LO+vnnnaObnzFdS5KM+w1okwa32xH0g8EvZIhoB3fI3mS1g==} + /@next/swc-linux-arm64-gnu@14.0.2: + resolution: {integrity: sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -4578,8 +4578,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@14.0.1: - resolution: {integrity: sha512-mVsGyMxTLWZXyD5sen6kGOTYVOO67lZjLApIj/JsTEEohDDt1im2nkspzfV5MvhfS7diDw6Rp/xvAQaWZTv1Ww==} + /@next/swc-linux-arm64-musl@14.0.2: + resolution: {integrity: sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -4587,8 +4587,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@14.0.1: - resolution: {integrity: sha512-wMqf90uDWN001NqCM/auRl3+qVVeKfjJdT9XW+RMIOf+rhUzadmYJu++tp2y+hUbb6GTRhT+VjQzcgg/QTD9NQ==} + /@next/swc-linux-x64-gnu@14.0.2: + resolution: {integrity: sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -4596,8 +4596,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@14.0.1: - resolution: {integrity: sha512-ol1X1e24w4j4QwdeNjfX0f+Nza25n+ymY0T2frTyalVczUmzkVD7QGgPTZMHfR1aLrO69hBs0G3QBYaj22J5GQ==} + /@next/swc-linux-x64-musl@14.0.2: + resolution: {integrity: sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -4605,8 +4605,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@14.0.1: - resolution: {integrity: sha512-WEmTEeWs6yRUEnUlahTgvZteh5RJc4sEjCQIodJlZZ5/VJwVP8p2L7l6VhzQhT4h7KvLx/Ed4UViBdne6zpIsw==} + /@next/swc-win32-arm64-msvc@14.0.2: + resolution: {integrity: sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -4614,8 +4614,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@14.0.1: - resolution: {integrity: sha512-oFpHphN4ygAgZUKjzga7SoH2VGbEJXZa/KL8bHCAwCjDWle6R1SpiGOdUdA8EJ9YsG1TYWpzY6FTbUA+iAJeww==} + /@next/swc-win32-ia32-msvc@14.0.2: + resolution: {integrity: sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -4623,8 +4623,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@14.0.1: - resolution: {integrity: sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==} + /@next/swc-win32-x64-msvc@14.0.2: + resolution: {integrity: sha512-Ut4LXIUvC5m8pHTe2j0vq/YDnTEyq6RSR9vHYPqnELrDapPhLNz9Od/L5Ow3J8RNDWpEnfCiQXuVdfjlNEJ7ug==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -6765,7 +6765,7 @@ packages: - supports-color dev: true - /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2): + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -6777,7 +6777,7 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 6.9.1 '@typescript-eslint/type-utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) @@ -6833,6 +6833,26 @@ packages: transitivePeerDependencies: - supports-color + /@typescript-eslint/parser@6.10.0(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 6.10.0 + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/typescript-estree': 6.10.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.10.0 + debug: 4.3.4 + eslint: 8.53.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + /@typescript-eslint/parser@6.9.1(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==} engines: {node: ^16.0.0 || >=18.0.0} @@ -6852,6 +6872,7 @@ packages: typescript: 5.2.2 transitivePeerDependencies: - supports-color + dev: true /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} @@ -6860,12 +6881,20 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 + /@typescript-eslint/scope-manager@6.10.0: + resolution: {integrity: sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/visitor-keys': 6.10.0 + /@typescript-eslint/scope-manager@6.9.1: resolution: {integrity: sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: '@typescript-eslint/types': 6.9.1 '@typescript-eslint/visitor-keys': 6.9.1 + dev: true /@typescript-eslint/type-utils@5.62.0(eslint@8.53.0)(typescript@4.9.5): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} @@ -6931,9 +6960,14 @@ packages: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/types@6.10.0: + resolution: {integrity: sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==} + engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/types@6.9.1: resolution: {integrity: sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==} engines: {node: ^16.0.0 || >=18.0.0} + dev: true /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -6976,6 +7010,26 @@ packages: transitivePeerDependencies: - supports-color + /@typescript-eslint/typescript-estree@6.10.0(typescript@5.2.2): + resolution: {integrity: sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/visitor-keys': 6.10.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + /@typescript-eslint/typescript-estree@6.9.1(typescript@5.2.2): resolution: {integrity: sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==} engines: {node: ^16.0.0 || >=18.0.0} @@ -6995,6 +7049,7 @@ packages: typescript: 5.2.2 transitivePeerDependencies: - supports-color + dev: true /@typescript-eslint/utils@5.62.0(eslint@8.53.0)(typescript@4.9.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -7062,12 +7117,20 @@ packages: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 + /@typescript-eslint/visitor-keys@6.10.0: + resolution: {integrity: sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.10.0 + eslint-visitor-keys: 3.4.3 + /@typescript-eslint/visitor-keys@6.9.1: resolution: {integrity: sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: '@typescript-eslint/types': 6.9.1 eslint-visitor-keys: 3.4.3 + dev: true /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -11105,8 +11168,8 @@ packages: source-map: 0.6.1 dev: true - /eslint-config-next@14.0.1(eslint@8.53.0)(typescript@5.2.2): - resolution: {integrity: sha512-QfIFK2WD39H4WOespjgf6PLv9Bpsd7KGGelCtmq4l67nGvnlsGpuvj0hIT+aIy6p5gKH+lAChYILsyDlxP52yg==} + /eslint-config-next@14.0.2(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-CasWThlsyIcg/a+clU6KVOMTieuDhTztsrqvniP6AsRki9v7FnojTa7vKQOYM8QSOsQdZ/aElLD1Y2Oc8/PsIg==} peerDependencies: eslint: ^7.23.0 || ^8.0.0 typescript: '>=3.3.1' @@ -11114,13 +11177,13 @@ packages: typescript: optional: true dependencies: - '@next/eslint-plugin-next': 14.0.1 + '@next/eslint-plugin-next': 14.0.2 '@rushstack/eslint-patch': 1.5.1 '@typescript-eslint/parser': 5.62.0(eslint@8.53.0)(typescript@5.2.2) eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0)(eslint@8.53.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.9.1)(eslint@8.53.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.53.0) eslint-plugin-react: 7.33.2(eslint@8.53.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.53.0) @@ -11133,8 +11196,8 @@ packages: /eslint-config-techor@2.5.19(typescript@5.2.2): resolution: {integrity: sha512-JeSm6ugW+9xM+kkU8WpkPZx/4qXOllC4gkHcWDfEvVk94+TOk17mEfZCOHPflYMn3YYlJREnicng629b40RN+w==} dependencies: - '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.10.0)(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2) eslint: 8.53.0 transitivePeerDependencies: - supports-color @@ -11194,7 +11257,7 @@ packages: enhanced-resolve: 5.15.0 eslint: 8.53.0 eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.53.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.9.1)(eslint@8.53.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -11320,7 +11383,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint@8.53.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.10.0)(eslint-import-resolver-node@0.3.9)(eslint@8.53.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -11341,7 +11404,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2) debug: 3.2.7(supports-color@5.5.0) eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 @@ -11395,7 +11458,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.9.1)(eslint@8.53.0): + /eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.10.0)(eslint@8.53.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -11405,7 +11468,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.10.0(eslint@8.53.0)(typescript@5.2.2) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -11414,7 +11477,7 @@ packages: doctrine: 2.1.0 eslint: 8.53.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.9.1)(eslint-import-resolver-node@0.3.9)(eslint@8.53.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.10.0)(eslint-import-resolver-node@0.3.9)(eslint@8.53.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -12664,7 +12727,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -16834,8 +16897,8 @@ packages: typescript: 5.2.2 dev: false - /next@14.0.1(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-s4YaLpE4b0gmb3ggtmpmV+wt+lPRuGtANzojMQ2+gmBpgX9w5fTbjsy6dXByBuENsdCX5pukZH/GxdFgO62+pA==} + /next@14.0.2(@babel/core@7.23.2)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-jsAU2CkYS40GaQYOiLl9m93RTv2DA/tTJ0NRlmZIBIL87YwQ/xR8k796z7IqgM3jydI8G25dXvyYMC9VDIevIg==} engines: {node: '>=18.17.0'} hasBin: true peerDependencies: @@ -16849,7 +16912,7 @@ packages: sass: optional: true dependencies: - '@next/env': 14.0.1 + '@next/env': 14.0.2 '@swc/helpers': 0.5.2 busboy: 1.6.0 caniuse-lite: 1.0.30001561 @@ -16859,15 +16922,15 @@ packages: styled-jsx: 5.1.1(@babel/core@7.23.2)(react@18.2.0) watchpack: 2.4.0 optionalDependencies: - '@next/swc-darwin-arm64': 14.0.1 - '@next/swc-darwin-x64': 14.0.1 - '@next/swc-linux-arm64-gnu': 14.0.1 - '@next/swc-linux-arm64-musl': 14.0.1 - '@next/swc-linux-x64-gnu': 14.0.1 - '@next/swc-linux-x64-musl': 14.0.1 - '@next/swc-win32-arm64-msvc': 14.0.1 - '@next/swc-win32-ia32-msvc': 14.0.1 - '@next/swc-win32-x64-msvc': 14.0.1 + '@next/swc-darwin-arm64': 14.0.2 + '@next/swc-darwin-x64': 14.0.2 + '@next/swc-linux-arm64-gnu': 14.0.2 + '@next/swc-linux-arm64-musl': 14.0.2 + '@next/swc-linux-x64-gnu': 14.0.2 + '@next/swc-linux-x64-musl': 14.0.2 + '@next/swc-win32-arm64-msvc': 14.0.2 + '@next/swc-win32-ia32-msvc': 14.0.2 + '@next/swc-win32-x64-msvc': 14.0.2 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros diff --git a/website/app/[locale]/(root)/play/Play.tsx b/website/app/[locale]/(root)/play/Play.tsx index 333a8fc8a..a3d5e59f9 100644 --- a/website/app/[locale]/(root)/play/Play.tsx +++ b/website/app/[locale]/(root)/play/Play.tsx @@ -79,16 +79,19 @@ export default function Play(props: any) { const { dict } = props const router = useRouter() const themeService = useThemeService() + const searchParams = useSearchParams() + const queryParams = useMemo(() => { + return Object.assign({}, props.searchParams, Object.fromEntries(searchParams)) + }, [props.searchParams, searchParams]) const pathname = usePathname(); - const searchParams = useSearchParams(); const versionSelectRef = useRef(null) const monacoProvidersRef = useRef([]) const editorRef = useRef(null) const monacoRef = useRef(null) const previewIframeRef = useRef(null) const prevVersionRef = useRef(props.shareItem?.version ?? latestMasterCSSVersion) - const [layout, setLayout] = useState(searchParams.get('layout')) - const [preview, setPreview] = useState(searchParams.get('preview')) + const [layout, setLayout] = useState(queryParams.layout) + const [preview, setPreview] = useState(queryParams.preview) const [shareId, setShareId] = useState(props.shareId ?? '') const [sharing, setSharing] = useState(false) const [version, setVersion] = useState(props.shareItem?.version ?? latestMasterCSSVersion) @@ -113,8 +116,8 @@ export default function Play(props: any) { }, [props.shareItem, template?.dependencies, template?.files, template?.links, version]) const [currentTabTitle, setCurrentTabTitle] = useState( - shareItem.files.find(({ title }) => searchParams.get('tab') === title) - ? searchParams.get('tab') + shareItem.files.find(({ title }) => queryParams.tab === title) + ? queryParams.tab : shareItem.files[0].title ) const editorModelRef = useRef>({}) @@ -156,9 +159,9 @@ export default function Play(props: any) { ); useEffect(() => { - const queryLayout = searchParams.get('layout') - const queryPreview = searchParams.get('preview') - const queryTab = searchParams.get('tab') + const queryLayout = queryParams.layout + const queryPreview = queryParams.preview + const queryTab = queryParams.tab if (queryLayout) { setLayout(queryLayout) } @@ -170,7 +173,7 @@ export default function Play(props: any) { } else { setCurrentTabTitle(shareItem.files[0].title) } - }, [createQueryString, pathname, router, searchParams, shareItem.files]) + }, [createQueryString, pathname, queryParams.layout, queryParams.preview, queryParams.tab, router, searchParams, shareItem.files]) /** * 避免切換到更大視口時仍停留在僅小視口支援的 Preview 或 Generated CSS 瀏覽模式 @@ -190,16 +193,16 @@ export default function Play(props: any) { }, [currentTabTitle, shareItem.files]) useEffect(() => { - if (searchParams.get('layout') !== layout) { + if (queryParams.layout !== layout) { router.push(pathname + '?' + createQueryString('layout', layout)) } - }, [createQueryString, layout, pathname, router, searchParams, shareId]) + }, [createQueryString, layout, pathname, queryParams.layout, router, searchParams, shareId]) useEffect(() => { - if (searchParams.get('preview') !== preview) { + if (queryParams.preview !== preview) { router.push(pathname + '?' + createQueryString('preview', preview)) } - }, [createQueryString, pathname, preview, router, searchParams, shareId]) + }, [createQueryString, pathname, preview, queryParams.preview, router, searchParams, shareId]) /** * 需避免即時編輯 HTML, Config 或切換 Theme 時更新 previewHTML,否則 Preview 將重載並造成視覺閃爍 diff --git a/website/app/[locale]/(root)/play/[shareId]/page.tsx b/website/app/[locale]/(root)/play/[shareId]/page.tsx index a7de1febf..f37a73472 100644 --- a/website/app/[locale]/(root)/play/[shareId]/page.tsx +++ b/website/app/[locale]/(root)/play/[shareId]/page.tsx @@ -6,11 +6,11 @@ import { collectDictionary } from 'websites/dictionaries' export default async function Page(props: any) { const store = initializeFirestore(app) - const shareId = props.params.shareId - const locale = props.params.locale + const { shareId, locale, searchParams } = props.params if (!shareId) { notFound() } + console.log('Request a play:', props) let shareItem: PlayShare | null = null const shareItemRef = store.doc(`sandbox/${shareId}`) const doc = await shareItemRef.get() @@ -20,6 +20,7 @@ export default async function Page(props: any) { )