@dxos/react-client 0.4.10-main.1ada56e → 0.4.10-main.1be21a3

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useQuery.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSubscription.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-async';\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.presence !== SpaceMember.PresenceState.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-async';\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 spaceKey the key of the space to look for\n */\nexport const useSpace = (spaceKey?: 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 (spaceKey) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.isReady.wait();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKey]);\n\n if (spaceKey) {\n return spaces.find((space) => space.key.equals(spaceKey));\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.READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport type { QueryOptions, TypedObject, Query, FilterSource, Space } from '@dxos/client/echo';\n\ntype UseQuery = {\n <T extends TypedObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];\n};\n\n/**\n * Create subscription.\n */\n// TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).\nexport const useQuery: UseQuery = <T extends TypedObject>(\n space?: Space,\n filter?: FilterSource<T>,\n options?: QueryOptions,\n deps?: any[],\n) => {\n const query = useMemo(\n () => space?.db.query(filter, options) as Query<T> | undefined,\n [space?.db, ...(typeof filter === 'function' ? [] : filterToDepsArray(filter)), ...(deps ?? [])],\n );\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n return (\n useSyncExternalStore<T[] | undefined>(\n (cb) => query?.subscribe?.(cb) ?? cb,\n () => query?.objects,\n ) ?? []\n );\n};\n\nconst filterToDepsArray = (filter?: FilterSource<any>) => Object.entries(filter ?? {}).flat();\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceProxy } from '@dxos/client/echo';\n\nimport { useSpace } from './useSpaces';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey) => {\n const space = useSpace(spaceKey);\n const invitations =\n useSyncExternalStore(\n (listener) => {\n if (!(space instanceof SpaceProxy)) {\n return () => {};\n }\n\n const subscription = space.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => space?.invitations.get(),\n ) ?? [];\n\n return invitations;\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"],
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-async';\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.presence !== SpaceMember.PresenceState.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-async';\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 spaceKey the key of the space to look for\n */\nexport const useSpace = (spaceKey?: 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 (spaceKey) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.isReady.wait();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKey]);\n\n if (spaceKey) {\n return spaces.find((space) => space.key.equals(spaceKey));\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.READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport type { QueryOptions, OpaqueEchoObject, Query, FilterSource, Space } from '@dxos/client/echo';\n\ntype UseQuery = {\n <T extends OpaqueEchoObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];\n};\n\n/**\n * Create subscription.\n */\n// TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).\nexport const useQuery: UseQuery = <T extends OpaqueEchoObject>(\n space?: Space,\n filter?: FilterSource<T>,\n options?: QueryOptions,\n deps?: any[],\n) => {\n const query = useMemo(\n () => space?.db.query(filter, options) as Query<T> | undefined,\n [space?.db, ...(typeof filter === 'function' ? [] : filterToDepsArray(filter)), ...(deps ?? [])],\n );\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n return (\n useSyncExternalStore<T[] | undefined>(\n (cb) => query?.subscribe?.(cb) ?? cb,\n () => query?.objects,\n ) ?? []\n );\n};\n\nconst filterToDepsArray = (filter?: FilterSource<any>) => Object.entries(filter ?? {}).flat();\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceProxy } from '@dxos/client/echo';\n\nimport { useSpace } from './useSpaces';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey) => {\n const space = useSpace(spaceKey);\n const invitations =\n useSyncExternalStore(\n (listener) => {\n if (!(space instanceof SpaceProxy)) {\n return () => {};\n }\n\n const subscription = space.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => space?.invitations.get(),\n ) ?? [];\n\n return invitations;\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"],
5
5
  "mappings": ";;;;;;;;AAIA,cAAc;;;ACAd,SAASA,2BAA2B;AAEpC,SAASC,mBAAmB;AAC5B,SAASC,0BAAAA,+BAA8B;;;ACHvC,SAASC,WAAWC,gBAAgB;AAGpC,SAAqBC,kBAAkB;AACvC,SAASC,8BAA8B;AAYhC,IAAMC,WAAW,CAACC,aAAAA;AACvB,QAAMC,SAASC,UAAAA;AACf,QAAMC,SAASC,uBAAgCH,OAAOE,MAAM;AAC5D,QAAM,CAACE,OAAOC,QAAAA,IAAYC,SAAS,KAAA;AAEnCC,YAAU,MAAA;AAER,QAAIR,UAAU;AACZ;IACF;AAEA,UAAMS,UAAUC,WAAW,YAAA;AACzB,YAAMT,OAAOE,OAAOQ,QAAQC,KAAI;AACh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,IAAMJ,oBAAoB,CAACN,WAA+BW,OAAOC,QAAQZ,UAAU,CAAC,CAAA,EAAGa,KAAI;;;AChC3F,SAASC,WAAAA,UAASC,wBAAAA,6BAA4B;AAG9C,SAASC,kBAAkB;AAKpB,IAAMC,sBAAsB,CAACC,aAAAA;AAClC,QAAMC,QAAQC,SAASF,QAAAA;AACvB,QAAMG,cACJC,sBACE,CAACC,aAAAA;AACC,QAAI,EAAEJ,iBAAiBK,aAAa;AAClC,aAAO,MAAA;MAAO;IAChB;AAEA,UAAMC,eAAeN,MAAME,YAAYK,UAAU,MAAMH,SAAAA,CAAAA;AACvD,WAAO,MAAME,aAAaE,YAAW;EACvC,GACA,MAAMR,OAAOE,YAAYO,IAAAA,CAAAA,KACtB,CAAA;AAEP,SAAOP;AACT;AAEO,IAAMQ,qBAAqB,CAACX,UAAsBY,iBAAAA;AACvD,QAAMT,cAAcJ,oBAAoBC,QAAAA;AACxC,QAAMa,aAAaC,SACjB,MAAMX,YAAYY,KAAK,CAACF,gBAAeA,YAAWH,IAAG,EAAGE,iBAAiBA,YAAAA,GACzE;IAACT;GAAY;AAEf,SAAOa,oBAAoBH,UAAAA;AAC7B;;;ACjCA,SAASI,aAAAA,YAAWC,cAAc;AAElC,SAAkDC,0BAA0B;AAOrE,IAAMC,kBAAkB,CAACC,IAAgBC,cAAAA;AAI9C,QAAMC,cAAcC,OAAOH,EAAAA;AAC3BE,cAAYE,UAAUJ;AAEtB,QAAMK,kBAAkBF,OAAAA;AAExBG,EAAAA,WAAU,MAAA;AACRD,oBAAgBD,UAAUG,mBAAmB,MAAA;AAC3CL,kBAAYE,QAAO;IACrB,CAAA;AAEA,WAAO,MAAMC,gBAAgBD,SAASI,YAAAA;EACxC,GAAG,CAAA,CAAE;AAELH,kBAAgBD,SAASK,OAAOR,SAAAA;AAChC,SAAOI,gBAAgBD;AACzB;",
6
6
  "names": ["MulticastObservable", "SpaceMember", "useMulticastObservable", "useEffect", "useState", "SpaceState", "useMulticastObservable", "useSpace", "spaceKey", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "isReady", "wait", "clearTimeout", "find", "space", "key", "equals", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "READY", "useMembers", "spaceKey", "spaces", "useSpaces", "all", "space", "find", "key", "equals", "undefined", "members", "useMulticastObservable", "MulticastObservable", "empty", "filter", "member", "presence", "SpaceMember", "PresenceState", "REMOVED", "useMemo", "useSyncExternalStore", "useQuery", "space", "filter", "options", "deps", "query", "useMemo", "db", "filterToDepsArray", "useSyncExternalStore", "cb", "subscribe", "objects", "Object", "entries", "flat", "useMemo", "useSyncExternalStore", "SpaceProxy", "useSpaceInvitations", "spaceKey", "space", "useSpace", "invitations", "useSyncExternalStore", "listener", "SpaceProxy", "subscription", "subscribe", "unsubscribe", "get", "useSpaceInvitation", "invitationId", "invitation", "useMemo", "find", "useInvitationStatus", "useEffect", "useRef", "createSubscription", "useSubscription", "cb", "selection", "callbackRef", "useRef", "current", "subscriptionRef", "useEffect", "createSubscription", "unsubscribe", "update"]
7
7
  }
@@ -37,7 +37,7 @@ var useHaloInvitations = () => {
37
37
  const invitations = useSyncExternalStore3((listener) => {
38
38
  const subscription = client.halo.invitations.subscribe(() => listener());
39
39
  return () => subscription.unsubscribe();
40
- }, () => client.halo.invitations.get()) ?? [];
40
+ }, () => client.halo.opened ? client.halo.invitations.get() : []) ?? [];
41
41
  return invitations;
42
42
  };
43
43
  var useHaloInvitation = (invitationId) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/halo/index.ts", "../../../../src/halo/useContacts.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 Contact,\n Device,\n DeviceKind,\n DeviceType,\n type Identity,\n // generateSeedPhrase,\n type Halo,\n HaloProxy,\n} from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Contact } from '@dxos/client/halo';\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 const contacts = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.contacts.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.contacts.get(),\n );\n\n return contacts;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Device } from '@dxos/client/halo';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n const devices = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.devices.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.devices.get(),\n );\n\n return devices;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { useClient } from '../client';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useHaloInvitations = () => {\n const client = useClient();\n const invitations =\n useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => client.halo.invitations.get(),\n ) ?? [];\n\n return 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-async';\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() {\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) {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string) {\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,SAEEA,QACAC,YACAC,YAIAC,iBACK;;;ACVP,SAASC,4BAA4B;AAW9B,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,QAAMC,WAAWC,qBACf,CAACC,aAAAA;AACC,UAAMC,eAAeL,OAAOM,KAAKJ,SAASK,UAAUH,QAAAA;AACpD,WAAO,MAAMC,aAAaG,YAAW;EACvC,GACA,MAAMR,OAAOM,KAAKJ,SAASO,IAAG,CAAA;AAGhC,SAAOP;AACT;;;ACtBA,SAASQ,wBAAAA,6BAA4B;AAM9B,IAAMC,aAAa,MAAA;AACxB,QAAMC,SAASC,UAAAA;AACf,QAAMC,U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AAa;AAClBE,iBAAaC,QAAQH,GAAAA;EACvB;EAEAI,OAAOJ,KAAaC,OAAe;AACjCC,iBAAaI,QAAQN,KAAK,EAAA;AAC1B,SAAKL,QAAQY,IAAIP,KAAKC,KAAAA;EACxB;AACF;AAMO,IAAMO,cAAc,CACzBC,cAAwB,CAAA,MAAE;AAE1B,QAAM,CAAA,EAAGC,WAAAA,IAAeC,WAAW,CAACC,MAAMA,IAAI,GAAG,CAAA;AACjD,QAAMC,QAAQC,SAAQ,MAAM,IAAItB,SAASiB,WAAAA,EAAaX,WAAU,GAAI;IAACW;GAAY;AACjF,QAAML,SAAS,CAACJ,KAAaC,UAAAA;AAC3BY,UAAMT,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACG,MAAMhB;IAAKO;;AACrB;",
