This commit is contained in:
Ren Amamiya 2023-09-21 15:28:01 +07:00
parent 17fe3bb1f6
commit 413571ee7f
11 changed files with 235 additions and 207 deletions

View File

@ -30,13 +30,13 @@
"@tanstack/react-query": "^4.35.3",
"@tanstack/react-virtual": "3.0.0-beta.54",
"@tauri-apps/api": "^1.4.0",
"@tiptap/extension-image": "^2.1.10",
"@tiptap/extension-mention": "^2.1.10",
"@tiptap/extension-placeholder": "^2.1.10",
"@tiptap/pm": "^2.1.10",
"@tiptap/react": "^2.1.10",
"@tiptap/starter-kit": "^2.1.10",
"@tiptap/suggestion": "^2.1.10",
"@tiptap/extension-image": "^2.1.11",
"@tiptap/extension-mention": "^2.1.11",
"@tiptap/extension-placeholder": "^2.1.11",
"@tiptap/pm": "^2.1.11",
"@tiptap/react": "^2.1.11",
"@tiptap/starter-kit": "^2.1.11",
"@tiptap/suggestion": "^2.1.11",
"dayjs": "^1.11.10",
"destr": "^2.0.1",
"html-to-text": "^9.0.5",
@ -68,14 +68,14 @@
"@tauri-apps/cli": "^1.4.0",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/html-to-text": "^9.0.2",
"@types/node": "^20.6.2",
"@types/node": "^20.6.3",
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"@types/youtube-player": "^5.5.7",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.15",
"autoprefixer": "^10.4.16",
"clsx": "^2.0.0",
"cross-env": "^7.0.3",
"csstype": "^3.1.2",

View File

