@liveblocks/react 2.3.0 → 2.4.0-test1

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "2.3.0";
3
+ var PKG_VERSION = "2.4.0-test1";
4
4
  var PKG_FORMAT = "cjs";
5
5
 
6
6
  // src/ClientSideSuspense.tsx
@@ -22,8 +22,8 @@ function ClientSideSuspense(props) {
22
22
 
23
23
 
24
24
 
25
+
25
26
  var _core = require('@liveblocks/core');
26
- var _nanoid = require('nanoid');
27
27
 
28
28
 
29
29
 
@@ -244,20 +244,32 @@ function getExtrasForClient(client) {
244
244
  function makeExtrasForClient(client) {
245
245
  const internals = client[_core.kInternal];
246
246
  const store = internals.cacheStore;
247
- const notifications = internals.notifications;
248
247
  let lastRequestedAt;
249
248
  async function fetchInboxNotifications() {
250
- const since = lastRequestedAt !== void 0 ? { since: lastRequestedAt } : void 0;
251
- const result = await notifications.getInboxNotifications(since);
252
- store.updateThreadsAndNotifications(
253
- result.threads,
254
- result.inboxNotifications,
255
- result.deletedThreads,
256
- result.deletedInboxNotifications,
257
- INBOX_NOTIFICATIONS_QUERY
258
- );
259
- if (lastRequestedAt === void 0 || lastRequestedAt < result.meta.requestedAt) {
260
- lastRequestedAt = result.meta.requestedAt;
249
+ if (lastRequestedAt === void 0) {
250
+ const result = await client.getInboxNotifications();
251
+ store.updateThreadsAndNotifications(
252
+ result.threads,
253
+ result.inboxNotifications,
254
+ [],
255
+ [],
256
+ INBOX_NOTIFICATIONS_QUERY
257
+ );
258
+ lastRequestedAt = result.requestedAt;
259
+ } else {
260
+ const result = await client.getInboxNotificationsSince({
261
+ since: lastRequestedAt
262
+ });
263
+ store.updateThreadsAndNotifications(
264
+ result.threads.modified,
265
+ result.inboxNotifications.modified,
266
+ result.threads.deleted,
267
+ result.inboxNotifications.deleted,
268
+ INBOX_NOTIFICATIONS_QUERY
269
+ );
270
+ if (lastRequestedAt < result.requestedAt) {
271
+ lastRequestedAt = result.requestedAt;
272
+ }
261
273
  }
262
274
  }
263
275
  let pollerSubscribers = 0;
@@ -311,7 +323,6 @@ function makeExtrasForClient(client) {
311
323
  }
312
324
  return {
313
325
  store,
314
- notifications,
315
326
  useEnableInboxNotificationsPolling,
316
327
  waitUntilInboxNotificationsLoaded,
317
328
  loadInboxNotifications
@@ -399,8 +410,8 @@ function useUnreadInboxNotificationsCountSuspense_withClient(client) {
399
410
  function useMarkInboxNotificationAsRead_withClient(client) {
400
411
  return _react.useCallback.call(void 0,
401
412
  (inboxNotificationId) => {
402
- const { store, notifications } = getExtrasForClient(client);
403
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
413
+ const { store } = getExtrasForClient(client);
414
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
404
415
  const readAt = /* @__PURE__ */ new Date();
405
416
  store.pushOptimisticUpdate({
406
417
  type: "mark-inbox-notification-as-read",
@@ -408,7 +419,7 @@ function useMarkInboxNotificationAsRead_withClient(client) {
408
419
  inboxNotificationId,
409
420
  readAt
410
421
  });
411
- notifications.markInboxNotificationAsRead(inboxNotificationId).then(
422
+ client.markInboxNotificationAsRead(inboxNotificationId).then(
412
423
  () => {
413
424
  store.set((state) => {
414
425
  const existingNotification = state.inboxNotifications[inboxNotificationId];
@@ -450,15 +461,15 @@ function useMarkInboxNotificationAsRead_withClient(client) {
450
461
  }
451
462
  function useMarkAllInboxNotificationsAsRead_withClient(client) {
452
463
  return _react.useCallback.call(void 0, () => {
453
- const { store, notifications } = getExtrasForClient(client);
454
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
464
+ const { store } = getExtrasForClient(client);
465
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
455
466
  const readAt = /* @__PURE__ */ new Date();
456
467
  store.pushOptimisticUpdate({
457
468
  type: "mark-all-inbox-notifications-as-read",
458
469
  id: optimisticUpdateId,
459
470
  readAt
460
471
  });
461
- notifications.markAllInboxNotificationsAsRead().then(
472
+ client.markAllInboxNotificationsAsRead().then(
462
473
  () => {
463
474
  store.set((state) => ({
464
475
  ...state,
@@ -489,8 +500,8 @@ function useMarkAllInboxNotificationsAsRead_withClient(client) {
489
500
  function useDeleteInboxNotification_withClient(client) {
490
501
  return _react.useCallback.call(void 0,
491
502
  (inboxNotificationId) => {
492
- const { store, notifications } = getExtrasForClient(client);
493
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
503
+ const { store } = getExtrasForClient(client);
504
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
494
505
  const deletedAt = /* @__PURE__ */ new Date();
495
506
  store.pushOptimisticUpdate({
496
507
  type: "delete-inbox-notification",
@@ -498,7 +509,7 @@ function useDeleteInboxNotification_withClient(client) {
498
509
  inboxNotificationId,
499
510
  deletedAt
500
511
  });
501
- notifications.deleteInboxNotification(inboxNotificationId).then(
512
+ client.deleteInboxNotification(inboxNotificationId).then(
502
513
  () => {
503
514
  store.set((state) => {
504
515
  const existingNotification = state.inboxNotifications[inboxNotificationId];
@@ -535,15 +546,15 @@ function useDeleteInboxNotification_withClient(client) {
535
546
  }
536
547
  function useDeleteAllInboxNotifications_withClient(client) {
537
548
  return _react.useCallback.call(void 0, () => {
538
- const { store, notifications } = getExtrasForClient(client);
539
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
549
+ const { store } = getExtrasForClient(client);
550
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
540
551
  const deletedAt = /* @__PURE__ */ new Date();
541
552
  store.pushOptimisticUpdate({
542
553
  type: "delete-all-inbox-notifications",
543
554
  id: optimisticUpdateId,
544
555
  deletedAt
545
556
  });
546
- notifications.deleteAllInboxNotifications().then(
557
+ client.deleteAllInboxNotifications().then(
547
558
  () => {
548
559
  store.set((state) => ({
549
560
  ...state,
@@ -968,19 +979,7 @@ var _client = require('@liveblocks/client');
968
979
 
969
980
 
970
981
 
971
- // src/comments/lib/createIds.ts
972
982
 
973
- var THREAD_ID_PREFIX = "th";
974
- var COMMENT_ID_PREFIX = "cm";
975
- function createOptimisticId(prefix) {
976
- return `${prefix}_${_nanoid.nanoid.call(void 0, )}`;
977
- }
978
- function createThreadId() {
979
- return createOptimisticId(THREAD_ID_PREFIX);
980
- }
981
- function createCommentId() {
982
- return createOptimisticId(COMMENT_ID_PREFIX);
983
- }
984
983
 
985
984
  // src/comments/lib/select-notification-settings.ts
986
985
 
@@ -1166,18 +1165,17 @@ function makeExtrasForClient2(client) {
1166
1165
  if (isFetchingThreadsUpdates === true) return;
1167
1166
  try {
1168
1167
  requestStatusByRoom.set(room.id, true);
1169
- const commentsAPI = room[_core.kInternal].comments;
1170
- const updates = await commentsAPI.getThreads({ since });
1168
+ const updates = await room.getThreadsSince({ since });
1171
1169
  setTimeout(() => {
1172
1170
  requestStatusByRoom.set(room.id, false);
1173
1171
  }, DEFAULT_DEDUPING_INTERVAL);
1174
1172
  store.updateThreadsAndNotifications(
1175
- updates.threads,
1176
- updates.inboxNotifications,
1177
- updates.deletedThreads,
1178
- updates.deletedInboxNotifications
1173
+ updates.threads.modified,
1174
+ updates.inboxNotifications.modified,
1175
+ updates.threads.deleted,
1176
+ updates.inboxNotifications.deleted
1179
1177
  );
1180
- lastRequestedAtByRoom.set(room.id, updates.meta.requestedAt);
1178
+ lastRequestedAtByRoom.set(room.id, updates.requestedAt);
1181
1179
  } catch (err) {
1182
1180
  requestStatusByRoom.set(room.id, false);
1183
1181
  return;
@@ -1186,8 +1184,7 @@ function makeExtrasForClient2(client) {
1186
1184
  async function getThreadsAndInboxNotifications(room, queryKey, options, { retryCount } = { retryCount: 0 }) {
1187
1185
  const existingRequest = requestsByQuery.get(queryKey);
1188
1186
  if (existingRequest !== void 0) return existingRequest;
1189
- const commentsAPI = room[_core.kInternal].comments;
1190
- const request = commentsAPI.getThreads(options);
1187
+ const request = room.getThreads(options);
1191
1188
  requestsByQuery.set(queryKey, request);
1192
1189
  store.setQueryState(queryKey, {
1193
1190
  isLoading: true
@@ -1196,14 +1193,15 @@ function makeExtrasForClient2(client) {
1196
1193
  const result = await request;
1197
1194
  store.updateThreadsAndNotifications(
1198
1195
  result.threads,
1196
+ // TODO: Figure out how to remove this casting
1199
1197
  result.inboxNotifications,
1200
- result.deletedThreads,
1201
- result.deletedInboxNotifications,
1198
+ [],
1199
+ [],
1202
1200
  queryKey
1203
1201
  );
1204
1202
  const lastRequestedAt = lastRequestedAtByRoom.get(room.id);
1205
- if (lastRequestedAt === void 0 || lastRequestedAt > result.meta.requestedAt) {
1206
- lastRequestedAtByRoom.set(room.id, result.meta.requestedAt);
1203
+ if (lastRequestedAt === void 0 || lastRequestedAt > result.requestedAt) {
1204
+ lastRequestedAtByRoom.set(room.id, result.requestedAt);
1207
1205
  }
1208
1206
  poller.start(POLLING_INTERVAL2);
1209
1207
  } catch (err) {
@@ -1224,7 +1222,7 @@ function makeExtrasForClient2(client) {
1224
1222
  const existingRequest = requestsByQuery.get(queryKey);
1225
1223
  if (existingRequest !== void 0) return existingRequest;
1226
1224
  try {
1227
- const request = room[_core.kInternal].notifications.getRoomNotificationSettings();
1225
+ const request = room.getNotificationSettings();
1228
1226
  requestsByQuery.set(queryKey, request);
1229
1227
  store.setQueryState(queryKey, {
1230
1228
  isLoading: true
@@ -1444,10 +1442,8 @@ function RoomProviderInner(props) {
1444
1442
  store.deleteThread(message.threadId);
1445
1443
  return;
1446
1444
  }
1447
- const info = await room[_core.kInternal].comments.getThread({
1448
- threadId: message.threadId
1449
- });
1450
- if (!info) {
1445
+ const info = await room.getThread(message.threadId);
1446
+ if (!info.thread) {
1451
1447
  store.deleteThread(message.threadId);
1452
1448
  return;
1453
1449
  }
@@ -1825,8 +1821,8 @@ function useCreateThread() {
1825
1821
  (options) => {
1826
1822
  const body = options.body;
1827
1823
  const metadata = _nullishCoalesce(options.metadata, () => ( {}));
1828
- const threadId = createThreadId();
1829
- const commentId = createCommentId();
1824
+ const threadId = _core.createThreadId.call(void 0, );
1825
+ const commentId = _core.createCommentId.call(void 0, );
1830
1826
  const createdAt = /* @__PURE__ */ new Date();
1831
1827
  const newComment = {
1832
1828
  id: commentId,
@@ -1848,7 +1844,7 @@ function useCreateThread() {
1848
1844
  comments: [newComment],
1849
1845
  resolved: false
1850
1846
  };
1851
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
1847
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
1852
1848
  const { store, onMutationFailure } = getExtrasForClient2(client);
1853
1849
  store.pushOptimisticUpdate({
1854
1850
  type: "create-thread",
@@ -1856,8 +1852,7 @@ function useCreateThread() {
1856
1852
  id: optimisticUpdateId,
1857
1853
  roomId: room.id
1858
1854
  });
1859
- const commentsAPI = room[_core.kInternal].comments;
1860
- commentsAPI.createThread({ threadId, commentId, body, metadata }).then(
1855
+ room.createThread({ threadId, commentId, body, metadata }).then(
1861
1856
  (thread) => {
1862
1857
  store.set((state) => ({
1863
1858
  ...state,
@@ -1892,7 +1887,7 @@ function useDeleteThread() {
1892
1887
  const room = useRoom();
1893
1888
  return React4.useCallback(
1894
1889
  (threadId) => {
1895
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
1890
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
1896
1891
  const { store, onMutationFailure } = getExtrasForClient2(client);
1897
1892
  const thread = store.get().threads[threadId];
1898
1893
  const userId = getCurrentUserId(room);
@@ -1906,8 +1901,7 @@ function useDeleteThread() {
1906
1901
  threadId,
1907
1902
  deletedAt: /* @__PURE__ */ new Date()
1908
1903
  });
1909
- const commentsAPI = room[_core.kInternal].comments;
1910
- commentsAPI.deleteThread({ threadId }).then(
1904
+ room.deleteThread(threadId).then(
1911
1905
  () => {
1912
1906
  store.set((state) => {
1913
1907
  const existingThread = state.threads[threadId];
@@ -1951,7 +1945,7 @@ function useEditThreadMetadata() {
1951
1945
  const threadId = options.threadId;
1952
1946
  const metadata = options.metadata;
1953
1947
  const updatedAt = /* @__PURE__ */ new Date();
1954
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
1948
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
1955
1949
  const { store, onMutationFailure } = getExtrasForClient2(client);
1956
1950
  store.pushOptimisticUpdate({
1957
1951
  type: "edit-thread-metadata",
@@ -1960,8 +1954,7 @@ function useEditThreadMetadata() {
1960
1954
  threadId,
1961
1955
  updatedAt
1962
1956
  });
1963
- const commentsAPI = room[_core.kInternal].comments;
1964
- commentsAPI.editThreadMetadata({ metadata, threadId }).then(
1957
+ room.editThreadMetadata({ metadata, threadId }).then(
1965
1958
  (metadata2) => {
1966
1959
  store.set((state) => {
1967
1960
  const existingThread = state.threads[threadId];
@@ -2018,7 +2011,7 @@ function useCreateComment() {
2018
2011
  const room = useRoom();
2019
2012
  return React4.useCallback(
2020
2013
  ({ threadId, body }) => {
2021
- const commentId = createCommentId();
2014
+ const commentId = _core.createCommentId.call(void 0, );
2022
2015
  const createdAt = /* @__PURE__ */ new Date();
2023
2016
  const comment = {
2024
2017
  id: commentId,
@@ -2030,14 +2023,14 @@ function useCreateComment() {
2030
2023
  body,
2031
2024
  reactions: []
2032
2025
  };
2033
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2026
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2034
2027
  const { store, onMutationFailure } = getExtrasForClient2(client);
2035
2028
  store.pushOptimisticUpdate({
2036
2029
  type: "create-comment",
2037
2030
  comment,
2038
2031
  id: optimisticUpdateId
2039
2032
  });
2040
- room[_core.kInternal].comments.createComment({ threadId, commentId, body }).then(
2033
+ room.createComment({ threadId, commentId, body }).then(
2041
2034
  (newComment) => {
2042
2035
  store.set((state) => {
2043
2036
  const existingThread = state.threads[threadId];
@@ -2097,7 +2090,7 @@ function useEditComment() {
2097
2090
  return React4.useCallback(
2098
2091
  ({ threadId, commentId, body }) => {
2099
2092
  const editedAt = /* @__PURE__ */ new Date();
2100
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2093
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2101
2094
  const { store, onMutationFailure } = getExtrasForClient2(client);
2102
2095
  const thread = store.get().threads[threadId];
2103
2096
  if (thread === void 0) {
@@ -2124,7 +2117,7 @@ function useEditComment() {
2124
2117
  },
2125
2118
  id: optimisticUpdateId
2126
2119
  });
2127
- room[_core.kInternal].comments.editComment({ threadId, commentId, body }).then(
2120
+ room.editComment({ threadId, commentId, body }).then(
2128
2121
  (editedComment) => {
2129
2122
  store.set((state) => {
2130
2123
  const existingThread = state.threads[threadId];
@@ -2169,7 +2162,7 @@ function useDeleteComment() {
2169
2162
  return React4.useCallback(
2170
2163
  ({ threadId, commentId }) => {
2171
2164
  const deletedAt = /* @__PURE__ */ new Date();
2172
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2165
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2173
2166
  const { store, onMutationFailure } = getExtrasForClient2(client);
2174
2167
  store.pushOptimisticUpdate({
2175
2168
  type: "delete-comment",
@@ -2179,7 +2172,7 @@ function useDeleteComment() {
2179
2172
  id: optimisticUpdateId,
2180
2173
  roomId: room.id
2181
2174
  });
2182
- room[_core.kInternal].comments.deleteComment({ threadId, commentId }).then(
2175
+ room.deleteComment({ threadId, commentId }).then(
2183
2176
  () => {
2184
2177
  store.set((state) => {
2185
2178
  const existingThread = state.threads[threadId];
@@ -2223,7 +2216,7 @@ function useAddReaction() {
2223
2216
  ({ threadId, commentId, emoji }) => {
2224
2217
  const createdAt = /* @__PURE__ */ new Date();
2225
2218
  const userId = getCurrentUserId(room);
2226
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2219
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2227
2220
  const { store, onMutationFailure } = getExtrasForClient2(client);
2228
2221
  store.pushOptimisticUpdate({
2229
2222
  type: "add-reaction",
@@ -2236,7 +2229,7 @@ function useAddReaction() {
2236
2229
  },
2237
2230
  id: optimisticUpdateId
2238
2231
  });
2239
- room[_core.kInternal].comments.addReaction({ threadId, commentId, emoji }).then(
2232
+ room.addReaction({ threadId, commentId, emoji }).then(
2240
2233
  (addedReaction) => {
2241
2234
  store.set((state) => {
2242
2235
  const existingThread = state.threads[threadId];
@@ -2285,7 +2278,7 @@ function useRemoveReaction() {
2285
2278
  ({ threadId, commentId, emoji }) => {
2286
2279
  const userId = getCurrentUserId(room);
2287
2280
  const removedAt = /* @__PURE__ */ new Date();
2288
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2281
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2289
2282
  const { store, onMutationFailure } = getExtrasForClient2(client);
2290
2283
  store.pushOptimisticUpdate({
2291
2284
  type: "remove-reaction",
@@ -2296,7 +2289,7 @@ function useRemoveReaction() {
2296
2289
  removedAt,
2297
2290
  id: optimisticUpdateId
2298
2291
  });
2299
- room[_core.kInternal].comments.removeReaction({ threadId, commentId, emoji }).then(
2292
+ room.removeReaction({ threadId, commentId, emoji }).then(
2300
2293
  () => {
2301
2294
  store.set((state) => {
2302
2295
  const existingThread = state.threads[threadId];
@@ -2352,7 +2345,7 @@ function useMarkThreadAsRead() {
2352
2345
  (inboxNotification2) => inboxNotification2.kind === "thread" && inboxNotification2.threadId === threadId
2353
2346
  );
2354
2347
  if (!inboxNotification) return;
2355
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2348
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2356
2349
  const now = /* @__PURE__ */ new Date();
2357
2350
  store.pushOptimisticUpdate({
2358
2351
  type: "mark-inbox-notification-as-read",
@@ -2360,7 +2353,7 @@ function useMarkThreadAsRead() {
2360
2353
  inboxNotificationId: inboxNotification.id,
2361
2354
  readAt: now
2362
2355
  });
2363
- room[_core.kInternal].notifications.markInboxNotificationAsRead(inboxNotification.id).then(
2356
+ room.markInboxNotificationAsRead(inboxNotification.id).then(
2364
2357
  () => {
2365
2358
  store.set((state) => ({
2366
2359
  ...state,
@@ -2396,7 +2389,7 @@ function useMarkThreadAsResolved() {
2396
2389
  const room = useRoom();
2397
2390
  return React4.useCallback(
2398
2391
  (threadId) => {
2399
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2392
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2400
2393
  const updatedAt = /* @__PURE__ */ new Date();
2401
2394
  const { store, onMutationFailure } = getExtrasForClient2(client);
2402
2395
  store.pushOptimisticUpdate({
@@ -2405,8 +2398,7 @@ function useMarkThreadAsResolved() {
2405
2398
  threadId,
2406
2399
  updatedAt
2407
2400
  });
2408
- const commentsAPI = room[_core.kInternal].comments;
2409
- commentsAPI.markThreadAsResolved({ threadId }).then(
2401
+ room.markThreadAsResolved(threadId).then(
2410
2402
  () => {
2411
2403
  store.set((state) => {
2412
2404
  const existingThread = state.threads[threadId];
@@ -2462,7 +2454,7 @@ function useMarkThreadAsUnresolved() {
2462
2454
  const room = useRoom();
2463
2455
  return React4.useCallback(
2464
2456
  (threadId) => {
2465
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2457
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2466
2458
  const updatedAt = /* @__PURE__ */ new Date();
2467
2459
  const { store, onMutationFailure } = getExtrasForClient2(client);
2468
2460
  store.pushOptimisticUpdate({
@@ -2471,8 +2463,7 @@ function useMarkThreadAsUnresolved() {
2471
2463
  threadId,
2472
2464
  updatedAt
2473
2465
  });
2474
- const commentsAPI = room[_core.kInternal].comments;
2475
- commentsAPI.markThreadAsUnresolved({ threadId }).then(
2466
+ room.markThreadAsUnresolved(threadId).then(
2476
2467
  () => {
2477
2468
  store.set((state) => {
2478
2469
  const existingThread = state.threads[threadId];
@@ -2592,7 +2583,7 @@ function useUpdateRoomNotificationSettings() {
2592
2583
  const room = useRoom();
2593
2584
  return React4.useCallback(
2594
2585
  (settings) => {
2595
- const optimisticUpdateId = _nanoid.nanoid.call(void 0, );
2586
+ const optimisticUpdateId = _core.nanoid.call(void 0, );
2596
2587
  const { store, onMutationFailure } = getExtrasForClient2(client);
2597
2588
  store.pushOptimisticUpdate({
2598
2589
  id: optimisticUpdateId,
@@ -2600,7 +2591,7 @@ function useUpdateRoomNotificationSettings() {
2600
2591
  roomId: room.id,
2601
2592
  settings
2602
2593
  });
2603
- room[_core.kInternal].notifications.updateRoomNotificationSettings(settings).then(
2594
+ room.updateNotificationSettings(settings).then(
2604
2595
  (settings2) => {
2605
2596
  store.set((state) => ({
2606
2597
  ...state,
@@ -2870,4 +2861,4 @@ var _useUpdateMyPresence = useUpdateMyPresence;
2870
2861
 
2871
2862
 
2872
2863
  exports.PKG_NAME = PKG_NAME; exports.PKG_VERSION = PKG_VERSION; exports.PKG_FORMAT = PKG_FORMAT; exports.ClientSideSuspense = ClientSideSuspense; exports.ClientContext = ClientContext; exports.useClient = useClient; exports.LiveblocksProvider = LiveblocksProvider; exports.createLiveblocksContext = createLiveblocksContext; exports.useInboxNotifications = useInboxNotifications; exports.useInboxNotificationsSuspense = useInboxNotificationsSuspense; exports.useMarkAllInboxNotificationsAsRead = useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = useMarkInboxNotificationAsRead; exports.useDeleteAllInboxNotifications = useDeleteAllInboxNotifications; exports.useDeleteInboxNotification = useDeleteInboxNotification; exports.useUnreadInboxNotificationsCount = useUnreadInboxNotificationsCount; exports.useUnreadInboxNotificationsCountSuspense = useUnreadInboxNotificationsCountSuspense; exports.useRoomInfo = useRoomInfo; exports.useRoomInfoSuspense = useRoomInfoSuspense; exports._useInboxNotificationThread = _useInboxNotificationThread; exports._useUser = _useUser; exports._useUserSuspense = _useUserSuspense; exports.CreateThreadError = CreateThreadError; exports.selectedThreads = selectedThreads; exports.RoomContext = RoomContext; exports.useStatus = useStatus; exports.useStorageStatus = useStorageStatus; exports.useBatch = useBatch; exports.useLostConnectionListener = useLostConnectionListener; exports.useErrorListener = useErrorListener; exports.useHistory = useHistory; exports.useUndo = useUndo; exports.useRedo = useRedo; exports.useCanUndo = useCanUndo; exports.useCanRedo = useCanRedo; exports.useOthersConnectionIds = useOthersConnectionIds; exports.useCommentsErrorListener = useCommentsErrorListener; exports.useCreateComment = useCreateComment; exports.useEditComment = useEditComment; exports.useDeleteComment = useDeleteComment; exports.useRemoveReaction = useRemoveReaction; exports.useMarkThreadAsRead = useMarkThreadAsRead; exports.useMarkThreadAsResolved = useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = useMarkThreadAsUnresolved; exports.useThreadSubscription = useThreadSubscription; exports.useRoomNotificationSettings = useRoomNotificationSettings; exports.useUpdateRoomNotificationSettings = useUpdateRoomNotificationSettings; exports.useOthersConnectionIdsSuspense = useOthersConnectionIdsSuspense; exports.useStorageStatusSuspense = useStorageStatusSuspense; exports.createRoomContext = createRoomContext; exports._RoomProvider = _RoomProvider; exports._useBroadcastEvent = _useBroadcastEvent; exports._useOthersListener = _useOthersListener; exports._useRoom = _useRoom; exports._useAddReaction = _useAddReaction; exports._useMutation = _useMutation; exports._useCreateThread = _useCreateThread; exports._useDeleteThread = _useDeleteThread; exports._useEditThreadMetadata = _useEditThreadMetadata; exports._useEventListener = _useEventListener; exports._useMyPresence = _useMyPresence; exports._useOthersMapped = _useOthersMapped; exports._useOthersMappedSuspense = _useOthersMappedSuspense; exports._useThreads = _useThreads; exports._useThreadsSuspense = _useThreadsSuspense; exports._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;
2873
- //# sourceMappingURL=chunk-K5EDPAZP.js.map
2864
+ //# sourceMappingURL=chunk-L4QUDD4I.js.map