6
- "names": ["Device", "DeviceKind", "DeviceType", "HaloProxy", "useSyncExternalStore", "useContacts", "client", "useClient", "contacts", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useSyncExternalStore", "useDevices", "client", "useClient", "devices", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useMemo", "useSyncExternalStore", "useHaloInvitations", "client", "useClient", "invitations", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "useInvitationStatus", "useMulticastObservable", "useIdentity", "client", "useClient", "useMulticastObservable", "halo", "identity", "useMemo", "useReducer", "KeyStore", "constructor", "_defaultKeys", "_keyMap", "Map", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "useReducer", "x", "store", "useMemo"]
4
+ "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n type Contact,\n Device,\n DeviceKind,\n DeviceType,\n type Identity,\n // generateSeedPhrase,\n type Halo,\n HaloProxy,\n} from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Contact } from '@dxos/client/halo';\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 const contacts = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.contacts.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.contacts.get(),\n );\n\n return contacts;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Device } from '@dxos/client/halo';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n const devices = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.devices.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.devices.get(),\n );\n\n return devices;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { useClient } from '../client';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useHaloInvitations = () => {\n const client = useClient();\n const invitations =\n useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => (client.halo.opened ? client.halo.invitations.get() : []),\n ) ?? [];\n\n return 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-async';\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() {\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) {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string) {\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,SAEEA,QACAC,YACAC,YAIAC,iBACK;;;ACVP,SAASC,4BAA4B;AAW9B,IAAMC,cAAc,MAAA;AACzB,QAAMC,SAASC,UAAAA;AACf,QAAMC,WAAWC,qBACf,CAACC,aAAAA;AACC,UAAMC,eAAeL,OAAOM,KAAKJ,SAASK,UAAUH,QAAAA;AACpD,WAAO,MAAMC,aAAaG,YAAW;EACvC,GACA,MAAMR,OAAOM,KAAKJ,SAASO,IAAG,CAAA;AAGhC,SAAOP;AACT;;;ACtBA,SAASQ,wBAAAA,6BAA4B;AAM9B,IAAMC,aAAa,MAAA;AACxB,QAAMC,SAASC,UAAAA;AACf,QAAMC,UAAUC,sBACd,CAACC,aAAAA;AACC,UAAMC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a;AAClBE,iBAAaC,QAAQH,GAAAA;EACvB;EAEAI,OAAOJ,KAAaC,OAAe;AACjCC,iBAAaI,QAAQN,KAAK,EAAA;AAC1B,SAAKL,QAAQY,IAAIP,KAAKC,KAAAA;EACxB;AACF;AAMO,IAAMO,cAAc,CACzBC,cAAwB,CAAA,MAAE;AAE1B,QAAM,CAAA,EAAGC,WAAAA,IAAeC,WAAW,CAACC,MAAMA,IAAI,GAAG,CAAA;AACjD,QAAMC,QAAQC,SAAQ,MAAM,IAAItB,SAASiB,WAAAA,EAAaX,WAAU,GAAI;IAACW;GAAY;AACjF,QAAML,SAAS,CAACJ,KAAaC,UAAAA;AAC3BY,UAAMT,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACG,MAAMhB;IAAKO;;AACrB;",
6
+ "names": ["Device", "DeviceKind", "DeviceType", "HaloProxy", "useSyncExternalStore", "useContacts", "client", "useClient", "contacts", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useSyncExternalStore", "useDevices", "client", "useClient", "devices", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useMemo", "useSyncExternalStore", "useHaloInvitations", "client", "useClient", "invitations", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "opened", "get", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "useInvitationStatus", "useMulticastObservable", "useIdentity", "client", "useClient", "useMulticastObservable", "halo", "identity", "useMemo", "useReducer", "KeyStore", "constructor", "_defaultKeys", "_keyMap", "Map", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "useReducer", "x", "store", "useMemo"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/sdk/react-client/src/banner.ts":{"bytes":3658,"imports":[],"format":"esm"},"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytes":15632,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/banner.ts","kind":"import-statement","original":"../banner"}],"format":"esm"},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytes":1563,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useConfig.ts":{"bytes":1775,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useShell.ts":{"bytes":1106,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useStatus.ts":{"bytes":1507,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytes":3547,"imports":[{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/client/index.ts":{"bytes":995,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"},{"path":"packages/sdk/react-client/src/client/useClientServices.ts","kind":"import-statement","original":"./useClientServices"},{"path":"packages/sdk/react-client/src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"packages/sdk/react-client/src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"packages/sdk/react-client/src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"},{"path":"packages/sdk/react-client/src/client/useAgentHostingProvider.ts","kind":"import-statement","original":"./useAgentHostingProvider"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytes":1938,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytes":2796,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/devtools/index.ts":{"bytes":693,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"packages/sdk/react-client/src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytes":6145,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytes":3150,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytes":3273,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytes":17876,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/index.ts":{"bytes":1299,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytes":3915,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytes":3528,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/echo/index.ts":{"bytes":986,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"packages/sdk/react-client/src/echo/useQuery.ts","kind":"import-statement","original":"./useQuery"},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"packages/sdk/react-client/src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"}],"format":"esm"},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytes":2382,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytes":1962,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytes":3302,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytes":1588,"imports":[{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytes":4572,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/halo/index.ts":{"bytes":1424,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"packages/sdk/react-client/src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"packages/sdk/react-client/src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"packages/sdk/react-client/src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"packages/sdk/react-client/src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"packages/sdk/react-client/src/index.ts":{"bytes":888,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytes":2220,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/index.ts":{"bytes":601,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytes":11223,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytes":1552,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/testing/index.ts":{"bytes":724,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx","kind":"import-statement","original":"./FullscreenDecorator"}],"format":"esm"},"packages/sdk/react-client/src/worker.ts":{"bytes":491,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/sdk/react-client/dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2520},"packages/sdk/react-client/dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"packages/sdk/react-client/src/devtools/index.ts","inputs":{"packages/sdk/react-client/src/devtools/index.ts":{"bytesInOutput":39},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytesInOutput":506},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytesInOutput":692}},"bytes":1534},"packages/sdk/react-client/dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10595},"packages/sdk/react-client/dist/lib/browser/echo/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"exports":["useMembers","useQuery","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaces","useSubscription"],"entryPoint":"packages/sdk/react-client/src/echo/index.ts","inputs":{"packages/sdk/react-client/src/echo/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytesInOutput":550},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytesInOutput":956},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytesInOutput":454},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytesInOutput":839},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytesInOutput":519}},"bytes":4007},"packages/sdk/react-client/dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7426},"packages/sdk/react-client/dist/lib/browser/halo/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","HaloProxy","KeyStore","useContacts","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"packages/sdk/react-client/src/halo/index.ts","inputs":{"packages/sdk/react-client/src/halo/index.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytesInOutput":332},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytesInOutput":353},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytesInOutput":676},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytesInOutput":174},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytesInOutput":928}},"bytes":3193},"packages/sdk/react-client/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":391},"packages/sdk/react-client/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useMulticastObservable","useShell","useStatus"],"entryPoint":"packages/sdk/react-client/src/index.ts","inputs":{"packages/sdk/react-client/src/index.ts":{"bytesInOutput":129}},"bytes":563},"packages/sdk/react-client/dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/react-client/dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"packages/sdk/react-client/src/invitations/index.ts","inputs":{},"bytes":388},"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9664},"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"packages/sdk/react-client/src/invitations/index.ts":{"bytesInOutput":198},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytesInOutput":4166}},"bytes":4731},"packages/sdk/react-client/dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1330},"packages/sdk/react-client/dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"packages/sdk/react-client/src/mesh/index.ts","inputs":{"packages/sdk/react-client/src/mesh/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytesInOutput":357}},"bytes":618},"packages/sdk/react-client/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6898},"packages/sdk/react-client/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["ClientRepeater","FullscreenDecorator"],"entryPoint":"packages/sdk/react-client/src/testing/index.ts","inputs":{"packages/sdk/react-client/src/testing/index.ts":{"bytesInOutput":38},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytesInOutput":2168},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytesInOutput":290}},"bytes":2818},"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14166},"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useShell","useStatus"],"inputs":{"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytesInOutput":3601},"packages/sdk/react-client/src/banner.ts":{"bytesInOutput":773},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytesInOutput":250},"packages/sdk/react-client/src/client/useConfig.ts":{"bytesInOutput":245},"packages/sdk/react-client/src/client/useShell.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/client/useStatus.ts":{"bytesInOutput":238},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytesInOutput":904},"packages/sdk/react-client/src/client/index.ts":{"bytesInOutput":0}},"bytes":6738},"packages/sdk/react-client/dist/lib/browser/worker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"packages/sdk/react-client/dist/lib/browser/worker.mjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"packages/sdk/react-client/src/worker.ts","inputs":{"packages/sdk/react-client/src/worker.ts":{"bytesInOutput":37}},"bytes":116}}}
1
+ {"inputs":{"packages/sdk/react-client/src/banner.ts":{"bytes":3658,"imports":[],"format":"esm"},"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytes":15632,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/banner.ts","kind":"import-statement","original":"../banner"}],"format":"esm"},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytes":1563,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useConfig.ts":{"bytes":1775,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useShell.ts":{"bytes":1106,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useStatus.ts":{"bytes":1507,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytes":3547,"imports":[{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/client/index.ts":{"bytes":995,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"},{"path":"packages/sdk/react-client/src/client/useClientServices.ts","kind":"import-statement","original":"./useClientServices"},{"path":"packages/sdk/react-client/src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"packages/sdk/react-client/src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"packages/sdk/react-client/src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"},{"path":"packages/sdk/react-client/src/client/useAgentHostingProvider.ts","kind":"import-statement","original":"./useAgentHostingProvider"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytes":1938,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytes":2796,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/devtools/index.ts":{"bytes":693,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"packages/sdk/react-client/src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytes":6145,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytes":3150,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytes":3293,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytes":17876,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/index.ts":{"bytes":1299,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytes":3915,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytes":3528,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/echo/index.ts":{"bytes":986,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"packages/sdk/react-client/src/echo/useQuery.ts","kind":"import-statement","original":"./useQuery"},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"packages/sdk/react-client/src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"}],"format":"esm"},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytes":2382,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytes":1962,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytes":3432,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytes":1588,"imports":[{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytes":4572,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/halo/index.ts":{"bytes":1424,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"packages/sdk/react-client/src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"packages/sdk/react-client/src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"packages/sdk/react-client/src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"packages/sdk/react-client/src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"packages/sdk/react-client/src/index.ts":{"bytes":888,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytes":2220,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/index.ts":{"bytes":601,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytes":11195,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytes":1552,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/testing/index.ts":{"bytes":724,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx","kind":"import-statement","original":"./FullscreenDecorator"}],"format":"esm"},"packages/sdk/react-client/src/worker.ts":{"bytes":491,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/sdk/react-client/dist/lib/browser/devtools/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2520},"packages/sdk/react-client/dist/lib/browser/devtools/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"packages/sdk/react-client/src/devtools/index.ts","inputs":{"packages/sdk/react-client/src/devtools/index.ts":{"bytesInOutput":39},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytesInOutput":506},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytesInOutput":692}},"bytes":1534},"packages/sdk/react-client/dist/lib/browser/echo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10610},"packages/sdk/react-client/dist/lib/browser/echo/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"exports":["useMembers","useQuery","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaces","useSubscription"],"entryPoint":"packages/sdk/react-client/src/echo/index.ts","inputs":{"packages/sdk/react-client/src/echo/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytesInOutput":550},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytesInOutput":956},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytesInOutput":454},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytesInOutput":839},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytesInOutput":519}},"bytes":4007},"packages/sdk/react-client/dist/lib/browser/halo/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7492},"packages/sdk/react-client/dist/lib/browser/halo/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","HaloProxy","KeyStore","useContacts","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"packages/sdk/react-client/src/halo/index.ts","inputs":{"packages/sdk/react-client/src/halo/index.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytesInOutput":332},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytesInOutput":353},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytesInOutput":702},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytesInOutput":174},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytesInOutput":928}},"bytes":3219},"packages/sdk/react-client/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":391},"packages/sdk/react-client/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useMulticastObservable","useShell","useStatus"],"entryPoint":"packages/sdk/react-client/src/index.ts","inputs":{"packages/sdk/react-client/src/index.ts":{"bytesInOutput":129}},"bytes":563},"packages/sdk/react-client/dist/lib/browser/invitations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/react-client/dist/lib/browser/invitations/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"packages/sdk/react-client/src/invitations/index.ts","inputs":{},"bytes":388},"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9664},"packages/sdk/react-client/dist/lib/browser/chunk-Y64VSVTU.mjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"packages/sdk/react-client/src/invitations/index.ts":{"bytesInOutput":198},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytesInOutput":4166}},"bytes":4731},"packages/sdk/react-client/dist/lib/browser/mesh/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1330},"packages/sdk/react-client/dist/lib/browser/mesh/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"packages/sdk/react-client/src/mesh/index.ts","inputs":{"packages/sdk/react-client/src/mesh/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytesInOutput":357}},"bytes":618},"packages/sdk/react-client/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6889},"packages/sdk/react-client/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["ClientRepeater","FullscreenDecorator"],"entryPoint":"packages/sdk/react-client/src/testing/index.ts","inputs":{"packages/sdk/react-client/src/testing/index.ts":{"bytesInOutput":38},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytesInOutput":2164},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytesInOutput":290}},"bytes":2814},"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14166},"packages/sdk/react-client/dist/lib/browser/chunk-6SW7V4VI.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useShell","useStatus"],"inputs":{"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytesInOutput":3601},"packages/sdk/react-client/src/banner.ts":{"bytesInOutput":773},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytesInOutput":250},"packages/sdk/react-client/src/client/useConfig.ts":{"bytesInOutput":245},"packages/sdk/react-client/src/client/useShell.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/client/useStatus.ts":{"bytesInOutput":238},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytesInOutput":904},"packages/sdk/react-client/src/client/index.ts":{"bytesInOutput":0}},"bytes":6738},"packages/sdk/react-client/dist/lib/browser/worker.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"packages/sdk/react-client/dist/lib/browser/worker.mjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"packages/sdk/react-client/src/worker.ts","inputs":{"packages/sdk/react-client/src/worker.ts":{"bytesInOutput":37}},"bytes":116}}}
@@ -27,7 +27,7 @@ var ClientRepeater = (props) => {
27
27
  services: testBuilder.createLocal()
28
28
  }));
