@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 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/devtools/index.ts", "../../../../src/devtools/useDevtools.ts", "../../../../src/devtools/useStream.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/client/devtools';\n\nexport * from './useDevtools';\nexport * from './useStream';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { type DevtoolsHost } from '@dxos/client/devtools';\nimport { raise } from '@dxos/debug';\n\nimport { useClient } from '../client';\n\nexport const useDevtools = (): DevtoolsHost => {\n const client = useClient();\n return client.services.services.DevtoolsHost ?? raise(new Error('DevtoolsHost not available.'));\n};\n", "//\n// Copyright 2021 DXOS.org\n//\n\nimport { type DependencyList, useState, useEffect } from 'react';\n\nimport { type Stream } from '@dxos/codec-protobuf/stream';\nimport { log } from '@dxos/log';\n\n/**\n * Subscribe to service API streams.\n */\nexport const useStream = <T>(streamFactory: () => Stream<T>, defaultValue: T, deps: DependencyList = []): T => {\n const [value, setValue] = useState<T | undefined>(defaultValue);\n useEffect(() => {\n const stream = streamFactory();\n stream.subscribe(\n (response: T) => setValue(response),\n (err) => {\n if (err) {\n log.catch(err);\n }\n },\n );\n\n return () => {\n void stream.close();\n };\n }, deps);\n\n return value ?? defaultValue;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,6BAAc;ACCd,mBAAsB;ACDtB,mBAAyD;AAGzD,iBAAoB;ADEb,IAAMA,cAAc,MAAA;AACzB,QAAMC,aAASC,iCAAAA;AACf,SAAOD,OAAOE,SAASA,SAASC,oBAAgBC,oBAAM,IAAIC,MAAM,6BAAA,CAAA;AAClE;;ACAO,IAAMC,YAAY,CAAIC,eAAgCC,cAAiBC,OAAuB,CAAA,MAAE;AACrG,QAAM,CAACC,OAAOC,QAAAA,QAAYC,uBAAwBJ,YAAAA;AAClDK,8BAAU,MAAA;AACR,UAAMC,SAASP,cAAAA;AACfO,WAAOC,UACL,CAACC,aAAgBL,SAASK,QAAAA,GAC1B,CAACC,QAAAA;AACC,UAAIA,KAAK;AACPC,uBAAIC,MAAMF,KAAAA,QAAAA;;;;;;MACZ;IACF,CAAA;AAGF,WAAO,MAAA;AACL,WAAKH,OAAOM,MAAK;IACnB;EACF,GAAGX,IAAAA;AAEH,SAAOC,SAASF;AAClB;",
6
- "names": ["useDevtools", "client", "useClient", "services", "DevtoolsHost", "raise", "Error", "useStream", "streamFactory", "defaultValue", "deps", "value", "setValue", "useState", "useEffect", "stream", "subscribe", "response", "err", "log", "catch", "close"]
7
- }
@@ -1,302 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var echo_exports = {};
21
- __export(echo_exports, {
22
- useMembers: () => useMembers,
23
- useQuery: () => useQuery,
24
- useQueue: () => useQueue,
25
- useSchema: () => useSchema,
26
- useSpace: () => useSpace,
27
- useSpaceInvitation: () => useSpaceInvitation,
28
- useSpaceInvitations: () => useSpaceInvitations,
29
- useSpaceSyncState: () => useSpaceSyncState,
30
- useSpaces: () => useSpaces,
31
- useSubscription: () => useSubscription,
32
- useSyncState: () => useSyncState
33
- });
34
- module.exports = __toCommonJS(echo_exports);
35
- var import_chunk_FYOAVV65 = require("../chunk-FYOAVV65.cjs");
36
- var import_chunk_5RUIFUEC = require("../chunk-5RUIFUEC.cjs");
37
- __reExport(echo_exports, require("@dxos/client/echo"), module.exports);
38
- var import_async = require("@dxos/async");
39
- var import_echo = require("@dxos/client/echo");
40
- var import_react_hooks = require("@dxos/react-hooks");
41
- var import_react = require("react");
42
- var import_echo2 = require("@dxos/client/echo");
43
- var import_react_hooks2 = require("@dxos/react-hooks");
44
- var import_react2 = require("react");
45
- var import_echo3 = require("@dxos/client/echo");
46
- var import_react3 = require("react");
47
- var import_debug = require("@dxos/debug");
48
- var import_react4 = require("react");
49
- var import_react5 = require("react");
50
- var import_async2 = require("@dxos/async");
51
- var import_react_hooks3 = require("@dxos/react-hooks");
52
- var import_react6 = require("react");
53
- var import_echo4 = require("@dxos/client/echo");
54
- var import_react7 = require("react");
55
- var import_context = require("@dxos/context");
56
- var import_protocols = require("@dxos/protocols");
57
- var useSpace = (spaceKeyLike) => {
58
- const client = (0, import_chunk_5RUIFUEC.useClient)();
59
- const spaces = (0, import_react_hooks2.useMulticastObservable)(client.spaces);
60
- const [ready, setReady] = (0, import_react.useState)(false);
61
- (0, import_react.useEffect)(() => {
62
- if (spaceKeyLike) {
63
- return;
64
- }
65
- const timeout = setTimeout(async () => {
66
- await client.spaces.waitUntilReady();
67
- setReady(true);
68
- });
69
- return () => clearTimeout(timeout);
70
- }, [
71
- client,
72
- spaceKeyLike
73
- ]);
74
- if (spaceKeyLike) {
75
- return spaces.find((space) => space.key.equals(spaceKeyLike) || space.id === spaceKeyLike);
76
- }
77
- if (ready && client.halo.identity.get()) {
78
- return client.spaces.default;
79
- }
80
- };
81
- var useSpaces = ({ all = false } = {}) => {
82
- const client = (0, import_chunk_5RUIFUEC.useClient)();
83
- const spaces = (0, import_react_hooks2.useMulticastObservable)(client.spaces);
84
- return spaces.filter((space) => all || space.state.get() === import_echo2.SpaceState.SPACE_READY);
85
- };
86
- var useMembers = (spaceKey) => {
87
- const spaces = useSpaces({
88
- all: true
89
- });
90
- const space = spaceKey ? spaces.find((space2) => space2.key.equals(spaceKey)) : void 0;
91
- const members = (0, import_react_hooks.useMulticastObservable)(space?.members ?? import_async.MulticastObservable.empty()) ?? [];
92
- return members.filter((member) => member.role !== import_echo.HaloSpaceMember.Role.REMOVED);
93
- };
94
- var EMPTY_ARRAY = [];
95
- var noop = () => {
96
- };
97
- var useQuery = (spaceOrEcho, queryOrFilter, deps) => {
98
- const query = import_echo3.Filter.is(queryOrFilter) ? import_echo3.Query.select(queryOrFilter) : queryOrFilter;
99
- const { getObjects, subscribe } = (0, import_react2.useMemo)(() => {
100
- let subscribed = false;
101
- const queryResult = spaceOrEcho === void 0 ? void 0 : (0, import_echo3.isSpace)(spaceOrEcho) ? spaceOrEcho.db.query(query) : spaceOrEcho.query(query);
102
- return {
103
- getObjects: () => subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY,
104
- subscribe: (cb) => {
105
- subscribed = true;
106
- const unsubscribe = queryResult?.subscribe(cb) ?? noop;
107
- return () => {
108
- unsubscribe?.();
109
- subscribed = false;
110
- };
111
- }
112
- };
113
- }, [
114
- spaceOrEcho,
115
- JSON.stringify(query.ast),
116
- ...deps ?? []
117
- ]);
118
- const objects = (0, import_react2.useSyncExternalStore)(subscribe, getObjects);
119
- return objects ?? [];
120
- };
121
- var MIN_POLL_INTERVAL = 1e3;
122
- var useQueue = (queueDxn, options = {}) => {
123
- const client = (0, import_chunk_5RUIFUEC.useClient)();
124
- const mountedRef = (0, import_react3.useRef)(true);
125
- const queue = (0, import_react3.useMemo)(() => {
126
- if (!queueDxn) {
127
- return void 0;
128
- }
129
- const { spaceId } = queueDxn.asQueueDXN() ?? (0, import_debug.raise)(new TypeError("Invalid queue DXN"));
130
- return client.spaces.get(spaceId)?.queues.get(queueDxn);
131
- }, [
132
- client,
133
- queueDxn?.toString()
134
- ]);
135
- (0, import_react3.useEffect)(() => {
136
- void queue?.refresh();
137
- }, [
138
- queue
139
- ]);
140
- (0, import_react3.useEffect)(() => {
141
- let timeout;
142
- mountedRef.current = true;
143
- const poll = () => {
144
- if (!mountedRef.current) {
145
- return;
146
- }
147
- void queue?.refresh().finally(() => {
148
- if (mountedRef.current && options.pollInterval) {
149
- timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));
150
- }
151
- });
152
- };
153
- if (options.pollInterval) {
154
- poll();
155
- }
156
- return () => {
157
- mountedRef.current = false;
158
- clearTimeout(timeout);
159
- };
160
- }, [
161
- queue,
162
- options.pollInterval
163
- ]);
164
- return queue;
165
- };
166
- var useSchema = (client, space, typename) => {
167
- const { subscribe, getSchema } = (0, import_react4.useMemo)(() => {
168
- if (!typename || !space) {
169
- return {
170
- subscribe: () => () => {
171
- },
172
- getSchema: () => void 0
173
- };
174
- }
175
- const staticSchema = client.graph.schemaRegistry.getSchema(typename);
176
- if (staticSchema) {
177
- return {
178
- subscribe: () => () => {
179
- },
180
- getSchema: () => staticSchema
181
- };
182
- }
183
- const query = space.db.schemaRegistry.query({
184
- typename
185
- });
186
- const initialResult = query.runSync()[0];
187
- let currentSchema = initialResult;
188
- return {
189
- subscribe: (onStoreChange) => {
190
- const unsubscribe = query.subscribe(() => {
191
- currentSchema = query.results[0];
192
- onStoreChange();
193
- });
194
- return unsubscribe;
195
- },
196
- getSchema: () => currentSchema
197
- };
198
- }, [
199
- typename,
200
- space
201
- ]);
202
- return (0, import_react4.useSyncExternalStore)(subscribe, getSchema);
203
- };
204
- var useSpaceInvitations = (spaceKey) => {
205
- const space = useSpace(spaceKey);
206
- return (0, import_react_hooks3.useMulticastObservable)(space?.invitations ?? import_async2.MulticastObservable.empty()) ?? [];
207
- };
208
- var useSpaceInvitation = (spaceKey, invitationId) => {
209
- const invitations = useSpaceInvitations(spaceKey);
210
- const invitation = (0, import_react5.useMemo)(() => invitations.find((invitation2) => invitation2.get().invitationId === invitationId), [
211
- invitations
212
- ]);
213
- return (0, import_chunk_FYOAVV65.useInvitationStatus)(invitation);
214
- };
215
- var useSubscription = (cb, selection) => {
216
- const callbackRef = (0, import_react6.useRef)(cb);
217
- callbackRef.current = cb;
218
- const subscriptionRef = (0, import_react6.useRef)();
219
- (0, import_react6.useEffect)(() => {
220
- subscriptionRef.current = (0, import_echo4.createSubscription)(() => {
221
- callbackRef.current();
222
- });
223
- return () => subscriptionRef.current?.unsubscribe();
224
- }, []);
225
- subscriptionRef.current?.update(selection);
226
- return subscriptionRef.current;
227
- };
228
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/react-client/src/echo/useSyncState.ts";
229
- var isEdgePeerId = (peerId, spaceId) => peerId.startsWith(`${import_protocols.EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);
230
- var useSyncState = () => {
231
- const client = (0, import_chunk_5RUIFUEC.useClient)();
232
- const [spaceState, setSpaceState] = (0, import_react7.useState)({});
233
- (0, import_react7.useEffect)(() => {
234
- const ctx = new import_context.Context(void 0, {
235
- F: __dxlog_file,
236
- L: 25
237
- });
238
- const createSubscriptions = (spaces) => {
239
- for (const space of spaces) {
240
- if (spaceState[space.id]) {
241
- continue;
242
- }
243
- ctx.onDispose(space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
244
- const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
245
- if (syncState) {
246
- setSpaceState((spaceState2) => ({
247
- ...spaceState2,
248
- [space.id]: syncState
249
- }));
250
- }
251
- }));
252
- }
253
- };
254
- createSubscriptions(client.spaces.get());
255
- client.spaces.subscribe((spaces) => {
256
- createSubscriptions(spaces);
257
- });
258
- return () => {
259
- void ctx.dispose();
260
- };
261
- }, [
262
- client
263
- ]);
264
- return spaceState;
265
- };
266
- var useSpaceSyncState = (space) => {
267
- const [spaceState, setSpaceState] = (0, import_react7.useState)();
268
- (0, import_react7.useEffect)(() => {
269
- const ctx = new import_context.Context(void 0, {
270
- F: __dxlog_file,
271
- L: 64
272
- });
273
- space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {
274
- const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));
275
- if (syncState) {
276
- setSpaceState(syncState);
277
- }
278
- });
279
- return () => {
280
- void ctx.dispose();
281
- };
282
- }, [
283
- space
284
- ]);
285
- return spaceState;
286
- };
287
- // Annotate the CommonJS export names for ESM import in node:
288
- 0 && (module.exports = {
289
- useMembers,
290
- useQuery,
291
- useQueue,
292
- useSchema,
293
- useSpace,
294
- useSpaceInvitation,
295
- useSpaceInvitations,
296
- useSpaceSyncState,
297
- useSpaces,
298
- useSubscription,
299
- useSyncState,
300
- ...require("@dxos/client/echo")
301
- });
302
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useQuery.ts", "../../../../src/echo/useQueue.ts", "../../../../src/echo/useSchema.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSubscription.ts", "../../../../src/echo/useSyncState.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useQueue';\nexport * from './useSchema';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\nexport * from './useSyncState';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { HaloSpaceMember, type SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpaces } from './useSpaces';\n\nexport const useMembers = (spaceKey: PublicKey | undefined): SpaceMember[] => {\n // TODO(dmaretskyi): useSpace hook for spaces that are not ready.\n const spaces = useSpaces({ all: true });\n const space = spaceKey ? spaces.find((space) => space.key.equals(spaceKey)) : undefined;\n\n // EMPTY_OBSERVABLE needs to be a stable reference to avoid re-subscribing on every render.\n const members = useMulticastObservable(space?.members ?? MulticastObservable.empty()) ?? [];\n return members.filter((member) => member.role !== HaloSpaceMember.Role.REMOVED);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PublicKeyLike } from '@dxos/client';\nimport { type Space, SpaceState } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Get a specific Space using its key.\n * The space is not guaranteed to be in the ready state.\n * Returns the default space if no key is provided.\n * Requires a ClientProvider somewhere in the parent tree.\n *\n * @param spaceKeyLike the key of the space to look for\n */\nexport const useSpace = (spaceKeyLike?: PublicKeyLike): Space | undefined => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n const [ready, setReady] = useState(false);\n\n useEffect(() => {\n // Only wait for ready if looking for the default space.\n if (spaceKeyLike) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.waitUntilReady();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKeyLike]);\n\n if (spaceKeyLike) {\n return spaces.find((space) => space.key.equals(spaceKeyLike) || space.id === spaceKeyLike);\n }\n\n if (ready && client.halo.identity.get()) {\n return client.spaces.default;\n }\n};\n\nexport type UseSpacesParams = {\n /**\n * Return uninitialized spaces as well.\n */\n all?: boolean;\n};\n\n/**\n * Get all Spaces available to current user.\n * Requires a ClientProvider somewhere in the parent tree.\n * By default, only ready spaces are returned.\n * @returns an array of Spaces\n */\nexport const useSpaces = ({ all = false }: UseSpacesParams = {}): Space[] => {\n const client = useClient();\n const spaces = useMulticastObservable<Space[]>(client.spaces);\n\n // TODO(dmaretskyi): Array reference equality.\n return spaces.filter((space) => all || space.state.get() === SpaceState.SPACE_READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Echo, Filter, type Live, Query, type Space, isSpace } from '@dxos/client/echo';\n\nconst EMPTY_ARRAY: never[] = [];\n\nconst noop = () => {};\n\n// TODO(dmaretskyi): Queries are fully serializable, so we can remove `deps` argument.\ninterface UseQueryFn {\n <Q extends Query.Any>(spaceOrEcho: Space | Echo | undefined, query: Q, deps?: any[]): Live<Query.Type<Q>>[];\n\n <F extends Filter.Any>(spaceOrEcho: Space | Echo | undefined, filter: F, deps?: any[]): Live<Filter.Type<F>>[];\n}\n\n/**\n * Create subscription.\n */\nexport const useQuery: UseQueryFn = (\n spaceOrEcho: Space | Echo | undefined,\n queryOrFilter: Query.Any | Filter.Any,\n deps?: any[],\n): Live<unknown>[] => {\n const query = Filter.is(queryOrFilter) ? Query.select(queryOrFilter) : queryOrFilter;\n\n const { getObjects, subscribe } = useMemo(() => {\n let subscribed = false;\n const queryResult =\n spaceOrEcho === undefined\n ? undefined\n : isSpace(spaceOrEcho)\n ? spaceOrEcho.db.query(query)\n : spaceOrEcho.query(query);\n\n return {\n getObjects: () => (subscribed && queryResult ? queryResult.objects : EMPTY_ARRAY),\n subscribe: (cb: () => void) => {\n subscribed = true;\n const unsubscribe = queryResult?.subscribe(cb) ?? noop;\n return () => {\n unsubscribe?.();\n subscribed = false;\n };\n },\n };\n }, [spaceOrEcho, JSON.stringify(query.ast), ...(deps ?? [])]);\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes; make sure it is stable.\n const objects = useSyncExternalStore<Live<unknown>[] | undefined>(subscribe, getObjects);\n return objects ?? [];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useMemo, useRef } from 'react';\n\nimport { type Queue } from '@dxos/client/echo';\nimport { raise } from '@dxos/debug';\nimport { type Obj, type Relation } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\n\nimport { useClient } from '../client';\n\nconst MIN_POLL_INTERVAL = 1_000;\n\nexport type UseQueueOptions = {\n pollInterval?: number;\n};\n\n/**\n * Polls the given Edge queue.\n */\n// TODO(burdon): Replace polling with socket?\n// TODO(dmaretskyi): Move into client package.\n// TODO(dmaretskyi): Consider passing the space into the hook to support queue DXNs without space id.\n// TODO(ZaymonFC): If queue is unchanged returned object should be refferentially stable on poll.\nexport const useQueue = <T extends Obj.Any | Relation.Any>(\n queueDxn?: DXN,\n options: UseQueueOptions = {},\n): Queue<T> | undefined => {\n const client = useClient();\n const mountedRef = useRef(true);\n\n const queue = useMemo<Queue<T> | undefined>(() => {\n if (!queueDxn) {\n return undefined;\n }\n\n const { spaceId } = queueDxn.asQueueDXN() ?? raise(new TypeError('Invalid queue DXN'));\n return client.spaces.get(spaceId)?.queues.get<T>(queueDxn);\n }, [client, queueDxn?.toString()]);\n\n useEffect(() => {\n void queue?.refresh();\n }, [queue]);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n mountedRef.current = true;\n\n const poll = () => {\n if (!mountedRef.current) {\n return;\n }\n\n void queue?.refresh().finally(() => {\n if (mountedRef.current && options.pollInterval) {\n timeout = setTimeout(poll, Math.max(options.pollInterval ?? 0, MIN_POLL_INTERVAL));\n }\n });\n };\n\n if (options.pollInterval) {\n poll();\n }\n\n return () => {\n mountedRef.current = false;\n clearTimeout(timeout);\n };\n }, [queue, options.pollInterval]);\n\n return queue;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Schema } from 'effect';\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type Client } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type BaseSchema } from '@dxos/echo-schema';\n\n/**\n * Subscribe to and retrieve schema changes from a space's schema registry.\n */\nexport const useSchema = (\n client: Client,\n space: Space | undefined,\n typename: string | undefined,\n): Schema.Schema.AnyNoContext | undefined => {\n const { subscribe, getSchema } = useMemo(() => {\n if (!typename || !space) {\n return {\n subscribe: () => () => {},\n getSchema: () => undefined,\n };\n }\n\n const staticSchema = client.graph.schemaRegistry.getSchema(typename);\n if (staticSchema) {\n return {\n subscribe: () => () => {},\n getSchema: () => staticSchema,\n };\n }\n\n const query = space.db.schemaRegistry.query({ typename });\n const initialResult: BaseSchema = query.runSync()[0];\n let currentSchema = initialResult;\n\n return {\n subscribe: (onStoreChange: () => void) => {\n const unsubscribe = query.subscribe(() => {\n currentSchema = query.results[0];\n onStoreChange();\n });\n\n return unsubscribe;\n },\n getSchema: () => currentSchema,\n };\n }, [typename, space]);\n\n return useSyncExternalStore(subscribe, getSchema);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useSpace } from './useSpaces';\nimport { type CancellableInvitationObservable, useInvitationStatus } from '../invitations';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey): CancellableInvitationObservable[] => {\n const space = useSpace(spaceKey);\n return useMulticastObservable(space?.invitations ?? MulticastObservable.empty()) ?? [];\n};\n\nexport const useSpaceInvitation = (spaceKey?: PublicKey, invitationId?: string) => {\n const invitations = useSpaceInvitations(spaceKey);\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useEffect, useRef } from 'react';\n\nimport { type Selection, type SubscriptionHandle, createSubscription } from '@dxos/client/echo';\n\n/**\n * Create reactive selection.\n * Calls the callback when the selection changes and during the first render.\n */\n// TODO(wittjosiah): Is this still needed with signals reactivity? If not, remove or update jsdoc with usage info.\nexport const useSubscription = (cb: () => void, selection: Selection) => {\n // Make sure that the callback is always the one from the latest render.\n // Without this, we would always call the callback from the initial render,\n // which might contain stale data.\n const callbackRef = useRef(cb);\n callbackRef.current = cb;\n\n const subscriptionRef = useRef<SubscriptionHandle>();\n\n useEffect(() => {\n subscriptionRef.current = createSubscription(() => {\n callbackRef.current();\n });\n\n return () => subscriptionRef.current?.unsubscribe();\n }, []);\n\n subscriptionRef.current?.update(selection);\n return subscriptionRef.current;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type PeerSyncState, type SpaceSyncStateMap, type Space } from '@dxos/client/echo';\nimport { Context } from '@dxos/context';\nimport { type SpaceId } from '@dxos/keys';\nimport { EdgeService } from '@dxos/protocols';\n\nimport { useClient } from '../client';\n\nconst isEdgePeerId = (peerId: string, spaceId: SpaceId) =>\n peerId.startsWith(`${EdgeService.AUTOMERGE_REPLICATOR}:${spaceId}`);\n\n/**\n * Hook Subscribes to sync state for each space.\n */\nexport const useSyncState = (): SpaceSyncStateMap => {\n const client = useClient();\n const [spaceState, setSpaceState] = useState<SpaceSyncStateMap>({});\n\n useEffect(() => {\n const ctx = new Context();\n const createSubscriptions = (spaces: Space[]) => {\n for (const space of spaces) {\n if (spaceState[space.id]) {\n continue;\n }\n\n ctx.onDispose(\n space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState((spaceState) => ({ ...spaceState, [space.id]: syncState }));\n }\n }),\n );\n }\n };\n\n createSubscriptions(client.spaces.get());\n client.spaces.subscribe((spaces) => {\n createSubscriptions(spaces);\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [client]);\n\n return spaceState;\n};\n\n/**\n * Hook Subscribes to sync state for a single space.\n */\n// TODO(wittjosiah): Reconcile w/ useSyncState.\nexport const useSpaceSyncState = (space: Space): PeerSyncState | undefined => {\n const [spaceState, setSpaceState] = useState<PeerSyncState>();\n\n useEffect(() => {\n const ctx = new Context();\n space.crud.subscribeToSyncState(ctx, ({ peers = [] }) => {\n const syncState = peers.find((state) => isEdgePeerId(state.peerId, space.id));\n if (syncState) {\n setSpaceState(syncState);\n }\n });\n\n return () => {\n void ctx.dispose();\n };\n }, [space]);\n\n return spaceState;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAc;ACAd,mBAAoC;AAEpC,kBAAkD;AAClD,yBAAuC;ACHvC,mBAAoC;AAGpC,IAAAA,eAAuC;AACvC,IAAAC,sBAAuC;ACJvC,IAAAC,gBAA8C;AAE9C,IAAAF,eAAyE;ACFzE,IAAAE,gBAA2C;AAG3C,mBAAsB;ACFtB,IAAAA,gBAA8C;ACD9C,IAAAA,gBAAwB;AAExB,IAAAC,gBAAoC;AAEpC,IAAAF,sBAAuC;ACJvC,IAAAC,gBAAkC;AAElC,IAAAF,eAA4E;ACF5E,IAAAE,gBAAoC;AAGpC,qBAAwB;AAExB,uBAA4B;ANWrB,IAAME,WAAW,CAACC,iBAAAA;AACvB,QAAMC,aAASC,iCAAAA;AACf,QAAMC,aAASC,4CAAgCH,OAAOE,MAAM;AAC5D,QAAM,CAACE,OAAOC,QAAAA,QAAYC,uBAAS,KAAA;AAEnCC,8BAAU,MAAA;AAER,QAAIR,cAAc;AAChB;IACF;AAEA,U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AAMC,YAAYD,MAAM5G,KAAK,CAACY,UAAUkF,aAAalF,MAAMmF,QAAQ9F,MAAMG,EAAE,CAAA;AAC3E,cAAIyG,WAAW;AACbR,0BAAc,CAACD,iBAAgB;cAAE,GAAGA;cAAY,CAACnG,MAAMG,EAAE,GAAGyG;YAAU,EAAA;UACxE;QACF,CAAA,CAAA;MAEJ;IACF;AAEAL,wBAAoBpH,OAAOE,OAAOiB,IAAG,CAAA;AACrCnB,WAAOE,OAAOgD,UAAU,CAAChD,WAAAA;AACvBkH,0BAAoBlH,MAAAA;IACtB,CAAA;AAEA,WAAO,MAAA;AACL,WAAKgH,IAAIQ,QAAO;IAClB;EACF,GAAG;IAAC1H;GAAO;AAEX,SAAOgH;AACT;AAMO,IAAMW,oBAAoB,CAAC9G,UAAAA;AAChC,QAAM,CAACmG,YAAYC,aAAAA,QAAiB3G,cAAAA,UAAAA;AAEpCC,oBAAAA,WAAU,MAAA;AACR,UAAM2G,MAAM,IAAIC,uBAAAA,QAAAA;;;;AAChBtG,UAAMyG,KAAKC,qBAAqBL,KAAK,CAAC,EAAEM,QAAQ,CAAA,EAAE,MAAE;AAClD,YAAMC,YAAYD,MAAM5G,KAAK,CAACY,UAAUkF,aAAalF,MAAMmF,QAAQ9F,MAAMG,EAAE,CAAA;AAC3E,UAAIyG,WAAW;AACbR,sBAAcQ,SAAAA;MAChB;IACF,CAAA;AAEA,WAAO,MAAA;AACL,WAAKP,IAAIQ,QAAO;IAClB;EACF,GAAG;IAAC7G;GAAM;AAEV,SAAOmG;AACT;",
6
- "names": ["import_echo", "import_react_hooks", "import_react", "import_async", "useSpace", "spaceKeyLike", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "waitUntilReady", "clearTimeout", "find", "space", "key", "equals", "id", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "SPACE_READY", "useMembers", "spaceKey", "undefined", "members", "MulticastObservable", "empty", "member", "role", "HaloSpaceMember", "Role", "REMOVED", "EMPTY_ARRAY", "noop", "useQuery", "spaceOrEcho", "queryOrFilter", "deps", "query", "Filter", "is", "Query", "select", "getObjects", "subscribe", "useMemo", "subscribed", "queryResult", "isSpace", "db", "objects", "cb", "unsubscribe", "JSON", "stringify", "ast", "useSyncExternalStore", "MIN_POLL_INTERVAL", "useQueue", "queueDxn", "options", "mountedRef", "useRef", "queue", "spaceId", "asQueueDXN", "raise", "TypeError", "queues", "toString", "refresh", "current", "poll", "finally", "pollInterval", "Math", "max", "useSchema", "typename", "getSchema", "staticSchema", "graph", "schemaRegistry", "initialResult", "runSync", "currentSchema", "onStoreChange", "results", "useSpaceInvitations", "invitations", "useSpaceInvitation", "invitationId", "invitation", "useInvitationStatus", "useSubscription", "selection", "callbackRef", "subscriptionRef", "createSubscription", "update", "isEdgePeerId", "peerId", "startsWith", "EdgeService", "AUTOMERGE_REPLICATOR", "useSyncState", "spaceState", "setSpaceState", "ctx", "Context", "createSubscriptions", "onDispose", "crud", "subscribeToSyncState", "peers", "syncState", "dispose", "useSpaceSyncState"]
7
- }
@@ -1,123 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var halo_exports = {};
20
- __export(halo_exports, {
21
- Device: () => import_halo.Device,
22
- DeviceKind: () => import_halo.DeviceKind,
23
- DeviceType: () => import_halo.DeviceType,
24
- KeyStore: () => KeyStore,
25
- useContacts: () => useContacts,
26
- useCredentials: () => useCredentials,
27
- useDevices: () => useDevices,
28
- useHaloInvitation: () => useHaloInvitation,
29
- useHaloInvitations: () => useHaloInvitations,
30
- useIdentity: () => useIdentity,
31
- useKeyStore: () => useKeyStore
32
- });
33
- module.exports = __toCommonJS(halo_exports);
34
- var import_chunk_FYOAVV65 = require("../chunk-FYOAVV65.cjs");
35
- var import_chunk_5RUIFUEC = require("../chunk-5RUIFUEC.cjs");
36
- var import_halo = require("@dxos/client/halo");
37
- var import_react_hooks = require("@dxos/react-hooks");
38
- var import_react_hooks2 = require("@dxos/react-hooks");
39
- var import_react_hooks3 = require("@dxos/react-hooks");
40
- var import_react = require("react");
41
- var import_react_hooks4 = require("@dxos/react-hooks");
42
- var import_react_hooks5 = require("@dxos/react-hooks");
43
- var import_react2 = require("react");
44
- var useContacts = () => {
45
- const client = (0, import_chunk_5RUIFUEC.useClient)();
46
- return (0, import_react_hooks.useMulticastObservable)(client.halo.contacts);
47
- };
48
- var useCredentials = () => {
49
- const client = (0, import_chunk_5RUIFUEC.useClient)();
50
- return (0, import_react_hooks2.useMulticastObservable)(client.halo.credentials);
51
- };
52
- var useDevices = () => {
53
- const client = (0, import_chunk_5RUIFUEC.useClient)();
54
- return (0, import_react_hooks3.useMulticastObservable)(client.halo.devices);
55
- };
56
- var useHaloInvitations = () => {
57
- const client = (0, import_chunk_5RUIFUEC.useClient)();
58
- return (0, import_react_hooks4.useMulticastObservable)(client.halo.invitations);
59
- };
60
- var useHaloInvitation = (invitationId) => {
61
- const invitations = useHaloInvitations();
62
- const invitation = (0, import_react.useMemo)(() => invitations.find((invitation2) => invitation2.get().invitationId === invitationId), [
63
- invitations
64
- ]);
65
- return (0, import_chunk_FYOAVV65.useInvitationStatus)(invitation);
66
- };
67
- var useIdentity = () => {
68
- const client = (0, import_chunk_5RUIFUEC.useClient)();
69
- return (0, import_react_hooks5.useMulticastObservable)(client.halo.identity);
70
- };
71
- var KeyStore = class {
72
- constructor(_defaultKeys = []) {
73
- this._defaultKeys = _defaultKeys;
74
- this._keyMap = /* @__PURE__ */ new Map();
75
- }
76
- get map() {
77
- return this._keyMap;
78
- }
79
- // TODO(burdon): Create subkeys.
80
- initialize() {
81
- this._defaultKeys.forEach((key) => {
82
- const value = localStorage.getItem(key);
83
- this.setKey(key, value ?? "");
84
- });
85
- return this;
86
- }
87
- getKey(key) {
88
- localStorage.getItem(key);
89
- }
90
- setKey(key, value) {
91
- localStorage.setItem(key, "");
92
- this._keyMap.set(key, value);
93
- }
94
- };
95
- var useKeyStore = (defaultKeys = []) => {
96
- const [, forceUpdate] = (0, import_react2.useReducer)((x) => x + 1, 0);
97
- const store = (0, import_react2.useMemo)(() => new KeyStore(defaultKeys).initialize(), [
98
- defaultKeys
99
- ]);
100
- const setKey = (key, value) => {
101
- store.setKey(key, value);
102
- forceUpdate();
103
- };
104
- return [
105
- store.map,
106
- setKey
107
- ];
108
- };
109
- // Annotate the CommonJS export names for ESM import in node:
110
- 0 && (module.exports = {
111
- Device,
112
- DeviceKind,
113
- DeviceType,
114
- KeyStore,
115
- useContacts,
116
- useCredentials,
117
- useDevices,
118
- useHaloInvitation,
119
- useHaloInvitations,
120
- useIdentity,
121
- useKeyStore
122
- });
123
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/halo/index.ts", "../../../../src/halo/useContacts.ts", "../../../../src/halo/useCredentials.ts", "../../../../src/halo/useDevices.ts", "../../../../src/halo/useHaloInvitations.ts", "../../../../src/halo/useIdentity.ts", "../../../../src/halo/useKeyStore.ts"],
4
- "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n type Credential,\n type Contact,\n type Identity,\n type Halo,\n Device,\n DeviceKind,\n DeviceType,\n} from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useCredentials';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Contact } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Returns all known Contacts across all Spaces.\n * Contacts are known members of a common Space.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useContacts = (): Contact[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.contacts);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Credential } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\nexport const useCredentials = (): Credential[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.credentials);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport type { Device } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.devices);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\nimport { useInvitationStatus, type CancellableInvitationObservable } from '../invitations';\n\nexport const useHaloInvitations = (): CancellableInvitationObservable[] => {\n const client = useClient();\n return useMulticastObservable(client.halo.invitations);\n};\n\nexport const useHaloInvitation = (invitationId?: string) => {\n const invitations = useHaloInvitations();\n const invitation = useMemo(\n () => invitations.find((invitation) => invitation.get().invitationId === invitationId),\n [invitations],\n );\n return useInvitationStatus(invitation);\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { type Identity } from '@dxos/client/halo';\nimport { useMulticastObservable } from '@dxos/react-hooks';\n\nimport { useClient } from '../client';\n\n/**\n * Hook returning DXOS identity object.\n * Requires ClientContext to be set via ClientProvider.\n */\nexport const useIdentity = (): Identity | null => {\n const client = useClient();\n return useMulticastObservable(client.halo.identity);\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useMemo, useReducer } from 'react';\n\n// TODO(burdon): Move to settings plugin.\nexport class KeyStore {\n private _keyMap = new Map<string, string>();\n\n constructor(private readonly _defaultKeys: string[] = []) {}\n\n get map() {\n return this._keyMap;\n }\n\n // TODO(burdon): Create subkeys.\n initialize(): this {\n this._defaultKeys.forEach((key) => {\n const value = localStorage.getItem(key);\n this.setKey(key, value ?? '');\n });\n\n return this;\n }\n\n getKey(key: string): void {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string): void {\n localStorage.setItem(key, '');\n this._keyMap.set(key, value);\n }\n}\n\n/**\n * Settings store.\n * @deprecated Replace with HALO key store when available.\n */\nexport const useKeyStore = (\n defaultKeys: string[] = [],\n): [Map<string, string>, (key: string, value: string) => void] => {\n const [, forceUpdate] = useReducer((x) => x + 1, 0);\n const store = useMemo(() => new KeyStore(defaultKeys).initialize(), [defaultKeys]);\n const setKey = (key: string, value: string) => {\n store.setKey(key, value);\n forceUpdate();\n };\n\n return [store.map, setKey];\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,kBAQO;ACRP,yBAAuC;ACAvC,IAAAA,sBAAuC;ACAvC,IAAAA,sBAAuC;ACDvC,mBAAwB;AAExB,IAAAA,sBAAuC;ACDvC,IAAAA,sBAAuC;ACDvC,IAAAC,gBAAoC;ALU7B,IAAMC,cAAc,MAAA;AACzB,QAAMC,aAASC,iCAAAA;AACf,aAAOC,2CAAuBF,OAAOG,KAAKC,QAAQ;AACpD;ACRO,IAAMC,iBAAiB,MAAA;AAC5B,QAAML,aAASC,iCAAAA;AACf,aAAOC,oBAAAA,wBAAuBF,OAAOG,KAAKG,WAAW;AACvD;ACHO,IAAMC,aAAa,MAAA;AACxB,QAAMP,aAASC,iCAAAA;AACf,aAAOC,oBAAAA,wBAAuBF,OAAOG,KAAKK,OAAO;AAC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T,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACG,MAAMhB;IAAKO;;AACrB;",
6
- "names": ["import_react_hooks", "import_react", "useContacts", "client", "useClient", "useMulticastObservable", "halo", "contacts", "useCredentials", "credentials", "useDevices", "devices", "useHaloInvitations", "invitations", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "get", "useInvitationStatus", "useIdentity", "identity", "KeyStore", "_defaultKeys", "_keyMap", "Map", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "useReducer", "x", "store"]
7
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var node_exports = {};
21
- __export(node_exports, {
22
- AgentHostingContext: () => import_chunk_5RUIFUEC.AgentHostingContext,
23
- AgentHostingProvider: () => import_chunk_5RUIFUEC.AgentHostingProvider,
24
- ClientContext: () => import_chunk_5RUIFUEC.ClientContext,
25
- ClientProvider: () => import_chunk_5RUIFUEC.ClientProvider,
26
- useAgentHostingClient: () => import_chunk_5RUIFUEC.useAgentHostingClient,
27
- useClient: () => import_chunk_5RUIFUEC.useClient,
28
- useClientStatus: () => import_chunk_5RUIFUEC.useClientStatus,
29
- useConfig: () => import_chunk_5RUIFUEC.useConfig,
30
- useMulticastObservable: () => import_react_hooks.useMulticastObservable,
31
- useShell: () => import_chunk_5RUIFUEC.useShell,
32
- useShellDisplay: () => import_chunk_5RUIFUEC.useShellDisplay,
33
- useStatus: () => import_chunk_5RUIFUEC.useStatus
34
- });
35
- module.exports = __toCommonJS(node_exports);
36
- var import_chunk_5RUIFUEC = require("./chunk-5RUIFUEC.cjs");
37
- __reExport(node_exports, require("@dxos/client"), module.exports);
38
- var import_react_hooks = require("@dxos/react-hooks");
39
- // Annotate the CommonJS export names for ESM import in node:
40
- 0 && (module.exports = {
41
- AgentHostingContext,
42
- AgentHostingProvider,
43
- ClientContext,
44
- ClientProvider,
45
- useAgentHostingClient,
46
- useClient,
47
- useClientStatus,
48
- useConfig,
49
- useMulticastObservable,
50
- useShell,
51
- useShellDisplay,
52
- useStatus,
53
- ...require("@dxos/client")
54
- });
55
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client';\nexport { useMulticastObservable } from '@dxos/react-hooks';\n\nexport * from './client';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAc;AACd,yBAAuC;",
6
- "names": []
7
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var invitations_exports = {};
20
- __export(invitations_exports, {
21
- AuthenticatingInvitationObservable: () => import_chunk_FYOAVV65.AuthenticatingInvitationObservable,
22
- CancellableInvitationObservable: () => import_chunk_FYOAVV65.CancellableInvitationObservable,
23
- Invitation: () => import_chunk_FYOAVV65.Invitation,
24
- InvitationEncoder: () => import_chunk_FYOAVV65.InvitationEncoder,
25
- InvitationsProxy: () => import_chunk_FYOAVV65.InvitationsProxy,
26
- useInvitationStatus: () => import_chunk_FYOAVV65.useInvitationStatus
27
- });
28
- module.exports = __toCommonJS(invitations_exports);
29
- var import_chunk_FYOAVV65 = require("../chunk-FYOAVV65.cjs");
30
- // Annotate the CommonJS export names for ESM import in node:
31
- 0 && (module.exports = {
32
- AuthenticatingInvitationObservable,
33
- CancellableInvitationObservable,
34
- Invitation,
35
- InvitationEncoder,
36
- InvitationsProxy,
37
- useInvitationStatus
38
- });
39
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["index.cjs"],
4
- "sourcesContent": ["import {\n AuthenticatingInvitationObservable,\n CancellableInvitationObservable,\n Invitation,\n InvitationEncoder,\n InvitationsProxy,\n useInvitationStatus\n} from \"../chunk-FYOAVV65.cjs\";\nexport {\n AuthenticatingInvitationObservable,\n CancellableInvitationObservable,\n Invitation,\n InvitationEncoder,\n InvitationsProxy,\n useInvitationStatus\n};\n//# sourceMappingURL=index.cjs.map\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAOO;",
6
- "names": []
7
- }