@dxos/react-client 0.10.0 → 0.11.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.
Files changed (101) hide show
  1. package/.storybook/main.mts +1 -1
  2. package/.storybook/preview.mts +2 -2
  3. package/CHANGELOG.md +77 -0
  4. package/dist/lib/chunk-ClientProvider.mjs +152 -0
  5. package/dist/lib/chunk-ClientProvider.mjs.map +1 -0
  6. package/dist/lib/chunk-context.mjs +14 -0
  7. package/dist/lib/chunk-context.mjs.map +1 -0
  8. package/dist/lib/chunk-useClient.mjs +16 -0
  9. package/dist/lib/chunk-useClient.mjs.map +1 -0
  10. package/dist/lib/devtools.mjs +37 -0
  11. package/dist/lib/devtools.mjs.map +1 -0
  12. package/dist/lib/echo.mjs +230 -0
  13. package/dist/lib/echo.mjs.map +1 -0
  14. package/dist/lib/halo.mjs +85 -0
  15. package/dist/lib/halo.mjs.map +1 -0
  16. package/dist/lib/index.mjs +108 -0
  17. package/dist/lib/index.mjs.map +1 -0
  18. package/dist/lib/invitations.mjs +130 -0
  19. package/dist/lib/invitations.mjs.map +1 -0
  20. package/dist/lib/mesh.mjs +14 -0
  21. package/dist/lib/mesh.mjs.map +1 -0
  22. package/dist/lib/testing.mjs +206 -0
  23. package/dist/lib/testing.mjs.map +1 -0
  24. package/dist/types/src/client/AgentHostingProvider.d.ts +0 -3
  25. package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -1
  26. package/dist/types/src/client/context.d.ts +4 -1
  27. package/dist/types/src/client/context.d.ts.map +1 -1
  28. package/dist/types/src/echo/index.d.ts +1 -0
  29. package/dist/types/src/echo/index.d.ts.map +1 -1
  30. package/dist/types/src/echo/useFeedSyncState.d.ts +1 -1
  31. package/dist/types/src/echo/useFlush.d.ts +10 -0
  32. package/dist/types/src/echo/useFlush.d.ts.map +1 -0
  33. package/dist/types/src/echo/useSpaces.d.ts +0 -10
  34. package/dist/types/src/echo/useSpaces.d.ts.map +1 -1
  35. package/dist/types/tsconfig.tsbuildinfo +1 -1
  36. package/moon.yml +1 -12
  37. package/package.json +32 -45
  38. package/src/client/AgentHostingProvider.tsx +5 -8
  39. package/src/client/context.ts +11 -2
  40. package/src/echo/index.ts +1 -0
  41. package/src/echo/useFeedSyncState.ts +4 -4
  42. package/src/echo/useFlush.ts +39 -0
  43. package/src/echo/useSpaces.ts +0 -14
  44. package/src/echo/useSyncState.ts +2 -2
  45. package/src/halo/Passkey.stories.tsx +1 -1
  46. package/src/testing/withClientProvider.stories.tsx +1 -1
  47. package/vite.config.ts +19 -0
  48. package/dist/lib/browser/chunk-3LVU7RNK.mjs +0 -16
  49. package/dist/lib/browser/chunk-3LVU7RNK.mjs.map +0 -7
  50. package/dist/lib/browser/chunk-CZMIVAGI.mjs +0 -8
  51. package/dist/lib/browser/chunk-CZMIVAGI.mjs.map +0 -7
  52. package/dist/lib/browser/chunk-SSDQ6NXU.mjs +0 -153
  53. package/dist/lib/browser/chunk-SSDQ6NXU.mjs.map +0 -7
  54. package/dist/lib/browser/chunk-XT352YI6.mjs +0 -134
  55. package/dist/lib/browser/chunk-XT352YI6.mjs.map +0 -7
  56. package/dist/lib/browser/devtools/index.mjs +0 -39
  57. package/dist/lib/browser/devtools/index.mjs.map +0 -7
  58. package/dist/lib/browser/echo/index.mjs +0 -239
  59. package/dist/lib/browser/echo/index.mjs.map +0 -7
  60. package/dist/lib/browser/halo/index.mjs +0 -109
  61. package/dist/lib/browser/halo/index.mjs.map +0 -7
  62. package/dist/lib/browser/index.mjs +0 -119
  63. package/dist/lib/browser/index.mjs.map +0 -7
  64. package/dist/lib/browser/invitations/index.mjs +0 -17
  65. package/dist/lib/browser/invitations/index.mjs.map +0 -7
  66. package/dist/lib/browser/mesh/index.mjs +0 -18
  67. package/dist/lib/browser/mesh/index.mjs.map +0 -7
  68. package/dist/lib/browser/meta.json +0 -1
  69. package/dist/lib/browser/testing/index.mjs +0 -204
  70. package/dist/lib/browser/testing/index.mjs.map +0 -7
  71. package/dist/lib/browser/worker.mjs +0 -3
  72. package/dist/lib/browser/worker.mjs.map +0 -7
  73. package/dist/lib/node-esm/chunk-CUDKNAMV.mjs +0 -17
  74. package/dist/lib/node-esm/chunk-CUDKNAMV.mjs.map +0 -7
  75. package/dist/lib/node-esm/chunk-JZNSBWIR.mjs +0 -155
  76. package/dist/lib/node-esm/chunk-JZNSBWIR.mjs.map +0 -7
  77. package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs +0 -135
  78. package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs.map +0 -7
  79. package/dist/lib/node-esm/chunk-WUTK2IJF.mjs +0 -10
  80. package/dist/lib/node-esm/chunk-WUTK2IJF.mjs.map +0 -7
  81. package/dist/lib/node-esm/devtools/index.mjs +0 -40
  82. package/dist/lib/node-esm/devtools/index.mjs.map +0 -7
  83. package/dist/lib/node-esm/echo/index.mjs +0 -240
  84. package/dist/lib/node-esm/echo/index.mjs.map +0 -7
  85. package/dist/lib/node-esm/halo/index.mjs +0 -110
  86. package/dist/lib/node-esm/halo/index.mjs.map +0 -7
  87. package/dist/lib/node-esm/index.mjs +0 -120
  88. package/dist/lib/node-esm/index.mjs.map +0 -7
  89. package/dist/lib/node-esm/invitations/index.mjs +0 -18
  90. package/dist/lib/node-esm/invitations/index.mjs.map +0 -7
  91. package/dist/lib/node-esm/mesh/index.mjs +0 -19
  92. package/dist/lib/node-esm/mesh/index.mjs.map +0 -7
  93. package/dist/lib/node-esm/meta.json +0 -1
  94. package/dist/lib/node-esm/testing/index.mjs +0 -205
  95. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  96. package/dist/lib/node-esm/worker.mjs +0 -5
  97. package/dist/lib/node-esm/worker.mjs.map +0 -7
  98. package/dist/types/src/worker.d.ts +0 -2
  99. package/dist/types/src/worker.d.ts.map +0 -1
  100. package/src/worker.ts +0 -5
  101. package/vitest.config.ts +0 -16