29
29
  await Promise.all(clients2.map((client) => client.initialize()));
30
- types && clients2.map((client) => client.spaces.addSchema(types));
30
+ types && clients2.map((client) => client.addSchema(...types));
31
31
  if (createIdentity || createSpace) {
32
32
  await Promise.all(clients2.map((client) => client.halo.createIdentity()));
33
33
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/index.ts", "../../../../src/testing/ClientRepeater.tsx", "../../../../src/testing/FullscreenDecorator.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/testing';\n\nexport * from './ClientRepeater';\nexport * from './FullscreenDecorator';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { useState, type FC, useEffect } from 'react';\n\nimport { Client, type PublicKey } from '@dxos/client';\nimport { type SpaceProxy, type Space, type TypeCollection } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { registerSignalFactory } from '@dxos/echo-signals/react';\nimport { faker } from '@dxos/random';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientContext } from '../client';\n\nconst testBuilder = new TestBuilder();\n\nexport type RepeatedComponentProps = { id: number; count: number };\n\nexport type ClientRepeaterProps<P extends RepeatedComponentProps> = {\n component: FC<any>;\n controls?: FC<{ clients: Client[] }>;\n clients?: Client[];\n count?: number;\n registerSignalFactory?: boolean;\n className?: string;\n types?: TypeCollection;\n createIdentity?: boolean;\n createSpace?: boolean;\n onCreateSpace?: (space: Space) => MaybePromise<void>;\n args?: Omit<P, 'id' | 'count'>;\n};\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 */\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.\n// TODO(wittjosiah): Rename.\nexport const ClientRepeater = <P extends RepeatedComponentProps>(props: ClientRepeaterProps<P>) => {\n const {\n component: Component,\n controls: Controls,\n count = 1,\n className = 'flex w-full place-content-evenly',\n types,\n createIdentity,\n createSpace,\n onCreateSpace,\n } = props;\n if (props.registerSignalFactory ?? true) {\n registerSignalFactory();\n }\n\n const [clients, setClients] = useState(props.clients ?? []);\n const [spaceKey, setSpaceKey] = useState<PublicKey>();\n\n useEffect(() => {\n const timeout = setTimeout(async () => {\n const clients = [...Array(count)].map((_) => new Client({ services: testBuilder.createLocal() }));\n await Promise.all(clients.map((client) => client.initialize()));\n types && clients.map((client) => client.spaces.addSchema(types));\n\n if (createIdentity || createSpace) {\n await Promise.all(clients.map((client) => client.halo.createIdentity()));\n }\n\n if (createSpace) {\n const space = await clients[0].spaces.create({ name: faker.commerce.productName() });\n setSpaceKey(space.key);\n await onCreateSpace?.(space);\n await Promise.all(\n clients.slice(1).map((client) => performInvitation({ host: space as SpaceProxy, 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 <div className={className}>\n {clients.map((client, index) => (\n <ClientContext.Provider key={index} value={{ client }}>\n <Component id={index} count={clients.length} {...{ ...props.args, spaceKey }} />\n </ClientContext.Provider>\n ))}\n </div>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { DecoratorFunction } from '@storybook/csf';\nimport type { ReactRenderer } from '@storybook/react';\nimport React from 'react';\n\nexport const FullscreenDecorator = (className?: string): DecoratorFunction<ReactRenderer> => {\n return (Story) => (\n <div className={['flex fixed inset-0 overflow-hidden', className].join(' ')}>\n <Story />\n </div>\n );\n};\n"],
5
- "mappings": ";;;;;AAIA,cAAc;;;ACAd,OAAOA,SAASC,UAAmBC,iBAAiB;AAEpD,SAASC,cAA8B;AAEvC,SAASC,aAAaC,yBAAyB;AAC/C,SAASC,6BAA6B;AACtC,SAASC,aAAa;AAKtB,IAAMC,cAAc,IAAIC,YAAAA;AA2BjB,IAAMC,iBAAiB,CAAmCC,UAAAA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EACT;AAEA,SACE,sBAAA,cAAA,MAAA,UAAA,MACGzC,YAAY,sBAAA,cAACA,UAAAA;IAASQ;MACvB,sBAAA,cAACkC,OAAAA;IAAIxC;KACFM,QAAQS,IAAI,CAACO,QAAQmB,UACpB,sBAAA,cAACC,cAAcC,UAAQ;IAACV,KAAKQ;IAAOG,OAAO;MAAEtB;IAAO;KAClD,sBAAA,cAAC1B,WAAAA;IAAUiD,IAAIJ;IAAO1C,OAAOO,QAAQiC;IAAc,GAAG7C,MAAMoD;IAAMrC;;AAM9E;;;AC/FA,OAAOsC,YAAW;AAEX,IAAMC,sBAAsB,CAACC,cAAAA;AAClC,SAAO,CAACC,UACN,gBAAAC,OAAA,cAACC,OAAAA;IAAIH,WAAW;MAAC;MAAsCA;MAAWI,KAAK,GAAA;KACrE,gBAAAF,OAAA,cAACD,OAAAA,IAAAA,CAAAA;AAGP;",
6
- "names": ["React", "useState", "useEffect", "Client", "TestBuilder", "performInvitation", "registerSignalFactory", "faker", "testBuilder", "TestBuilder", "ClientRepeater", "props", "component", "Component", "controls", "Controls", "count", "className", "types", "createIdentity", "createSpace", "onCreateSpace", "registerSignalFactory", "clients", "setClients", "useState", "spaceKey", "setSpaceKey", "useEffect", "timeout", "setTimeout", "Array", "map", "_", "Client", "services", "createLocal", "Promise", "all", "client", "initialize", "spaces", "addSchema", "halo", "space", "create", "name", "faker", "commerce", "productName", "key", "slice", "performInvitation", "host", "guest", "clearTimeout", "length", "div", "index", "ClientContext", "Provider", "value", "id", "args", "React", "FullscreenDecorator", "className", "Story", "React", "div", "join"]
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/testing';\n\nexport * from './ClientRepeater';\nexport * from './FullscreenDecorator';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { useState, type FC, useEffect } from 'react';\n\nimport { Client, type PublicKey } from '@dxos/client';\nimport { type SpaceProxy, type Space } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { registerSignalFactory } from '@dxos/echo-signals/react';\nimport { faker } from '@dxos/random';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientContext } from '../client';\n\nconst testBuilder = new TestBuilder();\n\nexport type RepeatedComponentProps = { id: number; count: number };\n\nexport type ClientRepeaterProps<P extends RepeatedComponentProps> = {\n component: FC<any>;\n controls?: FC<{ clients: Client[] }>;\n clients?: Client[];\n count?: number;\n registerSignalFactory?: boolean;\n className?: string;\n types?: Parameters<Client['addSchema']>;\n createIdentity?: boolean;\n createSpace?: boolean;\n onCreateSpace?: (space: Space) => MaybePromise<void>;\n args?: Omit<P, 'id' | 'count'>;\n};\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 */\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.\n// TODO(wittjosiah): Rename.\nexport const ClientRepeater = <P extends RepeatedComponentProps>(props: ClientRepeaterProps<P>) => {\n const {\n component: Component,\n controls: Controls,\n count = 1,\n className = 'flex w-full place-content-evenly',\n types,\n createIdentity,\n createSpace,\n onCreateSpace,\n } = props;\n if (props.registerSignalFactory ?? true) {\n registerSignalFactory();\n }\n\n const [clients, setClients] = useState(props.clients ?? []);\n const [spaceKey, setSpaceKey] = useState<PublicKey>();\n\n useEffect(() => {\n const timeout = setTimeout(async () => {\n const clients = [...Array(count)].map((_) => new Client({ services: testBuilder.createLocal() }));\n await Promise.all(clients.map((client) => client.initialize()));\n types && clients.map((client) => client.addSchema(...types));\n\n if (createIdentity || createSpace) {\n await Promise.all(clients.map((client) => client.halo.createIdentity()));\n }\n\n if (createSpace) {\n const space = await clients[0].spaces.create({ name: faker.commerce.productName() });\n setSpaceKey(space.key);\n await onCreateSpace?.(space);\n await Promise.all(\n clients.slice(1).map((client) => performInvitation({ host: space as SpaceProxy, 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 <div className={className}>\n {clients.map((client, index) => (\n <ClientContext.Provider key={index} value={{ client }}>\n <Component id={index} count={clients.length} {...{ ...props.args, spaceKey }} />\n </ClientContext.Provider>\n ))}\n </div>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { DecoratorFunction } from '@storybook/csf';\nimport type { ReactRenderer } from '@storybook/react';\nimport React from 'react';\n\nexport const FullscreenDecorator = (className?: string): DecoratorFunction<ReactRenderer> => {\n return (Story) => (\n <div className={['flex fixed inset-0 overflow-hidden', className].join(' ')}>\n <Story />\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;;AAIA,cAAc;;;ACAd,OAAOA,SAASC,UAAmBC,iBAAiB;AAEpD,SAASC,cAA8B;AAEvC,SAASC,aAAaC,yBAAyB;AAC/C,SAASC,6BAA6B;AACtC,SAASC,aAAa;AAKtB,IAAMC,cAAc,IAAIC,YAAAA;AA2BjB,IAAMC,iBAAiB,CAAmCC,UAAAA;AAC/D,QAAM,EACJC,WAAWC,WACXC,UAAUC,UACVC,QAAQ,GACRC,YAAY,oCACZC,OACAC,gBACAC,aACAC,cAAa,IACXV;AACJ,MAAIA,MAAMW,yBAAyB,MAAM;AACvCA,0BAAAA;EACF;AAEA,QAAM,CAACC,SAASC,UAAAA,IAAcC,SAASd,MAAMY,WAAW,CAAA,CAAE;AAC1D,QAAM,CAACG,UAAUC,WAAAA,IAAeF,SAAAA;AAEhCG,YAAU,MAAA;AACR,UAAMC,UAAUC,WAAW,YAAA;AACzB,YAAMP,WAAU;WAAIQ,MAAMf,KAAAA;QAAQgB,IAAI,CAACC,MAAM,IAAIC,OAAO;QAAEC,UAAU3B,YAAY4B,YAAW;MAAG,CAAA,CAAA;AAC9F,YAAMC,QAAQC,IAAI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AA;KACrE,gBAAAF,OAAA,cAACD,OAAAA,IAAAA,CAAAA;AAGP;",
6
+ "names": ["React", "useState", "useEffect", "Client", "TestBuilder", "performInvitation", "registerSignalFactory", "faker", "testBuilder", "TestBuilder", "ClientRepeater", "props", "component", "Component", "controls", "Controls", "count", "className", "types", "createIdentity", "createSpace", "onCreateSpace", "registerSignalFactory", "clients", "setClients", "useState", "spaceKey", "setSpaceKey", "useEffect", "timeout", "setTimeout", "Array", "map", "_", "Client", "services", "createLocal", "Promise", "all", "client", "initialize", "addSchema", "halo", "space", "spaces", "create", "name", "faker", "commerce", "productName", "key", "slice", "performInvitation", "host", "guest", "clearTimeout", "length", "div", "index", "ClientContext", "Provider", "value", "id", "args", "React", "FullscreenDecorator", "className", "Story", "React", "div", "join"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/echo/index.ts", "../../../../src/echo/useMembers.ts", "../../../../src/echo/useSpaces.ts", "../../../../src/echo/useQuery.ts", "../../../../src/echo/useSpaceInvitations.ts", "../../../../src/echo/useSubscription.ts"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-async';\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.presence !== SpaceMember.PresenceState.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-async';\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 spaceKey the key of the space to look for\n */\nexport const useSpace = (spaceKey?: 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 (spaceKey) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.isReady.wait();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKey]);\n\n if (spaceKey) {\n return spaces.find((space) => space.key.equals(spaceKey));\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.READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport type { QueryOptions, TypedObject, Query, FilterSource, Space } from '@dxos/client/echo';\n\ntype UseQuery = {\n <T extends TypedObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];\n};\n\n/**\n * Create subscription.\n */\n// TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).\nexport const useQuery: UseQuery = <T extends TypedObject>(\n space?: Space,\n filter?: FilterSource<T>,\n options?: QueryOptions,\n deps?: any[],\n) => {\n const query = useMemo(\n () => space?.db.query(filter, options) as Query<T> | undefined,\n [space?.db, ...(typeof filter === 'function' ? [] : filterToDepsArray(filter)), ...(deps ?? [])],\n );\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n return (\n useSyncExternalStore<T[] | undefined>(\n (cb) => query?.subscribe?.(cb) ?? cb,\n () => query?.objects,\n ) ?? []\n );\n};\n\nconst filterToDepsArray = (filter?: FilterSource<any>) => Object.entries(filter ?? {}).flat();\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceProxy } from '@dxos/client/echo';\n\nimport { useSpace } from './useSpaces';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey) => {\n const space = useSpace(spaceKey);\n const invitations =\n useSyncExternalStore(\n (listener) => {\n if (!(space instanceof SpaceProxy)) {\n return () => {};\n }\n\n const subscription = space.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => space?.invitations.get(),\n ) ?? [];\n\n return invitations;\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"],
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/echo';\n\nexport * from './useMembers';\nexport * from './useQuery';\nexport * from './useSpaces';\nexport * from './useSpaceInvitations';\nexport * from './useSubscription';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { MulticastObservable } from '@dxos/async';\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceMember } from '@dxos/client/echo';\nimport { useMulticastObservable } from '@dxos/react-async';\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.presence !== SpaceMember.PresenceState.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-async';\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 spaceKey the key of the space to look for\n */\nexport const useSpace = (spaceKey?: 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 (spaceKey) {\n return;\n }\n\n const timeout = setTimeout(async () => {\n await client.spaces.isReady.wait();\n setReady(true);\n });\n\n return () => clearTimeout(timeout);\n }, [client, spaceKey]);\n\n if (spaceKey) {\n return spaces.find((space) => space.key.equals(spaceKey));\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.READY);\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport type { QueryOptions, OpaqueEchoObject, Query, FilterSource, Space } from '@dxos/client/echo';\n\ntype UseQuery = {\n <T extends OpaqueEchoObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];\n};\n\n/**\n * Create subscription.\n */\n// TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).\nexport const useQuery: UseQuery = <T extends OpaqueEchoObject>(\n space?: Space,\n filter?: FilterSource<T>,\n options?: QueryOptions,\n deps?: any[],\n) => {\n const query = useMemo(\n () => space?.db.query(filter, options) as Query<T> | undefined,\n [space?.db, ...(typeof filter === 'function' ? [] : filterToDepsArray(filter)), ...(deps ?? [])],\n );\n\n // https://beta.reactjs.org/reference/react/useSyncExternalStore\n return (\n useSyncExternalStore<T[] | undefined>(\n (cb) => query?.subscribe?.(cb) ?? cb,\n () => query?.objects,\n ) ?? []\n );\n};\n\nconst filterToDepsArray = (filter?: FilterSource<any>) => Object.entries(filter ?? {}).flat();\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { type PublicKey } from '@dxos/client';\nimport { SpaceProxy } from '@dxos/client/echo';\n\nimport { useSpace } from './useSpaces';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useSpaceInvitations = (spaceKey?: PublicKey) => {\n const space = useSpace(spaceKey);\n const invitations =\n useSyncExternalStore(\n (listener) => {\n if (!(space instanceof SpaceProxy)) {\n return () => {};\n }\n\n const subscription = space.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => space?.invitations.get(),\n ) ?? [];\n\n return invitations;\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"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAc;ACAd,mBAAoC;AAEpC,kBAA4B;AAC5B,y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AAcC,sBAAOnB,EAAAA;AAC3BkB,cAAYE,UAAUpB;AAEtB,QAAMqB,sBAAkBF,sBAAAA;AAExBzD,oBAAAA,WAAU,MAAA;AACR2D,oBAAgBD,cAAUE,iCAAmB,MAAA;AAC3CJ,kBAAYE,QAAO;IACrB,CAAA;AAEA,WAAO,MAAMC,gBAAgBD,SAAST,YAAAA;EACxC,GAAG,CAAA,CAAE;AAELU,kBAAgBD,SAASG,OAAON,SAAAA;AAChC,SAAOI,gBAAgBD;AACzB;",
6
6
  "names": ["import_echo", "import_react_async", "import_react", "useSpace", "spaceKey", "client", "useClient", "spaces", "useMulticastObservable", "ready", "setReady", "useState", "useEffect", "timeout", "setTimeout", "isReady", "wait", "clearTimeout", "find", "space", "key", "equals", "halo", "identity", "get", "default", "useSpaces", "all", "filter", "state", "SpaceState", "READY", "useMembers", "undefined", "members", "MulticastObservable", "empty", "member", "presence", "SpaceMember", "PresenceState", "REMOVED", "useQuery", "options", "deps", "query", "useMemo", "db", "filterToDepsArray", "useSyncExternalStore", "cb", "subscribe", "objects", "Object", "entries", "flat", "useSpaceInvitations", "invitations", "listener", "SpaceProxy", "subscription", "unsubscribe", "useSpaceInvitation", "invitationId", "invitation", "useInvitationStatus", "useSubscription", "selection", "callbackRef", "useRef", "current", "subscriptionRef", "createSubscription", "update"]
