@liveblocks/react 3.4.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/_private.cjs CHANGED
@@ -25,7 +25,7 @@
25
25
 
26
26
 
27
27
 
28
- var _chunkKEDRXCJDcjs = require('./chunk-KEDRXCJD.cjs');
28
+ var _chunkEEINMYNIcjs = require('./chunk-EEINMYNI.cjs');
29
29
 
30
30
  // src/lib/use-layout-effect.ts
31
31
  var _react = require('react');
@@ -43,8 +43,8 @@ function normalizeMentionSuggestions(suggestions) {
43
43
  function useMentionSuggestions(roomId, search) {
44
44
  const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
45
45
  const lastInvokedAt = _react.useRef.call(void 0, );
46
- const resolveMentionSuggestions = _chunkKEDRXCJDcjs.useResolveMentionSuggestions.call(void 0, );
47
- const mentionSuggestionsCache = _chunkKEDRXCJDcjs.useMentionSuggestionsCache.call(void 0, );
46
+ const resolveMentionSuggestions = _chunkEEINMYNIcjs.useResolveMentionSuggestions.call(void 0, );
47
+ const mentionSuggestionsCache = _chunkEEINMYNIcjs.useMentionSuggestionsCache.call(void 0, );
48
48
  _react.useEffect.call(void 0, () => {
49
49
  if (search === void 0 || !resolveMentionSuggestions) {
50
50
  return;
@@ -99,7 +99,7 @@ function useMentionSuggestions(roomId, search) {
99
99
 
100
100
 
101
101
  function useSyncSource() {
102
- const client = _chunkKEDRXCJDcjs.useClient.call(void 0, );
102
+ const client = _chunkEEINMYNIcjs.useClient.call(void 0, );
103
103
  const createSyncSource = client[_core.kInternal].createSyncSource;
104
104
  const [syncSource, setSyncSource] = _react.useState.call(void 0, );
105
105
  _react.useEffect.call(void 0, () => {
@@ -138,5 +138,5 @@ function useSyncSource() {
138
138
 
139
139
 
140
140
 
141
- exports.getUmbrellaStoreForClient = _chunkKEDRXCJDcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkKEDRXCJDcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkKEDRXCJDcjs.useClientOrNull; exports.useCreateRoomComment = _chunkKEDRXCJDcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkKEDRXCJDcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkKEDRXCJDcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkKEDRXCJDcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkKEDRXCJDcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkKEDRXCJDcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkKEDRXCJDcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkKEDRXCJDcjs.useEditRoomThreadMetadata; exports.useLatest = _chunkKEDRXCJDcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkKEDRXCJDcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkKEDRXCJDcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkKEDRXCJDcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkKEDRXCJDcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkKEDRXCJDcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkKEDRXCJDcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkKEDRXCJDcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkKEDRXCJDcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkKEDRXCJDcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkKEDRXCJDcjs.useRoomThreadSubscription; exports.useSignal = _chunkKEDRXCJDcjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkKEDRXCJDcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkKEDRXCJDcjs.useYjsProvider;
141
+ exports.getUmbrellaStoreForClient = _chunkEEINMYNIcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkEEINMYNIcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkEEINMYNIcjs.useClientOrNull; exports.useCreateRoomComment = _chunkEEINMYNIcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkEEINMYNIcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkEEINMYNIcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkEEINMYNIcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkEEINMYNIcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkEEINMYNIcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkEEINMYNIcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkEEINMYNIcjs.useEditRoomThreadMetadata; exports.useLatest = _chunkEEINMYNIcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkEEINMYNIcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkEEINMYNIcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkEEINMYNIcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkEEINMYNIcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkEEINMYNIcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkEEINMYNIcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkEEINMYNIcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkEEINMYNIcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkEEINMYNIcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkEEINMYNIcjs.useRoomThreadSubscription; exports.useSignal = _chunkEEINMYNIcjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkEEINMYNIcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkEEINMYNIcjs.useYjsProvider;
142
142
  //# sourceMappingURL=_private.cjs.map
package/dist/_private.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  useSignal,
26
26
  useSyncExternalStoreWithSelector,
27
27
  useYjsProvider
28
- } from "./chunk-TYQDESJE.js";
28
+ } from "./chunk-I2UW4JM4.js";
29
29
 
30
30
  // src/lib/use-layout-effect.ts
31
31
  import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "3.4.0";
3
+ var PKG_VERSION = "3.4.1";
4
4
  var PKG_FORMAT = "cjs";
5
5
 
6
6
  // src/ClientSideSuspense.tsx
@@ -20,4 +20,4 @@ function ClientSideSuspense(props) {
20
20
 
21
21
 
22
22
  exports.PKG_NAME = PKG_NAME; exports.PKG_VERSION = PKG_VERSION; exports.PKG_FORMAT = PKG_FORMAT; exports.ClientSideSuspense = ClientSideSuspense;
23
- //# sourceMappingURL=chunk-JP4MG2VP.cjs.map
23
+ //# sourceMappingURL=chunk-65PGHVAD.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-JP4MG2VP.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,OAAA;AACvD,IAAM,WAAA,EAAgD,KAAA;ADD7D;AACA;AEJA,8BAA8C;AAkC1C,+CAAA;AAVG,SAAS,kBAAA,CAAmB,KAAA,EAAc;AAC/C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAE5C,EAAA,8BAAA,CAAU,EAAA,GAAM;AAGd,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,uBACE,6BAAA,eAAC,EAAA,EAAS,QAAA,EAAU,KAAA,CAAM,QAAA,EACvB,QAAA,EAAA,QAAA,EACG,OAAO,KAAA,CAAM,SAAA,IAAa,WAAA,EACxB,KAAA,CAAM,QAAA,CAAS,EAAA,EACf,KAAA,CAAM,SAAA,EACR,KAAA,CAAM,SAAA,CACZ,CAAA;AAEJ;AF5BA;AACA;AACE;AACA;AACA;AACA;AACF,iJAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-JP4MG2VP.cjs","sourcesContent":[null,"declare const __VERSION__: string;\ndeclare const TSUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof TSUP_FORMAT === \"string\" && TSUP_FORMAT;\n","import type { ReactNode } from \"react\";\nimport { Suspense, useEffect, useState } from \"react\";\n\ntype Props = {\n fallback: ReactNode;\n children: (() => ReactNode | undefined) | ReactNode | undefined;\n};\n\n/**\n * Almost like a normal <Suspense> component, except that for server-side\n * renders, the fallback will be used.\n *\n * The child props will have to be provided in a function, i.e. change:\n *\n * <Suspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </Suspense>\n *\n * To:\n *\n * <ClientSideSuspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </ClientSideSuspense>\n *\n */\nexport function ClientSideSuspense(props: Props) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n // Effects are never executed on the server side. The point of this is to\n // delay the flipping of this boolean until after hydration has happened.\n setMounted(true);\n }, []);\n\n return (\n <Suspense fallback={props.fallback}>\n {mounted\n ? typeof props.children === \"function\"\n ? props.children()\n : props.children\n : props.fallback}\n </Suspense>\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-65PGHVAD.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,OAAA;AACvD,IAAM,WAAA,EAAgD,KAAA;ADD7D;AACA;AEJA,8BAA8C;AAkC1C,+CAAA;AAVG,SAAS,kBAAA,CAAmB,KAAA,EAAc;AAC/C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAE5C,EAAA,8BAAA,CAAU,EAAA,GAAM;AAGd,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,uBACE,6BAAA,eAAC,EAAA,EAAS,QAAA,EAAU,KAAA,CAAM,QAAA,EACvB,QAAA,EAAA,QAAA,EACG,OAAO,KAAA,CAAM,SAAA,IAAa,WAAA,EACxB,KAAA,CAAM,QAAA,CAAS,EAAA,EACf,KAAA,CAAM,SAAA,EACR,KAAA,CAAM,SAAA,CACZ,CAAA;AAEJ;AF5BA;AACA;AACE;AACA;AACA;AACA;AACF,iJAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-65PGHVAD.cjs","sourcesContent":[null,"declare const __VERSION__: string;\ndeclare const TSUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof TSUP_FORMAT === \"string\" && TSUP_FORMAT;\n","import type { ReactNode } from \"react\";\nimport { Suspense, useEffect, useState } from \"react\";\n\ntype Props = {\n fallback: ReactNode;\n children: (() => ReactNode | undefined) | ReactNode | undefined;\n};\n\n/**\n * Almost like a normal <Suspense> component, except that for server-side\n * renders, the fallback will be used.\n *\n * The child props will have to be provided in a function, i.e. change:\n *\n * <Suspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </Suspense>\n *\n * To:\n *\n * <ClientSideSuspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </ClientSideSuspense>\n *\n */\nexport function ClientSideSuspense(props: Props) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n // Effects are never executed on the server side. The point of this is to\n // delay the flipping of this boolean until after hydration has happened.\n setMounted(true);\n }, []);\n\n return (\n <Suspense fallback={props.fallback}>\n {mounted\n ? typeof props.children === \"function\"\n ? props.children()\n : props.children\n : props.fallback}\n </Suspense>\n );\n}\n"]}
@@ -185,6 +185,7 @@ function useSignal(signal, selector, isEqual) {
185
185
 
186
186
 
187
187
 
188
+
188
189
  // src/config.ts
189
190
  var SECONDS = 1e3;
190
191
  var MINUTES = 60 * SECONDS;
@@ -2071,7 +2072,7 @@ function makeLiveblocksExtrasForClient(client) {
2071
2072
  try {
2072
2073
  return await store.fetchNotificationsDeltaUpdate(signal);
2073
2074
  } catch (err) {
2074
- console.warn(`Polling new inbox notifications failed: ${String(err)}`);
2075
+ _core.console.warn(`Polling new inbox notifications failed: ${String(err)}`);
2075
2076
  throw err;
2076
2077
  }
2077
2078
  },
@@ -2083,7 +2084,7 @@ function makeLiveblocksExtrasForClient(client) {
2083
2084
  try {
2084
2085
  return await store.fetchUserThreadsDeltaUpdate(signal);
2085
2086
  } catch (err) {
2086
- console.warn(`Polling new user threads failed: ${String(err)}`);
2087
+ _core.console.warn(`Polling new user threads failed: ${String(err)}`);
2087
2088
  throw err;
2088
2089
  }
2089
2090
  },
@@ -2095,7 +2096,7 @@ function makeLiveblocksExtrasForClient(client) {
2095
2096
  try {
2096
2097
  return await store.refreshNotificationSettings(signal);
2097
2098
  } catch (err) {
2098
- console.warn(
2099
+ _core.console.warn(
2099
2100
  `Polling new notification settings failed: ${String(err)}`
2100
2101
  );
2101
2102
  throw err;
@@ -2363,7 +2364,7 @@ function useUpdateNotificationSettings_withClient(client) {
2363
2364
  if (err instanceof _core.HttpError) {
2364
2365
  if (err.status === 422) {
2365
2366
  const msg = [_optionalChain([err, 'access', _12 => _12.details, 'optionalAccess', _13 => _13.error]), _optionalChain([err, 'access', _14 => _14.details, 'optionalAccess', _15 => _15.reason])].filter(Boolean).join("\n");
2366
- console.error(msg);
2367
+ _core.console.error(msg);
2367
2368
  }
2368
2369
  client[_core.kInternal].emitError(
2369
2370
  {
@@ -2637,7 +2638,7 @@ function useCreateAiChat() {
2637
2638
  title: options.title,
2638
2639
  metadata: options.metadata
2639
2640
  }).catch((err) => {
2640
- console.error(
2641
+ _core.console.error(
2641
2642
  `Failed to create chat with ID "${options.id}": ${String(err)}`
2642
2643
  );
2643
2644
  });
@@ -2650,7 +2651,7 @@ function useDeleteAiChat() {
2650
2651
  return _react.useCallback.call(void 0,
2651
2652
  (chatId) => {
2652
2653
  client[_core.kInternal].ai.deleteChat(chatId).catch((err) => {
2653
- console.error(
2654
+ _core.console.error(
2654
2655
  `Failed to delete chat with ID "${chatId}": ${String(err)}`
2655
2656
  );
2656
2657
  });
@@ -2665,6 +2666,7 @@ function useSendAiMessage(chatId, options) {
2665
2666
  const {
2666
2667
  text: messageText,
2667
2668
  chatId: messageOptionsChatId,
2669
+ copilotId: messageOptionsCopilotId,
2668
2670
  ...messageOptions
2669
2671
  } = typeof message === "string" ? { text: message } : message;
2670
2672
  const resolvedChatId = _nullishCoalesce(_nullishCoalesce(messageOptionsChatId, () => ( chatId)), () => ( // The `useSendAiMessage` overloads prevent this scenario from happening
@@ -2673,7 +2675,20 @@ function useSendAiMessage(chatId, options) {
2673
2675
  "chatId must be provided to either `useSendAiMessage` or its returned function."
2674
2676
  )));
2675
2677
  const messages = client[_core.kInternal].ai.signals.getChatMessagesForBranch\u03A3(resolvedChatId).get();
2676
- const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _21 => _21[messages.length - 1], 'optionalAccess', _22 => _22.id]), () => ( null));
2678
+ if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess', _21 => _21.copilotId])) {
2679
+ _core.console.warn(
2680
+ `No copilot ID was provided to useSendAiMessage when sending the message "${messageText.slice(
2681
+ 0,
2682
+ 20
2683
+ )}\u2026". As a result, the message will use the chat's previous copilot ID, which could lead to unexpected behavior.
2684
+ To ensure the correct copilot ID is used, specify it either through the hook as 'useSendAiMessage("${resolvedChatId}", { copilotId: "co_xxx" })' or via the function as 'sendAiMessage({ text: "${messageText.slice(
2685
+ 0,
2686
+ 20
2687
+ )}\u2026", copilotId: "co_xxx" })'`
2688
+ );
2689
+ }
2690
+ const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess', _22 => _22.copilotId]))), () => ( client[_core.kInternal].ai.getLastUsedCopilotId(resolvedChatId)));
2691
+ const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _23 => _23[messages.length - 1], 'optionalAccess', _24 => _24.id]), () => ( null));
2677
2692
  const content = [{ type: "text", text: messageText }];
2678
2693
  const newMessageId = client[_core.kInternal].ai[_core.kInternal].context.messagesStore.createOptimistically(
2679
2694
  resolvedChatId,
@@ -2685,17 +2700,18 @@ function useSendAiMessage(chatId, options) {
2685
2700
  const targetMessageId = client[_core.kInternal].ai[_core.kInternal].context.messagesStore.createOptimistically(
2686
2701
  resolvedChatId,
2687
2702
  "assistant",
2688
- newMessageId
2703
+ newMessageId,
2704
+ resolvedCopilotId
2689
2705
  );
2690
2706
  void client[_core.kInternal].ai.askUserMessageInChat(
2691
2707
  resolvedChatId,
2692
2708
  { id: newMessageId, parentMessageId: lastMessageId, content },
2693
2709
  targetMessageId,
2694
2710
  {
2695
- stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _23 => _23.stream]))),
2696
- copilotId: _nullishCoalesce(messageOptions.copilotId, () => ( _optionalChain([options, 'optionalAccess', _24 => _24.copilotId]))),
2697
- timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _25 => _25.timeout]))),
2698
- knowledge: _nullishCoalesce(messageOptions.knowledge, () => ( _optionalChain([options, 'optionalAccess', _26 => _26.knowledge])))
2711
+ stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _25 => _25.stream]))),
2712
+ copilotId: resolvedCopilotId,
2713
+ timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _26 => _26.timeout]))),
2714
+ knowledge: _nullishCoalesce(messageOptions.knowledge, () => ( _optionalChain([options, 'optionalAccess', _27 => _27.knowledge])))
2699
2715
  }
2700
2716
  );
2701
2717
  return newMessage;
@@ -2703,10 +2719,10 @@ function useSendAiMessage(chatId, options) {
2703
2719
  [
2704
2720
  client,
2705
2721
  chatId,
2706
- _optionalChain([options, 'optionalAccess', _27 => _27.copilotId]),
2707
- _optionalChain([options, 'optionalAccess', _28 => _28.stream]),
2708
- _optionalChain([options, 'optionalAccess', _29 => _29.timeout]),
2709
- _optionalChain([options, 'optionalAccess', _30 => _30.knowledge])
2722
+ _optionalChain([options, 'optionalAccess', _28 => _28.copilotId]),
2723
+ _optionalChain([options, 'optionalAccess', _29 => _29.stream]),
2724
+ _optionalChain([options, 'optionalAccess', _30 => _30.timeout]),
2725
+ _optionalChain([options, 'optionalAccess', _31 => _31.knowledge])
2710
2726
  ]
2711
2727
  );
2712
2728
  }
