From 41460436df4f386209f0c758a4ab7896f22e6b58 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Tue, 11 Jul 2023 14:27:14 +0700 Subject: [PATCH 01/37] add nostr-fetch --- package.json | 6 +- pnpm-lock.yaml | 162 ++++++++++++++++++------------ src/app/root.tsx | 77 ++++++++------ src/app/user/components/feed.tsx | 20 ++-- src/libs/ndk/instance.ts | 7 +- src/libs/ndk/provider.tsx | 6 +- src/libs/ndk/utils.tsx | 23 ----- src/libs/storage.tsx | 4 +- src/shared/notification/modal.tsx | 29 +++--- src/utils/date.tsx | 3 + src/utils/hooks/useSocial.tsx | 28 +++--- 11 files changed, 202 insertions(+), 163 deletions(-) delete mode 100644 src/libs/ndk/utils.tsx diff --git a/package.json b/package.json index b340d8b0..ce21269f 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "dependencies": { "@headlessui/react": "^1.7.15", "@nostr-dev-kit/ndk": "^0.7.5", + "@nostr-fetch/adapter-ndk": "^0.11.0", "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-tooltip": "^1.0.6", "@tanstack/react-query": "^4.29.19", @@ -31,6 +32,7 @@ "get-urls": "^11.0.0", "immer": "^10.0.2", "light-bolt11-decoder": "^3.0.0", + "nostr-fetch": "^0.11.0", "nostr-tools": "^1.12.1", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -57,8 +59,8 @@ "@types/react": "^18.2.14", "@types/react-dom": "^18.2.6", "@types/youtube-player": "^5.5.7", - "@typescript-eslint/eslint-plugin": "^5.61.0", - "@typescript-eslint/parser": "^5.61.0", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "@vitejs/plugin-react-swc": "^3.3.2", "autoprefixer": "^10.4.14", "cross-env": "^7.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 815d383e..6a2b61fb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,9 @@ dependencies: '@nostr-dev-kit/ndk': specifier: ^0.7.5 version: 0.7.5(typescript@4.9.5) + '@nostr-fetch/adapter-ndk': + specifier: ^0.11.0 + version: 0.11.0(@nostr-dev-kit/ndk@0.7.5)(nostr-fetch@0.11.0) '@radix-ui/react-popover': specifier: ^1.0.6 version: 1.0.6(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) @@ -46,6 +49,9 @@ dependencies: light-bolt11-decoder: specifier: ^3.0.0 version: 3.0.0 + nostr-fetch: + specifier: ^0.11.0 + version: 0.11.0 nostr-tools: specifier: ^1.12.1 version: 1.12.1 @@ -121,11 +127,11 @@ devDependencies: specifier: ^5.5.7 version: 5.5.7 '@typescript-eslint/eslint-plugin': - specifier: ^5.61.0 - version: 5.61.0(@typescript-eslint/parser@5.61.0)(eslint@8.44.0)(typescript@4.9.5) + specifier: ^5.62.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.44.0)(typescript@4.9.5) '@typescript-eslint/parser': - specifier: ^5.61.0 - version: 5.61.0(eslint@8.44.0)(typescript@4.9.5) + specifier: ^5.62.0 + version: 5.62.0(eslint@8.44.0)(typescript@4.9.5) '@vitejs/plugin-react-swc': specifier: ^3.3.2 version: 3.3.2(vite@4.4.2) @@ -882,6 +888,10 @@ packages: engines: {node: '>= 16'} dev: false + /@noble/secp256k1@1.7.1: + resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + dev: false + /@noble/secp256k1@2.0.0: resolution: {integrity: sha512-rUGBd95e2a45rlmFTqQJYEFA4/gdIARFfuTuTqLglz0PZ6AKyzyXsEZZq7UZn8hZsvaBgpCzKKBJizT2cJERXw==} dev: false @@ -910,14 +920,14 @@ packages: '@noble/hashes': 1.3.1 '@noble/secp256k1': 2.0.0 '@scure/base': 1.1.1 - '@typescript-eslint/eslint-plugin': 5.61.0(@typescript-eslint/parser@5.61.0)(eslint@8.44.0)(typescript@4.9.5) - '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) debug: 4.3.4 esbuild: 0.17.19 esbuild-plugin-alias: 0.2.1 eslint: 8.44.0 eslint-config-prettier: 8.8.0(eslint@8.44.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.61.0)(eslint@8.44.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.44.0) esm-loader-typescript: 1.0.5 eventemitter3: 5.0.1 light-bolt11-decoder: 3.0.0 @@ -933,6 +943,24 @@ packages: - typescript dev: false + /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.7.5)(nostr-fetch@0.11.0): + resolution: {integrity: sha512-Otl7SEzm9ecqyHB10bpYXBu1qpqJEnipp7dZ4qcA9LeJAtM38fnYKUD34HX0JXA9EDjtc6VS5UNZe544xC9GCg==} + peerDependencies: + '@nostr-dev-kit/ndk': ^0.5.0 + nostr-fetch: ^0.11.0 + dependencies: + '@nostr-dev-kit/ndk': 0.7.5(typescript@4.9.5) + '@nostr-fetch/kernel': 0.11.0 + nostr-fetch: 0.11.0 + dev: false + + /@nostr-fetch/kernel@0.11.0: + resolution: {integrity: sha512-OQGAfrGckWkUmFBbE85hq/njVmFrWP21uO8XgXQ1ISS7yrD2N5zcOs1XXXRnaTwIMCv25E8s5Gsgf0AhVWtDEw==} + dependencies: + '@noble/hashes': 1.3.1 + '@noble/secp256k1': 1.7.1 + dev: false + /@npmcli/fs@3.1.0: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -1793,8 +1821,8 @@ packages: resolution: {integrity: sha512-W8F4eoTIvzXeNrT3JroQPimZLXnlJA8smYygHZUKFPVoYwgs/OhJkA1VBhL3iSs57OQkuINqHlY4SmMT5wtnJg==} dev: true - /@typescript-eslint/eslint-plugin@5.61.0(@typescript-eslint/parser@5.61.0)(eslint@8.44.0)(typescript@4.9.5): - resolution: {integrity: sha512-A5l/eUAug103qtkwccSCxn8ZRwT+7RXWkFECdA4Cvl1dOlDUgTpAOfSEElZn2uSUxhdDpnCdetrf0jvU4qrL+g==} + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.44.0)(typescript@4.9.5): + resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -1805,10 +1833,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@4.9.5) - '@typescript-eslint/scope-manager': 5.61.0 - '@typescript-eslint/type-utils': 5.61.0(eslint@8.44.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.61.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/type-utils': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.44.0)(typescript@4.9.5) debug: 4.3.4 eslint: 8.44.0 graphemer: 1.4.0 @@ -1820,8 +1848,8 @@ packages: transitivePeerDependencies: - supports-color - /@typescript-eslint/parser@5.61.0(eslint@8.44.0)(typescript@4.9.5): - resolution: {integrity: sha512-yGr4Sgyh8uO6fSi9hw3jAFXNBHbCtKKFMdX2IkT3ZqpKmtAq3lHS4ixB/COFuAIJpwl9/AqF7j72ZDWYKmIfvg==} + /@typescript-eslint/parser@5.62.0(eslint@8.44.0)(typescript@4.9.5): + resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1830,24 +1858,24 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.61.0 - '@typescript-eslint/types': 5.61.0 - '@typescript-eslint/typescript-estree': 5.61.0(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) debug: 4.3.4 eslint: 8.44.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color - /@typescript-eslint/scope-manager@5.61.0: - resolution: {integrity: sha512-W8VoMjoSg7f7nqAROEmTt6LoBpn81AegP7uKhhW5KzYlehs8VV0ZW0fIDVbcZRcaP3aPSW+JZFua+ysQN+m/Nw==} + /@typescript-eslint/scope-manager@5.62.0: + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.61.0 - '@typescript-eslint/visitor-keys': 5.61.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 - /@typescript-eslint/type-utils@5.61.0(eslint@8.44.0)(typescript@4.9.5): - resolution: {integrity: sha512-kk8u//r+oVK2Aj3ph/26XdH0pbAkC2RiSjUYhKD+PExemG4XSjpGFeyZ/QM8lBOa7O8aGOU+/yEbMJgQv/DnCg==} + /@typescript-eslint/type-utils@5.62.0(eslint@8.44.0)(typescript@4.9.5): + resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -1856,8 +1884,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.61.0(typescript@4.9.5) - '@typescript-eslint/utils': 5.61.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.44.0)(typescript@4.9.5) debug: 4.3.4 eslint: 8.44.0 tsutils: 3.21.0(typescript@4.9.5) @@ -1865,12 +1893,12 @@ packages: transitivePeerDependencies: - supports-color - /@typescript-eslint/types@5.61.0: - resolution: {integrity: sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==} + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /@typescript-eslint/typescript-estree@5.61.0(typescript@4.9.5): - resolution: {integrity: sha512-Fud90PxONnnLZ36oR5ClJBLTLfU4pIWBmnvGwTbEa2cXIqj70AEDEmOmpkFComjBZ/037ueKrOdHuYmSFVD7Rw==} + /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -1878,8 +1906,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.61.0 - '@typescript-eslint/visitor-keys': 5.61.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1889,8 +1917,8 @@ packages: transitivePeerDependencies: - supports-color - /@typescript-eslint/utils@5.61.0(eslint@8.44.0)(typescript@4.9.5): - resolution: {integrity: sha512-mV6O+6VgQmVE6+xzlA91xifndPW9ElFW8vbSF0xCT/czPXVhwDewKila1jOyRwa9AE19zKnrr7Cg5S3pJVrTWQ==} + /@typescript-eslint/utils@5.62.0(eslint@8.44.0)(typescript@4.9.5): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1898,9 +1926,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.61.0 - '@typescript-eslint/types': 5.61.0 - '@typescript-eslint/typescript-estree': 5.61.0(typescript@4.9.5) + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) eslint: 8.44.0 eslint-scope: 5.1.1 semver: 7.5.4 @@ -1908,11 +1936,11 @@ packages: - supports-color - typescript - /@typescript-eslint/visitor-keys@5.61.0: - resolution: {integrity: sha512-50XQ5VdbWrX06mQXhy93WywSFZZGsv3EOjq+lqp6WC2t+j3mb6A9xYVdrRxafvK88vg9k9u+CT4l6D8PEatjKg==} + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.1 /@vitejs/plugin-react-swc@3.3.2(vite@4.4.2): @@ -2126,7 +2154,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.9 - caniuse-lite: 1.0.30001514 + caniuse-lite: 1.0.30001515 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -2184,8 +2212,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001514 - electron-to-chromium: 1.4.454 + caniuse-lite: 1.0.30001515 + electron-to-chromium: 1.4.455 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -2245,8 +2273,8 @@ packages: engines: {node: '>=6'} dev: false - /caniuse-lite@1.0.30001514: - resolution: {integrity: sha512-ENcIpYBmwAAOm/V2cXgM7rZUrKKaqisZl4ZAI520FIkqGXUxJjmaIssbRW5HVVR5tyV6ygTLIm15aU8LUmQSaQ==} + /caniuse-lite@1.0.30001515: + resolution: {integrity: sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==} dev: true /chalk@2.4.2: @@ -2419,7 +2447,7 @@ packages: dependencies: nice-try: 1.0.5 path-key: 2.0.1 - semver: 5.7.1 + semver: 5.7.2 shebang-command: 1.2.0 which: 1.3.1 dev: false @@ -2625,8 +2653,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.454: - resolution: {integrity: sha512-pmf1rbAStw8UEQ0sr2cdJtWl48ZMuPD9Sto8HVQOq9vx9j2WgDEN6lYoaqFvqEHYOmGA9oRGn7LqWI9ta0YugQ==} + /electron-to-chromium@1.4.455: + resolution: {integrity: sha512-8tgdX0Odl24LtmLwxotpJCVjIndN559AvaOtd67u+2mo+IDsgsTF580NB+uuDCqsHw8yFg53l5+imFV9Fw3cbA==} dev: true /emoji-regex@8.0.0: @@ -2697,7 +2725,7 @@ packages: string.prototype.trimstart: 1.0.6 typed-array-length: 1.0.4 unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 + which-typed-array: 1.1.10 /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} @@ -2854,7 +2882,7 @@ packages: - supports-color dev: false - /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.61.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -2875,7 +2903,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) debug: 3.2.7 eslint: 8.44.0 eslint-import-resolver-node: 0.3.7 @@ -2883,7 +2911,7 @@ packages: - supports-color dev: false - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.61.0)(eslint@8.44.0): + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.44.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -2893,7 +2921,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.61.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -2901,14 +2929,14 @@ packages: doctrine: 2.1.0 eslint: 8.44.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.61.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0) has: 1.0.3 is-core-module: 2.12.1 is-glob: 4.0.3 minimatch: 3.1.2 object.values: 1.1.6 resolve: 1.22.2 - semver: 6.3.0 + semver: 6.3.1 tsconfig-paths: 3.14.2 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -2938,7 +2966,7 @@ packages: minimatch: 3.1.2 object.entries: 1.1.6 object.fromentries: 2.0.6 - semver: 6.3.0 + semver: 6.3.1 dev: true /eslint-plugin-react@7.32.2(eslint@8.44.0): @@ -2961,7 +2989,7 @@ packages: object.values: 1.1.6 prop-types: 15.8.1 resolve: 2.0.0-next.4 - semver: 6.3.0 + semver: 6.3.1 string.prototype.matchall: 4.0.8 dev: true @@ -4267,7 +4295,7 @@ packages: dependencies: hosted-git-info: 2.8.9 resolve: 1.22.2 - semver: 5.7.1 + semver: 5.7.2 validate-npm-package-license: 3.0.4 dev: false @@ -4296,6 +4324,12 @@ packages: engines: {node: '>=12.20'} dev: false + /nostr-fetch@0.11.0: + resolution: {integrity: sha512-l4GNnS7y4Zc58ROF43uiMPvPVVB8x/hAFqzJpEEqO0IQFQNZ90t6jQIzqPQfy8tFdaPN/n89uaY7KZbNQ7HJsQ==} + dependencies: + '@nostr-fetch/kernel': 0.11.0 + dev: false + /nostr-tools@1.12.1: resolution: {integrity: sha512-ZeoV7g3jBUAlb4mKa3C+6hrc84htPkbebMShfGNgV4vAiz18e/sQukUBFL6vb/+sxZy+dBQFkRwsJIaVFs8Gfw==} dependencies: @@ -5101,13 +5135,13 @@ packages: compute-scroll-into-view: 1.0.20 dev: false - /semver@5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true dev: false - /semver@6.3.0: - resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true /semver@7.5.4: @@ -5882,8 +5916,8 @@ packages: is-string: 1.0.7 is-symbol: 1.0.4 - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + /which-typed-array@1.1.10: + resolution: {integrity: sha512-uxoA5vLUfRPdjCuJ1h5LlYdmTLbYfums398v3WLkM+i/Wltl2/XyZpQWKbN++ck5L64SR/grOHqtXCUKmlZPNA==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.5 diff --git a/src/app/root.tsx b/src/app/root.tsx index 5d0ba5d2..81aab4f6 100644 --- a/src/app/root.tsx +++ b/src/app/root.tsx @@ -1,53 +1,67 @@ -import { NDKFilter } from '@nostr-dev-kit/ndk'; -import { useEffect, useRef } from 'react'; +import { NDKUser } from '@nostr-dev-kit/ndk'; +import { nip19 } from 'nostr-tools'; +import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useNDK } from '@libs/ndk/provider'; -import { prefetchEvents } from '@libs/ndk/utils'; import { countTotalNotes, createChat, createNote, getLastLogin, + updateAccount, updateLastLogin, } from '@libs/storage'; import { LoaderIcon, LumeIcon } from '@shared/icons'; -import { dateToUnix, getHourAgo } from '@utils/date'; +import { nHoursAgo } from '@utils/date'; import { useAccount } from '@utils/hooks/useAccount'; const totalNotes = await countTotalNotes(); const lastLogin = await getLastLogin(); export function Root() { - const now = useRef(new Date()); const navigate = useNavigate(); - const { ndk } = useNDK(); + const { ndk, relayUrls, fetcher } = useNDK(); const { status, account } = useAccount(); + async function getFollows() { + const authors: string[] = []; + + const user = ndk.getUser({ hexpubkey: account.pubkey }); + const follows = await user.follows(); + + follows.forEach((follow: NDKUser) => { + authors.push(nip19.decode(follow.npub).data as string); + }); + + // update follows in db + await updateAccount('follows', authors, account.pubkey); + + return authors; + } + async function fetchNotes() { try { - const follows = JSON.parse(account.follows); + const follows = await getFollows(); if (follows.length > 0) { let since: number; - if (totalNotes === 0 || lastLogin === 0) { - since = dateToUnix(getHourAgo(48, now.current)); + since = nHoursAgo(48); } else { since = lastLogin; } - const filter: NDKFilter = { - kinds: [1, 6], - authors: follows, - since: since, - }; - - const events = await prefetchEvents(ndk, filter); - for (const event of events) { + const events = fetcher.allEventsIterator( + relayUrls, + { kinds: [1], authors: follows }, + { since: since }, + { skipVerification: true } + ); + for await (const event of events) { await createNote( event.id, event.pubkey, @@ -67,20 +81,23 @@ export function Root() { async function fetchChats() { try { - const sendFilter: NDKFilter = { - kinds: [4], - authors: [account.pubkey], - since: lastLogin, - }; + const sendMessages = await fetcher.fetchAllEvents( + relayUrls, + { + kinds: [4], + authors: [account.pubkey], + }, + { since: lastLogin } + ); - const receiveFilter: NDKFilter = { - kinds: [4], - '#p': [account.pubkey], - since: lastLogin, - }; - - const sendMessages = await prefetchEvents(ndk, sendFilter); - const receiveMessages = await prefetchEvents(ndk, receiveFilter); + const receiveMessages = await fetcher.fetchAllEvents( + relayUrls, + { + kinds: [4], + '#p': [account.pubkey], + }, + { since: lastLogin } + ); const events = [...sendMessages, ...receiveMessages]; for (const event of events) { diff --git a/src/app/user/components/feed.tsx b/src/app/user/components/feed.tsx index 5778834a..0132aac2 100644 --- a/src/app/user/components/feed.tsx +++ b/src/app/user/components/feed.tsx @@ -1,24 +1,22 @@ -import { NDKFilter } from '@nostr-dev-kit/ndk'; import { useQuery } from '@tanstack/react-query'; import { useNDK } from '@libs/ndk/provider'; import { Note } from '@shared/notes/note'; -import { dateToUnix, getHourAgo } from '@utils/date'; +import { nHoursAgo } from '@utils/date'; import { LumeEvent } from '@utils/types'; export function UserFeed({ pubkey }: { pubkey: string }) { - const { ndk } = useNDK(); + const { fetcher, relayUrls } = useNDK(); const { status, data } = useQuery(['user-feed', pubkey], async () => { - const now = new Date(); - const filter: NDKFilter = { - kinds: [1], - authors: [pubkey], - since: dateToUnix(getHourAgo(48, now)), - }; - const events = await ndk.fetchEvents(filter); - return [...events]; + const events = await fetcher.fetchAllEvents( + relayUrls, + { kinds: [1], authors: [pubkey] }, + { since: nHoursAgo(48) }, + { sort: true } + ); + return events as unknown as LumeEvent[]; }); return ( diff --git a/src/libs/ndk/instance.ts b/src/libs/ndk/instance.ts index cbd3ecb5..c66f3e12 100644 --- a/src/libs/ndk/instance.ts +++ b/src/libs/ndk/instance.ts @@ -1,15 +1,18 @@ // source: https://github.com/nostr-dev-kit/ndk-react/ import NDK from '@nostr-dev-kit/ndk'; +import { ndkAdapter } from '@nostr-fetch/adapter-ndk'; +import { NostrFetcher, normalizeRelayUrls } from 'nostr-fetch'; import { useEffect, useState } from 'react'; import { getSetting } from '@libs/storage'; const setting = await getSetting('relays'); -const relays = JSON.parse(setting); +const relays = normalizeRelayUrls(JSON.parse(setting)); export const NDKInstance = () => { const [ndk, setNDK] = useState(undefined); const [relayUrls, setRelayUrls] = useState(relays); + const [fetcher, setFetcher] = useState(undefined); useEffect(() => { loadNdk(relays); @@ -26,11 +29,13 @@ export const NDKInstance = () => { setNDK(ndkInstance); setRelayUrls(explicitRelayUrls); + setFetcher(NostrFetcher.withCustomPool(ndkAdapter(ndkInstance))); } return { ndk, relayUrls, + fetcher, loadNdk, }; }; diff --git a/src/libs/ndk/provider.tsx b/src/libs/ndk/provider.tsx index bb74bd49..6ebef78f 100644 --- a/src/libs/ndk/provider.tsx +++ b/src/libs/ndk/provider.tsx @@ -1,5 +1,6 @@ // source: https://github.com/nostr-dev-kit/ndk-react/ import NDK from '@nostr-dev-kit/ndk'; +import { NostrFetcher } from 'nostr-fetch'; import { PropsWithChildren, createContext, useContext } from 'react'; import { NDKInstance } from '@libs/ndk/instance'; @@ -7,17 +8,19 @@ import { NDKInstance } from '@libs/ndk/instance'; interface NDKContext { ndk: NDK; relayUrls: string[]; + fetcher: NostrFetcher; loadNdk: (_: string[]) => void; } const NDKContext = createContext({ ndk: new NDK({}), relayUrls: [], + fetcher: undefined, loadNdk: undefined, }); const NDKProvider = ({ children }: PropsWithChildren) => { - const { ndk, relayUrls, loadNdk } = NDKInstance(); + const { ndk, relayUrls, fetcher, loadNdk } = NDKInstance(); if (ndk) return ( @@ -25,6 +28,7 @@ const NDKProvider = ({ children }: PropsWithChildren) => { value={{ ndk, relayUrls, + fetcher, loadNdk, }} > diff --git a/src/libs/ndk/utils.tsx b/src/libs/ndk/utils.tsx deleted file mode 100644 index 78beb34f..00000000 --- a/src/libs/ndk/utils.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import NDK, { NDKEvent, NDKFilter } from '@nostr-dev-kit/ndk'; - -export async function prefetchEvents( - ndk: NDK, - filter: NDKFilter -): Promise> { - return new Promise((resolve) => { - const events: Map = new Map(); - - const relaySetSubscription = ndk.subscribe(filter, { - closeOnEose: true, - }); - - relaySetSubscription.on('event', (event: NDKEvent) => { - event.ndk = ndk; - events.set(event.tagId(), event); - }); - - relaySetSubscription.on('eose', () => { - setTimeout(() => resolve(new Set(events.values())), 3000); - }); - }); -} diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index 00e69c1c..6071619c 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -440,7 +440,9 @@ export async function createMetadata(id: string, pubkey: string, content: string // get metadata export async function getUserMetadata(pubkey: string) { const db = await connect(); - const result = await db.select(`SELECT content FROM metadata WHERE id = "${pubkey}";`); + const result = await db.select( + `SELECT content, created_at FROM metadata WHERE id = "${pubkey}";` + ); if (result[0]) { return JSON.parse(result[0].content); } else { diff --git a/src/shared/notification/modal.tsx b/src/shared/notification/modal.tsx index 0ddebff9..2ff02db3 100644 --- a/src/shared/notification/modal.tsx +++ b/src/shared/notification/modal.tsx @@ -1,7 +1,7 @@ import { Dialog, Transition } from '@headlessui/react'; -import { NDKEvent, NDKFilter } from '@nostr-dev-kit/ndk'; +import { NDKEvent } from '@nostr-dev-kit/ndk'; import { useQuery } from '@tanstack/react-query'; -import { Fragment, useRef, useState } from 'react'; +import { Fragment, useState } from 'react'; import { useNDK } from '@libs/ndk/provider'; @@ -9,29 +9,26 @@ import { BellIcon, CancelIcon, LoaderIcon } from '@shared/icons'; import { NotificationUser } from '@shared/notification/user'; import { User } from '@shared/user'; -import { dateToUnix, getHourAgo } from '@utils/date'; +import { nHoursAgo } from '@utils/date'; +import { LumeEvent } from '@utils/types'; export function NotificationModal({ pubkey }: { pubkey: string }) { - const now = useRef(new Date()); const [isOpen, setIsOpen] = useState(false); - const { ndk } = useNDK(); + const { fetcher, relayUrls } = useNDK(); const { status, data } = useQuery( - ['user-notification', pubkey], + ['notification', pubkey], async () => { - const filter: NDKFilter = { - '#p': [pubkey], - kinds: [1, 6, 7, 9735], - since: dateToUnix(getHourAgo(48, now.current)), - }; - const events = await ndk.fetchEvents(filter); - return [...events]; + const events = await fetcher.fetchAllEvents( + relayUrls, + { '#p': [pubkey], kinds: [1, 6, 7, 9735] }, + { since: nHoursAgo(48) }, + { sort: true } + ); + return events as unknown as LumeEvent[]; }, { - refetchOnMount: false, - refetchOnReconnect: false, refetchOnWindowFocus: false, - staleTime: Infinity, } ); diff --git a/src/utils/date.tsx b/src/utils/date.tsx index 6c981663..e289a359 100644 --- a/src/utils/date.tsx +++ b/src/utils/date.tsx @@ -20,3 +20,6 @@ export function dateToUnix(_date?: Date) { return Math.floor(date.getTime() / 1000); } + +export const nHoursAgo = (hrs: number): number => + Math.floor((Date.now() - hrs * 60 * 60 * 1000) / 1000); diff --git a/src/utils/hooks/useSocial.tsx b/src/utils/hooks/useSocial.tsx index 5841c027..5a3062e6 100644 --- a/src/utils/hooks/useSocial.tsx +++ b/src/utils/hooks/useSocial.tsx @@ -4,26 +4,26 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useNDK } from '@libs/ndk/provider'; import { createNote } from '@libs/storage'; -import { dateToUnix, getHourAgo } from '@utils/date'; +import { dateToUnix, getHourAgo, nHoursAgo } from '@utils/date'; import { useAccount } from '@utils/hooks/useAccount'; import { usePublish } from '@utils/hooks/usePublish'; import { nip02ToArray } from '@utils/transform'; +import { LumeEvent } from '@utils/types'; export function useSocial() { const queryClient = useQueryClient(); const publish = usePublish(); - const { ndk } = useNDK(); + const { ndk, fetcher, relayUrls } = useNDK(); const { account } = useAccount(); const { status, data: userFollows } = useQuery( ['userFollows', account.pubkey], async () => { - const res = await ndk.fetchEvents({ + const res = await fetcher.fetchLastEvent(relayUrls, { kinds: [3], authors: [account.pubkey], }); - const latest = [...res].slice(-1)[0]; - const list = nip02ToArray(latest.tags); + const list = nip02ToArray(res.tags); return list; }, { @@ -68,14 +68,14 @@ export function useSocial() { }); // fetch events - const filter: NDKFilter = { - authors: [pubkey], - kinds: [1, 6], - since: dateToUnix(getHourAgo(48, new Date())), - }; - const events = await ndk.fetchEvents(filter); - events.forEach((event: NDKEvent) => { - createNote( + const events = await fetcher.fetchAllEvents( + relayUrls, + { authors: [pubkey], kinds: [1, 6] }, + { since: nHoursAgo(48) } + ); + + for (const event of events) { + await createNote( event.id, event.pubkey, event.kind, @@ -83,7 +83,7 @@ export function useSocial() { event.content, event.created_at ); - }); + } }; return { status, userFollows, follow, unfollow }; From 1f18d8bb444e5a51f59b0e3bd771f301249972c5 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sat, 15 Jul 2023 12:20:09 +0700 Subject: [PATCH 02/37] refactor note component --- package.json | 16 +- pnpm-lock.yaml | 648 +++++++++--------- src/app/note/index.tsx | 4 - src/app/space/components/blocks/feed.tsx | 82 ++- src/app/space/components/blocks/following.tsx | 90 ++- src/app/space/components/blocks/thread.tsx | 8 - src/app/trending/components/trendingNotes.tsx | 4 +- src/app/user/components/feed.tsx | 14 +- src/libs/storage.tsx | 39 +- src/shared/icons/index.tsx | 1 + src/shared/icons/reaction.tsx | 37 + src/shared/icons/repost.tsx | 16 +- src/shared/notes/actions.tsx | 29 + src/shared/notes/actions/reaction.tsx | 32 + .../notes/{metadata => actions}/reply.tsx | 27 +- .../notes/{metadata => actions}/repost.tsx | 34 +- .../notes/{metadata => actions}/zap.tsx | 27 +- src/shared/notes/contents/kind1.tsx | 40 -- src/shared/notes/contents/kind1063.tsx | 24 - src/shared/notes/index.tsx | 22 + src/shared/notes/kinds/kind1.tsx | 52 ++ src/shared/notes/kinds/kind1063.tsx | 42 ++ src/shared/notes/kinds/repost.tsx | 74 ++ src/shared/notes/kinds/sub.tsx | 60 ++ src/shared/notes/kinds/thread.tsx | 58 ++ src/shared/notes/kinds/unsupport.tsx | 40 ++ src/shared/notes/mentions/note.tsx | 24 +- src/shared/notes/metadata.tsx | 211 +++--- src/shared/notes/note.tsx | 89 --- src/shared/notes/parent.tsx | 46 -- src/shared/notes/replies/item.tsx | 2 - src/shared/notes/repost.tsx | 49 -- src/shared/notes/users/mini.tsx | 22 + src/shared/notes/users/repost.tsx | 34 + src/shared/user.tsx | 27 +- src/utils/hooks/useEvent.tsx | 17 +- src/utils/hooks/useProfile.tsx | 3 - src/utils/parser.tsx | 14 - 38 files changed, 1174 insertions(+), 884 deletions(-) create mode 100644 src/shared/icons/reaction.tsx create mode 100644 src/shared/notes/actions.tsx create mode 100644 src/shared/notes/actions/reaction.tsx rename src/shared/notes/{metadata => actions}/reply.tsx (60%) rename src/shared/notes/{metadata => actions}/repost.tsx (60%) rename src/shared/notes/{metadata => actions}/zap.tsx (54%) delete mode 100644 src/shared/notes/contents/kind1.tsx delete mode 100644 src/shared/notes/contents/kind1063.tsx create mode 100644 src/shared/notes/index.tsx create mode 100644 src/shared/notes/kinds/kind1.tsx create mode 100644 src/shared/notes/kinds/kind1063.tsx create mode 100644 src/shared/notes/kinds/repost.tsx create mode 100644 src/shared/notes/kinds/sub.tsx create mode 100644 src/shared/notes/kinds/thread.tsx create mode 100644 src/shared/notes/kinds/unsupport.tsx delete mode 100644 src/shared/notes/note.tsx delete mode 100644 src/shared/notes/parent.tsx delete mode 100644 src/shared/notes/repost.tsx create mode 100644 src/shared/notes/users/mini.tsx create mode 100644 src/shared/notes/users/repost.tsx diff --git a/package.json b/package.json index ce21269f..135c2b53 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "@headlessui/react": "^1.7.15", - "@nostr-dev-kit/ndk": "^0.7.5", + "@nostr-dev-kit/ndk": "^0.7.6", "@nostr-fetch/adapter-ndk": "^0.11.0", "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-tooltip": "^1.0.6", @@ -28,7 +28,7 @@ "cheerio": "1.0.0-rc.12", "dayjs": "^1.11.9", "destr": "^1.2.2", - "framer-motion": "^10.12.18", + "framer-motion": "^10.12.20", "get-urls": "^11.0.0", "immer": "^10.0.2", "light-bolt11-decoder": "^3.0.0", @@ -41,7 +41,7 @@ "react-player": "^2.12.0", "react-router-dom": "^6.14.1", "react-string-replace": "^1.1.1", - "react-virtuoso": "^4.3.11", + "react-virtuoso": "^4.4.0", "slate": "^0.94.1", "slate-history": "^0.93.0", "slate-react": "^0.94.2", @@ -56,8 +56,8 @@ "@tauri-apps/cli": "^1.4.0", "@trivago/prettier-plugin-sort-imports": "^4.1.1", "@types/node": "^18.16.19", - "@types/react": "^18.2.14", - "@types/react-dom": "^18.2.6", + "@types/react": "^18.2.15", + "@types/react-dom": "^18.2.7", "@types/youtube-player": "^5.5.7", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", @@ -73,13 +73,13 @@ "eslint-plugin-simple-import-sort": "^10.0.0", "husky": "^8.0.3", "lint-staged": "^13.2.3", - "postcss": "^8.4.25", + "postcss": "^8.4.26", "prettier": "^2.8.8", "prettier-plugin-tailwindcss": "^0.3.0", "prop-types": "^15.8.1", - "tailwindcss": "^3.3.2", + "tailwindcss": "^3.3.3", "typescript": "^4.9.5", - "vite": "^4.4.2", + "vite": "^4.4.4", "vite-plugin-top-level-await": "^1.3.1", "vite-tsconfig-paths": "^4.2.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a2b61fb..e58692e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,17 +5,17 @@ dependencies: specifier: ^1.7.15 version: 1.7.15(react-dom@18.2.0)(react@18.2.0) '@nostr-dev-kit/ndk': - specifier: ^0.7.5 - version: 0.7.5(typescript@4.9.5) + specifier: ^0.7.6 + version: 0.7.6(typescript@4.9.5) '@nostr-fetch/adapter-ndk': specifier: ^0.11.0 - version: 0.11.0(@nostr-dev-kit/ndk@0.7.5)(nostr-fetch@0.11.0) + version: 0.11.0(@nostr-dev-kit/ndk@0.7.6)(nostr-fetch@0.11.0) '@radix-ui/react-popover': specifier: ^1.0.6 - version: 1.0.6(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) + version: 1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) '@radix-ui/react-tooltip': specifier: ^1.0.6 - version: 1.0.6(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) + version: 1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': specifier: ^4.29.19 version: 4.29.19(react-dom@18.2.0)(react@18.2.0) @@ -38,8 +38,8 @@ dependencies: specifier: ^1.2.2 version: 1.2.2 framer-motion: - specifier: ^10.12.18 - version: 10.12.18(react-dom@18.2.0)(react@18.2.0) + specifier: ^10.12.20 + version: 10.12.20(react-dom@18.2.0)(react@18.2.0) get-urls: specifier: ^11.0.0 version: 11.0.0 @@ -77,8 +77,8 @@ dependencies: specifier: ^1.1.1 version: 1.1.1 react-virtuoso: - specifier: ^4.3.11 - version: 4.3.11(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.4.0 + version: 4.4.0(react-dom@18.2.0)(react@18.2.0) slate: specifier: ^0.94.1 version: 0.94.1 @@ -93,13 +93,13 @@ dependencies: version: 1.13.2 tauri-plugin-autostart-api: specifier: github:tauri-apps/tauri-plugin-autostart#v1 - version: github.com/tauri-apps/tauri-plugin-autostart/f409102d516cdac20bb7dde4300a0e495c61d6f2 + version: github.com/tauri-apps/tauri-plugin-autostart/59c48c642cea6a854bb1f4181972ad0bfbeb0c75 tauri-plugin-sql-api: specifier: github:tauri-apps/tauri-plugin-sql - version: github.com/tauri-apps/tauri-plugin-sql/91195cd53a9599e3c043aee2490c0d5bd7989f18 + version: github.com/tauri-apps/tauri-plugin-sql/f8125e517d9de2a567a2eaa14f7b1b32e456278b tauri-plugin-stronghold-api: specifier: github:tauri-apps/tauri-plugin-stronghold#v1 - version: github.com/tauri-apps/tauri-plugin-stronghold/910f0dcda71336f75e284c84bbabe05ed2491128 + version: github.com/tauri-apps/tauri-plugin-stronghold/a2dbe1f937f2f2a1fd27d5a4a7a87ec7b7d1f5d4 zustand: specifier: ^4.3.9 version: 4.3.9(immer@10.0.2)(react@18.2.0) @@ -107,7 +107,7 @@ dependencies: devDependencies: '@tailwindcss/typography': specifier: ^0.5.9 - version: 0.5.9(tailwindcss@3.3.2) + version: 0.5.9(tailwindcss@3.3.3) '@tauri-apps/cli': specifier: ^1.4.0 version: 1.4.0 @@ -118,11 +118,11 @@ devDependencies: specifier: ^18.16.19 version: 18.16.19 '@types/react': - specifier: ^18.2.14 - version: 18.2.14 + specifier: ^18.2.15 + version: 18.2.15 '@types/react-dom': - specifier: ^18.2.6 - version: 18.2.6 + specifier: ^18.2.7 + version: 18.2.7 '@types/youtube-player': specifier: ^5.5.7 version: 5.5.7 @@ -134,10 +134,10 @@ devDependencies: version: 5.62.0(eslint@8.44.0)(typescript@4.9.5) '@vitejs/plugin-react-swc': specifier: ^3.3.2 - version: 3.3.2(vite@4.4.2) + version: 3.3.2(vite@4.4.4) autoprefixer: specifier: ^10.4.14 - version: 10.4.14(postcss@8.4.25) + version: 10.4.14(postcss@8.4.26) cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -169,8 +169,8 @@ devDependencies: specifier: ^13.2.3 version: 13.2.3 postcss: - specifier: ^8.4.25 - version: 8.4.25 + specifier: ^8.4.26 + version: 8.4.26 prettier: specifier: ^2.8.8 version: 2.8.8 @@ -181,20 +181,20 @@ devDependencies: specifier: ^15.8.1 version: 15.8.1 tailwindcss: - specifier: ^3.3.2 - version: 3.3.2 + specifier: ^3.3.3 + version: 3.3.3 typescript: specifier: ^4.9.5 version: 4.9.5 vite: - specifier: ^4.4.2 - version: 4.4.2(@types/node@18.16.19) + specifier: ^4.4.4 + version: 4.4.4(@types/node@18.16.19) vite-plugin-top-level-await: specifier: ^1.3.1 - version: 1.3.1(vite@4.4.2) + version: 1.3.1(vite@4.4.4) vite-tsconfig-paths: specifier: ^4.2.0 - version: 4.2.0(typescript@4.9.5)(vite@4.4.2) + version: 4.2.0(typescript@4.9.5)(vite@4.4.4) packages: @@ -346,8 +346,8 @@ packages: dev: false optional: true - /@esbuild/android-arm64@0.18.11: - resolution: {integrity: sha512-snieiq75Z1z5LJX9cduSAjUr7vEI1OdlzFPMw0HH5YI7qQHDd3qs+WZoMrWYDsfRJSq36lIA6mfZBkvL46KoIw==} + /@esbuild/android-arm64@0.18.12: + resolution: {integrity: sha512-BMAlczRqC/LUt2P97E4apTBbkvS9JTJnp2DKFbCwpZ8vBvXVbNdqmvzW/OsdtI/+mGr+apkkpqGM8WecLkPgrA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -364,8 +364,8 @@ packages: dev: false optional: true - /@esbuild/android-arm@0.18.11: - resolution: {integrity: sha512-q4qlUf5ucwbUJZXF5tEQ8LF7y0Nk4P58hOsGk3ucY0oCwgQqAnqXVbUuahCddVHfrxmpyewRpiTHwVHIETYu7Q==} + /@esbuild/android-arm@0.18.12: + resolution: {integrity: sha512-LIxaNIQfkFZbTLb4+cX7dozHlAbAshhFE5PKdro0l+FnCpx1GDJaQ2WMcqm+ToXKMt8p8Uojk/MFRuGyz3V5Sw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -382,8 +382,8 @@ packages: dev: false optional: true - /@esbuild/android-x64@0.18.11: - resolution: {integrity: sha512-iPuoxQEV34+hTF6FT7om+Qwziv1U519lEOvekXO9zaMMlT9+XneAhKL32DW3H7okrCOBQ44BMihE8dclbZtTuw==} + /@esbuild/android-x64@0.18.12: + resolution: {integrity: sha512-zU5MyluNsykf5cOJ0LZZZjgAHbhPJ1cWfdH1ZXVMXxVMhEV0VZiZXQdwBBVvmvbF28EizeK7obG9fs+fpmS0eQ==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -400,8 +400,8 @@ packages: dev: false optional: true - /@esbuild/darwin-arm64@0.18.11: - resolution: {integrity: sha512-Gm0QkI3k402OpfMKyQEEMG0RuW2LQsSmI6OeO4El2ojJMoF5NLYb3qMIjvbG/lbMeLOGiW6ooU8xqc+S0fgz2w==} + /@esbuild/darwin-arm64@0.18.12: + resolution: {integrity: sha512-zUZMep7YONnp6954QOOwEBwFX9svlKd3ov6PkxKd53LGTHsp/gy7vHaPGhhjBmEpqXEXShi6dddjIkmd+NgMsA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -418,8 +418,8 @@ packages: dev: false optional: true - /@esbuild/darwin-x64@0.18.11: - resolution: {integrity: sha512-N15Vzy0YNHu6cfyDOjiyfJlRJCB/ngKOAvoBf1qybG3eOq0SL2Lutzz9N7DYUbb7Q23XtHPn6lMDF6uWbGv9Fw==} + /@esbuild/darwin-x64@0.18.12: + resolution: {integrity: sha512-ohqLPc7i67yunArPj1+/FeeJ7AgwAjHqKZ512ADk3WsE3FHU9l+m5aa7NdxXr0HmN1bjDlUslBjWNbFlD9y12Q==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -436,8 +436,8 @@ packages: dev: false optional: true - /@esbuild/freebsd-arm64@0.18.11: - resolution: {integrity: sha512-atEyuq6a3omEY5qAh5jIORWk8MzFnCpSTUruBgeyN9jZq1K/QI9uke0ATi3MHu4L8c59CnIi4+1jDKMuqmR71A==} + /@esbuild/freebsd-arm64@0.18.12: + resolution: {integrity: sha512-GIIHtQXqgeOOqdG16a/A9N28GpkvjJnjYMhOnXVbn3EDJcoItdR58v/pGN31CHjyXDc8uCcRnFWmqaJt24AYJg==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -454,8 +454,8 @@ packages: dev: false optional: true - /@esbuild/freebsd-x64@0.18.11: - resolution: {integrity: sha512-XtuPrEfBj/YYYnAAB7KcorzzpGTvOr/dTtXPGesRfmflqhA4LMF0Gh/n5+a9JBzPuJ+CGk17CA++Hmr1F/gI0Q==} + /@esbuild/freebsd-x64@0.18.12: + resolution: {integrity: sha512-zK0b9a1/0wZY+6FdOS3BpZcPc1kcx2G5yxxfEJtEUzVxI6n/FrC2Phsxj/YblPuBchhBZ/1wwn7AyEBUyNSa6g==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -472,8 +472,8 @@ packages: dev: false optional: true - /@esbuild/linux-arm64@0.18.11: - resolution: {integrity: sha512-c6Vh2WS9VFKxKZ2TvJdA7gdy0n6eSy+yunBvv4aqNCEhSWVor1TU43wNRp2YLO9Vng2G+W94aRz+ILDSwAiYog==} + /@esbuild/linux-arm64@0.18.12: + resolution: {integrity: sha512-JKgG8Q/LL/9sw/iHHxQyVMoQYu3rU3+a5Z87DxC+wAu3engz+EmctIrV+FGOgI6gWG1z1+5nDDbXiRMGQZXqiw==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -490,8 +490,8 @@ packages: dev: false optional: true - /@esbuild/linux-arm@0.18.11: - resolution: {integrity: sha512-Idipz+Taso/toi2ETugShXjQ3S59b6m62KmLHkJlSq/cBejixmIydqrtM2XTvNCywFl3VC7SreSf6NV0i6sRyg==} + /@esbuild/linux-arm@0.18.12: + resolution: {integrity: sha512-y75OijvrBE/1XRrXq1jtrJfG26eHeMoqLJ2dwQNwviwTuTtHGCojsDO6BJNF8gU+3jTn1KzJEMETytwsFSvc+Q==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -508,8 +508,8 @@ packages: dev: false optional: true - /@esbuild/linux-ia32@0.18.11: - resolution: {integrity: sha512-S3hkIF6KUqRh9n1Q0dSyYcWmcVa9Cg+mSoZEfFuzoYXXsk6196qndrM+ZiHNwpZKi3XOXpShZZ+9dfN5ykqjjw==} + /@esbuild/linux-ia32@0.18.12: + resolution: {integrity: sha512-yoRIAqc0B4lDIAAEFEIu9ttTRFV84iuAl0KNCN6MhKLxNPfzwCBvEMgwco2f71GxmpBcTtn7KdErueZaM2rEvw==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -526,8 +526,8 @@ packages: dev: false optional: true - /@esbuild/linux-loong64@0.18.11: - resolution: {integrity: sha512-MRESANOoObQINBA+RMZW+Z0TJWpibtE7cPFnahzyQHDCA9X9LOmGh68MVimZlM9J8n5Ia8lU773te6O3ILW8kw==} + /@esbuild/linux-loong64@0.18.12: + resolution: {integrity: sha512-qYgt3dHPVvf/MgbIBpJ4Sup/yb9DAopZ3a2JgMpNKIHUpOdnJ2eHBo/aQdnd8dJ21X/+sS58wxHtA9lEazYtXQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -544,8 +544,8 @@ packages: dev: false optional: true - /@esbuild/linux-mips64el@0.18.11: - resolution: {integrity: sha512-qVyPIZrXNMOLYegtD1u8EBccCrBVshxMrn5MkuFc3mEVsw7CCQHaqZ4jm9hbn4gWY95XFnb7i4SsT3eflxZsUg==} + /@esbuild/linux-mips64el@0.18.12: + resolution: {integrity: sha512-wHphlMLK4ufNOONqukELfVIbnGQJrHJ/mxZMMrP2jYrPgCRZhOtf0kC4yAXBwnfmULimV1qt5UJJOw4Kh13Yfg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -562,8 +562,8 @@ packages: dev: false optional: true - /@esbuild/linux-ppc64@0.18.11: - resolution: {integrity: sha512-T3yd8vJXfPirZaUOoA9D2ZjxZX4Gr3QuC3GztBJA6PklLotc/7sXTOuuRkhE9W/5JvJP/K9b99ayPNAD+R+4qQ==} + /@esbuild/linux-ppc64@0.18.12: + resolution: {integrity: sha512-TeN//1Ft20ZZW41+zDSdOI/Os1bEq5dbvBvYkberB7PHABbRcsteeoNVZFlI0YLpGdlBqohEpjrn06kv8heCJg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -580,8 +580,8 @@ packages: dev: false optional: true - /@esbuild/linux-riscv64@0.18.11: - resolution: {integrity: sha512-evUoRPWiwuFk++snjH9e2cAjF5VVSTj+Dnf+rkO/Q20tRqv+644279TZlPK8nUGunjPAtQRCj1jQkDAvL6rm2w==} + /@esbuild/linux-riscv64@0.18.12: + resolution: {integrity: sha512-AgUebVS4DoAblBgiB2ACQ/8l4eGE5aWBb8ZXtkXHiET9mbj7GuWt3OnsIW/zX+XHJt2RYJZctbQ2S/mDjbp0UA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -598,8 +598,8 @@ packages: dev: false optional: true - /@esbuild/linux-s390x@0.18.11: - resolution: {integrity: sha512-/SlRJ15XR6i93gRWquRxYCfhTeC5PdqEapKoLbX63PLCmAkXZHY2uQm2l9bN0oPHBsOw2IswRZctMYS0MijFcg==} + /@esbuild/linux-s390x@0.18.12: + resolution: {integrity: sha512-dJ3Rb3Ei2u/ysSXd6pzleGtfDdc2MuzKt8qc6ls8vreP1G3B7HInX3i7gXS4BGeVd24pp0yqyS7bJ5NHaI9ing==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -616,8 +616,8 @@ packages: dev: false optional: true - /@esbuild/linux-x64@0.18.11: - resolution: {integrity: sha512-xcncej+wF16WEmIwPtCHi0qmx1FweBqgsRtEL1mSHLFR6/mb3GEZfLQnx+pUDfRDEM4DQF8dpXIW7eDOZl1IbA==} + /@esbuild/linux-x64@0.18.12: + resolution: {integrity: sha512-OrNJMGQbPaVyHHcDF8ybNSwu7TDOfX8NGpXCbetwOSP6txOJiWlgQnRymfC9ocR1S0Y5PW0Wb1mV6pUddqmvmQ==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -634,8 +634,8 @@ packages: dev: false optional: true - /@esbuild/netbsd-x64@0.18.11: - resolution: {integrity: sha512-aSjMHj/F7BuS1CptSXNg6S3M4F3bLp5wfFPIJM+Km2NfIVfFKhdmfHF9frhiCLIGVzDziggqWll0B+9AUbud/Q==} + /@esbuild/netbsd-x64@0.18.12: + resolution: {integrity: sha512-55FzVCAiwE9FK8wWeCRuvjazNRJ1QqLCYGZVB6E8RuQuTeStSwotpSW4xoRGwp3a1wUsaVCdYcj5LGCASVJmMg==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -652,8 +652,8 @@ packages: dev: false optional: true - /@esbuild/openbsd-x64@0.18.11: - resolution: {integrity: sha512-tNBq+6XIBZtht0xJGv7IBB5XaSyvYPCm1PxJ33zLQONdZoLVM0bgGqUrXnJyiEguD9LU4AHiu+GCXy/Hm9LsdQ==} + /@esbuild/openbsd-x64@0.18.12: + resolution: {integrity: sha512-qnluf8rfb6Y5Lw2tirfK2quZOBbVqmwxut7GPCIJsM8lc4AEUj9L8y0YPdLaPK0TECt4IdyBdBD/KRFKorlK3g==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -670,8 +670,8 @@ packages: dev: false optional: true - /@esbuild/sunos-x64@0.18.11: - resolution: {integrity: sha512-kxfbDOrH4dHuAAOhr7D7EqaYf+W45LsAOOhAet99EyuxxQmjbk8M9N4ezHcEiCYPaiW8Dj3K26Z2V17Gt6p3ng==} + /@esbuild/sunos-x64@0.18.12: + resolution: {integrity: sha512-+RkKpVQR7bICjTOPUpkTBTaJ4TFqQBX5Ywyd/HSdDkQGn65VPkTsR/pL4AMvuMWy+wnXgIl4EY6q4mVpJal8Kg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -688,8 +688,8 @@ packages: dev: false optional: true - /@esbuild/win32-arm64@0.18.11: - resolution: {integrity: sha512-Sh0dDRyk1Xi348idbal7lZyfSkjhJsdFeuC13zqdipsvMetlGiFQNdO+Yfp6f6B4FbyQm7qsk16yaZk25LChzg==} + /@esbuild/win32-arm64@0.18.12: + resolution: {integrity: sha512-GNHuciv0mFM7ouzsU0+AwY+7eV4Mgo5WnbhfDCQGtpvOtD1vbOiRjPYG6dhmMoFyBjj+pNqQu2X+7DKn0KQ/Gw==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -706,8 +706,8 @@ packages: dev: false optional: true - /@esbuild/win32-ia32@0.18.11: - resolution: {integrity: sha512-o9JUIKF1j0rqJTFbIoF4bXj6rvrTZYOrfRcGyL0Vm5uJ/j5CkBD/51tpdxe9lXEDouhRgdr/BYzUrDOvrWwJpg==} + /@esbuild/win32-ia32@0.18.12: + resolution: {integrity: sha512-kR8cezhYipbbypGkaqCTWIeu4zID17gamC8YTPXYtcN3E5BhhtTnwKBn9I0PJur/T6UVwIEGYzkffNL0lFvxEw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -724,8 +724,8 @@ packages: dev: false optional: true - /@esbuild/win32-x64@0.18.11: - resolution: {integrity: sha512-rQI4cjLHd2hGsM1LqgDI7oOCYbQ6IBOVsX9ejuRMSze0GqXUG2ekwiKkiBU1pRGSeCqFFHxTrcEydB2Hyoz9CA==} + /@esbuild/win32-x64@0.18.12: + resolution: {integrity: sha512-O0UYQVkvfM/jO8a4OwoV0mAKSJw+mjWTAd1MJd/1FCX6uiMdLmMRPK/w6e9OQ0ob2WGxzIm9va/KG0Ja4zIOgg==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -770,8 +770,8 @@ packages: resolution: {integrity: sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==} dev: false - /@floating-ui/dom@1.4.4: - resolution: {integrity: sha512-21hhDEPOiWkGp0Ys4Wi6Neriah7HweToKra626CIK712B5m9qkdz54OP9gVldUg+URnBTpv/j/bi/skmGdstXQ==} + /@floating-ui/dom@1.4.5: + resolution: {integrity: sha512-96KnRWkRnuBSSFbj0sFGwwOUd8EkiecINVl0O9wiZlZ64EkpyAOG3Xc2vKKNJmru0Z7RqWNymA+6b8OZqjgyyw==} dependencies: '@floating-ui/core': 1.3.1 dev: false @@ -782,7 +782,7 @@ packages: react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: - '@floating-ui/dom': 1.4.4 + '@floating-ui/dom': 1.4.5 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -914,8 +914,8 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@nostr-dev-kit/ndk@0.7.5(typescript@4.9.5): - resolution: {integrity: sha512-P3hcvWq0jMlTBiasMtcqP2FclGwVks1LIwhRhyJb5XesLEYvnWh1wBWnx3+UQCj9uuu7fBMkmrY7AAi3CTuaXA==} + /@nostr-dev-kit/ndk@0.7.6(typescript@4.9.5): + resolution: {integrity: sha512-eZph117ErfsIrLeap8OD0flwesPPPp6p14z30Ci+3DnQWVqpuB84BefxvgRPQUfKxgV49Yl77NnrtE2sF4yuSA==} dependencies: '@noble/hashes': 1.3.1 '@noble/secp256k1': 2.0.0 @@ -943,13 +943,13 @@ packages: - typescript dev: false - /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.7.5)(nostr-fetch@0.11.0): + /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.7.6)(nostr-fetch@0.11.0): resolution: {integrity: sha512-Otl7SEzm9ecqyHB10bpYXBu1qpqJEnipp7dZ4qcA9LeJAtM38fnYKUD34HX0JXA9EDjtc6VS5UNZe544xC9GCg==} peerDependencies: '@nostr-dev-kit/ndk': ^0.5.0 nostr-fetch: ^0.11.0 dependencies: - '@nostr-dev-kit/ndk': 0.7.5(typescript@4.9.5) + '@nostr-dev-kit/ndk': 0.7.6(typescript@4.9.5) '@nostr-fetch/kernel': 0.11.0 nostr-fetch: 0.11.0 dev: false @@ -981,7 +981,7 @@ packages: '@babel/runtime': 7.22.6 dev: false - /@radix-ui/react-arrow@1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(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.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==} peerDependencies: '@types/react': '*' @@ -995,14 +995,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-compose-refs@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} peerDependencies: '@types/react': '*' @@ -1012,11 +1012,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-context@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-context@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} peerDependencies: '@types/react': '*' @@ -1026,11 +1026,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-dismissable-layer@1.0.4(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-dismissable-layer@1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-7UpBa/RKMoHJYjie1gkF1DlK8l1fdU/VKDpoS3rCCo8YBJR294GwcEHyxHw72yvphJ7ld0AXEcSLAzY2F/WyCg==} peerDependencies: '@types/react': '*' @@ -1045,17 +1045,17 @@ packages: dependencies: '@babel/runtime': 7.22.6 '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-focus-guards@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-focus-guards@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==} peerDependencies: '@types/react': '*' @@ -1065,11 +1065,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-focus-scope@1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-focus-scope@1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-upXdPfqI4islj2CslyfUBNlaJCPybbqRHAi1KER7Isel9Q2AtSJ0zRBZv8mWQiFXD2nyAJ4BhC3yXgZ6kMBSrQ==} peerDependencies: '@types/react': '*' @@ -1083,16 +1083,16 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-id@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-id@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==} peerDependencies: '@types/react': '*' @@ -1102,12 +1102,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-popover@1.0.6(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-popover@1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-cZ4defGpkZ0qTRtlIBzJLSzL6ht7ofhhW4i1+pkemjV1IKXm0wgCRnee154qlV6r9Ttunmh2TNZhMfV2bavUyA==} peerDependencies: '@types/react': '*' @@ -1122,27 +1122,27 @@ packages: dependencies: '@babel/runtime': 7.22.6 '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.0.4(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-focus-scope': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-popper': 1.1.2(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-context': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-focus-scope': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-id': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-popper': 1.1.2(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 aria-hidden: 1.2.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.5.5(@types/react@18.2.14)(react@18.2.0) + react-remove-scroll: 2.5.5(@types/react@18.2.15)(react@18.2.0) dev: false - /@radix-ui/react-popper@1.1.2(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-popper@1.1.2(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-1CnGGfFi/bbqtJZZ0P/NQY20xdG3E0LALJaLUEoKwPLwl6PPPfbeiCqMVQnhoFRAxjJj4RpBRJzDmUgsex2tSg==} peerDependencies: '@types/react': '*' @@ -1157,22 +1157,22 @@ packages: dependencies: '@babel/runtime': 7.22.6 '@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.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-rect': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-size': 1.0.1(@types/react@18.2.14)(react@18.2.0) + '@radix-ui/react-arrow': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-context': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-rect': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-size': 1.0.1(@types/react@18.2.15)(react@18.2.0) '@radix-ui/rect': 1.0.1 - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-portal@1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-portal@1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-xLYZeHrWoPmA5mEKEfZZevoVRK/Q43GfzRXkWV6qawIWWK8t6ifIiLQdd7rmQ4Vk1bmI21XhqF9BN3jWf+phpA==} peerDependencies: '@types/react': '*' @@ -1186,14 +1186,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-presence@1.0.1(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-presence@1.0.1(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} peerDependencies: '@types/react': '*' @@ -1207,15 +1207,15 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-primitive@1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-primitive@1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} peerDependencies: '@types/react': '*' @@ -1229,14 +1229,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-slot': 1.0.2(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-slot@1.0.2(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-slot@1.0.2(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} peerDependencies: '@types/react': '*' @@ -1246,12 +1246,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-tooltip@1.0.6(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-tooltip@1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-DmNFOiwEc2UDigsYj6clJENma58OelxD24O4IODoZ+3sQc3Zb+L8w1EP+y9laTuKCLAysPw4fD6/v0j4KNV8rg==} peerDependencies: '@types/react': '*' @@ -1266,24 +1266,24 @@ packages: dependencies: '@babel/runtime': 7.22.6 '@radix-ui/primitive': 1.0.1 - '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-context': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-dismissable-layer': 1.0.4(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-id': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-popper': 1.1.2(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-portal': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@radix-ui/react-slot': 1.0.2(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-context': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-id': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-popper': 1.1.2(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-portal': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@radix-ui/react-slot': 1.0.2(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} peerDependencies: '@types/react': '*' @@ -1293,11 +1293,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} peerDependencies: '@types/react': '*' @@ -1307,12 +1307,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==} peerDependencies: '@types/react': '*' @@ -1322,12 +1322,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} peerDependencies: '@types/react': '*' @@ -1337,11 +1337,11 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-use-rect@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-use-rect@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==} peerDependencies: '@types/react': '*' @@ -1352,11 +1352,11 @@ packages: dependencies: '@babel/runtime': 7.22.6 '@radix-ui/rect': 1.0.1 - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-use-size@1.0.1(@types/react@18.2.14)(react@18.2.0): + /@radix-ui/react-use-size@1.0.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==} peerDependencies: '@types/react': '*' @@ -1366,12 +1366,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.14)(react@18.2.0) - '@types/react': 18.2.14 + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.15)(react@18.2.0) + '@types/react': 18.2.15 react: 18.2.0 dev: false - /@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0): + /@radix-ui/react-visually-hidden@1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==} peerDependencies: '@types/react': '*' @@ -1385,9 +1385,9 @@ packages: optional: true dependencies: '@babel/runtime': 7.22.6 - '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.6)(@types/react@18.2.14)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.14 - '@types/react-dom': 18.2.6 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.15 + '@types/react-dom': 18.2.7 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -1436,8 +1436,8 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: false - /@swc/core-darwin-arm64@1.3.68: - resolution: {integrity: sha512-Z5pNxeuP2NxpOHTzDQkJs0wAPLnTlglZnR3WjObijwvdwT/kw1Y5EPDKM/BVSIeG40SPMkDLBbI0aj0qyXzrBA==} + /@swc/core-darwin-arm64@1.3.69: + resolution: {integrity: sha512-IjZTf12zIPWkV3D7toaLDoJPSkLhQ4fDH8G6/yCJUI27cBFOI3L8LXqptYmISoN5yYdrcnNpdqdapD09JPuNJg==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -1445,8 +1445,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.68: - resolution: {integrity: sha512-ZHl42g6yXhfX4PzAQ0BNvBXpt/OcbAHfubWRN6eXELK3fiNnxL7QBW1if7iizlq6iA+Mj1pwHyyUit1pz0+fgA==} + /@swc/core-darwin-x64@1.3.69: + resolution: {integrity: sha512-/wBO0Rn5oS5dJI/L9kJRkPAdksVwl5H9nleW/NM3A40N98VV8T7h/i1nO051mxIjq0R6qXVGOWFbBoLrPYucJg==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -1454,8 +1454,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm-gnueabihf@1.3.68: - resolution: {integrity: sha512-Mk8f6KCOQ2CNAR4PtWajIjS6XKSSR7ZYDOCf1GXRxhS3qEyQH7V8elWvqWYqHcT4foO60NUmxA/NOM/dQrdO1A==} + /@swc/core-linux-arm-gnueabihf@1.3.69: + resolution: {integrity: sha512-NShCjMv6Xn8ckMKBRqmprXvUF14+jXY0TcNKXwjYErzoIUFOnG72M36HxT4QEeAtKZ4Eg4CZFE4zlJ27fDp1gg==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -1463,8 +1463,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.68: - resolution: {integrity: sha512-RhBllggh9t9sIxaRgRcGrVaS7fDk6KsIqR6b9+dwU5OyDr4ZyHWw1ZaH/1/HAebuXYhNBjoNUiRtca6lKRIPgQ==} + /@swc/core-linux-arm64-gnu@1.3.69: + resolution: {integrity: sha512-VRPOJj4idopSHIj1bOVXX0SgaB18R8yZNunb7eXS5ZcjVxAcdvqyIz3RdQX1zaJFCGzcdPLzBRP32DZWWGE8Ng==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1472,8 +1472,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.68: - resolution: {integrity: sha512-8K3zjU+tFgn6yGDEeD343gkKaHU9dhz77NiVkI1VzwRaT/Ag5pwl5eMQ1yStm8koNFzn3zq6rGjHfI5g2yI5Wg==} + /@swc/core-linux-arm64-musl@1.3.69: + resolution: {integrity: sha512-QxeSiZqo5x1X8vq8oUWLibq+IZJcxl9vy0sLUmzdjF2b/Z+qxKP3gutxnb2tzJaHqPVBbEZaILERIGy1qWdumQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1481,8 +1481,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.68: - resolution: {integrity: sha512-4xAnvsBOyeTL0AB8GWlRKDM/hsysJ5jr5qvdKKI3rZfJgnnxl/xSX6TJKPsJ8gygfUJ3BmfCbmUmEyeDZ3YPvA==} + /@swc/core-linux-x64-gnu@1.3.69: + resolution: {integrity: sha512-b+DUlVxYox3BwD3PyTwhLvqtu6TYZtW+S6O0FnttH11o4skHN0XyJ/cUZSI0X2biSmfDsizRDUt1PWPFM+F7SA==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1490,8 +1490,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.68: - resolution: {integrity: sha512-RCpaBo1fcpy1EFdjF+I7N4lfzOaHXVV0iMw/ABM+0PD6tp3V/9pxsguaZyeAHyEiUlDA6PZ4TfXv5zfnXEgW4Q==} + /@swc/core-linux-x64-musl@1.3.69: + resolution: {integrity: sha512-QXjsI+f8n9XPZHUvmGgkABpzN4M9kdSbhqBOZmv3o0AsDGNCA4uVowQqgZoPFAqlJTpwHeDmrv5sQ13HN+LOGw==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1499,8 +1499,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.68: - resolution: {integrity: sha512-v2WZvXrSslYEpY1nqpItyamL4DyaJinmOkXvM8Bc1LLKU5rGuvmBdjUYg/5Y+o0AUynuiWubpgHNOkBWiCvfqw==} + /@swc/core-win32-arm64-msvc@1.3.69: + resolution: {integrity: sha512-wn7A8Ws1fyviuCUB2Vg6IotiZeuqiO1Mz3d+YDae2EYyNpj1kNHvjBip8GHkfGzZG+jVrvG6NHsDo0KO/pGb8A==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -1508,8 +1508,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.68: - resolution: {integrity: sha512-HH5NJrIdzkJs+1xxprie0qSCMBeL9yeEhcC1yZTzYv8bwmabOUSdtKIqS55iYP/2hLWn9CTbvKPmLOIhCopW3Q==} + /@swc/core-win32-ia32-msvc@1.3.69: + resolution: {integrity: sha512-LsFBXtXqxEcVaaOGEZ9X3qdMzobVoJqKv8DnksuDsWcBk+9WCeTz2u/iB+7yZ2HGuPXkCqTRqhFo6FX9aC00kQ==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -1517,8 +1517,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.68: - resolution: {integrity: sha512-9HZVtLQUgK8r/yXQdwe0VBexbIcrY6+fBROhs7AAPWdewpaUeLkwQEJk6TbYr9CQuHw26FFGg6SjwAiqXF+kgQ==} + /@swc/core-win32-x64-msvc@1.3.69: + resolution: {integrity: sha512-ieBscU0gUgKjaseFI07tAaGqHvKyweNknPeSYEZOasVZUczhD6fK2GRnVREhv2RB2qdKC/VGFBsgRDMgzq1VLw==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -1526,8 +1526,8 @@ packages: dev: true optional: true - /@swc/core@1.3.68: - resolution: {integrity: sha512-njGQuJO+Wy06dEayt70cf0c/KI3HGjm4iW9LLViVLBuYNzJ4SSdNfzejludzufu6im+dsDJ0i3QjgWhAIcVHMQ==} + /@swc/core@1.3.69: + resolution: {integrity: sha512-Khc/DE9D5+2tYTHgAIp5DZARbs8kldWg3b0Jp6l8FQLjelcLFmlQWSwKhVZrgv4oIbgZydIp8jInsvTalMHqnQ==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -1536,19 +1536,19 @@ packages: '@swc/helpers': optional: true optionalDependencies: - '@swc/core-darwin-arm64': 1.3.68 - '@swc/core-darwin-x64': 1.3.68 - '@swc/core-linux-arm-gnueabihf': 1.3.68 - '@swc/core-linux-arm64-gnu': 1.3.68 - '@swc/core-linux-arm64-musl': 1.3.68 - '@swc/core-linux-x64-gnu': 1.3.68 - '@swc/core-linux-x64-musl': 1.3.68 - '@swc/core-win32-arm64-msvc': 1.3.68 - '@swc/core-win32-ia32-msvc': 1.3.68 - '@swc/core-win32-x64-msvc': 1.3.68 + '@swc/core-darwin-arm64': 1.3.69 + '@swc/core-darwin-x64': 1.3.69 + '@swc/core-linux-arm-gnueabihf': 1.3.69 + '@swc/core-linux-arm64-gnu': 1.3.69 + '@swc/core-linux-arm64-musl': 1.3.69 + '@swc/core-linux-x64-gnu': 1.3.69 + '@swc/core-linux-x64-musl': 1.3.69 + '@swc/core-win32-arm64-msvc': 1.3.69 + '@swc/core-win32-ia32-msvc': 1.3.69 + '@swc/core-win32-x64-msvc': 1.3.69 dev: true - /@tailwindcss/typography@0.5.9(tailwindcss@3.3.2): + /@tailwindcss/typography@0.5.9(tailwindcss@3.3.3): resolution: {integrity: sha512-t8Sg3DyynFysV9f4JDOVISGsjazNb48AeIYQwcL+Bsq5uf4RYL75C1giZ43KISjeDGBaTN3Kxh7Xj/vRSMJUUg==} peerDependencies: tailwindcss: '>=3.0.0 || insiders' @@ -1557,7 +1557,7 @@ packages: lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 postcss-selector-parser: 6.0.10 - tailwindcss: 3.3.2 + tailwindcss: 3.3.3 dev: true /@tanstack/match-sorter-utils@8.8.4: @@ -1799,13 +1799,13 @@ packages: /@types/prop-types@15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} - /@types/react-dom@18.2.6: - resolution: {integrity: sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A==} + /@types/react-dom@18.2.7: + resolution: {integrity: sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==} dependencies: - '@types/react': 18.2.14 + '@types/react': 18.2.15 - /@types/react@18.2.14: - resolution: {integrity: sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g==} + /@types/react@18.2.15: + resolution: {integrity: sha512-oEjE7TQt1fFTFSbf8kkNuc798ahTUzn3Le67/PWjE8MAfYAD/qB7O8hSTcromLFqHCt9bcdOg5GXMokzTjJ5SA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.3 @@ -1943,13 +1943,13 @@ packages: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.1 - /@vitejs/plugin-react-swc@3.3.2(vite@4.4.2): + /@vitejs/plugin-react-swc@3.3.2(vite@4.4.4): resolution: {integrity: sha512-VJFWY5sfoZerQRvJrh518h3AcQt6f/yTuWn4/TRB+dqmYU0NX1qz7qM5Wfd+gOQqUzQW4gxKqKN3KpE/P3+zrA==} peerDependencies: vite: ^4 dependencies: - '@swc/core': 1.3.68 - vite: 4.4.2(@types/node@18.16.19) + '@swc/core': 1.3.69 + vite: 4.4.4(@types/node@18.16.19) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -2096,7 +2096,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 get-intrinsic: 1.2.1 is-string: 1.0.7 @@ -2110,7 +2110,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 es-shim-unscopables: 1.0.0 /array.prototype.flatmap@1.3.1: @@ -2119,7 +2119,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 es-shim-unscopables: 1.0.0 /array.prototype.tosorted@1.1.1: @@ -2127,7 +2127,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 es-shim-unscopables: 1.0.0 get-intrinsic: 1.2.1 dev: true @@ -2146,7 +2146,7 @@ packages: engines: {node: '>=8'} dev: true - /autoprefixer@10.4.14(postcss@8.4.25): + /autoprefixer@10.4.14(postcss@8.4.26): resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true @@ -2158,7 +2158,7 @@ packages: fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.25 + postcss: 8.4.26 postcss-value-parser: 4.2.0 dev: true @@ -2213,7 +2213,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001515 - electron-to-chromium: 1.4.455 + electron-to-chromium: 1.4.460 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -2653,8 +2653,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.455: - resolution: {integrity: sha512-8tgdX0Odl24LtmLwxotpJCVjIndN559AvaOtd67u+2mo+IDsgsTF580NB+uuDCqsHw8yFg53l5+imFV9Fw3cbA==} + /electron-to-chromium@1.4.460: + resolution: {integrity: sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ==} dev: true /emoji-regex@8.0.0: @@ -2688,8 +2688,8 @@ packages: is-arrayish: 0.2.1 dev: false - /es-abstract@1.21.2: - resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} + /es-abstract@1.21.3: + resolution: {integrity: sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 @@ -2723,6 +2723,7 @@ packages: string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 + typed-array-byte-offset: 1.0.0 typed-array-length: 1.0.4 unbox-primitive: 1.0.2 which-typed-array: 1.1.10 @@ -2807,34 +2808,34 @@ packages: '@esbuild/win32-x64': 0.17.19 dev: false - /esbuild@0.18.11: - resolution: {integrity: sha512-i8u6mQF0JKJUlGR3OdFLKldJQMMs8OqM9Cc3UCi9XXziJ9WERM5bfkHaEAy0YAvPRMgqSW55W7xYn84XtEFTtA==} + /esbuild@0.18.12: + resolution: {integrity: sha512-XuOVLDdtsDslXStStduT41op21Ytmf4/BDS46aa3xPJ7X5h2eMWBF1oAe3QjUH3bDksocNXgzGUZ7XHIBya6Tg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.11 - '@esbuild/android-arm64': 0.18.11 - '@esbuild/android-x64': 0.18.11 - '@esbuild/darwin-arm64': 0.18.11 - '@esbuild/darwin-x64': 0.18.11 - '@esbuild/freebsd-arm64': 0.18.11 - '@esbuild/freebsd-x64': 0.18.11 - '@esbuild/linux-arm': 0.18.11 - '@esbuild/linux-arm64': 0.18.11 - '@esbuild/linux-ia32': 0.18.11 - '@esbuild/linux-loong64': 0.18.11 - '@esbuild/linux-mips64el': 0.18.11 - '@esbuild/linux-ppc64': 0.18.11 - '@esbuild/linux-riscv64': 0.18.11 - '@esbuild/linux-s390x': 0.18.11 - '@esbuild/linux-x64': 0.18.11 - '@esbuild/netbsd-x64': 0.18.11 - '@esbuild/openbsd-x64': 0.18.11 - '@esbuild/sunos-x64': 0.18.11 - '@esbuild/win32-arm64': 0.18.11 - '@esbuild/win32-ia32': 0.18.11 - '@esbuild/win32-x64': 0.18.11 + '@esbuild/android-arm': 0.18.12 + '@esbuild/android-arm64': 0.18.12 + '@esbuild/android-x64': 0.18.12 + '@esbuild/darwin-arm64': 0.18.12 + '@esbuild/darwin-x64': 0.18.12 + '@esbuild/freebsd-arm64': 0.18.12 + '@esbuild/freebsd-x64': 0.18.12 + '@esbuild/linux-arm': 0.18.12 + '@esbuild/linux-arm64': 0.18.12 + '@esbuild/linux-ia32': 0.18.12 + '@esbuild/linux-loong64': 0.18.12 + '@esbuild/linux-mips64el': 0.18.12 + '@esbuild/linux-ppc64': 0.18.12 + '@esbuild/linux-riscv64': 0.18.12 + '@esbuild/linux-s390x': 0.18.12 + '@esbuild/linux-x64': 0.18.12 + '@esbuild/netbsd-x64': 0.18.12 + '@esbuild/openbsd-x64': 0.18.12 + '@esbuild/sunos-x64': 0.18.12 + '@esbuild/win32-arm64': 0.18.12 + '@esbuild/win32-ia32': 0.18.12 + '@esbuild/win32-x64': 0.18.12 dev: true /escalade@3.1.1: @@ -3233,8 +3234,8 @@ packages: resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} dev: true - /framer-motion@10.12.18(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-cfhiUpPbj+0eEWKjuD+5cz5cMqH71xOtMxGiS/cSGfHn2OlHIEAqFnFyzEMENw5PxWR9bMVhatzzpD6lexmHZQ==} + /framer-motion@10.12.20(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-O4ODHTlov2cGHWjtMSuZhm2wX0eM33VK8+vCxren2uw9g3k/RubPCa0/tT6PtLzCvYgAhgKmaczVbY2qEJVWOw==} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 @@ -3285,7 +3286,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 functions-have-names: 1.2.3 /functions-have-names@1.2.3: @@ -4410,7 +4411,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 dev: true /object.fromentries@2.0.6: @@ -4419,14 +4420,14 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 dev: true /object.hasown@1.1.2: resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==} dependencies: define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 dev: true /object.values@1.1.6: @@ -4435,7 +4436,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -4627,29 +4628,29 @@ packages: irregular-plurals: 3.5.0 dev: false - /postcss-import@15.1.0(postcss@8.4.25): + /postcss-import@15.1.0(postcss@8.4.26): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.25 + postcss: 8.4.26 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.2 dev: true - /postcss-js@4.0.1(postcss@8.4.25): + /postcss-js@4.0.1(postcss@8.4.26): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 dependencies: camelcase-css: 2.0.1 - postcss: 8.4.25 + postcss: 8.4.26 dev: true - /postcss-load-config@4.0.1(postcss@8.4.25): + /postcss-load-config@4.0.1(postcss@8.4.26): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} peerDependencies: @@ -4662,17 +4663,17 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.25 + postcss: 8.4.26 yaml: 2.3.1 dev: true - /postcss-nested@6.0.1(postcss@8.4.25): + /postcss-nested@6.0.1(postcss@8.4.26): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 dependencies: - postcss: 8.4.25 + postcss: 8.4.26 postcss-selector-parser: 6.0.13 dev: true @@ -4696,8 +4697,8 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true - /postcss@8.4.25: - resolution: {integrity: sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==} + /postcss@8.4.26: + resolution: {integrity: sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -4871,7 +4872,7 @@ packages: react-fast-compare: 3.2.2 dev: false - /react-remove-scroll-bar@2.3.4(@types/react@18.2.14)(react@18.2.0): + /react-remove-scroll-bar@2.3.4(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==} engines: {node: '>=10'} peerDependencies: @@ -4881,13 +4882,13 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 - react-style-singleton: 2.2.1(@types/react@18.2.14)(react@18.2.0) + react-style-singleton: 2.2.1(@types/react@18.2.15)(react@18.2.0) tslib: 2.6.0 dev: false - /react-remove-scroll@2.5.5(@types/react@18.2.14)(react@18.2.0): + /react-remove-scroll@2.5.5(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==} engines: {node: '>=10'} peerDependencies: @@ -4897,13 +4898,13 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 - react-remove-scroll-bar: 2.3.4(@types/react@18.2.14)(react@18.2.0) - react-style-singleton: 2.2.1(@types/react@18.2.14)(react@18.2.0) + react-remove-scroll-bar: 2.3.4(@types/react@18.2.15)(react@18.2.0) + react-style-singleton: 2.2.1(@types/react@18.2.15)(react@18.2.0) tslib: 2.6.0 - use-callback-ref: 1.3.0(@types/react@18.2.14)(react@18.2.0) - use-sidecar: 1.1.2(@types/react@18.2.14)(react@18.2.0) + use-callback-ref: 1.3.0(@types/react@18.2.15)(react@18.2.0) + use-sidecar: 1.1.2(@types/react@18.2.15)(react@18.2.0) dev: false /react-router-dom@6.14.1(react-dom@18.2.0)(react@18.2.0): @@ -4934,7 +4935,7 @@ packages: engines: {node: '>=0.12.0'} dev: false - /react-style-singleton@2.2.1(@types/react@18.2.14)(react@18.2.0): + /react-style-singleton@2.2.1(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: @@ -4944,15 +4945,15 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.14 + '@types/react': 18.2.15 get-nonce: 1.0.1 invariant: 2.2.4 react: 18.2.0 tslib: 2.6.0 dev: false - /react-virtuoso@4.3.11(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-0YrCvQ5GsIKRcN34GxrzhSJGuMNI+hGxWci5cTVuPQ8QWTEsrKfCyqm7YNBMmV3pu7onG1YVUBo86CyCXdejXg==} + /react-virtuoso@4.4.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-7hVk43DN9Sx6czpclTpPnB2uzDmCaioSoTSN8lRv4mMF7UL5jmfc58UpjRrGoJavzVn1VBjHLLj6RHBLsS+N5Q==} engines: {node: '>=10'} peerDependencies: react: '>=16 || >=17 || >= 18' @@ -5353,7 +5354,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 get-intrinsic: 1.2.1 has-symbols: 1.0.3 internal-slot: 1.0.5 @@ -5367,7 +5368,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 dev: false /string.prototype.trim@1.2.7: @@ -5376,21 +5377,21 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.2 + es-abstract: 1.21.3 /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -5480,8 +5481,8 @@ packages: resolution: {integrity: sha512-R2/nULkdg1VR/EL4RXg4dEohdoxNUJGLMnWIQnPKL+O9Twu7Cn3Rxi4dlXkDzZrEGtR+G+psSXFouWlpTyLhCQ==} dev: false - /tailwindcss@3.3.2: - resolution: {integrity: sha512-9jPkMiIBXvPc2KywkraqsUfbfj+dHDb+JPWtSJa9MLFdrPyazI7q6WX2sUrm7R9eVR7qqv3Pas7EvQFzxKnI6w==} + /tailwindcss@3.3.3: + resolution: {integrity: sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==} engines: {node: '>=14.0.0'} hasBin: true dependencies: @@ -5499,13 +5500,12 @@ packages: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.25 - postcss-import: 15.1.0(postcss@8.4.25) - postcss-js: 4.0.1(postcss@8.4.25) - postcss-load-config: 4.0.1(postcss@8.4.25) - postcss-nested: 6.0.1(postcss@8.4.25) + postcss: 8.4.26 + postcss-import: 15.1.0(postcss@8.4.26) + postcss-js: 4.0.1(postcss@8.4.26) + postcss-load-config: 4.0.1(postcss@8.4.26) + postcss-nested: 6.0.1(postcss@8.4.26) postcss-selector-parser: 6.0.13 - postcss-value-parser: 4.2.0 resolve: 1.22.2 sucrase: 3.32.0 transitivePeerDependencies: @@ -5669,6 +5669,16 @@ packages: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} dev: false + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.10 + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: @@ -5745,7 +5755,7 @@ packages: tlds: 1.240.0 dev: false - /use-callback-ref@1.3.0(@types/react@18.2.14)(react@18.2.0): + /use-callback-ref@1.3.0(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==} engines: {node: '>=10'} peerDependencies: @@ -5755,12 +5765,12 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.14 + '@types/react': 18.2.15 react: 18.2.0 tslib: 2.6.0 dev: false - /use-sidecar@1.1.2(@types/react@18.2.14)(react@18.2.0): + /use-sidecar@1.1.2(@types/react@18.2.15)(react@18.2.0): resolution: {integrity: sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==} engines: {node: '>=10'} peerDependencies: @@ -5770,7 +5780,7 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.14 + '@types/react': 18.2.15 detect-node-es: 1.1.0 react: 18.2.0 tslib: 2.6.0 @@ -5812,21 +5822,21 @@ packages: spdx-expression-parse: 3.0.1 dev: false - /vite-plugin-top-level-await@1.3.1(vite@4.4.2): + /vite-plugin-top-level-await@1.3.1(vite@4.4.4): resolution: {integrity: sha512-55M1h4NAwkrpxPNOJIBzKZFihqLUzIgnElLSmPNPMR2Fn9+JHKaNg3sVX1Fq+VgvuBksQYxiD3OnwQAUu7kaPQ==} peerDependencies: vite: '>=2.8' dependencies: '@rollup/plugin-virtual': 3.0.1 - '@swc/core': 1.3.68 + '@swc/core': 1.3.69 uuid: 9.0.0 - vite: 4.4.2(@types/node@18.16.19) + vite: 4.4.4(@types/node@18.16.19) transitivePeerDependencies: - '@swc/helpers' - rollup dev: true - /vite-tsconfig-paths@4.2.0(typescript@4.9.5)(vite@4.4.2): + /vite-tsconfig-paths@4.2.0(typescript@4.9.5)(vite@4.4.4): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: vite: '*' @@ -5837,14 +5847,14 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@4.9.5) - vite: 4.4.2(@types/node@18.16.19) + vite: 4.4.4(@types/node@18.16.19) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.4.2(@types/node@18.16.19): - resolution: {integrity: sha512-zUcsJN+UvdSyHhYa277UHhiJ3iq4hUBwHavOpsNUGsTgjBeoBlK8eDt+iT09pBq0h9/knhG/SPrZiM7cGmg7NA==} + /vite@4.4.4(@types/node@18.16.19): + resolution: {integrity: sha512-4mvsTxjkveWrKDJI70QmelfVqTm+ihFAb6+xf4sjEU2TmUCTlVX87tmg/QooPEMQb/lM9qGHT99ebqPziEd3wg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -5872,8 +5882,8 @@ packages: optional: true dependencies: '@types/node': 18.16.19 - esbuild: 0.18.11 - postcss: 8.4.25 + esbuild: 0.18.12 + postcss: 8.4.26 rollup: 3.26.2 optionalDependencies: fsevents: 2.3.2 @@ -6015,24 +6025,24 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - github.com/tauri-apps/tauri-plugin-autostart/f409102d516cdac20bb7dde4300a0e495c61d6f2: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/f409102d516cdac20bb7dde4300a0e495c61d6f2} + github.com/tauri-apps/tauri-plugin-autostart/59c48c642cea6a854bb1f4181972ad0bfbeb0c75: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/59c48c642cea6a854bb1f4181972ad0bfbeb0c75} name: tauri-plugin-autostart-api version: 0.0.0 dependencies: '@tauri-apps/api': 1.4.0 dev: false - github.com/tauri-apps/tauri-plugin-sql/91195cd53a9599e3c043aee2490c0d5bd7989f18: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/91195cd53a9599e3c043aee2490c0d5bd7989f18} + github.com/tauri-apps/tauri-plugin-sql/f8125e517d9de2a567a2eaa14f7b1b32e456278b: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/f8125e517d9de2a567a2eaa14f7b1b32e456278b} name: tauri-plugin-sql-api version: 0.0.0 dependencies: '@tauri-apps/api': 1.4.0 dev: false - github.com/tauri-apps/tauri-plugin-stronghold/910f0dcda71336f75e284c84bbabe05ed2491128: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-stronghold/tar.gz/910f0dcda71336f75e284c84bbabe05ed2491128} + github.com/tauri-apps/tauri-plugin-stronghold/a2dbe1f937f2f2a1fd27d5a4a7a87ec7b7d1f5d4: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-stronghold/tar.gz/a2dbe1f937f2f2a1fd27d5a4a7a87ec7b7d1f5d4} name: tauri-plugin-stronghold-api version: 0.0.0 dependencies: diff --git a/src/app/note/index.tsx b/src/app/note/index.tsx index 4e1009d3..20016f4e 100644 --- a/src/app/note/index.tsx +++ b/src/app/note/index.tsx @@ -5,8 +5,6 @@ import { useLiveThread } from '@app/space/hooks/useLiveThread'; import { getNoteByID } from '@libs/storage'; -import { Kind1 } from '@shared/notes/contents/kind1'; -import { Kind1063 } from '@shared/notes/contents/kind1063'; import { NoteMetadata } from '@shared/notes/metadata'; import { NoteReplyForm } from '@shared/notes/replies/form'; import { RepliesList } from '@shared/notes/replies/list'; @@ -41,8 +39,6 @@ export function NoteScreen() {
- {data.kind === 1 && } - {data.kind === 1063 && }
diff --git a/src/app/space/components/blocks/feed.tsx b/src/app/space/components/blocks/feed.tsx index 1689e336..35fd9a1c 100644 --- a/src/app/space/components/blocks/feed.tsx +++ b/src/app/space/components/blocks/feed.tsx @@ -1,14 +1,16 @@ import { useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; -import { useEffect, useRef } from 'react'; -import { Link } from 'react-router-dom'; +import { useCallback, useEffect, useRef } from 'react'; import { getNotesByAuthors, removeBlock } from '@libs/storage'; -import { Note } from '@shared/notes/note'; +import { NoteKind_1, NoteKind_1063, NoteThread, Repost } from '@shared/notes'; +import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; +import { LumeEvent } from '@utils/types'; + const ITEM_PER_PAGE = 10; export function FeedBlock({ params }: { params: any }) { @@ -55,16 +57,70 @@ export function FeedBlock({ params }: { params: any }) { }, }); - const renderItem = (index: string | number) => { - const note = notes[index]; - - if (!note) return; - return ( -
- -
- ); - }; + const renderItem = useCallback( + (index: string | number) => { + const note: LumeEvent = notes[index]; + if (!note) return; + switch (note.kind) { + case 1: { + const root = note.tags.find((el) => el[3] === 'root')?.[1]; + const reply = note.tags.find((el) => el[3] === 'reply')?.[1]; + if (root || reply) { + return ( +
+ +
+ ); + } else { + return ( +
+ +
+ ); + } + } + case 6: + return ( +
+ +
+ ); + case 1063: + return ( +
+ +
+ ); + default: + return ( +
+ +
+ ); + } + }, + [notes] + ); return (
diff --git a/src/app/space/components/blocks/following.tsx b/src/app/space/components/blocks/following.tsx index fa1c6b00..aff97bf3 100644 --- a/src/app/space/components/blocks/following.tsx +++ b/src/app/space/components/blocks/following.tsx @@ -1,18 +1,21 @@ import { useInfiniteQuery } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; -import { useEffect, useRef } from 'react'; +import { useCallback, useEffect, useRef } from 'react'; import { Link } from 'react-router-dom'; import { useNewsfeed } from '@app/space/hooks/useNewsfeed'; import { getNotes } from '@libs/storage'; -import { Note } from '@shared/notes/note'; +import { NoteKind_1, NoteKind_1063, NoteThread, Repost } from '@shared/notes'; +import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; import { useNote } from '@stores/note'; +import { LumeEvent } from '@utils/types'; + const ITEM_PER_PAGE = 10; export function FollowingBlock() { @@ -66,19 +69,76 @@ export function FollowingBlock() { toggleHasNewNote(false); }; - const renderItem = (index: string | number) => { - const note = notes[index]; - if (!note) return; - return ( -
- -
- ); - }; + const renderItem = useCallback( + (index: string | number) => { + const note: LumeEvent = notes[index]; + if (!note) return; + switch (note.kind) { + case 1: { + let root: string; + let reply: string; + if (note.tags?.[0]?.[0] === 'e' && !note.tags?.[0]?.[3]) { + root = note.tags[0][1]; + } else { + root = note.tags.find((el) => el[3] === 'root')?.[1]; + reply = note.tags.find((el) => el[3] === 'reply')?.[1]; + } + if (root || reply) { + return ( +
+ +
+ ); + } else { + return ( +
+ +
+ ); + } + } + case 6: + return ( +
+ +
+ ); + case 1063: + return ( +
+ +
+ ); + default: + return ( +
+ +
+ ); + } + }, + [notes] + ); return (
diff --git a/src/app/space/components/blocks/thread.tsx b/src/app/space/components/blocks/thread.tsx index 5b3b35c5..5bc68727 100644 --- a/src/app/space/components/blocks/thread.tsx +++ b/src/app/space/components/blocks/thread.tsx @@ -5,8 +5,6 @@ import { useLiveThread } from '@app/space/hooks/useLiveThread'; import { getNoteByID, removeBlock } from '@libs/storage'; -import { Kind1 } from '@shared/notes/contents/kind1'; -import { Kind1063 } from '@shared/notes/contents/kind1063'; import { NoteMetadata } from '@shared/notes/metadata'; import { NoteReplyForm } from '@shared/notes/replies/form'; import { RepliesList } from '@shared/notes/replies/list'; @@ -53,12 +51,6 @@ export function ThreadBlock({ params }: { params: any }) {
- {data.kind === 1 && } - {data.kind === 1063 && } - Focus
diff --git a/src/app/trending/components/trendingNotes.tsx b/src/app/trending/components/trendingNotes.tsx index d5cc8a9b..b41e6c8c 100644 --- a/src/app/trending/components/trendingNotes.tsx +++ b/src/app/trending/components/trendingNotes.tsx @@ -1,6 +1,6 @@ import { useQuery } from '@tanstack/react-query'; -import { Note } from '@shared/notes/note'; +import { NoteKind_1 } from '@shared/notes'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; @@ -27,7 +27,7 @@ export function TrendingNotes() { ) : (
{data.notes.map((item) => ( - + ))}
)} diff --git a/src/app/user/components/feed.tsx b/src/app/user/components/feed.tsx index 0132aac2..f0d1f81d 100644 --- a/src/app/user/components/feed.tsx +++ b/src/app/user/components/feed.tsx @@ -2,8 +2,6 @@ import { useQuery } from '@tanstack/react-query'; import { useNDK } from '@libs/ndk/provider'; -import { Note } from '@shared/notes/note'; - import { nHoursAgo } from '@utils/date'; import { LumeEvent } from '@utils/types'; @@ -19,15 +17,5 @@ export function UserFeed({ pubkey }: { pubkey: string }) { return events as unknown as LumeEvent[]; }); - return ( -
- {status === 'loading' ? ( -
-

Loading...

-
- ) : ( - data.map((note: LumeEvent) => ) - )} -
- ); + return
; } diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index 6071619c..4c7735cf 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -1,7 +1,9 @@ -import { NDKUserProfile } from '@nostr-dev-kit/ndk'; +import { NDKTag, NDKUserProfile } from '@nostr-dev-kit/ndk'; +import destr from 'destr'; import Database from 'tauri-plugin-sql-api'; import { getParentID } from '@utils/transform'; +import { LumeEvent } from '@utils/types'; let db: null | Database = null; @@ -92,11 +94,19 @@ export async function getNotes(limit: number, offset: number) { const totalNotes = await countTotalNotes(); const nextCursor = offset + limit; - const notes: any = { data: null, nextCursor: 0 }; - const query: any = await db.select( + const notes: { data: LumeEvent[] | null; nextCursor: number } = { + data: null, + nextCursor: 0, + }; + + const query: LumeEvent[] = await db.select( `SELECT * FROM notes WHERE kind IN (1, 6, 1063) GROUP BY parent_id ORDER BY created_at DESC LIMIT "${limit}" OFFSET "${offset}";` ); + query.forEach( + (el) => (el.tags = typeof el.tags === 'string' ? destr(el.tags) : el.tags) + ); + notes['data'] = query; notes['nextCursor'] = Math.round(totalNotes / nextCursor) > 1 ? nextCursor : undefined; @@ -106,11 +116,16 @@ export async function getNotes(limit: number, offset: number) { // get all notes by pubkey export async function getNotesByPubkey(pubkey: string) { const db = await connect(); - const res: any = await db.select( + + const query: LumeEvent[] = await db.select( `SELECT * FROM notes WHERE pubkey == "${pubkey}" AND kind IN (1, 6, 1063) GROUP BY parent_id ORDER BY created_at DESC;` ); - return res; + query.forEach( + (el) => (el.tags = typeof el.tags === 'string' ? destr(el.tags) : el.tags) + ); + + return query; } // get all notes by authors @@ -121,11 +136,19 @@ export async function getNotesByAuthors(authors: string, limit: number, offset: const array = JSON.parse(authors); const finalArray = `'${array.join("','")}'`; - const notes: any = { data: null, nextCursor: 0 }; - const query: any = await db.select( + const notes: { data: LumeEvent[] | null; nextCursor: number } = { + data: null, + nextCursor: 0, + }; + + const query: LumeEvent[] = await db.select( `SELECT * FROM notes WHERE pubkey IN (${finalArray}) AND kind IN (1, 6, 1063) GROUP BY parent_id ORDER BY created_at DESC LIMIT "${limit}" OFFSET "${offset}";` ); + query.forEach( + (el) => (el.tags = typeof el.tags === 'string' ? destr(el.tags) : el.tags) + ); + notes['data'] = query; notes['nextCursor'] = Math.round(totalNotes / nextCursor) > 1 ? nextCursor : undefined; @@ -144,7 +167,7 @@ export async function createNote( event_id: string, pubkey: string, kind: number, - tags: any, + tags: string[], content: string, created_at: number ) { diff --git a/src/shared/icons/index.tsx b/src/shared/icons/index.tsx index 549e6b93..3cbb94b8 100644 --- a/src/shared/icons/index.tsx +++ b/src/shared/icons/index.tsx @@ -43,4 +43,5 @@ export * from './settings'; export * from './logout'; export * from './follow'; export * from './unfollow'; +export * from './reaction'; // @endindex diff --git a/src/shared/icons/reaction.tsx b/src/shared/icons/reaction.tsx new file mode 100644 index 00000000..b160caac --- /dev/null +++ b/src/shared/icons/reaction.tsx @@ -0,0 +1,37 @@ +import { SVGProps } from 'react'; + +export function ReactionIcon(props: JSX.IntrinsicAttributes & SVGProps) { + return ( + + + + + + + ); +} diff --git a/src/shared/icons/repost.tsx b/src/shared/icons/repost.tsx index cb605aa6..b3ffb473 100644 --- a/src/shared/icons/repost.tsx +++ b/src/shared/icons/repost.tsx @@ -2,14 +2,20 @@ import { SVGProps } from 'react'; export function RepostIcon(props: JSX.IntrinsicAttributes & SVGProps) { return ( - + + strokeWidth="1.5" + d="M12 21.25c4.28 0 7.75-3.75 7.75-8.25 0-5.167-4.613-8.829-6.471-10.094-.426-.29-.988-.165-1.285.257L9.582 6.59a1.002 1.002 0 01-1.525.131c-.39-.387-1.026-.391-1.376.033C5.06 8.718 4.25 11.16 4.25 13c0 4.5 3.47 8.25 7.75 8.25zm0 0c1.657 0 3-1.533 3-3.424 0-2.084-1.663-3.601-2.513-4.24a.802.802 0 00-.974 0c-.85.639-2.513 2.156-2.513 4.24 0 1.89 1.343 3.424 3 3.424z" + > ); } diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx new file mode 100644 index 00000000..86051ad7 --- /dev/null +++ b/src/shared/notes/actions.tsx @@ -0,0 +1,29 @@ +import * as Tooltip from '@radix-ui/react-tooltip'; + +import { NoteReaction } from '@shared/notes/actions/reaction'; +import { NoteReply } from '@shared/notes/actions/reply'; +import { NoteRepost } from '@shared/notes/actions/repost'; +import { NoteZap } from '@shared/notes/actions/zap'; + +export function NoteActions({ + id, + rootID, + eventPubkey, +}: { + id: string; + rootID?: string; + eventPubkey: string; +}) { + return ( + +
+
+ + + + +
+
+ + ); +} diff --git a/src/shared/notes/actions/reaction.tsx b/src/shared/notes/actions/reaction.tsx new file mode 100644 index 00000000..bf374c21 --- /dev/null +++ b/src/shared/notes/actions/reaction.tsx @@ -0,0 +1,32 @@ +import * as Tooltip from '@radix-ui/react-tooltip'; + +import { ReactionIcon } from '@shared/icons'; + +export function NoteReaction() { + const submit = async () => { + console.log('todo'); + }; + + return ( + + + + + + + Reaction + + + + + ); +} diff --git a/src/shared/notes/metadata/reply.tsx b/src/shared/notes/actions/reply.tsx similarity index 60% rename from src/shared/notes/metadata/reply.tsx rename to src/shared/notes/actions/reply.tsx index 2e552cdc..8ab4b1a0 100644 --- a/src/shared/notes/metadata/reply.tsx +++ b/src/shared/notes/actions/reply.tsx @@ -4,37 +4,28 @@ import { ReplyIcon } from '@shared/icons'; import { useComposer } from '@stores/composer'; -import { compactNumber } from '@utils/number'; - export function NoteReply({ id, rootID, pubkey, - replies, }: { id: string; rootID?: string; pubkey: string; - replies: number; }) { const setReply = useComposer((state) => state.setReply); return ( - + + + { @@ -28,20 +19,15 @@ export function NoteRepost({ return ( - + + + - + + + - Coming Soon + Tip diff --git a/src/shared/notes/contents/kind1.tsx b/src/shared/notes/contents/kind1.tsx deleted file mode 100644 index 53d94191..00000000 --- a/src/shared/notes/contents/kind1.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { ReactNode } from 'react'; - -import { MentionNote } from '@shared/notes/mentions/note'; -import { ImagePreview } from '@shared/notes/preview/image'; -import { LinkPreview } from '@shared/notes/preview/link'; -import { VideoPreview } from '@shared/notes/preview/video'; - -export function Kind1({ - content, - truncate = false, -}: { - content: { - original: string; - parsed: ReactNode[]; - notes: string[]; - images: string[]; - videos: string[]; - links: string[]; - }; - truncate?: boolean; -}) { - return ( - <> -
- {content.parsed} -
- {content.images.length > 0 && ( - - )} - {content.videos.length > 0 && } - {content.links.length > 0 && } - {content.notes.length > 0 && - content.notes.map((note: string) => )} - - ); -} diff --git a/src/shared/notes/contents/kind1063.tsx b/src/shared/notes/contents/kind1063.tsx deleted file mode 100644 index ea5d7f82..00000000 --- a/src/shared/notes/contents/kind1063.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { NDKTag } from '@nostr-dev-kit/ndk'; - -import { Image } from '@shared/image'; - -function isImage(url: string) { - return /\.(jpg|jpeg|gif|png|webp|avif)$/.test(url); -} - -export function Kind1063({ metadata }: { metadata: NDKTag[] }) { - const url = metadata[0][1]; - - return ( -
- {isImage(url) && ( - image - )} -
- ); -} diff --git a/src/shared/notes/index.tsx b/src/shared/notes/index.tsx new file mode 100644 index 00000000..de14f037 --- /dev/null +++ b/src/shared/notes/index.tsx @@ -0,0 +1,22 @@ +export * from './actions/reaction'; +export * from './actions/reply'; +export * from './actions/repost'; +export * from './actions/zap'; +export * from './mentions/note'; +export * from './mentions/user'; +export * from './preview/image'; +export * from './preview/link'; +export * from './preview/video'; +export * from './replies/form'; +export * from './replies/item'; +export * from './replies/list'; +export * from './kinds/kind1'; +export * from './kinds/kind1063'; +export * from './metadata'; +export * from './users/mini'; +export * from './users/repost'; +export * from './kinds/thread'; +export * from './kinds/repost'; +export * from './kinds/sub'; +export * from './skeleton'; +export * from './actions'; diff --git a/src/shared/notes/kinds/kind1.tsx b/src/shared/notes/kinds/kind1.tsx new file mode 100644 index 00000000..01701677 --- /dev/null +++ b/src/shared/notes/kinds/kind1.tsx @@ -0,0 +1,52 @@ +import { useMemo } from 'react'; + +import { LinkPreview, NoteActions, NoteMetadata, VideoPreview } from '@shared/notes'; +import { MentionNote } from '@shared/notes/mentions/note'; +import { ImagePreview } from '@shared/notes/preview/image'; +import { User } from '@shared/user'; + +import { parser } from '@utils/parser'; +import { LumeEvent } from '@utils/types'; + +export function NoteKind_1({ + event, + skipMetadata = false, +}: { + event: LumeEvent; + skipMetadata?: boolean; +}) { + const content = useMemo(() => parser(event), [event.id]); + + return ( +
+
+
+ +
+
+
+
+ {content.parsed} +
+ {content.images.length > 0 && } + {content.videos.length > 0 && } + {content.links.length > 0 && } + {content.notes.length > 0 && + content.notes.map((note: string) => )} + +
+
+ {!skipMetadata ? ( + + ) : ( +
+ )} +
+
+
+ ); +} diff --git a/src/shared/notes/kinds/kind1063.tsx b/src/shared/notes/kinds/kind1063.tsx new file mode 100644 index 00000000..04be866a --- /dev/null +++ b/src/shared/notes/kinds/kind1063.tsx @@ -0,0 +1,42 @@ +import { Image } from '@shared/image'; +import { NoteActions, NoteMetadata } from '@shared/notes'; +import { User } from '@shared/user'; + +import { LumeEvent } from '@utils/types'; + +function isImage(url: string) { + return /\.(jpg|jpeg|gif|png|webp|avif)$/.test(url); +} + +export function NoteKind_1063({ event }: { event: LumeEvent }) { + const url = event.tags[0][1]; + + return ( +
+
+
+ +
+
+
+ {isImage(url) && ( + image + )} + +
+
+ +
+
+
+ ); +} diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx new file mode 100644 index 00000000..274bae15 --- /dev/null +++ b/src/shared/notes/kinds/repost.tsx @@ -0,0 +1,74 @@ +import { + ImagePreview, + LinkPreview, + MentionNote, + NoteActions, + NoteMetadata, + NoteSkeleton, + RepostUser, + VideoPreview, +} from '@shared/notes'; +import { User } from '@shared/user'; + +import { useEvent } from '@utils/hooks/useEvent'; +import { getRepostID } from '@utils/transform'; +import { LumeEvent } from '@utils/types'; + +export function Repost({ event }: { event: LumeEvent }) { + const repostID = getRepostID(event.tags); + const { status, data } = useEvent(repostID, event.content); + + if (status === 'loading') { + return ( +
+ +
+ ); + } + + if (status === 'error') { + return ( +
+

Failed to fetch

+
+ ); + } + + return ( +
+
+
+
+ + +
+
+
+
+
+ {data.content.parsed} +
+ {data.content.images.length > 0 && ( + + )} + {data.content.videos.length > 0 && ( + + )} + {data.content.links.length > 0 && } + {data.content.notes.length > 0 && + data.content.notes.map((note: string) => ( + + ))} + +
+
+ +
+
+
+ ); +} diff --git a/src/shared/notes/kinds/sub.tsx b/src/shared/notes/kinds/sub.tsx new file mode 100644 index 00000000..36d8ab0e --- /dev/null +++ b/src/shared/notes/kinds/sub.tsx @@ -0,0 +1,60 @@ +import { + ImagePreview, + LinkPreview, + MentionNote, + NoteActions, + NoteSkeleton, + VideoPreview, +} from '@shared/notes'; +import { User } from '@shared/user'; + +import { useEvent } from '@utils/hooks/useEvent'; + +export function SubNote({ id }: { id: string }) { + const { status, data } = useEvent(id); + + if (status === 'loading') { + return ( +
+ +
+ ); + } + + if (status === 'error') { + return ( +
+

Failed to fetch

+
+ ); + } + + return ( + <> +
+
+ +
+
+
+
+ {data.content.parsed} +
+ {data.content.images.length > 0 && ( + + )} + {data.content.videos.length > 0 && ( + + )} + {data.content.links.length > 0 && } + {data.content.notes.length > 0 && + data.content.notes.map((note: string) => ( + + ))} + +
+
+
+ + ); +} diff --git a/src/shared/notes/kinds/thread.tsx b/src/shared/notes/kinds/thread.tsx new file mode 100644 index 00000000..a8ed8e1c --- /dev/null +++ b/src/shared/notes/kinds/thread.tsx @@ -0,0 +1,58 @@ +import { useMemo } from 'react'; + +import { + LinkPreview, + NoteActions, + NoteMetadata, + SubNote, + VideoPreview, +} from '@shared/notes'; +import { MentionNote } from '@shared/notes/mentions/note'; +import { ImagePreview } from '@shared/notes/preview/image'; +import { User } from '@shared/user'; + +import { parser } from '@utils/parser'; +import { LumeEvent } from '@utils/types'; + +export function NoteThread({ + event, + root, + reply, +}: { + event: LumeEvent; + root: string; + reply: string; +}) { + const content = useMemo(() => parser(event), [event.id]); + + return ( +
+
+
{root && }
+
{reply && }
+
+ +
+
+
+
+ {content.parsed} +
+ {content.images.length > 0 && } + {content.videos.length > 0 && } + {content.links.length > 0 && } + {content.notes.length > 0 && + content.notes.map((note: string) => )} + +
+
+ +
+
+
+ ); +} diff --git a/src/shared/notes/kinds/unsupport.tsx b/src/shared/notes/kinds/unsupport.tsx new file mode 100644 index 00000000..1d9cec68 --- /dev/null +++ b/src/shared/notes/kinds/unsupport.tsx @@ -0,0 +1,40 @@ +import { NoteActions, NoteMetadata } from '@shared/notes'; +import { User } from '@shared/user'; + +import { LumeEvent } from '@utils/types'; + +export function NoteKindUnsupport({ event }: { event: LumeEvent }) { + return ( +
+
+
+ +
+
+
+
+
+ + Kind: {event.kind} + +

+ Lume isn't fully support this kind +

+
+
+

{event.content.toString()}

+
+
+ +
+
+ +
+
+
+ ); +} diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx index 671412c7..15dde810 100644 --- a/src/shared/notes/mentions/note.tsx +++ b/src/shared/notes/mentions/note.tsx @@ -3,17 +3,15 @@ import { memo } from 'react'; import { createBlock } from '@libs/storage'; -import { Kind1 } from '@shared/notes/contents/kind1'; -import { Kind1063 } from '@shared/notes/contents/kind1063'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { User } from '@shared/user'; import { useEvent } from '@utils/hooks/useEvent'; export const MentionNote = memo(function MentionNote({ id }: { id: string }) { - const queryClient = useQueryClient(); const { status, data } = useEvent(id); + const queryClient = useQueryClient(); const block = useMutation({ mutationFn: (data: any) => { return createBlock(data.kind, data.title, data.content); @@ -45,25 +43,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { ) : status === 'success' ? ( <> -
- {data.kind === 1 && } - {data.kind === 1063 && } - {data.kind !== 1 && data.kind !== 1063 && ( -
-
- - Kind: {data.kind} - -

- Lume isn't fully support this kind in newsfeed -

-
-
-

{data.content}

-
-
- )} -
+
{data.content.parsed}
) : (

Failed to fetch event

diff --git a/src/shared/notes/metadata.tsx b/src/shared/notes/metadata.tsx index 7f39aec6..b56de16d 100644 --- a/src/shared/notes/metadata.tsx +++ b/src/shared/notes/metadata.tsx @@ -1,74 +1,66 @@ import { NDKEvent, NDKFilter } from '@nostr-dev-kit/ndk'; -import * as Tooltip from '@radix-ui/react-tooltip'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { decode } from 'light-bolt11-decoder'; import { useNDK } from '@libs/ndk/provider'; import { createBlock, createReplyNote } from '@libs/storage'; -import { LoaderIcon, ReplyIcon, RepostIcon, ZapIcon } from '@shared/icons'; -import { ThreadIcon } from '@shared/icons/thread'; -import { NoteReply } from '@shared/notes/metadata/reply'; -import { NoteRepost } from '@shared/notes/metadata/repost'; -import { NoteZap } from '@shared/notes/metadata/zap'; +import { LoaderIcon } from '@shared/icons'; +import { MiniUser } from '@shared/notes/users/mini'; -export function NoteMetadata({ - id, - rootID, - eventPubkey, -}: { - id: string; - rootID?: string; - eventPubkey: string; -}) { +import { compactNumber } from '@utils/number'; + +export function NoteMetadata({ id }: { id: string }) { const queryClient = useQueryClient(); const { ndk } = useNDK(); - const { status, data } = useQuery(['note-metadata', id], async () => { - let replies = 0; - let reposts = 0; - let zap = 0; + const { status, data } = useQuery( + ['note-metadata', id], + async () => { + let replies = 0; + let zap = 0; + const users = []; - const filter: NDKFilter = { - '#e': [id], - kinds: [1, 6, 9735], - }; + const filter: NDKFilter = { + '#e': [id], + kinds: [1, 9735], + }; - const events = await ndk.fetchEvents(filter); - events.forEach((event: NDKEvent) => { - switch (event.kind) { - case 1: - replies += 1; - createReplyNote( - id, - event.id, - event.pubkey, - event.kind, - event.tags, - event.content, - event.created_at - ); - break; - case 6: - reposts += 1; - break; - case 9735: { - const bolt11 = event.tags.find((tag) => tag[0] === 'bolt11')[1]; - if (bolt11) { - const decoded = decode(bolt11); - const amount = decoded.sections.find((item) => item.name === 'amount'); - const sats = amount.value / 1000; - zap += sats; + const events = await ndk.fetchEvents(filter); + events.forEach((event: NDKEvent) => { + switch (event.kind) { + case 1: + replies += 1; + if (users.length < 3) users.push(event.pubkey); + createReplyNote( + id, + event.id, + event.pubkey, + event.kind, + event.tags, + event.content, + event.created_at + ); + break; + case 9735: { + const bolt11 = event.tags.find((tag) => tag[0] === 'bolt11')[1]; + if (bolt11) { + const decoded = decode(bolt11); + const amount = decoded.sections.find((item) => item.name === 'amount'); + const sats = amount.value / 1000; + zap += sats; + } + break; } - break; + default: + break; } - default: - break; - } - }); + }); - return { replies, reposts, zap }; - }); + return { replies, users, zap }; + }, + { refetchOnWindowFocus: false, refetchOnReconnect: false } + ); const block = useMutation({ mutationFn: (data: any) => { @@ -85,81 +77,50 @@ export function NoteMetadata({ if (status === 'loading') { return ( -
-
- - -
-
- - -
-
- - +
+
+
+
); } return ( - -
-
- - - -
- - - - - - - Open thread - - - - -
-
+
+ {data.replies > 0 ? ( + <> +
+
+
+
+ {data.users?.map((user, index) => ( + + ))} +
+
+
+ + · +

+ + {compactNumber.format(data.zap)} + {' '} + zaps +

+
+
+ + ) : ( +
+ )} +
); } diff --git a/src/shared/notes/note.tsx b/src/shared/notes/note.tsx deleted file mode 100644 index 8cdd5dfe..00000000 --- a/src/shared/notes/note.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { useMemo } from 'react'; - -import { Kind1 } from '@shared/notes/contents/kind1'; -import { Kind1063 } from '@shared/notes/contents/kind1063'; -import { NoteMetadata } from '@shared/notes/metadata'; -import { NoteParent } from '@shared/notes/parent'; -import { Repost } from '@shared/notes/repost'; -import { User } from '@shared/user'; - -import { parser } from '@utils/parser'; -import { LumeEvent } from '@utils/types'; - -interface Note { - event: LumeEvent; - skipMetadata?: boolean; -} - -export function Note({ event, skipMetadata = false }: Note) { - const isRepost = event.kind === 6; - - const renderParent = useMemo(() => { - if (!isRepost && event.parent_id && event.parent_id !== event.event_id) { - return ; - } else { - return null; - } - }, [event.parent_id]); - - const renderRepost = useMemo(() => { - if (isRepost) { - return ; - } else { - return null; - } - }, [event.kind]); - - const renderContent = useMemo(() => { - switch (event.kind) { - case 1: { - const content = parser(event); - return ; - } - case 6: - return null; - case 1063: - return ; - default: - return ( -
-
- - Kind: {event.kind} - -

- Lume isn't fully support this kind in newsfeed -

-
-
-

{event.content}

-
-
- ); - } - }, [event.kind]); - - return ( -
-
- {renderParent} -
- -
- {renderContent} - {!isRepost && !skipMetadata ? ( - - ) : ( -
- )} -
-
- {renderRepost} -
-
- ); -} diff --git a/src/shared/notes/parent.tsx b/src/shared/notes/parent.tsx deleted file mode 100644 index ac9eb95b..00000000 --- a/src/shared/notes/parent.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { Kind1 } from '@shared/notes/contents/kind1'; -import { Kind1063 } from '@shared/notes/contents/kind1063'; -import { NoteMetadata } from '@shared/notes/metadata'; -import { NoteSkeleton } from '@shared/notes/skeleton'; -import { User } from '@shared/user'; - -import { useEvent } from '@utils/hooks/useEvent'; - -export function NoteParent({ id }: { id: string }) { - const { status, data } = useEvent(id); - - return ( -
-
- {status === 'loading' ? ( - - ) : status === 'success' ? ( - <> - -
- {data.kind === 1 && } - {data.kind === 1063 && } - {data.kind !== 1 && data.kind !== 1063 && ( -
-
- - Kind: {data.kind} - -

- Lume isn't fully support this kind in newsfeed -

-
-
-

{data.content || data.toString()}

-
-
- )} - -
- - ) : ( -

Failed to fetch event

- )} -
- ); -} diff --git a/src/shared/notes/replies/item.tsx b/src/shared/notes/replies/item.tsx index 22d12af3..c6718bd8 100644 --- a/src/shared/notes/replies/item.tsx +++ b/src/shared/notes/replies/item.tsx @@ -1,4 +1,3 @@ -import { Kind1 } from '@shared/notes/contents/kind1'; import { NoteMetadata } from '@shared/notes/metadata'; import { User } from '@shared/user'; @@ -12,7 +11,6 @@ export function Reply({ data }: { data: any }) {
-
diff --git a/src/shared/notes/repost.tsx b/src/shared/notes/repost.tsx deleted file mode 100644 index 7e0a685e..00000000 --- a/src/shared/notes/repost.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { Kind1 } from '@shared/notes/contents/kind1'; -import { Kind1063 } from '@shared/notes/contents/kind1063'; -import { NoteMetadata } from '@shared/notes/metadata'; -import { NoteSkeleton } from '@shared/notes/skeleton'; -import { User } from '@shared/user'; - -import { useEvent } from '@utils/hooks/useEvent'; -import { getRepostID } from '@utils/transform'; -import { LumeEvent } from '@utils/types'; - -export function Repost({ event }: { event: LumeEvent }) { - const repostID = getRepostID(event.tags); - const { status, data } = useEvent(repostID); - - return ( -
-
- {status === 'loading' ? ( - - ) : status === 'success' ? ( - <> - -
- {data.kind === 1 && } - {data.kind === 1063 && } - {data.kind !== 1 && data.kind !== 1063 && ( -
-
- - Kind: {data.kind} - -

- Lume isn't fully support this kind in newsfeed -

-
-
-

{data.content || data.toString()}

-
-
- )} - -
- - ) : ( -

Failed to fetch event

- )} -
- ); -} diff --git a/src/shared/notes/users/mini.tsx b/src/shared/notes/users/mini.tsx new file mode 100644 index 00000000..ad3860f4 --- /dev/null +++ b/src/shared/notes/users/mini.tsx @@ -0,0 +1,22 @@ +import { Image } from '@shared/image'; + +import { DEFAULT_AVATAR } from '@stores/constants'; + +import { useProfile } from '@utils/hooks/useProfile'; + +export function MiniUser({ pubkey }: { pubkey: string }) { + const { status, user } = useProfile(pubkey); + + if (status === 'loading') { + return
; + } + + return ( + {pubkey} + ); +} diff --git a/src/shared/notes/users/repost.tsx b/src/shared/notes/users/repost.tsx new file mode 100644 index 00000000..d0dd220d --- /dev/null +++ b/src/shared/notes/users/repost.tsx @@ -0,0 +1,34 @@ +import { Image } from '@shared/image'; + +import { DEFAULT_AVATAR } from '@stores/constants'; + +import { useProfile } from '@utils/hooks/useProfile'; +import { shortenKey } from '@utils/shortenKey'; + +export function RepostUser({ pubkey }: { pubkey: string }) { + const { status, user } = useProfile(pubkey); + + if (status === 'loading') { + return
; + } + + return ( +
+ {pubkey} +
+
+ {user?.nip05?.toLowerCase() || + user?.name || + user?.display_name || + shortenKey(pubkey)} +
+ reposted +
+
+ ); +} diff --git a/src/shared/user.tsx b/src/shared/user.tsx index cd76290c..1ca52c5a 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -14,13 +14,13 @@ export function User({ pubkey, time, size, - repost, + isRepost = false, isChat = false, }: { pubkey: string; time: number; size?: string; - repost?: boolean; + isRepost?: boolean; isChat?: boolean; }) { const { status, user } = useProfile(pubkey); @@ -50,9 +50,7 @@ export function User({ return ( -
+
- {user?.nip05 || user?.name || user?.displayName || shortenKey(pubkey)} + {user?.nip05?.toLowerCase() || + user?.name || + user?.display_name || + shortenKey(pubkey)}
- {repost && ( - reposted - )} - · {createdAt}
{ const result = await getNoteByID(id); if (result) { - if (result.kind === 1 || result.kind === 1063) { + if (result.kind === 1) { result['content'] = parser(result); } return result; } else { + if (fallback) { + const embed = JSON.parse(fallback); + await createNote( + embed.id, + embed.pubkey, + embed.kind, + embed.tags, + embed.content, + embed.created_at + ); + } const event = await ndk.fetchEvent(id); await createNote( event.id, @@ -27,7 +38,7 @@ export function useEvent(id: string) { event.created_at ); event['event_id'] = event.id; - if (event.kind === 1 || event.kind === 1063) { + if (event.kind === 1) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore event['content'] = parser(event); diff --git a/src/utils/hooks/useProfile.tsx b/src/utils/hooks/useProfile.tsx index 8ecce2b0..4b1363f6 100644 --- a/src/utils/hooks/useProfile.tsx +++ b/src/utils/hooks/useProfile.tsx @@ -24,9 +24,6 @@ export function useProfile(pubkey: string, fallback?: string) { if (latest) { await createMetadata(pubkey, pubkey, latest.content); return JSON.parse(latest.content); - } else { - await createMetadata(pubkey, pubkey, [...events][0].content); - return JSON.parse([...events][0].content); } } } else { diff --git a/src/utils/parser.tsx b/src/utils/parser.tsx index 54a46621..e3c7b5d4 100644 --- a/src/utils/parser.tsx +++ b/src/utils/parser.tsx @@ -1,4 +1,3 @@ -import destr from 'destr'; import getUrls from 'get-urls'; import { Event, parseReferences } from 'nostr-tools'; import { ReactNode } from 'react'; @@ -9,20 +8,7 @@ import { MentionUser } from '@shared/notes/mentions/user'; import { LumeEvent } from '@utils/types'; -function isJsonString(str: string[][] | string) { - try { - if (typeof str === 'string') JSON.parse(str); - } catch (e) { - return false; - } - return true; -} - export function parser(event: LumeEvent) { - if (isJsonString(event.tags)) { - event['tags'] = destr(event.tags); - } - const references = parseReferences(event as Event); const urls = getUrls(event.content); From f154d8f5f4c47f69b58d5fcb6d80eea6517bc65a Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sat, 15 Jul 2023 16:03:31 +0700 Subject: [PATCH 03/37] use markdown --- package.json | 2 + pnpm-lock.yaml | 649 ++++++++++++++++++++++++++++- src/index.css | 2 +- src/shared/notes/kinds/kind1.tsx | 33 +- src/shared/notes/kinds/repost.tsx | 17 +- src/shared/notes/kinds/sub.tsx | 17 +- src/shared/notes/kinds/thread.tsx | 16 +- src/shared/notes/mentions/note.tsx | 21 +- src/shared/notes/mentions/user.tsx | 2 +- src/shared/user.tsx | 2 +- src/utils/parser.tsx | 49 +-- 11 files changed, 760 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index 135c2b53..1344cecb 100644 --- a/package.json +++ b/package.json @@ -38,10 +38,12 @@ "react-dom": "^18.2.0", "react-hook-form": "^7.45.1", "react-hotkeys-hook": "^4.4.1", + "react-markdown": "^8.0.7", "react-player": "^2.12.0", "react-router-dom": "^6.14.1", "react-string-replace": "^1.1.1", "react-virtuoso": "^4.4.0", + "remark-gfm": "^3.0.1", "slate": "^0.94.1", "slate-history": "^0.93.0", "slate-react": "^0.94.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e58692e5..fa41dbe5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,6 +67,9 @@ dependencies: react-hotkeys-hook: specifier: ^4.4.1 version: 4.4.1(react-dom@18.2.0)(react@18.2.0) + react-markdown: + specifier: ^8.0.7 + version: 8.0.7(@types/react@18.2.15)(react@18.2.0) react-player: specifier: ^2.12.0 version: 2.12.0(react@18.2.0) @@ -79,6 +82,9 @@ dependencies: react-virtuoso: specifier: ^4.4.0 version: 4.4.0(react-dom@18.2.0)(react@18.2.0) + remark-gfm: + specifier: ^3.0.1 + version: 3.0.1 slate: specifier: ^0.94.1 version: 0.94.1 @@ -1758,6 +1764,12 @@ packages: resolution: {integrity: sha512-YQi2lvZSI+xidKeUjlbv6b6Zw7qB3aXHw5oGJLs5OOGAEqKIOvz5UIAkWyg0bJbkSUWPBEtaOHpVxU4EYBO1Jg==} dev: false + /@types/debug@4.1.8: + resolution: {integrity: sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==} + dependencies: + '@types/ms': 0.7.31 + dev: false + /@types/eslint@7.29.0: resolution: {integrity: sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==} dependencies: @@ -1769,6 +1781,12 @@ packages: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: false + /@types/hast@2.3.5: + resolution: {integrity: sha512-SvQi0L/lNpThgPoleH53cdjB3y9zpLlVjRbqB3rH8hx1jiRSBGAhyjV3H+URFjNVRqt2EdYNrbZE5IsGlNfpRg==} + dependencies: + '@types/unist': 2.0.7 + dev: false + /@types/is-hotkey@0.1.7: resolution: {integrity: sha512-yB5C7zcOM7idwYZZ1wKQ3pTfjA9BbvFqRWvKB46GFddxnJtHwi/b9y84ykQtxQPg5qhdpg4Q/kWU3EGoCTmLzQ==} dev: false @@ -1784,10 +1802,20 @@ packages: resolution: {integrity: sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==} dev: false + /@types/mdast@3.0.12: + resolution: {integrity: sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==} + dependencies: + '@types/unist': 2.0.7 + dev: false + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: false + /@types/ms@0.7.31: + resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} + dev: false + /@types/node@18.16.19: resolution: {integrity: sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==} dev: true @@ -1817,6 +1845,10 @@ packages: /@types/semver@7.5.0: resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + /@types/unist@2.0.7: + resolution: {integrity: sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g==} + dev: false + /@types/youtube-player@5.5.7: resolution: {integrity: sha512-W8F4eoTIvzXeNrT3JroQPimZLXnlJA8smYygHZUKFPVoYwgs/OhJkA1VBhL3iSs57OQkuINqHlY4SmMT5wtnJg==} dev: true @@ -2177,6 +2209,10 @@ packages: dequal: 2.0.3 dev: true + /bail@2.0.2: + resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} + dev: false + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -2277,6 +2313,10 @@ packages: resolution: {integrity: sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==} dev: true + /ccount@2.0.1: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + dev: false + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -2297,6 +2337,10 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true + /character-entities@2.0.2: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + dev: false + /cheerio-select@2.1.0: resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} dependencies: @@ -2398,6 +2442,10 @@ packages: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} dev: true + /comma-separated-tokens@2.0.3: + resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + dev: false + /commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} @@ -2550,6 +2598,12 @@ packages: engines: {node: '>=0.10.0'} dev: false + /decode-named-character-reference@1.0.2: + resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} + dependencies: + character-entities: 2.0.2 + dev: false + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -2577,7 +2631,6 @@ packages: /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} - dev: true /destr@1.2.2: resolution: {integrity: sha512-lrbCJwD9saUQrqUfXvl6qoM+QN3W7tLV5pAOs+OqOmopCCz/JkE05MHedJR1xfk4IAnZuJXPVuN5+7jNA2ZCiA==} @@ -2596,6 +2649,11 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: false + /diff@5.1.0: + resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} + engines: {node: '>=0.3.1'} + dev: false + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -2851,6 +2909,11 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + /escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + dev: false + /eslint-config-prettier@8.8.0(eslint@8.44.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} hasBin: true @@ -3141,6 +3204,10 @@ packages: type: 2.7.2 dev: false + /extend@3.0.2: + resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + dev: false + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -3476,6 +3543,10 @@ packages: dependencies: function-bind: 1.1.1 + /hast-util-whitespace@2.0.1: + resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} + dev: false + /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: false @@ -3580,6 +3651,10 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + /inline-style-parser@0.1.1: + resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} + dev: false + /install-artifact-from-github@1.3.3: resolution: {integrity: sha512-x79SL0d8WOi1ZjXSTUqqs0GPQZ92YArJAN9O46wgU9wdH2U9ecyyhB9YGDbPe2OLV4ptmt6AZYRQZ2GydQZosQ==} hasBin: true @@ -3643,6 +3718,11 @@ packages: call-bind: 1.0.2 has-tostringtag: 1.0.0 + /is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + dev: false + /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -3708,6 +3788,11 @@ packages: engines: {node: '>=0.10.0'} dev: false + /is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + dev: false + /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} engines: {node: '>=0.10.0'} @@ -3858,6 +3943,11 @@ packages: engines: {node: '>=0.10.0'} dev: false + /kleur@4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + dev: false + /language-subtag-registry@0.3.22: resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} dev: true @@ -3990,6 +4080,10 @@ packages: wrap-ansi: 6.2.0 dev: true + /longest-streak@3.1.0: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} + dev: false + /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -4045,6 +4139,141 @@ packages: engines: {node: '>=8'} dev: false + /markdown-table@3.0.3: + resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==} + dev: false + + /mdast-util-definitions@5.1.2: + resolution: {integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==} + dependencies: + '@types/mdast': 3.0.12 + '@types/unist': 2.0.7 + unist-util-visit: 4.1.2 + dev: false + + /mdast-util-find-and-replace@2.2.2: + resolution: {integrity: sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==} + dependencies: + '@types/mdast': 3.0.12 + escape-string-regexp: 5.0.0 + unist-util-is: 5.2.1 + unist-util-visit-parents: 5.1.3 + dev: false + + /mdast-util-from-markdown@1.3.1: + resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==} + dependencies: + '@types/mdast': 3.0.12 + '@types/unist': 2.0.7 + decode-named-character-reference: 1.0.2 + mdast-util-to-string: 3.2.0 + micromark: 3.2.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-decode-string: 1.1.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + unist-util-stringify-position: 3.0.3 + uvu: 0.5.6 + transitivePeerDependencies: + - supports-color + dev: false + + /mdast-util-gfm-autolink-literal@1.0.3: + resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==} + dependencies: + '@types/mdast': 3.0.12 + ccount: 2.0.1 + mdast-util-find-and-replace: 2.2.2 + micromark-util-character: 1.2.0 + dev: false + + /mdast-util-gfm-footnote@1.0.2: + resolution: {integrity: sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==} + dependencies: + '@types/mdast': 3.0.12 + mdast-util-to-markdown: 1.5.0 + micromark-util-normalize-identifier: 1.1.0 + dev: false + + /mdast-util-gfm-strikethrough@1.0.3: + resolution: {integrity: sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==} + dependencies: + '@types/mdast': 3.0.12 + mdast-util-to-markdown: 1.5.0 + dev: false + + /mdast-util-gfm-table@1.0.7: + resolution: {integrity: sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==} + dependencies: + '@types/mdast': 3.0.12 + markdown-table: 3.0.3 + mdast-util-from-markdown: 1.3.1 + mdast-util-to-markdown: 1.5.0 + transitivePeerDependencies: + - supports-color + dev: false + + /mdast-util-gfm-task-list-item@1.0.2: + resolution: {integrity: sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==} + dependencies: + '@types/mdast': 3.0.12 + mdast-util-to-markdown: 1.5.0 + dev: false + + /mdast-util-gfm@2.0.2: + resolution: {integrity: sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==} + dependencies: + mdast-util-from-markdown: 1.3.1 + mdast-util-gfm-autolink-literal: 1.0.3 + mdast-util-gfm-footnote: 1.0.2 + mdast-util-gfm-strikethrough: 1.0.3 + mdast-util-gfm-table: 1.0.7 + mdast-util-gfm-task-list-item: 1.0.2 + mdast-util-to-markdown: 1.5.0 + transitivePeerDependencies: + - supports-color + dev: false + + /mdast-util-phrasing@3.0.1: + resolution: {integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==} + dependencies: + '@types/mdast': 3.0.12 + unist-util-is: 5.2.1 + dev: false + + /mdast-util-to-hast@12.3.0: + resolution: {integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==} + dependencies: + '@types/hast': 2.3.5 + '@types/mdast': 3.0.12 + mdast-util-definitions: 5.1.2 + micromark-util-sanitize-uri: 1.2.0 + trim-lines: 3.0.1 + unist-util-generated: 2.0.1 + unist-util-position: 4.0.4 + unist-util-visit: 4.1.2 + dev: false + + /mdast-util-to-markdown@1.5.0: + resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==} + dependencies: + '@types/mdast': 3.0.12 + '@types/unist': 2.0.7 + longest-streak: 3.1.0 + mdast-util-phrasing: 3.0.1 + mdast-util-to-string: 3.2.0 + micromark-util-decode-string: 1.1.0 + unist-util-visit: 4.1.2 + zwitch: 2.0.4 + dev: false + + /mdast-util-to-string@3.2.0: + resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} + dependencies: + '@types/mdast': 3.0.12 + dev: false + /memoize-one@5.2.1: resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} dev: false @@ -4080,6 +4309,253 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + /micromark-core-commonmark@1.1.0: + resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} + dependencies: + decode-named-character-reference: 1.0.2 + micromark-factory-destination: 1.1.0 + micromark-factory-label: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-factory-title: 1.1.0 + micromark-factory-whitespace: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-chunked: 1.1.0 + micromark-util-classify-character: 1.1.0 + micromark-util-html-tag-name: 1.2.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-subtokenize: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-extension-gfm-autolink-literal@1.0.5: + resolution: {integrity: sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==} + dependencies: + micromark-util-character: 1.2.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-extension-gfm-footnote@1.1.2: + resolution: {integrity: sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==} + dependencies: + micromark-core-commonmark: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-extension-gfm-strikethrough@1.0.7: + resolution: {integrity: sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==} + dependencies: + micromark-util-chunked: 1.1.0 + micromark-util-classify-character: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-extension-gfm-table@1.0.7: + resolution: {integrity: sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==} + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-extension-gfm-tagfilter@1.0.2: + resolution: {integrity: sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==} + dependencies: + micromark-util-types: 1.1.0 + dev: false + + /micromark-extension-gfm-task-list-item@1.0.5: + resolution: {integrity: sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==} + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-extension-gfm@2.0.3: + resolution: {integrity: sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==} + dependencies: + micromark-extension-gfm-autolink-literal: 1.0.5 + micromark-extension-gfm-footnote: 1.1.2 + micromark-extension-gfm-strikethrough: 1.0.7 + micromark-extension-gfm-table: 1.0.7 + micromark-extension-gfm-tagfilter: 1.0.2 + micromark-extension-gfm-task-list-item: 1.0.5 + micromark-util-combine-extensions: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-factory-destination@1.1.0: + resolution: {integrity: sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==} + dependencies: + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-factory-label@1.1.0: + resolution: {integrity: sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==} + dependencies: + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-factory-space@1.1.0: + resolution: {integrity: sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==} + dependencies: + micromark-util-character: 1.2.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-factory-title@1.1.0: + resolution: {integrity: sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==} + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-factory-whitespace@1.1.0: + resolution: {integrity: sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==} + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-util-character@1.2.0: + resolution: {integrity: sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==} + dependencies: + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-util-chunked@1.1.0: + resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==} + dependencies: + micromark-util-symbol: 1.1.0 + dev: false + + /micromark-util-classify-character@1.1.0: + resolution: {integrity: sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==} + dependencies: + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-util-combine-extensions@1.1.0: + resolution: {integrity: sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==} + dependencies: + micromark-util-chunked: 1.1.0 + micromark-util-types: 1.1.0 + dev: false + + /micromark-util-decode-numeric-character-reference@1.1.0: + resolution: {integrity: sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==} + dependencies: + micromark-util-symbol: 1.1.0 + dev: false + + /micromark-util-decode-string@1.1.0: + resolution: {integrity: sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==} + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 1.2.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-symbol: 1.1.0 + dev: false + + /micromark-util-encode@1.1.0: + resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==} + dev: false + + /micromark-util-html-tag-name@1.2.0: + resolution: {integrity: sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==} + dev: false + + /micromark-util-normalize-identifier@1.1.0: + resolution: {integrity: sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==} + dependencies: + micromark-util-symbol: 1.1.0 + dev: false + + /micromark-util-resolve-all@1.1.0: + resolution: {integrity: sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==} + dependencies: + micromark-util-types: 1.1.0 + dev: false + + /micromark-util-sanitize-uri@1.2.0: + resolution: {integrity: sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==} + dependencies: + micromark-util-character: 1.2.0 + micromark-util-encode: 1.1.0 + micromark-util-symbol: 1.1.0 + dev: false + + /micromark-util-subtokenize@1.1.0: + resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==} + dependencies: + micromark-util-chunked: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + dev: false + + /micromark-util-symbol@1.1.0: + resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==} + dev: false + + /micromark-util-types@1.1.0: + resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==} + dev: false + + /micromark@3.2.0: + resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} + dependencies: + '@types/debug': 4.1.8 + debug: 4.3.4 + decode-named-character-reference: 1.0.2 + micromark-core-commonmark: 1.1.0 + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-chunked: 1.1.0 + micromark-util-combine-extensions: 1.1.0 + micromark-util-decode-numeric-character-reference: 1.1.0 + micromark-util-encode: 1.1.0 + micromark-util-normalize-identifier: 1.1.0 + micromark-util-resolve-all: 1.1.0 + micromark-util-sanitize-uri: 1.2.0 + micromark-util-subtokenize: 1.1.0 + micromark-util-symbol: 1.1.0 + micromark-util-types: 1.1.0 + uvu: 0.5.6 + transitivePeerDependencies: + - supports-color + dev: false + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -4192,6 +4668,11 @@ packages: hasBin: true dev: false + /mri@1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + dev: false + /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: false @@ -4796,6 +5277,10 @@ packages: object-assign: 4.1.1 react-is: 16.13.1 + /property-information@6.2.0: + resolution: {integrity: sha512-kma4U7AFCTwpqq5twzC1YVIDXSqg6qQK6JN0smOw8fgRy1OkMi0CYSzFmsy6dnqSenamAtj0CyXMUJ1Mf6oROg==} + dev: false + /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} @@ -4859,6 +5344,33 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: false + /react-markdown@8.0.7(@types/react@18.2.15)(react@18.2.0): + resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==} + peerDependencies: + '@types/react': '>=16' + react: '>=16' + dependencies: + '@types/hast': 2.3.5 + '@types/prop-types': 15.7.5 + '@types/react': 18.2.15 + '@types/unist': 2.0.7 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 2.0.1 + prop-types: 15.8.1 + property-information: 6.2.0 + react: 18.2.0 + react-is: 18.2.0 + remark-parse: 10.0.2 + remark-rehype: 10.1.0 + space-separated-tokens: 2.0.2 + style-to-object: 0.4.1 + unified: 10.1.2 + unist-util-visit: 4.1.2 + vfile: 5.3.7 + transitivePeerDependencies: + - supports-color + dev: false + /react-player@2.12.0(react@18.2.0): resolution: {integrity: sha512-rymLRz/2GJJD+Wc01S7S+i9pGMFYnNmQibR2gVE3KmHJCBNN8BhPAlOPTGZtn1uKpJ6p4RPLlzPQ1OLreXd8gw==} peerDependencies: @@ -5039,6 +5551,36 @@ packages: define-properties: 1.2.0 functions-have-names: 1.2.3 + /remark-gfm@3.0.1: + resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==} + dependencies: + '@types/mdast': 3.0.12 + mdast-util-gfm: 2.0.2 + micromark-extension-gfm: 2.0.3 + unified: 10.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /remark-parse@10.0.2: + resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==} + dependencies: + '@types/mdast': 3.0.12 + mdast-util-from-markdown: 1.3.1 + unified: 10.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /remark-rehype@10.1.0: + resolution: {integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==} + dependencies: + '@types/hast': 2.3.5 + '@types/mdast': 3.0.12 + mdast-util-to-hast: 12.3.0 + unified: 10.1.2 + dev: false + /remove-accents@0.4.2: resolution: {integrity: sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA==} dev: false @@ -5110,6 +5652,13 @@ packages: tslib: 2.6.0 dev: true + /sade@1.8.1: + resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} + engines: {node: '>=6'} + dependencies: + mri: 1.2.0 + dev: false + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false @@ -5299,6 +5848,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /space-separated-tokens@2.0.2: + resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + dev: false + /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: @@ -5432,6 +5985,12 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + /style-to-object@0.4.1: + resolution: {integrity: sha512-HFpbb5gr2ypci7Qw+IOhnP2zOU7e77b+rzM+wTzXzfi1PrtBCX0E7Pk4wL4iTLnhzZ+JgEGAhX81ebTg/aYjQw==} + dependencies: + inline-style-parser: 0.1.1 + dev: false + /sucrase@3.32.0: resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} engines: {node: '>=8'} @@ -5568,11 +6127,19 @@ packages: dependencies: is-number: 7.0.0 + /trim-lines@3.0.1: + resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + dev: false + /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} dev: false + /trough@2.1.0: + resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} + dev: false + /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true @@ -5711,6 +6278,18 @@ packages: has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 + /unified@10.1.2: + resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} + dependencies: + '@types/unist': 2.0.7 + bail: 2.0.2 + extend: 3.0.2 + is-buffer: 2.0.5 + is-plain-obj: 4.1.0 + trough: 2.1.0 + vfile: 5.3.7 + dev: false + /unique-filename@3.0.0: resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -5725,6 +6304,43 @@ packages: imurmurhash: 0.1.4 dev: false + /unist-util-generated@2.0.1: + resolution: {integrity: sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==} + dev: false + + /unist-util-is@5.2.1: + resolution: {integrity: sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==} + dependencies: + '@types/unist': 2.0.7 + dev: false + + /unist-util-position@4.0.4: + resolution: {integrity: sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==} + dependencies: + '@types/unist': 2.0.7 + dev: false + + /unist-util-stringify-position@3.0.3: + resolution: {integrity: sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==} + dependencies: + '@types/unist': 2.0.7 + dev: false + + /unist-util-visit-parents@5.1.3: + resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} + dependencies: + '@types/unist': 2.0.7 + unist-util-is: 5.2.1 + dev: false + + /unist-util-visit@4.1.2: + resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} + dependencies: + '@types/unist': 2.0.7 + unist-util-is: 5.2.1 + unist-util-visit-parents: 5.1.3 + dev: false + /update-browserslist-db@1.0.11(browserslist@4.21.9): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true @@ -5815,6 +6431,17 @@ packages: hasBin: true dev: true + /uvu@0.5.6: + resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + dequal: 2.0.3 + diff: 5.1.0 + kleur: 4.1.5 + sade: 1.8.1 + dev: false + /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: @@ -5822,6 +6449,22 @@ packages: spdx-expression-parse: 3.0.1 dev: false + /vfile-message@3.1.4: + resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==} + dependencies: + '@types/unist': 2.0.7 + unist-util-stringify-position: 3.0.3 + dev: false + + /vfile@5.3.7: + resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} + dependencies: + '@types/unist': 2.0.7 + is-buffer: 2.0.5 + unist-util-stringify-position: 3.0.3 + vfile-message: 3.1.4 + dev: false + /vite-plugin-top-level-await@1.3.1(vite@4.4.4): resolution: {integrity: sha512-55M1h4NAwkrpxPNOJIBzKZFihqLUzIgnElLSmPNPMR2Fn9+JHKaNg3sVX1Fq+VgvuBksQYxiD3OnwQAUu7kaPQ==} peerDependencies: @@ -6025,6 +6668,10 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false + /zwitch@2.0.4: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + dev: false + github.com/tauri-apps/tauri-plugin-autostart/59c48c642cea6a854bb1f4181972ad0bfbeb0c75: resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/59c48c642cea6a854bb1f4181972ad0bfbeb0c75} name: tauri-plugin-autostart-api diff --git a/src/index.css b/src/index.css index 72148ca3..a89a9aea 100644 --- a/src/index.css +++ b/src/index.css @@ -15,7 +15,7 @@ button { } .markdown { - @apply prose prose-zinc max-w-none select-text break-words dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:leading-tight prose-p:last:mb-0 prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-500 hover:prose-a:text-fuchsia-600 prose-blockquote:m-0 prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-hr:mx-0 prose-hr:my-2; + @apply prose prose-zinc max-w-none select-text break-words dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:last:mb-0 prose-a:break-words prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-hr:mx-0 prose-hr:my-2; } /* For Webkit-based browsers (Chrome, Safari and Opera) */ diff --git a/src/shared/notes/kinds/kind1.tsx b/src/shared/notes/kinds/kind1.tsx index 01701677..34b3d702 100644 --- a/src/shared/notes/kinds/kind1.tsx +++ b/src/shared/notes/kinds/kind1.tsx @@ -1,6 +1,14 @@ import { useMemo } from 'react'; +import ReactMarkdown from 'react-markdown'; +import remarkGfm from 'remark-gfm'; -import { LinkPreview, NoteActions, NoteMetadata, VideoPreview } from '@shared/notes'; +import { + LinkPreview, + MentionUser, + NoteActions, + NoteMetadata, + VideoPreview, +} from '@shared/notes'; import { MentionNote } from '@shared/notes/mentions/note'; import { ImagePreview } from '@shared/notes/preview/image'; import { User } from '@shared/user'; @@ -25,9 +33,28 @@ export function NoteKind_1({
-
+ { + const key = children[0] as string; + if (key.startsWith('pub')) + return ; + if (key.startsWith('tag')) + return ( + + ); + }, + }} + > {content.parsed} -
+ {content.images.length > 0 && } {content.videos.length > 0 && } {content.links.length > 0 && } diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index 274bae15..b1705514 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -1,7 +1,11 @@ +import ReactMarkdown from 'react-markdown'; +import remarkGfm from 'remark-gfm'; + import { ImagePreview, LinkPreview, MentionNote, + MentionUser, NoteActions, NoteMetadata, NoteSkeleton, @@ -45,9 +49,18 @@ export function Repost({ event }: { event: LumeEvent }) {
-
+ { + const pubkey = children[0] as string; + return ; + }, + }} + > {data.content.parsed} -
+ {data.content.images.length > 0 && ( )} diff --git a/src/shared/notes/kinds/sub.tsx b/src/shared/notes/kinds/sub.tsx index 36d8ab0e..75c71078 100644 --- a/src/shared/notes/kinds/sub.tsx +++ b/src/shared/notes/kinds/sub.tsx @@ -1,7 +1,11 @@ +import ReactMarkdown from 'react-markdown'; +import remarkGfm from 'remark-gfm'; + import { ImagePreview, LinkPreview, MentionNote, + MentionUser, NoteActions, NoteSkeleton, VideoPreview, @@ -37,9 +41,18 @@ export function SubNote({ id }: { id: string }) {
-
+ { + const pubkey = children[0] as string; + return ; + }, + }} + > {data.content.parsed} -
+ {data.content.images.length > 0 && ( )} diff --git a/src/shared/notes/kinds/thread.tsx b/src/shared/notes/kinds/thread.tsx index a8ed8e1c..82fc4add 100644 --- a/src/shared/notes/kinds/thread.tsx +++ b/src/shared/notes/kinds/thread.tsx @@ -1,7 +1,10 @@ import { useMemo } from 'react'; +import ReactMarkdown from 'react-markdown'; +import remarkGfm from 'remark-gfm'; import { LinkPreview, + MentionUser, NoteActions, NoteMetadata, SubNote, @@ -35,9 +38,18 @@ export function NoteThread({
-
+ { + const pubkey = children[0] as string; + return ; + }, + }} + > {content.parsed} -
+ {content.images.length > 0 && } {content.videos.length > 0 && } {content.links.length > 0 && } diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx index 15dde810..4e994d70 100644 --- a/src/shared/notes/mentions/note.tsx +++ b/src/shared/notes/mentions/note.tsx @@ -1,5 +1,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; import { memo } from 'react'; +import ReactMarkdown from 'react-markdown'; +import remarkGfm from 'remark-gfm'; import { createBlock } from '@libs/storage'; @@ -8,6 +10,8 @@ import { User } from '@shared/user'; import { useEvent } from '@utils/hooks/useEvent'; +import { MentionUser } from './user'; + export const MentionNote = memo(function MentionNote({ id }: { id: string }) { const { status, data } = useEvent(id); @@ -43,7 +47,22 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { ) : status === 'success' ? ( <> -
{data.content.parsed}
+
+ { + const pubkey = children[0] as string; + return ; + }, + }} + > + {data.content.parsed.length > 200 + ? data.content.parsed.substring(0, 200) + '...' + : data.content.parsed} + +
) : (

Failed to fetch event

diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index 0ca6109b..20bef718 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -9,7 +9,7 @@ export function MentionUser({ pubkey }: { pubkey: string }) { return ( @{user?.name || user?.displayName || shortenKey(pubkey)} diff --git a/src/shared/user.tsx b/src/shared/user.tsx index 1ca52c5a..37dcbb83 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -71,7 +71,7 @@ export function User({ >
{user?.nip05?.toLowerCase() || diff --git a/src/utils/parser.tsx b/src/utils/parser.tsx index e3c7b5d4..2c9c18ec 100644 --- a/src/utils/parser.tsx +++ b/src/utils/parser.tsx @@ -1,6 +1,5 @@ import getUrls from 'get-urls'; import { Event, parseReferences } from 'nostr-tools'; -import { ReactNode } from 'react'; import { Link } from 'react-router-dom'; import reactStringReplace from 'react-string-replace'; @@ -14,14 +13,14 @@ export function parser(event: LumeEvent) { const content: { original: string; - parsed: ReactNode[]; + parsed: string; notes: string[]; images: string[]; videos: string[]; links: string[]; } = { original: event.content, - parsed: [event.content], + parsed: event.content, notes: [], images: [], videos: [], @@ -34,62 +33,40 @@ export function parser(event: LumeEvent) { // image url content.images.push(url); // remove url from original content - content.parsed = reactStringReplace(content.parsed, url, () => ''); + content.parsed = content.parsed.replace(url, ''); } else if (url.match(/\.(mp4|webm|mov|ogv|avi|mp3)$/)) { // video content.videos.push(url); // remove url from original content - content.parsed = reactStringReplace(content.parsed, url, () => ''); + content.parsed = content.parsed.replace(url, ''); } else { if (content.links.length < 1) { // push to store content.links.push(url); // remove url from original content - content.parsed = reactStringReplace(content.parsed, url, () => ''); - } else { - content.parsed = reactStringReplace(content.parsed, url, (match, i) => ( - - {match} - - )); + content.parsed = content.parsed.replace(url, ''); } } }); + // parse hashtag + const hashtags = content.parsed.split(/\s/gm).filter((s) => s.startsWith('#')); + hashtags?.forEach((tag) => { + content.parsed = content.parsed.replace(tag, `~tag${tag}~`); + }); + // parse nostr references?.forEach((item) => { const profile = item.profile; const event = item.event; if (event) { content.notes.push(event.id); - content.parsed = reactStringReplace(content.parsed, item.text, () => null); + content.parsed = content.parsed.replace(item.text, ''); } if (profile) { - content.parsed = reactStringReplace(content.parsed, item.text, (match, i) => ( - - )); + content.parsed = content.parsed.replace(item.text, `~pub${item.profile.pubkey}~`); } }); - // parse hashtag - content.parsed = reactStringReplace(content.parsed, /#(\w+)/g, (match, i) => ( - - #{match} - - )); - - // clean array - content.parsed = content.parsed.filter( - (el) => el !== '\n' && el !== '\n\n' && el !== '\n' - ); - return content; } From e0a14ce6cff79de954a194b052226d600222248e Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sat, 15 Jul 2023 21:01:27 +0700 Subject: [PATCH 04/37] update markdown --- src/shared/notes/content.tsx | 54 +++++++++++++++++++++++++++++ src/shared/notes/index.tsx | 1 + src/shared/notes/kinds/kind1.tsx | 42 ++-------------------- src/shared/notes/kinds/kind1063.tsx | 2 +- src/shared/notes/kinds/repost.tsx | 33 ++---------------- src/shared/notes/kinds/sub.tsx | 39 ++------------------- src/shared/notes/kinds/thread.tsx | 33 ++---------------- src/shared/notes/mentions/note.tsx | 17 ++++++--- src/shared/notes/mentions/user.tsx | 10 +++--- src/utils/parser.tsx | 7 ++-- 10 files changed, 85 insertions(+), 153 deletions(-) create mode 100644 src/shared/notes/content.tsx diff --git a/src/shared/notes/content.tsx b/src/shared/notes/content.tsx new file mode 100644 index 00000000..a3c4c0ea --- /dev/null +++ b/src/shared/notes/content.tsx @@ -0,0 +1,54 @@ +import ReactMarkdown from 'react-markdown'; +import remarkGfm from 'remark-gfm'; + +import { + ImagePreview, + LinkPreview, + MentionNote, + MentionUser, + VideoPreview, +} from '@shared/notes'; + +export function NoteContent({ + content, +}: { + content: { + original: string; + parsed: string; + notes: string[]; + images: string[]; + videos: string[]; + links: string[]; + }; +}) { + return ( + <> + { + const key = children[0] as string; + if (key.startsWith('pub')) return ; + if (key.startsWith('tag')) + return ( + + ); + }, + }} + > + {content.parsed} + + {content.images.length > 0 && } + {content.videos.length > 0 && } + {content.links.length > 0 && } + {content.notes.length > 0 && + content.notes.map((note: string) => )} + + ); +} diff --git a/src/shared/notes/index.tsx b/src/shared/notes/index.tsx index de14f037..b12f5be9 100644 --- a/src/shared/notes/index.tsx +++ b/src/shared/notes/index.tsx @@ -20,3 +20,4 @@ export * from './kinds/repost'; export * from './kinds/sub'; export * from './skeleton'; export * from './actions'; +export * from './content'; diff --git a/src/shared/notes/kinds/kind1.tsx b/src/shared/notes/kinds/kind1.tsx index 34b3d702..3cfa7562 100644 --- a/src/shared/notes/kinds/kind1.tsx +++ b/src/shared/notes/kinds/kind1.tsx @@ -1,16 +1,6 @@ import { useMemo } from 'react'; -import ReactMarkdown from 'react-markdown'; -import remarkGfm from 'remark-gfm'; -import { - LinkPreview, - MentionUser, - NoteActions, - NoteMetadata, - VideoPreview, -} from '@shared/notes'; -import { MentionNote } from '@shared/notes/mentions/note'; -import { ImagePreview } from '@shared/notes/preview/image'; +import { NoteActions, NoteContent, NoteMetadata } from '@shared/notes'; import { User } from '@shared/user'; import { parser } from '@utils/parser'; @@ -30,36 +20,10 @@ export function NoteKind_1({
-
+
- { - const key = children[0] as string; - if (key.startsWith('pub')) - return ; - if (key.startsWith('tag')) - return ( - - ); - }, - }} - > - {content.parsed} - - {content.images.length > 0 && } - {content.videos.length > 0 && } - {content.links.length > 0 && } - {content.notes.length > 0 && - content.notes.map((note: string) => )} +
-
+
{isImage(url) && ( diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index b1705514..7ab7ff16 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -1,16 +1,9 @@ -import ReactMarkdown from 'react-markdown'; -import remarkGfm from 'remark-gfm'; - import { - ImagePreview, - LinkPreview, - MentionNote, - MentionUser, NoteActions, + NoteContent, NoteMetadata, NoteSkeleton, RepostUser, - VideoPreview, } from '@shared/notes'; import { User } from '@shared/user'; @@ -49,29 +42,7 @@ export function Repost({ event }: { event: LumeEvent }) {
- { - const pubkey = children[0] as string; - return ; - }, - }} - > - {data.content.parsed} - - {data.content.images.length > 0 && ( - - )} - {data.content.videos.length > 0 && ( - - )} - {data.content.links.length > 0 && } - {data.content.notes.length > 0 && - data.content.notes.map((note: string) => ( - - ))} +
-
+
- { - const pubkey = children[0] as string; - return ; - }, - }} - > - {data.content.parsed} - - {data.content.images.length > 0 && ( - - )} - {data.content.videos.length > 0 && ( - - )} - {data.content.links.length > 0 && } - {data.content.notes.length > 0 && - data.content.notes.map((note: string) => ( - - ))} +
diff --git a/src/shared/notes/kinds/thread.tsx b/src/shared/notes/kinds/thread.tsx index 82fc4add..5a6fd43a 100644 --- a/src/shared/notes/kinds/thread.tsx +++ b/src/shared/notes/kinds/thread.tsx @@ -1,17 +1,6 @@ import { useMemo } from 'react'; -import ReactMarkdown from 'react-markdown'; -import remarkGfm from 'remark-gfm'; -import { - LinkPreview, - MentionUser, - NoteActions, - NoteMetadata, - SubNote, - VideoPreview, -} from '@shared/notes'; -import { MentionNote } from '@shared/notes/mentions/note'; -import { ImagePreview } from '@shared/notes/preview/image'; +import { NoteActions, NoteContent, NoteMetadata, SubNote } from '@shared/notes'; import { User } from '@shared/user'; import { parser } from '@utils/parser'; @@ -35,26 +24,10 @@ export function NoteThread({
{reply && }
-
+
- { - const pubkey = children[0] as string; - return ; - }, - }} - > - {content.parsed} - - {content.images.length > 0 && } - {content.videos.length > 0 && } - {content.links.length > 0 && } - {content.notes.length > 0 && - content.notes.map((note: string) => )} + { - const pubkey = children[0] as string; - return ; + const key = children[0] as string; + if (key.startsWith('pub')) return ; + if (key.startsWith('tag')) + return ( + + ); }, }} > diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index 20bef718..49fcf80f 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -1,5 +1,3 @@ -import { Link } from 'react-router-dom'; - import { useProfile } from '@utils/hooks/useProfile'; import { shortenKey } from '@utils/shortenKey'; @@ -7,11 +5,11 @@ export function MentionUser({ pubkey }: { pubkey: string }) { const { user } = useProfile(pubkey); return ( - @{user?.name || user?.displayName || shortenKey(pubkey)} - + ); } diff --git a/src/utils/parser.tsx b/src/utils/parser.tsx index 2c9c18ec..de84283f 100644 --- a/src/utils/parser.tsx +++ b/src/utils/parser.tsx @@ -1,9 +1,6 @@ import getUrls from 'get-urls'; import { Event, parseReferences } from 'nostr-tools'; -import { Link } from 'react-router-dom'; -import reactStringReplace from 'react-string-replace'; - -import { MentionUser } from '@shared/notes/mentions/user'; +import ReactPlayer from 'react-player'; import { LumeEvent } from '@utils/types'; @@ -34,7 +31,7 @@ export function parser(event: LumeEvent) { content.images.push(url); // remove url from original content content.parsed = content.parsed.replace(url, ''); - } else if (url.match(/\.(mp4|webm|mov|ogv|avi|mp3)$/)) { + } else if (ReactPlayer.canPlay(url)) { // video content.videos.push(url); // remove url from original content From abc53a0d9ad3109db51f3a02a7fc823c8b56d414 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sun, 16 Jul 2023 14:24:19 +0700 Subject: [PATCH 05/37] update note actions component --- src/index.css | 2 +- src/shared/composer/types/post.tsx | 16 +++-------- src/shared/icons/index.tsx | 1 + src/shared/icons/thread.tsx | 9 ++---- src/shared/notes/actions.tsx | 43 ++++++++++++++++++++-------- src/shared/notes/actions/reply.tsx | 12 ++------ src/shared/notes/kinds/kind1.tsx | 6 +--- src/shared/notes/kinds/kind1063.tsx | 6 +--- src/shared/notes/kinds/repost.tsx | 6 +--- src/shared/notes/kinds/sub.tsx | 2 +- src/shared/notes/kinds/thread.tsx | 6 +--- src/shared/notes/kinds/unsupport.tsx | 6 +--- src/shared/notes/metadata.tsx | 2 +- src/shared/user.tsx | 11 ++++++- src/stores/composer.tsx | 10 +++---- 15 files changed, 64 insertions(+), 74 deletions(-) diff --git a/src/index.css b/src/index.css index a89a9aea..1512f92c 100644 --- a/src/index.css +++ b/src/index.css @@ -15,7 +15,7 @@ button { } .markdown { - @apply prose prose-zinc max-w-none select-text break-words dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:last:mb-0 prose-a:break-words prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-hr:mx-0 prose-hr:my-2; + @apply prose prose-zinc max-w-none select-text break-words dark:prose-invert prose-p:mb-2 prose-p:mt-0 prose-p:last:mb-0 prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:text-fuchsia-400 hover:prose-a:text-fuchsia-500 prose-blockquote:m-0 prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-li:leading-tight prose-hr:mx-0 prose-hr:my-2; } /* For Webkit-based browsers (Chrome, Safari and Opera) */ diff --git a/src/shared/composer/types/post.tsx b/src/shared/composer/types/post.tsx index 27d06f65..84820c56 100644 --- a/src/shared/composer/types/post.tsx +++ b/src/shared/composer/types/post.tsx @@ -87,18 +87,10 @@ export function Post() { let tags: string[][] = []; if (reply.id && reply.pubkey) { - if (reply.root && reply.root !== reply.id) { - tags = [ - ['e', reply.id, FULL_RELAYS[0], 'root'], - ['e', reply.root, FULL_RELAYS[0], 'reply'], - ['p', reply.pubkey], - ]; - } else { - tags = [ - ['e', reply.id, FULL_RELAYS[0], 'root'], - ['p', reply.pubkey], - ]; - } + tags = [ + ['e', reply.id, FULL_RELAYS[0], 'reply'], + ['p', reply.pubkey], + ]; } else { tags = []; } diff --git a/src/shared/icons/index.tsx b/src/shared/icons/index.tsx index 3cbb94b8..8227667d 100644 --- a/src/shared/icons/index.tsx +++ b/src/shared/icons/index.tsx @@ -44,4 +44,5 @@ export * from './logout'; export * from './follow'; export * from './unfollow'; export * from './reaction'; +export * from './thread'; // @endindex diff --git a/src/shared/icons/thread.tsx b/src/shared/icons/thread.tsx index 95d8af55..406c90c0 100644 --- a/src/shared/icons/thread.tsx +++ b/src/shared/icons/thread.tsx @@ -11,12 +11,9 @@ export function ThreadIcon(props: JSX.IntrinsicAttributes & SVGProps + fill="currentColor" + d="M12 19.25V20a.75.75 0 00.75-.75H12zm8.5-9a.75.75 0 001.5 0h-1.5zm-.75 3.5a.75.75 0 00-1.5 0h1.5zm-1.5 6.5a.75.75 0 001.5 0h-1.5zm-2.5-4a.75.75 0 000 1.5v-1.5zm6.5 1.5a.75.75 0 000-1.5v1.5zm-18.75.5V5.75H2v12.5h1.5zm8.5.25H3.75V20H12v-1.5zm8.5-12.75v4.5H22v-4.5h-1.5zM3.75 5.5H12V4H3.75v1.5zm8.25 0h8.25V4H12v1.5zm.75 13.75V4.75h-1.5v14.5h1.5zm5.5-5.5V17h1.5v-3.25h-1.5zm0 3.25v3.25h1.5V17h-1.5zm-2.5.75H19v-1.5h-3.25v1.5zm3.25 0h3.25v-1.5H19v1.5zm3-12A1.75 1.75 0 0020.25 4v1.5a.25.25 0 01.25.25H22zm-18.5 0a.25.25 0 01.25-.25V4A1.75 1.75 0 002 5.75h1.5zM2 18.25c0 .966.784 1.75 1.75 1.75v-1.5a.25.25 0 01-.25-.25H2z" + > ); } diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index 86051ad7..6846de61 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -1,28 +1,47 @@ import * as Tooltip from '@radix-ui/react-tooltip'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { createBlock } from '@libs/storage'; + +import { ThreadIcon } from '@shared/icons'; import { NoteReaction } from '@shared/notes/actions/reaction'; import { NoteReply } from '@shared/notes/actions/reply'; import { NoteRepost } from '@shared/notes/actions/repost'; import { NoteZap } from '@shared/notes/actions/zap'; -export function NoteActions({ - id, - rootID, - eventPubkey, -}: { - id: string; - rootID?: string; - eventPubkey: string; -}) { +export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) { + const queryClient = useQueryClient(); + + const block = useMutation({ + mutationFn: (data: { kind: number; title: string; content: string }) => { + return createBlock(data.kind, data.title, data.content); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['blocks'] }); + }, + }); + + const openThread = (thread: string) => { + block.mutate({ kind: 2, title: 'Thread', content: thread }); + }; + return ( -
+
+ + - -
+
+
); diff --git a/src/shared/notes/actions/reply.tsx b/src/shared/notes/actions/reply.tsx index 8ab4b1a0..e391849d 100644 --- a/src/shared/notes/actions/reply.tsx +++ b/src/shared/notes/actions/reply.tsx @@ -4,15 +4,7 @@ import { ReplyIcon } from '@shared/icons'; import { useComposer } from '@stores/composer'; -export function NoteReply({ - id, - rootID, - pubkey, -}: { - id: string; - rootID?: string; - pubkey: string; -}) { +export function NoteReply({ id, pubkey }: { id: string; pubkey: string }) { const setReply = useComposer((state) => state.setReply); return ( @@ -20,7 +12,7 @@ export function NoteReply({
diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index 7ab7ff16..15f9759f 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -43,11 +43,7 @@ export function Repost({ event }: { event: LumeEvent }) {
- +
diff --git a/src/shared/notes/kinds/sub.tsx b/src/shared/notes/kinds/sub.tsx index 23b5e3b1..b9ff380e 100644 --- a/src/shared/notes/kinds/sub.tsx +++ b/src/shared/notes/kinds/sub.tsx @@ -31,7 +31,7 @@ export function SubNote({ id }: { id: string }) {
- +
diff --git a/src/shared/notes/kinds/thread.tsx b/src/shared/notes/kinds/thread.tsx index 5a6fd43a..bb30576d 100644 --- a/src/shared/notes/kinds/thread.tsx +++ b/src/shared/notes/kinds/thread.tsx @@ -28,11 +28,7 @@ export function NoteThread({
- +
diff --git a/src/shared/notes/kinds/unsupport.tsx b/src/shared/notes/kinds/unsupport.tsx index 1d9cec68..8566bb6d 100644 --- a/src/shared/notes/kinds/unsupport.tsx +++ b/src/shared/notes/kinds/unsupport.tsx @@ -25,11 +25,7 @@ export function NoteKindUnsupport({ event }: { event: LumeEvent }) {

{event.content.toString()}

- +
diff --git a/src/shared/notes/metadata.tsx b/src/shared/notes/metadata.tsx index b56de16d..5fa0a850 100644 --- a/src/shared/notes/metadata.tsx +++ b/src/shared/notes/metadata.tsx @@ -63,7 +63,7 @@ export function NoteMetadata({ id }: { id: string }) { ); const block = useMutation({ - mutationFn: (data: any) => { + mutationFn: (data: { kind: number; title: string; content: string }) => { return createBlock(data.kind, data.title, data.content); }, onSuccess: () => { diff --git a/src/shared/user.tsx b/src/shared/user.tsx index 37dcbb83..b6e164b7 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -2,6 +2,7 @@ import { Popover, Transition } from '@headlessui/react'; import { Fragment } from 'react'; import { Link } from 'react-router-dom'; +import { ChevronDownIcon, VerticalDotsIcon } from '@shared/icons'; import { Image } from '@shared/image'; import { DEFAULT_AVATAR } from '@stores/constants'; @@ -79,7 +80,15 @@ export function User({ user?.display_name || shortenKey(pubkey)}
- {createdAt} +
+ {createdAt} + +
void; - setReply: (id: string, root: string, pubkey: string) => void; + setReply: (id: string, pubkey: string) => void; clearReply: () => void; } @@ -14,11 +14,11 @@ export const useComposer = create((set) => ({ toggleModal: (status: boolean) => { set({ open: status }); }, - setReply: (id: string, root: string, pubkey: string) => { - set({ reply: { id: id, root: root, pubkey: pubkey } }); + setReply: (id: string, pubkey: string) => { + set({ reply: { id: id, pubkey: pubkey } }); set({ open: true }); }, clearReply: () => { - set({ reply: { id: null, root: null, pubkey: null } }); + set({ reply: { id: null, pubkey: null } }); }, })); From 5ce9fa515af30e67b57d1eed882369cbdecfddc7 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sun, 16 Jul 2023 15:46:01 +0700 Subject: [PATCH 06/37] add reaction --- package.json | 10 +- pnpm-lock.yaml | 396 ++++++++++++++------------ src/shared/notes/actions.tsx | 29 +- src/shared/notes/actions/reaction.tsx | 143 ++++++++-- src/shared/notes/content.tsx | 2 +- src/shared/notes/mentions/user.tsx | 2 +- 6 files changed, 373 insertions(+), 209 deletions(-) diff --git a/package.json b/package.json index 1344cecb..e89629df 100644 --- a/package.json +++ b/package.json @@ -17,18 +17,18 @@ }, "dependencies": { "@headlessui/react": "^1.7.15", - "@nostr-dev-kit/ndk": "^0.7.6", + "@nostr-dev-kit/ndk": "^0.7.7", "@nostr-fetch/adapter-ndk": "^0.11.0", "@radix-ui/react-popover": "^1.0.6", "@radix-ui/react-tooltip": "^1.0.6", - "@tanstack/react-query": "^4.29.19", - "@tanstack/react-query-devtools": "^4.29.19", + "@tanstack/react-query": "^4.29.25", + "@tanstack/react-query-devtools": "^4.29.25", "@tanstack/react-virtual": "3.0.0-beta.54", "@tauri-apps/api": "^1.4.0", "cheerio": "1.0.0-rc.12", "dayjs": "^1.11.9", "destr": "^1.2.2", - "framer-motion": "^10.12.20", + "framer-motion": "^10.12.21", "get-urls": "^11.0.0", "immer": "^10.0.2", "light-bolt11-decoder": "^3.0.0", @@ -68,7 +68,7 @@ "cross-env": "^7.0.3", "csstype": "^3.1.2", "encoding": "^0.1.13", - "eslint": "^8.44.0", + "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-react": "^7.32.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa41dbe5..c36382f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,11 +5,11 @@ dependencies: specifier: ^1.7.15 version: 1.7.15(react-dom@18.2.0)(react@18.2.0) '@nostr-dev-kit/ndk': - specifier: ^0.7.6 - version: 0.7.6(typescript@4.9.5) + specifier: ^0.7.7 + version: 0.7.7(typescript@4.9.5) '@nostr-fetch/adapter-ndk': specifier: ^0.11.0 - version: 0.11.0(@nostr-dev-kit/ndk@0.7.6)(nostr-fetch@0.11.0) + version: 0.11.0(@nostr-dev-kit/ndk@0.7.7)(nostr-fetch@0.11.0) '@radix-ui/react-popover': specifier: ^1.0.6 version: 1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) @@ -17,11 +17,11 @@ dependencies: specifier: ^1.0.6 version: 1.0.6(@types/react-dom@18.2.7)(@types/react@18.2.15)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': - specifier: ^4.29.19 - version: 4.29.19(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.29.25 + version: 4.29.25(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query-devtools': - specifier: ^4.29.19 - version: 4.29.19(@tanstack/react-query@4.29.19)(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.29.25 + version: 4.29.25(@tanstack/react-query@4.29.25)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-virtual': specifier: 3.0.0-beta.54 version: 3.0.0-beta.54(react@18.2.0) @@ -38,8 +38,8 @@ dependencies: specifier: ^1.2.2 version: 1.2.2 framer-motion: - specifier: ^10.12.20 - version: 10.12.20(react-dom@18.2.0)(react@18.2.0) + specifier: ^10.12.21 + version: 10.12.21(react-dom@18.2.0)(react@18.2.0) get-urls: specifier: ^11.0.0 version: 11.0.0 @@ -134,10 +134,10 @@ devDependencies: version: 5.5.7 '@typescript-eslint/eslint-plugin': specifier: ^5.62.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.44.0)(typescript@4.9.5) + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@4.9.5) '@typescript-eslint/parser': specifier: ^5.62.0 - version: 5.62.0(eslint@8.44.0)(typescript@4.9.5) + version: 5.62.0(eslint@8.45.0)(typescript@4.9.5) '@vitejs/plugin-react-swc': specifier: ^3.3.2 version: 3.3.2(vite@4.4.4) @@ -154,20 +154,20 @@ devDependencies: specifier: ^0.1.13 version: 0.1.13 eslint: - specifier: ^8.44.0 - version: 8.44.0 + specifier: ^8.45.0 + version: 8.45.0 eslint-config-prettier: specifier: ^8.8.0 - version: 8.8.0(eslint@8.44.0) + version: 8.8.0(eslint@8.45.0) eslint-plugin-jsx-a11y: specifier: ^6.7.1 - version: 6.7.1(eslint@8.44.0) + version: 6.7.1(eslint@8.45.0) eslint-plugin-react: specifier: ^7.32.2 - version: 7.32.2(eslint@8.44.0) + version: 7.32.2(eslint@8.45.0) eslint-plugin-simple-import-sort: specifier: ^10.0.0 - version: 10.0.0(eslint@8.44.0) + version: 10.0.0(eslint@8.45.0) husky: specifier: ^8.0.3 version: 8.0.3 @@ -352,8 +352,8 @@ packages: dev: false optional: true - /@esbuild/android-arm64@0.18.12: - resolution: {integrity: sha512-BMAlczRqC/LUt2P97E4apTBbkvS9JTJnp2DKFbCwpZ8vBvXVbNdqmvzW/OsdtI/+mGr+apkkpqGM8WecLkPgrA==} + /@esbuild/android-arm64@0.18.13: + resolution: {integrity: sha512-j7NhycJUoUAG5kAzGf4fPWfd17N6SM3o1X6MlXVqfHvs2buFraCJzos9vbeWjLxOyBKHyPOnuCuipbhvbYtTAg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -370,8 +370,8 @@ packages: dev: false optional: true - /@esbuild/android-arm@0.18.12: - resolution: {integrity: sha512-LIxaNIQfkFZbTLb4+cX7dozHlAbAshhFE5PKdro0l+FnCpx1GDJaQ2WMcqm+ToXKMt8p8Uojk/MFRuGyz3V5Sw==} + /@esbuild/android-arm@0.18.13: + resolution: {integrity: sha512-KwqFhxRFMKZINHzCqf8eKxE0XqWlAVPRxwy6rc7CbVFxzUWB2sA/s3hbMZeemPdhN3fKBkqOaFhTbS8xJXYIWQ==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -388,8 +388,8 @@ packages: dev: false optional: true - /@esbuild/android-x64@0.18.12: - resolution: {integrity: sha512-zU5MyluNsykf5cOJ0LZZZjgAHbhPJ1cWfdH1ZXVMXxVMhEV0VZiZXQdwBBVvmvbF28EizeK7obG9fs+fpmS0eQ==} + /@esbuild/android-x64@0.18.13: + resolution: {integrity: sha512-M2eZkRxR6WnWfVELHmv6MUoHbOqnzoTVSIxgtsyhm/NsgmL+uTmag/VVzdXvmahak1I6sOb1K/2movco5ikDJg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -406,8 +406,8 @@ packages: dev: false optional: true - /@esbuild/darwin-arm64@0.18.12: - resolution: {integrity: sha512-zUZMep7YONnp6954QOOwEBwFX9svlKd3ov6PkxKd53LGTHsp/gy7vHaPGhhjBmEpqXEXShi6dddjIkmd+NgMsA==} + /@esbuild/darwin-arm64@0.18.13: + resolution: {integrity: sha512-f5goG30YgR1GU+fxtaBRdSW3SBG9pZW834Mmhxa6terzcboz7P2R0k4lDxlkP7NYRIIdBbWp+VgwQbmMH4yV7w==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -424,8 +424,8 @@ packages: dev: false optional: true - /@esbuild/darwin-x64@0.18.12: - resolution: {integrity: sha512-ohqLPc7i67yunArPj1+/FeeJ7AgwAjHqKZ512ADk3WsE3FHU9l+m5aa7NdxXr0HmN1bjDlUslBjWNbFlD9y12Q==} + /@esbuild/darwin-x64@0.18.13: + resolution: {integrity: sha512-RIrxoKH5Eo+yE5BtaAIMZaiKutPhZjw+j0OCh8WdvKEKJQteacq0myZvBDLU+hOzQOZWJeDnuQ2xgSScKf1Ovw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -442,8 +442,8 @@ packages: dev: false optional: true - /@esbuild/freebsd-arm64@0.18.12: - resolution: {integrity: sha512-GIIHtQXqgeOOqdG16a/A9N28GpkvjJnjYMhOnXVbn3EDJcoItdR58v/pGN31CHjyXDc8uCcRnFWmqaJt24AYJg==} + /@esbuild/freebsd-arm64@0.18.13: + resolution: {integrity: sha512-AfRPhHWmj9jGyLgW/2FkYERKmYR+IjYxf2rtSLmhOrPGFh0KCETFzSjx/JX/HJnvIqHt/DRQD/KAaVsUKoI3Xg==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -460,8 +460,8 @@ packages: dev: false optional: true - /@esbuild/freebsd-x64@0.18.12: - resolution: {integrity: sha512-zK0b9a1/0wZY+6FdOS3BpZcPc1kcx2G5yxxfEJtEUzVxI6n/FrC2Phsxj/YblPuBchhBZ/1wwn7AyEBUyNSa6g==} + /@esbuild/freebsd-x64@0.18.13: + resolution: {integrity: sha512-pGzWWZJBInhIgdEwzn8VHUBang8UvFKsvjDkeJ2oyY5gZtAM6BaxK0QLCuZY+qoj/nx/lIaItH425rm/hloETA==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -478,8 +478,8 @@ packages: dev: false optional: true - /@esbuild/linux-arm64@0.18.12: - resolution: {integrity: sha512-JKgG8Q/LL/9sw/iHHxQyVMoQYu3rU3+a5Z87DxC+wAu3engz+EmctIrV+FGOgI6gWG1z1+5nDDbXiRMGQZXqiw==} + /@esbuild/linux-arm64@0.18.13: + resolution: {integrity: sha512-hCzZbVJEHV7QM77fHPv2qgBcWxgglGFGCxk6KfQx6PsVIdi1u09X7IvgE9QKqm38OpkzaAkPnnPqwRsltvLkIQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -496,8 +496,8 @@ packages: dev: false optional: true - /@esbuild/linux-arm@0.18.12: - resolution: {integrity: sha512-y75OijvrBE/1XRrXq1jtrJfG26eHeMoqLJ2dwQNwviwTuTtHGCojsDO6BJNF8gU+3jTn1KzJEMETytwsFSvc+Q==} + /@esbuild/linux-arm@0.18.13: + resolution: {integrity: sha512-4iMxLRMCxGyk7lEvkkvrxw4aJeC93YIIrfbBlUJ062kilUUnAiMb81eEkVvCVoh3ON283ans7+OQkuy1uHW+Hw==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -514,8 +514,8 @@ packages: dev: false optional: true - /@esbuild/linux-ia32@0.18.12: - resolution: {integrity: sha512-yoRIAqc0B4lDIAAEFEIu9ttTRFV84iuAl0KNCN6MhKLxNPfzwCBvEMgwco2f71GxmpBcTtn7KdErueZaM2rEvw==} + /@esbuild/linux-ia32@0.18.13: + resolution: {integrity: sha512-I3OKGbynl3AAIO6onXNrup/ttToE6Rv2XYfFgLK/wnr2J+1g+7k4asLrE+n7VMhaqX+BUnyWkCu27rl+62Adug==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -532,8 +532,8 @@ packages: dev: false optional: true - /@esbuild/linux-loong64@0.18.12: - resolution: {integrity: sha512-qYgt3dHPVvf/MgbIBpJ4Sup/yb9DAopZ3a2JgMpNKIHUpOdnJ2eHBo/aQdnd8dJ21X/+sS58wxHtA9lEazYtXQ==} + /@esbuild/linux-loong64@0.18.13: + resolution: {integrity: sha512-8pcKDApAsKc6WW51ZEVidSGwGbebYw2qKnO1VyD8xd6JN0RN6EUXfhXmDk9Vc4/U3Y4AoFTexQewQDJGsBXBpg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -550,8 +550,8 @@ packages: dev: false optional: true - /@esbuild/linux-mips64el@0.18.12: - resolution: {integrity: sha512-wHphlMLK4ufNOONqukELfVIbnGQJrHJ/mxZMMrP2jYrPgCRZhOtf0kC4yAXBwnfmULimV1qt5UJJOw4Kh13Yfg==} + /@esbuild/linux-mips64el@0.18.13: + resolution: {integrity: sha512-6GU+J1PLiVqWx8yoCK4Z0GnfKyCGIH5L2KQipxOtbNPBs+qNDcMJr9euxnyJ6FkRPyMwaSkjejzPSISD9hb+gg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -568,8 +568,8 @@ packages: dev: false optional: true - /@esbuild/linux-ppc64@0.18.12: - resolution: {integrity: sha512-TeN//1Ft20ZZW41+zDSdOI/Os1bEq5dbvBvYkberB7PHABbRcsteeoNVZFlI0YLpGdlBqohEpjrn06kv8heCJg==} + /@esbuild/linux-ppc64@0.18.13: + resolution: {integrity: sha512-pfn/OGZ8tyR8YCV7MlLl5hAit2cmS+j/ZZg9DdH0uxdCoJpV7+5DbuXrR+es4ayRVKIcfS9TTMCs60vqQDmh+w==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -586,8 +586,8 @@ packages: dev: false optional: true - /@esbuild/linux-riscv64@0.18.12: - resolution: {integrity: sha512-AgUebVS4DoAblBgiB2ACQ/8l4eGE5aWBb8ZXtkXHiET9mbj7GuWt3OnsIW/zX+XHJt2RYJZctbQ2S/mDjbp0UA==} + /@esbuild/linux-riscv64@0.18.13: + resolution: {integrity: sha512-aIbhU3LPg0lOSCfVeGHbmGYIqOtW6+yzO+Nfv57YblEK01oj0mFMtvDJlOaeAZ6z0FZ9D13oahi5aIl9JFphGg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -604,8 +604,8 @@ packages: dev: false optional: true - /@esbuild/linux-s390x@0.18.12: - resolution: {integrity: sha512-dJ3Rb3Ei2u/ysSXd6pzleGtfDdc2MuzKt8qc6ls8vreP1G3B7HInX3i7gXS4BGeVd24pp0yqyS7bJ5NHaI9ing==} + /@esbuild/linux-s390x@0.18.13: + resolution: {integrity: sha512-Pct1QwF2sp+5LVi4Iu5Y+6JsGaV2Z2vm4O9Dd7XZ5tKYxEHjFtb140fiMcl5HM1iuv6xXO8O1Vrb1iJxHlv8UA==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -622,8 +622,8 @@ packages: dev: false optional: true - /@esbuild/linux-x64@0.18.12: - resolution: {integrity: sha512-OrNJMGQbPaVyHHcDF8ybNSwu7TDOfX8NGpXCbetwOSP6txOJiWlgQnRymfC9ocR1S0Y5PW0Wb1mV6pUddqmvmQ==} + /@esbuild/linux-x64@0.18.13: + resolution: {integrity: sha512-zTrIP0KzYP7O0+3ZnmzvUKgGtUvf4+piY8PIO3V8/GfmVd3ZyHJGz7Ht0np3P1wz+I8qJ4rjwJKqqEAbIEPngA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -640,8 +640,8 @@ packages: dev: false optional: true - /@esbuild/netbsd-x64@0.18.12: - resolution: {integrity: sha512-55FzVCAiwE9FK8wWeCRuvjazNRJ1QqLCYGZVB6E8RuQuTeStSwotpSW4xoRGwp3a1wUsaVCdYcj5LGCASVJmMg==} + /@esbuild/netbsd-x64@0.18.13: + resolution: {integrity: sha512-I6zs10TZeaHDYoGxENuksxE1sxqZpCp+agYeW039yqFwh3MgVvdmXL5NMveImOC6AtpLvE4xG5ujVic4NWFIDQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -658,8 +658,8 @@ packages: dev: false optional: true - /@esbuild/openbsd-x64@0.18.12: - resolution: {integrity: sha512-qnluf8rfb6Y5Lw2tirfK2quZOBbVqmwxut7GPCIJsM8lc4AEUj9L8y0YPdLaPK0TECt4IdyBdBD/KRFKorlK3g==} + /@esbuild/openbsd-x64@0.18.13: + resolution: {integrity: sha512-W5C5nczhrt1y1xPG5bV+0M12p2vetOGlvs43LH8SopQ3z2AseIROu09VgRqydx5qFN7y9qCbpgHLx0kb0TcW7g==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -676,8 +676,8 @@ packages: dev: false optional: true - /@esbuild/sunos-x64@0.18.12: - resolution: {integrity: sha512-+RkKpVQR7bICjTOPUpkTBTaJ4TFqQBX5Ywyd/HSdDkQGn65VPkTsR/pL4AMvuMWy+wnXgIl4EY6q4mVpJal8Kg==} + /@esbuild/sunos-x64@0.18.13: + resolution: {integrity: sha512-X/xzuw4Hzpo/yq3YsfBbIsipNgmsm8mE/QeWbdGdTTeZ77fjxI2K0KP3AlhZ6gU3zKTw1bKoZTuKLnqcJ537qw==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -694,8 +694,8 @@ packages: dev: false optional: true - /@esbuild/win32-arm64@0.18.12: - resolution: {integrity: sha512-GNHuciv0mFM7ouzsU0+AwY+7eV4Mgo5WnbhfDCQGtpvOtD1vbOiRjPYG6dhmMoFyBjj+pNqQu2X+7DKn0KQ/Gw==} + /@esbuild/win32-arm64@0.18.13: + resolution: {integrity: sha512-4CGYdRQT/ILd+yLLE5i4VApMPfGE0RPc/wFQhlluDQCK09+b4JDbxzzjpgQqTPrdnP7r5KUtGVGZYclYiPuHrw==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -712,8 +712,8 @@ packages: dev: false optional: true - /@esbuild/win32-ia32@0.18.12: - resolution: {integrity: sha512-kR8cezhYipbbypGkaqCTWIeu4zID17gamC8YTPXYtcN3E5BhhtTnwKBn9I0PJur/T6UVwIEGYzkffNL0lFvxEw==} + /@esbuild/win32-ia32@0.18.13: + resolution: {integrity: sha512-D+wKZaRhQI+MUGMH+DbEr4owC2D7XnF+uyGiZk38QbgzLcofFqIOwFs7ELmIeU45CQgfHNy9Q+LKW3cE8g37Kg==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -730,8 +730,8 @@ packages: dev: false optional: true - /@esbuild/win32-x64@0.18.12: - resolution: {integrity: sha512-O0UYQVkvfM/jO8a4OwoV0mAKSJw+mjWTAd1MJd/1FCX6uiMdLmMRPK/w6e9OQ0ob2WGxzIm9va/KG0Ja4zIOgg==} + /@esbuild/win32-x64@0.18.13: + resolution: {integrity: sha512-iVl6lehAfJS+VmpF3exKpNQ8b0eucf5VWfzR8S7xFve64NBNz2jPUgx1X93/kfnkfgP737O+i1k54SVQS7uVZA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -739,13 +739,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.44.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.45.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.44.0 + eslint: 8.45.0 eslint-visitor-keys: 3.4.1 /@eslint-community/regexpp@4.5.1: @@ -758,7 +758,7 @@ packages: dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.6.0 + espree: 9.6.1 globals: 13.20.0 ignore: 5.2.4 import-fresh: 3.3.0 @@ -920,20 +920,20 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@nostr-dev-kit/ndk@0.7.6(typescript@4.9.5): - resolution: {integrity: sha512-eZph117ErfsIrLeap8OD0flwesPPPp6p14z30Ci+3DnQWVqpuB84BefxvgRPQUfKxgV49Yl77NnrtE2sF4yuSA==} + /@nostr-dev-kit/ndk@0.7.7(typescript@4.9.5): + resolution: {integrity: sha512-IRTW16q40zzuSBkpYpDUcZJRrbw26JTeicfZN6O/2Gw7D2w6Pe42VqFwpbcP9xOnFPEGP2eNV6SwXQ3y0tjBtw==} dependencies: '@noble/hashes': 1.3.1 '@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.44.0)(typescript@4.9.5) - '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@4.9.5) debug: 4.3.4 esbuild: 0.17.19 esbuild-plugin-alias: 0.2.1 - eslint: 8.44.0 - eslint-config-prettier: 8.8.0(eslint@8.44.0) - eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.44.0) + eslint: 8.45.0 + eslint-config-prettier: 8.8.0(eslint@8.45.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.45.0) esm-loader-typescript: 1.0.5 eventemitter3: 5.0.1 light-bolt11-decoder: 3.0.0 @@ -949,13 +949,13 @@ packages: - typescript dev: false - /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.7.6)(nostr-fetch@0.11.0): + /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.7.7)(nostr-fetch@0.11.0): resolution: {integrity: sha512-Otl7SEzm9ecqyHB10bpYXBu1qpqJEnipp7dZ4qcA9LeJAtM38fnYKUD34HX0JXA9EDjtc6VS5UNZe544xC9GCg==} peerDependencies: '@nostr-dev-kit/ndk': ^0.5.0 nostr-fetch: ^0.11.0 dependencies: - '@nostr-dev-kit/ndk': 0.7.6(typescript@4.9.5) + '@nostr-dev-kit/ndk': 0.7.7(typescript@4.9.5) '@nostr-fetch/kernel': 0.11.0 nostr-fetch: 0.11.0 dev: false @@ -1573,27 +1573,27 @@ packages: remove-accents: 0.4.2 dev: false - /@tanstack/query-core@4.29.19: - resolution: {integrity: sha512-uPe1DukeIpIHpQi6UzIgBcXsjjsDaLnc7hF+zLBKnaUlh7jFE/A+P8t4cU4VzKPMFB/C970n/9SxtpO5hmIRgw==} + /@tanstack/query-core@4.29.25: + resolution: {integrity: sha512-DI4y4VC6Uw4wlTpOocEXDky69xeOScME1ezLKsj+hOk7DguC9fkqXtp6Hn39BVb9y0b5IBrY67q6kIX623Zj4Q==} dev: false - /@tanstack/react-query-devtools@4.29.19(@tanstack/react-query@4.29.19)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-rL2xqTPr+7gJvVGwyq8E8CWqqw950N4lZ6ffJeNX0qqymKHxHW1FM6nZaYt7Aufs/bXH0m1L9Sj3kDGQbp0rwg==} + /@tanstack/react-query-devtools@4.29.25(@tanstack/react-query@4.29.25)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-XlrGUqmjv1O+6Ny23rAiyNSWYKep90SKT3IixDQRnIuTGaZej+hVCOh7wZSxq6qkzadIvsblc4SLtyJsOiIXBQ==} peerDependencies: - '@tanstack/react-query': 4.29.19 + '@tanstack/react-query': 4.29.25 react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: '@tanstack/match-sorter-utils': 8.8.4 - '@tanstack/react-query': 4.29.19(react-dom@18.2.0)(react@18.2.0) + '@tanstack/react-query': 4.29.25(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.4 use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /@tanstack/react-query@4.29.19(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-XiTIOHHQ5Cw1WUlHaD4fmVUMhoWjuNJlAeJGq7eM4BraI5z7y8WkZO+NR8PSuRnQGblpuVdjClQbDFtwxTtTUw==} + /@tanstack/react-query@4.29.25(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-c1+Ezu+XboYrdAMdusK2fTdRqXPMgPAnyoTrzHOZQqr8Hqz6PNvV9DSKl8agUo6nXX4np7fdWabIprt+838dLg==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -1604,7 +1604,7 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.29.19 + '@tanstack/query-core': 4.29.25 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) use-sync-external-store: 1.2.0(react@18.2.0) @@ -1853,7 +1853,7 @@ packages: resolution: {integrity: sha512-W8F4eoTIvzXeNrT3JroQPimZLXnlJA8smYygHZUKFPVoYwgs/OhJkA1VBhL3iSs57OQkuINqHlY4SmMT5wtnJg==} dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.44.0)(typescript@4.9.5): + /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@4.9.5): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1865,12 +1865,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@4.9.5) '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.44.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/type-utils': 5.62.0(eslint@8.45.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@4.9.5) debug: 4.3.4 - eslint: 8.44.0 + eslint: 8.45.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare-lite: 1.4.0 @@ -1880,7 +1880,7 @@ packages: transitivePeerDependencies: - supports-color - /@typescript-eslint/parser@5.62.0(eslint@8.44.0)(typescript@4.9.5): + /@typescript-eslint/parser@5.62.0(eslint@8.45.0)(typescript@4.9.5): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1894,7 +1894,7 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) debug: 4.3.4 - eslint: 8.44.0 + eslint: 8.45.0 typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -1906,7 +1906,7 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - /@typescript-eslint/type-utils@5.62.0(eslint@8.44.0)(typescript@4.9.5): + /@typescript-eslint/type-utils@5.62.0(eslint@8.45.0)(typescript@4.9.5): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1917,9 +1917,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/utils': 5.62.0(eslint@8.45.0)(typescript@4.9.5) debug: 4.3.4 - eslint: 8.44.0 + eslint: 8.45.0 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: @@ -1949,19 +1949,19 @@ packages: transitivePeerDependencies: - supports-color - /@typescript-eslint/utils@5.62.0(eslint@8.44.0)(typescript@4.9.5): + /@typescript-eslint/utils@5.62.0(eslint@8.45.0)(typescript@4.9.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) '@types/json-schema': 7.0.12 '@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@4.9.5) - eslint: 8.44.0 + eslint: 8.45.0 eslint-scope: 5.1.1 semver: 7.5.4 transitivePeerDependencies: @@ -2128,7 +2128,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 get-intrinsic: 1.2.1 is-string: 1.0.7 @@ -2142,7 +2142,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 /array.prototype.flatmap@1.3.1: @@ -2151,7 +2151,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 /array.prototype.tosorted@1.1.1: @@ -2159,11 +2159,22 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 get-intrinsic: 1.2.1 dev: true + /arraybuffer.prototype.slice@1.0.1: + resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.2 + define-properties: 1.2.0 + get-intrinsic: 1.2.1 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} @@ -2186,7 +2197,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.9 - caniuse-lite: 1.0.30001515 + caniuse-lite: 1.0.30001516 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -2248,8 +2259,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001515 - electron-to-chromium: 1.4.460 + caniuse-lite: 1.0.30001516 + electron-to-chromium: 1.4.461 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -2309,8 +2320,8 @@ packages: engines: {node: '>=6'} dev: false - /caniuse-lite@1.0.30001515: - resolution: {integrity: sha512-eEFDwUOZbE24sb+Ecsx3+OvNETqjWIdabMy52oOkIgcUtAsQifjUG9q4U9dgTHJM2mfk4uEPxc0+xuFdJ629QA==} + /caniuse-lite@1.0.30001516: + resolution: {integrity: sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g==} dev: true /ccount@2.0.1: @@ -2711,8 +2722,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.460: - resolution: {integrity: sha512-kKiHnbrHME7z8E6AYaw0ehyxY5+hdaRmeUbjBO22LZMdqTYCO29EvF0T1cQ3pJ1RN5fyMcHl1Lmcsdt9WWJpJQ==} + /electron-to-chromium@1.4.461: + resolution: {integrity: sha512-1JkvV2sgEGTDXjdsaQCeSwYYuhLRphRpc+g6EHTFELJXEiznLt3/0pZ9JuAOQ5p2rI3YxKTbivtvajirIfhrEQ==} dev: true /emoji-regex@8.0.0: @@ -2746,11 +2757,12 @@ packages: is-arrayish: 0.2.1 dev: false - /es-abstract@1.21.3: - resolution: {integrity: sha512-ZU4miiY1j3sGPFLJ34VJXEqhpmL+HGByCinGHv4HC+Fxl2fI2Z4yR6tl0mORnDr6PA8eihWo4LmSWDbvhALckg==} + /es-abstract@1.22.1: + resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.1 available-typed-arrays: 1.0.5 call-bind: 1.0.2 es-set-tostringtag: 2.0.1 @@ -2777,10 +2789,13 @@ packages: object-keys: 1.1.1 object.assign: 4.1.4 regexp.prototype.flags: 1.5.0 + safe-array-concat: 1.0.0 safe-regex-test: 1.0.0 string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 typed-array-byte-offset: 1.0.0 typed-array-length: 1.0.4 unbox-primitive: 1.0.2 @@ -2866,34 +2881,34 @@ packages: '@esbuild/win32-x64': 0.17.19 dev: false - /esbuild@0.18.12: - resolution: {integrity: sha512-XuOVLDdtsDslXStStduT41op21Ytmf4/BDS46aa3xPJ7X5h2eMWBF1oAe3QjUH3bDksocNXgzGUZ7XHIBya6Tg==} + /esbuild@0.18.13: + resolution: {integrity: sha512-vhg/WR/Oiu4oUIkVhmfcc23G6/zWuEQKFS+yiosSHe4aN6+DQRXIfeloYGibIfVhkr4wyfuVsGNLr+sQU1rWWw==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.12 - '@esbuild/android-arm64': 0.18.12 - '@esbuild/android-x64': 0.18.12 - '@esbuild/darwin-arm64': 0.18.12 - '@esbuild/darwin-x64': 0.18.12 - '@esbuild/freebsd-arm64': 0.18.12 - '@esbuild/freebsd-x64': 0.18.12 - '@esbuild/linux-arm': 0.18.12 - '@esbuild/linux-arm64': 0.18.12 - '@esbuild/linux-ia32': 0.18.12 - '@esbuild/linux-loong64': 0.18.12 - '@esbuild/linux-mips64el': 0.18.12 - '@esbuild/linux-ppc64': 0.18.12 - '@esbuild/linux-riscv64': 0.18.12 - '@esbuild/linux-s390x': 0.18.12 - '@esbuild/linux-x64': 0.18.12 - '@esbuild/netbsd-x64': 0.18.12 - '@esbuild/openbsd-x64': 0.18.12 - '@esbuild/sunos-x64': 0.18.12 - '@esbuild/win32-arm64': 0.18.12 - '@esbuild/win32-ia32': 0.18.12 - '@esbuild/win32-x64': 0.18.12 + '@esbuild/android-arm': 0.18.13 + '@esbuild/android-arm64': 0.18.13 + '@esbuild/android-x64': 0.18.13 + '@esbuild/darwin-arm64': 0.18.13 + '@esbuild/darwin-x64': 0.18.13 + '@esbuild/freebsd-arm64': 0.18.13 + '@esbuild/freebsd-x64': 0.18.13 + '@esbuild/linux-arm': 0.18.13 + '@esbuild/linux-arm64': 0.18.13 + '@esbuild/linux-ia32': 0.18.13 + '@esbuild/linux-loong64': 0.18.13 + '@esbuild/linux-mips64el': 0.18.13 + '@esbuild/linux-ppc64': 0.18.13 + '@esbuild/linux-riscv64': 0.18.13 + '@esbuild/linux-s390x': 0.18.13 + '@esbuild/linux-x64': 0.18.13 + '@esbuild/netbsd-x64': 0.18.13 + '@esbuild/openbsd-x64': 0.18.13 + '@esbuild/sunos-x64': 0.18.13 + '@esbuild/win32-arm64': 0.18.13 + '@esbuild/win32-ia32': 0.18.13 + '@esbuild/win32-x64': 0.18.13 dev: true /escalade@3.1.1: @@ -2914,13 +2929,13 @@ packages: engines: {node: '>=12'} dev: false - /eslint-config-prettier@8.8.0(eslint@8.44.0): + /eslint-config-prettier@8.8.0(eslint@8.45.0): resolution: {integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.44.0 + eslint: 8.45.0 /eslint-formatter-pretty@4.1.0: resolution: {integrity: sha512-IsUTtGxF1hrH6lMWiSl1WbGaiP01eT6kzywdY1U+zLc0MP+nwEnUiS9UI8IaOTUhTeQJLlCEWIbXINBH4YJbBQ==} @@ -2946,7 +2961,7 @@ packages: - supports-color dev: false - /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint@8.45.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -2967,15 +2982,15 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@4.9.5) debug: 3.2.7 - eslint: 8.44.0 + eslint: 8.45.0 eslint-import-resolver-node: 0.3.7 transitivePeerDependencies: - supports-color dev: false - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.44.0): + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.62.0)(eslint@8.45.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -2985,15 +3000,15 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.44.0)(typescript@4.9.5) + '@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@4.9.5) array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.44.0 + eslint: 8.45.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint@8.44.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint@8.45.0) has: 1.0.3 is-core-module: 2.12.1 is-glob: 4.0.3 @@ -3008,7 +3023,7 @@ packages: - supports-color dev: false - /eslint-plugin-jsx-a11y@6.7.1(eslint@8.44.0): + /eslint-plugin-jsx-a11y@6.7.1(eslint@8.45.0): resolution: {integrity: sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==} engines: {node: '>=4.0'} peerDependencies: @@ -3023,7 +3038,7 @@ packages: axobject-query: 3.2.1 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - eslint: 8.44.0 + eslint: 8.45.0 has: 1.0.3 jsx-ast-utils: 3.3.4 language-tags: 1.0.5 @@ -3033,7 +3048,7 @@ packages: semver: 6.3.1 dev: true - /eslint-plugin-react@7.32.2(eslint@8.44.0): + /eslint-plugin-react@7.32.2(eslint@8.45.0): resolution: {integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==} engines: {node: '>=4'} peerDependencies: @@ -3043,7 +3058,7 @@ packages: array.prototype.flatmap: 1.3.1 array.prototype.tosorted: 1.1.1 doctrine: 2.1.0 - eslint: 8.44.0 + eslint: 8.45.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.4 minimatch: 3.1.2 @@ -3057,12 +3072,12 @@ packages: string.prototype.matchall: 4.0.8 dev: true - /eslint-plugin-simple-import-sort@10.0.0(eslint@8.44.0): + /eslint-plugin-simple-import-sort@10.0.0(eslint@8.45.0): resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==} peerDependencies: eslint: '>=5.0.0' dependencies: - eslint: 8.44.0 + eslint: 8.45.0 dev: true /eslint-rule-docs@1.1.235: @@ -3076,8 +3091,8 @@ packages: esrecurse: 4.3.0 estraverse: 4.3.0 - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + /eslint-scope@7.2.1: + resolution: {integrity: sha512-CvefSOsDdaYYvxChovdrPo/ZGt8d5lrJWleAc1diXRKhHGiTYEI26cvo8Kle/wGnsizoCJjK73FMg1/IkIwiNA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 @@ -3087,12 +3102,12 @@ packages: resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint@8.44.0: - resolution: {integrity: sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==} + /eslint@8.45.0: + resolution: {integrity: sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0) '@eslint-community/regexpp': 4.5.1 '@eslint/eslintrc': 2.1.0 '@eslint/js': 8.44.0 @@ -3105,9 +3120,9 @@ packages: debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 + eslint-scope: 7.2.1 eslint-visitor-keys: 3.4.1 - espree: 9.6.0 + espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -3117,7 +3132,6 @@ packages: globals: 13.20.0 graphemer: 1.4.0 ignore: 5.2.4 - import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -3129,7 +3143,6 @@ packages: natural-compare: 1.4.0 optionator: 0.9.3 strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color @@ -3143,8 +3156,8 @@ packages: typescript: 5.1.6 dev: false - /espree@9.6.0: - resolution: {integrity: sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==} + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: acorn: 8.10.0 @@ -3301,8 +3314,8 @@ packages: resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} dev: true - /framer-motion@10.12.20(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-O4ODHTlov2cGHWjtMSuZhm2wX0eM33VK8+vCxren2uw9g3k/RubPCa0/tT6PtLzCvYgAhgKmaczVbY2qEJVWOw==} + /framer-motion@10.12.21(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-EmnP73O5+1OGm2jtQNoBPPuAJvhySl+p4/9PL7PPJHt58nkPWeFaxhCJaUDXDf6N3jSLluefxopc0FrMCQ+/tQ==} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 @@ -3353,7 +3366,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 functions-have-names: 1.2.3 /functions-have-names@1.2.3: @@ -3856,6 +3869,9 @@ packages: engines: {node: '>=12.13'} dev: false + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -4892,7 +4908,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 dev: true /object.fromentries@2.0.6: @@ -4901,14 +4917,14 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 dev: true /object.hasown@1.1.2: resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==} dependencies: define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 dev: true /object.values@1.1.6: @@ -4917,7 +4933,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} @@ -5659,6 +5675,15 @@ packages: mri: 1.2.0 dev: false + /safe-array-concat@1.0.0: + resolution: {integrity: sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + has-symbols: 1.0.3 + isarray: 2.0.5 + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false @@ -5907,7 +5932,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 get-intrinsic: 1.2.1 has-symbols: 1.0.3 internal-slot: 1.0.5 @@ -5921,7 +5946,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 dev: false /string.prototype.trim@1.2.7: @@ -5930,21 +5955,21 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.3 + es-abstract: 1.22.1 /string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} @@ -5991,8 +6016,8 @@ packages: inline-style-parser: 0.1.1 dev: false - /sucrase@3.32.0: - resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} + /sucrase@3.33.0: + resolution: {integrity: sha512-ARGC7vbufOHfpvyGcZZXFaXCMZ9A4fffOGC5ucOW7+WHDGlAe8LJdf3Jts1sWhDeiI1RSWrKy5Hodl+JWGdW2A==} engines: {node: '>=8'} hasBin: true dependencies: @@ -6066,7 +6091,7 @@ packages: postcss-nested: 6.0.1(postcss@8.4.26) postcss-selector-parser: 6.0.13 resolve: 1.22.2 - sucrase: 3.32.0 + sucrase: 3.33.0 transitivePeerDependencies: - ts-node dev: true @@ -6144,8 +6169,8 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /tsconfck@2.1.1(typescript@4.9.5): - resolution: {integrity: sha512-ZPCkJBKASZBmBUNqGHmRhdhM8pJYDdOXp4nRgj/O0JwUwsMq50lCDRQP/M5GBNAA0elPrq4gAeu4dkaVCuKWww==} + /tsconfck@2.1.2(typescript@4.9.5): + resolution: {integrity: sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==} engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true peerDependencies: @@ -6236,6 +6261,23 @@ packages: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} dev: false + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + is-typed-array: 1.1.10 + + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.10 + /typed-array-byte-offset@1.0.0: resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} engines: {node: '>= 0.4'} @@ -6489,7 +6531,7 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 2.1.1(typescript@4.9.5) + tsconfck: 2.1.2(typescript@4.9.5) vite: 4.4.4(@types/node@18.16.19) transitivePeerDependencies: - supports-color @@ -6525,7 +6567,7 @@ packages: optional: true dependencies: '@types/node': 18.16.19 - esbuild: 0.18.12 + esbuild: 0.18.13 postcss: 8.4.26 rollup: 3.26.2 optionalDependencies: diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index 6846de61..cba308bd 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -30,18 +30,31 @@ export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) {
+ -
- + + + + + + + Open thread + + + +
); diff --git a/src/shared/notes/actions/reaction.tsx b/src/shared/notes/actions/reaction.tsx index bf374c21..48ec3e6b 100644 --- a/src/shared/notes/actions/reaction.tsx +++ b/src/shared/notes/actions/reaction.tsx @@ -1,32 +1,141 @@ -import * as Tooltip from '@radix-ui/react-tooltip'; +import * as Popover from '@radix-ui/react-popover'; +import { useCallback, useEffect, useState } from 'react'; import { ReactionIcon } from '@shared/icons'; -export function NoteReaction() { - const submit = async () => { - console.log('todo'); +import { usePublish } from '@utils/hooks/usePublish'; + +const REACTIONS = [ + { + content: '👏', + img: 'https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Hand%20gestures/Clapping%20Hands.png', + }, + { + content: '🤪', + img: 'https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Face%20with%20Tongue.png', + }, + { + content: '😮', + img: 'https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Face%20with%20Open%20Mouth.png', + }, + { + content: '😢', + img: 'https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Crying%20Face.png', + }, + { + content: '🤡', + img: 'https://raw.githubusercontent.com/Tarikul-Islam-Anik/Animated-Fluent-Emojis/master/Emojis/Smilies/Clown%20Face.png', + }, +]; + +export function NoteReaction({ id, pubkey }: { id: string; pubkey: string }) { + const [open, setOpen] = useState(false); + const [reaction, setReaction] = useState(null); + + const publish = usePublish(); + + const getReactionImage = (content: string) => { + const reaction: { img: string } = REACTIONS.find((el) => el.content === content); + return reaction.img; + }; + + const react = async (content: string) => { + setReaction(content); + + const event = await publish({ + content: content, + kind: 7, + tags: [ + ['e', id], + ['p', pubkey], + ], + }); + + if (event) { + setOpen(false); + } }; return ( - - + + - - - + + - Reaction - - - - +
+ + + + + +
+ + + + ); } diff --git a/src/shared/notes/content.tsx b/src/shared/notes/content.tsx index a3c4c0ea..fe728ef3 100644 --- a/src/shared/notes/content.tsx +++ b/src/shared/notes/content.tsx @@ -34,7 +34,7 @@ export function NoteContent({ return ( diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index 49fcf80f..d2e9bd36 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -7,7 +7,7 @@ export function MentionUser({ pubkey }: { pubkey: string }) { return ( From 9a09a04a5d6612cab9b737050426d2669b0eba35 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:25:58 +0700 Subject: [PATCH 07/37] add strangers section to chats sidebar --- src/app/chat/components/list.tsx | 26 +++++++++++++++++++------- src/app/chat/components/modal.tsx | 2 +- src/libs/storage.tsx | 27 +++++++++++++++++++++++---- src/shared/icons/index.tsx | 1 + src/shared/icons/strangers.tsx | 22 ++++++++++++++++++++++ src/utils/types.d.ts | 17 +++++++++++++++++ src/utils/types.ts | 6 ------ 7 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 src/shared/icons/strangers.tsx create mode 100644 src/utils/types.d.ts delete mode 100644 src/utils/types.ts diff --git a/src/app/chat/components/list.tsx b/src/app/chat/components/list.tsx index ee53e31e..b4ffed92 100644 --- a/src/app/chat/components/list.tsx +++ b/src/app/chat/components/list.tsx @@ -6,7 +6,10 @@ import { ChatsListSelfItem } from '@app/chat/components/self'; import { getChats } from '@libs/storage'; +import { StrangersIcon } from '@shared/icons'; + import { useAccount } from '@utils/hooks/useAccount'; +import { compactNumber } from '@utils/number'; export function ChatsList() { const { account } = useAccount(); @@ -15,11 +18,7 @@ export function ChatsList() { data: chats, isFetching, } = useQuery(['chats'], async () => { - const chats = await getChats(); - const sorted = chats.sort( - (a, b) => parseInt(a.new_messages) - parseInt(b.new_messages) - ); - return sorted; + return await getChats(); }); if (status === 'loading') { @@ -39,7 +38,6 @@ export function ChatsList() { return (
- {account ? ( ) : ( @@ -48,11 +46,25 @@ export function ChatsList() {
)} - {chats.map((item) => { + {chats.follows.map((item) => { if (account.pubkey !== item.sender_pubkey) { return ; } })} + + {isFetching && (
diff --git a/src/app/chat/components/modal.tsx b/src/app/chat/components/modal.tsx index ced45948..018c3210 100644 --- a/src/app/chat/components/modal.tsx +++ b/src/app/chat/components/modal.tsx @@ -36,7 +36,7 @@ export function NewMessageModal() { className="inline-flex h-9 items-center gap-2.5 rounded-md px-2.5" >
- +
New chat
diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index 4c7735cf..7d00f51e 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -3,7 +3,7 @@ import destr from 'destr'; import Database from 'tauri-plugin-sql-api'; import { getParentID } from '@utils/transform'; -import { LumeEvent } from '@utils/types'; +import { Chats, LumeEvent } from '@utils/types'; let db: null | Database = null; @@ -295,11 +295,30 @@ export async function getChannelUsers(channel_id: string) { export async function getChats() { const db = await connect(); const account = await getActiveAccount(); - const result: any = await db.select( + const follows = + typeof account.follows === 'string' ? JSON.parse(account.follows) : account.follows; + + const chats: { follows: Array | null; unknown: number } = { + follows: [], + unknown: 0, + }; + + let result: Array = await db.select( `SELECT DISTINCT sender_pubkey FROM chats WHERE receiver_pubkey = "${account.pubkey}" ORDER BY created_at DESC;` ); - const newArr: any = result.map((v) => ({ ...v, new_messages: 0 })); - return newArr; + + result = result.map((v) => ({ ...v, new_messages: 0 })); + result = result.sort((a, b) => a.new_messages - b.new_messages); + + chats.follows = result.filter((el) => { + return follows.some((i) => { + return i === el.sender_pubkey; + }); + }); + + chats.unknown = result.length - chats.follows.length; + + return chats; } // get chat messages diff --git a/src/shared/icons/index.tsx b/src/shared/icons/index.tsx index 8227667d..8a2deb45 100644 --- a/src/shared/icons/index.tsx +++ b/src/shared/icons/index.tsx @@ -45,4 +45,5 @@ export * from './follow'; export * from './unfollow'; export * from './reaction'; export * from './thread'; +export * from './strangers'; // @endindex diff --git a/src/shared/icons/strangers.tsx b/src/shared/icons/strangers.tsx new file mode 100644 index 00000000..c0521707 --- /dev/null +++ b/src/shared/icons/strangers.tsx @@ -0,0 +1,22 @@ +import { SVGProps } from 'react'; + +export function StrangersIcon(props: JSX.IntrinsicAttributes & SVGProps) { + return ( + + + + ); +} diff --git a/src/utils/types.d.ts b/src/utils/types.d.ts new file mode 100644 index 00000000..60702a63 --- /dev/null +++ b/src/utils/types.d.ts @@ -0,0 +1,17 @@ +import { NDKEvent } from '@nostr-dev-kit/ndk'; + +export interface LumeEvent extends NDKEvent { + event_id: string; + parent_id: string; +} + +export interface Chats { + id: string; + event_id: string; + receiver_pubkey: string; + sender_pubkey: string; + content: string; + tags: string[][]; + created_at: number; + new_messages: number; +} diff --git a/src/utils/types.ts b/src/utils/types.ts deleted file mode 100644 index 49def25d..00000000 --- a/src/utils/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { NDKEvent } from '@nostr-dev-kit/ndk'; - -export interface LumeEvent extends NDKEvent { - event_id: string; - parent_id: string; -} From 4f41022b3022f934e15eca2ba268c5225726d2f3 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 17 Jul 2023 07:51:00 +0700 Subject: [PATCH 08/37] update --- src/libs/storage.tsx | 22 ++++++++++++++-------- src/shared/notes/actions.tsx | 7 ++----- src/shared/notes/actions/reaction.tsx | 6 +++--- src/shared/notes/actions/reply.tsx | 7 ++----- src/shared/notes/actions/repost.tsx | 7 ++----- src/shared/notes/actions/zap.tsx | 7 ++----- src/shared/notes/mentions/note.tsx | 2 +- src/shared/user.tsx | 2 +- src/utils/types.d.ts | 17 +++++++++++++++++ 9 files changed, 44 insertions(+), 33 deletions(-) diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index 7d00f51e..0d568fc8 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -1,9 +1,8 @@ -import { NDKTag, NDKUserProfile } from '@nostr-dev-kit/ndk'; import destr from 'destr'; import Database from 'tauri-plugin-sql-api'; import { getParentID } from '@utils/transform'; -import { Chats, LumeEvent } from '@utils/types'; +import { Account, Block, Chats, LumeEvent } from '@utils/types'; let db: null | Database = null; @@ -20,7 +19,9 @@ export async function connect(): Promise { // get active account export async function getActiveAccount() { const db = await connect(); - const result: any = await db.select('SELECT * FROM accounts WHERE is_active = 1;'); + const result: Array = await db.select( + 'SELECT * FROM accounts WHERE is_active = 1;' + ); if (result.length > 0) { return result[0]; } else { @@ -31,9 +32,10 @@ export async function getActiveAccount() { // get all accounts export async function getAccounts() { const db = await connect(); - return await db.select( + const result: Array = await db.select( 'SELECT * FROM accounts WHERE is_active = 0 ORDER BY created_at DESC;' ); + return result; } // create account @@ -433,15 +435,19 @@ export async function updateItemInBlacklist(content: string, status: number) { // get all blocks export async function getBlocks() { const db = await connect(); - const activeAccount = await getActiveAccount(); - const result: any = await db.select( - `SELECT * FROM blocks WHERE account_id = "${activeAccount.id}" ORDER BY created_at DESC;` + const account = await getActiveAccount(); + const result: Array = await db.select( + `SELECT * FROM blocks WHERE account_id = "${account.id}" ORDER BY created_at DESC;` ); return result; } // create block -export async function createBlock(kind: number, title: string, content: any) { +export async function createBlock( + kind: number, + title: string, + content: string | string[] +) { const db = await connect(); const activeAccount = await getActiveAccount(); return await db.execute( diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index cba308bd..c106917b 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -46,12 +46,9 @@ export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) { - + Open thread - + diff --git a/src/shared/notes/actions/reaction.tsx b/src/shared/notes/actions/reaction.tsx index 48ec3e6b..83889974 100644 --- a/src/shared/notes/actions/reaction.tsx +++ b/src/shared/notes/actions/reaction.tsx @@ -72,8 +72,8 @@ export function NoteReaction({ id, pubkey }: { id: string; pubkey: string }) {
@@ -133,7 +133,7 @@ export function NoteReaction({ id, pubkey }: { id: string; pubkey: string }) { />
- +
diff --git a/src/shared/notes/actions/reply.tsx b/src/shared/notes/actions/reply.tsx index e391849d..cbda02a8 100644 --- a/src/shared/notes/actions/reply.tsx +++ b/src/shared/notes/actions/reply.tsx @@ -19,12 +19,9 @@ export function NoteReply({ id, pubkey }: { id: string; pubkey: string }) { - + Quick reply - + diff --git a/src/shared/notes/actions/repost.tsx b/src/shared/notes/actions/repost.tsx index bf22d219..0bfd214b 100644 --- a/src/shared/notes/actions/repost.tsx +++ b/src/shared/notes/actions/repost.tsx @@ -29,12 +29,9 @@ export function NoteRepost({ id, pubkey }: { id: string; pubkey: string }) { - + Repost - + diff --git a/src/shared/notes/actions/zap.tsx b/src/shared/notes/actions/zap.tsx index 64f7a19b..a6407fc0 100644 --- a/src/shared/notes/actions/zap.tsx +++ b/src/shared/notes/actions/zap.tsx @@ -14,12 +14,9 @@ export function NoteZap() { - + Tip - + diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx index 39582d8d..17f7ab1e 100644 --- a/src/shared/notes/mentions/note.tsx +++ b/src/shared/notes/mentions/note.tsx @@ -65,7 +65,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { }, }} > - {data.content.parsed.length > 200 + {data?.content?.parsed?.length > 200 ? data.content.parsed.substring(0, 200) + '...' : data.content.parsed} diff --git a/src/shared/user.tsx b/src/shared/user.tsx index b6e164b7..b930c3ef 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -2,7 +2,7 @@ import { Popover, Transition } from '@headlessui/react'; import { Fragment } from 'react'; import { Link } from 'react-router-dom'; -import { ChevronDownIcon, VerticalDotsIcon } from '@shared/icons'; +import { VerticalDotsIcon } from '@shared/icons'; import { Image } from '@shared/image'; import { DEFAULT_AVATAR } from '@stores/constants'; diff --git a/src/utils/types.d.ts b/src/utils/types.d.ts index 60702a63..b2068820 100644 --- a/src/utils/types.d.ts +++ b/src/utils/types.d.ts @@ -5,6 +5,23 @@ export interface LumeEvent extends NDKEvent { parent_id: string; } +export interface Account { + id: number; + npub: string; + pubkey: string; + privkey: string; + follows: string[] | string; + is_active: number; +} + +export interface Block { + id: string; + account_id: number; + kind: number; + title: string; + content: string; +} + export interface Chats { id: string; event_id: string; From b3b790588a099a5b8483039a5c0542bb45eeeacb Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:54:17 +0700 Subject: [PATCH 09/37] add hashtag block --- src/app/space/components/addFeed.tsx | 10 +- src/app/space/components/addImage.tsx | 15 +-- src/app/space/components/blocks/feed.tsx | 10 +- src/app/space/components/blocks/following.tsx | 6 +- src/app/space/components/blocks/hashtag.tsx | 102 ++++++++++++++++++ src/app/space/components/blocks/image.tsx | 4 +- src/app/space/components/blocks/thread.tsx | 4 +- src/app/space/index.tsx | 35 +++--- src/shared/notes/actions.tsx | 4 +- src/shared/notes/content.tsx | 19 ++-- src/shared/notes/hashtag.tsx | 36 +++++++ src/shared/notes/index.tsx | 1 + src/shared/notes/kinds/kind1.tsx | 4 +- src/stores/constants.tsx | 8 ++ src/utils/types.d.ts | 4 +- 15 files changed, 203 insertions(+), 59 deletions(-) create mode 100644 src/app/space/components/blocks/hashtag.tsx create mode 100644 src/shared/notes/hashtag.tsx diff --git a/src/app/space/components/addFeed.tsx b/src/app/space/components/addFeed.tsx index 33ced7ad..aa221100 100644 --- a/src/app/space/components/addFeed.tsx +++ b/src/app/space/components/addFeed.tsx @@ -12,7 +12,7 @@ import { createBlock } from '@libs/storage'; import { CancelIcon, CheckCircleIcon, CommandIcon, LoaderIcon } from '@shared/icons'; -import { DEFAULT_AVATAR } from '@stores/constants'; +import { BLOCK_KINDS, DEFAULT_AVATAR } from '@stores/constants'; import { ADD_FEEDBLOCK_SHORTCUT } from '@stores/shortcuts'; import { useAccount } from '@utils/hooks/useAccount'; @@ -38,7 +38,7 @@ export function AddFeedBlock() { useHotkeys(ADD_FEEDBLOCK_SHORTCUT, () => openModal()); const block = useMutation({ - mutationFn: (data: any) => { + mutationFn: (data: { kind: number; title: string; content: string }) => { return createBlock(data.kind, data.title, data.content); }, onSuccess: () => { @@ -53,7 +53,7 @@ export function AddFeedBlock() { formState: { isDirty, isValid }, } = useForm(); - const onSubmit = (data: any) => { + const onSubmit = (data: { kind: number; title: string; content: string }) => { setLoading(true); selected.forEach((item, index) => { @@ -64,7 +64,7 @@ export function AddFeedBlock() { // insert to database block.mutate({ - kind: 1, + kind: BLOCK_KINDS.feed, title: data.title, content: JSON.stringify(selected), }); @@ -205,7 +205,7 @@ export function AddFeedBlock() { {status === 'loading' ? (

Loading...

) : ( - JSON.parse(account.follows).map((follow) => ( + JSON.parse(account.follows as string).map((follow) => ( { @@ -101,7 +94,7 @@ export function AddImageBlock() { }; const block = useMutation({ - mutationFn: (data: any) => { + mutationFn: (data: { kind: number; title: string; content: string }) => { return createBlock(data.kind, data.title, data.content); }, onSuccess: () => { @@ -109,14 +102,14 @@ export function AddImageBlock() { }, }); - const onSubmit = async (data: any) => { + const onSubmit = async (data: { kind: number; title: string; content: string }) => { setLoading(true); // publish file metedata await publish({ content: data.title, kind: 1063, tags: tags.current }); // mutate - block.mutate({ kind: 0, title: data.title, content: data.content }); + block.mutate({ kind: BLOCK_KINDS.image, title: data.title, content: data.content }); setLoading(false); // reset form diff --git a/src/app/space/components/blocks/feed.tsx b/src/app/space/components/blocks/feed.tsx index 35fd9a1c..3b74d871 100644 --- a/src/app/space/components/blocks/feed.tsx +++ b/src/app/space/components/blocks/feed.tsx @@ -9,11 +9,11 @@ import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; -import { LumeEvent } from '@utils/types'; +import { Block, LumeEvent } from '@utils/types'; const ITEM_PER_PAGE = 10; -export function FeedBlock({ params }: { params: any }) { +export function FeedBlock({ params }: { params: Block }) { const queryClient = useQueryClient(); const { status, data, fetchNextPage, hasNextPage, isFetchingNextPage } = useInfiniteQuery({ @@ -24,7 +24,7 @@ export function FeedBlock({ params }: { params: any }) { getNextPageParam: (lastPage) => lastPage.nextCursor, }); - const notes = data ? data.pages.flatMap((d: { data: any }) => d.data) : []; + const notes = data ? data.pages.flatMap((d: { data: LumeEvent[] }) => d.data) : []; const parentRef = useRef(); const rowVirtualizer = useVirtualizer({ @@ -161,9 +161,7 @@ export function FeedBlock({ params }: { params: any }) { }px)`, }} > - {rowVirtualizer - .getVirtualItems() - .map((virtualRow) => renderItem(virtualRow.index))} + {itemsVirtualizer.map((virtualRow) => renderItem(virtualRow.index))}
)} diff --git a/src/app/space/components/blocks/following.tsx b/src/app/space/components/blocks/following.tsx index aff97bf3..d2cc0676 100644 --- a/src/app/space/components/blocks/following.tsx +++ b/src/app/space/components/blocks/following.tsx @@ -36,7 +36,7 @@ export function FollowingBlock() { getNextPageParam: (lastPage) => lastPage.nextCursor, }); - const notes = data ? data.pages.flatMap((d: { data: any }) => d.data) : []; + const notes = data ? data.pages.flatMap((d: { data: LumeEvent[] }) => d.data) : []; const parentRef = useRef(); const rowVirtualizer = useVirtualizer({ @@ -198,9 +198,7 @@ export function FollowingBlock() { }px)`, }} > - {rowVirtualizer - .getVirtualItems() - .map((virtualRow) => renderItem(virtualRow.index))} + {itemsVirtualizer.map((virtualRow) => renderItem(virtualRow.index))}
)} diff --git a/src/app/space/components/blocks/hashtag.tsx b/src/app/space/components/blocks/hashtag.tsx new file mode 100644 index 00000000..5d792b49 --- /dev/null +++ b/src/app/space/components/blocks/hashtag.tsx @@ -0,0 +1,102 @@ +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useVirtualizer } from '@tanstack/react-virtual'; +import { useRef } from 'react'; + +import { useNDK } from '@libs/ndk/provider'; +import { removeBlock } from '@libs/storage'; + +import { NoteKind_1, NoteSkeleton } from '@shared/notes'; +import { TitleBar } from '@shared/titleBar'; + +import { nHoursAgo } from '@utils/date'; +import { Block, LumeEvent } from '@utils/types'; + +export function HashtagBlock({ params }: { params: Block }) { + const queryClient = useQueryClient(); + const parentRef = useRef(); + + const { relayUrls, fetcher } = useNDK(); + const { status, data } = useQuery(['hashtag', params.content], async () => { + const events = (await fetcher.fetchAllEvents( + relayUrls, + { kinds: [1], '#t': [params.content] }, + { since: nHoursAgo(48) } + )) as unknown as LumeEvent[]; + return events; + }); + + const block = useMutation({ + mutationFn: (id: string) => { + return removeBlock(id); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['blocks'] }); + }, + }); + + const rowVirtualizer = useVirtualizer({ + count: data ? data.length : 0, + getScrollElement: () => parentRef.current, + estimateSize: () => 400, + }); + + const itemsVirtualizer = rowVirtualizer.getVirtualItems(); + + return ( +
+ block.mutate(params.id)} + /> +
+ {status === 'loading' ? ( +
+
+ +
+
+ ) : itemsVirtualizer.length === 0 ? ( +
+
+
+

+ No new posts about this hashtag in 48 hours ago +

+
+
+
+ ) : ( +
+
+ {itemsVirtualizer.map((virtualRow) => ( +
+ +
+ ))} +
+
+ )} +
+
+ ); +} diff --git a/src/app/space/components/blocks/image.tsx b/src/app/space/components/blocks/image.tsx index 05202221..1e2cc8f2 100644 --- a/src/app/space/components/blocks/image.tsx +++ b/src/app/space/components/blocks/image.tsx @@ -7,7 +7,9 @@ import { Image } from '@shared/image'; import { DEFAULT_AVATAR } from '@stores/constants'; -export function ImageBlock({ params }: { params: any }) { +import { Block } from '@utils/types'; + +export function ImageBlock({ params }: { params: Block }) { const queryClient = useQueryClient(); const block = useMutation({ diff --git a/src/app/space/components/blocks/thread.tsx b/src/app/space/components/blocks/thread.tsx index 5bc68727..a3fe7b06 100644 --- a/src/app/space/components/blocks/thread.tsx +++ b/src/app/space/components/blocks/thread.tsx @@ -5,7 +5,6 @@ import { useLiveThread } from '@app/space/hooks/useLiveThread'; import { getNoteByID, removeBlock } from '@libs/storage'; -import { NoteMetadata } from '@shared/notes/metadata'; import { NoteReplyForm } from '@shared/notes/replies/form'; import { RepliesList } from '@shared/notes/replies/list'; import { NoteSkeleton } from '@shared/notes/skeleton'; @@ -14,8 +13,9 @@ import { User } from '@shared/user'; import { useAccount } from '@utils/hooks/useAccount'; import { parser } from '@utils/parser'; +import { Block } from '@utils/types'; -export function ThreadBlock({ params }: { params: any }) { +export function ThreadBlock({ params }: { params: Block }) { useLiveThread(params.content); const queryClient = useQueryClient(); diff --git a/src/app/space/index.tsx b/src/app/space/index.tsx index 40908966..a8643542 100644 --- a/src/app/space/index.tsx +++ b/src/app/space/index.tsx @@ -1,8 +1,10 @@ import { useQuery } from '@tanstack/react-query'; +import { useCallback } from 'react'; import { AddBlock } from '@app/space/components/add'; import { FeedBlock } from '@app/space/components/blocks/feed'; import { FollowingBlock } from '@app/space/components/blocks/following'; +import { HashtagBlock } from '@app/space/components/blocks/hashtag'; import { ImageBlock } from '@app/space/components/blocks/image'; import { ThreadBlock } from '@app/space/components/blocks/thread'; @@ -10,6 +12,8 @@ import { getBlocks } from '@libs/storage'; import { LoaderIcon } from '@shared/icons'; +import { Block } from '@utils/types'; + export function SpaceScreen() { const { status, @@ -28,6 +32,24 @@ export function SpaceScreen() { } ); + const renderBlock = useCallback( + (block: Block) => { + switch (block.kind) { + case 0: + return ; + case 1: + return ; + case 2: + return ; + case 3: + return ; + default: + break; + } + }, + [blocks] + ); + return (
@@ -43,18 +65,7 @@ export function SpaceScreen() {
) : ( - blocks.map((block: { kind: number; id: string }) => { - switch (block.kind) { - case 0: - return ; - case 1: - return ; - case 2: - return ; - default: - break; - } - }) + blocks.map((block: Block) => renderBlock(block)) )} {isFetching && (
diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index c106917b..9255850d 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -9,6 +9,8 @@ import { NoteReply } from '@shared/notes/actions/reply'; import { NoteRepost } from '@shared/notes/actions/repost'; import { NoteZap } from '@shared/notes/actions/zap'; +import { BLOCK_KINDS } from '@stores/constants'; + export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) { const queryClient = useQueryClient(); @@ -22,7 +24,7 @@ export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) { }); const openThread = (thread: string) => { - block.mutate({ kind: 2, title: 'Thread', content: thread }); + block.mutate({ kind: BLOCK_KINDS.thread, title: 'Thread', content: thread }); }; return ( diff --git a/src/shared/notes/content.tsx b/src/shared/notes/content.tsx index fe728ef3..e46a4990 100644 --- a/src/shared/notes/content.tsx +++ b/src/shared/notes/content.tsx @@ -2,6 +2,7 @@ import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { + Hashtag, ImagePreview, LinkPreview, MentionNote, @@ -30,24 +31,16 @@ export function NoteContent({ del: ({ children }) => { const key = children[0] as string; if (key.startsWith('pub')) return ; - if (key.startsWith('tag')) - return ( - - ); + if (key.startsWith('tag')) return ; }, }} > {content.parsed} - {content.images.length > 0 && } - {content.videos.length > 0 && } - {content.links.length > 0 && } - {content.notes.length > 0 && + {content.images?.length > 0 && } + {content.videos?.length > 0 && } + {content.links?.length > 0 && } + {content.notes?.length > 0 && content.notes.map((note: string) => )} ); diff --git a/src/shared/notes/hashtag.tsx b/src/shared/notes/hashtag.tsx new file mode 100644 index 00000000..5b29c425 --- /dev/null +++ b/src/shared/notes/hashtag.tsx @@ -0,0 +1,36 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; + +import { createBlock } from '@libs/storage'; + +import { BLOCK_KINDS } from '@stores/constants'; + +export function Hashtag({ tag }: { tag: string }) { + const queryClient = useQueryClient(); + + const block = useMutation({ + mutationFn: (data: { kind: number; title: string; content: string }) => { + return createBlock(data.kind, data.title, data.content); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['blocks'] }); + }, + }); + + const openBlock = () => { + block.mutate({ + kind: BLOCK_KINDS.hashtag, + title: tag, + content: tag.replace('#', ''), + }); + }; + + return ( + + ); +} diff --git a/src/shared/notes/index.tsx b/src/shared/notes/index.tsx index b12f5be9..a9ba8762 100644 --- a/src/shared/notes/index.tsx +++ b/src/shared/notes/index.tsx @@ -21,3 +21,4 @@ export * from './kinds/sub'; export * from './skeleton'; export * from './actions'; export * from './content'; +export * from './hashtag'; diff --git a/src/shared/notes/kinds/kind1.tsx b/src/shared/notes/kinds/kind1.tsx index 13730902..f6bc0c0c 100644 --- a/src/shared/notes/kinds/kind1.tsx +++ b/src/shared/notes/kinds/kind1.tsx @@ -24,11 +24,11 @@ export function NoteKind_1({
- +
{!skipMetadata ? ( - + ) : (
)} diff --git a/src/stores/constants.tsx b/src/stores/constants.tsx index 1673abc4..0c26d95e 100644 --- a/src/stores/constants.tsx +++ b/src/stores/constants.tsx @@ -70,3 +70,11 @@ export const FULL_RELAYS = [ 'wss://relay.nostr.band/all', 'wss://nostr.mutinywallet.com', ]; + +export const BLOCK_KINDS = { + image: 0, + feed: 1, + thread: 2, + hashtag: 3, + exchange_rate: 4, +}; diff --git a/src/utils/types.d.ts b/src/utils/types.d.ts index b2068820..17ff140c 100644 --- a/src/utils/types.d.ts +++ b/src/utils/types.d.ts @@ -1,8 +1,8 @@ import { NDKEvent } from '@nostr-dev-kit/ndk'; export interface LumeEvent extends NDKEvent { - event_id: string; - parent_id: string; + event_id?: string; + parent_id?: string; } export interface Account { From 5606dcb32fd876e98a11857bf964512a23a528d8 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:37:01 +0700 Subject: [PATCH 10/37] update replies --- src/app/note/index.tsx | 15 ++--- src/app/space/components/blocks/thread.tsx | 46 +++++-------- src/libs/storage.tsx | 4 +- src/shared/notes/index.tsx | 2 + src/shared/notes/mentions/user.tsx | 2 +- src/shared/notes/replies/item.tsx | 22 +++++-- src/shared/notes/replies/list.tsx | 20 ++++-- src/shared/notes/stats.tsx | 76 ++++++++++++++++++++++ src/shared/notes/users/thread.tsx | 46 +++++++++++++ src/utils/shortenKey.tsx | 14 ++++ src/utils/transform.tsx | 2 +- 11 files changed, 193 insertions(+), 56 deletions(-) create mode 100644 src/shared/notes/stats.tsx create mode 100644 src/shared/notes/users/thread.tsx diff --git a/src/app/note/index.tsx b/src/app/note/index.tsx index 20016f4e..bd019934 100644 --- a/src/app/note/index.tsx +++ b/src/app/note/index.tsx @@ -1,10 +1,7 @@ -import { useQuery } from '@tanstack/react-query'; import { useParams } from 'react-router-dom'; import { useLiveThread } from '@app/space/hooks/useLiveThread'; -import { getNoteByID } from '@libs/storage'; - import { NoteMetadata } from '@shared/notes/metadata'; import { NoteReplyForm } from '@shared/notes/replies/form'; import { RepliesList } from '@shared/notes/replies/list'; @@ -12,16 +9,12 @@ import { NoteSkeleton } from '@shared/notes/skeleton'; import { User } from '@shared/user'; import { useAccount } from '@utils/hooks/useAccount'; -import { parser } from '@utils/parser'; +import { useEvent } from '@utils/hooks/useEvent'; export function NoteScreen() { const { id } = useParams(); const { account } = useAccount(); - const { status, data } = useQuery(['thread', id], async () => { - const res = await getNoteByID(id); - res['content'] = parser(res); - return res; - }); + const { status, data } = useEvent(id); useLiveThread(id); @@ -39,7 +32,7 @@ export function NoteScreen() {
- +
@@ -48,7 +41,7 @@ export function NoteScreen() {
)}
- +
diff --git a/src/app/space/components/blocks/thread.tsx b/src/app/space/components/blocks/thread.tsx index a3fe7b06..f1e37821 100644 --- a/src/app/space/components/blocks/thread.tsx +++ b/src/app/space/components/blocks/thread.tsx @@ -1,31 +1,20 @@ -import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { Link } from 'react-router-dom'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; -import { useLiveThread } from '@app/space/hooks/useLiveThread'; +// import { useLiveThread } from '@app/space/hooks/useLiveThread'; +import { removeBlock } from '@libs/storage'; -import { getNoteByID, removeBlock } from '@libs/storage'; - -import { NoteReplyForm } from '@shared/notes/replies/form'; +import { NoteContent, NoteStats, ThreadUser } from '@shared/notes'; import { RepliesList } from '@shared/notes/replies/list'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; -import { User } from '@shared/user'; -import { useAccount } from '@utils/hooks/useAccount'; -import { parser } from '@utils/parser'; +import { useEvent } from '@utils/hooks/useEvent'; import { Block } from '@utils/types'; export function ThreadBlock({ params }: { params: Block }) { - useLiveThread(params.content); - const queryClient = useQueryClient(); - const { account } = useAccount(); - const { status, data } = useQuery(['thread', params.content], async () => { - const res = await getNoteByID(params.content); - res['content'] = parser(res); - return res; - }); + const { status, data } = useEvent(params.content); const block = useMutation({ mutationFn: (id: string) => { @@ -36,33 +25,34 @@ export function ThreadBlock({ params }: { params: Block }) { }, }); + // subscribe to live reply + // useLiveThread(params.content); + return (
block.mutate(params.id)} />
{status === 'loading' ? (
-
+
) : (
-
- -
- Focus +
+ +
+ +
+
+
-
-
- {account && ( - - )}
)}
- +
diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index 0d568fc8..61369494 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -169,7 +169,7 @@ export async function createNote( event_id: string, pubkey: string, kind: number, - tags: string[], + tags: string[][], content: string, created_at: number ) { @@ -186,7 +186,7 @@ export async function createNote( // get note replies export async function getReplies(parent_id: string) { const db = await connect(); - const result: any = await db.select( + const result: Array = await db.select( `SELECT * FROM replies WHERE parent_id = "${parent_id}" ORDER BY created_at DESC;` ); return result; diff --git a/src/shared/notes/index.tsx b/src/shared/notes/index.tsx index a9ba8762..0f7531e8 100644 --- a/src/shared/notes/index.tsx +++ b/src/shared/notes/index.tsx @@ -15,6 +15,7 @@ export * from './kinds/kind1063'; export * from './metadata'; export * from './users/mini'; export * from './users/repost'; +export * from './users/thread'; export * from './kinds/thread'; export * from './kinds/repost'; export * from './kinds/sub'; @@ -22,3 +23,4 @@ export * from './skeleton'; export * from './actions'; export * from './content'; export * from './hashtag'; +export * from './stats'; diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index d2e9bd36..c0ddf550 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -9,7 +9,7 @@ export function MentionUser({ pubkey }: { pubkey: string }) { type="button" className="break-words rounded bg-zinc-800 px-2 py-px text-sm font-normal text-blue-400 no-underline hover:bg-zinc-700 hover:text-blue-500" > - @{user?.name || user?.displayName || shortenKey(pubkey)} + {'@' + user?.name || user?.displayName || shortenKey(pubkey)} ); } diff --git a/src/shared/notes/replies/item.tsx b/src/shared/notes/replies/item.tsx index c6718bd8..98b5d19b 100644 --- a/src/shared/notes/replies/item.tsx +++ b/src/shared/notes/replies/item.tsx @@ -1,17 +1,25 @@ -import { NoteMetadata } from '@shared/notes/metadata'; +import { NoteActions, NoteContent } from '@shared/notes'; import { User } from '@shared/user'; import { parser } from '@utils/parser'; +import { LumeEvent } from '@utils/types'; -export function Reply({ data }: { data: any }) { +export function Reply({ data }: { data: LumeEvent }) { const content = parser(data); return ( -
-
- -
- +
+
+
+ +
+
+
+ + +
+
+
diff --git a/src/shared/notes/replies/list.tsx b/src/shared/notes/replies/list.tsx index d27b6622..7be43a9a 100644 --- a/src/shared/notes/replies/list.tsx +++ b/src/shared/notes/replies/list.tsx @@ -1,17 +1,25 @@ import { NDKEvent } from '@nostr-dev-kit/ndk'; import { useQuery } from '@tanstack/react-query'; -import { getReplies } from '@libs/storage'; +import { useNDK } from '@libs/ndk/provider'; import { Reply } from '@shared/notes/replies/item'; -export function RepliesList({ parent_id }: { parent_id: string }) { - const { status, data } = useQuery(['replies', parent_id], async () => { - return await getReplies(parent_id); +import { LumeEvent } from '@utils/types'; + +export function RepliesList({ id }: { id: string }) { + const { relayUrls, fetcher } = useNDK(); + const { status, data } = useQuery(['thread', id], async () => { + const events = (await fetcher.fetchAllEvents( + relayUrls, + { kinds: [1], '#e': [id] }, + { since: 0 } + )) as unknown as LumeEvent[]; + return events; }); return ( -
+
Replies
@@ -28,7 +36,7 @@ export function RepliesList({ parent_id }: { parent_id: string }) {
) : data.length === 0 ? (
-
+

👋

Share your thought on it...

diff --git a/src/shared/notes/stats.tsx b/src/shared/notes/stats.tsx new file mode 100644 index 00000000..ead08097 --- /dev/null +++ b/src/shared/notes/stats.tsx @@ -0,0 +1,76 @@ +import { NDKEvent, NDKFilter } from '@nostr-dev-kit/ndk'; +import { useQuery } from '@tanstack/react-query'; +import { decode } from 'light-bolt11-decoder'; + +import { useNDK } from '@libs/ndk/provider'; + +import { LoaderIcon } from '@shared/icons'; + +export function NoteStats({ id }: { id: string }) { + const { ndk } = useNDK(); + const { status, data } = useQuery( + ['note-stats', id], + async () => { + let reactions = 0; + let reposts = 0; + let zaps = 0; + + const filter: NDKFilter = { + '#e': [id], + kinds: [6, 7, 9735], + }; + + const events = await ndk.fetchEvents(filter); + events.forEach((event: NDKEvent) => { + switch (event.kind) { + case 6: + reposts += 1; + break; + case 7: + reactions += 1; + break; + case 9735: { + const bolt11 = event.tags.find((tag) => tag[0] === 'bolt11')[1]; + if (bolt11) { + const decoded = decode(bolt11); + const amount = decoded.sections.find((item) => item.name === 'amount'); + const sats = amount.value / 1000; + zaps += sats; + } + break; + } + default: + break; + } + }); + + return { reposts, reactions, zaps }; + }, + { refetchOnWindowFocus: false, refetchOnReconnect: false } + ); + + if (status === 'loading') { + return ( +
+ +
+ ); + } + + return ( +
+

+ {data.reactions} + reactions +

+

+ {data.reposts} + reposts +

+

+ {data.zaps} + zaps +

+
+ ); +} diff --git a/src/shared/notes/users/thread.tsx b/src/shared/notes/users/thread.tsx new file mode 100644 index 00000000..c7ee4346 --- /dev/null +++ b/src/shared/notes/users/thread.tsx @@ -0,0 +1,46 @@ +import { VerticalDotsIcon } from '@shared/icons'; +import { Image } from '@shared/image'; + +import { DEFAULT_AVATAR } from '@stores/constants'; + +import { formatCreatedAt } from '@utils/createdAt'; +import { useProfile } from '@utils/hooks/useProfile'; +import { displayNpub } from '@utils/shortenKey'; + +export function ThreadUser({ pubkey, time }: { pubkey: string; time: number }) { + const { status, user } = useProfile(pubkey); + const createdAt = formatCreatedAt(time); + + if (status === 'loading') { + return
; + } + + return ( +
+ {pubkey} +
+
+
+ {user?.nip05?.toLowerCase() || user?.name || user?.display_name} +
+ +
+
+ {createdAt} + · + {displayNpub(pubkey, 16)} +
+
+
+ ); +} diff --git a/src/utils/shortenKey.tsx b/src/utils/shortenKey.tsx index 4e90b4f5..cf950fd3 100644 --- a/src/utils/shortenKey.tsx +++ b/src/utils/shortenKey.tsx @@ -4,3 +4,17 @@ export function shortenKey(pubkey: string) { const npub = nip19.npubEncode(pubkey); return npub.substring(0, 16).concat('...'); } + +export function displayNpub(pubkey: string, len: number, separator?: string) { + const npub = nip19.npubEncode(pubkey) as string; + if (npub.length <= len) return npub; + + separator = separator || ' ... '; + + const sepLen = separator.length, + charsToShow = len - sepLen, + frontChars = Math.ceil(charsToShow / 2), + backChars = Math.floor(charsToShow / 2); + + return npub.substr(0, frontChars) + separator + npub.substr(npub.length - backChars); +} diff --git a/src/utils/transform.tsx b/src/utils/transform.tsx index e4f771a6..7068694f 100644 --- a/src/utils/transform.tsx +++ b/src/utils/transform.tsx @@ -47,7 +47,7 @@ export function arrayObjToPureArr(arr: any) { } // get parent id from event tags -export function getParentID(arr: string[], fallback: string) { +export function getParentID(arr: string[][], fallback: string) { const tags = destr(arr); let parentID = fallback; From 7d38fa5d85966f588dd97de9bf29e5c8dee8a747 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:21:56 +0700 Subject: [PATCH 11/37] update depedencies --- package.json | 6 +- pnpm-lock.yaml | 22 +- src-tauri/Cargo.lock | 434 +++++++++++++++++++------------------- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src/stores/constants.tsx | 2 +- 6 files changed, 238 insertions(+), 230 deletions(-) diff --git a/package.json b/package.json index e89629df..2100fc3e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lume", "private": true, - "version": "1.0.1", + "version": "1.1.0", "scripts": { "dev": "vite", "build": "vite build", @@ -46,8 +46,8 @@ "remark-gfm": "^3.0.1", "slate": "^0.94.1", "slate-history": "^0.93.0", - "slate-react": "^0.94.2", - "tailwind-merge": "^1.13.2", + "slate-react": "^0.97.2", + "tailwind-merge": "^1.14.0", "tauri-plugin-autostart-api": "github:tauri-apps/tauri-plugin-autostart#v1", "tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql", "tauri-plugin-stronghold-api": "github:tauri-apps/tauri-plugin-stronghold#v1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c36382f7..8025d5e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,17 +92,17 @@ dependencies: specifier: ^0.93.0 version: 0.93.0(slate@0.94.1) slate-react: - specifier: ^0.94.2 - version: 0.94.2(react-dom@18.2.0)(react@18.2.0)(slate@0.94.1) + specifier: ^0.97.2 + version: 0.97.2(react-dom@18.2.0)(react@18.2.0)(slate@0.94.1) tailwind-merge: - specifier: ^1.13.2 - version: 1.13.2 + specifier: ^1.14.0 + version: 1.14.0 tauri-plugin-autostart-api: specifier: github:tauri-apps/tauri-plugin-autostart#v1 version: github.com/tauri-apps/tauri-plugin-autostart/59c48c642cea6a854bb1f4181972ad0bfbeb0c75 tauri-plugin-sql-api: specifier: github:tauri-apps/tauri-plugin-sql - version: github.com/tauri-apps/tauri-plugin-sql/f8125e517d9de2a567a2eaa14f7b1b32e456278b + version: github.com/tauri-apps/tauri-plugin-sql/953f2ab9f05ef131b55af065b0596c4c2136b37e tauri-plugin-stronghold-api: specifier: github:tauri-apps/tauri-plugin-stronghold#v1 version: github.com/tauri-apps/tauri-plugin-stronghold/a2dbe1f937f2f2a1fd27d5a4a7a87ec7b7d1f5d4 @@ -5784,8 +5784,8 @@ packages: slate: 0.94.1 dev: false - /slate-react@0.94.2(react-dom@18.2.0)(react@18.2.0)(slate@0.94.1): - resolution: {integrity: sha512-4wDSuTuGBkdQ609CS55uc2Yhfa5but21usBgAtCVhPJQazL85kzN2vUUYTmGb7d/mpP9tdnJiVPopIyhqlRJ8Q==} + /slate-react@0.97.2(react-dom@18.2.0)(react@18.2.0)(slate@0.94.1): + resolution: {integrity: sha512-jVUbTU+0MnbT7l09thQnWfM7gneTFGMsybmXX9utryQnbttKwIo3NynPI6chGwiz0N4/6k5Yb4fc8N/eZkYHUw==} peerDependencies: react: '>=16.8.0' react-dom: '>=16.8.0' @@ -6061,8 +6061,8 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /tailwind-merge@1.13.2: - resolution: {integrity: sha512-R2/nULkdg1VR/EL4RXg4dEohdoxNUJGLMnWIQnPKL+O9Twu7Cn3Rxi4dlXkDzZrEGtR+G+psSXFouWlpTyLhCQ==} + /tailwind-merge@1.14.0: + resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==} dev: false /tailwindcss@3.3.3: @@ -6722,8 +6722,8 @@ packages: '@tauri-apps/api': 1.4.0 dev: false - github.com/tauri-apps/tauri-plugin-sql/f8125e517d9de2a567a2eaa14f7b1b32e456278b: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/f8125e517d9de2a567a2eaa14f7b1b32e456278b} + github.com/tauri-apps/tauri-plugin-sql/953f2ab9f05ef131b55af065b0596c4c2136b37e: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/953f2ab9f05ef131b55af065b0596c4c2136b37e} name: tauri-plugin-sql-api version: 0.0.0 dependencies: diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 21930210..a2899fec 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -75,15 +75,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - [[package]] name = "aho-corasick" version = "1.0.2" @@ -110,9 +101,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56fc6cf8dc8c4158eed8649f9b8b0ea1518eb62b544fe9490d66fa0b349eafe9" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-tzdata" @@ -130,10 +121,59 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.71" +name = "anstream" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arrayref" @@ -249,7 +289,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -266,7 +306,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -308,17 +348,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "auto-launch" version = "0.4.0" @@ -550,18 +579,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -686,42 +715,44 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.25" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" dependencies = [ - "atty", - "bitflags 1.3.2", + "clap_builder", "clap_derive", - "clap_lex", - "indexmap 1.9.3", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.25" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck 0.4.1", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.26", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "clipboard-win" @@ -771,6 +802,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "combine" version = "4.6.6" @@ -805,9 +842,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6340df57935414636969091153f35f68d9f00bbc8fb4a9c6054706c213e6c6bc" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" [[package]] name = "constant_time_eq" @@ -987,7 +1024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -1024,9 +1061,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ "darling_core", "darling_macro", @@ -1034,27 +1071,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -1168,9 +1205,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dtoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519b83cd10f5f6e969625a409f735182bea5558cd8b64c655806ceaae36f1999" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dtoa-short" @@ -1268,14 +1305,14 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -1341,7 +1378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" dependencies = [ "cfg-if", - "rustix 0.38.3", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -1520,7 +1557,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -1794,11 +1831,11 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "1391ab1f92ffcc08911957149833e682aa3fe252b9f45f966d2ef972274c97df" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick", "bstr", "fnv", "log", @@ -1936,15 +1973,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.2" @@ -2006,7 +2034,7 @@ checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", - "itoa 1.0.8", + "itoa 1.0.9", ] [[package]] @@ -2053,7 +2081,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.8", + "itoa 1.0.9", "pin-project-lite", "socket2", "tokio", @@ -2199,7 +2227,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi", "libc", "windows-sys 0.48.0", ] @@ -2232,9 +2260,9 @@ dependencies = [ [[package]] name = "iota-crypto" -version = "0.21.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22b9d6f6b7601c3fcff97cdf6298cbfdd6fb44812b4e6f82a016152be1c891" +checksum = "c5d5a986d972c3a703d48ced24fdc0bf16fb2d02959ff4b152fa77b9132f6fb0" dependencies = [ "autocfg", ] @@ -2263,6 +2291,17 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +[[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.4", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -2280,9 +2319,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "javascriptcore-rs" @@ -2492,7 +2531,7 @@ dependencies = [ [[package]] name = "lume" -version = "1.0.1" +version = "1.1.0" dependencies = [ "cocoa", "objc", @@ -2860,7 +2899,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi", "libc", ] @@ -2978,7 +3017,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -3020,12 +3059,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "os_str_bytes" -version = "6.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" - [[package]] name = "overload" version = "0.1.1" @@ -3088,9 +3121,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pathdiff" @@ -3237,7 +3270,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -3281,14 +3314,14 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plist" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" +checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" dependencies = [ "base64 0.21.2", "indexmap 1.9.3", "line-wrap", - "quick-xml 0.28.2", + "quick-xml 0.29.0", "serde", "time", ] @@ -3399,9 +3432,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -3426,18 +3459,18 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" +checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] @@ -3596,10 +3629,10 @@ version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-automata 0.3.2", - "regex-syntax 0.7.3", + "regex-automata 0.3.3", + "regex-syntax 0.7.4", ] [[package]] @@ -3613,13 +3646,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-syntax 0.7.3", + "regex-syntax 0.7.4", ] [[package]] @@ -3630,9 +3663,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "remove_dir_all" @@ -3791,9 +3824,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", "errno", @@ -3804,12 +3837,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.3" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "ring", - "rustls-webpki 0.101.1", + "rustls-webpki", "sct", ] @@ -3822,16 +3855,6 @@ dependencies = [ "base64 0.21.2", ] -[[package]] -name = "rustls-webpki" -version = "0.100.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "rustls-webpki" version = "0.101.1" @@ -3844,9 +3867,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rustyline" @@ -3874,9 +3897,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safemem" @@ -3969,40 +3992,40 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.169" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd51c3db8f9500d531e6c12dd0fd4ad13d133e9117f5aebac3cdbb8b6d9824b0" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.169" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27738cfea0d944ab72c3ed01f3d5f23ec4322af8a1431e40ce630e4c01ea74fd" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ - "itoa 1.0.8", + "itoa 1.0.9", "ryu", "serde", ] @@ -4015,7 +4038,7 @@ checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -4034,7 +4057,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.8", + "itoa 1.0.9", "ryu", "serde", ] @@ -4064,7 +4087,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -4145,9 +4168,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "b824b6e687aff278cdbf3b36f07aa52d4bd4099699324d5da86a2ebce3aa00b3" dependencies = [ "libc", "signal-hook-registry", @@ -4275,9 +4298,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ef53c86d2066e04f0ac6b1364f16d13d82388e2d07f11a5c71782345555761" +checksum = "8e58421b6bc416714d5115a2ca953718f6c621a51b68e4f4922aea5a4391a721" dependencies = [ "sqlx-core", "sqlx-macros", @@ -4288,9 +4311,9 @@ dependencies = [ [[package]] name = "sqlx-cli" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c8afd6085e14de2e4a4efa62e1294ae6bd2ca46f842033f4bce4276c620c12" +checksum = "f53103960be705bebdbe2314d6c06f05a6a64934998c3c6844f3347437890abc" dependencies = [ "anyhow", "async-trait", @@ -4314,9 +4337,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a22fd81e9c1ad53c562edb869ff042b215d4eadefefc4784bacfbfd19835945" +checksum = "dd4cef4251aabbae751a3710927945901ee1d97ee96d757f6880ebb9a79bfd53" dependencies = [ "ahash 0.8.3", "atoi", @@ -4358,9 +4381,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bb7c096a202b8164c175614cbfb79fe0e1e0a3d50e0374526183ef2974e4a2" +checksum = "208e3165167afd7f3881b16c1ef3f2af69fa75980897aac8874a0696516d12c2" dependencies = [ "proc-macro2", "quote", @@ -4371,9 +4394,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d644623ab9699014e5b3cb61a040d16caa50fd477008f63f1399ae35498a58" +checksum = "8a4a8336d278c62231d87f24e8a7a74898156e34c1c18942857be2acb29c7dfc" dependencies = [ "dotenvy", "either", @@ -4397,9 +4420,9 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8264c59b28b6858796acfcedc660aa4c9075cc6e4ec8eb03cdca2a3e725726db" +checksum = "8ca69bf415b93b60b80dc8fda3cb4ef52b2336614d8da2de5456cc942a110482" dependencies = [ "atoi", "base64 0.21.2", @@ -4418,7 +4441,7 @@ dependencies = [ "hex", "hkdf", "hmac", - "itoa 1.0.8", + "itoa 1.0.9", "log", "md-5", "memchr", @@ -4440,9 +4463,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cab6147b81ca9213a7578f1b4c9d24c449a53953cd2222a7b5d7cd29a5c3139" +checksum = "a0db2df1b8731c3651e204629dd55e52adbae0462fa1bdcbed56a2302c18181e" dependencies = [ "atoi", "base64 0.21.2", @@ -4459,7 +4482,7 @@ dependencies = [ "hkdf", "hmac", "home", - "itoa 1.0.8", + "itoa 1.0.9", "log", "md-5", "memchr", @@ -4480,9 +4503,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fba60afa64718104b71eec6984f8779d4caffff3b30cde91a75843c7efc126" +checksum = "be4c21bf34c7cae5b283efb3ac1bcc7670df7561124dc2f8bdc0b59be40f79a2" dependencies = [ "atoi", "flume", @@ -4556,9 +4579,9 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -4647,9 +4670,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.24" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ccaf716a23c35ff908f91c971a86a9a71af5998c1d8f10e828d9f55f68ac00" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ "proc-macro2", "quote", @@ -4757,9 +4780,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" dependencies = [ "filetime", "libc", @@ -4768,9 +4791,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" +checksum = "df8e77cb757a61f51b947ec4a7e3646efd825b73561db1c232a8ccb639e611a0" [[package]] name = "tauri" @@ -4889,7 +4912,7 @@ dependencies = [ [[package]] name = "tauri-plugin-autostart" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#0d0ed7b9075ee21f37d787217fba3ef0784b2449" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#51f20b438e42050cdbfd6c6dc72dbc985a31bbc1" dependencies = [ "auto-launch", "log", @@ -4902,7 +4925,7 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#0d0ed7b9075ee21f37d787217fba3ef0784b2449" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#51f20b438e42050cdbfd6c6dc72dbc985a31bbc1" dependencies = [ "log", "serde", @@ -4916,7 +4939,7 @@ dependencies = [ [[package]] name = "tauri-plugin-sql" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#0d0ed7b9075ee21f37d787217fba3ef0784b2449" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#51f20b438e42050cdbfd6c6dc72dbc985a31bbc1" dependencies = [ "futures-core", "log", @@ -4932,10 +4955,10 @@ dependencies = [ [[package]] name = "tauri-plugin-stronghold" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#0d0ed7b9075ee21f37d787217fba3ef0784b2449" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#51f20b438e42050cdbfd6c6dc72dbc985a31bbc1" dependencies = [ "hex", - "iota-crypto 0.21.2", + "iota-crypto 0.23.0", "iota_stronghold", "log", "serde", @@ -5060,21 +5083,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thin-slice" version = "0.1.1" @@ -5098,7 +5106,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -5117,7 +5125,7 @@ version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ - "itoa 1.0.8", + "itoa 1.0.9", "serde", "time-core", "time-macros", @@ -5179,7 +5187,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -5249,9 +5257,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", @@ -5287,7 +5295,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] @@ -5377,9 +5385,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -5450,9 +5458,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d023da39d1fde5a8a3fe1f3e01ca9632ada0a63e9797de55a879d6e2236277be" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom 0.2.10", ] @@ -5565,7 +5573,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", "wasm-bindgen-shared", ] @@ -5599,7 +5607,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5682,11 +5690,11 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "rustls-webpki 0.100.1", + "rustls-webpki", ] [[package]] @@ -6084,9 +6092,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.9" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" dependencies = [ "memchr", ] @@ -6282,7 +6290,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.24", + "syn 2.0.26", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index a9363a2c..bf759896 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lume" -version = "1.0.1" +version = "1.1.0" description = "nostr client" authors = ["Ren Amamiya"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 82f04ba3..048d7fd5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "Lume", - "version": "1.0.1" + "version": "1.1.0" }, "tauri": { "allowlist": { diff --git a/src/stores/constants.tsx b/src/stores/constants.tsx index 0c26d95e..29b8eb00 100644 --- a/src/stores/constants.tsx +++ b/src/stores/constants.tsx @@ -1,4 +1,4 @@ -export const APP_VERSION = '1.0.1'; +export const APP_VERSION = '1.1.0'; export const DEFAULT_AVATAR = 'https://void.cat/d/5VKmKyuHyxrNMf9bWSVPih'; From 100204b26790f62e73ab87bc5bba2b1098cb30aa Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:00:01 +0700 Subject: [PATCH 12/37] add user block --- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 3 +- src/app/space/components/blocks/thread.tsx | 10 +- src/app/space/components/blocks/user.tsx | 141 +++++++++++++++++++++ src/app/space/index.tsx | 3 + src/app/user/components/feed.tsx | 68 +++++++++- src/app/user/components/metadata.tsx | 4 +- src/shared/notes/actions.tsx | 50 +++++--- src/shared/notes/mentions/note.tsx | 6 +- src/shared/notes/mentions/user.tsx | 25 ++++ src/shared/notes/preview/link.tsx | 18 +-- src/shared/notes/replies/form.tsx | 32 +---- src/shared/user.tsx | 2 +- src/stores/constants.tsx | 1 + 14 files changed, 299 insertions(+), 66 deletions(-) create mode 100644 src/app/space/components/blocks/user.tsx diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index bf759896..635927ae 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -16,7 +16,7 @@ tauri-build = { version = "1.2", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "1.2", features = [ "path-all", "fs-read-dir", "fs-read-file", "clipboard-read-text", "clipboard-write-text", "dialog-open", "http-all", "http-multipart", "notification-all", "os-all", "process-relaunch", "shell-open", "system-tray", "updater", "window-close", "window-start-dragging"] } +tauri = { version = "1.2", features = [ "window-create", "path-all", "fs-read-dir", "fs-read-file", "clipboard-read-text", "clipboard-write-text", "dialog-open", "http-all", "http-multipart", "notification-all", "os-all", "process-relaunch", "shell-open", "system-tray", "updater", "window-close", "window-start-dragging"] } tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 048d7fd5..355ea0d6 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -62,7 +62,8 @@ }, "window": { "startDragging": true, - "close": true + "close": true, + "create": true }, "process": { "all": false, diff --git a/src/app/space/components/blocks/thread.tsx b/src/app/space/components/blocks/thread.tsx index f1e37821..fcd41fc7 100644 --- a/src/app/space/components/blocks/thread.tsx +++ b/src/app/space/components/blocks/thread.tsx @@ -3,7 +3,13 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; // import { useLiveThread } from '@app/space/hooks/useLiveThread'; import { removeBlock } from '@libs/storage'; -import { NoteContent, NoteStats, ThreadUser } from '@shared/notes'; +import { + NoteActions, + NoteContent, + NoteReplyForm, + NoteStats, + ThreadUser, +} from '@shared/notes'; import { RepliesList } from '@shared/notes/replies/list'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; @@ -46,12 +52,14 @@ export function ThreadBlock({ params }: { params: Block }) {
+
)}
+
diff --git a/src/app/space/components/blocks/user.tsx b/src/app/space/components/blocks/user.tsx new file mode 100644 index 00000000..66a0e227 --- /dev/null +++ b/src/app/space/components/blocks/user.tsx @@ -0,0 +1,141 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useEffect, useState } from 'react'; +import { Link } from 'react-router-dom'; + +import { UserFeed } from '@app/user/components/feed'; +import { UserMetadata } from '@app/user/components/metadata'; + +import { removeBlock } from '@libs/storage'; + +import { ZapIcon } from '@shared/icons'; +import { Image } from '@shared/image'; +import { TitleBar } from '@shared/titleBar'; + +import { DEFAULT_AVATAR } from '@stores/constants'; + +import { useProfile } from '@utils/hooks/useProfile'; +import { useSocial } from '@utils/hooks/useSocial'; +import { shortenKey } from '@utils/shortenKey'; +import { Block } from '@utils/types'; + +export function UserBlock({ params }: { params: Block }) { + const queryClient = useQueryClient(); + + const { user } = useProfile(params.content); + const { status, userFollows, follow, unfollow } = useSocial(); + + const [followed, setFollowed] = useState(false); + + const block = useMutation({ + mutationFn: (id: string) => { + return removeBlock(id); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['blocks'] }); + }, + }); + + const followUser = (pubkey: string) => { + try { + follow(pubkey); + + // update state + setFollowed(true); + } catch (error) { + console.log(error); + } + }; + + const unfollowUser = (pubkey: string) => { + try { + unfollow(pubkey); + + // update state + setFollowed(false); + } catch (error) { + console.log(error); + } + }; + + useEffect(() => { + if (status === 'success' && userFollows) { + if (userFollows.includes(params.content)) { + setFollowed(true); + } + } + }, [status]); + + return ( +
+ block.mutate(params.id)} /> +
+
+ {params.content} +
+
+
+ {user?.displayName || user?.name || 'No name'} +
+ + {user?.nip05 || shortenKey(params.content)} + +
+
+

+ {user?.about} +

+ +
+
+ {status === 'loading' ? ( + + ) : followed ? ( + + ) : ( + + )} + + Message + + +
+
+
+
+

Timeline

+ +
+
+
+ ); +} diff --git a/src/app/space/index.tsx b/src/app/space/index.tsx index a8643542..607ea55f 100644 --- a/src/app/space/index.tsx +++ b/src/app/space/index.tsx @@ -1,6 +1,7 @@ import { useQuery } from '@tanstack/react-query'; import { useCallback } from 'react'; +import { UserBlock } from '@app/space//components/blocks/user'; import { AddBlock } from '@app/space/components/add'; import { FeedBlock } from '@app/space/components/blocks/feed'; import { FollowingBlock } from '@app/space/components/blocks/following'; @@ -43,6 +44,8 @@ export function SpaceScreen() { return ; case 3: return ; + case 5: + return ; default: break; } diff --git a/src/app/user/components/feed.tsx b/src/app/user/components/feed.tsx index f0d1f81d..fb9da7cf 100644 --- a/src/app/user/components/feed.tsx +++ b/src/app/user/components/feed.tsx @@ -1,11 +1,17 @@ -import { useQuery } from '@tanstack/react-query'; +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { useVirtualizer } from '@tanstack/react-virtual'; +import { useRef } from 'react'; import { useNDK } from '@libs/ndk/provider'; +import { NoteKind_1, NoteSkeleton } from '@shared/notes'; + import { nHoursAgo } from '@utils/date'; import { LumeEvent } from '@utils/types'; export function UserFeed({ pubkey }: { pubkey: string }) { + const parentRef = useRef(); + const { fetcher, relayUrls } = useNDK(); const { status, data } = useQuery(['user-feed', pubkey], async () => { const events = await fetcher.fetchAllEvents( @@ -17,5 +23,63 @@ export function UserFeed({ pubkey }: { pubkey: string }) { return events as unknown as LumeEvent[]; }); - return
; + const rowVirtualizer = useVirtualizer({ + count: data ? data.length : 0, + getScrollElement: () => parentRef.current, + estimateSize: () => 400, + }); + + const itemsVirtualizer = rowVirtualizer.getVirtualItems(); + + return ( +
+ {status === 'loading' ? ( +
+
+ +
+
+ ) : itemsVirtualizer.length === 0 ? ( +
+
+
+

+ No new posts about this hashtag in 48 hours ago +

+
+
+
+ ) : ( +
+
+ {itemsVirtualizer.map((virtualRow) => ( +
+ +
+ ))} +
+
+ )} +
+ ); } diff --git a/src/app/user/components/metadata.tsx b/src/app/user/components/metadata.tsx index 25e0a435..a471e7e9 100644 --- a/src/app/user/components/metadata.tsx +++ b/src/app/user/components/metadata.tsx @@ -19,13 +19,13 @@ export function UserMetadata({ pubkey }: { pubkey: string }) {
- {data.stats[pubkey].followers_pubkey_count ?? 0} + {compactNumber.format(data.stats[pubkey].followers_pubkey_count) ?? 0} Followers
- {data.stats[pubkey].pub_following_pubkey_count ?? 0} + {compactNumber.format(data.stats[pubkey].pub_following_pubkey_count) ?? 0} Following
diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index 9255850d..b7953fbd 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -11,7 +11,15 @@ import { NoteZap } from '@shared/notes/actions/zap'; import { BLOCK_KINDS } from '@stores/constants'; -export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) { +export function NoteActions({ + id, + pubkey, + noOpenThread, +}: { + id: string; + pubkey: string; + noOpenThread?: boolean; +}) { const queryClient = useQueryClient(); const block = useMutation({ @@ -36,24 +44,28 @@ export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) {
-
- - - - - - - Open thread - - - - + {!noOpenThread && ( + <> +
+ + + + + + + Open thread + + + + + + )}
); diff --git a/src/shared/notes/mentions/note.tsx b/src/shared/notes/mentions/note.tsx index 17f7ab1e..e9f8e60b 100644 --- a/src/shared/notes/mentions/note.tsx +++ b/src/shared/notes/mentions/note.tsx @@ -8,6 +8,8 @@ import { createBlock } from '@libs/storage'; import { MentionUser, NoteSkeleton } from '@shared/notes'; import { User } from '@shared/user'; +import { BLOCK_KINDS } from '@stores/constants'; + import { useEvent } from '@utils/hooks/useEvent'; export const MentionNote = memo(function MentionNote({ id }: { id: string }) { @@ -15,7 +17,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { const queryClient = useQueryClient(); const block = useMutation({ - mutationFn: (data: any) => { + mutationFn: (data: { kind: number; title: string; content: string }) => { return createBlock(data.kind, data.title, data.content); }, onSuccess: () => { @@ -26,7 +28,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) { const openThread = (event: any, thread: string) => { const selection = window.getSelection(); if (selection.toString().length === 0) { - block.mutate({ kind: 2, title: 'Thread', content: thread }); + block.mutate({ kind: BLOCK_KINDS.thread, title: 'Thread', content: thread }); } else { event.stopPropagation(); } diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index c0ddf550..540c01e0 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -1,12 +1,37 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; + +import { createBlock } from '@libs/storage'; + +import { BLOCK_KINDS } from '@stores/constants'; + import { useProfile } from '@utils/hooks/useProfile'; import { shortenKey } from '@utils/shortenKey'; export function MentionUser({ pubkey }: { pubkey: string }) { const { user } = useProfile(pubkey); + const queryClient = useQueryClient(); + const block = useMutation({ + mutationFn: (data: { kind: number; title: string; content: string }) => { + return createBlock(data.kind, data.title, data.content); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['blocks'] }); + }, + }); + + const openBlock = () => { + block.mutate({ + kind: BLOCK_KINDS.user, + title: user?.name || user?.displayNam, + content: pubkey, + }); + }; + return (
+
+

+ Your private key is your password. If you lose this key, you will lose + access to your account! Copy it and keep it in a safe place. There is no way + to reset your private key. +

+
+
+
+ +
-
); diff --git a/src/app/auth/onboarding.tsx b/src/app/auth/onboarding.tsx index e25fbf2c..b0fa56db 100644 --- a/src/app/auth/onboarding.tsx +++ b/src/app/auth/onboarding.tsx @@ -37,15 +37,16 @@ export function OnboardingScreen() { return (
-
+

👋 Hello, welcome you to Lume

- You're a part of better future that we're fighting + You're a part of Nostr community now

- If Lume gets your attention, please help us spread via button below + If Lume gets your attention, please help us spread it and don't forget + invite your friend join with you, we can have fun togother

@@ -84,16 +85,16 @@ export function OnboardingScreen() { ) : ( <> - Publish + Spread )} - Skip for now + Skip
diff --git a/src/app/space/components/blocks/following.tsx b/src/app/space/components/blocks/following.tsx index d2cc0676..63729329 100644 --- a/src/app/space/components/blocks/following.tsx +++ b/src/app/space/components/blocks/following.tsx @@ -86,7 +86,7 @@ export function FollowingBlock() { if (root || reply) { return (
diff --git a/src/libs/storage.tsx b/src/libs/storage.tsx index 57e2a8dd..496f23c6 100644 --- a/src/libs/storage.tsx +++ b/src/libs/storage.tsx @@ -53,7 +53,7 @@ export async function createAccount( if (res) { await createBlock( 0, - 'Preserve your freedom', + 'Have fun together!', 'https://void.cat/d/949GNg7ZjSLHm2eTR3jZqv' ); } diff --git a/src/shared/button.tsx b/src/shared/button.tsx index a7ff78c8..5dd4ea6d 100644 --- a/src/shared/button.tsx +++ b/src/shared/button.tsx @@ -7,7 +7,7 @@ export function Button({ disabled = false, onClick = undefined, }: { - preset: 'small' | 'publish' | 'large'; + preset: 'small' | 'publish' | 'large' | 'large-alt'; children: ReactNode; disabled?: boolean; onClick?: () => void; @@ -26,6 +26,10 @@ export function Button({ preClass = 'h-11 w-full bg-fuchsia-500 rounded-md font-medium text-zinc-100 hover:bg-fuchsia-600'; break; + case 'large-alt': + preClass = + 'h-11 w-full bg-zinc-800 rounded-md font-medium text-zinc-300 border-t border-zinc-700/50 hover:bg-zinc-900'; + break; default: break; } diff --git a/src/utils/hooks/useEvent.tsx b/src/utils/hooks/useEvent.tsx index c2a4a137..06f4f4a2 100644 --- a/src/utils/hooks/useEvent.tsx +++ b/src/utils/hooks/useEvent.tsx @@ -27,29 +27,36 @@ export function useEvent(id: string, fallback?: string) { embed.content, embed.created_at ); + return embed; + } else { + const event = await ndk.fetchEvent(id); + if (event) { + await createNote( + event.id, + event.pubkey, + event.kind, + event.tags, + event.content, + event.created_at + ); + event['event_id'] = event.id; + if (event.kind === 1) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + event['content'] = parser(event); + } + return event; + } else { + return null; + } } - const event = await ndk.fetchEvent(id); - await createNote( - event.id, - event.pubkey, - event.kind, - event.tags, - event.content, - event.created_at - ); - event['event_id'] = event.id; - if (event.kind === 1) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - event['content'] = parser(event); - } - return event; } }, { refetchOnWindowFocus: false, refetchOnMount: false, refetchOnReconnect: false, + staleTime: Infinity, } ); From 22c1eaa541eb462cb35b125e489adaf483ea52de Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Wed, 19 Jul 2023 12:47:45 +0700 Subject: [PATCH 15/37] add useBlock hook --- pnpm-lock.yaml | 74 ++++++++++----------- src/app/space/components/blocks/feed.tsx | 18 ++--- src/app/space/components/blocks/hashtag.tsx | 21 +----- src/app/space/components/blocks/image.tsx | 18 +---- src/app/space/components/blocks/thread.tsx | 17 +---- src/app/space/components/blocks/user.tsx | 16 +---- src/shared/notes/actions.tsx | 28 +++----- src/shared/notes/hashtag.tsx | 33 +++------ src/shared/notes/mentions/note.tsx | 19 ++---- src/shared/notes/mentions/user.tsx | 32 +++------ src/shared/notes/metadata.tsx | 27 +++----- src/shared/titleBar.tsx | 16 ++--- src/utils/hooks/useBlock.tsx | 33 +++++++++ 13 files changed, 131 insertions(+), 221 deletions(-) create mode 100644 src/utils/hooks/useBlock.tsx diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd551b35..c455ed35 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1455,8 +1455,8 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: false - /@swc/core-darwin-arm64@1.3.69: - resolution: {integrity: sha512-IjZTf12zIPWkV3D7toaLDoJPSkLhQ4fDH8G6/yCJUI27cBFOI3L8LXqptYmISoN5yYdrcnNpdqdapD09JPuNJg==} + /@swc/core-darwin-arm64@1.3.70: + resolution: {integrity: sha512-31+mcl0dgdRHvZRjhLOK9V6B+qJ7nxDZYINr9pBlqGWxknz37Vld5KK19Kpr79r0dXUZvaaelLjCnJk9dA2PcQ==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -1464,8 +1464,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.69: - resolution: {integrity: sha512-/wBO0Rn5oS5dJI/L9kJRkPAdksVwl5H9nleW/NM3A40N98VV8T7h/i1nO051mxIjq0R6qXVGOWFbBoLrPYucJg==} + /@swc/core-darwin-x64@1.3.70: + resolution: {integrity: sha512-GMFJ65E18zQC80t0os+TZvI+8lbRuitncWVge/RXmXbVLPRcdykP4EJ87cqzcG5Ah0z18/E0T+ixD6jHRisrYQ==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -1473,8 +1473,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm-gnueabihf@1.3.69: - resolution: {integrity: sha512-NShCjMv6Xn8ckMKBRqmprXvUF14+jXY0TcNKXwjYErzoIUFOnG72M36HxT4QEeAtKZ4Eg4CZFE4zlJ27fDp1gg==} + /@swc/core-linux-arm-gnueabihf@1.3.70: + resolution: {integrity: sha512-wjhCwS8LCiAq2VedF1b4Bryyw68xZnfMED4pLRazAl8BaUlDFANfRBORNunxlfHQj4V3x39IaiLgCZRHMdzXBg==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -1482,8 +1482,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.69: - resolution: {integrity: sha512-VRPOJj4idopSHIj1bOVXX0SgaB18R8yZNunb7eXS5ZcjVxAcdvqyIz3RdQX1zaJFCGzcdPLzBRP32DZWWGE8Ng==} + /@swc/core-linux-arm64-gnu@1.3.70: + resolution: {integrity: sha512-9D/Rx67cAOnMiexvCqARxvhj7coRajTp5HlJHuf+rfwMqI2hLhpO9/pBMQxBUAWxODO/ksQ/OF+GJRjmtWw/2A==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1491,8 +1491,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.69: - resolution: {integrity: sha512-QxeSiZqo5x1X8vq8oUWLibq+IZJcxl9vy0sLUmzdjF2b/Z+qxKP3gutxnb2tzJaHqPVBbEZaILERIGy1qWdumQ==} + /@swc/core-linux-arm64-musl@1.3.70: + resolution: {integrity: sha512-gkjxBio7XD+1GlQVVyPP/qeFkLu83VhRHXaUrkNYpr5UZG9zZurBERT9nkS6Y+ouYh+Q9xmw57aIyd2KvD2zqQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1500,8 +1500,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.69: - resolution: {integrity: sha512-b+DUlVxYox3BwD3PyTwhLvqtu6TYZtW+S6O0FnttH11o4skHN0XyJ/cUZSI0X2biSmfDsizRDUt1PWPFM+F7SA==} + /@swc/core-linux-x64-gnu@1.3.70: + resolution: {integrity: sha512-/nCly+V4xfMVwfEUoLLAukxUSot/RcSzsf6GdsGTjFcrp5sZIntAjokYRytm3VT1c2TK321AfBorsi9R5w8Y7Q==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1509,8 +1509,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.69: - resolution: {integrity: sha512-QXjsI+f8n9XPZHUvmGgkABpzN4M9kdSbhqBOZmv3o0AsDGNCA4uVowQqgZoPFAqlJTpwHeDmrv5sQ13HN+LOGw==} + /@swc/core-linux-x64-musl@1.3.70: + resolution: {integrity: sha512-HoOsPJbt361KGKaivAK0qIiYARkhzlxeAfvF5NlnKxkIMOZpQ46Lwj3tR0VWohKbrhS+cYKFlVuDi5XnDkx0XA==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1518,8 +1518,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.69: - resolution: {integrity: sha512-wn7A8Ws1fyviuCUB2Vg6IotiZeuqiO1Mz3d+YDae2EYyNpj1kNHvjBip8GHkfGzZG+jVrvG6NHsDo0KO/pGb8A==} + /@swc/core-win32-arm64-msvc@1.3.70: + resolution: {integrity: sha512-hm4IBK/IaRil+aj1cWU6f0GyAdHpw/Jr5nyFYLM2c/tt7w2t5hgb8NjzM2iM84lOClrig1fG6edj2vCF1dFzNQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -1527,8 +1527,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.69: - resolution: {integrity: sha512-LsFBXtXqxEcVaaOGEZ9X3qdMzobVoJqKv8DnksuDsWcBk+9WCeTz2u/iB+7yZ2HGuPXkCqTRqhFo6FX9aC00kQ==} + /@swc/core-win32-ia32-msvc@1.3.70: + resolution: {integrity: sha512-5cgKUKIT/9Fp5fCA+zIjYCQ4dSvjFYOeWGZR3QiTXGkC4bGa1Ji9SEPyeIAX0iruUnKjYaZB9RvHK2tNn7RLrQ==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -1536,8 +1536,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.69: - resolution: {integrity: sha512-ieBscU0gUgKjaseFI07tAaGqHvKyweNknPeSYEZOasVZUczhD6fK2GRnVREhv2RB2qdKC/VGFBsgRDMgzq1VLw==} + /@swc/core-win32-x64-msvc@1.3.70: + resolution: {integrity: sha512-LE8lW46+TQBzVkn2mHBlk8DIElPIZ2dO5P8AbJiARNBAnlqQWu67l9gWM89UiZ2l33J2cI37pHzON3tKnT8f9g==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -1545,8 +1545,8 @@ packages: dev: true optional: true - /@swc/core@1.3.69: - resolution: {integrity: sha512-Khc/DE9D5+2tYTHgAIp5DZARbs8kldWg3b0Jp6l8FQLjelcLFmlQWSwKhVZrgv4oIbgZydIp8jInsvTalMHqnQ==} + /@swc/core@1.3.70: + resolution: {integrity: sha512-LWVWlEDLlOD25PvA2NEz41UzdwXnlDyBiZbe69s3zM0DfCPwZXLUm79uSqH9ItsOjTrXSL5/1+XUL6C/BZwChA==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -1555,16 +1555,16 @@ packages: '@swc/helpers': optional: true optionalDependencies: - '@swc/core-darwin-arm64': 1.3.69 - '@swc/core-darwin-x64': 1.3.69 - '@swc/core-linux-arm-gnueabihf': 1.3.69 - '@swc/core-linux-arm64-gnu': 1.3.69 - '@swc/core-linux-arm64-musl': 1.3.69 - '@swc/core-linux-x64-gnu': 1.3.69 - '@swc/core-linux-x64-musl': 1.3.69 - '@swc/core-win32-arm64-msvc': 1.3.69 - '@swc/core-win32-ia32-msvc': 1.3.69 - '@swc/core-win32-x64-msvc': 1.3.69 + '@swc/core-darwin-arm64': 1.3.70 + '@swc/core-darwin-x64': 1.3.70 + '@swc/core-linux-arm-gnueabihf': 1.3.70 + '@swc/core-linux-arm64-gnu': 1.3.70 + '@swc/core-linux-arm64-musl': 1.3.70 + '@swc/core-linux-x64-gnu': 1.3.70 + '@swc/core-linux-x64-musl': 1.3.70 + '@swc/core-win32-arm64-msvc': 1.3.70 + '@swc/core-win32-ia32-msvc': 1.3.70 + '@swc/core-win32-x64-msvc': 1.3.70 dev: true /@tailwindcss/typography@0.5.9(tailwindcss@3.3.3): @@ -1993,7 +1993,7 @@ packages: peerDependencies: vite: ^4 dependencies: - '@swc/core': 1.3.69 + '@swc/core': 1.3.70 vite: 4.4.4(@types/node@18.16.19) transitivePeerDependencies: - '@swc/helpers' @@ -2273,7 +2273,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001516 - electron-to-chromium: 1.4.463 + electron-to-chromium: 1.4.464 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true @@ -2735,8 +2735,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.463: - resolution: {integrity: sha512-fT3hvdUWLjDbaTGzyOjng/CQhQJSQP8ThO3XZAoaxHvHo2kUXiRQVMj9M235l8uDFiNPsPa6KHT1p3RaR6ugRw==} + /electron-to-chromium@1.4.464: + resolution: {integrity: sha512-guZ84yoou4+ILNdj0XEbmGs6DEWj6zpVOWYpY09GU66yEb0DSYvP/biBPzHn0GuW/3RC/pnaYNUWlQE1fJYtgA==} dev: true /emoji-regex@8.0.0: @@ -6522,7 +6522,7 @@ packages: vite: '>=2.8' dependencies: '@rollup/plugin-virtual': 3.0.1 - '@swc/core': 1.3.69 + '@swc/core': 1.3.70 uuid: 9.0.0 vite: 4.4.4(@types/node@18.16.19) transitivePeerDependencies: diff --git a/src/app/space/components/blocks/feed.tsx b/src/app/space/components/blocks/feed.tsx index 3b74d871..fa0d3179 100644 --- a/src/app/space/components/blocks/feed.tsx +++ b/src/app/space/components/blocks/feed.tsx @@ -1,8 +1,8 @@ -import { useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; import { useCallback, useEffect, useRef } from 'react'; -import { getNotesByAuthors, removeBlock } from '@libs/storage'; +import { getNotesByAuthors } from '@libs/storage'; import { NoteKind_1, NoteKind_1063, NoteThread, Repost } from '@shared/notes'; import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport'; @@ -14,7 +14,6 @@ import { Block, LumeEvent } from '@utils/types'; const ITEM_PER_PAGE = 10; export function FeedBlock({ params }: { params: Block }) { - const queryClient = useQueryClient(); const { status, data, fetchNextPage, hasNextPage, isFetchingNextPage } = useInfiniteQuery({ queryKey: ['newsfeed', params.content], @@ -25,8 +24,8 @@ export function FeedBlock({ params }: { params: Block }) { }); const notes = data ? data.pages.flatMap((d: { data: LumeEvent[] }) => d.data) : []; - const parentRef = useRef(); + const parentRef = useRef(); const rowVirtualizer = useVirtualizer({ count: hasNextPage ? notes.length + 1 : notes.length, getScrollElement: () => parentRef.current, @@ -48,15 +47,6 @@ export function FeedBlock({ params }: { params: Block }) { } }, [notes.length, fetchNextPage, rowVirtualizer.getVirtualItems()]); - const block = useMutation({ - mutationFn: (id: string) => { - return removeBlock(id); - }, - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['blocks'] }); - }, - }); - const renderItem = useCallback( (index: string | number) => { const note: LumeEvent = notes[index]; @@ -124,7 +114,7 @@ export function FeedBlock({ params }: { params: Block }) { return (
- block.mutate(params.id)} /> +
{ const events = (await fetcher.fetchAllEvents( @@ -25,15 +21,7 @@ export function HashtagBlock({ params }: { params: Block }) { return events; }); - const block = useMutation({ - mutationFn: (id: string) => { - return removeBlock(id); - }, - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['blocks'] }); - }, - }); - + const parentRef = useRef(); const rowVirtualizer = useVirtualizer({ count: data ? data.length : 0, getScrollElement: () => parentRef.current, @@ -44,10 +32,7 @@ export function HashtagBlock({ params }: { params: Block }) { return (
- block.mutate(params.id)} - /> +
{ - return removeBlock(id); - }, - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['blocks'] }); - }, - }); + const { remove } = useBlock(); return (
@@ -29,7 +17,7 @@ export function ImageBlock({ params }: { params: Block }) {

{params.title}