7
7
  }
@@ -60,7 +60,7 @@ var useHaloInvitations = () => {
60
60
  const invitations = (0, import_react3.useSyncExternalStore)((listener) => {
61
61
  const subscription = client.halo.invitations.subscribe(() => listener());
62
62
  return () => subscription.unsubscribe();
63
- }, () => client.halo.invitations.get()) ?? [];
63
+ }, () => client.halo.opened ? client.halo.invitations.get() : []) ?? [];
64
64
  return invitations;
65
65
  };
66
66
  var useHaloInvitation = (invitationId) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/halo/index.ts", "../../../../src/halo/useContacts.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 Contact,\n Device,\n DeviceKind,\n DeviceType,\n type Identity,\n // generateSeedPhrase,\n type Halo,\n HaloProxy,\n} from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Contact } from '@dxos/client/halo';\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 const contacts = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.contacts.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.contacts.get(),\n );\n\n return contacts;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Device } from '@dxos/client/halo';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n const devices = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.devices.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.devices.get(),\n );\n\n return devices;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { useClient } from '../client';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useHaloInvitations = () => {\n const client = useClient();\n const invitations =\n useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => client.halo.invitations.get(),\n ) ?? [];\n\n return 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-async';\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() {\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) {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string) {\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,kBASO;ACVP,mBAAqC;ACArC,IAAAA,gBAAqC;ACArC,IAAAA,gBAA8C;ACC9C,yBAAuC;ACDvC,IAAAA,gBAAoC;AJW7B,IAAMC,cAAc,MAAA;AACzB,QAAMC,aAASC,iCAAAA;AACf,QAAMC,eAAWC,mCACf,CAACC,aAAAA;AACC,UAAMC,eAAeL,OAAOM,KAAKJ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AAQC,aAAaC,QAAQH,GAAAA;AACnC,WAAKI,OAAOJ,KAAKC,SAAS,EAAA;IAC5B,CAAA;AAEA,WAAO;EACT;EAEAI,OAAOL,KAAa;AAClBE,iBAAaC,QAAQH,GAAAA;EACvB;EAEAI,OAAOJ,KAAaC,OAAe;AACjCC,iBAAaI,QAAQN,KAAK,EAAA;AAC1B,SAAKL,QAAQY,IAAIP,KAAKC,KAAAA;EACxB;AACF;AAMO,IAAMO,cAAc,CACzBC,cAAwB,CAAA,MAAE;AAE1B,QAAM,CAAA,EAAGC,WAAAA,QAAeC,0BAAW,CAACC,MAAMA,IAAI,GAAG,CAAA;AACjD,QAAMC,YAAQ3B,cAAAA,SAAQ,MAAM,IAAIM,SAASiB,WAAAA,EAAaX,WAAU,GAAI;IAACW;GAAY;AACjF,QAAML,SAAS,CAACJ,KAAaC,UAAAA;AAC3BY,UAAMT,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACG,MAAMhB;IAAKO;;AACrB;",