@@ -1,134 +0,0 @@
1
- import {
2
- ClientContext
3
- } from "./chunk-CZMIVAGI.mjs";
4
-
5
- // src/client/ClientProvider.tsx
6
- import React, { forwardRef, useEffect, useImperativeHandle, useState } from "react";
7
- import { Client, SystemStatus } from "@dxos/client";
8
- import { log } from "@dxos/log";
9
- import { useAsyncEffect, useControlledState } from "@dxos/react-hooks";
10
- import { getAsyncProviderValue } from "@dxos/util";
11
-
12
- // src/banner.ts
13
- var BANNER = (client) => {
14
- const commitHash = client.config.get("runtime.app.build.commitHash");
15
- const hash = commitHash ? ` App Commit ${commitHash}
16
- ` : "";
17
- return `
18
- _/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\______/\\/\\/\\/\\/\\_
19
- _/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__/\\/\\_________
20
- _/\\/\\____/\\/\\______/\\/\\______/\\/\\____/\\/\\____/\\/\\/\\/\\___
21
- _/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__________/\\/\\_
22
- _/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\/\\/\\/\\___
23
-
24
- DXOS Client ${client.version}
25
- ${hash}`;
26
- };
27
- var bannerPrinted = false;
28
- var printBanner = (client) => {
29
- if (bannerPrinted || window.location.hostname === "localhost") {
30
- return;
31
- }
32
- bannerPrinted = true;
33
- console.log(`%c${BANNER(client)}`, "font-family: monospace;");
34
- };
35
-
36
- // src/client/ClientProvider.tsx
37
- var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/client/ClientProvider.tsx";
38
- var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp, client: clientProp, services: servicesProp, status: statusProp, fallback: Fallback = () => null, noBanner, onInitialized, ...options }, forwardedRef) => {
39
- const [error, setError] = useState();
40
- if (error) {
41
- throw error;
42
- }
43
- const [client, setClient] = useState(clientProp instanceof Client ? clientProp : void 0);
44
- useImperativeHandle(forwardedRef, () => client, [
45
- client
46
- ]);
47
- const [status, setStatus] = useControlledState(statusProp);
48
- useEffect(() => {
49
- if (!client) {
50
- return;
51
- }
52
- const subscription = client.status.subscribe((status2) => setStatus(status2));
53
- return () => subscription.unsubscribe();
54
- }, [
55
- client
56
- ]);
57
- useAsyncEffect(async () => {
58
- let disposed = false;
59
- const initialize = async (client3) => {
60
- if (!client3.initialized) {
61
- await client3.initialize().catch((err) => {
62
- if (!disposed) {
63
- setError(err);
64
- }
65
- });
66
- log("client ready", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 50, S: void 0 });
67
- await onInitialized?.(client3);
68
- log("initialization complete", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 52, S: void 0 });
69
- }
70
- setClient(client3);
71
- if (!noBanner) {
72
- printBanner(client3);
73
- }
74
- };
75
- let client2;
76
- try {
77
- if (clientProp) {
78
- client2 = await getAsyncProviderValue(clientProp);
79
- await initialize(client2);
80
- } else {
81
- const config = await getAsyncProviderValue(configProp);
82
- log("resolved config", {
83
- config
84
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 68, S: void 0 });
85
- const services = await getAsyncProviderValue(servicesProp, config);
86
- log("created services", {
87
- services
88
- }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 72, S: void 0 });
89
- client2 = new Client({
90
- config,
91
- services,
92
- ...options
93
- });
94
- log("created client", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 80, S: void 0 });
95
- await initialize(client2);
96
- }
97
- } catch (err) {
98
- if (!disposed) {
99
- log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 85, S: void 0 });
100
- }
101
- }
102
- return () => {
103
- log("clean up", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 89, S: void 0 });
104
- disposed = true;
105
- if (!clientProp) {
106
- void client2?.destroy().then(() => {
107
- log("destroyed", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 94, S: void 0 });
108
- }).catch((err) => log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 95, S: void 0 }));
109
- }
110
- };
111
- }, [
112
- configProp,
113
- clientProp,
114
- servicesProp,
115
- noBanner
116
- ]);
117
- if (!client?.initialized || status !== SystemStatus.ACTIVE) {
118
- return /* @__PURE__ */ React.createElement(Fallback, {
119
- client,
120
- status
121
- });
122
- }
123
- return /* @__PURE__ */ React.createElement(ClientContext.Provider, {
124
- value: {
125
- client,
126
- status
127
- }
128
- }, children);
129
- });
130
-
131
- export {
132
- ClientProvider
133
- };
134
- //# sourceMappingURL=chunk-XT352YI6.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/client/ClientProvider.tsx", "../../../src/banner.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nimport React, {\n type FunctionComponent,\n type PropsWithChildren,\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n} from 'react';\n\nimport { Client, type ClientOptions, type ClientServicesProvider, SystemStatus } from '@dxos/client';\nimport { type Config } from '@dxos/config';\nimport { log } from '@dxos/log';\nimport { useAsyncEffect, useControlledState } from '@dxos/react-hooks';\nimport { type MaybePromise, type Provider, getAsyncProviderValue } from '@dxos/util';\n\nimport { printBanner } from '../banner';\nimport { ClientContext, type ClientContextProps } from './context';\n\n/**\n * Properties for the ClientProvider.\n */\nexport type ClientProviderProps = Omit<ClientOptions, 'config' | 'services'> &\n Pick<ClientContextProps, 'status'> &\n PropsWithChildren<{\n /**\n * Client object or async provider to enable to caller to do custom initialization.\n *\n * NOTE: For advanced use cases only.\n */\n client?: Client | Provider<Promise<Client>>;\n\n /**\n * Config object or async provider.\n *\n * NOTE: If a `client` is provided then `config` is ignored.\n */\n // TODO(burdon): Reconcile with ClientOptions.\n config?: Config | Provider<Promise<Config>>;\n\n /**\n * Callback to enable the caller to create a custom ClientServicesProvider.\n *\n * NOTE: If a `client` is provided then `services` is ignored.\n */\n // TODO(burdon): Reconcile with ClientOptions.\n services?: ClientServicesProvider | ((config?: Config) => MaybePromise<ClientServicesProvider>);\n\n /**\n * ReactNode to display until the client is available.\n */\n fallback?: FunctionComponent<Partial<ClientContextProps>>;\n\n /**\n * Skip the DXOS banner.\n */\n noBanner?: boolean;\n\n /**\n * Post initialization hook to enable to caller to do custom initialization.\n */\n onInitialized?: (client: Client) => MaybePromise<void>;\n }>;\n\n/**\n * Root component that provides the DXOS client instance to child components.\n * To be used with the `useClient` hook.\n */\nexport const ClientProvider = forwardRef<Client | undefined, ClientProviderProps>(\n (\n {\n children,\n config: configProp,\n client: clientProp,\n services: servicesProp,\n status: statusProp,\n fallback: Fallback = () => null,\n noBanner,\n onInitialized,\n ...options\n },\n forwardedRef,\n ) => {\n // The client is initialized asynchronously.\n // If an error occurs during initialization, it is caught and the state is set.\n // This allows the error to be thrown in the render method.\n // The assumption is that a client initialization error is fatal to the app.\n // This error will be caught by the nearest error boundary.\n const [error, setError] = useState();\n if (error) {\n throw error;\n }\n\n const [client, setClient] = useState(clientProp instanceof Client ? clientProp : undefined);\n\n // Provide external access.\n useImperativeHandle(forwardedRef, () => client, [client]);\n\n // Client status subscription.\n const [status, setStatus] = useControlledState(statusProp);\n useEffect(() => {\n if (!client) {\n return;\n }\n\n const subscription = client.status.subscribe((status) => setStatus(status));\n return () => subscription.unsubscribe();\n }, [client]);\n\n // Create and/or initialize client.\n useAsyncEffect(async () => {\n let disposed = false;\n const initialize = async (client: Client) => {\n if (!client.initialized) {\n await client.initialize().catch((err) => {\n if (!disposed) {\n setError(err);\n }\n });\n log('client ready');\n await onInitialized?.(client);\n log('initialization complete');\n }\n\n setClient(client);\n if (!noBanner) {\n printBanner(client);\n }\n };\n\n let client: Client;\n try {\n if (clientProp) {\n // Asynchronously request client.\n client = await getAsyncProviderValue(clientProp);\n await initialize(client);\n } else {\n // Asynchronously construct client (config may be undefined).\n const config = await getAsyncProviderValue(configProp);\n log('resolved config', { config });\n const services = await getAsyncProviderValue(servicesProp, config);\n log('created services', { services });\n client = new Client({ config, services, ...options });\n log('created client');\n await initialize(client);\n }\n } catch (err) {\n if (!disposed) {\n log.catch(err);\n }\n }\n\n return () => {\n log('clean up');\n disposed = true;\n // Only destroy if the client is not provided by the parent.\n if (!clientProp) {\n void client\n ?.destroy()\n .then(() => {\n log('destroyed');\n })\n .catch((err) => log.catch(err));\n }\n };\n }, [configProp, clientProp, servicesProp, noBanner]);\n\n if (!client?.initialized || status !== SystemStatus.ACTIVE) {\n return <Fallback client={client} status={status} />;\n }\n\n return <ClientContext.Provider value={{ client, status }}>{children}</ClientContext.Provider>;\n },\n);\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type Client } from '@dxos/client';\n\n// http://patorjk.com/software/taag/#p=testall&f=Patorjk-HeX&t=DXOS\nconst BANNER = (client: Client) => {\n const commitHash = client.config.get('runtime.app.build.commitHash');\n const hash = commitHash ? ` App Commit ${commitHash} \\n` : '';\n\n return (\n '\\n' +\n '_/\\\\/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\______/\\\\/\\\\/\\\\/\\\\/\\\\_\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\__/\\\\/\\\\_________\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\______/\\\\/\\\\______/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\___\\n' +\n '_/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\__________/\\\\/\\\\_\\n' +\n '_/\\\\/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\____/\\\\/\\\\/\\\\/\\\\/\\\\___\\n' +\n `\\n DXOS Client ${client.version} \\n${hash}`\n );\n};\n\nlet bannerPrinted = false;\n\nexport const printBanner = (client: Client) => {\n if (bannerPrinted || window.location.hostname === 'localhost') {\n return;\n }\n\n bannerPrinted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AACN,aACCT,SAAOE,QAAYF,EAAAA,KAAME,MAAAA;AAC9B,cAAA,aAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;QACF,CAAA,EAAA,MAAA,CAAA,QAAA,IAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA,CAAA;MACC;IAACQ;;IAAwBC;IAAcC;IAAS;IAE/C;;eACelB,eAAQA,WAAAA,aAAAA,QAAAA;WAAgBG,sBAAAA,cAAAA,UAAAA;;MAC3C;IAEA,CAAA;;SAAwCH,sBAAAA,cAAAA,cAAAA,UAAAA;WAAQG;MAAO;MAAIgB;IAE7D;;;",
6
- "names": ["React", "forwardRef", "useEffect", "useImperativeHandle", "useState", "Client", "SystemStatus", "log", "useAsyncEffect", "useControlledState", "getAsyncProviderValue", "BANNER", "client", "commitHash", "config", "get", "hash", "version", "bannerPrinted", "printBanner", "window", "location", "hostname", "console", "log", "error", "client", "useImperativeHandle", "forwardedRef", "status", "useAsyncEffect", "initialize", "catch", "setError", "err", "log", "setClient", "printBanner", "config", "services", "disposed", "clientProp", "configProp", "servicesProp", "noBanner", "children"]
7
- }
@@ -1,39 +0,0 @@
1
- import {
2
- useClient
3
- } from "../chunk-3LVU7RNK.mjs";
4
- import "../chunk-CZMIVAGI.mjs";
5
-
6
- // src/devtools/index.ts
7
- export * from "@dxos/client/devtools";
8
-
9
- // src/devtools/useDevtools.ts
10
- import { raise } from "@dxos/debug";
11
- var useDevtools = () => {
12
- const client = useClient();
13
- return client.services.services.DevtoolsHost ?? raise(new Error("DevtoolsHost not available."));
14
- };
15
-
16
- // src/devtools/useStream.ts
17
- import { useEffect, useState } from "react";
18
- import { log } from "@dxos/log";
19
- var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/devtools/useStream.ts";
20
- var useStream = (streamFactory, defaultValue, deps = []) => {
21
- const [value, setValue] = useState(defaultValue);
22
- useEffect(() => {
23
- const stream = streamFactory();
24
- stream.subscribe((response) => setValue(response), (err) => {
25
- if (err) {
26
- log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 14, S: void 0 });
27
- }
28
- });
29
- return () => {
30
- void stream.close();
31
- };
32
- }, deps);
33
- return value ?? defaultValue;
34
- };
35
- export {
36
- useDevtools,
37
- useStream
38
- };
39
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/devtools/index.ts", "../../../../src/devtools/useDevtools.ts", "../../../../src/devtools/useStream.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/client/devtools';\n\nexport * from './useDevtools';\nexport * from './useStream';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type DevtoolsHost } from '@dxos/client/devtools';\nimport { raise } from '@dxos/debug';\n\nimport { useClient } from '../client';\n\nexport const useDevtools = (): DevtoolsHost => {\n const client = useClient();\n return client.services.services.DevtoolsHost ?? raise(new Error('DevtoolsHost not available.'));\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type DependencyList, useEffect, useState } from 'react';\n\nimport { type Stream } from '@dxos/codec-protobuf/stream';\nimport { log } from '@dxos/log';\n\n/**\n * Subscribe to service API streams.\n */\nexport const useStream = <T>(streamFactory: () => Stream<T>, defaultValue: T, deps: DependencyList = []): T => {\n const [value, setValue] = useState<T | undefined>(defaultValue);\n useEffect(() => {\n const stream = streamFactory();\n stream.subscribe(\n (response: T) => setValue(response),\n (err) => {\n if (err) {\n log.catch(err);\n }\n },\n );\n\n return () => {\n void stream.close();\n };\n }, deps);\n\n return value ?? defaultValue;\n};\n"],
5
- "mappings": ";;;;;;AAIA,cAAc;;;ACCd,SAASA,aAAa;AAIf,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOD,OAAOE,SAASA,SAASC,gBAAgBC,MAAM,IAAIC,MAAM,6BAAA,CAAA;AAClE;;;ACRA,SAA8BC,WAAWC,gBAAgB;AAGzD,SAASC,WAAW;AAEpB,IAAA,eAAA;AAKEF,IAAU,YAAA,CAAA,eAAA,cAAA,OAAA,CAAA,MAAA;QACR,CAAA,OAAMG,QAASC,IAAAA,SAAAA,YAAAA;YACfD,MAAOE;UAGH,SAAS,cAAA;qBACE,CAACC,aAAAA,SAAAA,QAAAA,GAAAA,CAAAA,QAAAA;AACZ,UAAA,KAAA;AACF,YAAA,MAAA,KAAA,QAAA,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,OAAA,CAAA;MAGF;;AAEA,WAAA,MAAA;AACCC,WAAAA,OAAAA,MAAAA;IAEH;EACA,GAAA,IAAA;;;",
6
- "names": ["raise", "useDevtools", "client", "useClient", "services", "DevtoolsHost", "raise", "Error", "useEffect", "useState", "log", "stream", "streamFactory", "subscribe", "err", "deps"]
7
- }
@@ -1,239 +0,0 @@
1
- import {
2
- useInvitationStatus
3
- } from "../chunk-SSDQ6NXU.mjs";
4
- import {
5
- useClient
6
- } from "../chunk-3LVU7RNK.mjs";
7
- import "../chunk-CZMIVAGI.mjs";
8
-
9
- // src/echo/index.ts
10
- export * from "@dxos/client/echo";
11
- export * from "@dxos/echo-react";
12
-
13
- // src/echo/useMembers.ts
14
- import { MulticastObservable } from "@dxos/async";
15
- import { PublicKey as PublicKey2 } from "@dxos/client";
16
- import { HaloSpaceMember } from "@dxos/client/echo";
17
- import { useMulticastObservable as useMulticastObservable2 } from "@dxos/react-hooks";
18
-
19
- // src/echo/useSpaces.ts
20
- import { PublicKey } from "@dxos/client";
21
- import { SpaceState } from "@dxos/client/echo";
22
- import { useMulticastObservable } from "@dxos/react-hooks";
23
- var useSpace = (spaceId) => {
24
- const client = useClient();
25
- const spaces = useMulticastObservable(client.spaces);
26
- if (!spaceId) {
27
- return void 0;
28
- }
29
- return spaces.find((space) => {
30
- if (spaceId instanceof PublicKey) {
31
- return space.key.equals(spaceId);
32
- }
33
- return space.id === spaceId;
34
- });
35
- };
36
- var useDatabase = (spaceId) => {
37
- const space = useSpace(spaceId);
38
- return space?.db;
39
- };
40
- var useSpaces = ({ all = false } = {}) => {
41
- const client = useClient();
42
- const spaces = useMulticastObservable(client.spaces);
43
- return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);
44
- };
45
-
46
- // src/echo/useMembers.ts
47
- var useMembers = (spaceKey) => {
48
- const spaces = useSpaces({
49
- all: true
50
- });
51
- const space = spaceKey ? spaces.find((space2) => spaceKey instanceof PublicKey2 ? space2.key.equals(spaceKey) : space2.id === spaceKey) : void 0;
52
- const members = useMulticastObservable2(space?.members ?? MulticastObservable.empty()) ?? [];
53
- return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);
54
- };
55
-
56
- // src/echo/useSpaceInvitations.ts
57
- import { useMemo } from "react";
58
- import { MulticastObservable as MulticastObservable2 } from "@dxos/async";
59
- import { useMulticastObservable as useMulticastObservable3 } from "@dxos/react-hooks";
60
- var useSpaceInvitations = (spaceId) => {
61
- const space = useSpace(spaceId);
62
- return useMulticastObservable3(space?.invitations ?? MulticastObservable2.empty()) ?? [];
63
- };
64
- var useSpaceInvitation = (spaceId, invitationId) => {
65
- const invitations = useSpaceInvitations(spaceId);
66
- const invitation = useMemo(() => invitations.find((invitation2) => invitation2.get().invitationId === invitationId), [
67
- invitations
68
- ]);
69
- return useInvitationStatus(invitation);
70
- };
71
-
72
- // src/echo/useSpaceProperties.ts
73
- import { MulticastObservable as MulticastObservable3 } from "@dxos/async";
74
- import { SpaceState as SpaceState2 } from "@dxos/client/echo";
75
- import { useObject } from "@dxos/echo-react";
76
- import { useMulticastObservable as useMulticastObservable4 } from "@dxos/react-hooks";
77
- var useSpaceProperties = (spaceId) => {
78
- const space = useSpace(spaceId);
79
- const spaceState = useMulticastObservable4(space?.state ?? MulticastObservable3.empty());
80
- const properties = spaceState === SpaceState2.SPACE_READY ? space?.properties : void 0;
81
- return useObject(properties);
82
- };
83
-
84
- // src/echo/useSubscription.ts
85
- import { useEffect, useRef } from "react";
86
- import { createSubscription } from "@dxos/client/echo";
87
- var useSubscription = (cb, selection) => {
88
- const callbackRef = useRef(cb);
89
- callbackRef.current = cb;
90
- const subscriptionRef = useRef(null);
91
- useEffect(() => {
92
- subscriptionRef.current = createSubscription(() => {
93
- callbackRef.current();
94
- });
95
- return () => subscriptionRef.current?.unsubscribe();
96
- }, []);
97
- subscriptionRef.current?.update(selection);
98
- return subscriptionRef.current;
99
- };
100
-
101
- // src/echo/useSyncState.ts
102
- import { useEffect as useEffect2, useState } from "react";
103
- import { Context } from "@dxos/context";
104
- import { isEdgePeerId } from "@dxos/echo-protocol";
105
- var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/echo/useSyncState.ts";
106
- var useSyncState = () => {
107
- const client = useClient();
108
- const [spaceState, setSpaceState] = useState({});
109
- useEffect2(() => {
110
- const ctx = new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 14 });
111
- const createSubscriptions = (spaces) => {
112
- for (const space of spaces) {
113
- if (spaceState[space.id]) {
114
- continue;
115
- }
116
- ctx.onDispose(space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {
117
- const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
118
- if (syncState) {
119
- setSpaceState((spaceState2) => ({
120
- ...spaceState2,
121
- [space.id]: syncState
122
- }));
123
- }
124
- }));
125
- }
126
- };
127
- createSubscriptions(client.spaces.get());
128
- client.spaces.subscribe((spaces) => {
129
- createSubscriptions(spaces);
130
- });
131
- return () => {
132
- void ctx.dispose();
133
- };
134
- }, [
135
- client
136
- ]);
137
- return spaceState;
138
- };
139
- var useSpaceSyncState = (space) => {
140
- const [spaceState, setSpaceState] = useState();
141
- useEffect2(() => {
142
- const ctx = new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 49 });
143
- space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {
144
- const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
145
- if (syncState) {
146
- setSpaceState(syncState);
147
- }
148
- });
149
- return () => {
150
- void ctx.dispose();
151
- };
152
- }, [
153
- space
154
- ]);
155
- return spaceState;
156
- };
157
-
158
- // src/echo/useFeedSyncState.ts
159
- import { useEffect as useEffect3, useState as useState2 } from "react";
160
- var DEFAULT_POLL_INTERVAL_MS = 5e3;
161
- var useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS) => {
162
- const client = useClient();
163
- const [feedSyncState, setFeedSyncState] = useState2({});
164
- useEffect3(() => {
165
- const queueService = client.services.services.QueueService;
166
- if (!queueService) {
167
- return;
168
- }
169
- let cancelled = false;
170
- const poll = async () => {
171
- const spaces = client.spaces.get();
172
- const entries = await Promise.all(spaces.map(async (space) => {
173
- try {
174
- const response = await queueService.getSyncState({
175
- spaceId: space.id
176
- });
177
- const state = (response.namespaces ?? []).reduce((acc, entry) => {
178
- acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);
179
- acc.total += Number(entry.totalBlocks ?? 0);
180
- return acc;
181
- }, {
182
- pending: 0,
183
- total: 0
184
- });
185
- return [
186
- space.id,
187
- state
188
- ];
189
- } catch {
190
- return [
191
- space.id,
192
- {
193
- pending: 0,
194
- total: 0
195
- }
196
- ];
197
- }
198
- }));
199
- if (!cancelled) {
200
- setFeedSyncState(Object.fromEntries(entries));
201
- }
202
- };
203
- void poll();
204
- const interval = setInterval(() => void poll(), pollIntervalMs);
205
- const spacesSubscription = client.spaces.subscribe(() => {
206
- void poll();
207
- });
208
- return () => {
209
- cancelled = true;
210
- clearInterval(interval);
211
- spacesSubscription.unsubscribe();
212
- };
213
- }, [
214
- client,
215
- pollIntervalMs
216
- ]);
217
- return feedSyncState;
218
- };
219
-
220
- // src/echo/useRegistry.ts
221
- var useRegistry = () => {
222
- const client = useClient();
223
- return client.graph.registry;
224
- };
225
- export {
226
- useDatabase,
227
- useFeedSyncState,
228
- useMembers,
229
- useRegistry,
230
- useSpace,
231
- useSpaceInvitation,
232
- useSpaceInvitations,
233
- useSpaceProperties,
234
- useSpaceSyncState,
235
- useSpaces,
236
- useSubscription,
237
- useSyncState
238
- };
239
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSpaceProperties.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts", "../../../../src/echo/useFeedSyncState.ts", "../../../../src/echo/useRegistry.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\nexport * from '@dxos/echo-react';\n\nexport * from './useMembers';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\nexport * from './useFeedSyncState';\nexport * from './useRegistry';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { PublicKey, type PublicKeyLike } from '@dxos/client';\nimport { HaloSpaceMember, type SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpaces } from './useSpaces';\n\nexport const useMembers = (spaceKey: PublicKeyLike | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey\n ? spaces.find((space) => (spaceKey instanceof PublicKey ? space.key.equals(spaceKey) : space.id === spaceKey))\n : undefined;\n\n // EMPTY_OBSERVABLE needs to be a stable reference to avoid re-subscribing on every render.\n const members = useMulticastObservable(space?.members ?? MulticastObservable.empty()) ?? [];\n return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its id.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n */\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpace = (spaceId?: SpaceId | PublicKey): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n if (!spaceId) {\n return undefined;\n }\n\n return spaces.find((space) => {\n if (spaceId instanceof PublicKey) {\n return space.key.equals(spaceId);\n }\n\n return space.id === spaceId;\n });\n};\n\n/**\n * Get a Space database by the id of the space.\n * The space is not guaranteed to be in the ready state.\n * Returns undefined if no id is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceId the id of the space to look for.\n * @deprecated Use useSpace.\n */\nexport const useDatabase = (spaceId?: SpaceId): Space['db'] | undefined => {\n const space = useSpace(spaceId);\n return space?.db;\n};\n\nexport type UseSpacesProps = {\n /**\n * Return uninitialized spaces as well.\n */\n all?: boolean;\n};\n\n/**\n * Get all Spaces available to current user.\n * Requires a ClientProvider somewhere in the parent tree.\n * By default, only ready spaces are returned.\n * @returns an array of Spaces.\n */\nexport const useSpaces = ({ all = false }: UseSpacesProps = {}): Space[] => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n\n // TODO(dmaretskyi): Array reference equality.\n return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { type SpaceId } from '@dxos/keys';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\nimport { useSpace } from './useSpaces';\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitations = (spaceId?: SpaceId | PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceId);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\n// TODO(wittjosiah): Currently unable to remove `PublicKey` from this api.\n// When initially joining a space that is all that is returned.\nexport const useSpaceInvitation = (spaceId?: SpaceId | PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceId);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type SpaceProperties, SpaceState } from '@dxos/client/echo';\nimport { type Key, type Obj } from '@dxos/echo';\nimport { type ObjectUpdateCallback, useObject } from '@dxos/echo-react';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\n\n/**\n * Subscribe to a space's properties with reactive updates.\n * Returns undefined if the space is undefined or not ready yet.\n * Automatically waits for the space to be ready before returning properties.\n *\n * @param spaceId - The space ID to get properties from (can be undefined).\n * @returns A tuple of [snapshot, updateCallback] or [undefined, no-op] if not ready.\n */\nexport const useSpaceProperties = (\n spaceId: Key.SpaceId | undefined,\n): [Obj.Snapshot<SpaceProperties> | undefined, ObjectUpdateCallback<SpaceProperties>] => {\n const space = useSpace(spaceId);\n const spaceState = useMulticastObservable(space?.state ?? MulticastObservable.empty());\n const properties = spaceState === SpaceState.SPACE_READY ? space?.properties : undefined;\n return useObject(properties);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useRef } from 'react';\n\nimport { type Selection, type SubscriptionHandle, createSubscription } from '@dxos/client/echo';\n\n/**\n * Create reactive selection.\n * Calls the callback when the selection changes and during the first render.\n */\n// TODO(wittjosiah): Is this still needed with signals reactivity? If not, remove or update jsdoc with usage info.\nexport const useSubscription = (cb: () => void, selection: Selection) => {\n // Make sure that the callback is always the one from the latest render.\n // Without this, we would always call the callback from the initial render,\n // which might contain stale data.\n const callbackRef = useRef(cb);\n callbackRef.current = cb;\n\n const subscriptionRef = useRef<SubscriptionHandle>(null);\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { isEdgePeerId } from '@dxos/echo-protocol';\n\nimport { useClient } from '../client';\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type SpaceId } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst DEFAULT_POLL_INTERVAL_MS = 5_000;\n\nexport type FeedSyncState = {\n /** Combined blocks to pull + push across namespaces. */\n pending: number;\n /** Total blocks stored locally across namespaces. */\n total: number;\n};\n\nexport type FeedSyncStateMap = Record<SpaceId, FeedSyncState>;\n\n/**\n * Polls queue replication state per space.\n */\nexport const useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS): FeedSyncStateMap => {\n const client = useClient();\n const [feedSyncState, setFeedSyncState] = useState<FeedSyncStateMap>({});\n\n useEffect(() => {\n const queueService = client.services.services.QueueService;\n if (!queueService) {\n return;\n }\n\n let cancelled = false;\n\n const poll = async () => {\n const spaces = client.spaces.get();\n const entries = await Promise.all(\n spaces.map(async (space) => {\n try {\n const response = await queueService.getSyncState({ spaceId: space.id });\n const state = (response.namespaces ?? []).reduce<FeedSyncState>(\n (acc, entry) => {\n acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);\n acc.total += Number(entry.totalBlocks ?? 0);\n return acc;\n },\n { pending: 0, total: 0 },\n );\n return [space.id, state] as const;\n } catch {\n return [space.id, { pending: 0, total: 0 }] as const;\n }\n }),\n );\n\n if (!cancelled) {\n setFeedSyncState(Object.fromEntries(entries));\n }\n };\n\n void poll();\n const interval = setInterval(() => void poll(), pollIntervalMs);\n\n const spacesSubscription = client.spaces.subscribe(() => {\n void poll();\n });\n\n return () => {\n cancelled = true;\n clearInterval(interval);\n spacesSubscription.unsubscribe();\n };\n }, [client, pollIntervalMs]);\n\n return feedSyncState;\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { type Registry } from '@dxos/echo';\n\nimport { useClient } from '../client';\n\n/**\n * Returns the hypergraph registry attached to the current client.\n */\nexport const useRegistry = (): Registry.Registry => {\n const client = useClient();\n return client.graph.registry;\n};\n"],
5
- "mappings": ";;;;;;;;;AAIA,cAAc;AACd,cAAc;;;ACDd,SAASA,2BAA2B;AACpC,SAASC,aAAAA,kBAAqC;AAC9C,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,iBAAiB;AAC1B,SAAqBC,kBAAkB;AAEvC,SAASC,8BAA8B;AAchC,IAAMC,WAAW,CAACC,YAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAC5D,MAAI,CAACH,SAAS;AACZ,WAAOK;EACT;AAEA,SAAOF,OAAOG,KAAK,CAACC,UAAAA;AAClB,QAAIP,mBAAmBQ,WAAW;AAChC,aAAOD,MAAME,IAAIC,OAAOV,OAAAA;IAC1B;AAEA,WAAOO,MAAMI,OAAOX;EACtB,CAAA;AACF;AAWO,IAAMY,cAAc,CAACZ,YAAAA;AAC1B,QAAMO,QAAQR,SAASC,OAAAA;AACvB,SAAOO,OAAOM;AAChB;AAeO,IAAMC,YAAY,CAAC,EAAEC,MAAM,MAAK,IAAqB,CAAC,MAAC;AAC5D,QAAMd,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAG5D,SAAOA,OAAOa,OAAO,CAACT,UAAUQ,OAAOR,MAAMU,MAAMC,IAAG,MAAOC,WAAWC,WAAW;AACrF;;;AD3DO,IAAMC,aAAa,CAACC,aAAAA;AAEzB,QAAMC,SAASC,UAAU;IAAEC,KAAK;EAAK,CAAA;AACrC,QAAMC,QAAQJ,WACVC,OAAOI,KAAK,CAACD,WAAWJ,oBAAoBM,aAAYF,OAAMG,IAAIC,OAAOR,QAAAA,IAAYI,OAAMK,OAAOT,QAAAA,IAClGU;AAGJ,QAAMC,UAAUC,w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AAEA,SAAKH,KAAAA;AACL,UAAMyB,WAAWC,YAAY,MAAM,KAAK1B,KAAAA,GAAQX,cAAAA;AAEhD,UAAMsC,qBAAqBrC,OAAOW,OAAO2B,UAAU,MAAA;AACjD,WAAK5B,KAAAA;IACP,CAAA;AAEA,WAAO,MAAA;AACLD,kBAAY;AACZ8B,oBAAcJ,QAAAA;AACdE,yBAAmBG,YAAW;IAChC;EACF,GAAG;IAACxC;IAAQD;GAAe;AAE3B,SAAOG;AACT;;;AClEO,IAAMuC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOD,OAAOE,MAAMC;AACtB;",
6
- "names": ["MulticastObservable", "PublicKey", "HaloSpaceMember", "useMulticastObservable", "PublicKey", "SpaceState", "useMulticastObservable", "useSpace", "spaceId", "client", "useClient", "spaces", "useMulticastObservable", "undefined", "find", "space", "PublicKey", "key", "equals", "id", "useDatabase", "db", "useSpaces", "all", "filter", "state", "get", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "PublicKey", "key", "equals", "id", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "useMemo", "MulticastObservable", "useMulticastObservable", "useSpaceInvitations", "spaceId", "space", "useSpace", "useMulticastObservable", "invitations", "MulticastObservable", "empty", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "MulticastObservable", "SpaceState", "useObject", "useMulticastObservable", "useSpaceProperties", "spaceId", "space", "useSpace", "spaceState", "useMulticastObservable", "state", "MulticastObservable", "empty", "properties", "SpaceState", "SPACE_READY", "undefined", "useObject", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "current", "subscriptionRef", "unsubscribe", "update", "useEffect", "useState", "Context", "isEdgePeerId", "spaceState", "setSpaceState", "useEffect", "Context", "createSubscriptions", "space", "spaces", "id", "onDispose", "syncState", "client", "internal", "peers", "find", "isEdgePeerId", "state", "useEffect", "useState", "DEFAULT_POLL_INTERVAL_MS", "useFeedSyncState", "pollIntervalMs", "client", "useClient", "feedSyncState", "setFeedSyncState", "useState", "useEffect", "queueService", "services", "QueueService", "cancelled", "poll", "spaces", "get", "entries", "Promise", "all", "map", "space", "response", "getSyncState", "spaceId", "id", "state", "namespaces", "reduce", "acc", "entry", "pending", "Number", "blocksToPull", "blocksToPush", "total", "totalBlocks", "Object", "fromEntries", "interval", "setInterval", "spacesSubscription", "subscribe", "clearInterval", "unsubscribe", "useRegistry", "client", "useClient", "graph", "registry"]
7
- }
@@ -1,109 +0,0 @@
1
- import {
2
- useInvitationStatus
3
- } from "../chunk-SSDQ6NXU.mjs";
4
- import {
5
- useClient
6
- } from "../chunk-3LVU7RNK.mjs";
7
- import "../chunk-CZMIVAGI.mjs";
8
-
9
- // src/halo/index.ts
10
- import { Device, DeviceKind, DeviceType } from "@dxos/client/halo";
11
-
12
- // src/halo/useContacts.ts
13
- import { useMulticastObservable } from "@dxos/react-hooks";
14
- var useContacts = () => {
15
- const client = useClient();
16
- return useMulticastObservable(client.halo.contacts);
17
- };
18
-
19
- // src/halo/useCredentials.ts
20
- import { useMulticastObservable as useMulticastObservable2 } from "@dxos/react-hooks";
21
- var useCredentials = () => {
22
- const client = useClient();
23
- return useMulticastObservable2(client.halo.credentials);
24
- };
25
-
26
- // src/halo/useDevices.ts
27
- import { useMulticastObservable as useMulticastObservable3 } from "@dxos/react-hooks";
28
- var useDevices = () => {
29
- const client = useClient();
30
- return useMulticastObservable3(client.halo.devices);
31
- };
32
-
33
- // src/halo/useHaloInvitations.ts
34
- import { useMemo } from "react";
35
- import { useMulticastObservable as useMulticastObservable4 } from "@dxos/react-hooks";
36
- var useHaloInvitations = () => {
37
- const client = useClient();
38
- return useMulticastObservable4(client.halo.invitations);
39
- };
40
- var useHaloInvitation = (invitationId) => {
41
- const invitations = useHaloInvitations();
42
- const invitation = useMemo(() => invitations.find((invitation2) => invitation2.get().invitationId === invitationId), [
43
- invitations
44
- ]);
45
- return useInvitationStatus(invitation);
46
- };
47
-
48
- // src/halo/useIdentity.ts
49
- import { useMulticastObservable as useMulticastObservable5 } from "@dxos/react-hooks";
50
- var useIdentity = () => {
51
- const client = useClient();
52
- return useMulticastObservable5(client.halo.identity);
53
- };
54
-
55
- // src/halo/useKeyStore.ts
56
- import { useMemo as useMemo2, useReducer } from "react";
57
- var KeyStore = class {
58
- _defaultKeys;
59
- _keyMap = /* @__PURE__ */ new Map();
60
- constructor(_defaultKeys = []) {
61
- this._defaultKeys = _defaultKeys;
62
- }
63
- get map() {
64
- return this._keyMap;
65
- }
66
- // TODO(burdon): Create subkeys.
67
- initialize() {
68
- this._defaultKeys.forEach((key) => {
69
- const value = localStorage.getItem(key);
70
- this.setKey(key, value ?? "");
71
- });
72
- return this;
73
- }
74
- getKey(key) {
75
- localStorage.getItem(key);
76
- }
77
- setKey(key, value) {
78
- localStorage.setItem(key, "");
79
- this._keyMap.set(key, value);
80
- }
81
- };
82
- var useKeyStore = (defaultKeys = []) => {
83
- const [, forceUpdate] = useReducer((x) => x + 1, 0);
84
- const store = useMemo2(() => new KeyStore(defaultKeys).initialize(), [
85
- defaultKeys
86
- ]);
87
- const setKey = (key, value) => {
88
- store.setKey(key, value);
89
- forceUpdate();
90
- };
91
- return [
92
- store.map,
93
- setKey
94
- ];
95
- };
96
- export {
97
- Device,
98
- DeviceKind,
99
- DeviceType,
100
- KeyStore,
101
- useContacts,
102
- useCredentials,
103
- useDevices,
104
- useHaloInvitation,
105
- useHaloInvitations,
106
- useIdentity,
107
- useKeyStore
108
- };
109
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/halo/index.ts", "../../../../src/halo/useContacts.ts", "../../../../src/halo/useCredentials.ts", "../../../../src/halo/useDevices.ts", "../../../../src/halo/useHaloInvitations.ts", "../../../../src/halo/useIdentity.ts", "../../../../src/halo/useKeyStore.ts"],
4
- "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n type Contact,\n type Credential,\n Device,\n DeviceKind,\n DeviceType,\n type Halo,\n type Identity,\n} from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useCredentials';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Contact } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Returns all known Contacts across all Spaces.\n * Contacts are known members of a common Space.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useContacts = (): Contact[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.contacts);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Credential } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\nexport const useCredentials = (): Credential[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.credentials);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Device } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.devices);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\nexport const useHaloInvitations = (): CancellableInvitationObservable[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.invitations);\n};\n\nexport const useHaloInvitation = (invitationId?: string) => {\n const invitations = useHaloInvitations();\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Identity } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Hook returning DXOS identity object.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useIdentity = (): Identity | null => {\n const client = useClient();\n return useMulticastObservable(client.halo.identity);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useMemo, useReducer } from 'react';\n\n// TODO(burdon): Move to settings plugin.\nexport class KeyStore {\n private _keyMap = new Map<string, string>();\n\n constructor(private readonly _defaultKeys: string[] = []) {}\n\n get map() {\n return this._keyMap;\n }\n\n // TODO(burdon): Create subkeys.\n initialize(): this {\n this._defaultKeys.forEach((key) => {\n const value = localStorage.getItem(key);\n this.setKey(key, value ?? '');\n });\n\n return this;\n }\n\n getKey(key: string): void {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string): void {\n localStorage.setItem(key, '');\n this._keyMap.set(key, value);\n }\n}\n\n/**\n * Settings store.\n * @deprecated Replace with HALO key store when available.\n */\nexport const useKeyStore = (\n defaultKeys: string[] = [],\n): [Map<string, string>, (key: string, value: string) => void] => {\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n const store = useMemo(() => new KeyStore(defaultKeys).initialize(), [defaultKeys]);\n const setKey = (key: string, value: string) => {\n store.setKey(key, value);\n forceUpdate();\n };\n\n return [store.map, setKey];\n};\n"],
5
- "mappings": ";;;;;;;;;AAKA,SAGEA,QACAC,YACAC,kBAGK;;;ACRP,SAASC,8BAA8B;AAShC,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOC,uBAAuBF,OAAOG,KAAKC,QAAQ;AACpD;;;ACZA,SAASC,0BAAAA,+BAA8B;AAIhC,IAAMC,iBAAiB,MAAA;AAC5B,QAAMC,SAASC,UAAAA;AACf,SAAOC,wBAAuBF,OAAOG,KAAKC,WAAW;AACvD;;;ACPA,SAASC,0BAAAA,+BAA8B;AAIhC,IAAMC,aAAa,MAAA;AACxB,Q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AAG,CAAA;AACjD,QAAMC,QAAQrB,SAAQ,MAAM,IAAIE,SAASgB,WAAAA,EAAaX,WAAU,GAAI;IAACW;GAAY;AACjF,QAAML,SAAS,CAACJ,KAAaC,UAAAA;AAC3BW,UAAMR,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACE,MAAMf;IAAKO;;AACrB;",
6
- "names": ["Device", "DeviceKind", "DeviceType", "useMulticastObservable", "useContacts", "client", "useClient", "useMulticastObservable", "halo", "contacts", "useMulticastObservable", "useCredentials", "client", "useClient", "useMulticastObservable", "halo", "credentials", "useMulticastObservable", "useDevices", "client", "useClient", "useMulticastObservable", "halo", "devices", "useMemo", "useMulticastObservable", "useHaloInvitations", "client", "useClient", "useMulticastObservable", "halo", "invitations", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useMulticastObservable", "useIdentity", "client", "useClient", "useMulticastObservable", "halo", "identity", "useMemo", "useReducer", "KeyStore", "_keyMap", "Map", "_defaultKeys", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "x", "store"]
7
- }