@liveblocks/react 2.16.1-ai3 → 2.16.1-ai5

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.js CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
 
26
26
 
27
- var _chunkNZL5WL5Ojs = require('./chunk-NZL5WL5O.js');
27
+ var _chunkVLZ3CRYCjs = require('./chunk-VLZ3CRYC.js');
28
28
 
29
29
  // src/lib/use-layout-effect.ts
30
30
  var _react = require('react');
@@ -37,8 +37,8 @@ var MENTION_SUGGESTIONS_DEBOUNCE = 500;
37
37
  function useMentionSuggestions(roomId, search) {
38
38
  const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
39
39
  const lastInvokedAt = _react.useRef.call(void 0, );
40
- const resolveMentionSuggestions = _chunkNZL5WL5Ojs.useResolveMentionSuggestions.call(void 0, );
41
- const mentionSuggestionsCache = _chunkNZL5WL5Ojs.useMentionSuggestionsCache.call(void 0, );
40
+ const resolveMentionSuggestions = _chunkVLZ3CRYCjs.useResolveMentionSuggestions.call(void 0, );
41
+ const mentionSuggestionsCache = _chunkVLZ3CRYCjs.useMentionSuggestionsCache.call(void 0, );
42
42
  _react.useEffect.call(void 0, () => {
43
43
  if (search === void 0 || !resolveMentionSuggestions) {
44
44
  return;
@@ -87,7 +87,7 @@ function useMentionSuggestions(roomId, search) {
87
87
 
88
88
 
89
89
  function useSyncSource() {
90
- const client = _chunkNZL5WL5Ojs.useClient.call(void 0, );
90
+ const client = _chunkVLZ3CRYCjs.useClient.call(void 0, );
91
91
  const createSyncSource = client[_core.kInternal].createSyncSource;
92
92
  const [syncSource, setSyncSource] = _react.useState.call(void 0, );
93
93
  _react.useEffect.call(void 0, () => {
@@ -125,5 +125,5 @@ function useSyncSource() {
125
125
 
126
126
 
127
127
 
128
- exports.getUmbrellaStoreForClient = _chunkNZL5WL5Ojs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkNZL5WL5Ojs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkNZL5WL5Ojs.useClientOrNull; exports.useCreateRoomComment = _chunkNZL5WL5Ojs.useCreateRoomComment; exports.useCreateRoomThread = _chunkNZL5WL5Ojs.useCreateRoomThread; exports.useCreateTextMention = _chunkNZL5WL5Ojs.useCreateTextMention; exports.useDeleteRoomComment = _chunkNZL5WL5Ojs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkNZL5WL5Ojs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkNZL5WL5Ojs.useDeleteTextMention; exports.useEditRoomComment = _chunkNZL5WL5Ojs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkNZL5WL5Ojs.useEditRoomThreadMetadata; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkNZL5WL5Ojs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkNZL5WL5Ojs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkNZL5WL5Ojs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkNZL5WL5Ojs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkNZL5WL5Ojs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkNZL5WL5Ojs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkNZL5WL5Ojs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkNZL5WL5Ojs.useRoomAttachmentUrl; exports.useRoomOrNull = _chunkNZL5WL5Ojs.useRoomOrNull; exports.useRoomPermissions = _chunkNZL5WL5Ojs.useRoomPermissions; exports.useSignal = _chunkNZL5WL5Ojs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkNZL5WL5Ojs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkNZL5WL5Ojs.useYjsProvider;
128
+ exports.getUmbrellaStoreForClient = _chunkVLZ3CRYCjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkVLZ3CRYCjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkVLZ3CRYCjs.useClientOrNull; exports.useCreateRoomComment = _chunkVLZ3CRYCjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkVLZ3CRYCjs.useCreateRoomThread; exports.useCreateTextMention = _chunkVLZ3CRYCjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkVLZ3CRYCjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkVLZ3CRYCjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkVLZ3CRYCjs.useDeleteTextMention; exports.useEditRoomComment = _chunkVLZ3CRYCjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkVLZ3CRYCjs.useEditRoomThreadMetadata; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkVLZ3CRYCjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkVLZ3CRYCjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkVLZ3CRYCjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkVLZ3CRYCjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkVLZ3CRYCjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkVLZ3CRYCjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkVLZ3CRYCjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkVLZ3CRYCjs.useRoomAttachmentUrl; exports.useRoomOrNull = _chunkVLZ3CRYCjs.useRoomOrNull; exports.useRoomPermissions = _chunkVLZ3CRYCjs.useRoomPermissions; exports.useSignal = _chunkVLZ3CRYCjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkVLZ3CRYCjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkVLZ3CRYCjs.useYjsProvider;
129
129
  //# sourceMappingURL=_private.js.map
package/dist/_private.mjs CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  useSignal,
25
25
  useSyncExternalStoreWithSelector,
26
26
  useYjsProvider
27
- } from "./chunk-JZBPCFEX.mjs";
27
+ } from "./chunk-63WTJCBG.mjs";
28
28
 
29
29
  // src/lib/use-layout-effect.ts
30
30
  import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
@@ -159,6 +159,15 @@ function count(it, predicate) {
159
159
  return total;
160
160
  }
161
161
 
162
+ // src/lib/ssr.ts
163
+ function ensureNotServerSide() {
164
+ if (typeof window === "undefined") {
165
+ throw new Error(
166
+ "You cannot use the Suspense version of Liveblocks hooks server side. Make sure to only call them client side by using a ClientSideSuspense wrapper.\nFor tips, see https://liveblocks.io/docs/api-reference/liveblocks-react#ClientSideSuspense"
167
+ );
168
+ }
169
+ }
170
+
162
171
  // src/lib/use-initial.ts
163
172
  import { useCallback, useReducer } from "react";
164
173
 
@@ -1778,6 +1787,7 @@ function useInboxNotifications_withClient(client, selector, isEqual) {
1778
1787
  );
1779
1788
  }
1780
1789
  function useInboxNotificationsSuspense_withClient(client) {
1790
+ ensureNotServerSide();
1781
1791
  const store = getLiveblocksExtrasForClient(client).store;
1782
1792
  use(store.outputs.loadingNotifications.waitUntilLoaded());
1783
1793
  const result = useInboxNotifications_withClient(client, identity2, shallow4);
@@ -1793,6 +1803,7 @@ function useUnreadInboxNotificationsCount_withClient(client) {
1793
1803
  );
1794
1804
  }
1795
1805
  function useUnreadInboxNotificationsCountSuspense_withClient(client) {
1806
+ ensureNotServerSide();
1796
1807
  const store = getLiveblocksExtrasForClient(client).store;
1797
1808
  use(store.outputs.loadingNotifications.waitUntilLoaded());
1798
1809
  const result = useUnreadInboxNotificationsCount_withClient(client);
@@ -2151,6 +2162,7 @@ function useUserThreads_experimental(options = {}) {
2151
2162
  );
2152
2163
  }
2153
2164
  function useUserThreadsSuspense_experimental(options = {}) {
2165
+ ensureNotServerSide();
2154
2166
  const client = useClient();
2155
2167
  const { store } = getLiveblocksExtrasForClient(client);
2156
2168
  const queryKey = makeUserThreadsQueryKey(options.query);
@@ -3545,6 +3557,7 @@ function useRoomNotificationSettings() {
3545
3557
  }, [settings, updateRoomNotificationSettings]);
3546
3558
  }
3547
3559
  function useRoomNotificationSettingsSuspense() {
3560
+ ensureNotServerSide();
3548
3561
  const client = useClient();
3549
3562
  const store = getRoomExtrasForClient(client).store;
3550
3563
  const room = useRoom();
@@ -3609,6 +3622,7 @@ function useHistoryVersions() {
3609
3622
  return useSignal(store.outputs.versionsByRoomId.getOrCreate(room.id).signal);
3610
3623
  }
3611
3624
  function useHistoryVersionsSuspense() {
3625
+ ensureNotServerSide();
3612
3626
  const client = useClient();
3613
3627
  const room = useRoom();
3614
3628
  const store = getRoomExtrasForClient(client).store;
@@ -3643,13 +3657,6 @@ function useUpdateRoomNotificationSettings() {
3643
3657
  [client, room]
3644
3658
  );
3645
3659
  }
3646
- function ensureNotServerSide() {
3647
- if (typeof window === "undefined") {
3648
- throw new Error(
3649
- "You cannot use the Suspense version of this hook on the server side. Make sure to only call them on the client side.\nFor tips, see https://liveblocks.io/docs/api-reference/liveblocks-react#suspense-avoid-ssr"
3650
- );
3651
- }
3652
- }
3653
3660
  function useSuspendUntilPresenceReady() {
3654
3661
  ensureNotServerSide();
3655
3662
  const room = useRoom();
@@ -3698,6 +3705,7 @@ function useStorageStatusSuspense(options) {
3698
3705
  return useStorageStatus(options);
3699
3706
  }
3700
3707
  function useThreadsSuspense(options = {}) {
3708
+ ensureNotServerSide();
3701
3709
  const client = useClient();
3702
3710
  const room = useRoom();
3703
3711
  const { store } = getRoomExtrasForClient(client);
@@ -3925,4 +3933,4 @@ export {
3925
3933
  _useStorageRoot,
3926
3934
  _useUpdateMyPresence
3927
3935
  };
3928
- //# sourceMappingURL=chunk-JZBPCFEX.mjs.map
3936
+ //# sourceMappingURL=chunk-63WTJCBG.mjs.map