@liveblocks/core 1.10.0 → 1.10.1

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.d.mts CHANGED
@@ -1208,7 +1208,7 @@ declare type CommentData = {
1208
1208
  deletedAt: Date;
1209
1209
  });
1210
1210
  declare type CommentDataPlain = Omit<DateToString<CommentData>, "reactions" | "body"> & {
1211
- reactions: DateToString<CommentReaction[]>;
1211
+ reactions: DateToString<CommentReaction>[];
1212
1212
  } & ({
1213
1213
  body: CommentBody;
1214
1214
  deletedAt?: never;
package/dist/index.d.ts CHANGED
@@ -1208,7 +1208,7 @@ declare type CommentData = {
1208
1208
  deletedAt: Date;
1209
1209
  });
1210
1210
  declare type CommentDataPlain = Omit<DateToString<CommentData>, "reactions" | "body"> & {
1211
- reactions: DateToString<CommentReaction[]>;
1211
+ reactions: DateToString<CommentReaction>[];
1212
1212
  } & ({
1213
1213
  body: CommentBody;
1214
1214
  deletedAt?: never;
package/dist/index.js 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.10.0";
9
+ var PKG_VERSION = "1.10.1";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -742,11 +742,13 @@ var LiveblocksError = class extends Error {
742
742
  this.code = code;
743
743
  }
744
744
  };
745
- function nextBackoffDelay(currentDelay, delays = BACKOFF_DELAYS) {
745
+ function nextBackoffDelay(currentDelay, delays) {
746
746
  return _nullishCoalesce(delays.find((delay) => delay > currentDelay), () => ( delays[delays.length - 1]));
747
747
  }
748
748
  function increaseBackoffDelay(context) {
749
- context.patch({ backoffDelay: nextBackoffDelay(context.backoffDelay) });
749
+ context.patch({
750
+ backoffDelay: nextBackoffDelay(context.backoffDelay, BACKOFF_DELAYS)
751
+ });
750
752
  }
751
753
  function increaseBackoffDelayAggressively(context) {
752
754
  context.patch({
@@ -893,8 +895,7 @@ function createConnectionStateMachine(delegates, options) {
893
895
  (okEvent) => ({
894
896
  target: "@connecting.busy",
895
897
  effect: assign({
896
- authValue: okEvent.data,
897
- backoffDelay: RESET_DELAY
898
+ authValue: okEvent.data
898
899
  })
899
900
  }),
900
901
  // Auth failed
@@ -7066,12 +7067,10 @@ var MAX_LOST_CONNECTION_TIMEOUT = 3e4;
7066
7067
  var DEFAULT_LOST_CONNECTION_TIMEOUT = 5e3;
7067
7068
  var RESOLVE_USERS_BATCH_DELAY = 50;
7068
7069
  var RESOLVE_ROOMS_INFO_BATCH_DELAY = 50;
7069
- function getBaseUrlFromClientOptions(clientOptions) {
7070
- if ("liveblocksServer" in clientOptions) {
7071
- throw new Error("Client option no longer supported");
7072
- }
7073
- if (typeof clientOptions.baseUrl === "string" && clientOptions.baseUrl.startsWith("http")) {
7074
- return clientOptions.baseUrl;
7070
+ function getBaseUrl(baseUrl) {
7071
+ baseUrl || (baseUrl = process.env.LIVEBLOCKS_BASE_URL || process.env.NEXT_PUBLIC_LIVEBLOCKS_BASE_URL || process.env.VITE_LIVEBLOCKS_BASE_URL || void 0);
7072
+ if (typeof baseUrl === "string" && baseUrl.startsWith("http")) {
7073
+ return baseUrl;
7075
7074
  } else {
7076
7075
  return DEFAULT_BASE_URL;
7077
7076
  }
@@ -7092,7 +7091,7 @@ function createClient(options) {
7092
7091
  const backgroundKeepAliveTimeout = getBackgroundKeepAliveTimeout(
7093
7092
  clientOptions.backgroundKeepAliveTimeout
7094
7093
  );
7095
- const baseUrl = getBaseUrlFromClientOptions(clientOptions);
7094
+ const baseUrl = getBaseUrl(clientOptions.baseUrl);
7096
7095
  const authManager = createAuthManager(options);
7097
7096
  const roomsById = /* @__PURE__ */ new Map();
7098
7097
  function teardownRoom(room) {