diff --git a/package.json b/package.json index c629b74..1f07580 100644 --- a/package.json +++ b/package.json @@ -15,20 +15,24 @@ "@tanstack/react-query": "^5.51.11", "@tanstack/react-router": "^1.45.8", "@tauri-apps/api": ">=2.0.0-beta.0", + "@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.5", + "@tauri-apps/plugin-dialog": "2.0.0-beta.7", + "@tauri-apps/plugin-os": "2.0.0-beta.7", "@tauri-apps/plugin-shell": ">=2.0.0-beta.0", "minidenticons": "^4.2.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "19.0.0-rc-d025ddd3-20240722", + "react-dom": "19.0.0-rc-d025ddd3-20240722", "virtua": "^0.33.3" }, "devDependencies": { "@biomejs/biome": "1.8.3", "@tanstack/router-plugin": "^1.45.8", "@tauri-apps/cli": ">=2.0.0-beta.0", - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react-dom@rc", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.19", + "babel-plugin-react-compiler": "0.0.0-experimental-696af53-20240625", "clsx": "^2.1.1", "postcss": "^8.4.39", "tailwind-merge": "^2.4.0", @@ -36,5 +40,9 @@ "typescript": "^5.2.2", "vite": "^5.3.1", "vite-tsconfig-paths": "^4.3.2" + }, + "overrides": { + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react-dom@rc" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5073c01..918f319 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,19 +10,28 @@ importers: dependencies: '@phosphor-icons/react': specifier: ^2.1.7 - version: 2.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 2.1.7(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722) '@radix-ui/react-avatar': specifier: ^1.1.0 - version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 1.1.0(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)(types-react-dom@19.0.0-rc.1)(types-react@19.0.0-rc.1) '@tanstack/react-query': specifier: ^5.51.11 - version: 5.51.11(react@18.3.1) + version: 5.51.11(react@19.0.0-rc-d025ddd3-20240722) '@tanstack/react-router': specifier: ^1.45.8 - version: 1.45.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 1.45.8(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722) '@tauri-apps/api': specifier: '>=2.0.0-beta.0' version: 2.0.0-beta.15 + '@tauri-apps/plugin-clipboard-manager': + specifier: 2.1.0-beta.5 + version: 2.1.0-beta.5 + '@tauri-apps/plugin-dialog': + specifier: 2.0.0-beta.7 + version: 2.0.0-beta.7 + '@tauri-apps/plugin-os': + specifier: 2.0.0-beta.7 + version: 2.0.0-beta.7 '@tauri-apps/plugin-shell': specifier: '>=2.0.0-beta.0' version: 2.0.0-beta.8 @@ -30,14 +39,14 @@ importers: specifier: ^4.2.1 version: 4.2.1 react: - specifier: ^18.2.0 - version: 18.3.1 + specifier: 19.0.0-rc-d025ddd3-20240722 + version: 19.0.0-rc-d025ddd3-20240722 react-dom: - specifier: ^18.2.0 - version: 18.3.1(react@18.3.1) + specifier: 19.0.0-rc-d025ddd3-20240722 + version: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) virtua: specifier: ^0.33.3 - version: 0.33.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 0.33.3(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722) devDependencies: '@biomejs/biome': specifier: 1.8.3 @@ -49,17 +58,20 @@ importers: specifier: '>=2.0.0-beta.0' version: 2.0.0-beta.22 '@types/react': - specifier: ^18.2.15 - version: 18.3.3 + specifier: npm:types-react@rc + version: types-react@19.0.0-rc.1 '@types/react-dom': - specifier: ^18.2.7 - version: 18.3.0 + specifier: npm:types-react-dom@rc + version: types-react-dom@19.0.0-rc.1 '@vitejs/plugin-react': specifier: ^4.2.1 version: 4.3.1(vite@5.3.4) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.39) + babel-plugin-react-compiler: + specifier: 0.0.0-experimental-696af53-20240625 + version: 0.0.0-experimental-696af53-20240625 clsx: specifier: ^2.1.1 version: 2.1.1 @@ -104,6 +116,9 @@ packages: resolution: {integrity: sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==} engines: {node: '>=6.9.0'} + '@babel/generator@7.2.0': + resolution: {integrity: sha512-BA75MVfRlFQG2EZgFYIwyT1r6xSkwfP2bdkY/kLZusEYWiJs4xCowab/alaEaT0wSvmVuXGqiefeBlP+7V1yKg==} + '@babel/generator@7.24.10': resolution: {integrity: sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg==} engines: {node: '>=6.9.0'} @@ -402,6 +417,10 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} + '@jest/types@24.9.0': + resolution: {integrity: sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==} + engines: {node: '>= 6'} + '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -710,6 +729,15 @@ packages: engines: {node: '>= 10'} hasBin: true + '@tauri-apps/plugin-clipboard-manager@2.1.0-beta.5': + resolution: {integrity: sha512-7YQEXRHXn5dIr/YcE7RtkoAhc6XwpqI7Qz0I3FcHn5vMbVvQ5OxKnGqEa8ZGRud6R3G9pNdnEKglLXLgUXK8tA==} + + '@tauri-apps/plugin-dialog@2.0.0-beta.7': + resolution: {integrity: sha512-myywwpsKbquDDzl5zaOmmLLv5O8EJ/GgHDAoVSPwO97R4iWzkDvj3HFF91tNh7i25Tu/bP6jYPAdZA1NCRxxtg==} + + '@tauri-apps/plugin-os@2.0.0-beta.7': + resolution: {integrity: sha512-CHo09ecxUU0NFkAqctXeQzdaXw02EXulqcaZnbjrBfRJ2ulmGq7zaUCsHihfcqWcdnmNwmP9Wh/gyznMc1JF9Q==} + '@tauri-apps/plugin-shell@2.0.0-beta.8': resolution: {integrity: sha512-rFXI6MvsCdSGbuKbDu/NaOePREb9YTVTdeugHdvvljnKWW3dvmThBb2h/8Hxj+Z7Cd8MUoRxPeJWUZbPbJ2Imw==} @@ -728,15 +756,27 @@ packages: '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + + '@types/istanbul-reports@1.1.2': + resolution: {integrity: sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==} + '@types/prop-types@15.7.12': resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} - '@types/react-dom@18.3.0': - resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} - '@types/react@18.3.3': resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@13.0.12': + resolution: {integrity: sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==} + '@vitejs/plugin-react@4.3.1': resolution: {integrity: sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -748,6 +788,10 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + ansi-regex@4.1.1: + resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} + engines: {node: '>=6'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -788,6 +832,9 @@ packages: babel-dead-code-elimination@1.0.6: resolution: {integrity: sha512-JxFi9qyRJpN0LjEbbjbN8g0ux71Qppn9R8Qe3k6QzHg2CaKsbUQtbn307LQGiDLGjV6JCtEFqfxzVig9MyDCHQ==} + babel-plugin-react-compiler@0.0.0-experimental-696af53-20240625: + resolution: {integrity: sha512-OUDKms8qmcm5bX0D+sJWC1YcKcd7AZ2aJ7eY6gkR+Xr7PDfkXLbqAld4Qs9B0ntjVbUMEtW/PjlQrxDtY4raHg==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -818,6 +865,10 @@ packages: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} + chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -951,10 +1002,17 @@ packages: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} + has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + invariant@2.2.4: + resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} + is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} @@ -1013,6 +1071,9 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -1148,20 +1209,27 @@ packages: engines: {node: '>=14'} hasBin: true + pretty-format@24.9.0: + resolution: {integrity: sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==} + engines: {node: '>= 6'} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} + react-dom@19.0.0-rc-d025ddd3-20240722: + resolution: {integrity: sha512-8/iAF8F5U5kkPg+UzDXcLUq/QKWN9ZDZy8GA8IuzIhW0AagEeZCWJQVl0uYLwZBqHFVQt+DQJ3oFwcjgELjykw==} peerDependencies: - react: ^18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 + + react-is@16.13.1: + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} react-refresh@0.14.2: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} + react@19.0.0-rc-d025ddd3-20240722: + resolution: {integrity: sha512-pZZ3zHponPdVhwgOoQoI7qoHh+Hn3GAVc+/g4LICRv/XZ0IEJPsPOehV/Iu8Ssl/DoruEO4EdeK6kTSmcaAo8A==} engines: {node: '>=0.10.0'} read-cache@1.0.0: @@ -1187,8 +1255,8 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} + scheduler@0.25.0-rc-d025ddd3-20240722: + resolution: {integrity: sha512-W+CjyTUXoOf/l6b2C9uWAFA696ib1s40vKoLnVQ7o34Cgi9t18mJ7ak4AiVsKBy4pibxZAlmAZJvlKr2ra2p0w==} semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} @@ -1210,6 +1278,10 @@ packages: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} + source-map@0.5.7: + resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} + engines: {node: '>=0.10.0'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -1235,6 +1307,10 @@ packages: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} + supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -1268,6 +1344,10 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + trim-right@1.0.1: + resolution: {integrity: sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==} + engines: {node: '>=0.10.0'} + ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} @@ -1281,6 +1361,12 @@ packages: typescript: optional: true + types-react-dom@19.0.0-rc.1: + resolution: {integrity: sha512-VSLZJl8VXCD0fAWp7DUTFUDCcZ8DVXOQmjhJMD03odgeFmu14ZQJHCXeETm3BEAhJqfgJaFkLnGkQv88sRx0fQ==} + + types-react@19.0.0-rc.1: + resolution: {integrity: sha512-RshndUfqTW6K3STLPis8BtAYCGOkMbtvYsi90gmVNDZBXUyUc5juf2PE9LfS/JmOlUIRO8cWTS/1MTnmhjDqyQ==} + typescript@5.5.4: resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} @@ -1388,6 +1474,12 @@ packages: engines: {node: '>= 14'} hasBin: true + zod-validation-error@2.1.0: + resolution: {integrity: sha512-VJh93e2wb4c3tWtGgTa0OF/dTt/zoPCPzXq4V11ZjxmEAFaPi/Zss1xIZdEB5RD8GD00U0/iVXgqkF77RV7pdQ==} + engines: {node: '>=18.0.0'} + peerDependencies: + zod: ^3.18.0 + zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} @@ -1427,6 +1519,14 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/generator@7.2.0': + dependencies: + '@babel/types': 7.24.9 + jsesc: 2.5.2 + lodash: 4.17.21 + source-map: 0.5.7 + trim-right: 1.0.1 + '@babel/generator@7.24.10': dependencies: '@babel/types': 7.24.9 @@ -1668,6 +1768,12 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 + '@jest/types@24.9.0': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 1.1.2 + '@types/yargs': 13.0.12 + '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -1697,65 +1803,65 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@phosphor-icons/react@2.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@phosphor-icons/react@2.1.7(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)': dependencies: - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) + react: 19.0.0-rc-d025ddd3-20240722 + react-dom: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) '@pkgjs/parseargs@0.11.0': optional: true - '@radix-ui/react-avatar@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-avatar@1.1.0(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)(types-react-dom@19.0.0-rc.1)(types-react@19.0.0-rc.1)': dependencies: - '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) + '@radix-ui/react-context': 1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1) + '@radix-ui/react-primitive': 2.0.0(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)(types-react-dom@19.0.0-rc.1)(types-react@19.0.0-rc.1) + '@radix-ui/react-use-callback-ref': 1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1) + '@radix-ui/react-use-layout-effect': 1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1) + react: 19.0.0-rc-d025ddd3-20240722 + react-dom: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 + '@types/react': types-react@19.0.0-rc.1 + '@types/react-dom': types-react-dom@19.0.0-rc.1 - '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.3)(react@18.3.1)': + '@radix-ui/react-compose-refs@1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1)': dependencies: - react: 18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 optionalDependencies: - '@types/react': 18.3.3 + '@types/react': types-react@19.0.0-rc.1 - '@radix-ui/react-context@1.1.0(@types/react@18.3.3)(react@18.3.1)': + '@radix-ui/react-context@1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1)': dependencies: - react: 18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 optionalDependencies: - '@types/react': 18.3.3 + '@types/react': types-react@19.0.0-rc.1 - '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-primitive@2.0.0(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)(types-react-dom@19.0.0-rc.1)(types-react@19.0.0-rc.1)': dependencies: - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1) + react: 19.0.0-rc-d025ddd3-20240722 + react-dom: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) optionalDependencies: - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 + '@types/react': types-react@19.0.0-rc.1 + '@types/react-dom': types-react-dom@19.0.0-rc.1 - '@radix-ui/react-slot@1.1.0(@types/react@18.3.3)(react@18.3.1)': + '@radix-ui/react-slot@1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1)': dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - react: 18.3.1 + '@radix-ui/react-compose-refs': 1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1) + react: 19.0.0-rc-d025ddd3-20240722 optionalDependencies: - '@types/react': 18.3.3 + '@types/react': types-react@19.0.0-rc.1 - '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.3)(react@18.3.1)': + '@radix-ui/react-use-callback-ref@1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1)': dependencies: - react: 18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 optionalDependencies: - '@types/react': 18.3.3 + '@types/react': types-react@19.0.0-rc.1 - '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.3)(react@18.3.1)': + '@radix-ui/react-use-layout-effect@1.1.0(react@19.0.0-rc-d025ddd3-20240722)(types-react@19.0.0-rc.1)': dependencies: - react: 18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 optionalDependencies: - '@types/react': 18.3.3 + '@types/react': types-react@19.0.0-rc.1 '@rollup/rollup-android-arm-eabi@4.19.0': optional: true @@ -1809,26 +1915,26 @@ snapshots: '@tanstack/query-core@5.51.9': {} - '@tanstack/react-query@5.51.11(react@18.3.1)': + '@tanstack/react-query@5.51.11(react@19.0.0-rc-d025ddd3-20240722)': dependencies: '@tanstack/query-core': 5.51.9 - react: 18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 - '@tanstack/react-router@1.45.8(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@tanstack/react-router@1.45.8(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)': dependencies: '@tanstack/history': 1.45.3 - '@tanstack/react-store': 0.5.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) + '@tanstack/react-store': 0.5.5(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722) + react: 19.0.0-rc-d025ddd3-20240722 + react-dom: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) tiny-invariant: 1.3.3 tiny-warning: 1.0.3 - '@tanstack/react-store@0.5.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@tanstack/react-store@0.5.5(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722)': dependencies: '@tanstack/store': 0.5.5 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - use-sync-external-store: 1.2.2(react@18.3.1) + react: 19.0.0-rc-d025ddd3-20240722 + react-dom: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) + use-sync-external-store: 1.2.2(react@19.0.0-rc-d025ddd3-20240722) '@tanstack/router-generator@1.45.7': dependencies: @@ -1906,6 +2012,18 @@ snapshots: '@tauri-apps/cli-win32-ia32-msvc': 2.0.0-beta.22 '@tauri-apps/cli-win32-x64-msvc': 2.0.0-beta.22 + '@tauri-apps/plugin-clipboard-manager@2.1.0-beta.5': + dependencies: + '@tauri-apps/api': 2.0.0-beta.15 + + '@tauri-apps/plugin-dialog@2.0.0-beta.7': + dependencies: + '@tauri-apps/api': 2.0.0-beta.15 + + '@tauri-apps/plugin-os@2.0.0-beta.7': + dependencies: + '@tauri-apps/api': 2.0.0-beta.15 + '@tauri-apps/plugin-shell@2.0.0-beta.8': dependencies: '@tauri-apps/api': 2.0.0-beta.15 @@ -1933,17 +2051,30 @@ snapshots: '@types/estree@1.0.5': {} - '@types/prop-types@15.7.12': {} + '@types/istanbul-lib-coverage@2.0.6': {} - '@types/react-dom@18.3.0': + '@types/istanbul-lib-report@3.0.3': dependencies: - '@types/react': 18.3.3 + '@types/istanbul-lib-coverage': 2.0.6 + + '@types/istanbul-reports@1.1.2': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-lib-report': 3.0.3 + + '@types/prop-types@15.7.12': {} '@types/react@18.3.3': dependencies: '@types/prop-types': 15.7.12 csstype: 3.1.3 + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@13.0.12': + dependencies: + '@types/yargs-parser': 21.0.3 + '@vitejs/plugin-react@4.3.1(vite@5.3.4)': dependencies: '@babel/core': 7.24.9 @@ -1957,6 +2088,8 @@ snapshots: acorn@8.12.1: {} + ansi-regex@4.1.1: {} + ansi-regex@5.0.1: {} ansi-regex@6.0.1: {} @@ -1999,6 +2132,16 @@ snapshots: transitivePeerDependencies: - supports-color + babel-plugin-react-compiler@0.0.0-experimental-696af53-20240625: + dependencies: + '@babel/generator': 7.2.0 + '@babel/types': 7.24.9 + chalk: 4.1.2 + invariant: 2.2.4 + pretty-format: 24.9.0 + zod: 3.23.8 + zod-validation-error: 2.1.0(zod@3.23.8) + balanced-match@1.0.2: {} binary-extensions@2.3.0: {} @@ -2028,6 +2171,11 @@ snapshots: escape-string-regexp: 1.0.5 supports-color: 5.5.0 + chalk@4.1.2: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + chokidar@3.6.0: dependencies: anymatch: 3.1.3 @@ -2167,10 +2315,16 @@ snapshots: has-flag@3.0.0: {} + has-flag@4.0.0: {} + hasown@2.0.2: dependencies: function-bind: 1.1.2 + invariant@2.2.4: + dependencies: + loose-envify: 1.4.0 + is-binary-path@2.1.0: dependencies: binary-extensions: 2.3.0 @@ -2211,6 +2365,8 @@ snapshots: lines-and-columns@1.2.4: {} + lodash@4.17.21: {} + loose-envify@1.4.0: dependencies: js-tokens: 4.0.0 @@ -2314,19 +2470,25 @@ snapshots: prettier@3.3.3: {} + pretty-format@24.9.0: + dependencies: + '@jest/types': 24.9.0 + ansi-regex: 4.1.1 + ansi-styles: 3.2.1 + react-is: 16.13.1 + queue-microtask@1.2.3: {} - react-dom@18.3.1(react@18.3.1): + react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722): dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 + react: 19.0.0-rc-d025ddd3-20240722 + scheduler: 0.25.0-rc-d025ddd3-20240722 + + react-is@16.13.1: {} react-refresh@0.14.2: {} - react@18.3.1: - dependencies: - loose-envify: 1.4.0 + react@19.0.0-rc-d025ddd3-20240722: {} read-cache@1.0.0: dependencies: @@ -2370,9 +2532,7 @@ snapshots: dependencies: queue-microtask: 1.2.3 - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 + scheduler@0.25.0-rc-d025ddd3-20240722: {} semver@6.3.1: {} @@ -2386,6 +2546,8 @@ snapshots: source-map-js@1.2.0: {} + source-map@0.5.7: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -2420,6 +2582,10 @@ snapshots: dependencies: has-flag: 3.0.0 + supports-color@7.2.0: + dependencies: + has-flag: 4.0.0 + supports-preserve-symlinks-flag@1.0.0: {} tailwind-merge@2.4.0: {} @@ -2469,12 +2635,22 @@ snapshots: dependencies: is-number: 7.0.0 + trim-right@1.0.1: {} + ts-interface-checker@0.1.13: {} tsconfck@3.1.1(typescript@5.5.4): optionalDependencies: typescript: 5.5.4 + types-react-dom@19.0.0-rc.1: + dependencies: + '@types/react': 18.3.3 + + types-react@19.0.0-rc.1: + dependencies: + csstype: 3.1.3 + typescript@5.5.4: {} unplugin@1.11.0: @@ -2490,16 +2666,16 @@ snapshots: escalade: 3.1.2 picocolors: 1.0.1 - use-sync-external-store@1.2.2(react@18.3.1): + use-sync-external-store@1.2.2(react@19.0.0-rc-d025ddd3-20240722): dependencies: - react: 18.3.1 + react: 19.0.0-rc-d025ddd3-20240722 util-deprecate@1.0.2: {} - virtua@0.33.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + virtua@0.33.3(react-dom@19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722))(react@19.0.0-rc-d025ddd3-20240722): optionalDependencies: - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) + react: 19.0.0-rc-d025ddd3-20240722 + react-dom: 19.0.0-rc-d025ddd3-20240722(react@19.0.0-rc-d025ddd3-20240722) vite-tsconfig-paths@4.3.2(typescript@5.5.4)(vite@5.3.4): dependencies: @@ -2544,4 +2720,8 @@ snapshots: yaml@2.4.5: {} + zod-validation-error@2.1.0(zod@3.23.8): + dependencies: + zod: 3.23.8 + zod@3.23.8: {} diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index c3ac00d..20f8f86 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" + [[package]] name = "addr2line" version = "0.22.0" @@ -101,6 +107,41 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[package]] +name = "arboard" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" +dependencies = [ + "clipboard-win", + "core-graphics", + "image", + "log", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "parking_lot", + "windows-sys 0.48.0", + "x11rb", +] + +[[package]] +name = "ashpd" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd884d7c72877a94102c3715f3b1cd09ff4fac28221add3e57cfbe25c236d093" +dependencies = [ + "enumflags2", + "futures-channel", + "futures-util", + "rand 0.8.5", + "serde", + "serde_repr", + "tokio", + "url", + "zbus", +] + [[package]] name = "async-broadcast" version = "0.7.1" @@ -534,6 +575,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.6.1" @@ -712,6 +759,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + [[package]] name = "cocoa" version = "0.25.0" @@ -787,10 +843,15 @@ dependencies = [ "nostr-sdk", "serde", "serde_json", + "specta", "tauri", "tauri-build", + "tauri-plugin-clipboard-manager", "tauri-plugin-decorum", + "tauri-plugin-dialog", + "tauri-plugin-os", "tauri-plugin-shell", + "tauri-specta", ] [[package]] @@ -1187,6 +1248,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "error-code" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" + [[package]] name = "event-listener" version = "5.3.1" @@ -1550,6 +1617,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -1991,6 +2068,19 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "image" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +dependencies = [ + "bytemuck", + "byteorder-lite", + "num-traits", + "png", + "tiff", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -2013,6 +2103,12 @@ dependencies = [ "serde", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "infer" version = "0.15.0" @@ -2135,6 +2231,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jpeg-decoder" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" + [[package]] name = "js-sys" version = "0.3.69" @@ -2948,6 +3050,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_info" +version = "3.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" +dependencies = [ + "log", + "serde", + "windows-sys 0.52.0", +] + [[package]] name = "os_pipe" version = "1.2.0" @@ -3029,6 +3142,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "pathdiff" version = "0.2.1" @@ -3639,6 +3758,30 @@ dependencies = [ "winreg", ] +[[package]] +name = "rfd" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a73a7337fc24366edfca76ec521f51877b114e42dab584008209cca6719251" +dependencies = [ + "ashpd", + "block", + "dispatch", + "glib-sys", + "gobject-sys", + "gtk-sys", + "js-sys", + "log", + "objc", + "objc-foundation", + "objc_id", + "raw-window-handle 0.6.2", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-sys 0.48.0", +] + [[package]] name = "ring" version = "0.17.8" @@ -4205,6 +4348,31 @@ dependencies = [ "system-deps", ] +[[package]] +name = "specta" +version = "2.0.0-rc.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3624a07cbde326fdf1ec37cbd39d06a224660fa0199b7db7316f2349583df981" +dependencies = [ + "once_cell", + "paste", + "serde", + "specta-macros", + "thiserror", +] + +[[package]] +name = "specta-macros" +version = "2.0.0-rc.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef33e9678ae36993fcbfc46aa29568ef10d32fd54428808759c6a450998c43ec" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "spin" version = "0.9.8" @@ -4309,6 +4477,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "sys-locale" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" +dependencies = [ + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -4410,6 +4587,7 @@ dependencies = [ "serde_json", "serde_repr", "serialize-to-javascript", + "specta", "state", "swift-rs", "tauri-build", @@ -4508,6 +4686,21 @@ dependencies = [ "walkdir", ] +[[package]] +name = "tauri-plugin-clipboard-manager" +version = "2.0.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8cf4b7fde295126b30b8279aa2addedda7689027a6a7fc4cdf9bea43a86ad84" +dependencies = [ + "arboard", + "log", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "thiserror", +] + [[package]] name = "tauri-plugin-decorum" version = "0.1.5" @@ -4524,6 +4717,61 @@ dependencies = [ "tauri-plugin", ] +[[package]] +name = "tauri-plugin-dialog" +version = "2.0.0-beta.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8860dd73c96969eb14813f9f04d8665f2853342670456fb6619d637137ef0d09" +dependencies = [ + "dunce", + "log", + "raw-window-handle 0.6.2", + "rfd", + "serde", + "serde_json", + "tauri", + "tauri-plugin", + "tauri-plugin-fs", + "thiserror", +] + +[[package]] +name = "tauri-plugin-fs" +version = "2.0.0-beta.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "461853268fe115ca19ee21e5986d505944f0b826048fe1bd726d74753fdf1df6" +dependencies = [ + "anyhow", + "glob", + "schemars", + "serde", + "serde_json", + "serde_repr", + "tauri", + "tauri-plugin", + "thiserror", + "url", + "uuid", +] + +[[package]] +name = "tauri-plugin-os" +version = "2.0.0-beta.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79a0466f11f45fd3f640a17b5ba5e34c62912c9b391141c818155125ae9f0917" +dependencies = [ + "gethostname", + "log", + "os_info", + "serde", + "serde_json", + "serialize-to-javascript", + "sys-locale", + "tauri", + "tauri-plugin", + "thiserror", +] + [[package]] name = "tauri-plugin-shell" version = "2.0.0-beta.9" @@ -4588,6 +4836,32 @@ dependencies = [ "wry", ] +[[package]] +name = "tauri-specta" +version = "2.0.0-rc.11" +source = "git+https://github.com/reyamir/tauri-specta?branch=feat/tauri-v2#5c09319b345814bfce3c4c02527e481d18339051" +dependencies = [ + "heck 0.5.0", + "indoc", + "serde", + "serde_json", + "specta", + "tauri", + "tauri-specta-macros", + "thiserror", +] + +[[package]] +name = "tauri-specta-macros" +version = "2.0.0-rc.5" +source = "git+https://github.com/reyamir/tauri-specta?branch=feat/tauri-v2#5c09319b345814bfce3c4c02527e481d18339051" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "tauri-utils" version = "2.0.0-beta.19" @@ -4692,6 +4966,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tiff" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + [[package]] name = "time" version = "0.3.36" @@ -4750,8 +5035,10 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", + "tracing", "windows-sys 0.48.0", ] @@ -5428,6 +5715,12 @@ dependencies = [ "windows-core 0.57.0", ] +[[package]] +name = "weezl" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" + [[package]] name = "winapi" version = "0.3.9" @@ -5858,6 +6151,23 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +dependencies = [ + "gethostname", + "rustix", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" + [[package]] name = "xdg-home" version = "1.2.0" @@ -5898,6 +6208,7 @@ dependencies = [ "serde_repr", "sha1", "static_assertions", + "tokio", "tracing", "uds_windows", "windows-sys 0.52.0", @@ -5968,6 +6279,7 @@ dependencies = [ "enumflags2", "serde", "static_assertions", + "url", "zvariant_derive", ] diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ad23088..379cc8d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -17,6 +17,12 @@ tauri = { version = "2.0.0-beta", features = [ "macos-private-api", "protocol-asset", ] } +tauri-specta = { git = "https://github.com/reyamir/tauri-specta", branch = "feat/tauri-v2", features = [ + "typescript", +] } +tauri-plugin-os = "2.0.0-beta" +tauri-plugin-clipboard-manager = "2.0.0-beta" +tauri-plugin-dialog = "2.0.0-beta" tauri-plugin-shell = "2.0.0-beta" tauri-plugin-decorum = "0.1.5" serde = { version = "1", features = ["derive"] } @@ -28,6 +34,7 @@ keyring = { version = "3", features = [ ] } keyring-search = "1.2.0" itertools = "0.13.0" +specta = "^2.0.0-rc.12" [target.'cfg(target_os = "macos")'.dependencies] border = { git = "https://github.com/ahkohd/tauri-toolkit", branch = "v2" } diff --git a/src-tauri/src/commands/account.rs b/src-tauri/src/commands/account.rs index 678fcbe..987fcbc 100644 --- a/src-tauri/src/commands/account.rs +++ b/src-tauri/src/commands/account.rs @@ -3,11 +3,12 @@ use keyring::Entry; use keyring_search::{Limit, List, Search}; use nostr_sdk::prelude::*; use std::{collections::HashSet, str::FromStr}; -use tauri::State; +use tauri::{Manager, State}; use crate::Nostr; #[tauri::command] +#[specta::specta] pub fn get_accounts() -> Vec { let search = Search::new().expect("Unexpected."); let results = search.by_user("nostr_secret"); @@ -19,6 +20,7 @@ pub fn get_accounts() -> Vec { } #[tauri::command] +#[specta::specta] pub async fn get_profile(id: String, state: State<'_, Nostr>) -> Result { let client = &state.client; let public_key = PublicKey::from_str(&id).unwrap(); @@ -34,7 +36,12 @@ pub async fn get_profile(id: String, state: State<'_, Nostr>) -> Result) -> Result<(), String> { +#[specta::specta] +pub async fn login( + id: String, + state: State<'_, Nostr>, + handle: tauri::AppHandle, +) -> Result<(), String> { let client = &state.client; let keyring = Entry::new(&id, "nostr_secret").expect("Unexpected."); @@ -50,7 +57,6 @@ pub async fn login(id: String, state: State<'_, Nostr>) -> Result<(), String> { client.set_signer(Some(signer)).await; let public_key = PublicKey::from_str(&id).unwrap(); - let incoming = Filter::new().kind(Kind::GiftWrap).pubkey(public_key); let inbox = Filter::new().kind(Kind::Custom(10050)).author(public_key).limit(1); if let Ok(events) = client.get_events_of(vec![inbox], None).await { @@ -67,34 +73,43 @@ pub async fn login(id: String, state: State<'_, Nostr>) -> Result<(), String> { } } - if let Ok(report) = client.reconcile(incoming.clone(), NegentropyOptions::default()).await { - let receives = report.received.clone(); - let ids = receives.into_iter().collect::>(); + tauri::async_runtime::spawn(async move { + let window = handle.get_webview_window("main").unwrap(); + let state = window.state::(); + let client = &state.client; - if let Ok(events) = client.database().query(vec![Filter::new().ids(ids)], Order::Desc).await - { - let pubkeys = events - .into_iter() - .unique_by(|ev| ev.pubkey) - .map(|ev| ev.pubkey) - .collect::>(); + let incoming = Filter::new().kind(Kind::GiftWrap).pubkey(public_key); - if client - .reconcile( - Filter::new().kind(Kind::GiftWrap).pubkeys(pubkeys), - NegentropyOptions::default(), - ) - .await - .is_ok() + if let Ok(report) = client.reconcile(incoming.clone(), NegentropyOptions::default()).await { + let receives = report.received.clone(); + let ids = receives.into_iter().collect::>(); + + if let Ok(events) = + client.database().query(vec![Filter::new().ids(ids)], Order::Desc).await { - println!("Sync done.") + let pubkeys = events + .into_iter() + .unique_by(|ev| ev.pubkey) + .map(|ev| ev.pubkey) + .collect::>(); + + if client + .reconcile( + Filter::new().kind(Kind::GiftWrap).pubkeys(pubkeys), + NegentropyOptions::default(), + ) + .await + .is_ok() + { + println!("Sync done.") + } } } - } - if client.subscribe(vec![incoming.limit(0)], None).await.is_ok() { - println!("Waiting for new message...") - } + if client.subscribe(vec![incoming.limit(0)], None).await.is_ok() { + println!("Waiting for new message...") + } + }); Ok(()) } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index b76e60e..c05e1f3 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -19,6 +19,20 @@ pub struct Nostr { } fn main() { + let mut ctx = tauri::generate_context!(); + let invoke_handler = { + let builder = tauri_specta::ts::builder().commands(tauri_specta::collect_commands![ + get_accounts, + login, + get_profile + ]); + + #[cfg(debug_assertions)] + let builder = builder.path("../src/commands.ts"); + + builder.build().unwrap() + }; + tauri::Builder::default() .setup(|app| { #[cfg(not(target_os = "linux"))] @@ -58,9 +72,13 @@ fn main() { Ok(()) }) + .enable_macos_default_menu(false) + .plugin(tauri_plugin_os::init()) + .plugin(tauri_plugin_clipboard_manager::init()) + .plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_decorum::init()) .plugin(tauri_plugin_shell::init()) - .invoke_handler(tauri::generate_handler![login, get_accounts, get_profile]) - .run(tauri::generate_context!()) + .invoke_handler(invoke_handler) + .run(ctx) .expect("error while running tauri application"); } diff --git a/src/commands.ts b/src/commands.ts new file mode 100644 index 0000000..54efebb --- /dev/null +++ b/src/commands.ts @@ -0,0 +1,97 @@ + + // This file was generated by [tauri-specta](https://github.com/oscartbeaumont/tauri-specta). Do not edit this file manually. + + /** user-defined commands **/ + + export const commands = { +async getAccounts() : Promise { +return await TAURI_INVOKE("get_accounts"); +}, +async login(id: string) : Promise> { +try { + return { status: "ok", data: await TAURI_INVOKE("login", { id }) }; +} catch (e) { + if(e instanceof Error) throw e; + else return { status: "error", error: e as any }; +} +}, +async getProfile(id: string) : Promise> { +try { + return { status: "ok", data: await TAURI_INVOKE("get_profile", { id }) }; +} catch (e) { + if(e instanceof Error) throw e; + else return { status: "error", error: e as any }; +} +} +} + + /** user-defined events **/ + + + + /** user-defined statics **/ + + + +/** user-defined types **/ + + + +/** tauri-specta globals **/ + + import { invoke as TAURI_INVOKE } from "@tauri-apps/api/core"; +import * as TAURI_API_EVENT from "@tauri-apps/api/event"; +import { type WebviewWindow as __WebviewWindow__ } from "@tauri-apps/api/webviewWindow"; + +type __EventObj__ = { + listen: ( + cb: TAURI_API_EVENT.EventCallback + ) => ReturnType>; + once: ( + cb: TAURI_API_EVENT.EventCallback + ) => ReturnType>; + emit: T extends null + ? (payload?: T) => ReturnType + : (payload: T) => ReturnType; +}; + +export type Result = + | { status: "ok"; data: T } + | { status: "error"; error: E }; + +function __makeEvents__>( + mappings: Record +) { + return new Proxy( + {} as unknown as { + [K in keyof T]: __EventObj__ & { + (handle: __WebviewWindow__): __EventObj__; + }; + }, + { + get: (_, event) => { + const name = mappings[event as keyof T]; + + return new Proxy((() => {}) as any, { + apply: (_, __, [window]: [__WebviewWindow__]) => ({ + listen: (arg: any) => window.listen(name, arg), + once: (arg: any) => window.once(name, arg), + emit: (arg: any) => window.emit(name, arg), + }), + get: (_, command: keyof __EventObj__) => { + switch (command) { + case "listen": + return (arg: any) => TAURI_API_EVENT.listen(name, arg); + case "once": + return (arg: any) => TAURI_API_EVENT.once(name, arg); + case "emit": + return (arg: any) => TAURI_API_EVENT.emit(name, arg); + } + }, + }); + }, + } + ); +} + + \ No newline at end of file diff --git a/src/components/frame.tsx b/src/components/frame.tsx new file mode 100644 index 0000000..d5b7b10 --- /dev/null +++ b/src/components/frame.tsx @@ -0,0 +1,27 @@ +import { cn } from "@/commons"; +import { useRouteContext } from "@tanstack/react-router"; +import type { ReactNode } from "react"; + +export function Frame({ + children, + shadow, + className, +}: { children: ReactNode; shadow?: boolean; className?: string }) { + const { platform } = useRouteContext({ strict: false }); + + return ( +
+ {children} +
+ ); +} diff --git a/src/components/user/avatar.tsx b/src/components/user/avatar.tsx index 9c4e5bd..3119164 100644 --- a/src/components/user/avatar.tsx +++ b/src/components/user/avatar.tsx @@ -22,7 +22,7 @@ export function UserAvatar({ className }: { className?: string }) { )} > - {prefix} - {user.profile?.display_name || - user.profile?.name || - npub(user.pubkey, 16)} + {user.profile?.display_name || user.profile?.name || "Anon"} ); } diff --git a/src/main.tsx b/src/main.tsx index 180d554..9033004 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,4 +1,5 @@ import { RouterProvider, createRouter } from "@tanstack/react-router"; +import { type } from "@tauri-apps/plugin-os"; import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; import "./app.css"; @@ -9,10 +10,12 @@ import { routeTree } from "./routes.gen"; // Create a new router instance const queryClient = new QueryClient(); +const platform = type(); const router = createRouter({ routeTree, context: { queryClient, + platform, }, }); diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index fb5f5ae..d48cfd4 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -1,10 +1,30 @@ +import { cn } from "@/commons"; import type { QueryClient } from "@tanstack/react-query"; import { Outlet, createRootRouteWithContext } from "@tanstack/react-router"; +import type { OsType } from "@tauri-apps/plugin-os"; interface RouterContext { queryClient: QueryClient; + platform: OsType; } export const Route = createRootRouteWithContext()({ - component: () => , + component: RootComponent, }); + +function RootComponent() { + const { platform } = Route.useRouteContext(); + + return ( +
+ +
+ ); +} diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 61e2d30..47f33ad 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,14 +1,16 @@ +import { commands } from "@/commands"; import { npub } from "@/commons"; +import { Frame } from "@/components/frame"; import { Spinner } from "@/components/spinner"; import { User } from "@/components/user"; import { Plus } from "@phosphor-icons/react"; import { Link, createFileRoute, redirect } from "@tanstack/react-router"; -import { invoke } from "@tauri-apps/api/core"; -import { useMemo, useState } from "react"; +import { message } from "@tauri-apps/plugin-dialog"; +import { useMemo, useState, useTransition } from "react"; export const Route = createFileRoute("/")({ beforeLoad: async () => { - const accounts: string[] = await invoke("get_accounts"); + const accounts = await commands.getAccounts(); if (!accounts.length) { throw redirect({ @@ -36,24 +38,28 @@ function Screen() { [], ); - const [loading, setLoading] = useState({ npub: "", status: false }); + const [value, setValue] = useState(""); + const [isPending, startTransition] = useTransition(); - const login = async (npub: string) => { - try { - setLoading({ npub, status: true }); + const loginWith = async (npub: string) => { + setValue(npub); + startTransition(async () => { + const run = await commands.login(npub); - const status = await invoke("login", { id: npub }); - - if (status) { - return navigate({ + if (run.status === "ok") { + navigate({ to: "/$account/chats", params: { account: npub }, replace: true, }); + } else { + setValue(""); + await message(run.error, { + title: "Login", + kind: "error", + }); } - } catch (e) { - setLoading({ npub: "", status: false }); - } + }); }; return ( @@ -65,12 +71,15 @@ function Screen() {

Welcome back!

-
+ {context.accounts.map((account) => (
login(account)} - onKeyDown={() => login(account)} + onClick={() => loginWith(account)} + onKeyDown={() => loginWith(account)} className="flex items-center justify-between hover:bg-black/5 dark:hover:bg-white/5" > @@ -85,9 +94,7 @@ function Screen() {
- {loading.npub === account && loading.status ? ( - - ) : null} + {value === account && isPending ? : null}
))} @@ -99,12 +106,12 @@ function Screen() {
- + Add an account
- + ); diff --git a/vite.config.ts b/vite.config.ts index 00a70cd..2179043 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,9 +3,21 @@ import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; +const ReactCompilerConfig = { + /* ... */ +}; + // https://vitejs.dev/config/ export default defineConfig(async () => ({ - plugins: [TanStackRouterVite(), tsconfigPaths(), react()], + plugins: [ + TanStackRouterVite(), + tsconfigPaths(), + react({ + babel: { + plugins: [["babel-plugin-react-compiler", ReactCompilerConfig]], + }, + }), + ], // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` //