From 00361aeff0a3277e3bc736b3f9add2fde6a263ee Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 00:00:52 +0100 Subject: [PATCH 01/12] chore: upgrade nextjs to 13.4.15 --- package.json | 2 +- pnpm-lock.yaml | 77 ++++++++++++++++++++++------------------------ src/app/layout.tsx | 7 ++++- 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index c687aa28..98e98e41 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "medium-zoom": "1.0.8", "mermaid": "10.3.1", "nanoid": "4.0.2", - "next": "13.4.12", + "next": "13.4.15", "next-themes": "0.2.1", "node-id3": "0.2.6", "open-graph-scraper": "^6.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b21dc340..f2df51d2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,11 +204,11 @@ dependencies: specifier: 4.0.2 version: 4.0.2 next: - specifier: 13.4.12 - version: 13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) + specifier: 13.4.15 + version: 13.4.15(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) next-themes: specifier: 0.2.1 - version: 0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0) + version: 0.2.1(next@13.4.15)(react-dom@18.2.0)(react@18.2.0) node-id3: specifier: 0.2.6 version: 0.2.6 @@ -2424,8 +2424,8 @@ packages: - utf-8-validate dev: true - /@next/env@13.4.12: - resolution: {integrity: sha512-RmHanbV21saP/6OEPBJ7yJMuys68cIf8OBBWd7+uj40LdpmswVAwe1uzeuFyUsd6SfeITWT3XnQfn6wULeKwDQ==} + /@next/env@13.4.15: + resolution: {integrity: sha512-GQXUy/y5NW4VbrKQMbLjsuTykJ7+Jtb9zcKH1WrmgI1zG7yCoZQaoI65YFNksEh+9EPSHX6Xr7U1/StIIAOXog==} dev: false /@next/eslint-plugin-next@13.4.19: @@ -2434,8 +2434,8 @@ packages: glob: 7.1.7 dev: true - /@next/swc-darwin-arm64@13.4.12: - resolution: {integrity: sha512-deUrbCXTMZ6ZhbOoloqecnUeNpUOupi8SE2tx4jPfNS9uyUR9zK4iXBvH65opVcA/9F5I/p8vDXSYbUlbmBjZg==} + /@next/swc-darwin-arm64@13.4.15: + resolution: {integrity: sha512-S4/5CwFxUtV+MnXXv5a+zGpx8Swm6WfzKYrcKbyYgl71Ek7bj0TrqZXASD2HeXIlHwr+0SJnnhSFcU09Y4tHjA==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -2443,8 +2443,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@13.4.12: - resolution: {integrity: sha512-WRvH7RxgRHlC1yb5oG0ZLx8F7uci9AivM5/HGGv9ZyG2Als8Ij64GC3d+mQ5sJhWjusyU6T6V1WKTUoTmOB0zQ==} + /@next/swc-darwin-x64@13.4.15: + resolution: {integrity: sha512-6bAi8s3vVRMFPU5qr4hZsfsQ0tzLU/Ig3tHjpJyjIN9AV3PMbTnX716P7hj1QioLfzZxIcUVnDczW7L45xHVfQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -2452,8 +2452,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@13.4.12: - resolution: {integrity: sha512-YEKracAWuxp54tKiAvvq73PUs9lok57cc8meYRibTWe/VdPB2vLgkTVWFcw31YDuRXdEhdX0fWS6Q+ESBhnEig==} + /@next/swc-linux-arm64-gnu@13.4.15: + resolution: {integrity: sha512-LpMjwqsQAj269h0PIqw8drRGGpyg6cRHi8JEAKtD/putcCalQWCplfUzjtML8jplwMN1lcdPDNtFIab53t8AzQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2461,8 +2461,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@13.4.12: - resolution: {integrity: sha512-LhJR7/RAjdHJ2Isl2pgc/JaoxNk0KtBgkVpiDJPVExVWA1c6gzY57+3zWuxuyWzTG+fhLZo2Y80pLXgIJv7g3g==} + /@next/swc-linux-arm64-musl@13.4.15: + resolution: {integrity: sha512-zpV8C34OtLhu+1oiXIdDC576s88/TYxN325kipuL64Zs/j2kSEinR28mcLCZQTYI2g4OwtE3XIERy4vFoY3WiA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2470,8 +2470,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@13.4.12: - resolution: {integrity: sha512-1DWLL/B9nBNiQRng+1aqs3OaZcxC16Nf+mOnpcrZZSdyKHek3WQh6j/fkbukObgNGwmCoVevLUa/p3UFTTqgqg==} + /@next/swc-linux-x64-gnu@13.4.15: + resolution: {integrity: sha512-Xk7QEfbX3zotvLmCoLzeGefbdyPpclCR8WyWHQOMMwUpftfmAuEVyU29WegcdfNCqYwc2QDXseVVI7xW/VwHCA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2479,8 +2479,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@13.4.12: - resolution: {integrity: sha512-kEAJmgYFhp0VL+eRWmUkVxLVunn7oL9Mdue/FS8yzRBVj7Z0AnIrHpTIeIUl1bbdQq1VaoOztnKicAjfkLTRCQ==} + /@next/swc-linux-x64-musl@13.4.15: + resolution: {integrity: sha512-SxXxWBIUICkbHPUthg+T/FuRgOp75wE0e6eiLGs4P9Miq/P3kSXHv6x5LRnDreGDvYnKOlpzXlsXTxcPTRWttg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2488,8 +2488,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@13.4.12: - resolution: {integrity: sha512-GMLuL/loR6yIIRTnPRY6UGbLL9MBdw2anxkOnANxvLvsml4F0HNIgvnU3Ej4BjbqMTNjD4hcPFdlEow4XHPdZA==} + /@next/swc-win32-arm64-msvc@13.4.15: + resolution: {integrity: sha512-Pu8zaW59XKbycyW/vzKRQOcbaZA2n3BK1zAFxv+hAO2bQ29FSGrtRb2nfhMDLwN0ggWIHKVKb+h4WMFHZkS9Qw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -2497,8 +2497,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@13.4.12: - resolution: {integrity: sha512-PhgNqN2Vnkm7XaMdRmmX0ZSwZXQAtamBVSa9A/V1dfKQCV1rjIZeiy/dbBnVYGdj63ANfsOR/30XpxP71W0eww==} + /@next/swc-win32-ia32-msvc@13.4.15: + resolution: {integrity: sha512-V3y1Sc0X31mwK4cx0JQBi0wSTbPpmp/qRXjS0Vz3+2oSrbV06Oz27c/r2tW7ph0qhVp8+Jt03ZLnSc7KjjECiA==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -2506,8 +2506,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@13.4.12: - resolution: {integrity: sha512-Z+56e/Ljt0bUs+T+jPjhFyxYBcdY2RIq9ELFU+qAMQMteHo7ymbV7CKmlcX59RI9C4YzN8PgMgLyAoi916b5HA==} + /@next/swc-win32-x64-msvc@13.4.15: + resolution: {integrity: sha512-mUGemqDIuD2PjnqEkqMpeI8cXOTVjedo9cqoaMkrOVcoK1IX/w7h4qYeniMUCImamsDAoLms86Fq9LzxT24StQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -8847,37 +8847,34 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /next-themes@0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0): + /next-themes@0.2.1(next@13.4.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} peerDependencies: next: '*' react: '*' react-dom: '*' dependencies: - next: 13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) + next: 13.4.15(@babel/core@7.22.10)(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@13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-eHfnru9x6NRmTMcjQp6Nz0J4XH9OubmzOa7CkWL+AUrUxpibub3vWwttjduu9No16dug1kq04hiUUpo7J3m3Xw==} + /next@13.4.15(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-s4ZSBwZrvpY0IDzRtD7C5CY8FA/8ZIYqrJZHnwrf6mkUVA+Y+A6CtwBYyxml6VKgP/3DFNqCqkBQGInZuPHzmQ==} engines: {node: '>=16.8.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 - fibers: '>= 3.1.0' react: ^18.2.0 react-dom: ^18.2.0 sass: ^1.3.0 peerDependenciesMeta: '@opentelemetry/api': optional: true - fibers: - optional: true sass: optional: true dependencies: - '@next/env': 13.4.12 + '@next/env': 13.4.15 '@swc/helpers': 0.5.1 busboy: 1.6.0 caniuse-lite: 1.0.30001522 @@ -8888,15 +8885,15 @@ packages: watchpack: 2.4.0 zod: 3.21.4 optionalDependencies: - '@next/swc-darwin-arm64': 13.4.12 - '@next/swc-darwin-x64': 13.4.12 - '@next/swc-linux-arm64-gnu': 13.4.12 - '@next/swc-linux-arm64-musl': 13.4.12 - '@next/swc-linux-x64-gnu': 13.4.12 - '@next/swc-linux-x64-musl': 13.4.12 - '@next/swc-win32-arm64-msvc': 13.4.12 - '@next/swc-win32-ia32-msvc': 13.4.12 - '@next/swc-win32-x64-msvc': 13.4.12 + '@next/swc-darwin-arm64': 13.4.15 + '@next/swc-darwin-x64': 13.4.15 + '@next/swc-linux-arm64-gnu': 13.4.15 + '@next/swc-linux-arm64-musl': 13.4.15 + '@next/swc-linux-x64-gnu': 13.4.15 + '@next/swc-linux-x64-musl': 13.4.15 + '@next/swc-win32-arm64-msvc': 13.4.15 + '@next/swc-win32-ia32-msvc': 13.4.15 + '@next/swc-win32-x64-msvc': 13.4.15 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 632db85a..a5cb70c3 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -110,7 +110,12 @@ export default function RootLayout({ } return ( - + From 9ddd904ceccc863ccfa2f2eeff7feecf6c99c655 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 00:22:10 +0100 Subject: [PATCH 02/12] Revert "chore: upgrade nextjs to 13.4.15" This reverts commit 00361aeff0a3277e3bc736b3f9add2fde6a263ee. --- package.json | 2 +- pnpm-lock.yaml | 77 ++++++++++++++++++++++++---------------------- src/app/layout.tsx | 7 +---- 3 files changed, 42 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 98e98e41..c687aa28 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "medium-zoom": "1.0.8", "mermaid": "10.3.1", "nanoid": "4.0.2", - "next": "13.4.15", + "next": "13.4.12", "next-themes": "0.2.1", "node-id3": "0.2.6", "open-graph-scraper": "^6.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f2df51d2..b21dc340 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,11 +204,11 @@ dependencies: specifier: 4.0.2 version: 4.0.2 next: - specifier: 13.4.15 - version: 13.4.15(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) + specifier: 13.4.12 + version: 13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) next-themes: specifier: 0.2.1 - version: 0.2.1(next@13.4.15)(react-dom@18.2.0)(react@18.2.0) + version: 0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0) node-id3: specifier: 0.2.6 version: 0.2.6 @@ -2424,8 +2424,8 @@ packages: - utf-8-validate dev: true - /@next/env@13.4.15: - resolution: {integrity: sha512-GQXUy/y5NW4VbrKQMbLjsuTykJ7+Jtb9zcKH1WrmgI1zG7yCoZQaoI65YFNksEh+9EPSHX6Xr7U1/StIIAOXog==} + /@next/env@13.4.12: + resolution: {integrity: sha512-RmHanbV21saP/6OEPBJ7yJMuys68cIf8OBBWd7+uj40LdpmswVAwe1uzeuFyUsd6SfeITWT3XnQfn6wULeKwDQ==} dev: false /@next/eslint-plugin-next@13.4.19: @@ -2434,8 +2434,8 @@ packages: glob: 7.1.7 dev: true - /@next/swc-darwin-arm64@13.4.15: - resolution: {integrity: sha512-S4/5CwFxUtV+MnXXv5a+zGpx8Swm6WfzKYrcKbyYgl71Ek7bj0TrqZXASD2HeXIlHwr+0SJnnhSFcU09Y4tHjA==} + /@next/swc-darwin-arm64@13.4.12: + resolution: {integrity: sha512-deUrbCXTMZ6ZhbOoloqecnUeNpUOupi8SE2tx4jPfNS9uyUR9zK4iXBvH65opVcA/9F5I/p8vDXSYbUlbmBjZg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -2443,8 +2443,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@13.4.15: - resolution: {integrity: sha512-6bAi8s3vVRMFPU5qr4hZsfsQ0tzLU/Ig3tHjpJyjIN9AV3PMbTnX716P7hj1QioLfzZxIcUVnDczW7L45xHVfQ==} + /@next/swc-darwin-x64@13.4.12: + resolution: {integrity: sha512-WRvH7RxgRHlC1yb5oG0ZLx8F7uci9AivM5/HGGv9ZyG2Als8Ij64GC3d+mQ5sJhWjusyU6T6V1WKTUoTmOB0zQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -2452,8 +2452,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@13.4.15: - resolution: {integrity: sha512-LpMjwqsQAj269h0PIqw8drRGGpyg6cRHi8JEAKtD/putcCalQWCplfUzjtML8jplwMN1lcdPDNtFIab53t8AzQ==} + /@next/swc-linux-arm64-gnu@13.4.12: + resolution: {integrity: sha512-YEKracAWuxp54tKiAvvq73PUs9lok57cc8meYRibTWe/VdPB2vLgkTVWFcw31YDuRXdEhdX0fWS6Q+ESBhnEig==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2461,8 +2461,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@13.4.15: - resolution: {integrity: sha512-zpV8C34OtLhu+1oiXIdDC576s88/TYxN325kipuL64Zs/j2kSEinR28mcLCZQTYI2g4OwtE3XIERy4vFoY3WiA==} + /@next/swc-linux-arm64-musl@13.4.12: + resolution: {integrity: sha512-LhJR7/RAjdHJ2Isl2pgc/JaoxNk0KtBgkVpiDJPVExVWA1c6gzY57+3zWuxuyWzTG+fhLZo2Y80pLXgIJv7g3g==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2470,8 +2470,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@13.4.15: - resolution: {integrity: sha512-Xk7QEfbX3zotvLmCoLzeGefbdyPpclCR8WyWHQOMMwUpftfmAuEVyU29WegcdfNCqYwc2QDXseVVI7xW/VwHCA==} + /@next/swc-linux-x64-gnu@13.4.12: + resolution: {integrity: sha512-1DWLL/B9nBNiQRng+1aqs3OaZcxC16Nf+mOnpcrZZSdyKHek3WQh6j/fkbukObgNGwmCoVevLUa/p3UFTTqgqg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2479,8 +2479,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@13.4.15: - resolution: {integrity: sha512-SxXxWBIUICkbHPUthg+T/FuRgOp75wE0e6eiLGs4P9Miq/P3kSXHv6x5LRnDreGDvYnKOlpzXlsXTxcPTRWttg==} + /@next/swc-linux-x64-musl@13.4.12: + resolution: {integrity: sha512-kEAJmgYFhp0VL+eRWmUkVxLVunn7oL9Mdue/FS8yzRBVj7Z0AnIrHpTIeIUl1bbdQq1VaoOztnKicAjfkLTRCQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2488,8 +2488,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@13.4.15: - resolution: {integrity: sha512-Pu8zaW59XKbycyW/vzKRQOcbaZA2n3BK1zAFxv+hAO2bQ29FSGrtRb2nfhMDLwN0ggWIHKVKb+h4WMFHZkS9Qw==} + /@next/swc-win32-arm64-msvc@13.4.12: + resolution: {integrity: sha512-GMLuL/loR6yIIRTnPRY6UGbLL9MBdw2anxkOnANxvLvsml4F0HNIgvnU3Ej4BjbqMTNjD4hcPFdlEow4XHPdZA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -2497,8 +2497,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@13.4.15: - resolution: {integrity: sha512-V3y1Sc0X31mwK4cx0JQBi0wSTbPpmp/qRXjS0Vz3+2oSrbV06Oz27c/r2tW7ph0qhVp8+Jt03ZLnSc7KjjECiA==} + /@next/swc-win32-ia32-msvc@13.4.12: + resolution: {integrity: sha512-PhgNqN2Vnkm7XaMdRmmX0ZSwZXQAtamBVSa9A/V1dfKQCV1rjIZeiy/dbBnVYGdj63ANfsOR/30XpxP71W0eww==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -2506,8 +2506,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@13.4.15: - resolution: {integrity: sha512-mUGemqDIuD2PjnqEkqMpeI8cXOTVjedo9cqoaMkrOVcoK1IX/w7h4qYeniMUCImamsDAoLms86Fq9LzxT24StQ==} + /@next/swc-win32-x64-msvc@13.4.12: + resolution: {integrity: sha512-Z+56e/Ljt0bUs+T+jPjhFyxYBcdY2RIq9ELFU+qAMQMteHo7ymbV7CKmlcX59RI9C4YzN8PgMgLyAoi916b5HA==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -8847,34 +8847,37 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /next-themes@0.2.1(next@13.4.15)(react-dom@18.2.0)(react@18.2.0): + /next-themes@0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} peerDependencies: next: '*' react: '*' react-dom: '*' dependencies: - next: 13.4.15(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) + next: 13.4.12(@babel/core@7.22.10)(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@13.4.15(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-s4ZSBwZrvpY0IDzRtD7C5CY8FA/8ZIYqrJZHnwrf6mkUVA+Y+A6CtwBYyxml6VKgP/3DFNqCqkBQGInZuPHzmQ==} + /next@13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-eHfnru9x6NRmTMcjQp6Nz0J4XH9OubmzOa7CkWL+AUrUxpibub3vWwttjduu9No16dug1kq04hiUUpo7J3m3Xw==} engines: {node: '>=16.8.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 + fibers: '>= 3.1.0' react: ^18.2.0 react-dom: ^18.2.0 sass: ^1.3.0 peerDependenciesMeta: '@opentelemetry/api': optional: true + fibers: + optional: true sass: optional: true dependencies: - '@next/env': 13.4.15 + '@next/env': 13.4.12 '@swc/helpers': 0.5.1 busboy: 1.6.0 caniuse-lite: 1.0.30001522 @@ -8885,15 +8888,15 @@ packages: watchpack: 2.4.0 zod: 3.21.4 optionalDependencies: - '@next/swc-darwin-arm64': 13.4.15 - '@next/swc-darwin-x64': 13.4.15 - '@next/swc-linux-arm64-gnu': 13.4.15 - '@next/swc-linux-arm64-musl': 13.4.15 - '@next/swc-linux-x64-gnu': 13.4.15 - '@next/swc-linux-x64-musl': 13.4.15 - '@next/swc-win32-arm64-msvc': 13.4.15 - '@next/swc-win32-ia32-msvc': 13.4.15 - '@next/swc-win32-x64-msvc': 13.4.15 + '@next/swc-darwin-arm64': 13.4.12 + '@next/swc-darwin-x64': 13.4.12 + '@next/swc-linux-arm64-gnu': 13.4.12 + '@next/swc-linux-arm64-musl': 13.4.12 + '@next/swc-linux-x64-gnu': 13.4.12 + '@next/swc-linux-x64-musl': 13.4.12 + '@next/swc-win32-arm64-msvc': 13.4.12 + '@next/swc-win32-ia32-msvc': 13.4.12 + '@next/swc-win32-x64-msvc': 13.4.12 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a5cb70c3..632db85a 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -110,12 +110,7 @@ export default function RootLayout({ } return ( - + From f8761b8e7bf93a087b48529596cbf2d95405d4f9 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 16:11:39 +0100 Subject: [PATCH 03/12] feat: use common components --- package.json | 1 - pnpm-lock.yaml | 19 ---- .../[subdomain]/editor/portfolio-editor.tsx | 103 +++++++++--------- src/components/dashboard/PublishButton.tsx | 63 ++++------- 4 files changed, 72 insertions(+), 114 deletions(-) diff --git a/package.json b/package.json index c687aa28..cd67a340 100644 --- a/package.json +++ b/package.json @@ -151,7 +151,6 @@ "unified": "10.1.2", "unist-builder": "4.0.0", "unist-util-visit": "5.0.0", - "use-onclickoutside": "0.4.1", "uuid": "9.0.0", "viem": "1.6.7", "wagmi": "1.3.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b21dc340..33926b90 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -368,9 +368,6 @@ dependencies: unist-util-visit: specifier: 5.0.0 version: 5.0.0 - use-onclickoutside: - specifier: 0.4.1 - version: 0.4.1(@types/react@18.2.21)(react@18.2.0) uuid: specifier: 9.0.0 version: 9.0.0 @@ -4137,10 +4134,6 @@ packages: smoothscroll: 0.4.0 dev: false - /are-passive-events-supported@1.1.1: - resolution: {integrity: sha512-5wnvlvB/dTbfrCvJ027Y4L4gW/6Mwoy1uFSavney0YO++GU+0e/flnjiBBwH+1kh7xNCgCOGvmJC3s32joYbww==} - dev: false - /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} @@ -11456,18 +11449,6 @@ packages: use-isomorphic-layout-effect: 1.1.2(@types/react@18.2.21)(react@18.2.0) dev: false - /use-onclickoutside@0.4.1(@types/react@18.2.21)(react@18.2.0): - resolution: {integrity: sha512-hAo1viJ9D2mPffUig4EWCwE4as7fq84HANk3MCkY3rhXk5oMl0mjLCLF/OhzWIhTaITcAcDDcnaxRdMHPq+sww==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - are-passive-events-supported: 1.1.1 - react: 18.2.0 - use-latest: 1.2.1(@types/react@18.2.21)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - dev: false - /use-sidecar@1.1.2(@types/react@18.2.21)(react@18.2.0): resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} engines: {node: '>=10'} diff --git a/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx b/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx index 35b5a3cc..f393b229 100644 --- a/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx @@ -226,61 +226,56 @@ export default function PortfolioEditor() { return ( <> - -
- {page.isLoading ? ( -
- {t("Loading")}... + + {page.isLoading ? ( +
+ {t("Loading")}... +
+ ) : ( + <> + +
+
+ + + {t(visibility as string)} + +
- ) : ( - <> -
- -
-
-
- - - {t(visibility as string)} - -
-
- - )} -
+ + )} ) diff --git a/src/components/dashboard/PublishButton.tsx b/src/components/dashboard/PublishButton.tsx index fc9a0cdc..3a1d6658 100644 --- a/src/components/dashboard/PublishButton.tsx +++ b/src/components/dashboard/PublishButton.tsx @@ -1,6 +1,8 @@ -import { useEffect, useRef, useState } from "react" -import useOnClickOutside from "use-onclickoutside" +import { useState } from "react" +import { Placement } from "@floating-ui/react" + +import { Menu } from "~/components//ui/Menu" import { DeleteConfirmationModal } from "~/components/common/DeleteConfirmationModal" import { useTranslation } from "~/lib/i18n/client" import { NoteType } from "~/lib/types" @@ -17,6 +19,7 @@ export const PublishButton = ({ isModified, twitterShareUrl, type, + placement = "bottom-end", }: { savePage: () => void deletePage: () => void @@ -27,23 +30,10 @@ export const PublishButton = ({ type: NoteType isModified: boolean discardChanges: () => void + placement?: Placement }) => { - const [showDropdown, setShowDropdown] = useState(false) - const dropdownRef = useRef(null) - const triggerRef = useRef(null) const { t } = useTranslation("dashboard") - useOnClickOutside(dropdownRef, (e) => { - if (triggerRef.current?.contains(e.target as any)) return - setShowDropdown(false) - }) - - useEffect(() => { - if (isSaving) { - setShowDropdown(false) - } - }, [isSaving]) - const [deleteConfirmModalOpen, setDeleteConfirmModalOpen] = useState(false) @@ -60,26 +50,19 @@ export const PublishButton = ({ {t(published ? "Update" : "Publish")} {published && ( - - )} - - {showDropdown && ( -
-
- {published && ( + + + + } + dropdown={
- )} -
-
- )} + } + /> + )} + Date: Thu, 24 Aug 2023 18:09:16 +0100 Subject: [PATCH 04/12] chore(deps): bump viem from 1.6.7 to 1.7.0 (#951) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 54 +++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index c687aa28..544a1e47 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "unist-util-visit": "5.0.0", "use-onclickoutside": "0.4.1", "uuid": "9.0.0", - "viem": "1.6.7", + "viem": "1.7.0", "wagmi": "1.3.10", "zustand": "4.4.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b21dc340..6e3eff2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -375,11 +375,11 @@ dependencies: specifier: 9.0.0 version: 9.0.0 viem: - specifier: 1.6.7 - version: 1.6.7(typescript@5.1.6)(zod@3.22.2) + specifier: 1.7.0 + version: 1.7.0(typescript@5.1.6)(zod@3.22.2) wagmi: specifier: 1.3.10 - version: 1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) + version: 1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) zustand: specifier: 4.4.1 version: 4.4.1(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0) @@ -1116,8 +1116,8 @@ packages: '@mantine/hooks': 6.0.19(react@18.2.0) '@mantine/notifications': 6.0.19(@mantine/core@6.0.19)(@mantine/hooks@6.0.19)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': 4.33.0(react-dom@18.2.0)(react@18.2.0) - '@wagmi/connectors': 2.7.0(@wagmi/chains@1.7.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) - '@web3modal/ethereum': 2.7.1(@wagmi/core@1.3.9)(viem@1.6.7) + '@wagmi/connectors': 2.7.0(@wagmi/chains@1.7.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) + '@web3modal/ethereum': 2.7.1(@wagmi/core@1.3.9)(viem@1.7.0) canvas-confetti: 1.6.0 check-password-strength: 2.0.7 classnames: 2.3.2 @@ -1133,8 +1133,8 @@ packages: react-google-recaptcha: 3.1.0(react@18.2.0) rxjs: 7.8.1 ts-essentials: 9.3.2(typescript@5.1.6) - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) - wagmi: 1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) + wagmi: 1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) zustand: 4.4.1(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0) transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -1160,7 +1160,7 @@ packages: '@crossbell/util-hooks': 1.5.11(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(zod@3.22.2) crossbell: 1.6.1(typescript@5.1.6)(zod@3.22.2) react: 18.2.0 - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) transitivePeerDependencies: - bufferutil - react-dom @@ -1178,7 +1178,7 @@ packages: dayjs: 1.11.9 lodash.compact: 3.0.1 lru-cache: 10.0.1 - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) transitivePeerDependencies: - bufferutil - react @@ -1210,8 +1210,8 @@ packages: dayjs: 1.11.9 react: 18.2.0 react-intersection-observer: 9.5.2(react@18.2.0) - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) - wagmi: 1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) + wagmi: 1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) zustand: 4.4.1(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0) transitivePeerDependencies: - '@types/react' @@ -1242,7 +1242,7 @@ packages: react: 18.2.0 rxjs: 7.8.1 ts-essentials: 9.3.2(typescript@5.1.6) - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) zustand: 4.4.1(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0) transitivePeerDependencies: - '@types/react' @@ -2726,7 +2726,7 @@ packages: resolution: {integrity: sha512-gYw0ki/EAuV1oSyMxpqandHjnthZjYYy+YWpTAzf8BqfXM3ItcZLpjxfg+3+mXW8HIO+3jw6T9iiqEXsqHaMMw==} dependencies: '@safe-global/safe-gateway-typescript-sdk': 3.7.3 - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) transitivePeerDependencies: - bufferutil - encoding @@ -3352,7 +3352,7 @@ packages: typescript: 5.1.6 dev: false - /@wagmi/connectors@2.7.0(@wagmi/chains@1.7.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2): + /@wagmi/connectors@2.7.0(@wagmi/chains@1.7.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2): resolution: {integrity: sha512-1KOL0HTJl5kzSC/YdKwFwiokr6poUQn1V/tcT0TpG3iH2x0lSM7FTkvCjVVY/6lKzTXrLlo9y2aE7AsOPnkvqg==} peerDependencies: '@wagmi/chains': '>=1.7.0' @@ -3376,7 +3376,7 @@ packages: abitype: 0.8.7(typescript@5.1.6)(zod@3.22.2) eventemitter3: 4.0.7 typescript: 5.1.6 - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - bufferutil @@ -3388,7 +3388,7 @@ packages: - zod dev: false - /@wagmi/core@1.3.9(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2): + /@wagmi/core@1.3.9(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2): resolution: {integrity: sha512-SrnABCrsDvhiMCLLLyzyHnZbEumsFT/XWlJJQZeyEDcixL95R7XQwOaaoRI4MpNilCtMtu3jzN57tA5Z2iA+kw==} peerDependencies: typescript: '>=5.0.4' @@ -3398,11 +3398,11 @@ packages: optional: true dependencies: '@wagmi/chains': 1.7.0(typescript@5.1.6) - '@wagmi/connectors': 2.7.0(@wagmi/chains@1.7.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) + '@wagmi/connectors': 2.7.0(@wagmi/chains@1.7.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) abitype: 0.8.7(typescript@5.1.6)(zod@3.22.2) eventemitter3: 4.0.7 typescript: 5.1.6 - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) zustand: 4.4.1(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0) transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -3790,14 +3790,14 @@ packages: tslib: 1.14.1 dev: false - /@web3modal/ethereum@2.7.1(@wagmi/core@1.3.9)(viem@1.6.7): + /@web3modal/ethereum@2.7.1(@wagmi/core@1.3.9)(viem@1.7.0): resolution: {integrity: sha512-1x3qhYh9qgtvw1MDQD4VeDf2ZOsVANKRPtUty4lF+N4L8xnAIwvNKUAMA4j6T5xSsjqUfq5Tdy5mYsNxLmsWMA==} peerDependencies: '@wagmi/core': '>=1' viem: '>=1' dependencies: - '@wagmi/core': 1.3.9(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + '@wagmi/core': 1.3.9(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) dev: false /@webassemblyjs/ast@1.11.6: @@ -4917,7 +4917,7 @@ packages: eip1193-types: 0.2.1 exponential-backoff: 3.1.1 p-limit: 3.1.0 - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) transitivePeerDependencies: - bufferutil - typescript @@ -11598,8 +11598,8 @@ packages: vfile-message: 4.0.2 dev: false - /viem@1.6.7(typescript@5.1.6)(zod@3.22.2): - resolution: {integrity: sha512-w2OMJqKcQrzPQnmMFxe4ex+md8wSwfle6L3LvEi25CBvDKhkuljVrsWY19UzG05ssQhiZ+cdxU3YMBrX817Qiw==} + /viem@1.7.0(typescript@5.1.6)(zod@3.22.2): + resolution: {integrity: sha512-S4SclYe0Oca6TuPh2YPI3BzfC7a4UvN7TRDCWwpoVNnu9+4z2hqCZhW+6aF1yufgSwdezNsF14vztE/P4eMdBw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -11647,7 +11647,7 @@ packages: xml-name-validator: 4.0.0 dev: false - /wagmi@1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2): + /wagmi@1.3.10(@types/react@18.2.21)(immer@10.0.2)(react-dom@18.2.0)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2): resolution: {integrity: sha512-MMGJcnxOmeUZWDmzUxgRGcB1cqxbJoSFSa+pNY4vBCWMz0n4ptpE5F8FKISLCx+BGoDwsaz2ldcMALcdJZ+29w==} peerDependencies: react: '>=17.0.0' @@ -11660,12 +11660,12 @@ packages: '@tanstack/query-sync-storage-persister': 4.29.25 '@tanstack/react-query': 4.33.0(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query-persist-client': 4.29.25(@tanstack/react-query@4.33.0) - '@wagmi/core': 1.3.9(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0)(typescript@5.1.6)(viem@1.6.7)(zod@3.22.2) + '@wagmi/core': 1.3.9(@types/react@18.2.21)(immer@10.0.2)(react@18.2.0)(typescript@5.1.6)(viem@1.7.0)(zod@3.22.2) abitype: 0.8.7(typescript@5.1.6)(zod@3.22.2) react: 18.2.0 typescript: 5.1.6 use-sync-external-store: 1.2.0(react@18.2.0) - viem: 1.6.7(typescript@5.1.6)(zod@3.22.2) + viem: 1.7.0(typescript@5.1.6)(zod@3.22.2) transitivePeerDependencies: - '@react-native-async-storage/async-storage' - '@types/react' From a5d37bb4dea0ee9e13fcc93dd4951b4a1d10efaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:09:27 +0100 Subject: [PATCH 05/12] chore(deps-dev): bump @types/node from 20.5.3 to 20.5.4 (#950) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 544a1e47..748e83cd 100644 --- a/package.json +++ b/package.json @@ -170,7 +170,7 @@ "@types/katex": "0.16.2", "@types/mdast": "4.0.0", "@types/mjml": "4.7.1", - "@types/node": "20.5.3", + "@types/node": "20.5.4", "@types/pangu": "4.0.0", "@types/prismjs": "1.26.0", "@types/react": "18.2.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e3eff2c..8233eb98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -422,8 +422,8 @@ devDependencies: specifier: 4.7.1 version: 4.7.1 '@types/node': - specifier: 20.5.3 - version: 20.5.3 + specifier: 20.5.4 + version: 20.5.4 '@types/pangu': specifier: 4.0.0 version: 4.0.0 @@ -3037,7 +3037,7 @@ packages: /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 20.5.3 + '@types/node': 20.5.4 dev: false /@types/cookie@0.5.1: @@ -3150,7 +3150,7 @@ packages: /@types/node-fetch@2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 20.5.3 + '@types/node': 20.5.4 form-data: 3.0.1 dev: false @@ -3162,8 +3162,8 @@ packages: resolution: {integrity: sha512-Av/7MqX/iNKwT9Tr60V85NqMnsmh8ilfJoBlIVibkXfitk9Q22D9Y5mSpm+FvG5DET7EbVfB40bOiLzKgYFgPw==} dev: false - /@types/node@20.5.3: - resolution: {integrity: sha512-ITI7rbWczR8a/S6qjAW7DMqxqFMjjTo61qZVWJ1ubPvbIQsL5D/TvwjYEalM8Kthpe3hTzOGrF2TGbAu2uyqeA==} + /@types/node@20.5.4: + resolution: {integrity: sha512-Y9vbIAoM31djQZrPYjpTLo0XlaSwOIsrlfE3LpulZeRblttsLQRFRlBAppW0LOxyT3ALj2M5vU1ucQQayQH3jA==} /@types/pangu@4.0.0: resolution: {integrity: sha512-da3b6P7QDH41VdfF2xRE8/KgL06nX3RawfiIMAvJ/sYzLWQCQtxc+B3qWVtrIlrNlSgV/e1oG2SZYUpN6gvmhQ==} @@ -3248,13 +3248,13 @@ packages: /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 20.5.3 + '@types/node': 20.5.4 dev: false /@types/ws@8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: - '@types/node': 20.5.3 + '@types/node': 20.5.4 dev: false /@typescript-eslint/parser@6.4.0(eslint@8.47.0)(typescript@5.1.6): @@ -7503,7 +7503,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 20.5.3 + '@types/node': 20.5.4 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true From 6a94e3d4ebe9e309ba7cb694b87130e403793d2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:09:37 +0100 Subject: [PATCH 06/12] chore(deps): bump langchain from 0.0.132 to 0.0.133 (#949) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 748e83cd..599cc558 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "jsdom": "22.1.0", "jsonfeed-to-rss": "3.0.7", "katex": "0.16.8", - "langchain": "0.0.132", + "langchain": "0.0.133", "lottie-react": "2.4.0", "mdast-util-to-hast": "12.3.0", "mdast-util-toc": "7.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8233eb98..925685fd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -183,8 +183,8 @@ dependencies: specifier: 0.16.8 version: 0.16.8 langchain: - specifier: 0.0.132 - version: 0.0.132(cheerio@1.0.0-rc.12)(ioredis@5.3.2)(jsdom@22.1.0) + specifier: 0.0.133 + version: 0.0.133(cheerio@1.0.0-rc.12)(ioredis@5.3.2)(jsdom@22.1.0) lottie-react: specifier: 2.4.0 version: 2.4.0(react-dom@18.2.0)(react@18.2.0) @@ -7692,8 +7692,8 @@ packages: engines: {node: '>=6'} dev: false - /langchain@0.0.132(cheerio@1.0.0-rc.12)(ioredis@5.3.2)(jsdom@22.1.0): - resolution: {integrity: sha512-gXnuiAhsQQqXheKQiaSmFa9s3S/Yhkkb9OCytu04OE0ecttvVvfjjqIoNVS9vor8V7kRUgYPKHJsMz2UFDoJNw==} + /langchain@0.0.133(cheerio@1.0.0-rc.12)(ioredis@5.3.2)(jsdom@22.1.0): + resolution: {integrity: sha512-AVieepmeOso+32+bdGPX02qpHRh3Eff7r+gVe6GkR8KyMsl+FW7JFvXLhBTpO5pdzFQoNL/UtCBQkvHxEdmW3Q==} engines: {node: '>=18'} peerDependencies: '@aws-crypto/sha256-js': ^5.0.0 From b34856fa2e40746434539a61a29864fb79033d05 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 18:17:08 +0100 Subject: [PATCH 07/12] feat: dashboard layout style --- src/components/dashboard/DashboardMain.tsx | 4 +++- src/components/dashboard/DashboardTopbar.tsx | 12 ++---------- src/lib/i18n/locales/zh/dashboard.json | 3 ++- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/dashboard/DashboardMain.tsx b/src/components/dashboard/DashboardMain.tsx index e6cb8e1c..565a7518 100644 --- a/src/components/dashboard/DashboardMain.tsx +++ b/src/components/dashboard/DashboardMain.tsx @@ -19,7 +19,9 @@ export const DashboardMain = ({ return (
React.ReactNode }) => { - const [isOpen, setIsOpen] = useState(false) - return (
@@ -32,13 +30,7 @@ export const DashboardTopbar = ({ > - { - setIsOpen(true) - }} - > + Date: Thu, 24 Aug 2023 18:37:54 +0100 Subject: [PATCH 08/12] feat: PublishedModal component --- .../[subdomain]/editor/portfolio-editor.tsx | 34 +----------- .../[subdomain]/editor/post-editor.tsx | 47 +--------------- src/components/dashboard/PagesManager.tsx | 2 +- src/components/dashboard/PublishedModal.tsx | 53 +++++++++++++++++++ src/lib/i18n/locales/zh/dashboard.json | 2 +- 5 files changed, 59 insertions(+), 79 deletions(-) create mode 100644 src/components/dashboard/PublishedModal.tsx diff --git a/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx b/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx index f393b229..b590a2cc 100644 --- a/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/portfolio-editor.tsx @@ -10,12 +10,12 @@ import { useQueryClient } from "@tanstack/react-query" import { DashboardMain } from "~/components/dashboard/DashboardMain" import { PublishButton } from "~/components/dashboard/PublishButton" +import PublishedModal from "~/components/dashboard/PublishedModal" import { Button } from "~/components/ui/Button" import { FieldLabel } from "~/components/ui/FieldLabel" import { ImageUploader } from "~/components/ui/ImageUploader" import { Input } from "~/components/ui/Input" -import { ModalContentProps, useModalStack } from "~/components/ui/ModalStack" -import { UniLink } from "~/components/ui/UniLink" +import { useModalStack } from "~/components/ui/ModalStack" import { initialEditorState, useEditorState } from "~/hooks/useEditorState" import { useBeforeMounted } from "~/hooks/useSyncOnce" import { showConfetti } from "~/lib/confetti" @@ -433,33 +433,3 @@ const EditorExtraProperties = memo(() => { }) EditorExtraProperties.displayName = "EditorExtraProperties" - -const PublishedModal = ({ - dismiss, - transactionUrl, -}: ModalContentProps<{ - transactionUrl: string -}>) => { - const { t } = useTranslation("dashboard") - return ( - <> -
- {t( - "Your post has been securely stored on the blockchain. Now you may want to", - )} -
    -
  • - - {t("View the transaction")} - -
  • -
-
-
- -
- - ) -} diff --git a/src/app/dashboard/[subdomain]/editor/post-editor.tsx b/src/app/dashboard/[subdomain]/editor/post-editor.tsx index 1ae6487b..5d4d7c03 100644 --- a/src/app/dashboard/[subdomain]/editor/post-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/post-editor.tsx @@ -25,12 +25,13 @@ import { useQueryClient } from "@tanstack/react-query" import { DashboardMain } from "~/components/dashboard/DashboardMain" import { OptionsButton } from "~/components/dashboard/OptionsButton" import { PublishButton } from "~/components/dashboard/PublishButton" +import PublishedModal from "~/components/dashboard/PublishedModal" import { Button } from "~/components/ui/Button" import { EditorToolbar } from "~/components/ui/EditorToolbar" import { FieldLabel } from "~/components/ui/FieldLabel" import { ImageUploader } from "~/components/ui/ImageUploader" import { Input } from "~/components/ui/Input" -import { ModalContentProps, useModalStack } from "~/components/ui/ModalStack" +import { useModalStack } from "~/components/ui/ModalStack" import { Switch } from "~/components/ui/Switch" import { TagInput } from "~/components/ui/TagInput" import { UniLink } from "~/components/ui/UniLink" @@ -986,47 +987,3 @@ const EditorAdvancedModal: FC<{
) } - -const PublishedModal = ({ - dismiss, - postUrl, - transactionUrl, - twitterShareUrl, -}: ModalContentProps<{ - postUrl: string - transactionUrl: string - twitterShareUrl: string -}>) => { - const { t } = useTranslation("dashboard") - return ( - <> -
- {t( - "Your post has been securely stored on the blockchain. Now you may want to", - )} -
    -
  • - - {t("View the post")} - -
  • -
  • - - {t("View the transaction")} - -
  • -
  • - - {t("Share to Twitter")} - -
  • -
-
-
- -
- - ) -} diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index 164d6c5d..c473dcc1 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -225,7 +225,7 @@ export const PagesManager = ({ type }: { type: NoteType }) => { {t(`New ${type.charAt(0).toUpperCase() + type.slice(1)}`)} - {type !== "portfolio" && ( + {(type === "post" || type === "page") && ( ) { + const { t } = useTranslation("dashboard") + + return ( + <> +
+ {t( + "Your publication has been securely stored on the blockchain. Now you may want to", + )} +
    + {postUrl && ( +
  • + + {t("View the post")} + +
  • + )} +
  • + + {t("View the transaction")} + +
  • + {twitterShareUrl && ( +
  • + + {t("Share to Twitter")} + +
  • + )} +
+
+
+ +
+ + ) +} diff --git a/src/lib/i18n/locales/zh/dashboard.json b/src/lib/i18n/locales/zh/dashboard.json index 9c7a163a..b7c5e940 100644 --- a/src/lib/i18n/locales/zh/dashboard.json +++ b/src/lib/i18n/locales/zh/dashboard.json @@ -141,7 +141,7 @@ "More": "更多", "Meet New Friends": "认识新朋友", "Need help?": "需要帮助?", - "Your post has been securely stored on the blockchain. Now you may want to": "你的文章已经安全地存储在区块链上。现在你可能想要", + "Your publication has been securely stored on the blockchain. Now you may want to": "你的发布已经安全地存储在区块链上。现在你可能想要", "View the post": "查看文章", "View the transaction": "查看交易", "Share to Twitter": "分享到 Twitter", From b1f54707a0df9a21c94fdc81b0a539d9a106e8f1 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 19:56:11 +0100 Subject: [PATCH 09/12] fix: async client component --- src/app/@modal/(.)post/[site]/[slug]/page.tsx | 3 +++ src/app/site/[site]/[slug]/page.tsx | 5 +++-- src/app/site/[site]/layout.tsx | 6 +++--- src/components/common/PageContent.tsx | 7 +++---- src/lib/is-only-client.ts | 17 ----------------- src/lib/is-only-content.ts | 11 +++++++++++ 6 files changed, 23 insertions(+), 26 deletions(-) delete mode 100644 src/lib/is-only-client.ts create mode 100644 src/lib/is-only-content.ts diff --git a/src/app/@modal/(.)post/[site]/[slug]/page.tsx b/src/app/@modal/(.)post/[site]/[slug]/page.tsx index 0f6a19cb..a72a27ff 100644 --- a/src/app/@modal/(.)post/[site]/[slug]/page.tsx +++ b/src/app/@modal/(.)post/[site]/[slug]/page.tsx @@ -9,6 +9,7 @@ import PostMeta from "~/components/site/PostMeta" import { SiteHeader } from "~/components/site/SiteHeader" import { getTranslation } from "~/lib/i18n" import { toCid } from "~/lib/ipfs-parser" +import { isOnlyContent } from "~/lib/is-only-content" import getQueryClient from "~/lib/query-client" import { cn } from "~/lib/utils" import { fetchGetPage, getSummary } from "~/queries/page.server" @@ -53,6 +54,7 @@ export default async function SiteModal({ lang: i18n.resolvedLanguage, }) } + const onlyContent = isOnlyContent() return ( @@ -97,6 +99,7 @@ export default async function SiteModal({ page={page} site={site} withActions={false} + onlyContent={onlyContent} /> diff --git a/src/app/site/[site]/[slug]/page.tsx b/src/app/site/[site]/[slug]/page.tsx index d793d4b5..aa63e6f2 100644 --- a/src/app/site/[site]/[slug]/page.tsx +++ b/src/app/site/[site]/[slug]/page.tsx @@ -13,7 +13,7 @@ import { getSiteLink } from "~/lib/helpers" import { getTranslation } from "~/lib/i18n" import { toCid, toGateway } from "~/lib/ipfs-parser" import { isInRN } from "~/lib/is-in-rn" -import { isOnlyContent } from "~/lib/is-only-client" +import { isOnlyContent } from "~/lib/is-only-content" import getQueryClient from "~/lib/query-client" import { fetchGetPage, getSummary } from "~/queries/page.server" import { fetchGetSite } from "~/queries/site.server" @@ -103,7 +103,7 @@ export default async function SitePagePage({ } const dehydratedState = dehydrate(queryClient) - const onlyContent = await isOnlyContent() + const onlyContent = isOnlyContent() function addPageJsonLd() { return { @@ -176,6 +176,7 @@ export default async function SitePagePage({ page={page} site={site} withActions={true} + onlyContent={onlyContent} /> { - let search - if (isServerSide()) { - const { headers } = await import("next/headers") - search = headers().get("x-xlog-search") - } else { - search = window.location.search - } - - return new URLSearchParams(search?.substring(1) || "") -} - -export const isOnlyContent = async () => { - return (await searchParser()).get("only-content") -} diff --git a/src/lib/is-only-content.ts b/src/lib/is-only-content.ts new file mode 100644 index 00000000..af152e36 --- /dev/null +++ b/src/lib/is-only-content.ts @@ -0,0 +1,11 @@ +import { headers } from "next/headers" + +export const searchParser = () => { + const search = headers().get("x-xlog-search") + + return new URLSearchParams(search?.substring(1) || "") +} + +export const isOnlyContent = () => { + return !!searchParser().get("only-content") +} From 44f374912891ff6ff76df40670ae082d0f39fb7b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 20:00:26 +0100 Subject: [PATCH 10/12] feat: DualColumnEditor component --- .../[subdomain]/editor/post-editor.tsx | 239 +--------------- src/components/dashboard/DualColumnEditor.tsx | 264 ++++++++++++++++++ 2 files changed, 273 insertions(+), 230 deletions(-) create mode 100644 src/components/dashboard/DualColumnEditor.tsx diff --git a/src/app/dashboard/[subdomain]/editor/post-editor.tsx b/src/app/dashboard/[subdomain]/editor/post-editor.tsx index 5d4d7c03..35787d97 100644 --- a/src/app/dashboard/[subdomain]/editor/post-editor.tsx +++ b/src/app/dashboard/[subdomain]/editor/post-editor.tsx @@ -1,20 +1,8 @@ "use client" -import { useDebounceEffect } from "ahooks" -import type { Root } from "mdast" import { nanoid } from "nanoid" -import dynamic from "next/dynamic" import { useParams, useRouter, useSearchParams } from "next/navigation" -import { - ChangeEvent, - FC, - memo, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from "react" +import { ChangeEvent, FC, memo, useCallback, useEffect, useState } from "react" import toast from "react-hot-toast" import { shallow } from "zustand/shallow" @@ -23,6 +11,7 @@ import { DateInput } from "@mantine/dates" import { useQueryClient } from "@tanstack/react-query" import { DashboardMain } from "~/components/dashboard/DashboardMain" +import DualColumnEditor from "~/components/dashboard/DualColumnEditor" import { OptionsButton } from "~/components/dashboard/OptionsButton" import { PublishButton } from "~/components/dashboard/PublishButton" import PublishedModal from "~/components/dashboard/PublishedModal" @@ -35,8 +24,7 @@ import { useModalStack } from "~/components/ui/ModalStack" import { Switch } from "~/components/ui/Switch" import { TagInput } from "~/components/ui/TagInput" import { UniLink } from "~/components/ui/UniLink" -import { toolbarShortcuts, toolbars } from "~/editor" -import { editorUpload } from "~/editor/Multimedia" +import { toolbars } from "~/editor" import { Values, initialEditorState, @@ -45,7 +33,6 @@ import { import { useGetState } from "~/hooks/useGetState" import { useIsMobileLayout } from "~/hooks/useMobileLayout" import { useBeforeMounted } from "~/hooks/useSyncOnce" -import { useUploadFile } from "~/hooks/useUploadFile" import { showConfetti } from "~/lib/confetti" import { RESERVED_TAGS } from "~/lib/constants" import { getDefaultSlug } from "~/lib/default-slug" @@ -56,7 +43,6 @@ import { getPageVisibility } from "~/lib/page-helpers" import { delStorage, setStorage } from "~/lib/storage" import { ExpandedNote, NoteType, PageVisibilityEnum } from "~/lib/types" import { cn, pick } from "~/lib/utils" -import { Rendered, renderPageContent } from "~/markdown" import { checkPageSlug } from "~/models/page.model" import { useCreatePage, @@ -67,30 +53,6 @@ import { } from "~/queries/page" import { useGetSite } from "~/queries/site" -const DynamicCodeMirrorEditor = dynamic( - () => import("~/components/ui/CodeMirror"), - { - ssr: false, - loading: () => ( -
- Loading... -
- ), - }, -) - -const DynamicPageContent = dynamic( - () => import("~/components/common/PageContent"), - { - ssr: false, - loading: () => ( -
- Loading... -
- ), - }, -) - export default function PostEditor() { const router = useRouter() const queryClient = useQueryClient() @@ -160,8 +122,6 @@ export default function PostEditor() { } }, [page.isSuccess, page.data]) - const uploadFile = useUploadFile() - // reset editor state when page changes useBeforeMounted(() => { useEditorState.setState({ @@ -392,27 +352,7 @@ export default function PostEditor() { ) }, [page.data, subdomain, draftKey, site.data?.characterId]) - const [currentScrollArea, setCurrentScrollArea] = useState("") const [view, setView] = useState() - const [tree, setTree] = useState() - - // preview - - const [parsedContent, setParsedContent] = useState() - - useDebounceEffect( - () => { - const result = renderPageContent(values.content) - setTree(result.tree) - setParsedContent(result) - }, - [values.content], - { - wait: 500, - }, - ) - - const previewRef = useRef(null) // editor const onCreateEditor = useCallback( @@ -429,115 +369,6 @@ export default function PostEditor() { [updateValue], ) - const handleDropFile = useCallback( - async (file: File) => { - if (view) { - editorUpload(file, view) - } - }, - [uploadFile, view], - ) - - const computedPosition = useCallback(() => { - let previewChildNodes = previewRef.current?.childNodes[0]?.childNodes - const editorElementList: number[] = [] - const previewElementList: number[] = [] - if (view?.state && previewChildNodes) { - tree?.children.forEach((child, index) => { - if ( - child.position && - previewChildNodes?.[index] && - (child as any).tagName !== "style" - ) { - if (child.position.start.line > view.state.doc.lines) return - const line = view.state?.doc.line(child.position.start.line) - const block = view.lineBlockAt(line.from) - if (block) { - editorElementList.push(block.top) - previewElementList.push( - (previewChildNodes[index] as HTMLElement).offsetTop, - ) - } - } - }) - } - return { - editorElementList, - previewElementList, - } - }, [view, tree]) - - const onScroll = useCallback( - (scrollTop: number, area: string) => { - if ( - currentScrollArea === area && - previewRef.current?.parentElement && - view - ) { - const position = computedPosition() - - let selfElement - let selfPosition - let targetElement - let targetPosition - if (area === "preview") { - selfElement = previewRef.current.parentElement - selfPosition = position.previewElementList - targetElement = view.scrollDOM - targetPosition = position.editorElementList - } else { - selfElement = view.scrollDOM - selfPosition = position.editorElementList - targetElement = previewRef.current.parentElement - targetPosition = position.previewElementList - } - - let scrollElementIndex = 0 - for (let i = 0; i < selfPosition.length; i++) { - if (scrollTop < selfPosition[i]) { - scrollElementIndex = i - 1 - break - } - } - - // scroll to bottom - if (scrollTop >= selfElement.scrollHeight - selfElement.clientHeight) { - targetElement.scrollTop = - targetElement.scrollHeight - targetElement.clientHeight - return - } - - // scroll to position - if (scrollElementIndex >= 0) { - let ratio = - (scrollTop - selfPosition[scrollElementIndex]) / - (selfPosition[scrollElementIndex + 1] - - selfPosition[scrollElementIndex]) - targetElement.scrollTop = - ratio * - (targetPosition[scrollElementIndex + 1] - - targetPosition[scrollElementIndex]) + - targetPosition[scrollElementIndex] - } - } - }, - [view, computedPosition, currentScrollArea], - ) - - const onEditorScroll = useCallback( - (scrollTop: number) => { - onScroll(scrollTop, "editor") - }, - [onScroll], - ) - - const onPreviewScroll = useCallback( - (scrollTop: number) => { - onScroll(scrollTop, "preview") - }, - [onScroll], - ) - const onPreviewButtonClick = useCallback(() => { window.open( `/site/${subdomain}/preview/${draftKey.replace( @@ -568,18 +399,6 @@ export default function PostEditor() { } }, [draftKey, site.data?.characterId]) - const cmStyle = useMemo( - () => ({ - ".cm-scroller": { - padding: "0 1.25rem", - }, - ".cm-content": { - paddingBottom: "600px", - }, - }), - [], - ) - return ( <> @@ -686,52 +505,12 @@ export default function PostEditor() { placeholder={t("Title goes here...") || ""} />
-
- {!(isMobileLayout && isRendering) && ( - { - setCurrentScrollArea("editor") - }} - className={cn( - "h-full flex-1", - isRendering ? "border-r" : "", - )} - shortcuts={toolbarShortcuts} - /> - )} - {!isMobileLayout && ( -
-
setIsRendering(!isRendering)} - > - {isRendering ? ( - - ) : ( - - )} -
-
- )} - {isRendering && ( - { - setCurrentScrollArea("preview") - }} - /> - )} +
+
{!isMobileLayout && ( diff --git a/src/components/dashboard/DualColumnEditor.tsx b/src/components/dashboard/DualColumnEditor.tsx new file mode 100644 index 00000000..af39273a --- /dev/null +++ b/src/components/dashboard/DualColumnEditor.tsx @@ -0,0 +1,264 @@ +import { useDebounceEffect } from "ahooks" +import type { Root } from "mdast" +import dynamic from "next/dynamic" +import { useCallback, useEffect, useMemo, useRef, useState } from "react" + +import { EditorView } from "@codemirror/view" + +import { toolbarShortcuts } from "~/editor" +import { editorUpload } from "~/editor/Multimedia" +import { useIsMobileLayout } from "~/hooks/useMobileLayout" +import { useUploadFile } from "~/hooks/useUploadFile" +import { useTranslation } from "~/lib/i18n/client" +import { cn } from "~/lib/utils" +import { Rendered, renderPageContent } from "~/markdown" + +const DynamicCodeMirrorEditor = dynamic( + () => import("~/components/ui/CodeMirror"), + { + ssr: false, + loading: () => ( +
+ Loading... +
+ ), + }, +) + +const DynamicPageContent = dynamic( + () => import("~/components/common/PageContent"), + { + ssr: false, + loading: () => ( +
+ Loading... +
+ ), + }, +) + +export default function DualColumnEditor({ + initialContent, + onChange, + onCreateEditor, +}: { + initialContent: string + onChange: (value: string) => void + onCreateEditor: (view: EditorView) => void +}) { + const isMobileLayout = useIsMobileLayout() + const [isRendering, setIsRendering] = useState(!isMobileLayout) + const { t } = useTranslation("dashboard") + const uploadFile = useUploadFile() + + const [currentScrollArea, setCurrentScrollArea] = useState("") + const [view, setView] = useState() + const [tree, setTree] = useState() + const [values, setValues] = useState("") + + // preview + const [parsedContent, setParsedContent] = useState() + + useEffect(() => { + setValues(initialContent) + }, [initialContent]) + + useDebounceEffect( + () => { + const result = renderPageContent(values) + setTree(result.tree) + setParsedContent(result) + }, + [values], + { + wait: 500, + }, + ) + + const previewRef = useRef(null) + + // editor + const onCreateEditorInside = useCallback( + (view: EditorView) => { + setView?.(view) + onCreateEditor?.(view) + }, + [setView], + ) + + const handleDropFile = useCallback( + async (file: File) => { + if (view) { + editorUpload(file, view) + } + }, + [uploadFile, view], + ) + + const computedPosition = useCallback(() => { + let previewChildNodes = previewRef.current?.childNodes[0]?.childNodes + const editorElementList: number[] = [] + const previewElementList: number[] = [] + if (view?.state && previewChildNodes) { + tree?.children.forEach((child, index) => { + if ( + child.position && + previewChildNodes?.[index] && + (child as any).tagName !== "style" + ) { + if (child.position.start.line > view.state.doc.lines) return + const line = view.state?.doc.line(child.position.start.line) + const block = view.lineBlockAt(line.from) + if (block) { + editorElementList.push(block.top) + previewElementList.push( + (previewChildNodes[index] as HTMLElement).offsetTop, + ) + } + } + }) + } + return { + editorElementList, + previewElementList, + } + }, [view, tree]) + + const onScroll = useCallback( + (scrollTop: number, area: string) => { + if ( + currentScrollArea === area && + previewRef.current?.parentElement && + view + ) { + const position = computedPosition() + + let selfElement + let selfPosition + let targetElement + let targetPosition + if (area === "preview") { + selfElement = previewRef.current.parentElement + selfPosition = position.previewElementList + targetElement = view.scrollDOM + targetPosition = position.editorElementList + } else { + selfElement = view.scrollDOM + selfPosition = position.editorElementList + targetElement = previewRef.current.parentElement + targetPosition = position.previewElementList + } + + let scrollElementIndex = 0 + for (let i = 0; i < selfPosition.length; i++) { + if (scrollTop < selfPosition[i]) { + scrollElementIndex = i - 1 + break + } + } + + // scroll to bottom + if (scrollTop >= selfElement.scrollHeight - selfElement.clientHeight) { + targetElement.scrollTop = + targetElement.scrollHeight - targetElement.clientHeight + return + } + + // scroll to position + if (scrollElementIndex >= 0) { + let ratio = + (scrollTop - selfPosition[scrollElementIndex]) / + (selfPosition[scrollElementIndex + 1] - + selfPosition[scrollElementIndex]) + targetElement.scrollTop = + ratio * + (targetPosition[scrollElementIndex + 1] - + targetPosition[scrollElementIndex]) + + targetPosition[scrollElementIndex] + } + } + }, + [view, computedPosition, currentScrollArea], + ) + + const onEditorScroll = useCallback( + (scrollTop: number) => { + onScroll(scrollTop, "editor") + }, + [onScroll], + ) + + const onPreviewScroll = useCallback( + (scrollTop: number) => { + onScroll(scrollTop, "preview") + }, + [onScroll], + ) + + const cmStyle = useMemo( + () => ({ + ".cm-scroller": { + padding: "0 1.25rem", + }, + ".cm-content": { + paddingBottom: "600px", + }, + }), + [], + ) + + const onChangeInside = useCallback( + (value: string) => { + setValues(value) + onChange(value) + }, + [setValues, onChange], + ) + + return ( +
+ {!(isMobileLayout && isRendering) && ( + { + setCurrentScrollArea("editor") + }} + className={cn("h-full flex-1", isRendering ? "border-r" : "")} + shortcuts={toolbarShortcuts} + /> + )} + {!isMobileLayout && ( +
+
setIsRendering(!isRendering)} + > + {isRendering ? ( + + ) : ( + + )} +
+
+ )} + {isRendering && ( + { + setCurrentScrollArea("preview") + }} + /> + )} +
+ ) +} From b4af802d4ecf498e7c33b73f1429f128319ed199 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 20:05:45 +0100 Subject: [PATCH 11/12] chore: upgrade nextjs --- package.json | 2 +- pnpm-lock.yaml | 140 +++++++++++++++++++++++++++---------------------- 2 files changed, 77 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index ebbd2603..2ee3119e 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "medium-zoom": "1.0.8", "mermaid": "10.3.1", "nanoid": "4.0.2", - "next": "13.4.12", + "next": "13.4.19", "next-themes": "0.2.1", "node-id3": "0.2.6", "open-graph-scraper": "^6.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5ba0255..d305227f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,11 +204,11 @@ dependencies: specifier: 4.0.2 version: 4.0.2 next: - specifier: 13.4.12 - version: 13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) + specifier: 13.4.19 + version: 13.4.19(@babel/core@7.22.11)(react-dom@18.2.0)(react@18.2.0) next-themes: specifier: 0.2.1 - version: 0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0) + version: 0.2.1(next@13.4.19)(react-dom@18.2.0)(react@18.2.0) node-id3: specifier: 0.2.6 version: 0.2.6 @@ -456,7 +456,7 @@ devDependencies: version: 10.4.15(postcss@8.4.28) babel-loader: specifier: 9.1.3 - version: 9.1.3(@babel/core@7.22.10)(webpack@5.88.2) + version: 9.1.3(@babel/core@7.22.11)(webpack@5.88.2) cspell: specifier: 7.0.1 version: 7.0.1 @@ -569,20 +569,20 @@ packages: resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} - /@babel/core@7.22.10: - resolution: {integrity: sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==} + /@babel/core@7.22.11: + resolution: {integrity: sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.22.10 '@babel/generator': 7.22.10 '@babel/helper-compilation-targets': 7.22.10 - '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.10) - '@babel/helpers': 7.22.10 - '@babel/parser': 7.22.10 + '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.11) + '@babel/helpers': 7.22.11 + '@babel/parser': 7.22.11 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.10 - '@babel/types': 7.22.10 + '@babel/traverse': 7.22.11 + '@babel/types': 7.22.11 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -642,13 +642,13 @@ packages: dependencies: '@babel/types': 7.22.10 - /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.10): + /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.11): resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-module-imports': 7.22.5 '@babel/helper-simple-access': 7.22.5 @@ -659,7 +659,7 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} @@ -679,13 +679,13 @@ packages: resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} - /@babel/helpers@7.22.10: - resolution: {integrity: sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==} + /@babel/helpers@7.22.11: + resolution: {integrity: sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/traverse': 7.22.10 - '@babel/types': 7.22.10 + '@babel/traverse': 7.22.11 + '@babel/types': 7.22.11 transitivePeerDependencies: - supports-color @@ -704,6 +704,13 @@ packages: dependencies: '@babel/types': 7.22.10 + /@babel/parser@7.22.11: + resolution: {integrity: sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.22.11 + /@babel/runtime@7.22.10: resolution: {integrity: sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==} engines: {node: '>=6.9.0'} @@ -736,8 +743,8 @@ packages: - supports-color dev: true - /@babel/traverse@7.22.10: - resolution: {integrity: sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==} + /@babel/traverse@7.22.11: + resolution: {integrity: sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.10 @@ -746,8 +753,8 @@ packages: '@babel/helper-function-name': 7.22.5 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.22.10 - '@babel/types': 7.22.10 + '@babel/parser': 7.22.11 + '@babel/types': 7.22.11 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -769,6 +776,14 @@ packages: '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 + /@babel/types@7.22.11: + resolution: {integrity: sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.22.5 + '@babel/helper-validator-identifier': 7.22.5 + to-fast-properties: 2.0.0 + /@birdgg/react-github@0.2.3(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-VIwpLdZYf/oiRneMmkwiQU3F9TmuSgfZ1bp2IImeCB3xwyVYIkjTY41gh1XkQoidLdiS4J35FUmibJxgpiLjoQ==} peerDependencies: @@ -2421,8 +2436,8 @@ packages: - utf-8-validate dev: true - /@next/env@13.4.12: - resolution: {integrity: sha512-RmHanbV21saP/6OEPBJ7yJMuys68cIf8OBBWd7+uj40LdpmswVAwe1uzeuFyUsd6SfeITWT3XnQfn6wULeKwDQ==} + /@next/env@13.4.19: + resolution: {integrity: sha512-FsAT5x0jF2kkhNkKkukhsyYOrRqtSxrEhfliniIq0bwWbuXLgyt3Gv0Ml+b91XwjwArmuP7NxCiGd++GGKdNMQ==} dev: false /@next/eslint-plugin-next@13.4.19: @@ -2431,8 +2446,8 @@ packages: glob: 7.1.7 dev: true - /@next/swc-darwin-arm64@13.4.12: - resolution: {integrity: sha512-deUrbCXTMZ6ZhbOoloqecnUeNpUOupi8SE2tx4jPfNS9uyUR9zK4iXBvH65opVcA/9F5I/p8vDXSYbUlbmBjZg==} + /@next/swc-darwin-arm64@13.4.19: + resolution: {integrity: sha512-vv1qrjXeGbuF2mOkhkdxMDtv9np7W4mcBtaDnHU+yJG+bBwa6rYsYSCI/9Xm5+TuF5SbZbrWO6G1NfTh1TMjvQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -2440,8 +2455,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@13.4.12: - resolution: {integrity: sha512-WRvH7RxgRHlC1yb5oG0ZLx8F7uci9AivM5/HGGv9ZyG2Als8Ij64GC3d+mQ5sJhWjusyU6T6V1WKTUoTmOB0zQ==} + /@next/swc-darwin-x64@13.4.19: + resolution: {integrity: sha512-jyzO6wwYhx6F+7gD8ddZfuqO4TtpJdw3wyOduR4fxTUCm3aLw7YmHGYNjS0xRSYGAkLpBkH1E0RcelyId6lNsw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -2449,8 +2464,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@13.4.12: - resolution: {integrity: sha512-YEKracAWuxp54tKiAvvq73PUs9lok57cc8meYRibTWe/VdPB2vLgkTVWFcw31YDuRXdEhdX0fWS6Q+ESBhnEig==} + /@next/swc-linux-arm64-gnu@13.4.19: + resolution: {integrity: sha512-vdlnIlaAEh6H+G6HrKZB9c2zJKnpPVKnA6LBwjwT2BTjxI7e0Hx30+FoWCgi50e+YO49p6oPOtesP9mXDRiiUg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2458,8 +2473,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@13.4.12: - resolution: {integrity: sha512-LhJR7/RAjdHJ2Isl2pgc/JaoxNk0KtBgkVpiDJPVExVWA1c6gzY57+3zWuxuyWzTG+fhLZo2Y80pLXgIJv7g3g==} + /@next/swc-linux-arm64-musl@13.4.19: + resolution: {integrity: sha512-aU0HkH2XPgxqrbNRBFb3si9Ahu/CpaR5RPmN2s9GiM9qJCiBBlZtRTiEca+DC+xRPyCThTtWYgxjWHgU7ZkyvA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2467,8 +2482,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@13.4.12: - resolution: {integrity: sha512-1DWLL/B9nBNiQRng+1aqs3OaZcxC16Nf+mOnpcrZZSdyKHek3WQh6j/fkbukObgNGwmCoVevLUa/p3UFTTqgqg==} + /@next/swc-linux-x64-gnu@13.4.19: + resolution: {integrity: sha512-htwOEagMa/CXNykFFeAHHvMJeqZfNQEoQvHfsA4wgg5QqGNqD5soeCer4oGlCol6NGUxknrQO6VEustcv+Md+g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2476,8 +2491,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@13.4.12: - resolution: {integrity: sha512-kEAJmgYFhp0VL+eRWmUkVxLVunn7oL9Mdue/FS8yzRBVj7Z0AnIrHpTIeIUl1bbdQq1VaoOztnKicAjfkLTRCQ==} + /@next/swc-linux-x64-musl@13.4.19: + resolution: {integrity: sha512-4Gj4vvtbK1JH8ApWTT214b3GwUh9EKKQjY41hH/t+u55Knxi/0wesMzwQRhppK6Ddalhu0TEttbiJ+wRcoEj5Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2485,8 +2500,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@13.4.12: - resolution: {integrity: sha512-GMLuL/loR6yIIRTnPRY6UGbLL9MBdw2anxkOnANxvLvsml4F0HNIgvnU3Ej4BjbqMTNjD4hcPFdlEow4XHPdZA==} + /@next/swc-win32-arm64-msvc@13.4.19: + resolution: {integrity: sha512-bUfDevQK4NsIAHXs3/JNgnvEY+LRyneDN788W2NYiRIIzmILjba7LaQTfihuFawZDhRtkYCv3JDC3B4TwnmRJw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -2494,8 +2509,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@13.4.12: - resolution: {integrity: sha512-PhgNqN2Vnkm7XaMdRmmX0ZSwZXQAtamBVSa9A/V1dfKQCV1rjIZeiy/dbBnVYGdj63ANfsOR/30XpxP71W0eww==} + /@next/swc-win32-ia32-msvc@13.4.19: + resolution: {integrity: sha512-Y5kikILFAr81LYIFaw6j/NrOtmiM4Sf3GtOc0pn50ez2GCkr+oejYuKGcwAwq3jiTKuzF6OF4iT2INPoxRycEA==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -2503,8 +2518,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@13.4.12: - resolution: {integrity: sha512-Z+56e/Ljt0bUs+T+jPjhFyxYBcdY2RIq9ELFU+qAMQMteHo7ymbV7CKmlcX59RI9C4YzN8PgMgLyAoi916b5HA==} + /@next/swc-win32-x64-msvc@13.4.19: + resolution: {integrity: sha512-YzA78jBDXMYiINdPdJJwGgPNT3YqBNNGhsthsDoWHL9p24tEJn9ViQf/ZqTbwSpX/RrkPupLfuuTH2sf73JBAw==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -4331,14 +4346,14 @@ packages: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} dev: false - /babel-loader@9.1.3(@babel/core@7.22.10)(webpack@5.88.2): + /babel-loader@9.1.3(@babel/core@7.22.11)(webpack@5.88.2): resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} engines: {node: '>= 14.15.0'} peerDependencies: '@babel/core': ^7.12.0 webpack: '>=5' dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 find-cache-dir: 4.0.0 schema-utils: 4.2.0 webpack: 5.88.2(esbuild@0.19.2) @@ -8840,56 +8855,53 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /next-themes@0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0): + /next-themes@0.2.1(next@13.4.19)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} peerDependencies: next: '*' react: '*' react-dom: '*' dependencies: - next: 13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) + next: 13.4.19(@babel/core@7.22.11)(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@13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-eHfnru9x6NRmTMcjQp6Nz0J4XH9OubmzOa7CkWL+AUrUxpibub3vWwttjduu9No16dug1kq04hiUUpo7J3m3Xw==} + /next@13.4.19(@babel/core@7.22.11)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-HuPSzzAbJ1T4BD8e0bs6B9C1kWQ6gv8ykZoRWs5AQoiIuqbGHHdQO7Ljuvg05Q0Z24E2ABozHe6FxDvI6HfyAw==} engines: {node: '>=16.8.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 - fibers: '>= 3.1.0' react: ^18.2.0 react-dom: ^18.2.0 sass: ^1.3.0 peerDependenciesMeta: '@opentelemetry/api': optional: true - fibers: - optional: true sass: optional: true dependencies: - '@next/env': 13.4.12 + '@next/env': 13.4.19 '@swc/helpers': 0.5.1 busboy: 1.6.0 caniuse-lite: 1.0.30001522 postcss: 8.4.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.22.10)(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.22.11)(react@18.2.0) watchpack: 2.4.0 zod: 3.21.4 optionalDependencies: - '@next/swc-darwin-arm64': 13.4.12 - '@next/swc-darwin-x64': 13.4.12 - '@next/swc-linux-arm64-gnu': 13.4.12 - '@next/swc-linux-arm64-musl': 13.4.12 - '@next/swc-linux-x64-gnu': 13.4.12 - '@next/swc-linux-x64-musl': 13.4.12 - '@next/swc-win32-arm64-msvc': 13.4.12 - '@next/swc-win32-ia32-msvc': 13.4.12 - '@next/swc-win32-x64-msvc': 13.4.12 + '@next/swc-darwin-arm64': 13.4.19 + '@next/swc-darwin-x64': 13.4.19 + '@next/swc-linux-arm64-gnu': 13.4.19 + '@next/swc-linux-arm64-musl': 13.4.19 + '@next/swc-linux-x64-gnu': 13.4.19 + '@next/swc-linux-x64-musl': 13.4.19 + '@next/swc-win32-arm64-msvc': 13.4.19 + '@next/swc-win32-ia32-msvc': 13.4.19 + '@next/swc-win32-x64-msvc': 13.4.19 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -10770,7 +10782,7 @@ packages: inline-style-parser: 0.1.1 dev: false - /styled-jsx@5.1.1(@babel/core@7.22.10)(react@18.2.0): + /styled-jsx@5.1.1(@babel/core@7.22.11)(react@18.2.0): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: @@ -10783,7 +10795,7 @@ packages: babel-plugin-macros: optional: true dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 client-only: 0.0.1 react: 18.2.0 dev: false From 47bb21ec252113337998dd6e934b568b6888d346 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 24 Aug 2023 20:32:47 +0100 Subject: [PATCH 12/12] Revert "chore: upgrade nextjs" This reverts commit b4af802d4ecf498e7c33b73f1429f128319ed199. --- package.json | 2 +- pnpm-lock.yaml | 140 ++++++++++++++++++++++--------------------------- 2 files changed, 65 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index 2ee3119e..ebbd2603 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "medium-zoom": "1.0.8", "mermaid": "10.3.1", "nanoid": "4.0.2", - "next": "13.4.19", + "next": "13.4.12", "next-themes": "0.2.1", "node-id3": "0.2.6", "open-graph-scraper": "^6.2.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d305227f..f5ba0255 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,11 +204,11 @@ dependencies: specifier: 4.0.2 version: 4.0.2 next: - specifier: 13.4.19 - version: 13.4.19(@babel/core@7.22.11)(react-dom@18.2.0)(react@18.2.0) + specifier: 13.4.12 + version: 13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0) next-themes: specifier: 0.2.1 - version: 0.2.1(next@13.4.19)(react-dom@18.2.0)(react@18.2.0) + version: 0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0) node-id3: specifier: 0.2.6 version: 0.2.6 @@ -456,7 +456,7 @@ devDependencies: version: 10.4.15(postcss@8.4.28) babel-loader: specifier: 9.1.3 - version: 9.1.3(@babel/core@7.22.11)(webpack@5.88.2) + version: 9.1.3(@babel/core@7.22.10)(webpack@5.88.2) cspell: specifier: 7.0.1 version: 7.0.1 @@ -569,20 +569,20 @@ packages: resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} - /@babel/core@7.22.11: - resolution: {integrity: sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==} + /@babel/core@7.22.10: + resolution: {integrity: sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.22.10 '@babel/generator': 7.22.10 '@babel/helper-compilation-targets': 7.22.10 - '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.11) - '@babel/helpers': 7.22.11 - '@babel/parser': 7.22.11 + '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.10) + '@babel/helpers': 7.22.10 + '@babel/parser': 7.22.10 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.11 - '@babel/types': 7.22.11 + '@babel/traverse': 7.22.10 + '@babel/types': 7.22.10 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -642,13 +642,13 @@ packages: dependencies: '@babel/types': 7.22.10 - /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.11): + /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.10): resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.10 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-module-imports': 7.22.5 '@babel/helper-simple-access': 7.22.5 @@ -659,7 +659,7 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.11 + '@babel/types': 7.22.10 /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} @@ -679,13 +679,13 @@ packages: resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} - /@babel/helpers@7.22.11: - resolution: {integrity: sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==} + /@babel/helpers@7.22.10: + resolution: {integrity: sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/traverse': 7.22.11 - '@babel/types': 7.22.11 + '@babel/traverse': 7.22.10 + '@babel/types': 7.22.10 transitivePeerDependencies: - supports-color @@ -704,13 +704,6 @@ packages: dependencies: '@babel/types': 7.22.10 - /@babel/parser@7.22.11: - resolution: {integrity: sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.22.11 - /@babel/runtime@7.22.10: resolution: {integrity: sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==} engines: {node: '>=6.9.0'} @@ -743,8 +736,8 @@ packages: - supports-color dev: true - /@babel/traverse@7.22.11: - resolution: {integrity: sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==} + /@babel/traverse@7.22.10: + resolution: {integrity: sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.10 @@ -753,8 +746,8 @@ packages: '@babel/helper-function-name': 7.22.5 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.22.11 - '@babel/types': 7.22.11 + '@babel/parser': 7.22.10 + '@babel/types': 7.22.10 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -776,14 +769,6 @@ packages: '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 - /@babel/types@7.22.11: - resolution: {integrity: sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.5 - to-fast-properties: 2.0.0 - /@birdgg/react-github@0.2.3(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-VIwpLdZYf/oiRneMmkwiQU3F9TmuSgfZ1bp2IImeCB3xwyVYIkjTY41gh1XkQoidLdiS4J35FUmibJxgpiLjoQ==} peerDependencies: @@ -2436,8 +2421,8 @@ packages: - utf-8-validate dev: true - /@next/env@13.4.19: - resolution: {integrity: sha512-FsAT5x0jF2kkhNkKkukhsyYOrRqtSxrEhfliniIq0bwWbuXLgyt3Gv0Ml+b91XwjwArmuP7NxCiGd++GGKdNMQ==} + /@next/env@13.4.12: + resolution: {integrity: sha512-RmHanbV21saP/6OEPBJ7yJMuys68cIf8OBBWd7+uj40LdpmswVAwe1uzeuFyUsd6SfeITWT3XnQfn6wULeKwDQ==} dev: false /@next/eslint-plugin-next@13.4.19: @@ -2446,8 +2431,8 @@ packages: glob: 7.1.7 dev: true - /@next/swc-darwin-arm64@13.4.19: - resolution: {integrity: sha512-vv1qrjXeGbuF2mOkhkdxMDtv9np7W4mcBtaDnHU+yJG+bBwa6rYsYSCI/9Xm5+TuF5SbZbrWO6G1NfTh1TMjvQ==} + /@next/swc-darwin-arm64@13.4.12: + resolution: {integrity: sha512-deUrbCXTMZ6ZhbOoloqecnUeNpUOupi8SE2tx4jPfNS9uyUR9zK4iXBvH65opVcA/9F5I/p8vDXSYbUlbmBjZg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -2455,8 +2440,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64@13.4.19: - resolution: {integrity: sha512-jyzO6wwYhx6F+7gD8ddZfuqO4TtpJdw3wyOduR4fxTUCm3aLw7YmHGYNjS0xRSYGAkLpBkH1E0RcelyId6lNsw==} + /@next/swc-darwin-x64@13.4.12: + resolution: {integrity: sha512-WRvH7RxgRHlC1yb5oG0ZLx8F7uci9AivM5/HGGv9ZyG2Als8Ij64GC3d+mQ5sJhWjusyU6T6V1WKTUoTmOB0zQ==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -2464,8 +2449,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu@13.4.19: - resolution: {integrity: sha512-vdlnIlaAEh6H+G6HrKZB9c2zJKnpPVKnA6LBwjwT2BTjxI7e0Hx30+FoWCgi50e+YO49p6oPOtesP9mXDRiiUg==} + /@next/swc-linux-arm64-gnu@13.4.12: + resolution: {integrity: sha512-YEKracAWuxp54tKiAvvq73PUs9lok57cc8meYRibTWe/VdPB2vLgkTVWFcw31YDuRXdEhdX0fWS6Q+ESBhnEig==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2473,8 +2458,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl@13.4.19: - resolution: {integrity: sha512-aU0HkH2XPgxqrbNRBFb3si9Ahu/CpaR5RPmN2s9GiM9qJCiBBlZtRTiEca+DC+xRPyCThTtWYgxjWHgU7ZkyvA==} + /@next/swc-linux-arm64-musl@13.4.12: + resolution: {integrity: sha512-LhJR7/RAjdHJ2Isl2pgc/JaoxNk0KtBgkVpiDJPVExVWA1c6gzY57+3zWuxuyWzTG+fhLZo2Y80pLXgIJv7g3g==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -2482,8 +2467,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu@13.4.19: - resolution: {integrity: sha512-htwOEagMa/CXNykFFeAHHvMJeqZfNQEoQvHfsA4wgg5QqGNqD5soeCer4oGlCol6NGUxknrQO6VEustcv+Md+g==} + /@next/swc-linux-x64-gnu@13.4.12: + resolution: {integrity: sha512-1DWLL/B9nBNiQRng+1aqs3OaZcxC16Nf+mOnpcrZZSdyKHek3WQh6j/fkbukObgNGwmCoVevLUa/p3UFTTqgqg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2491,8 +2476,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl@13.4.19: - resolution: {integrity: sha512-4Gj4vvtbK1JH8ApWTT214b3GwUh9EKKQjY41hH/t+u55Knxi/0wesMzwQRhppK6Ddalhu0TEttbiJ+wRcoEj5Q==} + /@next/swc-linux-x64-musl@13.4.12: + resolution: {integrity: sha512-kEAJmgYFhp0VL+eRWmUkVxLVunn7oL9Mdue/FS8yzRBVj7Z0AnIrHpTIeIUl1bbdQq1VaoOztnKicAjfkLTRCQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -2500,8 +2485,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc@13.4.19: - resolution: {integrity: sha512-bUfDevQK4NsIAHXs3/JNgnvEY+LRyneDN788W2NYiRIIzmILjba7LaQTfihuFawZDhRtkYCv3JDC3B4TwnmRJw==} + /@next/swc-win32-arm64-msvc@13.4.12: + resolution: {integrity: sha512-GMLuL/loR6yIIRTnPRY6UGbLL9MBdw2anxkOnANxvLvsml4F0HNIgvnU3Ej4BjbqMTNjD4hcPFdlEow4XHPdZA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -2509,8 +2494,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc@13.4.19: - resolution: {integrity: sha512-Y5kikILFAr81LYIFaw6j/NrOtmiM4Sf3GtOc0pn50ez2GCkr+oejYuKGcwAwq3jiTKuzF6OF4iT2INPoxRycEA==} + /@next/swc-win32-ia32-msvc@13.4.12: + resolution: {integrity: sha512-PhgNqN2Vnkm7XaMdRmmX0ZSwZXQAtamBVSa9A/V1dfKQCV1rjIZeiy/dbBnVYGdj63ANfsOR/30XpxP71W0eww==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -2518,8 +2503,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc@13.4.19: - resolution: {integrity: sha512-YzA78jBDXMYiINdPdJJwGgPNT3YqBNNGhsthsDoWHL9p24tEJn9ViQf/ZqTbwSpX/RrkPupLfuuTH2sf73JBAw==} + /@next/swc-win32-x64-msvc@13.4.12: + resolution: {integrity: sha512-Z+56e/Ljt0bUs+T+jPjhFyxYBcdY2RIq9ELFU+qAMQMteHo7ymbV7CKmlcX59RI9C4YzN8PgMgLyAoi916b5HA==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -4346,14 +4331,14 @@ packages: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} dev: false - /babel-loader@9.1.3(@babel/core@7.22.11)(webpack@5.88.2): + /babel-loader@9.1.3(@babel/core@7.22.10)(webpack@5.88.2): resolution: {integrity: sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw==} engines: {node: '>= 14.15.0'} peerDependencies: '@babel/core': ^7.12.0 webpack: '>=5' dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.10 find-cache-dir: 4.0.0 schema-utils: 4.2.0 webpack: 5.88.2(esbuild@0.19.2) @@ -8855,53 +8840,56 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /next-themes@0.2.1(next@13.4.19)(react-dom@18.2.0)(react@18.2.0): + /next-themes@0.2.1(next@13.4.12)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} peerDependencies: next: '*' react: '*' react-dom: '*' dependencies: - next: 13.4.19(@babel/core@7.22.11)(react-dom@18.2.0)(react@18.2.0) + next: 13.4.12(@babel/core@7.22.10)(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@13.4.19(@babel/core@7.22.11)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-HuPSzzAbJ1T4BD8e0bs6B9C1kWQ6gv8ykZoRWs5AQoiIuqbGHHdQO7Ljuvg05Q0Z24E2ABozHe6FxDvI6HfyAw==} + /next@13.4.12(@babel/core@7.22.10)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-eHfnru9x6NRmTMcjQp6Nz0J4XH9OubmzOa7CkWL+AUrUxpibub3vWwttjduu9No16dug1kq04hiUUpo7J3m3Xw==} engines: {node: '>=16.8.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 + fibers: '>= 3.1.0' react: ^18.2.0 react-dom: ^18.2.0 sass: ^1.3.0 peerDependenciesMeta: '@opentelemetry/api': optional: true + fibers: + optional: true sass: optional: true dependencies: - '@next/env': 13.4.19 + '@next/env': 13.4.12 '@swc/helpers': 0.5.1 busboy: 1.6.0 caniuse-lite: 1.0.30001522 postcss: 8.4.14 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - styled-jsx: 5.1.1(@babel/core@7.22.11)(react@18.2.0) + styled-jsx: 5.1.1(@babel/core@7.22.10)(react@18.2.0) watchpack: 2.4.0 zod: 3.21.4 optionalDependencies: - '@next/swc-darwin-arm64': 13.4.19 - '@next/swc-darwin-x64': 13.4.19 - '@next/swc-linux-arm64-gnu': 13.4.19 - '@next/swc-linux-arm64-musl': 13.4.19 - '@next/swc-linux-x64-gnu': 13.4.19 - '@next/swc-linux-x64-musl': 13.4.19 - '@next/swc-win32-arm64-msvc': 13.4.19 - '@next/swc-win32-ia32-msvc': 13.4.19 - '@next/swc-win32-x64-msvc': 13.4.19 + '@next/swc-darwin-arm64': 13.4.12 + '@next/swc-darwin-x64': 13.4.12 + '@next/swc-linux-arm64-gnu': 13.4.12 + '@next/swc-linux-arm64-musl': 13.4.12 + '@next/swc-linux-x64-gnu': 13.4.12 + '@next/swc-linux-x64-musl': 13.4.12 + '@next/swc-win32-arm64-msvc': 13.4.12 + '@next/swc-win32-ia32-msvc': 13.4.12 + '@next/swc-win32-x64-msvc': 13.4.12 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -10782,7 +10770,7 @@ packages: inline-style-parser: 0.1.1 dev: false - /styled-jsx@5.1.1(@babel/core@7.22.11)(react@18.2.0): + /styled-jsx@5.1.1(@babel/core@7.22.10)(react@18.2.0): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} peerDependencies: @@ -10795,7 +10783,7 @@ packages: babel-plugin-macros: optional: true dependencies: - '@babel/core': 7.22.11 + '@babel/core': 7.22.10 client-only: 0.0.1 react: 18.2.0 dev: false