@dxos/react-client 0.8.3 → 0.8.4-main.03d5cd7b56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/.storybook/main.mts +9 -0
  2. package/.storybook/preview.mts +8 -0
  3. package/dist/lib/browser/chunk-3LVU7RNK.mjs +16 -0
  4. package/dist/lib/browser/chunk-3LVU7RNK.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-CZMIVAGI.mjs +8 -0
  6. package/dist/lib/browser/chunk-CZMIVAGI.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-XT352YI6.mjs +134 -0
  8. package/dist/lib/browser/chunk-XT352YI6.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-AL2CUQ46.mjs → chunk-YHE6WD44.mjs} +8 -18
  10. package/dist/lib/browser/chunk-YHE6WD44.mjs.map +7 -0
  11. package/dist/lib/browser/devtools/index.mjs +8 -12
  12. package/dist/lib/browser/devtools/index.mjs.map +3 -3
  13. package/dist/lib/browser/echo/index.mjs +67 -136
  14. package/dist/lib/browser/echo/index.mjs.map +4 -4
  15. package/dist/lib/browser/halo/index.mjs +12 -10
  16. package/dist/lib/browser/halo/index.mjs.map +3 -3
  17. package/dist/lib/browser/index.mjs +100 -13
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/invitations/index.mjs +1 -1
  20. package/dist/lib/browser/mesh/index.mjs +4 -3
  21. package/dist/lib/browser/mesh/index.mjs.map +1 -1
  22. package/dist/lib/browser/meta.json +1 -1
  23. package/dist/lib/browser/testing/index.mjs +117 -160
  24. package/dist/lib/browser/testing/index.mjs.map +3 -3
  25. package/dist/lib/browser/worker.mjs +1 -1
  26. package/dist/lib/node-esm/chunk-CUDKNAMV.mjs +17 -0
  27. package/dist/lib/node-esm/chunk-CUDKNAMV.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-UYJUBYMU.mjs → chunk-RQJPEHDY.mjs} +8 -18
  29. package/dist/lib/node-esm/chunk-RQJPEHDY.mjs.map +7 -0
  30. package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs +135 -0
  31. package/dist/lib/node-esm/chunk-WL3Z5HOH.mjs.map +7 -0
  32. package/dist/lib/node-esm/chunk-WUTK2IJF.mjs +10 -0
  33. package/dist/lib/node-esm/chunk-WUTK2IJF.mjs.map +7 -0
  34. package/dist/lib/node-esm/devtools/index.mjs +8 -12
  35. package/dist/lib/node-esm/devtools/index.mjs.map +3 -3
  36. package/dist/lib/node-esm/echo/index.mjs +67 -136
  37. package/dist/lib/node-esm/echo/index.mjs.map +4 -4
  38. package/dist/lib/node-esm/halo/index.mjs +12 -10
  39. package/dist/lib/node-esm/halo/index.mjs.map +3 -3
  40. package/dist/lib/node-esm/index.mjs +100 -13
  41. package/dist/lib/node-esm/index.mjs.map +4 -4
  42. package/dist/lib/node-esm/invitations/index.mjs +1 -1
  43. package/dist/lib/node-esm/mesh/index.mjs +4 -3
  44. package/dist/lib/node-esm/mesh/index.mjs.map +1 -1
  45. package/dist/lib/node-esm/meta.json +1 -1
  46. package/dist/lib/node-esm/testing/index.mjs +117 -160
  47. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  48. package/dist/lib/node-esm/worker.mjs +1 -1
  49. package/dist/types/src/banner.d.ts.map +1 -1
  50. package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -1
  51. package/dist/types/src/client/ClientProvider.d.ts +1 -11
  52. package/dist/types/src/client/ClientProvider.d.ts.map +1 -1
  53. package/dist/types/src/client/useClientStatus.d.ts.map +1 -1
  54. package/dist/types/src/devtools/useStream.d.ts.map +1 -1
  55. package/dist/types/src/echo/index.d.ts +2 -2
  56. package/dist/types/src/echo/index.d.ts.map +1 -1
  57. package/dist/types/src/echo/useMembers.d.ts +2 -2
  58. package/dist/types/src/echo/useMembers.d.ts.map +1 -1
  59. package/dist/types/src/echo/useQueue.d.ts +3 -2
  60. package/dist/types/src/echo/useQueue.d.ts.map +1 -1
  61. package/dist/types/src/echo/useSpaceInvitations.d.ts +3 -2
  62. package/dist/types/src/echo/useSpaceInvitations.d.ts.map +1 -1
  63. package/dist/types/src/echo/useSpaceProperties.d.ts +13 -0
  64. package/dist/types/src/echo/useSpaceProperties.d.ts.map +1 -0
  65. package/dist/types/src/echo/useSpaces.d.ts +19 -9
  66. package/dist/types/src/echo/useSpaces.d.ts.map +1 -1
  67. package/dist/types/src/echo/useSubscription.d.ts +1 -1
  68. package/dist/types/src/echo/useSubscription.d.ts.map +1 -1
  69. package/dist/types/src/echo/useSyncState.d.ts +1 -1
  70. package/dist/types/src/echo/useSyncState.d.ts.map +1 -1
  71. package/dist/types/src/halo/Passkey.stories.d.ts +5 -5
  72. package/dist/types/src/halo/Passkey.stories.d.ts.map +1 -1
  73. package/dist/types/src/halo/useHaloInvitations.d.ts.map +1 -1
  74. package/dist/types/src/halo/useKeyStore.d.ts.map +1 -1
  75. package/dist/types/src/invitations/useInvitationStatus.d.ts +1 -1
  76. package/dist/types/src/invitations/useInvitationStatus.d.ts.map +1 -1
  77. package/dist/types/src/testing/ClientRepeater.d.ts +6 -5
  78. package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
  79. package/dist/types/src/testing/ClientRepeater.stories.d.ts +6 -10
  80. package/dist/types/src/testing/ClientRepeater.stories.d.ts.map +1 -1
  81. package/dist/types/src/testing/context.d.ts +4 -2
  82. package/dist/types/src/testing/context.d.ts.map +1 -1
  83. package/dist/types/src/testing/util.d.ts.map +1 -1
  84. package/dist/types/src/testing/withClientProvider.d.ts +6 -10
  85. package/dist/types/src/testing/withClientProvider.d.ts.map +1 -1
  86. package/dist/types/src/testing/withClientProvider.stories.d.ts +8 -9
  87. package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
  88. package/dist/types/tsconfig.tsbuildinfo +1 -1
  89. package/docs/README.md +38 -38
  90. package/moon.yml +20 -0
  91. package/package.json +43 -58
  92. package/src/client/AgentHostingProvider.tsx +1 -1
  93. package/src/client/ClientProvider.test.tsx +2 -2
  94. package/src/client/ClientProvider.tsx +32 -50
  95. package/src/client/useConfig.test.tsx +1 -1
  96. package/src/devtools/useStream.ts +1 -1
  97. package/src/echo/index.ts +2 -2
  98. package/src/echo/useMembers.ts +5 -3
  99. package/src/echo/useQueue.ts +3 -4
  100. package/src/echo/useSpaceInvitations.ts +10 -5
  101. package/src/echo/useSpaceProperties.ts +28 -0
  102. package/src/echo/useSpaces.test.tsx +8 -14
  103. package/src/echo/useSpaces.ts +32 -30
  104. package/src/echo/useSubscription.ts +1 -1
  105. package/src/echo/useSyncState.ts +5 -4
  106. package/src/halo/Passkey.stories.tsx +20 -20
  107. package/src/halo/useDevices.test.tsx +1 -1
  108. package/src/halo/useHaloInvitations.ts +1 -1
  109. package/src/invitations/useInvitationStatus.ts +9 -8
  110. package/src/testing/ClientRepeater.stories.tsx +22 -16
  111. package/src/testing/ClientRepeater.tsx +29 -37
  112. package/src/testing/context.tsx +4 -3
  113. package/src/testing/util.tsx +0 -1
  114. package/src/testing/withClientProvider.stories.tsx +34 -20
  115. package/src/testing/withClientProvider.tsx +77 -94
  116. package/tsconfig.json +3 -6
  117. package/typedoc.json +1 -1
  118. package/vitest.config.ts +10 -16
  119. package/.eslintrc.cjs +0 -12
  120. package/README.yml +0 -33
  121. package/dist/lib/browser/chunk-72QD3PXL.mjs +0 -312
  122. package/dist/lib/browser/chunk-72QD3PXL.mjs.map +0 -7
  123. package/dist/lib/browser/chunk-AL2CUQ46.mjs.map +0 -7
  124. package/dist/lib/node/chunk-5RUIFUEC.cjs +0 -334
  125. package/dist/lib/node/chunk-5RUIFUEC.cjs.map +0 -7
  126. package/dist/lib/node/chunk-FYOAVV65.cjs +0 -188
  127. package/dist/lib/node/chunk-FYOAVV65.cjs.map +0 -7
  128. package/dist/lib/node/devtools/index.cjs +0 -62
  129. package/dist/lib/node/devtools/index.cjs.map +0 -7
  130. package/dist/lib/node/echo/index.cjs +0 -302
  131. package/dist/lib/node/echo/index.cjs.map +0 -7
  132. package/dist/lib/node/halo/index.cjs +0 -123
  133. package/dist/lib/node/halo/index.cjs.map +0 -7
  134. package/dist/lib/node/index.cjs +0 -55
  135. package/dist/lib/node/index.cjs.map +0 -7
  136. package/dist/lib/node/invitations/index.cjs +0 -39
  137. package/dist/lib/node/invitations/index.cjs.map +0 -7
  138. package/dist/lib/node/mesh/index.cjs +0 -37
  139. package/dist/lib/node/mesh/index.cjs.map +0 -7
  140. package/dist/lib/node/meta.json +0 -1
  141. package/dist/lib/node/testing/index.cjs +0 -278
  142. package/dist/lib/node/testing/index.cjs.map +0 -7
  143. package/dist/lib/node/worker.cjs +0 -23
  144. package/dist/lib/node/worker.cjs.map +0 -7
  145. package/dist/lib/node-esm/chunk-NBTZZNQ5.mjs +0 -314
  146. package/dist/lib/node-esm/chunk-NBTZZNQ5.mjs.map +0 -7
  147. package/dist/lib/node-esm/chunk-UYJUBYMU.mjs.map +0 -7
  148. package/dist/types/src/echo/useQuery.d.ts +0 -11
  149. package/dist/types/src/echo/useQuery.d.ts.map +0 -1
  150. package/dist/types/src/echo/useQuery.test.d.ts +0 -2
  151. package/dist/types/src/echo/useQuery.test.d.ts.map +0 -1
  152. package/dist/types/src/echo/useSchema.d.ts +0 -8
  153. package/dist/types/src/echo/useSchema.d.ts.map +0 -1
  154. package/dist/types/src/playwright/playwright.config.d.cts +0 -3
  155. package/dist/types/src/playwright/playwright.config.d.cts.map +0 -1
  156. package/dist/types/src/playwright/smoke.spec.d.ts +0 -2
  157. package/dist/types/src/playwright/smoke.spec.d.ts.map +0 -1
  158. package/project.json +0 -40
  159. package/src/echo/useQuery.test.tsx +0 -128
  160. package/src/echo/useQuery.ts +0 -56
  161. package/src/echo/useSchema.ts +0 -54
  162. package/src/playwright/playwright.config.cts +0 -18
  163. package/src/playwright/smoke.spec.ts +0 -26
  164. package/typedoc/.nojekyll +0 -1
  165. package/typedoc/assets/hierarchy.js +0 -1
  166. package/typedoc/assets/highlight.css +0 -99
  167. package/typedoc/assets/icons.js +0 -18
  168. package/typedoc/assets/icons.svg +0 -1
  169. package/typedoc/assets/main.js +0 -60
  170. package/typedoc/assets/navigation.js +0 -1
  171. package/typedoc/assets/search.js +0 -1
  172. package/typedoc/assets/style.css +0 -1640
  173. package/typedoc/classes/echo.Hypergraph.html +0 -17
  174. package/typedoc/classes/echo.PropertiesType.html +0 -19
  175. package/typedoc/classes/echo.QueryResult.html +0 -18
  176. package/typedoc/classes/halo.KeyStore.html +0 -6
  177. package/typedoc/classes/index.AgentClientServiceProvider.html +0 -10
  178. package/typedoc/classes/index.AgentManagerClient.html +0 -22
  179. package/typedoc/classes/index.AlreadyJoinedError.html +0 -15
  180. package/typedoc/classes/index.ApiError.html +0 -16
  181. package/typedoc/classes/index.CancelledError.html +0 -16
  182. package/typedoc/classes/index.Client.html +0 -51
  183. package/typedoc/classes/index.ClientServicesProxy.html +0 -12
  184. package/typedoc/classes/index.Config.html +0 -17
  185. package/typedoc/classes/index.DataCorruptionError.html +0 -16
  186. package/typedoc/classes/index.DatabaseError.html +0 -15
  187. package/typedoc/classes/index.EntityNotFoundError.html +0 -15
  188. package/typedoc/classes/index.FakeAgentHostingProvider.html +0 -7
  189. package/typedoc/classes/index.IFrameManager.html +0 -6
  190. package/typedoc/classes/index.IdentityNotInitializedError.html +0 -15
  191. package/typedoc/classes/index.InvalidConfigError.html +0 -16
  192. package/typedoc/classes/index.InvalidInvitationError.html +0 -15
  193. package/typedoc/classes/index.InvalidInvitationExtensionRoleError.html +0 -16
  194. package/typedoc/classes/index.InvalidStorageVersionError.html +0 -15
  195. package/typedoc/classes/index.LocalClientServices.html +0 -12
  196. package/typedoc/classes/index.PublicKey.html +0 -55
  197. package/typedoc/classes/index.RemoteServiceConnectionError.html +0 -15
  198. package/typedoc/classes/index.RemoteServiceConnectionTimeout.html +0 -15
  199. package/typedoc/classes/index.RpcClosedError.html +0 -15
  200. package/typedoc/classes/index.RpcNotOpenError.html +0 -15
  201. package/typedoc/classes/index.SharedWorkerConnection.html +0 -5
  202. package/typedoc/classes/index.Shell.html +0 -35
  203. package/typedoc/classes/index.ShellManager.html +0 -9
  204. package/typedoc/classes/index.SystemError.html +0 -16
  205. package/typedoc/classes/index.UnknownModelError.html +0 -15
  206. package/typedoc/classes/index.WorkerClientServices.html +0 -12
  207. package/typedoc/classes/invitations.AuthenticatingInvitationObservable.html +0 -30
  208. package/typedoc/classes/invitations.CancellableInvitationObservable.html +0 -29
  209. package/typedoc/classes/invitations.InvitationEncoder.html +0 -5
  210. package/typedoc/classes/invitations.InvitationsProxy.html +0 -12
  211. package/typedoc/enums/devtools.KeyType.html +0 -9
  212. package/typedoc/enums/echo.HaloSpaceMember.Role.html +0 -9
  213. package/typedoc/enums/echo.IndexKind.Kind.html +0 -8
  214. package/typedoc/enums/echo.QueryOptions.DataLocation.html +0 -6
  215. package/typedoc/enums/echo.QueryOptions.ShowDeletedOption.html +0 -6
  216. package/typedoc/enums/echo.ResultFormat.html +0 -10
  217. package/typedoc/enums/echo.SpaceMember.PresenceState.html +0 -5
  218. package/typedoc/enums/echo.SpaceState.html +0 -13
  219. package/typedoc/enums/echo.TextKind.html +0 -5
  220. package/typedoc/enums/halo.Device.PresenceState.html +0 -6
  221. package/typedoc/enums/halo.DeviceKind.html +0 -5
  222. package/typedoc/enums/halo.DeviceType.html +0 -9
  223. package/typedoc/enums/index.ShellDisplay.html +0 -5
  224. package/typedoc/enums/index.ShellLayout.html +0 -13
  225. package/typedoc/enums/index.SystemStatus.html +0 -5
  226. package/typedoc/enums/invitations.Invitation.AuthMethod.html +0 -6
  227. package/typedoc/enums/invitations.Invitation.Kind.html +0 -5
  228. package/typedoc/enums/invitations.Invitation.State.html +0 -13
  229. package/typedoc/enums/invitations.Invitation.Type.html +0 -6
  230. package/typedoc/enums/mesh.ConnectionState.html +0 -5
  231. package/typedoc/functions/devtools.useDevtools.html +0 -1
  232. package/typedoc/functions/devtools.useStream.html +0 -2
  233. package/typedoc/functions/echo.useMembers.html +0 -1
  234. package/typedoc/functions/echo.useQueue.html +0 -2
  235. package/typedoc/functions/echo.useSchema.html +0 -2
  236. package/typedoc/functions/echo.useSpace.html +0 -6
  237. package/typedoc/functions/echo.useSpaceInvitation.html +0 -1
  238. package/typedoc/functions/echo.useSpaceInvitations.html +0 -1
  239. package/typedoc/functions/echo.useSpaceSyncState.html +0 -2
  240. package/typedoc/functions/echo.useSpaces.html +0 -5
  241. package/typedoc/functions/echo.useSubscription.html +0 -3
  242. package/typedoc/functions/echo.useSyncState.html +0 -2
  243. package/typedoc/functions/halo.useContacts.html +0 -4
  244. package/typedoc/functions/halo.useCredentials.html +0 -1
  245. package/typedoc/functions/halo.useDevices.html +0 -1
  246. package/typedoc/functions/halo.useHaloInvitation.html +0 -1
  247. package/typedoc/functions/halo.useHaloInvitations.html +0 -1
  248. package/typedoc/functions/halo.useIdentity.html +0 -3
  249. package/typedoc/functions/halo.useKeyStore.html +0 -3
  250. package/typedoc/functions/index.AgentHostingProvider.html +0 -2
  251. package/typedoc/functions/index.useAgentHostingClient.html +0 -1
  252. package/typedoc/functions/index.useClient.html +0 -3
  253. package/typedoc/functions/index.useClientStatus.html +0 -1
  254. package/typedoc/functions/index.useConfig.html +0 -3
  255. package/typedoc/functions/index.useShell.html +0 -2
  256. package/typedoc/functions/index.useShellDisplay.html +0 -2
  257. package/typedoc/functions/index.useStatus.html +0 -1
  258. package/typedoc/functions/invitations.useInvitationStatus.html +0 -1
  259. package/typedoc/functions/mesh.useNetworkStatus.html +0 -2
  260. package/typedoc/hierarchy.html +0 -1
  261. package/typedoc/index.html +0 -23
  262. package/typedoc/interfaces/devtools.DevtoolsHook.html +0 -22
  263. package/typedoc/interfaces/devtools.DevtoolsHost.html +0 -26
  264. package/typedoc/interfaces/echo.DocAccessor.html +0 -3
  265. package/typedoc/interfaces/echo.Echo.html +0 -39
  266. package/typedoc/interfaces/echo.EchoDatabase.html +0 -25
  267. package/typedoc/interfaces/echo.Expando.html +0 -3
  268. package/typedoc/interfaces/echo.Filter.html +0 -3
  269. package/typedoc/interfaces/echo.HaloSpaceMember.html +0 -18
  270. package/typedoc/interfaces/echo.IDocHandle.html +0 -6
  271. package/typedoc/interfaces/echo.IndexKind.html +0 -9
  272. package/typedoc/interfaces/echo.Query.html +0 -34
  273. package/typedoc/interfaces/echo.QueryOptions.html +0 -39
  274. package/typedoc/interfaces/echo.Queue.html +0 -17
  275. package/typedoc/interfaces/echo.Ref.html +0 -32
  276. package/typedoc/interfaces/echo.Space.html +0 -39
  277. package/typedoc/interfaces/echo.SpaceMember.html +0 -7
  278. package/typedoc/interfaces/echo.SpaceSyncState.PeerState.html +0 -14
  279. package/typedoc/interfaces/echo.SpaceSyncState.html +0 -4
  280. package/typedoc/interfaces/echo.SubscriptionHandle.html +0 -5
  281. package/typedoc/interfaces/echo.TypedObject.html +0 -16
  282. package/typedoc/interfaces/halo.Contact.html +0 -10
  283. package/typedoc/interfaces/halo.Credential.html +0 -27
  284. package/typedoc/interfaces/halo.Device.html +0 -11
  285. package/typedoc/interfaces/halo.Halo.html +0 -16
  286. package/typedoc/interfaces/halo.Identity.html +0 -15
  287. package/typedoc/interfaces/index.AgentHostingProviderClient.html +0 -6
  288. package/typedoc/interfaces/index.AppContextRequest.html +0 -33
  289. package/typedoc/interfaces/index.ClientServicesProvider.html +0 -9
  290. package/typedoc/interfaces/index.InvitationUrlRequest.html +0 -9
  291. package/typedoc/interfaces/index.LayoutRequest.html +0 -29
  292. package/typedoc/interfaces/index.ShellRuntime.html +0 -15
  293. package/typedoc/interfaces/invitations.Invitation.html +0 -92
  294. package/typedoc/interfaces/invitations.Invitations.html +0 -5
  295. package/typedoc/interfaces/mesh.GossipMessage.html +0 -10
  296. package/typedoc/interfaces/mesh.NetworkStatus.Signal.html +0 -5
  297. package/typedoc/interfaces/mesh.NetworkStatus.html +0 -6
  298. package/typedoc/media/LICENSE +0 -8
  299. package/typedoc/modules/devtools.html +0 -1
  300. package/typedoc/modules/echo.Filter.html +0 -1
  301. package/typedoc/modules/echo.HaloSpaceMember.html +0 -1
  302. package/typedoc/modules/echo.IndexKind.html +0 -1
  303. package/typedoc/modules/echo.Query.html +0 -1
  304. package/typedoc/modules/echo.QueryOptions.html +0 -1
  305. package/typedoc/modules/echo.Ref.html +0 -2
  306. package/typedoc/modules/echo.SpaceMember.html +0 -1
  307. package/typedoc/modules/echo.SpaceSyncState.html +0 -1
  308. package/typedoc/modules/echo.html +0 -1
  309. package/typedoc/modules/halo.Device.html +0 -1
  310. package/typedoc/modules/halo.html +0 -1
  311. package/typedoc/modules/index.html +0 -1
  312. package/typedoc/modules/invitations.Invitation.html +0 -1
  313. package/typedoc/modules/invitations.html +0 -1
  314. package/typedoc/modules/mesh.NetworkStatus.html +0 -1
  315. package/typedoc/modules/mesh.html +0 -1
  316. package/typedoc/modules/worker.html +0 -1
  317. package/typedoc/modules.html +0 -1
  318. package/typedoc/types/devtools.MountOptions.html +0 -3
  319. package/typedoc/types/echo.AnyLiveObject.html +0 -2
  320. package/typedoc/types/echo.Filter.And.html +0 -1
  321. package/typedoc/types/echo.Filter.Any.html +0 -1
  322. package/typedoc/types/echo.Filter.Or.html +0 -1
  323. package/typedoc/types/echo.Filter.Props.html +0 -1
  324. package/typedoc/types/echo.Filter.Type.html +0 -1
  325. package/typedoc/types/echo.Live.html +0 -5
  326. package/typedoc/types/echo.ObjectMeta.html +0 -1
  327. package/typedoc/types/echo.ObjectMigration.html +0 -7
  328. package/typedoc/types/echo.ObjectVersion.html +0 -2
  329. package/typedoc/types/echo.PeerSyncState.html +0 -1
  330. package/typedoc/types/echo.Progress.html +0 -3
  331. package/typedoc/types/echo.PropertiesTypeProps.html +0 -1
  332. package/typedoc/types/echo.Query.Any.html +0 -1
  333. package/typedoc/types/echo.Query.TextSearchOptions.html +0 -2
  334. package/typedoc/types/echo.Query.Type.html +0 -1
  335. package/typedoc/types/echo.Ref.Target.html +0 -2
  336. package/typedoc/types/echo.Selection.html +0 -1
  337. package/typedoc/types/echo.SpaceId.html +0 -6
  338. package/typedoc/types/echo.SpaceSyncStateMap.html +0 -1
  339. package/typedoc/types/echo.UseQueueOptions.html +0 -2
  340. package/typedoc/types/echo.UseSpacesParams.html +0 -3
  341. package/typedoc/types/index.AgentHostingProviderProps.html +0 -3
  342. package/typedoc/types/index.ClientContextProps.html +0 -3
  343. package/typedoc/types/index.ClientOptions.html +0 -12
  344. package/typedoc/types/index.ClientProviderProps.html +0 -2
  345. package/typedoc/types/index.ClientServices.html +0 -15
  346. package/typedoc/types/index.FromAgentOptions.html +0 -2
  347. package/typedoc/types/index.PublicKeyLike.html +0 -2
  348. package/typedoc/types/invitations.InvitationAction.html +0 -1
  349. package/typedoc/types/invitations.InvitationResult.html +0 -5
  350. package/typedoc/types/invitations.InvitationStatus.html +0 -15
  351. package/typedoc/variables/devtools.mountDevtoolsHooks.html +0 -1
  352. package/typedoc/variables/devtools.unmountDevtoolsHooks.html +0 -1
  353. package/typedoc/variables/echo.DocAccessor.html +0 -1
  354. package/typedoc/variables/echo.EchoObjectSchema.html +0 -1
  355. package/typedoc/variables/echo.Expando.html +0 -1
  356. package/typedoc/variables/echo.FQ_ID_LENGTH.html +0 -1
  357. package/typedoc/variables/echo.Filter.html +0 -1
  358. package/typedoc/variables/echo.OBJECT_ID_LENGTH.html +0 -1
  359. package/typedoc/variables/echo.ObjectVersion.html +0 -1
  360. package/typedoc/variables/echo.Query.html +0 -1
  361. package/typedoc/variables/echo.Queue.html +0 -1
  362. package/typedoc/variables/echo.ReactiveObjectSchema.html +0 -1
  363. package/typedoc/variables/echo.Ref.html +0 -2
  364. package/typedoc/variables/echo.RefArray.html +0 -2
  365. package/typedoc/variables/echo.SPACE_ID_LENGTH.html +0 -1
  366. package/typedoc/variables/echo.SpaceId.html +0 -1
  367. package/typedoc/variables/echo.SpaceSchema.html +0 -1
  368. package/typedoc/variables/echo.TypedObject.html +0 -3
  369. package/typedoc/variables/echo.compareForeignKeys.html +0 -1
  370. package/typedoc/variables/echo.createDocAccessor.html +0 -1
  371. package/typedoc/variables/echo.createEmptyEdgeSyncState.html +0 -1
  372. package/typedoc/variables/echo.createObject.html +0 -1
  373. package/typedoc/variables/echo.createQueueDXN.html +0 -2
  374. package/typedoc/variables/echo.createSubscription.html +0 -5
  375. package/typedoc/variables/echo.defineObjectMigration.html +0 -1
  376. package/typedoc/variables/echo.fromCursor.html +0 -1
  377. package/typedoc/variables/echo.fullyQualifiedId.html +0 -4
  378. package/typedoc/variables/echo.getMeta.html +0 -1
  379. package/typedoc/variables/echo.getObjectCore.html +0 -1
  380. package/typedoc/variables/echo.getRangeFromCursor.html +0 -1
  381. package/typedoc/variables/echo.getSchema.html +0 -2
  382. package/typedoc/variables/echo.getSource.html +0 -4
  383. package/typedoc/variables/echo.getSpace.html +0 -1
  384. package/typedoc/variables/echo.getSyncSummary.html +0 -1
  385. package/typedoc/variables/echo.getTarget.html +0 -4
  386. package/typedoc/variables/echo.getTextInRange.html +0 -2
  387. package/typedoc/variables/echo.getType.html +0 -5
  388. package/typedoc/variables/echo.getTypename.html +0 -6
  389. package/typedoc/variables/echo.getVersion.html +0 -3
  390. package/typedoc/variables/echo.importSpace.html +0 -1
  391. package/typedoc/variables/echo.internalDecodeReference.html +0 -1
  392. package/typedoc/variables/echo.isEchoObject.html +0 -2
  393. package/typedoc/variables/echo.isLiveObject.html +0 -2
  394. package/typedoc/variables/echo.isRelation.html +0 -2
  395. package/typedoc/variables/echo.isSpace.html +0 -1
  396. package/typedoc/variables/echo.live.html +0 -3
  397. package/typedoc/variables/echo.loadObjectReferences.html +0 -7
  398. package/typedoc/variables/echo.makeRef.html +0 -2
  399. package/typedoc/variables/echo.parseFullyQualifiedId.html +0 -2
  400. package/typedoc/variables/echo.parseId.html +0 -1
  401. package/typedoc/variables/echo.refFromDXN.html +0 -2
  402. package/typedoc/variables/echo.toCursor.html +0 -1
  403. package/typedoc/variables/echo.toCursorRange.html +0 -1
  404. package/typedoc/variables/echo.updateText.html +0 -6
  405. package/typedoc/variables/echo.useQuery.html +0 -2
  406. package/typedoc/variables/index.AgentHostingContext.html +0 -1
  407. package/typedoc/variables/index.ClientProvider.html +0 -3
  408. package/typedoc/variables/index.DXOS_VERSION.html +0 -1
  409. package/typedoc/variables/index.Defaults.html +0 -2
  410. package/typedoc/variables/index.Dynamics.html +0 -2
  411. package/typedoc/variables/index.Envs.html +0 -2
  412. package/typedoc/variables/index.Local.html +0 -2
  413. package/typedoc/variables/index.Remote.html +0 -1
  414. package/typedoc/variables/index.Storage.html +0 -2
  415. package/typedoc/variables/index.createClientServices.html +0 -4
  416. package/typedoc/variables/index.fromAgent.html +0 -2
  417. package/typedoc/variables/index.fromHost.html +0 -2
  418. package/typedoc/variables/index.fromSocket.html +0 -2
  419. package/typedoc/variables/index.fromWorker.html +0 -2
  420. package/typedoc/variables/index.getUnixSocket.html +0 -1
  421. package/typedoc/variables/index.resolveRef.html +0 -1
  422. package/typedoc/variables/index.useMulticastObservable.html +0 -3
  423. package/typedoc/variables/worker.getWorkerServiceHost.html +0 -1
  424. package/typedoc/variables/worker.onconnect.html +0 -1
