@liveblocks/react 3.15.0-feeds2 → 3.15.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_private.cjs +7 -7
- package/dist/_private.d.cts +2 -2
- package/dist/_private.d.ts +2 -2
- package/dist/_private.js +1 -1
- package/dist/{chunk-GWYQHSXI.js → chunk-7TVEKSIE.js} +725 -527
- package/dist/chunk-7TVEKSIE.js.map +1 -0
- package/dist/{chunk-NHU725OF.cjs → chunk-L3D3UECF.cjs} +761 -563
- package/dist/chunk-L3D3UECF.cjs.map +1 -0
- package/dist/{chunk-7I2IBAFZ.cjs → chunk-SBRWCEYI.cjs} +2 -2
- package/dist/{chunk-7I2IBAFZ.cjs.map → chunk-SBRWCEYI.cjs.map} +1 -1
- package/dist/{chunk-H7GF5P7X.js → chunk-XWDDGVZ4.js} +2 -2
- package/dist/index.cjs +4 -20
- 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 +4 -20
- package/dist/index.js.map +1 -1
- package/dist/{room-c0k0bfIo.d.cts → room-C3ujtNzt.d.cts} +20 -182
- package/dist/{room-c0k0bfIo.d.ts → room-C3ujtNzt.d.ts} +20 -182
- package/dist/suspense.cjs +4 -20
- 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 +4 -20
- package/dist/suspense.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-GWYQHSXI.js.map +0 -1
- package/dist/chunk-NHU725OF.cjs.map +0 -1
- /package/dist/{chunk-H7GF5P7X.js.map → chunk-XWDDGVZ4.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 GlobalRoomContext = _react.createContext.call(void 0, null);
|
|
12
|
+
function useRoomOrNull(RoomContext = GlobalRoomContext) {
|
|
13
13
|
return _react.useContext.call(void 0, RoomContext);
|
|
14
14
|
}
|
|
15
15
|
function useIsInsideRoom() {
|
|
@@ -512,12 +512,6 @@ 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
|
-
}
|
|
521
515
|
function usify(promise) {
|
|
522
516
|
if ("status" in promise) {
|
|
523
517
|
return promise;
|
|
@@ -985,16 +979,6 @@ var UmbrellaStore = class {
|
|
|
985
979
|
#roomVersionsLastRequestedAtByRoom = /* @__PURE__ */ new Map();
|
|
986
980
|
// Notification Settings
|
|
987
981
|
#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
|
-
});
|
|
998
982
|
constructor(client) {
|
|
999
983
|
this.#client = client[_core.kInternal].as();
|
|
1000
984
|
this.optimisticUpdates = createStore_forOptimistic(this.#client);
|
|
@@ -1366,91 +1350,6 @@ var UmbrellaStore = class {
|
|
|
1366
1350
|
return { signal, waitUntilLoaded: resource.waitUntilLoaded };
|
|
1367
1351
|
}
|
|
1368
1352
|
);
|
|
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
|
-
);
|
|
1454
1353
|
this.outputs = {
|
|
1455
1354
|
threadifications,
|
|
1456
1355
|
threads,
|
|
@@ -1466,9 +1365,7 @@ var UmbrellaStore = class {
|
|
|
1466
1365
|
aiChats,
|
|
1467
1366
|
messagesByChatId,
|
|
1468
1367
|
aiChatById,
|
|
1469
|
-
urlMetadataByUrl
|
|
1470
|
-
loadingFeeds,
|
|
1471
|
-
loadingFeedMessages
|
|
1368
|
+
urlMetadataByUrl
|
|
1472
1369
|
};
|
|
1473
1370
|
autobind(this);
|
|
1474
1371
|
}
|
|
@@ -1689,64 +1586,6 @@ var UmbrellaStore = class {
|
|
|
1689
1586
|
result.subscriptions.deleted
|
|
1690
1587
|
);
|
|
1691
1588
|
}
|
|
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
|
-
}
|
|
1750
1589
|
async fetchUnreadNotificationsCount(queryKey, signal) {
|
|
1751
1590
|
const query = JSON.parse(queryKey);
|
|
1752
1591
|
const result = await this.#client.getUnreadInboxNotificationsCount({
|
|
@@ -2157,7 +1996,7 @@ function applyUpsertComment(thread, comment) {
|
|
|
2157
1996
|
updatedAt: new Date(
|
|
2158
1997
|
Math.max(
|
|
2159
1998
|
thread.updatedAt.getTime(),
|
|
2160
|
-
_optionalChain([comment, 'access',
|
|
1999
|
+
_optionalChain([comment, 'access', _8 => _8.editedAt, 'optionalAccess', _9 => _9.getTime, 'call', _10 => _10()]) || comment.createdAt.getTime()
|
|
2161
2000
|
)
|
|
2162
2001
|
),
|
|
2163
2002
|
comments: updatedComments
|
|
@@ -2314,7 +2153,7 @@ function selectorFor_useUnreadInboxNotificationsCount(result) {
|
|
|
2314
2153
|
return ASYNC_OK("count", result.count);
|
|
2315
2154
|
}
|
|
2316
2155
|
function selectorFor_useUser(state, userId) {
|
|
2317
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
2156
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _11 => _11.isLoading])) {
|
|
2318
2157
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
2319
2158
|
}
|
|
2320
2159
|
if (state.error) {
|
|
@@ -2332,7 +2171,7 @@ function selectorFor_useUser(state, userId) {
|
|
|
2332
2171
|
};
|
|
2333
2172
|
}
|
|
2334
2173
|
function selectorFor_useRoomInfo(state, roomId) {
|
|
2335
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
2174
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _12 => _12.isLoading])) {
|
|
2336
2175
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
2337
2176
|
}
|
|
2338
2177
|
if (state.error) {
|
|
@@ -2350,7 +2189,7 @@ function selectorFor_useRoomInfo(state, roomId) {
|
|
|
2350
2189
|
};
|
|
2351
2190
|
}
|
|
2352
2191
|
function selectorFor_useGroupInfo(state, groupId) {
|
|
2353
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
2192
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _13 => _13.isLoading])) {
|
|
2354
2193
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
2355
2194
|
}
|
|
2356
2195
|
if (state.error) {
|
|
@@ -2520,7 +2359,7 @@ function makeLiveblocksContextBundle(client) {
|
|
|
2520
2359
|
}
|
|
2521
2360
|
function useInboxNotifications_withClient(client, selector, isEqual, options) {
|
|
2522
2361
|
const { store, notificationsPoller: poller } = getLiveblocksExtrasForClient(client);
|
|
2523
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2362
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _14 => _14.query]));
|
|
2524
2363
|
_react.useEffect.call(void 0,
|
|
2525
2364
|
() => void store.outputs.loadingNotifications.getOrCreate(queryKey).waitUntilLoaded()
|
|
2526
2365
|
// NOTE: Deliberately *not* using a dependency array here!
|
|
@@ -2548,7 +2387,7 @@ function useInboxNotifications_withClient(client, selector, isEqual, options) {
|
|
|
2548
2387
|
function useInboxNotificationsSuspense_withClient(client, options) {
|
|
2549
2388
|
ensureNotServerSide();
|
|
2550
2389
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
2551
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2390
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _15 => _15.query]));
|
|
2552
2391
|
use(
|
|
2553
2392
|
store.outputs.loadingNotifications.getOrCreate(queryKey).waitUntilLoaded()
|
|
2554
2393
|
);
|
|
@@ -2564,7 +2403,7 @@ function useInboxNotificationsSuspense_withClient(client, options) {
|
|
|
2564
2403
|
}
|
|
2565
2404
|
function useUnreadInboxNotificationsCount_withClient(client, options) {
|
|
2566
2405
|
const { store, unreadNotificationsCountPollersByQueryKey: pollers } = getLiveblocksExtrasForClient(client);
|
|
2567
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2406
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _16 => _16.query]));
|
|
2568
2407
|
const poller = pollers.getOrCreate(queryKey);
|
|
2569
2408
|
_react.useEffect.call(void 0,
|
|
2570
2409
|
() => void store.outputs.unreadNotificationsCount.getOrCreate(queryKey).waitUntilLoaded()
|
|
@@ -2593,7 +2432,7 @@ function useUnreadInboxNotificationsCount_withClient(client, options) {
|
|
|
2593
2432
|
function useUnreadInboxNotificationsCountSuspense_withClient(client, options) {
|
|
2594
2433
|
ensureNotServerSide();
|
|
2595
2434
|
const store = getLiveblocksExtrasForClient(client).store;
|
|
2596
|
-
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2435
|
+
const queryKey = makeInboxNotificationsQueryKey(_optionalChain([options, 'optionalAccess', _17 => _17.query]));
|
|
2597
2436
|
use(
|
|
2598
2437
|
store.outputs.unreadNotificationsCount.getOrCreate(queryKey).waitUntilLoaded()
|
|
2599
2438
|
);
|
|
@@ -2764,7 +2603,7 @@ function useUpdateNotificationSettings_withClient(client) {
|
|
|
2764
2603
|
store.optimisticUpdates.remove(optimisticUpdateId);
|
|
2765
2604
|
if (err instanceof _core.HttpError) {
|
|
2766
2605
|
if (err.status === 422) {
|
|
2767
|
-
const msg = [_optionalChain([err, 'access',
|
|
2606
|
+
const msg = [_optionalChain([err, 'access', _18 => _18.details, 'optionalAccess', _19 => _19.error]), _optionalChain([err, 'access', _20 => _20.details, 'optionalAccess', _21 => _21.reason])].filter(Boolean).join("\n");
|
|
2768
2607
|
_core.console.error(msg);
|
|
2769
2608
|
}
|
|
2770
2609
|
client[_core.kInternal].emitError(
|
|
@@ -2999,7 +2838,7 @@ function useGroupInfoSuspense_withClient(client, groupId) {
|
|
|
2999
2838
|
function useAiChats(options) {
|
|
3000
2839
|
const client = useClient();
|
|
3001
2840
|
const store = getUmbrellaStoreForClient(client);
|
|
3002
|
-
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2841
|
+
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _22 => _22.query]));
|
|
3003
2842
|
useEnsureAiConnection(client);
|
|
3004
2843
|
_react.useEffect.call(void 0,
|
|
3005
2844
|
() => void store.outputs.aiChats.getOrCreate(queryKey).waitUntilLoaded()
|
|
@@ -3023,7 +2862,7 @@ function useAiChatsSuspense(options) {
|
|
|
3023
2862
|
const client = useClient();
|
|
3024
2863
|
const store = getUmbrellaStoreForClient(client);
|
|
3025
2864
|
useEnsureAiConnection(client);
|
|
3026
|
-
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess',
|
|
2865
|
+
const queryKey = makeAiChatsQueryKey(_optionalChain([options, 'optionalAccess', _23 => _23.query]));
|
|
3027
2866
|
use(store.outputs.aiChats.getOrCreate(queryKey).waitUntilLoaded());
|
|
3028
2867
|
const result = useAiChats(options);
|
|
3029
2868
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
@@ -3035,7 +2874,7 @@ function useAiChatMessages(chatId, options) {
|
|
|
3035
2874
|
const store = getUmbrellaStoreForClient(client);
|
|
3036
2875
|
useEnsureAiConnection(client);
|
|
3037
2876
|
_react.useEffect.call(void 0,
|
|
3038
|
-
() => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2877
|
+
() => void store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.branchId]), () => ( null))).waitUntilLoaded()
|
|
3039
2878
|
// NOTE: Deliberately *not* using a dependency array here!
|
|
3040
2879
|
//
|
|
3041
2880
|
// It is important to call waitUntil on *every* render.
|
|
@@ -3046,7 +2885,7 @@ function useAiChatMessages(chatId, options) {
|
|
|
3046
2885
|
// *next* render after that, a *new* fetch/promise will get created.
|
|
3047
2886
|
);
|
|
3048
2887
|
return useSignal(
|
|
3049
|
-
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2888
|
+
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _25 => _25.branchId]), () => ( null))).signal
|
|
3050
2889
|
);
|
|
3051
2890
|
}
|
|
3052
2891
|
function useAiChatMessagesSuspense(chatId, options) {
|
|
@@ -3055,7 +2894,7 @@ function useAiChatMessagesSuspense(chatId, options) {
|
|
|
3055
2894
|
const store = getUmbrellaStoreForClient(client);
|
|
3056
2895
|
useEnsureAiConnection(client);
|
|
3057
2896
|
use(
|
|
3058
|
-
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
2897
|
+
store.outputs.messagesByChatId.getOrCreate(chatId).getOrCreate(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.branchId]), () => ( null))).waitUntilLoaded()
|
|
3059
2898
|
);
|
|
3060
2899
|
const result = useAiChatMessages(chatId, options);
|
|
3061
2900
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
@@ -3174,12 +3013,12 @@ function useAiChatStatus(chatId, branchId) {
|
|
|
3174
3013
|
if (result.error) return IDLE;
|
|
3175
3014
|
const messages = result.messages;
|
|
3176
3015
|
const lastMessage = messages[messages.length - 1];
|
|
3177
|
-
if (_optionalChain([lastMessage, 'optionalAccess',
|
|
3016
|
+
if (_optionalChain([lastMessage, 'optionalAccess', _27 => _27.role]) !== "assistant") return IDLE;
|
|
3178
3017
|
if (lastMessage.status !== "generating" && lastMessage.status !== "awaiting-tool")
|
|
3179
3018
|
return IDLE;
|
|
3180
3019
|
const contentSoFar = lastMessage.contentSoFar;
|
|
3181
3020
|
const lastPart = contentSoFar[contentSoFar.length - 1];
|
|
3182
|
-
if (_optionalChain([lastPart, 'optionalAccess',
|
|
3021
|
+
if (_optionalChain([lastPart, 'optionalAccess', _28 => _28.type]) === "tool-invocation") {
|
|
3183
3022
|
return {
|
|
3184
3023
|
status: "generating",
|
|
3185
3024
|
partType: "tool-invocation",
|
|
@@ -3188,7 +3027,7 @@ function useAiChatStatus(chatId, branchId) {
|
|
|
3188
3027
|
} else {
|
|
3189
3028
|
return {
|
|
3190
3029
|
status: "generating",
|
|
3191
|
-
partType: _optionalChain([lastPart, 'optionalAccess',
|
|
3030
|
+
partType: _optionalChain([lastPart, 'optionalAccess', _29 => _29.type])
|
|
3192
3031
|
};
|
|
3193
3032
|
}
|
|
3194
3033
|
},
|
|
@@ -3216,7 +3055,7 @@ function useSendAiMessage(chatId, options) {
|
|
|
3216
3055
|
"chatId must be provided to either `useSendAiMessage` or its returned function."
|
|
3217
3056
|
)));
|
|
3218
3057
|
const messages = client[_core.kInternal].ai.signals.getChatMessagesForBranch\u03A3(resolvedChatId).get();
|
|
3219
|
-
if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess',
|
|
3058
|
+
if (process.env.NODE_ENV !== "production" && !messageOptionsCopilotId && !_optionalChain([options, 'optionalAccess', _30 => _30.copilotId])) {
|
|
3220
3059
|
_core.console.warn(
|
|
3221
3060
|
`No copilot ID was provided to useSendAiMessage when sending the message "${messageText.slice(
|
|
3222
3061
|
0,
|
|
@@ -3228,8 +3067,8 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
3228
3067
|
)}\u2026", copilotId: "co_xxx" })'`
|
|
3229
3068
|
);
|
|
3230
3069
|
}
|
|
3231
|
-
const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess',
|
|
3232
|
-
const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access',
|
|
3070
|
+
const resolvedCopilotId = _nullishCoalesce(_nullishCoalesce(messageOptionsCopilotId, () => ( _optionalChain([options, 'optionalAccess', _31 => _31.copilotId]))), () => ( client[_core.kInternal].ai.getLastUsedCopilotId(resolvedChatId)));
|
|
3071
|
+
const lastMessageId = _nullishCoalesce(_optionalChain([messages, 'access', _32 => _32[messages.length - 1], 'optionalAccess', _33 => _33.id]), () => ( null));
|
|
3233
3072
|
const content = [{ type: "text", text: messageText }];
|
|
3234
3073
|
const newMessageId = client[_core.kInternal].ai[_core.kInternal].context.messagesStore.createOptimistically(
|
|
3235
3074
|
resolvedChatId,
|
|
@@ -3249,14 +3088,14 @@ To ensure the correct copilot ID is used, specify it either through the hook as
|
|
|
3249
3088
|
{ id: newMessageId, parentMessageId: lastMessageId, content },
|
|
3250
3089
|
targetMessageId,
|
|
3251
3090
|
{
|
|
3252
|
-
stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess',
|
|
3091
|
+
stream: _nullishCoalesce(messageOptions.stream, () => ( _optionalChain([options, 'optionalAccess', _34 => _34.stream]))),
|
|
3253
3092
|
copilotId: resolvedCopilotId,
|
|
3254
|
-
timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess',
|
|
3093
|
+
timeout: _nullishCoalesce(messageOptions.timeout, () => ( _optionalChain([options, 'optionalAccess', _35 => _35.timeout])))
|
|
3255
3094
|
}
|
|
3256
3095
|
);
|
|
3257
3096
|
return newMessage;
|
|
3258
3097
|
},
|
|
3259
|
-
[client, chatId, _optionalChain([options, 'optionalAccess',
|
|
3098
|
+
[client, chatId, _optionalChain([options, 'optionalAccess', _36 => _36.copilotId]), _optionalChain([options, 'optionalAccess', _37 => _37.stream]), _optionalChain([options, 'optionalAccess', _38 => _38.timeout])]
|
|
3260
3099
|
);
|
|
3261
3100
|
}
|
|
3262
3101
|
function createSharedContext(client) {
|
|
@@ -3291,7 +3130,7 @@ function createSharedContext(client) {
|
|
|
3291
3130
|
}
|
|
3292
3131
|
function useEnsureNoLiveblocksProvider(options) {
|
|
3293
3132
|
const existing = useClientOrNull();
|
|
3294
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
3133
|
+
if (!_optionalChain([options, 'optionalAccess', _39 => _39.allowNesting]) && existing !== null) {
|
|
3295
3134
|
throw new Error(
|
|
3296
3135
|
"You cannot nest multiple LiveblocksProvider instances in the same React tree."
|
|
3297
3136
|
);
|
|
@@ -3454,7 +3293,7 @@ var _useAiChatMessagesSuspense = useAiChatMessagesSuspense;
|
|
|
3454
3293
|
var _useUrlMetadata = useUrlMetadata;
|
|
3455
3294
|
var _useUrlMetadataSuspense = useUrlMetadataSuspense;
|
|
3456
3295
|
function useSyncStatus_withClient(client, options) {
|
|
3457
|
-
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3296
|
+
const smooth = useInitial(_nullishCoalesce(_optionalChain([options, 'optionalAccess', _40 => _40.smooth]), () => ( false)));
|
|
3458
3297
|
if (smooth) {
|
|
3459
3298
|
return useSyncStatusSmooth_withClient(client);
|
|
3460
3299
|
} else {
|
|
@@ -3526,6 +3365,7 @@ var _client = require('@liveblocks/client');
|
|
|
3526
3365
|
|
|
3527
3366
|
|
|
3528
3367
|
|
|
3368
|
+
|
|
3529
3369
|
|
|
3530
3370
|
|
|
3531
3371
|
// src/use-scroll-to-comment-on-load-effect.ts
|
|
@@ -3609,15 +3449,6 @@ function getCurrentUserId(client) {
|
|
|
3609
3449
|
return userId;
|
|
3610
3450
|
}
|
|
3611
3451
|
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
|
-
}
|
|
3621
3452
|
function getRoomExtrasForClient(client) {
|
|
3622
3453
|
let extras = _extras2.get(client);
|
|
3623
3454
|
if (!extras) {
|
|
@@ -3634,8 +3465,8 @@ function makeRoomExtrasForClient(client) {
|
|
|
3634
3465
|
if (innerError.status === 403) {
|
|
3635
3466
|
const detailedMessage = [
|
|
3636
3467
|
innerError.message,
|
|
3637
|
-
_optionalChain([innerError, 'access',
|
|
3638
|
-
_optionalChain([innerError, 'access',
|
|
3468
|
+
_optionalChain([innerError, 'access', _41 => _41.details, 'optionalAccess', _42 => _42.suggestion]),
|
|
3469
|
+
_optionalChain([innerError, 'access', _43 => _43.details, 'optionalAccess', _44 => _44.docs])
|
|
3639
3470
|
].filter(Boolean).join("\n");
|
|
3640
3471
|
_core.console.error(detailedMessage);
|
|
3641
3472
|
}
|
|
@@ -3705,130 +3536,6 @@ function makeRoomExtrasForClient(client) {
|
|
|
3705
3536
|
)
|
|
3706
3537
|
};
|
|
3707
3538
|
}
|
|
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
|
-
}
|
|
3832
3539
|
function RoomProvider(props) {
|
|
3833
3540
|
const client = useClient();
|
|
3834
3541
|
const [cache] = _react.useState.call(void 0,
|
|
@@ -3859,7 +3566,7 @@ function RoomProvider(props) {
|
|
|
3859
3566
|
}
|
|
3860
3567
|
function RoomProviderInner(props) {
|
|
3861
3568
|
const client = useClient();
|
|
3862
|
-
const { id: roomId, stableEnterRoom } = props;
|
|
3569
|
+
const { id: roomId, stableEnterRoom, BoundRoomContext } = props;
|
|
3863
3570
|
if (process.env.NODE_ENV !== "production") {
|
|
3864
3571
|
if (!roomId) {
|
|
3865
3572
|
throw new Error(
|
|
@@ -3940,33 +3647,6 @@ function RoomProviderInner(props) {
|
|
|
3940
3647
|
(message) => void handleCommentEvent(message)
|
|
3941
3648
|
);
|
|
3942
3649
|
}, [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]);
|
|
3970
3650
|
_react.useEffect.call(void 0, () => {
|
|
3971
3651
|
const pair = stableEnterRoom(roomId, frozenProps);
|
|
3972
3652
|
setRoomLeavePair(pair);
|
|
@@ -3978,22 +3658,31 @@ function RoomProviderInner(props) {
|
|
|
3978
3658
|
leave();
|
|
3979
3659
|
};
|
|
3980
3660
|
}, [roomId, frozenProps, stableEnterRoom]);
|
|
3981
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3661
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GlobalRoomContext.Provider, { value: room, children: BoundRoomContext ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BoundRoomContext.Provider, { value: room, children: props.children }) : props.children });
|
|
3982
3662
|
}
|
|
3983
|
-
function
|
|
3984
|
-
const room = useRoomOrNull();
|
|
3985
|
-
if (room === null && !_optionalChain([options, 'optionalAccess',
|
|
3663
|
+
function useRoom_withRoomContext(RoomContext, options) {
|
|
3664
|
+
const room = useRoomOrNull(RoomContext);
|
|
3665
|
+
if (room === null && !_optionalChain([options, 'optionalAccess', _45 => _45.allowOutsideRoom])) {
|
|
3986
3666
|
throw new Error("RoomProvider is missing from the React tree.");
|
|
3987
3667
|
}
|
|
3988
3668
|
return room;
|
|
3989
3669
|
}
|
|
3990
|
-
function
|
|
3991
|
-
|
|
3670
|
+
function useRoom(options) {
|
|
3671
|
+
return useRoom_withRoomContext(
|
|
3672
|
+
GlobalRoomContext,
|
|
3673
|
+
options
|
|
3674
|
+
);
|
|
3675
|
+
}
|
|
3676
|
+
function useStatus_withRoomContext(RoomContext) {
|
|
3677
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
3992
3678
|
const subscribe = room.events.status.subscribe;
|
|
3993
3679
|
const getSnapshot = room.getStatus;
|
|
3994
3680
|
const getServerSnapshot = room.getStatus;
|
|
3995
3681
|
return _react.useSyncExternalStore.call(void 0, subscribe, getSnapshot, getServerSnapshot);
|
|
3996
3682
|
}
|
|
3683
|
+
function useStatus() {
|
|
3684
|
+
return useStatus_withRoomContext(GlobalRoomContext);
|
|
3685
|
+
}
|
|
3997
3686
|
function useReportTextEditor(editor, rootKey) {
|
|
3998
3687
|
const isReported = _react.useRef.call(void 0, false);
|
|
3999
3688
|
const room = useRoom();
|
|
@@ -4056,8 +3745,10 @@ function useMentionSuggestionsCache() {
|
|
|
4056
3745
|
const client = useClient();
|
|
4057
3746
|
return client[_core.kInternal].mentionSuggestionsCache;
|
|
4058
3747
|
}
|
|
4059
|
-
function
|
|
4060
|
-
const room =
|
|
3748
|
+
function useBroadcastEvent_withRoomContext(RoomContext) {
|
|
3749
|
+
const room = useRoom_withRoomContext(
|
|
3750
|
+
RoomContext
|
|
3751
|
+
);
|
|
4061
3752
|
return _react.useCallback.call(void 0,
|
|
4062
3753
|
(event, options = { shouldQueueEventIfNotReady: false }) => {
|
|
4063
3754
|
room.broadcastEvent(event, options);
|
|
@@ -4065,16 +3756,24 @@ function useBroadcastEvent() {
|
|
|
4065
3756
|
[room]
|
|
4066
3757
|
);
|
|
4067
3758
|
}
|
|
4068
|
-
function
|
|
4069
|
-
|
|
3759
|
+
function useBroadcastEvent() {
|
|
3760
|
+
return useBroadcastEvent_withRoomContext(GlobalRoomContext);
|
|
3761
|
+
}
|
|
3762
|
+
function useOthersListener_withRoomContext(RoomContext, callback) {
|
|
3763
|
+
const room = useRoom_withRoomContext(
|
|
3764
|
+
RoomContext
|
|
3765
|
+
);
|
|
4070
3766
|
const savedCallback = useLatest(callback);
|
|
4071
3767
|
_react.useEffect.call(void 0,
|
|
4072
3768
|
() => room.events.others.subscribe((event) => savedCallback.current(event)),
|
|
4073
3769
|
[room, savedCallback]
|
|
4074
3770
|
);
|
|
4075
3771
|
}
|
|
4076
|
-
function
|
|
4077
|
-
|
|
3772
|
+
function useOthersListener(callback) {
|
|
3773
|
+
return useOthersListener_withRoomContext(GlobalRoomContext, callback);
|
|
3774
|
+
}
|
|
3775
|
+
function useLostConnectionListener_withRoomContext(RoomContext, callback) {
|
|
3776
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4078
3777
|
const savedCallback = useLatest(callback);
|
|
4079
3778
|
_react.useEffect.call(void 0,
|
|
4080
3779
|
() => room.events.lostConnection.subscribe(
|
|
@@ -4083,8 +3782,13 @@ function useLostConnectionListener(callback) {
|
|
|
4083
3782
|
[room, savedCallback]
|
|
4084
3783
|
);
|
|
4085
3784
|
}
|
|
4086
|
-
function
|
|
4087
|
-
|
|
3785
|
+
function useLostConnectionListener(callback) {
|
|
3786
|
+
return useLostConnectionListener_withRoomContext(GlobalRoomContext, callback);
|
|
3787
|
+
}
|
|
3788
|
+
function useEventListener_withRoomContext(RoomContext, callback) {
|
|
3789
|
+
const room = useRoom_withRoomContext(
|
|
3790
|
+
RoomContext
|
|
3791
|
+
);
|
|
4088
3792
|
const savedCallback = useLatest(callback);
|
|
4089
3793
|
_react.useEffect.call(void 0, () => {
|
|
4090
3794
|
const listener = (eventData) => {
|
|
@@ -4093,29 +3797,49 @@ function useEventListener(callback) {
|
|
|
4093
3797
|
return room.events.customEvent.subscribe(listener);
|
|
4094
3798
|
}, [room, savedCallback]);
|
|
4095
3799
|
}
|
|
3800
|
+
function useEventListener(callback) {
|
|
3801
|
+
return useEventListener_withRoomContext(GlobalRoomContext, callback);
|
|
3802
|
+
}
|
|
3803
|
+
function useHistory_withRoomContext(RoomContext) {
|
|
3804
|
+
return useRoom_withRoomContext(RoomContext).history;
|
|
3805
|
+
}
|
|
4096
3806
|
function useHistory() {
|
|
4097
|
-
return
|
|
3807
|
+
return useHistory_withRoomContext(GlobalRoomContext);
|
|
3808
|
+
}
|
|
3809
|
+
function useUndo_withRoomContext(RoomContext) {
|
|
3810
|
+
return useHistory_withRoomContext(RoomContext).undo;
|
|
4098
3811
|
}
|
|
4099
3812
|
function useUndo() {
|
|
4100
|
-
return
|
|
3813
|
+
return useUndo_withRoomContext(GlobalRoomContext);
|
|
3814
|
+
}
|
|
3815
|
+
function useRedo_withRoomContext(RoomContext) {
|
|
3816
|
+
return useHistory_withRoomContext(RoomContext).redo;
|
|
4101
3817
|
}
|
|
4102
3818
|
function useRedo() {
|
|
4103
|
-
return
|
|
3819
|
+
return useRedo_withRoomContext(GlobalRoomContext);
|
|
4104
3820
|
}
|
|
4105
|
-
function
|
|
4106
|
-
const room =
|
|
3821
|
+
function useCanUndo_withRoomContext(RoomContext) {
|
|
3822
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4107
3823
|
const subscribe = room.events.history.subscribe;
|
|
4108
3824
|
const canUndo = room.history.canUndo;
|
|
4109
3825
|
return _react.useSyncExternalStore.call(void 0, subscribe, canUndo, canUndo);
|
|
4110
3826
|
}
|
|
4111
|
-
function
|
|
4112
|
-
|
|
3827
|
+
function useCanUndo() {
|
|
3828
|
+
return useCanUndo_withRoomContext(GlobalRoomContext);
|
|
3829
|
+
}
|
|
3830
|
+
function useCanRedo_withRoomContext(RoomContext) {
|
|
3831
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4113
3832
|
const subscribe = room.events.history.subscribe;
|
|
4114
3833
|
const canRedo = room.history.canRedo;
|
|
4115
3834
|
return _react.useSyncExternalStore.call(void 0, subscribe, canRedo, canRedo);
|
|
4116
3835
|
}
|
|
4117
|
-
function
|
|
4118
|
-
|
|
3836
|
+
function useCanRedo() {
|
|
3837
|
+
return useCanRedo_withRoomContext(GlobalRoomContext);
|
|
3838
|
+
}
|
|
3839
|
+
function useSelf_withRoomContext(RoomContext, maybeSelector, isEqual) {
|
|
3840
|
+
const room = useRoom_withRoomContext(
|
|
3841
|
+
RoomContext
|
|
3842
|
+
);
|
|
4119
3843
|
const subscribe = room.events.self.subscribe;
|
|
4120
3844
|
const getSnapshot = room.getSelf;
|
|
4121
3845
|
const selector = _nullishCoalesce(maybeSelector, () => ( identity3));
|
|
@@ -4132,19 +3856,38 @@ function useSelf(maybeSelector, isEqual) {
|
|
|
4132
3856
|
isEqual
|
|
4133
3857
|
);
|
|
4134
3858
|
}
|
|
4135
|
-
function
|
|
4136
|
-
|
|
3859
|
+
function useSelf(maybeSelector, isEqual) {
|
|
3860
|
+
return useSelf_withRoomContext(
|
|
3861
|
+
GlobalRoomContext,
|
|
3862
|
+
maybeSelector,
|
|
3863
|
+
isEqual
|
|
3864
|
+
);
|
|
3865
|
+
}
|
|
3866
|
+
function useMyPresence_withRoomContext(RoomContext) {
|
|
3867
|
+
const room = useRoom_withRoomContext(
|
|
3868
|
+
RoomContext
|
|
3869
|
+
);
|
|
4137
3870
|
const subscribe = room.events.myPresence.subscribe;
|
|
4138
3871
|
const getSnapshot = room.getPresence;
|
|
4139
3872
|
const presence = _react.useSyncExternalStore.call(void 0, subscribe, getSnapshot, getSnapshot);
|
|
4140
3873
|
const setPresence = room.updatePresence;
|
|
4141
3874
|
return [presence, setPresence];
|
|
4142
3875
|
}
|
|
3876
|
+
function useMyPresence() {
|
|
3877
|
+
return useMyPresence_withRoomContext(GlobalRoomContext);
|
|
3878
|
+
}
|
|
3879
|
+
function useUpdateMyPresence_withRoomContext(RoomContext) {
|
|
3880
|
+
return useRoom_withRoomContext(
|
|
3881
|
+
RoomContext
|
|
3882
|
+
).updatePresence;
|
|
3883
|
+
}
|
|
4143
3884
|
function useUpdateMyPresence() {
|
|
4144
|
-
return
|
|
3885
|
+
return useUpdateMyPresence_withRoomContext(GlobalRoomContext);
|
|
4145
3886
|
}
|
|
4146
|
-
function
|
|
4147
|
-
const room =
|
|
3887
|
+
function useOthers_withRoomContext(RoomContext, selector, isEqual) {
|
|
3888
|
+
const room = useRoom_withRoomContext(
|
|
3889
|
+
RoomContext
|
|
3890
|
+
);
|
|
4148
3891
|
const subscribe = room.events.others.subscribe;
|
|
4149
3892
|
const getSnapshot = room.getOthers;
|
|
4150
3893
|
const getServerSnapshot = alwaysEmptyList;
|
|
@@ -4156,7 +3899,14 @@ function useOthers(selector, isEqual) {
|
|
|
4156
3899
|
isEqual
|
|
4157
3900
|
);
|
|
4158
3901
|
}
|
|
4159
|
-
function
|
|
3902
|
+
function useOthers(selector, isEqual) {
|
|
3903
|
+
return useOthers_withRoomContext(
|
|
3904
|
+
GlobalRoomContext,
|
|
3905
|
+
selector,
|
|
3906
|
+
isEqual
|
|
3907
|
+
);
|
|
3908
|
+
}
|
|
3909
|
+
function useOthersMapped_withRoomContext(RoomContext, itemSelector, itemIsEqual) {
|
|
4160
3910
|
const wrappedSelector = _react.useCallback.call(void 0,
|
|
4161
3911
|
(others) => others.map((other) => [other.connectionId, itemSelector(other)]),
|
|
4162
3912
|
[itemSelector]
|
|
@@ -4171,13 +3921,31 @@ function useOthersMapped(itemSelector, itemIsEqual) {
|
|
|
4171
3921
|
},
|
|
4172
3922
|
[itemIsEqual]
|
|
4173
3923
|
);
|
|
4174
|
-
return
|
|
3924
|
+
return useOthers_withRoomContext(
|
|
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
|
+
);
|
|
4175
3943
|
}
|
|
4176
3944
|
function useOthersConnectionIds() {
|
|
4177
|
-
return
|
|
3945
|
+
return useOthersConnectionIds_withRoomContext(GlobalRoomContext);
|
|
4178
3946
|
}
|
|
4179
3947
|
var NOT_FOUND = Symbol();
|
|
4180
|
-
function
|
|
3948
|
+
function useOther_withRoomContext(RoomContext, connectionId, selector, isEqual) {
|
|
4181
3949
|
const wrappedSelector = _react.useCallback.call(void 0,
|
|
4182
3950
|
(others) => {
|
|
4183
3951
|
const other2 = others.find((other3) => other3.connectionId === connectionId);
|
|
@@ -4195,7 +3963,11 @@ function useOther(connectionId, selector, isEqual) {
|
|
|
4195
3963
|
},
|
|
4196
3964
|
[isEqual]
|
|
4197
3965
|
);
|
|
4198
|
-
const other =
|
|
3966
|
+
const other = useOthers_withRoomContext(
|
|
3967
|
+
RoomContext,
|
|
3968
|
+
wrappedSelector,
|
|
3969
|
+
wrappedIsEqual
|
|
3970
|
+
);
|
|
4199
3971
|
if (other === NOT_FOUND) {
|
|
4200
3972
|
throw new Error(
|
|
4201
3973
|
`No such other user with connection id ${connectionId} exists`
|
|
@@ -4203,19 +3975,34 @@ function useOther(connectionId, selector, isEqual) {
|
|
|
4203
3975
|
}
|
|
4204
3976
|
return other;
|
|
4205
3977
|
}
|
|
4206
|
-
function
|
|
4207
|
-
|
|
3978
|
+
function useOther(connectionId, selector, isEqual) {
|
|
3979
|
+
return useOther_withRoomContext(
|
|
3980
|
+
GlobalRoomContext,
|
|
3981
|
+
connectionId,
|
|
3982
|
+
selector,
|
|
3983
|
+
isEqual
|
|
3984
|
+
);
|
|
3985
|
+
}
|
|
3986
|
+
function useMutableStorageRoot_withRoomContext(RoomContext) {
|
|
3987
|
+
const room = useRoom_withRoomContext(
|
|
3988
|
+
RoomContext
|
|
3989
|
+
);
|
|
4208
3990
|
const subscribe = room.events.storageDidLoad.subscribeOnce;
|
|
4209
3991
|
const getSnapshot = room.getStorageSnapshot;
|
|
4210
3992
|
const getServerSnapshot = alwaysNull;
|
|
4211
3993
|
return _react.useSyncExternalStore.call(void 0, subscribe, getSnapshot, getServerSnapshot);
|
|
4212
3994
|
}
|
|
3995
|
+
function useStorageRoot_withRoomContext(RoomContext) {
|
|
3996
|
+
return [useMutableStorageRoot_withRoomContext(RoomContext)];
|
|
3997
|
+
}
|
|
4213
3998
|
function useStorageRoot() {
|
|
4214
|
-
return
|
|
3999
|
+
return useStorageRoot_withRoomContext(GlobalRoomContext);
|
|
4215
4000
|
}
|
|
4216
|
-
function
|
|
4217
|
-
const room =
|
|
4218
|
-
|
|
4001
|
+
function useStorage_withRoomContext(RoomContext, selector, isEqual) {
|
|
4002
|
+
const room = useRoom_withRoomContext(
|
|
4003
|
+
RoomContext
|
|
4004
|
+
);
|
|
4005
|
+
const rootOrNull = useMutableStorageRoot_withRoomContext(RoomContext);
|
|
4219
4006
|
const wrappedSelector = _react.useCallback.call(void 0,
|
|
4220
4007
|
(rootOrNull2) => rootOrNull2 !== null ? selector(rootOrNull2) : null,
|
|
4221
4008
|
[selector]
|
|
@@ -4242,8 +4029,11 @@ function useStorage(selector, isEqual) {
|
|
|
4242
4029
|
isEqual
|
|
4243
4030
|
);
|
|
4244
4031
|
}
|
|
4245
|
-
function
|
|
4246
|
-
|
|
4032
|
+
function useStorage(selector, isEqual) {
|
|
4033
|
+
return useStorage_withRoomContext(GlobalRoomContext, selector, isEqual);
|
|
4034
|
+
}
|
|
4035
|
+
function useMutation_withRoomContext(RoomContext, callback, deps) {
|
|
4036
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4247
4037
|
return _react.useMemo.call(void 0,
|
|
4248
4038
|
() => {
|
|
4249
4039
|
return (...args) => (
|
|
@@ -4263,10 +4053,17 @@ function useMutation(callback, deps) {
|
|
|
4263
4053
|
[room, ...deps]
|
|
4264
4054
|
);
|
|
4265
4055
|
}
|
|
4266
|
-
function
|
|
4056
|
+
function useMutation(callback, deps) {
|
|
4057
|
+
return useMutation_withRoomContext(
|
|
4058
|
+
GlobalRoomContext,
|
|
4059
|
+
callback,
|
|
4060
|
+
deps
|
|
4061
|
+
);
|
|
4062
|
+
}
|
|
4063
|
+
function useThreads_withRoomContext(RoomContext, options = {}) {
|
|
4267
4064
|
const { scrollOnLoad = true } = options;
|
|
4268
4065
|
const client = useClient();
|
|
4269
|
-
const room =
|
|
4066
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4270
4067
|
const { store, getOrCreateThreadsPollerForRoomId } = getRoomExtrasForClient(client);
|
|
4271
4068
|
const queryKey = makeRoomThreadsQueryKey(room.id, options.query);
|
|
4272
4069
|
const poller = getOrCreateThreadsPollerForRoomId(room.id);
|
|
@@ -4292,103 +4089,20 @@ function useThreads(options = {}) {
|
|
|
4292
4089
|
useScrollToCommentOnLoadEffect(scrollOnLoad, result);
|
|
4293
4090
|
return result;
|
|
4294
4091
|
}
|
|
4295
|
-
function
|
|
4296
|
-
|
|
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;
|
|
4329
|
-
}
|
|
4330
|
-
function useFeedMessagesSuspense(feedId, options) {
|
|
4331
|
-
ensureNotServerSide();
|
|
4332
|
-
const client = useClient();
|
|
4333
|
-
const room = useRoom();
|
|
4334
|
-
const { store } = getRoomExtrasForClient(client);
|
|
4335
|
-
const queryKey = makeFeedMessagesQueryKey(room.id, feedId, options);
|
|
4336
|
-
use(store.outputs.loadingFeedMessages.getOrCreate(queryKey).waitUntilLoaded());
|
|
4337
|
-
const result = useFeedMessages(feedId, options);
|
|
4338
|
-
_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
|
-
);
|
|
4092
|
+
function useThreads(options = {}) {
|
|
4093
|
+
return useThreads_withRoomContext(GlobalRoomContext, options);
|
|
4380
4094
|
}
|
|
4381
|
-
function
|
|
4095
|
+
function useSearchComments_withRoomContext(RoomContext, options) {
|
|
4382
4096
|
const [result, setResult] = _react.useState.call(void 0, {
|
|
4383
4097
|
isLoading: true
|
|
4384
4098
|
});
|
|
4385
4099
|
const currentRequestInfo = _react.useRef.call(void 0, null);
|
|
4386
4100
|
const timeout = _react.useRef.call(void 0, null);
|
|
4387
4101
|
const client = useClient();
|
|
4388
|
-
const room =
|
|
4102
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
4389
4103
|
const queryKey = _core.stableStringify.call(void 0, [room.id, options.query]);
|
|
4390
4104
|
_react.useEffect.call(void 0, () => {
|
|
4391
|
-
const currentRequestId = (_nullishCoalesce(_optionalChain([currentRequestInfo, 'access',
|
|
4105
|
+
const currentRequestId = (_nullishCoalesce(_optionalChain([currentRequestInfo, 'access', _46 => _46.current, 'optionalAccess', _47 => _47.id]), () => ( 0))) + 1;
|
|
4392
4106
|
const controller = new AbortController();
|
|
4393
4107
|
currentRequestInfo.current = { id: currentRequestId, controller };
|
|
4394
4108
|
setResult((result2) => {
|
|
@@ -4405,12 +4119,12 @@ function useSearchComments(options) {
|
|
|
4405
4119
|
{ signal: controller.signal }
|
|
4406
4120
|
).then(({ data }) => {
|
|
4407
4121
|
if (controller.signal.aborted) return;
|
|
4408
|
-
if (_optionalChain([currentRequestInfo, 'access',
|
|
4122
|
+
if (_optionalChain([currentRequestInfo, 'access', _48 => _48.current, 'optionalAccess', _49 => _49.id]) !== currentRequestId) return;
|
|
4409
4123
|
setResult({ isLoading: false, results: data });
|
|
4410
4124
|
currentRequestInfo.current = null;
|
|
4411
4125
|
}).catch((err) => {
|
|
4412
4126
|
if (controller.signal.aborted) return;
|
|
4413
|
-
if (_optionalChain([currentRequestInfo, 'access',
|
|
4127
|
+
if (_optionalChain([currentRequestInfo, 'access', _50 => _50.current, 'optionalAccess', _51 => _51.id]) !== currentRequestId) return;
|
|
4414
4128
|
setResult({ isLoading: false, error: err });
|
|
4415
4129
|
currentRequestInfo.current = null;
|
|
4416
4130
|
});
|
|
@@ -4429,8 +4143,14 @@ function useSearchComments(options) {
|
|
|
4429
4143
|
}, [queryKey, client, room.id]);
|
|
4430
4144
|
return result;
|
|
4431
4145
|
}
|
|
4146
|
+
function useSearchComments(options) {
|
|
4147
|
+
return useSearchComments_withRoomContext(GlobalRoomContext, options);
|
|
4148
|
+
}
|
|
4149
|
+
function useCreateThread_withRoomContext(RoomContext) {
|
|
4150
|
+
return useCreateRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4151
|
+
}
|
|
4432
4152
|
function useCreateThread() {
|
|
4433
|
-
return
|
|
4153
|
+
return useCreateThread_withRoomContext(GlobalRoomContext);
|
|
4434
4154
|
}
|
|
4435
4155
|
function useCreateRoomThread(roomId) {
|
|
4436
4156
|
const client = useClient();
|
|
@@ -4471,7 +4191,7 @@ function useCreateRoomThread(roomId) {
|
|
|
4471
4191
|
thread: newThread,
|
|
4472
4192
|
roomId
|
|
4473
4193
|
});
|
|
4474
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4194
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((attachment) => attachment.id)]);
|
|
4475
4195
|
client[_core.kInternal].httpClient.createThread({
|
|
4476
4196
|
roomId,
|
|
4477
4197
|
threadId,
|
|
@@ -4503,8 +4223,11 @@ function useCreateRoomThread(roomId) {
|
|
|
4503
4223
|
[client, roomId]
|
|
4504
4224
|
);
|
|
4505
4225
|
}
|
|
4226
|
+
function useDeleteThread_withRoomContext(RoomContext) {
|
|
4227
|
+
return useDeleteRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4228
|
+
}
|
|
4506
4229
|
function useDeleteThread() {
|
|
4507
|
-
return
|
|
4230
|
+
return useDeleteThread_withRoomContext(GlobalRoomContext);
|
|
4508
4231
|
}
|
|
4509
4232
|
function useDeleteRoomThread(roomId) {
|
|
4510
4233
|
const client = useClient();
|
|
@@ -4513,7 +4236,7 @@ function useDeleteRoomThread(roomId) {
|
|
|
4513
4236
|
const { store, onMutationFailure } = getRoomExtrasForClient(client);
|
|
4514
4237
|
const userId = getCurrentUserId(client);
|
|
4515
4238
|
const existing = store.outputs.threads.get().get(threadId);
|
|
4516
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
4239
|
+
if (_optionalChain([existing, 'optionalAccess', _54 => _54.comments, 'optionalAccess', _55 => _55[0], 'optionalAccess', _56 => _56.userId]) !== userId) {
|
|
4517
4240
|
throw new Error("Only the thread creator can delete the thread");
|
|
4518
4241
|
}
|
|
4519
4242
|
const optimisticId = store.optimisticUpdates.add({
|
|
@@ -4536,8 +4259,11 @@ function useDeleteRoomThread(roomId) {
|
|
|
4536
4259
|
[client, roomId]
|
|
4537
4260
|
);
|
|
4538
4261
|
}
|
|
4262
|
+
function useEditThreadMetadata_withRoomContext(RoomContext) {
|
|
4263
|
+
return useEditRoomThreadMetadata(useRoom_withRoomContext(RoomContext).id);
|
|
4264
|
+
}
|
|
4539
4265
|
function useEditThreadMetadata() {
|
|
4540
|
-
return
|
|
4266
|
+
return useEditThreadMetadata_withRoomContext(GlobalRoomContext);
|
|
4541
4267
|
}
|
|
4542
4268
|
function useEditRoomThreadMetadata(roomId) {
|
|
4543
4269
|
const client = useClient();
|
|
@@ -4576,8 +4302,13 @@ function useEditRoomThreadMetadata(roomId) {
|
|
|
4576
4302
|
[client, roomId]
|
|
4577
4303
|
);
|
|
4578
4304
|
}
|
|
4305
|
+
function useEditCommentMetadata_withRoomContext(RoomContext) {
|
|
4306
|
+
return useEditRoomCommentMetadata(
|
|
4307
|
+
useRoom_withRoomContext(RoomContext).id
|
|
4308
|
+
);
|
|
4309
|
+
}
|
|
4579
4310
|
function useEditCommentMetadata() {
|
|
4580
|
-
return
|
|
4311
|
+
return useEditCommentMetadata_withRoomContext(GlobalRoomContext);
|
|
4581
4312
|
}
|
|
4582
4313
|
function useEditRoomCommentMetadata(roomId) {
|
|
4583
4314
|
const client = useClient();
|
|
@@ -4625,8 +4356,11 @@ function useEditRoomCommentMetadata(roomId) {
|
|
|
4625
4356
|
[client, roomId]
|
|
4626
4357
|
);
|
|
4627
4358
|
}
|
|
4359
|
+
function useCreateComment_withRoomContext(RoomContext) {
|
|
4360
|
+
return useCreateRoomComment(useRoom_withRoomContext(RoomContext).id);
|
|
4361
|
+
}
|
|
4628
4362
|
function useCreateComment() {
|
|
4629
|
-
return
|
|
4363
|
+
return useCreateComment_withRoomContext(GlobalRoomContext);
|
|
4630
4364
|
}
|
|
4631
4365
|
function useCreateRoomComment(roomId) {
|
|
4632
4366
|
const client = useClient();
|
|
@@ -4654,7 +4388,7 @@ function useCreateRoomComment(roomId) {
|
|
|
4654
4388
|
type: "create-comment",
|
|
4655
4389
|
comment
|
|
4656
4390
|
});
|
|
4657
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4391
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _57 => _57.map, 'call', _58 => _58((attachment) => attachment.id)]);
|
|
4658
4392
|
client[_core.kInternal].httpClient.createComment({
|
|
4659
4393
|
roomId,
|
|
4660
4394
|
threadId,
|
|
@@ -4684,8 +4418,11 @@ function useCreateRoomComment(roomId) {
|
|
|
4684
4418
|
[client, roomId]
|
|
4685
4419
|
);
|
|
4686
4420
|
}
|
|
4421
|
+
function useEditComment_withRoomContext(RoomContext) {
|
|
4422
|
+
return useEditRoomComment(useRoom_withRoomContext(RoomContext).id);
|
|
4423
|
+
}
|
|
4687
4424
|
function useEditComment() {
|
|
4688
|
-
return
|
|
4425
|
+
return useEditComment_withRoomContext(GlobalRoomContext);
|
|
4689
4426
|
}
|
|
4690
4427
|
function useEditRoomComment(roomId) {
|
|
4691
4428
|
const client = useClient();
|
|
@@ -4729,7 +4466,7 @@ function useEditRoomComment(roomId) {
|
|
|
4729
4466
|
metadata: updatedMetadata
|
|
4730
4467
|
}
|
|
4731
4468
|
});
|
|
4732
|
-
const attachmentIds = _optionalChain([attachments, 'optionalAccess',
|
|
4469
|
+
const attachmentIds = _optionalChain([attachments, 'optionalAccess', _59 => _59.map, 'call', _60 => _60((attachment) => attachment.id)]);
|
|
4733
4470
|
client[_core.kInternal].httpClient.editComment({
|
|
4734
4471
|
roomId,
|
|
4735
4472
|
threadId,
|
|
@@ -4758,8 +4495,11 @@ function useEditRoomComment(roomId) {
|
|
|
4758
4495
|
[client, roomId]
|
|
4759
4496
|
);
|
|
4760
4497
|
}
|
|
4498
|
+
function useDeleteComment_withRoomContext(RoomContext) {
|
|
4499
|
+
return useDeleteRoomComment(useRoom_withRoomContext(RoomContext).id);
|
|
4500
|
+
}
|
|
4761
4501
|
function useDeleteComment() {
|
|
4762
|
-
return
|
|
4502
|
+
return useDeleteComment_withRoomContext(GlobalRoomContext);
|
|
4763
4503
|
}
|
|
4764
4504
|
function useDeleteRoomComment(roomId) {
|
|
4765
4505
|
const client = useClient();
|
|
@@ -4788,8 +4528,11 @@ function useDeleteRoomComment(roomId) {
|
|
|
4788
4528
|
[client, roomId]
|
|
4789
4529
|
);
|
|
4790
4530
|
}
|
|
4531
|
+
function useAddReaction_withRoomContext(RoomContext) {
|
|
4532
|
+
return useAddRoomCommentReaction(useRoom_withRoomContext(RoomContext).id);
|
|
4533
|
+
}
|
|
4791
4534
|
function useAddReaction() {
|
|
4792
|
-
return
|
|
4535
|
+
return useAddReaction_withRoomContext(GlobalRoomContext);
|
|
4793
4536
|
}
|
|
4794
4537
|
function useAddRoomCommentReaction(roomId) {
|
|
4795
4538
|
const client = useClient();
|
|
@@ -4834,8 +4577,11 @@ function useAddRoomCommentReaction(roomId) {
|
|
|
4834
4577
|
[client, roomId]
|
|
4835
4578
|
);
|
|
4836
4579
|
}
|
|
4580
|
+
function useRemoveReaction_withRoomContext(RoomContext) {
|
|
4581
|
+
return useRemoveRoomCommentReaction(useRoom_withRoomContext(RoomContext).id);
|
|
4582
|
+
}
|
|
4837
4583
|
function useRemoveReaction() {
|
|
4838
|
-
return
|
|
4584
|
+
return useRemoveReaction_withRoomContext(GlobalRoomContext);
|
|
4839
4585
|
}
|
|
4840
4586
|
function useRemoveRoomCommentReaction(roomId) {
|
|
4841
4587
|
const client = useClient();
|
|
@@ -4879,9 +4625,6 @@ function useRemoveRoomCommentReaction(roomId) {
|
|
|
4879
4625
|
[client, roomId]
|
|
4880
4626
|
);
|
|
4881
4627
|
}
|
|
4882
|
-
function useMarkThreadAsRead() {
|
|
4883
|
-
return useMarkRoomThreadAsRead(useRoom().id);
|
|
4884
|
-
}
|
|
4885
4628
|
function useMarkRoomThreadAsRead(roomId) {
|
|
4886
4629
|
const client = useClient();
|
|
4887
4630
|
return _react.useCallback.call(void 0,
|
|
@@ -4927,8 +4670,18 @@ function useMarkRoomThreadAsRead(roomId) {
|
|
|
4927
4670
|
[client, roomId]
|
|
4928
4671
|
);
|
|
4929
4672
|
}
|
|
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
|
+
}
|
|
4930
4683
|
function useMarkThreadAsResolved() {
|
|
4931
|
-
return
|
|
4684
|
+
return useMarkThreadAsResolved_withRoomContext(GlobalRoomContext);
|
|
4932
4685
|
}
|
|
4933
4686
|
function useMarkRoomThreadAsResolved(roomId) {
|
|
4934
4687
|
const client = useClient();
|
|
@@ -4960,8 +4713,11 @@ function useMarkRoomThreadAsResolved(roomId) {
|
|
|
4960
4713
|
[client, roomId]
|
|
4961
4714
|
);
|
|
4962
4715
|
}
|
|
4716
|
+
function useMarkThreadAsUnresolved_withRoomContext(RoomContext) {
|
|
4717
|
+
return useMarkRoomThreadAsUnresolved(useRoom_withRoomContext(RoomContext).id);
|
|
4718
|
+
}
|
|
4963
4719
|
function useMarkThreadAsUnresolved() {
|
|
4964
|
-
return
|
|
4720
|
+
return useMarkThreadAsUnresolved_withRoomContext(GlobalRoomContext);
|
|
4965
4721
|
}
|
|
4966
4722
|
function useMarkRoomThreadAsUnresolved(roomId) {
|
|
4967
4723
|
const client = useClient();
|
|
@@ -4993,8 +4749,11 @@ function useMarkRoomThreadAsUnresolved(roomId) {
|
|
|
4993
4749
|
[client, roomId]
|
|
4994
4750
|
);
|
|
4995
4751
|
}
|
|
4752
|
+
function useSubscribeToThread_withRoomContext(RoomContext) {
|
|
4753
|
+
return useSubscribeToRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4754
|
+
}
|
|
4996
4755
|
function useSubscribeToThread() {
|
|
4997
|
-
return
|
|
4756
|
+
return useSubscribeToThread_withRoomContext(GlobalRoomContext);
|
|
4998
4757
|
}
|
|
4999
4758
|
function useSubscribeToRoomThread(roomId) {
|
|
5000
4759
|
const client = useClient();
|
|
@@ -5021,8 +4780,11 @@ function useSubscribeToRoomThread(roomId) {
|
|
|
5021
4780
|
[client, roomId]
|
|
5022
4781
|
);
|
|
5023
4782
|
}
|
|
4783
|
+
function useUnsubscribeFromThread_withRoomContext(RoomContext) {
|
|
4784
|
+
return useUnsubscribeFromRoomThread(useRoom_withRoomContext(RoomContext).id);
|
|
4785
|
+
}
|
|
5024
4786
|
function useUnsubscribeFromThread() {
|
|
5025
|
-
return
|
|
4787
|
+
return useUnsubscribeFromThread_withRoomContext(GlobalRoomContext);
|
|
5026
4788
|
}
|
|
5027
4789
|
function useUnsubscribeFromRoomThread(roomId) {
|
|
5028
4790
|
const client = useClient();
|
|
@@ -5052,8 +4814,14 @@ function useUnsubscribeFromRoomThread(roomId) {
|
|
|
5052
4814
|
[client, roomId]
|
|
5053
4815
|
);
|
|
5054
4816
|
}
|
|
4817
|
+
function useThreadSubscription_withRoomContext(RoomContext, threadId) {
|
|
4818
|
+
return useRoomThreadSubscription(
|
|
4819
|
+
useRoom_withRoomContext(RoomContext).id,
|
|
4820
|
+
threadId
|
|
4821
|
+
);
|
|
4822
|
+
}
|
|
5055
4823
|
function useThreadSubscription(threadId) {
|
|
5056
|
-
return
|
|
4824
|
+
return useThreadSubscription_withRoomContext(GlobalRoomContext, threadId);
|
|
5057
4825
|
}
|
|
5058
4826
|
function useRoomThreadSubscription(roomId, threadId) {
|
|
5059
4827
|
const client = useClient();
|
|
@@ -5084,7 +4852,7 @@ function useRoomThreadSubscription(roomId, threadId) {
|
|
|
5084
4852
|
}
|
|
5085
4853
|
return {
|
|
5086
4854
|
status: "subscribed",
|
|
5087
|
-
unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess',
|
|
4855
|
+
unreadSince: _nullishCoalesce(_optionalChain([notification, 'optionalAccess', _61 => _61.readAt]), () => ( null)),
|
|
5088
4856
|
subscribe,
|
|
5089
4857
|
unsubscribe
|
|
5090
4858
|
};
|
|
@@ -5093,10 +4861,10 @@ function useRoomThreadSubscription(roomId, threadId) {
|
|
|
5093
4861
|
);
|
|
5094
4862
|
return useSignal(signal, selector, _client.shallow);
|
|
5095
4863
|
}
|
|
5096
|
-
function
|
|
5097
|
-
const updateRoomSubscriptionSettings =
|
|
4864
|
+
function useRoomSubscriptionSettings_withRoomContext(RoomContext) {
|
|
4865
|
+
const updateRoomSubscriptionSettings = useUpdateRoomSubscriptionSettings_withRoomContext(RoomContext);
|
|
5098
4866
|
const client = useClient();
|
|
5099
|
-
const room =
|
|
4867
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5100
4868
|
const { store, getOrCreateSubscriptionSettingsPollerForRoomId } = getRoomExtrasForClient(client);
|
|
5101
4869
|
const poller = getOrCreateSubscriptionSettingsPollerForRoomId(room.id);
|
|
5102
4870
|
_react.useEffect.call(void 0,
|
|
@@ -5124,26 +4892,32 @@ function useRoomSubscriptionSettings() {
|
|
|
5124
4892
|
return [settings, updateRoomSubscriptionSettings];
|
|
5125
4893
|
}, [settings, updateRoomSubscriptionSettings]);
|
|
5126
4894
|
}
|
|
5127
|
-
function
|
|
4895
|
+
function useRoomSubscriptionSettings() {
|
|
4896
|
+
return useRoomSubscriptionSettings_withRoomContext(GlobalRoomContext);
|
|
4897
|
+
}
|
|
4898
|
+
function useRoomSubscriptionSettingsSuspense_withRoomContext(RoomContext) {
|
|
5128
4899
|
ensureNotServerSide();
|
|
5129
4900
|
const client = useClient();
|
|
5130
4901
|
const store = getRoomExtrasForClient(client).store;
|
|
5131
|
-
const room =
|
|
4902
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5132
4903
|
use(
|
|
5133
4904
|
store.outputs.roomSubscriptionSettingsByRoomId.getOrCreate(room.id).waitUntilLoaded()
|
|
5134
4905
|
);
|
|
5135
|
-
const [settings, updateRoomSubscriptionSettings] =
|
|
4906
|
+
const [settings, updateRoomSubscriptionSettings] = useRoomSubscriptionSettings_withRoomContext(RoomContext);
|
|
5136
4907
|
_core.assert.call(void 0, !settings.error, "Did not expect error");
|
|
5137
4908
|
_core.assert.call(void 0, !settings.isLoading, "Did not expect loading");
|
|
5138
4909
|
return _react.useMemo.call(void 0, () => {
|
|
5139
4910
|
return [settings, updateRoomSubscriptionSettings];
|
|
5140
4911
|
}, [settings, updateRoomSubscriptionSettings]);
|
|
5141
4912
|
}
|
|
5142
|
-
function
|
|
4913
|
+
function useRoomSubscriptionSettingsSuspense() {
|
|
4914
|
+
return useRoomSubscriptionSettingsSuspense_withRoomContext(GlobalRoomContext);
|
|
4915
|
+
}
|
|
4916
|
+
function useHistoryVersionData_withRoomContext(RoomContext, versionId) {
|
|
5143
4917
|
const [state, setState] = _react.useState.call(void 0, {
|
|
5144
4918
|
isLoading: true
|
|
5145
4919
|
});
|
|
5146
|
-
const room =
|
|
4920
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5147
4921
|
_react.useEffect.call(void 0, () => {
|
|
5148
4922
|
setState({ isLoading: true });
|
|
5149
4923
|
const load = async () => {
|
|
@@ -5168,9 +4942,12 @@ function useHistoryVersionData(versionId) {
|
|
|
5168
4942
|
}, [room, versionId]);
|
|
5169
4943
|
return state;
|
|
5170
4944
|
}
|
|
5171
|
-
function
|
|
4945
|
+
function useHistoryVersionData(versionId) {
|
|
4946
|
+
return useHistoryVersionData_withRoomContext(GlobalRoomContext, versionId);
|
|
4947
|
+
}
|
|
4948
|
+
function useHistoryVersions_withRoomContext(RoomContext) {
|
|
5172
4949
|
const client = useClient();
|
|
5173
|
-
const room =
|
|
4950
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5174
4951
|
const { store, getOrCreateVersionsPollerForRoomId } = getRoomExtrasForClient(client);
|
|
5175
4952
|
const poller = getOrCreateVersionsPollerForRoomId(room.id);
|
|
5176
4953
|
_react.useEffect.call(void 0, () => {
|
|
@@ -5191,20 +4968,26 @@ function useHistoryVersions() {
|
|
|
5191
4968
|
);
|
|
5192
4969
|
return useSignal(store.outputs.versionsByRoomId.getOrCreate(room.id).signal);
|
|
5193
4970
|
}
|
|
5194
|
-
function
|
|
4971
|
+
function useHistoryVersions() {
|
|
4972
|
+
return useHistoryVersions_withRoomContext(GlobalRoomContext);
|
|
4973
|
+
}
|
|
4974
|
+
function useHistoryVersionsSuspense_withRoomContext(RoomContext) {
|
|
5195
4975
|
ensureNotServerSide();
|
|
5196
4976
|
const client = useClient();
|
|
5197
|
-
const room =
|
|
4977
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5198
4978
|
const store = getRoomExtrasForClient(client).store;
|
|
5199
4979
|
use(store.outputs.versionsByRoomId.getOrCreate(room.id).waitUntilLoaded());
|
|
5200
|
-
const result =
|
|
4980
|
+
const result = useHistoryVersions_withRoomContext(RoomContext);
|
|
5201
4981
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
5202
4982
|
_core.assert.call(void 0, !result.isLoading, "Did not expect loading");
|
|
5203
4983
|
return result;
|
|
5204
4984
|
}
|
|
5205
|
-
function
|
|
4985
|
+
function useHistoryVersionsSuspense() {
|
|
4986
|
+
return useHistoryVersionsSuspense_withRoomContext(GlobalRoomContext);
|
|
4987
|
+
}
|
|
4988
|
+
function useUpdateRoomSubscriptionSettings_withRoomContext(RoomContext) {
|
|
5206
4989
|
const client = useClient();
|
|
5207
|
-
const room =
|
|
4990
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5208
4991
|
return _react.useCallback.call(void 0,
|
|
5209
4992
|
(settings) => {
|
|
5210
4993
|
const { store, onMutationFailure, pollThreadsForRoomId } = getRoomExtrasForClient(client);
|
|
@@ -5239,63 +5022,120 @@ function useUpdateRoomSubscriptionSettings() {
|
|
|
5239
5022
|
[client, room]
|
|
5240
5023
|
);
|
|
5241
5024
|
}
|
|
5242
|
-
function
|
|
5025
|
+
function useUpdateRoomSubscriptionSettings() {
|
|
5026
|
+
return useUpdateRoomSubscriptionSettings_withRoomContext(GlobalRoomContext);
|
|
5027
|
+
}
|
|
5028
|
+
function useSuspendUntilPresenceReady_withRoomContext(RoomContext) {
|
|
5243
5029
|
ensureNotServerSide();
|
|
5244
|
-
const room =
|
|
5030
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5245
5031
|
use(room.waitUntilPresenceReady());
|
|
5246
5032
|
}
|
|
5033
|
+
function useSelfSuspense_withRoomContext(RoomContext, selector, isEqual) {
|
|
5034
|
+
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5035
|
+
return useSelf_withRoomContext(
|
|
5036
|
+
RoomContext,
|
|
5037
|
+
selector,
|
|
5038
|
+
isEqual
|
|
5039
|
+
);
|
|
5040
|
+
}
|
|
5247
5041
|
function useSelfSuspense(selector, isEqual) {
|
|
5248
|
-
|
|
5249
|
-
|
|
5042
|
+
return useSelfSuspense_withRoomContext(
|
|
5043
|
+
GlobalRoomContext,
|
|
5044
|
+
selector,
|
|
5045
|
+
isEqual
|
|
5046
|
+
);
|
|
5047
|
+
}
|
|
5048
|
+
function useOthersSuspense_withRoomContext(RoomContext, selector, isEqual) {
|
|
5049
|
+
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5050
|
+
return useOthers_withRoomContext(
|
|
5051
|
+
RoomContext,
|
|
5250
5052
|
selector,
|
|
5251
5053
|
isEqual
|
|
5252
5054
|
);
|
|
5253
5055
|
}
|
|
5254
5056
|
function useOthersSuspense(selector, isEqual) {
|
|
5255
|
-
|
|
5256
|
-
|
|
5057
|
+
return useOthersSuspense_withRoomContext(
|
|
5058
|
+
GlobalRoomContext,
|
|
5257
5059
|
selector,
|
|
5258
5060
|
isEqual
|
|
5259
5061
|
);
|
|
5260
5062
|
}
|
|
5063
|
+
function useOthersConnectionIdsSuspense_withRoomContext(RoomContext) {
|
|
5064
|
+
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5065
|
+
return useOthersConnectionIds_withRoomContext(RoomContext);
|
|
5066
|
+
}
|
|
5261
5067
|
function useOthersConnectionIdsSuspense() {
|
|
5262
|
-
|
|
5263
|
-
|
|
5068
|
+
return useOthersConnectionIdsSuspense_withRoomContext(GlobalRoomContext);
|
|
5069
|
+
}
|
|
5070
|
+
function useOthersMappedSuspense_withRoomContext(RoomContext, itemSelector, itemIsEqual) {
|
|
5071
|
+
useSuspendUntilPresenceReady_withRoomContext(RoomContext);
|
|
5072
|
+
return useOthersMapped_withRoomContext(
|
|
5073
|
+
RoomContext,
|
|
5074
|
+
itemSelector,
|
|
5075
|
+
itemIsEqual
|
|
5076
|
+
);
|
|
5264
5077
|
}
|
|
5265
5078
|
function useOthersMappedSuspense(itemSelector, itemIsEqual) {
|
|
5266
|
-
|
|
5267
|
-
|
|
5079
|
+
return useOthersMappedSuspense_withRoomContext(
|
|
5080
|
+
GlobalRoomContext,
|
|
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
|
+
);
|
|
5268
5093
|
}
|
|
5269
5094
|
function useOtherSuspense(connectionId, selector, isEqual) {
|
|
5270
|
-
|
|
5271
|
-
|
|
5095
|
+
return useOtherSuspense_withRoomContext(
|
|
5096
|
+
GlobalRoomContext,
|
|
5097
|
+
connectionId,
|
|
5098
|
+
selector,
|
|
5099
|
+
isEqual
|
|
5100
|
+
);
|
|
5272
5101
|
}
|
|
5273
|
-
function
|
|
5102
|
+
function useSuspendUntilStorageReady_withRoomContext(RoomContext) {
|
|
5274
5103
|
ensureNotServerSide();
|
|
5275
|
-
const room =
|
|
5104
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5276
5105
|
use(room.waitUntilStorageReady());
|
|
5277
5106
|
}
|
|
5107
|
+
function useStorageSuspense_withRoomContext(RoomContext, selector, isEqual) {
|
|
5108
|
+
useSuspendUntilStorageReady_withRoomContext(RoomContext);
|
|
5109
|
+
return useStorage_withRoomContext(
|
|
5110
|
+
RoomContext,
|
|
5111
|
+
selector,
|
|
5112
|
+
isEqual
|
|
5113
|
+
);
|
|
5114
|
+
}
|
|
5278
5115
|
function useStorageSuspense(selector, isEqual) {
|
|
5279
|
-
|
|
5280
|
-
|
|
5116
|
+
return useStorageSuspense_withRoomContext(
|
|
5117
|
+
GlobalRoomContext,
|
|
5281
5118
|
selector,
|
|
5282
5119
|
isEqual
|
|
5283
5120
|
);
|
|
5284
5121
|
}
|
|
5285
|
-
function
|
|
5122
|
+
function useThreadsSuspense_withRoomContext(RoomContext, options = {}) {
|
|
5286
5123
|
ensureNotServerSide();
|
|
5287
5124
|
const client = useClient();
|
|
5288
|
-
const room =
|
|
5125
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5289
5126
|
const { store } = getRoomExtrasForClient(client);
|
|
5290
5127
|
const queryKey = makeRoomThreadsQueryKey(room.id, options.query);
|
|
5291
5128
|
use(store.outputs.loadingRoomThreads.getOrCreate(queryKey).waitUntilLoaded());
|
|
5292
|
-
const result =
|
|
5129
|
+
const result = useThreads_withRoomContext(RoomContext, options);
|
|
5293
5130
|
_core.assert.call(void 0, !result.error, "Did not expect error");
|
|
5294
5131
|
_core.assert.call(void 0, !result.isLoading, "Did not expect loading");
|
|
5295
5132
|
return result;
|
|
5296
5133
|
}
|
|
5134
|
+
function useThreadsSuspense(options = {}) {
|
|
5135
|
+
return useThreadsSuspense_withRoomContext(GlobalRoomContext, options);
|
|
5136
|
+
}
|
|
5297
5137
|
function selectorFor_useAttachmentUrl(state) {
|
|
5298
|
-
if (state === void 0 || _optionalChain([state, 'optionalAccess',
|
|
5138
|
+
if (state === void 0 || _optionalChain([state, 'optionalAccess', _62 => _62.isLoading])) {
|
|
5299
5139
|
return _nullishCoalesce(state, () => ( { isLoading: true }));
|
|
5300
5140
|
}
|
|
5301
5141
|
if (state.error) {
|
|
@@ -5307,10 +5147,13 @@ function selectorFor_useAttachmentUrl(state) {
|
|
|
5307
5147
|
url: state.data
|
|
5308
5148
|
};
|
|
5309
5149
|
}
|
|
5310
|
-
function
|
|
5311
|
-
const room =
|
|
5150
|
+
function useAttachmentUrl_withRoomContext(RoomContext, attachmentId) {
|
|
5151
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5312
5152
|
return useRoomAttachmentUrl(attachmentId, room.id);
|
|
5313
5153
|
}
|
|
5154
|
+
function useAttachmentUrl(attachmentId) {
|
|
5155
|
+
return useAttachmentUrl_withRoomContext(GlobalRoomContext, attachmentId);
|
|
5156
|
+
}
|
|
5314
5157
|
function useRoomAttachmentUrl(attachmentId, roomId) {
|
|
5315
5158
|
const client = useClient();
|
|
5316
5159
|
const store = client[_core.kInternal].httpClient.getOrCreateAttachmentUrlsStore(roomId);
|
|
@@ -5329,8 +5172,8 @@ function useRoomAttachmentUrl(attachmentId, roomId) {
|
|
|
5329
5172
|
_client.shallow
|
|
5330
5173
|
);
|
|
5331
5174
|
}
|
|
5332
|
-
function
|
|
5333
|
-
const room =
|
|
5175
|
+
function useAttachmentUrlSuspense_withRoomContext(RoomContext, attachmentId) {
|
|
5176
|
+
const room = useRoom_withRoomContext(RoomContext);
|
|
5334
5177
|
const { attachmentUrlsStore } = room[_core.kInternal];
|
|
5335
5178
|
const getAttachmentUrlState = _react.useCallback.call(void 0,
|
|
5336
5179
|
() => attachmentUrlsStore.getItemState(attachmentId),
|
|
@@ -5357,13 +5200,382 @@ function useAttachmentUrlSuspense(attachmentId) {
|
|
|
5357
5200
|
error: void 0
|
|
5358
5201
|
};
|
|
5359
5202
|
}
|
|
5203
|
+
function useAttachmentUrlSuspense(attachmentId) {
|
|
5204
|
+
return useAttachmentUrlSuspense_withRoomContext(
|
|
5205
|
+
GlobalRoomContext,
|
|
5206
|
+
attachmentId
|
|
5207
|
+
);
|
|
5208
|
+
}
|
|
5360
5209
|
function useRoomPermissions(roomId) {
|
|
5361
5210
|
const client = useClient();
|
|
5362
5211
|
const store = getRoomExtrasForClient(client).store;
|
|
5363
5212
|
return useSignal(store.permissionHints.getPermissionForRoom\u03A3(roomId));
|
|
5364
5213
|
}
|
|
5365
5214
|
function createRoomContext(client) {
|
|
5366
|
-
|
|
5215
|
+
const BoundRoomContext = _react.createContext.call(void 0, null);
|
|
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
|
+
});
|
|
5367
5579
|
}
|
|
5368
5580
|
var _RoomProvider = RoomProvider;
|
|
5369
5581
|
var _useBroadcastEvent = useBroadcastEvent;
|
|
@@ -5383,10 +5595,6 @@ var _useMyPresence = useMyPresence;
|
|
|
5383
5595
|
var _useOthersMapped = useOthersMapped;
|
|
5384
5596
|
var _useOthersMappedSuspense = useOthersMappedSuspense;
|
|
5385
5597
|
var _useThreads = useThreads;
|
|
5386
|
-
var _useFeeds = useFeeds;
|
|
5387
|
-
var _useFeedMessages = useFeedMessages;
|
|
5388
|
-
var _useFeedsSuspense = useFeedsSuspense;
|
|
5389
|
-
var _useFeedMessagesSuspense = useFeedMessagesSuspense;
|
|
5390
5598
|
var _useSearchComments = useSearchComments;
|
|
5391
5599
|
var _useThreadsSuspense = useThreadsSuspense;
|
|
5392
5600
|
var _useRoomSubscriptionSettings = useRoomSubscriptionSettings;
|
|
@@ -5535,15 +5743,5 @@ var _useUpdateMyPresence = useUpdateMyPresence;
|
|
|
5535
5743
|
|
|
5536
5744
|
|
|
5537
5745
|
|
|
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-NHU725OF.cjs.map
|
|
5746
|
+
exports.ClientContext = ClientContext; exports.useClientOrNull = useClientOrNull; exports.useClient = useClient; exports.GlobalRoomContext = GlobalRoomContext; 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.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.useMarkRoomThreadAsRead = useMarkRoomThreadAsRead; exports.useMarkThreadAsRead = useMarkThreadAsRead; 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._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;
|
|
5747
|
+
//# sourceMappingURL=chunk-L3D3UECF.cjs.map
|