@liveblocks/react 3.23.0-file2 → 3.23.0-file4
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 +7 -7
- package/dist/_private.d.cts +2 -2
- package/dist/_private.d.ts +2 -2
- package/dist/_private.js +1 -1
- package/dist/{chunk-4Y44J4GN.js → chunk-HNNQLKPG.js} +2 -2
- package/dist/{chunk-CTG3FMRO.js → chunk-JMMTB4CU.js} +37 -9
- package/dist/chunk-JMMTB4CU.js.map +1 -0
- package/dist/{chunk-L5JH73RJ.cjs → chunk-SPZHRPMG.cjs} +38 -10
- package/dist/chunk-SPZHRPMG.cjs.map +1 -0
- package/dist/{chunk-DKLVP4PZ.cjs → chunk-ZY7D46YS.cjs} +2 -2
- package/dist/{chunk-DKLVP4PZ.cjs.map → chunk-ZY7D46YS.cjs.map} +1 -1
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/{room-BRD10hWb.d.cts → room-DUr5FIYB.d.cts} +20 -2
- package/dist/{room-BRD10hWb.d.ts → room-DUr5FIYB.d.ts} +20 -2
- package/dist/suspense.cjs +6 -4
- package/dist/suspense.cjs.map +1 -1
- package/dist/suspense.d.cts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +5 -3
- package/dist/suspense.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-CTG3FMRO.js.map +0 -1
- package/dist/chunk-L5JH73RJ.cjs.map +0 -1
- /package/dist/{chunk-4Y44J4GN.js.map → chunk-HNNQLKPG.js.map} +0 -0
package/dist/_private.cjs
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkSPZHRPMGcjs = require('./chunk-SPZHRPMG.cjs');
|
|
34
34
|
|
|
35
35
|
// src/lib/use-layout-effect.ts
|
|
36
36
|
var _react = require('react');
|
|
@@ -55,7 +55,7 @@ function selectorFor_useGroup(state) {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
function useGroup(groupId) {
|
|
58
|
-
const client =
|
|
58
|
+
const client = _chunkSPZHRPMGcjs.useClient.call(void 0, );
|
|
59
59
|
const store = client[_core.kInternal].httpClient.groupsStore;
|
|
60
60
|
const getGroupState = _react.useCallback.call(void 0,
|
|
61
61
|
() => store.getItemState(groupId),
|
|
@@ -64,7 +64,7 @@ function useGroup(groupId) {
|
|
|
64
64
|
_react.useEffect.call(void 0, () => {
|
|
65
65
|
void store.enqueue(groupId);
|
|
66
66
|
}, [store, groupId]);
|
|
67
|
-
return
|
|
67
|
+
return _chunkSPZHRPMGcjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
68
68
|
store.subscribe,
|
|
69
69
|
getGroupState,
|
|
70
70
|
getGroupState,
|
|
@@ -85,8 +85,8 @@ function normalizeMentionSuggestions(suggestions) {
|
|
|
85
85
|
function useMentionSuggestions(roomId, search) {
|
|
86
86
|
const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
|
|
87
87
|
const lastInvokedAt = _react.useRef.call(void 0, );
|
|
88
|
-
const resolveMentionSuggestions =
|
|
89
|
-
const mentionSuggestionsCache =
|
|
88
|
+
const resolveMentionSuggestions = _chunkSPZHRPMGcjs.useResolveMentionSuggestions.call(void 0, );
|
|
89
|
+
const mentionSuggestionsCache = _chunkSPZHRPMGcjs.useMentionSuggestionsCache.call(void 0, );
|
|
90
90
|
_react.useEffect.call(void 0, () => {
|
|
91
91
|
if (search === void 0 || !resolveMentionSuggestions) {
|
|
92
92
|
return;
|
|
@@ -141,7 +141,7 @@ function useMentionSuggestions(roomId, search) {
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
function useSyncSource() {
|
|
144
|
-
const client =
|
|
144
|
+
const client = _chunkSPZHRPMGcjs.useClient.call(void 0, );
|
|
145
145
|
const createSyncSource = client[_core.kInternal].createSyncSource;
|
|
146
146
|
const [syncSource, setSyncSource] = _react.useState.call(void 0, );
|
|
147
147
|
_react.useEffect.call(void 0, () => {
|
|
@@ -186,5 +186,5 @@ function useSyncSource() {
|
|
|
186
186
|
|
|
187
187
|
|
|
188
188
|
|
|
189
|
-
exports.getUmbrellaStoreForClient =
|
|
189
|
+
exports.getUmbrellaStoreForClient = _chunkSPZHRPMGcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkSPZHRPMGcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkSPZHRPMGcjs.useClientOrNull; exports.useCreateRoomComment = _chunkSPZHRPMGcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkSPZHRPMGcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkSPZHRPMGcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkSPZHRPMGcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkSPZHRPMGcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkSPZHRPMGcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkSPZHRPMGcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkSPZHRPMGcjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useHasPermissionAccess = _chunkSPZHRPMGcjs.useHasPermissionAccess; exports.useInitial = _chunkSPZHRPMGcjs.useInitial; exports.useLatest = _chunkSPZHRPMGcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkSPZHRPMGcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkSPZHRPMGcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkSPZHRPMGcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkSPZHRPMGcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkSPZHRPMGcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkSPZHRPMGcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkSPZHRPMGcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkSPZHRPMGcjs.useRoomAttachmentUrl; exports.useRoomFileUrl = _chunkSPZHRPMGcjs.useRoomFileUrl; exports.useRoomPermissions = _chunkSPZHRPMGcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkSPZHRPMGcjs.useRoomThreadSubscription; exports.useSignal = _chunkSPZHRPMGcjs.useSignal; exports.useSuspendUntilPresenceReady = _chunkSPZHRPMGcjs.useSuspendUntilPresenceReady; exports.useSuspendUntilStorageReady = _chunkSPZHRPMGcjs.useSuspendUntilStorageReady; exports.useSyncExternalStoreWithSelector = _chunkSPZHRPMGcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkSPZHRPMGcjs.useYjsProvider;
|
|
190
190
|
//# sourceMappingURL=_private.cjs.map
|
package/dist/_private.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GroupAsyncResult } from './room-
|
|
2
|
-
export { g as getUmbrellaStoreForClient, u as useAddRoomCommentReaction, a 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 useHasPermissionAccess, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, t as useRoomFileUrl, v as useRoomPermissions, w as useRoomThreadSubscription, x as useSuspendUntilPresenceReady, y as useSuspendUntilStorageReady, z as useYjsProvider } from './room-
|
|
1
|
+
import { G as GroupAsyncResult } from './room-DUr5FIYB.cjs';
|
|
2
|
+
export { g as getUmbrellaStoreForClient, u as useAddRoomCommentReaction, a 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 useHasPermissionAccess, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, t as useRoomFileUrl, v as useRoomPermissions, w as useRoomThreadSubscription, x as useSuspendUntilPresenceReady, y as useSuspendUntilStorageReady, z as useYjsProvider } from './room-DUr5FIYB.cjs';
|
|
3
3
|
import { MutableRefObject, useEffect } from 'react';
|
|
4
4
|
import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
|
|
5
5
|
import '@liveblocks/client';
|
package/dist/_private.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as GroupAsyncResult } from './room-
|
|
2
|
-
export { g as getUmbrellaStoreForClient, u as useAddRoomCommentReaction, a 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 useHasPermissionAccess, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, t as useRoomFileUrl, v as useRoomPermissions, w as useRoomThreadSubscription, x as useSuspendUntilPresenceReady, y as useSuspendUntilStorageReady, z as useYjsProvider } from './room-
|
|
1
|
+
import { G as GroupAsyncResult } from './room-DUr5FIYB.js';
|
|
2
|
+
export { g as getUmbrellaStoreForClient, u as useAddRoomCommentReaction, a 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 useHasPermissionAccess, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, t as useRoomFileUrl, v as useRoomPermissions, w as useRoomThreadSubscription, x as useSuspendUntilPresenceReady, y as useSuspendUntilStorageReady, z as useYjsProvider } from './room-DUr5FIYB.js';
|
|
3
3
|
import { MutableRefObject, useEffect } from 'react';
|
|
4
4
|
import { MentionData, ISignal, SyncSource } from '@liveblocks/core';
|
|
5
5
|
import '@liveblocks/client';
|
package/dist/_private.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
useSuspendUntilStorageReady,
|
|
31
31
|
useSyncExternalStoreWithSelector,
|
|
32
32
|
useYjsProvider
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-JMMTB4CU.js";
|
|
34
34
|
|
|
35
35
|
// src/lib/use-layout-effect.ts
|
|
36
36
|
import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
2
|
var PKG_NAME = "@liveblocks/react";
|
|
3
|
-
var PKG_VERSION = "3.23.0-
|
|
3
|
+
var PKG_VERSION = "3.23.0-file4";
|
|
4
4
|
var PKG_FORMAT = "esm";
|
|
5
5
|
|
|
6
6
|
// src/ClientSideSuspense.tsx
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
PKG_FORMAT,
|
|
21
21
|
ClientSideSuspense
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-HNNQLKPG.js.map
|
|
@@ -4310,6 +4310,16 @@ function useMutation(callback, deps) {
|
|
|
4310
4310
|
deps
|
|
4311
4311
|
);
|
|
4312
4312
|
}
|
|
4313
|
+
function useUploadFile_withRoomContext(RoomContext) {
|
|
4314
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4315
|
+
return useCallback3(
|
|
4316
|
+
(file, options) => room.uploadFile(file, options),
|
|
4317
|
+
[room]
|
|
4318
|
+
);
|
|
4319
|
+
}
|
|
4320
|
+
function useUploadFile() {
|
|
4321
|
+
return useUploadFile_withRoomContext(GlobalRoomContext);
|
|
4322
|
+
}
|
|
4313
4323
|
function useThreads_withRoomContext(RoomContext, options = {}) {
|
|
4314
4324
|
const { scrollOnLoad = true } = options;
|
|
4315
4325
|
const client = useClient();
|
|
@@ -5643,7 +5653,7 @@ function selectorFor_useFileUrl(state) {
|
|
|
5643
5653
|
assert2(state.data !== void 0, "Unexpected missing file URL");
|
|
5644
5654
|
return {
|
|
5645
5655
|
isLoading: false,
|
|
5646
|
-
url: state.data
|
|
5656
|
+
url: state.data.url
|
|
5647
5657
|
};
|
|
5648
5658
|
}
|
|
5649
5659
|
function useAttachmentUrl_withRoomContext(RoomContext, attachmentId) {
|
|
@@ -5673,29 +5683,35 @@ function useRoomAttachmentUrl(attachmentId, roomId) {
|
|
|
5673
5683
|
}
|
|
5674
5684
|
function useFileUrl_withRoomContext(RoomContext, file) {
|
|
5675
5685
|
const room = useRoom_withRoomContext(RoomContext);
|
|
5676
|
-
return
|
|
5686
|
+
return useFileUrl_WithStore(file, room[kInternal4].fileUrlsStore);
|
|
5677
5687
|
}
|
|
5678
5688
|
function useFileUrl(file) {
|
|
5679
5689
|
return useFileUrl_withRoomContext(GlobalRoomContext, file);
|
|
5680
5690
|
}
|
|
5681
5691
|
function useRoomFileUrl(file, roomId) {
|
|
5682
|
-
const fileId = getLiveFileId(file);
|
|
5683
5692
|
const client = useClient();
|
|
5684
5693
|
const store = client[kInternal4].httpClient.getOrCreateFileUrlsStore(roomId);
|
|
5694
|
+
return useFileUrl_WithStore(file, store);
|
|
5695
|
+
}
|
|
5696
|
+
function useFileUrl_WithStore(file, store) {
|
|
5697
|
+
const fileId = getLiveFileId(file);
|
|
5685
5698
|
const getFileUrlState = useCallback3(
|
|
5686
5699
|
() => store.getItemState(fileId),
|
|
5687
5700
|
[store, fileId]
|
|
5688
5701
|
);
|
|
5689
|
-
|
|
5690
|
-
void store.enqueue(fileId);
|
|
5691
|
-
}, [store, fileId]);
|
|
5692
|
-
return useSyncExternalStoreWithSelector(
|
|
5702
|
+
const result = useSyncExternalStoreWithSelector(
|
|
5693
5703
|
store.subscribe,
|
|
5694
5704
|
getFileUrlState,
|
|
5695
5705
|
getFileUrlState,
|
|
5696
5706
|
selectorFor_useFileUrl,
|
|
5697
5707
|
shallow4
|
|
5698
5708
|
);
|
|
5709
|
+
useEffect6(() => {
|
|
5710
|
+
if (result.isLoading) {
|
|
5711
|
+
void store.enqueue(fileId);
|
|
5712
|
+
}
|
|
5713
|
+
}, [store, fileId, result.isLoading]);
|
|
5714
|
+
return result;
|
|
5699
5715
|
}
|
|
5700
5716
|
function useAttachmentUrlSuspense_withRoomContext(RoomContext, attachmentId) {
|
|
5701
5717
|
const room = useRoom_withRoomContext(RoomContext);
|
|
@@ -5744,6 +5760,10 @@ function useFileUrlSuspense_withRoomContext(RoomContext, file) {
|
|
|
5744
5760
|
throw fileUrlsStore.enqueue(fileId);
|
|
5745
5761
|
}
|
|
5746
5762
|
if (fileUrlState.error) {
|
|
5763
|
+
const cacheExpiry$ = fileUrlsStore.waitUntilItemCacheExpires(fileId);
|
|
5764
|
+
if (cacheExpiry$ !== void 0) {
|
|
5765
|
+
throw cacheExpiry$;
|
|
5766
|
+
}
|
|
5747
5767
|
throw fileUrlState.error;
|
|
5748
5768
|
}
|
|
5749
5769
|
const state = useSyncExternalStore3(
|
|
@@ -5756,7 +5776,7 @@ function useFileUrlSuspense_withRoomContext(RoomContext, file) {
|
|
|
5756
5776
|
assert2(!state.error, "Unexpected error state");
|
|
5757
5777
|
return {
|
|
5758
5778
|
isLoading: false,
|
|
5759
|
-
url: state.data,
|
|
5779
|
+
url: state.data.url,
|
|
5760
5780
|
error: void 0
|
|
5761
5781
|
};
|
|
5762
5782
|
}
|
|
@@ -5903,6 +5923,9 @@ function createRoomContext(client) {
|
|
|
5903
5923
|
...args
|
|
5904
5924
|
);
|
|
5905
5925
|
}
|
|
5926
|
+
function useUploadFile_withBoundRoomContext() {
|
|
5927
|
+
return useUploadFile_withRoomContext(BoundRoomContext);
|
|
5928
|
+
}
|
|
5906
5929
|
function useThreads_withBoundRoomContext(...args) {
|
|
5907
5930
|
return useThreads_withRoomContext(BoundRoomContext, ...args);
|
|
5908
5931
|
}
|
|
@@ -6067,6 +6090,8 @@ function createRoomContext(client) {
|
|
|
6067
6090
|
// prettier-ignore
|
|
6068
6091
|
useMutation: useMutation_withBoundRoomContext,
|
|
6069
6092
|
// prettier-ignore
|
|
6093
|
+
useUploadFile: useUploadFile_withBoundRoomContext,
|
|
6094
|
+
// prettier-ignore
|
|
6070
6095
|
useSelf: useSelf_withBoundRoomContext,
|
|
6071
6096
|
// prettier-ignore
|
|
6072
6097
|
useMyPresence: useMyPresence_withBoundRoomContext,
|
|
@@ -6182,6 +6207,8 @@ function createRoomContext(client) {
|
|
|
6182
6207
|
// prettier-ignore
|
|
6183
6208
|
useMutation: useMutation_withBoundRoomContext,
|
|
6184
6209
|
// prettier-ignore
|
|
6210
|
+
useUploadFile: useUploadFile_withBoundRoomContext,
|
|
6211
|
+
// prettier-ignore
|
|
6185
6212
|
useSelf: useSelfSuspense_withBoundRoomContext,
|
|
6186
6213
|
// prettier-ignore
|
|
6187
6214
|
useMyPresence: useMyPresence_withBoundRoomContext,
|
|
@@ -6371,6 +6398,7 @@ export {
|
|
|
6371
6398
|
useCanUndo,
|
|
6372
6399
|
useCanRedo,
|
|
6373
6400
|
useOthersConnectionIds,
|
|
6401
|
+
useUploadFile,
|
|
6374
6402
|
useCreateFeed,
|
|
6375
6403
|
useDeleteFeed,
|
|
6376
6404
|
useUpdateFeedMetadata,
|
|
@@ -6454,4 +6482,4 @@ export {
|
|
|
6454
6482
|
_useStorageRoot,
|
|
6455
6483
|
_useUpdateMyPresence
|
|
6456
6484
|
};
|
|
6457
|
-
//# sourceMappingURL=chunk-
|
|
6485
|
+
//# sourceMappingURL=chunk-JMMTB4CU.js.map
|