@dxos/react-client 0.8.4-main.937b3ca → 0.8.4-main.9be5663bfe
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/.storybook/main.mts +1 -3
- package/dist/lib/browser/{chunk-5UKA2BMA.mjs → chunk-BVDNYEYI.mjs} +10 -10
- package/dist/lib/browser/chunk-BVDNYEYI.mjs.map +7 -0
- package/dist/lib/browser/echo/index.mjs +16 -29
- package/dist/lib/browser/echo/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +14 -48
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-T3QTQHBD.mjs → chunk-VSA674XR.mjs} +10 -10
- package/dist/lib/node-esm/chunk-VSA674XR.mjs.map +7 -0
- package/dist/lib/node-esm/echo/index.mjs +16 -29
- package/dist/lib/node-esm/echo/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +14 -48
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/client/ClientProvider.d.ts.map +1 -1
- package/dist/types/src/echo/useQueue.d.ts +1 -0
- package/dist/types/src/echo/useQueue.d.ts.map +1 -1
- package/dist/types/src/echo/useSpaceInvitations.d.ts.map +1 -1
- package/dist/types/src/echo/useSpaces.d.ts +5 -5
- package/dist/types/src/echo/useSpaces.d.ts.map +1 -1
- package/dist/types/src/echo/useSyncState.d.ts.map +1 -1
- package/dist/types/src/halo/Passkey.stories.d.ts.map +1 -1
- package/dist/types/src/testing/ClientRepeater.d.ts +1 -1
- package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
- package/dist/types/src/testing/ClientRepeater.stories.d.ts.map +1 -1
- package/dist/types/src/testing/util.d.ts.map +1 -1
- package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
- package/dist/types/src/testing/withClientProvider.stories.d.ts +2 -1
- package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/docs/README.md +38 -38
- package/moon.yml +2 -5
- package/package.json +24 -25
- package/src/client/ClientProvider.test.tsx +0 -1
- package/src/client/ClientProvider.tsx +0 -1
- package/src/client/useConfig.test.tsx +0 -1
- package/src/echo/useQueue.ts +1 -2
- package/src/echo/useSpaceInvitations.ts +0 -1
- package/src/echo/useSpaces.test.tsx +6 -13
- package/src/echo/useSpaces.ts +14 -30
- package/src/echo/useSyncState.ts +2 -1
- package/src/halo/Passkey.stories.tsx +4 -5
- package/src/halo/useDevices.test.tsx +0 -1
- package/src/testing/ClientRepeater.stories.tsx +4 -5
- package/src/testing/ClientRepeater.tsx +3 -4
- package/src/testing/util.tsx +0 -1
- package/src/testing/withClientProvider.stories.tsx +12 -7
- package/src/testing/withClientProvider.tsx +4 -38
- package/typedoc.json +1 -1
- package/vitest.config.ts +0 -2
- package/dist/lib/browser/chunk-5UKA2BMA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-T3QTQHBD.mjs.map +0 -7
- package/dist/types/src/playwright/playwright.config.d.ts +0 -3
- package/dist/types/src/playwright/playwright.config.d.ts.map +0 -1
- package/dist/types/src/playwright/smoke.spec.d.ts +0 -2
- package/dist/types/src/playwright/smoke.spec.d.ts.map +0 -1
- package/src/playwright/playwright.config.ts +0 -17
- package/src/playwright/smoke.spec.ts +0 -24
package/.storybook/main.mts
CHANGED
|
@@ -65,14 +65,14 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
65
65
|
});
|
|
66
66
|
log("client ready", void 0, {
|
|
67
67
|
F: __dxlog_file,
|
|
68
|
-
L:
|
|
68
|
+
L: 123,
|
|
69
69
|
S: void 0,
|
|
70
70
|
C: (f, a) => f(...a)
|
|
71
71
|
});
|
|
72
72
|
await onInitialized?.(client3);
|
|
73
73
|
log("initialization complete", void 0, {
|
|
74
74
|
F: __dxlog_file,
|
|
75
|
-
L:
|
|
75
|
+
L: 125,
|
|
76
76
|
S: void 0,
|
|
77
77
|
C: (f, a) => f(...a)
|
|
78
78
|
});
|
|
@@ -93,7 +93,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
93
93
|
config
|
|
94
94
|
}, {
|
|
95
95
|
F: __dxlog_file,
|
|
96
|
-
L:
|
|
96
|
+
L: 143,
|
|
97
97
|
S: void 0,
|
|
98
98
|
C: (f, a) => f(...a)
|
|
99
99
|
});
|
|
@@ -102,7 +102,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
102
102
|
services
|
|
103
103
|
}, {
|
|
104
104
|
F: __dxlog_file,
|
|
105
|
-
L:
|
|
105
|
+
L: 145,
|
|
106
106
|
S: void 0,
|
|
107
107
|
C: (f, a) => f(...a)
|
|
108
108
|
});
|
|
@@ -113,7 +113,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
113
113
|
});
|
|
114
114
|
log("created client", void 0, {
|
|
115
115
|
F: __dxlog_file,
|
|
116
|
-
L:
|
|
116
|
+
L: 147,
|
|
117
117
|
S: void 0,
|
|
118
118
|
C: (f, a) => f(...a)
|
|
119
119
|
});
|
|
@@ -123,7 +123,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
123
123
|
if (!disposed) {
|
|
124
124
|
log.catch(err, void 0, {
|
|
125
125
|
F: __dxlog_file,
|
|
126
|
-
L:
|
|
126
|
+
L: 152,
|
|
127
127
|
S: void 0,
|
|
128
128
|
C: (f, a) => f(...a)
|
|
129
129
|
});
|
|
@@ -132,7 +132,7 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
132
132
|
return () => {
|
|
133
133
|
log("clean up", void 0, {
|
|
134
134
|
F: __dxlog_file,
|
|
135
|
-
L:
|
|
135
|
+
L: 157,
|
|
136
136
|
S: void 0,
|
|
137
137
|
C: (f, a) => f(...a)
|
|
138
138
|
});
|
|
@@ -141,13 +141,13 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
141
141
|
void client2?.destroy().then(() => {
|
|
142
142
|
log("destroyed", void 0, {
|
|
143
143
|
F: __dxlog_file,
|
|
144
|
-
L:
|
|
144
|
+
L: 164,
|
|
145
145
|
S: void 0,
|
|
146
146
|
C: (f, a) => f(...a)
|
|
147
147
|
});
|
|
148
148
|
}).catch((err) => log.catch(err, void 0, {
|
|
149
149
|
F: __dxlog_file,
|
|
150
|
-
L:
|
|
150
|
+
L: 166,
|
|
151
151
|
S: void 0,
|
|
152
152
|
C: (f, a) => f(...a)
|
|
153
153
|
}));
|
|
@@ -176,4 +176,4 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
176
176
|
export {
|
|
177
177
|
ClientProvider
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-BVDNYEYI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 = true;\n // eslint-disable-next-line no-console\n console.log(`%c${BANNER(client)}`, 'font-family: monospace;');\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
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", "ClientProvider", "forwardRef", "children", "config", "configProp", "client", "clientProp", "services", "servicesProp", "status", "statusProp", "fallback", "Fallback", "noBanner", "onInitialized", "options", "forwardedRef", "error", "setError", "useState", "setClient", "Client", "undefined", "useImperativeHandle", "setStatus", "useControlledState", "useEffect", "subscription", "subscribe", "unsubscribe", "useAsyncEffect", "disposed", "initialize", "initialized", "catch", "err", "log", "printBanner", "getAsyncProviderValue", "destroy", "then", "SystemStatus", "ACTIVE", "ClientContext", "Provider", "value"]
|
|
7
|
+
}
|
|
@@ -17,35 +17,21 @@ import { HaloSpaceMember } from "@dxos/client/echo";
|
|
|
17
17
|
import { useMulticastObservable as useMulticastObservable2 } from "@dxos/react-hooks";
|
|
18
18
|
|
|
19
19
|
// src/echo/useSpaces.ts
|
|
20
|
-
import { useState } from "react";
|
|
21
20
|
import { PublicKey } from "@dxos/client";
|
|
22
21
|
import { SpaceState } from "@dxos/client/echo";
|
|
23
|
-
import {
|
|
22
|
+
import { useMulticastObservable } from "@dxos/react-hooks";
|
|
24
23
|
var useSpace = (spaceId) => {
|
|
25
24
|
const client = useClient();
|
|
26
25
|
const spaces = useMulticastObservable(client.spaces);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (spaceId) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
await client.spaces.waitUntilReady();
|
|
33
|
-
setReady(true);
|
|
34
|
-
}, [
|
|
35
|
-
client,
|
|
36
|
-
spaceId
|
|
37
|
-
]);
|
|
38
|
-
if (spaceId) {
|
|
39
|
-
return spaces.find((space) => {
|
|
40
|
-
if (spaceId instanceof PublicKey) {
|
|
41
|
-
return space.key.equals(spaceId);
|
|
42
|
-
}
|
|
43
|
-
return space.id === spaceId;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
if (ready && client.halo.identity.get()) {
|
|
47
|
-
return client.spaces.default;
|
|
26
|
+
if (!spaceId) {
|
|
27
|
+
return void 0;
|
|
48
28
|
}
|
|
29
|
+
return spaces.find((space) => {
|
|
30
|
+
if (spaceId instanceof PublicKey) {
|
|
31
|
+
return space.key.equals(spaceId);
|
|
32
|
+
}
|
|
33
|
+
return space.id === spaceId;
|
|
34
|
+
});
|
|
49
35
|
};
|
|
50
36
|
var useDatabase = (spaceId) => {
|
|
51
37
|
const space = useSpace(spaceId);
|
|
@@ -162,18 +148,19 @@ var useSubscription = (cb, selection) => {
|
|
|
162
148
|
};
|
|
163
149
|
|
|
164
150
|
// src/echo/useSyncState.ts
|
|
165
|
-
import { useEffect as useEffect3, useState
|
|
151
|
+
import { useEffect as useEffect3, useState } from "react";
|
|
166
152
|
import { Context } from "@dxos/context";
|
|
167
153
|
import { EdgeService } from "@dxos/protocols";
|
|
154
|
+
import { compositeKey } from "@dxos/util";
|
|
168
155
|
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/echo/useSyncState.ts";
|
|
169
|
-
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(
|
|
156
|
+
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(compositeKey(EdgeService.AUTOMERGE_REPLICATOR, spaceId));
|
|
170
157
|
var useSyncState = () => {
|
|
171
158
|
const client = useClient();
|
|
172
|
-
const [spaceState, setSpaceState] =
|
|
159
|
+
const [spaceState, setSpaceState] = useState({});
|
|
173
160
|
useEffect3(() => {
|
|
174
161
|
const ctx = new Context(void 0, {
|
|
175
162
|
F: __dxlog_file,
|
|
176
|
-
L:
|
|
163
|
+
L: 26
|
|
177
164
|
});
|
|
178
165
|
const createSubscriptions = (spaces) => {
|
|
179
166
|
for (const space of spaces) {
|
|
@@ -204,11 +191,11 @@ var useSyncState = () => {
|
|
|
204
191
|
return spaceState;
|
|
205
192
|
};
|
|
206
193
|
var useSpaceSyncState = (space) => {
|
|
207
|
-
const [spaceState, setSpaceState] =
|
|
194
|
+
const [spaceState, setSpaceState] = useState();
|
|
208
195
|
useEffect3(() => {
|
|
209
196
|
const ctx = new Context(void 0, {
|
|
210
197
|
F: __dxlog_file,
|
|
211
|
-
L:
|
|
198
|
+
L: 65
|
|
212
199
|
});
|
|
213
200
|
space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
214
201
|
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useQueue.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSpaceProperties.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.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 './useQueue';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\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 { useState } from 'react';\n\nimport { PublicKey } from '@dxos/client';\nimport { type Space, type SpaceId, SpaceState } from '@dxos/client/echo';\nimport { useAsyncEffect, 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 the default space 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 const [ready, setReady] = useState(false);\n\n useAsyncEffect(async () => {\n // Only wait for ready if looking for the default space.\n if (spaceId) {\n return;\n }\n\n await client.spaces.waitUntilReady();\n setReady(true);\n }, [client, spaceId]);\n\n if (spaceId) {\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 if (ready && client.halo.identity.get()) {\n return client.spaces.default;\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 the default space 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 */\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 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Entity } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n */\n// TODO(burdon): Replace polling with socket?\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\n// TODO(ZaymonFC): If queue is unchanged returned object should be refferentially stable on poll.\nexport const useQueue = <T extends Entity.Unknown>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\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/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\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 { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);\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"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,cAAc;AACd,cAAc;;;ACDd,SAASA,2BAA2B;AACpC,SAASC,aAAAA,kBAAqC;AAC9C,SAASC,uBAAyC;AAClD,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,
|
|
6
|
-
"names": ["MulticastObservable", "PublicKey", "HaloSpaceMember", "useMulticastObservable", "
|
|
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 './useQueue';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSpaceProperties';\nexport * from './useSubscription';\nexport * from './useSyncState';\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, type SpaceId, SpaceState } from '@dxos/client/echo';\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 */\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 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Entity } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n * @deprecated Use `useQuery` instead.\n */\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\nexport const useQueue = <T extends Entity.Unknown>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\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/client/echo';\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 { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\nimport { compositeKey } from '@dxos/util';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(compositeKey(EdgeService.AUTOMERGE_REPLICATOR, spaceId));\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"],
|
|
5
|
+
"mappings": "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",
|
|
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", "useEffect", "useMemo", "useRef", "raise", "MIN_POLL_INTERVAL", "useQueue", "queueDxn", "options", "client", "useClient", "mountedRef", "useRef", "queue", "useMemo", "undefined", "spaceId", "asQueueDXN", "raise", "TypeError", "spaces", "get", "queues", "toString", "useEffect", "refresh", "timeout", "current", "poll", "finally", "pollInterval", "setTimeout", "Math", "max", "clearTimeout", "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", "useRef", "current", "subscriptionRef", "useEffect", "createSubscription", "unsubscribe", "update", "useEffect", "useState", "Context", "EdgeService", "compositeKey", "isEdgePeerId", "peerId", "spaceId", "startsWith", "compositeKey", "EdgeService", "AUTOMERGE_REPLICATOR", "useSyncState", "client", "useClient", "spaceState", "setSpaceState", "useState", "useEffect", "ctx", "Context", "createSubscriptions", "spaces", "space", "id", "onDispose", "internal", "db", "subscribeToSyncState", "peers", "syncState", "find", "state", "get", "subscribe", "dispose", "useSpaceSyncState"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/client/AgentHostingProvider.tsx":{"bytes":7107,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/banner.ts":{"bytes":3825,"imports":[],"format":"esm"},"src/client/context.ts":{"bytes":1279,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/ClientProvider.tsx":{"bytes":16865,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/banner.ts","kind":"import-statement","original":"../banner"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useClient.ts":{"bytes":1643,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"../client/context"}],"format":"esm"},"src/client/useClientStatus.ts":{"bytes":1969,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/useConfig.ts":{"bytes":1748,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useShell.ts":{"bytes":2332,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"}],"format":"esm"},"src/client/useStatus.ts":{"bytes":1464,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/index.ts":{"bytes":1150,"imports":[{"path":"src/client/AgentHostingProvider.tsx","kind":"import-statement","original":"./AgentHostingProvider"},{"path":"src/client/ClientProvider.tsx","kind":"import-statement","original":"./ClientProvider"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"},{"path":"src/client/useClientStatus.ts","kind":"import-statement","original":"./useClientStatus"},{"path":"src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"}],"format":"esm"},"src/devtools/useDevtools.ts":{"bytes":1400,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/devtools/useStream.ts":{"bytes":2795,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/devtools/index.ts":{"bytes":680,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"src/echo/useSpaces.ts":{"bytes":7765,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useMembers.ts":{"bytes":3466,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useQueue.ts":{"bytes":6346,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/invitations/useInvitationStatus.ts":{"bytes":20448,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":1286,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"src/echo/useSpaceInvitations.ts":{"bytes":4052,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSpaceProperties.ts":{"bytes":3594,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSubscription.ts":{"bytes":3535,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useSyncState.ts":{"bytes":7775,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/index.ts":{"bytes":1293,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"src/echo/useQueue.ts","kind":"import-statement","original":"./useQueue"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"src/echo/useSpaceProperties.ts","kind":"import-statement","original":"./useSpaceProperties"},{"path":"src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"},{"path":"src/echo/useSyncState.ts","kind":"import-statement","original":"./useSyncState"}],"format":"esm"},"src/halo/useContacts.ts":{"bytes":1705,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useCredentials.ts":{"bytes":1344,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useDevices.ts":{"bytes":1292,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useHaloInvitations.ts":{"bytes":2724,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"src/halo/useIdentity.ts":{"bytes":1575,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useKeyStore.ts":{"bytes":4537,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/halo/index.ts":{"bytes":1446,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"src/halo/useCredentials.ts","kind":"import-statement","original":"./useCredentials"},{"path":"src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"src/index.ts":{"bytes":760,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"src/mesh/useNetworkStatus.ts":{"bytes":1504,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/mesh/index.ts":{"bytes":588,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"src/testing/context.tsx":{"bytes":1628,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/testing/ClientRepeater.tsx":{"bytes":10480,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/testing/withClientProvider.tsx":{"bytes":22707,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-error-boundary","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"}],"format":"esm"},"src/testing/index.ts":{"bytes":793,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"},{"path":"src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"src/testing/withClientProvider.tsx","kind":"import-statement","original":"./withClientProvider"}],"format":"esm"},"src/worker.ts":{"bytes":478,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2292},"dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"src/devtools/index.ts","inputs":{"src/devtools/index.ts":{"bytesInOutput":39},"src/devtools/useDevtools.ts":{"bytesInOutput":195},"src/devtools/useStream.ts":{"bytesInOutput":677}},"bytes":1158},"dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18960},"dist/lib/browser/echo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true}],"exports":["useDatabase","useMembers","useQueue","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaceProperties","useSpaceSyncState","useSpaces","useSubscription","useSyncState"],"entryPoint":"src/echo/index.ts","inputs":{"src/echo/index.ts":{"bytesInOutput":69},"src/echo/useMembers.ts":{"bytesInOutput":659},"src/echo/useSpaces.ts":{"bytesInOutput":1120},"src/echo/useQueue.ts":{"bytesInOutput":1163},"src/echo/useSpaceInvitations.ts":{"bytesInOutput":673},"src/echo/useSpaceProperties.ts":{"bytesInOutput":563},"src/echo/useSubscription.ts":{"bytesInOutput":536},"src/echo/useSyncState.ts":{"bytesInOutput":1838}},"bytes":7263},"dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6989},"dist/lib/browser/halo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","KeyStore","useContacts","useCredentials","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"src/halo/index.ts","inputs":{"src/halo/index.ts":{"bytesInOutput":68},"src/halo/useContacts.ts":{"bytesInOutput":174},"src/halo/useCredentials.ts":{"bytesInOutput":208},"src/halo/useDevices.ts":{"bytesInOutput":200},"src/halo/useHaloInvitations.ts":{"bytesInOutput":521},"src/halo/useIdentity.ts":{"bytesInOutput":202},"src/halo/useKeyStore.ts":{"bytesInOutput":937}},"bytes":2873},"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7376},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5UKA2BMA.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["AgentHostingContext","AgentHostingProvider","ClientContext","ClientProvider","useAgentHostingClient","useClient","useClientStatus","useConfig","useMulticastObservable","useShell","useShellDisplay","useStatus"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":90},"src/client/AgentHostingProvider.tsx":{"bytesInOutput":1798},"src/client/useClientStatus.ts":{"bytesInOutput":383},"src/client/useConfig.ts":{"bytesInOutput":234},"src/client/useShell.ts":{"bytesInOutput":377},"src/client/useStatus.ts":{"bytesInOutput":238}},"bytes":3727},"dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"src/invitations/index.ts","inputs":{},"bytes":388},"dist/lib/browser/chunk-LO3TU5CK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11043},"dist/lib/browser/chunk-LO3TU5CK.mjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"src/invitations/index.ts":{"bytesInOutput":198},"src/invitations/useInvitationStatus.ts":{"bytesInOutput":4667}},"bytes":5180},"dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":936},"dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"src/mesh/index.ts","inputs":{"src/mesh/index.ts":{"bytesInOutput":35},"src/mesh/useNetworkStatus.ts":{"bytesInOutput":184}},"bytes":425},"dist/lib/browser/chunk-PFF63FPR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":807},"dist/lib/browser/chunk-PFF63FPR.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["useClient"],"inputs":{"src/client/useClient.ts":{"bytesInOutput":211}},"bytes":364},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18503},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-5UKA2BMA.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-error-boundary","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["ClientRepeater","ClientStory","useClientStory","withClientProvider","withMultiClientProvider"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":38},"src/testing/context.tsx":{"bytesInOutput":254},"src/testing/ClientRepeater.tsx":{"bytesInOutput":1849},"src/testing/withClientProvider.tsx":{"bytesInOutput":5708}},"bytes":8212},"dist/lib/browser/chunk-5UKA2BMA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10216},"dist/lib/browser/chunk-5UKA2BMA.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ClientProvider"],"inputs":{"src/client/ClientProvider.tsx":{"bytesInOutput":3936},"src/banner.ts":{"bytesInOutput":817}},"bytes":4969},"dist/lib/browser/chunk-TSF6Y5VB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":711},"dist/lib/browser/chunk-TSF6Y5VB.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["ClientContext"],"inputs":{"src/client/context.ts":{"bytesInOutput":82}},"bytes":180},"dist/lib/browser/worker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"dist/lib/browser/worker.mjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/worker.ts","inputs":{"src/worker.ts":{"bytesInOutput":37}},"bytes":90}}}
|
|
1
|
+
{"inputs":{"src/client/AgentHostingProvider.tsx":{"bytes":7107,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/banner.ts":{"bytes":3825,"imports":[],"format":"esm"},"src/client/context.ts":{"bytes":1279,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/ClientProvider.tsx":{"bytes":16865,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/banner.ts","kind":"import-statement","original":"../banner"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useClient.ts":{"bytes":1643,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"../client/context"}],"format":"esm"},"src/client/useClientStatus.ts":{"bytes":1969,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/client/useConfig.ts":{"bytes":1748,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/useShell.ts":{"bytes":2332,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"}],"format":"esm"},"src/client/useStatus.ts":{"bytes":1464,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"},"src/client/index.ts":{"bytes":1150,"imports":[{"path":"src/client/AgentHostingProvider.tsx","kind":"import-statement","original":"./AgentHostingProvider"},{"path":"src/client/ClientProvider.tsx","kind":"import-statement","original":"./ClientProvider"},{"path":"src/client/context.ts","kind":"import-statement","original":"./context"},{"path":"src/client/useClient.ts","kind":"import-statement","original":"./useClient"},{"path":"src/client/useClientStatus.ts","kind":"import-statement","original":"./useClientStatus"},{"path":"src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"}],"format":"esm"},"src/devtools/useDevtools.ts":{"bytes":1400,"imports":[{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/devtools/useStream.ts":{"bytes":2795,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/devtools/index.ts":{"bytes":680,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"src/echo/useSpaces.ts":{"bytes":6259,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/useMembers.ts":{"bytes":3466,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useQueue.ts":{"bytes":6065,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/invitations/useInvitationStatus.ts":{"bytes":20448,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/invitations/index.ts":{"bytes":1286,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"src/echo/useSpaceInvitations.ts":{"bytes":4052,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSpaceProperties.ts":{"bytes":3594,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"src/echo/useSubscription.ts":{"bytes":3535,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"src/echo/useSyncState.ts":{"bytes":7933,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/echo/index.ts":{"bytes":1293,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"src/echo/useQueue.ts","kind":"import-statement","original":"./useQueue"},{"path":"src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"src/echo/useSpaceProperties.ts","kind":"import-statement","original":"./useSpaceProperties"},{"path":"src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"},{"path":"src/echo/useSyncState.ts","kind":"import-statement","original":"./useSyncState"}],"format":"esm"},"src/halo/useContacts.ts":{"bytes":1705,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useCredentials.ts":{"bytes":1344,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useDevices.ts":{"bytes":1292,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useHaloInvitations.ts":{"bytes":2724,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"src/halo/useIdentity.ts":{"bytes":1575,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/halo/useKeyStore.ts":{"bytes":4537,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/halo/index.ts":{"bytes":1446,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"src/halo/useCredentials.ts","kind":"import-statement","original":"./useCredentials"},{"path":"src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"src/index.ts":{"bytes":760,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"src/mesh/useNetworkStatus.ts":{"bytes":1504,"imports":[{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/mesh/index.ts":{"bytes":588,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"src/testing/context.tsx":{"bytes":1628,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"format":"esm"},"src/testing/ClientRepeater.tsx":{"bytes":10482,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"src/testing/withClientProvider.tsx":{"bytes":18285,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"}],"format":"esm"},"src/testing/index.ts":{"bytes":793,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"src/testing/context.tsx","kind":"import-statement","original":"./context"},{"path":"src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"src/testing/withClientProvider.tsx","kind":"import-statement","original":"./withClientProvider"}],"format":"esm"},"src/worker.ts":{"bytes":478,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2292},"dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"src/devtools/index.ts","inputs":{"src/devtools/index.ts":{"bytesInOutput":39},"src/devtools/useDevtools.ts":{"bytesInOutput":195},"src/devtools/useStream.ts":{"bytesInOutput":677}},"bytes":1158},"dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18158},"dist/lib/browser/echo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/protocols","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["useDatabase","useMembers","useQueue","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaceProperties","useSpaceSyncState","useSpaces","useSubscription","useSyncState"],"entryPoint":"src/echo/index.ts","inputs":{"src/echo/index.ts":{"bytesInOutput":69},"src/echo/useMembers.ts":{"bytesInOutput":659},"src/echo/useSpaces.ts":{"bytesInOutput":781},"src/echo/useQueue.ts":{"bytesInOutput":1163},"src/echo/useSpaceInvitations.ts":{"bytesInOutput":673},"src/echo/useSpaceProperties.ts":{"bytesInOutput":563},"src/echo/useSubscription.ts":{"bytesInOutput":536},"src/echo/useSyncState.ts":{"bytesInOutput":1873}},"bytes":6959},"dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6989},"dist/lib/browser/halo/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","KeyStore","useContacts","useCredentials","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"src/halo/index.ts","inputs":{"src/halo/index.ts":{"bytesInOutput":68},"src/halo/useContacts.ts":{"bytesInOutput":174},"src/halo/useCredentials.ts":{"bytesInOutput":208},"src/halo/useDevices.ts":{"bytesInOutput":200},"src/halo/useHaloInvitations.ts":{"bytesInOutput":521},"src/halo/useIdentity.ts":{"bytesInOutput":202},"src/halo/useKeyStore.ts":{"bytesInOutput":937}},"bytes":2873},"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7376},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-BVDNYEYI.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["AgentHostingContext","AgentHostingProvider","ClientContext","ClientProvider","useAgentHostingClient","useClient","useClientStatus","useConfig","useMulticastObservable","useShell","useShellDisplay","useStatus"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":90},"src/client/AgentHostingProvider.tsx":{"bytesInOutput":1798},"src/client/useClientStatus.ts":{"bytesInOutput":383},"src/client/useConfig.ts":{"bytesInOutput":234},"src/client/useShell.ts":{"bytesInOutput":377},"src/client/useStatus.ts":{"bytesInOutput":238}},"bytes":3727},"dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-LO3TU5CK.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"src/invitations/index.ts","inputs":{},"bytes":388},"dist/lib/browser/chunk-LO3TU5CK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11043},"dist/lib/browser/chunk-LO3TU5CK.mjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"src/invitations/index.ts":{"bytesInOutput":198},"src/invitations/useInvitationStatus.ts":{"bytesInOutput":4667}},"bytes":5180},"dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":936},"dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-PFF63FPR.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"src/mesh/index.ts","inputs":{"src/mesh/index.ts":{"bytesInOutput":35},"src/mesh/useNetworkStatus.ts":{"bytesInOutput":184}},"bytes":425},"dist/lib/browser/chunk-PFF63FPR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":807},"dist/lib/browser/chunk-PFF63FPR.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true}],"exports":["useClient"],"inputs":{"src/client/useClient.ts":{"bytesInOutput":211}},"bytes":364},"dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16027},"dist/lib/browser/testing/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-BVDNYEYI.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ClientRepeater","ClientStory","useClientStory","withClientProvider","withMultiClientProvider"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/index.ts":{"bytesInOutput":38},"src/testing/context.tsx":{"bytesInOutput":254},"src/testing/ClientRepeater.tsx":{"bytesInOutput":1851},"src/testing/withClientProvider.tsx":{"bytesInOutput":4406}},"bytes":6912},"dist/lib/browser/chunk-BVDNYEYI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10214},"dist/lib/browser/chunk-BVDNYEYI.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TSF6Y5VB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ClientProvider"],"inputs":{"src/client/ClientProvider.tsx":{"bytesInOutput":3936},"src/banner.ts":{"bytesInOutput":817}},"bytes":4969},"dist/lib/browser/chunk-TSF6Y5VB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":711},"dist/lib/browser/chunk-TSF6Y5VB.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true}],"exports":["ClientContext"],"inputs":{"src/client/context.ts":{"bytesInOutput":82}},"bytes":180},"dist/lib/browser/worker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"dist/lib/browser/worker.mjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/worker.ts","inputs":{"src/worker.ts":{"bytesInOutput":37}},"bytes":90}}}
|