@lvce-editor/text-search-worker 3.37.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.
- package/dist/textSearchWorkerMain.js +23 -9
- package/package.json +6 -6
|
@@ -509,7 +509,8 @@ class IpcParentWithMessagePort extends Ipc {
|
|
|
509
509
|
this._rawIpc.postMessage(message);
|
|
510
510
|
}
|
|
511
511
|
sendAndTransfer(message) {
|
|
512
|
-
|
|
512
|
+
const transfer = getTransferrables(message);
|
|
513
|
+
this._rawIpc.postMessage(message, transfer);
|
|
513
514
|
}
|
|
514
515
|
dispose() {
|
|
515
516
|
this._rawIpc.close();
|
|
@@ -3341,11 +3342,7 @@ const getFilteredResults = (results, collapsedPaths) => {
|
|
|
3341
3342
|
for (const result of results) {
|
|
3342
3343
|
if (result.type === File) {
|
|
3343
3344
|
filteredResults.push(result);
|
|
3344
|
-
|
|
3345
|
-
isExcluded = true;
|
|
3346
|
-
} else {
|
|
3347
|
-
isExcluded = false;
|
|
3348
|
-
}
|
|
3345
|
+
isExcluded = collapsedPaths.includes(result.text) ? true : false;
|
|
3349
3346
|
}
|
|
3350
3347
|
if (result.type === Match && !isExcluded) {
|
|
3351
3348
|
filteredResults.push(result);
|
|
@@ -3899,10 +3896,12 @@ var applyPendingPatches = (patches, pendingPatches, skip) => {
|
|
|
3899
3896
|
pendingPatches.length = 0;
|
|
3900
3897
|
};
|
|
3901
3898
|
|
|
3902
|
-
// src/parts/
|
|
3899
|
+
// src/parts/IsKey/IsKey.ts
|
|
3903
3900
|
var isKey = key => {
|
|
3904
3901
|
return key !== "type" && key !== "childCount";
|
|
3905
3902
|
};
|
|
3903
|
+
|
|
3904
|
+
// src/parts/GetKeys/GetKeys.ts
|
|
3906
3905
|
var getKeys = node => {
|
|
3907
3906
|
const keys = Object.keys(node).filter(isKey);
|
|
3908
3907
|
return keys;
|
|
@@ -3934,6 +3933,13 @@ var diff = (oldNodes, newNodes) => {
|
|
|
3934
3933
|
const oldNode = oldNodes[i];
|
|
3935
3934
|
const newNode = newNodes[j];
|
|
3936
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) {
|
|
3937
3943
|
pendingPatches.push(NavigateParent, 0);
|
|
3938
3944
|
maxSiblingOffset = indexStack.pop();
|
|
3939
3945
|
siblingOffset = indexStack.pop() + 1;
|
|
@@ -3991,6 +3997,9 @@ var diff = (oldNodes, newNodes) => {
|
|
|
3991
3997
|
}
|
|
3992
3998
|
}
|
|
3993
3999
|
if (hasAttributeChanges) {
|
|
4000
|
+
if (siblingOffset > 0) {
|
|
4001
|
+
pendingPatches.push(NavigateSibling, siblingOffset);
|
|
4002
|
+
}
|
|
3994
4003
|
applyPendingPatches(patches, pendingPatches, 0);
|
|
3995
4004
|
for (const key of newKeys) {
|
|
3996
4005
|
if (oldNode[key] !== newNode[key]) {
|
|
@@ -4028,6 +4037,7 @@ var diff = (oldNodes, newNodes) => {
|
|
|
4028
4037
|
}
|
|
4029
4038
|
i += getTotalChildCount(oldNodes, i);
|
|
4030
4039
|
j++;
|
|
4040
|
+
siblingOffset++;
|
|
4031
4041
|
continue;
|
|
4032
4042
|
}
|
|
4033
4043
|
if (newNode.childCount) {
|
|
@@ -4281,8 +4291,12 @@ const show = async (x, y, id, ...args) => {
|
|
|
4281
4291
|
const Search = 18;
|
|
4282
4292
|
|
|
4283
4293
|
const handleContextMenuKeyboard = async state => {
|
|
4284
|
-
const
|
|
4285
|
-
|
|
4294
|
+
const {
|
|
4295
|
+
x
|
|
4296
|
+
} = state; // TODO
|
|
4297
|
+
const {
|
|
4298
|
+
y
|
|
4299
|
+
} = state; // TODO
|
|
4286
4300
|
await show(x, y, Search);
|
|
4287
4301
|
return state;
|
|
4288
4302
|
};
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/text-search-worker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.39.0",
|
|
4
4
|
"description": "Text Search Worker",
|
|
5
|
-
"main": "dist/textSearchWorkerMain.js",
|
|
6
|
-
"type": "module",
|
|
7
5
|
"keywords": [
|
|
8
6
|
"text-search"
|
|
9
7
|
],
|
|
10
|
-
"author": "Lvce Editor",
|
|
11
|
-
"license": "MIT",
|
|
12
8
|
"repository": {
|
|
13
9
|
"type": "git",
|
|
14
10
|
"url": "git+https://github.com/lvce-editor/text-search-worker.git"
|
|
15
|
-
}
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Lvce Editor",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "dist/textSearchWorkerMain.js"
|
|
16
16
|
}
|