@@ -2740,7 +2756,7 @@ function createSharedContext(client) {
2740
2756
  }
2741
2757
  function useEnsureNoLiveblocksProvider(options) {
2742
2758
  const existing = useClientOrNull();
2743
- if (!_optionalChain([options, 'optionalAccess', _31 => _31.allowNesting]) && existing !== null) {
2759
+ if (!_optionalChain([options, 'optionalAccess', _32 => _32.allowNesting]) && existing !== null) {
2744
2760
  throw new Error(
2745
2761
  "You cannot nest multiple LiveblocksProvider instances in the same React tree."
2746
2762
  );
@@ -2889,7 +2905,7 @@ var _useAiChatSuspense = useAiChatSuspense;
2889
2905
  var _useAiChatMessages = useAiChatMessages;
2890
2906
  var _useAiChatMessagesSuspense = useAiChatMessagesSuspense;
2891
2907
  function useSyncStatus_withClient(client, options) {
2892
- const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _32 => _32.smooth]), () => ( false)));
2908
+ const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _33 => _33.smooth]), () => ( false)));
2893
2909
  if (smooth) {
2894
2910
  return useSyncStatusSmooth_withClient(client);
2895
2911
  } else {
@@ -3068,8 +3084,8 @@ function makeRoomExtrasForClient(client) {
3068
3084
  if (innerError.status === 403) {
3069
3085
  const detailedMessage = [
3070
3086
  innerError.message,
3071
- _optionalChain([innerError, 'access', _33 => _33.details, 'optionalAccess', _34 => _34.suggestion]),
3072
- _optionalChain([innerError, 'access', _35 => _35.details, 'optionalAccess', _36 => _36.docs])
3087
+ _optionalChain([innerError, 'access', _34 => _34.details, 'optionalAccess', _35 => _35.suggestion]),
3088
+ _optionalChain([innerError, 'access', _36 => _36.details, 'optionalAccess', _37 => _37.docs])
3073
3089
  ].filter(Boolean).join("\n");
3074
3090
  _core.console.error(detailedMessage);
3075
3091
  }
@@ -3364,7 +3380,7 @@ function RoomProviderInner(props) {
3364
3380
  }
3365
3381
  function useRoom(options) {
3366
3382
  const room = useRoomOrNull();
3367
- if (room === null && !_optionalChain([options, 'optionalAccess', _37 => _37.allowOutsideRoom])) {
3383
+ if (room === null && !_optionalChain([options, 'optionalAccess', _38 => _38.allowOutsideRoom])) {
3368
3384
  throw new Error("RoomProvider is missing from the React tree.");
3369
3385
  }
3370
3386
  return room;
@@ -3714,7 +3730,7 @@ function useCreateRoomThread(roomId) {
3714
3730
  thread: newThread,
3715
3731
  roomId
3716
3732
  });
3717
- const attachmentIds = _optionalChain([attachments, 'optionalAccess', _38 => _38.map, 'call', _39 => _39((attachment) => attachment.id)]);
3733
+ const attachmentIds = _optionalChain([attachments, 'optionalAccess', _39 => _39.map, 'call', _40 => _40((attachment) => attachment.id)]);
3718
3734
  client[_core.kInternal].httpClient.createThread({
3719
3735
  roomId,
3720
3736
  threadId,
@@ -3754,7 +3770,7 @@ function useDeleteRoomThread(roomId) {
3754
3770
  const { store, onMutationFailure } = getRoomExtrasForClient(client);
3755
3771
  const userId = getCurrentUserId(client);
3756
3772
  const existing = store.outputs.threads.get().get(threadId);
3757
- if (_optionalChain([existing, 'optionalAccess', _40 => _40.comments, 'optionalAccess', _41 => _41[0], 'optionalAccess', _42 => _42.userId]) !== userId) {
3773
+ if (_optionalChain([existing, 'optionalAccess', _41 => _41.comments, 'optionalAccess', _42 => _42[0], 'optionalAccess', _43 => _43.userId]) !== userId) {
3758
3774
  throw new Error("Only the thread creator can delete the thread");
3759
3775
  }
3760
3776
  const optimisticId = store.optimisticUpdates.add({
@@ -3842,7 +3858,7 @@ function useCreateRoomComment(roomId) {
3842
3858
  type: "create-comment",
3843
3859
  comment
3844
3860
  });
3845
- const attachmentIds = _optionalChain([attachments, 'optionalAccess', _43 => _43.map, 'call', _44 => _44((attachment) => attachment.id)]);
3861
+ const attachmentIds = _optionalChain([attachments, 'optionalAccess', _44 => _44.map, 'call', _45 => _45((attachment) => attachment.id)]);
3846
3862
  client[_core.kInternal].httpClient.createComment({ roomId, threadId, commentId, body, attachmentIds }).then(
3847
3863
  (newComment) => {
3848
3864
  store.createComment(newComment, optimisticId);
@@ -3898,7 +3914,7 @@ function useEditRoomComment(roomId) {
3898
3914
  attachments: _nullishCoalesce(attachments, () => ( []))
3899
3915
  }
3900
3916
  });
3901
- const attachmentIds = _optionalChain([attachments, 'optionalAccess', _45 => _45.map, 'call', _46 => _46((attachment) => attachment.id)]);
3917
+ const attachmentIds = _optionalChain([attachments, 'optionalAccess', _46 => _46.map, 'call', _47 => _47((attachment) => attachment.id)]);
3902
3918
  client[_core.kInternal].httpClient.editComment({ roomId, threadId, commentId, body, attachmentIds }).then(
3903
3919
  (editedComment) => {
3904
3920
  store.editComment(threadId, optimisticId, editedComment);
@@ -4239,7 +4255,7 @@ function useRoomThreadSubscription(roomId, threadId) {
4239
4255
  }
4240
4256
  return {
4241
4257
  status: "subscribed",
4242
- unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _47 => _47.readAt]), () => ( null)),
4258
+ unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _48 => _48.readAt]), () => ( null)),
4243
4259
  subscribe,
4244
4260
  unsubscribe
4245
4261
  };
@@ -4450,7 +4466,7 @@ function useThreadsSuspense(options = {}) {
4450
4466
  return result;
4451
4467
  }
4452
4468
  function selectorFor_useAttachmentUrl(state) {
4453
- if (state === void 0 || _optionalChain([state, 'optionalAccess', _48 => _48.isLoading])) {
4469
+ if (state === void 0 || _optionalChain([state, 'optionalAccess', _49 => _49.isLoading])) {
4454
4470
  return _nullishCoalesce(state, () => ( { isLoading: true }));
4455
4471
  }
4456
4472
  if (state.error) {
@@ -4676,4 +4692,4 @@ var _useUpdateMyPresence = useUpdateMyPresence;
4676
4692
 
4677
4693
 
4678
4694
  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.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._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;
4679
- //# sourceMappingURL=chunk-KEDRXCJD.cjs.map
4695
+ //# sourceMappingURL=chunk-EEINMYNI.cjs.map