@dxos/react-client 2.33.5-dev.ea3876ba → 2.33.5-dev.ebc105f7

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.
Files changed (51) hide show
  1. package/.rush/temp/package-deps_build.json +13 -13
  2. package/.rush/temp/package-deps_build:test.json +13 -13
  3. package/.rush/temp/package-deps_prerelease.json +13 -13
  4. package/.rush/temp/shrinkwrap-deps.json +24 -15
  5. package/dist/src/banner.d.ts +1 -1
  6. package/dist/src/banner.d.ts.map +1 -1
  7. package/dist/src/banner.js +2 -2
  8. package/dist/src/banner.js.map +1 -1
  9. package/dist/src/hooks/client/useProfile.d.ts.map +1 -1
  10. package/dist/src/hooks/client/useProfile.js +1 -3
  11. package/dist/src/hooks/client/useProfile.js.map +1 -1
  12. package/dist/src/hooks/echo-selections/useSelection.js +1 -3
  13. package/dist/src/hooks/echo-selections/useSelection.js.map +1 -1
  14. package/dist/src/hooks/echo-selections/useSelection.test.js +1 -3
  15. package/dist/src/hooks/echo-selections/useSelection.test.js.map +1 -1
  16. package/dist/src/hooks/invitations/useHaloInvitations.d.ts.map +1 -1
  17. package/dist/src/hooks/invitations/useHaloInvitations.js +1 -3
  18. package/dist/src/hooks/invitations/useHaloInvitations.js.map +1 -1
  19. package/dist/src/hooks/util/useResultSet.d.ts +1 -1
  20. package/dist/src/hooks/util/useResultSet.d.ts.map +1 -1
  21. package/dist/src/hooks/util/useResultSet.js +4 -6
  22. package/dist/src/hooks/util/useResultSet.js.map +1 -1
  23. package/dist/src/hooks/wns/registry.d.ts.map +1 -1
  24. package/dist/src/hooks/wns/registry.js +1 -3
  25. package/dist/src/hooks/wns/registry.js.map +1 -1
  26. package/dist/stories/client.stories.d.ts.map +1 -1
  27. package/dist/stories/client.stories.js +4 -8
  28. package/dist/stories/client.stories.js.map +1 -1
  29. package/dist/stories/halo-recovery.stories.d.ts.map +1 -1
  30. package/dist/stories/halo-recovery.stories.js +6 -8
  31. package/dist/stories/halo-recovery.stories.js.map +1 -1
  32. package/dist/stories/helpers/ContactsSelector.d.ts.map +1 -1
  33. package/dist/stories/helpers/ContactsSelector.js +5 -7
  34. package/dist/stories/helpers/ContactsSelector.js.map +1 -1
  35. package/dist/stories/helpers/JsonPanel.d.ts.map +1 -1
  36. package/dist/stories/helpers/JsonPanel.js +7 -9
  37. package/dist/stories/helpers/JsonPanel.js.map +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/out/book/esbuild-server-book.js +1101 -1194
  40. package/package.json +13 -13
  41. package/src/banner.ts +2 -2
  42. package/src/hooks/client/useProfile.ts +1 -3
  43. package/src/hooks/echo-selections/useSelection.test.tsx +1 -3
  44. package/src/hooks/echo-selections/useSelection.ts +1 -5
  45. package/src/hooks/invitations/useHaloInvitations.ts +1 -3
  46. package/src/hooks/util/useResultSet.ts +4 -6
  47. package/src/hooks/wns/registry.ts +1 -3
  48. package/stories/client.stories.tsx +6 -10
  49. package/stories/halo-recovery.stories.tsx +3 -5
  50. package/stories/helpers/ContactsSelector.tsx +3 -5
  51. 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.ea3876ba",
3
+ "version": "2.33.5-dev.ebc105f7",
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.ea3876ba",
11
- "@dxos/bot-factory-client": "2.33.5-dev.ea3876ba",
12
- "@dxos/client": "2.33.5-dev.ea3876ba",
13
- "@dxos/config": "2.33.5-dev.ea3876ba",
14
- "@dxos/credentials": "2.33.5-dev.ea3876ba",
15
- "@dxos/crypto": "2.33.5-dev.ea3876ba",
16
- "@dxos/debug": "2.33.5-dev.ea3876ba",
17
- "@dxos/echo-db": "2.33.5-dev.ea3876ba",
18
- "@dxos/network-manager": "2.33.5-dev.ea3876ba",
19
- "@dxos/react-async": "2.33.5-dev.ea3876ba",
20
- "@dxos/util": "2.33.5-dev.ea3876ba",
10
+ "@dxos/async": "2.33.5-dev.ebc105f7",
11
+ "@dxos/bot-factory-client": "2.33.5-dev.ebc105f7",
12
+ "@dxos/client": "2.33.5-dev.ebc105f7",
13
+ "@dxos/config": "2.33.5-dev.ebc105f7",
14
+ "@dxos/credentials": "2.33.5-dev.ebc105f7",
15
+ "@dxos/crypto": "2.33.5-dev.ebc105f7",
16
+ "@dxos/debug": "2.33.5-dev.ebc105f7",
17
+ "@dxos/echo-db": "2.33.5-dev.ebc105f7",
18
+ "@dxos/network-manager": "2.33.5-dev.ebc105f7",
19
+ "@dxos/react-async": "2.33.5-dev.ebc105f7",
20
+ "@dxos/util": "2.33.5-dev.ebc105f7",
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",
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 function printBanner (client: Client) {
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 function useResultSet<T> (resultSet: ResultSet<T>): T[] {
17
- return useSubscription(useMemo(() => ({
18
- getCurrentValue: () => resultSet.value,
19
- subscribe: (cb: any) => resultSet.subscribe(cb)
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]));
@@ -7,6 +7,4 @@
7
7
  * See `useRegistryBots` and `useBotFactories` for higher-level hooks.
8
8
  * @deprecated Use DXNS registry.
9
9
  */
10
- export const useWNSRegistry = (): any => {
11
- return undefined as any;
12
- };
10
+ export const useWNSRegistry = (): any => undefined as any;
@@ -25,18 +25,14 @@ const TestApp = () => {
25
25
  );
26
26
  };
27
27
 
28
- export const Primary = () => {
29
- return (
30
- <ClientProvider>
28
+ export const Primary = () => (
29
+ <ClientProvider>
31
30
  <TestApp />
32
31
  </ClientProvider>
33
- );
34
- };
32
+ );
35
33
 
36
- export const Secondary = () => {
37
- return (
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
- return (
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
- return (
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
- return (
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
+ );