@dxos/react-client 2.33.5-dev.6e3a1009 → 2.33.5-dev.b298094f
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 +13 -13
- package/.rush/temp/package-deps_build:test.json +13 -13
- package/.rush/temp/package-deps_prerelease.json +13 -13
- package/.rush/temp/shrinkwrap-deps.json +24 -15
- package/dist/src/banner.d.ts +1 -1
- package/dist/src/banner.d.ts.map +1 -1
- package/dist/src/banner.js +2 -2
- package/dist/src/banner.js.map +1 -1
- package/dist/src/hooks/client/useProfile.d.ts.map +1 -1
- package/dist/src/hooks/client/useProfile.js +1 -3
- package/dist/src/hooks/client/useProfile.js.map +1 -1
- package/dist/src/hooks/echo-selections/useSelection.js +1 -3
- package/dist/src/hooks/echo-selections/useSelection.js.map +1 -1
- package/dist/src/hooks/echo-selections/useSelection.test.js +1 -3
- package/dist/src/hooks/echo-selections/useSelection.test.js.map +1 -1
- package/dist/src/hooks/invitations/useHaloInvitations.d.ts.map +1 -1
- package/dist/src/hooks/invitations/useHaloInvitations.js +1 -3
- package/dist/src/hooks/invitations/useHaloInvitations.js.map +1 -1
- package/dist/src/hooks/util/useResultSet.d.ts +1 -1
- package/dist/src/hooks/util/useResultSet.d.ts.map +1 -1
- package/dist/src/hooks/util/useResultSet.js +4 -6
- package/dist/src/hooks/util/useResultSet.js.map +1 -1
- package/dist/src/hooks/wns/registry.d.ts.map +1 -1
- package/dist/src/hooks/wns/registry.js +1 -3
- package/dist/src/hooks/wns/registry.js.map +1 -1
- package/dist/stories/client.stories.d.ts.map +1 -1
- package/dist/stories/client.stories.js +4 -8
- package/dist/stories/client.stories.js.map +1 -1
- package/dist/stories/halo-recovery.stories.d.ts.map +1 -1
- package/dist/stories/halo-recovery.stories.js +6 -8
- package/dist/stories/halo-recovery.stories.js.map +1 -1
- package/dist/stories/helpers/ContactsSelector.d.ts.map +1 -1
- package/dist/stories/helpers/ContactsSelector.js +5 -7
- package/dist/stories/helpers/ContactsSelector.js.map +1 -1
- package/dist/stories/helpers/JsonPanel.d.ts.map +1 -1
- package/dist/stories/helpers/JsonPanel.js +7 -9
- package/dist/stories/helpers/JsonPanel.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/out/book/esbuild-server-book.js +854 -1024
- package/package.json +13 -13
- package/src/banner.ts +2 -2
- package/src/hooks/client/useProfile.ts +1 -3
- package/src/hooks/echo-selections/useSelection.test.tsx +1 -3
- package/src/hooks/echo-selections/useSelection.ts +1 -5
- package/src/hooks/invitations/useHaloInvitations.ts +1 -3
- package/src/hooks/util/useResultSet.ts +4 -6
- package/src/hooks/wns/registry.ts +1 -3
- package/stories/client.stories.tsx +6 -10
- package/stories/halo-recovery.stories.tsx +3 -5
- package/stories/helpers/ContactsSelector.tsx +3 -5
- package/stories/helpers/JsonPanel.tsx +3 -5
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.33.5-dev.
|
|
3
|
+
"version": "2.33.5-dev.b298094f",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "DXOS.org",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"types": "dist/src/index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@dxos/async": "2.33.5-dev.
|
|
11
|
-
"@dxos/bot-factory-client": "2.33.5-dev.
|
|
12
|
-
"@dxos/client": "2.33.5-dev.
|
|
13
|
-
"@dxos/config": "2.33.5-dev.
|
|
14
|
-
"@dxos/credentials": "2.33.5-dev.
|
|
15
|
-
"@dxos/crypto": "2.33.5-dev.
|
|
16
|
-
"@dxos/debug": "2.33.5-dev.
|
|
17
|
-
"@dxos/echo-db": "2.33.5-dev.
|
|
18
|
-
"@dxos/network-manager": "2.33.5-dev.
|
|
19
|
-
"@dxos/react-async": "2.33.5-dev.
|
|
20
|
-
"@dxos/util": "2.33.5-dev.
|
|
10
|
+
"@dxos/async": "2.33.5-dev.b298094f",
|
|
11
|
+
"@dxos/bot-factory-client": "2.33.5-dev.b298094f",
|
|
12
|
+
"@dxos/client": "2.33.5-dev.b298094f",
|
|
13
|
+
"@dxos/config": "2.33.5-dev.b298094f",
|
|
14
|
+
"@dxos/credentials": "2.33.5-dev.b298094f",
|
|
15
|
+
"@dxos/crypto": "2.33.5-dev.b298094f",
|
|
16
|
+
"@dxos/debug": "2.33.5-dev.b298094f",
|
|
17
|
+
"@dxos/echo-db": "2.33.5-dev.b298094f",
|
|
18
|
+
"@dxos/network-manager": "2.33.5-dev.b298094f",
|
|
19
|
+
"@dxos/react-async": "2.33.5-dev.b298094f",
|
|
20
|
+
"@dxos/util": "2.33.5-dev.b298094f",
|
|
21
21
|
"assert": "^2.0.0",
|
|
22
22
|
"debug": "^4.3.3",
|
|
23
23
|
"use-subscription": "^1.4.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@dxos/esbuild-plugins": "~2.28.7",
|
|
27
|
-
"@dxos/eslint-plugin": "~1.0.
|
|
27
|
+
"@dxos/eslint-plugin": "~1.0.33",
|
|
28
28
|
"@dxos/protocols-toolchain": "2.33.4",
|
|
29
29
|
"@mui/material": "^5.4.2",
|
|
30
30
|
"@testing-library/react": "^11.0.4",
|
package/src/banner.ts
CHANGED
|
@@ -15,11 +15,11 @@ const BANNER = (client: Client) => '\n' +
|
|
|
15
15
|
|
|
16
16
|
let bannerPrinted = false;
|
|
17
17
|
|
|
18
|
-
export
|
|
18
|
+
export const printBanner = (client: Client) => {
|
|
19
19
|
if (bannerPrinted) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
bannerPrinted = true;
|
|
24
24
|
console.log(BANNER(client));
|
|
25
|
-
}
|
|
25
|
+
};
|
|
@@ -14,9 +14,7 @@ export const useProfile = () => {
|
|
|
14
14
|
const client = useClient();
|
|
15
15
|
const [profile, setProfile] = useState(() => client.halo.profile);
|
|
16
16
|
|
|
17
|
-
useEffect(() =>
|
|
18
|
-
return client.halo.subscribeToProfile(() => setProfile(client.halo.profile));
|
|
19
|
-
}, [client]);
|
|
17
|
+
useEffect(() => client.halo.subscribeToProfile(() => setProfile(client.halo.profile)), [client]);
|
|
20
18
|
|
|
21
19
|
return profile;
|
|
22
20
|
};
|
|
@@ -23,9 +23,7 @@ const useTestComponents = async () => {
|
|
|
23
23
|
await client.halo.createProfile();
|
|
24
24
|
|
|
25
25
|
const party = await client.echo.createParty();
|
|
26
|
-
const items = await Promise.all(Array.from({ length: count }).map(async () => {
|
|
27
|
-
return await party.database.createItem({ type: TYPE_EXAMPLE });
|
|
28
|
-
}));
|
|
26
|
+
const items = await Promise.all(Array.from({ length: count }).map(async () => await party.database.createItem({ type: TYPE_EXAMPLE })));
|
|
29
27
|
expect(items.length).toBe(count);
|
|
30
28
|
|
|
31
29
|
return { client, party };
|
|
@@ -81,8 +81,4 @@ export const useReducer = <T extends Entity<any>, R> (
|
|
|
81
81
|
/**
|
|
82
82
|
* @param value Selection or SelectionResult from hook.
|
|
83
83
|
*/
|
|
84
|
-
const coerceSelection = <T extends Entity>(
|
|
85
|
-
value: Selection<T> | SelectionResult<T> | Falsy
|
|
86
|
-
): SelectionResult<T> | undefined => {
|
|
87
|
-
return !value ? undefined : value instanceof Selection ? value.exec() : value;
|
|
88
|
-
};
|
|
84
|
+
const coerceSelection = <T extends Entity>(value: Selection<T> | SelectionResult<T> | Falsy): SelectionResult<T> | undefined => !value ? undefined : value instanceof Selection ? value.exec() : value;
|
|
@@ -6,6 +6,4 @@ import { Client, HaloProxy } from '@dxos/client';
|
|
|
6
6
|
|
|
7
7
|
import { useInvitations } from './useInvitations';
|
|
8
8
|
|
|
9
|
-
export const useHaloInvitations = (client: Client) =>
|
|
10
|
-
return useInvitations((client.halo as HaloProxy).invitationProxy);
|
|
11
|
-
};
|
|
9
|
+
export const useHaloInvitations = (client: Client) => useInvitations((client.halo as HaloProxy).invitationProxy);
|
|
@@ -13,9 +13,7 @@ import { ResultSet } from '@dxos/client';
|
|
|
13
13
|
* @param resultSet The result set to subscribe to
|
|
14
14
|
* @returns Always up-to-date value of the result set
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}), [resultSet]));
|
|
21
|
-
}
|
|
16
|
+
export const useResultSet = <T>(resultSet: ResultSet<T>): T[] => useSubscription(useMemo(() => ({
|
|
17
|
+
getCurrentValue: () => resultSet.value,
|
|
18
|
+
subscribe: (cb: any) => resultSet.subscribe(cb)
|
|
19
|
+
}), [resultSet]));
|
|
@@ -25,18 +25,14 @@ const TestApp = () => {
|
|
|
25
25
|
);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
export const Primary = () =>
|
|
29
|
-
|
|
30
|
-
<ClientProvider>
|
|
28
|
+
export const Primary = () => (
|
|
29
|
+
<ClientProvider>
|
|
31
30
|
<TestApp />
|
|
32
31
|
</ClientProvider>
|
|
33
|
-
|
|
34
|
-
};
|
|
32
|
+
);
|
|
35
33
|
|
|
36
|
-
export const Secondary = () =>
|
|
37
|
-
|
|
38
|
-
<ClientProvider config={() => ({})}>
|
|
34
|
+
export const Secondary = () => (
|
|
35
|
+
<ClientProvider config={() => ({})}>
|
|
39
36
|
<TestApp />
|
|
40
37
|
</ClientProvider>
|
|
41
|
-
|
|
42
|
-
};
|
|
38
|
+
);
|
|
@@ -108,9 +108,8 @@ const TestApp = () => {
|
|
|
108
108
|
);
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
export const HaloRecovery = () =>
|
|
112
|
-
|
|
113
|
-
<Container>
|
|
111
|
+
export const HaloRecovery = () => (
|
|
112
|
+
<Container>
|
|
114
113
|
<Box sx={{ display: 'flex', flex: 1, padding: 1, justifyContent: 'space-around' }}>
|
|
115
114
|
{/* Instantiated Client. */}
|
|
116
115
|
<ClientProvider>
|
|
@@ -122,5 +121,4 @@ export const HaloRecovery = () => {
|
|
|
122
121
|
</ClientProvider>
|
|
123
122
|
</Box>
|
|
124
123
|
</Container>
|
|
125
|
-
|
|
126
|
-
};
|
|
124
|
+
);
|
|
@@ -15,9 +15,8 @@ export const ContactsSelector = ({ contacts, selected = '', onSelect }: {
|
|
|
15
15
|
contacts: any[],
|
|
16
16
|
selected?: string,
|
|
17
17
|
onSelect: (selected: string) => void
|
|
18
|
-
}) =>
|
|
19
|
-
|
|
20
|
-
<FormControl fullWidth>
|
|
18
|
+
}) => (
|
|
19
|
+
<FormControl fullWidth>
|
|
21
20
|
<InputLabel id='contact-select-label'>Contact</InputLabel>
|
|
22
21
|
<Select
|
|
23
22
|
value={selected || ''}
|
|
@@ -33,5 +32,4 @@ export const ContactsSelector = ({ contacts, selected = '', onSelect }: {
|
|
|
33
32
|
))}
|
|
34
33
|
</Select>
|
|
35
34
|
</FormControl>
|
|
36
|
-
|
|
37
|
-
};
|
|
35
|
+
);
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
export const JsonPanel = ({ value }: { value: any }) =>
|
|
8
|
-
|
|
9
|
-
<pre
|
|
7
|
+
export const JsonPanel = ({ value }: { value: any }) => (
|
|
8
|
+
<pre
|
|
10
9
|
style={{
|
|
11
10
|
margin: 0,
|
|
12
11
|
// code whiteSpace: 'pre-wrap',
|
|
@@ -17,5 +16,4 @@ export const JsonPanel = ({ value }: { value: any }) => {
|
|
|
17
16
|
>
|
|
18
17
|
{JSON.stringify(value, undefined, 2)}
|
|
19
18
|
</pre>
|
|
20
|
-
|
|
21
|
-
};
|
|
19
|
+
);
|