@liveblocks/core 1.11.1 → 1.12.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.
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 = "1.11.1";
9
+ var PKG_VERSION = "1.12.0-test1";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -782,13 +782,9 @@ function logPrematureErrorOrCloseEvent(e) {
782
782
  };
783
783
  }
784
784
  function logCloseEvent(event) {
785
- const details = [`code: ${event.code}`];
786
- if (event.reason) {
787
- details.push(`reason: ${event.reason}`);
788
- }
789
785
  return (ctx) => {
790
786
  warn(
791
- `Connection to Liveblocks websocket server closed (${details.join(", ")}). Retrying in ${ctx.backoffDelay}ms.`
787
+ `Connection to Liveblocks websocket server closed (code: ${event.code}). Retrying in ${ctx.backoffDelay}ms.`
792
788
  );
793
789
  };
794
790
  }
@@ -2035,6 +2031,18 @@ function convertToCommentUserReaction(data) {
2035
2031
  function convertToInboxNotificationData(data) {
2036
2032
  const notifiedAt = new Date(data.notifiedAt);
2037
2033
  const readAt = data.readAt ? new Date(data.readAt) : null;
2034
+ if ("activities" in data) {
2035
+ const activities = data.activities.map((activity) => ({
2036
+ ...activity,
2037
+ createdAt: new Date(activity.createdAt)
2038
+ }));
2039
+ return {
2040
+ ...data,
2041
+ notifiedAt,
2042
+ readAt,
2043
+ activities
2044
+ };
2045
+ }
2038
2046
  return {
2039
2047
  ...data,
2040
2048
  notifiedAt,
@@ -6612,7 +6620,7 @@ function createClientStore() {
6612
6620
  threads: deleteKeyImmutable(state.threads, threadId),
6613
6621
  inboxNotifications: Object.fromEntries(
6614
6622
  Object.entries(state.inboxNotifications).filter(
6615
- ([_id, notification]) => notification.threadId !== threadId
6623
+ ([_id, notification]) => notification.kind === "thread" && notification.threadId !== threadId
6616
6624
  )
6617
6625
  )
6618
6626
  };
@@ -6754,7 +6762,7 @@ function applyOptimisticUpdates(state) {
6754
6762
  optimisticUpdate.comment
6755
6763
  );
6756
6764
  const inboxNotification = Object.values(result.inboxNotifications).find(
6757
- (notification) => notification.threadId === thread.id
6765
+ (notification) => notification.kind === "thread" && notification.threadId !== thread.id
6758
6766
  );
6759
6767
  if (inboxNotification === void 0) {
6760
6768
  break;
@@ -8116,6 +8124,7 @@ export {
8116
8124
  fancy_console_exports as console,
8117
8125
  convertToCommentData,
8118
8126
  convertToCommentUserReaction,
8127
+ convertToInboxNotificationData,
8119
8128
  convertToThreadData,
8120
8129
  createClient,
8121
8130
  deleteComment,