@liveblocks/react 3.15.3 → 3.16.0-flow1

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,10 @@
25
25
 
26
26
 
27
27
 
28
- var _chunkL3D3UECFcjs = require('./chunk-L3D3UECF.cjs');
28
+
29
+
30
+
31
+ var _chunkQEGVIJNNcjs = require('./chunk-QEGVIJNN.cjs');
29
32
 
30
33
  // src/lib/use-layout-effect.ts
31
34
  var _react = require('react');
@@ -50,7 +53,7 @@ function selectorFor_useGroup(state) {
50
53
  };
51
54
  }
52
55
  function useGroup(groupId) {
53
- const client = _chunkL3D3UECFcjs.useClient.call(void 0, );
56
+ const client = _chunkQEGVIJNNcjs.useClient.call(void 0, );
54
57
  const store = client[_core.kInternal].httpClient.groupsStore;
55
58
  const getGroupState = _react.useCallback.call(void 0,
56
59
  () => store.getItemState(groupId),
@@ -59,7 +62,7 @@ function useGroup(groupId) {
59
62
  _react.useEffect.call(void 0, () => {
60
63
  void store.enqueue(groupId);
61
64
  }, [store, groupId]);
62
- return _chunkL3D3UECFcjs.useSyncExternalStoreWithSelector.call(void 0,
65
+ return _chunkQEGVIJNNcjs.useSyncExternalStoreWithSelector.call(void 0,
63
66
  store.subscribe,
64
67
  getGroupState,
65
68
  getGroupState,
@@ -80,8 +83,8 @@ function normalizeMentionSuggestions(suggestions) {
80
83
  function useMentionSuggestions(roomId, search) {
81
84
  const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
82
85
  const lastInvokedAt = _react.useRef.call(void 0, );
83
- const resolveMentionSuggestions = _chunkL3D3UECFcjs.useResolveMentionSuggestions.call(void 0, );
84
- const mentionSuggestionsCache = _chunkL3D3UECFcjs.useMentionSuggestionsCache.call(void 0, );
86
+ const resolveMentionSuggestions = _chunkQEGVIJNNcjs.useResolveMentionSuggestions.call(void 0, );
87
+ const mentionSuggestionsCache = _chunkQEGVIJNNcjs.useMentionSuggestionsCache.call(void 0, );
85
88
  _react.useEffect.call(void 0, () => {
86
89
  if (search === void 0 || !resolveMentionSuggestions) {
87
90
  return;
@@ -136,7 +139,7 @@ function useMentionSuggestions(roomId, search) {
136
139
 
137
140
 
138
141
  function useSyncSource() {
139
- const client = _chunkL3D3UECFcjs.useClient.call(void 0, );
142
+ const client = _chunkQEGVIJNNcjs.useClient.call(void 0, );
140
143
  const createSyncSource = client[_core.kInternal].createSyncSource;
141
144
  const [syncSource, setSyncSource] = _react.useState.call(void 0, );
142
145
  _react.useEffect.call(void 0, () => {
@@ -176,5 +179,8 @@ function useSyncSource() {
176
179
 
177
180
 
178
181
 
179
- exports.getUmbrellaStoreForClient = _chunkL3D3UECFcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkL3D3UECFcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkL3D3UECFcjs.useClientOrNull; exports.useCreateRoomComment = _chunkL3D3UECFcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkL3D3UECFcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkL3D3UECFcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkL3D3UECFcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkL3D3UECFcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkL3D3UECFcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkL3D3UECFcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkL3D3UECFcjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useLatest = _chunkL3D3UECFcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkL3D3UECFcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkL3D3UECFcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkL3D3UECFcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkL3D3UECFcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkL3D3UECFcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkL3D3UECFcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkL3D3UECFcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkL3D3UECFcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkL3D3UECFcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkL3D3UECFcjs.useRoomThreadSubscription; exports.useSignal = _chunkL3D3UECFcjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkL3D3UECFcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkL3D3UECFcjs.useYjsProvider;
182
+
183
+
184
+
185
+ exports.getUmbrellaStoreForClient = _chunkQEGVIJNNcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkQEGVIJNNcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkQEGVIJNNcjs.useClientOrNull; exports.useCreateRoomComment = _chunkQEGVIJNNcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkQEGVIJNNcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkQEGVIJNNcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkQEGVIJNNcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkQEGVIJNNcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkQEGVIJNNcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkQEGVIJNNcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkQEGVIJNNcjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useInitial = _chunkQEGVIJNNcjs.useInitial; exports.useLatest = _chunkQEGVIJNNcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkQEGVIJNNcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkQEGVIJNNcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkQEGVIJNNcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkQEGVIJNNcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkQEGVIJNNcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkQEGVIJNNcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkQEGVIJNNcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkQEGVIJNNcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkQEGVIJNNcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkQEGVIJNNcjs.useRoomThreadSubscription; exports.useSignal = _chunkQEGVIJNNcjs.useSignal; exports.useSuspendUntilPresenceReady = _chunkQEGVIJNNcjs.useSuspendUntilPresenceReady; exports.useSuspendUntilStorageReady = _chunkQEGVIJNNcjs.useSuspendUntilStorageReady; exports.useSyncExternalStoreWithSelector = _chunkQEGVIJNNcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkQEGVIJNNcjs.useYjsProvider;
180
186
  //# sourceMappingURL=_private.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/_private.cjs","../src/lib/use-layout-effect.ts","../src/use-group.ts","../src/use-mention-suggestions.ts","../src/use-sync-source.ts"],"names":["useEffect","kInternal","useState"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AC3BA,8BAAsE;AAI/D,IAAM,gBAAA,EACX,OAAO,OAAA,IAAW,YAAA,EAAc,uBAAA,EA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AA;AACvC,IAAA,aAAA,CAAc,aAAa,CAAA;AAC3B,IAAA,OAAO,CAAA,EAAA,GAAM,aAAA,CAAc,OAAA,CAAQ,CAAA;AAAA,EACrC,CAAA,EAAG,CAAC,gBAAgB,CAAC,CAAA;AAErB,EAAA,OAAO,UAAA;AACT;AJ8HA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,s9DAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/_private.cjs","sourcesContent":[null,"/* eslint-disable no-restricted-syntax */\n\nimport { useEffect, useLayoutEffect as useOriginalLayoutEffect } from \"react\";\n\n// On React 18.2.0 and earlier, useLayoutEffect triggers a warning when\n// executed on the server, so this workaround should be used instead.\nexport const useLayoutEffect =\n typeof window !== \"undefined\" ? useOriginalLayoutEffect : useEffect;\n","import {\n type AsyncResult,\n type GroupData,\n kInternal,\n shallow,\n} from \"@liveblocks/core\";\nimport { useCallback, useEffect } from \"react\";\n\nimport { useClient } from \"./contexts\";\nimport type { GroupAsyncResult } from \"./types\";\nimport { useSyncExternalStoreWithSelector } from \"./use-sync-external-store-with-selector\";\n\nfunction selectorFor_useGroup(\n state: AsyncResult<GroupData | undefined> | undefined\n): GroupAsyncResult {\n if (state === undefined || state?.isLoading) {\n return state ?? { isLoading: true };\n }\n\n if (state.error) {\n return state;\n }\n\n return {\n isLoading: false,\n group: state.data,\n };\n}\n\n/** @private - Internal API, do not rely on it. */\nexport function useGroup(groupId: string): GroupAsyncResult {\n const client = useClient();\n const store = client[kInternal].httpClient.groupsStore;\n\n const getGroupState = useCallback(\n () => store.getItemState(groupId),\n [store, groupId]\n );\n\n useEffect(() => {\n void store.enqueue(groupId);\n }, [store, groupId]);\n\n return useSyncExternalStoreWithSelector(\n store.subscribe,\n getGroupState,\n getGroupState,\n selectorFor_useGroup,\n shallow\n );\n}\n","import { type MentionData, stableStringify } from \"@liveblocks/core\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n useMentionSuggestionsCache,\n useResolveMentionSuggestions,\n} from \"./room\";\n\nconst MENTION_SUGGESTIONS_DEBOUNCE = 500;\n\n/**\n * Normalize mention suggestions as `MentionData[]`.\n *\n * Mention suggestions were previously typed as `string[]`, a list of user IDs,\n * but to support multiple mention kinds (user, group, etc), they're now\n * typed as `MentionData[]`.\n */\nfunction normalizeMentionSuggestions<T extends string[] | MentionData[]>(\n suggestions: T\n): MentionData[] {\n return suggestions.map(\n (suggestion): MentionData =>\n typeof suggestion === \"string\"\n ? { kind: \"user\" as const, id: suggestion }\n : suggestion\n );\n}\n\n/**\n * @private For internal use only. Do not rely on this hook.\n *\n * Simplistic debounced search, we don't need to worry too much about deduping\n * and race conditions as there can only be one search at a time.\n */\nexport function useMentionSuggestions(roomId: string, search?: string) {\n const [mentionSuggestions, setMentionSuggestions] = useState<MentionData[]>();\n const lastInvokedAt = useRef<number>();\n\n const resolveMentionSuggestions = useResolveMentionSuggestions();\n const mentionSuggestionsCache = useMentionSuggestionsCache();\n\n useEffect(() => {\n if (search === undefined || !resolveMentionSuggestions) {\n return;\n }\n\n const resolveMentionSuggestionsArgs = { text: search, roomId };\n const mentionSuggestionsCacheKey = stableStringify(\n resolveMentionSuggestionsArgs\n );\n let debounceTimeout: number | undefined;\n let isCanceled = false;\n\n const getMentionSuggestions = async () => {\n try {\n lastInvokedAt.current = performance.now();\n const rawMentionSuggestions = await resolveMentionSuggestions(\n resolveMentionSuggestionsArgs\n );\n\n if (!isCanceled) {\n const normalizedSuggestions = normalizeMentionSuggestions(\n rawMentionSuggestions\n );\n setMentionSuggestions(normalizedSuggestions);\n mentionSuggestionsCache.set(\n mentionSuggestionsCacheKey,\n normalizedSuggestions\n );\n }\n } catch (error) {\n console.error((error as Error)?.message);\n }\n };\n\n if (mentionSuggestionsCache.has(mentionSuggestionsCacheKey)) {\n // If there are already cached mention suggestions, use them immediately.\n const cachedSuggestions = mentionSuggestionsCache.get(\n mentionSuggestionsCacheKey\n );\n setMentionSuggestions(cachedSuggestions);\n } else if (\n !lastInvokedAt.current ||\n Math.abs(performance.now() - lastInvokedAt.current) >\n MENTION_SUGGESTIONS_DEBOUNCE\n ) {\n // If on the debounce's leading edge (either because it's the first invokation or enough\n // time has passed since the last debounce), get mention suggestions immediately.\n void getMentionSuggestions();\n } else {\n // Otherwise, wait for the debounce delay.\n debounceTimeout = window.setTimeout(() => {\n void getMentionSuggestions();\n }, MENTION_SUGGESTIONS_DEBOUNCE);\n }\n\n return () => {\n isCanceled = true;\n window.clearTimeout(debounceTimeout);\n };\n }, [search, roomId, resolveMentionSuggestions, mentionSuggestionsCache]);\n\n return mentionSuggestions;\n}\n","import type { SyncSource } from \"@liveblocks/core\";\nimport { kInternal } from \"@liveblocks/core\";\nimport { useEffect, useState } from \"react\";\n\nimport { useClient } from \"./contexts\";\n\n/**\n * @private For internal use only. Do not rely on this hook.\n */\nexport function useSyncSource(): SyncSource | undefined {\n const client = useClient();\n const createSyncSource = client[kInternal].createSyncSource;\n const [syncSource, setSyncSource] = useState<SyncSource | undefined>();\n\n useEffect(() => {\n // Create new sync source on mount\n const newSyncSource = createSyncSource();\n setSyncSource(newSyncSource);\n return () => newSyncSource.destroy();\n }, [createSyncSource]);\n\n return syncSource;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/_private.cjs","../src/lib/use-layout-effect.ts","../src/use-group.ts","../src/use-mention-suggestions.ts","../src/use-sync-source.ts"],"names":["useEffect","kInternal","useState"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AC9BA,8BAAsE;AAI/D,IAAM,gBAAA,E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,IAAA,MAAM,cAAA,EAAgB,gBAAA,CAAiB,CAAA;AACvC,IAAA,aAAA,CAAc,aAAa,CAAA;AAC3B,IAAA,OAAO,CAAA,EAAA,GAAM,aAAA,CAAc,OAAA,CAAQ,CAAA;AAAA,EACrC,CAAA,EAAG,CAAC,gBAAgB,CAAC,CAAA;AAErB,EAAA,OAAO,UAAA;AACT;AJiIA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,qrEAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/_private.cjs","sourcesContent":[null,"/* eslint-disable no-restricted-syntax */\n\nimport { useEffect, useLayoutEffect as useOriginalLayoutEffect } from \"react\";\n\n// On React 18.2.0 and earlier, useLayoutEffect triggers a warning when\n// executed on the server, so this workaround should be used instead.\nexport const useLayoutEffect =\n typeof window !== \"undefined\" ? useOriginalLayoutEffect : useEffect;\n","import {\n type AsyncResult,\n type GroupData,\n kInternal,\n shallow,\n} from \"@liveblocks/core\";\nimport { useCallback, useEffect } from \"react\";\n\nimport { useClient } from \"./contexts\";\nimport type { GroupAsyncResult } from \"./types\";\nimport { useSyncExternalStoreWithSelector } from \"./use-sync-external-store-with-selector\";\n\nfunction selectorFor_useGroup(\n state: AsyncResult<GroupData | undefined> | undefined\n): GroupAsyncResult {\n if (state === undefined || state?.isLoading) {\n return state ?? { isLoading: true };\n }\n\n if (state.error) {\n return state;\n }\n\n return {\n isLoading: false,\n group: state.data,\n };\n}\n\n/** @private - Internal API, do not rely on it. */\nexport function useGroup(groupId: string): GroupAsyncResult {\n const client = useClient();\n const store = client[kInternal].httpClient.groupsStore;\n\n const getGroupState = useCallback(\n () => store.getItemState(groupId),\n [store, groupId]\n );\n\n useEffect(() => {\n void store.enqueue(groupId);\n }, [store, groupId]);\n\n return useSyncExternalStoreWithSelector(\n store.subscribe,\n getGroupState,\n getGroupState,\n selectorFor_useGroup,\n shallow\n );\n}\n","import { type MentionData, stableStringify } from \"@liveblocks/core\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n useMentionSuggestionsCache,\n useResolveMentionSuggestions,\n} from \"./room\";\n\nconst MENTION_SUGGESTIONS_DEBOUNCE = 500;\n\n/**\n * Normalize mention suggestions as `MentionData[]`.\n *\n * Mention suggestions were previously typed as `string[]`, a list of user IDs,\n * but to support multiple mention kinds (user, group, etc), they're now\n * typed as `MentionData[]`.\n */\nfunction normalizeMentionSuggestions<T extends string[] | MentionData[]>(\n suggestions: T\n): MentionData[] {\n return suggestions.map(\n (suggestion): MentionData =>\n typeof suggestion === \"string\"\n ? { kind: \"user\" as const, id: suggestion }\n : suggestion\n );\n}\n\n/**\n * @private For internal use only. Do not rely on this hook.\n *\n * Simplistic debounced search, we don't need to worry too much about deduping\n * and race conditions as there can only be one search at a time.\n */\nexport function useMentionSuggestions(roomId: string, search?: string) {\n const [mentionSuggestions, setMentionSuggestions] = useState<MentionData[]>();\n const lastInvokedAt = useRef<number>();\n\n const resolveMentionSuggestions = useResolveMentionSuggestions();\n const mentionSuggestionsCache = useMentionSuggestionsCache();\n\n useEffect(() => {\n if (search === undefined || !resolveMentionSuggestions) {\n return;\n }\n\n const resolveMentionSuggestionsArgs = { text: search, roomId };\n const mentionSuggestionsCacheKey = stableStringify(\n resolveMentionSuggestionsArgs\n );\n let debounceTimeout: number | undefined;\n let isCanceled = false;\n\n const getMentionSuggestions = async () => {\n try {\n lastInvokedAt.current = performance.now();\n const rawMentionSuggestions = await resolveMentionSuggestions(\n resolveMentionSuggestionsArgs\n );\n\n if (!isCanceled) {\n const normalizedSuggestions = normalizeMentionSuggestions(\n rawMentionSuggestions\n );\n setMentionSuggestions(normalizedSuggestions);\n mentionSuggestionsCache.set(\n mentionSuggestionsCacheKey,\n normalizedSuggestions\n );\n }\n } catch (error) {\n console.error((error as Error)?.message);\n }\n };\n\n if (mentionSuggestionsCache.has(mentionSuggestionsCacheKey)) {\n // If there are already cached mention suggestions, use them immediately.\n const cachedSuggestions = mentionSuggestionsCache.get(\n mentionSuggestionsCacheKey\n );\n setMentionSuggestions(cachedSuggestions);\n } else if (\n !lastInvokedAt.current ||\n Math.abs(performance.now() - lastInvokedAt.current) >\n MENTION_SUGGESTIONS_DEBOUNCE\n ) {\n // If on the debounce's leading edge (either because it's the first invokation or enough\n // time has passed since the last debounce), get mention suggestions immediately.\n void getMentionSuggestions();\n } else {\n // Otherwise, wait for the debounce delay.\n debounceTimeout = window.setTimeout(() => {\n void getMentionSuggestions();\n }, MENTION_SUGGESTIONS_DEBOUNCE);\n }\n\n return () => {\n isCanceled = true;\n window.clearTimeout(debounceTimeout);\n };\n }, [search, roomId, resolveMentionSuggestions, mentionSuggestionsCache]);\n\n return mentionSuggestions;\n}\n","import type { SyncSource } from \"@liveblocks/core\";\nimport { kInternal } from \"@liveblocks/core\";\nimport { useEffect, useState } from \"react\";\n\nimport { useClient } from \"./contexts\";\n\n/**\n * @private For internal use only. Do not rely on this hook.\n */\nexport function useSyncSource(): SyncSource | undefined {\n const client = useClient();\n const createSyncSource = client[kInternal].createSyncSource;\n const [syncSource, setSyncSource] = useState<SyncSource | undefined>();\n\n useEffect(() => {\n // Create new sync source on mount\n const newSyncSource = createSyncSource();\n setSyncSource(newSyncSource);\n return () => newSyncSource.destroy();\n }, [createSyncSource]);\n\n return syncSource;\n}\n"]}
@@ -1,10 +1,18 @@
1
- import { G as GroupAsyncResult } from './room-MsYY4ALB.cjs';
2
- export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-MsYY4ALB.cjs';
1
+ import { G as GroupAsyncResult } from './room-BvPZu216.cjs';
2
+ export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useSuspendUntilPresenceReady, w as useSuspendUntilStorageReady, x as useYjsProvider } from './room-BvPZu216.cjs';
3
3
  import { MutableRefObject, useEffect } from 'react';
4
4
  import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
5
5
  import '@liveblocks/client';
6
6
  import 'react/jsx-runtime';
7
7
 
8
+ /**
9
+ * "Freezes" a given value, so that it will return the same value/instance on
10
+ * each subsequent render. This can be used to freeze "initial" values for
11
+ * custom hooks, much like how `useState(initialState)` or
12
+ * `useRef(initialValue)` works.
13
+ */
14
+ declare function useInitial<T>(value: T, roomId?: string): T;
15
+
8
16
  /**
9
17
  * Keeps a ref in sync with a given value that may or may not change on
10
18
  * every render.
@@ -38,4 +46,4 @@ declare function useSyncExternalStoreWithSelector<Snapshot, Selection>(subscribe
38
46
  */
39
47
  declare function useSyncSource(): SyncSource | undefined;
40
48
 
41
- export { useGroup, useLatest, useLayoutEffect, useMentionSuggestions, useSignal, useSyncExternalStoreWithSelector, useSyncSource };
49
+ export { useGroup, useInitial, useLatest, useLayoutEffect, useMentionSuggestions, useSignal, useSyncExternalStoreWithSelector, useSyncSource };
@@ -1,10 +1,18 @@
1
- import { G as GroupAsyncResult } from './room-MsYY4ALB.js';
2
- export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useYjsProvider } from './room-MsYY4ALB.js';
1
+ import { G as GroupAsyncResult } from './room-BvPZu216.js';
2
+ export { g as getUmbrellaStoreForClient, a as useAddRoomCommentReaction, u as useClientOrNull, b as useCreateRoomComment, c as useCreateRoomThread, d as useCreateTextMention, e as useDeleteRoomComment, f as useDeleteRoomThread, h as useDeleteTextMention, i as useEditRoomComment, j as useEditRoomThreadMetadata, k as useMarkRoomThreadAsRead, l as useMarkRoomThreadAsResolved, m as useMarkRoomThreadAsUnresolved, n as useMentionSuggestionsCache, o as useRemoveRoomCommentReaction, p as useReportTextEditor, q as useResolveMentionSuggestions, r as useRoomAttachmentUrl, s as useRoomPermissions, t as useRoomThreadSubscription, v as useSuspendUntilPresenceReady, w as useSuspendUntilStorageReady, x as useYjsProvider } from './room-BvPZu216.js';
3
3
  import { MutableRefObject, useEffect } from 'react';
4
4
  import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
5
5
  import '@liveblocks/client';
6
6
  import 'react/jsx-runtime';
7
7
 
8
+ /**
9
+ * "Freezes" a given value, so that it will return the same value/instance on
10
+ * each subsequent render. This can be used to freeze "initial" values for
11
+ * custom hooks, much like how `useState(initialState)` or
12
+ * `useRef(initialValue)` works.
13
+ */
14
+ declare function useInitial<T>(value: T, roomId?: string): T;
15
+
8
16
  /**
9
17
  * Keeps a ref in sync with a given value that may or may not change on
10
18
  * every render.
@@ -38,4 +46,4 @@ declare function useSyncExternalStoreWithSelector<Snapshot, Selection>(subscribe
38
46
  */
39
47
  declare function useSyncSource(): SyncSource | undefined;
40
48
 
41
- export { useGroup, useLatest, useLayoutEffect, useMentionSuggestions, useSignal, useSyncExternalStoreWithSelector, useSyncSource };
49
+ export { useGroup, useInitial, useLatest, useLayoutEffect, useMentionSuggestions, useSignal, useSyncExternalStoreWithSelector, useSyncSource };
package/dist/_private.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  useDeleteTextMention,
12
12
  useEditRoomComment,
13
13
  useEditRoomThreadMetadata,
14
+ useInitial,
14
15
  useLatest,
15
16
  useMarkRoomThreadAsRead,
16
17
  useMarkRoomThreadAsResolved,
@@ -23,9 +24,11 @@ import {
23
24
  useRoomPermissions,
24
25
  useRoomThreadSubscription,
25
26
  useSignal,
27
+ useSuspendUntilPresenceReady,
28
+ useSuspendUntilStorageReady,
26
29
  useSyncExternalStoreWithSelector,
27
30
  useYjsProvider
28
- } from "./chunk-7TVEKSIE.js";
31
+ } from "./chunk-2VF57BZV.js";
29
32
 
30
33
  // src/lib/use-layout-effect.ts
31
34
  import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
@@ -159,6 +162,7 @@ export {
159
162
  useEditRoomComment,
160
163
  useEditRoomThreadMetadata,
161
164
  useGroup,
165
+ useInitial,
162
166
  useLatest,
163
167
  useLayoutEffect,
164
168
  useMarkRoomThreadAsRead,
@@ -173,6 +177,8 @@ export {
173
177
  useRoomPermissions,
174
178
  useRoomThreadSubscription,
175
179
  useSignal,
180
+ useSuspendUntilPresenceReady,
181
+ useSuspendUntilStorageReady,
176
182
  useSyncExternalStoreWithSelector,
177
183
  useSyncSource,
178
184
  useYjsProvider
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/lib/use-layout-effect.ts","../src/use-group.ts","../src/use-mention-suggestions.ts","../src/use-sync-source.ts"],"sourcesContent":["/* eslint-disable no-restricted-syntax */\n\nimport { useEffect, useLayoutEffect as useOriginalLayoutEffect } from \"react\";\n\n// On React 18.2.0 and earlier, useLayoutEffect triggers a warning when\n// executed on the server, so this workaround should be used instead.\nexport const useLayoutEffect =\n typeof window !== \"undefined\" ? useOriginalLayoutEffect : useEffect;\n","import {\n type AsyncResult,\n type GroupData,\n kInternal,\n shallow,\n} from \"@liveblocks/core\";\nimport { useCallback, useEffect } from \"react\";\n\nimport { useClient } from \"./contexts\";\nimport type { GroupAsyncResult } from \"./types\";\nimport { useSyncExternalStoreWithSelector } from \"./use-sync-external-store-with-selector\";\n\nfunction selectorFor_useGroup(\n state: AsyncResult<GroupData | undefined> | undefined\n): GroupAsyncResult {\n if (state === undefined || state?.isLoading) {\n return state ?? { isLoading: true };\n }\n\n if (state.error) {\n return state;\n }\n\n return {\n isLoading: false,\n group: state.data,\n };\n}\n\n/** @private - Internal API, do not rely on it. */\nexport function useGroup(groupId: string): GroupAsyncResult {\n const client = useClient();\n const store = client[kInternal].httpClient.groupsStore;\n\n const getGroupState = useCallback(\n () => store.getItemState(groupId),\n [store, groupId]\n );\n\n useEffect(() => {\n void store.enqueue(groupId);\n }, [store, groupId]);\n\n return useSyncExternalStoreWithSelector(\n store.subscribe,\n getGroupState,\n getGroupState,\n selectorFor_useGroup,\n shallow\n );\n}\n","import { type MentionData, stableStringify } from \"@liveblocks/core\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n useMentionSuggestionsCache,\n useResolveMentionSuggestions,\n} from \"./room\";\n\nconst MENTION_SUGGESTIONS_DEBOUNCE = 500;\n\n/**\n * Normalize mention suggestions as `MentionData[]`.\n *\n * Mention suggestions were previously typed as `string[]`, a list of user IDs,\n * but to support multiple mention kinds (user, group, etc), they're now\n * typed as `MentionData[]`.\n */\nfunction normalizeMentionSuggestions<T extends string[] | MentionData[]>(\n suggestions: T\n): MentionData[] {\n return suggestions.map(\n (suggestion): MentionData =>\n typeof suggestion === \"string\"\n ? { kind: \"user\" as const, id: suggestion }\n : suggestion\n );\n}\n\n/**\n * @private For internal use only. Do not rely on this hook.\n *\n * Simplistic debounced search, we don't need to worry too much about deduping\n * and race conditions as there can only be one search at a time.\n */\nexport function useMentionSuggestions(roomId: string, search?: string) {\n const [mentionSuggestions, setMentionSuggestions] = useState<MentionData[]>();\n const lastInvokedAt = useRef<number>();\n\n const resolveMentionSuggestions = useResolveMentionSuggestions();\n const mentionSuggestionsCache = useMentionSuggestionsCache();\n\n useEffect(() => {\n if (search === undefined || !resolveMentionSuggestions) {\n return;\n }\n\n const resolveMentionSuggestionsArgs = { text: search, roomId };\n const mentionSuggestionsCacheKey = stableStringify(\n resolveMentionSuggestionsArgs\n );\n let debounceTimeout: number | undefined;\n let isCanceled = false;\n\n const getMentionSuggestions = async () => {\n try {\n lastInvokedAt.current = performance.now();\n const rawMentionSuggestions = await resolveMentionSuggestions(\n resolveMentionSuggestionsArgs\n );\n\n if (!isCanceled) {\n const normalizedSuggestions = normalizeMentionSuggestions(\n rawMentionSuggestions\n );\n setMentionSuggestions(normalizedSuggestions);\n mentionSuggestionsCache.set(\n mentionSuggestionsCacheKey,\n normalizedSuggestions\n );\n }\n } catch (error) {\n console.error((error as Error)?.message);\n }\n };\n\n if (mentionSuggestionsCache.has(mentionSuggestionsCacheKey)) {\n // If there are already cached mention suggestions, use them immediately.\n const cachedSuggestions = mentionSuggestionsCache.get(\n mentionSuggestionsCacheKey\n );\n setMentionSuggestions(cachedSuggestions);\n } else if (\n !lastInvokedAt.current ||\n Math.abs(performance.now() - lastInvokedAt.current) >\n MENTION_SUGGESTIONS_DEBOUNCE\n ) {\n // If on the debounce's leading edge (either because it's the first invokation or enough\n // time has passed since the last debounce), get mention suggestions immediately.\n void getMentionSuggestions();\n } else {\n // Otherwise, wait for the debounce delay.\n debounceTimeout = window.setTimeout(() => {\n void getMentionSuggestions();\n }, MENTION_SUGGESTIONS_DEBOUNCE);\n }\n\n return () => {\n isCanceled = true;\n window.clearTimeout(debounceTimeout);\n };\n }, [search, roomId, resolveMentionSuggestions, mentionSuggestionsCache]);\n\n return mentionSuggestions;\n}\n","import type { SyncSource } from \"@liveblocks/core\";\nimport { kInternal } from \"@liveblocks/core\";\nimport { useEffect, useState } from \"react\";\n\nimport { useClient } from \"./contexts\";\n\n/**\n * @private For internal use only. Do not rely on this hook.\n */\nexport function useSyncSource(): SyncSource | undefined {\n const client = useClient();\n const createSyncSource = client[kInternal].createSyncSource;\n const [syncSource, setSyncSource] = useState<SyncSource | undefined>();\n\n useEffect(() => {\n // Create new sync source on mount\n const newSyncSource = createSyncSource();\n setSyncSource(newSyncSource);\n return () => newSyncSource.destroy();\n }, [createSyncSource]);\n\n return syncSource;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,WAAW,mBAAmB,+BAA+B;AAI/D,IAAM,kBACX,OAAO,WAAW,cAAc,0BAA0B;;;ACP5D;AAAA,EAGE;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,aAAAA,kBAAiB;AAMvC,SAAS,qBACP,OACkB;AAClB,MAAI,UAAU,UAAa,OAAO,WAAW;AAC3C,WAAO,SAAS,EAAE,WAAW,KAAK;AAAA,EACpC;AAEA,MAAI,MAAM,OAAO;AACf,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,WAAW;AAAA,IACX,OAAO,MAAM;AAAA,EACf;AACF;AAGO,SAAS,SAAS,SAAmC;AAC1D,QAAM,SAAS,UAAU;AACzB,QAAM,QAAQ,OAAO,SAAS,EAAE,WAAW;AAE3C,QAAM,gBAAgB;AAAA,IACpB,MAAM,MAAM,aAAa,OAAO;AAAA,IAChC,CAAC,OAAO,OAAO;AAAA,EACjB;AAEA,EAAAC,WAAU,MAAM;AACd,SAAK,MAAM,QAAQ,OAAO;AAAA,EAC5B,GAAG,CAAC,OAAO,OAAO,CAAC;AAEnB,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,E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,sBAAsB;AAAA,MAC7B,GAAG,4BAA4B;AAAA,IACjC;AAEA,WAAO,MAAM;AACX,mBAAa;AACb,aAAO,aAAa,eAAe;AAAA,IACrC;AAAA,EACF,GAAG,CAAC,QAAQ,QAAQ,2BAA2B,uBAAuB,CAAC;AAEvE,SAAO;AACT;;;ACtGA,SAAS,aAAAC,kBAAiB;AAC1B,SAAS,aAAAC,YAAW,YAAAC,iBAAgB;AAO7B,SAAS,gBAAwC;AACtD,QAAM,SAAS,UAAU;AACzB,QAAM,mBAAmB,OAAOC,UAAS,EAAE;AAC3C,QAAM,CAAC,YAAY,aAAa,IAAIC,UAAiC;AAErE,EAAAC,WAAU,MAAM;AAEd,UAAM,gBAAgB,iBAAiB;AACvC,kBAAc,aAAa;AAC3B,WAAO,MAAM,cAAc,QAAQ;AAAA,EACrC,GAAG,CAAC,gBAAgB,CAAC;AAErB,SAAO;AACT;","names":["useEffect","useEffect","useEffect","useEffect","kInternal","useEffect","useState","kInternal","useState","useEffect"]}
1
+ {"version":3,"sources":["../src/lib/use-layout-effect.ts","../src/use-group.ts","../src/use-mention-suggestions.ts","../src/use-sync-source.ts"],"sourcesContent":["/* eslint-disable no-restricted-syntax */\n\nimport { useEffect, useLayoutEffect as useOriginalLayoutEffect } from \"react\";\n\n// On React 18.2.0 and earlier, useLayoutEffect triggers a warning when\n// executed on the server, so this workaround should be used instead.\nexport const useLayoutEffect =\n typeof window !== \"undefined\" ? useOriginalLayoutEffect : useEffect;\n","import {\n type AsyncResult,\n type GroupData,\n kInternal,\n shallow,\n} from \"@liveblocks/core\";\nimport { useCallback, useEffect } from \"react\";\n\nimport { useClient } from \"./contexts\";\nimport type { GroupAsyncResult } from \"./types\";\nimport { useSyncExternalStoreWithSelector } from \"./use-sync-external-store-with-selector\";\n\nfunction selectorFor_useGroup(\n state: AsyncResult<GroupData | undefined> | undefined\n): GroupAsyncResult {\n if (state === undefined || state?.isLoading) {\n return state ?? { isLoading: true };\n }\n\n if (state.error) {\n return state;\n }\n\n return {\n isLoading: false,\n group: state.data,\n };\n}\n\n/** @private - Internal API, do not rely on it. */\nexport function useGroup(groupId: string): GroupAsyncResult {\n const client = useClient();\n const store = client[kInternal].httpClient.groupsStore;\n\n const getGroupState = useCallback(\n () => store.getItemState(groupId),\n [store, groupId]\n );\n\n useEffect(() => {\n void store.enqueue(groupId);\n }, [store, groupId]);\n\n return useSyncExternalStoreWithSelector(\n store.subscribe,\n getGroupState,\n getGroupState,\n selectorFor_useGroup,\n shallow\n );\n}\n","import { type MentionData, stableStringify } from \"@liveblocks/core\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport {\n useMentionSuggestionsCache,\n useResolveMentionSuggestions,\n} from \"./room\";\n\nconst MENTION_SUGGESTIONS_DEBOUNCE = 500;\n\n/**\n * Normalize mention suggestions as `MentionData[]`.\n *\n * Mention suggestions were previously typed as `string[]`, a list of user IDs,\n * but to support multiple mention kinds (user, group, etc), they're now\n * typed as `MentionData[]`.\n */\nfunction normalizeMentionSuggestions<T extends string[] | MentionData[]>(\n suggestions: T\n): MentionData[] {\n return suggestions.map(\n (suggestion): MentionData =>\n typeof suggestion === \"string\"\n ? { kind: \"user\" as const, id: suggestion }\n : suggestion\n );\n}\n\n/**\n * @private For internal use only. Do not rely on this hook.\n *\n * Simplistic debounced search, we don't need to worry too much about deduping\n * and race conditions as there can only be one search at a time.\n */\nexport function useMentionSuggestions(roomId: string, search?: string) {\n const [mentionSuggestions, setMentionSuggestions] = useState<MentionData[]>();\n const lastInvokedAt = useRef<number>();\n\n const resolveMentionSuggestions = useResolveMentionSuggestions();\n const mentionSuggestionsCache = useMentionSuggestionsCache();\n\n useEffect(() => {\n if (search === undefined || !resolveMentionSuggestions) {\n return;\n }\n\n const resolveMentionSuggestionsArgs = { text: search, roomId };\n const mentionSuggestionsCacheKey = stableStringify(\n resolveMentionSuggestionsArgs\n );\n let debounceTimeout: number | undefined;\n let isCanceled = false;\n\n const getMentionSuggestions = async () => {\n try {\n lastInvokedAt.current = performance.now();\n const rawMentionSuggestions = await resolveMentionSuggestions(\n resolveMentionSuggestionsArgs\n );\n\n if (!isCanceled) {\n const normalizedSuggestions = normalizeMentionSuggestions(\n rawMentionSuggestions\n );\n setMentionSuggestions(normalizedSuggestions);\n mentionSuggestionsCache.set(\n mentionSuggestionsCacheKey,\n normalizedSuggestions\n );\n }\n } catch (error) {\n console.error((error as Error)?.message);\n }\n };\n\n if (mentionSuggestionsCache.has(mentionSuggestionsCacheKey)) {\n // If there are already cached mention suggestions, use them immediately.\n const cachedSuggestions = mentionSuggestionsCache.get(\n mentionSuggestionsCacheKey\n );\n setMentionSuggestions(cachedSuggestions);\n } else if (\n !lastInvokedAt.current ||\n Math.abs(performance.now() - lastInvokedAt.current) >\n MENTION_SUGGESTIONS_DEBOUNCE\n ) {\n // If on the debounce's leading edge (either because it's the first invokation or enough\n // time has passed since the last debounce), get mention suggestions immediately.\n void getMentionSuggestions();\n } else {\n // Otherwise, wait for the debounce delay.\n debounceTimeout = window.setTimeout(() => {\n void getMentionSuggestions();\n }, MENTION_SUGGESTIONS_DEBOUNCE);\n }\n\n return () => {\n isCanceled = true;\n window.clearTimeout(debounceTimeout);\n };\n }, [search, roomId, resolveMentionSuggestions, mentionSuggestionsCache]);\n\n return mentionSuggestions;\n}\n","import type { SyncSource } from \"@liveblocks/core\";\nimport { kInternal } from \"@liveblocks/core\";\nimport { useEffect, useState } from \"react\";\n\nimport { useClient } from \"./contexts\";\n\n/**\n * @private For internal use only. Do not rely on this hook.\n */\nexport function useSyncSource(): SyncSource | undefined {\n const client = useClient();\n const createSyncSource = client[kInternal].createSyncSource;\n const [syncSource, setSyncSource] = useState<SyncSource | undefined>();\n\n useEffect(() => {\n // Create new sync source on mount\n const newSyncSource = createSyncSource();\n setSyncSource(newSyncSource);\n return () => newSyncSource.destroy();\n }, [createSyncSource]);\n\n return syncSource;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,WAAW,mBAAmB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AAA,EACrC,GAAG,CAAC,gBAAgB,CAAC;AAErB,SAAO;AACT;","names":["useEffect","useEffect","useEffect","useEffect","kInternal","useEffect","useState","kInternal","useState","useEffect"]}
@@ -27,6 +27,25 @@ function useLatest(value) {
27
27
  return ref;
28
28
  }
29
29
 
30
+ // src/lib/use-initial.ts
31
+ import { useCallback, useMemo } from "react";
32
+ function useInitial(value, roomId) {
33
+ return useMemo(() => value, [roomId]);
34
+ }
35
+ function useInitialUnlessFunction(latestValue, roomId) {
36
+ const frozenValue = useInitial(latestValue, roomId);
37
+ const ref = useLatest(latestValue);
38
+ const wrapper = useCallback(
39
+ (...args) => ref.current(...args),
40
+ [ref]
41
+ );
42
+ if (typeof frozenValue === "function") {
43
+ return wrapper;
44
+ } else {
45
+ return frozenValue;
46
+ }
47
+ }
48
+
30
49
  // src/ai.tsx
31
50
  import { kInternal, nanoid } from "@liveblocks/core";
32
51
  import { memo, useEffect as useEffect2, useId, useState } from "react";
@@ -82,7 +101,7 @@ var RegisterAiTool = memo(function RegisterAiTool2({
82
101
  import {
83
102
  useDebugValue,
84
103
  useEffect as useEffect3,
85
- useMemo,
104
+ useMemo as useMemo2,
86
105
  useRef as useRef2,
87
106
  useSyncExternalStore
88
107
  } from "react";
@@ -101,7 +120,7 @@ function useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnaps
101
120
  } else {
102
121
  inst = instRef.current;
103
122
  }
104
- const [getSelection, getServerSelection] = useMemo(() => {
123
+ const [getSelection, getServerSelection] = useMemo2(() => {
105
124
  let hasMemo = false;
106
125
  let memoizedSnapshot;
107
126
  let memoizedSelection;
@@ -231,25 +250,6 @@ function ensureNotServerSide() {
231
250
  }
232
251
  }
233
252
 
234
- // src/lib/use-initial.ts
235
- import { useCallback, useMemo as useMemo2 } from "react";
236
- function useInitial(value, roomId) {
237
- return useMemo2(() => value, [roomId]);
238
- }
239
- function useInitialUnlessFunction(latestValue, roomId) {
240
- const frozenValue = useInitial(latestValue, roomId);
241
- const ref = useLatest(latestValue);
242
- const wrapper = useCallback(
243
- (...args) => ref.current(...args),
244
- [ref]
245
- );
246
- if (typeof frozenValue === "function") {
247
- return wrapper;
248
- } else {
249
- return frozenValue;
250
- }
251
- }
252
-
253
253
  // src/lib/use-polyfill.ts
254
254
  import * as React from "react";
255
255
  var reactUse = React[" use ".trim().toString()];
@@ -5030,6 +5030,9 @@ function useSuspendUntilPresenceReady_withRoomContext(RoomContext) {
5030
5030
  const room = useRoom_withRoomContext(RoomContext);
5031
5031
  use(room.waitUntilPresenceReady());
5032
5032
  }
5033
+ function useSuspendUntilPresenceReady() {
5034
+ return useSuspendUntilPresenceReady_withRoomContext(GlobalRoomContext);
5035
+ }
5033
5036
  function useSelfSuspense_withRoomContext(RoomContext, selector, isEqual) {
5034
5037
  useSuspendUntilPresenceReady_withRoomContext(RoomContext);
5035
5038
  return useSelf_withRoomContext(
@@ -5104,6 +5107,9 @@ function useSuspendUntilStorageReady_withRoomContext(RoomContext) {
5104
5107
  const room = useRoom_withRoomContext(RoomContext);
5105
5108
  use(room.waitUntilStorageReady());
5106
5109
  }
5110
+ function useSuspendUntilStorageReady() {
5111
+ return useSuspendUntilStorageReady_withRoomContext(GlobalRoomContext);
5112
+ }
5107
5113
  function useStorageSuspense_withRoomContext(RoomContext, selector, isEqual) {
5108
5114
  useSuspendUntilStorageReady_withRoomContext(RoomContext);
5109
5115
  return useStorage_withRoomContext(
@@ -5626,6 +5632,7 @@ export {
5626
5632
  useClient,
5627
5633
  GlobalRoomContext,
5628
5634
  useLatest,
5635
+ useInitial,
5629
5636
  RegisterAiKnowledge,
5630
5637
  RegisterAiTool,
5631
5638
  useSyncExternalStoreWithSelector,
@@ -5703,7 +5710,9 @@ export {
5703
5710
  useRoomThreadSubscription,
5704
5711
  useHistoryVersionData,
5705
5712
  useUpdateRoomSubscriptionSettings,
5713
+ useSuspendUntilPresenceReady,
5706
5714
  useOthersConnectionIdsSuspense,
5715
+ useSuspendUntilStorageReady,
5707
5716
  useAttachmentUrl,
5708
5717
  useRoomAttachmentUrl,
5709
5718
  useAttachmentUrlSuspense,
@@ -5744,4 +5753,4 @@ export {
5744
5753
  _useStorageRoot,
5745
5754
  _useUpdateMyPresence
5746
5755
  };
5747
- //# sourceMappingURL=chunk-7TVEKSIE.js.map
5756
+ //# sourceMappingURL=chunk-2VF57BZV.js.map