@liveblocks/react 2.8.0-beta2 → 2.8.0-beta4
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/{chunk-OBLKSEC3.mjs → chunk-G35ZEFD6.mjs} +366 -281
- package/dist/chunk-G35ZEFD6.mjs.map +1 -0
- package/dist/{chunk-7GMBACXS.js → chunk-G4SKKVCK.js} +381 -296
- package/dist/chunk-G4SKKVCK.js.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{suspense-FX3HjuPs.d.mts → suspense-DJOhRXB2.d.mts} +70 -143
- package/dist/{suspense-FX3HjuPs.d.ts → suspense-DJOhRXB2.d.ts} +70 -143
- package/dist/suspense.d.mts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +3 -3
- package/dist/suspense.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-7GMBACXS.js.map +0 -1
- package/dist/chunk-OBLKSEC3.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/version.ts
|
|
2
2
|
var PKG_NAME = "@liveblocks/react";
|
|
3
|
-
var PKG_VERSION = "2.8.0-
|
|
3
|
+
var PKG_VERSION = "2.8.0-beta4";
|
|
4
4
|
var PKG_FORMAT = "cjs";
|
|
5
5
|
|
|
6
6
|
// src/ClientSideSuspense.tsx
|
|
@@ -182,30 +182,35 @@ var use = (
|
|
|
182
182
|
|
|
183
183
|
|
|
184
184
|
|
|
185
|
-
var
|
|
186
|
-
var
|
|
187
|
-
var INBOX_NOTIFICATIONS_QUERY = "INBOX_NOTIFICATIONS";
|
|
185
|
+
var ASYNC_LOADING = Object.freeze({ isLoading: true });
|
|
186
|
+
var ASYNC_OK = Object.freeze({ isLoading: false, data: void 0 });
|
|
188
187
|
function makeNotificationSettingsQueryKey(roomId) {
|
|
189
188
|
return `${roomId}:NOTIFICATION_SETTINGS`;
|
|
190
189
|
}
|
|
190
|
+
function makeVersionsQueryKey(roomId) {
|
|
191
|
+
return `${roomId}-VERSIONS`;
|
|
192
|
+
}
|
|
191
193
|
var UmbrellaStore = class {
|
|
192
194
|
constructor() {
|
|
193
195
|
this._prevState = null;
|
|
194
196
|
this._stateCached = null;
|
|
195
197
|
this._store = _core.createStore.call(void 0, {
|
|
196
198
|
rawThreadsById: {},
|
|
197
|
-
queries: {},
|
|
199
|
+
// queries: {},
|
|
200
|
+
query1: void 0,
|
|
201
|
+
queries2: {},
|
|
202
|
+
queries3: {},
|
|
203
|
+
queries4: {},
|
|
198
204
|
optimisticUpdates: [],
|
|
199
205
|
inboxNotificationsById: {},
|
|
200
206
|
notificationSettingsByRoomId: {},
|
|
201
207
|
versionsByRoomId: {}
|
|
202
208
|
});
|
|
203
|
-
this.
|
|
204
|
-
this.getInboxNotifications = this.getInboxNotifications.bind(this);
|
|
209
|
+
this.getFullState = this.getFullState.bind(this);
|
|
205
210
|
this.getInboxNotificationsAsync = this.getInboxNotificationsAsync.bind(this);
|
|
206
|
-
this.getVersions = this.getVersions.bind(this);
|
|
207
211
|
this.subscribeThreads = this.subscribeThreads.bind(this);
|
|
208
|
-
this.
|
|
212
|
+
this.subscribeUserThreads = this.subscribeUserThreads.bind(this);
|
|
213
|
+
this.subscribeThreadsOrInboxNotifications = this.subscribeThreadsOrInboxNotifications.bind(this);
|
|
209
214
|
this.subscribeNotificationSettings = this.subscribeNotificationSettings.bind(this);
|
|
210
215
|
this.subscribeVersions = this.subscribeVersions.bind(this);
|
|
211
216
|
this._hasOptimisticUpdates = this._hasOptimisticUpdates.bind(this);
|
|
@@ -219,31 +224,59 @@ var UmbrellaStore = class {
|
|
|
219
224
|
}
|
|
220
225
|
return this._stateCached;
|
|
221
226
|
}
|
|
222
|
-
|
|
223
|
-
return this.
|
|
227
|
+
batch(callback) {
|
|
228
|
+
return this._store.batch(callback);
|
|
224
229
|
}
|
|
225
|
-
|
|
230
|
+
getFullState() {
|
|
226
231
|
return this.get();
|
|
227
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Returns the async result of the given queryKey. If the query is success,
|
|
235
|
+
* then it will return the entire store's state in the payload.
|
|
236
|
+
*/
|
|
237
|
+
// TODO: This return type is a bit weird! Feels like we haven't found the
|
|
238
|
+
// right abstraction here yet.
|
|
239
|
+
getThreadsAsync(queryKey) {
|
|
240
|
+
const internalState = this._store.get();
|
|
241
|
+
const query = internalState.queries2[queryKey];
|
|
242
|
+
if (query === void 0 || query.isLoading) {
|
|
243
|
+
return ASYNC_LOADING;
|
|
244
|
+
}
|
|
245
|
+
if (query.error) {
|
|
246
|
+
return query;
|
|
247
|
+
}
|
|
248
|
+
return { isLoading: false, fullState: this.getFullState() };
|
|
249
|
+
}
|
|
250
|
+
getUserThreadsAsync(queryKey) {
|
|
251
|
+
const internalState = this._store.get();
|
|
252
|
+
const query = internalState.queries2[queryKey];
|
|
253
|
+
if (query === void 0 || query.isLoading) {
|
|
254
|
+
return ASYNC_LOADING;
|
|
255
|
+
}
|
|
256
|
+
if (query.error) {
|
|
257
|
+
return query;
|
|
258
|
+
}
|
|
259
|
+
return { isLoading: false, fullState: this.getFullState() };
|
|
260
|
+
}
|
|
228
261
|
// NOTE: This will read the async result, but WILL NOT start loading at the moment!
|
|
229
262
|
getInboxNotificationsAsync() {
|
|
230
263
|
const internalState = this._store.get();
|
|
231
|
-
const query = internalState.
|
|
264
|
+
const query = internalState.query1;
|
|
232
265
|
if (query === void 0 || query.isLoading) {
|
|
233
|
-
return
|
|
266
|
+
return ASYNC_LOADING;
|
|
234
267
|
}
|
|
235
268
|
if (query.error !== void 0) {
|
|
236
269
|
return query;
|
|
237
270
|
}
|
|
238
|
-
const inboxNotifications = this.
|
|
271
|
+
const inboxNotifications = this.getFullState().inboxNotifications;
|
|
239
272
|
return { isLoading: false, inboxNotifications };
|
|
240
273
|
}
|
|
241
274
|
// NOTE: This will read the async result, but WILL NOT start loading at the moment!
|
|
242
275
|
getNotificationSettingsAsync(roomId) {
|
|
243
276
|
const state = this.get();
|
|
244
|
-
const query = state.
|
|
277
|
+
const query = state.queries3[makeNotificationSettingsQueryKey(roomId)];
|
|
245
278
|
if (query === void 0 || query.isLoading) {
|
|
246
|
-
return
|
|
279
|
+
return ASYNC_LOADING;
|
|
247
280
|
}
|
|
248
281
|
if (query.error !== void 0) {
|
|
249
282
|
return query;
|
|
@@ -253,8 +286,19 @@ var UmbrellaStore = class {
|
|
|
253
286
|
settings: _core.nn.call(void 0, state.notificationSettingsByRoomId[roomId])
|
|
254
287
|
};
|
|
255
288
|
}
|
|
256
|
-
|
|
257
|
-
|
|
289
|
+
getVersionsAsync(roomId) {
|
|
290
|
+
const state = this.get();
|
|
291
|
+
const query = state.queries4[makeVersionsQueryKey(roomId)];
|
|
292
|
+
if (query === void 0 || query.isLoading) {
|
|
293
|
+
return ASYNC_LOADING;
|
|
294
|
+
}
|
|
295
|
+
if (query.error !== void 0) {
|
|
296
|
+
return query;
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
isLoading: false,
|
|
300
|
+
versions: _core.nn.call(void 0, state.versionsByRoomId[roomId])
|
|
301
|
+
};
|
|
258
302
|
}
|
|
259
303
|
/**
|
|
260
304
|
* @private Only used by the E2E test suite.
|
|
@@ -274,7 +318,10 @@ var UmbrellaStore = class {
|
|
|
274
318
|
subscribeThreads(callback) {
|
|
275
319
|
return this.subscribe(callback);
|
|
276
320
|
}
|
|
277
|
-
|
|
321
|
+
subscribeUserThreads(callback) {
|
|
322
|
+
return this.subscribe(callback);
|
|
323
|
+
}
|
|
324
|
+
subscribeThreadsOrInboxNotifications(callback) {
|
|
278
325
|
return this.subscribe(callback);
|
|
279
326
|
}
|
|
280
327
|
subscribeNotificationSettings(callback) {
|
|
@@ -314,11 +361,35 @@ var UmbrellaStore = class {
|
|
|
314
361
|
}
|
|
315
362
|
}));
|
|
316
363
|
}
|
|
317
|
-
|
|
364
|
+
setQuery1State(queryState) {
|
|
365
|
+
this._store.set((state) => ({
|
|
366
|
+
...state,
|
|
367
|
+
query1: queryState
|
|
368
|
+
}));
|
|
369
|
+
}
|
|
370
|
+
setQuery2State(queryKey, queryState) {
|
|
371
|
+
this._store.set((state) => ({
|
|
372
|
+
...state,
|
|
373
|
+
queries2: {
|
|
374
|
+
...state.queries2,
|
|
375
|
+
[queryKey]: queryState
|
|
376
|
+
}
|
|
377
|
+
}));
|
|
378
|
+
}
|
|
379
|
+
setQuery3State(queryKey, queryState) {
|
|
380
|
+
this._store.set((state) => ({
|
|
381
|
+
...state,
|
|
382
|
+
queries3: {
|
|
383
|
+
...state.queries3,
|
|
384
|
+
[queryKey]: queryState
|
|
385
|
+
}
|
|
386
|
+
}));
|
|
387
|
+
}
|
|
388
|
+
setQuery4State(queryKey, queryState) {
|
|
318
389
|
this._store.set((state) => ({
|
|
319
390
|
...state,
|
|
320
|
-
|
|
321
|
-
...state.
|
|
391
|
+
queries4: {
|
|
392
|
+
...state.queries4,
|
|
322
393
|
[queryKey]: queryState
|
|
323
394
|
}
|
|
324
395
|
}));
|
|
@@ -531,7 +602,7 @@ var UmbrellaStore = class {
|
|
|
531
602
|
}
|
|
532
603
|
});
|
|
533
604
|
}
|
|
534
|
-
updateThreadsAndNotifications(threads, inboxNotifications, deletedThreads, deletedInboxNotifications
|
|
605
|
+
updateThreadsAndNotifications(threads, inboxNotifications, deletedThreads, deletedInboxNotifications) {
|
|
535
606
|
this._store.batch(() => {
|
|
536
607
|
this.updateThreadsCache(
|
|
537
608
|
(cache) => applyThreadUpdates(cache, {
|
|
@@ -545,9 +616,6 @@ var UmbrellaStore = class {
|
|
|
545
616
|
deletedNotifications: deletedInboxNotifications
|
|
546
617
|
})
|
|
547
618
|
);
|
|
548
|
-
if (queryKey !== void 0) {
|
|
549
|
-
this.setQueryOK(queryKey);
|
|
550
|
-
}
|
|
551
619
|
});
|
|
552
620
|
}
|
|
553
621
|
/**
|
|
@@ -562,7 +630,7 @@ var UmbrellaStore = class {
|
|
|
562
630
|
}
|
|
563
631
|
updateRoomInboxNotificationSettings(roomId, settings, queryKey) {
|
|
564
632
|
this._store.batch(() => {
|
|
565
|
-
this.
|
|
633
|
+
this.setQuery3OK(queryKey);
|
|
566
634
|
this.setNotificationSettings(roomId, settings);
|
|
567
635
|
});
|
|
568
636
|
}
|
|
@@ -570,7 +638,7 @@ var UmbrellaStore = class {
|
|
|
570
638
|
this._store.batch(() => {
|
|
571
639
|
this.setVersions(roomId, versions);
|
|
572
640
|
if (queryKey !== void 0) {
|
|
573
|
-
this.
|
|
641
|
+
this.setQuery4OK(queryKey);
|
|
574
642
|
}
|
|
575
643
|
});
|
|
576
644
|
}
|
|
@@ -588,30 +656,61 @@ var UmbrellaStore = class {
|
|
|
588
656
|
//
|
|
589
657
|
// Query State APIs
|
|
590
658
|
//
|
|
591
|
-
|
|
592
|
-
|
|
659
|
+
// Query 1
|
|
660
|
+
setQuery1Loading() {
|
|
661
|
+
this.setQuery1State(ASYNC_LOADING);
|
|
662
|
+
}
|
|
663
|
+
setQuery1OK() {
|
|
664
|
+
this.setQuery1State(ASYNC_OK);
|
|
665
|
+
}
|
|
666
|
+
setQuery1Error(error) {
|
|
667
|
+
this.setQuery1State({ isLoading: false, error });
|
|
668
|
+
}
|
|
669
|
+
// Query 2
|
|
670
|
+
setQuery2Loading(queryKey) {
|
|
671
|
+
this.setQuery2State(queryKey, ASYNC_LOADING);
|
|
672
|
+
}
|
|
673
|
+
setQuery2OK(queryKey) {
|
|
674
|
+
this.setQuery2State(queryKey, ASYNC_OK);
|
|
675
|
+
}
|
|
676
|
+
setQuery2Error(queryKey, error) {
|
|
677
|
+
this.setQuery2State(queryKey, { isLoading: false, error });
|
|
678
|
+
}
|
|
679
|
+
// Query 3
|
|
680
|
+
setQuery3Loading(queryKey) {
|
|
681
|
+
this.setQuery3State(queryKey, ASYNC_LOADING);
|
|
593
682
|
}
|
|
594
|
-
|
|
595
|
-
this.
|
|
683
|
+
setQuery3OK(queryKey) {
|
|
684
|
+
this.setQuery3State(queryKey, ASYNC_OK);
|
|
596
685
|
}
|
|
597
|
-
|
|
598
|
-
this.
|
|
686
|
+
setQuery3Error(queryKey, error) {
|
|
687
|
+
this.setQuery3State(queryKey, { isLoading: false, error });
|
|
688
|
+
}
|
|
689
|
+
// Query 4
|
|
690
|
+
setQuery4Loading(queryKey) {
|
|
691
|
+
this.setQuery4State(queryKey, ASYNC_LOADING);
|
|
692
|
+
}
|
|
693
|
+
setQuery4OK(queryKey) {
|
|
694
|
+
this.setQuery4State(queryKey, ASYNC_OK);
|
|
695
|
+
}
|
|
696
|
+
setQuery4Error(queryKey, error) {
|
|
697
|
+
this.setQuery4State(queryKey, { isLoading: false, error });
|
|
599
698
|
}
|
|
600
699
|
};
|
|
601
700
|
function internalToExternalState(state) {
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
701
|
+
const computed = {
|
|
702
|
+
threadsById: { ...state.rawThreadsById },
|
|
703
|
+
inboxNotificationsById: { ...state.inboxNotificationsById },
|
|
704
|
+
notificationSettingsByRoomId: { ...state.notificationSettingsByRoomId }
|
|
606
705
|
};
|
|
607
706
|
for (const optimisticUpdate of state.optimisticUpdates) {
|
|
608
707
|
switch (optimisticUpdate.type) {
|
|
609
708
|
case "create-thread": {
|
|
610
|
-
|
|
709
|
+
computed.threadsById[optimisticUpdate.thread.id] = optimisticUpdate.thread;
|
|
611
710
|
break;
|
|
612
711
|
}
|
|
613
712
|
case "edit-thread-metadata": {
|
|
614
|
-
const thread =
|
|
713
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
615
714
|
if (thread === void 0) {
|
|
616
715
|
break;
|
|
617
716
|
}
|
|
@@ -621,7 +720,7 @@ function internalToExternalState(state) {
|
|
|
621
720
|
if (thread.updatedAt !== void 0 && thread.updatedAt > optimisticUpdate.updatedAt) {
|
|
622
721
|
break;
|
|
623
722
|
}
|
|
624
|
-
|
|
723
|
+
computed.threadsById[thread.id] = {
|
|
625
724
|
...thread,
|
|
626
725
|
updatedAt: optimisticUpdate.updatedAt,
|
|
627
726
|
metadata: {
|
|
@@ -632,49 +731,51 @@ function internalToExternalState(state) {
|
|
|
632
731
|
break;
|
|
633
732
|
}
|
|
634
733
|
case "mark-thread-as-resolved": {
|
|
635
|
-
const thread =
|
|
734
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
636
735
|
if (thread === void 0) {
|
|
637
736
|
break;
|
|
638
737
|
}
|
|
639
738
|
if (thread.deletedAt !== void 0) {
|
|
640
739
|
break;
|
|
641
740
|
}
|
|
642
|
-
|
|
741
|
+
computed.threadsById[thread.id] = {
|
|
643
742
|
...thread,
|
|
644
743
|
resolved: true
|
|
645
744
|
};
|
|
646
745
|
break;
|
|
647
746
|
}
|
|
648
747
|
case "mark-thread-as-unresolved": {
|
|
649
|
-
const thread =
|
|
748
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
650
749
|
if (thread === void 0) {
|
|
651
750
|
break;
|
|
652
751
|
}
|
|
653
752
|
if (thread.deletedAt !== void 0) {
|
|
654
753
|
break;
|
|
655
754
|
}
|
|
656
|
-
|
|
755
|
+
computed.threadsById[thread.id] = {
|
|
657
756
|
...thread,
|
|
658
757
|
resolved: false
|
|
659
758
|
};
|
|
660
759
|
break;
|
|
661
760
|
}
|
|
662
761
|
case "create-comment": {
|
|
663
|
-
const thread =
|
|
762
|
+
const thread = computed.threadsById[optimisticUpdate.comment.threadId];
|
|
664
763
|
if (thread === void 0) {
|
|
665
764
|
break;
|
|
666
765
|
}
|
|
667
|
-
|
|
766
|
+
computed.threadsById[thread.id] = applyUpsertComment(
|
|
668
767
|
thread,
|
|
669
768
|
optimisticUpdate.comment
|
|
670
769
|
);
|
|
671
|
-
const inboxNotification = Object.values(
|
|
770
|
+
const inboxNotification = Object.values(
|
|
771
|
+
computed.inboxNotificationsById
|
|
772
|
+
).find(
|
|
672
773
|
(notification) => notification.kind === "thread" && notification.threadId === thread.id
|
|
673
774
|
);
|
|
674
775
|
if (inboxNotification === void 0) {
|
|
675
776
|
break;
|
|
676
777
|
}
|
|
677
|
-
|
|
778
|
+
computed.inboxNotificationsById[inboxNotification.id] = {
|
|
678
779
|
...inboxNotification,
|
|
679
780
|
notifiedAt: optimisticUpdate.comment.createdAt,
|
|
680
781
|
readAt: optimisticUpdate.comment.createdAt
|
|
@@ -682,22 +783,22 @@ function internalToExternalState(state) {
|
|
|
682
783
|
break;
|
|
683
784
|
}
|
|
684
785
|
case "edit-comment": {
|
|
685
|
-
const thread =
|
|
786
|
+
const thread = computed.threadsById[optimisticUpdate.comment.threadId];
|
|
686
787
|
if (thread === void 0) {
|
|
687
788
|
break;
|
|
688
789
|
}
|
|
689
|
-
|
|
790
|
+
computed.threadsById[thread.id] = applyUpsertComment(
|
|
690
791
|
thread,
|
|
691
792
|
optimisticUpdate.comment
|
|
692
793
|
);
|
|
693
794
|
break;
|
|
694
795
|
}
|
|
695
796
|
case "delete-comment": {
|
|
696
|
-
const thread =
|
|
797
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
697
798
|
if (thread === void 0) {
|
|
698
799
|
break;
|
|
699
800
|
}
|
|
700
|
-
|
|
801
|
+
computed.threadsById[thread.id] = applyDeleteComment(
|
|
701
802
|
thread,
|
|
702
803
|
optimisticUpdate.commentId,
|
|
703
804
|
optimisticUpdate.deletedAt
|
|
@@ -705,12 +806,12 @@ function internalToExternalState(state) {
|
|
|
705
806
|
break;
|
|
706
807
|
}
|
|
707
808
|
case "delete-thread": {
|
|
708
|
-
const thread =
|
|
809
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
709
810
|
if (thread === void 0) {
|
|
710
811
|
break;
|
|
711
812
|
}
|
|
712
|
-
|
|
713
|
-
...
|
|
813
|
+
computed.threadsById[optimisticUpdate.threadId] = {
|
|
814
|
+
...thread,
|
|
714
815
|
deletedAt: optimisticUpdate.deletedAt,
|
|
715
816
|
updatedAt: optimisticUpdate.deletedAt,
|
|
716
817
|
comments: []
|
|
@@ -718,11 +819,11 @@ function internalToExternalState(state) {
|
|
|
718
819
|
break;
|
|
719
820
|
}
|
|
720
821
|
case "add-reaction": {
|
|
721
|
-
const thread =
|
|
822
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
722
823
|
if (thread === void 0) {
|
|
723
824
|
break;
|
|
724
825
|
}
|
|
725
|
-
|
|
826
|
+
computed.threadsById[thread.id] = applyAddReaction(
|
|
726
827
|
thread,
|
|
727
828
|
optimisticUpdate.commentId,
|
|
728
829
|
optimisticUpdate.reaction
|
|
@@ -730,11 +831,11 @@ function internalToExternalState(state) {
|
|
|
730
831
|
break;
|
|
731
832
|
}
|
|
732
833
|
case "remove-reaction": {
|
|
733
|
-
const thread =
|
|
834
|
+
const thread = computed.threadsById[optimisticUpdate.threadId];
|
|
734
835
|
if (thread === void 0) {
|
|
735
836
|
break;
|
|
736
837
|
}
|
|
737
|
-
|
|
838
|
+
computed.threadsById[thread.id] = applyRemoveReaction(
|
|
738
839
|
thread,
|
|
739
840
|
optimisticUpdate.commentId,
|
|
740
841
|
optimisticUpdate.emoji,
|
|
@@ -744,36 +845,41 @@ function internalToExternalState(state) {
|
|
|
744
845
|
break;
|
|
745
846
|
}
|
|
746
847
|
case "mark-inbox-notification-as-read": {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
848
|
+
const ibn = computed.inboxNotificationsById[optimisticUpdate.inboxNotificationId];
|
|
849
|
+
if (ibn === void 0) {
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
computed.inboxNotificationsById[optimisticUpdate.inboxNotificationId] = { ...ibn, readAt: optimisticUpdate.readAt };
|
|
751
853
|
break;
|
|
752
854
|
}
|
|
753
855
|
case "mark-all-inbox-notifications-as-read": {
|
|
754
|
-
for (const id in
|
|
755
|
-
|
|
756
|
-
|
|
856
|
+
for (const id in computed.inboxNotificationsById) {
|
|
857
|
+
const ibn = computed.inboxNotificationsById[id];
|
|
858
|
+
if (ibn === void 0) {
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
computed.inboxNotificationsById[id] = {
|
|
862
|
+
...ibn,
|
|
757
863
|
readAt: optimisticUpdate.readAt
|
|
758
864
|
};
|
|
759
865
|
}
|
|
760
866
|
break;
|
|
761
867
|
}
|
|
762
868
|
case "delete-inbox-notification": {
|
|
763
|
-
|
|
764
|
-
[optimisticUpdate.inboxNotificationId]: _,
|
|
765
|
-
...inboxNotifications
|
|
766
|
-
} = output.inboxNotifications;
|
|
767
|
-
output.inboxNotifications = inboxNotifications;
|
|
869
|
+
delete computed.inboxNotificationsById[optimisticUpdate.inboxNotificationId];
|
|
768
870
|
break;
|
|
769
871
|
}
|
|
770
872
|
case "delete-all-inbox-notifications": {
|
|
771
|
-
|
|
873
|
+
computed.inboxNotificationsById = {};
|
|
772
874
|
break;
|
|
773
875
|
}
|
|
774
876
|
case "update-notification-settings": {
|
|
775
|
-
|
|
776
|
-
|
|
877
|
+
const settings = computed.notificationSettingsByRoomId[optimisticUpdate.roomId];
|
|
878
|
+
if (settings === void 0) {
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
computed.notificationSettingsByRoomId[optimisticUpdate.roomId] = {
|
|
882
|
+
...settings,
|
|
777
883
|
...optimisticUpdate.settings
|
|
778
884
|
};
|
|
779
885
|
}
|
|
@@ -781,23 +887,28 @@ function internalToExternalState(state) {
|
|
|
781
887
|
}
|
|
782
888
|
const cleanedThreads = (
|
|
783
889
|
// Don't expose any soft-deleted threads
|
|
784
|
-
Object.values(
|
|
785
|
-
(thread) =>
|
|
890
|
+
Object.values(computed.threadsById).filter((thread) => !thread.deletedAt).filter(
|
|
891
|
+
(thread) => (
|
|
892
|
+
// Only keep a thread if there is at least one non-deleted comment
|
|
893
|
+
thread.comments.some((c) => c.deletedAt === void 0)
|
|
894
|
+
)
|
|
786
895
|
)
|
|
787
896
|
);
|
|
788
897
|
const cleanedNotifications = (
|
|
789
898
|
// Sort so that the most recent notifications are first
|
|
790
|
-
Object.values(
|
|
791
|
-
(
|
|
792
|
-
)
|
|
899
|
+
Object.values(computed.inboxNotificationsById).filter(
|
|
900
|
+
(ibn) => ibn.kind === "thread" ? computed.threadsById[ibn.threadId] && _optionalChain([computed, 'access', _ => _.threadsById, 'access', _2 => _2[ibn.threadId], 'optionalAccess', _3 => _3.deletedAt]) === void 0 : true
|
|
901
|
+
).sort((a, b) => b.notifiedAt.getTime() - a.notifiedAt.getTime())
|
|
793
902
|
);
|
|
794
903
|
return {
|
|
795
904
|
inboxNotifications: cleanedNotifications,
|
|
796
|
-
inboxNotificationsById:
|
|
797
|
-
notificationSettingsByRoomId:
|
|
798
|
-
|
|
905
|
+
inboxNotificationsById: computed.inboxNotificationsById,
|
|
906
|
+
notificationSettingsByRoomId: computed.notificationSettingsByRoomId,
|
|
907
|
+
queries2: state.queries2,
|
|
908
|
+
queries3: state.queries3,
|
|
909
|
+
queries4: state.queries4,
|
|
799
910
|
threads: cleanedThreads,
|
|
800
|
-
threadsById:
|
|
911
|
+
threadsById: computed.threadsById,
|
|
801
912
|
versionsByRoomId: state.versionsByRoomId
|
|
802
913
|
};
|
|
803
914
|
}
|
|
@@ -867,7 +978,7 @@ function applyUpsertComment(thread, comment) {
|
|
|
867
978
|
);
|
|
868
979
|
if (existingComment === void 0) {
|
|
869
980
|
const updatedAt = new Date(
|
|
870
|
-
Math.max(_optionalChain([thread, 'access',
|
|
981
|
+
Math.max(_optionalChain([thread, 'access', _4 => _4.updatedAt, 'optionalAccess', _5 => _5.getTime, 'call', _6 => _6()]) || 0, comment.createdAt.getTime())
|
|
871
982
|
);
|
|
872
983
|
const updatedThread = {
|
|
873
984
|
...thread,
|
|
@@ -887,8 +998,8 @@ function applyUpsertComment(thread, comment) {
|
|
|
887
998
|
...thread,
|
|
888
999
|
updatedAt: new Date(
|
|
889
1000
|
Math.max(
|
|
890
|
-
_optionalChain([thread, 'access',
|
|
891
|
-
_optionalChain([comment, 'access',
|
|
1001
|
+
_optionalChain([thread, 'access', _7 => _7.updatedAt, 'optionalAccess', _8 => _8.getTime, 'call', _9 => _9()]) || 0,
|
|
1002
|
+
_optionalChain([comment, 'access', _10 => _10.editedAt, 'optionalAccess', _11 => _11.getTime, 'call', _12 => _12()]) || comment.createdAt.getTime()
|
|
892
1003
|
)
|
|
893
1004
|
),
|
|
894
1005
|
comments: updatedComments
|
|
@@ -919,12 +1030,11 @@ function applyDeleteComment(thread, commentId, deletedAt) {
|
|
|
919
1030
|
attachments: []
|
|
920
1031
|
} : comment
|
|
921
1032
|
);
|
|
922
|
-
if (
|
|
1033
|
+
if (updatedComments.every((comment) => comment.deletedAt !== void 0)) {
|
|
923
1034
|
return {
|
|
924
1035
|
...thread,
|
|
925
1036
|
deletedAt,
|
|
926
|
-
updatedAt: deletedAt
|
|
927
|
-
comments: []
|
|
1037
|
+
updatedAt: deletedAt
|
|
928
1038
|
};
|
|
929
1039
|
}
|
|
930
1040
|
return {
|
|
@@ -955,7 +1065,7 @@ function applyAddReaction(thread, commentId, reaction) {
|
|
|
955
1065
|
return {
|
|
956
1066
|
...thread,
|
|
957
1067
|
updatedAt: new Date(
|
|
958
|
-
Math.max(reaction.createdAt.getTime(), _optionalChain([thread, 'access',
|
|
1068
|
+
Math.max(reaction.createdAt.getTime(), _optionalChain([thread, 'access', _13 => _13.updatedAt, 'optionalAccess', _14 => _14.getTime, 'call', _15 => _15()]) || 0)
|
|
959
1069
|
),
|
|
960
1070
|
comments: updatedComments
|
|
961
1071
|
};
|
|
@@ -988,7 +1098,7 @@ function applyRemoveReaction(thread, commentId, emoji, userId, removedAt) {
|
|
|
988
1098
|
return {
|
|
989
1099
|
...thread,
|
|
990
1100
|
updatedAt: new Date(
|
|
991
|
-
Math.max(removedAt.getTime(), _optionalChain([thread, 'access',
|
|
1101
|
+
Math.max(removedAt.getTime(), _optionalChain([thread, 'access', _16 => _16.updatedAt, 'optionalAccess', _17 => _17.getTime, 'call', _18 => _18()]) || 0)
|
|
992
1102
|
),
|
|
993
1103
|
comments: updatedComments
|
|
994
1104
|
};
|
|
@@ -1055,7 +1165,7 @@ function selectorFor_useUnreadInboxNotificationsCount(result) {
|
|
|
1055
1165
|
};
|
|
1056
1166
|
}
|
|
1057
1167
|
function selectorFor_useUser(state, userId) {
|
|
1058
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
1168
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _19 => _19.isLoading])) {
|
|
1059
1169
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
1060
1170
|
}
|
|
1061
1171
|
if (state.error) {
|
|
@@ -1073,7 +1183,7 @@ function selectorFor_useUser(state, userId) {
|
|
|
1073
1183
|
};
|
|
1074
1184
|
}
|
|
1075
1185
|
function selectorFor_useRoomInfo(state, roomId) {
|
|
1076
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
1186
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _20 => _20.isLoading])) {
|
|
1077
1187
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
1078
1188
|
}
|
|
1079
1189
|
if (state.error) {
|
|
@@ -1133,25 +1243,29 @@ function makeExtrasForClient(client) {
|
|
|
1133
1243
|
async function fetchInboxNotifications() {
|
|
1134
1244
|
if (lastRequestedAt === void 0) {
|
|
1135
1245
|
const result = await client.getInboxNotifications();
|
|
1136
|
-
store.
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1246
|
+
store.batch(() => {
|
|
1247
|
+
store.updateThreadsAndNotifications(
|
|
1248
|
+
result.threads,
|
|
1249
|
+
result.inboxNotifications,
|
|
1250
|
+
[],
|
|
1251
|
+
[]
|
|
1252
|
+
);
|
|
1253
|
+
store.setQuery1OK();
|
|
1254
|
+
});
|
|
1143
1255
|
lastRequestedAt = result.requestedAt;
|
|
1144
1256
|
} else {
|
|
1145
1257
|
const result = await client.getInboxNotificationsSince({
|
|
1146
1258
|
since: lastRequestedAt
|
|
1147
1259
|
});
|
|
1148
|
-
store.
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1260
|
+
store.batch(() => {
|
|
1261
|
+
store.updateThreadsAndNotifications(
|
|
1262
|
+
result.threads.updated,
|
|
1263
|
+
result.inboxNotifications.updated,
|
|
1264
|
+
result.threads.deleted,
|
|
1265
|
+
result.inboxNotifications.deleted
|
|
1266
|
+
);
|
|
1267
|
+
store.setQuery1OK();
|
|
1268
|
+
});
|
|
1155
1269
|
if (lastRequestedAt < result.requestedAt) {
|
|
1156
1270
|
lastRequestedAt = result.requestedAt;
|
|
1157
1271
|
}
|
|
@@ -1167,7 +1281,7 @@ function makeExtrasForClient(client) {
|
|
|
1167
1281
|
}
|
|
1168
1282
|
});
|
|
1169
1283
|
const waitUntilInboxNotificationsLoaded = _core.memoizeOnSuccess.call(void 0, async () => {
|
|
1170
|
-
store.
|
|
1284
|
+
store.setQuery1Loading();
|
|
1171
1285
|
try {
|
|
1172
1286
|
await _core.autoRetry.call(void 0,
|
|
1173
1287
|
() => fetchInboxNotifications(),
|
|
@@ -1175,7 +1289,7 @@ function makeExtrasForClient(client) {
|
|
|
1175
1289
|
[5e3, 5e3, 1e4, 15e3]
|
|
1176
1290
|
);
|
|
1177
1291
|
} catch (err) {
|
|
1178
|
-
store.
|
|
1292
|
+
store.setQuery1Error(err);
|
|
1179
1293
|
throw err;
|
|
1180
1294
|
}
|
|
1181
1295
|
});
|
|
@@ -1183,23 +1297,21 @@ function makeExtrasForClient(client) {
|
|
|
1183
1297
|
void waitUntilInboxNotificationsLoaded().catch(() => {
|
|
1184
1298
|
});
|
|
1185
1299
|
}
|
|
1186
|
-
function
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
};
|
|
1202
|
-
}, []);
|
|
1300
|
+
function startPolling() {
|
|
1301
|
+
pollerSubscribers++;
|
|
1302
|
+
poller.start(POLLING_INTERVAL);
|
|
1303
|
+
return () => {
|
|
1304
|
+
if (pollerSubscribers <= 0) {
|
|
1305
|
+
console.warn(
|
|
1306
|
+
"Unexpected internal error: cannot decrease subscriber count for inbox notifications."
|
|
1307
|
+
);
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
pollerSubscribers--;
|
|
1311
|
+
if (pollerSubscribers <= 0) {
|
|
1312
|
+
poller.stop();
|
|
1313
|
+
}
|
|
1314
|
+
};
|
|
1203
1315
|
}
|
|
1204
1316
|
const userThreadsPoller = _core.makePoller.call(void 0, refreshUserThreads);
|
|
1205
1317
|
let isFetchingUserThreadsUpdates = false;
|
|
@@ -1214,13 +1326,15 @@ function makeExtrasForClient(client) {
|
|
|
1214
1326
|
since
|
|
1215
1327
|
});
|
|
1216
1328
|
isFetchingUserThreadsUpdates = false;
|
|
1217
|
-
store.
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1329
|
+
store.batch(() => {
|
|
1330
|
+
store.updateThreadsAndNotifications(
|
|
1331
|
+
updates.threads.updated,
|
|
1332
|
+
[],
|
|
1333
|
+
updates.threads.deleted,
|
|
1334
|
+
[]
|
|
1335
|
+
);
|
|
1336
|
+
store.setQuery2OK(USER_THREADS_QUERY);
|
|
1337
|
+
});
|
|
1224
1338
|
userThreadslastRequestedAt = updates.requestedAt;
|
|
1225
1339
|
} catch (err) {
|
|
1226
1340
|
isFetchingUserThreadsUpdates = false;
|
|
@@ -1257,16 +1371,18 @@ function makeExtrasForClient(client) {
|
|
|
1257
1371
|
if (existingRequest !== void 0) return existingRequest;
|
|
1258
1372
|
const request = client[_core.kInternal].getThreads(options);
|
|
1259
1373
|
userThreadsRequestsByQuery.set(queryKey, request);
|
|
1260
|
-
store.
|
|
1374
|
+
store.setQuery2Loading(queryKey);
|
|
1261
1375
|
try {
|
|
1262
1376
|
const result = await request;
|
|
1263
|
-
store.
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1377
|
+
store.batch(() => {
|
|
1378
|
+
store.updateThreadsAndNotifications(
|
|
1379
|
+
result.threads,
|
|
1380
|
+
result.inboxNotifications,
|
|
1381
|
+
[],
|
|
1382
|
+
[]
|
|
1383
|
+
);
|
|
1384
|
+
store.setQuery2OK(queryKey);
|
|
1385
|
+
});
|
|
1270
1386
|
if (userThreadslastRequestedAt === void 0 || userThreadslastRequestedAt < result.requestedAt) {
|
|
1271
1387
|
userThreadslastRequestedAt = result.requestedAt;
|
|
1272
1388
|
}
|
|
@@ -1278,13 +1394,13 @@ function makeExtrasForClient(client) {
|
|
|
1278
1394
|
retryCount: retryCount + 1
|
|
1279
1395
|
});
|
|
1280
1396
|
}, retryCount);
|
|
1281
|
-
store.
|
|
1397
|
+
store.setQuery2Error(queryKey, err);
|
|
1282
1398
|
}
|
|
1283
1399
|
return;
|
|
1284
1400
|
}
|
|
1285
1401
|
return {
|
|
1286
1402
|
store,
|
|
1287
|
-
|
|
1403
|
+
startPolling,
|
|
1288
1404
|
waitUntilInboxNotificationsLoaded,
|
|
1289
1405
|
loadInboxNotifications,
|
|
1290
1406
|
incrementUserThreadsQuerySubscribers,
|
|
@@ -1329,13 +1445,11 @@ function makeLiveblocksContextBundle(client) {
|
|
|
1329
1445
|
return bundle;
|
|
1330
1446
|
}
|
|
1331
1447
|
function useInboxNotifications_withClient(client) {
|
|
1332
|
-
const { loadInboxNotifications, store,
|
|
1333
|
-
_react.useEffect.call(void 0,
|
|
1334
|
-
|
|
1335
|
-
}, [loadInboxNotifications]);
|
|
1336
|
-
useEnableInboxNotificationsPolling();
|
|
1448
|
+
const { loadInboxNotifications, store, startPolling } = getExtrasForClient(client);
|
|
1449
|
+
_react.useEffect.call(void 0, loadInboxNotifications, [loadInboxNotifications]);
|
|
1450
|
+
_react.useEffect.call(void 0, startPolling, [startPolling]);
|
|
1337
1451
|
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
1338
|
-
store.
|
|
1452
|
+
store.subscribeThreadsOrInboxNotifications,
|
|
1339
1453
|
store.getInboxNotificationsAsync,
|
|
1340
1454
|
store.getInboxNotificationsAsync,
|
|
1341
1455
|
identity,
|
|
@@ -1351,13 +1465,11 @@ function useInboxNotificationsSuspense_withClient(client) {
|
|
|
1351
1465
|
return result;
|
|
1352
1466
|
}
|
|
1353
1467
|
function useUnreadInboxNotificationsCount_withClient(client) {
|
|
1354
|
-
const { store, loadInboxNotifications,
|
|
1355
|
-
_react.useEffect.call(void 0,
|
|
1356
|
-
|
|
1357
|
-
}, [loadInboxNotifications]);
|
|
1358
|
-
useEnableInboxNotificationsPolling();
|
|
1468
|
+
const { store, loadInboxNotifications, startPolling } = getExtrasForClient(client);
|
|
1469
|
+
_react.useEffect.call(void 0, loadInboxNotifications, [loadInboxNotifications]);
|
|
1470
|
+
_react.useEffect.call(void 0, startPolling, [startPolling]);
|
|
1359
1471
|
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
1360
|
-
store.
|
|
1472
|
+
store.subscribeThreadsOrInboxNotifications,
|
|
1361
1473
|
store.getInboxNotificationsAsync,
|
|
1362
1474
|
store.getInboxNotificationsAsync,
|
|
1363
1475
|
selectorFor_useUnreadInboxNotificationsCount,
|
|
@@ -1464,6 +1576,7 @@ function useDeleteAllInboxNotifications_withClient(client) {
|
|
|
1464
1576
|
}
|
|
1465
1577
|
function useInboxNotificationThread_withClient(client, inboxNotificationId) {
|
|
1466
1578
|
const { store } = getExtrasForClient(client);
|
|
1579
|
+
const getter = store.getFullState;
|
|
1467
1580
|
const selector = _react.useCallback.call(void 0,
|
|
1468
1581
|
(state) => {
|
|
1469
1582
|
const inboxNotification = _nullishCoalesce(state.inboxNotificationsById[inboxNotificationId], () => ( _core.raise.call(void 0, `Inbox notification with ID "${inboxNotificationId}" not found`)));
|
|
@@ -1480,9 +1593,10 @@ function useInboxNotificationThread_withClient(client, inboxNotificationId) {
|
|
|
1480
1593
|
[inboxNotificationId]
|
|
1481
1594
|
);
|
|
1482
1595
|
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
1483
|
-
store.
|
|
1484
|
-
|
|
1485
|
-
|
|
1596
|
+
store.subscribeThreadsOrInboxNotifications,
|
|
1597
|
+
// Re-evaluate if we need to update any time the notification changes over time
|
|
1598
|
+
getter,
|
|
1599
|
+
getter,
|
|
1486
1600
|
selector
|
|
1487
1601
|
);
|
|
1488
1602
|
}
|
|
@@ -1608,7 +1722,7 @@ function createSharedContext(client) {
|
|
|
1608
1722
|
}
|
|
1609
1723
|
function useEnsureNoLiveblocksProvider(options) {
|
|
1610
1724
|
const existing = useClientOrNull();
|
|
1611
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
1725
|
+
if (!_optionalChain([options, 'optionalAccess', _21 => _21.allowNesting]) && existing !== null) {
|
|
1612
1726
|
throw new Error(
|
|
1613
1727
|
"You cannot nest multiple LiveblocksProvider instances in the same React tree."
|
|
1614
1728
|
);
|
|
@@ -1670,37 +1784,29 @@ function useUserThreads_experimental(options = {
|
|
|
1670
1784
|
void getUserThreads(queryKey, options);
|
|
1671
1785
|
return incrementUserThreadsQuerySubscribers(queryKey);
|
|
1672
1786
|
}, [queryKey, incrementUserThreadsQuerySubscribers, getUserThreads, options]);
|
|
1787
|
+
const getter = _react.useCallback.call(void 0,
|
|
1788
|
+
() => store.getUserThreadsAsync(queryKey),
|
|
1789
|
+
[store, queryKey]
|
|
1790
|
+
);
|
|
1673
1791
|
const selector = _react.useCallback.call(void 0,
|
|
1674
|
-
(
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
return {
|
|
1678
|
-
isLoading: true
|
|
1679
|
-
};
|
|
1680
|
-
}
|
|
1681
|
-
if (query.error !== void 0) {
|
|
1682
|
-
return {
|
|
1683
|
-
threads: [],
|
|
1684
|
-
error: query.error,
|
|
1685
|
-
isLoading: false
|
|
1686
|
-
};
|
|
1792
|
+
(result) => {
|
|
1793
|
+
if (!result.fullState) {
|
|
1794
|
+
return result;
|
|
1687
1795
|
}
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
isLoading: false
|
|
1696
|
-
};
|
|
1796
|
+
const threads = selectThreads(result.fullState, {
|
|
1797
|
+
roomId: null,
|
|
1798
|
+
// Do _not_ filter by roomId
|
|
1799
|
+
query: options.query,
|
|
1800
|
+
orderBy: "last-update"
|
|
1801
|
+
});
|
|
1802
|
+
return { isLoading: false, threads };
|
|
1697
1803
|
},
|
|
1698
|
-
[
|
|
1804
|
+
[options]
|
|
1699
1805
|
);
|
|
1700
1806
|
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
1701
|
-
store.
|
|
1702
|
-
|
|
1703
|
-
|
|
1807
|
+
store.subscribeUserThreads,
|
|
1808
|
+
getter,
|
|
1809
|
+
getter,
|
|
1704
1810
|
selector,
|
|
1705
1811
|
shallow2
|
|
1706
1812
|
// NOTE: Using 2-level-deep shallow check here, because the result of selectThreads() is not stable!
|
|
@@ -1721,13 +1827,14 @@ function useUserThreadsSuspense_experimental(options = {
|
|
|
1721
1827
|
const { incrementUserThreadsQuerySubscribers } = getExtrasForClient(client);
|
|
1722
1828
|
return incrementUserThreadsQuerySubscribers(queryKey);
|
|
1723
1829
|
}, [client, queryKey]);
|
|
1724
|
-
const query = store.
|
|
1830
|
+
const query = store.getFullState().queries2[queryKey];
|
|
1725
1831
|
if (query === void 0 || query.isLoading) {
|
|
1726
1832
|
throw getUserThreads(queryKey, options);
|
|
1727
1833
|
}
|
|
1728
1834
|
if (query.error) {
|
|
1729
1835
|
throw query.error;
|
|
1730
1836
|
}
|
|
1837
|
+
const getter = store.getFullState;
|
|
1731
1838
|
const selector = _react.useCallback.call(void 0,
|
|
1732
1839
|
(state) => {
|
|
1733
1840
|
return {
|
|
@@ -1743,9 +1850,9 @@ function useUserThreadsSuspense_experimental(options = {
|
|
|
1743
1850
|
[options]
|
|
1744
1851
|
);
|
|
1745
1852
|
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
1746
|
-
store.
|
|
1747
|
-
|
|
1748
|
-
|
|
1853
|
+
store.subscribeUserThreads,
|
|
1854
|
+
getter,
|
|
1855
|
+
getter,
|
|
1749
1856
|
selector,
|
|
1750
1857
|
shallow2
|
|
1751
1858
|
// NOTE: Using 2-level-deep shallow check here, because the result of selectThreads() is not stable!
|
|
@@ -1924,7 +2031,7 @@ var _client = require('@liveblocks/client');
|
|
|
1924
2031
|
|
|
1925
2032
|
function handleScrollToCommentOnLoad(shouldScrollOnLoad, state) {
|
|
1926
2033
|
if (shouldScrollOnLoad === false) return;
|
|
1927
|
-
if (state.
|
|
2034
|
+
if (!state.threads) return;
|
|
1928
2035
|
const isWindowDefined = typeof window !== "undefined";
|
|
1929
2036
|
if (!isWindowDefined) return;
|
|
1930
2037
|
const hash = window.location.hash;
|
|
@@ -2019,7 +2126,7 @@ function getCurrentUserId(room) {
|
|
|
2019
2126
|
}
|
|
2020
2127
|
function handleApiError(err) {
|
|
2021
2128
|
const message = `Request failed with status ${err.status}: ${err.message}`;
|
|
2022
|
-
if (_optionalChain([err, 'access',
|
|
2129
|
+
if (_optionalChain([err, 'access', _22 => _22.details, 'optionalAccess', _23 => _23.error]) === "FORBIDDEN") {
|
|
2023
2130
|
const detailedMessage = [message, err.details.suggestion, err.details.docs].filter(Boolean).join("\n");
|
|
2024
2131
|
_core.console.error(detailedMessage);
|
|
2025
2132
|
}
|
|
@@ -2108,12 +2215,12 @@ function makeExtrasForClient2(client) {
|
|
|
2108
2215
|
}
|
|
2109
2216
|
}
|
|
2110
2217
|
async function getRoomVersions(room, { retryCount } = { retryCount: 0 }) {
|
|
2111
|
-
const queryKey =
|
|
2218
|
+
const queryKey = makeVersionsQueryKey(room.id);
|
|
2112
2219
|
const existingRequest = requestsByQuery.get(queryKey);
|
|
2113
2220
|
if (existingRequest !== void 0) return existingRequest;
|
|
2114
2221
|
const request = room[_core.kInternal].listTextVersions();
|
|
2115
2222
|
requestsByQuery.set(queryKey, request);
|
|
2116
|
-
store.
|
|
2223
|
+
store.setQuery4Loading(queryKey);
|
|
2117
2224
|
try {
|
|
2118
2225
|
const result = await request;
|
|
2119
2226
|
const data = await result.json();
|
|
@@ -2132,7 +2239,7 @@ function makeExtrasForClient2(client) {
|
|
|
2132
2239
|
retryCount: retryCount + 1
|
|
2133
2240
|
});
|
|
2134
2241
|
}, retryCount);
|
|
2135
|
-
store.
|
|
2242
|
+
store.setQuery4Error(queryKey, err);
|
|
2136
2243
|
}
|
|
2137
2244
|
return;
|
|
2138
2245
|
}
|
|
@@ -2141,17 +2248,19 @@ function makeExtrasForClient2(client) {
|
|
|
2141
2248
|
if (existingRequest !== void 0) return existingRequest;
|
|
2142
2249
|
const request = room.getThreads(options);
|
|
2143
2250
|
requestsByQuery.set(queryKey, request);
|
|
2144
|
-
store.
|
|
2251
|
+
store.setQuery2Loading(queryKey);
|
|
2145
2252
|
try {
|
|
2146
2253
|
const result = await request;
|
|
2147
|
-
store.
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2254
|
+
store.batch(() => {
|
|
2255
|
+
store.updateThreadsAndNotifications(
|
|
2256
|
+
result.threads,
|
|
2257
|
+
// TODO: Figure out how to remove this casting
|
|
2258
|
+
result.inboxNotifications,
|
|
2259
|
+
[],
|
|
2260
|
+
[]
|
|
2261
|
+
);
|
|
2262
|
+
store.setQuery2OK(queryKey);
|
|
2263
|
+
});
|
|
2155
2264
|
const lastRequestedAt = lastRequestedAtByRoom.get(room.id);
|
|
2156
2265
|
if (lastRequestedAt === void 0 || lastRequestedAt > result.requestedAt) {
|
|
2157
2266
|
lastRequestedAtByRoom.set(room.id, result.requestedAt);
|
|
@@ -2164,7 +2273,7 @@ function makeExtrasForClient2(client) {
|
|
|
2164
2273
|
retryCount: retryCount + 1
|
|
2165
2274
|
});
|
|
2166
2275
|
}, retryCount);
|
|
2167
|
-
store.
|
|
2276
|
+
store.setQuery2Error(queryKey, err);
|
|
2168
2277
|
}
|
|
2169
2278
|
return;
|
|
2170
2279
|
}
|
|
@@ -2175,7 +2284,7 @@ function makeExtrasForClient2(client) {
|
|
|
2175
2284
|
try {
|
|
2176
2285
|
const request = room.getNotificationSettings();
|
|
2177
2286
|
requestsByQuery.set(queryKey, request);
|
|
2178
|
-
store.
|
|
2287
|
+
store.setQuery3Loading(queryKey);
|
|
2179
2288
|
const settings = await request;
|
|
2180
2289
|
store.updateRoomInboxNotificationSettings(room.id, settings, queryKey);
|
|
2181
2290
|
} catch (err) {
|
|
@@ -2185,7 +2294,7 @@ function makeExtrasForClient2(client) {
|
|
|
2185
2294
|
retryCount: retryCount + 1
|
|
2186
2295
|
});
|
|
2187
2296
|
}, retryCount);
|
|
2188
|
-
store.
|
|
2297
|
+
store.setQuery3Error(queryKey, err);
|
|
2189
2298
|
}
|
|
2190
2299
|
return;
|
|
2191
2300
|
}
|
|
@@ -2395,7 +2504,7 @@ function RoomProviderInner(props) {
|
|
|
2395
2504
|
return;
|
|
2396
2505
|
}
|
|
2397
2506
|
const { thread, inboxNotification } = info;
|
|
2398
|
-
const existingThread = store.
|
|
2507
|
+
const existingThread = store.getFullState().threadsById[message.threadId];
|
|
2399
2508
|
switch (message.type) {
|
|
2400
2509
|
case _core.ServerMsgCode.COMMENT_EDITED:
|
|
2401
2510
|
case _core.ServerMsgCode.THREAD_METADATA_UPDATED:
|
|
@@ -2459,7 +2568,7 @@ function useStatus() {
|
|
|
2459
2568
|
return useSyncExternalStore2(subscribe, getSnapshot, getServerSnapshot);
|
|
2460
2569
|
}
|
|
2461
2570
|
function useStorageStatus(options) {
|
|
2462
|
-
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2571
|
+
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.smooth]), () => ( false)));
|
|
2463
2572
|
if (smooth) {
|
|
2464
2573
|
return useStorageStatusSmooth();
|
|
2465
2574
|
} else {
|
|
@@ -2727,32 +2836,31 @@ function useThreads(options = {
|
|
|
2727
2836
|
void getThreadsAndInboxNotifications(room, queryKey, options);
|
|
2728
2837
|
return incrementQuerySubscribers(queryKey);
|
|
2729
2838
|
}, [room, queryKey]);
|
|
2839
|
+
const getter = React5.useCallback(
|
|
2840
|
+
() => store.getThreadsAsync(queryKey),
|
|
2841
|
+
[store, queryKey]
|
|
2842
|
+
);
|
|
2730
2843
|
const selector = React5.useCallback(
|
|
2731
|
-
(
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
return {
|
|
2735
|
-
isLoading: true
|
|
2736
|
-
};
|
|
2844
|
+
(result) => {
|
|
2845
|
+
if (!result.fullState) {
|
|
2846
|
+
return result;
|
|
2737
2847
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
isLoading: false,
|
|
2745
|
-
error: query.error
|
|
2746
|
-
};
|
|
2848
|
+
const threads = selectThreads(result.fullState, {
|
|
2849
|
+
roomId: room.id,
|
|
2850
|
+
query: options.query,
|
|
2851
|
+
orderBy: "age"
|
|
2852
|
+
});
|
|
2853
|
+
return { isLoading: false, threads };
|
|
2747
2854
|
},
|
|
2748
|
-
[room, queryKey]
|
|
2855
|
+
[room.id, queryKey]
|
|
2749
2856
|
// eslint-disable-line react-hooks/exhaustive-deps
|
|
2750
2857
|
);
|
|
2751
2858
|
const state = _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
2752
2859
|
store.subscribeThreads,
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
selector
|
|
2860
|
+
getter,
|
|
2861
|
+
getter,
|
|
2862
|
+
selector,
|
|
2863
|
+
shallow2
|
|
2756
2864
|
);
|
|
2757
2865
|
useScrollToCommentOnLoadEffect(scrollOnLoad, state);
|
|
2758
2866
|
return state;
|
|
@@ -2803,7 +2911,7 @@ function useCreateThread() {
|
|
|
2803
2911
|
thread: newThread,
|
|
2804
2912
|
roomId: room.id
|
|
2805
2913
|
});
|
|
2806
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
2914
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _25 => _25.map, 'call', _26 => _26((attachment) => attachment.id)]);
|
|
2807
2915
|
room.createThread({ threadId, commentId, body, metadata, attachmentIds }).then(
|
|
2808
2916
|
(thread) => {
|
|
2809
2917
|
store.createThread(optimisticUpdateId, thread);
|
|
@@ -2831,9 +2939,9 @@ function useDeleteThread() {
|
|
|
2831
2939
|
return React5.useCallback(
|
|
2832
2940
|
(threadId) => {
|
|
2833
2941
|
const { store, onMutationFailure } = getExtrasForClient2(client);
|
|
2834
|
-
const thread = store.
|
|
2942
|
+
const thread = store.getFullState().threadsById[threadId];
|
|
2835
2943
|
const userId = getCurrentUserId(room);
|
|
2836
|
-
if (_optionalChain([thread, 'optionalAccess',
|
|
2944
|
+
if (_optionalChain([thread, 'optionalAccess', _27 => _27.comments, 'optionalAccess', _28 => _28[0], 'optionalAccess', _29 => _29.userId]) !== userId) {
|
|
2837
2945
|
throw new Error("Only the thread creator can delete the thread");
|
|
2838
2946
|
}
|
|
2839
2947
|
const optimisticUpdateId = store.addOptimisticUpdate({
|
|
@@ -2921,7 +3029,7 @@ function useCreateComment() {
|
|
|
2921
3029
|
type: "create-comment",
|
|
2922
3030
|
comment
|
|
2923
3031
|
});
|
|
2924
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
3032
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _30 => _30.map, 'call', _31 => _31((attachment) => attachment.id)]);
|
|
2925
3033
|
room.createComment({ threadId, commentId, body, attachmentIds }).then(
|
|
2926
3034
|
(newComment) => {
|
|
2927
3035
|
store.createComment(newComment, optimisticUpdateId);
|
|
@@ -2949,7 +3057,7 @@ function useEditComment() {
|
|
|
2949
3057
|
({ threadId, commentId, body, attachments }) => {
|
|
2950
3058
|
const editedAt = /* @__PURE__ */ new Date();
|
|
2951
3059
|
const { store, onMutationFailure } = getExtrasForClient2(client);
|
|
2952
|
-
const thread = store.
|
|
3060
|
+
const thread = store.getFullState().threadsById[threadId];
|
|
2953
3061
|
if (thread === void 0) {
|
|
2954
3062
|
_core.console.warn(
|
|
2955
3063
|
`Internal unexpected behavior. Cannot edit comment in thread "${threadId}" because the thread does not exist in the cache.`
|
|
@@ -2974,7 +3082,7 @@ function useEditComment() {
|
|
|
2974
3082
|
attachments: _nullishCoalesce(attachments, () => ( []))
|
|
2975
3083
|
}
|
|
2976
3084
|
});
|
|
2977
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
3085
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _32 => _32.map, 'call', _33 => _33((attachment) => attachment.id)]);
|
|
2978
3086
|
room.editComment({ threadId, commentId, body, attachmentIds }).then(
|
|
2979
3087
|
(editedComment) => {
|
|
2980
3088
|
store.editComment(threadId, optimisticUpdateId, editedComment);
|
|
@@ -3123,7 +3231,7 @@ function useMarkThreadAsRead() {
|
|
|
3123
3231
|
(threadId) => {
|
|
3124
3232
|
const { store, onMutationFailure } = getExtrasForClient2(client);
|
|
3125
3233
|
const inboxNotification = Object.values(
|
|
3126
|
-
store.
|
|
3234
|
+
store.getFullState().inboxNotificationsById
|
|
3127
3235
|
).find(
|
|
3128
3236
|
(inboxNotification2) => inboxNotification2.kind === "thread" && inboxNotification2.threadId === threadId
|
|
3129
3237
|
);
|
|
@@ -3248,8 +3356,8 @@ function useThreadSubscription(threadId) {
|
|
|
3248
3356
|
);
|
|
3249
3357
|
return _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
3250
3358
|
store.subscribeThreads,
|
|
3251
|
-
store.
|
|
3252
|
-
store.
|
|
3359
|
+
store.getFullState,
|
|
3360
|
+
store.getFullState,
|
|
3253
3361
|
selector
|
|
3254
3362
|
);
|
|
3255
3363
|
}
|
|
@@ -3335,34 +3443,44 @@ function useHistoryVersionData(versionId) {
|
|
|
3335
3443
|
function useHistoryVersions() {
|
|
3336
3444
|
const client = useClient();
|
|
3337
3445
|
const room = useRoom();
|
|
3338
|
-
const queryKey = getVersionsQueryKey(room.id);
|
|
3339
3446
|
const { store, getRoomVersions } = getExtrasForClient2(client);
|
|
3447
|
+
const getter = React5.useCallback(
|
|
3448
|
+
() => store.getVersionsAsync(room.id),
|
|
3449
|
+
[store, room.id]
|
|
3450
|
+
);
|
|
3340
3451
|
React5.useEffect(() => {
|
|
3341
3452
|
void getRoomVersions(room);
|
|
3342
3453
|
}, [room]);
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3454
|
+
const state = _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
3455
|
+
store.subscribeVersions,
|
|
3456
|
+
getter,
|
|
3457
|
+
getter,
|
|
3458
|
+
identity2,
|
|
3459
|
+
_client.shallow
|
|
3460
|
+
);
|
|
3461
|
+
return state;
|
|
3462
|
+
}
|
|
3463
|
+
function useHistoryVersionsSuspense() {
|
|
3464
|
+
const client = useClient();
|
|
3465
|
+
const room = useRoom();
|
|
3466
|
+
const { store } = getExtrasForClient2(client);
|
|
3467
|
+
const getter = React5.useCallback(
|
|
3468
|
+
() => store.getVersionsAsync(room.id),
|
|
3469
|
+
[store, room.id]
|
|
3359
3470
|
);
|
|
3360
3471
|
const state = _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
3361
3472
|
store.subscribeVersions,
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3473
|
+
getter,
|
|
3474
|
+
getter,
|
|
3475
|
+
identity2,
|
|
3476
|
+
_client.shallow
|
|
3365
3477
|
);
|
|
3478
|
+
if (state.isLoading) {
|
|
3479
|
+
const { getRoomVersions } = getExtrasForClient2(client);
|
|
3480
|
+
throw getRoomVersions(room);
|
|
3481
|
+
} else if (state.error) {
|
|
3482
|
+
throw state.error;
|
|
3483
|
+
}
|
|
3366
3484
|
return state;
|
|
3367
3485
|
}
|
|
3368
3486
|
function useUpdateRoomNotificationSettings() {
|
|
@@ -3461,7 +3579,7 @@ function useThreadsSuspense(options = {
|
|
|
3461
3579
|
[room, options]
|
|
3462
3580
|
);
|
|
3463
3581
|
const { store, getThreadsAndInboxNotifications } = getExtrasForClient2(client);
|
|
3464
|
-
const query = store.
|
|
3582
|
+
const query = store.getFullState().queries2[queryKey];
|
|
3465
3583
|
if (query === void 0 || query.isLoading) {
|
|
3466
3584
|
throw getThreadsAndInboxNotifications(room, queryKey, options);
|
|
3467
3585
|
}
|
|
@@ -3488,15 +3606,15 @@ function useThreadsSuspense(options = {
|
|
|
3488
3606
|
}, [client, queryKey]);
|
|
3489
3607
|
const state = _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
3490
3608
|
store.subscribeThreads,
|
|
3491
|
-
store.
|
|
3492
|
-
store.
|
|
3609
|
+
store.getFullState,
|
|
3610
|
+
store.getFullState,
|
|
3493
3611
|
selector
|
|
3494
3612
|
);
|
|
3495
3613
|
useScrollToCommentOnLoadEffect(scrollOnLoad, state);
|
|
3496
3614
|
return state;
|
|
3497
3615
|
}
|
|
3498
3616
|
function selectorFor_useAttachmentUrl(state) {
|
|
3499
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
3617
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _34 => _34.isLoading])) {
|
|
3500
3618
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
3501
3619
|
}
|
|
3502
3620
|
if (state.error) {
|
|
@@ -3554,45 +3672,12 @@ function useAttachmentUrlSuspense(attachmentId) {
|
|
|
3554
3672
|
error: void 0
|
|
3555
3673
|
};
|
|
3556
3674
|
}
|
|
3557
|
-
function useHistoryVersionsSuspense() {
|
|
3558
|
-
const client = useClient();
|
|
3559
|
-
const room = useRoom();
|
|
3560
|
-
const queryKey = getVersionsQueryKey(room.id);
|
|
3561
|
-
const { store, getRoomVersions } = getExtrasForClient2(client);
|
|
3562
|
-
const query = store.getVersions().queries[queryKey];
|
|
3563
|
-
if (query === void 0 || query.isLoading) {
|
|
3564
|
-
throw getRoomVersions(room);
|
|
3565
|
-
}
|
|
3566
|
-
if (query.error) {
|
|
3567
|
-
throw query.error;
|
|
3568
|
-
}
|
|
3569
|
-
const selector = React5.useCallback(
|
|
3570
|
-
(state2) => {
|
|
3571
|
-
return {
|
|
3572
|
-
versions: state2.versionsByRoomId[room.id],
|
|
3573
|
-
isLoading: false
|
|
3574
|
-
};
|
|
3575
|
-
},
|
|
3576
|
-
[room, queryKey]
|
|
3577
|
-
// eslint-disable-line react-hooks/exhaustive-deps
|
|
3578
|
-
);
|
|
3579
|
-
const state = _withselectorjs.useSyncExternalStoreWithSelector.call(void 0,
|
|
3580
|
-
store.subscribeVersions,
|
|
3581
|
-
store.getVersions,
|
|
3582
|
-
store.getVersions,
|
|
3583
|
-
selector
|
|
3584
|
-
);
|
|
3585
|
-
return state;
|
|
3586
|
-
}
|
|
3587
3675
|
function createRoomContext(client) {
|
|
3588
3676
|
return getOrCreateRoomContextBundle(client);
|
|
3589
3677
|
}
|
|
3590
3678
|
function generateQueryKey(roomId, options) {
|
|
3591
3679
|
return `${roomId}-${_core.stringify.call(void 0, _nullishCoalesce(options, () => ( {})))}`;
|
|
3592
3680
|
}
|
|
3593
|
-
function getVersionsQueryKey(roomId) {
|
|
3594
|
-
return `${roomId}-VERSIONS`;
|
|
3595
|
-
}
|
|
3596
3681
|
var _RoomProvider = RoomProvider;
|
|
3597
3682
|
var _useBroadcastEvent = useBroadcastEvent;
|
|
3598
3683
|
var _useOthersListener = useOthersListener;
|
|
@@ -3715,4 +3800,4 @@ var _useUpdateMyPresence = useUpdateMyPresence;
|
|
|
3715
3800
|
|
|
3716
3801
|
|
|
3717
3802
|
exports.PKG_NAME = PKG_NAME; exports.PKG_VERSION = PKG_VERSION; exports.PKG_FORMAT = PKG_FORMAT; exports.ClientSideSuspense = ClientSideSuspense; exports.RoomContext = RoomContext; exports.ClientContext = ClientContext; exports.selectThreads = selectThreads; exports.getUmbrellaStoreForClient = getUmbrellaStoreForClient; 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.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.CreateThreadError = CreateThreadError; exports.useStatus = useStatus; exports.useStorageStatus = useStorageStatus; exports.useBatch = useBatch; exports.useLostConnectionListener = useLostConnectionListener; exports.useErrorListener = useErrorListener; exports.useHistory = useHistory; exports.useUndo = useUndo; exports.useRedo = useRedo; exports.useCanUndo = useCanUndo; exports.useCanRedo = useCanRedo; exports.useOthersConnectionIds = useOthersConnectionIds; exports.useCommentsErrorListener = useCommentsErrorListener; exports.useCreateComment = useCreateComment; exports.useEditComment = useEditComment; exports.useDeleteComment = useDeleteComment; exports.useRemoveReaction = useRemoveReaction; exports.useMarkThreadAsRead = useMarkThreadAsRead; exports.useMarkThreadAsResolved = useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = useMarkThreadAsUnresolved; exports.useThreadSubscription = useThreadSubscription; exports.useRoomNotificationSettings = useRoomNotificationSettings; exports.useHistoryVersionData = useHistoryVersionData; exports.useUpdateRoomNotificationSettings = useUpdateRoomNotificationSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useStorageStatusSuspense = useStorageStatusSuspense; exports.useAttachmentUrl = useAttachmentUrl; exports.useAttachmentUrlSuspense = useAttachmentUrlSuspense; 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._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;
|
|
3718
|
-
//# sourceMappingURL=chunk-
|
|
3803
|
+
//# sourceMappingURL=chunk-G4SKKVCK.js.map
|