@liveblocks/core 2.0.4-test1 → 2.0.4

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/index.mjs CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "2.0.4-test1";
9
+ var PKG_VERSION = "2.0.4";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -5212,6 +5212,11 @@ function createCommentsApi(roomId, getAuthValue, fetchClientApi) {
5212
5212
  });
5213
5213
  return convertToThreadData(thread);
5214
5214
  }
5215
+ async function deleteThread({ threadId }) {
5216
+ await fetchJson(`/threads/${encodeURIComponent(threadId)}`, {
5217
+ method: "DELETE"
5218
+ });
5219
+ }
5215
5220
  async function editThreadMetadata({
5216
5221
  metadata,
5217
5222
  threadId
@@ -5318,6 +5323,7 @@ function createCommentsApi(roomId, getAuthValue, fetchClientApi) {
5318
5323
  getThreads,
5319
5324
  getThread,
5320
5325
  createThread,
5326
+ deleteThread,
5321
5327
  editThreadMetadata,
5322
5328
  createComment,
5323
5329
  editComment,
@@ -6901,6 +6907,19 @@ function applyOptimisticUpdates(state) {
6901
6907
  );
6902
6908
  break;
6903
6909
  }
6910
+ case "delete-thread": {
6911
+ const thread = result.threads[optimisticUpdate.threadId];
6912
+ if (thread === void 0) {
6913
+ break;
6914
+ }
6915
+ result.threads[optimisticUpdate.threadId] = {
6916
+ ...result.threads[optimisticUpdate.threadId],
6917
+ deletedAt: optimisticUpdate.deletedAt,
6918
+ updatedAt: optimisticUpdate.deletedAt,
6919
+ comments: []
6920
+ };
6921
+ break;
6922
+ }
6904
6923
  case "add-reaction": {
6905
6924
  const thread = result.threads[optimisticUpdate.threadId];
6906
6925
  if (thread === void 0) {