@dxos/react-client 2.22.1-dev.132364de → 2.22.1-dev.4313d281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +3 -3
- package/.rush/temp/package-deps_build:test.json +3 -3
- package/dist/src/hooks/echo-queries/useParties.d.ts.map +1 -1
- package/dist/src/hooks/echo-queries/useParties.js +2 -4
- package/dist/src/hooks/echo-queries/useParties.js.map +1 -1
- package/dist/stories/halo-invitations.stories.d.ts.map +1 -1
- package/dist/stories/halo-invitations.stories.js +3 -3
- package/dist/stories/halo-invitations.stories.js.map +1 -1
- package/dist/stories/party-invitations.stories.d.ts.map +1 -1
- package/dist/stories/party-invitations.stories.js +3 -3
- package/dist/stories/party-invitations.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/react-client.build.log +33 -0
- package/src/hooks/echo-queries/useParties.ts +3 -4
- package/stories/halo-invitations.stories.tsx +4 -3
- package/stories/party-invitations.stories.tsx +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.22.1-dev.
|
|
3
|
+
"version": "2.22.1-dev.4313d281",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"types": "dist/src/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@dxos/async": "2.22.1-dev.
|
|
12
|
-
"@dxos/bot-factory-client": "2.22.1-dev.
|
|
13
|
-
"@dxos/client": "2.22.1-dev.
|
|
14
|
-
"@dxos/config": "2.22.1-dev.
|
|
15
|
-
"@dxos/credentials": "2.22.1-dev.
|
|
16
|
-
"@dxos/crypto": "2.22.1-dev.
|
|
17
|
-
"@dxos/debug": "2.22.1-dev.
|
|
18
|
-
"@dxos/echo-db": "2.22.1-dev.
|
|
19
|
-
"@dxos/util": "2.22.1-dev.
|
|
11
|
+
"@dxos/async": "2.22.1-dev.4313d281",
|
|
12
|
+
"@dxos/bot-factory-client": "2.22.1-dev.4313d281",
|
|
13
|
+
"@dxos/client": "2.22.1-dev.4313d281",
|
|
14
|
+
"@dxos/config": "2.22.1-dev.4313d281",
|
|
15
|
+
"@dxos/credentials": "2.22.1-dev.4313d281",
|
|
16
|
+
"@dxos/crypto": "2.22.1-dev.4313d281",
|
|
17
|
+
"@dxos/debug": "2.22.1-dev.4313d281",
|
|
18
|
+
"@dxos/echo-db": "2.22.1-dev.4313d281",
|
|
19
|
+
"@dxos/util": "2.22.1-dev.4313d281",
|
|
20
20
|
"assert": "^2.0.0",
|
|
21
21
|
"debug": "^4.3.3",
|
|
22
22
|
"react-display-name": "^0.2.5",
|
|
23
23
|
"use-subscription": "^1.4.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@dxos/esbuild-plugins": "2.22.1-dev.
|
|
26
|
+
"@dxos/esbuild-plugins": "2.22.1-dev.4313d281",
|
|
27
27
|
"@dxos/esbuild-server": "~1.7.4",
|
|
28
28
|
"@dxos/toolchain-node-library": "2.22.0",
|
|
29
29
|
"@mui/material": "^5.0.1",
|
package/react-client.build.log
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Invoking: toolchain build:test
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
typescript
|
|
5
|
+
OK in 6891 ms
|
|
6
|
+
|
|
7
|
+
eslint
|
|
8
|
+
OK in 6976 ms
|
|
9
|
+
|
|
10
|
+
mocha
|
|
11
|
+
This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
|
|
12
|
+
This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
ClientProvider
|
|
16
|
+
✓ Renders with children
|
|
17
|
+
✓ Provides the client
|
|
18
|
+
|
|
19
|
+
Client hook
|
|
20
|
+
✓ should throw when used outside a context
|
|
21
|
+
✓ should return client when used properly in a context
|
|
22
|
+
|
|
23
|
+
Config hook
|
|
24
|
+
✓ should throw when used outside a context
|
|
25
|
+
✓ should return default client config when no config is passed in a context
|
|
26
|
+
✓ should return custom client config when used properly in a context
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
7 passing (324ms)
|
|
30
|
+
|
|
31
|
+
OK in 2503 ms
|
|
32
|
+
|
|
33
|
+
CHECK COMPLETE in 16386 ms
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { PartyProxy } from '@dxos/client';
|
|
8
|
-
import {
|
|
8
|
+
import { PublicKeyLike } from '@dxos/crypto';
|
|
9
9
|
|
|
10
10
|
import { useClient } from '../client';
|
|
11
11
|
|
|
@@ -14,9 +14,8 @@ import { useClient } from '../client';
|
|
|
14
14
|
* Requires ClientContext to be set via ClientProvider.
|
|
15
15
|
*/
|
|
16
16
|
export const useParty = (partyKey?: PublicKeyLike): PartyProxy | undefined => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
return partyKey ? client.echo.getParty(PublicKey.from(partyKey)) : undefined;
|
|
17
|
+
const parties = useParties();
|
|
18
|
+
return parties.find(party => partyKey && party.key.equals(partyKey));
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
Box, Button, Divider, Paper, TextField, Toolbar
|
|
9
9
|
} from '@mui/material';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { Invitation } from '@dxos/client';
|
|
12
|
+
import { InvitationDescriptor } from '@dxos/echo-db';
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
ClientProvider,
|
|
@@ -49,7 +50,7 @@ const HaloInvitationContainer = () => {
|
|
|
49
50
|
setPin(invitation.secret.toString());
|
|
50
51
|
});
|
|
51
52
|
|
|
52
|
-
setInvitationCode(
|
|
53
|
+
setInvitationCode(invitation.descriptor.encode());
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
if (!client.halo.hasProfile()) {
|
|
@@ -106,7 +107,7 @@ const HaloAuthenticationContainer = () => {
|
|
|
106
107
|
|
|
107
108
|
const handleSubmit = async (invitationCode: string) => {
|
|
108
109
|
try {
|
|
109
|
-
const invitationDescriptor =
|
|
110
|
+
const invitationDescriptor = InvitationDescriptor.decode(invitationCode);
|
|
110
111
|
const invitation = await client.halo.acceptInvitation(invitationDescriptor);
|
|
111
112
|
setStatus({ identity: invitationDescriptor.identityKey?.toString(), invitation });
|
|
112
113
|
} catch (err: any) {
|
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
Box, Button, Divider, Paper, TextField, Toolbar
|
|
9
9
|
} from '@mui/material';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { PartyInvitation } from '@dxos/client';
|
|
12
12
|
import { PublicKey } from '@dxos/crypto';
|
|
13
|
+
import { InvitationDescriptor } from '@dxos/echo-db';
|
|
13
14
|
|
|
14
15
|
import {
|
|
15
16
|
ClientProvider,
|
|
@@ -69,7 +70,7 @@ const PartyInvitationContainer = () => {
|
|
|
69
70
|
invitation.connected.on(() => setPin(invitation.secret.toString()));
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
setInvitationCode(
|
|
73
|
+
setInvitationCode(invitation.descriptor.encode());
|
|
73
74
|
});
|
|
74
75
|
};
|
|
75
76
|
|
|
@@ -144,7 +145,7 @@ const PartyJoinContainer = () => {
|
|
|
144
145
|
setStatus({});
|
|
145
146
|
|
|
146
147
|
try {
|
|
147
|
-
const invitation = await client.echo.acceptInvitation(
|
|
148
|
+
const invitation = await client.echo.acceptInvitation(InvitationDescriptor.decode(invitationCode));
|
|
148
149
|
setStatus({ invitation });
|
|
149
150
|
|
|
150
151
|
const party = await invitation.getParty();
|