@@ -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, { useState, type FC, useEffect, useRef } 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 { type WithClientProviderProps } from './withClientProvider';\nimport { ClientProvider } from '../client';\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 StoryContext, type Decorator } from '@storybook/react';\nimport React, { createContext, type PropsWithChildren, 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 { performInvitation, TestBuilder } from '@dxos/client/testing';\nimport { log } from '@dxos/log';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientStory } from './context';\nimport { ClientProvider, type ClientProviderProps } from '../client';\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": ";;;;;;AAIA,cAAc;;;ACAd,SAASA,eAAeC,kBAAkB;AAG1C,SAASC,aAAa;AAOf,IAAMC,cAAcC,8BAAuCC,MAAAA;AA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,OAAO;AACT,WAAO,gBAAAvC,OAAA,cAACgD,eAAAA;MAAcT;MAAcU,oBAAoB,MAAMT,SAASU,MAAAA;;EACzE;AAEA,SAAO,gBAAAlD,OAAA,cAACmD,qBAAAA;IAAoBC,mBAAmBJ;KAAgBV,QAAAA;AACjE;AAEA,IAAMU,gBAAgB,CAAC,EAAET,MAAK,MAAiB;AAC7C,QAAM,EAAE/C,MAAM6D,SAASC,MAAK,IAC1Bf,iBAAiBgB,QAAQhB,QAAQ;IAAE/C,MAAM;IAAS6D,SAASG,OAAOjB,KAAAA;IAAQe,OAAOJ;EAAU;AAC7F,SACE,gBAAAlD,OAAA,cAACyD,OAAAA;IAAIC,MAAK;IAAQC,WAAU;KAC1B,gBAAA3D,OAAA,cAAC4D,MAAAA;IAAGD,WAAU;KAAwBnE,IAAAA,GACtC,gBAAAQ,OAAA,cAACyD,OAAAA;IAAIE,WAAU;KAAWN,OAAAA,GACzBC,SAAS,gBAAAtD,OAAA,cAAC6D,OAAAA;IAAIF,WAAU;KAA4CL,KAAAA,CAAAA;AAG3E;",
6
- "names": ["createContext", "useContext", "raise", "ClientStory", "createContext", "undefined", "useClientProvider", "useContext", "raise", "Error", "React", "useState", "useEffect", "useRef", "Client", "TestBuilder", "performInvitation", "registerSignalsRuntime", "faker", "ClientRepeater", "props", "component", "Component", "controls", "Controls", "count", "types", "createIdentity", "createSpace", "onSpaceCreated", "useEffect", "registerSignalsRuntime", "clients", "setClients", "useState", "spaceKey", "setSpaceKey", "testBuilder", "useRef", "TestBuilder", "timeout", "setTimeout", "Array", "map", "_", "Client", "services", "current", "createLocalClientServices", "Promise", "all", "client", "initialize", "halo", "space", "spaces", "create", "name", "faker", "commerce", "productName", "key", "slice", "flatMap", "performInvitation", "host", "guest", "clearTimeout", "length", "index", "ClientProvider", "id", "args", "React", "createContext", "useContext", "useEffect", "useRef", "useState", "ErrorBoundary", "NativeErrorBoundary", "Trigger", "performInvitation", "TestBuilder", "log", "initializeClient", "client", "createIdentity", "createSpace", "onSpaceCreated", "onIdentityCreated", "onInitialized", "context", "halo", "identity", "get", "space", "spaces", "create", "name", "withClientProvider", "props", "Story", "data", "setData", "useState", "handleInitialized", "React", "ErrorBoundary", "ClientProvider", "ClientStory", "Provider", "value", "MultiClientContext", "createContext", "id", "useMultiClient", "useContext", "withMultiClientProvider", "numClients", "builder", "useRef", "TestBuilder", "hostRef", "spaceReady", "Trigger", "index", "log", "info", "current", "wake", "wait", "Promise", "all", "performInvitation", "host", "guest", "Array", "from", "length", "map", "_", "key", "services", "createLocalClientServices", "children", "error", "setError", "useEffect", "handleError", "event", "reason", "window", "addEventListener", "removeEventListener", "ErrorFallback", "resetErrorBoundary", "undefined", "NativeErrorBoundary", "FallbackComponent", "message", "stack", "Error", "String", "div", "role", "className", "h1", "pre"]
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, type SpaceId } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\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 { random } from '@dxos/random';\nimport { useAsyncEffect } from '@dxos/react-hooks';\n\nimport { ClientProvider } from '../client';\nimport { type SpaceId } from '../echo';\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, type SpaceId } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\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;AAQf,IAAMC,cAAcH,8BAAuCI,MAAAA;AAE3D,IAAMC,iBAAiB,MAAA;AAC5B,SAAOJ,WAAWE,WAAAA,KAAgBD,MAAM,IAAII,MAAM,qBAAA,CAAA;AACpD;;;ACfA,OAAOC,SAAkBC,QAAQC,gBAAgB;AAEjD,SAASC,cAAc;AACvB,SAASC,aAAaC,yBAAyB;AAE/C,SAASC,cAAc;AACvB,SAASC,sBAAsB;AA+BxB,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,0BAAyB;MAAInB;IAAM,CAAA,CAAA;AAGvF,UAAMoB,QAAQC,IAAIjB,SAAQU,IAAI,CAACQ,WAAWA,OAAOC,WAAU,CAAA,CAAA;AAC3D,QAAItB,kBAAkBC,aAAa;AACj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ACnB,UAAQtB,GAAK;cAITN,EAAAA,MAAAA,IAAAA,MAAAA,iBAAAA,QAAAA;UACAY;UACAT;UACAU;UAEFR;UAGEyB;kBAAmBC;YAAOxB,KAAAA,YAAgByB;UAAG;UACjDX,SAAWf,OAAO0B;QAClBb,GAAAA,EAAAA,YAAWc,YAAa3B,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,OAAAA,CAAAA;AAC1B,mBAAO,OAAA,EAAA;AACL,mBAAA,QAAA,KAAoB,KAAA;aACpB;cAAiDO,iBAAAA,QAAAA;UAAiBR;UAE9DyB;kBAAkBC;AAAM,YAAA,KAAA,WAAA;UAC5B;QACA,GAAA,EAAA,YAAW,YAAA,GAAA,cAAA,GAAA,KAAA,GAAA,OAAA,CAAA;cACTG,QAAS,MAAA,WAAW,QAAA,KAAA;mBAAEH;cAAOxB,KAAAA,WAAeyB;YAAG;YAC/C,SAAMG,MACJC;2BACQ9B,YAAAA,GAAAA,cAAAA,GAAAA,KAAAA,GAAAA,OAAAA,CAAAA;gBACN+B,QAAOjC,IAAOkC,mBAAM;YACtB,MAAA;YAEJ,OAAA,OAAA;UACF,CAAA,CAAA;QACG;MAEL;QACOC,CAAAA;WACWnC,gBAAAA,OAAQ2B,cAAAA,OACpB;iBACOA;eACLF,IAAAA,CAAAA,QAAUzB,UAAe,gBAAAW,OAAA,cAAA,gBAAA;MACzBF,KAAAA;MACC,UAAQ,OAAA;qBAET,CAAAT,YAAA,kBAACoC,SAAYC,KAAQ;MAACxB,GAAAA;OAASc,gBAAAA,OAAAA,cAAAA,YAAAA,UAAAA;aAAOxB;QAAQ;;MAC7BmC;OACb,gBAAA3B,OAAA,cAACG,eAAAA;MAOf,MAAA;IACA,GAAA,gBAAAH,OAAA,cAAA,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,5 +1,5 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
 
