@dxos/react-client 0.8.4-main.ef1bc66f44 → 0.8.4-main.effb148878
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/{chunk-PFF63FPR.mjs → chunk-3LVU7RNK.mjs} +2 -2
- package/dist/lib/browser/{chunk-TSF6Y5VB.mjs → chunk-CZMIVAGI.mjs} +1 -1
- package/dist/lib/browser/{chunk-TSF6Y5VB.mjs.map → chunk-CZMIVAGI.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-5UKA2BMA.mjs → chunk-XT352YI6.mjs} +11 -56
- package/dist/lib/browser/chunk-XT352YI6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LO3TU5CK.mjs → chunk-YHE6WD44.mjs} +3 -13
- package/dist/lib/browser/{chunk-LO3TU5CK.mjs.map → chunk-YHE6WD44.mjs.map} +2 -2
- package/dist/lib/browser/devtools/index.mjs +3 -8
- package/dist/lib/browser/devtools/index.mjs.map +2 -2
- package/dist/lib/browser/echo/index.mjs +89 -97
- package/dist/lib/browser/echo/index.mjs.map +4 -4
- package/dist/lib/browser/halo/index.mjs +3 -3
- package/dist/lib/browser/halo/index.mjs.map +2 -2
- package/dist/lib/browser/index.mjs +6 -21
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/invitations/index.mjs +1 -1
- package/dist/lib/browser/mesh/index.mjs +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +15 -64
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-NETTSER2.mjs → chunk-CUDKNAMV.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-AQJH2UNZ.mjs → chunk-RQJPEHDY.mjs} +3 -13
- package/dist/lib/node-esm/{chunk-AQJH2UNZ.mjs.map → chunk-RQJPEHDY.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-T3QTQHBD.mjs → chunk-WL3Z5HOH.mjs} +11 -56
- package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-373DPHEQ.mjs → chunk-WUTK2IJF.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-373DPHEQ.mjs.map → chunk-WUTK2IJF.mjs.map} +2 -2
- package/dist/lib/node-esm/devtools/index.mjs +3 -8
- package/dist/lib/node-esm/devtools/index.mjs.map +2 -2
- package/dist/lib/node-esm/echo/index.mjs +89 -97
- package/dist/lib/node-esm/echo/index.mjs.map +4 -4
- package/dist/lib/node-esm/halo/index.mjs +3 -3
- package/dist/lib/node-esm/halo/index.mjs.map +2 -2
- package/dist/lib/node-esm/index.mjs +6 -21
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/invitations/index.mjs +1 -1
- package/dist/lib/node-esm/mesh/index.mjs +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +15 -64
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/banner.d.ts.map +1 -1
- package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -1
- package/dist/types/src/client/ClientProvider.d.ts +1 -1
- package/dist/types/src/client/ClientProvider.d.ts.map +1 -1
- package/dist/types/src/client/useClientStatus.d.ts.map +1 -1
- package/dist/types/src/devtools/useStream.d.ts.map +1 -1
- package/dist/types/src/echo/index.d.ts +1 -1
- package/dist/types/src/echo/index.d.ts.map +1 -1
- package/dist/types/src/echo/useFeedSyncState.d.ts +13 -0
- package/dist/types/src/echo/useFeedSyncState.d.ts.map +1 -0
- package/dist/types/src/echo/useMembers.d.ts.map +1 -1
- package/dist/types/src/echo/useSpaceInvitations.d.ts +1 -1
- package/dist/types/src/echo/useSpaceInvitations.d.ts.map +1 -1
- package/dist/types/src/echo/useSpaceProperties.d.ts.map +1 -1
- package/dist/types/src/echo/useSpaces.d.ts +9 -7
- package/dist/types/src/echo/useSpaces.d.ts.map +1 -1
- package/dist/types/src/echo/useSubscription.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/halo/useHaloInvitations.d.ts.map +1 -1
- package/dist/types/src/halo/useKeyStore.d.ts.map +1 -1
- package/dist/types/src/invitations/useInvitationStatus.d.ts.map +1 -1
- package/dist/types/src/testing/ClientRepeater.d.ts +2 -2
- 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/context.d.ts +2 -1
- package/dist/types/src/testing/context.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 +1 -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 +1 -4
- package/package.json +27 -51
- 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/index.ts +1 -1
- package/src/echo/useFeedSyncState.ts +78 -0
- package/src/echo/useSpaceInvitations.ts +1 -2
- package/src/echo/useSpaces.test.tsx +6 -13
- package/src/echo/useSpaces.ts +17 -31
- package/src/echo/useSyncState.ts +1 -5
- package/src/halo/Passkey.stories.tsx +4 -7
- package/src/halo/useDevices.test.tsx +0 -1
- package/src/testing/ClientRepeater.stories.tsx +4 -7
- package/src/testing/ClientRepeater.tsx +4 -5
- package/src/testing/context.tsx +2 -1
- package/src/testing/util.tsx +0 -1
- package/src/testing/withClientProvider.stories.tsx +6 -8
- package/src/testing/withClientProvider.tsx +6 -39
- package/tsconfig.json +6 -0
- package/typedoc.json +1 -1
- package/vitest.config.ts +0 -2
- package/.swc/plugins/linux_x86_64_19.0.0/727453fb3a62f7f1d952a41e051ca8a6f88cadc45cee43c6a4d1aa45f9b75665.wasmer-v7 +0 -0
- 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/echo/useQueue.d.ts +0 -11
- package/dist/types/src/echo/useQueue.d.ts.map +0 -1
- package/src/echo/useQueue.ts +0 -74
- /package/dist/lib/browser/{chunk-PFF63FPR.mjs.map → chunk-3LVU7RNK.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-NETTSER2.mjs.map → chunk-CUDKNAMV.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ClientContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WUTK2IJF.mjs";
|
|
5
5
|
|
|
6
6
|
// src/client/ClientProvider.tsx
|
|
7
7
|
import React, { forwardRef, useEffect, useImperativeHandle, useState } from "react";
|
|
@@ -64,19 +64,9 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
64
64
|
setError(err);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
log("client ready", void 0, {
|
|
68
|
-
F: __dxlog_file,
|
|
69
|
-
L: 124,
|
|
70
|
-
S: void 0,
|
|
71
|
-
C: (f, a) => f(...a)
|
|
72
|
-
});
|
|
67
|
+
log("client ready", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 50, S: void 0 });
|
|
73
68
|
await onInitialized?.(client3);
|
|
74
|
-
log("initialization complete", void 0, {
|
|
75
|
-
F: __dxlog_file,
|
|
76
|
-
L: 126,
|
|
77
|
-
S: void 0,
|
|
78
|
-
C: (f, a) => f(...a)
|
|
79
|
-
});
|
|
69
|
+
log("initialization complete", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 52, S: void 0 });
|
|
80
70
|
}
|
|
81
71
|
setClient(client3);
|
|
82
72
|
if (!noBanner) {
|
|
@@ -92,66 +82,31 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
92
82
|
const config = await getAsyncProviderValue(configProp);
|
|
93
83
|
log("resolved config", {
|
|
94
84
|
config
|
|
95
|
-
}, {
|
|
96
|
-
F: __dxlog_file,
|
|
97
|
-
L: 144,
|
|
98
|
-
S: void 0,
|
|
99
|
-
C: (f, a) => f(...a)
|
|
100
|
-
});
|
|
85
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 68, S: void 0 });
|
|
101
86
|
const services = await getAsyncProviderValue(servicesProp, config);
|
|
102
87
|
log("created services", {
|
|
103
88
|
services
|
|
104
|
-
}, {
|
|
105
|
-
F: __dxlog_file,
|
|
106
|
-
L: 146,
|
|
107
|
-
S: void 0,
|
|
108
|
-
C: (f, a) => f(...a)
|
|
109
|
-
});
|
|
89
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 72, S: void 0 });
|
|
110
90
|
client2 = new Client({
|
|
111
91
|
config,
|
|
112
92
|
services,
|
|
113
93
|
...options
|
|
114
94
|
});
|
|
115
|
-
log("created client", void 0, {
|
|
116
|
-
F: __dxlog_file,
|
|
117
|
-
L: 148,
|
|
118
|
-
S: void 0,
|
|
119
|
-
C: (f, a) => f(...a)
|
|
120
|
-
});
|
|
95
|
+
log("created client", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 80, S: void 0 });
|
|
121
96
|
await initialize(client2);
|
|
122
97
|
}
|
|
123
98
|
} catch (err) {
|
|
124
99
|
if (!disposed) {
|
|
125
|
-
log.catch(err, void 0, {
|
|
126
|
-
F: __dxlog_file,
|
|
127
|
-
L: 153,
|
|
128
|
-
S: void 0,
|
|
129
|
-
C: (f, a) => f(...a)
|
|
130
|
-
});
|
|
100
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 85, S: void 0 });
|
|
131
101
|
}
|
|
132
102
|
}
|
|
133
103
|
return () => {
|
|
134
|
-
log("clean up", void 0, {
|
|
135
|
-
F: __dxlog_file,
|
|
136
|
-
L: 158,
|
|
137
|
-
S: void 0,
|
|
138
|
-
C: (f, a) => f(...a)
|
|
139
|
-
});
|
|
104
|
+
log("clean up", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 89, S: void 0 });
|
|
140
105
|
disposed = true;
|
|
141
106
|
if (!clientProp) {
|
|
142
107
|
void client2?.destroy().then(() => {
|
|
143
|
-
log("destroyed", void 0, {
|
|
144
|
-
|
|
145
|
-
L: 165,
|
|
146
|
-
S: void 0,
|
|
147
|
-
C: (f, a) => f(...a)
|
|
148
|
-
});
|
|
149
|
-
}).catch((err) => log.catch(err, void 0, {
|
|
150
|
-
F: __dxlog_file,
|
|
151
|
-
L: 167,
|
|
152
|
-
S: void 0,
|
|
153
|
-
C: (f, a) => f(...a)
|
|
154
|
-
}));
|
|
108
|
+
log("destroyed", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 94, S: void 0 });
|
|
109
|
+
}).catch((err) => log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 95, S: void 0 }));
|
|
155
110
|
}
|
|
156
111
|
};
|
|
157
112
|
}, [
|
|
@@ -177,4 +132,4 @@ var ClientProvider = /* @__PURE__ */ forwardRef(({ children, config: configProp,
|
|
|
177
132
|
export {
|
|
178
133
|
ClientProvider
|
|
179
134
|
};
|
|
180
|
-
//# sourceMappingURL=chunk-
|
|
135
|
+
//# sourceMappingURL=chunk-WL3Z5HOH.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": ";;;;;;AAIA,OAAOA,SAGLC,YACAC,WACAC,qBACAC,gBACK;AAEP,SAASC,QAAyDC,oBAAoB;AAEtF,SAASC,WAAW;AACpB,SAASC,gBAAgBC,0BAA0B;AACnD,SAA2CC,6BAA6B;;;ACVxE,IAAMC,SAAS,CAACC,WAAAA;AACd,QAAMC,aAAaD,OAAOE,OAAOC,IAAI,8BAAA;AACrC,QAAMC,OAAOH,aAAa,eAAeA,UAAAA;IAAkB;AAE3D,SACE;;;;;;;eAMkBD,OAAOK,OAAO;EAAMD,IAAAA;AAE1C;AAEA,IAAIE,gBAAgB;AAEb,IAAMC,cAAc,CAACP,WAA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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
|
+
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/client/context.ts"],
|
|
4
4
|
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Context, createContext } from 'react';\n\nimport { type Client, type SystemStatus } from '@dxos/client';\n\nexport type ClientContextProps = {\n client: Client;\n status?: SystemStatus | null;\n};\n\n/**\n * @internal Use ClientProvider to create or initialize the Client.\n */\nexport const ClientContext: Context<ClientContextProps | undefined> = createContext<ClientContextProps | undefined>(\n undefined,\n);\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAAuBA,qBAAqB;AAYrC,IAAMC,
|
|
6
|
-
"names": ["createContext", "ClientContext", "
|
|
5
|
+
"mappings": ";;;AAIA,SAAuBA,qBAAqB;AAYrC,IAAMC,gBAAyDD,cACpEE,MAAAA;",
|
|
6
|
+
"names": ["createContext", "ClientContext", "undefined"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
useClient
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-CUDKNAMV.mjs";
|
|
5
|
+
import "../chunk-WUTK2IJF.mjs";
|
|
6
6
|
|
|
7
7
|
// src/devtools/index.ts
|
|
8
8
|
export * from "@dxos/client/devtools";
|
|
@@ -24,12 +24,7 @@ var useStream = (streamFactory, defaultValue, deps = []) => {
|
|
|
24
24
|
const stream = streamFactory();
|
|
25
25
|
stream.subscribe((response) => setValue(response), (err) => {
|
|
26
26
|
if (err) {
|
|
27
|
-
log.catch(err, void 0, {
|
|
28
|
-
F: __dxlog_file,
|
|
29
|
-
L: 21,
|
|
30
|
-
S: void 0,
|
|
31
|
-
C: (f, a) => f(...a)
|
|
32
|
-
});
|
|
27
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 14, S: void 0 });
|
|
33
28
|
}
|
|
34
29
|
});
|
|
35
30
|
return () => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/devtools/index.ts", "../../../../src/devtools/useDevtools.ts", "../../../../src/devtools/useStream.ts"],
|
|
4
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
|
|
6
|
-
"names": ["raise", "useDevtools", "client", "useClient", "services", "DevtoolsHost", "raise", "Error", "useEffect", "useState", "log", "
|
|
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
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
useInvitationStatus
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RQJPEHDY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useClient
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-CUDKNAMV.mjs";
|
|
8
|
+
import "../chunk-WUTK2IJF.mjs";
|
|
9
9
|
|
|
10
10
|
// src/echo/index.ts
|
|
11
11
|
export * from "@dxos/client/echo";
|
|
@@ -18,35 +18,21 @@ import { HaloSpaceMember } from "@dxos/client/echo";
|
|
|
18
18
|
import { useMulticastObservable as useMulticastObservable2 } from "@dxos/react-hooks";
|
|
19
19
|
|
|
20
20
|
// src/echo/useSpaces.ts
|
|
21
|
-
import { useState } from "react";
|
|
22
21
|
import { PublicKey } from "@dxos/client";
|
|
23
22
|
import { SpaceState } from "@dxos/client/echo";
|
|
24
|
-
import {
|
|
23
|
+
import { useMulticastObservable } from "@dxos/react-hooks";
|
|
25
24
|
var useSpace = (spaceId) => {
|
|
26
25
|
const client = useClient();
|
|
27
26
|
const spaces = useMulticastObservable(client.spaces);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (spaceId) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
await client.spaces.waitUntilReady();
|
|
34
|
-
setReady(true);
|
|
35
|
-
}, [
|
|
36
|
-
client,
|
|
37
|
-
spaceId
|
|
38
|
-
]);
|
|
39
|
-
if (spaceId) {
|
|
40
|
-
return spaces.find((space) => {
|
|
41
|
-
if (spaceId instanceof PublicKey) {
|
|
42
|
-
return space.key.equals(spaceId);
|
|
43
|
-
}
|
|
44
|
-
return space.id === spaceId;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
if (ready && client.halo.identity.get()) {
|
|
48
|
-
return client.spaces.default;
|
|
27
|
+
if (!spaceId) {
|
|
28
|
+
return void 0;
|
|
49
29
|
}
|
|
30
|
+
return spaces.find((space) => {
|
|
31
|
+
if (spaceId instanceof PublicKey) {
|
|
32
|
+
return space.key.equals(spaceId);
|
|
33
|
+
}
|
|
34
|
+
return space.id === spaceId;
|
|
35
|
+
});
|
|
50
36
|
};
|
|
51
37
|
var useDatabase = (spaceId) => {
|
|
52
38
|
const space = useSpace(spaceId);
|
|
@@ -68,57 +54,8 @@ var useMembers = (spaceKey) => {
|
|
|
68
54
|
return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);
|
|
69
55
|
};
|
|
70
56
|
|
|
71
|
-
// src/echo/useQueue.ts
|
|
72
|
-
import { useEffect, useMemo, useRef } from "react";
|
|
73
|
-
import { raise } from "@dxos/debug";
|
|
74
|
-
var MIN_POLL_INTERVAL = 1e3;
|
|
75
|
-
var useQueue = (queueDxn, options = {}) => {
|
|
76
|
-
const client = useClient();
|
|
77
|
-
const mountedRef = useRef(true);
|
|
78
|
-
const queue = useMemo(() => {
|
|
79
|
-
if (!queueDxn) {
|
|
80
|
-
return void 0;
|
|
81
|
-
}
|
|
82
|
-
const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError("Invalid queue DXN"));
|
|
83
|
-
return client.spaces.get(spaceId)?.queues.get(queueDxn);
|
|
84
|
-
}, [
|
|
85
|
-
client,
|
|
86
|
-
queueDxn?.toString()
|
|
87
|
-
]);
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
void queue?.refresh();
|
|
90
|
-
}, [
|
|
91
|
-
queue
|
|
92
|
-
]);
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
let timeout;
|
|
95
|
-
mountedRef.current = true;
|
|
96
|
-
const poll = () => {
|
|
97
|
-
if (!mountedRef.current) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
void queue?.refresh().finally(() => {
|
|
101
|
-
if (mountedRef.current && options.pollInterval) {
|
|
102
|
-
timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
if (options.pollInterval) {
|
|
107
|
-
poll();
|
|
108
|
-
}
|
|
109
|
-
return () => {
|
|
110
|
-
mountedRef.current = false;
|
|
111
|
-
clearTimeout(timeout);
|
|
112
|
-
};
|
|
113
|
-
}, [
|
|
114
|
-
queue,
|
|
115
|
-
options.pollInterval
|
|
116
|
-
]);
|
|
117
|
-
return queue;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
57
|
// src/echo/useSpaceInvitations.ts
|
|
121
|
-
import { useMemo
|
|
58
|
+
import { useMemo } from "react";
|
|
122
59
|
import { MulticastObservable as MulticastObservable2 } from "@dxos/async";
|
|
123
60
|
import { useMulticastObservable as useMulticastObservable3 } from "@dxos/react-hooks";
|
|
124
61
|
var useSpaceInvitations = (spaceId) => {
|
|
@@ -127,7 +64,7 @@ var useSpaceInvitations = (spaceId) => {
|
|
|
127
64
|
};
|
|
128
65
|
var useSpaceInvitation = (spaceId, invitationId) => {
|
|
129
66
|
const invitations = useSpaceInvitations(spaceId);
|
|
130
|
-
const invitation =
|
|
67
|
+
const invitation = useMemo(() => invitations.find((invitation2) => invitation2.get().invitationId === invitationId), [
|
|
131
68
|
invitations
|
|
132
69
|
]);
|
|
133
70
|
return useInvitationStatus(invitation);
|
|
@@ -146,13 +83,13 @@ var useSpaceProperties = (spaceId) => {
|
|
|
146
83
|
};
|
|
147
84
|
|
|
148
85
|
// src/echo/useSubscription.ts
|
|
149
|
-
import { useEffect
|
|
86
|
+
import { useEffect, useRef } from "react";
|
|
150
87
|
import { createSubscription } from "@dxos/client/echo";
|
|
151
88
|
var useSubscription = (cb, selection) => {
|
|
152
|
-
const callbackRef =
|
|
89
|
+
const callbackRef = useRef(cb);
|
|
153
90
|
callbackRef.current = cb;
|
|
154
|
-
const subscriptionRef =
|
|
155
|
-
|
|
91
|
+
const subscriptionRef = useRef(null);
|
|
92
|
+
useEffect(() => {
|
|
156
93
|
subscriptionRef.current = createSubscription(() => {
|
|
157
94
|
callbackRef.current();
|
|
158
95
|
});
|
|
@@ -163,19 +100,15 @@ var useSubscription = (cb, selection) => {
|
|
|
163
100
|
};
|
|
164
101
|
|
|
165
102
|
// src/echo/useSyncState.ts
|
|
166
|
-
import { useEffect as
|
|
103
|
+
import { useEffect as useEffect2, useState } from "react";
|
|
167
104
|
import { Context } from "@dxos/context";
|
|
168
|
-
import {
|
|
105
|
+
import { isEdgePeerId } from "@dxos/echo-protocol";
|
|
169
106
|
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/echo/useSyncState.ts";
|
|
170
|
-
var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
|
|
171
107
|
var useSyncState = () => {
|
|
172
108
|
const client = useClient();
|
|
173
|
-
const [spaceState, setSpaceState] =
|
|
174
|
-
|
|
175
|
-
const ctx = new Context(void 0, {
|
|
176
|
-
F: __dxlog_file,
|
|
177
|
-
L: 25
|
|
178
|
-
});
|
|
109
|
+
const [spaceState, setSpaceState] = useState({});
|
|
110
|
+
useEffect2(() => {
|
|
111
|
+
const ctx = new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 14 });
|
|
179
112
|
const createSubscriptions = (spaces) => {
|
|
180
113
|
for (const space of spaces) {
|
|
181
114
|
if (spaceState[space.id]) {
|
|
@@ -205,12 +138,9 @@ var useSyncState = () => {
|
|
|
205
138
|
return spaceState;
|
|
206
139
|
};
|
|
207
140
|
var useSpaceSyncState = (space) => {
|
|
208
|
-
const [spaceState, setSpaceState] =
|
|
209
|
-
|
|
210
|
-
const ctx = new Context(void 0, {
|
|
211
|
-
F: __dxlog_file,
|
|
212
|
-
L: 64
|
|
213
|
-
});
|
|
141
|
+
const [spaceState, setSpaceState] = useState();
|
|
142
|
+
useEffect2(() => {
|
|
143
|
+
const ctx = new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 49 });
|
|
214
144
|
space.internal.db.subscribeToSyncState(ctx, ({ peers = [] }) => {
|
|
215
145
|
const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
|
|
216
146
|
if (syncState) {
|
|
@@ -225,10 +155,72 @@ var useSpaceSyncState = (space) => {
|
|
|
225
155
|
]);
|
|
226
156
|
return spaceState;
|
|
227
157
|
};
|
|
158
|
+
|
|
159
|
+
// src/echo/useFeedSyncState.ts
|
|
160
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
161
|
+
var DEFAULT_POLL_INTERVAL_MS = 5e3;
|
|
162
|
+
var useFeedSyncState = (pollIntervalMs = DEFAULT_POLL_INTERVAL_MS) => {
|
|
163
|
+
const client = useClient();
|
|
164
|
+
const [feedSyncState, setFeedSyncState] = useState2({});
|
|
165
|
+
useEffect3(() => {
|
|
166
|
+
const queueService = client.services.services.QueueService;
|
|
167
|
+
if (!queueService) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let cancelled = false;
|
|
171
|
+
const poll = async () => {
|
|
172
|
+
const spaces = client.spaces.get();
|
|
173
|
+
const entries = await Promise.all(spaces.map(async (space) => {
|
|
174
|
+
try {
|
|
175
|
+
const response = await queueService.getSyncState({
|
|
176
|
+
spaceId: space.id
|
|
177
|
+
});
|
|
178
|
+
const state = (response.namespaces ?? []).reduce((acc, entry) => {
|
|
179
|
+
acc.pending += Number(entry.blocksToPull ?? 0) + Number(entry.blocksToPush ?? 0);
|
|
180
|
+
acc.total += Number(entry.totalBlocks ?? 0);
|
|
181
|
+
return acc;
|
|
182
|
+
}, {
|
|
183
|
+
pending: 0,
|
|
184
|
+
total: 0
|
|
185
|
+
});
|
|
186
|
+
return [
|
|
187
|
+
space.id,
|
|
188
|
+
state
|
|
189
|
+
];
|
|
190
|
+
} catch {
|
|
191
|
+
return [
|
|
192
|
+
space.id,
|
|
193
|
+
{
|
|
194
|
+
pending: 0,
|
|
195
|
+
total: 0
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
if (!cancelled) {
|
|
201
|
+
setFeedSyncState(Object.fromEntries(entries));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
void poll();
|
|
205
|
+
const interval = setInterval(() => void poll(), pollIntervalMs);
|
|
206
|
+
const spacesSubscription = client.spaces.subscribe(() => {
|
|
207
|
+
void poll();
|
|
208
|
+
});
|
|
209
|
+
return () => {
|
|
210
|
+
cancelled = true;
|
|
211
|
+
clearInterval(interval);
|
|
212
|
+
spacesSubscription.unsubscribe();
|
|
213
|
+
};
|
|
214
|
+
}, [
|
|
215
|
+
client,
|
|
216
|
+
pollIntervalMs
|
|
217
|
+
]);
|
|
218
|
+
return feedSyncState;
|
|
219
|
+
};
|
|
228
220
|
export {
|
|
229
221
|
useDatabase,
|
|
222
|
+
useFeedSyncState,
|
|
230
223
|
useMembers,
|
|
231
|
-
useQueue,
|
|
232
224
|
useSpace,
|
|
233
225
|
useSpaceInvitation,
|
|
234
226
|
useSpaceInvitations,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/
|
|
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", "
|
|
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"],
|
|
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';\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"],
|
|
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,UAA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OF,MAAMM,eAAe,CAAA;AACzC,mBAAOP;UACT,GACA;YAAEE,SAAS;YAAGI,OAAO;UAAE,CAAA;AAEzB,iBAAO;YAACd,MAAMI;YAAIC;;QACpB,QAAQ;AACN,iBAAO;YAACL,MAAMI;YAAI;cAAEM,SAAS;cAAGI,OAAO;YAAE;;QAC3C;MACF,CAAA,CAAA;AAGF,UAAI,CAACtB,WAAW;AACdN,yBAAiB8B,OAAOC,YAAYrB,OAAAA,CAAAA;MACtC;IACF;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;",
|
|
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"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
useInvitationStatus
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RQJPEHDY.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useClient
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-CUDKNAMV.mjs";
|
|
8
|
+
import "../chunk-WUTK2IJF.mjs";
|
|
9
9
|
|
|
10
10
|
// src/halo/index.ts
|
|
11
11
|
import { Device, DeviceKind, DeviceType } from "@dxos/client/halo";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
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
4
|
"sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n type Credential,\n type Contact,\n type Identity,\n type Halo,\n Device,\n DeviceKind,\n DeviceType,\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,SAKEA,QACAC,YACAC,kBACK;;;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;A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Kind", "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", "
|
|
5
|
+
"mappings": ";;;;;;;;;;AAKA,SAKEA,QACAC,YACAC,kBACK;;;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,QAAMC,SAASC,UAAAA;AACf,SAAOC,wBAAuBF,OAAOG,KAAKC,OAAO;AACnD;;;ACRA,SAASC,eAAe;AAExB,SAASC,0BAAAA,+BAA8B;AAKhC,IAAMC,qBAAqB,MAAA;AAChC,QAAMC,SAASC,UAAAA;AACf,SAAOC,wBAAuBF,OAAOG,KAAKC,WAAW;AACvD;AAEO,IAAMC,oBAAoB,CAACC,iBAAAA;AAChC,QAAMF,cAAcL,mBAAAA;AACpB,QAAMQ,aAAaC,QACjB,MAAMJ,YAAYK,KAAK,CAACF,gBAAeA,YAAWG,IAAG,EAAGJ,iBAAiBA,YAAAA,GACzE;IAACF;GAAY;AAEf,SAAOO,oBAAoBJ,UAAAA;AAC7B;;;AClBA,SAASK,0BAAAA,+BAA8B;AAQhC,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,SAAOC,wBAAuBF,OAAOG,KAAKC,QAAQ;AACpD;;;ACZA,SAASC,WAAAA,UAASC,kBAAkB;AAG7B,IAAMC,WAAN,MAAMA;;EACHC,UAAU,oBAAIC,IAAAA;EAEtB,YAA6BC,eAAyB,CAAA,GAAI;SAA7BA,eAAAA;EAA8B;EAE3D,IAAIC,MAAM;AACR,WAAO,KAAKH;EACd;;EAGAI,aAAmB;AACjB,SAAKF,aAAaG,QAAQ,CAACC,QAAAA;AACzB,YAAMC,QAAQC,aAAaC,QAAQH,GAAAA;AACnC,WAAKI,OAAOJ,KAAKC,SAAS,EAAA;IAC5B,CAAA;AAEA,WAAO;EACT;EAEAI,OAAOL,KAAmB;AACxBE,iBAAaC,QAAQH,GAAAA;EACvB;EAEAI,OAAOJ,KAAaC,OAAqB;AACvCC,iBAAaI,QAAQN,KAAK,EAAA;AAC1B,SAAKN,QAAQa,IAAIP,KAAKC,KAAAA;EACxB;AACF;AAMO,IAAMO,cAAc,CACzBC,cAAwB,CAAA,MAAE;AAE1B,QAAM,CAAA,EAAGC,WAAAA,IAAelB,WAAW,CAACmB,MAAMA,IAAI,GAAG,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
7
|
}
|