@dxos/react-client 2.15.7 → 2.16.1
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:test.json +11 -12
- package/.rush/temp/shrinkwrap-deps.json +8 -7
- package/README.md +4 -4
- package/dist/src/containers/ClientInitializer.d.ts +8 -2
- package/dist/src/containers/ClientInitializer.d.ts.map +1 -1
- package/dist/src/containers/ClientInitializer.js +4 -7
- package/dist/src/containers/ClientInitializer.js.map +1 -1
- package/dist/src/containers/ClientProvider.d.ts +1 -2
- package/dist/src/containers/ClientProvider.d.ts.map +1 -1
- package/dist/src/containers/ClientProvider.js +2 -1
- package/dist/src/containers/ClientProvider.js.map +1 -1
- package/dist/src/containers/ClientProvider.test.js +3 -3
- package/dist/src/containers/ClientProvider.test.js.map +1 -1
- package/dist/src/containers/ProfileInitializer.d.ts +1 -2
- package/dist/src/containers/ProfileInitializer.d.ts.map +1 -1
- package/dist/src/containers/ProfileInitializer.js +2 -1
- package/dist/src/containers/ProfileInitializer.js.map +1 -1
- package/dist/src/containers/index.d.ts +3 -3
- package/dist/src/containers/index.d.ts.map +1 -1
- package/dist/src/containers/index.js +12 -9
- package/dist/src/containers/index.js.map +1 -1
- package/dist/src/hooks/client/useClient.d.ts.map +1 -1
- package/dist/src/hooks/client/useClient.js +2 -2
- package/dist/src/hooks/client/useClient.js.map +1 -1
- package/dist/src/hooks/client/useConfig.d.ts.map +1 -1
- package/dist/src/hooks/client/useConfig.js +2 -2
- package/dist/src/hooks/client/useConfig.js.map +1 -1
- package/dist/stories/helpers/ContactsSelector.js +1 -1
- package/dist/stories/helpers/ContactsSelector.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/react-client.build.log +5 -5
- package/src/containers/ClientInitializer.tsx +9 -4
- package/src/containers/ClientProvider.test.tsx +1 -1
- package/src/containers/ClientProvider.tsx +1 -3
- package/src/containers/ProfileInitializer.tsx +1 -3
- package/src/containers/index.ts +3 -3
- package/src/hooks/client/useClient.ts +2 -1
- package/src/hooks/client/useConfig.ts +2 -1
- package/stories/helpers/ContactsSelector.tsx +1 -1
- package/dist/src/util.d.ts +0 -2
- package/dist/src/util.d.ts.map +0 -1
- package/dist/src/util.js +0 -11
- package/dist/src/util.js.map +0 -1
- package/src/util.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.1",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -16,17 +16,18 @@
|
|
|
16
16
|
"test": "toolchain test"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@dxos/async": "2.
|
|
20
|
-
"@dxos/client": "2.
|
|
21
|
-
"@dxos/credentials": "2.
|
|
22
|
-
"@dxos/crypto": "2.
|
|
23
|
-
"@dxos/echo-db": "2.
|
|
24
|
-
"@dxos/util": "2.
|
|
19
|
+
"@dxos/async": "2.16.1",
|
|
20
|
+
"@dxos/client": "2.16.1",
|
|
21
|
+
"@dxos/credentials": "2.16.1",
|
|
22
|
+
"@dxos/crypto": "2.16.1",
|
|
23
|
+
"@dxos/echo-db": "2.16.1",
|
|
24
|
+
"@dxos/util": "2.16.1",
|
|
25
25
|
"@types/debug": "^4.1.1",
|
|
26
26
|
"assert": "^2.0.0",
|
|
27
27
|
"debug": "^4.1.1",
|
|
28
28
|
"react-display-name": "^0.2.5",
|
|
29
|
-
"use-subscription": "^1.4.1"
|
|
29
|
+
"use-subscription": "^1.4.1",
|
|
30
|
+
"@dxos/debug": "2.16.1"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@babel/cli": "^7.0.0",
|
package/react-client.build.log
CHANGED
|
@@ -2,10 +2,10 @@ Invoking: toolchain build:test
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
typescript
|
|
5
|
-
OK in
|
|
5
|
+
OK in 5186 ms
|
|
6
6
|
|
|
7
7
|
eslint
|
|
8
|
-
OK in
|
|
8
|
+
OK in 4856 ms
|
|
9
9
|
|
|
10
10
|
jest
|
|
11
11
|
PASS tests/config.test.ts
|
|
@@ -16,8 +16,8 @@ PASS src/containers/ClientProvider.test.tsx
|
|
|
16
16
|
Test Suites: 4 passed, 4 total
|
|
17
17
|
Tests: 8 passed, 8 total
|
|
18
18
|
Snapshots: 0 total
|
|
19
|
-
Time:
|
|
19
|
+
Time: 3.327 s
|
|
20
20
|
Ran all test suites.
|
|
21
|
-
OK in
|
|
21
|
+
OK in 3906 ms
|
|
22
22
|
|
|
23
|
-
CHECK COMPLETE in
|
|
23
|
+
CHECK COMPLETE in 13953 ms
|
|
@@ -8,7 +8,14 @@ import { Client, ClientConfig } from '@dxos/client';
|
|
|
8
8
|
import { MaybePromise } from '@dxos/util';
|
|
9
9
|
|
|
10
10
|
import { ErrorComponentProps, ErrorBoundary, ErrorCallbackType } from '../components';
|
|
11
|
-
import ClientProvider from './ClientProvider';
|
|
11
|
+
import { ClientProvider } from './ClientProvider';
|
|
12
|
+
|
|
13
|
+
interface ClientLoaderProps {
|
|
14
|
+
children?: ReactNode
|
|
15
|
+
config?: ClientConfig | (() => MaybePromise<ClientConfig>)
|
|
16
|
+
onInit?: (client: Client) => void
|
|
17
|
+
loaderComponent?: React.ComponentType
|
|
18
|
+
}
|
|
12
19
|
|
|
13
20
|
interface ClientLoaderProps {
|
|
14
21
|
children?: ReactNode
|
|
@@ -68,7 +75,7 @@ interface ClientInitializerProps {
|
|
|
68
75
|
* incorporating a top-level ErrorBoundary.
|
|
69
76
|
*/
|
|
70
77
|
// TODO(burdon): Rename.
|
|
71
|
-
const ClientInitializer = ({
|
|
78
|
+
export const ClientInitializer = ({
|
|
72
79
|
children,
|
|
73
80
|
config = {},
|
|
74
81
|
onError,
|
|
@@ -114,5 +121,3 @@ const ClientInitializer = ({
|
|
|
114
121
|
</ErrorBoundary>
|
|
115
122
|
);
|
|
116
123
|
};
|
|
117
|
-
|
|
118
|
-
export default ClientInitializer;
|
|
@@ -9,7 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import { Client } from '@dxos/client';
|
|
10
10
|
|
|
11
11
|
import { useClient } from '../hooks';
|
|
12
|
-
import ClientProvider from './ClientProvider';
|
|
12
|
+
import { ClientProvider } from './ClientProvider';
|
|
13
13
|
|
|
14
14
|
const TestComponent = () => {
|
|
15
15
|
const client = useClient();
|
|
@@ -17,7 +17,7 @@ export interface ClientProviderProps {
|
|
|
17
17
|
* Root component that provides the DXOS client instance to child components.
|
|
18
18
|
* To be used with `useClient` hook.
|
|
19
19
|
*/
|
|
20
|
-
const ClientProvider = ({ client, children }: ClientProviderProps) => {
|
|
20
|
+
export const ClientProvider = ({ client, children }: ClientProviderProps) => {
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
(window as any).__DXOS__ = client.getDevtoolsContext();
|
|
23
23
|
}, []);
|
|
@@ -28,5 +28,3 @@ const ClientProvider = ({ client, children }: ClientProviderProps) => {
|
|
|
28
28
|
</ClientContext.Provider>
|
|
29
29
|
);
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
export default ClientProvider;
|
|
@@ -11,7 +11,7 @@ import { useClient, useProfile } from '../hooks';
|
|
|
11
11
|
* @deprecated
|
|
12
12
|
*/
|
|
13
13
|
// TODO(burdon): Testing-only.
|
|
14
|
-
const ProfileInitializer = ({ children }: { children: React.ReactNode }) => {
|
|
14
|
+
export const ProfileInitializer = ({ children }: { children: React.ReactNode }) => {
|
|
15
15
|
const client = useClient();
|
|
16
16
|
const profile = useProfile();
|
|
17
17
|
|
|
@@ -27,5 +27,3 @@ const ProfileInitializer = ({ children }: { children: React.ReactNode }) => {
|
|
|
27
27
|
|
|
28
28
|
return <>{children}</>;
|
|
29
29
|
};
|
|
30
|
-
|
|
31
|
-
export default ProfileInitializer;
|
package/src/containers/index.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// Copyright 2020 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export * from './ClientInitializer';
|
|
6
|
+
export * from './ClientProvider';
|
|
7
|
+
export * from './ProfileInitializer';
|
|
@@ -24,7 +24,7 @@ export const ContactsSelector = ({ contacts, selected = '', onSelect }: {
|
|
|
24
24
|
labelId='contact-select-label'
|
|
25
25
|
onChange={(event: SelectChangeEvent) => onSelect(event.target.value)}
|
|
26
26
|
>
|
|
27
|
-
<MenuItem value=''
|
|
27
|
+
<MenuItem value=''>-</MenuItem>
|
|
28
28
|
{contacts.map(contact => (
|
|
29
29
|
<MenuItem key={contact.publicKey.toHex()} value={contact.publicKey.toHex()}>
|
|
30
30
|
{contact.displayName}
|
package/dist/src/util.d.ts
DELETED
package/dist/src/util.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAIA,wBAAgB,KAAK,CAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAE1C"}
|
package/dist/src/util.js
DELETED
package/dist/src/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,SAAgB,KAAK,CAAE,KAAY;IACjC,MAAM,KAAK,CAAC;AACd,CAAC;AAFD,sBAEC"}
|