diff --git a/javascript/dwa-starter-react-vite/package.json b/javascript/dwa-starter-react-vite/package.json index b32d6ea1..e0fb2340 100644 --- a/javascript/dwa-starter-react-vite/package.json +++ b/javascript/dwa-starter-react-vite/package.json @@ -15,14 +15,19 @@ "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", - "@web5/api": "0.10.0", - "@web5/credentials": "^1.0.3", - "@web5/dids": "^1.1.1", + "@web5/agent": "^0.7.3", + "@web5/api": "0.0.0-next-3cfc21d-20240920195338", + "@web5/browser": "0.0.0-next-3cfc21d-20240920195338", + "@web5/common": "^1.0.2", + "@web5/credentials": "^1.1.1", + "@web5/dids": "^1.1.4", + "@web5/user-agent": "^0.6.3", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "lucide-react": "^0.407.0", "next-themes": "^0.3.0", "node-stdlib-browser": "^1.2.0", + "qrcode.react": "^4.0.1", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.24.1", @@ -58,4 +63,4 @@ "sharp": "0.32.6", "sharp-ico": "0.1.5" } -} \ No newline at end of file +} diff --git a/javascript/dwa-starter-react-vite/pnpm-lock.yaml b/javascript/dwa-starter-react-vite/pnpm-lock.yaml index 9b8d310c..d87329a2 100644 --- a/javascript/dwa-starter-react-vite/pnpm-lock.yaml +++ b/javascript/dwa-starter-react-vite/pnpm-lock.yaml @@ -14,28 +14,40 @@ importers: dependencies: '@radix-ui/react-checkbox': specifier: ^1.1.1 - version: 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + version: 1.1.1(@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-collapsible': 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) + 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) '@radix-ui/react-dropdown-menu': specifier: ^2.1.1 - version: 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + version: 2.1.1(@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-label': specifier: ^2.1.0 - version: 2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + version: 2.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-slot': specifier: ^1.1.0 version: 1.1.0(@types/react@18.3.3)(react@18.3.1) + '@web5/agent': + specifier: ^0.7.3 + version: 0.7.3(ws@8.18.0) '@web5/api': - specifier: 0.10.0 - version: 0.10.0(ws@8.18.0) + specifier: 0.0.0-next-3cfc21d-20240920195338 + version: 0.0.0-next-3cfc21d-20240920195338(ws@8.18.0) + '@web5/browser': + specifier: 0.0.0-next-3cfc21d-20240920195338 + version: 0.0.0-next-3cfc21d-20240920195338 + '@web5/common': + specifier: ^1.0.2 + version: 1.0.2 '@web5/credentials': - specifier: ^1.0.3 - version: 1.0.4 - '@web5/dids': specifier: ^1.1.1 - version: 1.1.2 + version: 1.1.1 + '@web5/dids': + specifier: ^1.1.4 + version: 1.1.4 + '@web5/user-agent': + specifier: ^0.6.3 + version: 0.6.3(ws@8.18.0) class-variance-authority: specifier: ^0.7.0 version: 0.7.0 @@ -47,10 +59,13 @@ importers: version: 0.407.0(react@18.3.1) next-themes: specifier: ^0.3.0 - version: 0.3.0(react-dom@18.3.1)(react@18.3.1) + version: 0.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) node-stdlib-browser: specifier: ^1.2.0 version: 1.2.0 + qrcode.react: + specifier: ^4.0.1 + version: 4.0.1(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 @@ -59,10 +74,10 @@ importers: version: 18.3.1(react@18.3.1) react-router-dom: specifier: ^6.24.1 - version: 6.25.1(react-dom@18.3.1)(react@18.3.1) + version: 6.25.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) sonner: specifier: ^1.5.0 - version: 1.5.0(react-dom@18.3.1)(react@18.3.1) + version: 1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) tailwind-merge: specifier: ^2.4.0 version: 2.4.0 @@ -81,7 +96,7 @@ importers: version: 18.3.0 '@typescript-eslint/eslint-plugin': specifier: ^7.8.0 - version: 7.16.1(@typescript-eslint/parser@7.16.1)(eslint@8.57.0)(typescript@5.5.3) + version: 7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3) '@typescript-eslint/parser': specifier: ^7.8.0 version: 7.16.1(eslint@8.57.0)(typescript@5.5.3) @@ -90,7 +105,7 @@ importers: version: 0.2.4 '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.3.1(vite@5.3.4) + version: 4.3.1(vite@5.3.4(@types/node@20.14.11)(terser@5.31.3)) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.39) @@ -114,13 +129,13 @@ importers: version: 5.5.3 vite: specifier: ^5.2.10 - version: 5.3.4(@types/node@20.14.11) + version: 5.3.4(@types/node@20.14.11)(terser@5.31.3) vite-plugin-node-stdlib-browser: specifier: ^0.2.1 - version: 0.2.1(node-stdlib-browser@1.2.0)(rollup@2.79.1)(vite@5.3.4) + version: 0.2.1(node-stdlib-browser@1.2.0)(rollup@2.79.1)(vite@5.3.4(@types/node@20.14.11)(terser@5.31.3)) vite-plugin-pwa: specifier: ^0.20.0 - version: 0.20.0(@vite-pwa/assets-generator@0.2.4)(vite@5.3.4)(workbox-build@7.1.1)(workbox-window@7.1.0) + version: 0.20.0(@vite-pwa/assets-generator@0.2.4)(vite@5.3.4(@types/node@20.14.11)(terser@5.31.3))(workbox-build@7.1.1(@types/babel__core@7.20.5))(workbox-window@7.1.0) workbox-core: specifier: ^7.1.0 version: 7.1.0 @@ -1525,8 +1540,8 @@ packages: '@surma/rollup-plugin-off-main-thread@2.2.3': resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==} - '@tbd54566975/dwn-sdk-js@0.4.4': - resolution: {integrity: sha512-i4jBrKOn6ypaFQJLNG8Kc9AvR1nmZrq3A+9M4O9xiDbH60+QMPf2HsNuVOTu6Ve9V7IU8NorI/GoSryD0TknpQ==} + '@tbd54566975/dwn-sdk-js@0.4.7': + resolution: {integrity: sha512-VYaLT4FKdHfVvUPZbicUpF77erkOSi1xBP/EVQIpnp0khPujp2lYcojbRcw4c4JR23CrRvLPy/iWXmEhdP8LqA==} engines: {node: '>= 18'} '@types/babel__core@7.20.5': @@ -1637,14 +1652,21 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 - '@web5/agent@0.4.1': - resolution: {integrity: sha512-cN88Qxm559AIA4cmO+pMjwJA3KZQwB6zBBo5UMo6Ke3/3HSuA687fd2ILQo+OY8JB9xWAjKqRYsnymD1TKfoEg==} + '@web5/agent@0.0.0-next-3cfc21d-20240920195338': + resolution: {integrity: sha512-DSkRcon3+ju3u9ivVjgKdhC9y9oEO/m7BOD9tKjuywMPvlTKsMAgOFm3aGadSOBhZaUb1HGdqPaqwVYw/KnxNA==} + engines: {node: '>=18.0.0'} + + '@web5/agent@0.7.3': + resolution: {integrity: sha512-IrpvQM9Lra8pFgDcZe2J/WGPBcvG6cYR6uSh/u9pvCxY+LmCB6+ULquPnfwvthazHNSJS/ZddhwQ/DM4cA2PZA==} engines: {node: '>=18.0.0'} - '@web5/api@0.10.0': - resolution: {integrity: sha512-63CA6BEz2xiaDscPq4sDTjL1Fa3bDkHL1ymDAih9hriV+rZ1xYI52/Un4I5eLy+4Lf+xh7BJD4ZKV87xh4FO4A==} + '@web5/api@0.0.0-next-3cfc21d-20240920195338': + resolution: {integrity: sha512-DU7gsrzyrjD8xvbptita/3w6qtVvfficnZQCd+tdQu2I3zOOPID4/7jXhdj6aQiPL6fmsmtTN/i9U/zLeEapsA==} engines: {node: '>=18.0.0'} + '@web5/browser@0.0.0-next-3cfc21d-20240920195338': + resolution: {integrity: sha512-gSVrsQTm/i2780vlB1iCk3w6USPCdSpaovys+N3wwB3oAxv2+KHQxBd3Wn4nENM8S4K65mlYyd/Y0p/pqcgGsA==} + '@web5/common@1.0.0': resolution: {integrity: sha512-3JHF6X5o0h+3oAVQeBC4XpMoZeEYZYdEmQdgpOfKv/rnSru2yHQSAM+0wbIvEFcSCmelBT3u7rUAcpJjelLB0w==} engines: {node: '>=18.0.0'} @@ -1653,16 +1675,28 @@ packages: resolution: {integrity: sha512-dxczXqzWt6HCwuNyOVBeakg6GgOpP74tVEVxBeKkb+D3XcSP96mYaDtky5ZnjY4iBYb16SaCgwje+sgevOL51A==} engines: {node: '>=18.0.0'} - '@web5/credentials@1.0.4': - resolution: {integrity: sha512-b8+svmFIix22Kq1YMgdtAADK7girze/xTTeHzQS2qZbuuWJsp5eZfy3d7YJp5oDnFOdy26WUjCYUJvngnbS66g==} + '@web5/common@1.0.2': + resolution: {integrity: sha512-SerGdrxZF47yidvhrRa8sGLEOunIlDHppxrtWYCuKMVgtQKgheEmaS4+xchGAc/mZggJX4LlwJbRuniIiSaXrw==} + engines: {node: '>=18.0.0'} + + '@web5/credentials@1.1.1': + resolution: {integrity: sha512-SlTpW4rg+HJ6ipLV4uzQ0Sg4HmSeuwWnWa6JOIG+cBWAOgCwgY/PL0F57wI3p4b8qcx/ey2R2yZyKkpN0sr8UQ==} + engines: {node: '>=18.0.0'} + + '@web5/crypto@0.0.0-next-3cfc21d-20240920195338': + resolution: {integrity: sha512-jnBU6tB/9NTPqdlhNEFOWFftGNOgUJ/E0EX8m6ekM438PLmYO+wDU4kSTdq97sqnPMq+PMwEc4LpC3e8sB93Qg==} engines: {node: '>=18.0.0'} '@web5/crypto@1.0.0': resolution: {integrity: sha512-z1CsgycTqiXEsS6pPlJDDLGAeGsgzfdBeWvyxLXTgh08Q8ACULmEGRXjSsgWHFn6DO6MpWFn55h/hF4wZZRxvA==} engines: {node: '>=18.0.0'} - '@web5/crypto@1.0.1': - resolution: {integrity: sha512-LqJsJTDgzEZoxsYSWjhIKDTE3xwjfPF3rpkClMFAxmK4dur/KmYHgeZW2/HjRrFrUhNeaNVClcl7Fg2ZnvjsWw==} + '@web5/crypto@1.0.4': + resolution: {integrity: sha512-XjYkwQG28zo6UXusl5djca9/Qv74H259fjofrUY87qeb1Y/lPrgtpVTSNaqdLu4RB1gwyzFZwOGRaphWNjK1Ug==} + engines: {node: '>=18.0.0'} + + '@web5/dids@0.0.0-next-3cfc21d-20240920195338': + resolution: {integrity: sha512-z+492AmJBviZ6SvUNtz4hgZyq3ikgmyVBXn1Ym6lMWxFOHHwv3e/gILzhhPXXW6JZu5kNYe1f5RiWs8M/ZRqhQ==} engines: {node: '>=18.0.0'} '@web5/dids@1.1.0': @@ -1673,12 +1707,16 @@ packages: resolution: {integrity: sha512-LKc6Okl2iz78QGJCsd8QKQq3LdtmfQ9cfiRKu1BU4ITWteWsg4JD089hKmslNDd2KKnEf9LE72TqEYWxr/e8JA==} engines: {node: '>=18.0.0'} - '@web5/dids@1.1.2': - resolution: {integrity: sha512-z//qSvyRbVvgXDVDb7t/HrwUj0BmsVu2HeVjlLHyK+iKpfJoo0PU+A9tZkBqsjnhTdbgjqO+rD4Id4GR+aviig==} + '@web5/dids@1.1.4': + resolution: {integrity: sha512-RdRWRMrZlcbnLkMO14ObWsL//efmSl/Mzvmbodbi3kMXvCaoLYgYyz5AkdrpskdjolWLkgOjjdMw+bX5uxp0mQ==} engines: {node: '>=18.0.0'} - '@web5/user-agent@0.4.1': - resolution: {integrity: sha512-B2fdj5vgLW6Vu/kcENzCcW5cYbfAJ1f+Gp8MDL03h08/O+2d8soN5AchY5QxBNoPBXyXZ/trKld7Epu/l5EEdA==} + '@web5/user-agent@0.0.0-next-3cfc21d-20240920195338': + resolution: {integrity: sha512-YfSF9g6w2dwezhWtQm6tjuHDvVZYbZeiMZarwEtfstM6glV3gNCtYoVnc00rRwU8X6iilfKmp3lcwEJLqG+tJQ==} + engines: {node: '>=18.0.0'} + + '@web5/user-agent@0.6.3': + resolution: {integrity: sha512-lULqSQ7KaGVGzCZmYb6aYbG7lP/xvaR3JrCyK1PEHFm9V3Y67R4N45XbBOmPQ2cfuU1+i0f+mcL2a92DhfSf1w==} engines: {node: '>=18.0.0'} abort-controller@3.0.0: @@ -2806,6 +2844,9 @@ packages: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} engines: {node: '>=0.10.0'} + jsonschema@1.4.1: + resolution: {integrity: sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==} + jwt-decode@3.1.2: resolution: {integrity: sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==} @@ -3249,6 +3290,11 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qrcode.react@4.0.1: + resolution: {integrity: sha512-Lpj0tPBn561WiQ3QQWXbkx8xTtB8BZkJeMZWLJIL8iaPBCoWzW1IpCeU3gY5MDqsb0+efCvEGkl9O0naP64crA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + qs@6.12.3: resolution: {integrity: sha512-AWJm14H1vVaO/iNZ4/hO+HyaTehuy9nRqVdkTqlJt0HWvBiBIEXFmb4C0DGeYo3Xes9rrEW+TxHsaigCbN5ICQ==} engines: {node: '>=0.6'} @@ -4935,7 +4981,7 @@ snapshots: '@floating-ui/core': 1.6.4 '@floating-ui/utils': 0.2.4 - '@floating-ui/react-dom@2.1.1(react-dom@18.3.1)(react@18.3.1)': + '@floating-ui/react-dom@2.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@floating-ui/dom': 1.6.7 react: 18.3.1 @@ -5052,264 +5098,293 @@ snapshots: '@radix-ui/primitive@1.1.0': {} - '@radix-ui/react-arrow@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-arrow@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)': dependencies: - '@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) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 + '@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) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-checkbox@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-checkbox@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(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) + '@radix-ui/react-presence': 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-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-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-use-previous': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-collapsible@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-collapsible@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)': dependencies: '@radix-ui/primitive': 1.1.0 '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(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) + '@radix-ui/react-presence': 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-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-controllable-state': 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) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-collection@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-collection@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)': dependencies: '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@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) + '@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-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-context@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-direction@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 - '@radix-ui/react-dismissable-layer@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-dismissable-layer@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)': dependencies: '@radix-ui/primitive': 1.1.0 '@radix-ui/react-compose-refs': 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) + '@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-escape-keydown': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-dropdown-menu@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-dropdown-menu@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-menu': 2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(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) + '@radix-ui/react-menu': 2.1.1(@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(@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-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 '@radix-ui/react-focus-guards@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 - '@radix-ui/react-focus-scope@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-focus-scope@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)': dependencies: '@radix-ui/react-compose-refs': 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) + '@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) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 '@radix-ui/react-id@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 - '@radix-ui/react-label@2.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-label@2.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)': dependencies: - '@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) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 + '@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) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-menu@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-menu@2.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-collection': 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-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-dismissable-layer': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-dismissable-layer': 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-focus-guards': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-focus-scope': 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-id': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) - '@radix-ui/react-portal': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) - '@radix-ui/react-presence': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(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) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-popper': 1.2.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-portal': 1.1.1(@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-presence': 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-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-roving-focus': 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-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 aria-hidden: 1.2.4 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-remove-scroll: 2.5.7(@types/react@18.3.3)(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-popper@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-popper@1.2.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)': dependencies: - '@floating-ui/react-dom': 2.1.1(react-dom@18.3.1)(react@18.3.1) - '@radix-ui/react-arrow': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + '@floating-ui/react-dom': 2.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-arrow': 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-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@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) + '@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) '@radix-ui/react-use-rect': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-use-size': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/rect': 1.1.0 - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-portal@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-portal@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@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) + '@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-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-presence@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-presence@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)': dependencies: '@radix-ui/react-compose-refs': 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) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@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)': + '@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)': dependencies: '@radix-ui/react-slot': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 - '@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)': + '@radix-ui/react-roving-focus@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)': dependencies: '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-collection': 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-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-direction': 1.1.0(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-id': 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) + '@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-controllable-state': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 - '@types/react-dom': 18.3.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 + '@types/react-dom': 18.3.0 '@radix-ui/react-slot@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-escape-keydown@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-previous@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-rect@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/rect': 1.1.0 - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/react-use-size@1.1.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.3)(react@18.3.1) - '@types/react': 18.3.3 react: 18.3.1 + optionalDependencies: + '@types/react': 18.3.3 '@radix-ui/rect@1.1.0': {} '@remix-run/router@1.18.0': {} - '@rollup/plugin-babel@5.3.1(@babel/core@7.24.9)(rollup@2.79.1)': + '@rollup/plugin-babel@5.3.1(@babel/core@7.24.9)(@types/babel__core@7.20.5)(rollup@2.79.1)': dependencies: '@babel/core': 7.24.9 '@babel/helper-module-imports': 7.24.7 '@rollup/pluginutils': 3.1.0(rollup@2.79.1) rollup: 2.79.1 + optionalDependencies: + '@types/babel__core': 7.20.5 transitivePeerDependencies: - supports-color @@ -5318,6 +5393,7 @@ snapshots: '@rollup/pluginutils': 5.1.0(rollup@2.79.1) estree-walker: 2.0.2 magic-string: 0.30.10 + optionalDependencies: rollup: 2.79.1 '@rollup/plugin-node-resolve@15.2.3(rollup@2.79.1)': @@ -5328,6 +5404,7 @@ snapshots: is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 + optionalDependencies: rollup: 2.79.1 '@rollup/plugin-replace@2.4.2(rollup@2.79.1)': @@ -5338,10 +5415,11 @@ snapshots: '@rollup/plugin-terser@0.4.4(rollup@2.79.1)': dependencies: - rollup: 2.79.1 serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.31.3 + optionalDependencies: + rollup: 2.79.1 '@rollup/pluginutils@3.1.0(rollup@2.79.1)': dependencies: @@ -5355,6 +5433,7 @@ snapshots: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 + optionalDependencies: rollup: 2.79.1 '@rollup/rollup-android-arm-eabi@4.18.1': @@ -5459,7 +5538,7 @@ snapshots: magic-string: 0.25.9 string.prototype.matchall: 4.0.11 - '@tbd54566975/dwn-sdk-js@0.4.4': + '@tbd54566975/dwn-sdk-js@0.4.7': dependencies: '@ipld/dag-cbor': 9.0.3 '@js-temporal/polyfill': 0.4.4 @@ -5467,7 +5546,7 @@ snapshots: '@noble/curves': 1.4.2 '@noble/ed25519': 2.0.0 '@noble/secp256k1': 2.0.0 - '@web5/dids': 1.1.0 + '@web5/dids': 1.1.4 abstract-level: 1.0.3 ajv: 8.12.0 blockstore-core: 4.2.0 @@ -5536,7 +5615,7 @@ snapshots: '@types/trusted-types@2.0.7': {} - '@typescript-eslint/eslint-plugin@7.16.1(@typescript-eslint/parser@7.16.1)(eslint@8.57.0)(typescript@5.5.3)': + '@typescript-eslint/eslint-plugin@7.16.1(@typescript-eslint/parser@7.16.1(eslint@8.57.0)(typescript@5.5.3))(eslint@8.57.0)(typescript@5.5.3)': dependencies: '@eslint-community/regexpp': 4.11.0 '@typescript-eslint/parser': 7.16.1(eslint@8.57.0)(typescript@5.5.3) @@ -5549,6 +5628,7 @@ snapshots: ignore: 5.3.1 natural-compare: 1.4.0 ts-api-utils: 1.3.0(typescript@5.5.3) + optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -5561,6 +5641,7 @@ snapshots: '@typescript-eslint/visitor-keys': 7.16.1 debug: 4.3.5 eslint: 8.57.0 + optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -5577,6 +5658,7 @@ snapshots: debug: 4.3.5 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.5.3) + optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -5593,6 +5675,7 @@ snapshots: minimatch: 9.0.5 semver: 7.6.3 ts-api-utils: 1.3.0(typescript@5.5.3) + optionalDependencies: typescript: 5.5.3 transitivePeerDependencies: - supports-color @@ -5624,25 +5707,25 @@ snapshots: sharp-ico: 0.1.5 unconfig: 0.3.13 - '@vitejs/plugin-react@4.3.1(vite@5.3.4)': + '@vitejs/plugin-react@4.3.1(vite@5.3.4(@types/node@20.14.11)(terser@5.31.3))': dependencies: '@babel/core': 7.24.9 '@babel/plugin-transform-react-jsx-self': 7.24.7(@babel/core@7.24.9) '@babel/plugin-transform-react-jsx-source': 7.24.7(@babel/core@7.24.9) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.3.4(@types/node@20.14.11) + vite: 5.3.4(@types/node@20.14.11)(terser@5.31.3) transitivePeerDependencies: - supports-color - '@web5/agent@0.4.1(ws@8.18.0)': + '@web5/agent@0.0.0-next-3cfc21d-20240920195338(ws@8.18.0)': dependencies: - '@noble/ciphers': 0.4.1 + '@noble/ciphers': 0.5.3 '@scure/bip39': 1.2.2 - '@tbd54566975/dwn-sdk-js': 0.4.4 - '@web5/common': 1.0.0 - '@web5/crypto': 1.0.0 - '@web5/dids': 1.1.0 + '@tbd54566975/dwn-sdk-js': 0.4.7 + '@web5/common': 1.0.2 + '@web5/crypto': 0.0.0-next-3cfc21d-20240920195338 + '@web5/dids': 0.0.0-next-3cfc21d-20240920195338 abstract-level: 1.0.4 ed25519-keygen: 0.4.11 isomorphic-ws: 5.0.0(ws@8.18.0) @@ -5655,18 +5738,42 @@ snapshots: - supports-color - ws - '@web5/api@0.10.0(ws@8.18.0)': + '@web5/agent@0.7.3(ws@8.18.0)': dependencies: - '@web5/agent': 0.4.1(ws@8.18.0) + '@noble/ciphers': 0.5.3 + '@scure/bip39': 1.2.2 + '@tbd54566975/dwn-sdk-js': 0.4.7 '@web5/common': 1.0.0 - '@web5/crypto': 1.0.0 - '@web5/dids': 1.1.0 - '@web5/user-agent': 0.4.1(ws@8.18.0) + '@web5/crypto': 1.0.4 + '@web5/dids': 1.1.4 + abstract-level: 1.0.4 + ed25519-keygen: 0.4.11 + isomorphic-ws: 5.0.0(ws@8.18.0) + level: 8.0.0 + ms: 2.1.3 + readable-web-to-node-stream: 3.0.2 + ulidx: 2.1.0 transitivePeerDependencies: - encoding - supports-color - ws + '@web5/api@0.0.0-next-3cfc21d-20240920195338(ws@8.18.0)': + dependencies: + '@web5/agent': 0.0.0-next-3cfc21d-20240920195338(ws@8.18.0) + '@web5/common': 1.0.2 + '@web5/crypto': 0.0.0-next-3cfc21d-20240920195338 + '@web5/dids': 0.0.0-next-3cfc21d-20240920195338 + '@web5/user-agent': 0.0.0-next-3cfc21d-20240920195338(ws@8.18.0) + transitivePeerDependencies: + - encoding + - supports-color + - ws + + '@web5/browser@0.0.0-next-3cfc21d-20240920195338': + dependencies: + '@web5/dids': 0.0.0-next-3cfc21d-20240920195338 + '@web5/common@1.0.0': dependencies: '@isaacs/ttlcache': 1.4.1 @@ -5681,14 +5788,29 @@ snapshots: multiformats: 13.1.0 readable-stream: 4.4.2 - '@web5/credentials@1.0.4': + '@web5/common@1.0.2': + dependencies: + '@isaacs/ttlcache': 1.4.1 + level: 8.0.1 + multiformats: 13.1.0 + readable-stream: 4.5.2 + + '@web5/credentials@1.1.1': dependencies: '@sphereon/pex': 3.3.3 '@web5/common': 1.0.1 - '@web5/crypto': 1.0.1 + '@web5/crypto': 1.0.4 '@web5/dids': 1.1.1 + jsonschema: 1.4.1 pako: 2.1.0 + '@web5/crypto@0.0.0-next-3cfc21d-20240920195338': + dependencies: + '@noble/ciphers': 0.5.3 + '@noble/curves': 1.3.0 + '@noble/hashes': 1.4.0 + '@web5/common': 1.0.2 + '@web5/crypto@1.0.0': dependencies: '@noble/ciphers': 0.4.1 @@ -5696,12 +5818,24 @@ snapshots: '@noble/hashes': 1.3.3 '@web5/common': 1.0.0 - '@web5/crypto@1.0.1': + '@web5/crypto@1.0.4': dependencies: - '@noble/ciphers': 0.4.1 + '@noble/ciphers': 0.5.3 '@noble/curves': 1.3.0 '@noble/hashes': 1.4.0 - '@web5/common': 1.0.0 + '@web5/common': 1.0.1 + + '@web5/dids@0.0.0-next-3cfc21d-20240920195338': + dependencies: + '@decentralized-identity/ion-sdk': 1.0.4 + '@dnsquery/dns-packet': 6.1.1 + '@web5/common': 1.0.2 + '@web5/crypto': 0.0.0-next-3cfc21d-20240920195338 + abstract-level: 1.0.4 + bencode: 4.0.0 + buffer: 6.0.3 + level: 8.0.1 + ms: 2.1.3 '@web5/dids@1.1.0': dependencies: @@ -5727,23 +5861,34 @@ snapshots: level: 8.0.1 ms: 2.1.3 - '@web5/dids@1.1.2': + '@web5/dids@1.1.4': dependencies: '@decentralized-identity/ion-sdk': 1.0.4 '@dnsquery/dns-packet': 6.1.1 '@web5/common': 1.0.0 - '@web5/crypto': 1.0.1 + '@web5/crypto': 1.0.4 abstract-level: 1.0.4 bencode: 4.0.0 buffer: 6.0.3 level: 8.0.1 ms: 2.1.3 - '@web5/user-agent@0.4.1(ws@8.18.0)': + '@web5/user-agent@0.0.0-next-3cfc21d-20240920195338(ws@8.18.0)': + dependencies: + '@web5/agent': 0.0.0-next-3cfc21d-20240920195338(ws@8.18.0) + '@web5/common': 1.0.2 + '@web5/crypto': 0.0.0-next-3cfc21d-20240920195338 + '@web5/dids': 0.0.0-next-3cfc21d-20240920195338 + transitivePeerDependencies: + - encoding + - supports-color + - ws + + '@web5/user-agent@0.6.3(ws@8.18.0)': dependencies: - '@web5/agent': 0.4.1(ws@8.18.0) + '@web5/agent': 0.7.3(ws@8.18.0) '@web5/common': 1.0.0 - '@web5/crypto': 1.0.0 + '@web5/crypto': 1.0.4 '@web5/dids': 1.1.0 transitivePeerDependencies: - encoding @@ -5781,7 +5926,7 @@ snapshots: acorn@8.12.1: {} ajv-formats@2.1.1(ajv@8.17.1): - dependencies: + optionalDependencies: ajv: 8.17.1 ajv@6.12.6: @@ -7076,6 +7221,8 @@ snapshots: jsonpointer@5.0.1: {} + jsonschema@1.4.1: {} + jwt-decode@3.1.2: {} keyv@4.5.4: @@ -7234,7 +7381,7 @@ snapshots: natural-compare@1.4.0: {} - next-themes@0.3.0(react-dom@18.3.1)(react@18.3.1): + next-themes@0.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7421,8 +7568,9 @@ snapshots: postcss-load-config@4.0.2(postcss@8.4.39): dependencies: lilconfig: 3.1.2 - postcss: 8.4.39 yaml: 2.4.5 + optionalDependencies: + postcss: 8.4.39 postcss-nested@6.0.1(postcss@8.4.39): dependencies: @@ -7495,6 +7643,10 @@ snapshots: punycode@2.3.1: {} + qrcode.react@4.0.1(react@18.3.1): + dependencies: + react: 18.3.1 + qs@6.12.3: dependencies: side-channel: 1.0.6 @@ -7543,22 +7695,24 @@ snapshots: react-remove-scroll-bar@2.3.6(@types/react@18.3.3)(react@18.3.1): dependencies: - '@types/react': 18.3.3 react: 18.3.1 react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) tslib: 2.6.3 + optionalDependencies: + '@types/react': 18.3.3 react-remove-scroll@2.5.7(@types/react@18.3.3)(react@18.3.1): dependencies: - '@types/react': 18.3.3 react: 18.3.1 react-remove-scroll-bar: 2.3.6(@types/react@18.3.3)(react@18.3.1) react-style-singleton: 2.2.1(@types/react@18.3.3)(react@18.3.1) tslib: 2.6.3 use-callback-ref: 1.3.2(@types/react@18.3.3)(react@18.3.1) use-sidecar: 1.1.2(@types/react@18.3.3)(react@18.3.1) + optionalDependencies: + '@types/react': 18.3.3 - react-router-dom@6.25.1(react-dom@18.3.1)(react@18.3.1): + react-router-dom@6.25.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@remix-run/router': 1.18.0 react: 18.3.1 @@ -7572,11 +7726,12 @@ snapshots: react-style-singleton@2.2.1(@types/react@18.3.3)(react@18.3.1): dependencies: - '@types/react': 18.3.3 get-nonce: 1.0.1 invariant: 2.2.4 react: 18.3.1 tslib: 2.6.3 + optionalDependencies: + '@types/react': 18.3.3 react@18.3.1: dependencies: @@ -7813,7 +7968,7 @@ snapshots: smob@1.5.0: {} - sonner@1.5.0(react-dom@18.3.1)(react@18.3.1): + sonner@1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -8203,16 +8358,18 @@ snapshots: use-callback-ref@1.3.2(@types/react@18.3.3)(react@18.3.1): dependencies: - '@types/react': 18.3.3 react: 18.3.1 tslib: 2.6.3 + optionalDependencies: + '@types/react': 18.3.3 use-sidecar@1.1.2(@types/react@18.3.3)(react@18.3.1): dependencies: - '@types/react': 18.3.3 detect-node-es: 1.1.0 react: 18.3.1 tslib: 2.6.3 + optionalDependencies: + '@types/react': 18.3.3 utf8-codec@1.0.0: {} @@ -8230,34 +8387,36 @@ snapshots: varint@6.0.0: {} - vite-plugin-node-stdlib-browser@0.2.1(node-stdlib-browser@1.2.0)(rollup@2.79.1)(vite@5.3.4): + vite-plugin-node-stdlib-browser@0.2.1(node-stdlib-browser@1.2.0)(rollup@2.79.1)(vite@5.3.4(@types/node@20.14.11)(terser@5.31.3)): dependencies: '@rollup/plugin-inject': 5.0.5(rollup@2.79.1) node-stdlib-browser: 1.2.0 - vite: 5.3.4(@types/node@20.14.11) + vite: 5.3.4(@types/node@20.14.11)(terser@5.31.3) transitivePeerDependencies: - rollup - vite-plugin-pwa@0.20.0(@vite-pwa/assets-generator@0.2.4)(vite@5.3.4)(workbox-build@7.1.1)(workbox-window@7.1.0): + vite-plugin-pwa@0.20.0(@vite-pwa/assets-generator@0.2.4)(vite@5.3.4(@types/node@20.14.11)(terser@5.31.3))(workbox-build@7.1.1(@types/babel__core@7.20.5))(workbox-window@7.1.0): dependencies: - '@vite-pwa/assets-generator': 0.2.4 debug: 4.3.5 fast-glob: 3.3.2 pretty-bytes: 6.1.1 - vite: 5.3.4(@types/node@20.14.11) - workbox-build: 7.1.1 + vite: 5.3.4(@types/node@20.14.11)(terser@5.31.3) + workbox-build: 7.1.1(@types/babel__core@7.20.5) workbox-window: 7.1.0 + optionalDependencies: + '@vite-pwa/assets-generator': 0.2.4 transitivePeerDependencies: - supports-color - vite@5.3.4(@types/node@20.14.11): + vite@5.3.4(@types/node@20.14.11)(terser@5.31.3): dependencies: - '@types/node': 20.14.11 esbuild: 0.21.5 postcss: 8.4.39 rollup: 4.18.1 optionalDependencies: + '@types/node': 20.14.11 fsevents: 2.3.3 + terser: 5.31.3 vm-browserify@1.1.2: {} @@ -8307,13 +8466,13 @@ snapshots: dependencies: workbox-core: 7.1.0 - workbox-build@7.1.1: + workbox-build@7.1.1(@types/babel__core@7.20.5): dependencies: '@apideck/better-ajv-errors': 0.3.6(ajv@8.17.1) '@babel/core': 7.24.9 '@babel/preset-env': 7.24.8(@babel/core@7.24.9) '@babel/runtime': 7.24.8 - '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.9)(rollup@2.79.1) + '@rollup/plugin-babel': 5.3.1(@babel/core@7.24.9)(@types/babel__core@7.20.5)(rollup@2.79.1) '@rollup/plugin-node-resolve': 15.2.3(rollup@2.79.1) '@rollup/plugin-replace': 2.4.2(rollup@2.79.1) '@rollup/plugin-terser': 0.4.4(rollup@2.79.1) diff --git a/javascript/dwa-starter-react-vite/src/components/connect/connect-pin.tsx b/javascript/dwa-starter-react-vite/src/components/connect/connect-pin.tsx new file mode 100644 index 00000000..60b30933 --- /dev/null +++ b/javascript/dwa-starter-react-vite/src/components/connect/connect-pin.tsx @@ -0,0 +1,78 @@ +import { DeleteIcon, Trash2Icon } from "lucide-react" +import { Input } from "../ui/input" +import { Typography } from "../ui/typography" + +interface ConnectPinProps { + value: string; + onChange: (value: string) => void; + close: () => void; + submit: (pin: string) => void; +} + +const ConnectPin: React.FC = ({ onChange, value, close, submit }) => { + + const submitPin = () => { + if (value.length === 0) { + return; + } + submit(value) + } + + return (
+ Please enter the PIN on your wallet +
+ +
+
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => ( + + ))} + + + + {value.length > 0 && ( + + ) || ( + + )} +
+
) +} + +export default ConnectPin; \ No newline at end of file diff --git a/javascript/dwa-starter-react-vite/src/components/connect/connect-qr.tsx b/javascript/dwa-starter-react-vite/src/components/connect/connect-qr.tsx new file mode 100644 index 00000000..1e8fc60a --- /dev/null +++ b/javascript/dwa-starter-react-vite/src/components/connect/connect-qr.tsx @@ -0,0 +1,23 @@ +import { QRCodeCanvas } from "qrcode.react"; +import { Typography } from "../ui/typography"; +import { Button } from "../ui/button"; +import { XIcon } from "lucide-react"; + +interface ConnectQRProps { + value: string; + close: () => void; +} + +const ConnectQR: React.FC = ({ close, value }) => { + return (
+ + Scan QR Code + + +
+ +
+
) +} + +export default ConnectQR; \ No newline at end of file diff --git a/javascript/dwa-starter-react-vite/src/components/connect/connect-selector.tsx b/javascript/dwa-starter-react-vite/src/components/connect/connect-selector.tsx new file mode 100644 index 00000000..77ca3535 --- /dev/null +++ b/javascript/dwa-starter-react-vite/src/components/connect/connect-selector.tsx @@ -0,0 +1,358 @@ +import { Loader2Icon, User2Icon, Wallet2Icon, XIcon } from "lucide-react"; +import { Button } from "../ui/button" +import { Typography } from "../ui/typography" +import { useWeb5 } from "@/web5"; +import { useEffect, useState } from "react"; +import { Input } from "../ui/input"; +import { ConnectOptions, Web5ConnectResult } from "@web5/api"; +import { DwnDataEncodedRecordsWriteMessage, WalletConnect } from "@web5/agent"; +import ConnectQR from "./connect-qr"; +import ConnectPin from "./connect-pin"; +import { profileDefinition, tasksProtocolDefinition } from "@/web5/protocols"; +import { toastError } from "@/lib/utils"; +import { Convert } from '@web5/common'; +import { PortableDid } from "@web5/dids"; + +const popupContent = ` + + + + + + Connecting... + + + +
+
+
+
+
Locating wallets...
+
+ + +`; + +interface ConnectSelectorProps { + close : () => void; +} + +type ConnectState = 'init' | 'wallet' | 'showQR' | 'showPin' | 'loading' | 'done'; + +const ConnectSelector: React.FC = ({ + close, +}) => { + const { connect, walletConnect } = useWeb5(); + + const [ state, setState ] = useState('loading'); + const [ qrCode, setQrCode ] = useState(''); + const [ pin, setPin ] = useState(''); + + useEffect(() => { + if (qrCode.length > 0) { + setState('showQR'); + } + }, [ qrCode ]); + + useEffect(() => { + if (state === 'done') { + setTimeout(close, 500); + } + },[ state, close ]); + + + useEffect(() => { + if (connect !== undefined && walletConnect !== undefined) { + setState('init'); + } + }, [ connect, walletConnect ]); + + const createDid = async () => { + if (!connect) { + return; + } + + setState('loading'); + try { + await connect(); + } catch(error) { + toastError('Error creating new DID', error); + } finally{ + close(); + } + } + + const submitPin = () => { + if (pin.length === 0) { + return; + } + setState('loading'); + postMessage({ type: 'pinSubmitted', pin }, window.parent.origin); + } + + + return (
+ {state === 'loading' && } + {state === 'init' &&
+
+ Connect to a Wallet +
+
+ + + +
+
} + {state === 'wallet' && } + {state === 'showQR' && } + {state === 'showPin' && } + {state === 'done' &&
Done
} +
) +} + +interface WalletSelectorProps { + setQrCodeText : (text: string) => void; + walletConnect : (options: ConnectOptions) => Promise; + setState : (state: ConnectState) => void; +} + +const WalletSelector: React.FC = ({ + setQrCodeText, + walletConnect, + setState, +}) => { + const { processDelegateIdentity } = useWeb5(); + + const [ isLoading, setIsloading ] = useState(false); + const [ selectingWallet, setSelectingWallet ] = useState(false); + const [ didInputValue, setDidInputValue ] = useState(''); + const [ popup, setPopup ] = useState(null); + const [ did, setDid ] = useState(''); + const [ wallets, setWallets ] = useState([]); + + const displayWalletLinkQR = async () => { + setState('loading'); + + try { + await walletConnect({ + connectServerUrl: "https://dwn.tbddev.org/latest/connect", + walletUri: "web5://connect", + permissionRequests: [{ protocolDefinition: profileDefinition }, { protocolDefinition: tasksProtocolDefinition }], + onWalletUriReady: (text: string) => { + setQrCodeText(text); + }, + validatePin: async () => { + setState('showPin'); + + return new Promise((resolve) => { + const eventListener = (event: MessageEvent) => { + if (event.data.type === 'pinSubmitted') { + removeEventListener('message', eventListener); + resolve(event.data.pin); + } + } + + addEventListener('message', eventListener); + }); + }, + }) + } catch(error) { + toastError('Error connecting to wallet', error); + } finally { + setState('done'); + } + } + + const requiredPermissions = () => { + const request = [tasksProtocolDefinition, profileDefinition]; + return request.map(definition => WalletConnect.createPermissionRequestForProtocol({ definition, permissions: [ + 'read', 'write', 'delete', 'query', 'subscribe' + ] })); + } + + const selectWallet = async (walletDomain: string) => { + setSelectingWallet(true); + try { + const width = 500; + const height = 600; + const left = (screen.width - width) / 2; + const top = (screen.height - height) / 2; + + const popup = window.open('', '_blank', `popup=true,width=${width},height=${height},left=${left},top=${top}`); + popup?.document.write(popupContent); + setPopup(popup); + + const messageListener = (event: MessageEvent<{ type: string, grants?: DwnDataEncodedRecordsWriteMessage[], delegateDid?: PortableDid}>) => { + const { type, grants, delegateDid } = event.data; + if (event.origin === walletDomain){ + if (type === 'dweb-connect-loaded') { + popup?.postMessage({ + type: 'dweb-connect-authorization-request', + did, + permissions: requiredPermissions() + }, walletDomain); + } else if (type === 'dweb-connect-authorization-response') { + window.removeEventListener('message', messageListener); + if (processDelegateIdentity) { + processDelegateIdentity(did, delegateDid!, grants!); + setState('done'); + } + } + } + } + + window.addEventListener('message', messageListener); + const checkClosed = setInterval(() => { + if (popup?.closed) { + clearInterval(checkClosed); + window.removeEventListener('message', messageListener); + } + }, 500); + popup!.location.href = walletDomain + '/dweb-connect#origin=' + location.origin; + } catch(error) { + // Set error message somewhere + setTimeout(() => popup?.close(), 500); + + setDid(''); + setPopup(null); + setWallets([]); + } finally { + setSelectingWallet(false); + setWallets([]); + setIsloading(false); + } + } + + const didInput = async (e: React.ChangeEvent) => { + const didInputRegex = /(?:[^@]*@)?(did:[a-z0-9]+:[a-zA-Z0-9-]+)/; + const httpInputRegex = /https?:\/\/[a-zA-Z0-9\-.]+/; + + setDidInputValue(e.target.value); + const didMatch = e.target.value.match(didInputRegex); + const httpMatch = e.target.value.match(httpInputRegex); + + if (e.isTrusted && httpMatch) { + setIsloading(true); + const domain = httpMatch[0]; + return selectWallet(domain); + } + + if (e.isTrusted && didMatch) { + setIsloading(true); + const did = didMatch[1]; + setDid(did); + + try { + const connectData = await fetch( + `https://dweb/${did}/read/protocols/${Convert.string('https://areweweb5yet.com/protocols/profile').toBase64Url()}/connect` + ); + const connectDataJson = await connectData.json(); + const wallets = connectDataJson?.webWallets as string[]; + if (!wallets?.length) return; + if (wallets.length === 1) { + return selectWallet(wallets[0]); + } + + setWallets(wallets); + + } catch(error) { + setDid(''); + setWallets([]); + setIsloading(false); + } + } + } + + return (isLoading &&
+ +
||
+ {wallets.length > 0 &&
+ {wallets.map(wallet =>
+ +
)} +
} + {wallets.length === 0 &&
+ + -or- + +
} +
) +} + +export default ConnectSelector; \ No newline at end of file diff --git a/javascript/dwa-starter-react-vite/src/components/todo-list/todo-list.tsx b/javascript/dwa-starter-react-vite/src/components/todo-list/todo-list.tsx index 1f1a7f8d..c13029de 100644 --- a/javascript/dwa-starter-react-vite/src/components/todo-list/todo-list.tsx +++ b/javascript/dwa-starter-react-vite/src/components/todo-list/todo-list.tsx @@ -17,7 +17,6 @@ export const TodoList = () => { const [isLoading, setIsLoading] = useState(false); const todoDwnRepository = useMemo(() => { - console.info("todoDwnRepository useMemo set dwn", { dwn }); if (!dwn) { return undefined; } @@ -39,7 +38,6 @@ export const TodoList = () => { }, [todoDwnRepository]); useEffect(() => { - console.info("todoDwnRepository loadTasks effect"); if (todoDwnRepository) { loadTasks(); } diff --git a/javascript/dwa-starter-react-vite/src/lib/todo-dwn-repository.ts b/javascript/dwa-starter-react-vite/src/lib/todo-dwn-repository.ts index b2de1619..572fd642 100644 --- a/javascript/dwa-starter-react-vite/src/lib/todo-dwn-repository.ts +++ b/javascript/dwa-starter-react-vite/src/lib/todo-dwn-repository.ts @@ -1,7 +1,6 @@ +import { tasksProtocolDefinition } from "@/web5/protocols"; import { DwnApi } from "@web5/api"; -const TASK_SCHEMA = "https://schema.org/TaskSample"; - export interface Task { id?: string; title: string; @@ -39,9 +38,14 @@ export class TodoDwnRepository { const { status, record } = await this.dwn.records.create({ data: task, message: { - schema: TASK_SCHEMA, - dataFormat: "application/json", + protocol: tasksProtocolDefinition.protocol, + protocolPath: "task", + schema: tasksProtocolDefinition.types.task.schema, + dataFormat: tasksProtocolDefinition.types.task.dataFormats[0], published: true, + tags: { + completed: task.completed, + } }, }); if (status.code !== 202) { @@ -67,6 +71,9 @@ export class TodoDwnRepository { const { status } = await record.update({ data, + tags: { + completed: task.completed, + } }); if (status.code !== 202) { throw Error(status.detail); @@ -85,20 +92,24 @@ export class TodoDwnRepository { async findTaskRecord(recordId: string) { const { record } = await this.dwn.records.read({ + protocol: tasksProtocolDefinition.protocol, message: { filter: { recordId, }, }, }); + return record.id ? record : undefined; } async listTasksRecords() { const { records } = await this.dwn.records.query({ + protocol: tasksProtocolDefinition.protocol, message: { filter: { - schema: TASK_SCHEMA, + protocol: tasksProtocolDefinition.protocol, + protocolPath: "task", dataFormat: "application/json", }, }, diff --git a/javascript/dwa-starter-react-vite/src/pages/home-page.tsx b/javascript/dwa-starter-react-vite/src/pages/home-page.tsx index a6f3d925..aeefe90e 100644 --- a/javascript/dwa-starter-react-vite/src/pages/home-page.tsx +++ b/javascript/dwa-starter-react-vite/src/pages/home-page.tsx @@ -4,12 +4,19 @@ import { Web5Connection } from "@/web5/Web5Connection"; import { useWeb5 } from "@/web5"; import { Typography } from "@/components/ui/typography"; import { TodoList } from "@/components/todo-list"; +import { useEffect } from "react"; /** * Home page: landing page with invitation to connect */ export const HomePage = () => { - const { isConnected } = useWeb5(); + const { isConnected, previouslyConnected, connect, isConnecting } = useWeb5(); + + useEffect(() => { + if (connect && !isConnecting && !isConnected && previouslyConnected === true) { + connect(); + } + }, [ previouslyConnected, connect, isConnected, isConnecting ]); return (
diff --git a/javascript/dwa-starter-react-vite/src/sw.ts b/javascript/dwa-starter-react-vite/src/sw.ts index 644d4592..e33d80bc 100644 --- a/javascript/dwa-starter-react-vite/src/sw.ts +++ b/javascript/dwa-starter-react-vite/src/sw.ts @@ -1,4 +1,6 @@ /// +import { activatePolyfills } from "@web5/browser"; + import { cleanupOutdatedCaches, createHandlerBoundToURL, @@ -6,10 +8,6 @@ import { } from "workbox-precaching"; import { NavigationRoute, registerRoute } from "workbox-routing"; -// TODO: review @web5/api process issue -import { activatePolyfills } from "./web-features"; -// import { activatePolyfills } from "@web5/api"; - declare let self: ServiceWorkerGlobalScope; self.addEventListener("message", (event) => { diff --git a/javascript/dwa-starter-react-vite/src/web-features.ts b/javascript/dwa-starter-react-vite/src/web-features.ts deleted file mode 100644 index f3fce59b..00000000 --- a/javascript/dwa-starter-react-vite/src/web-features.ts +++ /dev/null @@ -1,489 +0,0 @@ -// @ts-nocheck - -/* - This file is run in dual environments to make installation of the Service Worker code easier. - Be mindful that code placed in any open excution space may be evaluated multiple times in different contexts, - so take care to gate additions to only activate code in the right env, such as a Service Worker scope or page window. -*/ - -import { UniversalResolver, DidDht, DidWeb } from "@web5/dids"; - -declare const ServiceWorkerGlobalScope: any; - -const DidResolver = new UniversalResolver({ didResolvers: [DidDht, DidWeb] }); -const didUrlRegex = /^https?:\/\/dweb\/([^/]+)\/?(.*)?$/; -const httpToHttpsRegex = /^http:/; -const trailingSlashRegex = /\/$/; - -// This is in place to prevent our `bundler-bonanza` repo from failing for Node CJS builds -// Not sure if this is working as expected in all environments, crated an issue -// TODO: https://github.com/TBD54566975/web5-js/issues/767 -function importMetaIfSupported() { - try { - return new Function("return import.meta")(); - } catch (_error) { - return undefined; - } -} - -async function getDwnEndpoints(did) { - const { didDocument } = await DidResolver.resolve(did); - const endpoints = didDocument?.service?.find( - (service) => service.type === "DecentralizedWebNode" - )?.serviceEndpoint; - return (Array.isArray(endpoints) ? endpoints : [endpoints]).filter((url) => - url.startsWith("http") - ); -} - -async function handleEvent(event, did, path, options) { - const drl = event.request.url - .replace(httpToHttpsRegex, "https:") - .replace(trailingSlashRegex, ""); - const responseCache = await caches.open("drl"); - const cachedResponse = await responseCache.match(drl); - if (cachedResponse) { - if (!navigator.onLine) return cachedResponse; - const match = await options?.onCacheCheck(event, drl); - if (match) { - const cacheTime = cachedResponse.headers.get("dwn-cache-time"); - if ( - cacheTime && - Date.now() < Number(cacheTime) + (Number(match.ttl) || 0) - ) { - return cachedResponse; - } - } - } - try { - if (!path) { - const response = await DidResolver.resolve(did); - return new Response(JSON.stringify(response), { - status: 200, - headers: { - "Content-Type": "application/json", - }, - }); - } else - return await fetchResource(event, did, drl, path, responseCache, options); - } catch (error) { - if (error instanceof Response) { - return error; - } - console.log(`Error in DID URL fetch: ${error}`); - return new Response("DID URL fetch error", { status: 500 }); - } -} - -async function fetchResource(event, did, drl, path, responseCache, options) { - const endpoints = await getDwnEndpoints(did); - if (!endpoints?.length) { - throw new Response( - "DWeb Node resolution failed: no valid endpoints found.", - { status: 530 } - ); - } - for (const endpoint of endpoints) { - try { - const url = `${endpoint.replace(trailingSlashRegex, "")}/${did}/${path}`; - const response = await fetch(url, { headers: event.request.headers }); - if (response.ok) { - const match = await options?.onCacheCheck(event, drl); - if (match) { - cacheResponse(drl, url, response, responseCache); - } - return response; - } - console.log(`DWN endpoint error: ${response.status}`); - return new Response("DWeb Node request failed", { - status: response.status, - }); - } catch (error) { - console.log(`DWN endpoint error: ${error}`); - return new Response("DWeb Node request failed: " + error, { - status: 500, - }); - } - } -} - -async function cacheResponse(drl, url, response, cache) { - const clonedResponse = response.clone(); - const headers = new Headers(clonedResponse.headers); - headers.append("dwn-cache-time", Date.now().toString()); - headers.append("dwn-composed-url", url); - const modifiedResponse = new Response(clonedResponse.body, { headers }); - cache.put(drl, modifiedResponse); -} - -/* Service Worker-based features */ - -async function installWorker(options: any = {}): Promise { - const workerSelf = self as any; - try { - // Check to see if we are in a Service Worker already, if so, proceed - // You can call the activatePolyfills() function in your own worker, or standalone as a root worker - if ( - typeof ServiceWorkerGlobalScope !== "undefined" && - workerSelf instanceof ServiceWorkerGlobalScope - ) { - workerSelf.skipWaiting(); - workerSelf.addEventListener("activate", (event) => { - // Claim clients to make the service worker take control immediately - event.waitUntil(workerSelf.clients.claim()); - }); - workerSelf.addEventListener("fetch", (event) => { - const match = event.request.url.match(didUrlRegex); - if (match) { - event.respondWith(handleEvent(event, match[1], match[2], options)); - } - }); - } - // If the code gets here, it is not a SW env, it is likely DOM, but check to be sure - else if (globalThis?.navigator?.serviceWorker) { - const registration = await navigator.serviceWorker.getRegistration("/"); - // You can only have one worker per path, so check to see if one is already registered - if (!registration) { - // @ts-ignore - const installUrl = - options.path || - (globalThis.document - ? document?.currentScript?.src - : importMetaIfSupported()?.url); - if (installUrl) - navigator.serviceWorker - .register(installUrl, { type: "module" }) - .catch((error) => { - console.error( - "DWeb networking feature installation failed: ", - error - ); - }); - } - } else { - throw new Error( - "DWeb networking features are not available for install in this environment" - ); - } - } catch (error) { - console.error("Error in installing networking features:", error); - } -} - -/* DOM Environment Features */ - -const loaderStyles = ` - .drl-loading-overlay { - position: fixed; - inset: 0; - display: flex; - flex-wrap: wrap; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: 22px; - color: #fff; - background: rgba(0, 0, 0, 0.75); - backdrop-filter: blur(15px); - -webkit-backdrop-filter: blur(15px); - z-index: 1000000; - } - - .drl-loading-overlay > div { - display: flex; - align-items: center; - justify-content: center; - } - - .drl-loading-spinner { - display: flex; - align-items: center; - justify-content: center; - } - - .drl-loading-spinner div { - position: relative; - width: 2em; - height: 2em; - margin: 0.1em 0.25em 0 0; - } - .drl-loading-spinner div::after, - .drl-loading-spinner div::before { - content: ''; - box-sizing: border-box; - width: 100%; - height: 100%; - border-radius: 50%; - border: 0.1em solid #FFF; - position: absolute; - left: 0; - top: 0; - opacity: 0; - animation: drl-loading-spinner 2s linear infinite; - } - .drl-loading-spinner div::after { - animation-delay: 1s; - } - - .drl-loading-overlay span { - --text-opacity: 2; - display: flex; - align-items: center; - margin: 2em auto 0; - padding: 0.2em 0.75em 0.25em; - text-align: center; - border-radius: 5em; - background: rgba(255 255 255 / 8%); - opacity: 0.8; - transition: opacity 0.3s ease; - cursor: pointer; - } - - .drl-loading-overlay span:focus { - opacity: 1; - } - - .drl-loading-overlay span:hover { - opacity: 1; - } - - .drl-loading-overlay span::before { - content: "✕ "; - margin: 0 0.4em 0 0; - color: red; - font-size: 65%; - font-weight: bold; - } - - .drl-loading-overlay span::after { - content: "stop"; - display: block; - font-size: 60%; - line-height: 0; - color: rgba(255 255 255 / 60%); - } - - .drl-loading-overlay.new-tab-overlay span::after { - content: "close"; - } - - @keyframes drl-loading-spinner { - 0% { - transform: scale(0); - opacity: 1; - } - 100% { - transform: scale(1); - opacity: 0; - } - } -`; -const tabContent = ` - - - - - - Loading DRL... - - - -
-
-
- Loading DRL -
- -
- - -`; - -let elementsInjected = false; -function injectElements() { - if (elementsInjected) return; - const style = document.createElement("style"); - style.innerHTML = ` - ${loaderStyles} - - .drl-loading-overlay { - opacity: 0; - transition: opacity 0.3s ease; - pointer-events: none; - } - - :root[drl-link-loading] .drl-loading-overlay { - opacity: 1; - pointer-events: all; - } - `; - document.head.append(style); - - const overlay = document.createElement("div"); - overlay.classList.add("drl-loading-overlay"); - overlay.innerHTML = ` -
-
- Loading DRL -
- - `; - overlay.lastElementChild.addEventListener("click", cancelNavigation); - document.body.prepend(overlay); - elementsInjected = true; -} - -function cancelNavigation() { - document.documentElement.removeAttribute("drl-link-loading"); - activeNavigation = null; -} - -let activeNavigation; -let linkFeaturesActive = false; -function addLinkFeatures() { - if (!linkFeaturesActive) { - document.addEventListener("click", async (event: any) => { - const anchor = event.target.closest("a"); - if (anchor) { - const href = anchor.href; - const match = href.match(didUrlRegex); - if (match) { - const did = match[1]; - const path = match[2]; - const openAsTab = anchor.target === "_blank"; - event.preventDefault(); - try { - let tab; - if (openAsTab) { - tab = window.open("", "_blank"); - tab.document.write(tabContent); - } else { - activeNavigation = path; - // this is to allow for cached DIDs to instantly load without any flash of loading UI - setTimeout( - () => - document.documentElement.setAttribute("drl-link-loading", ""), - 50 - ); - } - const endpoints = await getDwnEndpoints(did); - if (!endpoints.length) throw null; - const url = `${endpoints[0].replace( - trailingSlashRegex, - "" - )}/${did}/${path}`; - if (openAsTab) { - if (!tab.closed) tab.location.href = url; - } else if (activeNavigation === path) { - window.location.href = url; - } - } catch (e) { - if (activeNavigation === path) { - cancelNavigation(); - } - throw new Error( - `DID endpoint resolution failed for the DRL: ${href}` - ); - } - } - } - }); - - document.addEventListener("pointercancel", resetContextMenuTarget); - document.addEventListener("pointerdown", async (event: any) => { - const target = event.composedPath()[0]; - if ( - (event.pointerType === "mouse" && event.button === 2) || - (event.pointerType === "touch" && event.isPrimary) - ) { - resetContextMenuTarget(); - if (target && target?.src?.match(didUrlRegex)) { - contextMenuTarget = target; - target.__src__ = target.src; - const drl = target.src - .replace(httpToHttpsRegex, "https:") - .replace(trailingSlashRegex, ""); - const responseCache = await caches.open("drl"); - const response = await responseCache.match(drl); - const url = response.headers.get("dwn-composed-url"); - if (url) target.src = url; - target.addEventListener("pointerup", resetContextMenuTarget, { - once: true, - }); - } - } else if (target === contextMenuTarget) { - resetContextMenuTarget(); - } - }); - - linkFeaturesActive = true; - } -} - -let contextMenuTarget; -async function resetContextMenuTarget(e?: any) { - if (e?.type === "pointerup") { - await new Promise((r) => requestAnimationFrame(r)); - } - if (contextMenuTarget) { - contextMenuTarget.src = contextMenuTarget.__src__; - delete contextMenuTarget.__src__; - contextMenuTarget = null; - } -} - -/** - * Activates various polyfills to enable Web5 features in Web environments. - * - * @param {object} [options={}] - Configuration options to control the activation of polyfills. - * @param {boolean} [options.serviceWorker=true] - Option to avoid installation of the Service Worker. Defaults to true, installing the Service Worker. - * @param {boolean} [options.injectStyles=true] - Option to skip injection of styles for UI related UX polyfills. Defaults to true, injecting styles. - * @param {boolean} [options.links=true] - Option to skip activation of DRL link features. Defaults to true, activating link features. - * @param {function} [options.onCacheCheck] - Callback function to handle cache check events, allowing fine-grained control over what DRL request to cache, and for how long. - * @param {object} [options.onCacheCheck.event] - The event object passed to the callback. - * @param {object} [options.onCacheCheck.route] - The route object passed to the callback. - * @returns {object} [options.onCacheCheck.return] - The return object from the callback. - * @returns {number} [options.onCacheCheck.return.ttl] - Time-to-live for the cached DRL response, in milliseconds. - * - * @returns {void} - * - * @example - * // Activate all polyfills with default options, and cache every DRL for 1 minute - * activatePolyfills({ - * onCacheCheck(event, route){ - * return { - * ttl: 60_000 - * } - * } - * }); - * - * @example - * // Activate polyfills, but without Service Worker activation - * activatePolyfills({ serviceWorker: false }); - */ -export function activatePolyfills(options: any = {}) { - if (options.serviceWorker !== false) { - installWorker(options); - } - if (typeof window !== "undefined" && typeof window.document !== "undefined") { - if (options.injectStyles !== false) { - if (document.readyState !== "loading") injectElements(); - else { - document.addEventListener("DOMContentLoaded", injectElements, { - once: true, - }); - } - } - if (options.links !== false) addLinkFeatures(); - } -} diff --git a/javascript/dwa-starter-react-vite/src/web5/Web5Connection.tsx b/javascript/dwa-starter-react-vite/src/web5/Web5Connection.tsx index 591054ab..d28ab7d1 100644 --- a/javascript/dwa-starter-react-vite/src/web5/Web5Connection.tsx +++ b/javascript/dwa-starter-react-vite/src/web5/Web5Connection.tsx @@ -1,7 +1,9 @@ import { LogInIcon, Loader2Icon } from "lucide-react"; +import { useState } from "react"; import { Button } from "@/components/ui/button"; import { useWeb5 } from "./use-web5"; +import ConnectSelector from "@/components/connect/connect-selector"; interface Web5ConnectionProps { connectButtonClassName?: string; @@ -10,28 +12,59 @@ interface Web5ConnectionProps { export const Web5Connection = ({ connectButtonClassName, }: Web5ConnectionProps) => { - const { did, connect, isConnecting } = useWeb5(); + const { did, isConnecting } = useWeb5(); + const [isOpen, setIsOpen] = useState(false); + + const clearStorage = () => { + // Clear localStorage + localStorage.clear(); + + // Clear IndexedDB + indexedDB.databases().then(dbs => { + dbs.forEach(db => { + indexedDB.deleteDatabase(db.name!); + }); + }); + + window.location.reload(); + } if (did) { - return
Hi, {did.substring(0, 16)}...!
; + return
+
Hi, {did.substring(0, 16)}...!
+ +
; } else { return ( - + <> + + + {isOpen && } + ); } }; + +const ConnectionOption = ({ setIsOpen }: { setIsOpen: (isOpen:boolean) => void}) => { + return ( +
+ setIsOpen(false)} + /> +
) +} diff --git a/javascript/dwa-starter-react-vite/src/web5/Web5Provider.tsx b/javascript/dwa-starter-react-vite/src/web5/Web5Provider.tsx index f12cb937..c344a8d3 100644 --- a/javascript/dwa-starter-react-vite/src/web5/Web5Provider.tsx +++ b/javascript/dwa-starter-react-vite/src/web5/Web5Provider.tsx @@ -1,7 +1,10 @@ import React, { createContext, useEffect, useState } from "react"; -import { Web5, Web5ConnectResult } from "@web5/api"; +import { ConnectOptions, Web5, Web5ConnectResult } from "@web5/api"; +import { Web5UserAgent } from "@web5/user-agent"; import { installProtocols } from "./protocols"; +import { PortableDid } from "@web5/dids"; +import { DwnDataEncodedRecordsWriteMessage } from "@web5/agent"; declare global { interface Window { @@ -10,13 +13,17 @@ declare global { } interface Web5ContextProps { + previouslyConnected: boolean; protocolsInitialized: boolean; web5Connection?: Web5ConnectResult; connect?: () => Promise; + walletConnect?: (walletConnectOptions: ConnectOptions) => Promise; + processDelegateIdentity?: (did: string, portableDid: PortableDid, grants: DwnDataEncodedRecordsWriteMessage[]) => Promise; isConnecting: boolean; } export const Web5Context = createContext({ + previouslyConnected: false, isConnecting: false, protocolsInitialized: false, }); @@ -24,12 +31,29 @@ export const Web5Context = createContext({ export const Web5Provider: React.FC<{ children: React.ReactNode }> = ({ children, }) => { + + const [ previouslyConnected, setPreviouslyConnected ] = useState(false); const [protocolsInitialized, setProtocolsInitialized] = useState(false); const [isConnecting, setIsConnecting] = useState(false); const [web5Connection, setWeb5Connection] = useState< Web5ConnectResult | undefined >(undefined); + useEffect(() => { + const previouslyConnected = localStorage.getItem('previouslyConnected'); + if (previouslyConnected) { + setPreviouslyConnected(previouslyConnected === 'true'); + } + + window.addEventListener('storage', (event) => { + if (event.key === 'previouslyConnected') { + setPreviouslyConnected(event.newValue === 'true') + } + }); + + + }, [ setPreviouslyConnected ]); + useEffect(() => { if (web5Connection && !protocolsInitialized) { installProtocols(web5Connection.web5.dwn, web5Connection.did).then( @@ -40,6 +64,49 @@ export const Web5Provider: React.FC<{ children: React.ReactNode }> = ({ } }, [web5Connection, protocolsInitialized]); + const processDelegateIdentity = async (did: string, portableDid: PortableDid, grants: DwnDataEncodedRecordsWriteMessage[]) => { + setIsConnecting(true); + const userAgent = await Web5UserAgent.create(); + if (await userAgent.firstLaunch()) { + await userAgent.initialize({ password: 'insecure-static-phrase', dwnEndpoints: ['https://dwn.tbddev.org/latest' ]}); + } + await userAgent.start({ password: 'insecure-static-phrase' }); + // Import the delegated DID as an Identity in the User Agent. + // Setting the connectedDID in the metadata applies a relationship between the signer identity and the one it is impersonating. + const identity = await userAgent.identity.import({ portableIdentity: { + portableDid, + metadata : { + connectedDid: did, + name : 'Default', + tenant : portableDid.uri, + uri : portableDid.uri, + } + }}); + await userAgent.identity.manage({ portableIdentity: await identity.export() }); + + // Attempts to process the connected grants to be used by the delegateDID + // If the process fails, we want to clean up the identity + // the connected grants will return a de-duped array of protocol URIs that are used to register sync for those protocols + const protocols = await Web5.processConnectedGrants({ agent: userAgent, delegateDid: portableDid.uri, grants }); + await userAgent.sync.registerIdentity({ did, options: { protocols, delegateDid: portableDid.uri } }); + await userAgent.sync.sync('pull'); + const web5 = new Web5({ agent: userAgent, connectedDid: did, delegateDid: portableDid.uri }); + const connection = { web5, did }; + localStorage.setItem('previouslyConnected', 'true'); + setWeb5Connection(connection); + setIsConnecting(false); + return connection; + } + + const walletConnect = async (walletConnectOptions: ConnectOptions) => { + const connection = await Web5.connect({ walletConnectOptions, sync: '15s' }); + window.web5 = connection; + localStorage.setItem('previouslyConnected', 'true'); + setWeb5Connection(connection); + setIsConnecting(false); + return connection; + } + const connect = async () => { setIsConnecting(true); @@ -48,9 +115,11 @@ export const Web5Provider: React.FC<{ children: React.ReactNode }> = ({ techPreview: { dwnEndpoints: ["http://localhost:3000"], }, + sync: '15s', }; const connection = await Web5.connect(connectOptions); window.web5 = connection; + localStorage.setItem('previouslyConnected', 'true'); setWeb5Connection(connection); setIsConnecting(false); return connection; @@ -63,7 +132,10 @@ export const Web5Provider: React.FC<{ children: React.ReactNode }> = ({ return ( { diff --git a/javascript/dwa-starter-react-vite/src/web5/use-web5.ts b/javascript/dwa-starter-react-vite/src/web5/use-web5.ts index f833ce40..1bc99bdb 100644 --- a/javascript/dwa-starter-react-vite/src/web5/use-web5.ts +++ b/javascript/dwa-starter-react-vite/src/web5/use-web5.ts @@ -7,7 +7,7 @@ export const useWeb5 = () => { throw new Error("useWeb5 must be used within a Web5Provider"); } - const { web5Connection, isConnecting, connect } = context; + const { web5Connection, isConnecting, connect, previouslyConnected, walletConnect, processDelegateIdentity } = context; const isConnected = web5Connection !== undefined; @@ -18,5 +18,8 @@ export const useWeb5 = () => { dwn: web5Connection?.web5.dwn, did: web5Connection?.did, isConnected, + previouslyConnected, + walletConnect, + processDelegateIdentity }; };