@liveblocks/react 3.15.0-components1 → 3.15.0-feeds2
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/README.md +6 -16
- package/dist/_private.cjs +7 -7
- package/dist/_private.d.cts +2 -2
- package/dist/_private.d.ts +2 -2
- package/dist/_private.js +1 -1
- package/dist/{chunk-Z7VSK4H7.cjs → chunk-7I2IBAFZ.cjs} +2 -2
- package/dist/chunk-7I2IBAFZ.cjs.map +1 -0
- package/dist/{chunk-B5F24HAT.js → chunk-GWYQHSXI.js} +530 -728
- package/dist/chunk-GWYQHSXI.js.map +1 -0
- package/dist/{chunk-VMPATNNT.js → chunk-H7GF5P7X.js} +2 -2
- package/dist/{chunk-Z3NTUAGP.cjs → chunk-NHU725OF.cjs} +566 -764
- package/dist/chunk-NHU725OF.cjs.map +1 -0
- package/dist/index.cjs +20 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/dist/{room-C3ujtNzt.d.cts → room-c0k0bfIo.d.cts} +182 -20
- package/dist/{room-C3ujtNzt.d.ts → room-c0k0bfIo.d.ts} +182 -20
- package/dist/suspense.cjs +20 -4
- package/dist/suspense.cjs.map +1 -1
- package/dist/suspense.d.cts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +20 -4
- package/dist/suspense.js.map +1 -1
- package/package.json +4 -3
- package/dist/chunk-B5F24HAT.js.map +0 -1
- package/dist/chunk-Z3NTUAGP.cjs.map +0 -1
- package/dist/chunk-Z7VSK4H7.cjs.map +0 -1
- /package/dist/{chunk-VMPATNNT.js.map → chunk-H7GF5P7X.js.map} +0 -0
|
@@ -8,8 +8,8 @@ function useClientOrNull() {
|
|
|
8
8
|
function useClient() {
|
|
9
9
|
return useClientOrNull() ?? raise("LiveblocksProvider is missing from the React tree.");
|
|
10
10
|
}
|
|
11
|
-
var
|
|
12
|
-
function useRoomOrNull(
|
|
11
|
+
var RoomContext = createContext(null);
|
|
12
|
+
function useRoomOrNull() {
|
|
13
13
|
return useContext(RoomContext);
|
|
14
14
|
}
|
|
15
15
|
function useIsInsideRoom() {
|
|
@@ -512,6 +512,12 @@ function makeAiChatsQueryKey(query) {
|
|
|
512
512
|
function makeInboxNotificationsQueryKey(query) {
|
|
513
513
|
return stableStringify(query ?? {});
|
|
514
514
|
}
|
|
515
|
+
function makeFeedsQueryKey(roomId, options) {
|
|
516
|
+
return stableStringify([roomId, options ?? {}]);
|
|
517
|
+
}
|
|
518
|
+
function makeFeedMessagesQueryKey(roomId, feedId, options) {
|
|
519
|
+
return stableStringify([roomId, feedId, options ?? {}]);
|
|
520
|
+
}
|
|
515
521
|
function usify(promise) {
|
|
516
522
|
if ("status" in promise) {
|
|
517
523
|
return promise;
|
|
@@ -559,6 +565,7 @@ var PaginatedResource = class {
|
|
|
559
565
|
this.#patch({ isFetchingMore: true });
|
|
560
566
|
try {
|
|
561
567
|
const nextCursor = await this.#fetchPage(state.data.cursor);
|
|
568
|
+
this.#pendingFetchMore = null;
|
|
562
569
|
this.#patch({
|
|
563
570
|
cursor: nextCursor,
|
|
564
571
|
hasFetchedAll: nextCursor === null,
|
|
@@ -566,6 +573,7 @@ var PaginatedResource = class {
|
|
|
566
573
|
isFetchingMore: false
|
|
567
574
|
});
|
|
568
575
|
} catch (err) {
|
|
576
|
+
this.#pendingFetchMore = null;
|
|
569
577
|
this.#patch({
|
|
570
578
|
isFetchingMore: false,
|
|
571
579
|
fetchMoreError: err
|
|
@@ -576,9 +584,7 @@ var PaginatedResource = class {
|
|
|
576
584
|
const state = this.#signal.get();
|
|
577
585
|
if (!state.data?.cursor) return noop;
|
|
578
586
|
if (!this.#pendingFetchMore) {
|
|
579
|
-
this.#pendingFetchMore = this.#fetchMore()
|
|
580
|
-
this.#pendingFetchMore = null;
|
|
581
|
-
});
|
|
587
|
+
this.#pendingFetchMore = this.#fetchMore();
|
|
582
588
|
}
|
|
583
589
|
return this.#pendingFetchMore;
|
|
584
590
|
}
|
|
@@ -979,6 +985,16 @@ var UmbrellaStore = class {
|
|
|
979
985
|
#roomVersionsLastRequestedAtByRoom = /* @__PURE__ */ new Map();
|
|
980
986
|
// Notification Settings
|
|
981
987
|
#notificationSettings;
|
|
988
|
+
// Feeds
|
|
989
|
+
#feedsByRoomId = /* @__PURE__ */ new Map();
|
|
990
|
+
#feedMessagesByFeedId = /* @__PURE__ */ new Map();
|
|
991
|
+
// Signals for feeds and feed messages to trigger reactivity
|
|
992
|
+
#feedsSignal = new MutableSignal3({
|
|
993
|
+
version: 0
|
|
994
|
+
});
|
|
995
|
+
#feedMessagesSignal = new MutableSignal3({
|
|
996
|
+
version: 0
|
|
997
|
+
});
|
|
982
998
|
constructor(client) {
|
|
983
999
|
this.#client = client[kInternal2].as();
|
|
984
1000
|
this.optimisticUpdates = createStore_forOptimistic(this.#client);
|
|
@@ -1350,6 +1366,91 @@ var UmbrellaStore = class {
|
|
|
1350
1366
|
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1351
1367
|
}
|
|
1352
1368
|
);
|
|
1369
|
+
const loadingFeeds = new DefaultMap(
|
|
1370
|
+
(queryKey) => {
|
|
1371
|
+
const [roomId, options] = JSON.parse(queryKey);
|
|
1372
|
+
const resource = new PaginatedResource(async (cursor) => {
|
|
1373
|
+
const room = this.#client.getRoom(roomId);
|
|
1374
|
+
if (room === null) {
|
|
1375
|
+
throw new Error(
|
|
1376
|
+
`Room '${roomId}' is not available on client. Make sure you're calling useFeeds inside a RoomProvider.`
|
|
1377
|
+
);
|
|
1378
|
+
}
|
|
1379
|
+
const result = await room.fetchFeeds({
|
|
1380
|
+
cursor,
|
|
1381
|
+
since: options?.since,
|
|
1382
|
+
metadata: options?.metadata
|
|
1383
|
+
});
|
|
1384
|
+
this.upsertFeeds(roomId, result.feeds);
|
|
1385
|
+
return result.nextCursor ?? null;
|
|
1386
|
+
});
|
|
1387
|
+
const signal = DerivedSignal.from(
|
|
1388
|
+
resource.signal,
|
|
1389
|
+
this.#feedsSignal,
|
|
1390
|
+
(resourceResult, _signalState) => {
|
|
1391
|
+
if (resourceResult.isLoading || resourceResult.error) {
|
|
1392
|
+
return resourceResult;
|
|
1393
|
+
}
|
|
1394
|
+
const feedsMap = this.#feedsByRoomId.get(roomId);
|
|
1395
|
+
const feeds = feedsMap ? Array.from(feedsMap.values()) : [];
|
|
1396
|
+
const page = resourceResult.data;
|
|
1397
|
+
return {
|
|
1398
|
+
isLoading: false,
|
|
1399
|
+
feeds,
|
|
1400
|
+
hasFetchedAll: page.hasFetchedAll,
|
|
1401
|
+
isFetchingMore: page.isFetchingMore,
|
|
1402
|
+
fetchMoreError: page.fetchMoreError,
|
|
1403
|
+
fetchMore: page.fetchMore
|
|
1404
|
+
};
|
|
1405
|
+
},
|
|
1406
|
+
shallow2
|
|
1407
|
+
);
|
|
1408
|
+
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1409
|
+
}
|
|
1410
|
+
);
|
|
1411
|
+
const loadingFeedMessages = new DefaultMap(
|
|
1412
|
+
(queryKey) => {
|
|
1413
|
+
const [roomId, feedId, options] = JSON.parse(queryKey);
|
|
1414
|
+
const resource = new PaginatedResource(async (cursor) => {
|
|
1415
|
+
const room = this.#client.getRoom(roomId);
|
|
1416
|
+
if (room === null) {
|
|
1417
|
+
throw new Error(
|
|
1418
|
+
`Room '${roomId}' is not available on client. Make sure you're calling useFeedMessages inside a RoomProvider.`
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
const result = await room.fetchFeedMessages(feedId, {
|
|
1422
|
+
cursor,
|
|
1423
|
+
limit: options?.limit
|
|
1424
|
+
});
|
|
1425
|
+
this.upsertFeedMessages(roomId, feedId, result.messages);
|
|
1426
|
+
return result.nextCursor ?? null;
|
|
1427
|
+
});
|
|
1428
|
+
const signal = DerivedSignal.from(
|
|
1429
|
+
resource.signal,
|
|
1430
|
+
this.#feedMessagesSignal,
|
|
1431
|
+
(resourceResult, _signalState) => {
|
|
1432
|
+
if (resourceResult.isLoading || resourceResult.error) {
|
|
1433
|
+
return resourceResult;
|
|
1434
|
+
}
|
|
1435
|
+
const messagesMap = this.#feedMessagesByFeedId.get(feedId);
|
|
1436
|
+
const messages = messagesMap ? Array.from(messagesMap.values()).sort(
|
|
1437
|
+
(a, b) => a.timestamp - b.timestamp
|
|
1438
|
+
) : [];
|
|
1439
|
+
const page = resourceResult.data;
|
|
1440
|
+
return {
|
|
1441
|
+
isLoading: false,
|
|
1442
|
+
messages,
|
|
1443
|
+
hasFetchedAll: page.hasFetchedAll,
|
|
1444
|
+
isFetchingMore: page.isFetchingMore,
|
|
1445
|
+
fetchMoreError: page.fetchMoreError,
|
|
1446
|
+
fetchMore: page.fetchMore
|
|
1447
|
+
};
|
|
1448
|
+
},
|
|
1449
|
+
shallow2
|
|
1450
|
+
);
|
|
1451
|
+
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1452
|
+
}
|
|
1453
|
+
);
|
|
1353
1454
|
this.outputs = {
|
|
1354
1455
|
threadifications,
|
|
1355
1456
|
threads,
|
|
@@ -1365,7 +1466,9 @@ var UmbrellaStore = class {
|
|
|
1365
1466
|
aiChats,
|
|
1366
1467
|
messagesByChatId,
|
|
1367
1468
|
aiChatById,
|
|
1368
|
-
urlMetadataByUrl
|
|
1469
|
+
urlMetadataByUrl,
|
|
1470
|
+
loadingFeeds,
|
|
1471
|
+
loadingFeedMessages
|
|
1369
1472
|
};
|
|
1370
1473
|
autobind(this);
|
|
1371
1474
|
}
|
|
@@ -1586,6 +1689,64 @@ var UmbrellaStore = class {
|
|
|
1586
1689
|
result.subscriptions.deleted
|
|
1587
1690
|
);
|
|
1588
1691
|
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Upserts feeds in the cache (for list/added/updated operations).
|
|
1694
|
+
*/
|
|
1695
|
+
upsertFeeds(roomId, feeds) {
|
|
1696
|
+
let feedsMap = this.#feedsByRoomId.get(roomId);
|
|
1697
|
+
if (!feedsMap) {
|
|
1698
|
+
feedsMap = /* @__PURE__ */ new Map();
|
|
1699
|
+
this.#feedsByRoomId.set(roomId, feedsMap);
|
|
1700
|
+
}
|
|
1701
|
+
for (const feed of feeds) {
|
|
1702
|
+
feedsMap.set(feed.feedId, feed);
|
|
1703
|
+
}
|
|
1704
|
+
this.#feedsSignal.mutate((state) => {
|
|
1705
|
+
state.version++;
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Removes feeds from the cache (for deleted operations).
|
|
1710
|
+
*/
|
|
1711
|
+
deleteFeeds(roomId, feeds) {
|
|
1712
|
+
const feedsMap = this.#feedsByRoomId.get(roomId);
|
|
1713
|
+
if (!feedsMap) return;
|
|
1714
|
+
for (const feed of feeds) {
|
|
1715
|
+
feedsMap.delete(feed.feedId);
|
|
1716
|
+
}
|
|
1717
|
+
this.#feedsSignal.mutate((state) => {
|
|
1718
|
+
state.version++;
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* Upserts feed messages in the cache (for list/added/updated operations).
|
|
1723
|
+
*/
|
|
1724
|
+
upsertFeedMessages(_roomId, feedId, messages) {
|
|
1725
|
+
let messagesMap = this.#feedMessagesByFeedId.get(feedId);
|
|
1726
|
+
if (!messagesMap) {
|
|
1727
|
+
messagesMap = /* @__PURE__ */ new Map();
|
|
1728
|
+
this.#feedMessagesByFeedId.set(feedId, messagesMap);
|
|
1729
|
+
}
|
|
1730
|
+
for (const message of messages) {
|
|
1731
|
+
messagesMap.set(message.id, message);
|
|
1732
|
+
}
|
|
1733
|
+
this.#feedMessagesSignal.mutate((state) => {
|
|
1734
|
+
state.version++;
|
|
1735
|
+
});
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* Removes feed messages from the cache (for deleted operations).
|
|
1739
|
+
*/
|
|
1740
|
+
deleteFeedMessages(_roomId, feedId, messages) {
|
|
1741
|
+
const messagesMap = this.#feedMessagesByFeedId.get(feedId);
|
|
1742
|
+
if (!messagesMap) return;
|
|
1743
|
+
for (const message of messages) {
|
|
1744
|
+
messagesMap.delete(message.id);
|
|
1745
|
+
}
|
|
1746
|
+
this.#feedMessagesSignal.mutate((state) => {
|
|
1747
|
+
state.version++;
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1589
1750
|
async fetchUnreadNotificationsCount(queryKey, signal) {
|
|
1590
1751
|
const query = JSON.parse(queryKey);
|
|
1591
1752
|
const result = await this.#client.getUnreadInboxNotificationsCount({
|
|
@@ -3358,7 +3519,6 @@ import {
|
|
|
3358
3519
|
stableStringify as stableStringify2
|
|
3359
3520
|
} from "@liveblocks/core";
|
|
3360
3521
|
import {
|
|
3361
|
-
createContext as createContext2,
|
|
3362
3522
|
useCallback as useCallback3,
|
|
3363
3523
|
useEffect as useEffect6,
|
|
3364
3524
|
useMemo as useMemo4,
|
|
@@ -3449,6 +3609,15 @@ function getCurrentUserId(client) {
|
|
|
3449
3609
|
return userId;
|
|
3450
3610
|
}
|
|
3451
3611
|
var _extras2 = /* @__PURE__ */ new WeakMap();
|
|
3612
|
+
var _bundles2 = /* @__PURE__ */ new WeakMap();
|
|
3613
|
+
function getOrCreateRoomContextBundle(client) {
|
|
3614
|
+
let bundle = _bundles2.get(client);
|
|
3615
|
+
if (!bundle) {
|
|
3616
|
+
bundle = makeRoomContextBundle(client);
|
|
3617
|
+
_bundles2.set(client, bundle);
|
|
3618
|
+
}
|
|
3619
|
+
return bundle;
|
|
3620
|
+
}
|
|
3452
3621
|
function getRoomExtrasForClient(client) {
|
|
3453
3622
|
let extras = _extras2.get(client);
|
|
3454
3623
|
if (!extras) {
|
|
@@ -3536,6 +3705,130 @@ function makeRoomExtrasForClient(client) {
|
|
|
3536
3705
|
)
|
|
3537
3706
|
};
|
|
3538
3707
|
}
|
|
3708
|
+
function makeRoomContextBundle(client) {
|
|
3709
|
+
function RoomProvider_withImplicitLiveblocksProvider(props) {
|
|
3710
|
+
return /* @__PURE__ */ jsx2(LiveblocksProviderWithClient, { client, allowNesting: true, children: /* @__PURE__ */ jsx2(RoomProvider, { ...props }) });
|
|
3711
|
+
}
|
|
3712
|
+
const shared = createSharedContext(client);
|
|
3713
|
+
const bundle = {
|
|
3714
|
+
RoomContext,
|
|
3715
|
+
RoomProvider: RoomProvider_withImplicitLiveblocksProvider,
|
|
3716
|
+
useRoom,
|
|
3717
|
+
useStatus,
|
|
3718
|
+
useBroadcastEvent,
|
|
3719
|
+
useOthersListener,
|
|
3720
|
+
useLostConnectionListener,
|
|
3721
|
+
useEventListener,
|
|
3722
|
+
useHistory,
|
|
3723
|
+
useUndo,
|
|
3724
|
+
useRedo,
|
|
3725
|
+
useCanRedo,
|
|
3726
|
+
useCanUndo,
|
|
3727
|
+
useStorageRoot,
|
|
3728
|
+
useStorage,
|
|
3729
|
+
useSelf,
|
|
3730
|
+
useMyPresence,
|
|
3731
|
+
useUpdateMyPresence,
|
|
3732
|
+
useOthers,
|
|
3733
|
+
useOthersMapped,
|
|
3734
|
+
useOthersConnectionIds,
|
|
3735
|
+
useOther,
|
|
3736
|
+
// prettier-ignore
|
|
3737
|
+
useMutation,
|
|
3738
|
+
useThreads,
|
|
3739
|
+
useFeeds,
|
|
3740
|
+
useFeedMessages,
|
|
3741
|
+
useCreateFeed,
|
|
3742
|
+
useDeleteFeed,
|
|
3743
|
+
useUpdateFeedMetadata,
|
|
3744
|
+
useCreateFeedMessage,
|
|
3745
|
+
useDeleteFeedMessage,
|
|
3746
|
+
useUpdateFeedMessage,
|
|
3747
|
+
useSearchComments,
|
|
3748
|
+
// prettier-ignore
|
|
3749
|
+
useCreateThread,
|
|
3750
|
+
useDeleteThread,
|
|
3751
|
+
useEditThreadMetadata,
|
|
3752
|
+
useMarkThreadAsResolved,
|
|
3753
|
+
useMarkThreadAsUnresolved,
|
|
3754
|
+
useSubscribeToThread,
|
|
3755
|
+
useUnsubscribeFromThread,
|
|
3756
|
+
useCreateComment,
|
|
3757
|
+
useEditComment,
|
|
3758
|
+
useEditCommentMetadata,
|
|
3759
|
+
useDeleteComment,
|
|
3760
|
+
useAddReaction,
|
|
3761
|
+
useRemoveReaction,
|
|
3762
|
+
useMarkThreadAsRead,
|
|
3763
|
+
useThreadSubscription,
|
|
3764
|
+
useAttachmentUrl,
|
|
3765
|
+
useHistoryVersions,
|
|
3766
|
+
useHistoryVersionData,
|
|
3767
|
+
useRoomSubscriptionSettings,
|
|
3768
|
+
useUpdateRoomSubscriptionSettings,
|
|
3769
|
+
...shared.classic,
|
|
3770
|
+
suspense: {
|
|
3771
|
+
RoomContext,
|
|
3772
|
+
RoomProvider: RoomProvider_withImplicitLiveblocksProvider,
|
|
3773
|
+
useRoom,
|
|
3774
|
+
useStatus,
|
|
3775
|
+
useBroadcastEvent,
|
|
3776
|
+
useOthersListener,
|
|
3777
|
+
useLostConnectionListener,
|
|
3778
|
+
useEventListener,
|
|
3779
|
+
useHistory,
|
|
3780
|
+
useUndo,
|
|
3781
|
+
useRedo,
|
|
3782
|
+
useCanRedo,
|
|
3783
|
+
useCanUndo,
|
|
3784
|
+
useStorageRoot,
|
|
3785
|
+
useStorage: useStorageSuspense,
|
|
3786
|
+
useSelf: useSelfSuspense,
|
|
3787
|
+
useMyPresence,
|
|
3788
|
+
useUpdateMyPresence,
|
|
3789
|
+
useOthers: useOthersSuspense,
|
|
3790
|
+
useOthersMapped: useOthersMappedSuspense,
|
|
3791
|
+
useOthersConnectionIds: useOthersConnectionIdsSuspense,
|
|
3792
|
+
useOther: useOtherSuspense,
|
|
3793
|
+
// prettier-ignore
|
|
3794
|
+
useMutation,
|
|
3795
|
+
useThreads: useThreadsSuspense,
|
|
3796
|
+
useFeeds: useFeedsSuspense,
|
|
3797
|
+
useFeedMessages: useFeedMessagesSuspense,
|
|
3798
|
+
useCreateFeed,
|
|
3799
|
+
useDeleteFeed,
|
|
3800
|
+
useUpdateFeedMetadata,
|
|
3801
|
+
useCreateFeedMessage,
|
|
3802
|
+
useDeleteFeedMessage,
|
|
3803
|
+
useUpdateFeedMessage,
|
|
3804
|
+
// prettier-ignore
|
|
3805
|
+
useCreateThread,
|
|
3806
|
+
useDeleteThread,
|
|
3807
|
+
useEditThreadMetadata,
|
|
3808
|
+
useMarkThreadAsResolved,
|
|
3809
|
+
useMarkThreadAsUnresolved,
|
|
3810
|
+
useSubscribeToThread,
|
|
3811
|
+
useUnsubscribeFromThread,
|
|
3812
|
+
useCreateComment,
|
|
3813
|
+
useEditComment,
|
|
3814
|
+
useEditCommentMetadata,
|
|
3815
|
+
useDeleteComment,
|
|
3816
|
+
useAddReaction,
|
|
3817
|
+
useRemoveReaction,
|
|
3818
|
+
useMarkThreadAsRead,
|
|
3819
|
+
useThreadSubscription,
|
|
3820
|
+
useAttachmentUrl: useAttachmentUrlSuspense,
|
|
3821
|
+
// TODO: useHistoryVersionData: useHistoryVersionDataSuspense,
|
|
3822
|
+
useHistoryVersions: useHistoryVersionsSuspense,
|
|
3823
|
+
useRoomSubscriptionSettings: useRoomSubscriptionSettingsSuspense,
|
|
3824
|
+
useUpdateRoomSubscriptionSettings,
|
|
3825
|
+
...shared.suspense
|
|
3826
|
+
}
|
|
3827
|
+
};
|
|
3828
|
+
return Object.defineProperty(bundle, kInternal4, {
|
|
3829
|
+
enumerable: false
|
|
3830
|
+
});
|
|
3831
|
+
}
|
|
3539
3832
|
function RoomProvider(props) {
|
|
3540
3833
|
const client = useClient();
|
|
3541
3834
|
const [cache] = useState3(
|
|
@@ -3566,7 +3859,7 @@ function RoomProvider(props) {
|
|
|
3566
3859
|
}
|
|
3567
3860
|
function RoomProviderInner(props) {
|
|
3568
3861
|
const client = useClient();
|
|
3569
|
-
const { id: roomId, stableEnterRoom
|
|
3862
|
+
const { id: roomId, stableEnterRoom } = props;
|
|
3570
3863
|
if (process.env.NODE_ENV !== "production") {
|
|
3571
3864
|
if (!roomId) {
|
|
3572
3865
|
throw new Error(
|
|
@@ -3647,6 +3940,33 @@ function RoomProviderInner(props) {
|
|
|
3647
3940
|
(message) => void handleCommentEvent(message)
|
|
3648
3941
|
);
|
|
3649
3942
|
}, [client, room]);
|
|
3943
|
+
useEffect6(() => {
|
|
3944
|
+
const { store } = getRoomExtrasForClient(client);
|
|
3945
|
+
function handleFeedEvent(message) {
|
|
3946
|
+
switch (message.type) {
|
|
3947
|
+
case ServerMsgCode.FEEDS_ADDED:
|
|
3948
|
+
case ServerMsgCode.FEEDS_UPDATED:
|
|
3949
|
+
store.upsertFeeds(room.id, message.feeds);
|
|
3950
|
+
break;
|
|
3951
|
+
case ServerMsgCode.FEEDS_DELETED:
|
|
3952
|
+
store.deleteFeeds(room.id, message.feeds);
|
|
3953
|
+
break;
|
|
3954
|
+
case ServerMsgCode.FEED_MESSAGES_ADDED:
|
|
3955
|
+
case ServerMsgCode.FEED_MESSAGES_UPDATED:
|
|
3956
|
+
store.upsertFeedMessages(room.id, message.feedId, message.messages);
|
|
3957
|
+
break;
|
|
3958
|
+
case ServerMsgCode.FEED_MESSAGES_DELETED:
|
|
3959
|
+
store.deleteFeedMessages(room.id, message.feedId, message.messages);
|
|
3960
|
+
break;
|
|
3961
|
+
// FEEDS_LIST and FEED_MESSAGES_LIST are handled by fetch promise resolution in room.ts
|
|
3962
|
+
default:
|
|
3963
|
+
break;
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
return room.events.feeds.subscribe(
|
|
3967
|
+
(message) => void handleFeedEvent(message)
|
|
3968
|
+
);
|
|
3969
|
+
}, [client, room]);
|
|
3650
3970
|
useEffect6(() => {
|
|
3651
3971
|
const pair = stableEnterRoom(roomId, frozenProps);
|
|
3652
3972
|
setRoomLeavePair(pair);
|
|
@@ -3658,31 +3978,22 @@ function RoomProviderInner(props) {
|
|
|
3658
3978
|
leave();
|
|
3659
3979
|
};
|
|
3660
3980
|
}, [roomId, frozenProps, stableEnterRoom]);
|
|
3661
|
-
return /* @__PURE__ */ jsx2(
|
|
3981
|
+
return /* @__PURE__ */ jsx2(RoomContext.Provider, { value: room, children: props.children });
|
|
3662
3982
|
}
|
|
3663
|
-
function
|
|
3664
|
-
const room = useRoomOrNull(
|
|
3983
|
+
function useRoom(options) {
|
|
3984
|
+
const room = useRoomOrNull();
|
|
3665
3985
|
if (room === null && !options?.allowOutsideRoom) {
|
|
3666
3986
|
throw new Error("RoomProvider is missing from the React tree.");
|
|
3667
3987
|
}
|
|
3668
3988
|
return room;
|
|
3669
3989
|
}
|
|
3670
|
-
function
|
|
3671
|
-
|
|
3672
|
-
GlobalRoomContext,
|
|
3673
|
-
options
|
|
3674
|
-
);
|
|
3675
|
-
}
|
|
3676
|
-
function useStatus_withRoomContext(RoomContext) {
|
|
3677
|
-
const room = useRoom_withRoomContext(RoomContext);
|
|
3990
|
+
function useStatus() {
|
|
3991
|
+
const room = useRoom();
|
|
3678
3992
|
const subscribe = room.events.status.subscribe;
|
|
3679
3993
|
const getSnapshot = room.getStatus;
|
|
3680
3994
|
const getServerSnapshot = room.getStatus;
|
|
3681
3995
|
return useSyncExternalStore3(subscribe, getSnapshot, getServerSnapshot);
|
|
3682
3996
|
}
|
|
3683
|
-
function useStatus() {
|
|
3684
|
-
return useStatus_withRoomContext(GlobalRoomContext);
|
|
3685
|
-
}
|
|
3686
3997
|
function useReportTextEditor(editor, rootKey) {
|
|
3687
3998
|
const isReported = useRef3(false);
|
|
3688
3999
|
const room = useRoom();
|
|
@@ -3745,10 +4056,8 @@ function useMentionSuggestionsCache() {
|
|
|
3745
4056
|
const client = useClient();
|
|
3746
4057
|
return client[kInternal4].mentionSuggestionsCache;
|
|
3747
4058
|
}
|
|
3748
|
-
function
|
|
3749
|
-
const room =
|
|
3750
|
-
RoomContext
|
|
3751
|
-
);
|
|
4059
|
+
function useBroadcastEvent() {
|
|
4060
|
+
const room = useRoom();
|
|
3752
4061
|
return useCallback3(
|
|
3753
4062
|
(event, options = { shouldQueueEventIfNotReady: false }) => {
|
|
3754
4063
|
room.broadcastEvent(event, options);
|
|
@@ -3756,24 +4065,16 @@ function useBroadcastEvent_withRoomContext(RoomContext) {
|
|
|
3756
4065
|
[room]
|
|
3757
4066
|
);
|
|
3758
4067
|
}
|
|
3759
|
-
function
|
|
3760
|
-
|
|
3761
|
-
}
|
|
3762
|
-
function useOthersListener_withRoomContext(RoomContext, callback) {
|
|
3763
|
-
const room = useRoom_withRoomContext(
|
|
3764
|
-
RoomContext
|
|
3765
|
-
);
|
|
4068
|
+
function useOthersListener(callback) {
|
|
4069
|
+
const room = useRoom();
|
|
3766
4070
|
const savedCallback = useLatest(callback);
|
|
3767
4071
|
useEffect6(
|
|
3768
4072
|
() => room.events.others.subscribe((event) => savedCallback.current(event)),
|
|
3769
4073
|
[room, savedCallback]
|
|
3770
4074
|
);
|
|
3771
4075
|
}
|
|
3772
|
-
function
|
|
3773
|
-
|
|
3774
|
-
}
|
|
3775
|
-
function useLostConnectionListener_withRoomContext(RoomContext, callback) {
|
|
3776
|
-
const room = useRoom_withRoomContext(RoomContext);
|
|
4076
|
+
function useLostConnectionListener(callback) {
|
|
4077
|
+
const room = useRoom();
|
|
3777
4078
|
const savedCallback = useLatest(callback);
|
|
3778
4079
|
useEffect6(
|
|
3779
4080
|
() => room.events.lostConnection.subscribe(
|
|
@@ -3782,13 +4083,8 @@ function useLostConnectionListener_withRoomContext(RoomContext, callback) {
|
|
|
3782
4083
|
[room, savedCallback]
|
|
3783
4084
|
);
|
|
3784
4085
|
}
|
|
3785
|
-
function
|
|
3786
|
-
|
|
3787
|
-
}
|
|
3788
|
-
function useEventListener_withRoomContext(RoomContext, callback) {
|
|
3789
|
-
const room = useRoom_withRoomContext(
|
|
3790
|
-
RoomContext
|
|
3791
|
-
);
|
|
4086
|
+
function useEventListener(callback) {
|
|
4087
|
+
const room = useRoom();
|
|
3792
4088
|
const savedCallback = useLatest(callback);
|
|
3793
4089
|
useEffect6(() => {
|
|
3794
4090
|
const listener = (eventData) => {
|
|
@@ -3797,49 +4093,29 @@ function useEventListener_withRoomContext(RoomContext, callback) {
|
|
|
3797
4093
|
return room.events.customEvent.subscribe(listener);
|
|
3798
4094
|
}, [room, savedCallback]);
|
|
3799
4095
|
}
|
|
3800
|
-
function useEventListener(callback) {
|
|
3801
|
-
return useEventListener_withRoomContext(GlobalRoomContext, callback);
|
|
3802
|
-
}
|
|
3803
|
-
function useHistory_withRoomContext(RoomContext) {
|
|
3804
|
-
return useRoom_withRoomContext(RoomContext).history;
|
|
3805
|
-
}
|
|
3806
4096
|
function useHistory() {
|
|
3807
|
-
return
|
|
3808
|
-
}
|
|
3809
|
-
function useUndo_withRoomContext(RoomContext) {
|
|
3810
|
-
return useHistory_withRoomContext(RoomContext).undo;
|
|
4097
|
+
return useRoom().history;
|
|
3811
4098
|
}
|
|
3812
4099
|
function useUndo() {
|
|
3813
|
-
return
|
|
3814
|
-
}
|
|
3815
|
-
function useRedo_withRoomContext(RoomContext) {
|
|
3816
|
-
return useHistory_withRoomContext(RoomContext).redo;
|
|
4100
|
+
return useHistory().undo;
|
|
3817
4101
|
}
|
|
3818
4102
|
function useRedo() {
|
|
3819
|
-
return
|
|
4103
|
+
return useHistory().redo;
|
|
3820
4104
|
}
|
|
3821
|
-
function
|
|
3822
|
-
const room =
|
|
4105
|
+
function useCanUndo() {
|
|
4106
|
+
const room = useRoom();
|
|
3823
4107
|
const subscribe = room.events.history.subscribe;
|
|
3824
4108
|
const canUndo = room.history.canUndo;
|
|
3825
4109
|
return useSyncExternalStore3(subscribe, canUndo, canUndo);
|
|
3826
4110
|
}
|
|
3827
|
-
function
|
|
3828
|
-
|
|
3829
|
-
}
|
|
3830
|
-
function useCanRedo_withRoomContext(RoomContext) {
|
|
3831
|
-
const room = useRoom_withRoomContext(RoomContext);
|
|
4111
|
+
function useCanRedo() {
|
|
4112
|
+
const room = useRoom();
|
|
3832
4113
|
const subscribe = room.events.history.subscribe;
|
|
3833
4114
|
const canRedo = room.history.canRedo;
|
|
3834
4115
|
return useSyncExternalStore3(subscribe, canRedo, canRedo);
|
|
3835
4116
|
}
|
|
3836
|
-
function
|
|
3837
|
-
|
|
3838
|
-
}
|
|
3839
|
-
function useSelf_withRoomContext(RoomContext, maybeSelector, isEqual) {
|
|
3840
|
-
const room = useRoom_withRoomContext(
|
|
3841
|
-
RoomContext
|
|
3842
|
-
);
|
|
4117
|
+
function useSelf(maybeSelector, isEqual) {
|
|
4118
|
+
const room = useRoom();
|
|
3843
4119
|
const subscribe = room.events.self.subscribe;
|
|
3844
4120
|
const getSnapshot = room.getSelf;
|
|
3845
4121
|
const selector = maybeSelector ?? identity3;
|
|
@@ -3856,38 +4132,19 @@ function useSelf_withRoomContext(RoomContext, maybeSelector, isEqual) {
|
|
|
3856
4132
|
isEqual
|
|
3857
4133
|
);
|
|
3858
4134
|
}
|
|
3859
|
-
function
|
|
3860
|
-
|
|
3861
|
-
GlobalRoomContext,
|
|
3862
|
-
maybeSelector,
|
|
3863
|
-
isEqual
|
|
3864
|
-
);
|
|
3865
|
-
}
|
|
3866
|
-
function useMyPresence_withRoomContext(RoomContext) {
|
|
3867
|
-
const room = useRoom_withRoomContext(
|
|
3868
|
-
RoomContext
|
|
3869
|
-
);
|
|
4135
|
+
function useMyPresence() {
|
|
4136
|
+
const room = useRoom();
|
|
3870
4137
|
const subscribe = room.events.myPresence.subscribe;
|
|
3871
4138
|
const getSnapshot = room.getPresence;
|
|
3872
4139
|
const presence = useSyncExternalStore3(subscribe, getSnapshot, getSnapshot);
|
|
3873
4140
|
const setPresence = room.updatePresence;
|
|
3874
4141
|
return [presence, setPresence];
|
|
3875
4142
|
}
|
|
3876
|
-
function useMyPresence() {
|
|
3877
|
-
return useMyPresence_withRoomContext(GlobalRoomContext);
|
|
3878
|
-
}
|
|
3879
|
-
function useUpdateMyPresence_withRoomContext(RoomContext) {
|
|
3880
|
-
return useRoom_withRoomContext(
|
|
3881
|
-
RoomContext
|
|
3882
|
-
).updatePresence;
|
|
3883
|
-
}
|
|
3884
4143
|
function useUpdateMyPresence() {
|
|
3885
|
-
return
|
|
4144
|
+
return useRoom().updatePresence;
|
|
3886
4145
|
}
|
|
3887
|
-
function
|
|
3888
|
-
const room =
|
|
3889
|
-
RoomContext
|
|
3890
|
-
);
|
|
4146
|
+
function useOthers(selector, isEqual) {
|
|
4147
|
+
const room = useRoom();
|
|
3891
4148
|
const subscribe = room.events.others.subscribe;
|
|
3892
4149
|
const getSnapshot = room.getOthers;
|
|
3893
4150
|
const getServerSnapshot = alwaysEmptyList;
|
|
@@ -3899,14 +4156,7 @@ function useOthers_withRoomContext(RoomContext, selector, isEqual) {
|
|
|
3899
4156
|
isEqual
|
|
3900
4157
|
);
|
|
3901
4158
|
}
|
|
3902
|
-
function
|
|
3903
|
-
return useOthers_withRoomContext(
|
|
3904
|
-
GlobalRoomContext,
|
|
3905
|
-
selector,
|
|
3906
|
-
isEqual
|
|
3907
|
-
);
|
|
3908
|
-
}
|
|
3909
|
-
function useOthersMapped_withRoomContext(RoomContext, itemSelector, itemIsEqual) {
|
|
4159
|
+
function useOthersMapped(itemSelector, itemIsEqual) {
|
|
3910
4160
|
const wrappedSelector = useCallback3(
|
|
3911
4161
|
(others) => others.map((other) => [other.connectionId, itemSelector(other)]),
|
|
3912
4162
|
[itemSelector]
|
|
@@ -3921,31 +4171,13 @@ function useOthersMapped_withRoomContext(RoomContext, itemSelector, itemIsEqual)
|
|
|
3921
4171
|
},
|
|
3922
4172
|
[itemIsEqual]
|
|
3923
4173
|
);
|
|
3924
|
-
return
|
|
3925
|
-
RoomContext,
|
|
3926
|
-
wrappedSelector,
|
|
3927
|
-
wrappedIsEqual
|
|
3928
|
-
);
|
|
3929
|
-
}
|
|
3930
|
-
function useOthersMapped(itemSelector, itemIsEqual) {
|
|
3931
|
-
return useOthersMapped_withRoomContext(
|
|
3932
|
-
GlobalRoomContext,
|
|
3933
|
-
itemSelector,
|
|
3934
|
-
itemIsEqual
|
|
3935
|
-
);
|
|
3936
|
-
}
|
|
3937
|
-
function useOthersConnectionIds_withRoomContext(RoomContext) {
|
|
3938
|
-
return useOthers_withRoomContext(
|
|
3939
|
-
RoomContext,
|
|
3940
|
-
selectorFor_useOthersConnectionIds,
|
|
3941
|
-
shallow4
|
|
3942
|
-
);
|
|
4174
|
+
return useOthers(wrappedSelector, wrappedIsEqual);
|
|
3943
4175
|
}
|
|
3944
4176
|
function useOthersConnectionIds() {
|
|
3945
|
-
return
|
|
4177
|
+
return useOthers(selectorFor_useOthersConnectionIds, shallow4);
|
|
3946
4178
|
}
|
|
3947
4179
|
var NOT_FOUND = Symbol();
|
|
3948
|
-
function
|
|
4180
|
+
function useOther(connectionId, selector, isEqual) {
|
|
3949
4181
|
const wrappedSelector = useCallback3(
|
|
3950
4182
|
(others) => {
|
|
3951
4183
|
const other2 = others.find((other3) => other3.connectionId === connectionId);
|
|
@@ -3963,11 +4195,7 @@ function useOther_withRoomContext(RoomContext, connectionId, selector, isEqual)
|
|
|
3963
4195
|
},
|
|
3964
4196
|
[isEqual]
|
|
3965
4197
|
);
|
|
3966
|
-
const other =
|
|
3967
|
-
RoomContext,
|
|
3968
|
-
wrappedSelector,
|
|
3969
|
-
wrappedIsEqual
|
|
3970
|
-
);
|
|
4198
|
+
const other = useOthers(wrappedSelector, wrappedIsEqual);
|
|
3971
4199
|
if (other === NOT_FOUND) {
|
|
3972
4200
|
throw new Error(
|
|
3973
4201
|
`No such other user with connection id ${connectionId} exists`
|
|
@@ -3975,34 +4203,19 @@ function useOther_withRoomContext(RoomContext, connectionId, selector, isEqual)
|
|
|
3975
4203
|
}
|
|
3976
4204
|
return other;
|
|
3977
4205
|
}
|
|
3978
|
-
function
|
|
3979
|
-
|
|
3980
|
-
GlobalRoomContext,
|
|
3981
|
-
connectionId,
|
|
3982
|
-
selector,
|
|
3983
|
-
isEqual
|
|
3984
|
-
);
|
|
3985
|
-
}
|
|
3986
|
-
function useMutableStorageRoot_withRoomContext(RoomContext) {
|
|
3987
|
-
const room = useRoom_withRoomContext(
|
|
3988
|
-
RoomContext
|
|
3989
|
-
);
|
|
4206
|
+
function useMutableStorageRoot() {
|
|
4207
|
+
const room = useRoom();
|
|
3990
4208
|
const subscribe = room.events.storageDidLoad.subscribeOnce;
|
|
3991
4209
|
const getSnapshot = room.getStorageSnapshot;
|
|
3992
4210
|
const getServerSnapshot = alwaysNull;
|
|
3993
4211
|
return useSyncExternalStore3(subscribe, getSnapshot, getServerSnapshot);
|
|
3994
4212
|
}
|
|
3995
|
-
function useStorageRoot_withRoomContext(RoomContext) {
|
|
3996
|
-
return [useMutableStorageRoot_withRoomContext(RoomContext)];
|
|
3997
|
-
}
|
|
3998
4213
|
function useStorageRoot() {
|
|
3999
|
-
return
|
|
4214
|
+
return [useMutableStorageRoot()];
|
|
4000
4215
|
}
|
|
4001
|
-
function
|
|
4002
|
-
const room =
|
|
4003
|
-
|
|
4004
|
-
);
|
|
4005
|
-
const rootOrNull = useMutableStorageRoot_withRoomContext(RoomContext);
|
|
4216
|
+
function useStorage(selector, isEqual) {
|
|
4217
|
+
const room = useRoom();
|
|
4218
|
+
const rootOrNull = useMutableStorageRoot();
|
|
4006
4219
|
const wrappedSelector = useCallback3(
|
|
4007
4220
|
(rootOrNull2) => rootOrNull2 !== null ? selector(rootOrNull2) : null,
|
|
4008
4221
|
[selector]
|
|
@@ -4029,11 +4242,8 @@ function useStorage_withRoomContext(RoomContext, selector, isEqual) {
|
|
|
4029
4242
|
isEqual
|
|
4030
4243
|
);
|
|
4031
4244
|
}
|
|
4032
|
-
function
|
|
4033
|
-
|
|
4034
|
-
}
|
|
4035
|
-
function useMutation_withRoomContext(RoomContext, callback, deps) {
|
|
4036
|
-
const room = useRoom_withRoomContext(RoomContext);
|
|
4245
|
+
function useMutation(callback, deps) {
|
|
4246
|
+
const room = useRoom();
|
|
4037
4247
|
return useMemo4(
|
|
4038
4248
|
() => {
|
|
4039
4249
|
return (...args) => (
|
|
@@ -4053,17 +4263,10 @@ function useMutation_withRoomContext(RoomContext, callback, deps) {
|
|
|
4053
4263
|
[room, ...deps]
|
|
4054
4264
|
);
|
|
4055
4265
|
}
|
|
4056
|
-
function
|
|
4057
|
-
return useMutation_withRoomContext(
|
|
4058
|
-
GlobalRoomContext,
|
|
4059
|
-
callback,
|
|
4060
|
-
deps
|
|
4061
|
-
);
|
|
4062
|
-
}
|
|
4063
|
-
function useThreads_withRoomContext(RoomContext, options = {}) {
|
|
4266
|
+
function useThreads(options = {}) {
|
|
4064
4267
|
const { scrollOnLoad = true } = options;
|
|
4065
4268
|
const client = useClient();
|
|
4066
|
-
const room =
|
|
4269
|
+
const room = useRoom();
|
|
4067
4270
|
const { store, getOrCreateThreadsPollerForRoomId } = getRoomExtrasForClient(client);
|
|
4068
4271
|
const queryKey = makeRoomThreadsQueryKey(room.id, options.query);
|
|
4069
4272
|
const poller = getOrCreateThreadsPollerForRoomId(room.id);
|
|
@@ -4089,17 +4292,100 @@ function useThreads_withRoomContext(RoomContext, options = {}) {
|
|
|
4089
4292
|
useScrollToCommentOnLoadEffect(scrollOnLoad, result);
|
|
4090
4293
|
return result;
|
|
4091
4294
|
}
|
|
4092
|
-
function
|
|
4093
|
-
|
|
4295
|
+
function useFeeds(options) {
|
|
4296
|
+
const room = useRoom();
|
|
4297
|
+
const client = useClient();
|
|
4298
|
+
const { store } = getRoomExtrasForClient(client);
|
|
4299
|
+
const queryKey = makeFeedsQueryKey(room.id, options);
|
|
4300
|
+
const loadableResource = store.outputs.loadingFeeds.getOrCreate(queryKey);
|
|
4301
|
+
useEffect6(() => {
|
|
4302
|
+
void loadableResource.waitUntilLoaded();
|
|
4303
|
+
});
|
|
4304
|
+
return useSignal(loadableResource.signal);
|
|
4094
4305
|
}
|
|
4095
|
-
function
|
|
4306
|
+
function useFeedMessages(feedId, options) {
|
|
4307
|
+
const room = useRoom();
|
|
4308
|
+
const client = useClient();
|
|
4309
|
+
const { store } = getRoomExtrasForClient(client);
|
|
4310
|
+
const queryKey = makeFeedMessagesQueryKey(room.id, feedId, options);
|
|
4311
|
+
useEffect6(() => {
|
|
4312
|
+
void store.outputs.loadingFeedMessages.getOrCreate(queryKey).waitUntilLoaded();
|
|
4313
|
+
});
|
|
4314
|
+
return useSignal(
|
|
4315
|
+
store.outputs.loadingFeedMessages.getOrCreate(queryKey).signal
|
|
4316
|
+
);
|
|
4317
|
+
}
|
|
4318
|
+
function useFeedsSuspense(options) {
|
|
4319
|
+
ensureNotServerSide();
|
|
4320
|
+
const client = useClient();
|
|
4321
|
+
const room = useRoom();
|
|
4322
|
+
const { store } = getRoomExtrasForClient(client);
|
|
4323
|
+
const queryKey = makeFeedsQueryKey(room.id, options);
|
|
4324
|
+
use(store.outputs.loadingFeeds.getOrCreate(queryKey).waitUntilLoaded());
|
|
4325
|
+
const result = useFeeds(options);
|
|
4326
|
+
assert2(!result.error, "Did not expect error");
|
|
4327
|
+
assert2(!result.isLoading, "Did not expect loading");
|
|
4328
|
+
return result;
|
|
4329
|
+
}
|
|
4330
|
+
function useFeedMessagesSuspense(feedId, options) {
|
|
4331
|
+
ensureNotServerSide();
|
|
4332
|
+
const client = useClient();
|
|
4333
|
+
const room = useRoom();
|
|
4334
|
+
const { store } = getRoomExtrasForClient(client);
|
|
4335
|
+
const queryKey = makeFeedMessagesQueryKey(room.id, feedId, options);
|
|
4336
|
+
use(store.outputs.loadingFeedMessages.getOrCreate(queryKey).waitUntilLoaded());
|
|
4337
|
+
const result = useFeedMessages(feedId, options);
|
|
4338
|
+
assert2(!result.error, "Did not expect error");
|
|
4339
|
+
assert2(!result.isLoading, "Did not expect loading");
|
|
4340
|
+
return result;
|
|
4341
|
+
}
|
|
4342
|
+
function useCreateFeed() {
|
|
4343
|
+
const room = useRoom();
|
|
4344
|
+
return useCallback3(
|
|
4345
|
+
(feedId, options) => room.addFeed(feedId, options),
|
|
4346
|
+
[room]
|
|
4347
|
+
);
|
|
4348
|
+
}
|
|
4349
|
+
function useDeleteFeed() {
|
|
4350
|
+
const room = useRoom();
|
|
4351
|
+
return useCallback3((feedId) => room.deleteFeed(feedId), [room]);
|
|
4352
|
+
}
|
|
4353
|
+
function useUpdateFeedMetadata() {
|
|
4354
|
+
const room = useRoom();
|
|
4355
|
+
return useCallback3(
|
|
4356
|
+
(feedId, metadata) => room.updateFeed(feedId, metadata),
|
|
4357
|
+
[room]
|
|
4358
|
+
);
|
|
4359
|
+
}
|
|
4360
|
+
function useCreateFeedMessage() {
|
|
4361
|
+
const room = useRoom();
|
|
4362
|
+
return useCallback3(
|
|
4363
|
+
(feedId, data, options) => room.addFeedMessage(feedId, data, options),
|
|
4364
|
+
[room]
|
|
4365
|
+
);
|
|
4366
|
+
}
|
|
4367
|
+
function useDeleteFeedMessage() {
|
|
4368
|
+
const room = useRoom();
|
|
4369
|
+
return useCallback3(
|
|
4370
|
+
(feedId, messageId) => room.deleteFeedMessage(feedId, messageId),
|
|
4371
|
+
[room]
|
|
4372
|
+
);
|
|
4373
|
+
}
|
|
4374
|
+
function useUpdateFeedMessage() {
|
|
4375
|
+
const room = useRoom();
|
|
4376
|
+
return useCallback3(
|
|
4377
|
+
(feedId, messageId, data) => room.updateFeedMessage(feedId, messageId, data),
|
|
4378
|
+
[room]
|
|
4379
|
+
);
|
|
4380
|
+
}
|
|
4381
|
+
function useSearchComments(options) {
|
|
4096
4382
|
const [result, setResult] = useState3({
|
|
4097
4383
|
isLoading: true
|
|
4098
4384
|
});
|
|
4099
4385
|
const currentRequestInfo = useRef3(null);
|
|
4100
4386
|
const timeout = useRef3(null);
|
|
4101
4387
|
const client = useClient();
|
|
4102
|
-
const room =
|
|
4388
|
+
const room = useRoom();
|
|
4103
4389
|
const queryKey = stableStringify2([room.id, options.query]);
|
|
4104
4390
|
useEffect6(() => {
|
|
4105
4391
|
const currentRequestId = (currentRequestInfo.current?.id ?? 0) + 1;
|
|
@@ -4143,14 +4429,8 @@ function useSearchComments_withRoomContext(RoomContext, options) {
|
|
|
4143
4429
|
}, [queryKey, client, room.id]);
|
|
4144
4430
|
return result;
|
|
4145
4431
|
}
|
|
4146
|
-
function useSearchComments(options) {
|
|
4147
|
-
return useSearchComments_withRoomContext(GlobalRoomContext, options);
|
|
4148
|
-
}
|
|
4149
|
-
function useCreateThread_withRoomContext(RoomContext) {
|
|
4150
|
-
return useCreateRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4151
|
-
}
|
|
4152
4432
|
function useCreateThread() {
|
|
4153
|
-
return
|
|
4433
|
+
return useCreateRoomThread(useRoom().id);
|
|
4154
4434
|
}
|
|
4155
4435
|
function useCreateRoomThread(roomId) {
|
|
4156
4436
|
const client = useClient();
|
|
@@ -4223,11 +4503,8 @@ function useCreateRoomThread(roomId) {
|
|
|
4223
4503
|
[client, roomId]
|
|
4224
4504
|
);
|
|
4225
4505
|
}
|
|
4226
|
-
function useDeleteThread_withRoomContext(RoomContext) {
|
|
4227
|
-
return useDeleteRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4228
|
-
}
|
|
4229
4506
|
function useDeleteThread() {
|
|
4230
|
-
return
|
|
4507
|
+
return useDeleteRoomThread(useRoom().id);
|
|
4231
4508
|
}
|
|
4232
4509
|
function useDeleteRoomThread(roomId) {
|
|
4233
4510
|
const client = useClient();
|
|
@@ -4259,11 +4536,8 @@ function useDeleteRoomThread(roomId) {
|
|
|
4259
4536
|
[client, roomId]
|
|
4260
4537
|
);
|
|
4261
4538
|
}
|
|
4262
|
-
function useEditThreadMetadata_withRoomContext(RoomContext) {
|
|
4263
|
-
return useEditRoomThreadMetadata(useRoom_withRoomContext(RoomContext).id);
|
|
4264
|
-
}
|
|
4265
4539
|
function useEditThreadMetadata() {
|
|
4266
|
-
return
|
|
4540
|
+
return useEditRoomThreadMetadata(useRoom().id);
|
|
4267
4541
|
}
|
|
4268
4542
|
function useEditRoomThreadMetadata(roomId) {
|
|
4269
4543
|
const client = useClient();
|
|
@@ -4302,13 +4576,8 @@ function useEditRoomThreadMetadata(roomId) {
|
|
|
4302
4576
|
[client, roomId]
|
|
4303
4577
|
);
|
|
4304
4578
|
}
|
|
4305
|
-
function useEditCommentMetadata_withRoomContext(RoomContext) {
|
|
4306
|
-
return useEditRoomCommentMetadata(
|
|
4307
|
-
useRoom_withRoomContext(RoomContext).id
|
|
4308
|
-
);
|
|
4309
|
-
}
|
|
4310
4579
|
function useEditCommentMetadata() {
|
|
4311
|
-
return
|
|
4580
|
+
return useEditRoomCommentMetadata(useRoom().id);
|
|
4312
4581
|
}
|
|
4313
4582
|
function useEditRoomCommentMetadata(roomId) {
|
|
4314
4583
|
const client = useClient();
|
|
@@ -4356,11 +4625,8 @@ function useEditRoomCommentMetadata(roomId) {
|
|
|
4356
4625
|
[client, roomId]
|
|
4357
4626
|
);
|
|
4358
4627
|
}
|
|
4359
|
-
function useCreateComment_withRoomContext(RoomContext) {
|
|
4360
|
-
return useCreateRoomComment(useRoom_withRoomContext(RoomContext).id);
|
|
4361
|
-
}
|
|
4362
4628
|
function useCreateComment() {
|
|
4363
|
-
return
|
|
4629
|
+
return useCreateRoomComment(useRoom().id);
|
|
4364
4630
|
}
|
|
4365
4631
|
function useCreateRoomComment(roomId) {
|
|
4366
4632
|
const client = useClient();
|
|
@@ -4418,11 +4684,8 @@ function useCreateRoomComment(roomId) {
|
|
|
4418
4684
|
[client, roomId]
|
|
4419
4685
|
);
|
|
4420
4686
|
}
|
|
4421
|
-
function useEditComment_withRoomContext(RoomContext) {
|
|
4422
|
-
return useEditRoomComment(useRoom_withRoomContext(RoomContext).id);
|
|
4423
|
-
}
|
|
4424
4687
|
function useEditComment() {
|
|
4425
|
-
return
|
|
4688
|
+
return useEditRoomComment(useRoom().id);
|
|
4426
4689
|
}
|
|
4427
4690
|
function useEditRoomComment(roomId) {
|
|
4428
4691
|
const client = useClient();
|
|
@@ -4495,11 +4758,8 @@ function useEditRoomComment(roomId) {
|
|
|
4495
4758
|
[client, roomId]
|
|
4496
4759
|
);
|
|
4497
4760
|
}
|
|
4498
|
-
function useDeleteComment_withRoomContext(RoomContext) {
|
|
4499
|
-
return useDeleteRoomComment(useRoom_withRoomContext(RoomContext).id);
|
|
4500
|
-
}
|
|
4501
4761
|
function useDeleteComment() {
|
|
4502
|
-
return
|
|
4762
|
+
return useDeleteRoomComment(useRoom().id);
|
|
4503
4763
|
}
|
|
4504
4764
|
function useDeleteRoomComment(roomId) {
|
|
4505
4765
|
const client = useClient();
|
|
@@ -4528,11 +4788,8 @@ function useDeleteRoomComment(roomId) {
|
|
|
4528
4788
|
[client, roomId]
|
|
4529
4789
|
);
|
|
4530
4790
|
}
|
|
4531
|
-
function useAddReaction_withRoomContext(RoomContext) {
|
|
4532
|
-
return useAddRoomCommentReaction(useRoom_withRoomContext(RoomContext).id);
|
|
4533
|
-
}
|
|
4534
4791
|
function useAddReaction() {
|
|
4535
|
-
return
|
|
4792
|
+
return useAddRoomCommentReaction(useRoom().id);
|
|
4536
4793
|
}
|
|
4537
4794
|
function useAddRoomCommentReaction(roomId) {
|
|
4538
4795
|
const client = useClient();
|
|
@@ -4577,11 +4834,8 @@ function useAddRoomCommentReaction(roomId) {
|
|
|
4577
4834
|
[client, roomId]
|
|
4578
4835
|
);
|
|
4579
4836
|
}
|
|
4580
|
-
function useRemoveReaction_withRoomContext(RoomContext) {
|
|
4581
|
-
return useRemoveRoomCommentReaction(useRoom_withRoomContext(RoomContext).id);
|
|
4582
|
-
}
|
|
4583
4837
|
function useRemoveReaction() {
|
|
4584
|
-
return
|
|
4838
|
+
return useRemoveRoomCommentReaction(useRoom().id);
|
|
4585
4839
|
}
|
|
4586
4840
|
function useRemoveRoomCommentReaction(roomId) {
|
|
4587
4841
|
const client = useClient();
|
|
@@ -4625,6 +4879,9 @@ function useRemoveRoomCommentReaction(roomId) {
|
|
|
4625
4879
|
[client, roomId]
|
|
4626
4880
|
);
|
|
4627
4881
|
}
|
|
4882
|
+
function useMarkThreadAsRead() {
|
|
4883
|
+
return useMarkRoomThreadAsRead(useRoom().id);
|
|
4884
|
+
}
|
|
4628
4885
|
function useMarkRoomThreadAsRead(roomId) {
|
|
4629
4886
|
const client = useClient();
|
|
4630
4887
|
return useCallback3(
|
|
@@ -4670,18 +4927,8 @@ function useMarkRoomThreadAsRead(roomId) {
|
|
|
4670
4927
|
[client, roomId]
|
|
4671
4928
|
);
|
|
4672
4929
|
}
|
|
4673
|
-
function useMarkThreadAsRead_withRoomContext(RoomContext) {
|
|
4674
|
-
const room = useRoom_withRoomContext(RoomContext);
|
|
4675
|
-
return useMarkRoomThreadAsRead(room.id);
|
|
4676
|
-
}
|
|
4677
|
-
function useMarkThreadAsRead() {
|
|
4678
|
-
return useMarkThreadAsRead_withRoomContext(GlobalRoomContext);
|
|
4679
|
-
}
|
|
4680
|
-
function useMarkThreadAsResolved_withRoomContext(RoomContext) {
|
|
4681
|
-
return useMarkRoomThreadAsResolved(useRoom_withRoomContext(RoomContext).id);
|
|
4682
|
-
}
|
|
4683
4930
|
function useMarkThreadAsResolved() {
|
|
4684
|
-
return
|
|
4931
|
+
return useMarkRoomThreadAsResolved(useRoom().id);
|
|
4685
4932
|
}
|
|
4686
4933
|
function useMarkRoomThreadAsResolved(roomId) {
|
|
4687
4934
|
const client = useClient();
|
|
@@ -4713,11 +4960,8 @@ function useMarkRoomThreadAsResolved(roomId) {
|
|
|
4713
4960
|
[client, roomId]
|
|
4714
4961
|
);
|
|
4715
4962
|
}
|
|
4716
|
-
function useMarkThreadAsUnresolved_withRoomContext(RoomContext) {
|
|
4717
|
-
return useMarkRoomThreadAsUnresolved(useRoom_withRoomContext(RoomContext).id);
|
|
4718
|
-
}
|
|
4719
4963
|
function useMarkThreadAsUnresolved() {
|
|
4720
|
-
return
|
|
4964
|
+
return useMarkRoomThreadAsUnresolved(useRoom().id);
|
|
4721
4965
|
}
|
|
4722
4966
|
function useMarkRoomThreadAsUnresolved(roomId) {
|
|
4723
4967
|
const client = useClient();
|
|
@@ -4749,11 +4993,8 @@ function useMarkRoomThreadAsUnresolved(roomId) {
|
|
|
4749
4993
|
[client, roomId]
|
|
4750
4994
|
);
|
|
4751
4995
|
}
|
|
4752
|
-
function useSubscribeToThread_withRoomContext(RoomContext) {
|
|
4753
|
-
return useSubscribeToRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4754
|
-
}
|
|
4755
4996
|
function useSubscribeToThread() {
|
|
4756
|
-
return
|
|
4997
|
+
return useSubscribeToRoomThread(useRoom().id);
|
|
4757
4998
|
}
|
|
4758
4999
|
function useSubscribeToRoomThread(roomId) {
|
|
4759
5000
|
const client = useClient();
|
|
@@ -4780,11 +5021,8 @@ function useSubscribeToRoomThread(roomId) {
|
|
|
4780
5021
|
[client, roomId]
|
|
4781
5022
|
);
|
|
4782
5023
|
}
|
|
4783
|
-
function useUnsubscribeFromThread_withRoomContext(RoomContext) {
|
|
4784
|
-
return useUnsubscribeFromRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4785
|
-
}
|
|
4786
5024
|
function useUnsubscribeFromThread() {
|
|
4787
|
-
return
|
|
5025
|
+
return useUnsubscribeFromRoomThread(useRoom().id);
|
|
4788
5026
|
}
|
|
4789
5027
|
function useUnsubscribeFromRoomThread(roomId) {
|
|
4790
5028
|
const client = useClient();
|
|
@@ -4814,14 +5052,8 @@ function useUnsubscribeFromRoomThread(roomId) {
|
|
|
4814
5052
|
[client, roomId]
|
|
4815
5053
|
);
|
|
4816
5054
|
}
|
|
4817
|
-
function useThreadSubscription_withRoomContext(RoomContext, threadId) {
|
|
4818
|
-
return useRoomThreadSubscription(
|
|
4819
|
-
useRoom_withRoomContext(RoomContext).id,
|
|
4820
|
-
threadId
|
|
4821
|
-
);
|
|
4822
|
-
}
|
|
4823
5055
|
function useThreadSubscription(threadId) {
|
|
4824
|
-
return
|
|
5056
|
+
return useRoomThreadSubscription(useRoom().id, threadId);
|
|
4825
5057
|
}
|
|
4826
5058
|
function useRoomThreadSubscription(roomId, threadId) {
|
|
4827
5059
|
const client = useClient();
|
|
@@ -4861,10 +5093,10 @@ function useRoomThreadSubscription(roomId, threadId) {
|
|
|
4861
5093
|
);
|
|
4862
5094
|
return useSignal(signal, selector, shallow4);
|
|
4863
5095
|
}
|
|
4864
|
-
function
|
|
4865
|
-
const updateRoomSubscriptionSettings =
|
|
5096
|
+
function useRoomSubscriptionSettings() {
|
|
5097
|
+
const updateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings();
|
|
4866
5098
|
const client = useClient();
|
|
4867
|
-
const room =
|
|
5099
|
+
const room = useRoom();
|
|
4868
5100
|
const { store, getOrCreateSubscriptionSettingsPollerForRoomId } = getRoomExtrasForClient(client);
|
|
4869
5101
|
const poller = getOrCreateSubscriptionSettingsPollerForRoomId(room.id);
|
|
4870
5102
|
useEffect6(
|
|
@@ -4892,32 +5124,26 @@ function useRoomSubscriptionSettings_withRoomContext(RoomContext) {
|
|
|
4892
5124
|
return [settings, updateRoomSubscriptionSettings];
|
|
4893
5125
|
}, [settings, updateRoomSubscriptionSettings]);
|
|
4894
5126
|
}
|
|
4895
|
-
function
|
|
4896
|
-
return useRoomSubscriptionSettings_withRoomContext(GlobalRoomContext);
|
|
4897
|
-
}
|
|
4898
|
-
function useRoomSubscriptionSettingsSuspense_withRoomContext(RoomContext) {
|
|
5127
|
+
function useRoomSubscriptionSettingsSuspense() {
|
|
4899
5128
|
ensureNotServerSide();
|
|
4900
5129
|
const client = useClient();
|
|
4901
5130
|
const store = getRoomExtrasForClient(client).store;
|
|
4902
|
-
const room =
|
|
5131
|
+
const room = useRoom();
|
|
4903
5132
|
use(
|
|
4904
5133
|
store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
|
|
4905
5134
|
);
|
|
4906
|
-
const [settings, updateRoomSubscriptionSettings] =
|
|
5135
|
+
const [settings, updateRoomSubscriptionSettings] = useRoomSubscriptionSettings();
|
|
4907
5136
|
assert2(!settings.error, "Did not expect error");
|
|
4908
5137
|
assert2(!settings.isLoading, "Did not expect loading");
|
|
4909
5138
|
return useMemo4(() => {
|
|
4910
5139
|
return [settings, updateRoomSubscriptionSettings];
|
|
4911
5140
|
}, [settings, updateRoomSubscriptionSettings]);
|
|
4912
5141
|
}
|
|
4913
|
-
function
|
|
4914
|
-
return useRoomSubscriptionSettingsSuspense_withRoomContext(GlobalRoomContext);
|
|
4915
|
-
}
|
|
4916
|
-
function useHistoryVersionData_withRoomContext(RoomContext, versionId) {
|
|
5142
|
+
function useHistoryVersionData(versionId) {
|
|
4917
5143
|
const [state, setState] = useState3({
|
|
4918
5144
|
isLoading: true
|
|
4919
5145
|
});
|
|
4920
|
-
const room =
|
|
5146
|
+
const room = useRoom();
|
|
4921
5147
|
useEffect6(() => {
|
|
4922
5148
|
setState({ isLoading: true });
|
|
4923
5149
|
const load = async () => {
|
|
@@ -4942,12 +5168,9 @@ function useHistoryVersionData_withRoomContext(RoomContext, versionId) {
|
|
|
4942
5168
|
}, [room, versionId]);
|
|
4943
5169
|
return state;
|
|
4944
5170
|
}
|
|
4945
|
-
function
|
|
4946
|
-
return useHistoryVersionData_withRoomContext(GlobalRoomContext, versionId);
|
|
4947
|
-
}
|
|
4948
|
-
function useHistoryVersions_withRoomContext(RoomContext) {
|
|
5171
|
+
function useHistoryVersions() {
|
|
4949
5172
|
const client = useClient();
|
|
4950
|
-
const room =
|
|
5173
|
+
const room = useRoom();
|
|
4951
5174
|
const { store, getOrCreateVersionsPollerForRoomId } = getRoomExtrasForClient(client);
|
|
4952
5175
|
const poller = getOrCreateVersionsPollerForRoomId(room.id);
|
|
4953
5176
|
useEffect6(() => {
|
|
@@ -4968,26 +5191,20 @@ function useHistoryVersions_withRoomContext(RoomContext) {
|
|
|
4968
5191
|
);
|
|
4969
5192
|
return useSignal(store.outputs.versionsByRoomId.getOrCreate(room.id).signal);
|
|
4970
5193
|
}
|
|
4971
|
-
function
|
|
4972
|
-
return useHistoryVersions_withRoomContext(GlobalRoomContext);
|
|
4973
|
-
}
|
|
4974
|
-
function useHistoryVersionsSuspense_withRoomContext(RoomContext) {
|
|
5194
|
+
function useHistoryVersionsSuspense() {
|
|
4975
5195
|
ensureNotServerSide();
|
|
4976
5196
|
const client = useClient();
|
|
4977
|
-
const room =
|
|
5197
|
+
const room = useRoom();
|
|
4978
5198
|
const store = getRoomExtrasForClient(client).store;
|
|
4979
5199
|
use(store.outputs.versionsByRoomId.getOrCreate(room.id).waitUntilLoaded());
|
|
4980
|
-
const result =
|
|
5200
|
+
const result = useHistoryVersions();
|
|
4981
5201
|
assert2(!result.error, "Did not expect error");
|
|
4982
5202
|
assert2(!result.isLoading, "Did not expect loading");
|
|
4983
5203
|
return result;
|
|
4984
5204
|
}
|
|
4985
|
-
function
|
|
4986
|
-
return useHistoryVersionsSuspense_withRoomContext(GlobalRoomContext);
|
|
4987
|
-
}
|
|
4988
|
-
function useUpdateRoomSubscriptionSettings_withRoomContext(RoomContext) {
|
|
5205
|
+
function useUpdateRoomSubscriptionSettings() {
|
|
4989
5206
|
const client = useClient();
|
|
4990
|
-
const room =
|
|
5207
|
+
const room = useRoom();
|
|
4991
5208
|
return useCallback3(
|
|
4992
5209
|
(settings) => {
|
|
4993
5210
|
const { store, onMutationFailure, pollThreadsForRoomId } = getRoomExtrasForClient(client);
|
|
@@ -5022,118 +5239,61 @@ function useUpdateRoomSubscriptionSettings_withRoomContext(RoomContext) {
|
|
|
5022
5239
|
[client, room]
|
|
5023
5240
|
);
|
|
5024
5241
|
}
|
|
5025
|
-
function
|
|
5026
|
-
return useUpdateRoomSubscriptionSettings_withRoomContext(GlobalRoomContext);
|
|
5027
|
-
}
|
|
5028
|
-
function useSuspendUntilPresenceReady_withRoomContext(RoomContext) {
|
|
5242
|
+
function useSuspendUntilPresenceReady() {
|
|
5029
5243
|
ensureNotServerSide();
|
|
5030
|
-
const room =
|
|
5244
|
+
const room = useRoom();
|
|
5031
5245
|
use(room.waitUntilPresenceReady());
|
|
5032
5246
|
}
|
|
5033
|
-
function useSelfSuspense_withRoomContext(RoomContext, selector, isEqual) {
|
|
5034
|
-
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5035
|
-
return useSelf_withRoomContext(
|
|
5036
|
-
RoomContext,
|
|
5037
|
-
selector,
|
|
5038
|
-
isEqual
|
|
5039
|
-
);
|
|
5040
|
-
}
|
|
5041
5247
|
function useSelfSuspense(selector, isEqual) {
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
selector,
|
|
5045
|
-
isEqual
|
|
5046
|
-
);
|
|
5047
|
-
}
|
|
5048
|
-
function useOthersSuspense_withRoomContext(RoomContext, selector, isEqual) {
|
|
5049
|
-
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5050
|
-
return useOthers_withRoomContext(
|
|
5051
|
-
RoomContext,
|
|
5248
|
+
useSuspendUntilPresenceReady();
|
|
5249
|
+
return useSelf(
|
|
5052
5250
|
selector,
|
|
5053
5251
|
isEqual
|
|
5054
5252
|
);
|
|
5055
5253
|
}
|
|
5056
5254
|
function useOthersSuspense(selector, isEqual) {
|
|
5057
|
-
|
|
5058
|
-
|
|
5255
|
+
useSuspendUntilPresenceReady();
|
|
5256
|
+
return useOthers(
|
|
5059
5257
|
selector,
|
|
5060
5258
|
isEqual
|
|
5061
5259
|
);
|
|
5062
5260
|
}
|
|
5063
|
-
function useOthersConnectionIdsSuspense_withRoomContext(RoomContext) {
|
|
5064
|
-
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5065
|
-
return useOthersConnectionIds_withRoomContext(RoomContext);
|
|
5066
|
-
}
|
|
5067
5261
|
function useOthersConnectionIdsSuspense() {
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
function useOthersMappedSuspense_withRoomContext(RoomContext, itemSelector, itemIsEqual) {
|
|
5071
|
-
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5072
|
-
return useOthersMapped_withRoomContext(
|
|
5073
|
-
RoomContext,
|
|
5074
|
-
itemSelector,
|
|
5075
|
-
itemIsEqual
|
|
5076
|
-
);
|
|
5262
|
+
useSuspendUntilPresenceReady();
|
|
5263
|
+
return useOthersConnectionIds();
|
|
5077
5264
|
}
|
|
5078
5265
|
function useOthersMappedSuspense(itemSelector, itemIsEqual) {
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
itemSelector,
|
|
5082
|
-
itemIsEqual
|
|
5083
|
-
);
|
|
5084
|
-
}
|
|
5085
|
-
function useOtherSuspense_withRoomContext(RoomContext, connectionId, selector, isEqual) {
|
|
5086
|
-
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5087
|
-
return useOther_withRoomContext(
|
|
5088
|
-
RoomContext,
|
|
5089
|
-
connectionId,
|
|
5090
|
-
selector,
|
|
5091
|
-
isEqual
|
|
5092
|
-
);
|
|
5266
|
+
useSuspendUntilPresenceReady();
|
|
5267
|
+
return useOthersMapped(itemSelector, itemIsEqual);
|
|
5093
5268
|
}
|
|
5094
5269
|
function useOtherSuspense(connectionId, selector, isEqual) {
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
connectionId,
|
|
5098
|
-
selector,
|
|
5099
|
-
isEqual
|
|
5100
|
-
);
|
|
5270
|
+
useSuspendUntilPresenceReady();
|
|
5271
|
+
return useOther(connectionId, selector, isEqual);
|
|
5101
5272
|
}
|
|
5102
|
-
function
|
|
5273
|
+
function useSuspendUntilStorageReady() {
|
|
5103
5274
|
ensureNotServerSide();
|
|
5104
|
-
const room =
|
|
5275
|
+
const room = useRoom();
|
|
5105
5276
|
use(room.waitUntilStorageReady());
|
|
5106
5277
|
}
|
|
5107
|
-
function useStorageSuspense_withRoomContext(RoomContext, selector, isEqual) {
|
|
5108
|
-
useSuspendUntilStorageReady_withRoomContext(RoomContext);
|
|
5109
|
-
return useStorage_withRoomContext(
|
|
5110
|
-
RoomContext,
|
|
5111
|
-
selector,
|
|
5112
|
-
isEqual
|
|
5113
|
-
);
|
|
5114
|
-
}
|
|
5115
5278
|
function useStorageSuspense(selector, isEqual) {
|
|
5116
|
-
|
|
5117
|
-
|
|
5279
|
+
useSuspendUntilStorageReady();
|
|
5280
|
+
return useStorage(
|
|
5118
5281
|
selector,
|
|
5119
5282
|
isEqual
|
|
5120
5283
|
);
|
|
5121
5284
|
}
|
|
5122
|
-
function
|
|
5285
|
+
function useThreadsSuspense(options = {}) {
|
|
5123
5286
|
ensureNotServerSide();
|
|
5124
5287
|
const client = useClient();
|
|
5125
|
-
const room =
|
|
5288
|
+
const room = useRoom();
|
|
5126
5289
|
const { store } = getRoomExtrasForClient(client);
|
|
5127
5290
|
const queryKey = makeRoomThreadsQueryKey(room.id, options.query);
|
|
5128
5291
|
use(store.outputs.loadingRoomThreads.getOrCreate(queryKey).waitUntilLoaded());
|
|
5129
|
-
const result =
|
|
5292
|
+
const result = useThreads(options);
|
|
5130
5293
|
assert2(!result.error, "Did not expect error");
|
|
5131
5294
|
assert2(!result.isLoading, "Did not expect loading");
|
|
5132
5295
|
return result;
|
|
5133
5296
|
}
|
|
5134
|
-
function useThreadsSuspense(options = {}) {
|
|
5135
|
-
return useThreadsSuspense_withRoomContext(GlobalRoomContext, options);
|
|
5136
|
-
}
|
|
5137
5297
|
function selectorFor_useAttachmentUrl(state) {
|
|
5138
5298
|
if (state === void 0 || state?.isLoading) {
|
|
5139
5299
|
return state ?? { isLoading: true };
|
|
@@ -5147,12 +5307,9 @@ function selectorFor_useAttachmentUrl(state) {
|
|
|
5147
5307
|
url: state.data
|
|
5148
5308
|
};
|
|
5149
5309
|
}
|
|
5150
|
-
function useAttachmentUrl_withRoomContext(RoomContext, attachmentId) {
|
|
5151
|
-
const room = useRoom_withRoomContext(RoomContext);
|
|
5152
|
-
return useRoomAttachmentUrl(attachmentId, room.id);
|
|
5153
|
-
}
|
|
5154
5310
|
function useAttachmentUrl(attachmentId) {
|
|
5155
|
-
|
|
5311
|
+
const room = useRoom();
|
|
5312
|
+
return useRoomAttachmentUrl(attachmentId, room.id);
|
|
5156
5313
|
}
|
|
5157
5314
|
function useRoomAttachmentUrl(attachmentId, roomId) {
|
|
5158
5315
|
const client = useClient();
|
|
@@ -5172,8 +5329,8 @@ function useRoomAttachmentUrl(attachmentId, roomId) {
|
|
|
5172
5329
|
shallow4
|
|
5173
5330
|
);
|
|
5174
5331
|
}
|
|
5175
|
-
function
|
|
5176
|
-
const room =
|
|
5332
|
+
function useAttachmentUrlSuspense(attachmentId) {
|
|
5333
|
+
const room = useRoom();
|
|
5177
5334
|
const { attachmentUrlsStore } = room[kInternal4];
|
|
5178
5335
|
const getAttachmentUrlState = useCallback3(
|
|
5179
5336
|
() => attachmentUrlsStore.getItemState(attachmentId),
|
|
@@ -5200,382 +5357,13 @@ function useAttachmentUrlSuspense_withRoomContext(RoomContext, attachmentId) {
|
|
|
5200
5357
|
error: void 0
|
|
5201
5358
|
};
|
|
5202
5359
|
}
|
|
5203
|
-
function useAttachmentUrlSuspense(attachmentId) {
|
|
5204
|
-
return useAttachmentUrlSuspense_withRoomContext(
|
|
5205
|
-
GlobalRoomContext,
|
|
5206
|
-
attachmentId
|
|
5207
|
-
);
|
|
5208
|
-
}
|
|
5209
5360
|
function useRoomPermissions(roomId) {
|
|
5210
5361
|
const client = useClient();
|
|
5211
5362
|
const store = getRoomExtrasForClient(client).store;
|
|
5212
5363
|
return useSignal(store.permissionHints.getPermissionForRoom\u03A3(roomId));
|
|
5213
5364
|
}
|
|
5214
5365
|
function createRoomContext(client) {
|
|
5215
|
-
|
|
5216
|
-
function RoomProvider_withImplicitLiveblocksProviderAndBoundRoomContext(props) {
|
|
5217
|
-
return /* @__PURE__ */ jsx2(LiveblocksProviderWithClient, { client, allowNesting: true, children: /* @__PURE__ */ jsx2(RoomProvider, { ...props, BoundRoomContext }) });
|
|
5218
|
-
}
|
|
5219
|
-
function useRoom_withBoundRoomContext(...args) {
|
|
5220
|
-
return useRoom_withRoomContext(
|
|
5221
|
-
BoundRoomContext,
|
|
5222
|
-
...args
|
|
5223
|
-
);
|
|
5224
|
-
}
|
|
5225
|
-
function useStatus_withBoundRoomContext() {
|
|
5226
|
-
return useStatus_withRoomContext(BoundRoomContext);
|
|
5227
|
-
}
|
|
5228
|
-
function useBroadcastEvent_withBoundRoomContext() {
|
|
5229
|
-
return useBroadcastEvent_withRoomContext(BoundRoomContext);
|
|
5230
|
-
}
|
|
5231
|
-
function useOthersListener_withBoundRoomContext(...args) {
|
|
5232
|
-
return useOthersListener_withRoomContext(BoundRoomContext, ...args);
|
|
5233
|
-
}
|
|
5234
|
-
function useLostConnectionListener_withBoundRoomContext(...args) {
|
|
5235
|
-
return useLostConnectionListener_withRoomContext(BoundRoomContext, ...args);
|
|
5236
|
-
}
|
|
5237
|
-
function useEventListener_withBoundRoomContext(...args) {
|
|
5238
|
-
return useEventListener_withRoomContext(BoundRoomContext, ...args);
|
|
5239
|
-
}
|
|
5240
|
-
function useMarkThreadAsRead_withBoundRoomContext() {
|
|
5241
|
-
return useMarkThreadAsRead_withRoomContext(BoundRoomContext);
|
|
5242
|
-
}
|
|
5243
|
-
function useHistory_withBoundRoomContext() {
|
|
5244
|
-
return useHistory_withRoomContext(BoundRoomContext);
|
|
5245
|
-
}
|
|
5246
|
-
function useUndo_withBoundRoomContext() {
|
|
5247
|
-
return useUndo_withRoomContext(BoundRoomContext);
|
|
5248
|
-
}
|
|
5249
|
-
function useRedo_withBoundRoomContext() {
|
|
5250
|
-
return useRedo_withRoomContext(BoundRoomContext);
|
|
5251
|
-
}
|
|
5252
|
-
function useCanUndo_withBoundRoomContext() {
|
|
5253
|
-
return useCanUndo_withRoomContext(BoundRoomContext);
|
|
5254
|
-
}
|
|
5255
|
-
function useCanRedo_withBoundRoomContext() {
|
|
5256
|
-
return useCanRedo_withRoomContext(BoundRoomContext);
|
|
5257
|
-
}
|
|
5258
|
-
function useStorageRoot_withBoundRoomContext() {
|
|
5259
|
-
return useStorageRoot_withRoomContext(BoundRoomContext);
|
|
5260
|
-
}
|
|
5261
|
-
function useStorage_withBoundRoomContext(...args) {
|
|
5262
|
-
return useStorage_withRoomContext(BoundRoomContext, ...args);
|
|
5263
|
-
}
|
|
5264
|
-
function useStorageSuspense_withBoundRoomContext(...args) {
|
|
5265
|
-
return useStorageSuspense_withRoomContext(BoundRoomContext, ...args);
|
|
5266
|
-
}
|
|
5267
|
-
function useSelf_withBoundRoomContext(...args) {
|
|
5268
|
-
return useSelf_withRoomContext(BoundRoomContext, ...args);
|
|
5269
|
-
}
|
|
5270
|
-
function useMyPresence_withBoundRoomContext() {
|
|
5271
|
-
return useMyPresence_withRoomContext(BoundRoomContext);
|
|
5272
|
-
}
|
|
5273
|
-
function useUpdateMyPresence_withBoundRoomContext() {
|
|
5274
|
-
return useUpdateMyPresence_withRoomContext(BoundRoomContext);
|
|
5275
|
-
}
|
|
5276
|
-
function useOthers_withBoundRoomContext(...args) {
|
|
5277
|
-
return useOthers_withRoomContext(BoundRoomContext, ...args);
|
|
5278
|
-
}
|
|
5279
|
-
function useOthersMapped_withBoundRoomContext(...args) {
|
|
5280
|
-
return useOthersMapped_withRoomContext(BoundRoomContext, ...args);
|
|
5281
|
-
}
|
|
5282
|
-
function useOthersConnectionIds_withBoundRoomContext() {
|
|
5283
|
-
return useOthersConnectionIds_withRoomContext(BoundRoomContext);
|
|
5284
|
-
}
|
|
5285
|
-
function useOther_withBoundRoomContext(...args) {
|
|
5286
|
-
return useOther_withRoomContext(BoundRoomContext, ...args);
|
|
5287
|
-
}
|
|
5288
|
-
function useSelfSuspense_withBoundRoomContext(...args) {
|
|
5289
|
-
return useSelfSuspense_withRoomContext(BoundRoomContext, ...args);
|
|
5290
|
-
}
|
|
5291
|
-
function useOthersSuspense_withBoundRoomContext(...args) {
|
|
5292
|
-
return useOthersSuspense_withRoomContext(
|
|
5293
|
-
BoundRoomContext,
|
|
5294
|
-
...args
|
|
5295
|
-
);
|
|
5296
|
-
}
|
|
5297
|
-
function useOthersMappedSuspense_withBoundRoomContext(...args) {
|
|
5298
|
-
return useOthersMappedSuspense_withRoomContext(
|
|
5299
|
-
BoundRoomContext,
|
|
5300
|
-
...args
|
|
5301
|
-
);
|
|
5302
|
-
}
|
|
5303
|
-
function useOthersConnectionIdsSuspense_withBoundRoomContext() {
|
|
5304
|
-
return useOthersConnectionIdsSuspense_withRoomContext(BoundRoomContext);
|
|
5305
|
-
}
|
|
5306
|
-
function useOtherSuspense_withBoundRoomContext(...args) {
|
|
5307
|
-
return useOtherSuspense_withRoomContext(BoundRoomContext, ...args);
|
|
5308
|
-
}
|
|
5309
|
-
function useMutation_withBoundRoomContext(...args) {
|
|
5310
|
-
return useMutation_withRoomContext(
|
|
5311
|
-
BoundRoomContext,
|
|
5312
|
-
...args
|
|
5313
|
-
);
|
|
5314
|
-
}
|
|
5315
|
-
function useThreads_withBoundRoomContext(...args) {
|
|
5316
|
-
return useThreads_withRoomContext(BoundRoomContext, ...args);
|
|
5317
|
-
}
|
|
5318
|
-
function useCreateThread_withBoundRoomContext() {
|
|
5319
|
-
return useCreateThread_withRoomContext(BoundRoomContext);
|
|
5320
|
-
}
|
|
5321
|
-
function useDeleteThread_withBoundRoomContext() {
|
|
5322
|
-
return useDeleteThread_withRoomContext(BoundRoomContext);
|
|
5323
|
-
}
|
|
5324
|
-
function useEditThreadMetadata_withBoundRoomContext() {
|
|
5325
|
-
return useEditThreadMetadata_withRoomContext(BoundRoomContext);
|
|
5326
|
-
}
|
|
5327
|
-
function useMarkThreadAsResolved_withBoundRoomContext() {
|
|
5328
|
-
return useMarkThreadAsResolved_withRoomContext(BoundRoomContext);
|
|
5329
|
-
}
|
|
5330
|
-
function useMarkThreadAsUnresolved_withBoundRoomContext() {
|
|
5331
|
-
return useMarkThreadAsUnresolved_withRoomContext(BoundRoomContext);
|
|
5332
|
-
}
|
|
5333
|
-
function useThreadsSuspense_withBoundRoomContext(...args) {
|
|
5334
|
-
return useThreadsSuspense_withRoomContext(
|
|
5335
|
-
BoundRoomContext,
|
|
5336
|
-
...args
|
|
5337
|
-
);
|
|
5338
|
-
}
|
|
5339
|
-
function useSubscribeToThread_withBoundRoomContext() {
|
|
5340
|
-
return useSubscribeToThread_withRoomContext(BoundRoomContext);
|
|
5341
|
-
}
|
|
5342
|
-
function useUnsubscribeFromThread_withBoundRoomContext() {
|
|
5343
|
-
return useUnsubscribeFromThread_withRoomContext(BoundRoomContext);
|
|
5344
|
-
}
|
|
5345
|
-
function useCreateComment_withBoundRoomContext() {
|
|
5346
|
-
return useCreateComment_withRoomContext(BoundRoomContext);
|
|
5347
|
-
}
|
|
5348
|
-
function useEditComment_withBoundRoomContext() {
|
|
5349
|
-
return useEditComment_withRoomContext(BoundRoomContext);
|
|
5350
|
-
}
|
|
5351
|
-
function useEditCommentMetadata_withBoundRoomContext() {
|
|
5352
|
-
return useEditCommentMetadata_withRoomContext(BoundRoomContext);
|
|
5353
|
-
}
|
|
5354
|
-
function useDeleteComment_withBoundRoomContext() {
|
|
5355
|
-
return useDeleteComment_withRoomContext(BoundRoomContext);
|
|
5356
|
-
}
|
|
5357
|
-
function useAddReaction_withBoundRoomContext() {
|
|
5358
|
-
return useAddReaction_withRoomContext(BoundRoomContext);
|
|
5359
|
-
}
|
|
5360
|
-
function useRemoveReaction_withBoundRoomContext() {
|
|
5361
|
-
return useRemoveReaction_withRoomContext(BoundRoomContext);
|
|
5362
|
-
}
|
|
5363
|
-
function useThreadSubscription_withBoundRoomContext(...args) {
|
|
5364
|
-
return useThreadSubscription_withRoomContext(BoundRoomContext, ...args);
|
|
5365
|
-
}
|
|
5366
|
-
function useAttachmentUrl_withBoundRoomContext(...args) {
|
|
5367
|
-
return useAttachmentUrl_withRoomContext(BoundRoomContext, ...args);
|
|
5368
|
-
}
|
|
5369
|
-
function useAttachmentUrlSuspense_withBoundRoomContext(...args) {
|
|
5370
|
-
return useAttachmentUrlSuspense_withRoomContext(BoundRoomContext, ...args);
|
|
5371
|
-
}
|
|
5372
|
-
function useSearchComments_withBoundRoomContext(...args) {
|
|
5373
|
-
return useSearchComments_withRoomContext(BoundRoomContext, ...args);
|
|
5374
|
-
}
|
|
5375
|
-
function useHistoryVersions_withBoundRoomContext() {
|
|
5376
|
-
return useHistoryVersions_withRoomContext(BoundRoomContext);
|
|
5377
|
-
}
|
|
5378
|
-
function useHistoryVersionsSuspense_withBoundRoomContext() {
|
|
5379
|
-
return useHistoryVersionsSuspense_withRoomContext(BoundRoomContext);
|
|
5380
|
-
}
|
|
5381
|
-
function useHistoryVersionData_withBoundRoomContext(...args) {
|
|
5382
|
-
return useHistoryVersionData_withRoomContext(BoundRoomContext, ...args);
|
|
5383
|
-
}
|
|
5384
|
-
function useRoomSubscriptionSettings_withBoundRoomContext() {
|
|
5385
|
-
return useRoomSubscriptionSettings_withRoomContext(BoundRoomContext);
|
|
5386
|
-
}
|
|
5387
|
-
function useRoomSubscriptionSettingsSuspense_withBoundRoomContext() {
|
|
5388
|
-
return useRoomSubscriptionSettingsSuspense_withRoomContext(
|
|
5389
|
-
BoundRoomContext
|
|
5390
|
-
);
|
|
5391
|
-
}
|
|
5392
|
-
function useUpdateRoomSubscriptionSettings_withBoundRoomContext() {
|
|
5393
|
-
return useUpdateRoomSubscriptionSettings_withRoomContext(BoundRoomContext);
|
|
5394
|
-
}
|
|
5395
|
-
const shared = createSharedContext(client);
|
|
5396
|
-
const bundle = {
|
|
5397
|
-
RoomContext: BoundRoomContext,
|
|
5398
|
-
RoomProvider: RoomProvider_withImplicitLiveblocksProviderAndBoundRoomContext,
|
|
5399
|
-
// prettier-ignore
|
|
5400
|
-
useRoom: useRoom_withBoundRoomContext,
|
|
5401
|
-
// prettier-ignore
|
|
5402
|
-
useStatus: useStatus_withBoundRoomContext,
|
|
5403
|
-
// prettier-ignore
|
|
5404
|
-
useBroadcastEvent: useBroadcastEvent_withBoundRoomContext,
|
|
5405
|
-
// prettier-ignore
|
|
5406
|
-
useOthersListener: useOthersListener_withBoundRoomContext,
|
|
5407
|
-
// prettier-ignore
|
|
5408
|
-
useLostConnectionListener: useLostConnectionListener_withBoundRoomContext,
|
|
5409
|
-
// prettier-ignore
|
|
5410
|
-
useEventListener: useEventListener_withBoundRoomContext,
|
|
5411
|
-
// prettier-ignore
|
|
5412
|
-
useHistory: useHistory_withBoundRoomContext,
|
|
5413
|
-
// prettier-ignore
|
|
5414
|
-
useUndo: useUndo_withBoundRoomContext,
|
|
5415
|
-
// prettier-ignore
|
|
5416
|
-
useRedo: useRedo_withBoundRoomContext,
|
|
5417
|
-
// prettier-ignore
|
|
5418
|
-
useCanUndo: useCanUndo_withBoundRoomContext,
|
|
5419
|
-
// prettier-ignore
|
|
5420
|
-
useCanRedo: useCanRedo_withBoundRoomContext,
|
|
5421
|
-
// prettier-ignore
|
|
5422
|
-
useStorageRoot: useStorageRoot_withBoundRoomContext,
|
|
5423
|
-
// prettier-ignore
|
|
5424
|
-
useStorage: useStorage_withBoundRoomContext,
|
|
5425
|
-
// prettier-ignore
|
|
5426
|
-
useMutation: useMutation_withBoundRoomContext,
|
|
5427
|
-
// prettier-ignore
|
|
5428
|
-
useSelf: useSelf_withBoundRoomContext,
|
|
5429
|
-
// prettier-ignore
|
|
5430
|
-
useMyPresence: useMyPresence_withBoundRoomContext,
|
|
5431
|
-
// prettier-ignore
|
|
5432
|
-
useUpdateMyPresence: useUpdateMyPresence_withBoundRoomContext,
|
|
5433
|
-
// prettier-ignore
|
|
5434
|
-
useOthers: useOthers_withBoundRoomContext,
|
|
5435
|
-
// prettier-ignore
|
|
5436
|
-
useOthersMapped: useOthersMapped_withBoundRoomContext,
|
|
5437
|
-
// prettier-ignore
|
|
5438
|
-
useOthersConnectionIds: useOthersConnectionIds_withBoundRoomContext,
|
|
5439
|
-
// prettier-ignore
|
|
5440
|
-
useOther: useOther_withBoundRoomContext,
|
|
5441
|
-
// prettier-ignore
|
|
5442
|
-
useThreads: useThreads_withBoundRoomContext,
|
|
5443
|
-
// prettier-ignore
|
|
5444
|
-
useCreateThread: useCreateThread_withBoundRoomContext,
|
|
5445
|
-
// prettier-ignore
|
|
5446
|
-
useDeleteThread: useDeleteThread_withBoundRoomContext,
|
|
5447
|
-
// prettier-ignore
|
|
5448
|
-
useEditThreadMetadata: useEditThreadMetadata_withBoundRoomContext,
|
|
5449
|
-
// prettier-ignore
|
|
5450
|
-
useMarkThreadAsResolved: useMarkThreadAsResolved_withBoundRoomContext,
|
|
5451
|
-
// prettier-ignore
|
|
5452
|
-
useMarkThreadAsUnresolved: useMarkThreadAsUnresolved_withBoundRoomContext,
|
|
5453
|
-
// prettier-ignore
|
|
5454
|
-
useSubscribeToThread: useSubscribeToThread_withBoundRoomContext,
|
|
5455
|
-
// prettier-ignore
|
|
5456
|
-
useUnsubscribeFromThread: useUnsubscribeFromThread_withBoundRoomContext,
|
|
5457
|
-
// prettier-ignore
|
|
5458
|
-
useCreateComment: useCreateComment_withBoundRoomContext,
|
|
5459
|
-
// prettier-ignore
|
|
5460
|
-
useEditComment: useEditComment_withBoundRoomContext,
|
|
5461
|
-
// prettier-ignore
|
|
5462
|
-
useEditCommentMetadata: useEditCommentMetadata_withBoundRoomContext,
|
|
5463
|
-
// prettier-ignore
|
|
5464
|
-
useDeleteComment: useDeleteComment_withBoundRoomContext,
|
|
5465
|
-
// prettier-ignore
|
|
5466
|
-
useAddReaction: useAddReaction_withBoundRoomContext,
|
|
5467
|
-
// prettier-ignore
|
|
5468
|
-
useRemoveReaction: useRemoveReaction_withBoundRoomContext,
|
|
5469
|
-
// prettier-ignore
|
|
5470
|
-
useMarkThreadAsRead: useMarkThreadAsRead_withBoundRoomContext,
|
|
5471
|
-
// prettier-ignore
|
|
5472
|
-
useThreadSubscription: useThreadSubscription_withBoundRoomContext,
|
|
5473
|
-
// prettier-ignore
|
|
5474
|
-
useAttachmentUrl: useAttachmentUrl_withBoundRoomContext,
|
|
5475
|
-
// prettier-ignore
|
|
5476
|
-
useSearchComments: useSearchComments_withBoundRoomContext,
|
|
5477
|
-
// prettier-ignore
|
|
5478
|
-
useHistoryVersions: useHistoryVersions_withBoundRoomContext,
|
|
5479
|
-
// prettier-ignore
|
|
5480
|
-
useHistoryVersionData: useHistoryVersionData_withBoundRoomContext,
|
|
5481
|
-
// prettier-ignore
|
|
5482
|
-
useRoomSubscriptionSettings: useRoomSubscriptionSettings_withBoundRoomContext,
|
|
5483
|
-
// prettier-ignore
|
|
5484
|
-
useUpdateRoomSubscriptionSettings: useUpdateRoomSubscriptionSettings_withBoundRoomContext,
|
|
5485
|
-
...shared.classic,
|
|
5486
|
-
suspense: {
|
|
5487
|
-
RoomContext: BoundRoomContext,
|
|
5488
|
-
RoomProvider: RoomProvider_withImplicitLiveblocksProviderAndBoundRoomContext,
|
|
5489
|
-
// prettier-ignore
|
|
5490
|
-
useRoom: useRoom_withBoundRoomContext,
|
|
5491
|
-
// prettier-ignore
|
|
5492
|
-
useStatus: useStatus_withBoundRoomContext,
|
|
5493
|
-
// prettier-ignore
|
|
5494
|
-
useBroadcastEvent: useBroadcastEvent_withBoundRoomContext,
|
|
5495
|
-
// prettier-ignore
|
|
5496
|
-
useOthersListener: useOthersListener_withBoundRoomContext,
|
|
5497
|
-
// prettier-ignore
|
|
5498
|
-
useLostConnectionListener: useLostConnectionListener_withBoundRoomContext,
|
|
5499
|
-
// prettier-ignore
|
|
5500
|
-
useEventListener: useEventListener_withBoundRoomContext,
|
|
5501
|
-
// prettier-ignore
|
|
5502
|
-
useHistory: useHistory_withBoundRoomContext,
|
|
5503
|
-
// prettier-ignore
|
|
5504
|
-
useUndo: useUndo_withBoundRoomContext,
|
|
5505
|
-
// prettier-ignore
|
|
5506
|
-
useRedo: useRedo_withBoundRoomContext,
|
|
5507
|
-
// prettier-ignore
|
|
5508
|
-
useCanUndo: useCanUndo_withBoundRoomContext,
|
|
5509
|
-
// prettier-ignore
|
|
5510
|
-
useCanRedo: useCanRedo_withBoundRoomContext,
|
|
5511
|
-
// prettier-ignore
|
|
5512
|
-
useStorageRoot: useStorageRoot_withBoundRoomContext,
|
|
5513
|
-
// prettier-ignore
|
|
5514
|
-
useStorage: useStorageSuspense_withBoundRoomContext,
|
|
5515
|
-
// prettier-ignore
|
|
5516
|
-
useMutation: useMutation_withBoundRoomContext,
|
|
5517
|
-
// prettier-ignore
|
|
5518
|
-
useSelf: useSelfSuspense_withBoundRoomContext,
|
|
5519
|
-
// prettier-ignore
|
|
5520
|
-
useMyPresence: useMyPresence_withBoundRoomContext,
|
|
5521
|
-
// prettier-ignore
|
|
5522
|
-
useUpdateMyPresence: useUpdateMyPresence_withBoundRoomContext,
|
|
5523
|
-
// prettier-ignore
|
|
5524
|
-
useOthers: useOthersSuspense_withBoundRoomContext,
|
|
5525
|
-
// prettier-ignore
|
|
5526
|
-
useOthersMapped: useOthersMappedSuspense_withBoundRoomContext,
|
|
5527
|
-
// prettier-ignore
|
|
5528
|
-
useOthersConnectionIds: useOthersConnectionIdsSuspense_withBoundRoomContext,
|
|
5529
|
-
// prettier-ignore
|
|
5530
|
-
useOther: useOtherSuspense_withBoundRoomContext,
|
|
5531
|
-
// prettier-ignore
|
|
5532
|
-
useThreads: useThreadsSuspense_withBoundRoomContext,
|
|
5533
|
-
// prettier-ignore
|
|
5534
|
-
useCreateThread: useCreateThread_withBoundRoomContext,
|
|
5535
|
-
// prettier-ignore
|
|
5536
|
-
useDeleteThread: useDeleteThread_withBoundRoomContext,
|
|
5537
|
-
// prettier-ignore
|
|
5538
|
-
useEditThreadMetadata: useEditThreadMetadata_withBoundRoomContext,
|
|
5539
|
-
// prettier-ignore
|
|
5540
|
-
useMarkThreadAsResolved: useMarkThreadAsResolved_withBoundRoomContext,
|
|
5541
|
-
// prettier-ignore
|
|
5542
|
-
useMarkThreadAsUnresolved: useMarkThreadAsUnresolved_withBoundRoomContext,
|
|
5543
|
-
// prettier-ignore
|
|
5544
|
-
useSubscribeToThread: useSubscribeToThread_withBoundRoomContext,
|
|
5545
|
-
// prettier-ignore
|
|
5546
|
-
useUnsubscribeFromThread: useUnsubscribeFromThread_withBoundRoomContext,
|
|
5547
|
-
// prettier-ignore
|
|
5548
|
-
useCreateComment: useCreateComment_withBoundRoomContext,
|
|
5549
|
-
// prettier-ignore
|
|
5550
|
-
useEditComment: useEditComment_withBoundRoomContext,
|
|
5551
|
-
// prettier-ignore
|
|
5552
|
-
useEditCommentMetadata: useEditCommentMetadata_withBoundRoomContext,
|
|
5553
|
-
// prettier-ignore
|
|
5554
|
-
useDeleteComment: useDeleteComment_withBoundRoomContext,
|
|
5555
|
-
// prettier-ignore
|
|
5556
|
-
useAddReaction: useAddReaction_withBoundRoomContext,
|
|
5557
|
-
// prettier-ignore
|
|
5558
|
-
useRemoveReaction: useRemoveReaction_withBoundRoomContext,
|
|
5559
|
-
// prettier-ignore
|
|
5560
|
-
useMarkThreadAsRead: useMarkThreadAsRead_withBoundRoomContext,
|
|
5561
|
-
// prettier-ignore
|
|
5562
|
-
useThreadSubscription: useThreadSubscription_withBoundRoomContext,
|
|
5563
|
-
// prettier-ignore
|
|
5564
|
-
useAttachmentUrl: useAttachmentUrlSuspense_withBoundRoomContext,
|
|
5565
|
-
// prettier-ignore
|
|
5566
|
-
useHistoryVersions: useHistoryVersionsSuspense_withBoundRoomContext,
|
|
5567
|
-
// prettier-ignore
|
|
5568
|
-
useRoomSubscriptionSettings: useRoomSubscriptionSettingsSuspense_withBoundRoomContext,
|
|
5569
|
-
// prettier-ignore
|
|
5570
|
-
useUpdateRoomSubscriptionSettings: useUpdateRoomSubscriptionSettings_withBoundRoomContext,
|
|
5571
|
-
// No Suspense version: useSearchComments
|
|
5572
|
-
// No Suspense version: useHistoryVersionData
|
|
5573
|
-
...shared.suspense
|
|
5574
|
-
}
|
|
5575
|
-
};
|
|
5576
|
-
return Object.defineProperty(bundle, kInternal4, {
|
|
5577
|
-
enumerable: false
|
|
5578
|
-
});
|
|
5366
|
+
return getOrCreateRoomContextBundle(client);
|
|
5579
5367
|
}
|
|
5580
5368
|
var _RoomProvider = RoomProvider;
|
|
5581
5369
|
var _useBroadcastEvent = useBroadcastEvent;
|
|
@@ -5595,6 +5383,10 @@ var _useMyPresence = useMyPresence;
|
|
|
5595
5383
|
var _useOthersMapped = useOthersMapped;
|
|
5596
5384
|
var _useOthersMappedSuspense = useOthersMappedSuspense;
|
|
5597
5385
|
var _useThreads = useThreads;
|
|
5386
|
+
var _useFeeds = useFeeds;
|
|
5387
|
+
var _useFeedMessages = useFeedMessages;
|
|
5388
|
+
var _useFeedsSuspense = useFeedsSuspense;
|
|
5389
|
+
var _useFeedMessagesSuspense = useFeedMessagesSuspense;
|
|
5598
5390
|
var _useSearchComments = useSearchComments;
|
|
5599
5391
|
var _useThreadsSuspense = useThreadsSuspense;
|
|
5600
5392
|
var _useRoomSubscriptionSettings = useRoomSubscriptionSettings;
|
|
@@ -5624,7 +5416,7 @@ export {
|
|
|
5624
5416
|
ClientContext,
|
|
5625
5417
|
useClientOrNull,
|
|
5626
5418
|
useClient,
|
|
5627
|
-
|
|
5419
|
+
RoomContext,
|
|
5628
5420
|
useLatest,
|
|
5629
5421
|
RegisterAiKnowledge,
|
|
5630
5422
|
RegisterAiTool,
|
|
@@ -5681,6 +5473,12 @@ export {
|
|
|
5681
5473
|
useCanUndo,
|
|
5682
5474
|
useCanRedo,
|
|
5683
5475
|
useOthersConnectionIds,
|
|
5476
|
+
useCreateFeed,
|
|
5477
|
+
useDeleteFeed,
|
|
5478
|
+
useUpdateFeedMetadata,
|
|
5479
|
+
useCreateFeedMessage,
|
|
5480
|
+
useDeleteFeedMessage,
|
|
5481
|
+
useUpdateFeedMessage,
|
|
5684
5482
|
useCreateRoomThread,
|
|
5685
5483
|
useDeleteRoomThread,
|
|
5686
5484
|
useEditRoomThreadMetadata,
|
|
@@ -5691,8 +5489,8 @@ export {
|
|
|
5691
5489
|
useAddRoomCommentReaction,
|
|
5692
5490
|
useRemoveReaction,
|
|
5693
5491
|
useRemoveRoomCommentReaction,
|
|
5694
|
-
useMarkRoomThreadAsRead,
|
|
5695
5492
|
useMarkThreadAsRead,
|
|
5493
|
+
useMarkRoomThreadAsRead,
|
|
5696
5494
|
useMarkThreadAsResolved,
|
|
5697
5495
|
useMarkRoomThreadAsResolved,
|
|
5698
5496
|
useMarkThreadAsUnresolved,
|
|
@@ -5727,6 +5525,10 @@ export {
|
|
|
5727
5525
|
_useOthersMapped,
|
|
5728
5526
|
_useOthersMappedSuspense,
|
|
5729
5527
|
_useThreads,
|
|
5528
|
+
_useFeeds,
|
|
5529
|
+
_useFeedMessages,
|
|
5530
|
+
_useFeedsSuspense,
|
|
5531
|
+
_useFeedMessagesSuspense,
|
|
5730
5532
|
_useSearchComments,
|
|
5731
5533
|
_useThreadsSuspense,
|
|
5732
5534
|
_useRoomSubscriptionSettings,
|
|
@@ -5744,4 +5546,4 @@ export {
|
|
|
5744
5546
|
_useStorageRoot,
|
|
5745
5547
|
_useUpdateMyPresence
|
|
5746
5548
|
};
|
|
5747
|
-
//# sourceMappingURL=chunk-
|
|
5549
|
+
//# sourceMappingURL=chunk-GWYQHSXI.js.map
|