@liveblocks/react 3.15.0-components1 → 3.15.0-feeds1
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-Z3NTUAGP.cjs → chunk-FLKIHVRX.cjs} +566 -764
- package/dist/chunk-FLKIHVRX.cjs.map +1 -0
- package/dist/{chunk-B5F24HAT.js → chunk-JQZ4SSGD.js} +530 -728
- package/dist/chunk-JQZ4SSGD.js.map +1 -0
- package/dist/{chunk-Z7VSK4H7.cjs → chunk-PQ62AG2K.cjs} +2 -2
- package/dist/chunk-PQ62AG2K.cjs.map +1 -0
- package/dist/{chunk-VMPATNNT.js → chunk-XMFQTQBJ.js} +2 -2
- 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-BFE9TLUA.d.cts} +182 -20
- package/dist/{room-C3ujtNzt.d.ts → room-BFE9TLUA.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-XMFQTQBJ.js.map} +0 -0
|
@@ -8,8 +8,8 @@ function useClientOrNull() {
|
|
|
8
8
|
function useClient() {
|
|
9
9
|
return _nullishCoalesce(useClientOrNull(), () => ( _core.raise.call(void 0, "LiveblocksProvider is missing from the React tree.")));
|
|
10
10
|
}
|
|
11
|
-
var
|
|
12
|
-
function useRoomOrNull(
|
|
11
|
+
var RoomContext = _react.createContext.call(void 0, null);
|
|
12
|
+
function useRoomOrNull() {
|
|
13
13
|
return _react.useContext.call(void 0, RoomContext);
|
|
14
14
|
}
|
|
15
15
|
function useIsInsideRoom() {
|
|
@@ -512,6 +512,12 @@ function makeAiChatsQueryKey(query) {
|
|
|
512
512
|
function makeInboxNotificationsQueryKey(query) {
|
|
513
513
|
return _core.stableStringify.call(void 0, _nullishCoalesce(query, () => ( {})));
|
|
514
514
|
}
|
|
515
|
+
function makeFeedsQueryKey(roomId, options) {
|
|
516
|
+
return _core.stableStringify.call(void 0, [roomId, _nullishCoalesce(options, () => ( {}))]);
|
|
517
|
+
}
|
|
518
|
+
function makeFeedMessagesQueryKey(roomId, feedId, options) {
|
|
519
|
+
return _core.stableStringify.call(void 0, [roomId, feedId, _nullishCoalesce(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 (!_optionalChain([state, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.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 (0, _core.MutableSignal)({
|
|
993
|
+
version: 0
|
|
994
|
+
});
|
|
995
|
+
#feedMessagesSignal = new (0, _core.MutableSignal)({
|
|
996
|
+
version: 0
|
|
997
|
+
});
|
|
982
998
|
constructor(client) {
|
|
983
999
|
this.#client = client[_core.kInternal].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 (0, _core.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: _optionalChain([options, 'optionalAccess', _8 => _8.since]),
|
|
1382
|
+
metadata: _optionalChain([options, 'optionalAccess', _9 => _9.metadata])
|
|
1383
|
+
});
|
|
1384
|
+
this.upsertFeeds(roomId, result.feeds);
|
|
1385
|
+
return _nullishCoalesce(result.nextCursor, () => ( null));
|
|
1386
|
+
});
|
|
1387
|
+
const signal = _core.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
|
+
_core.shallow2
|
|
1407
|
+
);
|
|
1408
|
+
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1409
|
+
}
|
|
1410
|
+
);
|
|
1411
|
+
const loadingFeedMessages = new (0, _core.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: _optionalChain([options, 'optionalAccess', _10 => _10.limit])
|
|
1424
|
+
});
|
|
1425
|
+
this.upsertFeedMessages(roomId, feedId, result.messages);
|
|
1426
|
+
return _nullishCoalesce(result.nextCursor, () => ( null));
|
|
1427
|
+
});
|
|
1428
|
+
const signal = _core.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
|
+
_core.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({
|
|
@@ -1996,7 +2157,7 @@ function applyUpsertComment(thread, comment) {
|
|
|
1996
2157
|
updatedAt: new Date(
|
|
1997
2158
|
Math.max(
|
|
1998
2159
|
thread.updatedAt.getTime(),
|
|
1999
|
-
_optionalChain([comment, 'access',
|
|
2160
|
+
_optionalChain([comment, 'access', _11 => _11.editedAt, 'optionalAccess', _12 => _12.getTime, 'call', _13 => _13()]) || comment.createdAt.getTime()
|
|
2000
2161
|
)
|
|
2001
2162
|
),
|
|
2002
2163
|
comments: updatedComments
|
|
@@ -2153,7 +2314,7 @@ function selectorFor_useUnreadInboxNotificationsCount(result) {
|
|
|
2153
2314
|
return ASYNC_OK("count", result.count);
|
|
2154
2315
|
}
|
|
2155
2316
|
function selectorFor_useUser(state, userId) {
|
|
2156
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
2317
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _14 => _14.isLoading])) {
|
|
2157
2318
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
2158
2319
|
}
|
|
2159
2320
|
if (state.error) {
|
|
@@ -2171,7 +2332,7 @@ function selectorFor_useUser(state, userId) {
|
|
|
2171
2332
|
};
|
|
2172
2333
|
}
|
|
2173
2334
|
function selectorFor_useRoomInfo(state, roomId) {
|
|
2174
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
2335
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _15 => _15.isLoading])) {
|
|
2175
2336
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
2176
2337
|
}
|
|
2177
2338
|
if (state.error) {
|
|
@@ -2189,7 +2350,7 @@ function selectorFor_useRoomInfo(state, roomId) {
|
|
|
2189
2350
|
};
|
|
2190
2351
|
}
|
|
2191
2352
|
function selectorFor_useGroupInfo(state, groupId) {
|
|
2192
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
2353
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _16 => _16.isLoading])) {
|
|
2193
2354
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
2194
2355
|
}
|
|
2195
2356
|
if (state.error) {
|
|
@@ -2359,7 +2520,7 @@ function makeLiveblocksContextBundle(client) {
|
|
|
2359
2520
|
}
|
|
2360
2521
|
function useInboxNotifications_withClient(client, selector, isEqual, options) {
|
|
2361
2522
|
const { store, notificationsPoller: poller } = getLiveblocksExtrasForClient(client);
|
|
2362
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2523
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _17 => _17.query]));
|
|
2363
2524
|
_react.useEffect.call(void 0,
|
|
2364
2525
|
() => void store.outputs.loadingNotifications.getOrCreate(queryKey).waitUntilLoaded()
|
|
2365
2526
|
// NOTE: Deliberately *not* using a dependency array here!
|
|
@@ -2387,7 +2548,7 @@ function useInboxNotifications_withClient(client, selector, isEqual, options) {
|
|
|
2387
2548
|
function useInboxNotificationsSuspense_withClient(client, options) {
|
|
2388
2549
|
ensureNotServerSide();
|
|
2389
2550
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
2390
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2551
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _18 => _18.query]));
|
|
2391
2552
|
use(
|
|
2392
2553
|
store.outputs.loadingNotifications.getOrCreate(queryKey).waitUntilLoaded()
|
|
2393
2554
|
);
|
|
@@ -2403,7 +2564,7 @@ function useInboxNotificationsSuspense_withClient(client, options) {
|
|
|
2403
2564
|
}
|
|
2404
2565
|
function useUnreadInboxNotificationsCount_withClient(client, options) {
|
|
2405
2566
|
const { store, unreadNotificationsCountPollersByQueryKey: pollers } = getLiveblocksExtrasForClient(client);
|
|
2406
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2567
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _19 => _19.query]));
|
|
2407
2568
|
const poller = pollers.getOrCreate(queryKey);
|
|
2408
2569
|
_react.useEffect.call(void 0,
|
|
2409
2570
|
() => void store.outputs.unreadNotificationsCount.getOrCreate(queryKey).waitUntilLoaded()
|
|
@@ -2432,7 +2593,7 @@ function useUnreadInboxNotificationsCount_withClient(client, options) {
|
|
|
2432
2593
|
function useUnreadInboxNotificationsCountSuspense_withClient(client, options) {
|
|
2433
2594
|
ensureNotServerSide();
|
|
2434
2595
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
2435
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2596
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _20 => _20.query]));
|
|
2436
2597
|
use(
|
|
2437
2598
|
store.outputs.unreadNotificationsCount.getOrCreate(queryKey).waitUntilLoaded()
|
|
2438
2599
|
);
|
|
@@ -2603,7 +2764,7 @@ function useUpdateNotificationSettings_withClient(client) {
|
|
|
2603
2764
|
store.optimisticUpdates.remove(optimisticUpdateId);
|
|
2604
2765
|
if (err instanceof _core.HttpError) {
|
|
2605
2766
|
if (err.status === 422) {
|
|
2606
|
-
const msg = [_optionalChain([err, 'access',
|
|
2767
|
+
const msg = [_optionalChain([err, 'access', _21 => _21.details, 'optionalAccess', _22 => _22.error]), _optionalChain([err, 'access', _23 => _23.details, 'optionalAccess', _24 => _24.reason])].filter(Boolean).join("\n");
|
|
2607
2768
|
_core.console.error(msg);
|
|
2608
2769
|
}
|
|
2609
2770
|
client[_core.kInternal].emitError(
|
|
@@ -2838,7 +2999,7 @@ function useGroupInfoSuspense_withClient(client, groupId) {
|
|
|
2838
2999
|
function useAiChats(options) {
|
|
2839
3000
|
const client = useClient();
|
|
2840
3001
|
const store = getUmbrellaStoreForClient(client);
|
|
2841
|
-
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
3002
|
+
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _25 => _25.query]));
|
|
2842
3003
|
useEnsureAiConnection(client);
|
|
2843
3004
|
_react.useEffect.call(void 0,
|
|
2844
3005
|
() => void store.outputs.aiChats.getOrCreate(queryKey).waitUntilLoaded()
|
|
@@ -2862,7 +3023,7 @@ function useAiChatsSuspense(options) {
|
|
|
2862
3023
|
const client = useClient();
|
|
2863
3024
|
const store = getUmbrellaStoreForClient(client);
|
|
2864
3025
|
useEnsureAiConnection(client);
|
|
2865
|
-
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
3026
|
+
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _26 => _26.query]));
|
|
2866
3027
|
use(store.outputs.aiChats.getOrCreate(queryKey).waitUntilLoaded());
|
|
2867
3028
|
const result = useAiChats(options);
|
|
2868
3029
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
@@ -2874,7 +3035,7 @@ function useAiChatMessages(chatId, options) {
|
|
|
2874
3035
|
const store = getUmbrellaStoreForClient(client);
|
|
2875
3036
|
useEnsureAiConnection(client);
|
|
2876
3037
|
_react.useEffect.call(void 0,
|
|
2877
|
-
() => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3038
|
+
() => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _27 => _27.branchId]), () => ( null))).waitUntilLoaded()
|
|
2878
3039
|
// NOTE: Deliberately *not* using a dependency array here!
|
|
2879
3040
|
//
|
|
2880
3041
|
// It is important to call waitUntil on *every* render.
|
|
@@ -2885,7 +3046,7 @@ function useAiChatMessages(chatId, options) {
|
|
|
2885
3046
|
// *next* render after that, a *new* fetch/promise will get created.
|
|
2886
3047
|
);
|
|
2887
3048
|
return useSignal(
|
|
2888
|
-
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3049
|
+
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _28 => _28.branchId]), () => ( null))).signal
|
|
2889
3050
|
);
|
|
2890
3051
|
}
|
|
2891
3052
|
function useAiChatMessagesSuspense(chatId, options) {
|
|
@@ -2894,7 +3055,7 @@ function useAiChatMessagesSuspense(chatId, options) {
|
|
|
2894
3055
|
const store = getUmbrellaStoreForClient(client);
|
|
2895
3056
|
useEnsureAiConnection(client);
|
|
2896
3057
|
use(
|
|
2897
|
-
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3058
|
+
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _29 => _29.branchId]), () => ( null))).waitUntilLoaded()
|
|
2898
3059
|
);
|
|
2899
3060
|
const result = useAiChatMessages(chatId, options);
|
|
2900
3061
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
@@ -3013,12 +3174,12 @@ function useAiChatStatus(chatId, branchId) {
|
|
|
3013
3174
|
if (result.error) return IDLE;
|
|
3014
3175
|
const messages = result.messages;
|
|
3015
3176
|
const lastMessage = messages[messages.length - 1];
|
|
3016
|
-
if (_optionalChain([lastMessage, 'optionalAccess',
|
|
3177
|
+
if (_optionalChain([lastMessage, 'optionalAccess', _30 => _30.role]) !== "assistant") return IDLE;
|
|
3017
3178
|
if (lastMessage.status !== "generating" && lastMessage.status !== "awaiting-tool")
|
|
3018
3179
|
return IDLE;
|
|
3019
3180
|
const contentSoFar = lastMessage.contentSoFar;
|
|
3020
3181
|
const lastPart = contentSoFar[contentSoFar.length - 1];
|
|
3021
|
-
if (_optionalChain([lastPart, 'optionalAccess',
|
|
3182
|
+
if (_optionalChain([lastPart, 'optionalAccess', _31 => _31.type]) === "tool-invocation") {
|
|
3022
3183
|
return {
|
|
3023
3184
|
status: "generating",
|
|
3024
3185
|
partType: "tool-invocation",
|
|
@@ -3027,7 +3188,7 @@ function useAiChatStatus(chatId, branchId) {
|
|
|
3027
3188
|
} else {
|
|
3028
3189
|
return {
|
|
3029
3190
|
status: "generating",
|
|
3030
|
-
partType: _optionalChain([lastPart, 'optionalAccess',
|
|
3191
|
+
partType: _optionalChain([lastPart, 'optionalAccess', _32 => _32.type])
|
|
3031
3192
|
};
|
|
3032
3193
|
}
|
|
3033
3194
|
},
|
|
@@ -3055,7 +3216,7 @@ function useSendAiMessage(chatId, options) {
|
|
|
3055
3216
|
"chatId must be provided to either `useSendAiMessage` or its returned function."
|
|
3056
3217
|
)));
|
|
3057
3218
|
const messages = client[_core.kInternal].ai.signals.getChatMessagesForBranch\u03A3(resolvedChatId).get();
|
|
3058
|
-
if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess',
|
|
3219
|
+
if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess', _33 => _33.copilotId])) {
|
|
3059
3220
|
_core.console.warn(
|
|
3060
3221
|
`No copilot ID was provided to useSendAiMessage when sending the message "${messageText.slice(
|
|
3061
3222
|
0,
|
|
@@ -3067,8 +3228,8 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
3067
3228
|
)}\u2026", copilotId: "co_xxx" })'`
|
|
3068
3229
|
);
|
|
3069
3230
|
}
|
|
3070
|
-
const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess',
|
|
3071
|
-
const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access',
|
|
3231
|
+
const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess', _34 => _34.copilotId]))), () => ( client[_core.kInternal].ai.getLastUsedCopilotId(resolvedChatId)));
|
|
3232
|
+
const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _35 => _35[messages.length - 1], 'optionalAccess', _36 => _36.id]), () => ( null));
|
|
3072
3233
|
const content = [{ type: "text", text: messageText }];
|
|
3073
3234
|
const newMessageId = client[_core.kInternal].ai[_core.kInternal].context.messagesStore.createOptimistically(
|
|
3074
3235
|
resolvedChatId,
|
|
@@ -3088,14 +3249,14 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
3088
3249
|
{ id: newMessageId, parentMessageId: lastMessageId, content },
|
|
3089
3250
|
targetMessageId,
|
|
3090
3251
|
{
|
|
3091
|
-
stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess',
|
|
3252
|
+
stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _37 => _37.stream]))),
|
|
3092
3253
|
copilotId: resolvedCopilotId,
|
|
3093
|
-
timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess',
|
|
3254
|
+
timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _38 => _38.timeout])))
|
|
3094
3255
|
}
|
|
3095
3256
|
);
|
|
3096
3257
|
return newMessage;
|
|
3097
3258
|
},
|
|
3098
|
-
[client, chatId, _optionalChain([options, 'optionalAccess',
|
|
3259
|
+
[client, chatId, _optionalChain([options, 'optionalAccess', _39 => _39.copilotId]), _optionalChain([options, 'optionalAccess', _40 => _40.stream]), _optionalChain([options, 'optionalAccess', _41 => _41.timeout])]
|
|
3099
3260
|
);
|
|
3100
3261
|
}
|
|
3101
3262
|
function createSharedContext(client) {
|
|
@@ -3130,7 +3291,7 @@ function createSharedContext(client) {
|
|
|
3130
3291
|
}
|
|
3131
3292
|
function useEnsureNoLiveblocksProvider(options) {
|
|
3132
3293
|
const existing = useClientOrNull();
|
|
3133
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
3294
|
+
if (!_optionalChain([options, 'optionalAccess', _42 => _42.allowNesting]) && existing !== null) {
|
|
3134
3295
|
throw new Error(
|
|
3135
3296
|
"You cannot nest multiple LiveblocksProvider instances in the same React tree."
|
|
3136
3297
|
);
|
|
@@ -3293,7 +3454,7 @@ var _useAiChatMessagesSuspense = useAiChatMessagesSuspense;
|
|
|
3293
3454
|
var _useUrlMetadata = useUrlMetadata;
|
|
3294
3455
|
var _useUrlMetadataSuspense = useUrlMetadataSuspense;
|
|
3295
3456
|
function useSyncStatus_withClient(client, options) {
|
|
3296
|
-
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3457
|
+
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _43 => _43.smooth]), () => ( false)));
|
|
3297
3458
|
if (smooth) {
|
|
3298
3459
|
return useSyncStatusSmooth_withClient(client);
|
|
3299
3460
|
} else {
|
|
@@ -3365,7 +3526,6 @@ var _client = require('@liveblocks/client');
|
|
|
3365
3526
|
|
|
3366
3527
|
|
|
3367
3528
|
|
|
3368
|
-
|
|
3369
3529
|
|
|
3370
3530
|
|
|
3371
3531
|
// src/use-scroll-to-comment-on-load-effect.ts
|
|
@@ -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) {
|
|
@@ -3465,8 +3634,8 @@ function makeRoomExtrasForClient(client) {
|
|
|
3465
3634
|
if (innerError.status === 403) {
|
|
3466
3635
|
const detailedMessage = [
|
|
3467
3636
|
innerError.message,
|
|
3468
|
-
_optionalChain([innerError, 'access',
|
|
3469
|
-
_optionalChain([innerError, 'access',
|
|
3637
|
+
_optionalChain([innerError, 'access', _44 => _44.details, 'optionalAccess', _45 => _45.suggestion]),
|
|
3638
|
+
_optionalChain([innerError, 'access', _46 => _46.details, 'optionalAccess', _47 => _47.docs])
|
|
3470
3639
|
].filter(Boolean).join("\n");
|
|
3471
3640
|
_core.console.error(detailedMessage);
|
|
3472
3641
|
}
|
|
@@ -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__ */ _jsxruntime.jsx.call(void 0, LiveblocksProviderWithClient, { client, allowNesting: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 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, _core.kInternal, {
|
|
3829
|
+
enumerable: false
|
|
3830
|
+
});
|
|
3831
|
+
}
|
|
3539
3832
|
function RoomProvider(props) {
|
|
3540
3833
|
const client = useClient();
|
|
3541
3834
|
const [cache] = _react.useState.call(void 0,
|
|
@@ -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
|
+
_react.useEffect.call(void 0, () => {
|
|
3944
|
+
const { store } = getRoomExtrasForClient(client);
|
|
3945
|
+
function handleFeedEvent(message) {
|
|
3946
|
+
switch (message.type) {
|
|
3947
|
+
case _core.ServerMsgCode.FEEDS_ADDED:
|
|
3948
|
+
case _core.ServerMsgCode.FEEDS_UPDATED:
|
|
3949
|
+
store.upsertFeeds(room.id, message.feeds);
|
|
3950
|
+
break;
|
|
3951
|
+
case _core.ServerMsgCode.FEEDS_DELETED:
|
|
3952
|
+
store.deleteFeeds(room.id, message.feeds);
|
|
3953
|
+
break;
|
|
3954
|
+
case _core.ServerMsgCode.FEED_MESSAGES_ADDED:
|
|
3955
|
+
case _core.ServerMsgCode.FEED_MESSAGES_UPDATED:
|
|
3956
|
+
store.upsertFeedMessages(room.id, message.feedId, message.messages);
|
|
3957
|
+
break;
|
|
3958
|
+
case _core.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
|
_react.useEffect.call(void 0, () => {
|
|
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__ */ _jsxruntime.jsx.call(void 0,
|
|
3981
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RoomContext.Provider, { value: room, children: props.children });
|
|
3662
3982
|
}
|
|
3663
|
-
function
|
|
3664
|
-
const room = useRoomOrNull(
|
|
3665
|
-
if (room === null && !_optionalChain([options, 'optionalAccess',
|
|
3983
|
+
function useRoom(options) {
|
|
3984
|
+
const room = useRoomOrNull();
|
|
3985
|
+
if (room === null && !_optionalChain([options, 'optionalAccess', _48 => _48.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 _react.useSyncExternalStore.call(void 0, subscribe, getSnapshot, getServerSnapshot);
|
|
3682
3996
|
}
|
|
3683
|
-
function useStatus() {
|
|
3684
|
-
return useStatus_withRoomContext(GlobalRoomContext);
|
|
3685
|
-
}
|
|
3686
3997
|
function useReportTextEditor(editor, rootKey) {
|
|
3687
3998
|
const isReported = _react.useRef.call(void 0, false);
|
|
3688
3999
|
const room = useRoom();
|
|
@@ -3745,10 +4056,8 @@ function useMentionSuggestionsCache() {
|
|
|
3745
4056
|
const client = useClient();
|
|
3746
4057
|
return client[_core.kInternal].mentionSuggestionsCache;
|
|
3747
4058
|
}
|
|
3748
|
-
function
|
|
3749
|
-
const room =
|
|
3750
|
-
RoomContext
|
|
3751
|
-
);
|
|
4059
|
+
function useBroadcastEvent() {
|
|
4060
|
+
const room = useRoom();
|
|
3752
4061
|
return _react.useCallback.call(void 0,
|
|
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
|
_react.useEffect.call(void 0,
|
|
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
|
_react.useEffect.call(void 0,
|
|
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
|
_react.useEffect.call(void 0, () => {
|
|
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 _react.useSyncExternalStore.call(void 0, 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 _react.useSyncExternalStore.call(void 0, 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 = _nullishCoalesce(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 = _react.useSyncExternalStore.call(void 0, 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 = _react.useCallback.call(void 0,
|
|
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
|
-
_client.shallow
|
|
3942
|
-
);
|
|
4174
|
+
return useOthers(wrappedSelector, wrappedIsEqual);
|
|
3943
4175
|
}
|
|
3944
4176
|
function useOthersConnectionIds() {
|
|
3945
|
-
return
|
|
4177
|
+
return useOthers(selectorFor_useOthersConnectionIds, _client.shallow);
|
|
3946
4178
|
}
|
|
3947
4179
|
var NOT_FOUND = Symbol();
|
|
3948
|
-
function
|
|
4180
|
+
function useOther(connectionId, selector, isEqual) {
|
|
3949
4181
|
const wrappedSelector = _react.useCallback.call(void 0,
|
|
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 _react.useSyncExternalStore.call(void 0, 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 = _react.useCallback.call(void 0,
|
|
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 _react.useMemo.call(void 0,
|
|
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,20 +4292,103 @@ 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
|
+
_react.useEffect.call(void 0, () => {
|
|
4302
|
+
void loadableResource.waitUntilLoaded();
|
|
4303
|
+
});
|
|
4304
|
+
return useSignal(loadableResource.signal);
|
|
4305
|
+
}
|
|
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
|
+
_react.useEffect.call(void 0, () => {
|
|
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
|
+
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
4327
|
+
_core.assert.call(void 0, !result.isLoading, "Did not expect loading");
|
|
4328
|
+
return result;
|
|
4094
4329
|
}
|
|
4095
|
-
function
|
|
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
|
+
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
4339
|
+
_core.assert.call(void 0, !result.isLoading, "Did not expect loading");
|
|
4340
|
+
return result;
|
|
4341
|
+
}
|
|
4342
|
+
function useCreateFeed() {
|
|
4343
|
+
const room = useRoom();
|
|
4344
|
+
return _react.useCallback.call(void 0,
|
|
4345
|
+
(feedId, options) => room.addFeed(feedId, options),
|
|
4346
|
+
[room]
|
|
4347
|
+
);
|
|
4348
|
+
}
|
|
4349
|
+
function useDeleteFeed() {
|
|
4350
|
+
const room = useRoom();
|
|
4351
|
+
return _react.useCallback.call(void 0, (feedId) => room.deleteFeed(feedId), [room]);
|
|
4352
|
+
}
|
|
4353
|
+
function useUpdateFeedMetadata() {
|
|
4354
|
+
const room = useRoom();
|
|
4355
|
+
return _react.useCallback.call(void 0,
|
|
4356
|
+
(feedId, metadata) => room.updateFeed(feedId, metadata),
|
|
4357
|
+
[room]
|
|
4358
|
+
);
|
|
4359
|
+
}
|
|
4360
|
+
function useCreateFeedMessage() {
|
|
4361
|
+
const room = useRoom();
|
|
4362
|
+
return _react.useCallback.call(void 0,
|
|
4363
|
+
(feedId, data, options) => room.addFeedMessage(feedId, data, options),
|
|
4364
|
+
[room]
|
|
4365
|
+
);
|
|
4366
|
+
}
|
|
4367
|
+
function useDeleteFeedMessage() {
|
|
4368
|
+
const room = useRoom();
|
|
4369
|
+
return _react.useCallback.call(void 0,
|
|
4370
|
+
(feedId, messageId) => room.deleteFeedMessage(feedId, messageId),
|
|
4371
|
+
[room]
|
|
4372
|
+
);
|
|
4373
|
+
}
|
|
4374
|
+
function useUpdateFeedMessage() {
|
|
4375
|
+
const room = useRoom();
|
|
4376
|
+
return _react.useCallback.call(void 0,
|
|
4377
|
+
(feedId, messageId, data) => room.updateFeedMessage(feedId, messageId, data),
|
|
4378
|
+
[room]
|
|
4379
|
+
);
|
|
4380
|
+
}
|
|
4381
|
+
function useSearchComments(options) {
|
|
4096
4382
|
const [result, setResult] = _react.useState.call(void 0, {
|
|
4097
4383
|
isLoading: true
|
|
4098
4384
|
});
|
|
4099
4385
|
const currentRequestInfo = _react.useRef.call(void 0, null);
|
|
4100
4386
|
const timeout = _react.useRef.call(void 0, null);
|
|
4101
4387
|
const client = useClient();
|
|
4102
|
-
const room =
|
|
4388
|
+
const room = useRoom();
|
|
4103
4389
|
const queryKey = _core.stableStringify.call(void 0, [room.id, options.query]);
|
|
4104
4390
|
_react.useEffect.call(void 0, () => {
|
|
4105
|
-
const currentRequestId = (_nullishCoalesce(_optionalChain([currentRequestInfo, 'access',
|
|
4391
|
+
const currentRequestId = (_nullishCoalesce(_optionalChain([currentRequestInfo, 'access', _49 => _49.current, 'optionalAccess', _50 => _50.id]), () => ( 0))) + 1;
|
|
4106
4392
|
const controller = new AbortController();
|
|
4107
4393
|
currentRequestInfo.current = { id: currentRequestId, controller };
|
|
4108
4394
|
setResult((result2) => {
|
|
@@ -4119,12 +4405,12 @@ function useSearchComments_withRoomContext(RoomContext, options) {
|
|
|
4119
4405
|
{ signal: controller.signal }
|
|
4120
4406
|
).then(({ data }) => {
|
|
4121
4407
|
if (controller.signal.aborted) return;
|
|
4122
|
-
if (_optionalChain([currentRequestInfo, 'access',
|
|
4408
|
+
if (_optionalChain([currentRequestInfo, 'access', _51 => _51.current, 'optionalAccess', _52 => _52.id]) !== currentRequestId) return;
|
|
4123
4409
|
setResult({ isLoading: false, results: data });
|
|
4124
4410
|
currentRequestInfo.current = null;
|
|
4125
4411
|
}).catch((err) => {
|
|
4126
4412
|
if (controller.signal.aborted) return;
|
|
4127
|
-
if (_optionalChain([currentRequestInfo, 'access',
|
|
4413
|
+
if (_optionalChain([currentRequestInfo, 'access', _53 => _53.current, 'optionalAccess', _54 => _54.id]) !== currentRequestId) return;
|
|
4128
4414
|
setResult({ isLoading: false, error: err });
|
|
4129
4415
|
currentRequestInfo.current = null;
|
|
4130
4416
|
});
|
|
@@ -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();
|
|
@@ -4191,7 +4471,7 @@ function useCreateRoomThread(roomId) {
|
|
|
4191
4471
|
thread: newThread,
|
|
4192
4472
|
roomId
|
|
4193
4473
|
});
|
|
4194
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4474
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _55 => _55.map, 'call', _56 => _56((attachment) => attachment.id)]);
|
|
4195
4475
|
client[_core.kInternal].httpClient.createThread({
|
|
4196
4476
|
roomId,
|
|
4197
4477
|
threadId,
|
|
@@ -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();
|
|
@@ -4236,7 +4513,7 @@ function useDeleteRoomThread(roomId) {
|
|
|
4236
4513
|
const { store, onMutationFailure } = getRoomExtrasForClient(client);
|
|
4237
4514
|
const userId = getCurrentUserId(client);
|
|
4238
4515
|
const existing = store.outputs.threads.get().get(threadId);
|
|
4239
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
4516
|
+
if (_optionalChain([existing, 'optionalAccess', _57 => _57.comments, 'optionalAccess', _58 => _58[0], 'optionalAccess', _59 => _59.userId]) !== userId) {
|
|
4240
4517
|
throw new Error("Only the thread creator can delete the thread");
|
|
4241
4518
|
}
|
|
4242
4519
|
const optimisticId = store.optimisticUpdates.add({
|
|
@@ -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();
|
|
@@ -4388,7 +4654,7 @@ function useCreateRoomComment(roomId) {
|
|
|
4388
4654
|
type: "create-comment",
|
|
4389
4655
|
comment
|
|
4390
4656
|
});
|
|
4391
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4657
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _60 => _60.map, 'call', _61 => _61((attachment) => attachment.id)]);
|
|
4392
4658
|
client[_core.kInternal].httpClient.createComment({
|
|
4393
4659
|
roomId,
|
|
4394
4660
|
threadId,
|
|
@@ -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();
|
|
@@ -4466,7 +4729,7 @@ function useEditRoomComment(roomId) {
|
|
|
4466
4729
|
metadata: updatedMetadata
|
|
4467
4730
|
}
|
|
4468
4731
|
});
|
|
4469
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4732
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _62 => _62.map, 'call', _63 => _63((attachment) => attachment.id)]);
|
|
4470
4733
|
client[_core.kInternal].httpClient.editComment({
|
|
4471
4734
|
roomId,
|
|
4472
4735
|
threadId,
|
|
@@ -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 _react.useCallback.call(void 0,
|
|
@@ -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();
|
|
@@ -4852,7 +5084,7 @@ function useRoomThreadSubscription(roomId, threadId) {
|
|
|
4852
5084
|
}
|
|
4853
5085
|
return {
|
|
4854
5086
|
status: "subscribed",
|
|
4855
|
-
unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess',
|
|
5087
|
+
unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _64 => _64.readAt]), () => ( null)),
|
|
4856
5088
|
subscribe,
|
|
4857
5089
|
unsubscribe
|
|
4858
5090
|
};
|
|
@@ -4861,10 +5093,10 @@ function useRoomThreadSubscription(roomId, threadId) {
|
|
|
4861
5093
|
);
|
|
4862
5094
|
return useSignal(signal, selector, _client.shallow);
|
|
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
|
_react.useEffect.call(void 0,
|
|
@@ -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
|
_core.assert.call(void 0, !settings.error, "Did not expect error");
|
|
4908
5137
|
_core.assert.call(void 0, !settings.isLoading, "Did not expect loading");
|
|
4909
5138
|
return _react.useMemo.call(void 0, () => {
|
|
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] = _react.useState.call(void 0, {
|
|
4918
5144
|
isLoading: true
|
|
4919
5145
|
});
|
|
4920
|
-
const room =
|
|
5146
|
+
const room = useRoom();
|
|
4921
5147
|
_react.useEffect.call(void 0, () => {
|
|
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
|
_react.useEffect.call(void 0, () => {
|
|
@@ -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
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
4982
5202
|
_core.assert.call(void 0, !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 _react.useCallback.call(void 0,
|
|
4992
5209
|
(settings) => {
|
|
4993
5210
|
const { store, onMutationFailure, pollThreadsForRoomId } = getRoomExtrasForClient(client);
|
|
@@ -5022,120 +5239,63 @@ 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
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
5131
5294
|
_core.assert.call(void 0, !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
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
5298
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _65 => _65.isLoading])) {
|
|
5139
5299
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
5140
5300
|
}
|
|
5141
5301
|
if (state.error) {
|
|
@@ -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
|
_client.shallow
|
|
5173
5330
|
);
|
|
5174
5331
|
}
|
|
5175
|
-
function
|
|
5176
|
-
const room =
|
|
5332
|
+
function useAttachmentUrlSuspense(attachmentId) {
|
|
5333
|
+
const room = useRoom();
|
|
5177
5334
|
const { attachmentUrlsStore } = room[_core.kInternal];
|
|
5178
5335
|
const getAttachmentUrlState = _react.useCallback.call(void 0,
|
|
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__ */ _jsxruntime.jsx.call(void 0, LiveblocksProviderWithClient, { client, allowNesting: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 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, _core.kInternal, {
|
|
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;
|
|
@@ -5743,5 +5535,15 @@ var _useUpdateMyPresence = useUpdateMyPresence;
|
|
|
5743
5535
|
|
|
5744
5536
|
|
|
5745
5537
|
|
|
5746
|
-
|
|
5747
|
-
|
|
5538
|
+
|
|
5539
|
+
|
|
5540
|
+
|
|
5541
|
+
|
|
5542
|
+
|
|
5543
|
+
|
|
5544
|
+
|
|
5545
|
+
|
|
5546
|
+
|
|
5547
|
+
|
|
5548
|
+
exports.ClientContext = ClientContext; exports.useClientOrNull = useClientOrNull; exports.useClient = useClient; exports.RoomContext = RoomContext; exports.useLatest = useLatest; exports.RegisterAiKnowledge = RegisterAiKnowledge; exports.RegisterAiTool = RegisterAiTool; exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector; exports.useSignal = useSignal; exports.getUmbrellaStoreForClient = getUmbrellaStoreForClient; exports.useCreateAiChat = useCreateAiChat; exports.useDeleteAiChat = useDeleteAiChat; exports.useAiChatStatus = useAiChatStatus; exports.useSendAiMessage = useSendAiMessage; exports.LiveblocksProvider = LiveblocksProvider; exports.createLiveblocksContext = createLiveblocksContext; exports.useInboxNotifications = useInboxNotifications; exports.useInboxNotificationsSuspense = useInboxNotificationsSuspense; exports.useMarkAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = useMarkInboxNotificationAsRead; exports.useDeleteAllInboxNotifications = useDeleteAllInboxNotifications; exports.useDeleteInboxNotification = useDeleteInboxNotification; exports.useUnreadInboxNotificationsCount = useUnreadInboxNotificationsCount; exports.useUnreadInboxNotificationsCountSuspense = useUnreadInboxNotificationsCountSuspense; exports.useNotificationSettings = useNotificationSettings; exports.useNotificationSettingsSuspense = useNotificationSettingsSuspense; exports.useUpdateNotificationSettings = useUpdateNotificationSettings; exports.useRoomInfo = useRoomInfo; exports.useRoomInfoSuspense = useRoomInfoSuspense; exports.useGroupInfo = useGroupInfo; exports.useGroupInfoSuspense = useGroupInfoSuspense; exports._useInboxNotificationThread = _useInboxNotificationThread; exports._useUser = _useUser; exports._useUserSuspense = _useUserSuspense; exports._useUserThreads_experimental = _useUserThreads_experimental; exports._useUserThreadsSuspense_experimental = _useUserThreadsSuspense_experimental; exports._useAiChats = _useAiChats; exports._useAiChatsSuspense = _useAiChatsSuspense; exports._useAiChat = _useAiChat; exports._useAiChatSuspense = _useAiChatSuspense; exports._useAiChatMessages = _useAiChatMessages; exports._useAiChatMessagesSuspense = _useAiChatMessagesSuspense; exports._useUrlMetadata = _useUrlMetadata; exports._useUrlMetadataSuspense = _useUrlMetadataSuspense; exports.useSyncStatus = useSyncStatus; exports.useErrorListener = useErrorListener; exports.useStatus = useStatus; exports.useReportTextEditor = useReportTextEditor; exports.useYjsProvider = useYjsProvider; exports.useCreateTextMention = useCreateTextMention; exports.useDeleteTextMention = useDeleteTextMention; exports.useResolveMentionSuggestions = useResolveMentionSuggestions; exports.useMentionSuggestionsCache = useMentionSuggestionsCache; exports.useLostConnectionListener = useLostConnectionListener; exports.useHistory = useHistory; exports.useUndo = useUndo; exports.useRedo = useRedo; exports.useCanUndo = useCanUndo; exports.useCanRedo = useCanRedo; exports.useOthersConnectionIds = useOthersConnectionIds; exports.useCreateFeed = useCreateFeed; exports.useDeleteFeed = useDeleteFeed; exports.useUpdateFeedMetadata = useUpdateFeedMetadata; exports.useCreateFeedMessage = useCreateFeedMessage; exports.useDeleteFeedMessage = useDeleteFeedMessage; exports.useUpdateFeedMessage = useUpdateFeedMessage; exports.useCreateRoomThread = useCreateRoomThread; exports.useDeleteRoomThread = useDeleteRoomThread; exports.useEditRoomThreadMetadata = useEditRoomThreadMetadata; exports.useCreateRoomComment = useCreateRoomComment; exports.useEditRoomComment = useEditRoomComment; exports.useDeleteComment = useDeleteComment; exports.useDeleteRoomComment = useDeleteRoomComment; exports.useAddRoomCommentReaction = useAddRoomCommentReaction; exports.useRemoveReaction = useRemoveReaction; exports.useRemoveRoomCommentReaction = useRemoveRoomCommentReaction; exports.useMarkThreadAsRead = useMarkThreadAsRead; exports.useMarkRoomThreadAsRead = useMarkRoomThreadAsRead; exports.useMarkThreadAsResolved = useMarkThreadAsResolved; exports.useMarkRoomThreadAsResolved = useMarkRoomThreadAsResolved; exports.useMarkThreadAsUnresolved = useMarkThreadAsUnresolved; exports.useMarkRoomThreadAsUnresolved = useMarkRoomThreadAsUnresolved; exports.useSubscribeToThread = useSubscribeToThread; exports.useUnsubscribeFromThread = useUnsubscribeFromThread; exports.useThreadSubscription = useThreadSubscription; exports.useRoomThreadSubscription = useRoomThreadSubscription; exports.useHistoryVersionData = useHistoryVersionData; exports.useUpdateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useAttachmentUrl = useAttachmentUrl; exports.useRoomAttachmentUrl = useRoomAttachmentUrl; exports.useAttachmentUrlSuspense = useAttachmentUrlSuspense; exports.useRoomPermissions = useRoomPermissions; exports.createRoomContext = createRoomContext; exports._RoomProvider = _RoomProvider; exports._useBroadcastEvent = _useBroadcastEvent; exports._useOthersListener = _useOthersListener; exports._useRoom = _useRoom; exports._useIsInsideRoom = _useIsInsideRoom; exports._useAddReaction = _useAddReaction; exports._useMutation = _useMutation; exports._useCreateThread = _useCreateThread; exports._useDeleteThread = _useDeleteThread; exports._useEditThreadMetadata = _useEditThreadMetadata; exports._useCreateComment = _useCreateComment; exports._useEditComment = _useEditComment; exports._useEditCommentMetadata = _useEditCommentMetadata; exports._useEventListener = _useEventListener; exports._useMyPresence = _useMyPresence; exports._useOthersMapped = _useOthersMapped; exports._useOthersMappedSuspense = _useOthersMappedSuspense; exports._useThreads = _useThreads; exports._useFeeds = _useFeeds; exports._useFeedMessages = _useFeedMessages; exports._useFeedsSuspense = _useFeedsSuspense; exports._useFeedMessagesSuspense = _useFeedMessagesSuspense; exports._useSearchComments = _useSearchComments; exports._useThreadsSuspense = _useThreadsSuspense; exports._useRoomSubscriptionSettings = _useRoomSubscriptionSettings; exports._useRoomSubscriptionSettingsSuspense = _useRoomSubscriptionSettingsSuspense; 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;
|
|
5549
|
+
//# sourceMappingURL=chunk-FLKIHVRX.cjs.map
|