Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a262217ab2 | |||
| c5d06a2492 | |||
| c93edde7d2 | |||
| 5103126001 |
166
package.json
166
package.json
@@ -1,85 +1,85 @@
|
||||
{
|
||||
"name": "lume",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getalby/bitcoin-connect-react": "^3.6.2",
|
||||
"@phosphor-icons/react": "^2.1.7",
|
||||
"@radix-ui/react-avatar": "^1.1.1",
|
||||
"@radix-ui/react-checkbox": "^1.1.2",
|
||||
"@radix-ui/react-popover": "^1.1.2",
|
||||
"@radix-ui/react-progress": "^1.1.0",
|
||||
"@radix-ui/react-scroll-area": "^1.2.0",
|
||||
"@radix-ui/react-switch": "^1.1.1",
|
||||
"@radix-ui/react-tabs": "^1.1.1",
|
||||
"@radix-ui/react-tooltip": "^1.1.3",
|
||||
"@tanstack/query-broadcast-client-experimental": "^5.59.20",
|
||||
"@tanstack/query-persist-client-core": "^5.59.20",
|
||||
"@tanstack/react-query": "^5.59.20",
|
||||
"@tanstack/react-router": "^1.81.0",
|
||||
"@tauri-apps/api": "^2.1.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.1",
|
||||
"@tauri-apps/plugin-fs": "^2.0.2",
|
||||
"@tauri-apps/plugin-http": "^2.0.1",
|
||||
"@tauri-apps/plugin-os": "^2.0.0",
|
||||
"@tauri-apps/plugin-process": "^2.0.0",
|
||||
"@tauri-apps/plugin-shell": "^2.0.1",
|
||||
"@tauri-apps/plugin-store": "github:tauri-apps/tauri-plugin-store#a564510",
|
||||
"@tauri-apps/plugin-updater": "^2.0.0",
|
||||
"@tauri-apps/plugin-upload": "^2.1.0",
|
||||
"@tauri-apps/plugin-window-state": "^2.0.0",
|
||||
"bitcoin-units": "^1.0.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"embla-carousel-react": "^8.3.1",
|
||||
"i18next": "^23.16.5",
|
||||
"i18next-resources-to-backend": "^1.2.1",
|
||||
"light-bolt11-decoder": "^3.2.0",
|
||||
"minidenticons": "^4.2.1",
|
||||
"nanoid": "^5.0.8",
|
||||
"nostr-tools": "^2.10.1",
|
||||
"react": "19.0.0-rc-cae764ce-20241025",
|
||||
"react-currency-input-field": "^3.8.0",
|
||||
"react-dom": "19.0.0-rc-cae764ce-20241025",
|
||||
"react-hook-form": "^7.53.2",
|
||||
"react-i18next": "^15.1.1",
|
||||
"react-string-replace": "^1.1.1",
|
||||
"rich-textarea": "^0.26.4",
|
||||
"use-debounce": "^10.0.4",
|
||||
"virtua": "^0.34.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"@tanstack/router-devtools": "^1.81.0",
|
||||
"@tanstack/router-plugin": "^1.79.0",
|
||||
"@tauri-apps/cli": "^2.1.0",
|
||||
"@types/react": "npm:types-react@19.0.0-rc.1",
|
||||
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"babel-plugin-react-compiler": "0.0.0-experimental-b4db8c3-20241001",
|
||||
"clsx": "^2.1.1",
|
||||
"postcss": "^8.4.47",
|
||||
"tailwind-gradient-mask-image": "^1.2.0",
|
||||
"tailwind-merge": "^2.5.4",
|
||||
"tailwind-scrollbar": "^3.1.0",
|
||||
"tailwindcss": "^3.4.14",
|
||||
"tailwindcss-content-visibility": "^1.0.0",
|
||||
"typescript": "^5.6.3",
|
||||
"vite": "^5.4.10",
|
||||
"vite-tsconfig-paths": "^5.1.1"
|
||||
},
|
||||
"overrides": {
|
||||
"@types/react": "npm:types-react@rc",
|
||||
"@types/react-dom": "npm:types-react-dom@rc"
|
||||
}
|
||||
"name": "lume",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getalby/bitcoin-connect-react": "^3.6.2",
|
||||
"@phosphor-icons/react": "^2.1.7",
|
||||
"@radix-ui/react-avatar": "^1.1.1",
|
||||
"@radix-ui/react-checkbox": "^1.1.2",
|
||||
"@radix-ui/react-popover": "^1.1.2",
|
||||
"@radix-ui/react-progress": "^1.1.0",
|
||||
"@radix-ui/react-scroll-area": "^1.2.0",
|
||||
"@radix-ui/react-switch": "^1.1.1",
|
||||
"@radix-ui/react-tabs": "^1.1.1",
|
||||
"@radix-ui/react-tooltip": "^1.1.3",
|
||||
"@tanstack/query-broadcast-client-experimental": "^5.59.20",
|
||||
"@tanstack/query-persist-client-core": "^5.59.20",
|
||||
"@tanstack/react-query": "^5.59.20",
|
||||
"@tanstack/react-router": "^1.81.0",
|
||||
"@tauri-apps/api": "^2.1.0",
|
||||
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.1",
|
||||
"@tauri-apps/plugin-fs": "^2.0.2",
|
||||
"@tauri-apps/plugin-http": "^2.0.1",
|
||||
"@tauri-apps/plugin-os": "^2.0.0",
|
||||
"@tauri-apps/plugin-process": "^2.0.0",
|
||||
"@tauri-apps/plugin-shell": "^2.0.1",
|
||||
"@tauri-apps/plugin-store": "github:tauri-apps/tauri-plugin-store#a564510",
|
||||
"@tauri-apps/plugin-updater": "^2.0.0",
|
||||
"@tauri-apps/plugin-upload": "^2.1.0",
|
||||
"@tauri-apps/plugin-window-state": "^2.0.0",
|
||||
"bitcoin-units": "^1.0.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"embla-carousel-react": "^8.3.1",
|
||||
"i18next": "^23.16.5",
|
||||
"i18next-resources-to-backend": "^1.2.1",
|
||||
"light-bolt11-decoder": "^3.2.0",
|
||||
"minidenticons": "^4.2.1",
|
||||
"nanoid": "^5.0.8",
|
||||
"nostr-tools": "^2.10.1",
|
||||
"react": "19.0.0-rc-cae764ce-20241025",
|
||||
"react-currency-input-field": "^3.8.0",
|
||||
"react-dom": "19.0.0-rc-cae764ce-20241025",
|
||||
"react-hook-form": "^7.53.2",
|
||||
"react-i18next": "^15.1.1",
|
||||
"react-string-replace": "^1.1.1",
|
||||
"rich-textarea": "^0.26.4",
|
||||
"use-debounce": "^10.0.4",
|
||||
"virtua": "^0.34.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"@tanstack/router-devtools": "^1.81.0",
|
||||
"@tanstack/router-plugin": "^1.79.0",
|
||||
"@tauri-apps/cli": "^2.1.0",
|
||||
"@types/react": "npm:types-react@19.0.0-rc.1",
|
||||
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"babel-plugin-react-compiler": "0.0.0-experimental-b4db8c3-20241001",
|
||||
"clsx": "^2.1.1",
|
||||
"postcss": "^8.4.47",
|
||||
"tailwind-gradient-mask-image": "^1.2.0",
|
||||
"tailwind-merge": "^2.5.4",
|
||||
"tailwind-scrollbar": "^3.1.0",
|
||||
"tailwindcss": "^3.4.14",
|
||||
"tailwindcss-content-visibility": "^1.0.0",
|
||||
"typescript": "^5.6.3",
|
||||
"vite": "^5.4.10",
|
||||
"vite-tsconfig-paths": "5.0.0"
|
||||
},
|
||||
"overrides": {
|
||||
"@types/react": "npm:types-react@rc",
|
||||
"@types/react-dom": "npm:types-react-dom@rc"
|
||||
}
|
||||
}
|
||||
|
||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -202,8 +202,8 @@ importers:
|
||||
specifier: ^5.4.10
|
||||
version: 5.4.10
|
||||
vite-tsconfig-paths:
|
||||
specifier: ^5.1.1
|
||||
version: 5.1.1(typescript@5.6.3)(vite@5.4.10)
|
||||
specifier: 5.0.0
|
||||
version: 5.0.0(typescript@5.6.3)(vite@5.4.10)
|
||||
|
||||
packages:
|
||||
|
||||
@@ -2319,8 +2319,8 @@ packages:
|
||||
vue:
|
||||
optional: true
|
||||
|
||||
vite-tsconfig-paths@5.1.1:
|
||||
resolution: {integrity: sha512-0nLY3qQI4GlYw3We4rps16ntW+nAZYCUrJwsuvqxIUCY9Bk3VnSeJDm/VPCmjOcAJ9Kud4k+CK2ZEnf9pbzK9Q==}
|
||||
vite-tsconfig-paths@5.0.0:
|
||||
resolution: {integrity: sha512-sCdKc6uC7ir102lW8deBiMnS0NGEs0100OJX8WZQmf3Uf7tJ/T3uQnzznq/tZWph7tkG+44JYOsKE7YTZjDn+Q==}
|
||||
peerDependencies:
|
||||
vite: '*'
|
||||
peerDependenciesMeta:
|
||||
@@ -4336,7 +4336,7 @@ snapshots:
|
||||
react: 19.0.0-rc-cae764ce-20241025
|
||||
react-dom: 19.0.0-rc-cae764ce-20241025(react@19.0.0-rc-cae764ce-20241025)
|
||||
|
||||
vite-tsconfig-paths@5.1.1(typescript@5.6.3)(vite@5.4.10):
|
||||
vite-tsconfig-paths@5.0.0(typescript@5.6.3)(vite@5.4.10):
|
||||
dependencies:
|
||||
debug: 4.3.7
|
||||
globrex: 0.1.2
|
||||
|
||||
162
src-tauri/Cargo.lock
generated
162
src-tauri/Cargo.lock
generated
@@ -301,7 +301,7 @@ dependencies = [
|
||||
"futures-lite 2.5.0",
|
||||
"parking",
|
||||
"polling 3.7.4",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"slab",
|
||||
"tracing",
|
||||
"windows-sys 0.59.0",
|
||||
@@ -340,7 +340,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"event-listener 3.1.0",
|
||||
"futures-lite 1.13.0",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
@@ -359,7 +359,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"event-listener 5.3.1",
|
||||
"futures-lite 2.5.0",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
@@ -386,7 +386,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"signal-hook-registry",
|
||||
"slab",
|
||||
"windows-sys 0.59.0",
|
||||
@@ -431,7 +431,7 @@ dependencies = [
|
||||
"futures",
|
||||
"futures-util",
|
||||
"js-sys",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tokio-socks",
|
||||
@@ -679,7 +679,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "border"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/ahkohd/tauri-toolkit?branch=v2#0bf90a47e90b22dede48f13444a34af8f8bbbdfc"
|
||||
source = "git+https://github.com/ahkohd/tauri-toolkit?branch=v2#8fa9329f677a199c5c2b445def218cef8ff325b2"
|
||||
dependencies = [
|
||||
"cocoa 0.25.0",
|
||||
"color",
|
||||
@@ -754,7 +754,7 @@ dependencies = [
|
||||
"glib",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -797,7 +797,7 @@ dependencies = [
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -987,7 +987,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "color"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/ahkohd/tauri-toolkit?branch=v2#0bf90a47e90b22dede48f13444a34af8f8bbbdfc"
|
||||
source = "git+https://github.com/ahkohd/tauri-toolkit?branch=v2#8fa9329f677a199c5c2b445def218cef8ff325b2"
|
||||
dependencies = [
|
||||
"cocoa 0.25.0",
|
||||
"objc",
|
||||
@@ -1765,7 +1765,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "db9c27b72f19a99a895f8ca89e2d26e4ef31013376e56fdafef697627306c3e4"
|
||||
dependencies = [
|
||||
"nom",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2029,7 +2029,7 @@ version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30"
|
||||
dependencies = [
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
@@ -2079,7 +2079,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"pin-project-lite",
|
||||
"smallvec",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2115,7 +2115,7 @@ dependencies = [
|
||||
"memchr",
|
||||
"once_cell",
|
||||
"smallvec",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2858,7 +2858,7 @@ dependencies = [
|
||||
"combine",
|
||||
"jni-sys",
|
||||
"log",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"walkdir",
|
||||
"windows-sys 0.45.0",
|
||||
]
|
||||
@@ -2893,7 +2893,7 @@ dependencies = [
|
||||
"jsonptr",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3034,7 +3034,7 @@ dependencies = [
|
||||
"freedesktop_entry_parser",
|
||||
"linicon-theme",
|
||||
"memmap2",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3275,7 +3275,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"png",
|
||||
"serde",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
@@ -3308,7 +3308,7 @@ dependencies = [
|
||||
"ndk-sys",
|
||||
"num_enum",
|
||||
"raw-window-handle",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3388,7 +3388,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"async-trait",
|
||||
@@ -3419,13 +3419,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr-connect"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"async-utility",
|
||||
"nostr",
|
||||
"nostr-relay-pool",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@@ -3433,13 +3433,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr-database"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"flatbuffers",
|
||||
"lru",
|
||||
"nostr",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@@ -3447,12 +3447,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr-lmdb"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"heed",
|
||||
"nostr",
|
||||
"nostr-database",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@@ -3460,7 +3460,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr-relay-pool"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"async-utility",
|
||||
"async-wsocket",
|
||||
@@ -3469,7 +3469,7 @@ dependencies = [
|
||||
"negentropy 0.4.3",
|
||||
"nostr",
|
||||
"nostr-database",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tracing",
|
||||
@@ -3478,7 +3478,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr-sdk"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"async-utility",
|
||||
"atomic-destructor",
|
||||
@@ -3489,7 +3489,7 @@ dependencies = [
|
||||
"nostr-relay-pool",
|
||||
"nostr-zapper",
|
||||
"nwc",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@@ -3497,11 +3497,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nostr-zapper"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"nostr",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"webln",
|
||||
]
|
||||
|
||||
@@ -3631,14 +3631,14 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nwc"
|
||||
version = "0.36.0"
|
||||
source = "git+https://github.com/reyamir/nostr?branch=feat/nip-22#9afd230b93494390438c69fbd6f2a7de79fa0af8"
|
||||
source = "git+https://github.com/rust-nostr/nostr#191410b7f14236b7a6b39e78a07099df4c691032"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"async-utility",
|
||||
"nostr",
|
||||
"nostr-relay-pool",
|
||||
"nostr-zapper",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
@@ -4337,7 +4337,7 @@ dependencies = [
|
||||
"concurrent-queue",
|
||||
"hermit-abi 0.4.0",
|
||||
"pin-project-lite",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"tracing",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
@@ -4497,7 +4497,7 @@ dependencies = [
|
||||
"rustc-hash",
|
||||
"rustls",
|
||||
"socket2 0.5.7",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@@ -4514,7 +4514,7 @@ dependencies = [
|
||||
"rustc-hash",
|
||||
"rustls",
|
||||
"slab",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tinyvec",
|
||||
"tracing",
|
||||
]
|
||||
@@ -4657,7 +4657,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
|
||||
dependencies = [
|
||||
"getrandom 0.2.15",
|
||||
"libredox",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4827,9 +4827,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.39"
|
||||
version = "0.38.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee"
|
||||
checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"errno",
|
||||
@@ -5256,7 +5256,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "share-picker"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/ahkohd/tauri-toolkit?branch=v2#0bf90a47e90b22dede48f13444a34af8f8bbbdfc"
|
||||
source = "git+https://github.com/ahkohd/tauri-toolkit?branch=v2#8fa9329f677a199c5c2b445def218cef8ff325b2"
|
||||
dependencies = [
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
@@ -5392,7 +5392,7 @@ checksum = "4ccbb212565d2dc177bc15ecb7b039d66c4490da892436a4eee5b394d620c9bc"
|
||||
dependencies = [
|
||||
"paste",
|
||||
"specta-macros",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5414,7 +5414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12260cbb21abb2e83a0375b1521867910e3aed8a7afa782206150ce552cd2e5a"
|
||||
dependencies = [
|
||||
"specta",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5425,7 +5425,7 @@ checksum = "b1e4472229365ceb6395487e3a60d921ad8e21f9ad06eaecc396f098902c9adc"
|
||||
dependencies = [
|
||||
"specta",
|
||||
"specta-serde",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5719,7 +5719,7 @@ dependencies = [
|
||||
"tauri-runtime",
|
||||
"tauri-runtime-wry",
|
||||
"tauri-utils",
|
||||
"thiserror 2.0.1",
|
||||
"thiserror 2.0.3",
|
||||
"tokio",
|
||||
"tray-icon",
|
||||
"url",
|
||||
@@ -5772,7 +5772,7 @@ dependencies = [
|
||||
"sha2",
|
||||
"syn 2.0.87",
|
||||
"tauri-utils",
|
||||
"thiserror 2.0.1",
|
||||
"thiserror 2.0.3",
|
||||
"time",
|
||||
"url",
|
||||
"uuid",
|
||||
@@ -5822,7 +5822,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5855,7 +5855,7 @@ dependencies = [
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"tauri-plugin-fs",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"url",
|
||||
]
|
||||
|
||||
@@ -5875,7 +5875,7 @@ dependencies = [
|
||||
"serde_repr",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"url",
|
||||
"uuid",
|
||||
]
|
||||
@@ -5896,7 +5896,7 @@ dependencies = [
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"tauri-plugin-fs",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"url",
|
||||
"urlpattern",
|
||||
@@ -5916,7 +5916,7 @@ dependencies = [
|
||||
"serde_repr",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"time",
|
||||
"url",
|
||||
]
|
||||
@@ -5936,7 +5936,7 @@ dependencies = [
|
||||
"sys-locale",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5951,7 +5951,7 @@ dependencies = [
|
||||
"strum",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5981,7 +5981,7 @@ dependencies = [
|
||||
"shared_child",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@@ -5996,7 +5996,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@@ -6043,7 +6043,7 @@ dependencies = [
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"tempfile",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"time",
|
||||
"tokio",
|
||||
"url",
|
||||
@@ -6065,7 +6065,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
]
|
||||
@@ -6082,7 +6082,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"tauri-plugin",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6099,7 +6099,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tauri-utils",
|
||||
"thiserror 2.0.1",
|
||||
"thiserror 2.0.3",
|
||||
"url",
|
||||
"windows 0.58.0",
|
||||
]
|
||||
@@ -6143,7 +6143,7 @@ dependencies = [
|
||||
"specta-typescript",
|
||||
"tauri",
|
||||
"tauri-specta-macros",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6187,7 +6187,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"serde_with",
|
||||
"swift-rs",
|
||||
"thiserror 2.0.1",
|
||||
"thiserror 2.0.3",
|
||||
"toml 0.8.19",
|
||||
"url",
|
||||
"urlpattern",
|
||||
@@ -6225,7 +6225,7 @@ dependencies = [
|
||||
"cfg-if",
|
||||
"fastrand 2.2.0",
|
||||
"once_cell",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
@@ -6248,27 +6248,27 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.68"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892"
|
||||
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
|
||||
dependencies = [
|
||||
"thiserror-impl 1.0.68",
|
||||
"thiserror-impl 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "2.0.1"
|
||||
version = "2.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "07c1e40dd48a282ae8edc36c732cbc219144b87fb6a4c7316d611c6b1f06ec0c"
|
||||
checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa"
|
||||
dependencies = [
|
||||
"thiserror-impl 2.0.1",
|
||||
"thiserror-impl 2.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.68"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e"
|
||||
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -6277,9 +6277,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "2.0.1"
|
||||
version = "2.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "874aa7e446f1da8d9c3a5c95b1c5eb41d800045252121dc7f8e0ba370cee55f5"
|
||||
checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -6432,7 +6432,7 @@ checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f"
|
||||
dependencies = [
|
||||
"either",
|
||||
"futures-util",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@@ -6626,7 +6626,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"png",
|
||||
"serde",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
@@ -6652,7 +6652,7 @@ dependencies = [
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"sha1",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"utf-8",
|
||||
]
|
||||
|
||||
@@ -6984,7 +6984,7 @@ checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"downcast-rs",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"scoped-tls",
|
||||
"smallvec",
|
||||
"wayland-sys",
|
||||
@@ -6997,7 +6997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"wayland-backend",
|
||||
"wayland-scanner",
|
||||
]
|
||||
@@ -7161,7 +7161,7 @@ version = "0.33.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a3a3e2eeb58f82361c93f9777014668eb3d07e7d174ee4c819575a9208011886"
|
||||
dependencies = [
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"windows 0.58.0",
|
||||
"windows-core 0.58.0",
|
||||
]
|
||||
@@ -7668,7 +7668,7 @@ dependencies = [
|
||||
"sha2",
|
||||
"soup3",
|
||||
"tao-macros",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
"url",
|
||||
"webkit2gtk",
|
||||
"webkit2gtk-sys",
|
||||
@@ -7707,7 +7707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12"
|
||||
dependencies = [
|
||||
"gethostname 0.4.3",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
"x11rb-protocol",
|
||||
]
|
||||
|
||||
@@ -7725,7 +7725,7 @@ checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"linux-raw-sys 0.4.14",
|
||||
"rustix 0.38.39",
|
||||
"rustix 0.38.40",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7973,7 +7973,7 @@ dependencies = [
|
||||
"displaydoc",
|
||||
"indexmap 2.6.0",
|
||||
"memchr",
|
||||
"thiserror 1.0.68",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -52,10 +52,6 @@ webbrowser = "1.0.2"
|
||||
nostr-sdk = { git = "https://github.com/rust-nostr/nostr", features = ["lmdb", "webln", "all-nips"] }
|
||||
nostr-connect = { git = "https://github.com/rust-nostr/nostr" }
|
||||
|
||||
[patch.'https://github.com/rust-nostr/nostr']
|
||||
nostr-sdk = { git = "https://github.com/reyamir/nostr", branch = "feat/nip-22", features = ["lmdb", "webln", "all-nips"] }
|
||||
nostr-connect = { git = "https://github.com/reyamir/nostr", branch = "feat/nip-22" }
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
border = { git = "https://github.com/ahkohd/tauri-toolkit", branch = "v2" }
|
||||
share-picker = { git = "https://github.com/ahkohd/tauri-toolkit", branch = "v2" }
|
||||
|
||||
@@ -2,4 +2,5 @@ pub mod account;
|
||||
pub mod event;
|
||||
pub mod metadata;
|
||||
pub mod relay;
|
||||
pub mod sync;
|
||||
pub mod window;
|
||||
|
||||
71
src-tauri/src/commands/sync.rs
Normal file
71
src-tauri/src/commands/sync.rs
Normal file
@@ -0,0 +1,71 @@
|
||||
use nostr_sdk::prelude::*;
|
||||
use std::collections::HashSet;
|
||||
use tauri::State;
|
||||
|
||||
use crate::Nostr;
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn sync_all(
|
||||
state: State<'_, Nostr>,
|
||||
reader: tauri::ipc::Channel<f64>,
|
||||
) -> Result<(), String> {
|
||||
let client = &state.client;
|
||||
|
||||
// Create a filter for get all public keys
|
||||
let filter = Filter::new().kinds(vec![
|
||||
Kind::TextNote,
|
||||
Kind::Repost,
|
||||
Kind::FollowSet,
|
||||
Kind::ContactList,
|
||||
Kind::MuteList,
|
||||
]);
|
||||
|
||||
let events = client
|
||||
.database()
|
||||
.query(vec![filter])
|
||||
.await
|
||||
.map_err(|err| err.to_string())?;
|
||||
|
||||
let public_keys: Vec<PublicKey> = events
|
||||
.iter()
|
||||
.flat_map(|ev| ev.tags.public_keys().copied())
|
||||
.collect::<HashSet<_>>()
|
||||
.into_iter()
|
||||
.collect();
|
||||
|
||||
let (tx, mut rx) = SyncProgress::channel();
|
||||
let opts = SyncOptions::default().progress(tx);
|
||||
|
||||
tauri::async_runtime::spawn(async move {
|
||||
while rx.changed().await.is_ok() {
|
||||
let progress = *rx.borrow_and_update();
|
||||
|
||||
if progress.total > 0 {
|
||||
reader.send(progress.percentage() * 100.0).unwrap();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for chunk in public_keys.chunks(200) {
|
||||
let authors = chunk.to_owned();
|
||||
let filter = Filter::new().authors(authors).kinds(vec![
|
||||
Kind::Metadata,
|
||||
Kind::ContactList,
|
||||
Kind::FollowSet,
|
||||
Kind::Interests,
|
||||
Kind::InterestSet,
|
||||
Kind::EventDeletion,
|
||||
Kind::TextNote,
|
||||
Kind::Repost,
|
||||
Kind::Comment,
|
||||
]);
|
||||
|
||||
let _ = client
|
||||
.sync(filter, &opts)
|
||||
.await
|
||||
.map_err(|err| err.to_string())?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -104,7 +104,7 @@ pub fn create_tags(content: &str) -> Vec<Tag> {
|
||||
}
|
||||
if entity.starts_with("nevent") {
|
||||
if let Ok(event) = Nip19Event::from_bech32(&entity) {
|
||||
let relay_url = event.relays.first().map(UncheckedUrl::from);
|
||||
let relay_url = event.relays.first().and_then(|i| Url::parse(i).ok());
|
||||
let tag = Tag::from_standardized(TagStandard::Quote {
|
||||
event_id: event.event_id,
|
||||
relay_url,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
use border::WebviewWindowExt as BorderWebviewWindowExt;
|
||||
use commands::{account::*, event::*, metadata::*, relay::*, window::*};
|
||||
use commands::{account::*, event::*, metadata::*, relay::*, sync::*, window::*};
|
||||
use common::{get_all_accounts, parse_event};
|
||||
use nostr_sdk::prelude::{Profile as DatabaseProfile, *};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -76,6 +76,7 @@ fn main() {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let builder = Builder::<tauri::Wry>::new().commands(collect_commands![
|
||||
sync_all,
|
||||
get_all_relays,
|
||||
get_all_relay_lists,
|
||||
is_relay_connected,
|
||||
@@ -365,6 +366,8 @@ fn main() {
|
||||
|
||||
// Set interval
|
||||
let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(600));
|
||||
// Skip the first tick
|
||||
interval.tick().await;
|
||||
|
||||
loop {
|
||||
interval.tick().await;
|
||||
@@ -475,7 +478,7 @@ fn main() {
|
||||
Kind::Repost,
|
||||
Kind::Reaction,
|
||||
Kind::ZapReceipt,
|
||||
Kind::Custom(1111),
|
||||
Kind::Comment,
|
||||
])
|
||||
.since(Timestamp::now());
|
||||
|
||||
@@ -603,7 +606,7 @@ fn send_event_notification(event: &Event, author: Metadata, handle: &tauri::AppH
|
||||
if let Err(e) = handle
|
||||
.notification()
|
||||
.builder()
|
||||
.body("Mentioned you in a thread.")
|
||||
.body("You're mentioned in a thread.")
|
||||
.title(author.display_name.unwrap_or_else(|| "Lume".to_string()))
|
||||
.show()
|
||||
{
|
||||
@@ -614,7 +617,7 @@ fn send_event_notification(event: &Event, author: Metadata, handle: &tauri::AppH
|
||||
if let Err(e) = handle
|
||||
.notification()
|
||||
.builder()
|
||||
.body("Reposted your note.")
|
||||
.body("Your note has been reposted.")
|
||||
.title(author.display_name.unwrap_or_else(|| "Lume".to_string()))
|
||||
.show()
|
||||
{
|
||||
@@ -625,7 +628,7 @@ fn send_event_notification(event: &Event, author: Metadata, handle: &tauri::AppH
|
||||
if let Err(e) = handle
|
||||
.notification()
|
||||
.builder()
|
||||
.body("Zapped you.")
|
||||
.body("You've received zap.")
|
||||
.title(author.display_name.unwrap_or_else(|| "Lume".to_string()))
|
||||
.show()
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "Lume",
|
||||
"version": "24.11.7",
|
||||
"version": "24.11.8",
|
||||
"identifier": "nu.lume.Lume",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
|
||||
|
||||
export const commands = {
|
||||
async syncAll(reader: TAURI_CHANNEL<number>) : Promise<Result<null, string>> {
|
||||
try {
|
||||
return { status: "ok", data: await TAURI_INVOKE("sync_all", { reader }) };
|
||||
} catch (e) {
|
||||
if(e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getAllRelays() : Promise<Result<string[], string>> {
|
||||
try {
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_all_relays") };
|
||||
@@ -554,6 +562,7 @@ export type Meta = { content: string; images: string[]; events: string[]; mentio
|
||||
export type NewWindow = { label: string; title: string; url: string; width: number; height: number; maximizable: boolean; minimizable: boolean; hidden_title: boolean; closable: boolean }
|
||||
export type RichEvent = { raw: string; parsed: Meta | null }
|
||||
export type Settings = { resize_service: boolean; content_warning: boolean; display_avatar: boolean; display_zap_button: boolean; display_repost_button: boolean; display_media: boolean }
|
||||
export type TAURI_CHANNEL<TSend> = null
|
||||
|
||||
/** tauri-specta globals **/
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import { Route as AppIndexImport } from './routes/_app/index'
|
||||
import { Route as ZapIdImport } from './routes/zap.$id'
|
||||
import { Route as SettingsWalletImport } from './routes/settings/wallet'
|
||||
import { Route as SettingsRelaysImport } from './routes/settings/relays'
|
||||
import { Route as SettingsGeneralImport } from './routes/settings/general'
|
||||
import { Route as ColumnsLayoutImport } from './routes/columns/_layout'
|
||||
import { Route as IdSetProfileImport } from './routes/$id.set-profile'
|
||||
import { Route as IdSetInterestImport } from './routes/$id.set-interest'
|
||||
@@ -39,6 +38,8 @@ import { Route as ColumnsLayoutCreateNewsfeedF2fImport } from './routes/columns/
|
||||
const ColumnsImport = createFileRoute('/columns')()
|
||||
const SettingsLazyImport = createFileRoute('/settings')()
|
||||
const NewLazyImport = createFileRoute('/new')()
|
||||
const SettingsSyncLazyImport = createFileRoute('/settings/sync')()
|
||||
const SettingsGeneralLazyImport = createFileRoute('/settings/general')()
|
||||
const NewAccountWatchLazyImport = createFileRoute('/new-account/watch')()
|
||||
const NewAccountImportLazyImport = createFileRoute('/new-account/import')()
|
||||
const NewAccountConnectLazyImport = createFileRoute('/new-account/connect')()
|
||||
@@ -118,6 +119,20 @@ const AppIndexRoute = AppIndexImport.update({
|
||||
getParentRoute: () => AppRoute,
|
||||
} as any).lazy(() => import('./routes/_app/index.lazy').then((d) => d.Route))
|
||||
|
||||
const SettingsSyncLazyRoute = SettingsSyncLazyImport.update({
|
||||
id: '/sync',
|
||||
path: '/sync',
|
||||
getParentRoute: () => SettingsLazyRoute,
|
||||
} as any).lazy(() => import('./routes/settings/sync.lazy').then((d) => d.Route))
|
||||
|
||||
const SettingsGeneralLazyRoute = SettingsGeneralLazyImport.update({
|
||||
id: '/general',
|
||||
path: '/general',
|
||||
getParentRoute: () => SettingsLazyRoute,
|
||||
} as any).lazy(() =>
|
||||
import('./routes/settings/general.lazy').then((d) => d.Route),
|
||||
)
|
||||
|
||||
const NewAccountWatchLazyRoute = NewAccountWatchLazyImport.update({
|
||||
id: '/new-account/watch',
|
||||
path: '/new-account/watch',
|
||||
@@ -164,14 +179,6 @@ const SettingsRelaysRoute = SettingsRelaysImport.update({
|
||||
import('./routes/settings/relays.lazy').then((d) => d.Route),
|
||||
)
|
||||
|
||||
const SettingsGeneralRoute = SettingsGeneralImport.update({
|
||||
id: '/general',
|
||||
path: '/general',
|
||||
getParentRoute: () => SettingsLazyRoute,
|
||||
} as any).lazy(() =>
|
||||
import('./routes/settings/general.lazy').then((d) => d.Route),
|
||||
)
|
||||
|
||||
const ColumnsLayoutRoute = ColumnsLayoutImport.update({
|
||||
id: '/_layout',
|
||||
getParentRoute: () => ColumnsRoute,
|
||||
@@ -440,13 +447,6 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof ColumnsLayoutImport
|
||||
parentRoute: typeof ColumnsRoute
|
||||
}
|
||||
'/settings/general': {
|
||||
id: '/settings/general'
|
||||
path: '/general'
|
||||
fullPath: '/settings/general'
|
||||
preLoaderRoute: typeof SettingsGeneralImport
|
||||
parentRoute: typeof SettingsLazyImport
|
||||
}
|
||||
'/settings/relays': {
|
||||
id: '/settings/relays'
|
||||
path: '/relays'
|
||||
@@ -489,6 +489,20 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof NewAccountWatchLazyImport
|
||||
parentRoute: typeof rootRoute
|
||||
}
|
||||
'/settings/general': {
|
||||
id: '/settings/general'
|
||||
path: '/general'
|
||||
fullPath: '/settings/general'
|
||||
preLoaderRoute: typeof SettingsGeneralLazyImport
|
||||
parentRoute: typeof SettingsLazyImport
|
||||
}
|
||||
'/settings/sync': {
|
||||
id: '/settings/sync'
|
||||
path: '/sync'
|
||||
fullPath: '/settings/sync'
|
||||
preLoaderRoute: typeof SettingsSyncLazyImport
|
||||
parentRoute: typeof SettingsLazyImport
|
||||
}
|
||||
'/_app/': {
|
||||
id: '/_app/'
|
||||
path: '/'
|
||||
@@ -666,15 +680,17 @@ const AppRouteChildren: AppRouteChildren = {
|
||||
const AppRouteWithChildren = AppRoute._addFileChildren(AppRouteChildren)
|
||||
|
||||
interface SettingsLazyRouteChildren {
|
||||
SettingsGeneralRoute: typeof SettingsGeneralRoute
|
||||
SettingsRelaysRoute: typeof SettingsRelaysRoute
|
||||
SettingsWalletRoute: typeof SettingsWalletRoute
|
||||
SettingsGeneralLazyRoute: typeof SettingsGeneralLazyRoute
|
||||
SettingsSyncLazyRoute: typeof SettingsSyncLazyRoute
|
||||
}
|
||||
|
||||
const SettingsLazyRouteChildren: SettingsLazyRouteChildren = {
|
||||
SettingsGeneralRoute: SettingsGeneralRoute,
|
||||
SettingsRelaysRoute: SettingsRelaysRoute,
|
||||
SettingsWalletRoute: SettingsWalletRoute,
|
||||
SettingsGeneralLazyRoute: SettingsGeneralLazyRoute,
|
||||
SettingsSyncLazyRoute: SettingsSyncLazyRoute,
|
||||
}
|
||||
|
||||
const SettingsLazyRouteWithChildren = SettingsLazyRoute._addFileChildren(
|
||||
@@ -768,13 +784,14 @@ export interface FileRoutesByFullPath {
|
||||
'/$id/set-interest': typeof IdSetInterestRoute
|
||||
'/$id/set-profile': typeof IdSetProfileRoute
|
||||
'/columns': typeof ColumnsLayoutRouteWithChildren
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/relays': typeof SettingsRelaysRoute
|
||||
'/settings/wallet': typeof SettingsWalletRoute
|
||||
'/zap/$id': typeof ZapIdRoute
|
||||
'/new-account/connect': typeof NewAccountConnectLazyRoute
|
||||
'/new-account/import': typeof NewAccountImportLazyRoute
|
||||
'/new-account/watch': typeof NewAccountWatchLazyRoute
|
||||
'/settings/general': typeof SettingsGeneralLazyRoute
|
||||
'/settings/sync': typeof SettingsSyncLazyRoute
|
||||
'/': typeof AppIndexRoute
|
||||
'/new-post': typeof NewPostIndexRoute
|
||||
'/columns/create-newsfeed': typeof ColumnsLayoutCreateNewsfeedRouteWithChildren
|
||||
@@ -807,13 +824,14 @@ export interface FileRoutesByTo {
|
||||
'/$id/set-interest': typeof IdSetInterestRoute
|
||||
'/$id/set-profile': typeof IdSetProfileRoute
|
||||
'/columns': typeof ColumnsLayoutRouteWithChildren
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/relays': typeof SettingsRelaysRoute
|
||||
'/settings/wallet': typeof SettingsWalletRoute
|
||||
'/zap/$id': typeof ZapIdRoute
|
||||
'/new-account/connect': typeof NewAccountConnectLazyRoute
|
||||
'/new-account/import': typeof NewAccountImportLazyRoute
|
||||
'/new-account/watch': typeof NewAccountWatchLazyRoute
|
||||
'/settings/general': typeof SettingsGeneralLazyRoute
|
||||
'/settings/sync': typeof SettingsSyncLazyRoute
|
||||
'/': typeof AppIndexRoute
|
||||
'/new-post': typeof NewPostIndexRoute
|
||||
'/columns/create-newsfeed': typeof ColumnsLayoutCreateNewsfeedRouteWithChildren
|
||||
@@ -849,13 +867,14 @@ export interface FileRoutesById {
|
||||
'/$id/set-profile': typeof IdSetProfileRoute
|
||||
'/columns': typeof ColumnsRouteWithChildren
|
||||
'/columns/_layout': typeof ColumnsLayoutRouteWithChildren
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/relays': typeof SettingsRelaysRoute
|
||||
'/settings/wallet': typeof SettingsWalletRoute
|
||||
'/zap/$id': typeof ZapIdRoute
|
||||
'/new-account/connect': typeof NewAccountConnectLazyRoute
|
||||
'/new-account/import': typeof NewAccountImportLazyRoute
|
||||
'/new-account/watch': typeof NewAccountWatchLazyRoute
|
||||
'/settings/general': typeof SettingsGeneralLazyRoute
|
||||
'/settings/sync': typeof SettingsSyncLazyRoute
|
||||
'/_app/': typeof AppIndexRoute
|
||||
'/new-post/': typeof NewPostIndexRoute
|
||||
'/columns/_layout/create-newsfeed': typeof ColumnsLayoutCreateNewsfeedRouteWithChildren
|
||||
@@ -891,13 +910,14 @@ export interface FileRouteTypes {
|
||||
| '/$id/set-interest'
|
||||
| '/$id/set-profile'
|
||||
| '/columns'
|
||||
| '/settings/general'
|
||||
| '/settings/relays'
|
||||
| '/settings/wallet'
|
||||
| '/zap/$id'
|
||||
| '/new-account/connect'
|
||||
| '/new-account/import'
|
||||
| '/new-account/watch'
|
||||
| '/settings/general'
|
||||
| '/settings/sync'
|
||||
| '/'
|
||||
| '/new-post'
|
||||
| '/columns/create-newsfeed'
|
||||
@@ -929,13 +949,14 @@ export interface FileRouteTypes {
|
||||
| '/$id/set-interest'
|
||||
| '/$id/set-profile'
|
||||
| '/columns'
|
||||
| '/settings/general'
|
||||
| '/settings/relays'
|
||||
| '/settings/wallet'
|
||||
| '/zap/$id'
|
||||
| '/new-account/connect'
|
||||
| '/new-account/import'
|
||||
| '/new-account/watch'
|
||||
| '/settings/general'
|
||||
| '/settings/sync'
|
||||
| '/'
|
||||
| '/new-post'
|
||||
| '/columns/create-newsfeed'
|
||||
@@ -969,13 +990,14 @@ export interface FileRouteTypes {
|
||||
| '/$id/set-profile'
|
||||
| '/columns'
|
||||
| '/columns/_layout'
|
||||
| '/settings/general'
|
||||
| '/settings/relays'
|
||||
| '/settings/wallet'
|
||||
| '/zap/$id'
|
||||
| '/new-account/connect'
|
||||
| '/new-account/import'
|
||||
| '/new-account/watch'
|
||||
| '/settings/general'
|
||||
| '/settings/sync'
|
||||
| '/_app/'
|
||||
| '/new-post/'
|
||||
| '/columns/_layout/create-newsfeed'
|
||||
@@ -1068,9 +1090,10 @@ export const routeTree = rootRoute
|
||||
"/settings": {
|
||||
"filePath": "settings.lazy.tsx",
|
||||
"children": [
|
||||
"/settings/general",
|
||||
"/settings/relays",
|
||||
"/settings/wallet"
|
||||
"/settings/wallet",
|
||||
"/settings/general",
|
||||
"/settings/sync"
|
||||
]
|
||||
},
|
||||
"/$id/set-group": {
|
||||
@@ -1113,10 +1136,6 @@ export const routeTree = rootRoute
|
||||
"/columns/_layout/users/$id"
|
||||
]
|
||||
},
|
||||
"/settings/general": {
|
||||
"filePath": "settings/general.tsx",
|
||||
"parent": "/settings"
|
||||
},
|
||||
"/settings/relays": {
|
||||
"filePath": "settings/relays.tsx",
|
||||
"parent": "/settings"
|
||||
@@ -1137,6 +1156,14 @@ export const routeTree = rootRoute
|
||||
"/new-account/watch": {
|
||||
"filePath": "new-account/watch.lazy.tsx"
|
||||
},
|
||||
"/settings/general": {
|
||||
"filePath": "settings/general.lazy.tsx",
|
||||
"parent": "/settings"
|
||||
},
|
||||
"/settings/sync": {
|
||||
"filePath": "settings/sync.lazy.tsx",
|
||||
"parent": "/settings"
|
||||
},
|
||||
"/_app/": {
|
||||
"filePath": "_app/index.tsx",
|
||||
"parent": "/_app"
|
||||
|
||||
@@ -118,7 +118,7 @@ function Account({ pubkey }: { pubkey: string }) {
|
||||
const items = await Promise.all([
|
||||
MenuItem.new({
|
||||
text: "Unlock",
|
||||
enabled: !isActive || true,
|
||||
enabled: !isActive,
|
||||
action: async () => await commands.setSigner(pubkey),
|
||||
}),
|
||||
PredefinedMenuItem.new({ item: "Separator" }),
|
||||
@@ -183,7 +183,7 @@ function Account({ pubkey }: { pubkey: string }) {
|
||||
|
||||
await menu.popup().catch((e) => console.error(e));
|
||||
},
|
||||
[pubkey],
|
||||
[isActive, pubkey],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1,96 +1,118 @@
|
||||
import { cn } from '@/commons'
|
||||
import { CurrencyBtc, GearSix, HardDrives } from '@phosphor-icons/react'
|
||||
import * as ScrollArea from '@radix-ui/react-scroll-area'
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { Outlet, createLazyFileRoute } from '@tanstack/react-router'
|
||||
import { cn } from "@/commons";
|
||||
import {
|
||||
CloudArrowDown,
|
||||
CurrencyBtc,
|
||||
GearSix,
|
||||
HardDrives,
|
||||
} from "@phosphor-icons/react";
|
||||
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import { Outlet, createLazyFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createLazyFileRoute('/settings')({
|
||||
component: Screen,
|
||||
})
|
||||
export const Route = createLazyFileRoute("/settings")({
|
||||
component: Screen,
|
||||
});
|
||||
|
||||
function Screen() {
|
||||
const { platform } = Route.useRouteContext()
|
||||
const { platform } = Route.useRouteContext();
|
||||
|
||||
return (
|
||||
<div className="flex size-full">
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
className={cn(
|
||||
'w-[200px] shrink-0 flex flex-col gap-1 border-r border-black/10 dark:border-white/10 p-2',
|
||||
platform === 'macos' ? 'pt-11' : '',
|
||||
)}
|
||||
>
|
||||
<div className="h-8 px-1.5">
|
||||
<h1 className="text-lg font-semibold">Settings</h1>
|
||||
</div>
|
||||
<Link to="/settings/general">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2',
|
||||
isActive
|
||||
? 'bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20'
|
||||
: 'text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10',
|
||||
)}
|
||||
>
|
||||
<GearSix className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">General</p>
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
</Link>
|
||||
<Link to="/settings/relays">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2',
|
||||
isActive
|
||||
? 'bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20'
|
||||
: 'text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10',
|
||||
)}
|
||||
>
|
||||
<HardDrives className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">Relays</p>
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
</Link>
|
||||
<Link to="/settings/wallet">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2',
|
||||
isActive
|
||||
? 'bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20'
|
||||
: 'text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10',
|
||||
)}
|
||||
>
|
||||
<CurrencyBtc className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">Wallet</p>
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
</Link>
|
||||
</div>
|
||||
<ScrollArea.Root
|
||||
type={'scroll'}
|
||||
scrollHideDelay={300}
|
||||
className="flex-1 overflow-hidden size-full"
|
||||
>
|
||||
<ScrollArea.Viewport className="relative h-full pt-12">
|
||||
<Outlet />
|
||||
</ScrollArea.Viewport>
|
||||
<ScrollArea.Scrollbar
|
||||
className="flex select-none touch-none p-0.5 duration-[160ms] ease-out data-[orientation=vertical]:w-2"
|
||||
orientation="vertical"
|
||||
>
|
||||
<ScrollArea.Thumb className="flex-1 bg-black/10 dark:bg-white/10 rounded-full relative before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-[44px] before:min-h-[44px]" />
|
||||
</ScrollArea.Scrollbar>
|
||||
<ScrollArea.Corner className="bg-transparent" />
|
||||
</ScrollArea.Root>
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div className="flex size-full">
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
className={cn(
|
||||
"w-[200px] shrink-0 flex flex-col gap-1 border-r border-black/10 dark:border-white/10 p-2",
|
||||
platform === "macos" ? "pt-11" : "",
|
||||
)}
|
||||
>
|
||||
<div className="h-8 px-1.5">
|
||||
<h1 className="text-lg font-semibold">Settings</h1>
|
||||
</div>
|
||||
<Link to="/settings/general">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2",
|
||||
isActive
|
||||
? "bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20"
|
||||
: "text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10",
|
||||
)}
|
||||
>
|
||||
<GearSix className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">General</p>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Link>
|
||||
<Link to="/settings/sync">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2",
|
||||
isActive
|
||||
? "bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20"
|
||||
: "text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10",
|
||||
)}
|
||||
>
|
||||
<CloudArrowDown className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">Sync</p>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Link>
|
||||
<Link to="/settings/relays">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2",
|
||||
isActive
|
||||
? "bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20"
|
||||
: "text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10",
|
||||
)}
|
||||
>
|
||||
<HardDrives className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">Relays</p>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Link>
|
||||
<Link to="/settings/wallet">
|
||||
{({ isActive }) => {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"h-9 w-full inline-flex items-center gap-1.5 rounded-lg p-2",
|
||||
isActive
|
||||
? "bg-black/10 hover:bg-black/20 dark:bg-white/10 text-neutral-900 dark:text-neutral-100 dark:hover:bg-bg-white/20"
|
||||
: "text-neutral-700 hover:bg-black/10 dark:text-neutral-300 dark:hover:bg-white/10",
|
||||
)}
|
||||
>
|
||||
<CurrencyBtc className="size-5 shrink-0" />
|
||||
<p className="text-sm font-medium">Wallet</p>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Link>
|
||||
</div>
|
||||
<ScrollArea.Root
|
||||
type={"scroll"}
|
||||
scrollHideDelay={300}
|
||||
className="flex-1 overflow-hidden size-full"
|
||||
>
|
||||
<ScrollArea.Viewport className="relative h-full pt-12">
|
||||
<Outlet />
|
||||
</ScrollArea.Viewport>
|
||||
<ScrollArea.Scrollbar
|
||||
className="flex select-none touch-none p-0.5 duration-[160ms] ease-out data-[orientation=vertical]:w-2"
|
||||
orientation="vertical"
|
||||
>
|
||||
<ScrollArea.Thumb className="flex-1 bg-black/10 dark:bg-white/10 rounded-full relative before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:w-full before:h-full before:min-w-[44px] before:min-h-[44px]" />
|
||||
</ScrollArea.Scrollbar>
|
||||
<ScrollArea.Corner className="bg-transparent" />
|
||||
</ScrollArea.Root>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -69,9 +69,7 @@ function Screen() {
|
||||
<div className="relative w-full">
|
||||
<div className="flex flex-col gap-6 px-3 pb-3">
|
||||
<div className="flex flex-col gap-2">
|
||||
<h2 className="text-sm font-semibold text-neutral-700 dark:text-neutral-300">
|
||||
General
|
||||
</h2>
|
||||
<h2 className="text-sm font-semibold">General</h2>
|
||||
<div className="flex flex-col px-3 divide-y divide-black/10 dark:divide-white/10 bg-black/5 dark:bg-white/5 rounded-xl">
|
||||
<Setting
|
||||
name="Content Warning"
|
||||
@@ -92,9 +90,7 @@ function Screen() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<h2 className="text-sm font-semibold text-neutral-700 dark:text-neutral-300">
|
||||
Appearance
|
||||
</h2>
|
||||
<h2 className="text-sm font-semibold">Appearance</h2>
|
||||
<div className="flex flex-col px-3 divide-y divide-black/10 dark:divide-white/10 bg-black/5 dark:bg-white/5 rounded-xl">
|
||||
<div className="flex items-start justify-between w-full gap-4 py-3">
|
||||
<div className="flex-1">
|
||||
@@ -140,9 +136,7 @@ function Screen() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<h2 className="text-sm font-semibold text-neutral-700 dark:text-neutral-300">
|
||||
Privacy & Performance
|
||||
</h2>
|
||||
<h2 className="text-sm font-semibold">Privacy & Performance</h2>
|
||||
<div className="flex flex-col px-3 divide-y divide-black/10 dark:divide-white/10 bg-black/5 dark:bg-white/5 rounded-xl">
|
||||
<Setting
|
||||
name="Resize Service"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/settings/general")();
|
||||
@@ -53,9 +53,20 @@ function Screen() {
|
||||
<div className="w-full px-3 pb-3">
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="flex flex-col gap-2">
|
||||
<h2 className="text-sm font-semibold text-neutral-700 dark:text-neutral-300">
|
||||
Connected Relays
|
||||
</h2>
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold">Connected Relays</h2>
|
||||
<p className="text-sm text-neutral-500">
|
||||
Learn more about Relays{" "}
|
||||
<a
|
||||
href="https://nostr.how/en/relays"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-blue-500 !underline"
|
||||
>
|
||||
here
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-col px-3 divide-y divide-black/10 dark:divide-white/10 bg-black/5 dark:bg-white/5 rounded-xl">
|
||||
<div className="flex items-center h-14">
|
||||
<div className="flex items-center w-full gap-2 mb-0">
|
||||
|
||||
100
src/routes/settings/sync.lazy.tsx
Normal file
100
src/routes/settings/sync.lazy.tsx
Normal file
@@ -0,0 +1,100 @@
|
||||
import { createLazyFileRoute } from "@tanstack/react-router";
|
||||
import { useEffect, useState, useTransition } from "react";
|
||||
import * as Progress from "@radix-ui/react-progress";
|
||||
import { Channel } from "@tauri-apps/api/core";
|
||||
import { commands } from "@/commands.gen";
|
||||
import { message } from "@tauri-apps/plugin-dialog";
|
||||
import { Spinner } from "@/components";
|
||||
|
||||
export const Route = createLazyFileRoute("/settings/sync")({
|
||||
component: Screen,
|
||||
});
|
||||
|
||||
function Screen() {
|
||||
const [channel, _setChannel] = useState<Channel<number>>(
|
||||
() => new Channel<number>(),
|
||||
);
|
||||
const [progress, setProgress] = useState(0);
|
||||
const [isPending, startTransition] = useTransition();
|
||||
|
||||
const runSync = () => {
|
||||
startTransition(async () => {
|
||||
const res = await commands.syncAll(channel);
|
||||
|
||||
if (res.status === "error") {
|
||||
await message(res.error, { kind: "error" });
|
||||
}
|
||||
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
channel.onmessage = (message) => {
|
||||
setProgress(message);
|
||||
};
|
||||
}, [channel]);
|
||||
|
||||
return (
|
||||
<div className="w-full h-full px-3 pb-3">
|
||||
<div className="h-full flex flex-col w-full gap-2">
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold">Sync events with Negentropy</h2>
|
||||
<p className="text-sm text-neutral-500">
|
||||
Learn more about negentropy{" "}
|
||||
<a
|
||||
href="https://github.com/hoytech/strfry/blob/nextneg/docs/negentropy.md"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-blue-500 !underline"
|
||||
>
|
||||
here
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div className="text-sm flex flex-col gap-2">
|
||||
<h5 className="font-semibold">Data will be sync:</h5>
|
||||
<div className="w-full h-9 inline-flex items-center px-2 bg-black/5 dark:bg-white/5 rounded-lg text-neutral-700 dark:text-neutral-300">
|
||||
Metadata of all public keys that found in database.
|
||||
</div>
|
||||
<div className="w-full h-9 inline-flex items-center px-2 bg-black/5 dark:bg-white/5 rounded-lg text-neutral-700 dark:text-neutral-300">
|
||||
Contact list of all public keys that found in database.
|
||||
</div>
|
||||
<div className="w-full h-9 inline-flex items-center px-2 bg-black/5 dark:bg-white/5 rounded-lg text-neutral-700 dark:text-neutral-300">
|
||||
Follow and interest sets of all public keys that found in database.
|
||||
</div>
|
||||
<div className="w-full h-9 inline-flex items-center px-2 bg-black/5 dark:bg-white/5 rounded-lg text-neutral-700 dark:text-neutral-300">
|
||||
All notes and reposts of all public keys that found in database.
|
||||
</div>
|
||||
<div className="w-full h-9 inline-flex items-center px-2 bg-black/5 dark:bg-white/5 rounded-lg text-neutral-700 dark:text-neutral-300">
|
||||
All comments all public keys that found in database.
|
||||
</div>
|
||||
</div>
|
||||
<div className="relative mt-auto flex items-center gap-4 justify-between">
|
||||
<div className="flex-1">
|
||||
<Progress.Root
|
||||
className="relative overflow-hidden bg-black/20 dark:bg-white/20 rounded-full w-full h-1"
|
||||
style={{
|
||||
transform: "translateZ(0)",
|
||||
}}
|
||||
value={progress}
|
||||
>
|
||||
<Progress.Indicator
|
||||
className="bg-blue-500 size-full rounded-full transition-transform duration-[660ms] ease-[cubic-bezier(0.65, 0, 0.35, 1)]"
|
||||
style={{ transform: `translateX(-${100 - progress}%)` }}
|
||||
/>
|
||||
</Progress.Root>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
disabled={isPending}
|
||||
onClick={() => runSync()}
|
||||
className="shrink-0 w-20 h-8 rounded-lg inline-flex items-center justify-center bg-blue-500 hover:bg-blue-600 text-white text-sm font-semibold"
|
||||
>
|
||||
{isPending ? <Spinner className="size-4" /> : "Sync"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -33,9 +33,20 @@ function Screen() {
|
||||
return (
|
||||
<div className="w-full px-3 pb-3">
|
||||
<div className="flex flex-col w-full gap-2">
|
||||
<h2 className="text-sm font-semibold text-neutral-700 dark:text-neutral-300">
|
||||
Wallet
|
||||
</h2>
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold">Bitcoin Wallet</h2>
|
||||
<p className="text-sm text-neutral-500">
|
||||
Learn more about Zap{" "}
|
||||
<a
|
||||
href="https://nostr.how/en/zaps"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="text-blue-500 !underline"
|
||||
>
|
||||
here
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div className="w-full h-44 flex items-center justify-center bg-black/5 dark:bg-white/5 rounded-xl">
|
||||
<Button
|
||||
onConnected={(provider) =>
|
||||
|
||||
Reference in New Issue
Block a user