@liveblocks/core 2.0.2 → 2.0.3-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.0.2";
9
+ var PKG_VERSION = "2.0.3-test2";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -1917,39 +1917,6 @@ function createStore(initialState) {
1917
1917
  };
1918
1918
  }
1919
1919
 
1920
- // src/lib/deprecation.ts
1921
- var _emittedDeprecationWarnings = /* @__PURE__ */ new Set();
1922
- function deprecate(message, key = message) {
1923
- if (process.env.NODE_ENV !== "production") {
1924
- if (!_emittedDeprecationWarnings.has(key)) {
1925
- _emittedDeprecationWarnings.add(key);
1926
- errorWithTitle("Deprecation warning", message);
1927
- }
1928
- }
1929
- }
1930
- function deprecateIf(condition, message, key = message) {
1931
- if (process.env.NODE_ENV !== "production") {
1932
- if (condition) {
1933
- deprecate(message, key);
1934
- }
1935
- }
1936
- }
1937
- function throwUsageError(message) {
1938
- if (process.env.NODE_ENV !== "production") {
1939
- const usageError = new Error(message);
1940
- usageError.name = "Usage error";
1941
- errorWithTitle("Usage error", message);
1942
- throw usageError;
1943
- }
1944
- }
1945
- function errorIf(condition, message) {
1946
- if (process.env.NODE_ENV !== "production") {
1947
- if (condition) {
1948
- throwUsageError(message);
1949
- }
1950
- }
1951
- }
1952
-
1953
1920
  // src/convert-plain-data.ts
1954
1921
  function convertToCommentData(data) {
1955
1922
  const editedAt = data.editedAt ? new Date(data.editedAt) : void 0;
@@ -5361,8 +5328,8 @@ function createCommentsApi(roomId, getAuthValue, fetchClientApi) {
5361
5328
  }
5362
5329
  var MARK_INBOX_NOTIFICATIONS_AS_READ_BATCH_DELAY2 = 50;
5363
5330
  function createRoom(options, config) {
5364
- const initialPresence = typeof options.initialPresence === "function" ? options.initialPresence(config.roomId) : options.initialPresence;
5365
- const initialStorage = typeof options.initialStorage === "function" ? options.initialStorage(config.roomId) : options.initialStorage;
5331
+ const initialPresence = options.initialPresence;
5332
+ const initialStorage = options.initialStorage;
5366
5333
  const [inBackgroundSince, uninstallBgTabSpy] = installBackgroundTabSpy();
5367
5334
  const delegates = {
5368
5335
  ...config.delegates,
@@ -7254,20 +7221,16 @@ function createClient(options) {
7254
7221
  leave
7255
7222
  };
7256
7223
  }
7257
- function enterRoom(roomId, options2) {
7224
+ function enterRoom(roomId, ...args) {
7258
7225
  const existing = roomsById.get(roomId);
7259
7226
  if (existing !== void 0) {
7260
7227
  return leaseRoom(existing);
7261
7228
  }
7262
- deprecateIf(
7263
- options2.initialPresence === null || options2.initialPresence === void 0,
7264
- "Please provide an initial presence value for the current user when entering the room."
7265
- );
7229
+ const options2 = args[0] ?? {};
7230
+ const initialPresence = (typeof options2.initialPresence === "function" ? options2.initialPresence(roomId) : options2.initialPresence) ?? {};
7231
+ const initialStorage = (typeof options2.initialStorage === "function" ? options2.initialStorage(roomId) : options2.initialStorage) ?? {};
7266
7232
  const newRoom = createRoom(
7267
- {
7268
- initialPresence: options2.initialPresence ?? {},
7269
- initialStorage: options2.initialStorage
7270
- },
7233
+ { initialPresence, initialStorage },
7271
7234
  {
7272
7235
  roomId,
7273
7236
  throttleDelay,
@@ -8084,6 +8047,39 @@ function legacy_patchImmutableNode(state, path, update) {
8084
8047
  }
8085
8048
  }
8086
8049
 
8050
+ // src/lib/deprecation.ts
8051
+ var _emittedDeprecationWarnings = /* @__PURE__ */ new Set();
8052
+ function deprecate(message, key = message) {
8053
+ if (process.env.NODE_ENV !== "production") {
8054
+ if (!_emittedDeprecationWarnings.has(key)) {
8055
+ _emittedDeprecationWarnings.add(key);
8056
+ errorWithTitle("Deprecation warning", message);
8057
+ }
8058
+ }
8059
+ }
8060
+ function deprecateIf(condition, message, key = message) {
8061
+ if (process.env.NODE_ENV !== "production") {
8062
+ if (condition) {
8063
+ deprecate(message, key);
8064
+ }
8065
+ }
8066
+ }
8067
+ function throwUsageError(message) {
8068
+ if (process.env.NODE_ENV !== "production") {
8069
+ const usageError = new Error(message);
8070
+ usageError.name = "Usage error";
8071
+ errorWithTitle("Usage error", message);
8072
+ throw usageError;
8073
+ }
8074
+ }
8075
+ function errorIf(condition, message) {
8076
+ if (process.env.NODE_ENV !== "production") {
8077
+ if (condition) {
8078
+ throwUsageError(message);
8079
+ }
8080
+ }
8081
+ }
8082
+
8087
8083
  // src/lib/Poller.ts
8088
8084
  function makePoller(callback) {
8089
8085
  let context = {