@dxos/react-client 2.19.12-dev.15870405 → 2.19.12-dev.c38ceb6d
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 +2 -2
- package/.rush/temp/package-deps_build:test.json +4 -4
- package/.rush/temp/shrinkwrap-deps.json +2 -40
- package/dist/src/hooks/invitations/index.d.ts +1 -1
- package/dist/src/hooks/invitations/index.d.ts.map +1 -1
- package/dist/src/hooks/invitations/index.js +1 -1
- package/dist/src/hooks/invitations/index.js.map +1 -1
- package/dist/src/hooks/invitations/usePartyInvitations.d.ts +4 -0
- package/dist/src/hooks/invitations/usePartyInvitations.d.ts.map +1 -0
- package/dist/src/hooks/invitations/usePartyInvitations.js +24 -0
- package/dist/src/hooks/invitations/usePartyInvitations.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/react-client.build.log +0 -34
- package/src/hooks/invitations/index.ts +1 -1
- package/src/hooks/invitations/usePartyInvitations.ts +27 -0
- package/src/hooks/invitations/useSecretGenerator.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.19.12-dev.
|
|
3
|
+
"version": "2.19.12-dev.c38ceb6d",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"types": "dist/src/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@dxos/async": "2.19.12-dev.
|
|
12
|
-
"@dxos/bot-factory-client": "2.19.12-dev.
|
|
13
|
-
"@dxos/client": "2.19.12-dev.
|
|
14
|
-
"@dxos/config": "2.19.12-dev.
|
|
15
|
-
"@dxos/credentials": "2.19.12-dev.
|
|
16
|
-
"@dxos/crypto": "2.19.12-dev.
|
|
17
|
-
"@dxos/debug": "2.19.12-dev.
|
|
18
|
-
"@dxos/echo-db": "2.19.12-dev.
|
|
19
|
-
"@dxos/util": "2.19.12-dev.
|
|
11
|
+
"@dxos/async": "2.19.12-dev.c38ceb6d",
|
|
12
|
+
"@dxos/bot-factory-client": "2.19.12-dev.c38ceb6d",
|
|
13
|
+
"@dxos/client": "2.19.12-dev.c38ceb6d",
|
|
14
|
+
"@dxos/config": "2.19.12-dev.c38ceb6d",
|
|
15
|
+
"@dxos/credentials": "2.19.12-dev.c38ceb6d",
|
|
16
|
+
"@dxos/crypto": "2.19.12-dev.c38ceb6d",
|
|
17
|
+
"@dxos/debug": "2.19.12-dev.c38ceb6d",
|
|
18
|
+
"@dxos/echo-db": "2.19.12-dev.c38ceb6d",
|
|
19
|
+
"@dxos/util": "2.19.12-dev.c38ceb6d",
|
|
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.19.12-dev.
|
|
27
|
-
"@dxos/esbuild-server": "~1.7.
|
|
26
|
+
"@dxos/esbuild-plugins": "2.19.12-dev.c38ceb6d",
|
|
27
|
+
"@dxos/esbuild-server": "~1.7.4",
|
|
28
28
|
"@dxos/toolchain-node-library": "2.19.11",
|
|
29
29
|
"@mui/material": "^5.0.1",
|
|
30
30
|
"@testing-library/react": "^11.0.4",
|
package/react-client.build.log
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
Invoking: toolchain build:test
|
|
2
|
-
|
|
3
|
-
ENOENT: no such file or directory, stat '/home/github/_work/protocols/protocols/packages/sdk/react-client/src/proto/gen'
|
|
4
|
-
|
|
5
|
-
typescript
|
|
6
|
-
OK in 15862 ms
|
|
7
|
-
|
|
8
|
-
eslint
|
|
9
|
-
OK in 13928 ms
|
|
10
|
-
|
|
11
|
-
mocha
|
|
12
|
-
This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
|
|
13
|
-
This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ClientProvider
|
|
17
|
-
✓ Renders with children
|
|
18
|
-
✓ Provides the client
|
|
19
|
-
|
|
20
|
-
Client hook
|
|
21
|
-
✓ should throw when used outside a context
|
|
22
|
-
✓ should return client when used properly in a context
|
|
23
|
-
|
|
24
|
-
Config hook
|
|
25
|
-
✓ should throw when used outside a context
|
|
26
|
-
✓ should return default client config when no config is passed in a context
|
|
27
|
-
✓ should return custom client config when used properly in a context
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
7 passing (469ms)
|
|
31
|
-
|
|
32
|
-
OK in 3324 ms
|
|
33
|
-
|
|
34
|
-
CHECK COMPLETE in 33123 ms
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { InvitationRequest } from '@dxos/client';
|
|
8
|
+
import { PublicKey } from '@dxos/crypto';
|
|
9
|
+
|
|
10
|
+
import { useParty } from '../echo-queries';
|
|
11
|
+
|
|
12
|
+
export const usePartyInvitations = (partyKey?: PublicKey) => {
|
|
13
|
+
const party = useParty(partyKey);
|
|
14
|
+
const [invitations, setInvitations] = useState<InvitationRequest[]>(party?.activeInvitations ?? []);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
return party?.invitationsUpdate.on(() => {
|
|
18
|
+
setInvitations([...party.activeInvitations]);
|
|
19
|
+
});
|
|
20
|
+
}, [party]);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setInvitations([]);
|
|
24
|
+
}, [party?.key.toHex()]);
|
|
25
|
+
|
|
26
|
+
return invitations;
|
|
27
|
+
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2021 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { generatePasscode } from '@dxos/credentials';
|
|
8
|
-
|
|
9
|
-
export const useSecretGenerator = (): [() => Promise<Buffer>, string | undefined, () => void] => {
|
|
10
|
-
const [pin, setPin] = useState<string>();
|
|
11
|
-
|
|
12
|
-
const provider = () => {
|
|
13
|
-
const pin = generatePasscode();
|
|
14
|
-
setPin(pin);
|
|
15
|
-
return Promise.resolve(Buffer.from(pin));
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return [provider, pin, () => setPin(undefined)];
|
|
19
|
-
};
|