@liveblocks/core 2.4.0 → 2.4.1-test2

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";
9
+ var PKG_VERSION = "2.4.1-test2";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -2152,6 +2152,34 @@ 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
+ }
2165
+ async function getThreadsSince(options) {
2166
+ const json = await fetchJson("/threads", void 0, {
2167
+ since: options.since.toISOString()
2168
+ });
2169
+ return {
2170
+ threads: {
2171
+ updated: json.threads.map(convertToThreadData),
2172
+ deleted: json.deletedThreads.map(convertToThreadDeleteInfo)
2173
+ },
2174
+ inboxNotifications: {
2175
+ updated: json.inboxNotifications.map(convertToInboxNotificationData),
2176
+ deleted: json.deletedInboxNotifications.map(
2177
+ convertToInboxNotificationDeleteInfo
2178
+ )
2179
+ },
2180
+ requestedAt: new Date(json.meta.requestedAt)
2181
+ };
2182
+ }
2155
2183
  return {
2156
2184
  getInboxNotifications,
2157
2185
  getInboxNotificationsSince,
@@ -2159,7 +2187,9 @@ function createNotificationsApi({
2159
2187
  markAllInboxNotificationsAsRead,
2160
2188
  markInboxNotificationAsRead,
2161
2189
  deleteAllInboxNotifications,
2162
- deleteInboxNotification
2190
+ deleteInboxNotification,
2191
+ getThreads,
2192
+ getThreadsSince
2163
2193
  };
2164
2194
  }
2165
2195
 
@@ -5476,6 +5506,9 @@ function createRoom(options, config) {
5476
5506
  others: new OthersRef(),
5477
5507
  initialStorage,
5478
5508
  idFactory: null,
5509
+ // Y.js
5510
+ provider: void 0,
5511
+ onProviderUpdate: makeEventSource(),
5479
5512
  // Storage
5480
5513
  clock: 0,
5481
5514
  opClock: 0,
@@ -6651,6 +6684,14 @@ ${Array.from(traces).join("\n\n")}`
6651
6684
  return context.nodes.size;
6652
6685
  },
6653
6686
  // prettier-ignore
6687
+ getProvider() {
6688
+ return context.provider;
6689
+ },
6690
+ setProvider(provider) {
6691
+ context.provider = provider;
6692
+ context.onProviderUpdate.notify();
6693
+ },
6694
+ onProviderUpdate: context.onProviderUpdate.observable,
6654
6695
  // send metadata when using a text editor
6655
6696
  reportTextEditor,
6656
6697
  // create a text mention when using a text editor
@@ -7484,7 +7525,9 @@ function createClient(options) {
7484
7525
  markAllInboxNotificationsAsRead,
7485
7526
  markInboxNotificationAsRead,
7486
7527
  deleteAllInboxNotifications,
7487
- deleteInboxNotification
7528
+ deleteInboxNotification,
7529
+ getThreads,
7530
+ getThreadsSince
7488
7531
  } = createNotificationsApi({
7489
7532
  baseUrl,
7490
7533
  fetcher: clientOptions.polyfills?.fetch || /* istanbul ignore next */
@@ -7533,6 +7576,7 @@ function createClient(options) {
7533
7576
  markInboxNotificationAsRead,
7534
7577
  deleteAllInboxNotifications,
7535
7578
  deleteInboxNotification,
7579
+ getThreads,
7536
7580
  // Internal
7537
7581
  [kInternal]: {
7538
7582
  currentUserIdStore,
@@ -7542,7 +7586,9 @@ function createClient(options) {
7542
7586
  roomsInfoStore,
7543
7587
  getRoomIds() {
7544
7588
  return Array.from(roomsById.keys());
7545
- }
7589
+ },
7590
+ getThreads,
7591
+ getThreadsSince
7546
7592
  }
7547
7593
  },
7548
7594
  kInternal,