6
- "names": ["import_react", "useContacts", "client", "useClient", "contacts", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useDevices", "devices", "useHaloInvitations", "invitations", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "useInvitationStatus", "useIdentity", "useMulticastObservable", "identity", "KeyStore", "constructor", "_defaultKeys", "_keyMap", "Map", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "useReducer", "x", "store"]
4
+ "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\n// NOTE: Export * fails here.\nexport {\n type Contact,\n Device,\n DeviceKind,\n DeviceType,\n type Identity,\n // generateSeedPhrase,\n type Halo,\n HaloProxy,\n} from '@dxos/client/halo';\n\nexport * from './useContacts';\nexport * from './useDevices';\nexport * from './useHaloInvitations';\nexport * from './useIdentity';\nexport * from './useKeyStore';\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Contact } from '@dxos/client/halo';\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 const contacts = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.contacts.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.contacts.get(),\n );\n\n return contacts;\n};\n", "//\n// Copyright 2020 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nimport type { Device } from '@dxos/client/halo';\n\nimport { useClient } from '../client';\n\nexport const useDevices = (): Device[] => {\n const client = useClient();\n const devices = useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.devices.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n () => client.halo.devices.get(),\n );\n\n return devices;\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useMemo, useSyncExternalStore } from 'react';\n\nimport { useClient } from '../client';\nimport { useInvitationStatus } from '../invitations';\n\nexport const useHaloInvitations = () => {\n const client = useClient();\n const invitations =\n useSyncExternalStore(\n (listener) => {\n const subscription = client.halo.invitations.subscribe(() => listener());\n return () => subscription.unsubscribe();\n },\n () => (client.halo.opened ? client.halo.invitations.get() : []),\n ) ?? [];\n\n return 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-async';\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() {\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) {\n localStorage.getItem(key);\n }\n\n setKey(key: string, value: string) {\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,kBASO;ACVP,mBAAqC;ACArC,IAAAA,gBAAqC;ACArC,IAAAA,gBAA8C;ACC9C,yBAAuC;ACDvC,IAAAA,gBAAoC;AJW7B,IAAMC,cAAc,MAAA;AACzB,QAAMC,aAASC,iCAAAA;AACf,QAAMC,eAAWC,mCACf,CAACC,aAAAA;AACC,UAAMC,eAAeL,OAAOM,KAAKJ,SAASK,UAAUH,QAAAA;AACpD,WAAO,MAAMC,aAAaG,YAAW;EACvC,GACA,MAAMR,OAAOM,KAAKJ,SAASO,IAAG,CAAA;AAGhC,SAAOP;AACT;AChBO,IAAMQ,aAAa,MAAA;AACxB,QAAMV,aAASC,iCAAAA;AACf,QAAMU,cAAUR,cAAAA,sBACd,CAACC,aAAAA;AACC,UAAMC,eAAeL,OAAOM,KAAKK,QAAQJ,UAAUH,QAAAA;AACnD,WAAO,M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xB;AACF;AAMO,IAAMO,cAAc,CACzBC,cAAwB,CAAA,MAAE;AAE1B,QAAM,CAAA,EAAGC,WAAAA,QAAeC,0BAAW,CAACC,MAAMA,IAAI,GAAG,CAAA;AACjD,QAAMC,YAAQ3B,cAAAA,SAAQ,MAAM,IAAIM,SAASiB,WAAAA,EAAaX,WAAU,GAAI;IAACW;GAAY;AACjF,QAAML,SAAS,CAACJ,KAAaC,UAAAA;AAC3BY,UAAMT,OAAOJ,KAAKC,KAAAA;AAClBS,gBAAAA;EACF;AAEA,SAAO;IAACG,MAAMhB;IAAKO;;AACrB;",
6
+ "names": ["import_react", "useContacts", "client", "useClient", "contacts", "useSyncExternalStore", "listener", "subscription", "halo", "subscribe", "unsubscribe", "get", "useDevices", "devices", "useHaloInvitations", "invitations", "opened", "useHaloInvitation", "invitationId", "invitation", "useMemo", "find", "useInvitationStatus", "useIdentity", "useMulticastObservable", "identity", "KeyStore", "constructor", "_defaultKeys", "_keyMap", "Map", "map", "initialize", "forEach", "key", "value", "localStorage", "getItem", "setKey", "getKey", "setItem", "set", "useKeyStore", "defaultKeys", "forceUpdate", "useReducer", "x", "store"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/sdk/react-client/src/banner.ts":{"bytes":3658,"imports":[],"format":"esm"},"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytes":15632,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/banner.ts","kind":"import-statement","original":"../banner"}],"format":"esm"},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytes":1563,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useConfig.ts":{"bytes":1775,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useShell.ts":{"bytes":1106,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useStatus.ts":{"bytes":1507,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytes":3547,"imports":[{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/client/index.ts":{"bytes":995,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"},{"path":"packages/sdk/react-client/src/client/useClientServices.ts","kind":"import-statement","original":"./useClientServices"},{"path":"packages/sdk/react-client/src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"packages/sdk/react-client/src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"packages/sdk/react-client/src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"},{"path":"packages/sdk/react-client/src/client/useAgentHostingProvider.ts","kind":"import-statement","original":"./useAgentHostingProvider"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytes":1938,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytes":2796,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/devtools/index.ts":{"bytes":693,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"packages/sdk/react-client/src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytes":6145,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytes":3150,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytes":3273,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytes":17876,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/index.ts":{"bytes":1299,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytes":3915,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytes":3528,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/echo/index.ts":{"bytes":986,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"packages/sdk/react-client/src/echo/useQuery.ts","kind":"import-statement","original":"./useQuery"},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"packages/sdk/react-client/src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"}],"format":"esm"},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytes":2382,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytes":1962,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytes":3302,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytes":1588,"imports":[{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytes":4572,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/halo/index.ts":{"bytes":1424,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"packages/sdk/react-client/src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"packages/sdk/react-client/src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"packages/sdk/react-client/src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"packages/sdk/react-client/src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"packages/sdk/react-client/src/index.ts":{"bytes":888,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytes":2220,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/index.ts":{"bytes":601,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytes":11223,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytes":1552,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/testing/index.ts":{"bytes":724,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx","kind":"import-statement","original":"./FullscreenDecorator"}],"format":"esm"},"packages/sdk/react-client/src/worker.ts":{"bytes":491,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/sdk/react-client/dist/lib/node/devtools/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2520},"packages/sdk/react-client/dist/lib/node/devtools/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"packages/sdk/react-client/src/devtools/index.ts","inputs":{"packages/sdk/react-client/src/devtools/index.ts":{"bytesInOutput":39},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytesInOutput":506},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytesInOutput":692}},"bytes":1534},"packages/sdk/react-client/dist/lib/node/echo/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10595},"packages/sdk/react-client/dist/lib/node/echo/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"exports":["useMembers","useQuery","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaces","useSubscription"],"entryPoint":"packages/sdk/react-client/src/echo/index.ts","inputs":{"packages/sdk/react-client/src/echo/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytesInOutput":550},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytesInOutput":956},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytesInOutput":454},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytesInOutput":839},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytesInOutput":519}},"bytes":4007},"packages/sdk/react-client/dist/lib/node/halo/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7426},"packages/sdk/react-client/dist/lib/node/halo/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","HaloProxy","KeyStore","useContacts","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"packages/sdk/react-client/src/halo/index.ts","inputs":{"packages/sdk/react-client/src/halo/index.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytesInOutput":332},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytesInOutput":353},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytesInOutput":676},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytesInOutput":174},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytesInOutput":928}},"bytes":3193},"packages/sdk/react-client/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":391},"packages/sdk/react-client/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useMulticastObservable","useShell","useStatus"],"entryPoint":"packages/sdk/react-client/src/index.ts","inputs":{"packages/sdk/react-client/src/index.ts":{"bytesInOutput":129}},"bytes":563},"packages/sdk/react-client/dist/lib/node/invitations/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/react-client/dist/lib/node/invitations/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"packages/sdk/react-client/src/invitations/index.ts","inputs":{},"bytes":388},"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9664},"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"packages/sdk/react-client/src/invitations/index.ts":{"bytesInOutput":198},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytesInOutput":4166}},"bytes":4731},"packages/sdk/react-client/dist/lib/node/mesh/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1330},"packages/sdk/react-client/dist/lib/node/mesh/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"packages/sdk/react-client/src/mesh/index.ts","inputs":{"packages/sdk/react-client/src/mesh/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytesInOutput":357}},"bytes":618},"packages/sdk/react-client/dist/lib/node/testing/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6898},"packages/sdk/react-client/dist/lib/node/testing/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["ClientRepeater","FullscreenDecorator"],"entryPoint":"packages/sdk/react-client/src/testing/index.ts","inputs":{"packages/sdk/react-client/src/testing/index.ts":{"bytesInOutput":38},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytesInOutput":2168},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytesInOutput":290}},"bytes":2818},"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14166},"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useShell","useStatus"],"inputs":{"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytesInOutput":3601},"packages/sdk/react-client/src/banner.ts":{"bytesInOutput":773},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytesInOutput":250},"packages/sdk/react-client/src/client/useConfig.ts":{"bytesInOutput":245},"packages/sdk/react-client/src/client/useShell.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/client/useStatus.ts":{"bytesInOutput":238},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytesInOutput":904},"packages/sdk/react-client/src/client/index.ts":{"bytesInOutput":0}},"bytes":6738},"packages/sdk/react-client/dist/lib/node/worker.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"packages/sdk/react-client/dist/lib/node/worker.cjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"packages/sdk/react-client/src/worker.ts","inputs":{"packages/sdk/react-client/src/worker.ts":{"bytesInOutput":37}},"bytes":116}}}
1
+ {"inputs":{"packages/sdk/react-client/src/banner.ts":{"bytes":3658,"imports":[],"format":"esm"},"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytes":15632,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/banner.ts","kind":"import-statement","original":"../banner"}],"format":"esm"},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytes":1563,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useConfig.ts":{"bytes":1775,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useShell.ts":{"bytes":1106,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useStatus.ts":{"bytes":1507,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"}],"format":"esm"},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytes":3547,"imports":[{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/client/index.ts":{"bytes":995,"imports":[{"path":"packages/sdk/react-client/src/client/ClientContext.tsx","kind":"import-statement","original":"./ClientContext"},{"path":"packages/sdk/react-client/src/client/useClientServices.ts","kind":"import-statement","original":"./useClientServices"},{"path":"packages/sdk/react-client/src/client/useConfig.ts","kind":"import-statement","original":"./useConfig"},{"path":"packages/sdk/react-client/src/client/useShell.ts","kind":"import-statement","original":"./useShell"},{"path":"packages/sdk/react-client/src/client/useStatus.ts","kind":"import-statement","original":"./useStatus"},{"path":"packages/sdk/react-client/src/client/useAgentHostingProvider.ts","kind":"import-statement","original":"./useAgentHostingProvider"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytes":1938,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytes":2796,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/devtools/index.ts":{"bytes":693,"imports":[{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/devtools/useDevtools.ts","kind":"import-statement","original":"./useDevtools"},{"path":"packages/sdk/react-client/src/devtools/useStream.ts","kind":"import-statement","original":"./useStream"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytes":6145,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytes":3150,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"}],"format":"esm"},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytes":3293,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytes":17876,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/invitations/index.ts":{"bytes":1299,"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/invitations/useInvitationStatus.ts","kind":"import-statement","original":"./useInvitationStatus"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytes":3915,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytes":3528,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/echo/index.ts":{"bytes":986,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/echo/useMembers.ts","kind":"import-statement","original":"./useMembers"},{"path":"packages/sdk/react-client/src/echo/useQuery.ts","kind":"import-statement","original":"./useQuery"},{"path":"packages/sdk/react-client/src/echo/useSpaces.ts","kind":"import-statement","original":"./useSpaces"},{"path":"packages/sdk/react-client/src/echo/useSpaceInvitations.ts","kind":"import-statement","original":"./useSpaceInvitations"},{"path":"packages/sdk/react-client/src/echo/useSubscription.ts","kind":"import-statement","original":"./useSubscription"}],"format":"esm"},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytes":2382,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytes":1962,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytes":3432,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"},{"path":"packages/sdk/react-client/src/invitations/index.ts","kind":"import-statement","original":"../invitations"}],"format":"esm"},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytes":1588,"imports":[{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytes":4572,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/halo/index.ts":{"bytes":1424,"imports":[{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/halo/useContacts.ts","kind":"import-statement","original":"./useContacts"},{"path":"packages/sdk/react-client/src/halo/useDevices.ts","kind":"import-statement","original":"./useDevices"},{"path":"packages/sdk/react-client/src/halo/useHaloInvitations.ts","kind":"import-statement","original":"./useHaloInvitations"},{"path":"packages/sdk/react-client/src/halo/useIdentity.ts","kind":"import-statement","original":"./useIdentity"},{"path":"packages/sdk/react-client/src/halo/useKeyStore.ts","kind":"import-statement","original":"./useKeyStore"}],"format":"esm"},"packages/sdk/react-client/src/index.ts":{"bytes":888,"imports":[{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"./client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytes":2220,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/mesh/index.ts":{"bytes":601,"imports":[{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/mesh/useNetworkStatus.ts","kind":"import-statement","original":"./useNetworkStatus"}],"format":"esm"},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytes":11195,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/client/index.ts","kind":"import-statement","original":"../client"}],"format":"esm"},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytes":1552,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/sdk/react-client/src/testing/index.ts":{"bytes":724,"imports":[{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"packages/sdk/react-client/src/testing/ClientRepeater.tsx","kind":"import-statement","original":"./ClientRepeater"},{"path":"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx","kind":"import-statement","original":"./FullscreenDecorator"}],"format":"esm"},"packages/sdk/react-client/src/worker.ts":{"bytes":491,"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/sdk/react-client/dist/lib/node/devtools/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2520},"packages/sdk/react-client/dist/lib/node/devtools/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/devtools","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["useDevtools","useStream"],"entryPoint":"packages/sdk/react-client/src/devtools/index.ts","inputs":{"packages/sdk/react-client/src/devtools/index.ts":{"bytesInOutput":39},"packages/sdk/react-client/src/devtools/useDevtools.ts":{"bytesInOutput":506},"packages/sdk/react-client/src/devtools/useStream.ts":{"bytesInOutput":692}},"bytes":1534},"packages/sdk/react-client/dist/lib/node/echo/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10610},"packages/sdk/react-client/dist/lib/node/echo/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true}],"exports":["useMembers","useQuery","useSpace","useSpaceInvitation","useSpaceInvitations","useSpaces","useSubscription"],"entryPoint":"packages/sdk/react-client/src/echo/index.ts","inputs":{"packages/sdk/react-client/src/echo/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/echo/useMembers.ts":{"bytesInOutput":550},"packages/sdk/react-client/src/echo/useSpaces.ts":{"bytesInOutput":956},"packages/sdk/react-client/src/echo/useQuery.ts":{"bytesInOutput":454},"packages/sdk/react-client/src/echo/useSpaceInvitations.ts":{"bytesInOutput":839},"packages/sdk/react-client/src/echo/useSubscription.ts":{"bytesInOutput":519}},"bytes":4007},"packages/sdk/react-client/dist/lib/node/halo/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7492},"packages/sdk/react-client/dist/lib/node/halo/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs","kind":"import-statement"},{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/halo","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Device","DeviceKind","DeviceType","HaloProxy","KeyStore","useContacts","useDevices","useHaloInvitation","useHaloInvitations","useIdentity","useKeyStore"],"entryPoint":"packages/sdk/react-client/src/halo/index.ts","inputs":{"packages/sdk/react-client/src/halo/index.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/halo/useContacts.ts":{"bytesInOutput":332},"packages/sdk/react-client/src/halo/useDevices.ts":{"bytesInOutput":353},"packages/sdk/react-client/src/halo/useHaloInvitations.ts":{"bytesInOutput":702},"packages/sdk/react-client/src/halo/useIdentity.ts":{"bytesInOutput":174},"packages/sdk/react-client/src/halo/useKeyStore.ts":{"bytesInOutput":928}},"bytes":3219},"packages/sdk/react-client/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":391},"packages/sdk/react-client/dist/lib/node/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useMulticastObservable","useShell","useStatus"],"entryPoint":"packages/sdk/react-client/src/index.ts","inputs":{"packages/sdk/react-client/src/index.ts":{"bytesInOutput":129}},"bytes":563},"packages/sdk/react-client/dist/lib/node/invitations/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/sdk/react-client/dist/lib/node/invitations/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs","kind":"import-statement"}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"entryPoint":"packages/sdk/react-client/src/invitations/index.ts","inputs":{},"bytes":388},"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9664},"packages/sdk/react-client/dist/lib/node/chunk-PNDYOCJA.cjs":{"imports":[{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client/invitations","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["AuthenticatingInvitationObservable","CancellableInvitationObservable","Invitation","InvitationEncoder","InvitationsProxy","useInvitationStatus"],"inputs":{"packages/sdk/react-client/src/invitations/index.ts":{"bytesInOutput":198},"packages/sdk/react-client/src/invitations/useInvitationStatus.ts":{"bytesInOutput":4166}},"bytes":4731},"packages/sdk/react-client/dist/lib/node/mesh/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1330},"packages/sdk/react-client/dist/lib/node/mesh/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/mesh","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["useNetworkStatus"],"entryPoint":"packages/sdk/react-client/src/mesh/index.ts","inputs":{"packages/sdk/react-client/src/mesh/index.ts":{"bytesInOutput":35},"packages/sdk/react-client/src/mesh/useNetworkStatus.ts":{"bytesInOutput":357}},"bytes":618},"packages/sdk/react-client/dist/lib/node/testing/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6889},"packages/sdk/react-client/dist/lib/node/testing/index.cjs":{"imports":[{"path":"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs","kind":"import-statement"},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["ClientRepeater","FullscreenDecorator"],"entryPoint":"packages/sdk/react-client/src/testing/index.ts","inputs":{"packages/sdk/react-client/src/testing/index.ts":{"bytesInOutput":38},"packages/sdk/react-client/src/testing/ClientRepeater.tsx":{"bytesInOutput":2164},"packages/sdk/react-client/src/testing/FullscreenDecorator.tsx":{"bytesInOutput":290}},"bytes":2814},"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14166},"packages/sdk/react-client/dist/lib/node/chunk-IRRRZ2KE.cjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/echo-signals/react","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/debug","kind":"import-statement","external":true},{"path":"@dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["ClientContext","ClientProvider","useAgentHostingProviderClient","useClient","useClientServices","useConfig","useShell","useStatus"],"inputs":{"packages/sdk/react-client/src/client/ClientContext.tsx":{"bytesInOutput":3601},"packages/sdk/react-client/src/banner.ts":{"bytesInOutput":773},"packages/sdk/react-client/src/client/useClientServices.ts":{"bytesInOutput":250},"packages/sdk/react-client/src/client/useConfig.ts":{"bytesInOutput":245},"packages/sdk/react-client/src/client/useShell.ts":{"bytesInOutput":79},"packages/sdk/react-client/src/client/useStatus.ts":{"bytesInOutput":238},"packages/sdk/react-client/src/client/useAgentHostingProvider.ts":{"bytesInOutput":904},"packages/sdk/react-client/src/client/index.ts":{"bytesInOutput":0}},"bytes":6738},"packages/sdk/react-client/dist/lib/node/worker.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":206},"packages/sdk/react-client/dist/lib/node/worker.cjs":{"imports":[{"path":"@dxos/client/worker","kind":"import-statement","external":true}],"exports":[],"entryPoint":"packages/sdk/react-client/src/worker.ts","inputs":{"packages/sdk/react-client/src/worker.ts":{"bytesInOutput":37}},"bytes":116}}}
@@ -57,7 +57,7 @@ var ClientRepeater = (props) => {
57
57
  services: testBuilder.createLocal()
58
58
  }));
