@liveblocks/core 2.4.0-test1 → 2.4.1-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 = "2.4.0-test1";
9
+ var PKG_VERSION = "2.4.1-test1";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -2094,11 +2094,11 @@ function createNotificationsApi({
2094
2094
  });
2095
2095
  return {
2096
2096
  threads: {
2097
- modified: json.threads.map(convertToThreadData),
2097
+ updated: json.threads.map(convertToThreadData),
2098
2098
  deleted: json.deletedThreads.map(convertToThreadDeleteInfo)
2099
2099
  },
2100
2100
  inboxNotifications: {
2101
- modified: json.inboxNotifications.map(convertToInboxNotificationData),
2101
+ updated: json.inboxNotifications.map(convertToInboxNotificationData),
2102
2102
  deleted: json.deletedInboxNotifications.map(
2103
2103
  convertToInboxNotificationDeleteInfo
2104
2104
  )
@@ -2152,6 +2152,16 @@ function createNotificationsApi({
2152
2152
  }
2153
2153
  );
2154
2154
  }
2155
+ async function getThreads() {
2156
+ const json = await fetchJson("/threads", void 0, {});
2157
+ return {
2158
+ threads: json.threads.map(convertToThreadData)
2159
+ // inboxNotifications: json.inboxNotifications.map(
2160
+ // convertToInboxNotificationData
2161
+ // ),
2162
+ // requestedAt: new Date(json.meta.requestedAt),
2163
+ };
2164
+ }
2155
2165
  return {
2156
2166
  getInboxNotifications,
2157
2167
  getInboxNotificationsSince,
@@ -2159,7 +2169,8 @@ function createNotificationsApi({
2159
2169
  markAllInboxNotificationsAsRead,
2160
2170
  markInboxNotificationAsRead,
2161
2171
  deleteAllInboxNotifications,
2162
- deleteInboxNotification
2172
+ deleteInboxNotification,
2173
+ getThreads
2163
2174
  };
2164
2175
  }
2165
2176
 
@@ -5189,11 +5200,11 @@ function createCommentsApi(roomId, getAuthValue, fetchClientApi) {
5189
5200
  const json = await response.json();
5190
5201
  return {
5191
5202
  threads: {
5192
- modified: json.data.map(convertToThreadData),
5203
+ updated: json.data.map(convertToThreadData),
5193
5204
  deleted: json.deletedThreads.map(convertToThreadDeleteInfo)
5194
5205
  },
5195
5206
  inboxNotifications: {
5196
- modified: json.inboxNotifications.map(convertToInboxNotificationData),
5207
+ updated: json.inboxNotifications.map(convertToInboxNotificationData),
5197
5208
  deleted: json.deletedInboxNotifications.map(
5198
5209
  convertToInboxNotificationDeleteInfo
5199
5210
  )
@@ -5203,11 +5214,11 @@ function createCommentsApi(roomId, getAuthValue, fetchClientApi) {
5203
5214
  } else if (response.status === 404) {
5204
5215
  return {
5205
5216
  threads: {
5206
- modified: [],
5217
+ updated: [],
5207
5218
  deleted: []
5208
5219
  },
5209
5220
  inboxNotifications: {
5210
- modified: [],
5221
+ updated: [],
5211
5222
  deleted: []
5212
5223
  },
5213
5224
  requestedAt: /* @__PURE__ */ new Date()
@@ -5476,6 +5487,9 @@ function createRoom(options, config) {
5476
5487
  others: new OthersRef(),
5477
5488
  initialStorage,
5478
5489
  idFactory: null,
5490
+ // Y.js
5491
+ provider: void 0,
5492
+ onProviderUpdate: makeEventSource(),
5479
5493
  // Storage
5480
5494
  clock: 0,
5481
5495
  opClock: 0,
@@ -6651,6 +6665,14 @@ ${Array.from(traces).join("\n\n")}`
6651
6665
  return context.nodes.size;
6652
6666
  },
6653
6667
  // prettier-ignore
6668
+ getProvider() {
6669
+ return context.provider;
6670
+ },
6671
+ setProvider(provider) {
6672
+ context.provider = provider;
6673
+ context.onProviderUpdate.notify();
6674
+ },
6675
+ onProviderUpdate: context.onProviderUpdate.observable,
6654
6676
  // send metadata when using a text editor
6655
6677
  reportTextEditor,
6656
6678
  // create a text mention when using a text editor
@@ -7484,7 +7506,8 @@ function createClient(options) {
7484
7506
  markAllInboxNotificationsAsRead,
7485
7507
  markInboxNotificationAsRead,
7486
7508
  deleteAllInboxNotifications,
7487
- deleteInboxNotification
7509
+ deleteInboxNotification,
7510
+ getThreads
7488
7511
  } = createNotificationsApi({
7489
7512
  baseUrl,
7490
7513
  fetcher: clientOptions.polyfills?.fetch || /* istanbul ignore next */
@@ -7533,6 +7556,7 @@ function createClient(options) {
7533
7556
  markInboxNotificationAsRead,
7534
7557
  deleteAllInboxNotifications,
7535
7558
  deleteInboxNotification,
7559
+ getThreads,
7536
7560
  // Internal
7537
7561
  [kInternal]: {
7538
7562
  currentUserIdStore,