@liveblocks/react 3.8.1 → 3.9.0

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.
@@ -325,11 +325,19 @@ function find(it, predicate) {
325
325
 
326
326
  // src/lib/querying.ts
327
327
 
328
- function makeThreadsFilter(query) {
329
- return (thread) => matchesThreadsQuery(thread, query) && matchesMetadata(thread, query);
328
+
329
+
330
+
331
+
332
+ function makeThreadsFilter(query, subscriptions) {
333
+ return (thread) => matchesThreadsQuery(thread, query, subscriptions) && matchesMetadata(thread, query);
330
334
  }
331
- function matchesThreadsQuery(thread, q) {
332
- return q.resolved === void 0 || thread.resolved === q.resolved;
335
+ function matchesThreadsQuery(thread, q, subscriptions) {
336
+ let subscription = void 0;
337
+ if (subscriptions) {
338
+ subscription = _optionalChain([subscriptions, 'optionalAccess', _2 => _2[_core.getSubscriptionKey.call(void 0, "thread", thread.id)]]);
339
+ }
340
+ return (q.resolved === void 0 || thread.resolved === q.resolved) && (q.subscribed === void 0 || q.subscribed === true && subscription !== void 0 || q.subscribed === false && subscription === void 0);
333
341
  }
334
342
  function matchesMetadata(thread, q) {
335
343
  const metadata = thread.metadata;
@@ -409,7 +417,7 @@ var ThreadDB = class _ThreadDB {
409
417
  /** Returns an existing thread by ID. Will never return a deleted thread. */
410
418
  get(threadId) {
411
419
  const thread = this.getEvenIfDeleted(threadId);
412
- return _optionalChain([thread, 'optionalAccess', _2 => _2.deletedAt]) ? void 0 : thread;
420
+ return _optionalChain([thread, 'optionalAccess', _3 => _3.deletedAt]) ? void 0 : thread;
413
421
  }
414
422
  /** Returns the (possibly deleted) thread by ID. */
415
423
  getEvenIfDeleted(threadId) {
@@ -475,15 +483,17 @@ var ThreadDB = class _ThreadDB {
475
483
  * 'desc' means by updatedAt DESC
476
484
  *
477
485
  * Will never return deleted threads in the result.
486
+ *
487
+ * Subscriptions are needed to filter threads based on the user's subscriptions.
478
488
  */
479
- findMany(roomId, query, direction) {
489
+ findMany(roomId, query, direction, subscriptions) {
480
490
  const index = direction === "desc" ? this.#desc : this.#asc;
481
491
  const crit = [];
482
492
  if (roomId !== void 0) {
483
493
  crit.push((t) => t.roomId === roomId);
484
494
  }
485
495
  if (query !== void 0) {
486
- crit.push(makeThreadsFilter(query));
496
+ crit.push(makeThreadsFilter(query, subscriptions));
487
497
  }
488
498
  return Array.from(index.filter((t) => crit.every((pred) => pred(t))));
489
499
  }
@@ -543,7 +553,7 @@ var PaginatedResource = class {
543
553
  }
544
554
  async #fetchMore() {
545
555
  const state = this.#signal.get();
546
- if (!_optionalChain([state, 'access', _3 => _3.data, 'optionalAccess', _4 => _4.cursor]) || state.data.isFetchingMore) {
556
+ if (!_optionalChain([state, 'access', _4 => _4.data, 'optionalAccess', _5 => _5.cursor]) || state.data.isFetchingMore) {
547
557
  return;
548
558
  }
549
559
  this.#patch({ isFetchingMore: true });
@@ -564,7 +574,7 @@ var PaginatedResource = class {
564
574
  }
565
575
  fetchMore() {
566
576
  const state = this.#signal.get();
567
- if (!_optionalChain([state, 'access', _5 => _5.data, 'optionalAccess', _6 => _6.cursor])) return noop;
577
+ if (!_optionalChain([state, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.cursor])) return noop;
568
578
  if (!this.#pendingFetchMore) {
569
579
  this.#pendingFetchMore = this.#fetchMore().finally(() => {
570
580
  this.#pendingFetchMore = null;
@@ -614,10 +624,12 @@ var SinglePageResource = class {
614
624
  #signal;
615
625
 
616
626
  #fetchPage;
617
- constructor(fetchPage) {
627
+ #autoRetry = true;
628
+ constructor(fetchPage, autoRetry2 = true) {
618
629
  this.#signal = new (0, _core.Signal)(ASYNC_LOADING);
619
630
  this.signal = this.#signal.asReadonly();
620
631
  this.#fetchPage = fetchPage;
632
+ this.#autoRetry = autoRetry2;
621
633
  autobind(this);
622
634
  }
623
635
  get() {
@@ -628,11 +640,7 @@ var SinglePageResource = class {
628
640
  if (this.#cachedPromise) {
629
641
  return this.#cachedPromise;
630
642
  }
631
- const initialFetcher$ = _core.autoRetry.call(void 0,
632
- () => this.#fetchPage(),
633
- 5,
634
- [5e3, 5e3, 1e4, 15e3]
635
- );
643
+ const initialFetcher$ = this.#autoRetry ? _core.autoRetry.call(void 0, () => this.#fetchPage(), 5, [5e3, 5e3, 1e4, 15e3]) : this.#fetchPage();
636
644
  const promise = usify(initialFetcher$);
637
645
  promise.then(
638
646
  () => {
@@ -640,10 +648,12 @@ var SinglePageResource = class {
640
648
  },
641
649
  (err) => {
642
650
  this.#signal.set(ASYNC_ERR(err));
643
- setTimeout(() => {
644
- this.#cachedPromise = null;
645
- this.#signal.set(ASYNC_LOADING);
646
- }, 5e3);
651
+ if (this.#autoRetry) {
652
+ setTimeout(() => {
653
+ this.#cachedPromise = null;
654
+ this.#signal.set(ASYNC_LOADING);
655
+ }, 5e3);
656
+ }
647
657
  }
648
658
  );
649
659
  this.#cachedPromise = promise;
@@ -822,6 +832,19 @@ function createStore_forHistoryVersions() {
822
832
  update
823
833
  };
824
834
  }
835
+ function createStore_forUrlsMetadata() {
836
+ const baseSignal = new (0, _core.MutableSignal)(/* @__PURE__ */ new Map());
837
+ function update(url, metadata) {
838
+ baseSignal.mutate((lut) => {
839
+ lut.set(url, metadata);
840
+ });
841
+ }
842
+ return {
843
+ signal: _core.DerivedSignal.from(baseSignal, (m) => Object.fromEntries(m)),
844
+ // Mutations
845
+ update
846
+ };
847
+ }
825
848
  function createStore_forPermissionHints() {
826
849
  const permissionsByRoomId = new (0, _core.DefaultMap)(
827
850
  () => new (0, _core.Signal)(/* @__PURE__ */ new Set())
@@ -934,6 +957,7 @@ var UmbrellaStore = class {
934
957
 
935
958
 
936
959
 
960
+
937
961
  //
938
962
  // Output signals.
939
963
  // (Readonly, clean, consistent. With optimistic updates applied.)
@@ -979,6 +1003,7 @@ var UmbrellaStore = class {
979
1003
  );
980
1004
  this.historyVersions = createStore_forHistoryVersions();
981
1005
  this.unreadNotificationsCount = createStore_forUnreadNotificationsCount();
1006
+ this.urlsMetadata = createStore_forUrlsMetadata();
982
1007
  const threadifications = _core.DerivedSignal.from(
983
1008
  this.threads.signal,
984
1009
  this.notifications.signal,
@@ -1026,11 +1051,13 @@ var UmbrellaStore = class {
1026
1051
  if (result.isLoading || result.error) {
1027
1052
  return result;
1028
1053
  }
1054
+ const subscriptions = threadSubscriptions.get().subscriptions;
1029
1055
  const threads2 = this.outputs.threads.get().findMany(
1030
1056
  void 0,
1031
1057
  // Do _not_ filter by roomId
1032
1058
  _nullishCoalesce(query, () => ( {})),
1033
- "desc"
1059
+ "desc",
1060
+ subscriptions
1034
1061
  );
1035
1062
  const page = result.data;
1036
1063
  return {
@@ -1074,7 +1101,8 @@ var UmbrellaStore = class {
1074
1101
  if (result.isLoading || result.error) {
1075
1102
  return result;
1076
1103
  }
1077
- const threads2 = this.outputs.threads.get().findMany(roomId, _nullishCoalesce(query, () => ( {})), "asc");
1104
+ const subscriptions = threadSubscriptions.get().subscriptions;
1105
+ const threads2 = this.outputs.threads.get().findMany(roomId, _nullishCoalesce(query, () => ( {})), "asc", subscriptions);
1078
1106
  const page = result.data;
1079
1107
  return {
1080
1108
  isLoading: false,
@@ -1305,6 +1333,22 @@ var UmbrellaStore = class {
1305
1333
  }, _core.shallow);
1306
1334
  return { signal, waitUntilLoaded: resource.waitUntilLoaded };
1307
1335
  });
1336
+ const urlMetadataByUrl = new (0, _core.DefaultMap)(
1337
+ (url) => {
1338
+ const resource = new SinglePageResource(async () => {
1339
+ const metadata = await this.#client[_core.kInternal].httpClient.getUrlMetadata(url);
1340
+ this.urlsMetadata.update(url, metadata);
1341
+ }, false);
1342
+ const signal = _core.DerivedSignal.from(() => {
1343
+ const result = resource.get();
1344
+ if (result.isLoading || result.error) {
1345
+ return result;
1346
+ }
1347
+ return ASYNC_OK("metadata", _core.nn.call(void 0, this.urlsMetadata.signal.get()[url]));
1348
+ }, _core.shallow);
1349
+ return { signal, waitUntilLoaded: resource.waitUntilLoaded };
1350
+ }
1351
+ );
1308
1352
  this.outputs = {
1309
1353
  threadifications,
1310
1354
  threads,
@@ -1319,7 +1363,8 @@ var UmbrellaStore = class {
1319
1363
  threadSubscriptions,
1320
1364
  aiChats,
1321
1365
  messagesByChatId,
1322
- aiChatById
1366
+ aiChatById,
1367
+ urlMetadataByUrl
1323
1368
  };
1324
1369
  autobind(this);
1325
1370
  }
@@ -1800,7 +1845,12 @@ function applyOptimisticUpdates_forSubscriptions(subscriptionsLUT, threads, opti
1800
1845
  if (!update.settings.threads) {
1801
1846
  continue;
1802
1847
  }
1803
- const roomThreads = threads.findMany(update.roomId, void 0, "desc");
1848
+ const roomThreads = threads.findMany(
1849
+ update.roomId,
1850
+ void 0,
1851
+ "desc",
1852
+ void 0
1853
+ );
1804
1854
  for (const thread of roomThreads) {
1805
1855
  const subscriptionKey = _core.getSubscriptionKey.call(void 0, "thread", thread.id);
1806
1856
  switch (update.settings.threads) {
@@ -1891,7 +1941,7 @@ function applyUpsertComment(thread, comment) {
1891
1941
  updatedAt: new Date(
1892
1942
  Math.max(
1893
1943
  thread.updatedAt.getTime(),
1894
- _optionalChain([comment, 'access', _7 => _7.editedAt, 'optionalAccess', _8 => _8.getTime, 'call', _9 => _9()]) || comment.createdAt.getTime()
1944
+ _optionalChain([comment, 'access', _8 => _8.editedAt, 'optionalAccess', _9 => _9.getTime, 'call', _10 => _10()]) || comment.createdAt.getTime()
1895
1945
  )
1896
1946
  ),
1897
1947
  comments: updatedComments
@@ -2048,7 +2098,7 @@ function selectorFor_useUnreadInboxNotificationsCount(result) {
2048
2098
  return ASYNC_OK("count", result.count);
2049
2099
  }
2050
2100
  function selectorFor_useUser(state, userId) {
2051
- if (state === void 0 || _optionalChain([state, 'optionalAccess', _10 => _10.isLoading])) {
2101
+ if (state === void 0 || _optionalChain([state, 'optionalAccess', _11 => _11.isLoading])) {
2052
2102
  return _nullishCoalesce(state, () => ( { isLoading: true }));
2053
2103
  }
2054
2104
  if (state.error) {
@@ -2066,7 +2116,7 @@ function selectorFor_useUser(state, userId) {
2066
2116
  };
2067
2117
  }
2068
2118
  function selectorFor_useRoomInfo(state, roomId) {
2069
- if (state === void 0 || _optionalChain([state, 'optionalAccess', _11 => _11.isLoading])) {
2119
+ if (state === void 0 || _optionalChain([state, 'optionalAccess', _12 => _12.isLoading])) {
2070
2120
  return _nullishCoalesce(state, () => ( { isLoading: true }));
2071
2121
  }
2072
2122
  if (state.error) {
@@ -2084,7 +2134,7 @@ function selectorFor_useRoomInfo(state, roomId) {
2084
2134
  };
2085
2135
  }
2086
2136
  function selectorFor_useGroupInfo(state, groupId) {
2087
- if (state === void 0 || _optionalChain([state, 'optionalAccess', _12 => _12.isLoading])) {
2137
+ if (state === void 0 || _optionalChain([state, 'optionalAccess', _13 => _13.isLoading])) {
2088
2138
  return _nullishCoalesce(state, () => ( { isLoading: true }));
2089
2139
  }
2090
2140
  if (state.error) {
@@ -2225,6 +2275,7 @@ function makeLiveblocksContextBundle(client) {
2225
2275
  useCreateAiChat,
2226
2276
  useDeleteAiChat,
2227
2277
  useSendAiMessage,
2278
+ useUrlMetadata,
2228
2279
  ...shared.classic,
2229
2280
  suspense: {
2230
2281
  LiveblocksProvider: LiveblocksProvider2,
@@ -2245,6 +2296,7 @@ function makeLiveblocksContextBundle(client) {
2245
2296
  useCreateAiChat,
2246
2297
  useDeleteAiChat,
2247
2298
  useSendAiMessage,
2299
+ useUrlMetadata: useUrlMetadataSuspense,
2248
2300
  ...shared.suspense
2249
2301
  }
2250
2302
  };
@@ -2252,7 +2304,7 @@ function makeLiveblocksContextBundle(client) {
2252
2304
  }
2253
2305
  function useInboxNotifications_withClient(client, selector, isEqual, options) {
2254
2306
  const { store, notificationsPoller: poller } = getLiveblocksExtrasForClient(client);
2255
- const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _13 => _13.query]));
2307
+ const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _14 => _14.query]));
2256
2308
  _react.useEffect.call(void 0,
2257
2309
  () => void store.outputs.loadingNotifications.getOrCreate(queryKey).waitUntilLoaded()
2258
2310
  // NOTE: Deliberately *not* using a dependency array here!
@@ -2280,7 +2332,7 @@ function useInboxNotifications_withClient(client, selector, isEqual, options) {
2280
2332
  function useInboxNotificationsSuspense_withClient(client, options) {
2281
2333
  ensureNotServerSide();
2282
2334
  const store = getLiveblocksExtrasForClient(client).store;
2283
- const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _14 => _14.query]));
2335
+ const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _15 => _15.query]));
2284
2336
  use(
2285
2337
  store.outputs.loadingNotifications.getOrCreate(queryKey).waitUntilLoaded()
2286
2338
  );
@@ -2296,7 +2348,7 @@ function useInboxNotificationsSuspense_withClient(client, options) {
2296
2348
  }
2297
2349
  function useUnreadInboxNotificationsCount_withClient(client, options) {
2298
2350
  const { store, unreadNotificationsCountPollersByQueryKey: pollers } = getLiveblocksExtrasForClient(client);
2299
- const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _15 => _15.query]));
2351
+ const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _16 => _16.query]));
2300
2352
  const poller = pollers.getOrCreate(queryKey);
2301
2353
  _react.useEffect.call(void 0,
2302
2354
  () => void store.outputs.unreadNotificationsCount.getOrCreate(queryKey).waitUntilLoaded()
@@ -2325,7 +2377,7 @@ function useUnreadInboxNotificationsCount_withClient(client, options) {
2325
2377
  function useUnreadInboxNotificationsCountSuspense_withClient(client, options) {
2326
2378
  ensureNotServerSide();
2327
2379
  const store = getLiveblocksExtrasForClient(client).store;
2328
- const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _16 => _16.query]));
2380
+ const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _17 => _17.query]));
2329
2381
  use(
2330
2382
  store.outputs.unreadNotificationsCount.getOrCreate(queryKey).waitUntilLoaded()
2331
2383
  );
@@ -2496,7 +2548,7 @@ function useUpdateNotificationSettings_withClient(client) {
2496
2548
  store.optimisticUpdates.remove(optimisticUpdateId);
2497
2549
  if (err instanceof _core.HttpError) {
2498
2550
  if (err.status === 422) {
2499
- const msg = [_optionalChain([err, 'access', _17 => _17.details, 'optionalAccess', _18 => _18.error]), _optionalChain([err, 'access', _19 => _19.details, 'optionalAccess', _20 => _20.reason])].filter(Boolean).join("\n");
2551
+ const msg = [_optionalChain([err, 'access', _18 => _18.details, 'optionalAccess', _19 => _19.error]), _optionalChain([err, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.reason])].filter(Boolean).join("\n");
2500
2552
  _core.console.error(msg);
2501
2553
  }
2502
2554
  client[_core.kInternal].emitError(
@@ -2731,7 +2783,7 @@ function useGroupInfoSuspense_withClient(client, groupId) {
2731
2783
  function useAiChats(options) {
2732
2784
  const client = useClient();
2733
2785
  const store = getUmbrellaStoreForClient(client);
2734
- const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _21 => _21.query]));
2786
+ const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _22 => _22.query]));
2735
2787
  useEnsureAiConnection(client);
2736
2788
  _react.useEffect.call(void 0,
2737
2789
  () => void store.outputs.aiChats.getOrCreate(queryKey).waitUntilLoaded()
@@ -2755,7 +2807,7 @@ function useAiChatsSuspense(options) {
2755
2807
  const client = useClient();
2756
2808
  const store = getUmbrellaStoreForClient(client);
2757
2809
  useEnsureAiConnection(client);
2758
- const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _22 => _22.query]));
2810
+ const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _23 => _23.query]));
2759
2811
  use(store.outputs.aiChats.getOrCreate(queryKey).waitUntilLoaded());
2760
2812
  const result = useAiChats(options);
2761
2813
  _core.assert.call(void 0, !result.error, "Did not expect error");
@@ -2767,7 +2819,7 @@ function useAiChatMessages(chatId, options) {
2767
2819
  const store = getUmbrellaStoreForClient(client);
2768
2820
  useEnsureAiConnection(client);
2769
2821
  _react.useEffect.call(void 0,
2770
- () => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _23 => _23.branchId]), () => ( null))).waitUntilLoaded()
2822
+ () => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.branchId]), () => ( null))).waitUntilLoaded()
2771
2823
  // NOTE: Deliberately *not* using a dependency array here!
2772
2824
  //
2773
2825
  // It is important to call waitUntil on *every* render.
@@ -2778,7 +2830,7 @@ function useAiChatMessages(chatId, options) {
2778
2830
  // *next* render after that, a *new* fetch/promise will get created.
2779
2831
  );
2780
2832
  return useSignal(
2781
- store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.branchId]), () => ( null))).signal
2833
+ store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _25 => _25.branchId]), () => ( null))).signal
2782
2834
  );
