From fd93cd47ea2a48f4059f1bbeb1beff32cc333e49 Mon Sep 17 00:00:00 2001 From: Oliver Pan <2216991777@qq.com> Date: Tue, 31 Oct 2023 01:07:58 -0500 Subject: [PATCH] chore: upgraded to next 14 --- apps/web/app/actions.ts | 5 + .../toolbar/plugin/readability.plugin.tsx | 78 +++++++++ pnpm-lock.yaml | 164 +++++++++++------- 3 files changed, 187 insertions(+), 60 deletions(-) create mode 100644 apps/web/app/actions.ts create mode 100644 apps/web/components/toolbar/plugin/readability.plugin.tsx diff --git a/apps/web/app/actions.ts b/apps/web/app/actions.ts new file mode 100644 index 0000000..0b5a9d5 --- /dev/null +++ b/apps/web/app/actions.ts @@ -0,0 +1,5 @@ +"use server"; +import { cookies } from "next/headers"; +export const handleToggleReadability = async (value: string) => { + await cookies().set("showReadability", value); +}; diff --git a/apps/web/components/toolbar/plugin/readability.plugin.tsx b/apps/web/components/toolbar/plugin/readability.plugin.tsx new file mode 100644 index 0000000..28601c4 --- /dev/null +++ b/apps/web/components/toolbar/plugin/readability.plugin.tsx @@ -0,0 +1,78 @@ +import { handleToggleReadability } from "@/app/actions"; +import { useColorStore } from "@/store/store"; +import { Switch } from "@ui/components/ui/switch"; +import { Label } from "@ui/components/ui/label"; +import { Fragment } from "react"; + +function ReadabilityPlugin() { + const { showReadability } = useColorStore(); + return ( + +
+

Contrast Ratio Guide

+

+ The border styles around the color values indicate their contrast + ratios, as defined by the{" "} + + W3C Web Content Accessibility Guidelines + + : +

+ +

+ Note: The left number represents the contrast ratio of{" "} + current color to foreground color, + and the right number represents the contrast ratio of{" "} + current color to background color. +

+
+
+ + { + handleToggleReadability(`${c}`); + useColorStore.setState({ showReadability: c }); + }} + checked={showReadability} + aria-label="Toggle Readability" + /> +
+
+ ); +} + +export default ReadabilityPlugin; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7903096..da60e92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,19 +39,19 @@ importers: install: ^0.13.0 jsonwebtoken: ^9.0.2 lucide-react: ^0.284.0 - next: ^13.5.4 + next: ^14.0.1 next-themes: ^0.2.1 postcss: ^8.4.24 prettier: ^3.0.3 react: ^18.2.0 react-colorful: ^5.6.1 react-dom: ^18.2.0 - recharts: ^2.9.0 - tailwindcss: ^3.3.3 + recharts: ^2.9.1 + tailwindcss: ^3.3.5 tailwindcss-animate: ^1.0.6 tinycolor2: ^1.6.0 tsconfig: workspace:* - typescript: 5.1.6 + typescript: 5.2.2 ui: workspace:* zustand: ^4.4.3 dependencies: @@ -63,18 +63,18 @@ importers: immer: 10.0.3 jsonwebtoken: 9.0.2 lucide-react: 0.284.0_react@18.2.0 - next: 13.5.6_biqbaboplfbrettd7655fr4n2y - next-themes: 0.2.1_geniznlzs656uacumbd4vvx6ke + next: 14.0.1_biqbaboplfbrettd7655fr4n2y + next-themes: 0.2.1_d44gvanaswtczdkus3z7hvpazm react: 18.2.0 react-colorful: 5.6.1_biqbaboplfbrettd7655fr4n2y react-dom: 18.2.0_react@18.2.0 - recharts: 2.9.0_v2m5e27vhdewzwhryxwfaorcca + recharts: 2.9.1_v2m5e27vhdewzwhryxwfaorcca tinycolor2: 1.6.0 ui: link:../../packages/ui zustand: 4.4.4_35aqkvjpbnve2gkm3iisp5rtbi devDependencies: - '@tailwindcss/container-queries': 0.1.1_tailwindcss@3.3.3 - '@tailwindcss/typography': 0.5.10_tailwindcss@3.3.3 + '@tailwindcss/container-queries': 0.1.1_tailwindcss@3.3.5 + '@tailwindcss/typography': 0.5.10_tailwindcss@3.3.5 '@types/culori': 2.0.3 '@types/node': 17.0.45 '@types/react': 18.2.31 @@ -84,10 +84,10 @@ importers: install: 0.13.0 postcss: 8.4.31 prettier: 3.0.3 - tailwindcss: 3.3.3 - tailwindcss-animate: 1.0.7_tailwindcss@3.3.3 + tailwindcss: 3.3.5 + tailwindcss-animate: 1.0.7_tailwindcss@3.3.5 tsconfig: link:../../packages/tsconfig - typescript: 5.1.6 + typescript: 5.2.2 packages/eslint-config-custom: specifiers: @@ -396,8 +396,8 @@ packages: call-bind: 1.0.5 dev: true - /@next/env/13.5.6: - resolution: {integrity: sha512-Yac/bV5sBGkkEXmAX5FWPS9Mmo2rthrOPRQQNfycJPkjUAUclomCPH7QFVCDQ4Mp2k2K1SSM6m0zrxYrOwtFQw==} + /@next/env/14.0.1: + resolution: {integrity: sha512-Ms8ZswqY65/YfcjrlcIwMPD7Rg/dVjdLapMcSHG26W6O67EJDF435ShW4H4LXi1xKO1oRc97tLXUpx8jpLe86A==} dev: false /@next/eslint-plugin-next/13.5.6: @@ -406,8 +406,8 @@ packages: glob: 7.1.7 dev: false - /@next/swc-darwin-arm64/13.5.6: - resolution: {integrity: sha512-5nvXMzKtZfvcu4BhtV0KH1oGv4XEW+B+jOfmBdpFI3C7FrB/MfujRpWYSBBO64+qbW8pkZiSyQv9eiwnn5VIQA==} + /@next/swc-darwin-arm64/14.0.1: + resolution: {integrity: sha512-JyxnGCS4qT67hdOKQ0CkgFTp+PXub5W1wsGvIq98TNbF3YEIN7iDekYhYsZzc8Ov0pWEsghQt+tANdidITCLaw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -415,8 +415,8 @@ packages: dev: false optional: true - /@next/swc-darwin-x64/13.5.6: - resolution: {integrity: sha512-6cgBfxg98oOCSr4BckWjLLgiVwlL3vlLj8hXg2b+nDgm4bC/qVXXLfpLB9FHdoDu4057hzywbxKvmYGmi7yUzA==} + /@next/swc-darwin-x64/14.0.1: + resolution: {integrity: sha512-625Z7bb5AyIzswF9hvfZWa+HTwFZw+Jn3lOBNZB87lUS0iuCYDHqk3ujuHCkiyPtSC0xFBtYDLcrZ11mF/ap3w==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -424,8 +424,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-gnu/13.5.6: - resolution: {integrity: sha512-txagBbj1e1w47YQjcKgSU4rRVQ7uF29YpnlHV5xuVUsgCUf2FmyfJ3CPjZUvpIeXCJAoMCFAoGnbtX86BK7+sg==} + /@next/swc-linux-arm64-gnu/14.0.1: + resolution: {integrity: sha512-iVpn3KG3DprFXzVHM09kvb//4CNNXBQ9NB/pTm8LO+vnnnaObnzFdS5KM+w1okwa32xH0g8EvZIhoB3fI3mS1g==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -433,8 +433,8 @@ packages: dev: false optional: true - /@next/swc-linux-arm64-musl/13.5.6: - resolution: {integrity: sha512-cGd+H8amifT86ZldVJtAKDxUqeFyLWW+v2NlBULnLAdWsiuuN8TuhVBt8ZNpCqcAuoruoSWynvMWixTFcroq+Q==} + /@next/swc-linux-arm64-musl/14.0.1: + resolution: {integrity: sha512-mVsGyMxTLWZXyD5sen6kGOTYVOO67lZjLApIj/JsTEEohDDt1im2nkspzfV5MvhfS7diDw6Rp/xvAQaWZTv1Ww==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -442,8 +442,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-gnu/13.5.6: - resolution: {integrity: sha512-Mc2b4xiIWKXIhBy2NBTwOxGD3nHLmq4keFk+d4/WL5fMsB8XdJRdtUlL87SqVCTSaf1BRuQQf1HvXZcy+rq3Nw==} + /@next/swc-linux-x64-gnu/14.0.1: + resolution: {integrity: sha512-wMqf90uDWN001NqCM/auRl3+qVVeKfjJdT9XW+RMIOf+rhUzadmYJu++tp2y+hUbb6GTRhT+VjQzcgg/QTD9NQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -451,8 +451,8 @@ packages: dev: false optional: true - /@next/swc-linux-x64-musl/13.5.6: - resolution: {integrity: sha512-CFHvP9Qz98NruJiUnCe61O6GveKKHpJLloXbDSWRhqhkJdZD2zU5hG+gtVJR//tyW897izuHpM6Gtf6+sNgJPQ==} + /@next/swc-linux-x64-musl/14.0.1: + resolution: {integrity: sha512-ol1X1e24w4j4QwdeNjfX0f+Nza25n+ymY0T2frTyalVczUmzkVD7QGgPTZMHfR1aLrO69hBs0G3QBYaj22J5GQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -460,8 +460,8 @@ packages: dev: false optional: true - /@next/swc-win32-arm64-msvc/13.5.6: - resolution: {integrity: sha512-aFv1ejfkbS7PUa1qVPwzDHjQWQtknzAZWGTKYIAaS4NMtBlk3VyA6AYn593pqNanlicewqyl2jUhQAaFV/qXsg==} + /@next/swc-win32-arm64-msvc/14.0.1: + resolution: {integrity: sha512-WEmTEeWs6yRUEnUlahTgvZteh5RJc4sEjCQIodJlZZ5/VJwVP8p2L7l6VhzQhT4h7KvLx/Ed4UViBdne6zpIsw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -469,8 +469,8 @@ packages: dev: false optional: true - /@next/swc-win32-ia32-msvc/13.5.6: - resolution: {integrity: sha512-XqqpHgEIlBHvzwG8sp/JXMFkLAfGLqkbVsyN+/Ih1mR8INb6YCc2x/Mbwi6hsAgUnqQztz8cvEbHJUbSl7RHDg==} + /@next/swc-win32-ia32-msvc/14.0.1: + resolution: {integrity: sha512-oFpHphN4ygAgZUKjzga7SoH2VGbEJXZa/KL8bHCAwCjDWle6R1SpiGOdUdA8EJ9YsG1TYWpzY6FTbUA+iAJeww==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -478,8 +478,8 @@ packages: dev: false optional: true - /@next/swc-win32-x64-msvc/13.5.6: - resolution: {integrity: sha512-Cqfe1YmOS7k+5mGu92nl5ULkzpKuxJrP3+4AEuPmrpFZ3BHxTY3TnHmU1On3bFmFFs6FbTcdF58CCUProGpIGQ==} + /@next/swc-win32-x64-msvc/14.0.1: + resolution: {integrity: sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1459,15 +1459,15 @@ packages: defer-to-connect: 2.0.1 dev: true - /@tailwindcss/container-queries/0.1.1_tailwindcss@3.3.3: + /@tailwindcss/container-queries/0.1.1_tailwindcss@3.3.5: resolution: {integrity: sha512-p18dswChx6WnTSaJCSGx6lTmrGzNNvm2FtXmiO6AuA1V4U5REyoqwmT6kgAsIMdjo07QdAfYXHJ4hnMtfHzWgA==} peerDependencies: tailwindcss: '>=3.2.0' dependencies: - tailwindcss: 3.3.3 + tailwindcss: 3.3.5 dev: true - /@tailwindcss/typography/0.5.10_tailwindcss@3.3.3: + /@tailwindcss/typography/0.5.10_tailwindcss@3.3.5: resolution: {integrity: sha512-Pe8BuPJQJd3FfRnm6H0ulKIGoMEQS+Vq01R6M5aCrFB/ccR/shT+0kXLjouGC1gFLm9hopTFN+DMP0pfwRWzPw==} peerDependencies: tailwindcss: '>=3.0.0 || insiders' @@ -1476,7 +1476,7 @@ packages: lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 postcss-selector-parser: 6.0.10 - tailwindcss: 3.3.3 + tailwindcss: 3.3.5 dev: true /@tootallnate/quickjs-emscripten/0.23.0: @@ -2198,6 +2198,11 @@ packages: /caniuse-lite/1.0.30001551: resolution: {integrity: sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==} + dev: true + + /caniuse-lite/1.0.30001558: + resolution: {integrity: sha512-/Et7DwLqpjS47JPEcz6VnxU9PwcIdVi0ciLXRWBQdj1XFye68pSQYpV0QtPTfUKWuOaEig+/Vez2l74eDc1tPQ==} + dev: false /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -4380,6 +4385,11 @@ packages: resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} hasBin: true + /jiti/1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} + hasBin: true + dev: true + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -4771,21 +4781,21 @@ packages: type-fest: 2.19.0 dev: true - /next-themes/0.2.1_geniznlzs656uacumbd4vvx6ke: + /next-themes/0.2.1_d44gvanaswtczdkus3z7hvpazm: resolution: {integrity: sha512-B+AKNfYNIzh0vqQQKqQItTS8evEouKD7H5Hj3kmuPERwddR2TxvDSFZuTj6T7Jfn1oyeUyJMydPl1Bkxkh0W7A==} peerDependencies: next: '*' react: '*' react-dom: '*' dependencies: - next: 13.5.6_biqbaboplfbrettd7655fr4n2y + next: 14.0.1_biqbaboplfbrettd7655fr4n2y react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: false - /next/13.5.6_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-Y2wTcTbO4WwEsVb4A8VSnOsG1I9ok+h74q0ZdxkwM3EODqrs4pasq7O0iUxbcS9VtWMicG7f3+HAj0r1+NtKSw==} - engines: {node: '>=16.14.0'} + /next/14.0.1_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-s4YaLpE4b0gmb3ggtmpmV+wt+lPRuGtANzojMQ2+gmBpgX9w5fTbjsy6dXByBuENsdCX5pukZH/GxdFgO62+pA==} + engines: {node: '>=18.17.0'} hasBin: true peerDependencies: '@opentelemetry/api': ^1.1.0 @@ -4798,25 +4808,25 @@ packages: sass: optional: true dependencies: - '@next/env': 13.5.6 + '@next/env': 14.0.1 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001551 + caniuse-lite: 1.0.30001558 postcss: 8.4.31 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 styled-jsx: 5.1.1_react@18.2.0 watchpack: 2.4.0 optionalDependencies: - '@next/swc-darwin-arm64': 13.5.6 - '@next/swc-darwin-x64': 13.5.6 - '@next/swc-linux-arm64-gnu': 13.5.6 - '@next/swc-linux-arm64-musl': 13.5.6 - '@next/swc-linux-x64-gnu': 13.5.6 - '@next/swc-linux-x64-musl': 13.5.6 - '@next/swc-win32-arm64-msvc': 13.5.6 - '@next/swc-win32-ia32-msvc': 13.5.6 - '@next/swc-win32-x64-msvc': 13.5.6 + '@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 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -5602,8 +5612,8 @@ packages: decimal.js-light: 2.5.1 dev: false - /recharts/2.9.0_v2m5e27vhdewzwhryxwfaorcca: - resolution: {integrity: sha512-cVgiAU3W5UrA8nRRV/N0JrudgZzY/vjkzrlShbH+EFo1vs4nMlXgshZWLI0DfDLmn4/p4pF7Lq7F5PU+K94Ipg==} + /recharts/2.9.1_v2m5e27vhdewzwhryxwfaorcca: + resolution: {integrity: sha512-GqHrQVMgDIktzNIIlhtvZnjYurr6Wy+KMSDxO1MEp3CrZZbvisUmnBojSWAZ7j8cjwhD4uRRFga2s5wcd/w9sQ==} engines: {node: '>=12'} peerDependencies: prop-types: ^15.6.0 @@ -6200,6 +6210,15 @@ packages: tailwindcss: '>=3.0.0 || insiders' dependencies: tailwindcss: 3.3.3 + dev: false + + /tailwindcss-animate/1.0.7_tailwindcss@3.3.5: + resolution: {integrity: sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==} + peerDependencies: + tailwindcss: '>=3.0.0 || insiders' + dependencies: + tailwindcss: 3.3.5 + dev: true /tailwindcss/3.3.3: resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} @@ -6231,6 +6250,37 @@ packages: transitivePeerDependencies: - ts-node + /tailwindcss/3.3.5: + resolution: {integrity: sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==} + engines: {node: '>=14.0.0'} + hasBin: true + dependencies: + '@alloc/quick-lru': 5.2.0 + arg: 5.0.2 + chokidar: 3.5.3 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.3.1 + glob-parent: 6.0.2 + is-glob: 4.0.3 + jiti: 1.21.0 + lilconfig: 2.1.0 + micromatch: 4.0.5 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.0.0 + postcss: 8.4.31 + postcss-import: 15.1.0_postcss@8.4.31 + postcss-js: 4.0.1_postcss@8.4.31 + postcss-load-config: 4.0.1_postcss@8.4.31 + postcss-nested: 6.0.1_postcss@8.4.31 + postcss-selector-parser: 6.0.13 + resolve: 1.22.8 + sucrase: 3.34.0 + transitivePeerDependencies: + - ts-node + dev: true + /tapable/2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -6493,12 +6543,6 @@ packages: hasBin: true dev: true - /typescript/5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} - engines: {node: '>=14.17'} - hasBin: true - dev: true - /typescript/5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'}