From 4dea6e400e0458246a2ebc93df45ce25cfe70e5a Mon Sep 17 00:00:00 2001 From: Innei Date: Sat, 10 Jun 2023 17:18:56 +0800 Subject: [PATCH] feat: init query Signed-off-by: Innei --- .env.template | 6 + .gitignore | 4 +- package.json | 7 +- pnpm-lock.yaml | 210 +++++++----- src/app/hydrate.tsx | 8 + src/app/layout.tsx | 23 +- src/app/page.module.css | 271 --------------- src/app/page.tsx | 11 +- src/app/providers.tsx | 10 - src/constants/env.ts | 4 + src/constants/kaomoji.ts | 346 ++++++++++++++++++++ src/constants/meta-icon.ts | 54 +++ src/constants/spring.ts | 19 ++ src/constants/tracker.ts | 5 + src/providers/root/debug-provider.tsx | 18 + src/providers/root/index.tsx | 17 + src/providers/root/react-query-provider.tsx | 60 ++++ src/queries/definition/aggregation.ts | 13 + src/queries/definition/helper.ts | 12 + src/queries/definition/index.ts | 5 + src/queries/hooks/useAggregation.ts | 7 + src/styles/index.css | 2 + src/styles/scrollbar.css | 28 ++ src/styles/uikit.css | 53 +++ src/styles/variables.css | 14 +- src/utils/cookie.ts | 60 ++++ src/utils/query-client.server.ts | 11 + src/utils/request.ts | 41 +++ tailwind.config.ts | 31 +- tsconfig.json | 2 +- 30 files changed, 961 insertions(+), 391 deletions(-) create mode 100644 .env.template create mode 100644 src/app/hydrate.tsx delete mode 100644 src/app/page.module.css delete mode 100644 src/app/providers.tsx create mode 100644 src/constants/env.ts create mode 100644 src/constants/kaomoji.ts create mode 100644 src/constants/meta-icon.ts create mode 100644 src/constants/spring.ts create mode 100644 src/constants/tracker.ts create mode 100644 src/providers/root/debug-provider.tsx create mode 100644 src/providers/root/index.tsx create mode 100644 src/providers/root/react-query-provider.tsx create mode 100644 src/queries/definition/aggregation.ts create mode 100644 src/queries/definition/helper.ts create mode 100644 src/queries/definition/index.ts create mode 100644 src/queries/hooks/useAggregation.ts create mode 100644 src/styles/scrollbar.css create mode 100644 src/styles/uikit.css create mode 100644 src/utils/cookie.ts create mode 100644 src/utils/query-client.server.ts create mode 100644 src/utils/request.ts diff --git a/.env.template b/.env.template new file mode 100644 index 0000000000..9e5ce44660 --- /dev/null +++ b/.env.template @@ -0,0 +1,6 @@ +NEXT_PUBLIC_API_URL=http://127.0.0.1:2333/api/v2 +NEXT_PUBLIC_GATEWAY_URL=http://127.0.0.1:2333/ +# NEXT_PUBLIC_API_URL=http://192.168.31.195:2333 +# NEXT_PUBLIC_GATEWAY_URL=http://192.168.31.195:2333 +NEXT_PUBLIC_API_URL=https://innei.ren/api/v2 +NEXT_PUBLIC_GATEWAY_URL=https://api.innei.ren diff --git a/.gitignore b/.gitignore index c87c9b392c..fb06cfde0b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ # dependencies /node_modules -/.pnp -.pnp.js # testing /coverage @@ -34,3 +32,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +.env diff --git a/package.json b/package.json index 505f61c03d..b6b7f00928 100644 --- a/package.json +++ b/package.json @@ -56,12 +56,17 @@ ], "dependencies": { "@floating-ui/react-dom": "2.0.0", - "@mx-space/api-client": "1.4.0", + "@mx-space/api-client": "1.4.1", "@tanstack/react-query": "4.29.12", + "@tanstack/react-query-devtools": "4.29.12", + "@tanstack/react-query-persist-client": "4.29.12", "axios": "1.4.0", + "daisyui": "3.0.22", "dayjs": "1.11.8", "framer-motion": "^10.12.16", + "idb-keyval": "6.2.1", "immer": "^10.0.2", + "jotai": "2.1.1", "js-cookie": "3.0.5", "lodash-es": "4.17.21", "markdown-escape": "2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9fc27f4f7f..773d1e96f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,23 +9,38 @@ dependencies: specifier: 2.0.0 version: 2.0.0(react-dom@18.2.0)(react@18.2.0) '@mx-space/api-client': - specifier: 1.4.0 - version: 1.4.0 + specifier: 1.4.1 + version: 1.4.1 '@tanstack/react-query': specifier: 4.29.12 version: 4.29.12(react-dom@18.2.0)(react@18.2.0) + '@tanstack/react-query-devtools': + specifier: 4.29.12 + version: 4.29.12(@tanstack/react-query@4.29.12)(react-dom@18.2.0)(react@18.2.0) + '@tanstack/react-query-persist-client': + specifier: 4.29.12 + version: 4.29.12(@tanstack/react-query@4.29.12) axios: specifier: 1.4.0 version: 1.4.0 + daisyui: + specifier: 3.0.22 + version: 3.0.22(postcss@8.4.24) dayjs: specifier: 1.11.8 version: 1.11.8 framer-motion: specifier: ^10.12.16 version: 10.12.16(react-dom@18.2.0)(react@18.2.0) + idb-keyval: + specifier: 6.2.1 + version: 6.2.1 immer: specifier: ^10.0.2 version: 10.0.2 + jotai: + specifier: 2.1.1 + version: 2.1.1(react@18.2.0) js-cookie: specifier: 3.0.5 version: 3.0.5 @@ -175,7 +190,6 @@ packages: /@alloc/quick-lru@5.2.0: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - dev: true /@ampproject/remapping@2.2.0: resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} @@ -1475,9 +1489,8 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@mx-space/api-client@1.4.0: - resolution: {integrity: sha512-F8JYd0XQbOTL5jEcOqvwIl9raRkhxRVKQDUM4eN1tE5KzW4DpKqQxfXktniFECg8vrMTcL8if1zsr3kEX9HDEA==} - engines: {pnpm: '>=6'} + /@mx-space/api-client@1.4.1: + resolution: {integrity: sha512-+N4luI2SqX7v+vkKeecyCgu/WAnpiurZxOWp1oTgexyilRKWyeLYVYWPeYc346Hv+XRrf6gITEOObPY+KW5rIg==} dev: false /@next/bundle-analyzer@13.4.4: @@ -1580,12 +1593,10 @@ packages: dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -1593,7 +1604,6 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - dev: true /@pkgjs/parseargs@0.11.0: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -1616,10 +1626,50 @@ packages: tslib: 2.5.3 dev: false + /@tanstack/match-sorter-utils@8.8.4: + resolution: {integrity: sha512-rKH8LjZiszWEvmi01NR72QWZ8m4xmXre0OOwlRGnjU01Eqz/QnN+cqpty2PJ0efHblq09+KilvyR7lsbzmXVEw==} + engines: {node: '>=12'} + dependencies: + remove-accents: 0.4.2 + dev: false + /@tanstack/query-core@4.29.11: resolution: {integrity: sha512-8C+hF6SFAb/TlFZyS9FItgNwrw4PMa7YeX+KQYe2ZAiEz6uzg6yIr+QBzPkUwZ/L0bXvGd1sufTm3wotoz+GwQ==} dev: false + /@tanstack/query-persist-client-core@4.29.11: + resolution: {integrity: sha512-CSmMZchr+446r79NJ/pjD2yfjqNqFV7k8BnqOq4yTZvXsaQLEIn3tsaU45IsPgs4N7g9OBfPUPDdapSQvck2WQ==} + dependencies: + '@tanstack/query-core': 4.29.11 + dev: false + + /@tanstack/react-query-devtools@4.29.12(@tanstack/react-query@4.29.12)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-ug4YGQhMhh6QI8/sWJhjXxuvdeehxf1cyxpTifGMH5qreQ5ECHT6vzqG/aKvADQDzqLBGrF0q4wTDnRRYvvtrA==} + peerDependencies: + '@tanstack/react-query': 4.29.12 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + dependencies: + '@tanstack/match-sorter-utils': 8.8.4 + '@tanstack/react-query': 4.29.12(react-dom@18.2.0)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + superjson: 1.12.3 + use-sync-external-store: 1.2.0(react@18.2.0) + dev: false + + /@tanstack/react-query-persist-client@4.29.12(@tanstack/react-query@4.29.12): + resolution: {integrity: sha512-rh6zZJB+3j8lr+YsEkVadnqmUELmqNFZQzGGsHS5col/YOjYsMe9ppqaUjIMJ2aXnFXye50sbe4KxHhSGoaNVw==} + peerDependencies: + '@tanstack/react-query': 4.29.12 + dependencies: + '@tanstack/query-persist-client-core': 4.29.11 + '@tanstack/react-query': 4.29.12(react-dom@18.2.0)(react@18.2.0) + dev: false + /@tanstack/react-query@4.29.12(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-zhcN6+zF6cxprxhTHQajHGlvxgK8npnp9uLe9yaWhGc6sYcPWXzyO4raL4HomUzQOPzu3jLvkriJQ7BOrDM8vA==} peerDependencies: @@ -2002,7 +2052,6 @@ packages: /any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: true /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -2010,11 +2059,9 @@ packages: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 - dev: true /arg@5.0.2: resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} - dev: true /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -2120,19 +2167,16 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} - dev: true /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 - dev: true /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} @@ -2145,7 +2189,6 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: true /browserslist@4.21.5: resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} @@ -2205,7 +2248,6 @@ packages: /camelcase-css@2.0.1: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} - dev: true /caniuse-lite@1.0.30001466: resolution: {integrity: sha512-ewtFBSfWjEmxUgNBSZItFSmVtvk9zkwkl1OfRZlKA8slltRN+/C/tuGVrF9styXkN36Yu3+SeJ1qkXxDEyNZ5w==} @@ -2247,7 +2289,6 @@ packages: readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.2 - dev: true /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} @@ -2320,6 +2361,10 @@ packages: color-string: 1.9.1 dev: true + /colord@2.9.3: + resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} + dev: false + /colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} dev: true @@ -2339,7 +2384,6 @@ packages: /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} - dev: true /commander@7.2.0: resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} @@ -2348,11 +2392,17 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: true /convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + /copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} + dependencies: + is-what: 4.1.15 + dev: false + /cosmiconfig@7.1.0: resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} engines: {node: '>=10'} @@ -2412,6 +2462,13 @@ packages: postcss: 8.4.24 dev: true + /css-selector-tokenizer@0.8.0: + resolution: {integrity: sha512-Jd6Ig3/pe62/qe5SBPTN8h8LeUg/pT4lLgtavPf7updwwHpvFzxvOQBHYj2LZDMjUnBzgvIUSjRcf6oT5HzHFg==} + dependencies: + cssesc: 3.0.0 + fastparse: 1.1.2 + dev: false + /cssdb@7.6.0: resolution: {integrity: sha512-Nna7rph8V0jC6+JBY4Vk4ndErUmfJfV6NJCaZdurL0omggabiy+QB2HCQtu5c/ACLZ0I7REv7A4QyPIoYzZx0w==} dev: true @@ -2420,12 +2477,26 @@ packages: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} hasBin: true - dev: true /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true + /daisyui@3.0.22(postcss@8.4.24): + resolution: {integrity: sha512-2xdRxQUUB+O0Mcww65QMwwo0fjnos4JmyLhX6F4WxWTngjy9eYyxdQChtsJB3GUl0jNYdZfmnK48gJNyhMBX8Q==} + engines: {node: '>=16.9.0'} + peerDependencies: + postcss: ^8 + dependencies: + colord: 2.9.3 + css-selector-tokenizer: 0.8.0 + postcss: 8.4.24 + postcss-js: 4.0.1(postcss@8.4.24) + tailwindcss: 3.3.2 + transitivePeerDependencies: + - ts-node + dev: false + /data-uri-to-buffer@4.0.1: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} @@ -2482,7 +2553,6 @@ packages: /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} - dev: true /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} @@ -2493,7 +2563,6 @@ packages: /dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - dev: true /doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} @@ -2973,7 +3042,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -2983,11 +3051,14 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fastparse@1.1.2: + resolution: {integrity: sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==} + dev: false + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 - dev: true /fetch-blob@3.2.0: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} @@ -3009,7 +3080,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: true /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} @@ -3117,19 +3187,16 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true /function.prototype.name@1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -3181,14 +3248,12 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: true /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} dependencies: is-glob: 4.0.3 - dev: true /glob@10.2.7: resolution: {integrity: sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==} @@ -3211,7 +3276,6 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: true /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} @@ -3331,7 +3395,6 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} @@ -3349,6 +3412,10 @@ packages: hasBin: true dev: true + /idb-keyval@6.2.1: + resolution: {integrity: sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==} + dev: false + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -3381,11 +3448,9 @@ packages: dependencies: once: 1.4.0 wrappy: 1.0.2 - dev: true /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true /internal-slot@1.0.5: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} @@ -3423,7 +3488,6 @@ packages: engines: {node: '>=8'} dependencies: binary-extensions: 2.2.0 - dev: true /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} @@ -3442,13 +3506,11 @@ packages: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: has: 1.0.3 - dev: true /is-core-module@2.12.1: resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} dependencies: has: 1.0.3 - dev: true /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} @@ -3460,7 +3522,6 @@ packages: /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -3477,7 +3538,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: true /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} @@ -3494,7 +3554,6 @@ packages: /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - dev: true /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} @@ -3556,6 +3615,11 @@ packages: call-bind: 1.0.2 dev: true + /is-what@4.1.15: + resolution: {integrity: sha512-uKua1wfy3Yt+YqsD6mTUEa2zSi3G1oPlqTflgaPJ7z63vUGN5pxFpnQfeSLMFnJDEsdvOtkp1rUWkYjB4YfhgA==} + engines: {node: '>=12.13'} + dev: false + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -3572,7 +3636,18 @@ packages: /jiti@1.18.2: resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==} hasBin: true - dev: true + + /jotai@2.1.1(react@18.2.0): + resolution: {integrity: sha512-LaaiuSaq+6XkwkrCtCkczyFVZOXe0dfjAFN4DVMsSZSRv/A/4xuLHnlpHMEDqvngjWYBotTIrnQ7OogMkUE6wA==} + engines: {node: '>=12.20.0'} + peerDependencies: + react: '>=17.0.0' + peerDependenciesMeta: + react: + optional: true + dependencies: + react: 18.2.0 + dev: false /joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -3738,11 +3813,9 @@ packages: /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} - dev: true /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: true /lint-staged@13.2.2: resolution: {integrity: sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==} @@ -3862,7 +3935,6 @@ packages: /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: true /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} @@ -3870,7 +3942,6 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: true /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} @@ -3898,7 +3969,6 @@ packages: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 - dev: true /minimatch@9.0.1: resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} @@ -3934,7 +4004,6 @@ packages: any-promise: 1.3.0 object-assign: 4.1.1 thenify-all: 1.6.0 - dev: true /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} @@ -4034,7 +4103,6 @@ packages: /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} - dev: true /normalize-range@0.1.2: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} @@ -4058,12 +4126,10 @@ packages: /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} - dev: true /object-hash@3.0.0: resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} engines: {node: '>= 6'} - dev: true /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} @@ -4122,7 +4188,6 @@ packages: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 - dev: true /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} @@ -4208,7 +4273,6 @@ packages: /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} - dev: true /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} @@ -4222,7 +4286,6 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true /path-scurry@1.9.2: resolution: {integrity: sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==} @@ -4249,7 +4312,6 @@ packages: /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true /pidtree@0.6.0: resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} @@ -4260,12 +4322,10 @@ packages: /pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} - dev: true /pirates@4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} engines: {node: '>= 6'} - dev: true /postcss-attribute-case-insensitive@6.0.2(postcss@8.4.24): resolution: {integrity: sha512-IRuCwwAAQbgaLhxQdQcIIK0dCVXg3XDUnzgKD8iwdiYdwU4rMWRWyl/W9/0nA4ihVpq5pyALiHB2veBJ0292pw==} @@ -4435,7 +4495,6 @@ packages: postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.1 - dev: true /postcss-initial@4.0.1(postcss@8.4.24): resolution: {integrity: sha512-0ueD7rPqX8Pn1xJIjay0AZeIuDoF+V+VvMt/uOnn+4ezUKhZM/NokDeP6DwMNyIoYByuN/94IQnt5FEkaN59xQ==} @@ -4453,7 +4512,6 @@ packages: dependencies: camelcase-css: 2.0.1 postcss: 8.4.24 - dev: true /postcss-lab-function@5.2.3(postcss@8.4.24): resolution: {integrity: sha512-fi32AYKzji5/rvgxo5zXHFvAYBw0u0OzELbeCNjEZVLUir18Oj+9RmNphtM8QdLUaUnrfx8zy8vVYLmFLkdmrQ==} @@ -4500,7 +4558,6 @@ packages: lilconfig: 2.1.0 postcss: 8.4.24 yaml: 2.3.1 - dev: true /postcss-logical@6.2.0(postcss@8.4.24): resolution: {integrity: sha512-aqlfKGaY0nnbgI9jwUikp4gJKBqcH5noU/EdnIVceghaaDPYhZuyJVxlvWNy55tlTG5tunRKCTAX9yljLiFgmw==} @@ -4520,7 +4577,6 @@ packages: dependencies: postcss: 8.4.24 postcss-selector-parser: 6.0.11 - dev: true /postcss-nesting@11.2.2(postcss@8.4.24): resolution: {integrity: sha512-aOTiUniAB1bcPE6GGiynWRa6PZFPhOTAm5q3q5cem6QeSijIHHkWr6gs65ukCZMXeak8yXeZVbBJET3VM+HlhA==} @@ -4675,7 +4731,6 @@ packages: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 - dev: true /postcss-selector-parser@6.0.13: resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} @@ -4683,11 +4738,9 @@ packages: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 - dev: true /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - dev: true /postcss@8.4.14: resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} @@ -4705,7 +4758,6 @@ packages: nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 - dev: true /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -4816,7 +4868,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} @@ -4870,14 +4921,12 @@ packages: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} dependencies: pify: 2.3.0 - dev: true /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 - dev: true /regexp.prototype.flags@1.5.0: resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} @@ -4888,6 +4937,10 @@ packages: functions-have-names: 1.2.3 dev: true + /remove-accents@0.4.2: + resolution: {integrity: sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA==} + dev: false + /remove-markdown@0.5.0: resolution: {integrity: sha512-x917M80K97K5IN1L8lUvFehsfhR8cYjGQ/yAMRI9E7JIKivtl5Emo5iD13DhMr+VojzMCiYk8V2byNPwT/oapg==} dev: false @@ -4913,7 +4966,6 @@ packages: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true /resolve@1.22.2: resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} @@ -4922,7 +4974,6 @@ packages: is-core-module: 2.12.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true /resolve@2.0.0-next.4: resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} @@ -4944,7 +4995,6 @@ packages: /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true /rfdc@1.3.0: resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} @@ -4977,7 +5027,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: true /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} @@ -5278,7 +5327,13 @@ packages: mz: 2.7.0 pirates: 4.0.5 ts-interface-checker: 0.1.13 - dev: true + + /superjson@1.12.3: + resolution: {integrity: sha512-0j+U70KUtP8+roVPbwfqkyQI7lBt7ETnuA7KXbTDX3mCKiD/4fXs2ldKSMdt0MCfpTwiMxo20yFU3vu6ewETpQ==} + engines: {node: '>=10'} + dependencies: + copy-anything: 3.0.5 + dev: false /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} @@ -5296,7 +5351,6 @@ packages: /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - dev: true /tailwindcss-variable-colors@0.0.1(tailwindcss@3.3.2): resolution: {integrity: sha512-LcEwheZC0uCKDQk2nLMpxc9BL8HRtU0TBhXbGU+nasmXXTQXWO5YXCm/XyoRBzUYkRwkIbRiP3NH0jhOUoDwDA==} @@ -5336,7 +5390,6 @@ packages: sucrase: 3.32.0 transitivePeerDependencies: - ts-node - dev: true /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -5347,13 +5400,11 @@ packages: engines: {node: '>=0.8'} dependencies: thenify: 3.3.1 - dev: true /thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} dependencies: any-promise: 1.3.0 - dev: true /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} @@ -5379,7 +5430,6 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: true /totalist@1.1.0: resolution: {integrity: sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==} @@ -5399,7 +5449,6 @@ packages: /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - dev: true /tsconfig-paths@3.14.2: resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==} @@ -5568,7 +5617,6 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true /validator@13.9.0: resolution: {integrity: sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==} @@ -5688,7 +5736,6 @@ packages: /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true /ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} @@ -5736,7 +5783,6 @@ packages: /yaml@2.3.1: resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} - dev: true /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} diff --git a/src/app/hydrate.tsx b/src/app/hydrate.tsx new file mode 100644 index 0000000000..f95905ba83 --- /dev/null +++ b/src/app/hydrate.tsx @@ -0,0 +1,8 @@ +'use client' + +import { Hydrate as RQHydrate } from '@tanstack/react-query' +import type { HydrateProps } from '@tanstack/react-query' + +export function Hydrate(props: HydrateProps) { + return +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1444f2a949..cbb10d9884 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,18 +1,35 @@ import '../styles/index.css' -import { Providers } from './providers' +import { dehydrate } from '@tanstack/react-query' +import { headers } from 'next/dist/client/components/headers' -export default function RootLayout({ +import { queries } from '~/queries/definition' +import { getQueryClient } from '~/utils/query-client.server' +import { $axios } from '~/utils/request' + +import { Providers } from '../providers/root' +import { Hydrate } from './hydrate' + +export default async function RootLayout({ children, }: { children: React.ReactNode }) { + const queryClient = getQueryClient() + const { get } = headers() + const ua = get('user-agent') + await queryClient.fetchQuery(queries.aggregation.root()) + $axios.defaults.headers.common['User-Agent'] = ua + + const dehydratedState = dehydrate(queryClient) return ( - {children} + + {children} + ) diff --git a/src/app/page.module.css b/src/app/page.module.css deleted file mode 100644 index 4732b55fdc..0000000000 --- a/src/app/page.module.css +++ /dev/null @@ -1,271 +0,0 @@ -.main { - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: center; - padding: 6rem; - min-height: 100vh; -} - -.description { - display: inherit; - justify-content: inherit; - align-items: inherit; - font-size: 0.85rem; - max-width: var(--max-width); - width: 100%; - z-index: 2; - font-family: var(--font-mono); -} - -.description a { - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; -} - -.description p { - position: relative; - margin: 0; - padding: 1rem; - background-color: rgba(var(--callout-rgb), 0.5); - border: 1px solid rgba(var(--callout-border-rgb), 0.3); - border-radius: var(--border-radius); -} - -.code { - font-weight: 700; - font-family: var(--font-mono); -} - -.grid { - display: grid; - grid-template-columns: repeat(3, minmax(33%, auto)); - width: var(--max-width); - max-width: 100%; -} - -.card { - padding: 1rem 1.2rem; - border-radius: var(--border-radius); - background: rgba(var(--card-rgb), 0); - border: 1px solid rgba(var(--card-border-rgb), 0); - transition: background 200ms, border 200ms; -} - -.card span { - display: inline-block; - transition: transform 200ms; -} - -.card h2 { - font-weight: 600; - margin-bottom: 0.7rem; -} - -.card p { - margin: 0; - opacity: 0.6; - font-size: 0.9rem; - line-height: 1.5; - max-width: 34ch; -} - -.center { - display: flex; - justify-content: center; - align-items: center; - position: relative; - padding: 4rem 0; -} - -.center::before { - background: var(--secondary-glow); - border-radius: 50%; - width: 480px; - height: 360px; - margin-left: -400px; -} - -.center::after { - background: var(--primary-glow); - width: 240px; - height: 180px; - z-index: -1; -} - -.center::before, -.center::after { - content: ''; - left: 50%; - position: absolute; - filter: blur(45px); - transform: translateZ(0); -} - -.logo, -.thirteen { - position: relative; -} - -.thirteen { - display: flex; - justify-content: center; - align-items: center; - width: 75px; - height: 75px; - padding: 25px 10px; - margin-left: 16px; - transform: translateZ(0); - border-radius: var(--border-radius); - overflow: hidden; - box-shadow: 0px 2px 8px -1px #0000001a; -} - -.thirteen::before, -.thirteen::after { - content: ''; - position: absolute; - z-index: -1; -} - -/* Conic Gradient Animation */ -.thirteen::before { - animation: 6s rotate linear infinite; - width: 200%; - height: 200%; - background: var(--tile-border); -} - -/* Inner Square */ -.thirteen::after { - inset: 0; - padding: 1px; - border-radius: var(--border-radius); - background: linear-gradient( - to bottom right, - rgba(var(--tile-start-rgb), 1), - rgba(var(--tile-end-rgb), 1) - ); - background-clip: content-box; -} - -/* Enable hover only on non-touch devices */ -@media (hover: hover) and (pointer: fine) { - .card:hover { - background: rgba(var(--card-rgb), 0.1); - border: 1px solid rgba(var(--card-border-rgb), 0.15); - } - - .card:hover span { - transform: translateX(4px); - } -} - -@media (prefers-reduced-motion) { - .thirteen::before { - animation: none; - } - - .card:hover span { - transform: none; - } -} - -/* Mobile and Tablet */ -@media (max-width: 1023px) { - .content { - padding: 4rem; - } - - .grid { - grid-template-columns: 1fr; - margin-bottom: 120px; - max-width: 320px; - text-align: center; - } - - .card { - padding: 1rem 2.5rem; - } - - .card h2 { - margin-bottom: 0.5rem; - } - - .center { - padding: 8rem 0 6rem; - } - - .center::before { - transform: none; - height: 300px; - } - - .description { - font-size: 0.8rem; - } - - .description a { - padding: 1rem; - } - - .description p, - .description div { - display: flex; - justify-content: center; - position: fixed; - width: 100%; - } - - .description p { - align-items: center; - inset: 0 0 auto; - padding: 2rem 1rem 1.4rem; - border-radius: 0; - border: none; - border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25); - background: linear-gradient( - to bottom, - rgba(var(--background-start-rgb), 1), - rgba(var(--callout-rgb), 0.5) - ); - background-clip: padding-box; - backdrop-filter: blur(24px); - } - - .description div { - align-items: flex-end; - pointer-events: none; - inset: auto 0 0; - padding: 2rem; - height: 200px; - background: linear-gradient( - to bottom, - transparent 0%, - rgb(var(--background-end-rgb)) 40% - ); - z-index: 1; - } -} - -@media (prefers-color-scheme: dark) { - .vercelLogo { - filter: invert(1); - } - - .logo, - .thirteen img { - filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70); - } -} - -@keyframes rotate { - from { - transform: rotate(360deg); - } - to { - transform: rotate(0deg); - } -} diff --git a/src/app/page.tsx b/src/app/page.tsx index 0ae7113caf..18002abe2c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,7 +1,8 @@ +'use client' + +import { useAggregation } from '~/queries/hooks/useAggregation' + export default function Home() { - return ( -
- 1 -
- ) + const { data } = useAggregation() + return
{data!.user.avatar}
} diff --git a/src/app/providers.tsx b/src/app/providers.tsx deleted file mode 100644 index 7e92d5480d..0000000000 --- a/src/app/providers.tsx +++ /dev/null @@ -1,10 +0,0 @@ -// app/providers.jsx - -'use client' - -import { ThemeProvider } from 'next-themes' -import type { PropsWithChildren } from 'react' - -export function Providers({ children }: PropsWithChildren) { - return {children} -} diff --git a/src/constants/env.ts b/src/constants/env.ts new file mode 100644 index 0000000000..4b7a60493f --- /dev/null +++ b/src/constants/env.ts @@ -0,0 +1,4 @@ +export const API_URL = + process.env.NEXT_PUBLIC_API_URL || process.env.NEXT_PUBLIC_APIURL || '/api/v2' + +export const GATEWAY_URL = process.env.NEXT_PUBLIC_GATEWAY_URL || '' diff --git a/src/constants/kaomoji.ts b/src/constants/kaomoji.ts new file mode 100644 index 0000000000..0137cd606d --- /dev/null +++ b/src/constants/kaomoji.ts @@ -0,0 +1,346 @@ +export const kaomoji = [ + '(o^▽^o)', + '(⌒▽⌒)☆', + '<( ̄︶ ̄)>', + 'ヽ(・∀・)ノ', + '( ̄ω ̄)', + '(o・ω・o)', + '(@^◡^)', + '(^人^)', + '(o´▽`o)', + '(*´▽`*)', + '(≧◡≦)', + '(o´∀`o)', + '(^▽^)', + '(⌒ω⌒)', + '╰(▔∀▔)╯', + '(─‿‿─)', + '(*^‿^*)', + '(✯◡✯)', + '(◕‿◕)', + '(*≧ω≦*)', + '(☆▽☆)', + '(⌒‿⌒)', + '\(≧▽≦)/', + '(*°▽°*)', + '(✧ω✧)', + '( ̄▽ ̄)', + 'o(≧▽≦)o', + '(☆ω☆)', + '\( ̄▽ ̄)/', + '(*¯︶¯*)', + '\(^▽^)/', + '٩(◕‿◕)۶', + '(o˘◡˘o)', + '\\(★ω★)/', + '\\(^ヮ^)/', + '(〃^▽^〃)', + '(╯✧▽✧)╯', + 'o(>ω<)o', + '(๑˃ᴗ˂)ﻭ', + '(๑˘︶˘๑)', + '(⁀ᗢ⁀)', + '(¬‿¬ )', + '(¬‿¬ )', + '(* ̄▽ ̄)b', + '( ˙▿˙ )', + '(¯▿¯)', + '( ◕▿◕ )', + '(ᵔ◡ᵔ)', + '(♡μ_μ)', + '(*^^*)♡', + '(♡-_-♡)', + '( ̄ε ̄@)', + 'ヽ(♡‿♡)ノ', + '(─‿‿─)♡', + '(*♡∀♡)', + '(◕‿◕)♡', + '(ღ˘⌣˘ღ)', + '(♡°▽°♡)', + '(♡˙︶˙♡)', + '(≧◡≦) ♡', + '(⌒▽⌒)♡', + '٩(♡ε♡)۶', + '♡ ( ̄З ̄)', + '(❤ω❤)', + '(´♡‿♡`)', + '(°◡°♡)', + '(´꒳`)♡', + '♡(>ᴗ•)', + '(⌒_⌒;)', + '(o^ ^o)', + '(*/ω\)', + '(*/。\)', + '(*/_\)', + '(*ノωノ)', + '(o-_-o)', + '(*μ_μ)', + '(ᵔ.ᵔ)', + '(*ノ∀`*)', + '(//▽//)', + '(//ω//)', + '(*^.^*)', + '(*ノ▽ノ)', + '( ̄▽ ̄*)ゞ', + '(*/▽\*)', + '(„ಡωಡ„)', + '( 〃▽〃)', + '(/▿\ )', + '(#><)', + '(; ̄Д ̄)', + '( ̄□ ̄」)', + '(# ̄0 ̄)', + '(# ̄ω ̄)', + '(¬_¬;)', + '(>m<)', + '(」°ロ°)」', + '(^^#)', + '(︶︹︺)', + '( ̄ヘ ̄)', + '( ̄︿ ̄)', + '(>﹏<)', + '(--_--)', + '凸( ̄ヘ ̄)', + '(⇀‸↼‶)', + 'o(>< )o', + '(」><)」', + '(ᗒᗣᗕ)՞', + '(눈_눈)', + '(#`Д´)', + '(`皿´#)', + '(・`ω´・)', + '(`ー´)', + '凸(`△´#)', + '( `ε´ )', + 'ヽ(‵﹏´)ノ', + '(╬`益´)', + 'Σ(▼□▼メ)', + '(°ㅂ°╬)', + '(ノ°益°)ノ', + '(‡▼益▼)', + '(╬ Ò﹏Ó)', + '(凸ಠ益ಠ)凸', + '٩(ఠ益ఠ)۶', + '(ノಥ益ಥ)ノ', + '(≖、≖╬)', + '(ノ_<。)', + '(-_-)', + '(´-ω-`)', + '(μ_μ)', + '(ノД`)', + '(-ω-、)', + 'o(TヘTo)', + '(。╯︵╰。)', + '(个_个)', + '(╯︵╰,)', + '( ╥ω╥ )', + '(╯_╰)', + '(╥_╥)', + '(/ˍ・、)', + '(ノ_<、)', + '(╥﹏╥)', + '(つω`。)', + '(ノω・、)', + '(T_T)', + '(>_<)', + 'o(〒﹏〒)o', + '(ಥ﹏ಥ)', + '(ಡ‸ಡ)', + '~(>_<~)', + '☆⌒(>。<)', + '(☆_@)', + '(×_×)', + '(x_x)', + '(×_×)⌒☆', + '(x_x)⌒☆', + '(×﹏×)', + '☆(#××)', + '(+_+)', + '٩(× ×)۶', + '(メ﹏メ)', + '(ノωヽ)', + '(/。\)', + '(ノ_ヽ)', + '(″ロ゛)', + '(・人・)', + '\(〇_o)/', + '(/ω\)', + '(/_\)', + '〜(><)〜', + '┐( ̄ヘ ̄)┌', + '╮( ̄_ ̄)╭', + 'ヽ(ˇヘˇ)ノ', + '┐( ̄~ ̄)┌', + '┐(︶▽︶)┌', + '╮( ̄~ ̄)╭', + '╮(︶︿︶)╭', + '┐( ̄∀ ̄)┌', + '╮(︶▽︶)╭', + '┐( ̄ヮ ̄)┌', + 'ᕕ( ᐛ )ᕗ', + '┐(シ)┌', + '( ̄ω ̄;)', + 'σ( ̄、 ̄〃)', + '( ̄~ ̄;)', + '(・_・ヾ', + '(〃 ̄ω ̄〃ゞ', + '(・_・;)', + '(@_@)', + '(・・;)ゞ', + 'Σ( ̄。 ̄ノ)', + '(・・ ) ?', + '(◎ ◎)ゞ', + '(ーー;)', + '(¯ ¯٥)', + '(¬_¬)', + '(→_→)', + '(¬ ¬)', + '(¬‿¬ )', + '(¬_¬ )', + '(←_←)', + '(¬ ¬ )', + '(¬‿¬ )', + '(↼_↼)', + '(⇀_⇀)', + '(ᓀ ᓀ)', + 'w(°o°)w', + 'ヽ(°〇°)ノ', + 'Σ(O_O)', + 'Σ(°ロ°)', + '(⊙_⊙)', + '(o_O)', + '(O_O;)', + '(O.O)', + '(°ロ°) !', + '(o_O) !', + '(□_□)', + 'Σ(□_□)', + '∑(O_O;)', + '(*・ω・)ノ', + '( ̄▽ ̄)ノ', + '(°▽°)/', + '(^-^*)/', + '\(⌒▽⌒)', + 'ヾ(☆▽☆)', + '(^0^)ノ', + '~ヾ(・ω・)', + '(・∀・)ノ', + 'ヾ(・ω・*)', + '(*°ー°)ノ', + '(・_・)ノ', + '( ̄ω ̄)/', + '(⌒ω⌒)ノ', + '(≧▽≦)/', + '(✧∀✧)/', + '( ̄▽ ̄)/', + '(つ≧▽≦)つ', + '(つ✧ω✧)つ', + '(っಠ‿ಠ)っ', + '(づ◡﹏◡)づ', + '⊂( ̄▽ ̄)⊃', + '(^_~)', + '( ゚o⌒)', + '(^_-)≡☆', + '(^ω~)', + '(>ω^)', + '(~人^)', + '(^_-)', + '( -_・)', + '(^_<)〜☆', + '(^人<)〜☆', + '☆⌒(ゝ。∂)', + '(^_<)', + '(^_−)☆', + '(・ω<)☆', + '(^.~)☆', + '(^.~)', + '(>ᴗ•)', + 'm(_ _)m', + '(シ_ _)シ', + 'm(. .)m', + '<(_ _)>', + '人(_ _*)', + '(*_ _)人', + '(シ. .)シ', + '(* ̄ii ̄)', + '( ̄ハ ̄*)', + '\\( ̄ハ ̄)', + '(^་།^)', + '(^〃^)', + '( ̄ ¨ヽ ̄)', + '( ̄ ; ̄)', + '( ̄ ;; ̄)', + '|・ω・)', + 'ヘ(・_|', + '|ω・)ノ', + 'ヾ(・|', + '|д・)', + '|_ ̄))', + '|▽//)', + '|_・)', + '|・д・)ノ', + '|ʘ‿ʘ)╯', + '__φ(..)', + '__φ(。。)', + '(=①ω①=)', + '(=`ω´=)', + '(=^‥^=)', + '( =ω= )', + '( =ω= )', + '(^◔ᴥ◔^)', + '(^◕ᴥ◕^)', + 'ต(=ω=)ต', + '( ̄(エ) ̄)', + '(/(エ)\)', + 'ʕ ᵔᴥᵔ ʔ', + 'ʕ •ᴥ• ʔ', + 'ʕಠᴥಠʔ', + '∪^ェ^∪', + '∪・ω・∪', + '∪ ̄- ̄∪', + '∪・ェ・∪', + 'U^皿^U', + 'UTェTU', + 'U^ェ^U', + 'V●ᴥ●V', + 'U・ᴥ・U', + '/(>×<)\', + '/(˃ᆺ˂)\', + '( ̄(ω) ̄)', + '( ̄Θ ̄)', + '(`・Θ・´)', + '(◉Θ◉)', + '(・θ・)', + '(・Θ・)', + '(・Θ・)', + 'ζ°)))彡', + '>°))))彡', + '(°))<<', + '―(T_T)→', + 'Q(`⌒´Q)', + '(っ˘ڡ˘ς)', + 'ヘ( ̄ω ̄ヘ)', + '(〜 ̄▽ ̄)〜', + '〜( ̄▽ ̄〜)', + '(ノ≧∀≦)ノ', + '√( ̄‥ ̄√)', + '└(^^)┐', + '┌(^^)┘', + '\( ̄▽ ̄)\', + '/( ̄▽ ̄)/', + '(^_^♪)', + '(~˘▽˘)~', + '~(˘▽˘~)', + '(〜 ̄△ ̄)〜', + '(~‾▽‾)~', + '~(˘▽˘)~', + '(≖ ͜ʖ≖)', + '( ̄^ ̄)ゞ', + '(-‸ლ)', + '(oT-T)尸', + '(ಠ_ಠ)', + '( ̄﹃ ̄)', + '( ・ω・)☞', + '(⌐■_■)', + '(◕‿◕✿)', +] diff --git a/src/constants/meta-icon.ts b/src/constants/meta-icon.ts new file mode 100644 index 0000000000..a3973ad557 --- /dev/null +++ b/src/constants/meta-icon.ts @@ -0,0 +1,54 @@ +import type { FC } from 'react' +import React from 'react' + +import { + FaSolidAngry, + FaSolidFlushed, + FaSolidFrownOpen, + FaSolidGrimace, + FaSolidGrinSquintTears, + FaSolidMeh, + FaSolidSadCry, + FaSolidSadTear, + FaSolidSmile, + FaSolidTired, +} from '~/components/ui/Icons/emoji' +import { PhSunBold } from '~/components/ui/Icons/layout' +import { + BiCloudLightningRainFill, + BiCloudRainFill, + MdiCloud, + MdiSnowflake, + RiSunCloudyFill, +} from '~/components/ui/Icons/weather' + +export const weather2icon = (weather: string) => { + const map: Record = { + 晴: PhSunBold, + 多云: RiSunCloudyFill, + 阴: MdiCloud, + 雪: MdiSnowflake, + 雨: BiCloudRainFill, + 雷雨: BiCloudLightningRainFill, + } + return React.createElement(map[weather] || PhSunBold) +} + +export const mood2icon = (mood: string) => { + const map: Record = { + 开心: FaSolidSmile, + 伤心: FaSolidSadTear, + 大哭: FaSolidSadCry, + 生气: FaSolidAngry, + 痛苦: FaSolidTired, + 悲哀: FaSolidMeh, + 不快: FaSolidMeh, + 激动: FaSolidGrinSquintTears, + 担心: FaSolidFrownOpen, + 可怕: FaSolidGrimace, + 可恶: FaSolidAngry, + 绝望: FaSolidFrownOpen, + 焦虑: FaSolidFlushed, + } + return React.createElement(map[mood] || FaSolidSmile) +} diff --git a/src/constants/spring.ts b/src/constants/spring.ts new file mode 100644 index 0000000000..3354136570 --- /dev/null +++ b/src/constants/spring.ts @@ -0,0 +1,19 @@ +import type { Spring } from 'framer-motion' + +export const reboundPreset: Spring = { + type: 'spring', + bounce: 10, + stiffness: 140, + damping: 8, +} + +export const microdampingPreset: Spring = { + type: 'spring', + damping: 24, +} + +export const microReboundPreset: Spring = { + type: 'spring', + stiffness: 300, + damping: 20, +} diff --git a/src/constants/tracker.ts b/src/constants/tracker.ts new file mode 100644 index 0000000000..137a32b5ad --- /dev/null +++ b/src/constants/tracker.ts @@ -0,0 +1,5 @@ +export enum TrackerAction { + Click = 'click', + Interaction = 'interaction', + Impression = 'impression', +} diff --git a/src/providers/root/debug-provider.tsx b/src/providers/root/debug-provider.tsx new file mode 100644 index 0000000000..58d3abd674 --- /dev/null +++ b/src/providers/root/debug-provider.tsx @@ -0,0 +1,18 @@ +'use client' + +import { ReactQueryDevtools } from '@tanstack/react-query-devtools' +import { Suspense } from 'react' +import type { PropsWithChildren, ReactElement } from 'react' + +export const DebugProvider = ({ + children, +}: PropsWithChildren): ReactElement => { + return ( + <> + + + + {children} + + ) +} diff --git a/src/providers/root/index.tsx b/src/providers/root/index.tsx new file mode 100644 index 0000000000..889b9d12ed --- /dev/null +++ b/src/providers/root/index.tsx @@ -0,0 +1,17 @@ +'use client' + +import { ReactQueryProvider } from './react-query-provider' +import { ThemeProvider } from 'next-themes' +import type { PropsWithChildren } from 'react' + +import { DebugProvider } from './debug-provider' + +export function Providers({ children }: PropsWithChildren) { + return ( + + + {children} + + + ) +} diff --git a/src/providers/root/react-query-provider.tsx b/src/providers/root/react-query-provider.tsx new file mode 100644 index 0000000000..f97bfb761d --- /dev/null +++ b/src/providers/root/react-query-provider.tsx @@ -0,0 +1,60 @@ +'use client' + +import { QueryClient } from '@tanstack/react-query' +import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client' +import { useState } from 'react' +import { del, get, set } from 'idb-keyval' +import type { + PersistedClient, + Persister, +} from '@tanstack/react-query-persist-client' +import type { PropsWithChildren } from 'react' + +const idbValidKey = 'reactQuery' +const persister = { + persistClient: async (client: PersistedClient) => { + set(idbValidKey, client) + }, + restoreClient: async () => { + return await get(idbValidKey) + }, + removeClient: async () => { + await del(idbValidKey) + }, +} as Persister +export const ReactQueryProvider = ({ children }: PropsWithChildren) => { + const [queryClient] = useState( + () => + new QueryClient({ + defaultOptions: { + queries: { + cacheTime: 1000 * 60 * 5, // 5 minutes + refetchInterval: 1000 * 60 * 5, // 5 minutes + refetchOnWindowFocus: false, + refetchIntervalInBackground: false, + }, + }, + }), + ) + + return ( + { + const queryIsReadyForPersistance = query.state.status === 'success' + if (queryIsReadyForPersistance) { + return !((query.state?.data as any)?.pages?.length > 1) + } else { + return false + } + }, + }, + }} + > + {children} + + ) +} diff --git a/src/queries/definition/aggregation.ts b/src/queries/definition/aggregation.ts new file mode 100644 index 0000000000..6bc42c251c --- /dev/null +++ b/src/queries/definition/aggregation.ts @@ -0,0 +1,13 @@ +import { apiClient } from '~/utils/request' + +import { defineQuery } from './helper' + +export const aggregation = { + root: () => + defineQuery({ + queryKey: ['aggregation'], + queryFn: async () => + apiClient.aggregate.getAggregateData().then((res) => res.$serialized), + cacheTime: 1000 * 60 * 10, + }), +} diff --git a/src/queries/definition/helper.ts b/src/queries/definition/helper.ts new file mode 100644 index 0000000000..5bf3a4e1d8 --- /dev/null +++ b/src/queries/definition/helper.ts @@ -0,0 +1,12 @@ +import type { FetchQueryOptions, QueryKey } from '@tanstack/react-query' + +export const defineQuery = < + TQueryFnData = unknown, + TError = unknown, + TData = TQueryFnData, + TQueryKey extends QueryKey = QueryKey, +>( + options: FetchQueryOptions, +) => { + return options +} diff --git a/src/queries/definition/index.ts b/src/queries/definition/index.ts new file mode 100644 index 0000000000..d84fb391bd --- /dev/null +++ b/src/queries/definition/index.ts @@ -0,0 +1,5 @@ +import { aggregation } from './aggregation' + +export const queries = { + aggregation, +} diff --git a/src/queries/hooks/useAggregation.ts b/src/queries/hooks/useAggregation.ts new file mode 100644 index 0000000000..2a2dacfce3 --- /dev/null +++ b/src/queries/hooks/useAggregation.ts @@ -0,0 +1,7 @@ +import { useQuery } from '@tanstack/react-query' + +import { aggregation } from '../definition/aggregation' + +export const useAggregation = () => { + return useQuery(aggregation.root()) +} diff --git a/src/styles/index.css b/src/styles/index.css index 28f1f67ba0..2c37d190e4 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -1,2 +1,4 @@ @import './tailwindcss.css'; @import './variables.css'; +@import './uikit.css'; +@import './scrollbar.css'; diff --git a/src/styles/scrollbar.css b/src/styles/scrollbar.css new file mode 100644 index 0000000000..eb1f170871 --- /dev/null +++ b/src/styles/scrollbar.css @@ -0,0 +1,28 @@ +body::-webkit-scrollbar { + height: 0; +} + +::-webkit-scrollbar-thumb, +::-webkit-scrollbar-thumb:hover { + background-color: theme(colors.accent); + border: 3px solid theme(colors.white); + border-radius: 5px; +} + +::-webkit-scrollbar { + width: 10px; + height: 10px; + background: theme(colors.white); +} + +::-webkit-scrollbar-thumb { + background: theme(colors.accent); +} + +::-webkit-scrollbar-thumb:hover { + background: var(--hover-color); +} + +::-webkit-scrollbar-corner { + background: theme(colors.white); +} diff --git a/src/styles/uikit.css b/src/styles/uikit.css new file mode 100644 index 0000000000..2a18f91f98 --- /dev/null +++ b/src/styles/uikit.css @@ -0,0 +1,53 @@ +@layer base { + .uk-material-thick-light { + background: linear-gradient(0deg, #5c5c5c, #5c5c5c), + rgba(153, 153, 153, 0.97); + background-blend-mode: color-dodge, normal; + backdrop-filter: blur(20px); + } + + .uk-material-thick-dark { + background: linear-gradient(0deg, #7c7c7c, #7c7c7c), rgba(37, 37, 37, 0.9); + background-blend-mode: overlay, normal; + backdrop-filter: blur(50px); + } + + .uk-material-default-light { + background: linear-gradient(0deg, #383838, #383838), + rgba(179, 179, 179, 0.82); + background-blend-mode: color-dodge, normal; + backdrop-filter: blur(17.5px); + } + + .uk-material-default-dark { + background: linear-gradient(0deg, #8c8c8c, #8c8c8c), rgba(37, 37, 37, 0.82); + background-blend-mode: overlay, normal; + backdrop-filter: blur(50px); + } + + .uk-material-thin-light { + background: linear-gradient(0deg, #333333, #333333), + rgba(166, 166, 166, 0.7); + background-blend-mode: color-dodge, normal; + backdrop-filter: blur(15px); + } + + .uk-material-thin-dark { + background: linear-gradient(0deg, #9c9c9c, #9c9c9c), rgba(37, 37, 37, 0.7); + background-blend-mode: overlay, normal; + backdrop-filter: blur(50px); + } + + .uk-material-ultrathin-light { + background: linear-gradient(0deg, #0d0d0d, #0d0d0d), + rgba(191, 191, 191, 0.44); + background-blend-mode: color-dodge, normal; + backdrop-filter: blur(15px); + } + + .uk-material-ultrathin-dark { + background: linear-gradient(0deg, #9c9c9c, #9c9c9c), rgba(37, 37, 37, 0.55); + background-blend-mode: overlay, normal; + backdrop-filter: blur(50px); + } +} diff --git a/src/styles/variables.css b/src/styles/variables.css index 4cc1ccaea7..6122cd43bc 100644 --- a/src/styles/variables.css +++ b/src/styles/variables.css @@ -1,8 +1,8 @@ html { --border-color: #eee; - --font-fans: theme("fontFamily.sans"); - --theme-color: var(--auto-theme-color, theme("colors.orange.500")); - --hover-color: var(--auto-hover-color, theme("colors.zinc.100")); + --font-fans: theme('fontFamily.sans'); + --theme-color: var(--auto-theme-color, theme('colors.accent')); + --hover-color: var(--auto-hover-color, theme('colors.zinc.100')); --header-height: auto; /* Accent color for form controls */ accent-color: var(--theme-color); @@ -16,13 +16,11 @@ html { html.dark { --border-color: #333; - --theme-color: var(--auto-theme-color, theme("colors.orange.600")); } @media (prefers-color-scheme: dark) { html.not(.light) { --border-color: #333; - --theme-color: var(--auto-theme-color, theme("colors.orange.600")); } } @@ -38,10 +36,10 @@ html.dark { mix-blend-mode: normal; } -.dark::view-transition-old(root){ +.dark::view-transition-old(root) { z-index: 9999; } -.dark::view-transition-new(root){ +.dark::view-transition-new(root) { z-index: 1; -} \ No newline at end of file +} diff --git a/src/utils/cookie.ts b/src/utils/cookie.ts new file mode 100644 index 0000000000..60a8fff81d --- /dev/null +++ b/src/utils/cookie.ts @@ -0,0 +1,60 @@ +import dayjs from 'dayjs' +import Cookies from 'js-cookie' + +export const TokenKey = 'mx-token' + +/** + * 带了 bearer + */ +export function getToken(): string | null { + const token = Cookies.get(TokenKey) + return token ? `bearer ${token}` : null +} + +export function setToken(token: string) { + if (typeof token !== 'string') { + return + } + return Cookies.set(TokenKey, token, { + expires: 14, + }) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} +const LikePrefix = 'mx-like' +export function setLikeId(id: string) { + const has = getLikes() + if (!has) { + Cookies.set(LikePrefix, JSON.stringify([id]), { expires: getTomorrow() }) + } else { + if (isLikedBefore(id)) { + return + } + Cookies.set( + LikePrefix, + JSON.stringify((JSON.parse(has) as string[]).concat(id)), + { expires: getTomorrow() }, + ) + } +} + +function getLikes() { + return decodeURIComponent(Cookies.get(LikePrefix) ?? '') +} + +export function isLikedBefore(id: string) { + const has = getLikes() + + if (!has) { + return false + } + const list = JSON.parse(has) as string[] + + return list.includes(id) +} + +function getTomorrow() { + return dayjs().add(1, 'd').set('h', 2).set('m', 0).toDate() +} diff --git a/src/utils/query-client.server.ts b/src/utils/query-client.server.ts new file mode 100644 index 0000000000..90f282c8d9 --- /dev/null +++ b/src/utils/query-client.server.ts @@ -0,0 +1,11 @@ +import { QueryClient } from '@tanstack/react-query' +import { cache } from 'react' + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + cacheTime: 1000 * 60 * 5, // 5 minutes + }, + }, +}) +export const getQueryClient = cache(() => queryClient) diff --git a/src/utils/request.ts b/src/utils/request.ts new file mode 100644 index 0000000000..748e236bf7 --- /dev/null +++ b/src/utils/request.ts @@ -0,0 +1,41 @@ +import type { AxiosInstance } from 'axios' + +import { allControllers, createClient } from '@mx-space/api-client' +import { axiosAdaptor } from '@mx-space/api-client/dist/adaptors/axios' + +import { API_URL } from '~/constants/env' + +import PKG from '../../package.json' +import { getToken } from './cookie' + +const genUUID = () => { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { + const r = (Math.random() * 16) | 0 + const v = c === 'x' ? r : (r & 0x3) | 0x8 + return v.toString(16) + }) +} +const uuid = genUUID() + +export const apiClient = createClient(axiosAdaptor)(API_URL, { + controllers: allControllers, +}) + +export const $axios = axiosAdaptor.default as AxiosInstance + +$axios.defaults.timeout = 10000 +$axios.defaults.headers.common[ + 'User-Agent' +] = `NextJS/v${PKG.dependencies.next} ${PKG.name}/${PKG.version}` + +$axios.interceptors.request.use((config) => { + const token = getToken() + if (config.headers) { + if (token) { + config.headers['Authorization'] = token + } + config.headers['x-uuid'] = uuid + } + + return config +}) diff --git a/tailwind.config.ts b/tailwind.config.ts index 6fba186e34..b698a5c368 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,3 +1,4 @@ +import daisyui from 'daisyui' import { createVariableColors, variableColorsPlugin, @@ -167,8 +168,6 @@ const UIKitColors = { }, } -const UIKitMaterials = {} - export default resolveConfig({ content: ['./src/**/*.{js,jsx,ts,tsx}'], darkMode: 'class', @@ -204,24 +203,40 @@ export default resolveConfig({ screen: '100vh', }, - zIndex: { - '-1': '-1', - 1: '1', - 99: '99', - }, colors: { uk: UIKitColors, always: { ...twColors }, + accent: '#39C5BB', + // hover: '#b1f2ed', }, }, }, + daisyui: { + themes: [ + { + mytheme: { + primary: '#570df8', + secondary: '#f000b8', + accent: '#39C5BB', // MIKU + neutral: '#2b3440', + 'base-100': '#ffffff', + info: '#66CCFF', + success: '#36d399', + warning: '#fbbd23', + error: '#f87272', + }, + }, + ], + }, + plugins: [ addDynamicIconSelectors(), addShortcutPlugin, variableColorsPlugin(twColors), - + daisyui, + daisyui, // ColorPlugin, ], }) diff --git a/tsconfig.json b/tsconfig.json index c8dcedad68..6e07ef3515 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "ES2020", "lib": [ "dom", "dom.iterable",