@liveblocks/react 2.16.1-ai → 2.16.1-ai1
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.d.mts +1 -1
- package/dist/_private.d.ts +1 -1
- package/dist/_private.js +5 -7
- package/dist/_private.js.map +1 -1
- package/dist/_private.mjs +1 -3
- package/dist/_private.mjs.map +1 -1
- package/dist/{chunk-XBBRJ42N.mjs → chunk-A53DY3L6.mjs} +2 -2
- package/dist/{chunk-FQKGWA7O.mjs → chunk-JZBPCFEX.mjs} +99 -214
- package/dist/chunk-JZBPCFEX.mjs.map +1 -0
- package/dist/{chunk-VJYVOAD5.js → chunk-NZL5WL5O.js} +102 -217
- package/dist/chunk-NZL5WL5O.js.map +1 -0
- package/dist/{chunk-ANPXBJP5.js → chunk-QRMB4TUI.js} +2 -2
- package/dist/{chunk-ANPXBJP5.js.map → chunk-QRMB4TUI.js.map} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{room-BjHGIaNf.d.mts → room-Ce3twcjb.d.mts} +36 -154
- package/dist/{room-BjHGIaNf.d.ts → room-Ce3twcjb.d.ts} +36 -154
- package/dist/suspense.d.mts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +4 -4
- package/dist/suspense.js.map +1 -1
- package/dist/suspense.mjs +2 -2
- package/dist/suspense.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-FQKGWA7O.mjs.map +0 -1
- package/dist/chunk-VJYVOAD5.js.map +0 -1
- /package/dist/{chunk-XBBRJ42N.mjs.map → chunk-A53DY3L6.mjs.map} +0 -0
|
@@ -224,15 +224,13 @@ import {
|
|
|
224
224
|
console as console2,
|
|
225
225
|
DefaultMap,
|
|
226
226
|
DerivedSignal,
|
|
227
|
-
HttpError,
|
|
228
227
|
kInternal,
|
|
229
228
|
MutableSignal as MutableSignal2,
|
|
230
229
|
nanoid,
|
|
231
230
|
nn,
|
|
232
231
|
shallow as shallow3,
|
|
233
232
|
Signal,
|
|
234
|
-
stringify
|
|
235
|
-
unstringify
|
|
233
|
+
stringify
|
|
236
234
|
} from "@liveblocks/core";
|
|
237
235
|
|
|
238
236
|
// src/lib/autobind.ts
|
|
@@ -282,16 +280,16 @@ function matchesMetadata(thread, q) {
|
|
|
282
280
|
const metadata = thread.metadata;
|
|
283
281
|
return q.metadata === void 0 || Object.entries(q.metadata).every(
|
|
284
282
|
([key, op]) => (
|
|
285
|
-
//
|
|
286
|
-
//
|
|
287
|
-
|
|
288
|
-
// https://liveblocks.slack.com/archives/C02PZL7QAAW/p1728546988505989
|
|
289
|
-
matchesOperator(metadata[key], op)
|
|
283
|
+
// Ignore explicit-undefined filters
|
|
284
|
+
// Boolean logic: op? => value matches the operator
|
|
285
|
+
op === void 0 || matchesOperator(metadata[key], op)
|
|
290
286
|
)
|
|
291
287
|
);
|
|
292
288
|
}
|
|
293
289
|
function matchesOperator(value, op) {
|
|
294
|
-
if (
|
|
290
|
+
if (op === null) {
|
|
291
|
+
return value === void 0;
|
|
292
|
+
} else if (isStartsWithOperator(op)) {
|
|
295
293
|
return typeof value === "string" && value.startsWith(op.startsWith);
|
|
296
294
|
} else {
|
|
297
295
|
return value === op;
|
|
@@ -836,7 +834,7 @@ var UmbrellaStore = class {
|
|
|
836
834
|
);
|
|
837
835
|
const loadingUserThreads = new DefaultMap(
|
|
838
836
|
(queryKey) => {
|
|
839
|
-
const query =
|
|
837
|
+
const query = JSON.parse(queryKey);
|
|
840
838
|
const resource = new PaginatedResource(async (cursor) => {
|
|
841
839
|
const result = await this.#client[kInternal].httpClient.getUserThreads_experimental({
|
|
842
840
|
cursor,
|
|
@@ -878,7 +876,7 @@ var UmbrellaStore = class {
|
|
|
878
876
|
);
|
|
879
877
|
const loadingRoomThreads = new DefaultMap(
|
|
880
878
|
(queryKey) => {
|
|
881
|
-
const [roomId, query] =
|
|
879
|
+
const [roomId, query] = JSON.parse(queryKey);
|
|
882
880
|
const resource = new PaginatedResource(async (cursor) => {
|
|
883
881
|
const result = await this.#client[kInternal].httpClient.getThreads({
|
|
884
882
|
roomId,
|
|
@@ -941,10 +939,7 @@ var UmbrellaStore = class {
|
|
|
941
939
|
const resource = new SinglePageResource(async () => {
|
|
942
940
|
const room = this.#client.getRoom(roomId);
|
|
943
941
|
if (room === null) {
|
|
944
|
-
throw new
|
|
945
|
-
`Room '${roomId}' is not available on client`,
|
|
946
|
-
479
|
|
947
|
-
);
|
|
942
|
+
throw new Error(`Room '${roomId}' is not available on client`);
|
|
948
943
|
}
|
|
949
944
|
const result = await room.getNotificationSettings();
|
|
950
945
|
this.roomNotificationSettings.update(roomId, result);
|
|
@@ -967,10 +962,7 @@ var UmbrellaStore = class {
|
|
|
967
962
|
const resource = new SinglePageResource(async () => {
|
|
968
963
|
const room = this.#client.getRoom(roomId);
|
|
969
964
|
if (room === null) {
|
|
970
|
-
throw new
|
|
971
|
-
`Room '${roomId}' is not available on client`,
|
|
972
|
-
479
|
|
973
|
-
);
|
|
965
|
+
throw new Error(`Room '${roomId}' is not available on client`);
|
|
974
966
|
}
|
|
975
967
|
const result = await room[kInternal].listTextVersions();
|
|
976
968
|
this.historyVersions.update(roomId, result.versions);
|
|
@@ -1826,8 +1818,15 @@ function useMarkInboxNotificationAsRead_withClient(client) {
|
|
|
1826
1818
|
optimisticId
|
|
1827
1819
|
);
|
|
1828
1820
|
},
|
|
1829
|
-
() => {
|
|
1821
|
+
(err) => {
|
|
1830
1822
|
store.optimisticUpdates.remove(optimisticId);
|
|
1823
|
+
client[kInternal2].emitError(
|
|
1824
|
+
{
|
|
1825
|
+
type: "MARK_INBOX_NOTIFICATION_AS_READ_ERROR",
|
|
1826
|
+
inboxNotificationId
|
|
1827
|
+
},
|
|
1828
|
+
err
|
|
1829
|
+
);
|
|
1831
1830
|
}
|
|
1832
1831
|
);
|
|
1833
1832
|
},
|
|
@@ -1846,8 +1845,13 @@ function useMarkAllInboxNotificationsAsRead_withClient(client) {
|
|
|
1846
1845
|
() => {
|
|
1847
1846
|
store.markAllInboxNotificationsRead(optimisticId, readAt);
|
|
1848
1847
|
},
|
|
1849
|
-
() => {
|
|
1848
|
+
(err) => {
|
|
1850
1849
|
store.optimisticUpdates.remove(optimisticId);
|
|
1850
|
+
client[kInternal2].emitError(
|
|
1851
|
+
// No roomId, threadId, commentId to include for this error
|
|
1852
|
+
{ type: "MARK_ALL_INBOX_NOTIFICATIONS_AS_READ_ERROR" },
|
|
1853
|
+
err
|
|
1854
|
+
);
|
|
1851
1855
|
}
|
|
1852
1856
|
);
|
|
1853
1857
|
}, [client]);
|
|
@@ -1866,8 +1870,12 @@ function useDeleteInboxNotification_withClient(client) {
|
|
|
1866
1870
|
() => {
|
|
1867
1871
|
store.deleteInboxNotification(inboxNotificationId, optimisticId);
|
|
1868
1872
|
},
|
|
1869
|
-
() => {
|
|
1873
|
+
(err) => {
|
|
1870
1874
|
store.optimisticUpdates.remove(optimisticId);
|
|
1875
|
+
client[kInternal2].emitError(
|
|
1876
|
+
{ type: "DELETE_INBOX_NOTIFICATION_ERROR", inboxNotificationId },
|
|
1877
|
+
err
|
|
1878
|
+
);
|
|
1871
1879
|
}
|
|
1872
1880
|
);
|
|
1873
1881
|
},
|
|
@@ -1886,8 +1894,12 @@ function useDeleteAllInboxNotifications_withClient(client) {
|
|
|
1886
1894
|
() => {
|
|
1887
1895
|
store.deleteAllInboxNotifications(optimisticId);
|
|
1888
1896
|
},
|
|
1889
|
-
() => {
|
|
1897
|
+
(err) => {
|
|
1890
1898
|
store.optimisticUpdates.remove(optimisticId);
|
|
1899
|
+
client[kInternal2].emitError(
|
|
1900
|
+
{ type: "DELETE_ALL_INBOX_NOTIFICATIONS_ERROR" },
|
|
1901
|
+
err
|
|
1902
|
+
);
|
|
1891
1903
|
}
|
|
1892
1904
|
);
|
|
1893
1905
|
}, [client]);
|
|
@@ -2049,6 +2061,7 @@ function createSharedContext(client) {
|
|
|
2049
2061
|
useUser: (userId) => useUser_withClient(client, userId),
|
|
2050
2062
|
useRoomInfo: (roomId) => useRoomInfo_withClient(client, roomId),
|
|
2051
2063
|
useIsInsideRoom,
|
|
2064
|
+
useErrorListener,
|
|
2052
2065
|
useSyncStatus: useSyncStatus2
|
|
2053
2066
|
},
|
|
2054
2067
|
suspense: {
|
|
@@ -2056,6 +2069,7 @@ function createSharedContext(client) {
|
|
|
2056
2069
|
useUser: (userId) => useUserSuspense_withClient(client, userId),
|
|
2057
2070
|
useRoomInfo: (roomId) => useRoomInfoSuspense_withClient(client, roomId),
|
|
2058
2071
|
useIsInsideRoom,
|
|
2072
|
+
useErrorListener,
|
|
2059
2073
|
useSyncStatus: useSyncStatus2
|
|
2060
2074
|
}
|
|
2061
2075
|
};
|
|
@@ -2235,104 +2249,14 @@ function useSyncStatusSmooth_withClient(client) {
|
|
|
2235
2249
|
function useSyncStatus(options) {
|
|
2236
2250
|
return useSyncStatus_withClient(useClient(), options);
|
|
2237
2251
|
}
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
var DeleteThreadError = class extends Error {
|
|
2249
|
-
constructor(cause, context) {
|
|
2250
|
-
super("Delete thread failed.");
|
|
2251
|
-
this.cause = cause;
|
|
2252
|
-
this.context = context;
|
|
2253
|
-
this.name = "DeleteThreadError";
|
|
2254
|
-
}
|
|
2255
|
-
};
|
|
2256
|
-
var EditThreadMetadataError = class extends Error {
|
|
2257
|
-
constructor(cause, context) {
|
|
2258
|
-
super("Edit thread metadata failed.");
|
|
2259
|
-
this.cause = cause;
|
|
2260
|
-
this.context = context;
|
|
2261
|
-
this.name = "EditThreadMetadataError";
|
|
2262
|
-
}
|
|
2263
|
-
};
|
|
2264
|
-
var MarkThreadAsResolvedError = class extends Error {
|
|
2265
|
-
constructor(cause, context) {
|
|
2266
|
-
super("Mark thread as resolved failed.");
|
|
2267
|
-
this.cause = cause;
|
|
2268
|
-
this.context = context;
|
|
2269
|
-
this.name = "MarkThreadAsResolvedError";
|
|
2270
|
-
}
|
|
2271
|
-
};
|
|
2272
|
-
var MarkThreadAsUnresolvedError = class extends Error {
|
|
2273
|
-
constructor(cause, context) {
|
|
2274
|
-
super("Mark thread as unresolved failed.");
|
|
2275
|
-
this.cause = cause;
|
|
2276
|
-
this.context = context;
|
|
2277
|
-
this.name = "MarkThreadAsUnresolvedError";
|
|
2278
|
-
}
|
|
2279
|
-
};
|
|
2280
|
-
var CreateCommentError = class extends Error {
|
|
2281
|
-
constructor(cause, context) {
|
|
2282
|
-
super("Create comment failed.");
|
|
2283
|
-
this.cause = cause;
|
|
2284
|
-
this.context = context;
|
|
2285
|
-
this.name = "CreateCommentError";
|
|
2286
|
-
}
|
|
2287
|
-
};
|
|
2288
|
-
var EditCommentError = class extends Error {
|
|
2289
|
-
constructor(cause, context) {
|
|
2290
|
-
super("Edit comment failed.");
|
|
2291
|
-
this.cause = cause;
|
|
2292
|
-
this.context = context;
|
|
2293
|
-
this.name = "EditCommentError";
|
|
2294
|
-
}
|
|
2295
|
-
};
|
|
2296
|
-
var DeleteCommentError = class extends Error {
|
|
2297
|
-
constructor(cause, context) {
|
|
2298
|
-
super("Delete comment failed.");
|
|
2299
|
-
this.cause = cause;
|
|
2300
|
-
this.context = context;
|
|
2301
|
-
this.name = "DeleteCommentError";
|
|
2302
|
-
}
|
|
2303
|
-
};
|
|
2304
|
-
var AddReactionError = class extends Error {
|
|
2305
|
-
constructor(cause, context) {
|
|
2306
|
-
super("Add reaction failed.");
|
|
2307
|
-
this.cause = cause;
|
|
2308
|
-
this.context = context;
|
|
2309
|
-
this.name = "AddReactionError";
|
|
2310
|
-
}
|
|
2311
|
-
};
|
|
2312
|
-
var RemoveReactionError = class extends Error {
|
|
2313
|
-
constructor(cause, context) {
|
|
2314
|
-
super("Remove reaction failed.");
|
|
2315
|
-
this.cause = cause;
|
|
2316
|
-
this.context = context;
|
|
2317
|
-
this.name = "RemoveReactionError";
|
|
2318
|
-
}
|
|
2319
|
-
};
|
|
2320
|
-
var MarkInboxNotificationAsReadError = class extends Error {
|
|
2321
|
-
constructor(cause, context) {
|
|
2322
|
-
super("Mark inbox notification as read failed.");
|
|
2323
|
-
this.cause = cause;
|
|
2324
|
-
this.context = context;
|
|
2325
|
-
this.name = "MarkInboxNotificationAsReadError";
|
|
2326
|
-
}
|
|
2327
|
-
};
|
|
2328
|
-
var UpdateNotificationSettingsError = class extends Error {
|
|
2329
|
-
constructor(cause, context) {
|
|
2330
|
-
super("Update notification settings failed.");
|
|
2331
|
-
this.cause = cause;
|
|
2332
|
-
this.context = context;
|
|
2333
|
-
this.name = "UpdateNotificationSettingsError";
|
|
2334
|
-
}
|
|
2335
|
-
};
|
|
2252
|
+
function useErrorListener(callback) {
|
|
2253
|
+
const client = useClient();
|
|
2254
|
+
const savedCallback = useLatest(callback);
|
|
2255
|
+
useEffect3(
|
|
2256
|
+
() => client.events.error.subscribe((e) => savedCallback.current(e)),
|
|
2257
|
+
[client, savedCallback]
|
|
2258
|
+
);
|
|
2259
|
+
}
|
|
2336
2260
|
|
|
2337
2261
|
// src/room.tsx
|
|
2338
2262
|
import { shallow as shallow5 } from "@liveblocks/client";
|
|
@@ -2343,9 +2267,8 @@ import {
|
|
|
2343
2267
|
createThreadId,
|
|
2344
2268
|
DefaultMap as DefaultMap2,
|
|
2345
2269
|
errorIf,
|
|
2346
|
-
HttpError
|
|
2270
|
+
HttpError,
|
|
2347
2271
|
kInternal as kInternal3,
|
|
2348
|
-
makeEventSource,
|
|
2349
2272
|
makePoller as makePoller2,
|
|
2350
2273
|
ServerMsgCode
|
|
2351
2274
|
} from "@liveblocks/core";
|
|
@@ -2439,14 +2362,6 @@ function getCurrentUserId(client) {
|
|
|
2439
2362
|
}
|
|
2440
2363
|
return userId;
|
|
2441
2364
|
}
|
|
2442
|
-
function handleApiError(err) {
|
|
2443
|
-
const message = `Request failed with status ${err.status}: ${err.message}`;
|
|
2444
|
-
if (err.details?.error === "FORBIDDEN") {
|
|
2445
|
-
const detailedMessage = [message, err.details.suggestion, err.details.docs].filter(Boolean).join("\n");
|
|
2446
|
-
console3.error(detailedMessage);
|
|
2447
|
-
}
|
|
2448
|
-
return new Error(message);
|
|
2449
|
-
}
|
|
2450
2365
|
var _extras2 = /* @__PURE__ */ new WeakMap();
|
|
2451
2366
|
var _bundles2 = /* @__PURE__ */ new WeakMap();
|
|
2452
2367
|
function getOrCreateRoomContextBundle(client) {
|
|
@@ -2467,19 +2382,21 @@ function getRoomExtrasForClient(client) {
|
|
|
2467
2382
|
}
|
|
2468
2383
|
function makeRoomExtrasForClient(client) {
|
|
2469
2384
|
const store = getUmbrellaStoreForClient(client);
|
|
2470
|
-
|
|
2471
|
-
function onMutationFailure(innerError, optimisticId, createPublicError) {
|
|
2385
|
+
function onMutationFailure(optimisticId, context, innerError) {
|
|
2472
2386
|
store.optimisticUpdates.remove(optimisticId);
|
|
2473
|
-
if (innerError instanceof
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2387
|
+
if (innerError instanceof HttpError) {
|
|
2388
|
+
if (innerError.status === 403) {
|
|
2389
|
+
const detailedMessage = [
|
|
2390
|
+
innerError.message,
|
|
2391
|
+
innerError.details?.suggestion,
|
|
2392
|
+
innerError.details?.docs
|
|
2393
|
+
].filter(Boolean).join("\n");
|
|
2394
|
+
console3.error(detailedMessage);
|
|
2395
|
+
}
|
|
2396
|
+
client[kInternal3].emitError(context, innerError);
|
|
2397
|
+
} else {
|
|
2398
|
+
throw innerError;
|
|
2481
2399
|
}
|
|
2482
|
-
throw innerError;
|
|
2483
2400
|
}
|
|
2484
2401
|
const threadsPollersByRoomId = new DefaultMap2(
|
|
2485
2402
|
(roomId) => makePoller2(
|
|
@@ -2525,7 +2442,6 @@ function makeRoomExtrasForClient(client) {
|
|
|
2525
2442
|
);
|
|
2526
2443
|
return {
|
|
2527
2444
|
store,
|
|
2528
|
-
commentsErrorEventSource: commentsErrorEventSource.observable,
|
|
2529
2445
|
onMutationFailure,
|
|
2530
2446
|
getOrCreateThreadsPollerForRoomId: threadsPollersByRoomId.getOrCreate.bind(
|
|
2531
2447
|
threadsPollersByRoomId
|
|
@@ -2551,7 +2467,6 @@ function makeRoomContextBundle(client) {
|
|
|
2551
2467
|
useBroadcastEvent,
|
|
2552
2468
|
useOthersListener,
|
|
2553
2469
|
useLostConnectionListener,
|
|
2554
|
-
useErrorListener,
|
|
2555
2470
|
useEventListener,
|
|
2556
2471
|
useHistory,
|
|
2557
2472
|
useUndo,
|
|
@@ -2597,7 +2512,6 @@ function makeRoomContextBundle(client) {
|
|
|
2597
2512
|
useBroadcastEvent,
|
|
2598
2513
|
useOthersListener,
|
|
2599
2514
|
useLostConnectionListener,
|
|
2600
|
-
useErrorListener,
|
|
2601
2515
|
useEventListener,
|
|
2602
2516
|
useHistory,
|
|
2603
2517
|
useUndo,
|
|
@@ -2633,8 +2547,7 @@ function makeRoomContextBundle(client) {
|
|
|
2633
2547
|
useRoomNotificationSettings: useRoomNotificationSettingsSuspense,
|
|
2634
2548
|
useUpdateRoomNotificationSettings,
|
|
2635
2549
|
...shared.suspense
|
|
2636
|
-
}
|
|
2637
|
-
useCommentsErrorListener
|
|
2550
|
+
}
|
|
2638
2551
|
};
|
|
2639
2552
|
return Object.defineProperty(bundle, kInternal3, {
|
|
2640
2553
|
enumerable: false
|
|
@@ -2895,14 +2808,6 @@ function useLostConnectionListener(callback) {
|
|
|
2895
2808
|
[room, savedCallback]
|
|
2896
2809
|
);
|
|
2897
2810
|
}
|
|
2898
|
-
function useErrorListener(callback) {
|
|
2899
|
-
const room = useRoom();
|
|
2900
|
-
const savedCallback = useLatest(callback);
|
|
2901
|
-
useEffect5(
|
|
2902
|
-
() => room.events.error.subscribe((e) => savedCallback.current(e)),
|
|
2903
|
-
[room, savedCallback]
|
|
2904
|
-
);
|
|
2905
|
-
}
|
|
2906
2811
|
function useEventListener(callback) {
|
|
2907
2812
|
const room = useRoom();
|
|
2908
2813
|
const savedCallback = useLatest(callback);
|
|
@@ -3112,14 +3017,6 @@ function useThreads(options = {}) {
|
|
|
3112
3017
|
useScrollToCommentOnLoadEffect(scrollOnLoad, result);
|
|
3113
3018
|
return result;
|
|
3114
3019
|
}
|
|
3115
|
-
function useCommentsErrorListener(callback) {
|
|
3116
|
-
const client = useClient();
|
|
3117
|
-
const savedCallback = useLatest(callback);
|
|
3118
|
-
const { commentsErrorEventSource } = getRoomExtrasForClient(client);
|
|
3119
|
-
useEffect5(() => {
|
|
3120
|
-
return commentsErrorEventSource.subscribe(savedCallback.current);
|
|
3121
|
-
}, [savedCallback, commentsErrorEventSource]);
|
|
3122
|
-
}
|
|
3123
3020
|
function useCreateThread() {
|
|
3124
3021
|
return useCreateRoomThread(useRoom().id);
|
|
3125
3022
|
}
|
|
@@ -3173,15 +3070,16 @@ function useCreateRoomThread(roomId) {
|
|
|
3173
3070
|
store.createThread(optimisticId, thread);
|
|
3174
3071
|
},
|
|
3175
3072
|
(err) => onMutationFailure(
|
|
3176
|
-
err,
|
|
3177
3073
|
optimisticId,
|
|
3178
|
-
|
|
3074
|
+
{
|
|
3075
|
+
type: "CREATE_THREAD_ERROR",
|
|
3179
3076
|
roomId,
|
|
3180
3077
|
threadId,
|
|
3181
3078
|
commentId,
|
|
3182
3079
|
body,
|
|
3183
3080
|
metadata
|
|
3184
|
-
}
|
|
3081
|
+
},
|
|
3082
|
+
err
|
|
3185
3083
|
)
|
|
3186
3084
|
);
|
|
3187
3085
|
return newThread;
|
|
@@ -3213,9 +3111,9 @@ function useDeleteRoomThread(roomId) {
|
|
|
3213
3111
|
store.deleteThread(threadId, optimisticId);
|
|
3214
3112
|
},
|
|
3215
3113
|
(err) => onMutationFailure(
|
|
3216
|
-
err,
|
|
3217
3114
|
optimisticId,
|
|
3218
|
-
|
|
3115
|
+
{ type: "DELETE_THREAD_ERROR", roomId, threadId },
|
|
3116
|
+
err
|
|
3219
3117
|
)
|
|
3220
3118
|
);
|
|
3221
3119
|
},
|
|
@@ -3248,13 +3146,14 @@ function useEditRoomThreadMetadata(roomId) {
|
|
|
3248
3146
|
store.patchThread(threadId, optimisticId, { metadata: metadata2 }, updatedAt)
|
|
3249
3147
|
),
|
|
3250
3148
|
(err) => onMutationFailure(
|
|
3251
|
-
err,
|
|
3252
3149
|
optimisticId,
|
|
3253
|
-
|
|
3150
|
+
{
|
|
3151
|
+
type: "EDIT_THREAD_METADATA_ERROR",
|
|
3254
3152
|
roomId,
|
|
3255
3153
|
threadId,
|
|
3256
3154
|
metadata
|
|
3257
|
-
}
|
|
3155
|
+
},
|
|
3156
|
+
err
|
|
3258
3157
|
)
|
|
3259
3158
|
);
|
|
3260
3159
|
},
|
|
@@ -3292,14 +3191,15 @@ function useCreateRoomComment(roomId) {
|
|
|
3292
3191
|
store.createComment(newComment, optimisticId);
|
|
3293
3192
|
},
|
|
3294
3193
|
(err) => onMutationFailure(
|
|
3295
|
-
err,
|
|
3296
3194
|
optimisticId,
|
|
3297
|
-
|
|
3195
|
+
{
|
|
3196
|
+
type: "CREATE_COMMENT_ERROR",
|
|
3298
3197
|
roomId,
|
|
3299
3198
|
threadId,
|
|
3300
3199
|
commentId,
|
|
3301
3200
|
body
|
|
3302
|
-
}
|
|
3201
|
+
},
|
|
3202
|
+
err
|
|
3303
3203
|
)
|
|
3304
3204
|
);
|
|
3305
3205
|
return comment;
|
|
@@ -3347,14 +3247,9 @@ function useEditRoomComment(roomId) {
|
|
|
3347
3247
|
store.editComment(threadId, optimisticId, editedComment);
|
|
3348
3248
|
},
|
|
3349
3249
|
(err) => onMutationFailure(
|
|
3350
|
-
err,
|
|
3351
3250
|
optimisticId,
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
threadId,
|
|
3355
|
-
commentId,
|
|
3356
|
-
body
|
|
3357
|
-
})
|
|
3251
|
+
{ type: "EDIT_COMMENT_ERROR", roomId, threadId, commentId, body },
|
|
3252
|
+
err
|
|
3358
3253
|
)
|
|
3359
3254
|
);
|
|
3360
3255
|
},
|
|
@@ -3382,13 +3277,9 @@ function useDeleteRoomComment(roomId) {
|
|
|
3382
3277
|
store.deleteComment(threadId, optimisticId, commentId, deletedAt);
|
|
3383
3278
|
},
|
|
3384
3279
|
(err) => onMutationFailure(
|
|
3385
|
-
err,
|
|
3386
3280
|
optimisticId,
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
threadId,
|
|
3390
|
-
commentId
|
|
3391
|
-
})
|
|
3281
|
+
{ type: "DELETE_COMMENT_ERROR", roomId, threadId, commentId },
|
|
3282
|
+
err
|
|
3392
3283
|
)
|
|
3393
3284
|
);
|
|
3394
3285
|
},
|
|
@@ -3426,14 +3317,15 @@ function useAddRoomCommentReaction(roomId) {
|
|
|
3426
3317
|
);
|
|
3427
3318
|
},
|
|
3428
3319
|
(err) => onMutationFailure(
|
|
3429
|
-
err,
|
|
3430
3320
|
optimisticId,
|
|
3431
|
-
|
|
3321
|
+
{
|
|
3322
|
+
type: "ADD_REACTION_ERROR",
|
|
3432
3323
|
roomId,
|
|
3433
3324
|
threadId,
|
|
3434
3325
|
commentId,
|
|
3435
3326
|
emoji
|
|
3436
|
-
}
|
|
3327
|
+
},
|
|
3328
|
+
err
|
|
3437
3329
|
)
|
|
3438
3330
|
);
|
|
3439
3331
|
},
|
|
@@ -3470,14 +3362,15 @@ function useRemoveRoomCommentReaction(roomId) {
|
|
|
3470
3362
|
);
|
|
3471
3363
|
},
|
|
3472
3364
|
(err) => onMutationFailure(
|
|
3473
|
-
err,
|
|
3474
3365
|
optimisticId,
|
|
3475
|
-
|
|
3366
|
+
{
|
|
3367
|
+
type: "REMOVE_REACTION_ERROR",
|
|
3476
3368
|
roomId,
|
|
3477
3369
|
threadId,
|
|
3478
3370
|
commentId,
|
|
3479
3371
|
emoji
|
|
3480
|
-
}
|
|
3372
|
+
},
|
|
3373
|
+
err
|
|
3481
3374
|
)
|
|
3482
3375
|
);
|
|
3483
3376
|
},
|
|
@@ -3517,11 +3410,13 @@ function useMarkRoomThreadAsRead(roomId) {
|
|
|
3517
3410
|
},
|
|
3518
3411
|
(err) => {
|
|
3519
3412
|
onMutationFailure(
|
|
3520
|
-
err,
|
|
3521
3413
|
optimisticId,
|
|
3522
|
-
|
|
3414
|
+
{
|
|
3415
|
+
type: "MARK_INBOX_NOTIFICATION_AS_READ_ERROR",
|
|
3416
|
+
roomId,
|
|
3523
3417
|
inboxNotificationId: inboxNotification.id
|
|
3524
|
-
}
|
|
3418
|
+
},
|
|
3419
|
+
err
|
|
3525
3420
|
);
|
|
3526
3421
|
return;
|
|
3527
3422
|
}
|
|
@@ -3554,12 +3449,9 @@ function useMarkRoomThreadAsResolved(roomId) {
|
|
|
3554
3449
|
);
|
|
3555
3450
|
},
|
|
3556
3451
|
(err) => onMutationFailure(
|
|
3557
|
-
err,
|
|
3558
3452
|
optimisticId,
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
threadId
|
|
3562
|
-
})
|
|
3453
|
+
{ type: "MARK_THREAD_AS_RESOLVED_ERROR", roomId, threadId },
|
|
3454
|
+
err
|
|
3563
3455
|
)
|
|
3564
3456
|
);
|
|
3565
3457
|
},
|
|
@@ -3590,12 +3482,9 @@ function useMarkRoomThreadAsUnresolved(roomId) {
|
|
|
3590
3482
|
);
|
|
3591
3483
|
},
|
|
3592
3484
|
(err) => onMutationFailure(
|
|
3593
|
-
err,
|
|
3594
3485
|
optimisticId,
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
threadId
|
|
3598
|
-
})
|
|
3486
|
+
{ type: "MARK_THREAD_AS_UNRESOLVED_ERROR", roomId, threadId },
|
|
3487
|
+
err
|
|
3599
3488
|
)
|
|
3600
3489
|
);
|
|
3601
3490
|
},
|
|
@@ -3745,11 +3634,9 @@ function useUpdateRoomNotificationSettings() {
|
|
|
3745
3634
|
store.updateRoomNotificationSettings(room.id, optimisticId, settings2);
|
|
3746
3635
|
},
|
|
3747
3636
|
(err) => onMutationFailure(
|
|
3748
|
-
err,
|
|
3749
3637
|
optimisticId,
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
})
|
|
3638
|
+
{ type: "UPDATE_NOTIFICATION_SETTINGS_ERROR", roomId: room.id },
|
|
3639
|
+
err
|
|
3753
3640
|
)
|
|
3754
3641
|
);
|
|
3755
3642
|
},
|
|
@@ -3962,7 +3849,7 @@ export {
|
|
|
3962
3849
|
_useUserThreads_experimental,
|
|
3963
3850
|
_useUserThreadsSuspense_experimental,
|
|
3964
3851
|
useSyncStatus,
|
|
3965
|
-
|
|
3852
|
+
useErrorListener,
|
|
3966
3853
|
useStatus,
|
|
3967
3854
|
useReportTextEditor,
|
|
3968
3855
|
useYjsProvider,
|
|
@@ -3973,14 +3860,12 @@ export {
|
|
|
3973
3860
|
useStorageStatus,
|
|
3974
3861
|
useBatch,
|
|
3975
3862
|
useLostConnectionListener,
|
|
3976
|
-
useErrorListener,
|
|
3977
3863
|
useHistory,
|
|
3978
3864
|
useUndo,
|
|
3979
3865
|
useRedo,
|
|
3980
3866
|
useCanUndo,
|
|
3981
3867
|
useCanRedo,
|
|
3982
3868
|
useOthersConnectionIds,
|
|
3983
|
-
useCommentsErrorListener,
|
|
3984
3869
|
useCreateRoomThread,
|
|
3985
3870
|
useDeleteRoomThread,
|
|
3986
3871
|
useEditRoomThreadMetadata,
|
|
@@ -4040,4 +3925,4 @@ export {
|
|
|
4040
3925
|
_useStorageRoot,
|
|
4041
3926
|
_useUpdateMyPresence
|
|
4042
3927
|
};
|
|
4043
|
-
//# sourceMappingURL=chunk-
|
|
3928
|
+
//# sourceMappingURL=chunk-JZBPCFEX.mjs.map
|