@liveblocks/react 2.17.0-usrnotsettings1 → 2.17.0-usrnotsettings3
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.d.mts +1 -1
- package/dist/_private.d.ts +1 -1
- package/dist/_private.js +5 -5
- package/dist/_private.mjs +1 -1
- package/dist/{chunk-4F7C4HN7.js → chunk-HV3HU2RB.js} +61 -35
- package/dist/chunk-HV3HU2RB.js.map +1 -0
- package/dist/{chunk-KAFU5ZQA.mjs → chunk-L7XOVOE2.mjs} +2 -2
- package/dist/{chunk-LOPNJCSB.mjs → chunk-M2B54KRP.mjs} +52 -26
- package/dist/chunk-M2B54KRP.mjs.map +1 -0
- package/dist/{chunk-DT3BO7N5.js → chunk-N7SHYNWS.js} +2 -2
- package/dist/{chunk-DT3BO7N5.js.map → chunk-N7SHYNWS.js.map} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +2 -2
- package/dist/{room-DlI0Yrzf.d.mts → room-BDt2BfPN.d.mts} +5 -1
- package/dist/{room-DlI0Yrzf.d.ts → room-BDt2BfPN.d.ts} +5 -1
- package/dist/suspense.d.mts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +4 -4
- package/dist/suspense.mjs +2 -2
- package/package.json +3 -3
- package/dist/chunk-4F7C4HN7.js.map +0 -1
- package/dist/chunk-LOPNJCSB.mjs.map +0 -1
- /package/dist/{chunk-KAFU5ZQA.mjs.map → chunk-L7XOVOE2.mjs.map} +0 -0
package/dist/_private.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-
|
|
1
|
+
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-BDt2BfPN.mjs';
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from 'react';
|
|
3
3
|
import { ISignal, SyncSource } from '@liveblocks/core';
|
|
4
4
|
import '@liveblocks/client';
|
package/dist/_private.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-
|
|
1
|
+
export { g as getUmbrellaStoreForClient, b as useAddRoomCommentReaction, a as useClientOrNull, c as useCreateRoomComment, d as useCreateRoomThread, e as useCreateTextMention, f as useDeleteRoomComment, h as useDeleteRoomThread, i as useDeleteTextMention, j as useEditRoomComment, k as useEditRoomThreadMetadata, l as useMarkRoomThreadAsRead, m as useMarkRoomThreadAsResolved, n as useMarkRoomThreadAsUnresolved, o as useMentionSuggestionsCache, p as useRemoveRoomCommentReaction, q as useReportTextEditor, r as useResolveMentionSuggestions, s as useRoomAttachmentUrl, u as useRoomOrNull, t as useRoomPermissions, v as useYjsProvider } from './room-BDt2BfPN.js';
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from 'react';
|
|
3
3
|
import { ISignal, SyncSource } from '@liveblocks/core';
|
|
4
4
|
import '@liveblocks/client';
|
package/dist/_private.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkHV3HU2RBjs = require('./chunk-HV3HU2RB.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 =
|
|
41
|
-
const mentionSuggestionsCache =
|
|
40
|
+
const resolveMentionSuggestions = _chunkHV3HU2RBjs.useResolveMentionSuggestions.call(void 0, );
|
|
41
|
+
const mentionSuggestionsCache = _chunkHV3HU2RBjs.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 =
|
|
90
|
+
const client = _chunkHV3HU2RBjs.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 =
|
|
128
|
+
exports.getUmbrellaStoreForClient = _chunkHV3HU2RBjs.getUmbrellaStoreForClient; exports.useAddRoomCommentReaction = _chunkHV3HU2RBjs.useAddRoomCommentReaction; exports.useClientOrNull = _chunkHV3HU2RBjs.useClientOrNull; exports.useCreateRoomComment = _chunkHV3HU2RBjs.useCreateRoomComment; exports.useCreateRoomThread = _chunkHV3HU2RBjs.useCreateRoomThread; exports.useCreateTextMention = _chunkHV3HU2RBjs.useCreateTextMention; exports.useDeleteRoomComment = _chunkHV3HU2RBjs.useDeleteRoomComment; exports.useDeleteRoomThread = _chunkHV3HU2RBjs.useDeleteRoomThread; exports.useDeleteTextMention = _chunkHV3HU2RBjs.useDeleteTextMention; exports.useEditRoomComment = _chunkHV3HU2RBjs.useEditRoomComment; exports.useEditRoomThreadMetadata = _chunkHV3HU2RBjs.useEditRoomThreadMetadata; exports.useLayoutEffect = useLayoutEffect; exports.useMarkRoomThreadAsRead = _chunkHV3HU2RBjs.useMarkRoomThreadAsRead; exports.useMarkRoomThreadAsResolved = _chunkHV3HU2RBjs.useMarkRoomThreadAsResolved; exports.useMarkRoomThreadAsUnresolved = _chunkHV3HU2RBjs.useMarkRoomThreadAsUnresolved; exports.useMentionSuggestions = useMentionSuggestions; exports.useMentionSuggestionsCache = _chunkHV3HU2RBjs.useMentionSuggestionsCache; exports.useRemoveRoomCommentReaction = _chunkHV3HU2RBjs.useRemoveRoomCommentReaction; exports.useReportTextEditor = _chunkHV3HU2RBjs.useReportTextEditor; exports.useResolveMentionSuggestions = _chunkHV3HU2RBjs.useResolveMentionSuggestions; exports.useRoomAttachmentUrl = _chunkHV3HU2RBjs.useRoomAttachmentUrl; exports.useRoomOrNull = _chunkHV3HU2RBjs.useRoomOrNull; exports.useRoomPermissions = _chunkHV3HU2RBjs.useRoomPermissions; exports.useSignal = _chunkHV3HU2RBjs.useSignal; exports.useSyncExternalStoreWithSelector = _chunkHV3HU2RBjs.useSyncExternalStoreWithSelector; exports.useSyncSource = useSyncSource; exports.useYjsProvider = _chunkHV3HU2RBjs.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-
|
|
27
|
+
} from "./chunk-M2B54KRP.mjs";
|
|
28
28
|
|
|
29
29
|
// src/lib/use-layout-effect.ts
|
|
30
30
|
import { useEffect, useLayoutEffect as useOriginalLayoutEffect } from "react";
|
|
@@ -100,12 +100,15 @@ function useSignal(signal, selector, isEqual) {
|
|
|
100
100
|
// src/liveblocks.tsx
|
|
101
101
|
|
|
102
102
|
|
|
103
|
+
var _core = require('@liveblocks/core');
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
103
107
|
|
|
104
108
|
|
|
105
109
|
|
|
106
110
|
|
|
107
111
|
|
|
108
|
-
var _core = require('@liveblocks/core');
|
|
109
112
|
|
|
110
113
|
|
|
111
114
|
|
|
@@ -161,6 +164,15 @@ function count(it, predicate) {
|
|
|
161
164
|
return total;
|
|
162
165
|
}
|
|
163
166
|
|
|
167
|
+
// src/lib/ssr.ts
|
|
168
|
+
function ensureNotServerSide() {
|
|
169
|
+
if (typeof window === "undefined") {
|
|
170
|
+
throw new Error(
|
|
171
|
+
"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"
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
164
176
|
// src/lib/use-initial.ts
|
|
165
177
|
|
|
166
178
|
|
|
@@ -771,16 +783,16 @@ var UmbrellaStore = class {
|
|
|
771
783
|
//
|
|
772
784
|
// Mutate inputs... ...observe clean/consistent output!
|
|
773
785
|
//
|
|
774
|
-
// .-> Base ThreadDB ---------+ +----> Clean threads by ID
|
|
786
|
+
// .-> Base ThreadDB ---------+ +----> Clean threads by ID (Part 1)
|
|
775
787
|
// / | |
|
|
776
|
-
// mutate ----> Base Notifications --+ | | +--> Clean notifications
|
|
788
|
+
// mutate ----> Base Notifications --+ | | +--> Clean notifications (Part 1)
|
|
777
789
|
// \ | | | | & notifications by ID
|
|
778
790
|
// | \ | | Apply | |
|
|
779
|
-
// | `-> OptimisticUpdates --+--+--> Optimistic --+-+--> Notification Settings
|
|
791
|
+
// | `-> OptimisticUpdates --+--+--> Optimistic --+-+--> Room Notification Settings (Part 2)
|
|
780
792
|
// \ | Updates | |
|
|
781
|
-
// `------- etc etc ---------+ | +--> History Versions
|
|
793
|
+
// `------- etc etc ---------+ | +--> History Versions (Part 3)
|
|
782
794
|
// ^ |
|
|
783
|
-
// | +----->
|
|
795
|
+
// | +-----> User Notification Settings (Part 4)
|
|
784
796
|
// |
|
|
785
797
|
// |
|
|
786
798
|
// | ^ ^
|
|
@@ -840,7 +852,7 @@ var UmbrellaStore = class {
|
|
|
840
852
|
return nextCursor;
|
|
841
853
|
}
|
|
842
854
|
);
|
|
843
|
-
const
|
|
855
|
+
const userNotificationSettingsFetcher = async () => {
|
|
844
856
|
const result = await this.#client.getNotificationSettings();
|
|
845
857
|
this.userNotificationSettings.update(result);
|
|
846
858
|
};
|
|
@@ -848,7 +860,7 @@ var UmbrellaStore = class {
|
|
|
848
860
|
this.optimisticUpdates.signal
|
|
849
861
|
);
|
|
850
862
|
this.#userNotificationSettings = new SinglePageResource(
|
|
851
|
-
|
|
863
|
+
userNotificationSettingsFetcher
|
|
852
864
|
);
|
|
853
865
|
this.threads = new ThreadDB();
|
|
854
866
|
this.notifications = createStore_forNotifications();
|
|
@@ -1897,6 +1909,7 @@ function useInboxNotifications_withClient(client, selector, isEqual) {
|
|
|
1897
1909
|
);
|
|
1898
1910
|
}
|
|
1899
1911
|
function useInboxNotificationsSuspense_withClient(client) {
|
|
1912
|
+
ensureNotServerSide();
|
|
1900
1913
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
1901
1914
|
use(store.outputs.loadingNotifications.waitUntilLoaded());
|
|
1902
1915
|
const result = useInboxNotifications_withClient(client, identity2, _core.shallow);
|
|
@@ -1912,6 +1925,7 @@ function useUnreadInboxNotificationsCount_withClient(client) {
|
|
|
1912
1925
|
);
|
|
1913
1926
|
}
|
|
1914
1927
|
function useUnreadInboxNotificationsCountSuspense_withClient(client) {
|
|
1928
|
+
ensureNotServerSide();
|
|
1915
1929
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
1916
1930
|
use(store.outputs.loadingNotifications.waitUntilLoaded());
|
|
1917
1931
|
const result = useUnreadInboxNotificationsCount_withClient(client);
|
|
@@ -2061,8 +2075,22 @@ function useUpdateNotificationSettings_withClient(client) {
|
|
|
2061
2075
|
optimisticUpdateId
|
|
2062
2076
|
);
|
|
2063
2077
|
},
|
|
2064
|
-
() => {
|
|
2078
|
+
(err) => {
|
|
2065
2079
|
store.optimisticUpdates.remove(optimisticUpdateId);
|
|
2080
|
+
if (err instanceof _core.HttpError) {
|
|
2081
|
+
if (err.status === 422) {
|
|
2082
|
+
const msg = [_optionalChain([err, 'access', _13 => _13.details, 'optionalAccess', _14 => _14.error]), _optionalChain([err, 'access', _15 => _15.details, 'optionalAccess', _16 => _16.reason])].filter(Boolean).join("\n");
|
|
2083
|
+
console.error(msg);
|
|
2084
|
+
}
|
|
2085
|
+
client[_core.kInternal].emitError(
|
|
2086
|
+
{
|
|
2087
|
+
type: "UPDATE_USER_NOTIFICATION_SETTINGS_ERROR"
|
|
2088
|
+
},
|
|
2089
|
+
err
|
|
2090
|
+
);
|
|
2091
|
+
} else {
|
|
2092
|
+
throw err;
|
|
2093
|
+
}
|
|
2066
2094
|
}
|
|
2067
2095
|
);
|
|
2068
2096
|
},
|
|
@@ -2082,20 +2110,21 @@ function useNotificationSettings_withClient(client) {
|
|
|
2082
2110
|
poller.dec();
|
|
2083
2111
|
};
|
|
2084
2112
|
}, [poller]);
|
|
2085
|
-
const
|
|
2113
|
+
const result = useSignal(store.outputs.userNotificationSettings.signal);
|
|
2086
2114
|
return _react.useMemo.call(void 0, () => {
|
|
2087
|
-
return [
|
|
2088
|
-
}, [
|
|
2115
|
+
return [result, updateNotificationSettings];
|
|
2116
|
+
}, [result, updateNotificationSettings]);
|
|
2089
2117
|
}
|
|
2090
2118
|
function useNotificationSettingsSuspense_withClient(client) {
|
|
2119
|
+
ensureNotServerSide();
|
|
2091
2120
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
2092
2121
|
use(store.outputs.userNotificationSettings.waitUntilLoaded());
|
|
2093
|
-
const [
|
|
2094
|
-
_core.assert.call(void 0, !
|
|
2095
|
-
_core.assert.call(void 0, !
|
|
2122
|
+
const [result, updateNotificationSettings] = useNotificationSettings_withClient(client);
|
|
2123
|
+
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
2124
|
+
_core.assert.call(void 0, !result.isLoading, "Did not expect loading");
|
|
2096
2125
|
return _react.useMemo.call(void 0, () => {
|
|
2097
|
-
return [
|
|
2098
|
-
}, [
|
|
2126
|
+
return [result, updateNotificationSettings];
|
|
2127
|
+
}, [result, updateNotificationSettings]);
|
|
2099
2128
|
}
|
|
2100
2129
|
function useUser_withClient(client, userId) {
|
|
2101
2130
|
const usersStore = client[_core.kInternal].usersStore;
|
|
@@ -2246,7 +2275,7 @@ function createSharedContext(client) {
|
|
|
2246
2275
|
}
|
|
2247
2276
|
function useEnsureNoLiveblocksProvider(options) {
|
|
2248
2277
|
const existing = useClientOrNull();
|
|
2249
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2278
|
+
if (!_optionalChain([options, 'optionalAccess', _17 => _17.allowNesting]) && existing !== null) {
|
|
2250
2279
|
throw new Error(
|
|
2251
2280
|
"You cannot nest multiple LiveblocksProvider instances in the same React tree."
|
|
2252
2281
|
);
|
|
@@ -2321,6 +2350,7 @@ function useUserThreads_experimental(options = {}) {
|
|
|
2321
2350
|
);
|
|
2322
2351
|
}
|
|
2323
2352
|
function useUserThreadsSuspense_experimental(options = {}) {
|
|
2353
|
+
ensureNotServerSide();
|
|
2324
2354
|
const client = useClient();
|
|
2325
2355
|
const { store } = getLiveblocksExtrasForClient(client);
|
|
2326
2356
|
const queryKey = makeUserThreadsQueryKey(options.query);
|
|
@@ -2389,7 +2419,7 @@ var _useUserSuspense = useUserSuspense;
|
|
|
2389
2419
|
var _useUserThreads_experimental = useUserThreads_experimental;
|
|
2390
2420
|
var _useUserThreadsSuspense_experimental = useUserThreadsSuspense_experimental;
|
|
2391
2421
|
function useSyncStatus_withClient(client, options) {
|
|
2392
|
-
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2422
|
+
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _18 => _18.smooth]), () => ( false)));
|
|
2393
2423
|
if (smooth) {
|
|
2394
2424
|
return useSyncStatusSmooth_withClient(client);
|
|
2395
2425
|
} else {
|
|
@@ -2567,8 +2597,8 @@ function makeRoomExtrasForClient(client) {
|
|
|
2567
2597
|
if (innerError.status === 403) {
|
|
2568
2598
|
const detailedMessage = [
|
|
2569
2599
|
innerError.message,
|
|
2570
|
-
_optionalChain([innerError, 'access',
|
|
2571
|
-
_optionalChain([innerError, 'access',
|
|
2600
|
+
_optionalChain([innerError, 'access', _19 => _19.details, 'optionalAccess', _20 => _20.suggestion]),
|
|
2601
|
+
_optionalChain([innerError, 'access', _21 => _21.details, 'optionalAccess', _22 => _22.docs])
|
|
2572
2602
|
].filter(Boolean).join("\n");
|
|
2573
2603
|
_core.console.error(detailedMessage);
|
|
2574
2604
|
}
|
|
@@ -2922,7 +2952,7 @@ function useMentionSuggestionsCache() {
|
|
|
2922
2952
|
return client[_core.kInternal].mentionSuggestionsCache;
|
|
2923
2953
|
}
|
|
2924
2954
|
function useStorageStatus(options) {
|
|
2925
|
-
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2955
|
+
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _23 => _23.smooth]), () => ( false)));
|
|
2926
2956
|
if (smooth) {
|
|
2927
2957
|
return useStorageStatusSmooth();
|
|
2928
2958
|
} else {
|
|
@@ -3236,7 +3266,7 @@ function useCreateRoomThread(roomId) {
|
|
|
3236
3266
|
thread: newThread,
|
|
3237
3267
|
roomId
|
|
3238
3268
|
});
|
|
3239
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
3269
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _24 => _24.map, 'call', _25 => _25((attachment) => attachment.id)]);
|
|
3240
3270
|
client[_core.kInternal].httpClient.createThread({
|
|
3241
3271
|
roomId,
|
|
3242
3272
|
threadId,
|
|
@@ -3276,7 +3306,7 @@ function useDeleteRoomThread(roomId) {
|
|
|
3276
3306
|
const { store, onMutationFailure } = getRoomExtrasForClient(client);
|
|
3277
3307
|
const userId = getCurrentUserId(client);
|
|
3278
3308
|
const existing = store.outputs.threads.get().get(threadId);
|
|
3279
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
3309
|
+
if (_optionalChain([existing, 'optionalAccess', _26 => _26.comments, 'optionalAccess', _27 => _27[0], 'optionalAccess', _28 => _28.userId]) !== userId) {
|
|
3280
3310
|
throw new Error("Only the thread creator can delete the thread");
|
|
3281
3311
|
}
|
|
3282
3312
|
const optimisticId = store.optimisticUpdates.add({
|
|
@@ -3364,7 +3394,7 @@ function useCreateRoomComment(roomId) {
|
|
|
3364
3394
|
type: "create-comment",
|
|
3365
3395
|
comment
|
|
3366
3396
|
});
|
|
3367
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
3397
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _29 => _29.map, 'call', _30 => _30((attachment) => attachment.id)]);
|
|
3368
3398
|
client[_core.kInternal].httpClient.createComment({ roomId, threadId, commentId, body, attachmentIds }).then(
|
|
3369
3399
|
(newComment) => {
|
|
3370
3400
|
store.createComment(newComment, optimisticId);
|
|
@@ -3420,7 +3450,7 @@ function useEditRoomComment(roomId) {
|
|
|
3420
3450
|
attachments: _nullishCoalesce(attachments, () => ( []))
|
|
3421
3451
|
}
|
|
3422
3452
|
});
|
|
3423
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
3453
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _31 => _31.map, 'call', _32 => _32((attachment) => attachment.id)]);
|
|
3424
3454
|
client[_core.kInternal].httpClient.editComment({ roomId, threadId, commentId, body, attachmentIds }).then(
|
|
3425
3455
|
(editedComment) => {
|
|
3426
3456
|
store.editComment(threadId, optimisticId, editedComment);
|
|
@@ -3724,6 +3754,7 @@ function useRoomNotificationSettings() {
|
|
|
3724
3754
|
}, [settings, updateRoomNotificationSettings]);
|
|
3725
3755
|
}
|
|
3726
3756
|
function useRoomNotificationSettingsSuspense() {
|
|
3757
|
+
ensureNotServerSide();
|
|
3727
3758
|
const client = useClient();
|
|
3728
3759
|
const store = getRoomExtrasForClient(client).store;
|
|
3729
3760
|
const room = useRoom();
|
|
@@ -3788,6 +3819,7 @@ function useHistoryVersions() {
|
|
|
3788
3819
|
return useSignal(store.outputs.versionsByRoomId.getOrCreate(room.id).signal);
|
|
3789
3820
|
}
|
|
3790
3821
|
function useHistoryVersionsSuspense() {
|
|
3822
|
+
ensureNotServerSide();
|
|
3791
3823
|
const client = useClient();
|
|
3792
3824
|
const room = useRoom();
|
|
3793
3825
|
const store = getRoomExtrasForClient(client).store;
|
|
@@ -3822,13 +3854,6 @@ function useUpdateRoomNotificationSettings() {
|
|
|
3822
3854
|
[client, room]
|
|
3823
3855
|
);
|
|
3824
3856
|
}
|
|
3825
|
-
function ensureNotServerSide() {
|
|
3826
|
-
if (typeof window === "undefined") {
|
|
3827
|
-
throw new Error(
|
|
3828
|
-
"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"
|
|
3829
|
-
);
|
|
3830
|
-
}
|
|
3831
|
-
}
|
|
3832
3857
|
function useSuspendUntilPresenceReady() {
|
|
3833
3858
|
ensureNotServerSide();
|
|
3834
3859
|
const room = useRoom();
|
|
@@ -3877,6 +3902,7 @@ function useStorageStatusSuspense(options) {
|
|
|
3877
3902
|
return useStorageStatus(options);
|
|
3878
3903
|
}
|
|
3879
3904
|
function useThreadsSuspense(options = {}) {
|
|
3905
|
+
ensureNotServerSide();
|
|
3880
3906
|
const client = useClient();
|
|
3881
3907
|
const room = useRoom();
|
|
3882
3908
|
const { store } = getRoomExtrasForClient(client);
|
|
@@ -3888,7 +3914,7 @@ function useThreadsSuspense(options = {}) {
|
|
|
3888
3914
|
return result;
|
|
3889
3915
|
}
|
|
3890
3916
|
function selectorFor_useAttachmentUrl(state) {
|
|
3891
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
3917
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _33 => _33.isLoading])) {
|
|
3892
3918
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
3893
3919
|
}
|
|
3894
3920
|
if (state.error) {
|
|
@@ -4107,4 +4133,4 @@ var _useUpdateMyPresence = useUpdateMyPresence;
|
|
|
4107
4133
|
|
|
4108
4134
|
|
|
4109
4135
|
exports.RoomContext = RoomContext; exports.useRoomOrNull = useRoomOrNull; exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; exports.useSignal = useSignal; exports.ClientContext = ClientContext; exports.getUmbrellaStoreForClient = getUmbrellaStoreForClient; exports.useClientOrNull = useClientOrNull; exports.useClient = useClient; 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.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.useStorageStatus = useStorageStatus; exports.useBatch = useBatch; 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.useThreadSubscription = useThreadSubscription; exports.useHistoryVersionData = useHistoryVersionData; exports.useUpdateRoomNotificationSettings = useUpdateRoomNotificationSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useStorageStatusSuspense = useStorageStatusSuspense; 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._useRoomNotificationSettings = _useRoomNotificationSettings; exports._useRoomNotificationSettingsSuspense = _useRoomNotificationSettingsSuspense; 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;
|
|
4110
|
-
//# sourceMappingURL=chunk-
|
|
4136
|
+
//# sourceMappingURL=chunk-HV3HU2RB.js.map
|