diff --git a/package.json b/package.json index e45dbe30..b0b2b32b 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "@radix-ui/react-toolbar": "^1.0.4", "@radix-ui/react-tooltip": "^1.0.7", "@tanstack/query-sync-storage-persister": "^5.4.3", - "@tanstack/react-query": "^5.4.3", - "@tanstack/react-query-persist-client": "^5.4.3", + "@tanstack/react-query": "^5.7.0", + "@tanstack/react-query-persist-client": "^5.7.0", "@tauri-apps/api": "2.0.0-alpha.11", "@tauri-apps/cli": "2.0.0-alpha.17", "@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.3", @@ -64,12 +64,12 @@ "destr": "^2.0.2", "framer-motion": "^10.16.4", "html-to-text": "^9.0.5", + "idb-keyval": "^6.2.1", "immer": "^10.0.3", "light-bolt11-decoder": "^3.0.0", "lru-cache": "^10.0.1", "markdown-to-jsx": "^7.3.2", - "media-chrome": "^1.5.0", - "million": "^2.6.4", + "media-chrome": "^1.5.2", "minidenticons": "^4.2.0", "nostr-fetch": "^0.13.1", "nostr-tools": "^1.17.0", @@ -78,7 +78,7 @@ "react": "^18.2.0", "react-currency-input-field": "^3.6.11", "react-dom": "^18.2.0", - "react-hook-form": "^7.47.0", + "react-hook-form": "^7.48.1", "react-hotkeys-hook": "^4.4.1", "react-medium-image-zoom": "^5.1.8", "react-router-dom": "^6.18.0", @@ -89,8 +89,8 @@ "tauri-controls": "^0.2.0", "tippy.js": "^6.3.7", "tiptap-markdown": "^0.8.3", - "virtua": "^0.16.0", - "zustand": "^4.4.5" + "virtua": "^0.16.1", + "zustand": "^4.4.6" }, "devDependencies": { "@tailwindcss/typography": "^0.5.10", @@ -108,7 +108,7 @@ "cross-env": "^7.0.3", "csstype": "^3.1.2", "encoding": "^0.1.13", - "eslint": "^8.52.0", + "eslint": "^8.53.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-react": "^7.33.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8f5eaff2..19565c0e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,11 +51,11 @@ dependencies: specifier: ^5.4.3 version: 5.4.3 '@tanstack/react-query': - specifier: ^5.4.3 - version: 5.4.3(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.7.0 + version: 5.7.0(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query-persist-client': - specifier: ^5.4.3 - version: 5.4.3(@tanstack/react-query@5.4.3)(react-dom@18.2.0)(react@18.2.0) + specifier: ^5.7.0 + version: 5.7.0(@tanstack/react-query@5.7.0)(react-dom@18.2.0)(react@18.2.0) '@tauri-apps/api': specifier: 2.0.0-alpha.11 version: 2.0.0-alpha.11 @@ -143,6 +143,9 @@ dependencies: html-to-text: specifier: ^9.0.5 version: 9.0.5 + idb-keyval: + specifier: ^6.2.1 + version: 6.2.1 immer: specifier: ^10.0.3 version: 10.0.3 @@ -156,11 +159,8 @@ dependencies: specifier: ^7.3.2 version: 7.3.2(react@18.2.0) media-chrome: - specifier: ^1.5.0 - version: 1.5.0 - million: - specifier: ^2.6.4 - version: 2.6.4 + specifier: ^1.5.2 + version: 1.5.2 minidenticons: specifier: ^4.2.0 version: 4.2.0 @@ -186,8 +186,8 @@ dependencies: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) react-hook-form: - specifier: ^7.47.0 - version: 7.47.0(react@18.2.0) + specifier: ^7.48.1 + version: 7.48.1(react@18.2.0) react-hotkeys-hook: specifier: ^4.4.1 version: 4.4.1(react-dom@18.2.0)(react@18.2.0) @@ -219,11 +219,11 @@ dependencies: specifier: ^0.8.3 version: 0.8.3(@tiptap/core@2.1.12) virtua: - specifier: ^0.16.0 - version: 0.16.0(react-dom@18.2.0)(react@18.2.0) + specifier: ^0.16.1 + version: 0.16.1(react-dom@18.2.0)(react@18.2.0) zustand: - specifier: ^4.4.5 - version: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + specifier: ^4.4.6 + version: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) devDependencies: '@tailwindcss/typography': @@ -249,10 +249,10 @@ devDependencies: version: 5.5.9 '@typescript-eslint/eslint-plugin': specifier: ^6.9.1 - version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@5.2.2) + version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/parser': specifier: ^6.9.1 - version: 6.9.1(eslint@8.52.0)(typescript@5.2.2) + version: 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@vitejs/plugin-react-swc': specifier: ^3.4.1 version: 3.4.1(vite@4.5.0) @@ -272,20 +272,20 @@ devDependencies: specifier: ^0.1.13 version: 0.1.13 eslint: - specifier: ^8.52.0 - version: 8.52.0 + specifier: ^8.53.0 + version: 8.53.0 eslint-config-prettier: specifier: ^9.0.0 - version: 9.0.0(eslint@8.52.0) + version: 9.0.0(eslint@8.53.0) eslint-plugin-jsx-a11y: specifier: ^6.8.0 - version: 6.8.0(eslint@8.52.0) + version: 6.8.0(eslint@8.53.0) eslint-plugin-react: specifier: ^7.33.2 - version: 7.33.2(eslint@8.52.0) + version: 7.33.2(eslint@8.53.0) eslint-plugin-simple-import-sort: specifier: ^10.0.0 - version: 10.0.0(eslint@8.52.0) + version: 10.0.0(eslint@8.53.0) husky: specifier: ^8.0.3 version: 8.0.3 @@ -331,48 +331,13 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - /@ampproject/remapping@2.2.1: - resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.20 - dev: false - /@babel/code-frame@7.22.13: resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.22.20 chalk: 2.4.2 - - /@babel/compat-data@7.23.2: - resolution: {integrity: sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==} - engines: {node: '>=6.9.0'} - dev: false - - /@babel/core@7.23.2: - resolution: {integrity: sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.22.13 - '@babel/generator': 7.23.0 - '@babel/helper-compilation-targets': 7.22.15 - '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) - '@babel/helpers': 7.23.2 - '@babel/parser': 7.23.0 - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 - '@babel/types': 7.23.0 - convert-source-map: 2.0.0 - debug: 4.3.4 - gensync: 1.0.0-beta.2 - json5: 2.2.3 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - dev: false + dev: true /@babel/generator@7.17.7: resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==} @@ -391,21 +356,12 @@ packages: '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.20 jsesc: 2.5.2 - - /@babel/helper-compilation-targets@7.22.15: - resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/compat-data': 7.23.2 - '@babel/helper-validator-option': 7.22.15 - browserslist: 4.22.1 - lru-cache: 5.1.1 - semver: 6.3.1 - dev: false + dev: true /@babel/helper-environment-visitor@7.22.20: resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} engines: {node: '>=6.9.0'} + dev: true /@babel/helper-function-name@7.23.0: resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} @@ -413,75 +369,31 @@ packages: dependencies: '@babel/template': 7.22.15 '@babel/types': 7.23.0 + dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.23.0 - - /@babel/helper-module-imports@7.22.15: - resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.0 - dev: false - - /@babel/helper-module-transforms@7.23.0(@babel/core@7.23.2): - resolution: {integrity: sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.23.2 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 - dev: false - - /@babel/helper-plugin-utils@7.22.5: - resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} - engines: {node: '>=6.9.0'} - dev: false - - /@babel/helper-simple-access@7.22.5: - resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.23.0 - dev: false + dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.23.0 + dev: true /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} + dev: true /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} - - /@babel/helper-validator-option@7.22.15: - resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} - engines: {node: '>=6.9.0'} - dev: false - - /@babel/helpers@7.23.2: - resolution: {integrity: sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.22.15 - '@babel/traverse': 7.23.2 - '@babel/types': 7.23.0 - transitivePeerDependencies: - - supports-color - dev: false + dev: true /@babel/highlight@7.22.20: resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} @@ -490,6 +402,7 @@ packages: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 + dev: true /@babel/parser@7.23.0: resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} @@ -497,26 +410,7 @@ packages: hasBin: true dependencies: '@babel/types': 7.17.0 - - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.2 - '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.23.2): - resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.23.2 - '@babel/helper-plugin-utils': 7.22.5 - dev: false + dev: true /@babel/runtime@7.23.2: resolution: {integrity: sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==} @@ -531,6 +425,7 @@ packages: '@babel/code-frame': 7.22.13 '@babel/parser': 7.23.0 '@babel/types': 7.23.0 + dev: true /@babel/traverse@7.23.2: resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} @@ -548,6 +443,7 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color + dev: true /@babel/types@7.17.0: resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==} @@ -555,6 +451,7 @@ packages: dependencies: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + dev: true /@babel/types@7.23.0: resolution: {integrity: sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==} @@ -563,6 +460,7 @@ packages: '@babel/helper-string-parser': 7.22.5 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + dev: true /@emotion/is-prop-valid@0.8.8: resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} @@ -776,13 +674,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.52.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.53.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.52.0 + eslint: 8.53.0 eslint-visitor-keys: 3.4.3 dev: true @@ -791,8 +689,8 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.1.2: - resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} + /@eslint/eslintrc@2.1.3: + resolution: {integrity: sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -808,8 +706,8 @@ packages: - supports-color dev: true - /@eslint/js@8.52.0: - resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} + /@eslint/js@8.53.0: + resolution: {integrity: sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -1824,7 +1722,7 @@ packages: classcat: 5.0.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + zustand: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' - immer @@ -1840,7 +1738,7 @@ packages: classcat: 5.0.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + zustand: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' - immer @@ -1862,7 +1760,7 @@ packages: d3-zoom: 3.0.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + zustand: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' - immer @@ -1882,7 +1780,7 @@ packages: d3-zoom: 3.0.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + zustand: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' - immer @@ -1900,7 +1798,7 @@ packages: d3-selection: 3.0.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + zustand: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' - immer @@ -1916,7 +1814,7 @@ packages: classcat: 5.0.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) + zustand: 4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' - immer @@ -2137,21 +2035,21 @@ packages: '@tanstack/query-persist-client-core': 5.4.3 dev: false - /@tanstack/react-query-persist-client@5.4.3(@tanstack/react-query@5.4.3)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-gpusG6IG6rnmdRT3onSjmRVG60K3BlsdUQifBVeLdi4uen1rvRAiB5a7jr4hFVMItzS9C4jBxJMWt/DmZpy6Ow==} + /@tanstack/react-query-persist-client@5.7.0(@tanstack/react-query@5.7.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-wcGu5z3nvJnFNEQ2zEe62N+HmjvImML2x3IPeZsieS6kLk097t7kcJjjppRcM6OgM4cPljUFXVhBboONGeMXXA==} peerDependencies: - '@tanstack/react-query': ^5.4.3 + '@tanstack/react-query': ^5.7.0 react: ^18.0.0 react-dom: ^18.0.0 dependencies: '@tanstack/query-persist-client-core': 5.4.3 - '@tanstack/react-query': 5.4.3(react-dom@18.2.0)(react@18.2.0) + '@tanstack/react-query': 5.7.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@tanstack/react-query@5.4.3(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-4aSOrRNa6yEmf7mws5QPTVMn8Lp7L38tFoTZ0c1ZmhIvbr8GIA0WT7X5N3yz/nuK8hUtjw9cAzBr4BPDZZ+tzA==} + /@tanstack/react-query@5.7.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-f6F9OdW4MC0bwlYPXop114ngkkZtg650TeJpR2/ME9q/iJ/59dg2+LoGHEdHk2w1mNAdiuiPFYzCcl2WNkFiiw==} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 @@ -2680,8 +2578,8 @@ packages: - supports-color dev: true - /@types/d3-array@3.0.9: - resolution: {integrity: sha512-mZowFN3p64ajCJJ4riVYlOjNlBJv3hctgAY01pjw3qTnJePD8s9DZmYDzhHKvzfCYvdjwylkU38+Vdt7Cu2FDA==} + /@types/d3-array@3.2.0: + resolution: {integrity: sha512-tjU8juPSfhMnu6mJZPOCVVGba4rZoE0tjHDPb81PYwA8CzbaFscGjgkUM7juUJu6iWA1cCVWNEVwxZ5HN9Jj8Q==} dev: false /@types/d3-axis@3.0.5: @@ -2707,7 +2605,7 @@ packages: /@types/d3-contour@3.0.5: resolution: {integrity: sha512-wLvjwdOQVd1NL1IcW90CCt1VtpeZ3V20p/OTXlkT8uAiprrJnq2PNNnRNe1QCez4U9aMU29Z14zpJQVLW1+Lcg==} dependencies: - '@types/d3-array': 3.0.9 + '@types/d3-array': 3.2.0 '@types/geojson': 7946.0.12 dev: false @@ -2827,7 +2725,7 @@ packages: /@types/d3@7.4.2: resolution: {integrity: sha512-Y4g2Yb30ZJmmtqAJTqMRaqXwRawfvpdpVmyEYEcyGNhrQI/Zvkq3k7yE1tdN07aFSmNBfvmegMQ9Fe2qy9ZMhw==} dependencies: - '@types/d3-array': 3.0.9 + '@types/d3-array': 3.2.0 '@types/d3-axis': 3.0.5 '@types/d3-brush': 3.0.5 '@types/d3-chord': 3.0.5 @@ -2930,7 +2828,7 @@ packages: resolution: {integrity: sha512-l2Q7ESxMv6HK2jc6I1qwMMGbh5bpHYQVCpXs0GsFmzaXoPibX50pHzs+PGfmegDY8TvmMGKWBgGI16ytqK6iIw==} dev: true - /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2942,13 +2840,13 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 6.9.1 - '@typescript-eslint/type-utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/type-utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 @@ -2959,7 +2857,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.9.1(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/parser@6.9.1(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2974,7 +2872,7 @@ packages: '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 typescript: 5.2.2 transitivePeerDependencies: - supports-color @@ -2988,7 +2886,7 @@ packages: '@typescript-eslint/visitor-keys': 6.9.1 dev: true - /@typescript-eslint/type-utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/type-utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2999,9 +2897,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: @@ -3034,19 +2932,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@types/json-schema': 7.0.14 '@types/semver': 7.5.4 '@typescript-eslint/scope-manager': 6.9.1 '@typescript-eslint/types': 6.9.1 '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) - eslint: 8.52.0 + eslint: 8.53.0 semver: 7.5.4 transitivePeerDependencies: - supports-color @@ -3088,6 +2986,7 @@ packages: resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} engines: {node: '>=0.4.0'} hasBin: true + dev: true /ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -3120,6 +3019,7 @@ packages: engines: {node: '>=4'} dependencies: color-convert: 1.9.3 + dev: true /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} @@ -3246,7 +3146,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.1 - caniuse-lite: 1.0.30001559 + caniuse-lite: 1.0.30001561 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -3294,10 +3194,11 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001559 - electron-to-chromium: 1.4.574 + caniuse-lite: 1.0.30001561 + electron-to-chromium: 1.4.576 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) + dev: true /bufferutil@4.0.8: resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} @@ -3324,8 +3225,9 @@ packages: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} - /caniuse-lite@1.0.30001559: - resolution: {integrity: sha512-cPiMKZgqgkg5LY3/ntGeLFUpi6tzddBNS58A4tnTgQw1zON7u2sZMU7SzOeVH4tj20++9ggL+V6FDOFMTaFFYA==} + /caniuse-lite@1.0.30001561: + resolution: {integrity: sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==} + dev: true /case-anything@2.1.13: resolution: {integrity: sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==} @@ -3339,6 +3241,7 @@ packages: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 + dev: true /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} @@ -3400,6 +3303,7 @@ packages: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 + dev: true /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} @@ -3410,6 +3314,7 @@ packages: /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} @@ -3431,10 +3336,6 @@ packages: /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - /convert-source-map@2.0.0: - resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - dev: false - /crelt@1.0.6: resolution: {integrity: sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==} dev: false @@ -3682,8 +3583,9 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.574: - resolution: {integrity: sha512-bg1m8L0n02xRzx4LsTTMbBPiUd9yIR+74iPtS/Ao65CuXvhVZHP0ym1kSdDG3yHFDXqHQQBKujlN1AQ8qZnyFg==} + /electron-to-chromium@1.4.576: + resolution: {integrity: sha512-yXsZyXJfAqzWk1WKryr0Wl0MN2D47xodPvEEwlVePBnhU5E7raevLQR+E6b9JAD3GfL/7MbAL9ZtWQQPcLx7wA==} + dev: true /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} @@ -3851,25 +3753,27 @@ packages: /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} + dev: true /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} + dev: true /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@9.0.0(eslint@8.52.0): + /eslint-config-prettier@9.0.0(eslint@8.53.0): resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.52.0 + eslint: 8.53.0 dev: true - /eslint-plugin-jsx-a11y@6.8.0(eslint@8.52.0): + /eslint-plugin-jsx-a11y@6.8.0(eslint@8.53.0): resolution: {integrity: sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==} engines: {node: '>=4.0'} peerDependencies: @@ -3885,7 +3789,7 @@ packages: damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 es-iterator-helpers: 1.0.15 - eslint: 8.52.0 + eslint: 8.53.0 hasown: 2.0.0 jsx-ast-utils: 3.3.5 language-tags: 1.0.9 @@ -3894,7 +3798,7 @@ packages: object.fromentries: 2.0.7 dev: true - /eslint-plugin-react@7.33.2(eslint@8.52.0): + /eslint-plugin-react@7.33.2(eslint@8.53.0): resolution: {integrity: sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==} engines: {node: '>=4'} peerDependencies: @@ -3905,7 +3809,7 @@ packages: array.prototype.tosorted: 1.1.2 doctrine: 2.1.0 es-iterator-helpers: 1.0.15 - eslint: 8.52.0 + eslint: 8.53.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 @@ -3919,12 +3823,12 @@ packages: string.prototype.matchall: 4.0.10 dev: true - /eslint-plugin-simple-import-sort@10.0.0(eslint@8.52.0): + /eslint-plugin-simple-import-sort@10.0.0(eslint@8.53.0): resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==} peerDependencies: eslint: '>=5.0.0' dependencies: - eslint: 8.52.0 + eslint: 8.53.0 dev: true /eslint-scope@7.2.2: @@ -3940,15 +3844,15 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.52.0: - resolution: {integrity: sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==} + /eslint@8.53.0: + resolution: {integrity: sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.2 - '@eslint/js': 8.52.0 + '@eslint/eslintrc': 2.1.3 + '@eslint/js': 8.53.0 '@humanwhocodes/config-array': 0.11.13 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -4179,11 +4083,6 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true - /gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - dev: false - /get-intrinsic@1.2.2: resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} dependencies: @@ -4247,6 +4146,7 @@ packages: /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} + dev: true /globals@13.23.0: resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} @@ -4295,6 +4195,7 @@ packages: /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} + dev: true /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} @@ -4368,6 +4269,10 @@ packages: safer-buffer: 2.1.2 dev: true + /idb-keyval@6.2.1: + resolution: {integrity: sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==} + dev: false + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} @@ -4643,6 +4548,7 @@ packages: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} hasBin: true + dev: true /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -4656,12 +4562,6 @@ packages: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: true - /json5@2.2.3: - resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} - engines: {node: '>=6'} - hasBin: true - dev: false - /jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} @@ -4678,11 +4578,6 @@ packages: json-buffer: 3.0.1 dev: true - /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 @@ -4801,12 +4696,6 @@ packages: engines: {node: 14 || >=16.14} dev: false - /lru-cache@5.1.1: - resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - dependencies: - yallist: 3.1.1 - dev: false - /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -4846,8 +4735,8 @@ packages: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} dev: false - /media-chrome@1.5.0: - resolution: {integrity: sha512-SHNADjnslaSOOETAfphH0kQyMLnkdxjPGxQ/QUlk9AeiHHBZCNSU+7y0sKWHoYBdC0fM3SIgqaS+qb99ObSVdQ==} + /media-chrome@1.5.2: + resolution: {integrity: sha512-wMWYZXjRqXhv2gYR2arQAMphDXLVVPVmyLQFeI0NjBhKQ36oZujqGiiNBhP3leE4ol+t8oXoziPamt2qAeGpxw==} dev: false /merge-stream@2.0.0: @@ -4865,22 +4754,6 @@ packages: braces: 3.0.2 picomatch: 2.3.1 - /million@2.6.4: - resolution: {integrity: sha512-voUkdd/jHWrG+7NS+mX49Pat+POKdgGW78V7pYMSrTaOjUitR6ySEcAci8hn17Rsx1IMI3+5w41dkADM1J1ZEg==} - hasBin: true - dependencies: - '@babel/core': 7.23.2 - '@babel/generator': 7.23.0 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.2) - '@babel/types': 7.23.0 - kleur: 4.1.5 - rollup: 3.29.4 - unplugin: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: false - /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -4949,6 +4822,7 @@ packages: /node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} + dev: true /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} @@ -5227,7 +5101,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.31 - yaml: 2.3.3 + yaml: 2.3.4 /postcss-nested@6.0.1(postcss@8.4.31): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} @@ -5526,8 +5400,8 @@ packages: scheduler: 0.23.0 dev: false - /react-hook-form@7.47.0(react@18.2.0): - resolution: {integrity: sha512-F/TroLjTICipmHeFlMrLtNLceO2xr1jU3CyiNla5zdwsGUGu2UOxxR4UyJgLlhMwLW/Wzp4cpJ7CPfgJIeKdSg==} + /react-hook-form@7.48.1(react@18.2.0): + resolution: {integrity: sha512-RPLOfCL+qC1lOTknh9OrgeFbchYUJ4KFgrqZTVHf0nRizcwzQUABrBIQk3SkujiqIXTs5xjP6eApc7FOpvpS1Q==} engines: {node: '>=12.22.0'} peerDependencies: react: ^16.8.0 || ^17 || ^18 @@ -5751,6 +5625,7 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.3 + dev: true /rope-sequence@1.3.4: resolution: {integrity: sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==} @@ -5798,6 +5673,7 @@ packages: /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + dev: true /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} @@ -5982,6 +5858,7 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 + dev: true /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} @@ -6096,6 +5973,7 @@ packages: /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} + dev: true /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} @@ -6236,15 +6114,6 @@ packages: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} dev: true - /unplugin@1.5.0: - resolution: {integrity: sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==} - dependencies: - acorn: 8.11.2 - chokidar: 3.5.3 - webpack-sources: 3.2.3 - webpack-virtual-modules: 0.5.0 - dev: false - /update-browserslist-db@1.0.13(browserslist@4.22.1): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true @@ -6254,6 +6123,7 @@ packages: browserslist: 4.22.1 escalade: 3.1.1 picocolors: 1.0.0 + dev: true /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -6316,8 +6186,8 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - /virtua@0.16.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-laq+Jpi6W73sXdXvLIxu+BLaFtUhP1Al25TJ/MwTHKTF5A9Kfs02xqHXsaLlh9WXk/eVbrwHt/+AM9U0dT6Hqg==} + /virtua@0.16.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-PiJWO++uDo7efG+gSgedm8sC4aoPL0C7tLxM4bHs62SAPlF8n9NdvpRzgsRhhMj0HA319BXPPKPRvimg4n+2Yw==} peerDependencies: react: '>=16.14.0' react-dom: '>=16.14.0' @@ -6388,15 +6258,6 @@ packages: engines: {node: '>= 8'} dev: false - /webpack-sources@3.2.3: - resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} - engines: {node: '>=10.13.0'} - dev: false - - /webpack-virtual-modules@0.5.0: - resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} - dev: false - /websocket-polyfill@0.0.3: resolution: {integrity: sha512-pF3kR8Uaoau78MpUmFfzbIRxXj9PeQrCuPepGE6JIsfsJ/o/iXr07Q2iQNzKSSblQJ0FiGWlS64N4pVSm+O3Dg==} dependencies: @@ -6493,10 +6354,6 @@ packages: engines: {node: '>=0.10.32'} dev: false - /yallist@3.1.1: - resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} - dev: false - /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true @@ -6504,14 +6361,19 @@ packages: /yaml@2.3.3: resolution: {integrity: sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==} engines: {node: '>= 14'} + dev: true + + /yaml@2.3.4: + resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} + engines: {node: '>= 14'} /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true - /zustand@4.4.5(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0): - resolution: {integrity: sha512-jgIrBBLKncQW74PA2Lclct3gwD4aPughwGE4FqlXrv3rDqQox7JCn8rwUiFK6ygJcbBAvfTf8fF+ICg7HLD2FQ==} + /zustand@4.4.6(@types/react@18.2.34)(immer@10.0.3)(react@18.2.0): + resolution: {integrity: sha512-Rb16eW55gqL4W2XZpJh0fnrATxYEG3Apl2gfHTyDSE965x/zxslTikpNch0JgNjJA9zK6gEFW8Fl6d1rTZaqgg==} engines: {node: '>=12.7.0'} peerDependencies: '@types/react': '>=16.8' diff --git a/src/app/space/index.tsx b/src/app/space/index.tsx index dd63dc9b..2726d9c1 100644 --- a/src/app/space/index.tsx +++ b/src/app/space/index.tsx @@ -100,7 +100,7 @@ export function SpaceScreen() { if (status === 'pending') { return ( -
+
); diff --git a/src/libs/ndk/provider.tsx b/src/libs/ndk/provider.tsx index 525e5e26..1cab3da4 100644 --- a/src/libs/ndk/provider.tsx +++ b/src/libs/ndk/provider.tsx @@ -28,9 +28,9 @@ const NDKProvider = ({ children }: PropsWithChildren) => { data-tauri-drag-region className="flex h-screen w-screen items-center justify-center bg-neutral-50 dark:bg-neutral-950" > -
- -

Connecting to relays

+
+

Connecting to relays...

+
); diff --git a/src/libs/storage/provider.tsx b/src/libs/storage/provider.tsx index 59f29ebf..c6ccbcd2 100644 --- a/src/libs/storage/provider.tsx +++ b/src/libs/storage/provider.tsx @@ -60,11 +60,11 @@ const StorageProvider = ({ children }: PropsWithChildren) => { data-tauri-drag-region className="flex h-screen w-screen items-center justify-center bg-neutral-50 dark:bg-neutral-950" > -
- -

- {isNewVersion ? 'Found a new version, updating' : 'Checking for updates'} +

+

+ {isNewVersion ? 'Found a new version, updating' : 'Checking for updates...'}

+
); diff --git a/src/main.jsx b/src/main.jsx index 039b2bd9..39f2d8f1 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -31,7 +31,8 @@ root.render( persister, dehydrateOptions: { shouldDehydrateQuery: (query) => { - if (query.queryKey !== 'widgets') return true; + if (query.queryKey === 'widgets') return false; + return true; }, }, }} diff --git a/src/shared/notes/child.tsx b/src/shared/notes/child.tsx index d9d0a547..0937a08a 100644 --- a/src/shared/notes/child.tsx +++ b/src/shared/notes/child.tsx @@ -1,5 +1,6 @@ import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { nip19 } from 'nostr-tools'; +import { useCallback } from 'react'; import { ArticleNote, @@ -17,18 +18,21 @@ import { useEvent } from '@utils/hooks/useEvent'; export function ChildNote({ id, root }: { id: string; root?: string }) { const { status, data } = useEvent(id); - const renderKind = (event: NDKEvent) => { - switch (event.kind) { - case NDKKind.Text: - return ; - case NDKKind.Article: - return ; - case 1063: - return ; - default: - return ; - } - }; + const renderKind = useCallback( + (event: NDKEvent) => { + switch (event.kind) { + case NDKKind.Text: + return ; + case NDKKind.Article: + return ; + case 1063: + return ; + default: + return ; + } + }, + [id] + ); if (status === 'pending') { return ( diff --git a/src/shared/notes/kinds/file.tsx b/src/shared/notes/kinds/file.tsx index 380f2446..38fb833b 100644 --- a/src/shared/notes/kinds/file.tsx +++ b/src/shared/notes/kinds/file.tsx @@ -4,11 +4,10 @@ import { download } from '@tauri-apps/plugin-upload'; import { MediaControlBar, MediaController, + MediaFullscreenButton, MediaMuteButton, MediaPlayButton, - MediaTimeDisplay, MediaTimeRange, - MediaVolumeRange, } from 'media-chrome/dist/react'; import { memo } from 'react'; @@ -56,9 +55,8 @@ export function FileNote(props: { event?: NDKEvent }) { - - + ); diff --git a/src/shared/notes/kinds/repost.tsx b/src/shared/notes/kinds/repost.tsx index 83bee3ed..44a972bc 100644 --- a/src/shared/notes/kinds/repost.tsx +++ b/src/shared/notes/kinds/repost.tsx @@ -36,18 +36,21 @@ export function Repost({ event }: { event: NDKEvent }) { refetchOnWindowFocus: false, }); - const renderKind = useCallback((repostEvent: NDKEvent) => { - switch (repostEvent.kind) { - case NDKKind.Text: - return ; - case NDKKind.Article: - return ; - case 1063: - return ; - default: - return ; - } - }, []); + const renderKind = useCallback( + (repostEvent: NDKEvent) => { + switch (repostEvent.kind) { + case NDKKind.Text: + return ; + case NDKKind.Article: + return ; + case 1063: + return ; + default: + return ; + } + }, + [event.id] + ); if (embedEvent) { return ( diff --git a/src/shared/notes/kinds/text.tsx b/src/shared/notes/kinds/text.tsx index 9052999b..42e72480 100644 --- a/src/shared/notes/kinds/text.tsx +++ b/src/shared/notes/kinds/text.tsx @@ -1,28 +1,21 @@ import { memo } from 'react'; -import { ImagePreview, LinkPreview, VideoPreview } from '@shared/notes'; - import { useRichContent } from '@utils/hooks/useRichContent'; export function TextNote(props: { content?: string; truncate?: boolean }) { - const { parsedContent, images, videos, linkPreview } = useRichContent(props.content); + const { parsedContent } = useRichContent(props.content); if (props.truncate) { return ( -
+
{props.content}
); } return ( -
-
- {parsedContent} -
- {images.length ? : null} - {videos.length ? : null} - {linkPreview ? : null} +
+ {parsedContent}
); } diff --git a/src/shared/notes/preview/image.tsx b/src/shared/notes/preview/image.tsx index 5b2c33e3..1e356361 100644 --- a/src/shared/notes/preview/image.tsx +++ b/src/shared/notes/preview/image.tsx @@ -5,7 +5,7 @@ import Zoom from 'react-medium-image-zoom'; import { DownloadIcon } from '@shared/icons'; -export function ImagePreview({ urls }: { urls: string[] }) { +export function ImagePreview({ url }: { url: string }) { const downloadImage = async (url: string) => { const downloadDirPath = await downloadDir(); const filename = url.substring(url.lastIndexOf('/') + 1); @@ -17,29 +17,25 @@ export function ImagePreview({ urls }: { urls: string[] }) { }; return ( -
- {urls.map((url) => ( - -
- {url} - -
-
- ))} -
+ +
+ {url} + +
+
); } diff --git a/src/shared/notes/preview/link.tsx b/src/shared/notes/preview/link.tsx index a0fe3f4c..3097550d 100644 --- a/src/shared/notes/preview/link.tsx +++ b/src/shared/notes/preview/link.tsx @@ -12,7 +12,7 @@ export function LinkPreview({ url }: { url: string }) { if (status === 'pending') { return ( -
+
@@ -30,7 +30,7 @@ export function LinkPreview({ url }: { url: string }) { to={url} target="_blank" rel="noreferrer" - className="flex w-full flex-col rounded-lg border border-neutral-300 bg-neutral-200 dark:border-neutral-700 dark:bg-neutral-800" + className="mt-2 flex w-full flex-col rounded-lg border border-neutral-300 bg-neutral-200 dark:border-neutral-700 dark:bg-neutral-800" > {isImage(data.image) ? (
{data.title && ( -
+
{data.title} -
+
)} {data.description ? ( -

+

{data.description} -

+
) : null}
- +
{domain.hostname} - +
); diff --git a/src/shared/notes/preview/video.tsx b/src/shared/notes/preview/video.tsx index 1432f00d..2a50d79b 100644 --- a/src/shared/notes/preview/video.tsx +++ b/src/shared/notes/preview/video.tsx @@ -1,28 +1,27 @@ import { MediaControlBar, MediaController, + MediaFullscreenButton, + MediaLoadingIndicator, MediaMuteButton, MediaPlayButton, - MediaTimeDisplay, MediaTimeRange, - MediaVolumeRange, } from 'media-chrome/dist/react'; -export function VideoPreview({ urls }: { urls: string[] }) { +export function VideoPreview({ url }: { url: string }) { return ( -
- {urls.map((url) => ( - - - ))} -
+ + ); } diff --git a/src/shared/notes/wrapper.tsx b/src/shared/notes/wrapper.tsx index 6b3fc0af..51551c9c 100644 --- a/src/shared/notes/wrapper.tsx +++ b/src/shared/notes/wrapper.tsx @@ -16,9 +16,12 @@ export function NoteWrapper({ return event.tags[0][1]; } return event.tags.find((el) => el[3] === 'root')?.[1]; - }, [event]); + }, [event.id]); - const reply = useMemo(() => event.tags.find((el) => el[3] === 'reply')?.[1], []); + const reply = useMemo( + () => event.tags.find((el) => el[3] === 'reply')?.[1], + [event.id] + ); return (
diff --git a/src/shared/user.tsx b/src/shared/user.tsx index 46dd6adb..30aa39e1 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -1,7 +1,7 @@ import * as Avatar from '@radix-ui/react-avatar'; import * as HoverCard from '@radix-ui/react-hover-card'; import { minidenticon } from 'minidenticons'; -import { memo } from 'react'; +import { memo, useMemo } from 'react'; import { Link } from 'react-router-dom'; import { RepostIcon, WorldIcon } from '@shared/icons'; @@ -39,9 +39,11 @@ export const User = memo(function User({ }) { const { status, user } = useProfile(pubkey, embedProfile); - const createdAt = formatCreatedAt(time, variant === 'chat'); - const svgURI = - 'data:image/svg+xml;utf8,' + encodeURIComponent(minidenticon(pubkey, 90, 50)); + const createdAt = useMemo(() => formatCreatedAt(time, variant === 'chat'), [pubkey]); + const svgURI = useMemo( + () => 'data:image/svg+xml;utf8,' + encodeURIComponent(minidenticon(pubkey, 90, 50)), + [pubkey] + ); if (variant === 'mention') { if (status === 'pending') { diff --git a/src/shared/widgets/liveUpdater.tsx b/src/shared/widgets/liveUpdater.tsx new file mode 100644 index 00000000..7e42c8bc --- /dev/null +++ b/src/shared/widgets/liveUpdater.tsx @@ -0,0 +1,77 @@ +import { NDKEvent, NDKFilter, NDKKind, NDKSubscription } from '@nostr-dev-kit/ndk'; +import { QueryStatus, useQueryClient } from '@tanstack/react-query'; +import { forwardRef, useEffect, useState } from 'react'; +import { VListHandle } from 'virtua'; + +import { useNDK } from '@libs/ndk/provider'; +import { useStorage } from '@libs/storage/provider'; + +import { ChevronUpIcon } from '@shared/icons'; + +export const LiveUpdater = forwardRef(function LiveUpdater({ + status, + ref, +}: { + status: QueryStatus; + ref: VListHandle; +}) { + const { db } = useStorage(); + const { ndk } = useNDK(); + + const [events, setEvents] = useState([]); + const queryClient = useQueryClient(); + + const update = async () => { + await queryClient.setQueryData( + ['newsfeed'], + (prev: { pageParams: number; pages: Array }) => ({ + ...prev, + pages: [[...events], ...prev.pages], + }) + ); + + // reset + setEvents([]); + + // scroll to top + ref.scrollToIndex(0, { smooth: true }); + }; + + useEffect(() => { + let sub: NDKSubscription = undefined; + + if (status === 'success' && db.account && db.account.circles.length > 0) { + queryClient.fetchQuery({ queryKey: ['notification'] }); + + const filter: NDKFilter = { + kinds: [NDKKind.Text, NDKKind.Repost], + authors: db.account.circles, + since: Math.floor(Date.now() / 1000), + }; + + sub = ndk.subscribe(filter, { closeOnEose: false, groupable: false }); + sub.addListener('event', (event: NDKEvent) => + setEvents((prev) => [...prev, event]) + ); + } + + return () => { + if (sub) sub.stop(); + }; + }, [status]); + + if (!events.length) return null; + + return ( +
+ +
+ ); +}); diff --git a/src/shared/widgets/newsfeed.tsx b/src/shared/widgets/newsfeed.tsx index 3f9416de..b8bb6ed1 100644 --- a/src/shared/widgets/newsfeed.tsx +++ b/src/shared/widgets/newsfeed.tsx @@ -1,15 +1,13 @@ -import { NDKEvent, NDKFilter, NDKKind, NDKSubscription } from '@nostr-dev-kit/ndk'; -import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query'; -import { useCallback, useEffect, useMemo } from 'react'; -import { VList } from 'virtua'; +import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; +import { useInfiniteQuery } from '@tanstack/react-query'; +import { useCallback, useMemo, useRef } from 'react'; +import { VList, VListHandle } from 'virtua'; import { useNDK } from '@libs/ndk/provider'; import { useStorage } from '@libs/storage/provider'; import { ArrowRightCircleIcon, LoaderIcon } from '@shared/icons'; import { - MemoizedArticleNote, - MemoizedFileNote, MemoizedRepost, MemoizedTextNote, NoteSkeleton, @@ -19,9 +17,9 @@ import { import { TitleBar } from '@shared/titleBar'; import { WidgetWrapper } from '@shared/widgets'; -export function NewsfeedWidget() { - const queryClient = useQueryClient(); +import { LiveUpdater } from './liveUpdater'; +export function NewsfeedWidget() { const { db } = useStorage(); const { relayUrls, ndk, fetcher } = useNDK(); const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } = @@ -41,10 +39,10 @@ export function NewsfeedWidget() { const events = await fetcher.fetchLatestEvents( relayUrls, { - kinds: [NDKKind.Text, NDKKind.Repost, 1063, NDKKind.Article], + kinds: [NDKKind.Text, NDKKind.Repost], authors: db.account.circles, }, - 50, + 20, { asOf: pageParam === 0 ? undefined : pageParam, abortSignal: signal } ); @@ -70,79 +68,42 @@ export function NewsfeedWidget() { if (!lastEvent) return; return lastEvent.created_at - 1; }, + refetchOnWindowFocus: false, }); + const ref = useRef(); const allEvents = useMemo( () => (data ? data.pages.flatMap((page) => page) : []), [data] ); - const renderItem = useCallback((event: NDKEvent) => { - switch (event.kind) { - case NDKKind.Text: - return ( - - - - ); - case NDKKind.Repost: - return ; - case 1063: - return ( - - - - ); - case NDKKind.Article: - return ( - - - - ); - default: - return ( - - - - ); - } - }, []); - - useEffect(() => { - let sub: NDKSubscription = undefined; - - if (status === 'success' && db.account && db.account.circles.length > 0) { - queryClient.fetchQuery({ queryKey: ['notification'] }); - - const filter: NDKFilter = { - kinds: [NDKKind.Text, NDKKind.Repost], - authors: db.account.circles, - since: Math.floor(Date.now() / 1000), - }; - - sub = ndk.subscribe(filter, { closeOnEose: false, groupable: false }); - sub.addListener('event', async (event: NDKEvent) => { - await queryClient.setQueryData( - ['newsfeed'], - (prev: { pageParams: number; pages: Array }) => ({ - ...prev, - pages: [[event], ...prev.pages], - }) - ); - }); - } - - return () => { - if (sub) sub.stop(); - }; - }, [status]); - - console.log('RERENDER'); + const renderItem = useCallback( + (event: NDKEvent) => { + switch (event.kind) { + case NDKKind.Text: + return ( + + + + ); + case NDKKind.Repost: + return ; + default: + return ( + + + + ); + } + }, + [data] + ); return ( - + + {status === 'pending' ? (
diff --git a/src/shared/widgets/notification.tsx b/src/shared/widgets/notification.tsx index 0123cd87..493ba319 100644 --- a/src/shared/widgets/notification.tsx +++ b/src/shared/widgets/notification.tsx @@ -38,7 +38,7 @@ export function NotificationWidget() { kinds: [NDKKind.Text, NDKKind.Repost, NDKKind.Reaction, NDKKind.Zap], '#p': [db.account.pubkey], }, - 50, + 20, { asOf: pageParam === 0 ? undefined : pageParam, abortSignal: signal } ); @@ -139,7 +139,7 @@ export function NotificationWidget() { return ( - + {status === 'pending' ? (
diff --git a/src/shared/widgets/wrapper.tsx b/src/shared/widgets/wrapper.tsx index 63496081..112b3075 100644 --- a/src/shared/widgets/wrapper.tsx +++ b/src/shared/widgets/wrapper.tsx @@ -21,7 +21,7 @@ export function WidgetWrapper({ minWidth={420} maxWidth={600} className={twMerge( - 'flex flex-col border-r-2 border-neutral-50 hover:border-neutral-100 dark:border-neutral-950 dark:hover:border-neutral-900', + 'relative flex flex-col border-r-2 border-neutral-50 hover:border-neutral-100 dark:border-neutral-950 dark:hover:border-neutral-900', className )} enable={{ right: true }} diff --git a/src/utils/hooks/useRichContent.tsx b/src/utils/hooks/useRichContent.tsx index 0c7e2e79..71999140 100644 --- a/src/utils/hooks/useRichContent.tsx +++ b/src/utils/hooks/useRichContent.tsx @@ -3,7 +3,14 @@ import { ReactNode } from 'react'; import { Link } from 'react-router-dom'; import reactStringReplace from 'react-string-replace'; -import { Hashtag, MentionNote, MentionUser } from '@shared/notes'; +import { + Hashtag, + ImagePreview, + LinkPreview, + MentionNote, + MentionUser, + VideoPreview, +} from '@shared/notes'; const NOSTR_MENTIONS = [ '@npub1', @@ -42,17 +49,10 @@ export function useRichContent(content: string) { const text = content; const words = text.split(/(\s+)/); - const images = words - .filter((word) => IMAGES.some((el) => word.endsWith(el))) - .map((item: string) => item); - - const videos = words - .filter((word) => VIDEOS.some((el) => word.endsWith(el))) - .map((item: string) => item); - + const images = words.filter((word) => IMAGES.some((el) => word.endsWith(el))); + const videos = words.filter((word) => VIDEOS.some((el) => word.endsWith(el))); const hashtags = words.filter((word) => word.startsWith('#')); const events = words.filter((word) => NOSTR_EVENTS.some((el) => word.startsWith(el))); - const mentions = words.filter((word) => NOSTR_MENTIONS.some((el) => word.startsWith(el)) ); @@ -60,15 +60,17 @@ export function useRichContent(content: string) { try { if (images.length) { images.forEach((image) => { - // @ts-expect-error, it is string at this time - parsedContent = parsedContent.replace(image, ''); + parsedContent = reactStringReplace(parsedContent, image, (match, i) => ( + + )); }); } if (videos.length) { videos.forEach((video) => { - // @ts-expect-error, it is string at this time - parsedContent = parsedContent.replace(video, ''); + parsedContent = reactStringReplace(parsedContent, video, (match, i) => ( + + )); }); } @@ -82,7 +84,7 @@ export function useRichContent(content: string) { if (events.length) { events.forEach((event) => { - const address = event.replace('nostr:', ''); + const address = event.replace('nostr:', '').replace(/[^a-zA-Z0-9]/g, ''); const decoded = nip19.decode(address); if (decoded.type === 'note') { @@ -101,7 +103,10 @@ export function useRichContent(content: string) { if (mentions.length) { mentions.forEach((mention) => { - const address = mention.replace('nostr:', '').replace('@', ''); + const address = mention + .replace('nostr:', '') + .replace('@', '') + .replace(/[^a-zA-Z0-9]/g, ''); const decoded = nip19.decode(address); if (decoded.type === 'npub') { @@ -119,18 +124,18 @@ export function useRichContent(content: string) { } parsedContent = reactStringReplace(parsedContent, /(https?:\/\/\S+)/g, (match, i) => { - if (!linkPreview) { - linkPreview = match; - if (content.length < 500) return null; - } - const url = new URL(match); url.search = ''; + if (!linkPreview) { + linkPreview = match; + return ; + } + return (