59
59
  await Promise.all(clients2.map((client) => client.initialize()));
60
- types && clients2.map((client) => client.spaces.addSchema(types));
60
+ types && clients2.map((client) => client.addSchema(...types));
61
61
  if (createIdentity || createSpace) {
62
62
  await Promise.all(clients2.map((client) => client.halo.createIdentity()));
63
63
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/index.ts", "../../../../src/testing/ClientRepeater.tsx", "../../../../src/testing/FullscreenDecorator.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/testing';\n\nexport * from './ClientRepeater';\nexport * from './FullscreenDecorator';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { useState, type FC, useEffect } from 'react';\n\nimport { Client, type PublicKey } from '@dxos/client';\nimport { type SpaceProxy, type Space, type TypeCollection } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { registerSignalFactory } from '@dxos/echo-signals/react';\nimport { faker } from '@dxos/random';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientContext } from '../client';\n\nconst testBuilder = new TestBuilder();\n\nexport type RepeatedComponentProps = { id: number; count: number };\n\nexport type ClientRepeaterProps<P extends RepeatedComponentProps> = {\n component: FC<any>;\n controls?: FC<{ clients: Client[] }>;\n clients?: Client[];\n count?: number;\n registerSignalFactory?: boolean;\n className?: string;\n types?: TypeCollection;\n createIdentity?: boolean;\n createSpace?: boolean;\n onCreateSpace?: (space: Space) => MaybePromise<void>;\n args?: Omit<P, 'id' | 'count'>;\n};\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 */\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.\n// TODO(wittjosiah): Rename.\nexport const ClientRepeater = <P extends RepeatedComponentProps>(props: ClientRepeaterProps<P>) => {\n const {\n component: Component,\n controls: Controls,\n count = 1,\n className = 'flex w-full place-content-evenly',\n types,\n createIdentity,\n createSpace,\n onCreateSpace,\n } = props;\n if (props.registerSignalFactory ?? true) {\n registerSignalFactory();\n }\n\n const [clients, setClients] = useState(props.clients ?? []);\n const [spaceKey, setSpaceKey] = useState<PublicKey>();\n\n useEffect(() => {\n const timeout = setTimeout(async () => {\n const clients = [...Array(count)].map((_) => new Client({ services: testBuilder.createLocal() }));\n await Promise.all(clients.map((client) => client.initialize()));\n types && clients.map((client) => client.spaces.addSchema(types));\n\n if (createIdentity || createSpace) {\n await Promise.all(clients.map((client) => client.halo.createIdentity()));\n }\n\n if (createSpace) {\n const space = await clients[0].spaces.create({ name: faker.commerce.productName() });\n setSpaceKey(space.key);\n await onCreateSpace?.(space);\n await Promise.all(\n clients.slice(1).map((client) => performInvitation({ host: space as SpaceProxy, 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 <div className={className}>\n {clients.map((client, index) => (\n <ClientContext.Provider key={index} value={{ client }}>\n <Component id={index} count={clients.length} {...{ ...props.args, spaceKey }} />\n </ClientContext.Provider>\n ))}\n </div>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { DecoratorFunction } from '@storybook/csf';\nimport type { ReactRenderer } from '@storybook/react';\nimport React from 'react';\n\nexport const FullscreenDecorator = (className?: string): DecoratorFunction<ReactRenderer> => {\n return (Story) => (\n <div className={['flex fixed inset-0 overflow-hidden', className].join(' ')}>\n <Story />\n </div>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4BAAc;ACAd,mBAAoD;AAEpD,oBAAuC;AAEvC,qBAA+C;AAC/C,IAAAA,gBAAsC;AACtC,oBAAsB;ACJtB,IAAAA,gBAAkB;ADSlB,IAAMC,cAAc,IAAIC,2BAAAA;AA2BjB,IAAMC,iBAAiB,CAAmCC,UAAAA;AAC/D,QAAM,EACJC,WAAWC,WACXC,UAAUC,UACVC,QAAQ,GACRC,YAAY,oCACZC,OACAC,gBACAC,aACAC,cAAa,IACXV;AACJ,MAAIA,MAAMW,yBAAyB,MAAM;AACvCA,6CAAAA;EACF;AAEA,QAAM,CAACC,SAASC,UAAAA,QAAcC,uBAASd,MAAMY,WAAW,CAAA,CAAE;AAC1D,QAAM,CAACG,UAAUC,WAAAA,QAAeF,uBAAAA;AAEhCG,8BAAU,MAAA;AACR,UAAMC,UAAUC,WAAW,YAAA;AACzB,YAAMP,WAAU;WAAIQ,MAAMf,KAAAA;QAAQgB,IAAI,CAACC,MAAM,IAAIC,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AAsB,CAAChD,cAAAA;AAClC,SAAO,CAACiD,UACNT,8BAAAA,QAAA,cAACC,OAAAA;IAAIzC,WAAW;MAAC;MAAsCA;MAAWkD,KAAK,GAAA;KACrEV,8BAAAA,QAAA,cAACS,OAAAA,IAAAA,CAAAA;AAGP;",
6
- "names": ["import_react", "testBuilder", "TestBuilder", "ClientRepeater", "props", "component", "Component", "controls", "Controls", "count", "className", "types", "createIdentity", "createSpace", "onCreateSpace", "registerSignalFactory", "clients", "setClients", "useState", "spaceKey", "setSpaceKey", "useEffect", "timeout", "setTimeout", "Array", "map", "_", "Client", "services", "createLocal", "Promise", "all", "client", "initialize", "spaces", "addSchema", "halo", "space", "create", "name", "faker", "commerce", "productName", "key", "slice", "performInvitation", "host", "guest", "clearTimeout", "length", "React", "div", "index", "ClientContext", "Provider", "value", "id", "args", "FullscreenDecorator", "Story", "join"]
4
+ "sourcesContent": ["//\n// Copyright 2020 DXOS.org\n//\n\nexport * from '@dxos/client/testing';\n\nexport * from './ClientRepeater';\nexport * from './FullscreenDecorator';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { useState, type FC, useEffect } from 'react';\n\nimport { Client, type PublicKey } from '@dxos/client';\nimport { type SpaceProxy, type Space } from '@dxos/client/echo';\nimport { TestBuilder, performInvitation } from '@dxos/client/testing';\nimport { registerSignalFactory } from '@dxos/echo-signals/react';\nimport { faker } from '@dxos/random';\nimport { type MaybePromise } from '@dxos/util';\n\nimport { ClientContext } from '../client';\n\nconst testBuilder = new TestBuilder();\n\nexport type RepeatedComponentProps = { id: number; count: number };\n\nexport type ClientRepeaterProps<P extends RepeatedComponentProps> = {\n component: FC<any>;\n controls?: FC<{ clients: Client[] }>;\n clients?: Client[];\n count?: number;\n registerSignalFactory?: boolean;\n className?: string;\n types?: Parameters<Client['addSchema']>;\n createIdentity?: boolean;\n createSpace?: boolean;\n onCreateSpace?: (space: Space) => MaybePromise<void>;\n args?: Omit<P, 'id' | 'count'>;\n};\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 */\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.\n// TODO(wittjosiah): Rename.\nexport const ClientRepeater = <P extends RepeatedComponentProps>(props: ClientRepeaterProps<P>) => {\n const {\n component: Component,\n controls: Controls,\n count = 1,\n className = 'flex w-full place-content-evenly',\n types,\n createIdentity,\n createSpace,\n onCreateSpace,\n } = props;\n if (props.registerSignalFactory ?? true) {\n registerSignalFactory();\n }\n\n const [clients, setClients] = useState(props.clients ?? []);\n const [spaceKey, setSpaceKey] = useState<PublicKey>();\n\n useEffect(() => {\n const timeout = setTimeout(async () => {\n const clients = [...Array(count)].map((_) => new Client({ services: testBuilder.createLocal() }));\n await Promise.all(clients.map((client) => client.initialize()));\n types && clients.map((client) => client.addSchema(...types));\n\n if (createIdentity || createSpace) {\n await Promise.all(clients.map((client) => client.halo.createIdentity()));\n }\n\n if (createSpace) {\n const space = await clients[0].spaces.create({ name: faker.commerce.productName() });\n setSpaceKey(space.key);\n await onCreateSpace?.(space);\n await Promise.all(\n clients.slice(1).map((client) => performInvitation({ host: space as SpaceProxy, 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 <div className={className}>\n {clients.map((client, index) => (\n <ClientContext.Provider key={index} value={{ client }}>\n <Component id={index} count={clients.length} {...{ ...props.args, spaceKey }} />\n </ClientContext.Provider>\n ))}\n </div>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { DecoratorFunction } from '@storybook/csf';\nimport type { ReactRenderer } from '@storybook/react';\nimport React from 'react';\n\nexport const FullscreenDecorator = (className?: string): DecoratorFunction<ReactRenderer> => {\n return (Story) => (\n <div className={['flex fixed inset-0 overflow-hidden', className].join(' ')}>\n <Story />\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4BAAc;ACAd,mBAAoD;AAEpD,oBAAuC;AAEvC,qBAA+C;AAC/C,IAAAA,gBAAsC;AACtC,oBAAsB;ACJtB,IAAAA,gBAAkB;ADSlB,IAAMC,cAAc,IAAIC,2BAAAA;AA2BjB,IAAMC,iBAAiB,CAAmCC,UAAAA;AAC/D,QAAM,EACJC,WAAWC,WACXC,UAAUC,UACVC,QAAQ,GACRC,YAAY,oCACZC,OACAC,gBACAC,aACAC,cAAa,IACXV;AACJ,MAAIA,MAAMW,yBAAyB,MAAM;AACvCA,6CAAAA;EACF;AAEA,QAAM,CAACC,SAASC,UAAAA,QAAcC,uBAASd,MAAMY,WAAW,CAAA,CAAE;AAC1D,QAAM,CAACG,UAAUC,WAAAA,QAAeF,uBAAAA;AAEhCG,8BAAU,MAAA;AACR,UAAMC,UAAUC,WAAW,YAAA;AACzB,YAAMP,WAAU;WAAIQ,MAAMf,KAAAA;QAAQgB,IAAI,CAACC,MAAM,IAAIC,qBAAO;QAAEC,UAAU3B,YAAY4B,YAAW;MAAG,CAAA,CAAA;AAC9F,YAAMC,QAAQC,IAAIf,SAAQS,IAAI,CAACO,WAAWA,OAAOC,WAAU,CAAA,CAAA;AAC3DtB,eAASK,SAAQS,IAAI,CAACO,WAAWA,OAAOE,UAAS,GAAIvB,KAAAA,CAAAA;AAErD,UAAIC,kBAAkBC,aAAa;AACjC,cAAMiB,QAAQC,IAAIf,SAAQS,IAAI,CAACO,WAAWA,OAAOG,KAAKvB,eAAc,CAAA,CAAA;MACtE;AAEA,UAAIC,aAAa;AACf,cAAMuB,QAAQ,MAAMpB,SAAQ,CAAA,EAAGqB,OAAOC,OAAO;UAAEC,MAAMC,oBAAMC,SAASC,YAAW;QAAG,CAAA;AAClFtB,oBAAYgB,MAAMO,GAAG;AACrB,cAAM7B,gBAAgBsB,KAAAA;AACtB,cAAMN,QAAQC,IACZf,SAAQ4B,MAAM,CAAA,EAAGnB,IAAI,CAACO,eAAWa,kCAAkB;UAAEC,MAAMV;UAAqBW,OAAOf,OAAOK;QAAO,CAAA,CAAA,CAAA;MAEzG;AAEApB,iBAAWD,QAAAA;IACb,CAAA;AAEA,WAAO,MAAMgC,aAAa1B,OAAAA;EAC5B,GAAG,CAAA,CAAE;AAEL,MAAIN,QAAQiC,WAAW,GAAG;AACxB,WAAO;EACT;AAEA,SACE,6BAAAC,QAAA,cAAA,aAAAA,QAAA,UAAA,MACG1C,YAAY,6BAAA0C,QAAA,cAAC1C,UAAAA;IAASQ;MACvB,6BAAAkC,QAAA,cAACC,OAAAA;IAAIzC;KACFM,QAAQS,IAAI,CAACO,QAAQoB,UACpB,6BAAAF,QAAA,cAACG,oCAAcC,UAAQ;IAACX,KAAKS;IAAOG,OAAO;MAAEvB;IAAO;KAClD,6BAAAkB,QAAA,cAAC5C,WAAAA;IAAUkD,IAAIJ;IAAO3C,OAAOO,QAAQiC;IAAc,GAAG7C,MAAMqD;IAAMtC;;AAM9E;AC7FO,IAAMuC,sBAAsB,CAAChD,cAAAA;AAClC,SAAO,CAACiD,UACNT,8BAAAA,QAAA,cAACC,OAAAA;IAAIzC,WAAW;MAAC;MAAsCA;MAAWkD,KAAK,GAAA;KACrEV,8BAAAA,QAAA,cAACS,OAAAA,IAAAA,CAAAA;AAGP;",
6
+ "names": ["import_react", "testBuilder", "TestBuilder", "ClientRepeater", "props", "component", "Component", "controls", "Controls", "count", "className", "types", "createIdentity", "createSpace", "onCreateSpace", "registerSignalFactory", "clients", "setClients", "useState", "spaceKey", "setSpaceKey", "useEffect", "timeout", "setTimeout", "Array", "map", "_", "Client", "services", "createLocal", "Promise", "all", "client", "initialize", "addSchema", "halo", "space", "spaces", "create", "name", "faker", "commerce", "productName", "key", "slice", "performInvitation", "host", "guest", "clearTimeout", "length", "React", "div", "index", "ClientContext", "Provider", "value", "id", "args", "FullscreenDecorator", "Story", "join"]
7
7
  }
@@ -1,6 +1,6 @@
1
- import type { QueryOptions, TypedObject, FilterSource, Space } from '@dxos/client/echo';
1
+ import type { QueryOptions, OpaqueEchoObject, FilterSource, Space } from '@dxos/client/echo';
2
2
  type UseQuery = {
3
- <T extends TypedObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];
3
+ <T extends OpaqueEchoObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];
4
4
  };
