From 92d49c306bbaae1f5902e07fe04f6f007ebab2df Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Fri, 25 Aug 2023 09:50:04 +0700 Subject: [PATCH] update user screen --- package.json | 4 +- pnpm-lock.yaml | 244 +++++++++--------- src-tauri/Cargo.lock | 40 +-- src-tauri/src/main.rs | 5 - src/app/space/components/widgets/network.tsx | 46 ++-- src/app/users/components/profile.tsx | 114 ++++---- .../components/{metadata.tsx => stats.tsx} | 22 +- src/app/users/index.tsx | 140 +++++++--- src/index.css | 2 +- src/shared/navigation.tsx | 2 +- src/shared/userProfile.tsx | 2 +- src/utils/hooks/useNostr.ts | 8 + 12 files changed, 357 insertions(+), 272 deletions(-) rename src/app/users/components/{metadata.tsx => stats.tsx} (71%) diff --git a/package.json b/package.json index f2374381..c4207b44 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@tailwindcss/typography": "^0.5.9", "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/html-to-text": "^9.0.1", - "@types/node": "^20.5.4", + "@types/node": "^20.5.6", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@types/youtube-player": "^5.5.7", @@ -106,7 +106,7 @@ "prop-types": "^15.8.1", "tailwind-merge": "^1.14.0", "tailwindcss": "^3.3.3", - "typescript": "^5.1.6", + "typescript": "^5.2.2", "vite": "^4.4.9", "vite-tsconfig-paths": "^4.2.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f1b1d843..4293f3fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,7 +9,7 @@ dependencies: version: 1.7.17(react-dom@18.2.0)(react@18.2.0) '@nostr-dev-kit/ndk': specifier: ^0.8.21 - version: 0.8.21(typescript@5.1.6) + version: 0.8.21(typescript@5.2.2) '@nostr-fetch/adapter-ndk': specifier: ^0.12.2 version: 0.12.2(@nostr-dev-kit/ndk@0.8.21)(nostr-fetch@0.12.2) @@ -190,8 +190,8 @@ devDependencies: specifier: ^9.0.1 version: 9.0.1 '@types/node': - specifier: ^20.5.4 - version: 20.5.4 + specifier: ^20.5.6 + version: 20.5.6 '@types/react': specifier: ^18.2.21 version: 18.2.21 @@ -203,10 +203,10 @@ devDependencies: version: 5.5.7 '@typescript-eslint/eslint-plugin': specifier: ^6.4.1 - version: 6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6) + version: 6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.2.2) '@typescript-eslint/parser': specifier: ^6.4.1 - version: 6.4.1(eslint@8.47.0)(typescript@5.1.6) + version: 6.4.1(eslint@8.47.0)(typescript@5.2.2) '@vitejs/plugin-react-swc': specifier: ^3.3.2 version: 3.3.2(vite@4.4.9) @@ -265,14 +265,14 @@ devDependencies: specifier: ^3.3.3 version: 3.3.3 typescript: - specifier: ^5.1.6 - version: 5.1.6 + specifier: ^5.2.2 + version: 5.2.2 vite: specifier: ^4.4.9 - version: 4.4.9(@types/node@20.5.4) + version: 4.4.9(@types/node@20.5.6) vite-tsconfig-paths: specifier: ^4.2.0 - version: 4.2.0(typescript@5.1.6)(vite@4.4.9) + version: 4.2.0(typescript@5.2.2)(vite@4.4.9) packages: @@ -311,21 +311,21 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-string-parser@7.22.5: @@ -345,16 +345,16 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/parser@7.22.10: - resolution: {integrity: sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==} + /@babel/parser@7.22.11: + resolution: {integrity: sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g==} engines: {node: '>=6.0.0'} hasBin: true dependencies: '@babel/types': 7.17.0 dev: true - /@babel/runtime@7.22.10: - resolution: {integrity: sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==} + /@babel/runtime@7.22.11: + resolution: {integrity: sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.0 @@ -364,8 +364,8 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.10 - '@babel/parser': 7.22.10 - '@babel/types': 7.22.10 + '@babel/parser': 7.22.11 + '@babel/types': 7.22.11 dev: true /@babel/traverse@7.17.3: @@ -378,7 +378,7 @@ 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/parser': 7.22.11 '@babel/types': 7.17.0 debug: 4.3.4 globals: 11.12.0 @@ -394,8 +394,8 @@ packages: to-fast-properties: 2.0.0 dev: true - /@babel/types@7.22.10: - resolution: {integrity: sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==} + /@babel/types@7.22.11: + resolution: {integrity: sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.22.5 @@ -986,14 +986,14 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@nostr-dev-kit/ndk@0.8.21(typescript@5.1.6): + /@nostr-dev-kit/ndk@0.8.21(typescript@5.2.2): resolution: {integrity: sha512-nthH3uoFuaXWqhZt96/p/iXTbYcMdkcee6pDm+Wi+MIcEsbj4o7r+ChoQ757TQZtEBLkOmku8/loi2LnHpkI9A==} dependencies: '@noble/hashes': 1.3.2 '@noble/secp256k1': 2.0.0 '@scure/base': 1.1.1 - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@5.1.6) - '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@5.2.2) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.2.2) debug: 4.3.4 esbuild: 0.17.19 esbuild-plugin-alias: 0.2.1 @@ -1021,7 +1021,7 @@ packages: '@nostr-dev-kit/ndk': ^0.7.5 nostr-fetch: ^0.12.2 dependencies: - '@nostr-dev-kit/ndk': 0.8.21(typescript@5.1.6) + '@nostr-dev-kit/ndk': 0.8.21(typescript@5.2.2) '@nostr-fetch/kernel': 0.12.2 nostr-fetch: 0.12.2 dev: false @@ -1040,7 +1040,7 @@ packages: /@radix-ui/primitive@1.0.1: resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==} dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 dev: false /@radix-ui/react-alert-dialog@1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0): @@ -1056,7 +1056,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1082,7 +1082,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.21 '@types/react-dom': 18.2.7 @@ -1103,7 +1103,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1131,7 +1131,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) @@ -1151,7 +1151,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@types/react': 18.2.21 react: 18.2.0 dev: false @@ -1165,7 +1165,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@types/react': 18.2.21 react: 18.2.0 dev: false @@ -1183,7 +1183,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1213,7 +1213,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@types/react': 18.2.21 react: 18.2.0 dev: false @@ -1231,7 +1231,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) @@ -1256,7 +1256,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1279,7 +1279,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@types/react': 18.2.21 react: 18.2.0 dev: false @@ -1297,7 +1297,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1316,7 +1316,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 react: 18.2.0 @@ -1335,7 +1335,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1373,7 +1373,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1408,7 +1408,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@floating-ui/react-dom': 2.0.1(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-arrow': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1438,7 +1438,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.21 '@types/react-dom': 18.2.7 @@ -1459,7 +1459,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 @@ -1481,7 +1481,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-slot': 1.0.2(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 '@types/react-dom': 18.2.7 @@ -1502,7 +1502,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1527,7 +1527,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 react: 18.2.0 @@ -1546,7 +1546,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@radix-ui/react-context': 1.0.1(@types/react@18.2.21)(react@18.2.0) @@ -1574,7 +1574,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@types/react': 18.2.21 react: 18.2.0 dev: false @@ -1588,7 +1588,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 react: 18.2.0 @@ -1603,7 +1603,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 react: 18.2.0 @@ -1618,7 +1618,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@types/react': 18.2.21 react: 18.2.0 dev: false @@ -1632,7 +1632,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/rect': 1.0.1 '@types/react': 18.2.21 react: 18.2.0 @@ -1647,7 +1647,7 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.21)(react@18.2.0) '@types/react': 18.2.21 react: 18.2.0 @@ -1666,7 +1666,7 @@ packages: '@types/react-dom': optional: true dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0) '@types/react': 18.2.21 '@types/react-dom': 18.2.7 @@ -1677,7 +1677,7 @@ packages: /@radix-ui/rect@1.0.1: resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==} dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 dev: false /@remirror/core-constants@2.0.2: @@ -2313,7 +2313,7 @@ packages: optional: true dependencies: '@babel/generator': 7.17.7 - '@babel/parser': 7.22.10 + '@babel/parser': 7.22.11 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 javascript-natural-sort: 0.7.1 @@ -2375,8 +2375,8 @@ packages: resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} dev: false - /@types/node@20.5.4: - resolution: {integrity: sha512-Y9vbIAoM31djQZrPYjpTLo0XlaSwOIsrlfE3LpulZeRblttsLQRFRlBAppW0LOxyT3ALj2M5vU1ucQQayQH3jA==} + /@types/node@20.5.6: + resolution: {integrity: sha512-Gi5wRGPbbyOTX+4Y2iULQ27oUPrefaB0PxGQJnfyWN3kvEDGM3mIB5M/gQLmitZf7A9FmLeaqxD3L1CXpm3VKQ==} dev: true /@types/normalize-package-data@2.4.1: @@ -2424,7 +2424,7 @@ packages: resolution: {integrity: sha512-W8F4eoTIvzXeNrT3JroQPimZLXnlJA8smYygHZUKFPVoYwgs/OhJkA1VBhL3iSs57OQkuINqHlY4SmMT5wtnJg==} dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2436,23 +2436,23 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.7.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) - '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.47.0)(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.47.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2464,10 +2464,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.7.0 - '@typescript-eslint/parser': 6.4.1(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/parser': 6.4.1(eslint@8.47.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 6.4.1 - '@typescript-eslint/type-utils': 6.4.1(eslint@8.47.0)(typescript@5.1.6) - '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/type-utils': 6.4.1(eslint@8.47.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.4.1 debug: 4.3.4 eslint: 8.47.0 @@ -2475,13 +2475,13 @@ packages: ignore: 5.2.4 natural-compare: 1.4.0 semver: 7.5.4 - ts-api-utils: 1.0.2(typescript@5.1.6) - typescript: 5.1.6 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2493,15 +2493,15 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) debug: 4.3.4 eslint: 8.47.0 - typescript: 5.1.6 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@6.4.1(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/parser@6.4.1(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2513,11 +2513,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.4.1 '@typescript-eslint/types': 6.4.1 - '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.4.1 debug: 4.3.4 eslint: 8.47.0 - typescript: 5.1.6 + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true @@ -2538,7 +2538,7 @@ packages: '@typescript-eslint/visitor-keys': 6.4.1 dev: true - /@typescript-eslint/type-utils@5.62.0(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/type-utils@5.62.0(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2548,17 +2548,17 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) - '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) + '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.47.0 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/type-utils@6.4.1(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/type-utils@6.4.1(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2568,12 +2568,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.1.6) - '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.2.2) + '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@5.2.2) debug: 4.3.4 eslint: 8.47.0 - ts-api-utils: 1.0.2(typescript@5.1.6) - typescript: 5.1.6 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true @@ -2588,7 +2588,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.1.6): + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.2.2): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2603,13 +2603,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/typescript-estree@6.4.1(typescript@5.1.6): + /@typescript-eslint/typescript-estree@6.4.1(typescript@5.2.2): resolution: {integrity: sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2624,13 +2624,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - ts-api-utils: 1.0.2(typescript@5.1.6) - typescript: 5.1.6 + ts-api-utils: 1.0.2(typescript@5.2.2) + typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/utils@5.62.0(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2641,7 +2641,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.2.2) eslint: 8.47.0 eslint-scope: 5.1.1 semver: 7.5.4 @@ -2650,7 +2650,7 @@ packages: - typescript dev: false - /@typescript-eslint/utils@6.4.1(eslint@8.47.0)(typescript@5.1.6): + /@typescript-eslint/utils@6.4.1(eslint@8.47.0)(typescript@5.2.2): resolution: {integrity: sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2661,7 +2661,7 @@ packages: '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 6.4.1 '@typescript-eslint/types': 6.4.1 - '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.2.2) eslint: 8.47.0 semver: 7.5.4 transitivePeerDependencies: @@ -2691,7 +2691,7 @@ packages: vite: ^4 dependencies: '@swc/core': 1.3.78 - vite: 4.4.9(@types/node@20.5.4) + vite: 4.4.9(@types/node@20.5.6) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -2945,7 +2945,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001522 - electron-to-chromium: 1.4.500 + electron-to-chromium: 1.4.501 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true @@ -3330,8 +3330,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.500: - resolution: {integrity: sha512-P38NO8eOuWOKY1sQk5yE0crNtrjgjJj6r3NrbIKtG18KzCHmHE2Bt+aQA7/y0w3uYsHWxDa6icOohzjLJ4vJ4A==} + /electron-to-chromium@1.4.501: + resolution: {integrity: sha512-NCF5hZUg73MEP0guvIM+BjPs9W07UeAuc5XCNqRZZTKJxLjE0ZS/Zo5UsV8bbs2y/jeKRPFPzdWdBfOGEZTXKg==} dev: true /emoji-regex@8.0.0: @@ -3618,7 +3618,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.2.2) debug: 3.2.7 eslint: 8.47.0 eslint-import-resolver-node: 0.3.9 @@ -3636,7 +3636,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@5.2.2) array-includes: 3.1.6 array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 @@ -3667,7 +3667,7 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 aria-query: 5.3.0 array-includes: 3.1.6 array.prototype.flatmap: 1.3.1 @@ -3793,7 +3793,7 @@ packages: create-esm-loader: 0.2.3 npm-run-all: 4.1.5 semver: 7.5.4 - typescript: 5.1.6 + typescript: 5.2.2 dev: false /espree@9.6.1: @@ -4467,8 +4467,8 @@ packages: resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==} dev: true - /jest-diff@29.6.3: - resolution: {integrity: sha512-3sw+AdWnwH9sSNohMRKA7JiYUJSRr/WS6+sEFfBuhxU5V5GlEVKfvUn8JuMHE0wqKowemR1C2aHy8VtXbaV8dQ==} + /jest-diff@29.6.4: + resolution: {integrity: sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 @@ -6082,7 +6082,7 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: - '@babel/runtime': 7.22.10 + '@babel/runtime': 7.22.11 react: 18.2.0 use-composed-ref: 1.3.0(react@18.2.0) use-latest: 1.2.1(@types/react@18.2.21)(react@18.2.0) @@ -6666,20 +6666,20 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: false - /ts-api-utils@1.0.2(typescript@5.1.6): + /ts-api-utils@1.0.2(typescript@5.2.2): resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==} engines: {node: '>=16.13.0'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.1.6 + typescript: 5.2.2 dev: true /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /tsconfck@2.1.2(typescript@5.1.6): + /tsconfck@2.1.2(typescript@5.2.2): resolution: {integrity: sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==} engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true @@ -6689,7 +6689,7 @@ packages: typescript: optional: true dependencies: - typescript: 5.1.6 + typescript: 5.2.2 dev: true /tsconfig-paths@3.14.2: @@ -6709,7 +6709,7 @@ packages: '@tsd/typescript': 5.0.4 eslint-formatter-pretty: 4.1.0 globby: 11.1.0 - jest-diff: 29.6.3 + jest-diff: 29.6.4 meow: 9.0.0 path-exists: 4.0.0 read-pkg-up: 7.0.1 @@ -6727,14 +6727,14 @@ packages: resolution: {integrity: sha512-h9wayHHFI5+yqt8iau0vqH96cTNhezhZ/Fk/hrIdpfkiMu3lg9nzyvMfs5bIdX51IVzZO6DudLqhkL/rVXpT6g==} dev: false - /tsutils@3.21.0(typescript@5.1.6): + /tsutils@3.21.0(typescript@5.2.2): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.1.6 + typescript: 5.2.2 dev: false /type-check@0.4.0: @@ -6825,8 +6825,8 @@ packages: is-typedarray: 1.0.0 dev: false - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true @@ -7045,7 +7045,7 @@ packages: vfile-message: 3.1.4 dev: false - /vite-tsconfig-paths@4.2.0(typescript@5.1.6)(vite@4.4.9): + /vite-tsconfig-paths@4.2.0(typescript@5.2.2)(vite@4.4.9): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: vite: '*' @@ -7055,14 +7055,14 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 2.1.2(typescript@5.1.6) - vite: 4.4.9(@types/node@20.5.4) + tsconfck: 2.1.2(typescript@5.2.2) + vite: 4.4.9(@types/node@20.5.6) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.4.9(@types/node@20.5.4): + /vite@4.4.9(@types/node@20.5.6): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -7090,7 +7090,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.5.4 + '@types/node': 20.5.6 esbuild: 0.18.20 postcss: 8.4.28 rollup: 3.28.1 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 9b1a57e1..f67f767b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -133,16 +133,15 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] @@ -172,9 +171,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -763,9 +762,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.24" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" +checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" dependencies = [ "clap_builder", "clap_derive", @@ -774,9 +773,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.24" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" +checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" dependencies = [ "anstream", "anstyle", @@ -786,9 +785,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" dependencies = [ "heck", "proc-macro2", @@ -798,9 +797,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "clipboard-win" @@ -2410,17 +2409,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.8", - "windows-sys 0.48.0", -] - [[package]] name = "is-wsl" version = "0.4.0" @@ -6396,9 +6384,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 825a730f..82683977 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -25,11 +25,6 @@ async fn close_splashscreen(window: tauri::Window) { fn main() { tauri::Builder::default() - .setup(|app| { - #[cfg(debug_assertions)] - app.get_window("main").unwrap().open_devtools(); - Ok(()) - }) .plugin( tauri_plugin_sql::Builder::default() .add_migrations( diff --git a/src/app/space/components/widgets/network.tsx b/src/app/space/components/widgets/network.tsx index bfbee5ad..32c17eeb 100644 --- a/src/app/space/components/widgets/network.tsx +++ b/src/app/space/components/widgets/network.tsx @@ -1,7 +1,6 @@ import { NDKEvent, NDKFilter, NDKKind } from '@nostr-dev-kit/ndk'; import { useInfiniteQuery } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; -import { destr } from 'destr'; import { useCallback, useEffect, useMemo, useRef } from 'react'; import { useStorage } from '@libs/storage/provider'; @@ -31,9 +30,6 @@ export function NetworkWidget() { return await db.getAllEvents(30, pageParam); }, getNextPageParam: (lastPage) => lastPage.nextCursor, - refetchOnWindowFocus: false, - refetchOnReconnect: false, - refetchOnMount: false, }); const dbEvents = useMemo( @@ -130,25 +126,29 @@ export function NetworkWidget() { since: db.account.last_login_at ?? Math.floor(Date.now() / 1000), }; - sub(filter, async (event) => { - let root: string; - let reply: string; - if (event.tags?.[0]?.[0] === 'e' && !event.tags?.[0]?.[3]) { - root = event.tags[0][1]; - } else { - root = event.tags.find((el) => el[3] === 'root')?.[1]; - reply = event.tags.find((el) => el[3] === 'reply')?.[1]; - } - await db.createEvent( - event.id, - destr(event), - event.pubkey, - event.kind, - root, - reply, - event.created_at - ); - }); + sub( + filter, + async (event) => { + let root: string; + let reply: string; + if (event.tags?.[0]?.[0] === 'e' && !event.tags?.[0]?.[3]) { + root = event.tags[0][1]; + } else { + root = event.tags.find((el) => el[3] === 'root')?.[1]; + reply = event.tags.find((el) => el[3] === 'reply')?.[1]; + } + await db.createEvent( + event.id, + JSON.stringify(event), + event.pubkey, + event.kind, + root, + reply, + event.created_at + ); + }, + false // don't close sub on eose + ); } }, []); diff --git a/src/app/users/components/profile.tsx b/src/app/users/components/profile.tsx index f1caadc2..a37e1153 100644 --- a/src/app/users/components/profile.tsx +++ b/src/app/users/components/profile.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import { UserMetadata } from '@app/users/components/metadata'; +import { UserStats } from '@app/users/components/stats'; import { useStorage } from '@libs/storage/provider'; @@ -49,67 +49,85 @@ export function UserProfile({ pubkey }: { pubkey: string }) { } }, [status]); + if (!user) return

Loading...

; + return ( <> -
- {'banner'} +
+ {user.banner ? ( + user banner + ) : ( +
+ )}
-
+
{pubkey} -
-
+
+
-
- {user?.displayName || user?.name || 'No name'} +
+ {user.display_name || user.displayName || user.name || 'No name'}
- - {user?.nip05 || shortenKey(pubkey)} + + {user.nip05 || user.username || shortenKey(pubkey)}
-
- {status === 'loading' ? ( - - ) : followed ? ( - +
+ {user.about || user.bio ? ( +

+ {user.about || user.bio} +

) : ( - + <> )} - - Message - - - {db.account.pubkey === pubkey && } +
-
-

- {user?.about || user?.bio} -

- +
+ {status === 'loading' ? ( + + ) : followed ? ( + + ) : ( + + )} + + Message + + {db.account.pubkey === pubkey && ( + <> + + + + )}
diff --git a/src/app/users/components/metadata.tsx b/src/app/users/components/stats.tsx similarity index 71% rename from src/app/users/components/metadata.tsx rename to src/app/users/components/stats.tsx index c72ad043..9c25d232 100644 --- a/src/app/users/components/metadata.tsx +++ b/src/app/users/components/stats.tsx @@ -1,8 +1,10 @@ import { useQuery } from '@tanstack/react-query'; +import { LoaderIcon } from '@shared/icons'; + import { compactNumber } from '@utils/number'; -export function UserMetadata({ pubkey }: { pubkey: string }) { +export function UserStats({ pubkey }: { pubkey: string }) { const { status, data } = useQuery(['user-metadata', pubkey], async () => { const res = await fetch(`https://api.nostr.band/v0/stats/profile/${pubkey}`); if (!res.ok) { @@ -12,24 +14,32 @@ export function UserMetadata({ pubkey }: { pubkey: string }) { }); if (status === 'loading') { - return

Loading...

; + return ( +
+ +
+ ); + } + + if (status === 'error') { + return
; } return (
-
+
{compactNumber.format(data.stats[pubkey].followers_pubkey_count) ?? 0} Followers
-
+
{compactNumber.format(data.stats[pubkey].pub_following_pubkey_count) ?? 0} Following
-
+
{data.stats[pubkey].zaps_received ? compactNumber.format(data.stats[pubkey].zaps_received.msats / 1000) @@ -37,7 +47,7 @@ export function UserMetadata({ pubkey }: { pubkey: string }) { Zaps received
-
+
{data.stats[pubkey].zaps_sent ? compactNumber.format(data.stats[pubkey].zaps_sent.msats / 1000) diff --git a/src/app/users/index.tsx b/src/app/users/index.tsx index 201a8fa1..695f0391 100644 --- a/src/app/users/index.tsx +++ b/src/app/users/index.tsx @@ -1,38 +1,115 @@ +import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { useQuery } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; -import { useRef } from 'react'; +import { useCallback, useRef } from 'react'; import { useParams } from 'react-router-dom'; +import { UserProfile } from '@app/users/components/profile'; + import { useNDK } from '@libs/ndk/provider'; -import { NoteSkeleton, TextNote } from '@shared/notes'; +import { + ArticleNote, + FileNote, + NoteSkeleton, + NoteWrapper, + Repost, + TextNote, + UnknownNote, +} from '@shared/notes'; import { nHoursAgo } from '@utils/date'; -import { LumeEvent } from '@utils/types'; - -import { UserProfile } from './components/profile'; export function UserScreen() { - const parentRef = useRef(); - const { pubkey } = useParams(); const { ndk } = useNDK(); const { status, data } = useQuery(['user-feed', pubkey], async () => { const events = await ndk.fetchEvents({ - kinds: [1], + kinds: [NDKKind.Text, NDKKind.Repost, NDKKind.Article], authors: [pubkey], since: nHoursAgo(48), }); - return [...events] as unknown as LumeEvent[]; + return [...events] as unknown as NDKEvent[]; }); - const rowVirtualizer = useVirtualizer({ + const parentRef = useRef(); + const virtualizer = useVirtualizer({ count: data ? data.length : 0, getScrollElement: () => parentRef.current, - estimateSize: () => 400, + estimateSize: () => 650, + overscan: 2, }); + const items = virtualizer.getVirtualItems(); - const itemsVirtualizer = rowVirtualizer.getVirtualItems(); + // render event match event kind + const renderItem = useCallback( + (index: string | number) => { + const event: NDKEvent = data[index]; + if (!event) return; + + switch (event.kind) { + case NDKKind.Text: + return ( +
+ + + +
+ ); + case NDKKind.Repost: + return ( +
+ +
+ ); + case 1063: + return ( +
+ + + +
+ ); + case NDKKind.Article: + return ( +
+ + + +
+ ); + default: + return ( +
+ + + +
+ ); + } + }, + [data] + ); return (
-
-
-

Latest posts

- 48 hours ago -
-
+
+

+ Latest postrs +

+
{status === 'loading' ? (
-
+
- ) : itemsVirtualizer.length === 0 ? ( + ) : items.length === 0 ? (
-

- No new posts in 48 hours ago +

+ User doesn't have any postrs in the last 48 hours.

) : (
- {itemsVirtualizer.map((virtualRow) => ( -
- -
- ))} -
+ {items.map((item) => renderItem(item.index))}
)} diff --git a/src/index.css b/src/index.css index 87a1b332..f757e792 100644 --- a/src/index.css +++ b/src/index.css @@ -15,7 +15,7 @@ button { } .markdown { - @apply prose prose-white max-w-none select-text hyphens-auto text-white prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:after:content-['_↗'] hover:prose-a:text-fuchsia-500 prose-blockquote:mb-1 prose-blockquote:mt-1 prose-blockquote:border-l-[2px] prose-blockquote:border-fuchsia-500 prose-blockquote:pl-2 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-ul:mt-1 prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2; + @apply prose prose-white max-w-none select-text hyphens-auto text-white prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal hover:prose-a:text-fuchsia-500 prose-blockquote:mb-1 prose-blockquote:mt-1 prose-blockquote:border-l-[2px] prose-blockquote:border-fuchsia-500 prose-blockquote:pl-2 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-ul:mt-1 prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2; } .ProseMirror p.is-empty::before { diff --git a/src/shared/navigation.tsx b/src/shared/navigation.tsx index 919db17d..be144e58 100644 --- a/src/shared/navigation.tsx +++ b/src/shared/navigation.tsx @@ -110,7 +110,7 @@ export function Navigation() {
diff --git a/src/shared/userProfile.tsx b/src/shared/userProfile.tsx index 2f2959a9..f4024d36 100644 --- a/src/shared/userProfile.tsx +++ b/src/shared/userProfile.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; -import { UserMetadata } from '@app/users/components/metadata'; +import { UserMetadata } from '@app/users/components/stats'; import { Image } from '@shared/image'; diff --git a/src/utils/hooks/useNostr.ts b/src/utils/hooks/useNostr.ts index bf5a4f84..1c335d62 100644 --- a/src/utils/hooks/useNostr.ts +++ b/src/utils/hooks/useNostr.ts @@ -44,6 +44,14 @@ export function useNostr() { subManager.set(JSON.stringify(filter), subEvent); subEvent.addListener('event', (event: NDKEvent) => { + delete event.ndk; + delete event.decrypt; + delete event.encrypt; + delete event.encode; + delete event.isParamReplaceable; + delete event.isReplaceable; + delete event.repost; + delete event.relay; callback(event); }); };