diff --git a/package.json b/package.json index 0741fef..7549225 100644 --- a/package.json +++ b/package.json @@ -23,13 +23,13 @@ "@ucanto/core": "^9.0.0", "@ucanto/interface": "^9.0.0", "@ucanto/transport": "^9.0.0", - "@w3ui/react": "^2.3.0", + "@w3ui/react": "^2.4.0", "@web3-storage/access": "^19.0.0", "@web3-storage/capabilities": "^17.1.0", "@web3-storage/content-claims": "^3.2.1", "@web3-storage/data-segment": "^5.0.0", "@web3-storage/did-mailto": "^2.1.0", - "@web3-storage/w3up-client": "^13.1.1", + "@web3-storage/w3up-client": "^16.2.0", "archy": "^1.0.0", "ariakit-utils": "0.17.0-next.27", "blueimp-md5": "^2.19.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3ac8a8d..dd80e0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ importers: specifier: ^9.0.0 version: 9.0.0 '@w3ui/react': - specifier: ^2.3.0 - version: 2.3.0(@types/react@18.2.42)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + specifier: ^2.4.0 + version: 2.4.0(@types/react@18.2.42)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@web3-storage/access': specifier: ^19.0.0 version: 19.0.0 @@ -54,8 +54,8 @@ importers: specifier: ^2.1.0 version: 2.1.0 '@web3-storage/w3up-client': - specifier: ^13.1.1 - version: 13.1.1(encoding@0.1.13) + specifier: ^16.2.0 + version: 16.2.0(encoding@0.1.13) archy: specifier: ^1.0.0 version: 1.0.0 @@ -437,14 +437,14 @@ packages: resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} engines: {node: '>=14'} - '@floating-ui/core@1.6.2': - resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==} + '@floating-ui/core@1.6.8': + resolution: {integrity: sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==} - '@floating-ui/dom@1.6.5': - resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==} + '@floating-ui/dom@1.6.11': + resolution: {integrity: sha512-qkMCxSR24v2vGkhYDo/UzxfJN3D4syqSjyuTFz6C7XcpU1pASPRieNI0Kj5VP3/503mOfYiGY891ugBX1GlABQ==} - '@floating-ui/utils@0.2.2': - resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} + '@floating-ui/utils@0.2.8': + resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} '@headlessui/react@1.7.17': resolution: {integrity: sha512-4am+tzvkqDSSgiwrsEpGWqgGo9dz8qU5M3znCkC4PgkpY4HcCZzEDEvozltGGGHIKl9jbXbZPSH5TWn4sWJdow==} @@ -490,6 +490,10 @@ packages: resolution: {integrity: sha512-N14oMy0q4gM6OuZkIpisKe0JBSjf1Jb39VI+7jMLiWX9124u1Z3Fdj/Tag1NA0cVxxqWDh0CqsjcVfOKtelPDA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} + '@ipld/dag-cbor@9.2.1': + resolution: {integrity: sha512-nyY48yE7r3dnJVlxrdaimrbloh4RokQaNRdI//btfTkcTEZbpmSrbYcBQ4VKTf8ZxXAOUJy4VsRpkJo+y9RTnA==} + engines: {node: '>=16.0.0', npm: '>=7.0.0'} + '@ipld/dag-json@10.2.2': resolution: {integrity: sha512-NnU8HdHKwAoGyrW3S09NMa8aZw0tImLRyR64hoafpLpDpAbA9g1+fb24JsdlugbL4sXUQVwDVA+qK4Ud8V83lA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -683,6 +687,13 @@ packages: '@sinclair/typebox@0.25.24': resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} + '@storacha/one-webcrypto@1.0.1': + resolution: {integrity: sha512-bD+vWmcgsEBqU0Dz04BR43SA03bBoLTAY29vaKasY9Oe8cb6XIP0/vkm0OS2UwKC13c8uRgFW4rjJUgDCNLejQ==} + + '@storacha/one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/9e029e2fd477bd95bb80abd3553bbac704ccc7a6': + resolution: {tarball: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/9e029e2fd477bd95bb80abd3553bbac704ccc7a6} + version: 1.0.1 + '@swc/helpers@0.5.2': resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} @@ -738,12 +749,12 @@ packages: '@types/node@20.10.4': resolution: {integrity: sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==} - '@types/node@20.12.12': - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} - '@types/node@20.14.9': resolution: {integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==} + '@types/node@22.5.5': + resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} + '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -898,11 +909,11 @@ packages: '@vercel/static-config@3.0.0': resolution: {integrity: sha512-2qtvcBJ1bGY0dYGYh3iM7yGKkk971FujLEDXzuW5wcZsPr1GSEjO/w2iSr3qve6nDDtBImsGoDEnus5FI4+fIw==} - '@w3ui/core@2.2.0': - resolution: {integrity: sha512-nIPlt658jplWMl6ymbgFJcn4gJV3vcj7bOm5NChlc64lzRpVfmamWd30yTkYWJ6CQeHYLoEwqmmnfjkXbUTfdg==} + '@w3ui/core@2.3.1': + resolution: {integrity: sha512-nA2RkJBavJsy93TdZUjvOQJruWlalT4DJsOo3YYEt9X2iGtdFJTluVcFy4TXJCo4cnw3y7hzkE1YtE+o0vu6Yw==} - '@w3ui/react@2.3.0': - resolution: {integrity: sha512-P3yC76zyq2au4odHITQ3gz5Y5zhrLFKQsVfT3OScidJCsKQkaG6RAYIkfwxRoXAKRAxuZyNiwtd4zoONTgRW8g==} + '@w3ui/react@2.4.0': + resolution: {integrity: sha512-78ZZvkoCyG9MudzK70uj1mOGuw8AtHUEZX3LIa2wVsW2FCiwOr4Oywk6fmXpGx5cHQ4mz5sAoQj71aA4tyZ4NQ==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -925,18 +936,25 @@ packages: '@web-std/stream@1.0.3': resolution: {integrity: sha512-5MIngxWyq4rQiGoDAC2WhjLuDraW8+ff2LD2et4NRY933K3gL8CHlUXrh8ZZ3dC9A9Xaub8c9sl5exOJE58D9Q==} - '@web3-storage/access@18.4.0': - resolution: {integrity: sha512-EQQxSCip9FNgiNGwpKTnpff7/5A6MSn/Etf1Xpei3Au2oQkUe25DHwRJd/mbUzjnhcYh6UMGk2f0dIJ4Me00LA==} - '@web3-storage/access@19.0.0': resolution: {integrity: sha512-n+d+aoGPGhx70zEI7AKxJ1MD+esanTaXOomfasYGmmIWVqy85pCxC4CInM89qI/oY5BWPAcIAs6s+7mikYVceA==} + '@web3-storage/access@20.0.1': + resolution: {integrity: sha512-JlCTp1BlFmxrxpkkLo73tytHIv7J+l8++dP5ghYk5oEo2Om3mUq+T3KkkkjZ8d3omoWam6tGiTQXbc/awHJjDw==} + + '@web3-storage/blob-index@1.0.4': + resolution: {integrity: sha512-04+PrmVHFT+xzRhyIPdcvGc8Y2NDffUe8R1gJOyErVzEVz5N1I9Q/BrlFHYt/A4HrjM5JBsxqSrZgTIkjfPmLA==} + engines: {node: '>=16.15'} + '@web3-storage/capabilities@16.0.0': resolution: {integrity: sha512-wCjLpYc6t8tFRZrF2k2vBteJDWzHkmQjoJG0Yy/fjA04IjNN48iVZaCMQIANHXZxDGlYRGxhwzDwl4dovAdSTQ==} '@web3-storage/capabilities@17.1.0': resolution: {integrity: sha512-p5Wn2O3TSEZ7JFSph2KY9OuFnofbkhKi7Tp+1zcPEYAUsEvDWGabd1NvSPDDMpFBE74UX4ZljE8aQzDAtI3qRw==} + '@web3-storage/capabilities@17.2.0': + resolution: {integrity: sha512-hnJGIQcCAMBbR8sfgkEwnjBVcpNpNRBnzSEB2E/wKkKIjHKimw3ClsVznu6jjFExCXFaKHd6r1eAU4NcTYsueg==} + '@web3-storage/car-block-validator@1.2.0': resolution: {integrity: sha512-KKQ/M5WtpH/JlkX+bQYKzdG4azmSF495T7vpewje2xh7MBh1d94/BLblxCcLM/larWvXDxOkbAyTTdlECAAuUw==} @@ -949,8 +967,8 @@ packages: '@web3-storage/data-segment@5.0.0': resolution: {integrity: sha512-5CbElsxec2DsKhEHEh3XRGISAyna+bCjKjjvFrLcYyXLCaiSt/nF3ypcllxwjpE4newMUArymGKGzzZnRWL2kg==} - '@web3-storage/data-segment@5.1.0': - resolution: {integrity: sha512-FYdmtKvNiVz+maZ++k4PdD43rfJW5DeagLpstq2y84CyOKNRBWbHLCZ/Ec5zT9iGI+0WgsCGbpC/WlG0jlrnhA==} + '@web3-storage/data-segment@5.2.0': + resolution: {integrity: sha512-Jr/bdweoEQ0lWIaNuFcYxM6BHYmXHBWwfXygHyp370agkAdU+dIFIbm+tX+66XP/1YmEUi4JI2I80psDtoJ++Q==} '@web3-storage/did-mailto@2.1.0': resolution: {integrity: sha512-TRmfSXj1IhtX3ESurSNOylZSBKi0z/VJNoMLpof+AVRdovgZjjocpiePQTs2pfHKqHTHfJXc9AboWyK4IKTWMw==} @@ -965,15 +983,11 @@ packages: '@web3-storage/parse-link-header@3.1.0': resolution: {integrity: sha512-K1undnK70vLLauqdE8bq/l98isTF2FDhcP0UPpXVSjkSWe3xhAn5eRXk5jfA1E5ycNm84Ws/rQFUD7ue11nciw==} - '@web3-storage/upload-client@14.1.1': - resolution: {integrity: sha512-sg44cd0hmKcI7I8eK5UOiZfdrtPf9DfMWRfBum/5gYLwD5VZazBd+mkqjihNqGOiE4mhbn6DtLVIRNzgP7Wfog==} + '@web3-storage/upload-client@17.0.1': + resolution: {integrity: sha512-+ELz3y32YmiMvuPD/fZgCEqn/KvvoUKcZ2ao+9wosfs6GJ8/j6lhxkEkwnICiwU2tLEB+FUsOuCDFquOSW1rKg==} - '@web3-storage/w3up-client@13.1.0': - resolution: {integrity: sha512-XxdWUqIGaeBsuqX9C5FHLD4vIq0DAytMs8NP6AlCwK1wgMYqsjw1dCzNGCFM60gQGzYgoRBn8+CTJ1ftDnv0PA==} - engines: {node: '>=18'} - - '@web3-storage/w3up-client@13.1.1': - resolution: {integrity: sha512-dZzRPHyRQIBABHwGWRJd6iTkpkp5dIxwZY3/rVUy6KBAKVCV4Ei8WmyI1m+NDt/MO7XpBrWg+uNRivEKZWinCw==} + '@web3-storage/w3up-client@16.2.0': + resolution: {integrity: sha512-gqzq03gcu14UrNw5Nwi7j6bqA3HLjnPDITo/qJBzaeRRfoBgnB6nrakIkR/SVhKqZ43VRy0MpxUhUmTLxW3kFQ==} engines: {node: '>=18'} '@zxing/text-encoding@0.9.0': @@ -1277,6 +1291,9 @@ packages: carstream@1.1.0: resolution: {integrity: sha512-tbf8FOnGX1+0kOe77nm9MG53REiqQopDwzwbXYVxUcsKOAHG2KSD++qy95v1vrtRt1Q6L0Sb01it7QwJ+Yt1sQ==} + carstream@2.2.0: + resolution: {integrity: sha512-/gHkK0lQjmGM45fhdx8JD+x7a1XS1qUk3T9xWWSt3oZiWPLq4u/lnDstp+N55K7hqTKKlb0CCr43EHTrlbmJSQ==} + cborg@1.10.2: resolution: {integrity: sha512-b3tFPA9pUr2zCUiCfRd2+wok2/LBSNUMKOuRRok+WlvvAgEt/PlbgPTsZUcwCOs53IJvLgTp0eotwtosE6njug==} hasBin: true @@ -2719,6 +2736,9 @@ packages: multiformats@13.1.0: resolution: {integrity: sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==} + multiformats@13.3.0: + resolution: {integrity: sha512-CBiqvsufgmpo01VT5ze94O+uc+Pbf6f/sThlvWss0sBZmAOu6GQn5usrYV2sf2mr17FWYc0rO8c/CNe2T90QAA==} + multiformats@9.9.0: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} @@ -2885,10 +2905,6 @@ packages: one-webcrypto@1.0.3: resolution: {integrity: sha512-fu9ywBVBPx0gS9K0etIROTiCkvI5S1TDjFsYFb3rC1ewFxeOqsbzq7aIMBHsYfrTHBcGXJaONXXjTl8B01cW1Q==} - one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382: - resolution: {tarball: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382} - version: 1.0.3 - onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -3088,8 +3104,8 @@ packages: resolution: {integrity: sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==} hasBin: true - protobufjs@7.3.0: - resolution: {integrity: sha512-YWD03n3shzV9ImZRX3ccbjqLxj7NokGN0V/ESiBV5xWqrommYHYiihuIyavq03pWSGqlyvYUFmfoMKd+1rPA/g==} + protobufjs@7.4.0: + resolution: {integrity: sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==} engines: {node: '>=12.0.0'} pump@3.0.0: @@ -3626,6 +3642,9 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici@5.25.4: resolution: {integrity: sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==} engines: {node: '>=14.0'} @@ -3829,7 +3848,7 @@ snapshots: '@ariakit/react-core@0.3.14(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@ariakit/core': 0.3.11 - '@floating-ui/dom': 1.6.5 + '@floating-ui/dom': 1.6.11 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) use-sync-external-store: 1.2.0(react@18.2.0) @@ -4024,16 +4043,16 @@ snapshots: '@fastify/busboy@2.1.0': {} - '@floating-ui/core@1.6.2': + '@floating-ui/core@1.6.8': dependencies: - '@floating-ui/utils': 0.2.2 + '@floating-ui/utils': 0.2.8 - '@floating-ui/dom@1.6.5': + '@floating-ui/dom@1.6.11': dependencies: - '@floating-ui/core': 1.6.2 - '@floating-ui/utils': 0.2.2 + '@floating-ui/core': 1.6.8 + '@floating-ui/utils': 0.2.8 - '@floating-ui/utils@0.2.2': {} + '@floating-ui/utils@0.2.8': {} '@headlessui/react@1.7.17(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: @@ -4090,6 +4109,11 @@ snapshots: cborg: 4.0.3 multiformats: 13.1.0 + '@ipld/dag-cbor@9.2.1': + dependencies: + cborg: 4.0.3 + multiformats: 13.3.0 + '@ipld/dag-json@10.2.2': dependencies: cborg: 4.0.3 @@ -4116,7 +4140,7 @@ snapshots: '@perma/map': 1.0.3 actor: 2.3.1 multiformats: 11.0.2 - protobufjs: 7.3.0 + protobufjs: 7.4.0 rabin-rs: 2.1.0 '@jridgewell/gen-mapping@0.3.3': @@ -4277,6 +4301,10 @@ snapshots: '@sinclair/typebox@0.25.24': {} + '@storacha/one-webcrypto@1.0.1': {} + + '@storacha/one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/9e029e2fd477bd95bb80abd3553bbac704ccc7a6': {} + '@swc/helpers@0.5.2': dependencies: tslib: 2.6.2 @@ -4324,13 +4352,13 @@ snapshots: dependencies: undici-types: 5.26.5 - '@types/node@20.12.12': + '@types/node@20.14.9': dependencies: undici-types: 5.26.5 - '@types/node@20.14.9': + '@types/node@22.5.5': dependencies: - undici-types: 5.26.5 + undici-types: 6.19.8 '@types/normalize-package-data@2.4.4': {} @@ -4634,24 +4662,24 @@ snapshots: json-schema-to-ts: 1.6.4 ts-morph: 12.0.0 - '@w3ui/core@2.2.0(encoding@0.1.13)': + '@w3ui/core@2.3.1(encoding@0.1.13)': dependencies: '@ipld/dag-ucan': 3.4.0 '@ucanto/client': 9.0.1 '@ucanto/interface': 10.0.1 '@ucanto/principal': 9.0.1 '@ucanto/transport': 9.1.1 - '@web3-storage/access': 18.4.0 + '@web3-storage/access': 20.0.1 '@web3-storage/did-mailto': 2.1.0 - '@web3-storage/w3up-client': 13.1.0(encoding@0.1.13) + '@web3-storage/w3up-client': 16.2.0(encoding@0.1.13) transitivePeerDependencies: - encoding - '@w3ui/react@2.3.0(@types/react@18.2.42)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@w3ui/react@2.4.0(@types/react@18.2.42)(encoding@0.1.13)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@ariakit/react': 0.3.14(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@ariakit/react-core': 0.3.14(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@w3ui/core': 2.2.0(encoding@0.1.13) + '@w3ui/core': 2.3.1(encoding@0.1.13) ariakit-react-utils: 0.17.0-next.27(@types/react@18.2.42)(react@18.2.0) react: 18.2.0 transitivePeerDependencies: @@ -4691,7 +4719,7 @@ snapshots: dependencies: web-streams-polyfill: 3.3.3 - '@web3-storage/access@18.4.0': + '@web3-storage/access@19.0.0': dependencies: '@ipld/car': 5.2.4 '@ipld/dag-ucan': 3.4.0 @@ -4707,32 +4735,43 @@ snapshots: bigint-mod-arith: 3.3.1 conf: 11.0.2 multiformats: 12.1.3 - one-webcrypto: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382 + one-webcrypto: '@storacha/one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/9e029e2fd477bd95bb80abd3553bbac704ccc7a6' p-defer: 4.0.1 type-fest: 4.18.2 uint8arrays: 4.0.9 - '@web3-storage/access@19.0.0': + '@web3-storage/access@20.0.1': dependencies: '@ipld/car': 5.2.4 '@ipld/dag-ucan': 3.4.0 '@scure/bip39': 1.3.0 + '@storacha/one-webcrypto': 1.0.1 '@ucanto/client': 9.0.1 '@ucanto/core': 10.0.1 '@ucanto/interface': 10.0.1 '@ucanto/principal': 9.0.1 '@ucanto/transport': 9.1.1 '@ucanto/validator': 9.0.2 - '@web3-storage/capabilities': 17.1.0 + '@web3-storage/capabilities': 17.2.0 '@web3-storage/did-mailto': 2.1.0 bigint-mod-arith: 3.3.1 conf: 11.0.2 multiformats: 12.1.3 - one-webcrypto: https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382 p-defer: 4.0.1 type-fest: 4.18.2 uint8arrays: 4.0.9 + '@web3-storage/blob-index@1.0.4': + dependencies: + '@ipld/dag-cbor': 9.2.0 + '@storacha/one-webcrypto': 1.0.1 + '@ucanto/core': 10.0.1 + '@ucanto/interface': 10.0.1 + '@web3-storage/capabilities': 17.2.0 + carstream: 2.2.0 + multiformats: 13.1.0 + uint8arrays: 5.1.0 + '@web3-storage/capabilities@16.0.0': dependencies: '@ucanto/core': 10.0.1 @@ -4753,6 +4792,16 @@ snapshots: '@web3-storage/data-segment': 3.2.0 uint8arrays: 5.1.0 + '@web3-storage/capabilities@17.2.0': + dependencies: + '@ucanto/core': 10.0.1 + '@ucanto/interface': 10.0.1 + '@ucanto/principal': 9.0.1 + '@ucanto/transport': 9.1.1 + '@ucanto/validator': 9.0.2 + '@web3-storage/data-segment': 3.2.0 + uint8arrays: 5.1.0 + '@web3-storage/car-block-validator@1.2.0': dependencies: '@multiformats/blake2': 1.0.13 @@ -4781,10 +4830,10 @@ snapshots: multiformats: 11.0.2 sync-multihash-sha2: 1.0.0 - '@web3-storage/data-segment@5.1.0': + '@web3-storage/data-segment@5.2.0': dependencies: - '@ipld/dag-cbor': 9.2.0 - multiformats: 11.0.2 + '@ipld/dag-cbor': 9.2.1 + multiformats: 13.3.0 sync-multihash-sha2: 1.0.0 '@web3-storage/did-mailto@2.1.0': {} @@ -4802,7 +4851,7 @@ snapshots: '@web3-storage/parse-link-header@3.1.0': {} - '@web3-storage/upload-client@14.1.1(encoding@0.1.13)': + '@web3-storage/upload-client@17.0.1(encoding@0.1.13)': dependencies: '@ipld/car': 5.2.4 '@ipld/dag-cbor': 9.2.0 @@ -4812,8 +4861,9 @@ snapshots: '@ucanto/core': 10.0.1 '@ucanto/interface': 10.0.1 '@ucanto/transport': 9.1.1 - '@web3-storage/capabilities': 17.1.0 - '@web3-storage/data-segment': 5.1.0 + '@web3-storage/blob-index': 1.0.4 + '@web3-storage/capabilities': 17.2.0 + '@web3-storage/data-segment': 5.2.0 '@web3-storage/filecoin-client': 3.3.3 ipfs-utils: 9.0.14(encoding@0.1.13) multiformats: 12.1.3 @@ -4822,23 +4872,7 @@ snapshots: transitivePeerDependencies: - encoding - '@web3-storage/w3up-client@13.1.0(encoding@0.1.13)': - dependencies: - '@ipld/dag-ucan': 3.4.0 - '@ucanto/client': 9.0.1 - '@ucanto/core': 10.0.1 - '@ucanto/interface': 10.0.1 - '@ucanto/principal': 9.0.1 - '@ucanto/transport': 9.1.1 - '@web3-storage/access': 18.4.0 - '@web3-storage/capabilities': 17.1.0 - '@web3-storage/did-mailto': 2.1.0 - '@web3-storage/filecoin-client': 3.3.3 - '@web3-storage/upload-client': 14.1.1(encoding@0.1.13) - transitivePeerDependencies: - - encoding - - '@web3-storage/w3up-client@13.1.1(encoding@0.1.13)': + '@web3-storage/w3up-client@16.2.0(encoding@0.1.13)': dependencies: '@ipld/dag-ucan': 3.4.0 '@ucanto/client': 9.0.1 @@ -4846,11 +4880,12 @@ snapshots: '@ucanto/interface': 10.0.1 '@ucanto/principal': 9.0.1 '@ucanto/transport': 9.1.1 - '@web3-storage/access': 18.4.0 - '@web3-storage/capabilities': 17.1.0 + '@web3-storage/access': 20.0.1 + '@web3-storage/blob-index': 1.0.4 + '@web3-storage/capabilities': 17.2.0 '@web3-storage/did-mailto': 2.1.0 '@web3-storage/filecoin-client': 3.3.3 - '@web3-storage/upload-client': 14.1.1(encoding@0.1.13) + '@web3-storage/upload-client': 17.0.1(encoding@0.1.13) transitivePeerDependencies: - encoding @@ -5179,6 +5214,12 @@ snapshots: multiformats: 12.1.3 uint8arraylist: 2.4.7 + carstream@2.2.0: + dependencies: + '@ipld/dag-cbor': 9.2.0 + multiformats: 13.1.0 + uint8arraylist: 2.4.7 + cborg@1.10.2: {} cborg@4.0.3: {} @@ -5692,7 +5733,7 @@ snapshots: eslint: 8.55.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0(eslint@8.55.0))(eslint@8.55.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0(eslint@8.55.0))(eslint@8.55.0))(eslint@8.55.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.55.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.55.0) eslint-plugin-react: 7.33.2(eslint@8.55.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.55.0) @@ -5716,7 +5757,7 @@ snapshots: enhanced-resolve: 5.15.0 eslint: 8.55.0 eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0(eslint@8.55.0))(eslint@8.55.0))(eslint@8.55.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0(eslint@8.55.0))(eslint@8.55.0))(eslint@8.55.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.55.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -5738,7 +5779,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.0(eslint@8.55.0))(eslint@8.55.0))(eslint@8.55.0): + eslint-plugin-import@2.29.0(@typescript-eslint/parser@6.13.2(eslint@8.55.0)(typescript@5.3.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.55.0): dependencies: array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 @@ -6857,6 +6898,8 @@ snapshots: multiformats@13.1.0: {} + multiformats@13.3.0: {} + multiformats@9.9.0: {} murmurhash3js-revisited@3.0.0: {} @@ -7040,8 +7083,6 @@ snapshots: one-webcrypto@1.0.3: {} - one-webcrypto@https://codeload.github.com/web3-storage/one-webcrypto/tar.gz/5148cd14d5489a8ac4cd38223870e02db15a2382: {} - onetime@5.1.2: dependencies: mimic-fn: 2.1.0 @@ -7238,7 +7279,7 @@ snapshots: '@types/node': 20.14.9 long: 4.0.0 - protobufjs@7.3.0: + protobufjs@7.4.0: dependencies: '@protobufjs/aspromise': 1.1.2 '@protobufjs/base64': 1.1.2 @@ -7250,7 +7291,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.12.12 + '@types/node': 22.5.5 long: 5.2.3 pump@3.0.0: @@ -7857,6 +7898,8 @@ snapshots: undici-types@5.26.5: {} + undici-types@6.19.8: {} + undici@5.25.4: dependencies: '@fastify/busboy': 2.0.0 diff --git a/src/app/page.tsx b/src/app/page.tsx index 17421ef..1237c3c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -18,7 +18,7 @@ export default function HomePage () { function SpacePage (): ReactNode { const [{ spaces }] = useW3() - + if (spaces.length === 0) { return
} diff --git a/src/app/space/[did]/share/page.tsx b/src/app/space/[did]/share/page.tsx index 6544f88..cba51d7 100644 --- a/src/app/space/[did]/share/page.tsx +++ b/src/app/space/[did]/share/page.tsx @@ -2,8 +2,8 @@ import { ShareSpace } from '@/share' -export default function SharePage (): JSX.Element { +export default function SharePage ({params}): JSX.Element { return ( - + ) } diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx new file mode 100644 index 0000000..de30fdd --- /dev/null +++ b/src/components/Tooltip.tsx @@ -0,0 +1,34 @@ +import { useState } from "react"; + +function Tooltip({ text, title, children }: { text: string[], title?: string, children: React.ReactNode }) { + const [visible, setVisible] = useState(false); + + return ( + setVisible(true)} + onMouseLeave={() => setVisible(false)} + style={{ position: 'relative', cursor: 'pointer', display: 'flex', alignItems: 'center' }} + > + {children} + {visible && ( +
+ {title && {title + '\n'}} + {text.join('\n')} +
+ )} +
+ ); +} + +export default Tooltip \ No newline at end of file diff --git a/src/share.tsx b/src/share.tsx index 9914928..b543c21 100644 --- a/src/share.tsx +++ b/src/share.tsx @@ -1,13 +1,15 @@ -import { ChangeEvent, useState } from 'react' +import { ChangeEvent, useEffect, useState } from 'react' import { useW3 } from '@w3ui/react' -import * as DID from '@ipld/dag-ucan/did' import { extract } from '@ucanto/core/delegation' import type { PropsWithChildren } from 'react' import type { Delegation } from '@ucanto/interface' import { SpacePreview } from './components/SpaceCreator' import { H2 } from '@/components/Text' import CopyButton from './components/CopyButton' -import { ArrowDownOnSquareStackIcon, CloudArrowDownIcon, PaperAirplaneIcon } from '@heroicons/react/24/outline' +import Tooltip from './components/Tooltip' +import { ArrowDownOnSquareStackIcon, CloudArrowDownIcon, PaperAirplaneIcon, InformationCircleIcon } from '@heroicons/react/24/outline' +import * as DIDMailTo from '@web3-storage/did-mailto' +import { DID } from '@ucanto/core' function Header(props: PropsWithChildren): JSX.Element { return ( @@ -17,10 +19,65 @@ function Header(props: PropsWithChildren): JSX.Element { ) } -export function ShareSpace (): JSX.Element { +function isDID(value: string): boolean { + try { + DID.parse(value.trim()) + return true + } catch (err) { + return false + } +} + +function isEmail(value: string): boolean { + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ + return !isDID(value) && emailRegex.test(value) +} + +export function ShareSpace({spaceDID}: {spaceDID: string}): JSX.Element { const [{ client }] = useW3() const [value, setValue] = useState('') const [downloadUrl, setDownloadUrl] = useState('') + const [sharedEmails, setSharedEmails] = useState<{ email: string, capabilities: string[] }[]>([]) + + useEffect(() => { + if (client && spaceDID) { + // Find all delegations where the spaceDID is present + const delegations = client.delegations() + .filter(d => d.capabilities.some(c => c.with === spaceDID)) + .map(d => ({ + email: DIDMailTo.toEmail(DIDMailTo.fromString(d.audience.did())), + capabilities: d.capabilities.map(c => c.can) + })) + setSharedEmails(delegations) + } + }, [client, spaceDID]) + + async function shareViaEmail(email: string): Promise { + try { + if (!client) { + throw new Error(`Client not found`) + } + + const space = client.spaces().find(s => s.did() === spaceDID) + if (!space) { + throw new Error(`Could not find space to share`) + } + + const delegatedEmail = DIDMailTo.email(email) + const delegation = await client.shareSpace(delegatedEmail, space.did()) + + const next = { email: delegatedEmail, capabilities: delegation.capabilities.map(c => c.can) } + setSharedEmails(prev => { + if (prev.some(item => item.email === next.email)) { + return prev + } + return [...prev, next] + }) + setValue('') + } catch (err) { + console.error(err) + } + } async function makeDownloadLink(input: string): Promise { if (!client) return @@ -34,16 +91,16 @@ export function ShareSpace (): JSX.Element { } try { - const delegation = await client.createDelegation(audience, ['*'], { - expiration: Infinity, - }) - const archiveRes = await delegation.archive() - if (archiveRes.error) { - throw new Error('failed to archive delegation', { cause: archiveRes.error }) - } - const blob = new Blob([archiveRes.ok]) - const url = URL.createObjectURL(blob) - setDownloadUrl(url) + const delegation = await client.createDelegation(audience, ['*'], { + expiration: Infinity, + }) + const archiveRes = await delegation.archive() + if (archiveRes.error) { + throw new Error('failed to archive delegation', { cause: archiveRes.error }) + } + const blob = new Blob([archiveRes.ok]) + const url = URL.createObjectURL(blob) + setDownloadUrl(url) } catch (err: any) { throw new Error(err.message ?? err, { cause: err }) } @@ -51,12 +108,17 @@ export function ShareSpace (): JSX.Element { function onSubmit(e: React.FormEvent): void { e.preventDefault() - void makeDownloadLink(value) + if (isDID(value)) { + void makeDownloadLink(value) + } else if (isEmail(value)) { + void shareViaEmail(value) + } else { + setDownloadUrl('') + } } function onChange(e: ChangeEvent): void { const input = e.target.value - void makeDownloadLink(input) setValue(input) } @@ -71,7 +133,7 @@ export function ShareSpace (): JSX.Element {
Share your space
+ {sharedEmails.length > 0 && ( +
+

+ Shared With: +

+
    + {sharedEmails.map(({ email, capabilities }) => ( +
  • + + {email} + + + + +
  • + ))} +
+
+ )} ) } -export function ImportSpace () { +export function ImportSpace() { const [{ client }] = useW3() const [proof, setProof] = useState() @@ -117,14 +219,14 @@ export function ImportSpace () { } delegation = res.ok } catch (err) { - console.log(err) + console.error(err) return } try { await client.addSpace(delegation) setProof(delegation) } catch (err) { - console.log(err) + console.error(err) } } @@ -142,7 +244,7 @@ export function ImportSpace () { Copy DID - Email DID + Email DID
  • @@ -150,7 +252,7 @@ export function ImportSpace () {

    Instruct your friend to use the web console or CLI to create a UCAN, delegating your DID acces to their space.