2783
2835
  }
2784
2836
  function useAiChatMessagesSuspense(chatId, options) {
@@ -2787,7 +2839,7 @@ function useAiChatMessagesSuspense(chatId, options) {
2787
2839
  const store = getUmbrellaStoreForClient(client);
2788
2840
  useEnsureAiConnection(client);
2789
2841
  use(
2790
- store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _25 => _25.branchId]), () => ( null))).waitUntilLoaded()
2842
+ store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.branchId]), () => ( null))).waitUntilLoaded()
2791
2843
  );
2792
2844
  const result = useAiChatMessages(chatId, options);
2793
2845
  _core.assert.call(void 0, !result.error, "Did not expect error");
@@ -2822,6 +2874,32 @@ function useAiChatSuspense(chatId) {
2822
2874
  _core.assert.call(void 0, !result.isLoading, "Did not expect loading");
2823
2875
  return result;
2824
2876
  }
2877
+ function useUrlMetadata(url) {
2878
+ const client = useClient();
2879
+ const store = getUmbrellaStoreForClient(client);
2880
+ _react.useEffect.call(void 0,
2881
+ () => void store.outputs.urlMetadataByUrl.getOrCreate(url).waitUntilLoaded()
2882
+ // NOTE: Deliberately *not* using a dependency array here!
2883
+ //
2884
+ // It is important to call waitUntil on *every* render.
2885
+ // This is harmless though, on most renders, except:
2886
+ // 1. The very first render, in which case we'll want to trigger the initial page fetch.
2887
+ // 2. All other subsequent renders now "just" return the same promise (a quick operation).
2888
+ // 3. If ever the promise would fail, then after 5 seconds it would reset, and on the very
2889
+ // *next* render after that, a *new* fetch/promise will get created.
2890
+ );
2891
+ return useSignal(store.outputs.urlMetadataByUrl.getOrCreate(url).signal);
2892
+ }
2893
+ function useUrlMetadataSuspense(url) {
2894
+ ensureNotServerSide();
2895
+ const client = useClient();
2896
+ const store = getUmbrellaStoreForClient(client);
2897
+ use(store.outputs.urlMetadataByUrl.getOrCreate(url).waitUntilLoaded());
2898
+ const result = useUrlMetadata(url);
2899
+ _core.assert.call(void 0, !result.error, "Did not expect error");
2900
+ _core.assert.call(void 0, !result.isLoading, "Did not expect loading");
2901
+ return result;
2902
+ }
2825
2903
  function useCreateAiChat() {
2826
2904
  const client = useClient();
2827
2905
  return _react.useCallback.call(void 0,
@@ -2854,6 +2932,7 @@ function useDeleteAiChat() {
2854
2932
  [client]
2855
2933
  );
2856
2934
  }
2935
+ var DISCONNECTED = Object.freeze({ status: "disconnected" });
2857
2936
  var LOADING = Object.freeze({ status: "loading" });
2858
2937
  var IDLE = Object.freeze({ status: "idle" });
2859
2938
  function useAiChatStatus(chatId, branchId) {
@@ -2863,7 +2942,14 @@ function useAiChatStatus(chatId, branchId) {
2863
2942
  _react.useEffect.call(void 0,
2864
2943
  () => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(branchId, () => ( null))).waitUntilLoaded()
2865
2944
  );
2866
- return useSignal(
2945
+ const isAvailable = useSignal(
2946
+ // Subscribe to connection status signal
2947
+ client[_core.kInternal].ai.signals.status\u03A3,
2948
+ // "Disconnected" means the AI service is not available
2949
+ // as it represents a final error status.
2950
+ (status) => status !== "disconnected"
2951
+ );
2952
+ const chatStatus = useSignal(
2867
2953
  // Signal
2868
2954
  store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(branchId, () => ( null))).signal,
2869
2955
  // Selector
@@ -2872,24 +2958,31 @@ function useAiChatStatus(chatId, branchId) {
2872
2958
  if (result.error) return IDLE;
2873
2959
  const messages = result.messages;
2874
2960
  const lastMessage = messages[messages.length - 1];
2875
- if (_optionalChain([lastMessage, 'optionalAccess', _26 => _26.role]) !== "assistant") return IDLE;
2961
+ if (_optionalChain([lastMessage, 'optionalAccess', _27 => _27.role]) !== "assistant") return IDLE;
2876
2962
  if (lastMessage.status !== "generating" && lastMessage.status !== "awaiting-tool")
2877
2963
  return IDLE;
2878
2964
  const contentSoFar = lastMessage.contentSoFar;
2879
2965
  const lastPart = contentSoFar[contentSoFar.length - 1];
2880
- if (_optionalChain([lastPart, 'optionalAccess', _27 => _27.type]) === "tool-invocation") {
2966
+ if (_optionalChain([lastPart, 'optionalAccess', _28 => _28.type]) === "tool-invocation") {
2881
2967
  return {
2882
2968
  status: "generating",
2883
2969
  partType: "tool-invocation",
2884
2970
  toolName: lastPart.name
2885
2971
  };
2886
2972
  } else {
2887
- return { status: "generating", partType: _optionalChain([lastPart, 'optionalAccess', _28 => _28.type]) };
2973
+ return {
2974
+ status: "generating",
2975
+ partType: _optionalChain([lastPart, 'optionalAccess', _29 => _29.type])
2976
+ };
2888
2977
  }
2889
2978
  },
2890
2979
  // Consider { status: "generating", partType: "text" } and { status: "generating", partType: "text" } equal
2891
2980
  _core.shallow
2892
2981
  );
2982
+ if (!isAvailable) {
2983
+ return DISCONNECTED;
2984
+ }
2985
+ return chatStatus;
2893
2986
  }
2894
2987
  function useSendAiMessage(chatId, options) {
2895
2988
  const client = useClient();
@@ -2907,7 +3000,7 @@ function useSendAiMessage(chatId, options) {
2907
3000
  "chatId must be provided to either `useSendAiMessage` or its returned function."
2908
3001
  )));
2909
3002
  const messages = client[_core.kInternal].ai.signals.getChatMessagesForBranch\u03A3(resolvedChatId).get();
2910
- if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess', _29 => _29.copilotId])) {
3003
+ if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess', _30 => _30.copilotId])) {
2911
3004
  _core.console.warn(
2912
3005
  `No copilot ID was provided to useSendAiMessage when sending the message "${messageText.slice(
2913
3006
  0,
@@ -2919,8 +3012,8 @@ To ensure the correct copilot ID is used, specify it either through the hook as
2919
3012
  )}\u2026", copilotId: "co_xxx" })'`
2920
3013
  );
2921
3014
  }
