minor updates

This commit is contained in:
Ren Amamiya 2023-06-03 19:40:36 +07:00
parent 93711e1d36
commit be6de2344e
14 changed files with 185 additions and 176 deletions

View File

@ -14,12 +14,12 @@
},
"dependencies": {
"@floating-ui/react": "^0.23.1",
"@headlessui/react": "^1.7.14",
"@headlessui/react": "^1.7.15",
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-virtual": "3.0.0-beta.54",
"@tauri-apps/api": "^1.3.0",
"@vidstack/react": "^0.4.5",
"dayjs": "^1.11.7",
"dayjs": "^1.11.8",
"destr": "^1.2.2",
"embla-carousel-react": "8.0.0-rc06",
"immer": "^10.0.2",
@ -28,7 +28,7 @@
"nostr-tools": "^1.11.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.44.2",
"react-hook-form": "^7.44.3",
"react-markdown": "^8.0.7",
"react-resizable-panels": "^0.0.48",
"react-virtuoso": "^4.3.8",
@ -37,7 +37,7 @@
"slate-history": "^0.93.0",
"slate-react": "^0.94.2",
"swr": "^2.1.5",
"tailwind-merge": "^1.12.0",
"tailwind-merge": "^1.13.0",
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql",
"vidstack": "^0.4.5",
"zustand": "^4.3.8"
@ -46,7 +46,7 @@
"@tailwindcss/typography": "^0.5.9",
"@tauri-apps/cli": "^1.3.1",
"@types/node": "^18.16.16",
"@types/react": "^18.2.7",
"@types/react": "^18.2.8",
"@types/react-dom": "^18.2.4",
"@types/youtube-player": "^5.5.7",
"@vitejs/plugin-react-swc": "^3.3.1",

View File

@ -5,8 +5,8 @@ dependencies:
specifier: ^0.23.1
version: 0.23.1(react-dom@18.2.0)(react@18.2.0)
'@headlessui/react':
specifier: ^1.7.14
version: 1.7.14(react-dom@18.2.0)(react@18.2.0)
specifier: ^1.7.15
version: 1.7.15(react-dom@18.2.0)(react@18.2.0)
'@tanstack/react-query':
specifier: ^4.29.12
version: 4.29.12(react-dom@18.2.0)(react@18.2.0)
@ -18,10 +18,10 @@ dependencies:
version: 1.3.0
'@vidstack/react':
specifier: ^0.4.5
version: 0.4.5(@types/react@18.2.7)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5)
version: 0.4.5(@types/react@18.2.8)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5)
dayjs:
specifier: ^1.11.7
version: 1.11.7
specifier: ^1.11.8
version: 1.11.8
destr:
specifier: ^1.2.2
version: 1.2.2
@ -47,11 +47,11 @@ dependencies:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
react-hook-form:
specifier: ^7.44.2
version: 7.44.2(react@18.2.0)
specifier: ^7.44.3
version: 7.44.3(react@18.2.0)
react-markdown:
specifier: ^8.0.7
version: 8.0.7(@types/react@18.2.7)(react@18.2.0)
version: 8.0.7(@types/react@18.2.8)(react@18.2.0)
react-resizable-panels:
specifier: ^0.0.48
version: 0.0.48(react-dom@18.2.0)(react@18.2.0)
@ -74,8 +74,8 @@ dependencies:
specifier: ^2.1.5
version: 2.1.5(react@18.2.0)
tailwind-merge:
specifier: ^1.12.0
version: 1.12.0
specifier: ^1.13.0
version: 1.13.0
tauri-plugin-sql-api:
specifier: github:tauri-apps/tauri-plugin-sql
version: github.com/tauri-apps/tauri-plugin-sql/312c4d39ac5eb1c6c75e8ecee1c4bc89ed799675
@ -97,8 +97,8 @@ devDependencies:
specifier: ^18.16.16
version: 18.16.16
'@types/react':
specifier: ^18.2.7
version: 18.2.7
specifier: ^18.2.8
version: 18.2.8
'@types/react-dom':
specifier: ^18.2.4
version: 18.2.4
@ -414,8 +414,8 @@ packages:
tabbable: 6.1.2
dev: false
/@headlessui/react@1.7.14(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-znzdq9PG8rkwcu9oQ2FwIy0ZFtP9Z7ycS+BAqJ3R5EIqC/0bJGvhT7193rFf+45i9nnPsYvCQVW4V/bB9Xc+gA==}
/@headlessui/react@1.7.15(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-OTO0XtoRQ6JPB1cKNFYBZv2Q0JMqMGNhYP1CjPvcJvjz8YGokz8oAj89HIYZGN0gZzn/4kk9iUpmMF4Q21Gsqw==}
engines: {node: '>=10'}
peerDependencies:
react: ^16 || ^17 || ^18
@ -470,8 +470,8 @@ packages:
resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==}
dev: false
/@maverick-js/signals@5.10.2:
resolution: {integrity: sha512-JEoTAsctQwKyL3RIfhqi8a1rVXvBnK7HBEIhrcOICjZ5zb2ignh6FHSa9rmShyoF7rKYd58javxfhFjKC6WCwQ==}
/@maverick-js/signals@5.10.3:
resolution: {integrity: sha512-5qS0v41jBRhopHmSjWTWWcn/19bDwFqOxL5oHYYYROc/L+cyos3A/qYhcmjU9bPPskc5JiUgLn0O7LV/OvGUmg==}
dev: false
/@noble/curves@1.0.0:
@ -586,8 +586,8 @@ packages:
'@scure/base': 1.1.1
dev: false
/@swc/core-darwin-arm64@1.3.61:
resolution: {integrity: sha512-Ra1CZIYYyIp/Y64VcKyaLjIPUwT83JmGduvHu8vhUZOvWV4dWL4s5DrcxQVaQJjjb7Z2N/IUYYS55US1TGnxZw==}
/@swc/core-darwin-arm64@1.3.62:
resolution: {integrity: sha512-MmGilibITz68LEje6vJlKzc2gUUSgzvB3wGLSjEORikTNeM7P8jXVxE4A8fgZqDeudJUm9HVWrxCV+pHDSwXhA==}
engines: {node: '>=10'}
cpu: [arm64]
os: [darwin]
@ -595,8 +595,8 @@ packages:
dev: true
optional: true
/@swc/core-darwin-x64@1.3.61:
resolution: {integrity: sha512-LUia75UByUFkYH1Ddw7IE0X9usNVGJ7aL6+cgOTju7P0dsU0f8h/OGc/GDfp1E4qnKxDCJE+GwDRLoi4SjIxpg==}
/@swc/core-darwin-x64@1.3.62:
resolution: {integrity: sha512-Xl93MMB3sCWVlYWuQIB+v6EQgzoiuQYK5tNt9lsHoIEVu2zLdkQjae+5FUHZb1VYqCXIiWcULFfVz0R4Sjb7JQ==}
engines: {node: '>=10'}
cpu: [x64]
os: [darwin]
@ -604,8 +604,8 @@ packages:
dev: true
optional: true
/@swc/core-linux-arm-gnueabihf@1.3.61:
resolution: {integrity: sha512-aalPlicYxHAn2PxNlo3JFEZkMXzCtUwjP27AgMqnfV4cSz7Omo56OtC+413e/kGyCH86Er9gJRQQsxNKP8Qbsg==}
/@swc/core-linux-arm-gnueabihf@1.3.62:
resolution: {integrity: sha512-nJsp6O7kCtAjTTMcIjVB0g5y1JNiYAa5q630eiwrnaHUusEFoANDdORI3Z9vXeikMkng+6yIv9/V8Rb093xLjQ==}
engines: {node: '>=10'}
cpu: [arm]
os: [linux]
@ -613,8 +613,8 @@ packages:
dev: true
optional: true
/@swc/core-linux-arm64-gnu@1.3.61:
resolution: {integrity: sha512-9hGdsbQrYNPo1c7YzWF57yl17bsIuuEQi3I1fOFSv3puL3l5M/C/oCD0Bz6IdKh6mEDC5UNJE4LWtV1gFA995A==}
/@swc/core-linux-arm64-gnu@1.3.62:
resolution: {integrity: sha512-XGsV93vpUAopDt5y6vPwbK1Nc/MlL55L77bAZUPIiosWD1cWWPHNtNSpriE6+I+JiMHe0pqtfS/SSTk6ZkFQVw==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
@ -622,8 +622,8 @@ packages:
dev: true
optional: true
/@swc/core-linux-arm64-musl@1.3.61:
resolution: {integrity: sha512-mVmcNfFQRP4SYbGC08IPB3B9Xox+VpGIQqA3Qg7LMCcejLAQLi4Lfe8CDvvBPlQzXHso0Cv+BicJnQVKs8JLOA==}
/@swc/core-linux-arm64-musl@1.3.62:
resolution: {integrity: sha512-ESUmJjSlTTkoBy9dMG49opcNn8BmviqStMhwyeD1G8XRnmRVCZZgoBOKdvCXmJhw8bQXDhZumeaTUB+OFUKVXg==}
engines: {node: '>=10'}
cpu: [arm64]
os: [linux]
@ -631,8 +631,8 @@ packages:
dev: true
optional: true
/@swc/core-linux-x64-gnu@1.3.61:
resolution: {integrity: sha512-ZkRHs7GEikN6JiVL1/stvq9BVHKrSKoRn9ulVK2hMr+mAGNOKm3Y06NSzOO+BWwMaFOgnO2dWlszCUICsQ0kpg==}
/@swc/core-linux-x64-gnu@1.3.62:
resolution: {integrity: sha512-wnHJkt3ZBrax3SFnUHDcncG6mrSg9ZZjMhQV9Mc3JL1x1s1Gy9rGZCoBNnV/BUZWTemxIBcQbANRSDut/WO+9A==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
@ -640,8 +640,8 @@ packages:
dev: true
optional: true
/@swc/core-linux-x64-musl@1.3.61:
resolution: {integrity: sha512-zK7VqQ5JlK20+7fxI4AgvIUckeZyX0XIbliGXNMR3i+39SJq1vs9scYEmq8VnAfvNdMU5BG+DewbFJlMfCtkxQ==}
/@swc/core-linux-x64-musl@1.3.62:
resolution: {integrity: sha512-9oRbuTC/VshB66Rgwi3pTq3sPxSTIb8k9L1vJjES+dDMKa29DAjPtWCXG/pyZ00ufpFZgkGEuAHH5uqUcr1JQg==}
engines: {node: '>=10'}
cpu: [x64]
os: [linux]
@ -649,8 +649,8 @@ packages:
dev: true
optional: true
/@swc/core-win32-arm64-msvc@1.3.61:
resolution: {integrity: sha512-e9kVVPk5iVNhO41TvLvcExDHn5iATQ5/M4U7/CdcC7s0fK19TKSEUqkdoTLIJvHBFhgR7w3JJSErfnauO0xXoA==}
/@swc/core-win32-arm64-msvc@1.3.62:
resolution: {integrity: sha512-zv14vlF2VRrxS061XkfzGjCYnOrEo5glKJjLK5PwUKysIoVrx/L8nAbFxjkX5cObdlyoqo+ekelyBPAO+4bS0w==}
engines: {node: '>=10'}
cpu: [arm64]
os: [win32]
@ -658,8 +658,8 @@ packages:
dev: true
optional: true
/@swc/core-win32-ia32-msvc@1.3.61:
resolution: {integrity: sha512-7cJULfa6HvKqvFh6M/f7mKiNRhE2AjgFUCZfdOuy5r8vbtpk+qBK94TXwaDjJYDUGKzDVZw/tJ1eN4Y9n9Ls/Q==}
/@swc/core-win32-ia32-msvc@1.3.62:
resolution: {integrity: sha512-8MC/PZQSsOP2iA/81tAfNRqMWyEqTS/8zKUI67vPuLvpx6NAjRn3E9qBv7iFqH79iqZNzqSMo3awnLrKZyFbcw==}
engines: {node: '>=10'}
cpu: [ia32]
os: [win32]
@ -667,8 +667,8 @@ packages:
dev: true
optional: true
/@swc/core-win32-x64-msvc@1.3.61:
resolution: {integrity: sha512-Jx8S+21WcKF/wlhW+sYpystWUyymDTEsbBpOgBRpXZelakVcNBCIIYSZOKW/A9PwWTpu6S8yvbs9nUOzKiVPqA==}
/@swc/core-win32-x64-msvc@1.3.62:
resolution: {integrity: sha512-GJSmUJ95HKHZXAxiuPUmrcm/S3ivQvEzXhOZaIqYBIwUsm02vFZkClsV7eIKzWjso1t0+I/8MjrnUNaSWqh1rQ==}
engines: {node: '>=10'}
cpu: [x64]
os: [win32]
@ -676,8 +676,8 @@ packages:
dev: true
optional: true
/@swc/core@1.3.61:
resolution: {integrity: sha512-p58Ltdjo7Yy8CU3zK0cp4/eAgy5qkHs35znGedqVGPiA67cuYZM63DuTfmyrOntMRwQnaFkMLklDAPCizDdDng==}
/@swc/core@1.3.62:
resolution: {integrity: sha512-J58hWY+/G8vOr4J6ZH9hLg0lMSijZtqIIf4HofZezGog/pVX6sJyBJ40dZ1ploFkDIlWTWvJyqtpesBKS73gkQ==}
engines: {node: '>=10'}
requiresBuild: true
peerDependencies:
@ -686,16 +686,16 @@ packages:
'@swc/helpers':
optional: true
optionalDependencies:
'@swc/core-darwin-arm64': 1.3.61
'@swc/core-darwin-x64': 1.3.61
'@swc/core-linux-arm-gnueabihf': 1.3.61
'@swc/core-linux-arm64-gnu': 1.3.61
'@swc/core-linux-arm64-musl': 1.3.61
'@swc/core-linux-x64-gnu': 1.3.61
'@swc/core-linux-x64-musl': 1.3.61
'@swc/core-win32-arm64-msvc': 1.3.61
'@swc/core-win32-ia32-msvc': 1.3.61
'@swc/core-win32-x64-msvc': 1.3.61
'@swc/core-darwin-arm64': 1.3.62
'@swc/core-darwin-x64': 1.3.62
'@swc/core-linux-arm-gnueabihf': 1.3.62
'@swc/core-linux-arm64-gnu': 1.3.62
'@swc/core-linux-arm64-musl': 1.3.62
'@swc/core-linux-x64-gnu': 1.3.62
'@swc/core-linux-x64-musl': 1.3.62
'@swc/core-win32-arm64-msvc': 1.3.62
'@swc/core-win32-ia32-msvc': 1.3.62
'@swc/core-win32-x64-msvc': 1.3.62
dev: true
/@tailwindcss/typography@0.5.9(tailwindcss@3.3.2):
@ -887,11 +887,11 @@ packages:
/@types/react-dom@18.2.4:
resolution: {integrity: sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==}
dependencies:
'@types/react': 18.2.7
'@types/react': 18.2.8
dev: true
/@types/react@18.2.7:
resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==}
/@types/react@18.2.8:
resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==}
dependencies:
'@types/prop-types': 15.7.5
'@types/scheduler': 0.16.3
@ -908,7 +908,7 @@ packages:
resolution: {integrity: sha512-W8F4eoTIvzXeNrT3JroQPimZLXnlJA8smYygHZUKFPVoYwgs/OhJkA1VBhL3iSs57OQkuINqHlY4SmMT5wtnJg==}
dev: true
/@vidstack/react@0.4.5(@types/react@18.2.7)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5):
/@vidstack/react@0.4.5(@types/react@18.2.8)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5):
resolution: {integrity: sha512-spcim3+p1fMzkhHRKn5PS54YQjfThW5M3F2+R8tCT+wpsxbbCDa/TGdLBoIy2oC0LNziPkn0vlBWIZko9F5iig==}
engines: {node: '>=16'}
peerDependencies:
@ -918,7 +918,7 @@ packages:
react: ^18.0.0
vidstack: 0.4.5
dependencies:
'@types/react': 18.2.7
'@types/react': 18.2.8
maverick.js: 0.33.1
media-icons: 0.4.2
react: 18.2.0
@ -930,7 +930,7 @@ packages:
peerDependencies:
vite: ^4
dependencies:
'@swc/core': 1.3.61
'@swc/core': 1.3.62
vite: 4.3.9(@types/node@18.16.16)
transitivePeerDependencies:
- '@swc/helpers'
@ -999,7 +999,7 @@ packages:
resolution: {integrity: sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==}
engines: {node: '>=10'}
dependencies:
tslib: 2.5.2
tslib: 2.5.3
dev: false
/astral-regex@2.0.0:
@ -1056,7 +1056,7 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001492
electron-to-chromium: 1.4.416
electron-to-chromium: 1.4.419
node-releases: 2.0.12
update-browserslist-db: 1.0.11(browserslist@4.21.7)
dev: true
@ -1203,8 +1203,8 @@ packages:
/csstype@3.1.2:
resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
/dayjs@1.11.7:
resolution: {integrity: sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==}
/dayjs@1.11.8:
resolution: {integrity: sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ==}
dev: false
/debug@4.3.4:
@ -1255,8 +1255,8 @@ packages:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
dev: true
/electron-to-chromium@1.4.416:
resolution: {integrity: sha512-AUYh0XDTb2vrj0rj82jb3P9hHSyzQNdTPYWZIhPdCOui7/vpme7+HTE07BE5jwuqg/34TZ8ktlRz6GImJ4IXjA==}
/electron-to-chromium@1.4.419:
resolution: {integrity: sha512-jdie3RiEgygvDTyS2sgjq71B36q2cDSBfPlwzUyuOrfYTNoYWyBxxjGJV/HAu3A2hB0Y+HesvCVkVAFoCKwCSw==}
dev: true
/embla-carousel-react@8.0.0-rc06(react@18.2.0):
@ -1687,7 +1687,7 @@ packages:
resolution: {integrity: sha512-p8L5V62CV6TmHAngmRAopp231oJKeH77mJja5SsKOfvzrPRoThT/Jo9U0jMRB5iMykqkvyg2J5V5Agn6FPXDWQ==}
engines: {node: '>=16'}
dependencies:
'@maverick-js/signals': 5.10.2
'@maverick-js/signals': 5.10.3
type-fest: 3.11.1
dev: false
@ -2368,8 +2368,8 @@ packages:
scheduler: 0.23.0
dev: false
/react-hook-form@7.44.2(react@18.2.0):
resolution: {integrity: sha512-IyihmIbCwzDI/iqlecTRa7+4BCnzNx40upSlGvIU7qwENhTf6APatm4bmL9ANtWKPYlD67SIlxfls7GwCUe+Lg==}
/react-hook-form@7.44.3(react@18.2.0):
resolution: {integrity: sha512-/tHId6p2ViAka1wECMw8FEPn/oz/w226zehHrJyQ1oIzCBNMIJCaj6ZkQcv+MjDxYh9MWR7RQic7Qqwe4a5nkw==}
engines: {node: '>=12.22.0'}
peerDependencies:
react: ^16.8.0 || ^17 || ^18
@ -2384,7 +2384,7 @@ packages:
resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==}
dev: false
/react-markdown@8.0.7(@types/react@18.2.7)(react@18.2.0):
/react-markdown@8.0.7(@types/react@18.2.8)(react@18.2.0):
resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==}
peerDependencies:
'@types/react': '>=16'
@ -2392,7 +2392,7 @@ packages:
dependencies:
'@types/hast': 2.3.4
'@types/prop-types': 15.7.5
'@types/react': 18.2.7
'@types/react': 18.2.8
'@types/unist': 2.0.6
comma-separated-tokens: 2.0.3
hast-util-whitespace: 2.0.1
@ -2539,7 +2539,7 @@ packages:
/rxjs@7.8.1:
resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==}
dependencies:
tslib: 2.5.2
tslib: 2.5.3
dev: true
/sade@1.8.1:
@ -2748,8 +2748,8 @@ packages:
resolution: {integrity: sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ==}
dev: false
/tailwind-merge@1.12.0:
resolution: {integrity: sha512-Y17eDp7FtN1+JJ4OY0Bqv9OA41O+MS8c1Iyr3T6JFLnOgLg3EvcyMKZAnQ8AGyvB5Nxm3t9Xb5Mhe139m8QT/g==}
/tailwind-merge@1.13.0:
resolution: {integrity: sha512-mUTmDbcU+IhOvJ0c42eLQ/nRkvolTqfpVaVQRSxfJAv9TabS6Y2zW/1wKpKLdKzyL3Gh8j6NTLl6MWNmvOM6kA==}
dev: false
/tailwindcss@3.3.2:
@ -2846,8 +2846,8 @@ packages:
typescript: 4.9.5
dev: true
/tslib@2.5.2:
resolution: {integrity: sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==}
/tslib@2.5.3:
resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==}
/type-fest@0.21.3:
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
@ -3009,7 +3009,7 @@ packages:
vite: '>=2.8'
dependencies:
'@rollup/plugin-virtual': 3.0.1
'@swc/core': 1.3.61
'@swc/core': 1.3.62
uuid: 9.0.0
vite: 4.3.9(@types/node@18.16.16)
transitivePeerDependencies:

