@liveblocks/core 2.9.3-emails1 → 2.9.3-experimental1

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.9.3-emails1";
9
+ var PKG_VERSION = "2.9.3-experimental1";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -2868,15 +2868,15 @@ var LiveList = class _LiveList extends AbstractCrdt {
2868
2868
  this._implicitlyDeletedItems.add(
2869
2869
  this._items[indexOfItemWithSamePosition]
2870
2870
  );
2871
- this._items.splice(indexOfItemWithSamePosition, 1);
2872
- delta.push(deleteDelta(indexOfItemWithSamePosition));
2871
+ const [prevNode] = this._items.splice(indexOfItemWithSamePosition, 1);
2872
+ delta.push(deleteDelta(indexOfItemWithSamePosition, prevNode));
2873
2873
  }
2874
- const previousIndex = this._items.indexOf(existingItem);
2874
+ const prevIndex = this._items.indexOf(existingItem);
2875
2875
  existingItem._setParentLink(this, op.parentKey);
2876
2876
  this._sortItems();
2877
2877
  const newIndex = this._items.indexOf(existingItem);
2878
- if (newIndex !== previousIndex) {
2879
- delta.push(moveDelta(previousIndex, newIndex, existingItem));
2878
+ if (newIndex !== prevIndex) {
2879
+ delta.push(moveDelta(prevIndex, newIndex, existingItem));
2880
2880
  }
2881
2881
  return {
2882
2882
  modified: delta.length > 0 ? makeUpdate(this, delta) : false,
@@ -3105,11 +3105,11 @@ var LiveList = class _LiveList extends AbstractCrdt {
3105
3105
  modified: false
3106
3106
  };
3107
3107
  }
3108
- this._items.splice(indexToDelete, 1);
3108
+ const [previousNode] = this._items.splice(indexToDelete, 1);
3109
3109
  this.invalidate();
3110
3110
  child._detach();
3111
3111
  return {
3112
- modified: makeUpdate(this, [deleteDelta(indexToDelete)]),
3112
+ modified: makeUpdate(this, [deleteDelta(indexToDelete, previousNode)]),
3113
3113
  reverse
3114
3114
  };
3115
3115
  }
@@ -3387,7 +3387,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
3387
3387
  }
3388
3388
  const item = this._items[index];
3389
3389
  item._detach();
3390
- this._items.splice(index, 1);
3390
+ const [prev] = this._items.splice(index, 1);
3391
3391
  this.invalidate();
3392
3392
  if (this._pool) {
3393
3393
  const childRecordId = item._id;
@@ -3395,7 +3395,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
3395
3395
  const storageUpdates = /* @__PURE__ */ new Map();
3396
3396
  storageUpdates.set(
3397
3397
  nn(this._id),
3398
- makeUpdate(this, [deleteDelta(index)])
3398
+ makeUpdate(this, [deleteDelta(index, prev)])
3399
3399
  );
3400
3400
  this._pool.dispatch(
3401
3401
  [
@@ -3429,7 +3429,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
3429
3429
  reverseOps.push(
3430
3430
  ...item._toOps(nn(this._id), item._getParentKeyOrThrow())
3431
3431
  );
3432
- updateDelta.push(deleteDelta(0));
3432
+ updateDelta.push(deleteDelta(0, item));
3433
3433
  }
3434
3434
  }
3435
3435
  this._items = [];
@@ -3654,10 +3654,11 @@ function setDelta(index, item) {
3654
3654
  item: item instanceof LiveRegister ? item.data : item
3655
3655
  };
3656
3656
  }
3657
- function deleteDelta(index) {
3657
+ function deleteDelta(index, deletedNode) {
3658
3658
  return {
3659
+ type: "delete",
3659
3660
  index,
3660
- type: "delete"
3661
+ deletedItem: deletedNode instanceof LiveRegister ? deletedNode.data : deletedNode
3661
3662
  };
3662
3663
  }
3663
3664
  function insertDelta(index, item) {
@@ -3669,10 +3670,10 @@ function insertDelta(index, item) {
3669
3670
  }
3670
3671
  function moveDelta(previousIndex, index, item) {
3671
3672
  return {
3672
- index,
3673
3673
  type: "move",
3674
- previousIndex,
3675
- item: item instanceof LiveRegister ? item.data : item
3674
+ index,
3675
+ item: item instanceof LiveRegister ? item.data : item,
3676
+ previousIndex
3676
3677
  };
3677
3678
  }
3678
3679
  function HACK_addIntentAndDeletedIdToOperation(ops, deletedId) {
@@ -7730,22 +7731,6 @@ async function stringifyCommentBody(body, options) {
7730
7731
  return blocks.join(separator);
7731
7732
  }
7732
7733
 
7733
- // src/comments/comment-url.ts
7734
- var PLACEHOLDER_BASE_URL = "https://localhost:9999";
7735
- var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
7736
- function generateCommentUrl({
7737
- roomUrl,
7738
- commentId
7739
- }) {
7740
- const isAbsolute = ABSOLUTE_URL_REGEX.test(roomUrl);
7741
- const urlObject = new URL(
7742
- roomUrl,
7743
- isAbsolute ? void 0 : PLACEHOLDER_BASE_URL
7744
- );
7745
- urlObject.hash = `#${commentId}`;
7746
- return isAbsolute ? urlObject.href : urlObject.href.replace(PLACEHOLDER_BASE_URL, "");
7747
- }
7748
-
7749
7734
  // src/crdts/utils.ts
7750
7735
  function toPlainLson(lson) {
7751
7736
  if (lson instanceof LiveObject) {
@@ -8203,7 +8188,6 @@ export {
8203
8188
  LiveObject,
8204
8189
  NotificationsApiError,
8205
8190
  OpCode,
8206
- Promise_withResolvers,
8207
8191
  ServerMsgCode,
8208
8192
  StopRetrying2 as StopRetrying,
8209
8193
  WebsocketCloseCodes,
@@ -8231,14 +8215,8 @@ export {
8231
8215
  detectDupes,
8232
8216
  errorIf,
8233
8217
  freeze,
8234
- generateCommentUrl,
8235
8218
  getMentionedIdsFromCommentBody,
8236
- html,
8237
- htmlSafe,
8238
8219
  isChildCrdt,
8239
- isCommentBodyLink,
8240
- isCommentBodyMention,
8241
- isCommentBodyText,
8242
8220
  isJsonArray,
8243
8221
  isJsonObject,
8244
8222
  isJsonScalar,
@@ -8258,12 +8236,10 @@ export {
8258
8236
  objectToQuery,
8259
8237
  patchLiveObjectKey,
8260
8238
  raise,
8261
- resolveUsersInCommentBody,
8262
8239
  shallow,
8263
8240
  stringify,
8264
8241
  stringifyCommentBody,
8265
8242
  throwUsageError,
8266
- toAbsoluteUrl,
8267
8243
  toPlainLson,
8268
8244
  tryParseJson,
8269
8245
  url,