3
- // packages/sdk/react-client/src/worker.ts
3
+ // src/worker.ts
4
4
  export * from "@dxos/client/worker";
5
5
  //# sourceMappingURL=worker.mjs.map
@@ -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,GAAI,QAAQ,MAAM,SAQzC,CAAC"}
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,EAAiB,KAAK,iBAAiB,EAAwB,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,GAAI,OAAO,iBAAiB,sBAM5D,CAAC;AAEF,eAAO,MAAM,qBAAqB,yCAEjC,CAAC"}
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, "services" | "config"> & Pick<ClientContextProps, "status"> & {
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,EAEZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,EAAgB,MAAM,cAAc,CAAC;AACrG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAyB,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC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C,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,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,GAAI,QAAQ,MAAM,oCAY7C,CAAC"}
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,EAAE,eAAe,MAAM,MAAM,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,OAAM,cAAmB,KAAG,CAmBzG,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,10 @@
1
1
  export * from '@dxos/client/echo';
2
+ export * from '@dxos/echo-react';
2
3
  export * from './useMembers';
3
- export * from './useQuery';
4
4
  export * from './useQueue';
5
- export * from './useSchema';
6
5
  export * from './useSpaces';
7
6
  export * from './useSpaceInvitations';
7
+ export * from './useSpaceProperties';
8
8
  export * from './useSubscription';
9
9
  export * from './useSyncState';
10
10
  //# 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;AAElC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,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,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type PublicKey } from '@dxos/client';
1
+ import { type PublicKeyLike } from '@dxos/client';
2
2
  import { type SpaceMember } from '@dxos/client/echo';
3
- export declare const useMembers: (spaceKey: PublicKey | undefined) => SpaceMember[];
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,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKtE,eAAO,MAAM,UAAU,GAAI,UAAU,SAAS,GAAG,SAAS,KAAG,WAAW,EAQvE,CAAC"}
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"}
@@ -1,11 +1,12 @@
1
1
  import { type Queue } from '@dxos/client/echo';
2
- import { type Obj, type Relation } from '@dxos/echo';
2
+ import { type Entity } from '@dxos/echo';
3
3
  import { type DXN } from '@dxos/keys';
4
4
  export type UseQueueOptions = {
5
5
  pollInterval?: number;
6
6
  };
7
7
  /**
8
8
  * Polls the given Edge queue.
9
+ * @deprecated Use `useQuery` instead.
9
10
  */
10
- export declare const useQueue: <T extends Obj.Any | Relation.Any>(queueDxn?: DXN, options?: UseQueueOptions) => Queue<T> | undefined;
11
+ export declare const useQueue: <T extends Entity.Unknown>(queueDxn?: DXN, options?: UseQueueOptions) => Queue<T> | undefined;
11
12
  //# sourceMappingURL=useQueue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQueue.d.ts","sourceRoot":"","sources":["../../../../src/echo/useQueue.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAMtC,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AAKH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,EACvD,WAAW,GAAG,EACd,UAAS,eAAoB,KAC5B,KAAK,CAAC,CAAC,CAAC,GAAG,SA4Cb,CAAC"}
1
+ {"version":3,"file":"useQueue.d.ts","sourceRoot":"","sources":["../../../../src/echo/useQueue.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAMtC,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AAGH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,OAAO,aACpC,GAAG,YACL,eAAe,KACvB,KAAK,CAAC,CAAC,CAAC,GAAG,SA4Cb,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type PublicKey } from '@dxos/client';
2
+ import { type SpaceId } from '@dxos/client/echo';
2
3
  import { type CancellableInvitationObservable } from '../invitations';
3
- export declare const useSpaceInvitations: (spaceKey?: PublicKey) => CancellableInvitationObservable[];
4
- export declare const useSpaceInvitation: (spaceKey?: PublicKey, invitationId?: string) => import("../invitations").InvitationStatus;
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;AAI9C,OAAO,EAAE,KAAK,+BAA+B,EAAuB,MAAM,gBAAgB,CAAC;AAE3F,eAAO,MAAM,mBAAmB,GAAI,WAAW,SAAS,KAAG,+BAA+B,EAGzF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,WAAW,SAAS,EAAE,eAAe,MAAM,8CAO7E,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,mBAAmB,CAAC;AAGjD,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"}
@@ -0,0 +1,13 @@
1
+ import { type SpaceProperties } from '@dxos/client/echo';
2
+ import { type Key, type Obj } from '@dxos/echo';
3
+ import { type ObjectUpdateCallback } from '@dxos/echo-react';
4
+ /**
5
+ * Subscribe to a space's properties with reactive updates.
6
+ * Returns undefined if the space is undefined or not ready yet.
7
+ * Automatically waits for the space to be ready before returning properties.
8
+ *
9
+ * @param spaceId - The space ID to get properties from (can be undefined).
10
+ * @returns A tuple of [snapshot, updateCallback] or [undefined, no-op] if not ready.
11
+ */
12
+ export declare const useSpaceProperties: (spaceId: Key.SpaceId | undefined) => [Obj.Snapshot<SpaceProperties> | undefined, ObjectUpdateCallback<SpaceProperties>];
13
+ //# sourceMappingURL=useSpaceProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSpaceProperties.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSpaceProperties.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,KAAK,oBAAoB,EAAa,MAAM,kBAAkB,CAAC;AAKxE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,YACpB,GAAG,CAAC,OAAO,GAAG,SAAS,KAC/B,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,SAAS,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAKnF,CAAC"}
@@ -1,15 +1,25 @@
1
- import { type PublicKeyLike } from '@dxos/client';
2
- import { type Space } from '@dxos/client/echo';
1
+ import { PublicKey } from '@dxos/client';
2
+ import { type Space, type SpaceId } from '@dxos/client/echo';
3
3
  /**
4
- * Get a specific Space using its key.
4
+ * Get a specific Space using its id.
5
5
  * The space is not guaranteed to be in the ready state.
6
- * Returns the default space if no key is provided.
6
+ * Returns undefined if no id is provided.
7
7
  * Requires a ClientProvider somewhere in the parent tree.
8
8
  *
9
- * @param spaceKeyLike the key of the space to look for
9
+ * @param spaceId the id of the space to look for.
10
10
  */
11
- export declare const useSpace: (spaceKeyLike?: PublicKeyLike) => Space | undefined;
12
- export type UseSpacesParams = {
11
+ export declare const useSpace: (spaceId?: SpaceId | PublicKey) => Space | undefined;
12
+ /**
13
+ * Get a Space database by the id of the space.
14
+ * The space is not guaranteed to be in the ready state.
15
+ * Returns undefined if no id is provided.
16
+ * Requires a ClientProvider somewhere in the parent tree.
17
+ *
18
+ * @param spaceId the id of the space to look for.
19
+ * @deprecated Use useSpace.
20
+ */
21
+ export declare const useDatabase: (spaceId?: SpaceId) => Space['db'] | undefined;
22
+ export type UseSpacesProps = {
13
23
  /**
14
24
  * Return uninitialized spaces as well.
15
25
  */
@@ -19,7 +29,7 @@ export type UseSpacesParams = {
19
29
  * Get all Spaces available to current user.
20
30
  * Requires a ClientProvider somewhere in the parent tree.
21
31
  * By default, only ready spaces are returned.
22
- * @returns an array of Spaces
32
+ * @returns an array of Spaces.
23
33
  */
24
- export declare const useSpaces: ({ all }?: UseSpacesParams) => Space[];
34
+ export declare const useSpaces: ({ all }?: UseSpacesProps) => Space[];
25
35
  //# sourceMappingURL=useSpaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSpaces.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSpaces.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,mBAAmB,CAAC;AAK3D;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,eAAe,aAAa,KAAG,KAAK,GAAG,SA0B/D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,UAAiB,eAAoB,KAAG,KAAK,EAMtE,CAAC"}
1
+ {"version":3,"file":"useSpaces.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSpaces.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAc,MAAM,mBAAmB,CAAC;AAKzE;;;;;;;GAOG;AAGH,eAAO,MAAM,QAAQ,aAAc,OAAO,GAAG,SAAS,KAAG,KAAK,GAAG,SAchE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,aAAc,OAAO,KAAG,KAAK,CAAC,IAAI,CAAC,GAAG,SAG7D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,aAAqB,cAAc,KAAQ,KAAK,EAMrE,CAAC"}
@@ -3,5 +3,5 @@ import { type Selection, type SubscriptionHandle } from '@dxos/client/echo';
3
3
  * Create reactive selection.
4
4
  * Calls the callback when the selection changes and during the first render.
5
5
  */
6
- export declare const useSubscription: (cb: () => void, selection: Selection) => SubscriptionHandle | undefined;
6
+ export declare const useSubscription: (cb: () => void, selection: Selection) => SubscriptionHandle | null;
7
7
  //# sourceMappingURL=useSubscription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSubscription.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSubscription.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAsB,MAAM,mBAAmB,CAAC;AAEhG;;;GAGG;AAEH,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,IAAI,EAAE,WAAW,SAAS,mCAmBnE,CAAC"}
1
+ {"version":3,"file":"useSubscription.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSubscription.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAsB,MAAM,mBAAmB,CAAC;AAEhG;;;GAGG;AAEH,eAAO,MAAM,eAAe,OAAQ,MAAM,IAAI,aAAa,SAAS,8BAmBnE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type PeerSyncState, type SpaceSyncStateMap, type Space } from '@dxos/client/echo';
1
+ import { type PeerSyncState, type Space, type SpaceSyncStateMap } from '@dxos/client/echo';
2
2
  /**
3
3
  * Hook Subscribes to sync state for each space.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useSyncState.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSyncState.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAU3F;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,iBAkC/B,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,KAAG,aAAa,GAAG,SAkBhE,CAAC"}
1
+ {"version":3,"file":"useSyncState.d.ts","sourceRoot":"","sources":["../../../../src/echo/useSyncState.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAW3F;;GAEG;AACH,eAAO,MAAM,YAAY,QAAO,iBAkC/B,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,iBAAiB,UAAW,KAAK,KAAG,aAAa,GAAG,SAkBhE,CAAC"}
@@ -1,11 +1,11 @@
1
- import '@dxos-theme';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
2
  import React from 'react';
3
- declare const _default: {
3
+ declare const meta: {
4
4
  title: string;
5
5
  render: () => React.JSX.Element;
6
- };
7
- export default _default;
8
- export declare const Default: {
9
6
  decorators: import("@storybook/react").Decorator[];
10
7
  };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
11
11
  //# sourceMappingURL=Passkey.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Passkey.stories.d.ts","sourceRoot":"","sources":["../../../../src/halo/Passkey.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAsB,MAAM,OAAO,CAAC;;;;;AAyH3C,wBAGE;AAsBF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
1
+ {"version":3,"file":"Passkey.stories.d.ts","sourceRoot":"","sources":["../../../../src/halo/Passkey.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAsB,MAAM,OAAO,CAAC;AA2I3C,QAAA,MAAM,IAAI;;;;CAIM,CAAC;eAEF,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useHaloInvitations.d.ts","sourceRoot":"","sources":["../../../../src/halo/useHaloInvitations.ts"],"names":[],"mappings":"AASA,OAAO,EAAuB,KAAK,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAE3F,eAAO,MAAM,kBAAkB,QAAO,+BAA+B,EAGpE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,eAAe,MAAM,8CAOtD,CAAC"}
1
+ {"version":3,"file":"useHaloInvitations.d.ts","sourceRoot":"","sources":["../../../../src/halo/useHaloInvitations.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,+BAA+B,EAAuB,MAAM,gBAAgB,CAAC;AAE3F,eAAO,MAAM,kBAAkB,QAAO,+BAA+B,EAGpE,CAAC;AAEF,eAAO,MAAM,iBAAiB,kBAAmB,MAAM,8CAOtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyStore.d.ts","sourceRoot":"","sources":["../../../../src/halo/useKeyStore.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAQ;IAGP,OAAO,CAAC,QAAQ,CAAC,YAAY;IAFzC,OAAO,CAAC,OAAO,CAA6B;gBAEf,YAAY,GAAE,MAAM,EAAO;IAExD,IAAI,GAAG,wBAEN;IAGD,UAAU,IAAI,IAAI;IASlB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIzB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAIzC;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GACtB,cAAa,MAAM,EAAO,KACzB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAS5D,CAAC"}
1
+ {"version":3,"file":"useKeyStore.d.ts","sourceRoot":"","sources":["../../../../src/halo/useKeyStore.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAQ;IAGP,OAAO,CAAC,QAAQ,CAAC,YAAY;IAFzC,OAAO,CAAC,OAAO,CAA6B;IAE5C,YAA6B,YAAY,GAAE,MAAM,EAAO,EAAI;IAE5D,IAAI,GAAG,wBAEN;IAGD,UAAU,IAAI,IAAI,CAOjB;IAED,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAExB;IAED,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAGvC;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,iBACT,MAAM,EAAE,KACpB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAS5D,CAAC"}
@@ -36,7 +36,7 @@ export type InvitationStatus = {
36
36
  multiUse?: boolean;
37
37
  shareable?: boolean;
38
38
  result: InvitationResult;
39
- error?: number;
39
+ error?: Error;
40
40
  cancel(): void;
41
41
  connect(observable: CancellableInvitationObservable): void;
42
42
  authenticate(authCode: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"useInvitationStatus.d.ts","sourceRoot":"","sources":["../../../../src/invitations/useInvitationStatus.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAEL,KAAK,+BAA+B,EACpC,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAeF,KAAK,iBAAiB,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GACxB,CAAC;IACC,MAAM,EACF,UAAU,CAAC,KAAK,CAAC,IAAI,GACrB,UAAU,CAAC,KAAK,CAAC,SAAS,GAC1B,UAAU,CAAC,KAAK,CAAC,wBAAwB,GACzC,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC;CACrC,GAAG,iBAAiB,CAAC,GACtB,CAAC;IACC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC;IACpC,UAAU,EAAE,+BAA+B,CAAC;CAC7C,GAAG,iBAAiB,CAAC,GACtB,CAAC;IACC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC;IACjC,MAAM,EAAE,gBAAgB,CAAC;CAC1B,GAAG,iBAAiB,CAAC,GACtB,CAAC;IACC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC;IAC9D,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;CAC5B,GAAG,iBAAiB,CAAC,GACtB;IACE,MAAM,EAAE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AE,UAAU,CAAC,KAAK,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IAEf,OAAO,CAAC,UAAU,EAAE,+BAA+B,GAAG,IAAI,CAAC;IAC3D,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C,CAAC;AAOF,eAAO,MAAM,mBAAmB,gBAAiB,+BAA+B,KAAG,gBA4HlF,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import React, { type FC } from 'react';
2
- import { Client, type PublicKey } from '@dxos/client';
3
- import { type TypedObject } from '@dxos/echo-schema';
2
+ import { Client } from '@dxos/client';
3
+ import { type Type } from '@dxos/echo';
4
+ import { type SpaceId } from '../echo';
4
5
  import { type WithClientProviderProps } from './withClientProvider';
5
6
  export type ClientRepeatedComponentProps = {
6
7
  id: number;
7
8
  count: number;
8
- spaceKey?: PublicKey;
9
+ spaceId?: SpaceId;
9
10
  };
10
11
  export type ClientRepeaterControlsProps = {
11
12
  clients: Client[];
@@ -16,9 +17,9 @@ export type ClientRepeaterProps<P extends ClientRepeatedComponentProps> = {
16
17
  controls?: FC<ClientRepeaterControlsProps>;
17
18
  count?: number;
18
19
  clients?: Client[];
19
- types?: TypedObject[];
20
+ types?: Type.AnyObj[];
20
21
  args?: Omit<P, 'id' | 'count'>;
21
- } & Pick<WithClientProviderProps, 'createIdentity' | 'createSpace' | 'onSpaceCreated'>;
22
+ } & Pick<WithClientProviderProps, 'createIdentity' | 'createSpace' | 'onCreateSpace'>;
22
23
  /**
23
24
  * Utility component for Storybook stories which sets up clients for n peers.
24
25
  * The `Component` property is rendered n times, once for each peer.
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRepeater.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRep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KAAK,EAAE,EAAoB,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAKvC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,MAAM,MAAM,4BAA4B,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5F,MAAM,MAAM,2BAA2B,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAGhE,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,4BAA4B,IAAI;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,EAAE,CAAC,4BAA4B,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;CAChC,GAAG,IAAI,CAAC,uBAAuB,EAAE,gBAAgB,GAAG,aAAa,GAAG,eAAe,CAAC,CAAC;AAEtF;;;;GAIG;AAMH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,4BAA4B,SAAS,mBAAmB,CAAC,CAAC,CAAC,6BAkDnG,CAAC"}
@@ -1,14 +1,10 @@
1
- import '@dxos-theme';
2
- import React from 'react';
3
- declare const _default: {
1
+ import { type StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
4
3
  title: string;
5
4
  decorators: import("@storybook/react").Decorator[];
6
5
  };
7
- export default _default;
8
- export declare const Default: {
9
- render: () => React.JSX.Element;
10
- };
11
- export declare const Space: {
12
- render: () => React.JSX.Element;
13
- };
6
+ export default meta;
7
+ type Story = StoryObj<typeof meta>;
8
+ export declare const Default: Story;
9
+ export declare const Space: Story;
14
10
  //# sourceMappingURL=ClientRepeater.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRepeater.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;AAU1B,wBAGE;AAgCF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC"}
1
+ {"version":3,"file":"ClientRepeater.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAYjE,QAAA,MAAM,IAAI;;;CAGoB,CAAC;eAEhB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAkCnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC"}
@@ -1,7 +1,9 @@
1
- import { type Space } from '@dxos/client/echo';
1
+ import { type Space, type SpaceId } from '@dxos/client/echo';
2
2
  export type ClientStory = {
3
+ index?: number;
4
+ spaceId?: SpaceId;
3
5
  space?: Space;
4
6
  };
5
7
  export declare const ClientStory: import("react").Context<ClientStory | undefined>;
6
- export declare const useClientProvider: () => ClientStory;
8
+ export declare const useClientStory: () => ClientStory;
7
9
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/testing/context.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAGF,eAAO,MAAM,WAAW,kDAAoD,CAAC;AAE7E,eAAO,MAAM,iBAAiB,QAAO,WAEpC,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/testing/context.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,WAAW,kDAAoD,CAAC;AAE7E,eAAO,MAAM,cAAc,QAAO,WAEjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/testing/util.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,YAAY,GAAU,2CAIhC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO;;;EAc3E,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAU,QAAQ,MAAM,4BACxC,GAAG,uBAC1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,QAAQ,MAAM,4BACjC,GAAG,uBAC1B,CAAC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/testing/util.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,YAAY,8CAItB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE;;;EAatE,CAAC;AAEF,eAAO,MAAM,2BAA2B,WAAkB,MAAM,4BACxC,GAAG,uBAC1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAkB,MAAM,4BACjC,GAAG,uBAC1B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type StoryContext, type Decorator } from '@storybook/react';
1
+ import { type Decorator, type StoryContext } from '@storybook/react';
2
2
  import { type Client } from '@dxos/client';
3
3
  import { type Space } from '@dxos/client/echo';
4
4
  import { type MaybePromise } from '@dxos/util';
@@ -7,10 +7,10 @@ type InitializeProps = {
7
7
  createIdentity?: boolean;
8
8
  createSpace?: boolean;
9
9
  onInitialized?: (client: Client) => MaybePromise<void>;
10
- onIdentityCreated?: (props: {
10
+ onCreateIdentity?: (props: {
11
11
  client: Client;
12
- }) => MaybePromise<void>;
13
- onSpaceCreated?: (props: {
12
+ }, context: StoryContext | any) => MaybePromise<void>;
13
+ onCreateSpace?: (props: {
14
14
  client: Client;
15
15
  space: Space;
16
16
  }, context: StoryContext | any) => MaybePromise<void>;
@@ -19,18 +19,14 @@ export type WithClientProviderProps = InitializeProps & Omit<ClientProviderProps
19
19
  /**
20
20
  * Decorator that provides the client context.
21
21
  */
22
- export declare const withClientProvider: ({ createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized, ...props }?: WithClientProviderProps) => Decorator;
22
+ export declare const withClientProvider: ({ createIdentity, createSpace, onCreateSpace, onCreateIdentity, onInitialized, ...props }?: WithClientProviderProps) => Decorator;
23
23
  export type WithMultiClientProviderProps = InitializeProps & Omit<ClientProviderProps, 'onInitialized'> & {
24
24
  numClients?: number;
25
25
  };
26
- export declare const useMultiClient: () => {
27
- id: number;
28
- };
29
26
  /**
30
27
  * Decorator that creates a scaffold for multiple clients.
31
28
  * Orchestrates invitations between a randomly selected host and the remaining clients.
32
- * NOTE: Should come before withLayout.
33
29
  */
34
- export declare const withMultiClientProvider: ({ numClients, createIdentity, createSpace, onSpaceCreated, onIdentityCreated, onInitialized, ...props }: WithMultiClientProviderProps) => Decorator;
30
+ export declare const withMultiClientProvider: ({ numClients, createIdentity, createSpace, onCreateSpace, onCreateIdentity, onInitialized, ...props }: WithMultiClientProviderProps) => Decorator;
35
31
  export {};
36
32
  //# sourceMappingURL=withClientProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/testing/withClientProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKrE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErE,KAAK,eAAe,GAAG;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IACvD,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAEtE,cAAc,CAAC,EAAE,CAAC,KAAK,EA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AAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,YAAY,GAAG,GAAG,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAElG,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,EAAE,OAAO,EAAE,YAAY,GAAG,GAAG,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;CAC9G,CAAC;AA6BF,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;AAEnG;;GAEG;AACH,eAAO,MAAM,kBAAkB,+FAO5B,uBAAuB,KAAQ,SA6BjC,CAAC;AAKF,MAAM,MAAM,4BAA4B,GAAG,eAAe,GACxD,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,0GAQjC,4BAA4B,KAAG,SAuEjC,CAAC"}
@@ -1,14 +1,13 @@
1
- import '@dxos-theme';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
2
  import React from 'react';
3
- declare const _default: {
3
+ declare const meta: {
4
4
  title: string;
5
- render: () => React.JSX.Element | null;
6
- };
7
- export default _default;
8
- export declare const Default: {
9
- decorators: import("@storybook/react").Decorator[];
10
- };
11
- export declare const Multiple: {
5
+ render: () => React.JSX.Element;
12
6
  decorators: import("@storybook/react").Decorator[];
7
+ tags: string[];
13
8
  };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
12
+ export declare const Multiple: Story;
14
13
  //# sourceMappingURL=withClientProvider.stories.d.ts.map