From 2d53019c1049d4a73e0154a5a3b8b8bba848ab2f Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Tue, 15 Aug 2023 21:13:58 +0700 Subject: [PATCH] wip: refactor --- package.json | 4 +- pnpm-lock.yaml | 307 +++++++------- src-tauri/Cargo.lock | 390 ++++++++++-------- src-tauri/Cargo.toml | 9 +- src-tauri/tauri.conf.json | 4 - src/app.tsx | 16 +- src/app/auth/import/step-3.tsx | 4 +- src/app/auth/migrate.tsx | 5 +- src/app/auth/onboarding/step-1.tsx | 4 +- src/app/auth/onboarding/step-3.tsx | 12 +- src/app/auth/reset.tsx | 7 +- src/app/auth/unlock.tsx | 5 +- src/app/chats/components/list.tsx | 29 +- src/app/chats/components/modal.tsx | 8 +- src/app/chats/components/self.tsx | 10 +- src/app/chats/index.tsx | 22 +- src/app/error.tsx | 74 +++- src/app/events/index.tsx | 7 +- src/app/space/components/widgets/network.tsx | 30 +- src/app/splash.tsx | 8 +- src/app/trending/components/profile.tsx | 1 - src/app/trending/components/trendingNotes.tsx | 1 - .../trending/components/trendingProfiles.tsx | 1 - src/libs/ndk/instance.ts | 8 +- src/libs/storage.ts | 6 - src/libs/storage/instance.ts | 48 ++- src/libs/storage/provider.tsx | 2 + src/shared/editProfileModal.tsx | 1 - src/shared/lumeBar.tsx | 19 +- src/shared/navigation.tsx | 22 - src/shared/notes/actions.tsx | 5 +- src/shared/notes/metadata.tsx | 11 +- src/stores/widgets.tsx | 2 +- src/utils/checkActiveAccount.tsx | 33 ++ src/utils/hooks/useAccount.tsx | 5 +- src/utils/hooks/useNostr.tsx | 35 +- 36 files changed, 603 insertions(+), 552 deletions(-) create mode 100644 src/utils/checkActiveAccount.tsx diff --git a/package.json b/package.json index c0344d13..02411e23 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "dependencies": { "@ctrl/magnet-link": "^3.1.2", "@headlessui/react": "^1.7.16", - "@nostr-dev-kit/ndk": "^0.8.13", + "@nostr-dev-kit/ndk": "^0.8.14", "@nostr-fetch/adapter-ndk": "^0.11.0", "@radix-ui/react-alert-dialog": "^1.0.4", "@radix-ui/react-collapsible": "^1.0.3", @@ -29,7 +29,7 @@ "@tanstack/react-query": "^4.32.6", "@tanstack/react-query-devtools": "^4.32.6", "@tanstack/react-virtual": "3.0.0-beta.54", - "@tauri-apps/api": "2.0.0-alpha.5", + "@tauri-apps/api": "2.0.0-alpha.6", "@tauri-apps/plugin-app": "github:tauri-apps/tauri-plugin-app#v2", "@tauri-apps/plugin-autostart": "github:tauri-apps/tauri-plugin-autostart#v2", "@tauri-apps/plugin-clipboard-manager": "github:tauri-apps/tauri-plugin-clipboard-manager#v2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2660c40d..522343c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,11 +8,11 @@ dependencies: specifier: ^1.7.16 version: 1.7.16(react-dom@18.2.0)(react@18.2.0) '@nostr-dev-kit/ndk': - specifier: ^0.8.13 - version: 0.8.13(typescript@4.9.5) + specifier: ^0.8.14 + version: 0.8.14(typescript@4.9.5) '@nostr-fetch/adapter-ndk': specifier: ^0.11.0 - version: 0.11.0(@nostr-dev-kit/ndk@0.8.13)(nostr-fetch@0.12.2) + version: 0.11.0(@nostr-dev-kit/ndk@0.8.14)(nostr-fetch@0.12.2) '@radix-ui/react-alert-dialog': specifier: ^1.0.4 version: 1.0.4(@types/react-dom@18.2.7)(@types/react@18.2.20)(react-dom@18.2.0)(react@18.2.0) @@ -38,50 +38,50 @@ dependencies: specifier: 3.0.0-beta.54 version: 3.0.0-beta.54(react@18.2.0) '@tauri-apps/api': - specifier: 2.0.0-alpha.5 - version: 2.0.0-alpha.5 + specifier: 2.0.0-alpha.6 + version: 2.0.0-alpha.6 '@tauri-apps/plugin-app': specifier: github:tauri-apps/tauri-plugin-app#v2 - version: github.com/tauri-apps/tauri-plugin-app/f8b21651dfa42f42e080488568010ff3bbeb7350 + version: github.com/tauri-apps/tauri-plugin-app/1efde5f3e693927a529408f414238ad40b06c9a2 '@tauri-apps/plugin-autostart': specifier: github:tauri-apps/tauri-plugin-autostart#v2 - version: github.com/tauri-apps/tauri-plugin-autostart/0b6ccaa31eccdeec47ca0425f7696846aa3a5f46 + version: github.com/tauri-apps/tauri-plugin-autostart/50d57bf6dcac4c32e6f5a73f1b6d90001b68c6f7 '@tauri-apps/plugin-clipboard-manager': specifier: github:tauri-apps/tauri-plugin-clipboard-manager#v2 - version: github.com/tauri-apps/tauri-plugin-clipboard-manager/32e302b07e3ea11b59c55d4fc100516ac49a4968 + version: github.com/tauri-apps/tauri-plugin-clipboard-manager/f5314980a4b60362bca6b9d2a3a40a637c021d3c '@tauri-apps/plugin-dialog': specifier: github:tauri-apps/tauri-plugin-dialog#v2 - version: github.com/tauri-apps/tauri-plugin-dialog/2d74ae009691b50e6498fb814a77c59b6798f2ac + version: github.com/tauri-apps/tauri-plugin-dialog/eece20be9c1dc257e268f5d63654af56cf4fb474 '@tauri-apps/plugin-fs': specifier: github:tauri-apps/tauri-plugin-fs#v2 - version: github.com/tauri-apps/tauri-plugin-fs/0dd45ead4ca3cc8b426614fa47ad9227e9ed2053 + version: github.com/tauri-apps/tauri-plugin-fs/c90fd8bcad3be92f34a0642d67ab1a6ad9f73dee '@tauri-apps/plugin-http': specifier: github:tauri-apps/tauri-plugin-http#v2 - version: github.com/tauri-apps/tauri-plugin-http/27b519b63419db048d2d30945ff34b2234975ccd + version: github.com/tauri-apps/tauri-plugin-http/50bc7956907eef54a20255b62ea57ff4c2e8585a '@tauri-apps/plugin-notification': specifier: github:tauri-apps/tauri-plugin-notification#v2 - version: github.com/tauri-apps/tauri-plugin-notification/7878980ee8cb97437f343cc31b97a1b666e324d4 + version: github.com/tauri-apps/tauri-plugin-notification/66c0779854575ec7860eadcd98673c39627e81a6 '@tauri-apps/plugin-os': specifier: github:tauri-apps/tauri-plugin-os#v2 - version: github.com/tauri-apps/tauri-plugin-os/e4dda0ceff72cbc762937e79c104522a8866b840 + version: github.com/tauri-apps/tauri-plugin-os/97469d43edd41c32aa1c0eea38d1c19d14e38f47 '@tauri-apps/plugin-process': specifier: github:tauri-apps/tauri-plugin-process#v2 - version: github.com/tauri-apps/tauri-plugin-process/eec5dc8d37c80b2c1ebb7eb8e4cb976eed221a9d + version: github.com/tauri-apps/tauri-plugin-process/7a04374b86dbc0691a7223bbdbec6b0b3d8cd3af '@tauri-apps/plugin-shell': specifier: github:tauri-apps/tauri-plugin-shell#v2 - version: github.com/tauri-apps/tauri-plugin-shell/f76cb0019364f40b9411eac5f5fdf6fd04b3e538 + version: github.com/tauri-apps/tauri-plugin-shell/c8bb6d545043434cdb5784ace171c509f8b20586 '@tauri-apps/plugin-sql': specifier: github:tauri-apps/tauri-plugin-sql#v2 - version: github.com/tauri-apps/tauri-plugin-sql/62eb3e4c9f084c1238cf7ab00d47148c034be207 + version: github.com/tauri-apps/tauri-plugin-sql/592d8ba3640cfb3a3214fcec21b0355d3a6951ec '@tauri-apps/plugin-store': specifier: github:tauri-apps/tauri-plugin-store#v2 - version: github.com/tauri-apps/tauri-plugin-store/ddb10b0776a670028c1a56bbe922aba02fd32484 + version: github.com/tauri-apps/tauri-plugin-store/22ed4246f7be1413852c5ab9907a773be08ad8a8 '@tauri-apps/plugin-stronghold': specifier: github:tauri-apps/tauri-plugin-stronghold#v2 - version: github.com/tauri-apps/tauri-plugin-stronghold/9b2878280d1ab9da3d1a56c6f73bc1384b93f705 + version: github.com/tauri-apps/tauri-plugin-stronghold/33dc99be377c7bc6b7cf4d4d1fdce28340379f63 '@tauri-apps/plugin-upload': specifier: github:tauri-apps/tauri-plugin-upload#v2 - version: github.com/tauri-apps/tauri-plugin-upload/58fa4ca197cfd55292f77ede59f241014806963a + version: github.com/tauri-apps/tauri-plugin-upload/c48327c9601b0097f104ddef120a1999d5b944db '@tauri-apps/plugin-window': specifier: 2.0.0-alpha.0 version: 2.0.0-alpha.0 @@ -990,8 +990,8 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - /@nostr-dev-kit/ndk@0.8.13(typescript@4.9.5): - resolution: {integrity: sha512-WDDx0B3eRJWiqKbkMKTxqNPWTDShTt7IfMbZblas700Hm5DvoFb6E5jXyE4/szLM2gFf785gBXfp+rdLUfIktw==} + /@nostr-dev-kit/ndk@0.8.14(typescript@4.9.5): + resolution: {integrity: sha512-aVYRRAypZDrnfkWWHWK+t6W/mv9yJflwMn4gYuPKCL8qUuP98QFuCO7yVbh+cWlyVQXQa+B64BDhg/oP2AIZzA==} dependencies: '@noble/hashes': 1.3.1 '@noble/secp256k1': 2.0.0 @@ -1019,13 +1019,13 @@ packages: - typescript dev: false - /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.8.13)(nostr-fetch@0.12.2): + /@nostr-fetch/adapter-ndk@0.11.0(@nostr-dev-kit/ndk@0.8.14)(nostr-fetch@0.12.2): resolution: {integrity: sha512-Otl7SEzm9ecqyHB10bpYXBu1qpqJEnipp7dZ4qcA9LeJAtM38fnYKUD34HX0JXA9EDjtc6VS5UNZe544xC9GCg==} peerDependencies: '@nostr-dev-kit/ndk': ^0.5.0 nostr-fetch: ^0.11.0 dependencies: - '@nostr-dev-kit/ndk': 0.8.13(typescript@4.9.5) + '@nostr-dev-kit/ndk': 0.8.14(typescript@4.9.5) '@nostr-fetch/kernel': 0.11.0 nostr-fetch: 0.12.2 dev: false @@ -1832,8 +1832,8 @@ packages: engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} dev: false - /@tauri-apps/api@2.0.0-alpha.5: - resolution: {integrity: sha512-OqysC4c819itGxic50RoDMrmd+ofX+MMNkXKeRS0BV2rkKqrnuV17o3TrQXFI1xs/kXRmmPC+3Y42P9Y5uNvRg==} + /@tauri-apps/api@2.0.0-alpha.6: + resolution: {integrity: sha512-ZMOc3eu9amwvkC6M69h3hWt4/EsFaAXmtkiw4xd2LN59/lTb4ZQiVfq2QKlRcu1rj3n/Tcr7U30ZopvHwXBGIg==} engines: {node: '>= 14.6.0', npm: '>= 6.6.0', yarn: '>= 1.19.1'} dev: false @@ -2788,7 +2788,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001520 - electron-to-chromium: 1.4.490 + electron-to-chromium: 1.4.491 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true @@ -2801,20 +2801,20 @@ packages: node-gyp-build: 4.6.0 dev: false - /cacache@17.1.3: - resolution: {integrity: sha512-jAdjGxmPxZh0IipMdR7fK/4sDSrHMLUV0+GvVUsjwyGNKHsh79kW/otg+GkbXwl6Uzvy9wsvHOX4nUoWldeZMg==} + /cacache@17.1.4: + resolution: {integrity: sha512-/aJwG2l3ZMJ1xNAnqbMpA40of9dj/pIH3QfiuQSqjfPJF747VR0J/bHn+/KdNnHKc6XQcWt/AfRSBft82W1d2A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: '@npmcli/fs': 3.1.0 - fs-minipass: 3.0.2 + fs-minipass: 3.0.3 glob: 10.3.3 lru-cache: 7.18.3 - minipass: 5.0.0 + minipass: 7.0.3 minipass-collect: 1.0.2 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 p-map: 4.0.0 - ssri: 10.0.4 + ssri: 10.0.5 tar: 6.1.15 unique-filename: 3.0.0 dev: false @@ -3208,8 +3208,8 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /electron-to-chromium@1.4.490: - resolution: {integrity: sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==} + /electron-to-chromium@1.4.491: + resolution: {integrity: sha512-ZzPqGKghdVzlQJ+qpfE+r6EB321zed7e5JsvHIlMM4zPFF8okXUkF5Of7h7F3l3cltPL0rG7YVmlp5Qro7RQLA==} dev: true /emoji-regex@8.0.0: @@ -3815,11 +3815,11 @@ packages: minipass: 3.3.6 dev: false - /fs-minipass@3.0.2: - resolution: {integrity: sha512-2GAfyfoaCDRrM6jaOS3UsBts8yJ55VioXdWcOL7dK9zdAuKT71+WBA4ifnNYqVjYv+4SsPxjK0JT4yIIn4cA/g==} + /fs-minipass@3.0.3: + resolution: {integrity: sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - minipass: 5.0.0 + minipass: 7.0.3 dev: false /fs.realpath@1.0.0: @@ -3918,7 +3918,7 @@ packages: foreground-child: 3.1.1 jackspeak: 2.2.3 minimatch: 9.0.3 - minipass: 5.0.0 + minipass: 7.0.3 path-scurry: 1.10.1 dev: false @@ -4629,20 +4629,20 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: agentkeepalive: 4.5.0 - cacache: 17.1.3 + cacache: 17.1.4 http-cache-semantics: 4.1.1 http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-lambda: 1.0.1 lru-cache: 7.18.3 minipass: 5.0.0 - minipass-fetch: 3.0.3 + minipass-fetch: 3.0.4 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 negotiator: 0.6.3 promise-retry: 2.0.1 socks-proxy-agent: 7.0.0 - ssri: 10.0.4 + ssri: 10.0.5 transitivePeerDependencies: - supports-color dev: false @@ -5143,11 +5143,11 @@ packages: minipass: 3.3.6 dev: false - /minipass-fetch@3.0.3: - resolution: {integrity: sha512-n5ITsTkDqYkYJZjcRWzZt9qnZKCT7nKCosJhHoj7S7zD+BP4jVbWs+odsniw5TA3E0sLomhTKOKjF86wf11PuQ==} + /minipass-fetch@3.0.4: + resolution: {integrity: sha512-jHAqnA728uUpIaFm7NWsCnqKT6UqZz7GcI/bDpPATuwYyKwJwW0remxSCxUlKiEty+eopHGa3oc8WxgQ1FFJqg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - minipass: 5.0.0 + minipass: 7.0.3 minipass-sized: 1.0.3 minizlib: 2.1.2 optionalDependencies: @@ -5187,6 +5187,11 @@ packages: engines: {node: '>=8'} dev: false + /minipass@7.0.3: + resolution: {integrity: sha512-LhbbwCfz3vsb12j/WkWQPZfKTsgqIe1Nf/ti1pKjYESGLHIVjWU96G9/ljLH4F9mWNVhlQOm0VySdAWzf05dpg==} + engines: {node: '>=16 || 14 >=14.17'} + dev: false + /minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} @@ -5601,7 +5606,7 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: lru-cache: 10.0.1 - minipass: 5.0.0 + minipass: 7.0.3 dev: false /path-type@3.0.0: @@ -6532,11 +6537,11 @@ packages: resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} dev: false - /ssri@10.0.4: - resolution: {integrity: sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==} + /ssri@10.0.5: + resolution: {integrity: sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dependencies: - minipass: 5.0.0 + minipass: 7.0.3 dev: false /string-argv@0.3.2: @@ -7361,114 +7366,114 @@ packages: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: false - github.com/tauri-apps/tauri-plugin-app/f8b21651dfa42f42e080488568010ff3bbeb7350: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-app/tar.gz/f8b21651dfa42f42e080488568010ff3bbeb7350} + github.com/tauri-apps/tauri-plugin-app/1efde5f3e693927a529408f414238ad40b06c9a2: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-app/tar.gz/1efde5f3e693927a529408f414238ad40b06c9a2} name: '@tauri-apps/plugin-app' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-autostart/0b6ccaa31eccdeec47ca0425f7696846aa3a5f46: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/0b6ccaa31eccdeec47ca0425f7696846aa3a5f46} - name: '@tauri-apps/plugin-autostart' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-clipboard-manager/32e302b07e3ea11b59c55d4fc100516ac49a4968: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-clipboard-manager/tar.gz/32e302b07e3ea11b59c55d4fc100516ac49a4968} - name: '@tauri-apps/plugin-clipboard-manager' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-dialog/2d74ae009691b50e6498fb814a77c59b6798f2ac: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-dialog/tar.gz/2d74ae009691b50e6498fb814a77c59b6798f2ac} - name: '@tauri-apps/plugin-dialog' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-fs/0dd45ead4ca3cc8b426614fa47ad9227e9ed2053: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-fs/tar.gz/0dd45ead4ca3cc8b426614fa47ad9227e9ed2053} - name: '@tauri-apps/plugin-fs' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-http/27b519b63419db048d2d30945ff34b2234975ccd: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-http/tar.gz/27b519b63419db048d2d30945ff34b2234975ccd} - name: '@tauri-apps/plugin-http' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-notification/7878980ee8cb97437f343cc31b97a1b666e324d4: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-notification/tar.gz/7878980ee8cb97437f343cc31b97a1b666e324d4} - name: '@tauri-apps/plugin-notification' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-os/e4dda0ceff72cbc762937e79c104522a8866b840: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-os/tar.gz/e4dda0ceff72cbc762937e79c104522a8866b840} - name: '@tauri-apps/plugin-os' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-process/eec5dc8d37c80b2c1ebb7eb8e4cb976eed221a9d: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-process/tar.gz/eec5dc8d37c80b2c1ebb7eb8e4cb976eed221a9d} - name: '@tauri-apps/plugin-process' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-shell/f76cb0019364f40b9411eac5f5fdf6fd04b3e538: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-shell/tar.gz/f76cb0019364f40b9411eac5f5fdf6fd04b3e538} - name: '@tauri-apps/plugin-shell' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-sql/62eb3e4c9f084c1238cf7ab00d47148c034be207: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/62eb3e4c9f084c1238cf7ab00d47148c034be207} - name: '@tauri-apps/plugin-sql' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-store/ddb10b0776a670028c1a56bbe922aba02fd32484: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/ddb10b0776a670028c1a56bbe922aba02fd32484} - name: '@tauri-apps/plugin-store' - version: 2.0.0-alpha.0 - dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 - dev: false - - github.com/tauri-apps/tauri-plugin-stronghold/9b2878280d1ab9da3d1a56c6f73bc1384b93f705: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-stronghold/tar.gz/9b2878280d1ab9da3d1a56c6f73bc1384b93f705} - name: '@tauri-apps/plugin-stronghold' version: 2.0.0-alpha.1 dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 + '@tauri-apps/api': 2.0.0-alpha.6 dev: false - github.com/tauri-apps/tauri-plugin-upload/58fa4ca197cfd55292f77ede59f241014806963a: - resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-upload/tar.gz/58fa4ca197cfd55292f77ede59f241014806963a} - name: '@tauri-apps/plugin-upload' - version: 2.0.0-alpha.0 + github.com/tauri-apps/tauri-plugin-autostart/50d57bf6dcac4c32e6f5a73f1b6d90001b68c6f7: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-autostart/tar.gz/50d57bf6dcac4c32e6f5a73f1b6d90001b68c6f7} + name: '@tauri-apps/plugin-autostart' + version: 2.0.0-alpha.1 dependencies: - '@tauri-apps/api': 2.0.0-alpha.5 + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-clipboard-manager/f5314980a4b60362bca6b9d2a3a40a637c021d3c: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-clipboard-manager/tar.gz/f5314980a4b60362bca6b9d2a3a40a637c021d3c} + name: '@tauri-apps/plugin-clipboard-manager' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-dialog/eece20be9c1dc257e268f5d63654af56cf4fb474: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-dialog/tar.gz/eece20be9c1dc257e268f5d63654af56cf4fb474} + name: '@tauri-apps/plugin-dialog' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-fs/c90fd8bcad3be92f34a0642d67ab1a6ad9f73dee: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-fs/tar.gz/c90fd8bcad3be92f34a0642d67ab1a6ad9f73dee} + name: '@tauri-apps/plugin-fs' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-http/50bc7956907eef54a20255b62ea57ff4c2e8585a: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-http/tar.gz/50bc7956907eef54a20255b62ea57ff4c2e8585a} + name: '@tauri-apps/plugin-http' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-notification/66c0779854575ec7860eadcd98673c39627e81a6: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-notification/tar.gz/66c0779854575ec7860eadcd98673c39627e81a6} + name: '@tauri-apps/plugin-notification' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-os/97469d43edd41c32aa1c0eea38d1c19d14e38f47: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-os/tar.gz/97469d43edd41c32aa1c0eea38d1c19d14e38f47} + name: '@tauri-apps/plugin-os' + version: 2.0.0-alpha.2 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-process/7a04374b86dbc0691a7223bbdbec6b0b3d8cd3af: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-process/tar.gz/7a04374b86dbc0691a7223bbdbec6b0b3d8cd3af} + name: '@tauri-apps/plugin-process' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-shell/c8bb6d545043434cdb5784ace171c509f8b20586: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-shell/tar.gz/c8bb6d545043434cdb5784ace171c509f8b20586} + name: '@tauri-apps/plugin-shell' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-sql/592d8ba3640cfb3a3214fcec21b0355d3a6951ec: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-sql/tar.gz/592d8ba3640cfb3a3214fcec21b0355d3a6951ec} + name: '@tauri-apps/plugin-sql' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-store/22ed4246f7be1413852c5ab9907a773be08ad8a8: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-store/tar.gz/22ed4246f7be1413852c5ab9907a773be08ad8a8} + name: '@tauri-apps/plugin-store' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-stronghold/33dc99be377c7bc6b7cf4d4d1fdce28340379f63: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-stronghold/tar.gz/33dc99be377c7bc6b7cf4d4d1fdce28340379f63} + name: '@tauri-apps/plugin-stronghold' + version: 2.0.0-alpha.2 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 + dev: false + + github.com/tauri-apps/tauri-plugin-upload/c48327c9601b0097f104ddef120a1999d5b944db: + resolution: {tarball: https://codeload.github.com/tauri-apps/tauri-plugin-upload/tar.gz/c48327c9601b0097f104ddef120a1999d5b944db} + name: '@tauri-apps/plugin-upload' + version: 2.0.0-alpha.1 + dependencies: + '@tauri-apps/api': 2.0.0-alpha.6 dev: false diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a7aa7710..690127f2 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] @@ -182,9 +182,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "f768393e7fabd388fe8409b13faa4d93ab0fef35db1508438dfdb066918bcf38" [[package]] name = "arboard" @@ -1543,9 +1543,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "miniz_oxide", @@ -1880,7 +1880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "windows-targets 0.48.1", + "windows-targets 0.48.2", ] [[package]] @@ -2170,20 +2170,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "html5ever" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148" -dependencies = [ - "log", - "mac", - "markup5ever 0.10.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "html5ever" version = "0.26.0" @@ -2192,7 +2178,7 @@ checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" dependencies = [ "log", "mac", - "markup5ever 0.11.0", + "markup5ever", "proc-macro2", "quote", "syn 1.0.109", @@ -2498,9 +2484,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "javascriptcore-rs" -version = "0.17.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "110b9902c80c12bf113c432d0b71c7a94490b294a8234f326fd0abca2fac0b00" +checksum = "4cfcc681b896b083864a4a3c3b3ea196f14ff66b8641a68fde209c6d84434056" dependencies = [ "bitflags 1.3.2", "glib", @@ -2509,9 +2495,9 @@ dependencies = [ [[package]] name = "javascriptcore-rs-sys" -version = "0.5.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a216519a52cd941a733a0ad3f1023cfdb1cd47f3955e8e863ed56f558f916c" +checksum = "b0983ba5b3ab9a0c0918de02c42dc71f795d6de08092f88a98ce9fdfdee4ba91" dependencies = [ "glib-sys", "gobject-sys", @@ -2521,16 +2507,18 @@ dependencies = [ [[package]] name = "jni" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", + "cfg-if", "combine", "jni-sys", "log", "thiserror", "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -2576,13 +2564,25 @@ dependencies = [ ] [[package]] -name = "kuchiki" -version = "0.8.1" +name = "keyboard-types" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" +checksum = "0b7668b7cff6a51fe61cdde64cd27c8a220786f399501b57ebe36f7d8112fd68" +dependencies = [ + "bitflags 1.3.2", + "serde", + "unicode-segmentation", +] + +[[package]] +name = "kuchikiki" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" dependencies = [ "cssparser", - "html5ever 0.25.2", + "html5ever", + "indexmap 1.9.3", "matches", "selectors", ] @@ -2789,20 +2789,6 @@ dependencies = [ "libc", ] -[[package]] -name = "markup5ever" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd" -dependencies = [ - "log", - "phf 0.8.0", - "phf_codegen 0.8.0", - "string_cache", - "string_cache_codegen", - "tendril", -] - [[package]] name = "markup5ever" version = "0.11.0" @@ -2823,8 +2809,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9521dd6750f8e80ee6c53d65e2e4656d7de37064f3a7a5d2d11d05df93839c2" dependencies = [ - "html5ever 0.26.0", - "markup5ever 0.11.0", + "html5ever", + "markup5ever", "tendril", "xml5ever", ] @@ -2926,15 +2912,35 @@ dependencies = [ ] [[package]] -name = "ndk" -version = "0.6.0" +name = "muda" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +checksum = "47e33f46fb20f85553edb85e30a6a5231567f4103276ccdb5a2050613d253b1d" +dependencies = [ + "cocoa 0.25.0", + "crossbeam-channel", + "gdk", + "gdk-pixbuf", + "gtk", + "keyboard-types", + "objc", + "once_cell", + "png", + "thiserror", + "windows-sys 0.48.0", +] + +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags 1.3.2", "jni-sys", "ndk-sys", "num_enum", + "raw-window-handle", "thiserror", ] @@ -2946,9 +2952,9 @@ checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-sys" -version = "0.3.0" +version = "0.4.1+23.1.7779620" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" dependencies = [ "jni-sys", ] @@ -3313,7 +3319,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.2", ] [[package]] @@ -4759,9 +4765,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "state" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" dependencies = [ "loom", ] @@ -4942,9 +4948,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.19.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "746ae5d0ca57ae275a792f109f6e992e0b41a443abdf3f5c6eff179ef5b3443a" +checksum = "60279ecb16c33a6cef45cd37a9602455c190942d20e360bd8499bff49f2a48f3" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -4953,7 +4959,6 @@ dependencies = [ "core-foundation", "core-graphics 0.22.3", "crossbeam-channel", - "dirs-next", "dispatch", "gdk", "gdk-pixbuf", @@ -4968,7 +4973,6 @@ dependencies = [ "instant", "jni", "lazy_static", - "libappindicator", "libc", "log", "ndk", @@ -4983,10 +4987,12 @@ dependencies = [ "serde", "tao-macros", "unicode-segmentation", + "url", "uuid", - "windows 0.44.0", + "windows 0.48.0", "windows-implement", "x11-dl", + "zbus", ] [[package]] @@ -5019,13 +5025,13 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tauri" -version = "2.0.0-alpha.10" +version = "2.0.0-alpha.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e18377a75e314aa1d476896af881ed63f57a78ca84889fe63e69067f0de158d" +checksum = "fad0a5c32ce9e3e9862fb8cd433abf63e65ffea9b80dcc44d3d991e6794ea9a6" dependencies = [ "anyhow", "bytes", - "cocoa 0.24.1", + "cocoa 0.25.0", "dirs-next", "embed_plist", "futures-util", @@ -5037,13 +5043,14 @@ dependencies = [ "jni", "libc", "log", + "mime", + "muda", "objc", "once_cell", "percent-encoding", "rand 0.8.5", "raw-window-handle", "reqwest", - "semver", "serde", "serde_json", "serde_repr", @@ -5055,26 +5062,27 @@ dependencies = [ "tauri-runtime", "tauri-runtime-wry", "tauri-utils", - "tempfile", "thiserror", "tokio", + "tray-icon", "url", "uuid", "webkit2gtk", "webview2-com", - "windows 0.44.0", + "windows 0.48.0", ] [[package]] name = "tauri-build" -version = "2.0.0-alpha.6" +version = "2.0.0-alpha.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a52990870fd043f1d3bd6719ae713ef2e0c50431334d7249f6ae8509d1b8c326" +checksum = "dc47d3c84f4aeac397cd956267f3b8060c5a2dba78288a5ccf9a8b7a8c1e7025" dependencies = [ "anyhow", "cargo_toml", "heck", "json-patch", + "plist", "semver", "serde", "serde_json", @@ -5086,9 +5094,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.0.0-alpha.6" +version = "2.0.0-alpha.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1f1611ab0896f2693163ba4e8f3e39c02a1b70cdca4314286b5e365a5e08c6" +checksum = "7f98a67c7ef3cb3c25de91fe1fa16cc3681997f6ec99da0a7496d6feae2ea91e" dependencies = [ "base64 0.21.2", "brotli", @@ -5112,9 +5120,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-alpha.6" +version = "2.0.0-alpha.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22752425c6dd6f3a058f376db7371f1d5bac250e340d40ba6c97ecf7182eef29" +checksum = "b01cb5f945c71e040c5d191c32598565ae26cc266a9d5d4f7dd2dc324c5cfdd0" dependencies = [ "heck", "proc-macro2", @@ -5126,16 +5134,16 @@ dependencies = [ [[package]] name = "tauri-plugin-app" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "tauri", ] [[package]] name = "tauri-plugin-autostart" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "auto-launch", "log", @@ -5147,8 +5155,8 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "arboard", "log", @@ -5161,8 +5169,8 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "glib", "log", @@ -5178,8 +5186,8 @@ dependencies = [ [[package]] name = "tauri-plugin-fs" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "anyhow", "glob", @@ -5191,8 +5199,8 @@ dependencies = [ [[package]] name = "tauri-plugin-http" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.2" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "data-url", "glob", @@ -5208,8 +5216,8 @@ dependencies = [ [[package]] name = "tauri-plugin-notification" -version = "2.0.0-alpha.1" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.2" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "log", "notify-rust", @@ -5226,8 +5234,8 @@ dependencies = [ [[package]] name = "tauri-plugin-os" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "gethostname 0.4.3", "log", @@ -5242,16 +5250,16 @@ dependencies = [ [[package]] name = "tauri-plugin-process" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "tauri", ] [[package]] name = "tauri-plugin-shell" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "encoding_rs", "log", @@ -5267,8 +5275,8 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "log", "serde", @@ -5281,8 +5289,8 @@ dependencies = [ [[package]] name = "tauri-plugin-sql" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "futures-core", "log", @@ -5297,8 +5305,8 @@ dependencies = [ [[package]] name = "tauri-plugin-store" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "log", "serde", @@ -5309,8 +5317,8 @@ dependencies = [ [[package]] name = "tauri-plugin-stronghold" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "hex", "iota-crypto 0.23.0", @@ -5325,8 +5333,8 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "base64 0.21.2", "dirs-next", @@ -5350,8 +5358,8 @@ dependencies = [ [[package]] name = "tauri-plugin-upload" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "futures-util", "log", @@ -5367,8 +5375,8 @@ dependencies = [ [[package]] name = "tauri-plugin-window" -version = "2.0.0-alpha.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#d5a7c77a8d0e7912a6b07b22ed329004edd6e80b" +version = "2.0.0-alpha.1" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#319de692bf5f50775fd3bb1d6722cb03304fd6ab" dependencies = [ "serde", "tauri", @@ -5377,9 +5385,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.13.0-alpha.6" +version = "1.0.0-alpha.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ce19f1309299bbc38ee9236307fad4943bd8fb09dd3fea5e9dd93c1d0898d6" +checksum = "f5ba2ea1c0b7a2c3e53259edc3c78527e9f40fa7b45f73c52ab5165e42f9d18a" dependencies = [ "gtk", "http", @@ -5393,14 +5401,14 @@ dependencies = [ "thiserror", "url", "uuid", - "windows 0.44.0", + "windows 0.48.0", ] [[package]] name = "tauri-runtime-wry" -version = "0.13.0-alpha.6" +version = "1.0.0-alpha.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1231be42085f3a8b150e615601f8a070bd16bf579771a5dafe2931970a05b518" +checksum = "095d8a6cb312211bd0ed6b51f078be2e5bba4e3244b5fdbe39fce2ebfc0d7a15" dependencies = [ "cocoa 0.24.1", "gtk", @@ -5413,25 +5421,25 @@ dependencies = [ "uuid", "webkit2gtk", "webview2-com", - "windows 0.44.0", + "windows 0.48.0", "wry", ] [[package]] name = "tauri-utils" -version = "2.0.0-alpha.6" +version = "2.0.0-alpha.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e2812e0cdfffb892c654555b2f1b8c84a035b4c56eb1646cb3eb5a9d8164d8e" +checksum = "06bcd7c6f67fd6371dcc22da7d7f26ec12c4eae26ad7bc54943bb9f35b5db302" dependencies = [ "brotli", "ctor", "dunce", "glob", "heck", - "html5ever 0.25.2", + "html5ever", "infer", "json-patch", - "kuchiki", + "kuchikiki", "memchr", "phf 0.10.1", "proc-macro2", @@ -5443,7 +5451,7 @@ dependencies = [ "thiserror", "url", "walkdir", - "windows 0.44.0", + "windows 0.48.0", ] [[package]] @@ -5498,18 +5506,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "dedd246497092a89beedfe2c9f176d44c1b672ea6090edc20544ade01fbb7ea0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "7d7b1fadccbbc7e19ea64708629f9d8dccd007c260d66485f20a6d41bc1cf4b3" dependencies = [ "proc-macro2", "quote", @@ -5736,6 +5744,25 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "tray-icon" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b0e5bec13da15e62330e9bcf8b9fd42489b5acfe29ac8fec7ed659dbee21d9" +dependencies = [ + "cocoa 0.25.0", + "core-graphics 0.23.1", + "crossbeam-channel", + "dirs-next", + "libappindicator", + "muda", + "objc", + "once_cell", + "png", + "thiserror", + "windows-sys 0.48.0", +] + [[package]] name = "treediff" version = "4.0.2" @@ -6027,9 +6054,9 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "0.19.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8eea819afe15eb8dcdff4f19d8bfda540bae84d874c10e6f4b8faf2d6704bd1" +checksum = "3ba4cce9085e0fb02575cfd45c328740dde78253cba516b1e8be2ca0f57bd8bf" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -6051,9 +6078,9 @@ dependencies = [ [[package]] name = "webkit2gtk-sys" -version = "0.19.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ac7a95ddd3fdfcaf83d8e513b4b1ad101b95b413b6aa6662ed95f284fc3d5b" +checksum = "f4489eb24e8cf0a3d0555fd3a8f7adec2a5ece34c1e7b7c9a62da7822fd40a59" dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", @@ -6076,7 +6103,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8598785beeb5af95abe95e7bb20c7e747d1188347080d6811d5a56d2b9a5f368" dependencies = [ "curl", - "html5ever 0.26.0", + "html5ever", "markup5ever_rcdom", "serde", "serde_json", @@ -6093,38 +6120,39 @@ dependencies = [ [[package]] name = "webview2-com" -version = "0.22.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11296e5daf3a653b79bf47d66c380e4143d5b9c975818871179a3bda79499562" +checksum = "79e563ffe8e84d42e43ffacbace8780c0244fc8910346f334613559d92e203ad" dependencies = [ "webview2-com-macros", "webview2-com-sys", - "windows 0.44.0", + "windows 0.48.0", "windows-implement", + "windows-interface", ] [[package]] name = "webview2-com-macros" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] name = "webview2-com-sys" -version = "0.22.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde542bed28058a5b028d459689ee57f1d06685bb6c266da3b91b1be6703952f" +checksum = "19d39576804304cf9ead192467ef47f7859a1a12fec3bd459d5ba34b8cd65ed5" dependencies = [ "regex", "serde", "serde_json", "thiserror", - "windows 0.44.0", + "windows 0.48.0", "windows-bindgen", "windows-metadata", ] @@ -6184,7 +6212,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window-vibrancy" version = "0.4.0" -source = "git+https://github.com/tauri-apps/window-vibrancy?branch=dev#c463a8b324e7a3fac18a006bcc92b27fc3d97a04" +source = "git+https://github.com/tauri-apps/window-vibrancy?branch=dev#98dc472a7f96bfba595c74b009073bd2c7b28339" dependencies = [ "cocoa 0.25.0", "objc", @@ -6224,8 +6252,6 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" dependencies = [ - "windows-implement", - "windows-interface", "windows-targets 0.42.2", ] @@ -6235,14 +6261,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-implement", + "windows-interface", + "windows-targets 0.48.2", ] [[package]] name = "windows-bindgen" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222204ecf46521382a4d88b4a1bbefca9f8855697b4ab7d20803901425e061a3" +checksum = "1fe21a77bc54b7312dbd66f041605e098990c98be48cd52967b85b5e60e75ae6" dependencies = [ "windows-metadata", "windows-tokens", @@ -6250,9 +6278,9 @@ dependencies = [ [[package]] name = "windows-implement" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" +checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" dependencies = [ "proc-macro2", "quote", @@ -6261,9 +6289,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" +checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" dependencies = [ "proc-macro2", "quote", @@ -6272,9 +6300,9 @@ dependencies = [ [[package]] name = "windows-metadata" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee78911e3f4ce32c1ad9d3c7b0bd95389662ad8d8f1a3155688fed70bd96e2b6" +checksum = "422ee0e5f0e2cc372bb6addbfff9a8add712155cd743df9c15f6ab000f31432d" [[package]] name = "windows-sys" @@ -6291,7 +6319,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.2", ] [[package]] @@ -6311,24 +6339,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.2", + "windows_aarch64_msvc 0.48.2", + "windows_i686_gnu 0.48.2", + "windows_i686_msvc 0.48.2", + "windows_x86_64_gnu 0.48.2", + "windows_x86_64_gnullvm 0.48.2", + "windows_x86_64_msvc 0.48.2", ] [[package]] name = "windows-tokens" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4251900975a0d10841c5d4bde79c56681543367ef811f3fabb8d1803b0959b" +checksum = "b34c9a3b28cb41db7385546f7f9a8179348dffc89923dde66857b1ba5312f6b4" [[package]] name = "windows_aarch64_gnullvm" @@ -6338,9 +6366,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" [[package]] name = "windows_aarch64_msvc" @@ -6362,9 +6390,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" [[package]] name = "windows_i686_gnu" @@ -6386,9 +6414,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" [[package]] name = "windows_i686_msvc" @@ -6410,9 +6438,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" [[package]] name = "windows_x86_64_gnu" @@ -6434,9 +6462,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" [[package]] name = "windows_x86_64_gnullvm" @@ -6446,9 +6474,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" [[package]] name = "windows_x86_64_msvc" @@ -6470,9 +6498,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" [[package]] name = "winnow" @@ -6504,11 +6532,11 @@ dependencies = [ [[package]] name = "wry" -version = "0.28.3" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d15f9f827d537cefe6d047be3930f5d89b238dfb85e08ba6a319153217635aa" +checksum = "4c6289018fa3cbc051c13f4ae1a102d80c3f35a527456c75567eb2cad6989020" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "block", "cocoa 0.24.1", "core-graphics 0.22.3", @@ -6518,10 +6546,10 @@ dependencies = [ "gio", "glib", "gtk", - "html5ever 0.25.2", + "html5ever", "http", "javascriptcore-rs", - "kuchiki", + "kuchikiki", "libc", "log", "objc", @@ -6537,7 +6565,7 @@ dependencies = [ "webkit2gtk", "webkit2gtk-sys", "webview2-com", - "windows 0.44.0", + "windows 0.48.0", "windows-implement", ] @@ -6622,7 +6650,7 @@ checksum = "4034e1d05af98b51ad7214527730626f019682d797ba38b51689212118d8e650" dependencies = [ "log", "mac", - "markup5ever 0.11.0", + "markup5ever", ] [[package]] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 0d4d2fb2..560966d8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -11,15 +11,12 @@ rust-version = "1.71" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] -tauri-build = { version = "2.0.0-alpha.6", features = [] } +tauri-build = { version = "2.0.0-alpha.8", features = [] } [dependencies] serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -tauri = { version = "2.0.0-alpha.10", features = [ - "macos-private-api", - "system-tray", -] } +tauri = { version = "2.0.0-alpha.11", features = ["macos-private-api"] } tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } @@ -55,7 +52,7 @@ features = ["sqlite"] default = ["custom-protocol"] # this feature is used used for production builds where `devPath` points to the filesystem # DO NOT remove this -custom-protocol = ["tauri/custom-protocol"] +custom-protocol = [] # Optimized for bundle size. If you want faster builds comment out/delete this section. [profile.release] diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 80ad772f..95db317c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -89,10 +89,6 @@ "security": { "csp": "upgrade-insecure-requests" }, - "systemTray": { - "iconAsTemplate": true, - "iconPath": "icons/icon.png" - }, "windows": [ { "width": 1080, diff --git a/src/app.tsx b/src/app.tsx index 58b152f0..6b966572 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -5,18 +5,18 @@ import { AuthImportScreen } from '@app/auth/import'; import { OnboardingScreen } from '@app/auth/onboarding'; import { ErrorScreen } from '@app/error'; -import { getActiveAccount } from '@libs/storage'; - import { AppLayout } from '@shared/appLayout'; import { AuthLayout } from '@shared/authLayout'; import { LoaderIcon } from '@shared/icons'; import { SettingsLayout } from '@shared/settingsLayout'; +import { checkActiveAccount } from '@utils/checkActiveAccount'; + import './index.css'; -const appLoader = async () => { +async function Loader() { try { - const account = await getActiveAccount(); + const account = await checkActiveAccount(); const stronghold = sessionStorage.getItem('stronghold'); const privkey = JSON.parse(stronghold).state.privkey || null; const onboarding = localStorage.getItem('onboarding'); @@ -29,10 +29,6 @@ const appLoader = async () => { if (!account) { return redirect('/auth/welcome'); } else { - if (account.privkey.length > 35) { - return redirect('/auth/migrate'); - } - if (!privkey) { return redirect('/auth/unlock'); } @@ -42,14 +38,14 @@ const appLoader = async () => { } catch (e) { throw new Error('App failed to load'); } -}; +} const router = createBrowserRouter([ { path: '/', element: , errorElement: , - loader: appLoader, + loader: Loader, children: [ { path: '', diff --git a/src/app/auth/import/step-3.tsx b/src/app/auth/import/step-3.tsx index a5d2f793..24c838d1 100644 --- a/src/app/auth/import/step-3.tsx +++ b/src/app/auth/import/step-3.tsx @@ -10,7 +10,6 @@ import { ArrowRightCircleIcon, LoaderIcon } from '@shared/icons'; import { useOnboarding } from '@stores/onboarding'; -import { useAccount } from '@utils/hooks/useAccount'; import { useNostr } from '@utils/hooks/useNostr'; export function ImportStep3Screen() { @@ -21,7 +20,6 @@ export function ImportStep3Screen() { const [loading, setLoading] = useState(false); const { db } = useStorage(); - const { status, account } = useAccount(); const { fetchUserData } = useNostr(); const submit = async () => { @@ -72,7 +70,7 @@ export function ImportStep3Screen() { ) : (
- + + +
); diff --git a/src/app/events/index.tsx b/src/app/events/index.tsx index 48db0500..e44c4b82 100644 --- a/src/app/events/index.tsx +++ b/src/app/events/index.tsx @@ -1,5 +1,7 @@ import { useParams } from 'react-router-dom'; +import { useStorage } from '@libs/storage/provider'; + import { NoteActions, NoteContent, @@ -10,12 +12,11 @@ import { import { RepliesList } from '@shared/notes/replies/list'; import { NoteSkeleton } from '@shared/notes/skeleton'; -import { useAccount } from '@utils/hooks/useAccount'; import { useEvent } from '@utils/hooks/useEvent'; export function EventScreen() { const { id } = useParams(); - const { account } = useAccount(); + const { db } = useStorage(); const { status, data } = useEvent(id); return ( @@ -42,7 +43,7 @@ export function EventScreen() { )}
- +
diff --git a/src/app/space/components/widgets/network.tsx b/src/app/space/components/widgets/network.tsx index bf301952..5b3d429c 100644 --- a/src/app/space/components/widgets/network.tsx +++ b/src/app/space/components/widgets/network.tsx @@ -1,36 +1,34 @@ import { useInfiniteQuery } from '@tanstack/react-query'; import { useVirtualizer } from '@tanstack/react-virtual'; -import { useCallback, useEffect, useRef } from 'react'; +import { NostrEvent } from 'nostr-fetch'; +import { useCallback, useEffect, useMemo, useRef } from 'react'; import { Link } from 'react-router-dom'; -import { useNewsfeed } from '@app/space/hooks/useNewsfeed'; - -import { getNotes } from '@libs/storage'; - import { NoteKind_1, NoteKind_1063, NoteThread, Repost } from '@shared/notes'; import { NoteKindUnsupport } from '@shared/notes/kinds/unsupport'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; +import { useNostr } from '@utils/hooks/useNostr'; import { LumeEvent } from '@utils/types'; -const ITEM_PER_PAGE = 10; - export function NetworkBlock() { - // subscribe for live update - // useNewsfeed(); - - const { status, data, fetchNextPage, hasNextPage, isFetchingNextPage } = + const { fetchNotes } = useNostr(); + const { status, data, hasNextPage, isFetchingNextPage, fetchNextPage } = useInfiniteQuery({ queryKey: ['network-widget'], - queryFn: async ({ pageParam = 0 }) => { - return await getNotes(ITEM_PER_PAGE, pageParam); + queryFn: async ({ pageParam = 24 }) => { + return await fetchNotes(pageParam); }, getNextPageParam: (lastPage) => lastPage.nextCursor, }); - const notes = data ? data.pages.flatMap((d: { data: LumeEvent[] }) => d.data) : []; const parentRef = useRef(); + const notes = useMemo( + // @ts-expect-error, todo + () => (data ? data.pages.flatMap((d: { data: NostrEvent[] }) => d.data) : []), + [data] + ); const rowVirtualizer = useVirtualizer({ count: hasNextPage ? notes.length + 1 : notes.length, @@ -140,7 +138,7 @@ export function NetworkBlock() {

- You not have any posts to see yet + You not have any postrs to see yet
Follow more people to have more fun.

@@ -148,7 +146,7 @@ export function NetworkBlock() { to="/trending" className="inline-flex w-max rounded bg-fuchsia-500 px-2.5 py-1.5 text-sm hover:bg-fuchsia-600" > - Trending + Trending users
diff --git a/src/app/splash.tsx b/src/app/splash.tsx index 47911768..38bd50a7 100644 --- a/src/app/splash.tsx +++ b/src/app/splash.tsx @@ -6,13 +6,11 @@ import { useStorage } from '@libs/storage/provider'; import { LoaderIcon } from '@shared/icons'; -import { useAccount } from '@utils/hooks/useAccount'; import { useNostr } from '@utils/hooks/useNostr'; export function SplashScreen() { const { db } = useStorage(); const { ndk, relayUrls } = useNDK(); - const { status, account } = useAccount(); const { fetchUserData } = useNostr(); const [isLoading, setIsLoading] = useState(true); @@ -46,15 +44,15 @@ export function SplashScreen() { }; useEffect(() => { - if (status === 'success' && !account) { + if (!db.account) { invoke('close_splashscreen'); } - if (ndk && account) { + if (ndk && db.account) { console.log('prefetching...'); prefetch(); } - }, [ndk, account]); + }, [ndk, db.account]); return (
diff --git a/src/app/trending/components/profile.tsx b/src/app/trending/components/profile.tsx index 5148d203..390b7576 100644 --- a/src/app/trending/components/profile.tsx +++ b/src/app/trending/components/profile.tsx @@ -1,5 +1,4 @@ import { useQuery } from '@tanstack/react-query'; -import { fetch } from '@tauri-apps/plugin-http'; import { useEffect, useState } from 'react'; import { FollowIcon, LoaderIcon, UnfollowIcon } from '@shared/icons'; diff --git a/src/app/trending/components/trendingNotes.tsx b/src/app/trending/components/trendingNotes.tsx index 7fd30e39..ef258d73 100644 --- a/src/app/trending/components/trendingNotes.tsx +++ b/src/app/trending/components/trendingNotes.tsx @@ -1,5 +1,4 @@ import { useQuery } from '@tanstack/react-query'; -import { fetch } from '@tauri-apps/plugin-http'; import { NoteKind_1 } from '@shared/notes'; import { NoteSkeleton } from '@shared/notes/skeleton'; diff --git a/src/app/trending/components/trendingProfiles.tsx b/src/app/trending/components/trendingProfiles.tsx index d65a778e..002ced7f 100644 --- a/src/app/trending/components/trendingProfiles.tsx +++ b/src/app/trending/components/trendingProfiles.tsx @@ -1,5 +1,4 @@ import { useQuery } from '@tanstack/react-query'; -import { fetch } from '@tauri-apps/plugin-http'; import { Profile } from '@app/trending/components/profile'; diff --git a/src/libs/ndk/instance.ts b/src/libs/ndk/instance.ts index 6bfaeba8..fd5d39b3 100644 --- a/src/libs/ndk/instance.ts +++ b/src/libs/ndk/instance.ts @@ -1,6 +1,5 @@ // inspire by: https://github.com/nostr-dev-kit/ndk-react/ import NDK from '@nostr-dev-kit/ndk'; -import { fetch } from '@tauri-apps/plugin-http'; import { useEffect, useState } from 'react'; import TauriAdapter from '@libs/ndk/cache'; @@ -31,14 +30,21 @@ export const NDKInstance = () => { } try { + const controller = new AbortController(); + const timeoutId = setTimeout(() => controller.abort('timeout'), 5000); const res = await fetch(url, { headers: { Accept: 'application/nostr+json' }, + signal: controller.signal, }); if (res.ok) { const data = await res.json(); console.log('relay information: ', data); + verifiedRelays.push(relay); + clearTimeout(timeoutId); + } else { + console.log('relay not working: ', res); } } catch (e) { console.log('fetch error', e); diff --git a/src/libs/storage.ts b/src/libs/storage.ts index 41600df1..c924717d 100644 --- a/src/libs/storage.ts +++ b/src/libs/storage.ts @@ -36,12 +36,6 @@ export async function getActiveAccount() { 'SELECT * FROM accounts WHERE is_active = 1;' ); if (result.length > 0) { - result[0]['follows'] = result[0].follows - ? JSON.parse(result[0].follows as unknown as string) - : null; - result[0]['network'] = result[0].network - ? JSON.parse(result[0].network as unknown as string) - : null; return result[0]; } else { return null; diff --git a/src/libs/storage/instance.ts b/src/libs/storage/instance.ts index 74c3d3e3..f33065d3 100644 --- a/src/libs/storage/instance.ts +++ b/src/libs/storage/instance.ts @@ -7,10 +7,12 @@ import { Account, Relays, Widget } from '@utils/types'; export class LumeStorage { public db: Database; public secureDB: Stronghold; + public account: Account | null = null; constructor(sqlite: Database, stronghold?: Stronghold) { this.db = sqlite; this.secureDB = stronghold ?? undefined; + this.account = null; } private async getSecureClient() { @@ -45,19 +47,24 @@ export class LumeStorage { } public async getActiveAccount() { - const account: Account = await this.db.select( - 'SELECT * FROM accounts WHERE is_active = 1;' - )?.[0]; - if (account) { + const results: Array = await this.db.select( + 'SELECT * FROM accounts WHERE is_active = "1" ORDER BY id DESC LIMIT 1;' + ); + + if (results.length > 0) { + const account = results[0]; + if (typeof account.follows === 'string') account.follows = JSON.parse(account.follows); if (typeof account.network === 'string') account.network = JSON.parse(account.network); + this.account = account; return account; } else { - throw new Error('Account not found'); + console.log('no active account, please create new account'); + return null; } } @@ -75,27 +82,30 @@ export class LumeStorage { } public async updateAccount(column: string, value: string | string[]) { - const account = await this.getActiveAccount(); - return await this.db.execute(`UPDATE accounts SET ${column} = $1 WHERE id = $2;`, [ - value, - account.id, - ]); + const insert = await this.db.execute( + `UPDATE accounts SET ${column} = $1 WHERE id = $2;`, + [value, this.account.id] + ); + + if (insert) { + const account = await this.getActiveAccount(); + return account; + } } public async getWidgets() { - const account = await this.getActiveAccount(); const result: Array = await this.db.select( - `SELECT * FROM widgets WHERE account_id = "${account.id}" ORDER BY created_at DESC;` + `SELECT * FROM widgets WHERE account_id = "${this.account.id}" ORDER BY created_at DESC;` ); return result; } public async createWidget(kind: number, title: string, content: string | string[]) { - const account = await this.getActiveAccount(); const insert = await this.db.execute( 'INSERT OR IGNORE INTO widgets (account_id, kind, title, content) VALUES ($1, $2, $3, $4);', - [account.id, kind, title, content] + [this.account.id, kind, title, content] ); + if (insert) { const widget: Widget = await this.db.select( 'SELECT * FROM widgets ORDER BY id DESC LIMIT 1;' @@ -129,7 +139,7 @@ export class LumeStorage { [cacheKey] )?.[0]; if (!event) { - console.error('failed to get event by cache_key: ', cacheKey); + // console.error('failed to get event by cache_key: ', cacheKey); return null; } return event; @@ -141,16 +151,15 @@ export class LumeStorage { [id] )?.[0]; if (!event) { - console.error('failed to get event by id: ', id); + // console.error('failed to get event by id: ', id); return null; } return event; } public async getExplicitRelayUrls() { - const account = await this.getActiveAccount(); const result: Relays[] = await this.db.select( - `SELECT * FROM relays WHERE account_id = "${account.id}";` + `SELECT * FROM relays WHERE account_id = "${this.account.id}";` ); if (result.length > 0) return result.map((el) => el.relay); @@ -158,10 +167,9 @@ export class LumeStorage { } public async createRelay(relay: string, purpose?: string) { - const account = await this.getActiveAccount(); return await this.db.execute( 'INSERT OR IGNORE INTO relays (account_id, relay, purpose) VALUES ($1, $2, $3);', - [account.id, relay, purpose || ''] + [this.account.id, relay, purpose || ''] ); } diff --git a/src/libs/storage/provider.tsx b/src/libs/storage/provider.tsx index 8489124c..5e6ed51e 100644 --- a/src/libs/storage/provider.tsx +++ b/src/libs/storage/provider.tsx @@ -17,6 +17,8 @@ const StorageProvider = ({ children }: PropsWithChildren) => { async function initLumeStorage() { const sqlite = await Database.load('sqlite:lume.db'); const lumeStorage = new LumeStorage(sqlite); + + if (!lumeStorage.account) await lumeStorage.getActiveAccount(); setDB(lumeStorage); } diff --git a/src/shared/editProfileModal.tsx b/src/shared/editProfileModal.tsx index adf33cc1..b04a6686 100644 --- a/src/shared/editProfileModal.tsx +++ b/src/shared/editProfileModal.tsx @@ -1,7 +1,6 @@ import { Dialog, Transition } from '@headlessui/react'; import { NDKEvent } from '@nostr-dev-kit/ndk'; import { useQueryClient } from '@tanstack/react-query'; -import { fetch } from '@tauri-apps/plugin-http'; import { Fragment, useEffect, useState } from 'react'; import { useForm } from 'react-hook-form'; diff --git a/src/shared/lumeBar.tsx b/src/shared/lumeBar.tsx index 2641c729..41c6893f 100644 --- a/src/shared/lumeBar.tsx +++ b/src/shared/lumeBar.tsx @@ -1,29 +1,20 @@ import { Link } from 'react-router-dom'; +import { useStorage } from '@libs/storage/provider'; + import { ActiveAccount } from '@shared/accounts/active'; import { SettingsIcon } from '@shared/icons'; import { Logout } from '@shared/logout'; import { NotificationModal } from '@shared/notification/modal'; -import { useAccount } from '@utils/hooks/useAccount'; - export function LumeBar() { - const { status, account } = useAccount(); + const { db } = useStorage(); return (
- {status === 'loading' ? ( - <> -
-
- - ) : ( - <> - - - - )} + +
- -
- - - - - - -
-
{/* Channels {({ open }) => ( diff --git a/src/shared/notes/actions.tsx b/src/shared/notes/actions.tsx index d78d5264..dae51eac 100644 --- a/src/shared/notes/actions.tsx +++ b/src/shared/notes/actions.tsx @@ -10,8 +10,6 @@ import { NoteZap } from '@shared/notes/actions/zap'; import { BLOCK_KINDS } from '@stores/constants'; import { useWidgets } from '@stores/widgets'; -import { useAccount } from '@utils/hooks/useAccount'; - export function NoteActions({ id, pubkey, @@ -23,7 +21,6 @@ export function NoteActions({ noOpenThread?: boolean; root?: string; }) { - const { account } = useAccount(); const setWidget = useWidgets((state) => state.setWidget); return ( @@ -33,7 +30,7 @@ export function NoteActions({ - {(account?.lud06 || account?.lud16) && } +
{!noOpenThread && ( <> diff --git a/src/shared/notes/metadata.tsx b/src/shared/notes/metadata.tsx index ab4e935a..832c23e0 100644 --- a/src/shared/notes/metadata.tsx +++ b/src/shared/notes/metadata.tsx @@ -67,13 +67,10 @@ export function NoteMetadata({ id }: { id: string }) { if (status === 'loading') { return ( -
-
-
-
-
- -
+
+
+
+
); diff --git a/src/stores/widgets.tsx b/src/stores/widgets.tsx index 3ffbec7b..6d9bd601 100644 --- a/src/stores/widgets.tsx +++ b/src/stores/widgets.tsx @@ -30,7 +30,7 @@ export const useWidgets = create()( }, }), { - name: 'blocks', + name: 'widgets', storage: createJSONStorage(() => localStorage), } ) diff --git a/src/utils/checkActiveAccount.tsx b/src/utils/checkActiveAccount.tsx new file mode 100644 index 00000000..4ee2287f --- /dev/null +++ b/src/utils/checkActiveAccount.tsx @@ -0,0 +1,33 @@ +import Database from '@tauri-apps/plugin-sql'; + +import { Account } from '@utils/types'; + +let db: null | Database = null; + +async function connect(): Promise { + if (db) { + return db; + } + try { + db = await Database.load('sqlite:lume.db'); + } catch (e) { + throw new Error('Failed to connect to database, error: ', e); + } + return db; +} + +export async function checkActiveAccount() { + const tempDB = await connect(); + const result: Array = await db.select( + 'SELECT * FROM accounts WHERE is_active = 1;' + ); + + // close temp db + tempDB.close(); + + if (result.length > 0) { + return true; + } else { + return false; + } +} diff --git a/src/utils/hooks/useAccount.tsx b/src/utils/hooks/useAccount.tsx index ba3db3db..74e13a2b 100644 --- a/src/utils/hooks/useAccount.tsx +++ b/src/utils/hooks/useAccount.tsx @@ -1,14 +1,15 @@ import { useQuery } from '@tanstack/react-query'; import { useNDK } from '@libs/ndk/provider'; -import { getActiveAccount } from '@libs/storage'; +import { useStorage } from '@libs/storage/provider'; export function useAccount() { + const { db } = useStorage(); const { ndk } = useNDK(); const { status, data: account } = useQuery( ['account'], async () => { - const account = await getActiveAccount(); + const account = await db.getActiveAccount(); console.log('account: ', account); if (account?.pubkey) { const user = ndk.getUser({ hexpubkey: account?.pubkey }); diff --git a/src/utils/hooks/useNostr.tsx b/src/utils/hooks/useNostr.tsx index cd95104e..38544016 100644 --- a/src/utils/hooks/useNostr.tsx +++ b/src/utils/hooks/useNostr.tsx @@ -7,7 +7,6 @@ import { NDKUser, } from '@nostr-dev-kit/ndk'; import { ndkAdapter } from '@nostr-fetch/adapter-ndk'; -import { useQueryClient } from '@tanstack/react-query'; import destr from 'destr'; import { LRUCache } from 'lru-cache'; import { NostrFetcher } from 'nostr-fetch'; @@ -19,14 +18,12 @@ import { useStorage } from '@libs/storage/provider'; import { useStronghold } from '@stores/stronghold'; -import { useAccount } from '@utils/hooks/useAccount'; +import { nHoursAgo } from '@utils/date'; export function useNostr() { const { ndk, relayUrls } = useNDK(); - const { account } = useAccount(); const { db } = useStorage(); - const queryClient = useQueryClient(); const privkey = useStronghold((state) => state.privkey); const fetcher = useMemo(() => NostrFetcher.withCustomPool(ndkAdapter(ndk)), [ndk]); const subManager = useMemo( @@ -58,7 +55,7 @@ export function useNostr() { // fetch user's follows if (!preFollows) { - const user = ndk.getUser({ hexpubkey: account.pubkey }); + const user = ndk.getUser({ hexpubkey: db.account.pubkey }); const list = await user.follows(); list.forEach((item: NDKUser) => { follows.add(nip19.decode(item.npub).data as string); @@ -78,8 +75,6 @@ export function useNostr() { await db.updateAccount('follows', [...follows]); await db.updateAccount('network', [...new Set([...follows, ...network])]); - queryClient.invalidateQueries(['account']); - return { status: 'ok' }; } catch (e) { return { status: 'failed', message: e }; @@ -90,19 +85,23 @@ export function useNostr() { try { if (!ndk) return { status: 'failed', message: 'NDK instance not found' }; - const events = await fetcher.fetchAllEvents( - relayUrls, - { - kinds: [1], - authors: account.network ?? account.follows, - }, - { since: since } - ); + const until = since === 24 ? Math.floor(Date.now() / 1000) : nHoursAgo(since / 2); - return { status: 'ok', notes: events }; + console.log('fetch events since: ', since); + console.log('fetch events until: ', until); + /* + const events = await ndk.fetchEvents({ + kinds: [1], + authors: db.account.network ?? db.account.follows, + since: since, + until: until, + }); + */ + + return { status: 'ok', data: [], nextCursor: since * 2 }; } catch (e) { console.error('failed get notes, error: ', e); - return { status: 'failed', message: e }; + return { status: 'failed', data: [], message: e }; } }; @@ -123,7 +122,7 @@ export function useNostr() { event.content = content; event.kind = kind; event.created_at = Math.floor(Date.now() / 1000); - event.pubkey = account.pubkey; + event.pubkey = db.account.pubkey; event.tags = tags; await event.sign(signer);