2922
- const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess', _30 => _30.copilotId]))), () => ( client[_core.kInternal].ai.getLastUsedCopilotId(resolvedChatId)));
2923
- const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _31 => _31[messages.length - 1], 'optionalAccess', _32 => _32.id]), () => ( null));
3015
+ const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess', _31 => _31.copilotId]))), () => ( client[_core.kInternal].ai.getLastUsedCopilotId(resolvedChatId)));
3016
+ const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _32 => _32[messages.length - 1], 'optionalAccess', _33 => _33.id]), () => ( null));
2924
3017
  const content = [{ type: "text", text: messageText }];
2925
3018
  const newMessageId = client[_core.kInternal].ai[_core.kInternal].context.messagesStore.createOptimistically(
2926
3019
  resolvedChatId,
@@ -2940,14 +3033,14 @@ To ensure the correct copilot ID is used, specify it either through the hook as
2940
3033
  { id: newMessageId, parentMessageId: lastMessageId, content },
2941
3034
  targetMessageId,
2942
3035
  {
2943
- stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _33 => _33.stream]))),
3036
+ stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _34 => _34.stream]))),
2944
3037
  copilotId: resolvedCopilotId,
2945
- timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _34 => _34.timeout])))
3038
+ timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _35 => _35.timeout])))
2946
3039
  }