@ -42,26 +42,26 @@ dependencies:
specifier: ^1.4.0
version: 1.4.0
'@tiptap/extension-image':
specifier: ^2.1.10
version: 2.1.10(@tiptap/core@2.1.10)
specifier: ^2.1.11
version: 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-mention':
specifier: ^2.1.10
version: 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)(@tiptap/suggestion@2.1.10)
specifier: ^2.1.11
version: 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)(@tiptap/suggestion@2.1.11)
'@tiptap/extension-placeholder':
specifier: ^2.1.10
version: 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
specifier: ^2.1.11
version: 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/pm':
specifier: ^2.1.10
version: 2.1.10
specifier: ^2.1.11
version: 2.1.11
'@tiptap/react':
specifier: ^2.1.10
version: 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)(react-dom@18.2.0)(react@18.2.0)
specifier: ^2.1.11
version: 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)(react-dom@18.2.0)(react@18.2.0)
'@tiptap/starter-kit':
specifier: ^2.1.10
version: 2.1.10(@tiptap/pm@2.1.10)
specifier: ^2.1.11
version: 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/suggestion':
specifier: ^2.1.10
version: 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
specifier: ^2.1.11
version: 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
dayjs:
specifier: ^1.11.10
version: 1.11.10
@ -152,8 +152,8 @@ devDependencies:
specifier: ^9.0.2
version: 9.0.2
'@types/node':
specifier: ^20.6.2
version: 20.6.2
specifier: ^20.6.3
version: 20.6.3
'@types/react':
specifier: ^18.2.22
version: 18.2.22
@ -173,8 +173,8 @@ devDependencies:
specifier: ^3.3.2
version: 3.3.2(vite@4.4.9)
autoprefixer:
specifier: ^10.4.15
version: 10.4.15(postcss@8.4.30)
specifier: ^10.4.16
version: 10.4.16(postcss@8.4.30)
clsx:
specifier: ^2.0.0
version: 2.0.0
@ -231,7 +231,7 @@ devDependencies:
version: 5.2.2
vite:
specifier: ^4.4.9
version: 4.4.9(@types/node@20.6.2)
version: 4.4.9(@types/node@20.6.3)
vite-tsconfig-paths:
specifier: ^4.2.1
version: 4.2.1(typescript@5.2.2)(vite@4.4.9)
@ -589,7 +589,7 @@ packages:
ajv: 6.12.6
debug: 4.3.4
espree: 9.6.1
globals: 13.21.0
globals: 13.22.0
ignore: 5.2.4
import-fresh: 3.3.0
js-yaml: 4.1.0
@ -1773,222 +1773,222 @@ packages:
'@tauri-apps/cli-win32-x64-msvc': 1.4.0
dev: true
/@tiptap/core@2.1.10(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-yhUKsac6nlqbPQfwQnp+4Jb110EqmzocXKoZacLwzHpM7JVsr2+LXMDu9kahtrvHNJErJljhnQvDHRsrrYeJkQ==}
/@tiptap/core@2.1.11(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-1W2DdjpPwfphHgQ3Qm4s5wzCnEjiXm1TeZ+6/zBl89yKURXgv8Mw1JGdj/NcImQjtDcsNn97MscACK3GKbEJBA==}
peerDependencies:
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/pm': 2.1.10
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-blockquote@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-lpBF/a+qgv4Bdf7HYisTkMFdFdGfn2SqspsydvG8UI7N9B/PfnCCrtoMaC3bqTaT6u8ZVxyM3Y3vnq2AxXJvBw==}
/@tiptap/extension-blockquote@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-IEVe3goA0rgp1G8Wm733BSRJiy71Vh2fmTCyZKWmc2A6GREVSy1X3fCvAo6pMENRObhjIoaBQUCE3p4iJYOxqg==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-bold@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-I43WCwc7pyz5vtKGj24Rjv7HN0EK5S4PlADQPBuhC1qQvfCTFvjrBB6ZmsekUMGmllW0qMOFVLSjtffpckqshA==}
/@tiptap/extension-bold@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-vhdkBtvd029ufOYt2ug49Gz+RLKSczO/CCqKYBqBmpIpsifyK7M6jkgamvAQg3c/vYk0LNcKiL2dp0Jp7L+5Gw==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-bubble-menu@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-XxgJajXkfAj/fChXkIwKBs7/3pd7OxV1uGc6Opx1qW/nSRYx/rr97654Sx/sg6auwIlbpRoqTmyqjbykGX1/yA==}
/@tiptap/extension-bubble-menu@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-WFJJpZvl9DP94Y5RQZB/THDxvDbrTo8tuhjT7yWlhseJ6zyhWmRXdutt39wfSZNFxitv/As+s7cO9aYLML/TVg==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
tippy.js: 6.3.7
dev: false
/@tiptap/extension-bullet-list@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-e6aFr29OSOmXsjFZB2zt3p8aeCWOx0C9Ayrpdf4QBUCOUJtt6FQPxxiYc+XZcdrYbLGLznA7QJlulCK9SGv2Fw==}
/@tiptap/extension-bullet-list@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-SOOVH2aSmdMtjWL7TTLbN72xbAFz2G5jifT4UCXb7Qx6LsyhNCyDCu0ukOW8rSosGoSdmBXxAsD9sBJ1jEOmZw==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-code-block@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-M+s89V9mP3tOoS6p/X2Dzw/Z7Fcg9EF0ZXlsMNifdlpwJlhAIYxI7vjPBmkMAFXTDB5eMZblXyNQaZ7v6V2Yeg==}
/@tiptap/extension-code-block@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-QhmhCCWqg/5qLXpZ3sl2A0rqJqV8zMOegcxUFaqcJMOqNbsuHcRgc9C+1hWSVLbCmstB7M6sgF02QpTBOkYHxg==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-code@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-1yy/kR0FAeMkDdAt1LW/FH6vlyZLqLZqY6BM+wBCiGrr+XeA5FTXih9iT/4gbTRuIzG0EPqx18nvroG7hUsWBg==}
/@tiptap/extension-code@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-G0UEbMFunujy/F86yHN0/dumPLbwTis9C+6IQv1XRPNsV28U0MgxBhlPcJUgyO5lwuleePDxiBVcRv2XrysgKw==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-document@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-jNlNGQIGg471DvzhADaEoRINa3LNghowrBbKK9d5wGVnbKRykNEPwjCf8zNl+m5NBmCZl3lsdznlwBk5zyh5Bg==}
/@tiptap/extension-document@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-L/iLuqxvJep33ycCFNrnUhdR0VtcZyeNnqB+ZvVHzEwLoRud+LBy44lpEdBrAFsvRm3DG14m/FGYL+TfaD0vxA==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-dropcursor@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-GhsWsCq6wLb8HJ32BeAm7ndv4lPyu1F7FFwmnARzEF5q54FV20kWSv2zC+Dv0dTvynXR3quXybdUM92xeNDovw==}
/@tiptap/extension-dropcursor@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-MiJepRpHlu93aInOMW8NeRCvm9VE5rL0MA9TONY/IspJFGFIqonc/01J6t33JQa3Xh/x3xAfis4nKa/UazeVJw==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-floating-menu@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-uChrDrY3usnF9wSegqq+YGaqd229p9gmaB5xyOyMERDs972hKj4Ul95rXzBBiMKAWUMw9eM09i7+ijTzz4KDUw==}
/@tiptap/extension-floating-menu@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-ExeoOQ6nT0CY0eWx6WjbG+osurXLXa7XrqIdhCAcTmzBAlGiKt8khX9qaZ+QF+BRK1r1lja2KX+5/fpLK7Dt1g==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
tippy.js: 6.3.7
dev: false
/@tiptap/extension-gapcursor@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-WSBT9X7dzg0HyMoMP/Yyxl28QwIJO90YzobI9z5mav86BQv7C5wU0fQSpbpAbsN3s7lxKhPwNrXkwkpnXT4ZCA==}
/@tiptap/extension-gapcursor@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-P/xjyhSOVyop5XXbNtRPgrooQrSlpYblwR67ClI9FAC7uQliuOwi5VcndmEItjWWSe85kJa2IHjOS7mLYvJe8A==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-hard-break@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-sYrzpPoV5jQri+duGb50nDTs+hOBQDxXTKlJuZNFfZMwgx6epwxb8xICcGAUJFShuuW8UAWCNcB4jG9tMqgvyw==}
/@tiptap/extension-hard-break@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-qhiPe6FA0b6PPb/ITlgSnY0l9tEVmXZ9e7eSjvks12ORfqL/dofSCLtChHWvhZxugzo92xejG2hXLi6lyOLbkg==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-heading@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-1OgmrRPMcY52WI7I4799xd4eIsEX/bI813B8mZvNYXLzZI75pLW1hmz1mUvBYyMwlcek74zVTGYgPy11o+2JEg==}
/@tiptap/extension-heading@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-QBtl0S1aDFB+F1wvTrS5iGdNUEeXp+WuTddj+L2f5EP4KqG2x7sj7e7ENMy20g/l8tbKwzd3AZZydvClH4Ybbw==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-history@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-tApuN8MIJMzc0dxvkYJPt3t5cea9NuZBGNiuVedJwMMUF6hbFpMZAt20GW2qwjBaZ76rQwbLp1s3KnImFsPe5A==}
/@tiptap/extension-history@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-88dovV2O9icmBn0IvaArFFeS6X5ts6BxZPu5VbGML8KBL8iAu+Og7RXEPdOy5e13K0K4V21fDpO3n7KdvNOAYQ==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-horizontal-rule@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-91lGpK2d6WMPhrMDPBURS8z8pEg1CUBYy7GmBenKvvgh+JzVhG+U6MtykfWNfm2R4iRXOl1xLbyUOCiOSUXodQ==}
/@tiptap/extension-horizontal-rule@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-uvHPa2YCKnDhtSBSZB3lk5U4H3wRKP0DNvVx4Y2F7MdQianVzcyOd1pZYO9BQs+lUB1aZots6doE69Zqz3mU2Q==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-image@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-d7+d4J2TJ99+phFbVTpsFhi208jAgcrfbdwUDkkwjdF+PQhax5pounSt/8eZPWdyCXj+EWYjCjx0znwsD6+SCA==}
/@tiptap/extension-image@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-dFFRvzl9F4fEcG95nyka72TeV127C1UVaMm816GHoFlVEFGV4yJ8NKgzT3UEDgFcs6OPwPlt8tuHuDeYm7EVOQ==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-italic@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-ebw5m+rWx6K5UoBVXSkz3fpvDJh/wScfYmwl6pkbjc2jNbZiln2LSiLHYc2eIYJ2aTsVxcw/n0Azfk5Lb19InA==}
/@tiptap/extension-italic@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-QmDsHtnBBit/1KtQpBPxjSPjDC1mVKtoNTgsEwMWK6YAkCKOKPj7oPEqqjaNZIRMKPPzE5XCsfBoS3jtVmo+6A==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-list-item@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-rRRyB14vOcSjTMAh8Y+50TRC/jO469CelGwFjOLrK1ZSEag5wmLDaqpWOOb52BFYnvCHuIm1HqZtdL5bTI/J1w==}
/@tiptap/extension-list-item@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-YhwHaPGhffsFsg/zjCu1G24//j/BTRDRZbZXmMwp77m1yEqPULcWyoWrI+gUzetQxJRD/ruAucqjLtoLLfICmQ==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-mention@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)(@tiptap/suggestion@2.1.10):
resolution: {integrity: sha512-OYt4etiv3N2rj+eQUZimuFHM8AK0DP90WknUFLBF++FKB7l50WOkVv7ZEK7i78JBzNkIN4vAI7K6NhY0HCvQzg==}
/@tiptap/extension-mention@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)(@tiptap/suggestion@2.1.11):
resolution: {integrity: sha512-QMHmAkhiDQEgAdUHdKRfVna0AINcbSbQCrpgwKLIHGWcpbi1zJbAPpm+xngbl0I9ZNxaMzbP4utTAzeQ92pJkw==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
'@tiptap/suggestion': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/suggestion': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
'@tiptap/suggestion': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-ordered-list@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-jouo3RHUMxU4dPzZcfZdUzmsLVp1KHrLIAD2YAxBuqArACrBNfJpIhtkTKuGLlaFhKqGr+EmNdNQnK8JOBhLtQ==}
/@tiptap/extension-ordered-list@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-/tghfEJ5U7WFbF8xyOqRJks8KxP/lRjnroMXMglaushSMx8PYPo1dZDB/dJZw7ksy47MAaKJfKlx3gyN2CPXBQ==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-paragraph@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-kzuHbrxcxpWkha5P+JFzCKT54pNqb4IBKMU5qT9YGhZSdNTtU63ncdCHM+Ad1ukLuvXAv95zh1IQC5j+Z1Qk4A==}
/@tiptap/extension-paragraph@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-gXMgJ2CU3X4yh1wKnb8RdbDmhITB76pH6DX0uWprmEgvzNMN3Qw+h5uBD9lgxg1WVghbCmkG9mY9J4PPbPTLxw==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-placeholder@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-lwtNmMZpxvQBGP72/zrdPFOmn/3QNZAKpkrfrK95Ri4TU6LPeDDwPsP81s9mkAFZPuDQ1i8SPakl+RivWa6qtA==}
/@tiptap/extension-placeholder@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-laHYRFxJWj6m72Yf1v6Q5nF2nvwWpQlKUj6Yu/yluOOoVE92HpLqCAvA8RamqLtPiw5VxR3v3oCY0WNeQRvyIg==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@tiptap/extension-strike@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-KW63lZLPFIir5AIeh2I7UK6Tx1O3jetD7JIPUzEqp1I1BfJlHGHVQxV8VXAmJl0hTOzjQBsHW42PmBxSC97NUg==}
/@tiptap/extension-strike@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-UnjeSVgu3bDuyjjUdWsUErRCoQKAHCzH/pAiqTEPEEdFYgZFQPBpcJICRVdlYjRmI2ZKh6d0TMUS55m7ckmwmQ==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/extension-text@2.1.10(@tiptap/core@2.1.10):
resolution: {integrity: sha512-ubU/WQwNB0MVKyMAHr8ka3Nu3jCR03HARGKUwNRzppZYtRXWyXHNlAaJdplNb1NMGb8hd0ElBJmwFlVqmh8haQ==}
/@tiptap/extension-text@2.1.11(@tiptap/core@2.1.11):
resolution: {integrity: sha512-Iey0EXYv9079+lbHMvZtLc6XcYfKrq++msEXuFFNHxvL0i/XzndhGf+qlDhLROLgEtDiiTqzOBBwFCGlFjbDow==}
peerDependencies:
'@tiptap/core': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
dev: false
/@tiptap/pm@2.1.10:
resolution: {integrity: sha512-Y+AqizKnjQpx4pSaA6m/cCD5QHQRPtALhO4ZO4YFZV1idYmsJA3/S5lgJI3ZL5eAHKHcGk6Vv3/8Y+eej5YIPw==}
/@tiptap/pm@2.1.11:
resolution: {integrity: sha512-vBIAic+H8fjHfT8r2qJkAOxdx1Iiss9+qMyujAoIdPkiyjEc4+sXcM0qSYgIr6KL5icITyuK8J7x/V62VfB7Uw==}
dependencies:
prosemirror-changeset: 2.2.1
prosemirror-collab: 1.3.1
@ -2010,56 +2010,56 @@ packages:
prosemirror-view: 1.31.8
dev: false
/@tiptap/react@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-kzCWzbV2dnD5NmHjN8GiS+k0GOmoEhKnMuMzuuU6FjtOALhJzPTrIXITzWDpU3jL+r/4eeXYhAt64Wp7PVwscg==}
/@tiptap/react@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-OLU4uqMeCE/LKz/GY2P1JRykUgHJDoPROHUa1IOnVpj/1FbbBHDyurT3eomwsVzScTULbrKGwrS3ada6QAmTTA==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
react: ^17.0.0 || ^18.0.0
react-dom: ^17.0.0 || ^18.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/extension-bubble-menu': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/extension-floating-menu': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/extension-bubble-menu': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/extension-floating-menu': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/@tiptap/starter-kit@2.1.10(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-h5mH1qv7SDFXWZPbOWC8zpGZ62EnDizRNtM45Gani0HYWJXcbPFpgN1qJmESP/jP+v+0hxtnVEkgfpiy3LRm6A==}
/@tiptap/starter-kit@2.1.11(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-kZXwuo9yxrs1ASxluRKjXThjdcy90d7owJxnJWD7SyEwXaXYc4h+Ar1M9rP3jieCDBuRTtCgvAOKbVbhnRJ2jg==}
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/extension-blockquote': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-bold': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-bullet-list': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-code': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-code-block': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/extension-document': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-dropcursor': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/extension-gapcursor': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/extension-hard-break': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-heading': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-history': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/extension-horizontal-rule': 2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10)
'@tiptap/extension-italic': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-list-item': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-ordered-list': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-paragraph': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-strike': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/extension-text': 2.1.10(@tiptap/core@2.1.10)
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/extension-blockquote': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-bold': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-bullet-list': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-code': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-code-block': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/extension-document': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-dropcursor': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/extension-gapcursor': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/extension-hard-break': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-heading': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-history': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/extension-horizontal-rule': 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11)
'@tiptap/extension-italic': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-list-item': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-ordered-list': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-paragraph': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-strike': 2.1.11(@tiptap/core@2.1.11)
'@tiptap/extension-text': 2.1.11(@tiptap/core@2.1.11)
transitivePeerDependencies:
- '@tiptap/pm'
dev: false
/@tiptap/suggestion@2.1.10(@tiptap/core@2.1.10)(@tiptap/pm@2.1.10):
resolution: {integrity: sha512-k9WTTWT81UkHaxZksjp+wE31E85QL0jyLd0ZEKAs+btW148Pon1KwBeLnODNHILcdQaRPxRvb28a47cRHEKTiw==}
/@tiptap/suggestion@2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11):
resolution: {integrity: sha512-AVMB4x1X3eU7QCO1A8URQK0W7ps5dsVzveIP7+c//Z/GYe8lFSGIUnEbLJdr6bwgPkRL56m7c9+oZqVST5wfjQ==}
peerDependencies:
'@tiptap/core': ^2.0.0
'@tiptap/pm': ^2.0.0
dependencies:
'@tiptap/core': 2.1.10(@tiptap/pm@2.1.10)
'@tiptap/pm': 2.1.10
'@tiptap/core': 2.1.11(@tiptap/pm@2.1.11)
'@tiptap/pm': 2.1.11
dev: false
/@trivago/prettier-plugin-sort-imports@4.2.0(prettier@3.0.3):
@ -2112,8 +2112,8 @@ packages:
resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==}
dev: false
/@types/node@20.6.2:
resolution: {integrity: sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==}
/@types/node@20.6.3:
resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==}
dev: true
/@types/object.omit@3.0.1:
@ -2295,7 +2295,7 @@ packages:
vite: ^4
dependencies:
'@swc/core': 1.3.86
vite: 4.4.9(@types/node@20.6.2)
vite: 4.4.9(@types/node@20.6.3)
transitivePeerDependencies:
- '@swc/helpers'
dev: true
@ -2467,8 +2467,8 @@ packages:
has-symbols: 1.0.3
dev: true
/autoprefixer@10.4.15(postcss@8.4.30):
resolution: {integrity: sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==}
/autoprefixer@10.4.16(postcss@8.4.30):
resolution: {integrity: sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==}
engines: {node: ^10 || ^12 || >=14}
hasBin: true
peerDependencies:
@ -2532,9 +2532,9 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001538
electron-to-chromium: 1.4.525
electron-to-chromium: 1.4.526
node-releases: 2.0.13
update-browserslist-db: 1.0.11(browserslist@4.21.10)
update-browserslist-db: 1.0.12(browserslist@4.21.10)
dev: true
/bufferutil@4.0.7:
@ -2869,8 +2869,8 @@ packages:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
dev: true
/electron-to-chromium@1.4.525:
resolution: {integrity: sha512-GIZ620hDK4YmIqAWkscG4W6RwY6gOx1y5J6f4JUQwctiJrqH2oxZYU4mXHi35oV32tr630UcepBzSBGJ/WYcZA==}
/electron-to-chromium@1.4.526:
resolution: {integrity: sha512-tjjTMjmZAx1g6COrintLTa2/jcafYKxKoiEkdQOrVdbLaHh2wCt2nsAF8ZHweezkrP+dl/VG9T5nabcYoo0U5Q==}
dev: true
/emoji-regex@9.2.2:
@ -3162,7 +3162,7 @@ packages:
file-entry-cache: 6.0.1
find-up: 5.0.0
glob-parent: 6.0.2
globals: 13.21.0
globals: 13.22.0
graphemer: 1.4.0
ignore: 5.2.4
imurmurhash: 0.1.4
@ -3433,8 +3433,8 @@ packages:
engines: {node: '>=4'}
dev: true
/globals@13.21.0:
resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==}
/globals@13.22.0:
resolution: {integrity: sha512-H1Ddc/PbZHTDVJSnj8kWptIRSD6AM3pK+mKytuIVF4uoBV7rshFlhhvA58ceJ5wp3Er58w6zj7bykMpYXt3ETw==}
engines: {node: '>=8'}
dependencies:
type-fest: 0.20.2
@ -5910,8 +5910,8 @@ packages:
unist-util-visit-parents: 5.1.3
dev: false
/update-browserslist-db@1.0.11(browserslist@4.21.10):
resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==}
/update-browserslist-db@1.0.12(browserslist@4.21.10):
resolution: {integrity: sha512-tE1smlR58jxbFMtrMpFNRmsrOXlpNXss965T1CrpwuZUzUAg/TBQc94SpyhDLSzrqrJS9xTRBthnZAGcE1oaxg==}
hasBin: true
peerDependencies:
browserslist: '>= 4.21.0'
@ -6056,13 +6056,13 @@ packages:
debug: 4.3.4
globrex: 0.1.2
tsconfck: 2.1.2(typescript@5.2.2)
vite: 4.4.9(@types/node@20.6.2)
vite: 4.4.9(@types/node@20.6.3)
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/vite@4.4.9(@types/node@20.6.2):
/vite@4.4.9(@types/node@20.6.3):
resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
@ -6090,7 +6090,7 @@ packages:
terser:
optional: true
dependencies:
'@types/node': 20.6.2
'@types/node': 20.6.3
esbuild: 0.18.20
postcss: 8.4.30
rollup: 3.29.2

