@dxos/react-client 2.31.8-dev.65575f28 → 2.31.8-dev.9afc174f

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 (45) hide show
  1. package/.rush/temp/package-deps_build.json +8 -11
  2. package/.rush/temp/package-deps_build:test.json +8 -11
  3. package/.rush/temp/package-deps_prerelease.json +8 -11
  4. package/.rush/temp/shrinkwrap-deps.json +3 -3
  5. package/dist/src/containers/BotFactoryClientProvider.d.ts.map +1 -1
  6. package/dist/src/containers/BotFactoryClientProvider.js +8 -9
  7. package/dist/src/containers/BotFactoryClientProvider.js.map +1 -1
  8. package/dist/src/containers/ClientProvider.d.ts.map +1 -1
  9. package/dist/src/containers/ClientProvider.js +14 -16
  10. package/dist/src/containers/ClientProvider.js.map +1 -1
  11. package/dist/src/index.d.ts +0 -1
  12. package/dist/src/index.d.ts.map +1 -1
  13. package/dist/src/index.js +0 -1
  14. package/dist/src/index.js.map +1 -1
  15. package/dist/stories/halo-invitations.stories.d.ts.map +1 -1
  16. package/dist/stories/halo-invitations.stories.js +10 -2
  17. package/dist/stories/halo-invitations.stories.js.map +1 -1
  18. package/dist/stories/party-invitations.stories.d.ts.map +1 -1
  19. package/dist/stories/party-invitations.stories.js +10 -2
  20. package/dist/stories/party-invitations.stories.js.map +1 -1
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +12 -11
  23. package/src/containers/BotFactoryClientProvider.tsx +8 -9
  24. package/src/containers/ClientProvider.tsx +13 -15
  25. package/src/index.ts +0 -1
  26. package/stories/halo-invitations.stories.tsx +12 -4
  27. package/stories/party-invitations.stories.tsx +12 -4
  28. package/tsconfig.json +12 -9
  29. package/dist/src/testing/ProfileInitializer.d.ts +0 -9
  30. package/dist/src/testing/ProfileInitializer.d.ts.map +0 -1
  31. package/dist/src/testing/ProfileInitializer.js +0 -49
  32. package/dist/src/testing/ProfileInitializer.js.map +0 -1
  33. package/dist/src/testing/index.d.ts +0 -3
  34. package/dist/src/testing/index.d.ts.map +0 -1
  35. package/dist/src/testing/index.js +0 -18
  36. package/dist/src/testing/index.js.map +0 -1
  37. package/dist/src/testing/useTestPartyBootstrap.d.ts +0 -11
  38. package/dist/src/testing/useTestPartyBootstrap.d.ts.map +0 -1
  39. package/dist/src/testing/useTestPartyBootstrap.js +0 -38
  40. package/dist/src/testing/useTestPartyBootstrap.js.map +0 -1
  41. package/out/book/esbuild-server-book.js +0 -190637
  42. package/out/book/index.html +0 -14
  43. package/src/testing/ProfileInitializer.tsx +0 -31
  44. package/src/testing/index.ts +0 -6
  45. package/src/testing/useTestPartyBootstrap.ts +0 -40
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <link rel="stylesheet" href="esbuild-server-book.css">
8
- <title>ESBuild-Server Book</title>
9
- </head>
10
- <body>
11
- <div id='root'></div>
12
- <script src='esbuild-server-book.js'></script>
13
- </body>
14
- </html>
@@ -1,31 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- import React, { ReactNode, useEffect } from 'react';
6
-
7
- import { useClient, useProfile } from '../hooks';
8
-
9
- /**
10
- * Automatically creates a random DXOS profile.
11
- * @deprecated
12
- */
13
- // TODO(burdon): Testing-only; replace with useTestProfile();
14
- export const ProfileInitializer = ({ children }: { children: ReactNode }) => {
15
- const client = useClient();
16
- const profile = useProfile();
17
-
18
- useEffect(() => {
19
- if (!profile) {
20
- setImmediate(async () => {
21
- await client.halo.createProfile();
22
- });
23
- }
24
- }, []);
25
-
26
- if (!profile) {
27
- return null;
28
- }
29
-
30
- return <>{children}</>;
31
- };
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- export * from './ProfileInitializer';
6
- export * from './useTestPartyBootstrap';
@@ -1,40 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
-
5
- import { useEffect, useState } from 'react';
6
-
7
- import { Client, Party } from '@dxos/client';
8
-
9
- /**
10
- * Hook which returns a set of peers joined in a shared party.
11
- *
12
- * Useful for setting up examples or tests which display multiple peers in a single view.
13
- */
14
- export const useTestPartyBootstrap = (peerCount = 2) => {
15
- const [peers, setPeers] = useState<{ client: Client, party: Party }[]>([]);
16
-
17
- useEffect(() => {
18
- setImmediate(async () => {
19
- const peers = [];
20
- const inviter = new Client();
21
- await inviter.initialize();
22
- await inviter.halo.createProfile({ username: 'peer-0' });
23
- const inviterParty = await inviter.echo.createParty();
24
- peers.push({ client: inviter, party: inviterParty });
25
-
26
- for (let i = 1; i < peerCount; i++) {
27
- const joiner = new Client();
28
- await joiner.initialize();
29
- await joiner.halo.createProfile({ username: `peer-${i}` });
30
- const invitation = await inviterParty.createInvitation();
31
- const joinerParty = await joiner.echo.acceptInvitation(invitation.descriptor).getParty();
32
- peers.push({ client: joiner, party: joinerParty });
33
- }
34
-
35
- setPeers(peers);
36
- });
37
- }, []);
38
-
39
- return peers;
40
- };