From 4915b833e77f6d3983b8158e32dfd6cdc65b34af Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:00:38 +0700 Subject: [PATCH] small fixed --- package.json | 4 +- pnpm-lock.yaml | 38 ++--- src-tauri/Cargo.lock | 145 ++++++++----------- src/app.tsx | 14 +- src/app/explore/index.tsx | 45 +++--- src/app/relays/components/relayEventList.tsx | 8 +- src/index.css | 35 +++++ src/libs/ndk/instance.ts | 1 + src/shared/notes/kinds/text.tsx | 2 +- src/shared/notes/preview/link.tsx | 7 +- src/shared/notes/preview/video.tsx | 19 ++- src/shared/widgets/local/feeds.tsx | 2 +- 12 files changed, 178 insertions(+), 142 deletions(-) diff --git a/package.json b/package.json index 2f66ea30..30cd691a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@tiptap/react": "^2.1.11", "@tiptap/starter-kit": "^2.1.11", "@tiptap/suggestion": "^2.1.11", - "@vidstack/react": "^1.0.2", + "@vidstack/react": "^1.0.5", "dayjs": "^1.11.10", "destr": "^2.0.1", "html-to-text": "^9.0.5", @@ -73,7 +73,7 @@ "@tauri-apps/cli": "^1.5.0", "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/html-to-text": "^9.0.2", - "@types/node": "^20.7.1", + "@types/node": "^20.8.0", "@types/react": "^18.2.23", "@types/react-dom": "^18.2.8", "@types/youtube-player": "^5.5.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4428170f..f90c1ada 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,8 +72,8 @@ dependencies: specifier: ^2.1.11 version: 2.1.11(@tiptap/core@2.1.11)(@tiptap/pm@2.1.11) '@vidstack/react': - specifier: ^1.0.2 - version: 1.0.2(@types/react@18.2.23)(react@18.2.0) + specifier: ^1.0.5 + version: 1.0.5(@types/react@18.2.23)(react@18.2.0) dayjs: specifier: ^1.11.10 version: 1.11.10 @@ -167,8 +167,8 @@ devDependencies: specifier: ^9.0.2 version: 9.0.2 '@types/node': - specifier: ^20.7.1 - version: 20.7.1 + specifier: ^20.8.0 + version: 20.8.0 '@types/react': specifier: ^18.2.23 version: 18.2.23 @@ -246,7 +246,7 @@ devDependencies: version: 5.2.2 vite: specifier: ^4.4.9 - version: 4.4.9(@types/node@20.7.1) + version: 4.4.9(@types/node@20.8.0) vite-tsconfig-paths: specifier: ^4.2.1 version: 4.2.1(typescript@5.2.2)(vite@4.4.9) @@ -1835,7 +1835,7 @@ packages: '@swc/helpers': optional: true dependencies: - '@swc/counter': 0.1.1 + '@swc/counter': 0.1.2 '@swc/types': 0.1.5 optionalDependencies: '@swc/core-darwin-arm64': 1.3.90 @@ -1850,8 +1850,8 @@ packages: '@swc/core-win32-x64-msvc': 1.3.90 dev: true - /@swc/counter@0.1.1: - resolution: {integrity: sha512-xVRaR4u9hcYjFvcSg71Lz5Bo4//CyjAAfMxa7UsaDSYxAshflUkVJWiyVWrfxC59z2kP1IzI4/1BEpnhI9o3Mw==} + /@swc/counter@0.1.2: + resolution: {integrity: sha512-9F4ys4C74eSTEUNndnER3VJ15oru2NumfQxS8geE+f3eB5xvfxpWyqE5XlVnxb/R14uoXi6SLbBwwiDSkv+XEw==} dev: true /@swc/types@0.1.5: @@ -2526,8 +2526,8 @@ packages: resolution: {integrity: sha512-xPSg0jm4mqgEkNhowKgZFBNtwoEwF6gJ4Dhww+GFpm3IgtNseHQZ5IqdNwnquZEoANxyDAKDRAdVo4Z72VvD/g==} dev: false - /@types/node@20.7.1: - resolution: {integrity: sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==} + /@types/node@20.8.0: + resolution: {integrity: sha512-LzcWltT83s1bthcvjBmiBvGJiiUe84NWRHkw+ZV6Fr41z2FbIzvc815dk2nQ3RAKMuN2fkenM/z3Xv2QzEpYxQ==} dev: true /@types/object.omit@3.0.1: @@ -2703,8 +2703,8 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@vidstack/react@1.0.2(@types/react@18.2.23)(react@18.2.0): - resolution: {integrity: sha512-ZBTaEFtxmaFX/oB5I9o8qvoQ39jmwTySFxsFfBN7tkcWxKdTOUhwlIgIlFM5H/alJ/qxw13AZvxK2MW6q+le3g==} + /@vidstack/react@1.0.5(@types/react@18.2.23)(react@18.2.0): + resolution: {integrity: sha512-7qpI3gC7AeuPp6uc8YmDxneQV6DTVl6W2KMF2P562Fj0F3IrJhDeh8YfZ+DV4gXIYzNgbvQXjRgCBu9VxET+7w==} engines: {node: '>=18'} peerDependencies: '@types/react': ^18.0.0 @@ -2721,7 +2721,7 @@ packages: vite: ^4 dependencies: '@swc/core': 1.3.90 - vite: 4.4.9(@types/node@20.7.1) + vite: 4.4.9(@types/node@20.8.0) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -2958,7 +2958,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001541 - electron-to-chromium: 1.4.536 + electron-to-chromium: 1.4.537 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) dev: true @@ -3369,8 +3369,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.536: - resolution: {integrity: sha512-L4VgC/76m6y8WVCgnw5kJy/xs7hXrViCFdNKVG8Y7B2isfwrFryFyJzumh3ugxhd/oB1uEaEEvRdmeLrnd7OFA==} + /electron-to-chromium@1.4.537: + resolution: {integrity: sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==} dev: true /emoji-regex@9.2.2: @@ -6554,13 +6554,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.7.1) + vite: 4.4.9(@types/node@20.8.0) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.4.9(@types/node@20.7.1): + /vite@4.4.9(@types/node@20.8.0): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6588,7 +6588,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.7.1 + '@types/node': 20.8.0 esbuild: 0.18.20 postcss: 8.4.31 rollup: 3.29.4 diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 5da78a66..18f06e06 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -122,9 +122,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6cd65a4b849ace0b7f6daeebcc1a1d111282227ca745458c61dbf670e52a597" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -160,9 +160,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0238ca56c96dfa37bdf7c373c8886dd591322500aceeeccdb2216fe06dc2f796" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -192,7 +192,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ - "event-listener 2.5.3", + "event-listener", "futures-core", ] @@ -203,7 +203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener 2.5.3", + "event-listener", "futures-core", ] @@ -247,7 +247,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.23", + "rustix 0.37.24", "slab", "socket2 0.4.9", "waker-fn", @@ -259,23 +259,24 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener 2.5.3", + "event-listener", ] [[package]] name = "async-process" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf012553ce51eb7aa6dc2143804cc8252bd1cb681a1c5cb7fa94ca88682dee1d" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" dependencies = [ "async-io", "async-lock", - "async-signal", + "autocfg", "blocking", "cfg-if", - "event-listener 3.0.0", + "event-listener", "futures-lite", - "rustix 0.38.14", + "rustix 0.37.24", + "signal-hook", "windows-sys 0.48.0", ] @@ -290,25 +291,6 @@ dependencies = [ "syn 2.0.37", ] -[[package]] -name = "async-signal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99f3cb3f9ff89f7d718fbb942c9eb91bedff12e396adf09a622dfe7ffec2bc2" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "concurrent-queue", - "futures-core", - "futures-io", - "libc", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - [[package]] name = "async-task" version = "4.4.1" @@ -515,9 +497,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.3.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -526,9 +508,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1425,17 +1407,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e56284f00d94c1bc7fd3c77027b4623c88c1f53d8d2394c6199f2921dea325" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "1.9.0" @@ -1458,7 +1429,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" dependencies = [ "cfg-if", - "rustix 0.38.14", + "rustix 0.38.15", "windows-sys 0.48.0", ] @@ -2050,9 +2021,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ "ahash 0.8.3", "allocator-api2", @@ -2064,7 +2035,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -2321,12 +2292,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "serde", ] @@ -2601,9 +2572,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lock_api" @@ -3745,13 +3716,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", + "regex-automata 0.3.9", "regex-syntax 0.7.5", ] @@ -3766,9 +3737,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -3917,9 +3888,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" dependencies = [ "bitflags 1.3.2", "errno", @@ -3931,14 +3902,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.8", "windows-sys 0.48.0", ] @@ -4179,7 +4150,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.0.1", + "indexmap 2.0.2", "serde", "serde_json", "serde_with_macros", @@ -4274,6 +4245,16 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -4456,7 +4437,7 @@ dependencies = [ "crossbeam-queue", "dotenvy", "either", - "event-listener 2.5.3", + "event-listener", "futures-channel", "futures-core", "futures-intrusive", @@ -4464,7 +4445,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.0.1", + "indexmap 2.0.2", "log", "memchr", "once_cell", @@ -4828,9 +4809,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.16.2" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6d198e01085564cea63e976ad1566c1ba2c2e4cc79578e35d9f05521505e31" +checksum = "b768eb5cf657b045d03304b1f60ecb54eac8b520f393c4f4240a94111a1caa17" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -4956,9 +4937,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a62b3327886e7ef2978adc668432f1cc53f14e1d46e7ae04f730f4d48584623" +checksum = "defbfc551bd38ab997e5f8e458f87396d2559d05ce32095076ad6c30f7fc5f9c" dependencies = [ "anyhow", "cargo_toml", @@ -5016,7 +4997,7 @@ dependencies = [ [[package]] name = "tauri-plugin-autostart" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9af4c3727c0d9c7a88b27cb80a6482a5aa461fc5" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9b96996b5a90a6a57d587ce4312975f13a4d8bc2" dependencies = [ "auto-launch", "log", @@ -5029,7 +5010,7 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9af4c3727c0d9c7a88b27cb80a6482a5aa461fc5" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9b96996b5a90a6a57d587ce4312975f13a4d8bc2" dependencies = [ "log", "serde", @@ -5043,7 +5024,7 @@ dependencies = [ [[package]] name = "tauri-plugin-sql" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9af4c3727c0d9c7a88b27cb80a6482a5aa461fc5" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9b96996b5a90a6a57d587ce4312975f13a4d8bc2" dependencies = [ "futures-core", "log", @@ -5059,7 +5040,7 @@ dependencies = [ [[package]] name = "tauri-plugin-store" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9af4c3727c0d9c7a88b27cb80a6482a5aa461fc5" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9b96996b5a90a6a57d587ce4312975f13a4d8bc2" dependencies = [ "log", "serde", @@ -5071,7 +5052,7 @@ dependencies = [ [[package]] name = "tauri-plugin-stronghold" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9af4c3727c0d9c7a88b27cb80a6482a5aa461fc5" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9b96996b5a90a6a57d587ce4312975f13a4d8bc2" dependencies = [ "hex", "iota-crypto 0.23.0", @@ -5090,7 +5071,7 @@ dependencies = [ [[package]] name = "tauri-plugin-upload" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9af4c3727c0d9c7a88b27cb80a6482a5aa461fc5" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#9b96996b5a90a6a57d587ce4312975f13a4d8bc2" dependencies = [ "futures-util", "log", @@ -5204,7 +5185,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.3.5", - "rustix 0.38.14", + "rustix 0.38.15", "windows-sys 0.48.0", ] @@ -5397,7 +5378,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.1", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -6407,7 +6388,7 @@ dependencies = [ "byteorder", "derivative", "enumflags2", - "event-listener 2.5.3", + "event-listener", "futures-core", "futures-sink", "futures-util", diff --git a/src/app.tsx b/src/app.tsx index bcec589e..748c54d3 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,13 +1,13 @@ import { message } from '@tauri-apps/api/dialog'; import { fetch } from '@tauri-apps/api/http'; -import '@vidstack/react/player/styles/default/theme.css'; import { RouterProvider, createBrowserRouter, defer, redirect } from 'react-router-dom'; -import 'reactflow/dist/style.css'; +import { ReactFlowProvider } from 'reactflow'; import { AuthCreateScreen } from '@app/auth/create'; import { AuthImportScreen } from '@app/auth/import'; import { OnboardingScreen } from '@app/auth/onboarding'; import { ErrorScreen } from '@app/error'; +import { ExploreScreen } from '@app/explore'; import { useStorage } from '@libs/storage/provider'; @@ -106,10 +106,12 @@ export default function App() { }, { path: 'explore', - async lazy() { - const { ExploreScreen } = await import('@app/explore'); - return { Component: ExploreScreen }; - }, + element: ( + + + + ), + errorElement: , }, { path: 'relays', diff --git a/src/app/explore/index.tsx b/src/app/explore/index.tsx index fac38ae2..b6248328 100644 --- a/src/app/explore/index.tsx +++ b/src/app/explore/index.tsx @@ -2,7 +2,6 @@ import { useCallback, useMemo, useRef } from 'react'; import ReactFlow, { Background, ConnectionMode, - ReactFlowProvider, addEdge, useEdgesState, useNodesState, @@ -92,28 +91,26 @@ export function ExploreScreen() { ); return ( - -
- - - -
-
+
+ + + +
); } diff --git a/src/app/relays/components/relayEventList.tsx b/src/app/relays/components/relayEventList.tsx index 56841a88..fec9457f 100644 --- a/src/app/relays/components/relayEventList.tsx +++ b/src/app/relays/components/relayEventList.tsx @@ -5,6 +5,7 @@ import { VList } from 'virtua'; import { useNDK } from '@libs/ndk/provider'; +import { LoaderIcon } from '@shared/icons'; import { ArticleNote, FileNote, @@ -70,7 +71,12 @@ export function RelayEventList({ relayUrl }: { relayUrl: string }) {
{status === 'loading' ? ( -
Loading...
+
+
+ +

Loading newsfeed...

+
+
) : (
diff --git a/src/index.css b/src/index.css index 74909906..0ef94e8f 100644 --- a/src/index.css +++ b/src/index.css @@ -1,3 +1,8 @@ +@import 'reactflow/dist/style.css'; +@import '@vidstack/react/player/styles/default/theme.css'; +@import '@vidstack/react/player/styles/default/layouts/audio.css'; +@import '@vidstack/react/player/styles/default/layouts/video.css'; + @tailwind base; @tailwind components; @tailwind utilities; @@ -67,3 +72,33 @@ input::-ms-clear { .ProseMirror img.ProseMirror-selectednode { @apply outline-fuchsia-500; } + +.player { + --brand-color: #f5f5f5; + --focus-color: #4e9cf6; + + --audio-brand: var(--brand-color); + --audio-focus-ring-color: var(--focus-color); + --audio-border-radius: 2px; + + --video-brand: var(--brand-color); + --video-focus-ring-color: var(--focus-color); + --video-border-radius: 8px; + + /* 👉 https://vidstack.io/docs/player/components/layouts/default#css-variables for more. */ + + width: 100%; +} + +.player[data-view-type='video'] { + aspect-ratio: 16 /9; +} + +.src-buttons { + display: flex; + align-items: center; + justify-content: space-evenly; + margin-top: 40px; + margin-inline: auto; + max-width: 300px; +} diff --git a/src/libs/ndk/instance.ts b/src/libs/ndk/instance.ts index 641d1d39..5fb58aff 100644 --- a/src/libs/ndk/instance.ts +++ b/src/libs/ndk/instance.ts @@ -58,6 +58,7 @@ export const NDKInstance = () => { const dexieAdapter = new NDKCacheAdapterDexie({ dbName: 'lume_ndkcache' }); const instance = new NDK({ explicitRelayUrls, + // @ts-expect-error, wtf? cacheAdapter: dexieAdapter, }); diff --git a/src/shared/notes/kinds/text.tsx b/src/shared/notes/kinds/text.tsx index 748e1693..82f34e7b 100644 --- a/src/shared/notes/kinds/text.tsx +++ b/src/shared/notes/kinds/text.tsx @@ -62,7 +62,7 @@ export function TextNote(props: { content?: string }) { } }, }} - disallowedElements={['h1', 'h2', 'h3', 'h4', 'h5', 'h6']} + disallowedElements={['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'pre', 'code']} unwrapDisallowed={true} linkTarget={'_blank'} > diff --git a/src/shared/notes/preview/link.tsx b/src/shared/notes/preview/link.tsx index 37bed4b1..b0b81e14 100644 --- a/src/shared/notes/preview/link.tsx +++ b/src/shared/notes/preview/link.tsx @@ -1,7 +1,5 @@ import { Link } from 'react-router-dom'; -import { Image } from '@shared/image'; - import { useOpenGraph } from '@utils/hooks/useOpenGraph'; export function LinkPreview({ urls }: { urls: string[] }) { @@ -38,10 +36,13 @@ export function LinkPreview({ urls }: { urls: string[] }) { ) : ( <> {data.image && ( - {urls[0]} )}
diff --git a/src/shared/notes/preview/video.tsx b/src/shared/notes/preview/video.tsx index 1217e8e7..089820f7 100644 --- a/src/shared/notes/preview/video.tsx +++ b/src/shared/notes/preview/video.tsx @@ -1,4 +1,9 @@ -import { MediaPlayer, MediaProvider } from '@vidstack/react'; +import { MediaPlayer, MediaProvider, Poster } from '@vidstack/react'; +import { + DefaultAudioLayout, + DefaultVideoLayout, + defaultLayoutIcons, +} from '@vidstack/react/player/layouts/default'; export function VideoPreview({ urls }: { urls: string[] }) { return ( @@ -7,12 +12,20 @@ export function VideoPreview({ urls }: { urls: string[] }) { - + + + + + ))}
diff --git a/src/shared/widgets/local/feeds.tsx b/src/shared/widgets/local/feeds.tsx index 5b418238..1b09c072 100644 --- a/src/shared/widgets/local/feeds.tsx +++ b/src/shared/widgets/local/feeds.tsx @@ -82,7 +82,7 @@ export function LocalFeedsWidget({ params }: { params: Widget }) {
{status === 'loading' ? ( -
+

Loading newsfeed...