View File

@ -2,6 +2,7 @@ import { MessageHideButton } from "@app/channel/components/messages/hideButton";
import { MessageMuteButton } from "@app/channel/components/messages/muteButton";
import { MessageReplyButton } from "@app/channel/components/messages/replyButton";
import { ChannelMessageUser } from "@app/channel/components/messages/user";
import { ChannelMessageUserMute } from "@app/channel/components/messages/userMute";
import { MentionNote } from "@app/note/components/mentions/note";
import { ImagePreview } from "@app/note/components/preview/image";
import { VideoPreview } from "@app/note/components/preview/video";
@ -16,7 +17,12 @@ export function ChannelMessageItem({ data }: { data: any }) {
setHide((prev) => !prev);
};
if (data.mute) return null;
if (data.mute)
return (
<div className="group relative flex h-min min-h-min w-full select-text flex-col px-5 py-3 hover:bg-black/20">
<ChannelMessageUserMute pubkey={data.pubkey} />
</div>
);
return (
<div className="group relative flex h-min min-h-min w-full select-text flex-col px-5 py-3 hover:bg-black/20">

View File

@ -0,0 +1,41 @@
import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
export function ChannelMessageUserMute({
pubkey,
}: {
pubkey: string;
}) {
const { user, isError, isLoading } = useProfile(pubkey);
return (
<div className="flex items-center gap-3">
{isError || isLoading ? (
<>
<div className="relative h-11 w-11 shrink animate-pulse rounded-md bg-zinc-800" />
<div className="flex w-full flex-1 items-center justify-between">
<div className="flex items-baseline gap-2 text-base">
<div className="h-4 w-20 animate-pulse rounded bg-zinc-800" />
</div>
</div>
</>
) : (
<>
<div className="relative h-11 w-11 shrink-0 rounded-md">
<Image
src={user?.picture || DEFAULT_AVATAR}
alt={pubkey}
className="h-11 w-11 rounded-md object-cover"
/>
</div>
<div className="flex w-full flex-1 items-center justify-between">
<span className="leading-none text-zinc-300">
You has been muted this user
</span>
</div>
</>
)}
</div>
);
}

View File

@ -55,12 +55,12 @@ export function Page() {
useSWRSubscription(
account && channelID && muted && hided ? ["channel", channelID] : null,
([, key]) => {
() => {
// subscribe to channel
const unsubscribe = pool.subscribe(
[
{
"#e": [key],
"#e": [channelID],
kinds: [42],
since: dateToUnix(getHourAgo(24, now.current)),
limit: 20,

View File

@ -38,13 +38,7 @@ export function ChatMessageForm({
pool.publish(event, WRITEONLY_RELAYS);
// add message to store
addMessage({
receiver_pubkey: receiverPubkey,
sender_pubkey: event.pubkey,
content: event.content,
tags: event.tags,
created_at: event.created_at,
});
addMessage(receiverPubkey, event);
// reset state
setValue("");

View File

@ -27,7 +27,7 @@ export function ChatsListSelfItem({ data }: { data: any }) {
href={`/app/chat?pubkey=${data.pubkey}`}
className={twMerge(
"group inline-flex h-8 items-center gap-2.5 rounded-md px-2.5 hover:bg-zinc-900",
pagePubkey === data.sender_pubkey
pagePubkey === data.pubkey
? "dark:bg-zinc-900 dark:text-white hover:dark:bg-zinc-800"
: "",
)}

View File

@ -22,34 +22,31 @@ export function Page() {
state.fetch,
state.clear,
]);
const addMessage = useChatMessages((state: any) => state.add);
const add = useChatMessages((state: any) => state.add);
useSWRSubscription(account && pubkey ? ["chat", pubkey] : null, ([, key]) => {
const unsubscribe = pool.subscribe(
[
{
kinds: [4],
authors: [key],
"#p": [account.pubkey],
since: dateToUnix(),
useSWRSubscription(
account.pubkey !== pubkey ? ["chat", pubkey] : null,
() => {
const unsubscribe = pool.subscribe(
[
{
kinds: [4],
authors: [pubkey],
"#p": [account.pubkey],
since: dateToUnix(),
},
],
READONLY_RELAYS,
(event: any) => {
add(account.pubkey, event);
},
],
READONLY_RELAYS,
(event: any) => {
addMessage({
receiver_pubkey: account.pubkey,
sender_pubkey: event.pubkey,
content: event.content,
tags: event.tags,
created_at: event.created_at,
});
},
);
);
return () => {
unsubscribe();
};
});
return () => {
unsubscribe();
};
},
);
useEffect(() => {
fetchMessages(account.pubkey, pubkey);
@ -57,7 +54,7 @@ export function Page() {
return () => {
clear();
};
}, [pubkey]);
}, [pubkey, fetchMessages]);
if (!account) return <div>Fuck SSR</div>;

View File

@ -8,7 +8,7 @@ export function ImagePreview({ urls }: { urls: string[] }) {
<div ref={emblaRef} className="mt-3 overflow-hidden">
<div className="flex">
{urls.map((url) => (
<div className="mr-2 min-w-0 grow-0 shrink-0 basis-full">
<div key={url} className="mr-2 min-w-0 grow-0 shrink-0 basis-full">
<Image
src={url}
alt="image"

View File

@ -2,7 +2,7 @@ import { Image } from "@shared/image";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { useChannels } from "@stores/channels";
import { useChats } from "@stores/chats";
import { useChatMessages, useChats } from "@stores/chats";
import { DEFAULT_AVATAR, READONLY_RELAYS } from "@stores/constants";
import { usePageContext } from "@utils/hooks/usePageContext";
import { useProfile } from "@utils/hooks/useProfile";
@ -13,26 +13,27 @@ import useSWRSubscription from "swr/subscription";
export function ActiveAccount({ data }: { data: any }) {
const pool: any = useContext(RelayContext);
const pageContext = usePageContext();
const pathnames: any = pageContext.urlParsed.pathname;
const pathname: any = pageContext.urlParsed.pathname;
const notChatPage = pathnames.includes("/chat") ? false : true;
const notChannelPage = pathnames.includes("/channel") ? false : true;
const isChatPage = pathname.includes("/chat");
const isChannelPage = pathname.includes("/channel");
// const notSpacePage = pathnames.includes("/space") ? false : true;
const lastLogin = useActiveAccount((state: any) => state.lastLogin);
const notifyChat = useChats((state: any) => state.add);
const saveChat = useChatMessages((state: any) => state.add);
const notifyChannel = useChannels((state: any) => state.add);
const { user } = useProfile(data.pubkey);
useSWRSubscription(
user && lastLogin > 0 ? ["account", data.pubkey] : null,
([, key]) => {
() => {
// subscribe to channel
const unsubscribe = pool.subscribe(
[
{
"#p": [key],
"#p": [data.pubkey],
since: lastLogin,
},
],
@ -42,7 +43,9 @@ export function ActiveAccount({ data }: { data: any }) {
case 1:
break;
case 4:
if (notChatPage) {
if (!isChatPage) {
// save
saveChat(data.pubkey, event);
// update state
notifyChat(event.pubkey);
// send native notifiation
@ -50,7 +53,7 @@ export function ActiveAccount({ data }: { data: any }) {
}
break;
case 42:
if (notChannelPage) {
if (!isChannelPage) {
// update state
notifyChannel(event);
// send native notifiation

View File

@ -1,4 +1,3 @@
import { EventCollector } from "@shared/eventCollector";
import { ArrowLeftIcon, ArrowRightIcon } from "@shared/icons";
export function AppHeader() {
@ -39,7 +38,6 @@ export function AppHeader() {
/>
</button>
</div>
<EventCollector />
</div>
);
}

View File

@ -3,8 +3,8 @@ import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { READONLY_RELAYS } from "@stores/constants";
import { dateToUnix } from "@utils/date";
import { createChat, createNote, updateAccount } from "@utils/storage";
import { getParentID, nip02ToArray } from "@utils/transform";
import { createNote } from "@utils/storage";
import { getParentID } from "@utils/transform";
import { useContext } from "react";
import useSWRSubscription from "swr/subscription";
@ -21,20 +21,6 @@ export function EventCollector() {
authors: follows,
since: dateToUnix(),
},
{
kinds: [3],
authors: [account.pubkey],
},
{
kinds: [4],
"#p": [account.pubkey],
since: dateToUnix(),
},
{
kinds: [4],
authors: [account.pubkey],
since: dateToUnix(),
},
],
READONLY_RELAYS,
(event: any) => {
@ -54,37 +40,6 @@ export function EventCollector() {
);
break;
}
// contacts
case 3: {
const follows = nip02ToArray(event.tags);
// update account's folllows with NIP-02 tag list
updateAccount("follows", follows, event.pubkey);
break;
}
// chat
case 4: {
if (event.pubkey === account.pubkey) {
const receiver = event.tags.find((t) => t[0] === "p")[1];
createChat(
event.id,
receiver,
event.pubkey,
event.content,
event.tags,
event.created_at,
);
} else {
createChat(
event.id,
account.pubkey,
event.pubkey,
event.content,
event.tags,
event.created_at,
);
}
break;
}
// repost
case 6:
createNote(

View File

@ -38,7 +38,7 @@ export const useChannelMessages = create(
messages: [],
replyTo: { id: null, pubkey: null, content: null },
add: (message: any) => {
set((state: any) => ({ messages: [...state.messages, message] }));
set((state: any) => ({ messages: [message, ...state.messages] }));
},
openReply: (id: string, pubkey: string, content: string) => {
set(() => ({ replyTo: { id, pubkey, content } }));

View File

@ -1,4 +1,4 @@
import { getChatMessages, getChatsByPubkey } from "@utils/storage";
import { createChat, getChatMessages, getChatsByPubkey } from "@utils/storage";
import { create } from "zustand";
import { immer } from "zustand/middleware/immer";
@ -9,7 +9,7 @@ export const useChats = create(
const response: any = await getChatsByPubkey(pubkey);
set({ chats: response });
},
add: (pubkey: string) => {
add: async (pubkey: string) => {
set((state) => {
const target = state.chats.findIndex(
(m: { sender_pubkey: string }) => m.sender_pubkey === pubkey,
@ -39,8 +39,23 @@ export const useChatMessages = create((set) => ({
const response: any = await getChatMessages(receiver_pubkey, sender_pubkey);
set({ messages: response });
},
add: (message: any) => {
set((state: any) => ({ messages: [...state.messages, message] }));
add: async (receiver: string, event: any) => {
const save = await createChat(
event.id,
receiver,
event.pubkey,
event.content,
event.tags,
event.created_at,
);
if (save) {
set((state: any) => ({
messages: [
...state.messages,
{ ...event, sender_pubkey: event.pubkey, receiver_pubkey: receiver },
],
}));
}
},
clear: () => {
set(() => ({ messages: [] }));