@lvce-editor/text-search-worker 3.38.0 → 3.39.0

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.
@@ -509,7 +509,8 @@ class IpcParentWithMessagePort extends Ipc {
509
509
  this._rawIpc.postMessage(message);
510
510
  }
511
511
  sendAndTransfer(message) {
512
- throw new Error('not implemented');
512
+ const transfer = getTransferrables(message);
513
+ this._rawIpc.postMessage(message, transfer);
513
514
  }
514
515
  dispose() {
515
516
  this._rawIpc.close();
@@ -3895,10 +3896,12 @@ var applyPendingPatches = (patches, pendingPatches, skip) => {
3895
3896
  pendingPatches.length = 0;
3896
3897
  };
3897
3898
 
3898
- // src/parts/GetKeys/GetKeys.ts
3899
+ // src/parts/IsKey/IsKey.ts
3899
3900
  var isKey = key => {
3900
3901
  return key !== "type" && key !== "childCount";
3901
3902
  };
3903
+
3904
+ // src/parts/GetKeys/GetKeys.ts
3902
3905
  var getKeys = node => {
3903
3906
  const keys = Object.keys(node).filter(isKey);
3904
3907
  return keys;
@@ -3930,6 +3933,13 @@ var diff = (oldNodes, newNodes) => {
3930
3933
  const oldNode = oldNodes[i];
3931
3934
  const newNode = newNodes[j];
3932
3935
  if (siblingOffset === maxSiblingOffset) {
3936
+ indexStack.pop();
3937
+ indexStack.pop();
3938
+ pendingPatches.push(NavigateParent, 0);
3939
+ maxSiblingOffset = indexStack.pop();
3940
+ siblingOffset = indexStack.pop() + 1;
3941
+ }
3942
+ while (siblingOffset === maxSiblingOffset) {
3933
3943
  pendingPatches.push(NavigateParent, 0);
3934
3944
  maxSiblingOffset = indexStack.pop();
3935
3945
  siblingOffset = indexStack.pop() + 1;
@@ -3987,6 +3997,9 @@ var diff = (oldNodes, newNodes) => {
3987
3997
  }
3988
3998
  }
3989
3999
  if (hasAttributeChanges) {
4000
+ if (siblingOffset > 0) {
4001
+ pendingPatches.push(NavigateSibling, siblingOffset);
4002
+ }
3990
4003
  applyPendingPatches(patches, pendingPatches, 0);
3991
4004
  for (const key of newKeys) {
3992
4005
  if (oldNode[key] !== newNode[key]) {
@@ -4024,6 +4037,7 @@ var diff = (oldNodes, newNodes) => {
4024
4037
  }
4025
4038
  i += getTotalChildCount(oldNodes, i);
4026
4039
  j++;
4040
+ siblingOffset++;
4027
4041
  continue;
4028
4042
  }
4029
4043
  if (newNode.childCount) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "3.38.0",
3
+ "version": "3.39.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"