View File

@ -60,10 +60,10 @@ const router = createBrowserRouter([
},
},
{
path: 'timeline',
path: 'browse',
async lazy() {
const { TimelineScreen } = await import('@app/timeline');
return { Component: TimelineScreen };
const { BrowseScreen } = await import('@app/browse');
return { Component: BrowseScreen };
},
},
{

View File

@ -1,4 +1,4 @@
export function TimelineScreen() {
export function BrowseScreen() {
return (
<div>
<p>TODO</p>

View File

@ -1,18 +1,25 @@
// inspire by: https://github.com/nostr-dev-kit/ndk-react/
import NDK from '@nostr-dev-kit/ndk';
import { ndkAdapter } from '@nostr-fetch/adapter-ndk';
import { message } from '@tauri-apps/api/dialog';
import { fetch } from '@tauri-apps/api/http';
import { NostrFetcher } from 'nostr-fetch';
import { useEffect, useMemo, useState } from 'react';
import TauriAdapter from '@libs/ndk/cache';
import { useStorage } from '@libs/storage/provider';
export const NDKInstance = () => {
const { db } = useStorage();
const [ndk, setNDK] = useState<NDK | undefined>(undefined);
const [relayUrls, setRelayUrls] = useState<string[]>([]);
const { db } = useStorage();
const cacheAdapter = useMemo(() => new TauriAdapter(), [ndk]);
const fetcher = useMemo(
() => (ndk ? NostrFetcher.withCustomPool(ndkAdapter(ndk)) : null),
[ndk]
);
// TODO: fully support NIP-11
async function getExplicitRelays() {
@ -81,5 +88,6 @@ export const NDKInstance = () => {
return {
ndk,
relayUrls,
fetcher,
};
};

View File

@ -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,21 +8,24 @@ import { NDKInstance } from '@libs/ndk/instance';
interface NDKContext {
ndk: undefined | NDK;
relayUrls: string[];
fetcher: NostrFetcher;
}
const NDKContext = createContext<NDKContext>({
ndk: undefined,
relayUrls: [],
fetcher: undefined,
});
const NDKProvider = ({ children }: PropsWithChildren<object>) => {
const { ndk, relayUrls } = NDKInstance();
const { ndk, relayUrls, fetcher } = NDKInstance();
return (
<NDKContext.Provider
value={{
ndk,
relayUrls,
fetcher,
}}
>
{children}

View File

@ -7,13 +7,7 @@ import { ChatsList } from '@app/chats/components/list';
import { ActiveAccount } from '@shared/accounts/active';
import { ComposerModal } from '@shared/composer';
import { Frame } from '@shared/frame';
import {
BellIcon,
NavArrowDownIcon,
NwcIcon,
SpaceIcon,
TimeLineIcon,
} from '@shared/icons';
import { BellIcon, NavArrowDownIcon, NwcIcon, SpaceIcon, WorldIcon } from '@shared/icons';
import { useActivities } from '@stores/activities';
import { useSidebar } from '@stores/sidebar';
@ -38,23 +32,6 @@ export function Navigation() {
className="scrollbar-hide flex h-full flex-1 flex-col gap-6 overflow-y-auto pb-32"
>
<div className="flex flex-col pr-3">
<NavLink
to="/timeline"
preventScrollReset={true}
className={({ isActive }) =>
twMerge(
'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 pl-4 pr-3',
isActive
? 'border-fuchsia-500 bg-white/5 text-white'
: 'border-transparent text-white/70'
)
}
>
<span className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded bg-white/10 backdrop-blur-xl">
<TimeLineIcon className="h-4 w-4 text-white" />
</span>
Timeline
</NavLink>
<NavLink
to="/"
preventScrollReset={true}
@ -70,7 +47,24 @@ export function Navigation() {
<span className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded bg-white/10 backdrop-blur-xl">
<SpaceIcon className="h-4 w-4 text-white" />
</span>
Space
Home
</NavLink>
<NavLink
to="/browse"
preventScrollReset={true}
className={({ isActive }) =>
twMerge(
'flex h-10 items-center gap-2.5 rounded-r-lg border-l-2 pl-4 pr-3',
isActive
? 'border-fuchsia-500 bg-white/5 text-white'
: 'border-transparent text-white/70'
)
}
>
<span className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded bg-white/10 backdrop-blur-xl">
<WorldIcon className="h-4 w-4 text-white" />
</span>
Browse
</NavLink>
<NavLink
to="/notifications"

View File

@ -3,6 +3,7 @@ import { useQuery } from '@tanstack/react-query';
import { nip19 } from 'nostr-tools';
import { useCallback } from 'react';
import { Link } from 'react-router-dom';
import { twMerge } from 'tailwind-merge';
import { useNDK } from '@libs/ndk/provider';
@ -17,7 +18,13 @@ import {
} from '@shared/notes';
import { User } from '@shared/user';
export function Repost({ event }: { event: NDKEvent }) {
export function Repost({
event,
lighter = false,
}: {
event: NDKEvent;
lighter?: boolean;
}) {
const embedEvent: null | NDKEvent =
event.content.length > 0 ? JSON.parse(event.content) : null;
@ -55,7 +62,12 @@ export function Repost({ event }: { event: NDKEvent }) {
if (embedEvent) {
return (
<div className="h-min w-full px-3 pb-3">
<div className="relative flex flex-col gap-10 overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
<div
className={twMerge(
'relative flex flex-col gap-10 overflow-hidden rounded-xl px-3 py-3',
!lighter ? 'bg-white/10 backdrop-blur-xl' : ''
)}
>
<User pubkey={event.pubkey} time={event.created_at} variant="repost" />
<div className="relative flex flex-col">
<User pubkey={embedEvent.pubkey} time={embedEvent.created_at} />
@ -89,7 +101,12 @@ export function Repost({ event }: { event: NDKEvent }) {
return (
<div className="h-min w-full px-3 pb-3">
<div className="relative overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
<div
className={twMerge(
'relative overflow-hidden rounded-xl px-3 py-3',
!lighter ? 'bg-white/10 backdrop-blur-xl' : ''
)}
>
<div className="relative flex flex-col">
<div className="relative z-10 flex items-start gap-3">
<div className="inline-flex h-11 w-11 items-end justify-center rounded-lg bg-black pb-1">
@ -122,7 +139,12 @@ export function Repost({ event }: { event: NDKEvent }) {
return (
<div className="h-min w-full px-3 pb-3">
<div className="relative flex flex-col gap-10 overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
<div
className={twMerge(
'relative flex flex-col gap-10 overflow-hidden rounded-xl px-3 py-3',
!lighter ? 'bg-white/10 backdrop-blur-xl' : ''
)}
>
<User pubkey={event.pubkey} time={event.created_at} variant="repost" />
<div className="relative flex flex-col">
<User pubkey={data.pubkey} time={data.created_at} />

View File

@ -1,5 +1,6 @@
import { NDKEvent } from '@nostr-dev-kit/ndk';
import { ReactNode } from 'react';
import { twMerge } from 'tailwind-merge';
import { ChildNote, NoteActions } from '@shared/notes';
import { User } from '@shared/user';
@ -9,16 +10,23 @@ export function NoteWrapper({
children,
root,
reply,
lighter = false,
}: {
event: NDKEvent;
children: ReactNode;
repost?: boolean;
root?: string;
reply?: string;
lighter?: boolean;
}) {
return (
<div className="h-min w-full px-3 pb-3">
<div className="relative overflow-hidden rounded-xl bg-white/10 px-3 py-3 backdrop-blur-xl">
<div
className={twMerge(
'relative overflow-hidden rounded-xl px-3 py-3',
!lighter ? 'bg-white/10 backdrop-blur-xl' : 'bg-transparent'
)}
>
<div className="relative">{root && <ChildNote id={root} />}</div>
<div className="relative">{reply && <ChildNote id={reply} root={root} />}</div>
<div className="relative flex flex-col">

View File

@ -58,7 +58,7 @@ export function LocalNetworkWidget() {
case NDKKind.Text:
return (
<div
key={dbEvent.id + index}
key={dbEvent.id + dbEvent.root_id + dbEvent.reply_id + index}
data-index={index}
ref={virtualizer.measureElement}
>

View File

@ -6,11 +6,9 @@ import {
NDKSubscription,
NDKUser,
} from '@nostr-dev-kit/ndk';
import { ndkAdapter } from '@nostr-fetch/adapter-ndk';
import { message, open } from '@tauri-apps/api/dialog';
import { Body, fetch } from '@tauri-apps/api/http';
import { LRUCache } from 'lru-cache';
import { NostrFetcher } from 'nostr-fetch';
import { nip19 } from 'nostr-tools';
import { useMemo } from 'react';
@ -24,8 +22,8 @@ import { nHoursAgo } from '@utils/date';
import { NDKEventWithReplies, NostrBuildResponse } from '@utils/types';
export function useNostr() {
const { ndk, relayUrls } = useNDK();
const { db } = useStorage();
const { ndk, relayUrls, fetcher } = useNDK();
const privkey = useStronghold((state) => state.privkey);
const subManager = useMemo(
@ -137,7 +135,6 @@ export function useNostr() {
const prefetchEvents = async () => {
try {
const fetcher = NostrFetcher.withCustomPool(ndkAdapter(ndk));
const dbEventsEmpty = await db.isEventsEmpty();
let since: number;
@ -173,7 +170,6 @@ export function useNostr() {
const fetchActivities = async () => {
try {
const fetcher = NostrFetcher.withCustomPool(ndkAdapter(ndk));
const events = await fetcher.fetchAllEvents(
relayUrls,
{
@ -197,7 +193,6 @@ export function useNostr() {
};
const fetchNIP04Chats = async () => {
const fetcher = NostrFetcher.withCustomPool(ndkAdapter(ndk));
const events = await fetcher.fetchAllEvents(
relayUrls,
{
@ -215,8 +210,6 @@ export function useNostr() {
};
const fetchNIP04Messages = async (sender: string) => {
const fetcher = NostrFetcher.withCustomPool(ndkAdapter(ndk));
const senderMessages = await fetcher.fetchAllEvents(
relayUrls,
{
@ -246,7 +239,6 @@ export function useNostr() {
const fetchAllReplies = async (id: string, data?: NDKEventWithReplies[]) => {
let events = data || null;
const fetcher = NostrFetcher.withCustomPool(ndkAdapter(ndk));
if (!data) {
events = (await fetcher.fetchAllEvents(