@liveblocks/react 3.21.0-private1 → 3.21.0-private2
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.js +1 -1
- package/dist/{chunk-ARD7SX6Z.js → chunk-4W555EA4.js} +63 -16
- package/dist/chunk-4W555EA4.js.map +1 -0
- package/dist/{chunk-2KKRVZI5.cjs → chunk-K73KKSIG.cjs} +76 -29
- package/dist/chunk-K73KKSIG.cjs.map +1 -0
- package/dist/{chunk-4KEFQLUK.cjs → chunk-OJVNHN7I.cjs} +2 -2
- package/dist/{chunk-4KEFQLUK.cjs.map → chunk-OJVNHN7I.cjs.map} +1 -1
- package/dist/{chunk-YCI7AKBP.js → chunk-XJISWPDJ.js} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/dist/suspense.cjs +4 -4
- package/dist/suspense.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-2KKRVZI5.cjs.map +0 -1
- package/dist/chunk-ARD7SX6Z.js.map +0 -1
- /package/dist/{chunk-YCI7AKBP.js.map → chunk-XJISWPDJ.js.map} +0 -0
package/dist/_private.cjs
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkK73KKSIGcjs = require('./chunk-K73KKSIG.cjs');
|
|
33
33
|
|
|
34
34
|
// src/lib/use-layout-effect.ts
|
|
35
35
|
var _react = require('react');
|
|
@@ -54,7 +54,7 @@ function selectorFor_useGroup(state) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function useGroup(groupId) {
|
|
57
|
-
const client =
|
|
57
|
+
const client = _chunkK73KKSIGcjs.useClient.call(void 0, );
|
|
58
58
|
const store = client[_core.kInternal].httpClient.groupsStore;
|
|
59
59
|
const getGroupState = _react.useCallback.call(void 0,
|
|
60
60
|
() => store.getItemState(groupId),
|
|
@@ -63,7 +63,7 @@ function useGroup(groupId) {
|
|
|
63
63
|
_react.useEffect.call(void 0, () => {
|
|
64
64
|
void store.enqueue(groupId);
|
|
65
65
|
}, [store, groupId]);
|
|
66
|
-
return
|
|
66
|
+
return _chunkK73KKSIGcjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
67
67
|
store.subscribe,
|
|
68
68
|
getGroupState,
|
|
69
69
|
getGroupState,
|
|
@@ -84,8 +84,8 @@ function normalizeMentionSuggestions(suggestions) {
|
|
|
84
84
|
function useMentionSuggestions(roomId, search) {
|
|
85
85
|
const [mentionSuggestions, setMentionSuggestions] = _react.useState.call(void 0, );
|
|
86
86
|
const lastInvokedAt = _react.useRef.call(void 0, );
|
|
87
|
-
const resolveMentionSuggestions =
|
|
88
|
-
const mentionSuggestionsCache =
|
|
87
|
+
const resolveMentionSuggestions = _chunkK73KKSIGcjs.useResolveMentionSuggestions.call(void 0, );
|
|
88
|
+
const mentionSuggestionsCache = _chunkK73KKSIGcjs.useMentionSuggestionsCache.call(void 0, );
|
|
89
89
|
_react.useEffect.call(void 0, () => {
|
|
90
90
|
if (search === void 0 || !resolveMentionSuggestions) {
|
|
91
91
|
return;
|
|
@@ -140,7 +140,7 @@ function useMentionSuggestions(roomId, search) {
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
function useSyncSource() {
|
|
143
|
-
const client =
|
|
143
|
+
const client = _chunkK73KKSIGcjs.useClient.call(void 0, );
|
|
144
144
|
const createSyncSource = client[_core.kInternal].createSyncSource;
|
|
145
145
|
const [syncSource, setSyncSource] = _react.useState.call(void 0, );
|
|
146
146
|
_react.useEffect.call(void 0, () => {
|
|
@@ -184,5 +184,5 @@ function useSyncSource() {
|
|
|
184
184
|
|
|
185
185
|
|
|
186
186
|
|
|
187
|
-
exports.getUmbrellaStoreForClient =
|
|
187
|
+
exports.getUmbrellaStoreForClient = _chunkK73KKSIGcjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkK73KKSIGcjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkK73KKSIGcjs.useClientOrNull; exports.useCreateRoomComment = _chunkK73KKSIGcjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkK73KKSIGcjs.useCreateRoomThread; exports.useCreateTextMention = _chunkK73KKSIGcjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkK73KKSIGcjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkK73KKSIGcjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkK73KKSIGcjs.useDeleteTextMention; exports.useEditRoomComment = _chunkK73KKSIGcjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkK73KKSIGcjs.useEditRoomThreadMetadata; exports.useGroup = useGroup; exports.useHasPermissionAccess = _chunkK73KKSIGcjs.useHasPermissionAccess; exports.useInitial = _chunkK73KKSIGcjs.useInitial; exports.useLatest = _chunkK73KKSIGcjs.useLatest; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkK73KKSIGcjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkK73KKSIGcjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkK73KKSIGcjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkK73KKSIGcjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkK73KKSIGcjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkK73KKSIGcjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkK73KKSIGcjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkK73KKSIGcjs.useRoomAttachmentUrl; exports.useRoomPermissions = _chunkK73KKSIGcjs.useRoomPermissions; exports.useRoomThreadSubscription = _chunkK73KKSIGcjs.useRoomThreadSubscription; exports.useSignal = _chunkK73KKSIGcjs.useSignal; exports.useSuspendUntilPresenceReady = _chunkK73KKSIGcjs.useSuspendUntilPresenceReady; exports.useSuspendUntilStorageReady = _chunkK73KKSIGcjs.useSuspendUntilStorageReady; exports.useSyncExternalStoreWithSelector = _chunkK73KKSIGcjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkK73KKSIGcjs.useYjsProvider;
|
|
188
188
|
//# sourceMappingURL=_private.cjs.map
|
package/dist/_private.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
useSuspendUntilStorageReady,
|
|
30
30
|
useSyncExternalStoreWithSelector,
|
|
31
31
|
useYjsProvider
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4W555EA4.js";
|
|
33
33
|
|
|
34
34
|
// src/lib/use-layout-effect.ts
|
|
35
35
|
import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
|
|
@@ -3678,6 +3678,9 @@ function getRoomExtrasForClient(client) {
|
|
|
3678
3678
|
}
|
|
3679
3679
|
return extras;
|
|
3680
3680
|
}
|
|
3681
|
+
function getThreadVisibility(store, threadId) {
|
|
3682
|
+
return store.outputs.threads.get().getEvenIfDeleted(threadId)?.visibility;
|
|
3683
|
+
}
|
|
3681
3684
|
function makeRoomExtrasForClient(client) {
|
|
3682
3685
|
const store = getUmbrellaStoreForClient(client);
|
|
3683
3686
|
function onMutationFailure(optimisticId, context, innerError) {
|
|
@@ -4617,7 +4620,11 @@ function useDeleteRoomThread(roomId) {
|
|
|
4617
4620
|
threadId,
|
|
4618
4621
|
deletedAt: /* @__PURE__ */ new Date()
|
|
4619
4622
|
});
|
|
4620
|
-
client[kInternal4].httpClient.deleteThread({
|
|
4623
|
+
client[kInternal4].httpClient.deleteThread({
|
|
4624
|
+
roomId,
|
|
4625
|
+
threadId,
|
|
4626
|
+
visibility: existing.visibility
|
|
4627
|
+
}).then(
|
|
4621
4628
|
() => {
|
|
4622
4629
|
store.deleteThread(threadId, optimisticId);
|
|
4623
4630
|
},
|
|
@@ -4654,7 +4661,12 @@ function useEditRoomThreadMetadata(roomId) {
|
|
|
4654
4661
|
threadId,
|
|
4655
4662
|
updatedAt
|
|
4656
4663
|
});
|
|
4657
|
-
client[kInternal4].httpClient.editThreadMetadata({
|
|
4664
|
+
client[kInternal4].httpClient.editThreadMetadata({
|
|
4665
|
+
roomId,
|
|
4666
|
+
threadId,
|
|
4667
|
+
metadata,
|
|
4668
|
+
visibility: getThreadVisibility(store, threadId)
|
|
4669
|
+
}).then(
|
|
4658
4670
|
(metadata2) => (
|
|
4659
4671
|
// Replace the optimistic update by the real thing
|
|
4660
4672
|
store.patchThread(threadId, optimisticId, { metadata: metadata2 }, updatedAt)
|
|
@@ -4701,7 +4713,13 @@ function useEditRoomCommentMetadata(roomId) {
|
|
|
4701
4713
|
metadata,
|
|
4702
4714
|
updatedAt
|
|
4703
4715
|
});
|
|
4704
|
-
client[kInternal4].httpClient.editCommentMetadata({
|
|
4716
|
+
client[kInternal4].httpClient.editCommentMetadata({
|
|
4717
|
+
roomId,
|
|
4718
|
+
threadId,
|
|
4719
|
+
commentId,
|
|
4720
|
+
metadata,
|
|
4721
|
+
visibility: getThreadVisibility(store, threadId)
|
|
4722
|
+
}).then(
|
|
4705
4723
|
(updatedMetadata) => (
|
|
4706
4724
|
// Replace the optimistic update by the real thing
|
|
4707
4725
|
store.editCommentMetadata(
|
|
@@ -4767,7 +4785,8 @@ function useCreateRoomComment(roomId) {
|
|
|
4767
4785
|
commentId,
|
|
4768
4786
|
body,
|
|
4769
4787
|
metadata,
|
|
4770
|
-
attachmentIds
|
|
4788
|
+
attachmentIds,
|
|
4789
|
+
visibility: getThreadVisibility(store, threadId)
|
|
4771
4790
|
}).then(
|
|
4772
4791
|
(newComment) => {
|
|
4773
4792
|
store.createComment(newComment, optimisticId);
|
|
@@ -4845,7 +4864,8 @@ function useEditRoomComment(roomId) {
|
|
|
4845
4864
|
commentId,
|
|
4846
4865
|
body,
|
|
4847
4866
|
attachmentIds,
|
|
4848
|
-
metadata
|
|
4867
|
+
metadata,
|
|
4868
|
+
visibility: existing.visibility
|
|
4849
4869
|
}).then(
|
|
4850
4870
|
(editedComment) => {
|
|
4851
4871
|
store.editComment(threadId, optimisticId, editedComment);
|
|
@@ -4886,7 +4906,12 @@ function useDeleteRoomComment(roomId) {
|
|
|
4886
4906
|
deletedAt,
|
|
4887
4907
|
roomId
|
|
4888
4908
|
});
|
|
4889
|
-
client[kInternal4].httpClient.deleteComment({
|
|
4909
|
+
client[kInternal4].httpClient.deleteComment({
|
|
4910
|
+
roomId,
|
|
4911
|
+
threadId,
|
|
4912
|
+
commentId,
|
|
4913
|
+
visibility: getThreadVisibility(store, threadId)
|
|
4914
|
+
}).then(
|
|
4890
4915
|
() => {
|
|
4891
4916
|
store.deleteComment(threadId, optimisticId, commentId, deletedAt);
|
|
4892
4917
|
},
|
|
@@ -4923,7 +4948,13 @@ function useAddRoomCommentReaction(roomId) {
|
|
|
4923
4948
|
createdAt
|
|
4924
4949
|
}
|
|
4925
4950
|
});
|
|
4926
|
-
client[kInternal4].httpClient.addReaction({
|
|
4951
|
+
client[kInternal4].httpClient.addReaction({
|
|
4952
|
+
roomId,
|
|
4953
|
+
threadId,
|
|
4954
|
+
commentId,
|
|
4955
|
+
emoji,
|
|
4956
|
+
visibility: getThreadVisibility(store, threadId)
|
|
4957
|
+
}).then(
|
|
4927
4958
|
(addedReaction) => {
|
|
4928
4959
|
store.addReaction(
|
|
4929
4960
|
threadId,
|
|
@@ -4970,7 +5001,13 @@ function useRemoveRoomCommentReaction(roomId) {
|
|
|
4970
5001
|
userId,
|
|
4971
5002
|
removedAt
|
|
4972
5003
|
});
|
|
4973
|
-
client[kInternal4].httpClient.removeReaction({
|
|
5004
|
+
client[kInternal4].httpClient.removeReaction({
|
|
5005
|
+
roomId,
|
|
5006
|
+
threadId,
|
|
5007
|
+
commentId,
|
|
5008
|
+
emoji,
|
|
5009
|
+
visibility: getThreadVisibility(store, threadId)
|
|
5010
|
+
}).then(
|
|
4974
5011
|
() => {
|
|
4975
5012
|
store.removeReaction(
|
|
4976
5013
|
threadId,
|
|
@@ -5066,7 +5103,11 @@ function useMarkRoomThreadAsResolved(roomId) {
|
|
|
5066
5103
|
threadId,
|
|
5067
5104
|
updatedAt
|
|
5068
5105
|
});
|
|
5069
|
-
client[kInternal4].httpClient.markThreadAsResolved({
|
|
5106
|
+
client[kInternal4].httpClient.markThreadAsResolved({
|
|
5107
|
+
roomId,
|
|
5108
|
+
threadId,
|
|
5109
|
+
visibility: getThreadVisibility(store, threadId)
|
|
5110
|
+
}).then(
|
|
5070
5111
|
() => {
|
|
5071
5112
|
store.patchThread(
|
|
5072
5113
|
threadId,
|
|
@@ -5102,7 +5143,11 @@ function useMarkRoomThreadAsUnresolved(roomId) {
|
|
|
5102
5143
|
threadId,
|
|
5103
5144
|
updatedAt
|
|
5104
5145
|
});
|
|
5105
|
-
client[kInternal4].httpClient.markThreadAsUnresolved({
|
|
5146
|
+
client[kInternal4].httpClient.markThreadAsUnresolved({
|
|
5147
|
+
roomId,
|
|
5148
|
+
threadId,
|
|
5149
|
+
visibility: getThreadVisibility(store, threadId)
|
|
5150
|
+
}).then(
|
|
5106
5151
|
() => {
|
|
5107
5152
|
store.patchThread(
|
|
5108
5153
|
threadId,
|
|
@@ -5609,13 +5654,15 @@ function useSelfAccessFallback(roomId, resource, requiredAccess) {
|
|
|
5609
5654
|
[room, roomId]
|
|
5610
5655
|
);
|
|
5611
5656
|
const getSnapshot = useCallback3(() => {
|
|
5612
|
-
const self = room?.id === roomId ? room.getSelf() : null;
|
|
5613
5657
|
const isCommentsResource = resource === "comments" || resource === "comments:public" || resource === "comments:private";
|
|
5614
|
-
if (
|
|
5615
|
-
|
|
5658
|
+
if (room?.id === roomId) {
|
|
5659
|
+
const permissionMatrix = room[kInternal4].getPermissionMatrix();
|
|
5660
|
+
if (permissionMatrix !== void 0) {
|
|
5661
|
+
return hasPermissionAccess(permissionMatrix, resource, requiredAccess);
|
|
5662
|
+
}
|
|
5616
5663
|
}
|
|
5617
|
-
if (
|
|
5618
|
-
return
|
|
5664
|
+
if (requiredAccess === "write" && (isCommentsResource || resource === "storage")) {
|
|
5665
|
+
return true;
|
|
5619
5666
|
}
|
|
5620
5667
|
return false;
|
|
5621
5668
|
}, [resource, requiredAccess, room, roomId]);
|
|
@@ -6234,4 +6281,4 @@ export {
|
|
|
6234
6281
|
_useStorageRoot,
|
|
6235
6282
|
_useUpdateMyPresence
|
|
6236
6283
|
};
|
|
6237
|
-
//# sourceMappingURL=chunk-
|
|
6284
|
+
//# sourceMappingURL=chunk-4W555EA4.js.map
|