5
5
  /**
6
6
  * Create subscription.
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.d.ts","sourceRoot":"","sources":["../../../../src/echo/useQuery.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAS,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/F,KAAK,QAAQ,GAAG;IACd,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;CAC7G,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,QAAQ,EAAE,QAkBtB,CAAC"}
1
+ {"version":3,"file":"useQuery.d.ts","sourceRoot":"","sources":["../../../../src/echo/useQuery.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAS,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpG,KAAK,QAAQ,GAAG;IACd,CAAC,CAAC,SAAS,gBAAgB,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;CAClH,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,QAAQ,EAAE,QAkBtB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type FC } from 'react';
2
2
  import { Client } from '@dxos/client';
3
- import { type Space, type TypeCollection } from '@dxos/client/echo';
3
+ import { type Space } from '@dxos/client/echo';
4
4
  import { type MaybePromise } from '@dxos/util';
5
5
  export type RepeatedComponentProps = {
6
6
  id: number;
@@ -15,7 +15,7 @@ export type ClientRepeaterProps<P extends RepeatedComponentProps> = {
15
15
  count?: number;
16
16
  registerSignalFactory?: boolean;
17
17
  className?: string;
18
- types?: TypeCollection;
18
+ types?: Parameters<Client['addSchema']>;
19
19
  createIdentity?: boolean;
20
20
  createSpace?: boolean;
21
21
  onCreateSpace?: (space: Space) => MaybePromise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRepeater.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAY,KAAK,EAAE,EAAa,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAkB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAmB,KAAK,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIrF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,sBAAsB,IAAI;IAClE,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,QAAQ,CAAC,EAAE,EAAE,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,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AC,WAAW,CAAC,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;;GAGG;AAMH,eAAO,MAAM,cAAc,yFA2D1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-client",
3
- "version": "0.4.10-main.1ada56e",
3
+ "version": "0.4.10-main.1be21a3",
4
4
  "description": "React client API",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -83,17 +83,17 @@
83
83
  }
84
84
  },
85
85
  "dependencies": {
86
- "@dxos/async": "0.4.10-main.1ada56e",
87
- "@dxos/client": "0.4.10-main.1ada56e",
88
- "@dxos/config": "0.4.10-main.1ada56e",
89
- "@dxos/debug": "0.4.10-main.1ada56e",
90
- "@dxos/echo-signals": "0.4.10-main.1ada56e",
91
- "@dxos/invariant": "0.4.10-main.1ada56e",
92
- "@dxos/codec-protobuf": "0.4.10-main.1ada56e",
93
- "@dxos/log": "0.4.10-main.1ada56e",
94
- "@dxos/node-std": "0.4.10-main.1ada56e",
95
- "@dxos/react-async": "0.4.10-main.1ada56e",
96
- "@dxos/util": "0.4.10-main.1ada56e"
86
+ "@dxos/async": "0.4.10-main.1be21a3",
87
+ "@dxos/client": "0.4.10-main.1be21a3",
88
+ "@dxos/config": "0.4.10-main.1be21a3",
89
+ "@dxos/codec-protobuf": "0.4.10-main.1be21a3",
90
+ "@dxos/debug": "0.4.10-main.1be21a3",
91
+ "@dxos/echo-signals": "0.4.10-main.1be21a3",
92
+ "@dxos/log": "0.4.10-main.1be21a3",
93
+ "@dxos/node-std": "0.4.10-main.1be21a3",
94
+ "@dxos/react-async": "0.4.10-main.1be21a3",
95
+ "@dxos/invariant": "0.4.10-main.1be21a3",
96
+ "@dxos/util": "0.4.10-main.1be21a3"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@testing-library/dom": "^8.17.1",
@@ -104,10 +104,10 @@
104
104
  "react": "^18.2.0",
105
105
  "react-dom": "^18.2.0",
106
106
  "yjs": "^13.6.10",
107
- "@dxos/random": "0.4.10-main.1ada56e",
108
- "@dxos/react-ui": "0.4.10-main.1ada56e",
109
- "@dxos/react-ui-theme": "0.4.10-main.1ada56e",
110
- "@dxos/storybook-utils": "0.4.10-main.1ada56e"
107
+ "@dxos/react-ui": "0.4.10-main.1be21a3",
108
+ "@dxos/storybook-utils": "0.4.10-main.1be21a3",
109
+ "@dxos/random": "0.4.10-main.1be21a3",
110
+ "@dxos/react-ui-theme": "0.4.10-main.1be21a3"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "react": "*",
@@ -115,7 +115,7 @@
115
115
  },
116
116
  "optionalDependencies": {
117
117
  "yjs": "^13.6.10",
118
- "@dxos/random": "0.4.10-main.1ada56e"
118
+ "@dxos/random": "0.4.10-main.1be21a3"
119
119
  },
120
120
  "publishConfig": {
121
121
  "access": "public"
@@ -4,17 +4,17 @@
4
4
 
5
5
  import { useMemo, useSyncExternalStore } from 'react';
6
6
 
7
- import type { QueryOptions, TypedObject, Query, FilterSource, Space } from '@dxos/client/echo';
7
+ import type { QueryOptions, OpaqueEchoObject, Query, FilterSource, Space } from '@dxos/client/echo';
8
8
 
9
9
  type UseQuery = {
10
- <T extends TypedObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];
10
+ <T extends OpaqueEchoObject>(space?: Space, filter?: FilterSource<T>, options?: QueryOptions, deps?: any[]): T[];
11
11
  };
12
12
 
13
13
  /**
14
14
  * Create subscription.
15
15
  */
