@dxos/react-client 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8
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 +9 -0
- package/.storybook/preview.mts +8 -0
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/chunk-3LVU7RNK.mjs +16 -0
- package/dist/lib/browser/chunk-3LVU7RNK.mjs.map +7 -0
- package/dist/lib/browser/chunk-CZMIVAGI.mjs +8 -0
- package/dist/lib/browser/chunk-CZMIVAGI.mjs.map +7 -0
- package/dist/lib/browser/chunk-XT352YI6.mjs +134 -0
- package/dist/lib/browser/chunk-XT352YI6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BXOLJYAY.mjs → chunk-YHE6WD44.mjs} +4 -14
- package/dist/lib/browser/chunk-YHE6WD44.mjs.map +7 -0
- package/dist/lib/browser/devtools/index.mjs +3 -7
- package/dist/lib/browser/devtools/index.mjs.map +2 -2
- package/dist/lib/browser/echo/index.mjs +124 -175
- package/dist/lib/browser/echo/index.mjs.map +4 -4
- package/dist/lib/browser/halo/index.mjs +4 -4
- package/dist/lib/browser/halo/index.mjs.map +2 -2
- package/dist/lib/browser/index.mjs +99 -12
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/invitations/index.mjs +1 -1
- package/dist/lib/browser/mesh/index.mjs +2 -1
- package/dist/lib/browser/mesh/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +111 -154
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-CUDKNAMV.mjs +17 -0
- package/dist/lib/node-esm/chunk-CUDKNAMV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-256IHY6F.mjs → chunk-RQJPEHDY.mjs} +4 -14
- package/dist/lib/node-esm/chunk-RQJPEHDY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs +135 -0
- package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WUTK2IJF.mjs +10 -0
- package/dist/lib/node-esm/chunk-WUTK2IJF.mjs.map +7 -0
- package/dist/lib/node-esm/devtools/index.mjs +3 -7
- package/dist/lib/node-esm/devtools/index.mjs.map +2 -2
- package/dist/lib/node-esm/echo/index.mjs +124 -175
- package/dist/lib/node-esm/echo/index.mjs.map +4 -4
- package/dist/lib/node-esm/halo/index.mjs +4 -4
- package/dist/lib/node-esm/halo/index.mjs.map +2 -2
- package/dist/lib/node-esm/index.mjs +99 -12
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/invitations/index.mjs +1 -1
- package/dist/lib/node-esm/mesh/index.mjs +2 -1
- package/dist/lib/node-esm/mesh/index.mjs.map +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +111 -154
- 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 -11
- 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 +4 -3
- 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 +2 -2
- package/dist/types/src/echo/useMembers.d.ts.map +1 -1
- package/dist/types/src/echo/useRegistry.d.ts +6 -0
- package/dist/types/src/echo/useRegistry.d.ts.map +1 -0
- package/dist/types/src/echo/useSpaceInvitations.d.ts +3 -2
- package/dist/types/src/echo/useSpaceInvitations.d.ts.map +1 -1
- package/dist/types/src/echo/useSpaceProperties.d.ts +13 -0
- package/dist/types/src/echo/useSpaceProperties.d.ts.map +1 -0
- package/dist/types/src/echo/useSpaces.d.ts +19 -8
- package/dist/types/src/echo/useSpaces.d.ts.map +1 -1
- package/dist/types/src/echo/useSubscription.d.ts +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 +5 -5
- 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 +1 -1
- package/dist/types/src/invitations/useInvitationStatus.d.ts.map +1 -1
- package/dist/types/src/testing/ClientRepeater.d.ts +6 -5
- package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
- package/dist/types/src/testing/ClientRepeater.stories.d.ts +6 -10
- package/dist/types/src/testing/ClientRepeater.stories.d.ts.map +1 -1
- package/dist/types/src/testing/context.d.ts +4 -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 +5 -9
- package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
- package/dist/types/src/testing/withClientProvider.stories.d.ts +8 -9
- 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 +3 -2
- package/package.json +37 -59
- package/src/client/ClientProvider.test.tsx +0 -1
- package/src/client/ClientProvider.tsx +29 -48
- package/src/client/useConfig.test.tsx +0 -1
- package/src/echo/index.ts +4 -3
- package/src/echo/useFeedSyncState.ts +78 -0
- package/src/echo/useMembers.ts +5 -3
- package/src/echo/useRegistry.ts +15 -0
- package/src/echo/useSpaceInvitations.ts +9 -5
- package/src/echo/useSpaceProperties.ts +28 -0
- package/src/echo/useSpaces.test.tsx +7 -14
- package/src/echo/useSpaces.ts +32 -29
- package/src/echo/useSubscription.ts +1 -1
- package/src/echo/useSyncState.ts +3 -7
- package/src/halo/Passkey.stories.tsx +17 -18
- package/src/halo/useDevices.test.tsx +0 -1
- package/src/invitations/useInvitationStatus.ts +9 -8
- package/src/testing/ClientRepeater.stories.tsx +21 -16
- package/src/testing/ClientRepeater.tsx +31 -40
- package/src/testing/context.tsx +4 -2
- package/src/testing/util.tsx +0 -1
- package/src/testing/withClientProvider.stories.tsx +33 -20
- package/src/testing/withClientProvider.tsx +74 -91
- package/tsconfig.json +7 -7
- package/typedoc.json +1 -1
- package/vitest.config.ts +10 -16
- package/.swc/plugins/v7_linux_x86_64_13.0.0/c614d7475354583212fbd7669acbae95b9832c305bf51bdaabe2e6de05abb6bf +0 -0
- package/dist/lib/browser/chunk-BXOLJYAY.mjs.map +0 -7
- package/dist/lib/browser/chunk-FQAPI3I4.mjs +0 -312
- package/dist/lib/browser/chunk-FQAPI3I4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-256IHY6F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MNTJNI2M.mjs +0 -314
- package/dist/lib/node-esm/chunk-MNTJNI2M.mjs.map +0 -7
- package/dist/types/src/echo/useQuery.d.ts +0 -11
- package/dist/types/src/echo/useQuery.d.ts.map +0 -1
- package/dist/types/src/echo/useQuery.test.d.ts +0 -2
- package/dist/types/src/echo/useQuery.test.d.ts.map +0 -1
- package/dist/types/src/echo/useQueue.d.ts +0 -11
- package/dist/types/src/echo/useQueue.d.ts.map +0 -1
- package/dist/types/src/echo/useSchema.d.ts +0 -8
- package/dist/types/src/echo/useSchema.d.ts.map +0 -1
- 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/echo/useQuery.test.tsx +0 -129
- package/src/echo/useQuery.ts +0 -56
- package/src/echo/useQueue.ts +0 -74
- package/src/echo/useSchema.ts +0 -54
- package/src/playwright/playwright.config.ts +0 -17
- package/src/playwright/smoke.spec.ts +0 -24
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ClientProvider
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WL3Z5HOH.mjs";
|
|
5
|
+
import "../chunk-WUTK2IJF.mjs";
|
|
5
6
|
|
|
6
7
|
// src/testing/index.ts
|
|
7
8
|
export * from "@dxos/client/testing";
|
|
@@ -10,54 +11,48 @@ export * from "@dxos/client/testing";
|
|
|
10
11
|
import { createContext, useContext } from "react";
|
|
11
12
|
import { raise } from "@dxos/debug";
|
|
12
13
|
var ClientStory = /* @__PURE__ */ createContext(void 0);
|
|
13
|
-
var
|
|
14
|
+
var useClientStory = () => {
|
|
14
15
|
return useContext(ClientStory) ?? raise(new Error("Missing ClientStory"));
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
// src/testing/ClientRepeater.tsx
|
|
18
|
-
import React, {
|
|
19
|
+
import React, { useRef, useState } from "react";
|
|
19
20
|
import { Client } from "@dxos/client";
|
|
20
21
|
import { TestBuilder, performInvitation } from "@dxos/client/testing";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
22
|
+
import { random } from "@dxos/random";
|
|
23
|
+
import { useAsyncEffect } from "@dxos/react-hooks";
|
|
23
24
|
var ClientRepeater = (props) => {
|
|
24
|
-
const { component: Component, controls: Controls, count = 1, types, createIdentity, createSpace,
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
registerSignalsRuntime();
|
|
27
|
-
}, []);
|
|
25
|
+
const { component: Component, controls: Controls, count = 1, types, createIdentity, createSpace, onCreateSpace } = props;
|
|
28
26
|
const [clients, setClients] = useState(props.clients ?? []);
|
|
29
|
-
const [
|
|
27
|
+
const [spaceId, setSpaceId] = useState();
|
|
30
28
|
const testBuilder = useRef(new TestBuilder());
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
setClients(clients2);
|
|
59
|
-
});
|
|
60
|
-
return () => clearTimeout(timeout);
|
|
29
|
+
useAsyncEffect(async () => {
|
|
30
|
+
const clients2 = [
|
|
31
|
+
...Array(count)
|
|
32
|
+
].map((_) => new Client({
|
|
33
|
+
services: testBuilder.current.createLocalClientServices(),
|
|
34
|
+
types
|
|
35
|
+
}));
|
|
36
|
+
await Promise.all(clients2.map((client) => client.initialize()));
|
|
37
|
+
if (createIdentity || createSpace) {
|
|
38
|
+
await Promise.all(clients2.map((client) => client.halo.createIdentity()));
|
|
39
|
+
}
|
|
40
|
+
if (createSpace) {
|
|
41
|
+
const client = clients2[0];
|
|
42
|
+
const space = await client.spaces.create({
|
|
43
|
+
name: random.commerce.productName()
|
|
44
|
+
});
|
|
45
|
+
setSpaceId(space.id);
|
|
46
|
+
await onCreateSpace?.({
|
|
47
|
+
client,
|
|
48
|
+
space
|
|
49
|
+
}, {});
|
|
50
|
+
await Promise.all(clients2.slice(1).flatMap((client2) => performInvitation({
|
|
51
|
+
host: space,
|
|
52
|
+
guest: client2.spaces
|
|
53
|
+
})));
|
|
54
|
+
}
|
|
55
|
+
setClients(clients2);
|
|
61
56
|
}, []);
|
|
62
57
|
if (clients.length === 0) {
|
|
63
58
|
return null;
|
|
@@ -70,26 +65,26 @@ var ClientRepeater = (props) => {
|
|
|
70
65
|
}, /* @__PURE__ */ React.createElement(Component, {
|
|
71
66
|
id: index,
|
|
72
67
|
count: clients.length,
|
|
73
|
-
|
|
68
|
+
spaceId,
|
|
74
69
|
...props.args
|
|
75
70
|
}))));
|
|
76
71
|
};
|
|
77
72
|
|
|
78
73
|
// src/testing/withClientProvider.tsx
|
|
79
|
-
import React2, {
|
|
80
|
-
import { ErrorBoundary as NativeErrorBoundary } from "react-error-boundary";
|
|
74
|
+
import React2, { useCallback, useMemo, useRef as useRef2, useState as useState2 } from "react";
|
|
81
75
|
import { Trigger } from "@dxos/async";
|
|
82
76
|
import { TestBuilder as TestBuilder2, performInvitation as performInvitation2 } from "@dxos/client/testing";
|
|
83
77
|
import { log } from "@dxos/log";
|
|
78
|
+
import { ErrorBoundary } from "@dxos/react-ui";
|
|
84
79
|
var __dxlog_file = "/__w/dxos/dxos/packages/sdk/react-client/src/testing/withClientProvider.tsx";
|
|
85
|
-
var initializeClient = async (client, { createIdentity, createSpace,
|
|
80
|
+
var initializeClient = async (client, { createIdentity, createSpace, onCreateIdentity, onCreateSpace, onInitialized }, context) => {
|
|
86
81
|
await onInitialized?.(client);
|
|
87
82
|
if (createIdentity || createSpace) {
|
|
88
83
|
if (!client.halo.identity.get()) {
|
|
89
84
|
await client.halo.createIdentity();
|
|
90
|
-
await
|
|
85
|
+
await onCreateIdentity?.({
|
|
91
86
|
client
|
|
92
|
-
});
|
|
87
|
+
}, context);
|
|
93
88
|
}
|
|
94
89
|
}
|
|
95
90
|
let space;
|
|
@@ -97,29 +92,33 @@ var initializeClient = async (client, { createIdentity, createSpace, onSpaceCrea
|
|
|
97
92
|
space = await client.spaces.create({
|
|
98
93
|
name: "Test Space"
|
|
99
94
|
});
|
|
100
|
-
await
|
|
95
|
+
await space.waitUntilReady();
|
|
96
|
+
await onCreateSpace?.({
|
|
101
97
|
client,
|
|
102
98
|
space
|
|
103
99
|
}, context);
|
|
104
100
|
}
|
|
105
101
|
return {
|
|
106
|
-
space
|
|
102
|
+
space,
|
|
103
|
+
spaceId: space?.id
|
|
107
104
|
};
|
|
108
105
|
};
|
|
109
|
-
var withClientProvider = ({ createIdentity, createSpace,
|
|
106
|
+
var withClientProvider = ({ createIdentity, createSpace, onCreateSpace, onCreateIdentity, onInitialized, ...props } = {}) => {
|
|
110
107
|
return (Story, context) => {
|
|
111
108
|
const [data, setData] = useState2({});
|
|
112
109
|
const handleInitialized = async (client) => {
|
|
113
110
|
const data2 = await initializeClient(client, {
|
|
114
111
|
createIdentity,
|
|
115
112
|
createSpace,
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
onCreateSpace,
|
|
114
|
+
onCreateIdentity,
|
|
118
115
|
onInitialized
|
|
119
116
|
}, context);
|
|
120
117
|
setData(data2);
|
|
121
118
|
};
|
|
122
|
-
return /* @__PURE__ */ React2.createElement(ErrorBoundary,
|
|
119
|
+
return /* @__PURE__ */ React2.createElement(ErrorBoundary, {
|
|
120
|
+
name: "client-provider"
|
|
121
|
+
}, /* @__PURE__ */ React2.createElement(ClientProvider, {
|
|
123
122
|
onInitialized: handleInitialized,
|
|
124
123
|
...props
|
|
125
124
|
}, /* @__PURE__ */ React2.createElement(ClientStory.Provider, {
|
|
@@ -127,121 +126,79 @@ var withClientProvider = ({ createIdentity, createSpace, onSpaceCreated, onIdent
|
|
|
127
126
|
}, /* @__PURE__ */ React2.createElement(Story, null))));
|
|
128
127
|
};
|
|
129
128
|
};
|
|
130
|
-
var
|
|
131
|
-
id: 0
|
|
132
|
-
});
|
|
133
|
-
var useMultiClient = () => useContext2(MultiClientContext);
|
|
134
|
-
var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized, ...props }) => {
|
|
129
|
+
var withMultiClientProvider = ({ numClients = 2, createIdentity, createSpace, onCreateSpace, onCreateIdentity, onInitialized, ...props }) => {
|
|
135
130
|
return (Story, context) => {
|
|
136
|
-
const builder = useRef2(new TestBuilder2());
|
|
137
|
-
const hostRef = useRef2();
|
|
138
131
|
const spaceReady = useRef2(new Trigger());
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
132
|
+
const [spaceId, setSpaceId] = useState2();
|
|
133
|
+
const clients = useMemo(() => {
|
|
134
|
+
const buidler = new TestBuilder2();
|
|
135
|
+
return Array.from({
|
|
136
|
+
length: numClients
|
|
137
|
+
}).map(() => {
|
|
138
|
+
return {
|
|
139
|
+
services: buidler.createLocalClientServices()
|
|
140
|
+
};
|
|
147
141
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
guest: client.spaces
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
142
|
+
}, [
|
|
143
|
+
numClients
|
|
144
|
+
]);
|
|
145
|
+
const handleInitialized = useCallback(async (client, index) => {
|
|
146
|
+
if (index === 0) {
|
|
147
|
+
const { space } = await initializeClient(client, {
|
|
148
|
+
createIdentity,
|
|
149
|
+
createSpace,
|
|
150
|
+
onCreateSpace,
|
|
151
|
+
onCreateIdentity,
|
|
152
|
+
onInitialized
|
|
153
|
+
}, context);
|
|
154
|
+
log.info("inviting", {
|
|
155
|
+
index,
|
|
156
|
+
spaceId: space?.id
|
|
157
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 95, S: void 0 });
|
|
158
|
+
setSpaceId(space?.id);
|
|
159
|
+
spaceReady.current.wake(space);
|
|
160
|
+
} else {
|
|
161
|
+
await initializeClient(client, {
|
|
162
|
+
createIdentity,
|
|
163
|
+
onInitialized
|
|
164
|
+
}, context);
|
|
165
|
+
log.info("waiting", {
|
|
166
|
+
index
|
|
167
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 107, S: void 0 });
|
|
168
|
+
const space = await spaceReady.current.wait();
|
|
169
|
+
if (space) {
|
|
170
|
+
log.info("joining", {
|
|
171
|
+
index,
|
|
172
|
+
spaceId: space.id
|
|
173
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 112, S: void 0 });
|
|
174
|
+
await Promise.all(performInvitation2({
|
|
175
|
+
host: space,
|
|
176
|
+
guest: client.spaces
|
|
177
|
+
}));
|
|
187
178
|
}
|
|
188
179
|
}
|
|
189
|
-
};
|
|
190
|
-
return /* @__PURE__ */ React2.createElement(
|
|
191
|
-
|
|
192
|
-
}
|
|
180
|
+
}, []);
|
|
181
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
182
|
+
className: "absolute inset-0 grid grid-flow-col auto-cols-fr gap-4 overflow-hidden"
|
|
183
|
+
}, clients.map((client, index) => /* @__PURE__ */ React2.createElement(ClientProvider, {
|
|
193
184
|
key: index,
|
|
185
|
+
services: client.services,
|
|
186
|
+
onInitialized: (client2) => handleInitialized(client2, index),
|
|
187
|
+
...props
|
|
188
|
+
}, /* @__PURE__ */ React2.createElement(ClientStory.Provider, {
|
|
194
189
|
value: {
|
|
195
|
-
|
|
190
|
+
index,
|
|
191
|
+
spaceId
|
|
196
192
|
}
|
|
197
|
-
}, /* @__PURE__ */ React2.createElement(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
...props
|
|
201
|
-
}, /* @__PURE__ */ React2.createElement(Story, null)))));
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
var ErrorBoundary = ({ children }) => {
|
|
205
|
-
const [error, setError] = useState2();
|
|
206
|
-
useEffect2(() => {
|
|
207
|
-
const handleError = (event) => {
|
|
208
|
-
setError(event.reason);
|
|
209
|
-
};
|
|
210
|
-
window.addEventListener("unhandledrejection", handleError);
|
|
211
|
-
return () => window.removeEventListener("unhandledrejection", handleError);
|
|
212
|
-
}, []);
|
|
213
|
-
if (error) {
|
|
214
|
-
return /* @__PURE__ */ React2.createElement(ErrorFallback, {
|
|
215
|
-
error,
|
|
216
|
-
resetErrorBoundary: () => setError(void 0)
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
return /* @__PURE__ */ React2.createElement(NativeErrorBoundary, {
|
|
220
|
-
FallbackComponent: ErrorFallback
|
|
221
|
-
}, children);
|
|
222
|
-
};
|
|
223
|
-
var ErrorFallback = ({ error }) => {
|
|
224
|
-
const { name, message, stack } = error instanceof Error ? error : {
|
|
225
|
-
name: "Error",
|
|
226
|
-
message: String(error),
|
|
227
|
-
stack: void 0
|
|
193
|
+
}, /* @__PURE__ */ React2.createElement(ErrorBoundary, {
|
|
194
|
+
name: "client-provider"
|
|
195
|
+
}, /* @__PURE__ */ React2.createElement(Story, null))))));
|
|
228
196
|
};
|
|
229
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
230
|
-
role: "alert",
|
|
231
|
-
className: "flex flex-col p-4 gap-4 overflow-auto"
|
|
232
|
-
}, /* @__PURE__ */ React2.createElement("h1", {
|
|
233
|
-
className: "text-xl text-red-500"
|
|
234
|
-
}, name), /* @__PURE__ */ React2.createElement("div", {
|
|
235
|
-
className: "text-lg"
|
|
236
|
-
}, message), stack && /* @__PURE__ */ React2.createElement("pre", {
|
|
237
|
-
className: "whitespace-pre-wrap text-sm text-subdued"
|
|
238
|
-
}, stack));
|
|
239
197
|
};
|
|
240
198
|
export {
|
|
241
199
|
ClientRepeater,
|
|
242
200
|
ClientStory,
|
|
243
|
-
|
|
244
|
-
useMultiClient,
|
|
201
|
+
useClientStory,
|
|
245
202
|
withClientProvider,
|
|
246
203
|
withMultiClientProvider
|
|
247
204
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/index.ts", "../../../../src/testing/context.tsx", "../../../../src/testing/ClientRepeater.tsx", "../../../../src/testing/withClientProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/testing';\n\nexport * from './context';\nexport * from './ClientRepeater';\nexport * from './withClientProvider';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type Space } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\n\nexport type ClientStory = {\n space?: Space;\n};\n\n// TODO(wittjosiah): Add to multi-client as well.\nexport const ClientStory = createContext<ClientStory | undefined>(undefined);\n\nexport const useClientProvider = (): ClientStory => {\n return useContext(ClientStory) ?? raise(new Error('Missing ClientStory'));\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { type FC, useEffect, useRef, useState } from 'react';\n\nimport { Client, type PublicKey } from '@dxos/client';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { type TypedObject } from '@dxos/echo-schema';\nimport { registerSignalsRuntime } from '@dxos/echo-signals/react';\nimport { faker } from '@dxos/random';\n\nimport { ClientProvider } from '../client';\n\nimport { type WithClientProviderProps } from './withClientProvider';\n\nexport type ClientRepeatedComponentProps = { id: number; count: number; spaceKey?: PublicKey };\n\nexport type ClientRepeaterControlsProps = { clients: Client[] };\n\n// TODO(burdon): Reconcile with ClientProviderProps.\nexport type ClientRepeaterProps<P extends ClientRepeatedComponentProps> = {\n className?: string;\n component: FC<ClientRepeatedComponentProps>;\n controls?: FC<ClientRepeaterControlsProps>;\n count?: number;\n clients?: Client[];\n types?: TypedObject[];\n args?: Omit<P, 'id' | 'count'>;\n} & Pick<WithClientProviderProps, 'createIdentity' | 'createSpace' | 'onSpaceCreated'>;\n\n/**\n * Utility component for Storybook stories which sets up clients for n peers.\n * The `Component` property is rendered n times, once for each peer.\n * @deprecated use `withClientProvider`.\n */\n// TODO(burdon): To discuss: evolve ClientRepeater with optional decorator that uses it.\n// NOTE: This is specifically not a storybook decorator because it broke stories as a decorator.\n// This seems primarily due to the fact that it required top-level await for the clients to initialize.\n// Storybook seemed to handle it alright, but Chromatic had a lot of trouble with it.\n// There was also a question of whether or not calling the story function multiple times was a good idea.\nexport const ClientRepeater = <P extends ClientRepeatedComponentProps>(props: ClientRepeaterProps<P>) => {\n const {\n component: Component,\n controls: Controls,\n count = 1,\n types,\n createIdentity,\n createSpace,\n onSpaceCreated,\n } = props;\n useEffect(() => {\n registerSignalsRuntime();\n }, []);\n\n const [clients, setClients] = useState(props.clients ?? []);\n const [spaceKey, setSpaceKey] = useState<PublicKey>();\n\n const testBuilder = useRef(new TestBuilder());\n useEffect(() => {\n const timeout = setTimeout(async () => {\n const clients = [...Array(count)].map(\n (_) => new Client({ services: testBuilder.current.createLocalClientServices(), types }),\n );\n\n await Promise.all(clients.map((client) => client.initialize()));\n if (createIdentity || createSpace) {\n await Promise.all(clients.map((client) => client.halo.createIdentity()));\n }\n\n if (createSpace) {\n const client = clients[0];\n const space = await client.spaces.create({ name: faker.commerce.productName() });\n setSpaceKey(space.key);\n await onSpaceCreated?.({ client, space }, {});\n await Promise.all(\n clients.slice(1).flatMap((client) => performInvitation({ host: space, guest: client.spaces })),\n );\n }\n\n setClients(clients);\n });\n\n return () => clearTimeout(timeout);\n }, []);\n\n if (clients.length === 0) {\n return null;\n }\n\n return (\n <>\n {Controls && <Controls clients={clients} />}\n {clients.map((client, index) => (\n <ClientProvider key={index} client={client}>\n <Component id={index} count={clients.length} spaceKey={spaceKey} {...{ ...props.args }} />\n </ClientProvider>\n ))}\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport React, { type PropsWithChildren, createContext, useContext, useEffect, useRef, useState } from 'react';\nimport { type FallbackProps, ErrorBoundary as NativeErrorBoundary } from 'react-error-boundary';\n\nimport { Trigger } from '@dxos/async';\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { log } from '@dxos/log';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientProvider, type ClientProviderProps } from '../client';\n\nimport { ClientStory } from './context';\n\ntype InitializeProps = {\n createIdentity?: boolean;\n createSpace?: boolean;\n onInitialized?: (client: Client) => MaybePromise<void>;\n onIdentityCreated?: (props: { client: Client }) => MaybePromise<void>;\n // NOTE: context must be untyped until ClientRepeater is removed.\n onSpaceCreated?: (props: { client: Client; space: Space }, context: StoryContext | any) => MaybePromise<void>;\n};\n\n/**\n * Initialize client, identity and first space.\n */\nconst initializeClient = async (\n client: Client,\n { createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized }: InitializeProps,\n context: StoryContext,\n): Promise<ClientStory> => {\n await onInitialized?.(client);\n\n if (createIdentity || createSpace) {\n if (!client.halo.identity.get()) {\n await client.halo.createIdentity();\n await onIdentityCreated?.({ client });\n }\n }\n\n let space: Space | undefined;\n if (createSpace) {\n space = await client.spaces.create({ name: 'Test Space' });\n await onSpaceCreated?.({ client, space }, context);\n }\n\n return { space };\n};\n\nexport type WithClientProviderProps = InitializeProps & Omit<ClientProviderProps, 'onInitialized'>;\n\n/**\n * Decorator that provides the client context.\n */\nexport const withClientProvider = ({\n createIdentity,\n createSpace,\n onSpaceCreated,\n onIdentityCreated,\n onInitialized,\n ...props\n}: WithClientProviderProps = {}): Decorator => {\n return (Story, context) => {\n const [data, setData] = useState<ClientStory>({});\n const handleInitialized = async (client: Client) => {\n const data = await initializeClient(\n client,\n {\n createIdentity,\n createSpace,\n onSpaceCreated,\n onIdentityCreated,\n onInitialized,\n },\n context,\n );\n\n setData(data);\n };\n\n return (\n <ErrorBoundary>\n <ClientProvider onInitialized={handleInitialized} {...props}>\n <ClientStory.Provider value={data}>\n <Story />\n </ClientStory.Provider>\n </ClientProvider>\n </ErrorBoundary>\n );\n };\n};\n\n// TODO(burdon): Implement context per client for context.\n// TODO(burdon): Callback once all invitations have completed.\n// TODO(burdon): Delay/jitter for creation of other clients.\nexport type WithMultiClientProviderProps = InitializeProps &\n Omit<ClientProviderProps, 'onInitialized'> & { numClients?: number };\n\nconst MultiClientContext = createContext<{ id: number }>({ id: 0 });\n\nexport const useMultiClient = () => useContext(MultiClientContext);\n\n/**\n * Decorator that creates a scaffold for multiple clients.\n * Orchestrates invitations between a randomly selected host and the remaining clients.\n * NOTE: Should come before withLayout.\n */\nexport const withMultiClientProvider = ({\n numClients = 2,\n createIdentity,\n createSpace,\n onSpaceCreated,\n onIdentityCreated,\n onInitialized,\n ...props\n}: WithMultiClientProviderProps): Decorator => {\n return (Story, context) => {\n const builder = useRef(new TestBuilder());\n const hostRef = useRef<Client>();\n const spaceReady = useRef(new Trigger<Space | undefined>());\n\n // Handle invitations.\n // NOTE: The zeroth client isn't necessarily the first to be initialized.\n const handleInitialized = async (client: Client, index: number) => {\n log.info('initialized', { index });\n if (createSpace) {\n if (!hostRef.current) {\n hostRef.current = client;\n const { space } = await initializeClient(\n client,\n {\n createIdentity,\n createSpace,\n onSpaceCreated,\n onIdentityCreated,\n onInitialized,\n },\n context,\n );\n\n spaceReady.current.wake(space);\n log.info('inviting', { index });\n } else {\n await initializeClient(client, { createIdentity, onInitialized }, context);\n const space = await spaceReady.current.wait();\n if (space) {\n log.info('joining', { index });\n await Promise.all(performInvitation({ host: space, guest: client.spaces }));\n }\n }\n }\n };\n\n return (\n <ErrorBoundary>\n {Array.from({ length: numClients }).map((_, index) => (\n <MultiClientContext.Provider key={index} value={{ id: index }}>\n <ClientProvider\n services={builder.current.createLocalClientServices()}\n onInitialized={(client) => handleInitialized(client, index)}\n {...props}\n >\n <Story />\n </ClientProvider>\n </MultiClientContext.Provider>\n ))}\n </ErrorBoundary>\n );\n };\n};\n\nconst ErrorBoundary = ({ children }: PropsWithChildren) => {\n const [error, setError] = useState<Error>();\n useEffect(() => {\n const handleError = (event: PromiseRejectionEvent) => {\n setError(event.reason);\n };\n\n window.addEventListener('unhandledrejection', handleError);\n return () => window.removeEventListener('unhandledrejection', handleError);\n }, []);\n\n if (error) {\n return <ErrorFallback error={error} resetErrorBoundary={() => setError(undefined)} />;\n }\n\n return <NativeErrorBoundary FallbackComponent={ErrorFallback}>{children}</NativeErrorBoundary>;\n};\n\nconst ErrorFallback = ({ error }: FallbackProps) => {\n const { name, message, stack } =\n error instanceof Error ? error : { name: 'Error', message: String(error), stack: undefined };\n return (\n <div role='alert' className='flex flex-col p-4 gap-4 overflow-auto'>\n <h1 className='text-xl text-red-500'>{name}</h1>\n <div className='text-lg'>{message}</div>\n {stack && <pre className='whitespace-pre-wrap text-sm text-subdued'>{stack}</pre>}\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["createContext", "useContext", "raise", "ClientStory", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/testing';\n\nexport * from './context';\nexport * from './ClientRepeater';\nexport * from './withClientProvider';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { createContext, useContext } from 'react';\n\nimport { type Space } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type SpaceId } from '@dxos/keys';\n\nexport type ClientStory = {\n index?: number;\n spaceId?: SpaceId;\n space?: Space;\n};\n\nexport const ClientStory = createContext<ClientStory | undefined>(undefined);\n\nexport const useClientStory = (): ClientStory => {\n return useContext(ClientStory) ?? raise(new Error('Missing ClientStory'));\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { type FC, useRef, useState } from 'react';\n\nimport { Client } from '@dxos/client';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { type Type } from '@dxos/echo';\nimport { type SpaceId } from '@dxos/keys';\nimport { random } from '@dxos/random';\nimport { useAsyncEffect } from '@dxos/react-hooks';\n\nimport { ClientProvider } from '../client';\nimport { type WithClientProviderProps } from './withClientProvider';\n\nexport type ClientRepeatedComponentProps = { id: number; count: number; spaceId?: SpaceId };\n\nexport type ClientRepeaterControlsProps = { clients: Client[] };\n\n// TODO(burdon): Reconcile with ClientProviderProps.\nexport type ClientRepeaterProps<P extends ClientRepeatedComponentProps> = {\n className?: string;\n component: FC<ClientRepeatedComponentProps>;\n controls?: FC<ClientRepeaterControlsProps>;\n count?: number;\n clients?: Client[];\n types?: Type.AnyObj[];\n args?: Omit<P, 'id' | 'count'>;\n} & Pick<WithClientProviderProps, 'createIdentity' | 'createSpace' | 'onCreateSpace'>;\n\n/**\n * Utility component for Storybook stories which sets up clients for n peers.\n * The `Component` property is rendered n times, once for each peer.\n * @deprecated use `withClientProvider`.\n */\n// TODO(burdon): To discuss: evolve ClientRepeater with optional decorator that uses it.\n// NOTE: This is specifically not a storybook decorator because it broke stories as a decorator.\n// This seems primarily due to the fact that it required top-level await for the clients to initialize.\n// Storybook seemed to handle it alright, but Chromatic had a lot of trouble with it.\n// There was also a question of whether or not calling the story function multiple times was a good idea.\nexport const ClientRepeater = <P extends ClientRepeatedComponentProps>(props: ClientRepeaterProps<P>) => {\n const {\n component: Component,\n controls: Controls,\n count = 1,\n types,\n createIdentity,\n createSpace,\n onCreateSpace,\n } = props;\n\n const [clients, setClients] = useState(props.clients ?? []);\n const [spaceId, setSpaceId] = useState<SpaceId>();\n\n const testBuilder = useRef(new TestBuilder());\n useAsyncEffect(async () => {\n const clients = [...Array(count)].map(\n (_) => new Client({ services: testBuilder.current.createLocalClientServices(), types }),\n );\n\n await Promise.all(clients.map((client) => client.initialize()));\n if (createIdentity || createSpace) {\n await Promise.all(clients.map((client) => client.halo.createIdentity()));\n }\n\n if (createSpace) {\n const client = clients[0];\n const space = await client.spaces.create({ name: random.commerce.productName() });\n setSpaceId(space.id);\n await onCreateSpace?.({ client, space }, {});\n await Promise.all(clients.slice(1).flatMap((client) => performInvitation({ host: space, guest: client.spaces })));\n }\n\n setClients(clients);\n }, []);\n\n if (clients.length === 0) {\n return null;\n }\n\n return (\n <>\n {Controls && <Controls clients={clients} />}\n {clients.map((client, index) => (\n <ClientProvider key={index} client={client}>\n <Component id={index} count={clients.length} spaceId={spaceId} {...{ ...props.args }} />\n </ClientProvider>\n ))}\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Decorator, type StoryContext } from '@storybook/react';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { Trigger } from '@dxos/async';\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { type SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ErrorBoundary } from '@dxos/react-ui';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientProvider, type ClientProviderProps } from '../client';\nimport { ClientStory } from './context';\n\ntype InitializeProps = {\n createIdentity?: boolean;\n createSpace?: boolean;\n onInitialized?: (client: Client) => MaybePromise<void>;\n onCreateIdentity?: (props: { client: Client }, context: StoryContext | any) => MaybePromise<void>;\n // NOTE: context must be untyped until ClientRepeater is removed.\n onCreateSpace?: (props: { client: Client; space: Space }, context: StoryContext | any) => MaybePromise<void>;\n};\n\n/**\n * Initialize client, identity and first space.\n */\nconst initializeClient = async (\n client: Client,\n { createIdentity, createSpace, onCreateIdentity, onCreateSpace, onInitialized }: InitializeProps,\n context: StoryContext,\n): Promise<ClientStory> => {\n await onInitialized?.(client);\n\n if (createIdentity || createSpace) {\n if (!client.halo.identity.get()) {\n await client.halo.createIdentity();\n await onCreateIdentity?.({ client }, context);\n }\n }\n\n let space: Space | undefined;\n if (createSpace) {\n space = await client.spaces.create({ name: 'Test Space' });\n await space.waitUntilReady(); // Is this required?\n await onCreateSpace?.({ client, space }, context);\n }\n\n return { space, spaceId: space?.id };\n};\n\nexport type WithClientProviderProps = InitializeProps & Omit<ClientProviderProps, 'onInitialized'>;\n\n/**\n * Decorator that provides the client context.\n */\nexport const withClientProvider = ({\n createIdentity,\n createSpace,\n onCreateSpace,\n onCreateIdentity,\n onInitialized,\n ...props\n}: WithClientProviderProps = {}): Decorator => {\n return (Story, context) => {\n const [data, setData] = useState<ClientStory>({});\n const handleInitialized = async (client: Client) => {\n const data = await initializeClient(\n client,\n {\n createIdentity,\n createSpace,\n onCreateSpace,\n onCreateIdentity,\n onInitialized,\n },\n context,\n );\n\n setData(data);\n };\n\n return (\n <ErrorBoundary name='client-provider'>\n <ClientProvider onInitialized={handleInitialized} {...props}>\n <ClientStory.Provider value={data}>\n <Story />\n </ClientStory.Provider>\n </ClientProvider>\n </ErrorBoundary>\n );\n };\n};\n\n// TODO(burdon): Implement context per client for context.\n// TODO(burdon): Callback once all invitations have completed.\n// TODO(burdon): Delay/jitter for creation of other clients.\nexport type WithMultiClientProviderProps = InitializeProps &\n Omit<ClientProviderProps, 'onInitialized'> & { numClients?: number };\n\n/**\n * Decorator that creates a scaffold for multiple clients.\n * Orchestrates invitations between a randomly selected host and the remaining clients.\n */\nexport const withMultiClientProvider = ({\n numClients = 2,\n createIdentity,\n createSpace,\n onCreateSpace,\n onCreateIdentity,\n onInitialized,\n ...props\n}: WithMultiClientProviderProps): Decorator => {\n return (Story, context) => {\n const spaceReady = useRef(new Trigger<Space | undefined>());\n const [spaceId, setSpaceId] = useState<SpaceId>();\n\n const clients = useMemo(() => {\n const buidler = new TestBuilder();\n return Array.from({ length: numClients }).map(() => {\n return {\n services: buidler.createLocalClientServices(),\n };\n });\n }, [numClients]);\n\n // Handle invitations.\n // NOTE: The zeroth client isn't necessarily the first to be initialized.\n const handleInitialized = useCallback(async (client: Client, index: number) => {\n if (index === 0) {\n // Initialize host.\n const { space } = await initializeClient(\n client,\n {\n createIdentity,\n createSpace,\n onCreateSpace,\n onCreateIdentity,\n onInitialized,\n },\n context,\n );\n\n log.info('inviting', { index, spaceId: space?.id });\n setSpaceId(space?.id);\n spaceReady.current.wake(space);\n } else {\n // Initialize guest.\n await initializeClient(client, { createIdentity, onInitialized }, context);\n\n log.info('waiting', { index });\n const space = await spaceReady.current.wait();\n if (space) {\n log.info('joining', { index, spaceId: space.id });\n await Promise.all(\n performInvitation({\n host: space,\n guest: client.spaces,\n }),\n );\n }\n }\n }, []);\n\n return (\n <div className='absolute inset-0 grid grid-flow-col auto-cols-fr gap-4 overflow-hidden'>\n {clients.map((client, index) => (\n <ClientProvider\n key={index}\n services={client.services}\n onInitialized={(client) => handleInitialized(client, index)}\n {...props}\n >\n <ClientStory.Provider value={{ index, spaceId }}>\n <ErrorBoundary name='client-provider'>\n <Story />\n </ErrorBoundary>\n </ClientStory.Provider>\n </ClientProvider>\n ))}\n </div>\n );\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,cAAc;;;ACAd,SAASA,eAAeC,kBAAkB;AAG1C,SAASC,aAAa;AASf,IAAMC,cAAcH,8BAAuCI,MAAAA;AAE3D,IAAMC,iBAAiB,MAAA;AAC5B,SAAOJ,WAAWE,WAAAA,KAAgBD,MAAM,IAAII,MAAM,qBAAA,CAAA;AACpD;;;AChBA,OAAOC,SAAkBC,QAAQC,gBAAgB;AAEjD,SAASC,cAAc;AACvB,SAASC,aAAaC,yBAAyB;AAG/C,SAASC,cAAc;AACvB,SAASC,sBAAsB;AA8BxB,IAAMC,iBAAiB,CAAyCC,UAAAA;AACrE,QAAM,EACJC,WAAWC,WACXC,UAAUC,UACVC,QAAQ,GACRC,OACAC,gBACAC,aACAC,cAAa,IACXT;AAEJ,QAAM,CAACU,SAASC,UAAAA,IAAcC,SAASZ,MAAMU,WAAW,CAAA,CAAE;AAC1D,QAAM,CAACG,SAASC,UAAAA,IAAcF,SAAAA;AAE9B,QAAMG,cAAcC,OAAO,IAAIC,YAAAA,CAAAA;AAC/BC,iBAAe,YAAA;AACb,UAAMR,WAAU;SAAIS,MAAMd,KAAAA;MAAQe,IAChC,CAACC,MAAM,IAAIC,OAAO;MAAEC,UAAUR,YAAYS,QAAQC,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A,OAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;",
|
|
6
|
+
"names": ["createContext", "useContext", "raise", "ClientStory", "undefined", "useClientStory", "Error", "React", "useRef", "useState", "Client", "TestBuilder", "performInvitation", "random", "useAsyncEffect", "ClientRepeater", "props", "component", "Component", "controls", "Controls", "count", "types", "createIdentity", "createSpace", "onCreateSpace", "clients", "setClients", "useState", "spaceId", "setSpaceId", "testBuilder", "useRef", "TestBuilder", "useAsyncEffect", "Array", "map", "_", "Client", "services", "current", "createLocalClientServices", "Promise", "all", "client", "initialize", "halo", "space", "spaces", "create", "name", "random", "commerce", "productName", "id", "slice", "flatMap", "performInvitation", "host", "guest", "length", "index", "ClientProvider", "key", "args", "React", "useCallback", "useMemo", "useRef", "useState", "Trigger", "TestBuilder", "performInvitation", "log", "ErrorBoundary", "createIdentity", "createSpace", "identity", "halo", "onCreateIdentity", "client", "context", "space", "spaceId", "data", "useState", "handleInitialized", "initializeClient", "onCreateSpace", "onInitialized", "setData", "React", "ClientProvider", "value", "Story", "spaceReady", "Trigger", "setSpaceId", "clients", "useMemo", "buidler", "TestBuilder", "Array", "length", "numClients", "services", "info", "index", "id", "current", "log", "Promise", "performInvitation", "guest", "spaces", "className", "ClientStory", "Provider", "name"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAoB3C,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAoB3C,eAAO,MAAM,WAAW,WAAY,MAAM,SAQzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentHostingProvider.d.ts","sourceRoot":"","sources":["../../../../src/client/AgentHostingProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAuC,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAE,KAAK,0BAA0B,EAAgD,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,MAAM,MAAM,yBAAyB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,mBAAmB,kDAAyD,CAAC;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"AgentHostingProvider.d.ts","sourceRoot":"","sources":["../../../../src/client/AgentHostingProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAuC,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAE,KAAK,0BAA0B,EAAgD,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,MAAM,MAAM,yBAAyB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAEvE,eAAO,MAAM,mBAAmB,kDAAyD,CAAC;AAE1F;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,UAAW,iBAAiB,sBAM5D,CAAC;AAEF,eAAO,MAAM,qBAAqB,yCAEjC,CAAC"}
|
|
@@ -29,11 +29,6 @@ export type ClientProviderProps = Omit<ClientOptions, 'config' | 'services'> & P
|
|
|
29
29
|
* ReactNode to display until the client is available.
|
|
30
30
|
*/
|
|
31
31
|
fallback?: FunctionComponent<Partial<ClientContextProps>>;
|
|
32
|
-
/**
|
|
33
|
-
* Enable (by default) registration of Preact signals runtime for reactive ECHO objects.
|
|
34
|
-
* @see https://www.npmjs.com/package/@preact/signals-react
|
|
35
|
-
*/
|
|
36
|
-
signalsRuntime?: boolean;
|
|
37
32
|
/**
|
|
38
33
|
* Skip the DXOS banner.
|
|
39
34
|
*/
|
|
@@ -47,7 +42,7 @@ export type ClientProviderProps = Omit<ClientOptions, 'config' | 'services'> & P
|
|
|
47
42
|
* Root component that provides the DXOS client instance to child components.
|
|
48
43
|
* To be used with the `useClient` hook.
|
|
49
44
|
*/
|
|
50
|
-
export declare const ClientProvider: React.ForwardRefExoticComponent<Omit<ClientOptions, "
|
|
45
|
+
export declare const ClientProvider: React.ForwardRefExoticComponent<Omit<ClientOptions, "config" | "services"> & Pick<ClientContextProps, "status"> & {
|
|
51
46
|
/**
|
|
52
47
|
* Client object or async provider to enable to caller to do custom initialization.
|
|
53
48
|
*
|
|
@@ -70,11 +65,6 @@ export declare const ClientProvider: React.ForwardRefExoticComponent<Omit<Client
|
|
|
70
65
|
* ReactNode to display until the client is available.
|
|
71
66
|
*/
|
|
72
67
|
fallback?: FunctionComponent<Partial<ClientContextProps>>;
|
|
73
|
-
/**
|
|
74
|
-
* Enable (by default) registration of Preact signals runtime for reactive ECHO objects.
|
|
75
|
-
* @see https://www.npmjs.com/package/@preact/signals-react
|
|
76
|
-
*/
|
|
77
|
-
signalsRuntime?: boolean;
|
|
78
68
|
/**
|
|
79
69
|
* Skip the DXOS banner.
|
|
80
70
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/client/ClientProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAKvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,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EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CACxD,CAAC,CAAC;AAEL;;;GAGG;AACH,eAAO,MAAM,cAAc;IA3CvB;;;;OAIG;aACM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C;;;;OAIG;aAEM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C;;;;OAIG;eAEQ,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAE/F;;OAEG;eACQ,iBAAiB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;OAEG;eACQ,OAAO;IAElB;;OAEG;oBACa,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC;;;4CAgHzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClientStatus.d.ts","sourceRoot":"","sources":["../../../../src/client/useClientStatus.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE9D,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"useClientStatus.d.ts","sourceRoot":"","sources":["../../../../src/client/useClientStatus.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE9D,eAAO,MAAM,eAAe,WAAY,MAAM,oCAY7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStream.d.ts","sourceRoot":"","sources":["../../../../src/devtools/useStream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAG1D;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"useStream.d.ts","sourceRoot":"","sources":["../../../../src/devtools/useStream.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAG1D;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,iBAAiB,MAAM,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,SAAQ,cAAc,KAAQ,CAmBzG,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * from '@dxos/client/echo';
|
|
2
|
+
export * from '@dxos/echo-react';
|
|
2
3
|
export * from './useMembers';
|
|
3
|
-
export * from './useQuery';
|
|
4
|
-
export * from './useQueue';
|
|
5
|
-
export * from './useSchema';
|
|
6
4
|
export * from './useSpaces';
|
|
7
5
|
export * from './useSpaceInvitations';
|
|
6
|
+
export * from './useSpaceProperties';
|
|
8
7
|
export * from './useSubscription';
|
|
9
8
|
export * from './useSyncState';
|
|
9
|
+
export * from './useFeedSyncState';
|
|
10
|
+
export * from './useRegistry';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/echo/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/echo/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SpaceId } from '@dxos/keys';
|
|
2
|
+
export type FeedSyncState = {
|
|
3
|
+
/** Combined blocks to pull + push across namespaces. */
|
|
4
|
+
pending: number;
|
|
5
|
+
/** Total blocks stored locally across namespaces. */
|
|
6
|
+
total: number;
|
|
7
|
+
};
|
|
8
|
+
export type FeedSyncStateMap = Record<SpaceId, FeedSyncState>;
|
|
9
|
+
/**
|
|
10
|
+
* Polls queue replication state per space.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useFeedSyncState: (pollIntervalMs?: number) => FeedSyncStateMap;
|
|
13
|
+
//# sourceMappingURL=useFeedSyncState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFeedSyncState.d.ts","sourceRoot":"","sources":["../../../../src/echo/useFeedSyncState.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAM1C,MAAM,MAAM,aAAa,GAAG;IAC1B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,gBAAgB,+BAAgD,gBAqD5E,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type PublicKeyLike } from '@dxos/client';
|
|
2
2
|
import { type SpaceMember } from '@dxos/client/echo';
|
|
3
|
-
export declare const useMembers: (spaceKey:
|
|
3
|
+
export declare const useMembers: (spaceKey: PublicKeyLike | undefined) => SpaceMember[];
|
|
4
4
|
//# sourceMappingURL=useMembers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMembers.d.ts","sourceRoot":"","sources":["../../../../src/echo/useMembers.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"useMembers.d.ts","sourceRoot":"","sources":["../../../../src/echo/useMembers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKtE,eAAO,MAAM,UAAU,aAAc,aAAa,GAAG,SAAS,KAAG,WAAW,EAU3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRegistry.d.ts","sourceRoot":"","sources":["../../../../src/echo/useRegistry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C;;GAEG;AACH,eAAO,MAAM,WAAW,QAAO,QAAQ,CAAC,QAGvC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PublicKey } from '@dxos/client';
|
|
2
|
+
import { type SpaceId } from '@dxos/keys';
|
|
2
3
|
import { type CancellableInvitationObservable } from '../invitations';
|
|
3
|
-
export declare const useSpaceInvitations: (
|
|
4
|
-
export declare const useSpaceInvitation: (
|
|
4
|
+
export declare const useSpaceInvitations: (spaceId?: SpaceId | PublicKey) => CancellableInvitationObservable[];
|
|
5
|
+
export declare const useSpaceInvitation: (spaceId?: SpaceId | PublicKey, invitationId?: string) => import("../invitations").InvitationStatus;
|
|
5
6
|
//# sourceMappingURL=useSpaceInvitations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSpaceInvitations.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSpaceInvitations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useSpaceInvitations.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSpaceInvitations.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,KAAK,+BAA+B,EAAuB,MAAM,gBAAgB,CAAC;AAK3F,eAAO,MAAM,mBAAmB,aAAc,OAAO,GAAG,SAAS,KAAG,+BAA+B,EAGlG,CAAC;AAIF,eAAO,MAAM,kBAAkB,aAAc,OAAO,GAAG,SAAS,iBAAiB,MAAM,8CAOtF,CAAC"}
|