2947
3040
  );
2948
3041
  return newMessage;
2949
3042
  },
2950
- [client, chatId, _optionalChain([options, 'optionalAccess', _35 => _35.copilotId]), _optionalChain([options, 'optionalAccess', _36 => _36.stream]), _optionalChain([options, 'optionalAccess', _37 => _37.timeout])]
3043
+ [client, chatId, _optionalChain([options, 'optionalAccess', _36 => _36.copilotId]), _optionalChain([options, 'optionalAccess', _37 => _37.stream]), _optionalChain([options, 'optionalAccess', _38 => _38.timeout])]
2951
3044
  );
2952
3045
  }
2953
3046
  function createSharedContext(client) {
@@ -2982,7 +3075,7 @@ function createSharedContext(client) {
2982
3075
  }
2983
3076
  function useEnsureNoLiveblocksProvider(options) {
2984
3077
  const existing = useClientOrNull();
2985
- if (!_optionalChain([options, 'optionalAccess', _38 => _38.allowNesting]) && existing !== null) {
3078
+ if (!_optionalChain([options, 'optionalAccess', _39 => _39.allowNesting]) && existing !== null) {
2986
3079
  throw new Error(
2987
3080
  "You cannot nest multiple LiveblocksProvider instances in the same React tree."
2988
3081
  );
@@ -3145,8 +3238,10 @@ var _useAiChat = useAiChat;
3145
3238
  var _useAiChatSuspense = useAiChatSuspense;
3146
3239
  var _useAiChatMessages = useAiChatMessages;
3147
3240
  var _useAiChatMessagesSuspense = useAiChatMessagesSuspense;
3241
+ var _useUrlMetadata = useUrlMetadata;
3242
+ var _useUrlMetadataSuspense = useUrlMetadataSuspense;
3148
3243
  function useSyncStatus_withClient(client, options) {
3149
- const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _39 => _39.smooth]), () => ( false)));
3244
+ const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _40 => _40.smooth]), () => ( false)));
3150
3245
  if (smooth) {
3151
3246
  return useSyncStatusSmooth_withClient(client);
3152
3247
  } else {
@@ -3325,8 +3420,8 @@ function makeRoomExtrasForClient(client) {
3325
3420
  if (innerError.status === 403) {
3326
3421
  const detailedMessage = [
3327
3422
  innerError.message,
3328
- _optionalChain([innerError, 'access', _40 => _40.details, 'optionalAccess', _41 => _41.suggestion]),
3329
- _optionalChain([innerError, 'access', _42 => _42.details, 'optionalAccess', _43 => _43.docs])
3423
+ _optionalChain([innerError, 'access', _41 => _41.details, 'optionalAccess', _42 => _42.suggestion]),
3424
+ _optionalChain([innerError, 'access', _43 => _43.details, 'optionalAccess', _44 => _44.docs])
3330
3425
  ].filter(Boolean).join("\n");
3331
3426
  _core.console.error(detailedMessage);
3332
3427
  }
@@ -3621,7 +3716,7 @@ function RoomProviderInner(props) {
3621
3716
  }
3622
3717
  function useRoom(options) {
3623
3718
  const room = useRoomOrNull();
3624
- if (room === null && !_optionalChain([options, 'optionalAccess', _44 => _44.allowOutsideRoom])) {
3719
+ if (room === null && !_optionalChain([options, 'optionalAccess', _45 => _45.allowOutsideRoom])) {
3625
3720
  throw new Error("RoomProvider is missing from the React tree.");
3626
3721
  }
3627
3722
  return room;
@@ -3971,7 +4066,7 @@ function useCreateRoomThread(roomId) {
3971
4066
  thread: newThread,
3972
4067
  roomId
3973
4068
  });
3974
- const attachmentIds = _optionalChain([attachments, 'optionalAccess', _45 => _45.map, 'call', _46 => _46((attachment) => attachment.id)]);
4069
+ const attachmentIds = _optionalChain([attachments, 'optionalAccess', _46 => _46.map, 'call', _47 => _47((attachment) => attachment.id)]);
3975
4070
  client[_core.kInternal].httpClient.createThread({
3976
4071
  roomId,
3977
4072
  threadId,
@@ -4011,7 +4106,7 @@ function useDeleteRoomThread(roomId) {
4011
4106
  const { store, onMutationFailure } = getRoomExtrasForClient(client);
4012
4107
  const userId = getCurrentUserId(client);
4013
4108
  const existing = store.outputs.threads.get().get(threadId);
4014
- if (_optionalChain([existing, 'optionalAccess', _47 => _47.comments, 'optionalAccess', _48 => _48[0], 'optionalAccess', _49 => _49.userId]) !== userId) {
4109
+ if (_optionalChain([existing, 'optionalAccess', _48 => _48.comments, 'optionalAccess', _49 => _49[0], 'optionalAccess', _50 => _50.userId]) !== userId) {
4015
4110
  throw new Error("Only the thread creator can delete the thread");
4016
4111
  }
4017
4112
  const optimisticId = store.optimisticUpdates.add({
@@ -4099,7 +4194,7 @@ function useCreateRoomComment(roomId) {
4099
4194
  type: "create-comment",
4100
4195
  comment
4101
4196
  });
4102
- const attachmentIds = _optionalChain([attachments, 'optionalAccess', _50 => _50.map, 'call', _51 => _51((attachment) => attachment.id)]);
4197
+ const attachmentIds = _optionalChain([attachments, 'optionalAccess', _51 => _51.map, 'call', _52 => _52((attachment) => attachment.id)]);
4103
4198
  client[_core.kInternal].httpClient.createComment({ roomId, threadId, commentId, body, attachmentIds }).then(
4104
4199
  (newComment) => {
4105
4200
  store.createComment(newComment, optimisticId);
@@ -4155,7 +4250,7 @@ function useEditRoomComment(roomId) {
4155
4250
  attachments: _nullishCoalesce(attachments, () => ( []))
4156
4251
  }
4157
4252
  });
4158
- const attachmentIds = _optionalChain([attachments, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((attachment) => attachment.id)]);
4253
+ const attachmentIds = _optionalChain([attachments, 'optionalAccess', _53 => _53.map, 'call', _54 => _54((attachment) => attachment.id)]);
4159
4254
  client[_core.kInternal].httpClient.editComment({ roomId, threadId, commentId, body, attachmentIds }).then(
4160
4255
  (editedComment) => {
4161
4256
  store.editComment(threadId, optimisticId, editedComment);
@@ -4496,7 +4591,7 @@ function useRoomThreadSubscription(roomId, threadId) {
4496
4591
  }
4497
4592
  return {
4498
4593
  status: "subscribed",
4499
- unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _54 => _54.readAt]), () => ( null)),
4594
+ unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _55 => _55.readAt]), () => ( null)),
4500
4595
  subscribe,
4501
4596
  unsubscribe
4502
4597
  };
@@ -4707,7 +4802,7 @@ function useThreadsSuspense(options = {}) {
4707
4802
  return result;
4708
4803
  }
4709
4804
  function selectorFor_useAttachmentUrl(state) {
4710
- if (state === void 0 || _optionalChain([state, 'optionalAccess', _55 => _55.isLoading])) {
4805
+ if (state === void 0 || _optionalChain([state, 'optionalAccess', _56 => _56.isLoading])) {
4711
4806
  return _nullishCoalesce(state, () => ( { isLoading: true }));
4712
4807
  }
4713
4808
  if (state.error) {
@@ -4935,5 +5030,7 @@ var _useUpdateMyPresence = useUpdateMyPresence;
4935
5030
 
4936
5031
 
4937
5032
 
4938
- exports.ClientContext = ClientContext; exports.useClientOrNull = useClientOrNull; exports.useClient = useClient; exports.RoomContext = RoomContext; exports.useLatest = useLatest; exports.RegisterAiKnowledge = RegisterAiKnowledge; exports.RegisterAiTool = RegisterAiTool; exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; exports.useSignal = useSignal; exports.getUmbrellaStoreForClient = getUmbrellaStoreForClient; exports.useCreateAiChat = useCreateAiChat; exports.useDeleteAiChat = useDeleteAiChat; exports.useAiChatStatus = useAiChatStatus; exports.useSendAiMessage = useSendAiMessage; exports.LiveblocksProvider = LiveblocksProvider; exports.createLiveblocksContext = createLiveblocksContext; exports.useInboxNotifications = useInboxNotifications; exports.useInboxNotificationsSuspense = useInboxNotificationsSuspense; exports.useMarkAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = useMarkInboxNotificationAsRead; exports.useDeleteAllInboxNotifications = useDeleteAllInboxNotifications; exports.useDeleteInboxNotification = useDeleteInboxNotification; exports.useUnreadInboxNotificationsCount = useUnreadInboxNotificationsCount; exports.useUnreadInboxNotificationsCountSuspense = useUnreadInboxNotificationsCountSuspense; exports.useNotificationSettings = useNotificationSettings; exports.useNotificationSettingsSuspense = useNotificationSettingsSuspense; exports.useUpdateNotificationSettings = useUpdateNotificationSettings; exports.useRoomInfo = useRoomInfo; exports.useRoomInfoSuspense = useRoomInfoSuspense; exports.useGroupInfo = useGroupInfo; exports.useGroupInfoSuspense = useGroupInfoSuspense; exports._useInboxNotificationThread = _useInboxNotificationThread; exports._useUser = _useUser; exports._useUserSuspense = _useUserSuspense; exports._useUserThreads_experimental = _useUserThreads_experimental; exports._useUserThreadsSuspense_experimental = _useUserThreadsSuspense_experimental; exports._useAiChats = _useAiChats; exports._useAiChatsSuspense = _useAiChatsSuspense; exports._useAiChat = _useAiChat; exports._useAiChatSuspense = _useAiChatSuspense; exports._useAiChatMessages = _useAiChatMessages; exports._useAiChatMessagesSuspense = _useAiChatMessagesSuspense; exports.useSyncStatus = useSyncStatus; exports.useErrorListener = useErrorListener; exports.useStatus = useStatus; exports.useReportTextEditor = useReportTextEditor; exports.useYjsProvider = useYjsProvider; exports.useCreateTextMention = useCreateTextMention; exports.useDeleteTextMention = useDeleteTextMention; exports.useResolveMentionSuggestions = useResolveMentionSuggestions; exports.useMentionSuggestionsCache = useMentionSuggestionsCache; exports.useLostConnectionListener = useLostConnectionListener; exports.useHistory = useHistory; exports.useUndo = useUndo; exports.useRedo = useRedo; exports.useCanUndo = useCanUndo; exports.useCanRedo = useCanRedo; exports.useOthersConnectionIds = useOthersConnectionIds; exports.useCreateRoomThread = useCreateRoomThread; exports.useDeleteRoomThread = useDeleteRoomThread; exports.useEditRoomThreadMetadata = useEditRoomThreadMetadata; exports.useCreateComment = useCreateComment; exports.useCreateRoomComment = useCreateRoomComment; exports.useEditComment = useEditComment; exports.useEditRoomComment = useEditRoomComment; exports.useDeleteComment = useDeleteComment; exports.useDeleteRoomComment = useDeleteRoomComment; exports.useAddRoomCommentReaction = useAddRoomCommentReaction; exports.useRemoveReaction = useRemoveReaction; exports.useRemoveRoomCommentReaction = useRemoveRoomCommentReaction; exports.useMarkThreadAsRead = useMarkThreadAsRead; exports.useMarkRoomThreadAsRead = useMarkRoomThreadAsRead; exports.useMarkThreadAsResolved = useMarkThreadAsResolved; exports.useMarkRoomThreadAsResolved = useMarkRoomThreadAsResolved; exports.useMarkThreadAsUnresolved = useMarkThreadAsUnresolved; exports.useMarkRoomThreadAsUnresolved = useMarkRoomThreadAsUnresolved; exports.useSubscribeToThread = useSubscribeToThread; exports.useUnsubscribeFromThread = useUnsubscribeFromThread; exports.useThreadSubscription = useThreadSubscription; exports.useRoomThreadSubscription = useRoomThreadSubscription; exports.useHistoryVersionData = useHistoryVersionData; exports.useUpdateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useAttachmentUrl = useAttachmentUrl; exports.useRoomAttachmentUrl = useRoomAttachmentUrl; exports.useAttachmentUrlSuspense = useAttachmentUrlSuspense; exports.useRoomPermissions = useRoomPermissions; exports.createRoomContext = createRoomContext; exports._RoomProvider = _RoomProvider; exports._useBroadcastEvent = _useBroadcastEvent; exports._useOthersListener = _useOthersListener; exports._useRoom = _useRoom; exports._useIsInsideRoom = _useIsInsideRoom; exports._useAddReaction = _useAddReaction; exports._useMutation = _useMutation; exports._useCreateThread = _useCreateThread; exports._useDeleteThread = _useDeleteThread; exports._useEditThreadMetadata = _useEditThreadMetadata; exports._useEventListener = _useEventListener; exports._useMyPresence = _useMyPresence; exports._useOthersMapped = _useOthersMapped; exports._useOthersMappedSuspense = _useOthersMappedSuspense; exports._useThreads = _useThreads; exports._useThreadsSuspense = _useThreadsSuspense; exports._useRoomSubscriptionSettings = _useRoomSubscriptionSettings; exports._useRoomSubscriptionSettingsSuspense = _useRoomSubscriptionSettingsSuspense; exports._useHistoryVersions = _useHistoryVersions; exports._useHistoryVersionsSuspense = _useHistoryVersionsSuspense; exports._useOther = _useOther; exports._useOthers = _useOthers; exports._useOtherSuspense = _useOtherSuspense; exports._useOthersSuspense = _useOthersSuspense; exports._useStorage = _useStorage; exports._useStorageSuspense = _useStorageSuspense; exports._useSelf = _useSelf; exports._useSelfSuspense = _useSelfSuspense; exports._useStorageRoot = _useStorageRoot; exports._useUpdateMyPresence = _useUpdateMyPresence;
4939
- //# sourceMappingURL=chunk-2YWY7TUQ.cjs.map
5033
+
5034
+
5035
+ exports.ClientContext = ClientContext; exports.useClientOrNull = useClientOrNull; exports.useClient = useClient; exports.RoomContext = RoomContext; exports.useLatest = useLatest; exports.RegisterAiKnowledge = RegisterAiKnowledge; exports.RegisterAiTool = RegisterAiTool; exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; exports.useSignal = useSignal; exports.getUmbrellaStoreForClient = getUmbrellaStoreForClient; exports.useCreateAiChat = useCreateAiChat; exports.useDeleteAiChat = useDeleteAiChat; exports.useAiChatStatus = useAiChatStatus; exports.useSendAiMessage = useSendAiMessage; exports.LiveblocksProvider = LiveblocksProvider; exports.createLiveblocksContext = createLiveblocksContext; exports.useInboxNotifications = useInboxNotifications; exports.useInboxNotificationsSuspense = useInboxNotificationsSuspense; exports.useMarkAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = useMarkInboxNotificationAsRead; exports.useDeleteAllInboxNotifications = useDeleteAllInboxNotifications; exports.useDeleteInboxNotification = useDeleteInboxNotification; exports.useUnreadInboxNotificationsCount = useUnreadInboxNotificationsCount; exports.useUnreadInboxNotificationsCountSuspense = useUnreadInboxNotificationsCountSuspense; exports.useNotificationSettings = useNotificationSettings; exports.useNotificationSettingsSuspense = useNotificationSettingsSuspense; exports.useUpdateNotificationSettings = useUpdateNotificationSettings; exports.useRoomInfo = useRoomInfo; exports.useRoomInfoSuspense = useRoomInfoSuspense; exports.useGroupInfo = useGroupInfo; exports.useGroupInfoSuspense = useGroupInfoSuspense; exports._useInboxNotificationThread = _useInboxNotificationThread; exports._useUser = _useUser; exports._useUserSuspense = _useUserSuspense; exports._useUserThreads_experimental = _useUserThreads_experimental; exports._useUserThreadsSuspense_experimental = _useUserThreadsSuspense_experimental; exports._useAiChats = _useAiChats; exports._useAiChatsSuspense = _useAiChatsSuspense; exports._useAiChat = _useAiChat; exports._useAiChatSuspense = _useAiChatSuspense; exports._useAiChatMessages = _useAiChatMessages; exports._useAiChatMessagesSuspense = _useAiChatMessagesSuspense; exports._useUrlMetadata = _useUrlMetadata; exports._useUrlMetadataSuspense = _useUrlMetadataSuspense; exports.useSyncStatus = useSyncStatus; exports.useErrorListener = useErrorListener; exports.useStatus = useStatus; exports.useReportTextEditor = useReportTextEditor; exports.useYjsProvider = useYjsProvider; exports.useCreateTextMention = useCreateTextMention; exports.useDeleteTextMention = useDeleteTextMention; exports.useResolveMentionSuggestions = useResolveMentionSuggestions; exports.useMentionSuggestionsCache = useMentionSuggestionsCache; exports.useLostConnectionListener = useLostConnectionListener; exports.useHistory = useHistory; exports.useUndo = useUndo; exports.useRedo = useRedo; exports.useCanUndo = useCanUndo; exports.useCanRedo = useCanRedo; exports.useOthersConnectionIds = useOthersConnectionIds; exports.useCreateRoomThread = useCreateRoomThread; exports.useDeleteRoomThread = useDeleteRoomThread; exports.useEditRoomThreadMetadata = useEditRoomThreadMetadata; exports.useCreateComment = useCreateComment; exports.useCreateRoomComment = useCreateRoomComment; exports.useEditComment = useEditComment; exports.useEditRoomComment = useEditRoomComment; exports.useDeleteComment = useDeleteComment; exports.useDeleteRoomComment = useDeleteRoomComment; exports.useAddRoomCommentReaction = useAddRoomCommentReaction; exports.useRemoveReaction = useRemoveReaction; exports.useRemoveRoomCommentReaction = useRemoveRoomCommentReaction; exports.useMarkThreadAsRead = useMarkThreadAsRead; exports.useMarkRoomThreadAsRead = useMarkRoomThreadAsRead; exports.useMarkThreadAsResolved = useMarkThreadAsResolved; exports.useMarkRoomThreadAsResolved = useMarkRoomThreadAsResolved; exports.useMarkThreadAsUnresolved = useMarkThreadAsUnresolved; exports.useMarkRoomThreadAsUnresolved = useMarkRoomThreadAsUnresolved; exports.useSubscribeToThread = useSubscribeToThread; exports.useUnsubscribeFromThread = useUnsubscribeFromThread; exports.useThreadSubscription = useThreadSubscription; exports.useRoomThreadSubscription = useRoomThreadSubscription; exports.useHistoryVersionData = useHistoryVersionData; exports.useUpdateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useAttachmentUrl = useAttachmentUrl; exports.useRoomAttachmentUrl = useRoomAttachmentUrl; exports.useAttachmentUrlSuspense = useAttachmentUrlSuspense; exports.useRoomPermissions = useRoomPermissions; exports.createRoomContext = createRoomContext; exports._RoomProvider = _RoomProvider; exports._useBroadcastEvent = _useBroadcastEvent; exports._useOthersListener = _useOthersListener; exports._useRoom = _useRoom; exports._useIsInsideRoom = _useIsInsideRoom; exports._useAddReaction = _useAddReaction; exports._useMutation = _useMutation; exports._useCreateThread = _useCreateThread; exports._useDeleteThread = _useDeleteThread; exports._useEditThreadMetadata = _useEditThreadMetadata; exports._useEventListener = _useEventListener; exports._useMyPresence = _useMyPresence; exports._useOthersMapped = _useOthersMapped; exports._useOthersMappedSuspense = _useOthersMappedSuspense; exports._useThreads = _useThreads; exports._useThreadsSuspense = _useThreadsSuspense; exports._useRoomSubscriptionSettings = _useRoomSubscriptionSettings; exports._useRoomSubscriptionSettingsSuspense = _useRoomSubscriptionSettingsSuspense; exports._useHistoryVersions = _useHistoryVersions; exports._useHistoryVersionsSuspense = _useHistoryVersionsSuspense; exports._useOther = _useOther; exports._useOthers = _useOthers; exports._useOtherSuspense = _useOtherSuspense; exports._useOthersSuspense = _useOthersSuspense; exports._useStorage = _useStorage; exports._useStorageSuspense = _useStorageSuspense; exports._useSelf = _useSelf; exports._useSelfSuspense = _useSelfSuspense; exports._useStorageRoot = _useStorageRoot; exports._useUpdateMyPresence = _useUpdateMyPresence;
5036
+ //# sourceMappingURL=chunk-NGMOQDHX.cjs.map