16
16
  // TODO(burdon): Support typed operator filters (e.g., Note.filter(note => ...)).
17
- export const useQuery: UseQuery = <T extends TypedObject>(
17
+ export const useQuery: UseQuery = <T extends OpaqueEchoObject>(
18
18
  space?: Space,
19
19
  filter?: FilterSource<T>,
20
20
  options?: QueryOptions,
@@ -15,7 +15,7 @@ export const useHaloInvitations = () => {
15
15
  const subscription = client.halo.invitations.subscribe(() => listener());
16
16
  return () => subscription.unsubscribe();
17
17
  },
18
- () => client.halo.invitations.get(),
18
+ () => (client.halo.opened ? client.halo.invitations.get() : []),
19
19
  ) ?? [];
20
20
 
21
21
  return invitations;
@@ -5,7 +5,7 @@
5
5
  import React, { useState, type FC, useEffect } from 'react';
6
6
 
7
7
  import { Client, type PublicKey } from '@dxos/client';
8
- import { type SpaceProxy, type Space, type TypeCollection } from '@dxos/client/echo';
8
+ import { type SpaceProxy, type Space } from '@dxos/client/echo';
9
9
  import { TestBuilder, performInvitation } from '@dxos/client/testing';
10
10
  import { registerSignalFactory } from '@dxos/echo-signals/react';
11
11
  import { faker } from '@dxos/random';
@@ -24,7 +24,7 @@ export type ClientRepeaterProps<P extends RepeatedComponentProps> = {
24
24
  count?: number;
25
25
  registerSignalFactory?: boolean;
26
26
  className?: string;
27
- types?: TypeCollection;
27
+ types?: Parameters<Client['addSchema']>;
28
28
  createIdentity?: boolean;
29
29
  createSpace?: boolean;
30
30
  onCreateSpace?: (space: Space) => MaybePromise<void>;
@@ -62,7 +62,7 @@ export const ClientRepeater = <P extends RepeatedComponentProps>(props: ClientRe
62
62
  const timeout = setTimeout(async () => {
63
63
  const clients = [...Array(count)].map((_) => new Client({ services: testBuilder.createLocal() }));
64
64
  await Promise.all(clients.map((client) => client.initialize()));
65
- types && clients.map((client) => client.spaces.addSchema(types));
65
+ types && clients.map((client) => client.addSchema(...types));
66
66
 
67
67
  if (createIdentity || createSpace) {
68
68
  await Promise.all(clients.map((client) => client.halo.createIdentity()));