@lvce-editor/text-search-worker 4.10.0 → 4.12.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 +26 -14
- package/package.json +1 -1
|
@@ -588,7 +588,7 @@ const create$4$1 = (method, params) => {
|
|
|
588
588
|
};
|
|
589
589
|
};
|
|
590
590
|
const callbacks = Object.create(null);
|
|
591
|
-
const set$
|
|
591
|
+
const set$4 = (id, fn) => {
|
|
592
592
|
callbacks[id] = fn;
|
|
593
593
|
};
|
|
594
594
|
const get$2 = id => {
|
|
@@ -607,7 +607,7 @@ const registerPromise = () => {
|
|
|
607
607
|
resolve,
|
|
608
608
|
promise
|
|
609
609
|
} = Promise.withResolvers();
|
|
610
|
-
set$
|
|
610
|
+
set$4(id, resolve);
|
|
611
611
|
return {
|
|
612
612
|
id,
|
|
613
613
|
promise
|
|
@@ -1141,7 +1141,7 @@ const collapseDetails = state => {
|
|
|
1141
1141
|
};
|
|
1142
1142
|
|
|
1143
1143
|
const rpcs = Object.create(null);
|
|
1144
|
-
const set$
|
|
1144
|
+
const set$g = (id, rpc) => {
|
|
1145
1145
|
rpcs[id] = rpc;
|
|
1146
1146
|
};
|
|
1147
1147
|
const get$1 = id => {
|
|
@@ -1165,28 +1165,37 @@ const create$3 = rpcId => {
|
|
|
1165
1165
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1166
1166
|
},
|
|
1167
1167
|
set(rpc) {
|
|
1168
|
-
set$
|
|
1168
|
+
set$g(rpcId, rpc);
|
|
1169
|
+
},
|
|
1170
|
+
async dispose() {
|
|
1171
|
+
const rpc = get$1(rpcId);
|
|
1172
|
+
await rpc.dispose();
|
|
1169
1173
|
}
|
|
1170
1174
|
};
|
|
1171
1175
|
};
|
|
1172
1176
|
const RendererWorker$1 = 1;
|
|
1177
|
+
const SearchProcess$1 = 77;
|
|
1173
1178
|
const {
|
|
1174
1179
|
invoke: invoke$3,
|
|
1175
1180
|
invokeAndTransfer: invokeAndTransfer$3,
|
|
1176
|
-
set: set$3
|
|
1177
|
-
} = create$3(RendererWorker$1);
|
|
1181
|
+
set: set$3} = create$3(RendererWorker$1);
|
|
1178
1182
|
const RendererWorker = {
|
|
1179
1183
|
__proto__: null,
|
|
1180
1184
|
invoke: invoke$3,
|
|
1181
1185
|
invokeAndTransfer: invokeAndTransfer$3,
|
|
1182
1186
|
set: set$3
|
|
1183
1187
|
};
|
|
1188
|
+
const {
|
|
1189
|
+
set: set$2$1} = create$3(SearchProcess$1);
|
|
1190
|
+
const SearchProcess = {
|
|
1191
|
+
__proto__: null,
|
|
1192
|
+
set: set$2$1
|
|
1193
|
+
};
|
|
1184
1194
|
|
|
1185
1195
|
const {
|
|
1186
1196
|
invoke: invoke$2,
|
|
1187
1197
|
invokeAndTransfer,
|
|
1188
|
-
set: set$
|
|
1189
|
-
} = RendererWorker;
|
|
1198
|
+
set: set$2} = RendererWorker;
|
|
1190
1199
|
|
|
1191
1200
|
const copy = async state => {
|
|
1192
1201
|
const {
|
|
@@ -1264,7 +1273,7 @@ const create$2 = () => {
|
|
|
1264
1273
|
|
|
1265
1274
|
const {
|
|
1266
1275
|
get,
|
|
1267
|
-
set,
|
|
1276
|
+
set: set$1,
|
|
1268
1277
|
wrapCommand
|
|
1269
1278
|
} = create$2();
|
|
1270
1279
|
|
|
@@ -1341,7 +1350,7 @@ const create = (uid, x, y, width, height, workspacePath, assetDir, itemHeight, v
|
|
|
1341
1350
|
incrementalSearch: false,
|
|
1342
1351
|
searchId: ''
|
|
1343
1352
|
};
|
|
1344
|
-
set(uid, state, state);
|
|
1353
|
+
set$1(uid, state, state);
|
|
1345
1354
|
return state;
|
|
1346
1355
|
};
|
|
1347
1356
|
|
|
@@ -2150,6 +2159,8 @@ const invoke$1 = async (method, ...params) => {
|
|
|
2150
2159
|
const rpc = await getOrCreate$1();
|
|
2151
2160
|
return rpc.invoke(method, ...params);
|
|
2152
2161
|
};
|
|
2162
|
+
const {
|
|
2163
|
+
set} = SearchProcess;
|
|
2153
2164
|
|
|
2154
2165
|
const getPortTuple = () => {
|
|
2155
2166
|
const {
|
|
@@ -2175,6 +2186,7 @@ const launchSearchProcessElectron = async () => {
|
|
|
2175
2186
|
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port1, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
2176
2187
|
port2.start();
|
|
2177
2188
|
const rpc = await rpcPromise;
|
|
2189
|
+
set(rpc);
|
|
2178
2190
|
return rpc;
|
|
2179
2191
|
};
|
|
2180
2192
|
|
|
@@ -2370,7 +2382,7 @@ const textSearchIncremental = async (root, query, options, assetDir, platform, s
|
|
|
2370
2382
|
minLineY: 0,
|
|
2371
2383
|
maxLineY: visible.length
|
|
2372
2384
|
};
|
|
2373
|
-
set(uid, latest2.oldState, updatedState2);
|
|
2385
|
+
set$1(uid, latest2.oldState, updatedState2);
|
|
2374
2386
|
// @ts-ignore
|
|
2375
2387
|
await invoke$2('Search.rerender');
|
|
2376
2388
|
await waitForNextFrame();
|
|
@@ -2402,7 +2414,7 @@ const handleUpdateIncremental = async (state, update) => {
|
|
|
2402
2414
|
...partialNewState,
|
|
2403
2415
|
searchId
|
|
2404
2416
|
};
|
|
2405
|
-
set(uid, latest1.oldState, updatedState1);
|
|
2417
|
+
set$1(uid, latest1.oldState, updatedState1);
|
|
2406
2418
|
|
|
2407
2419
|
// TODO await promise?
|
|
2408
2420
|
void textSearchIncremental(root, value, {
|
|
@@ -4429,7 +4441,7 @@ const render2 = (uid, diffResult) => {
|
|
|
4429
4441
|
oldState,
|
|
4430
4442
|
newState
|
|
4431
4443
|
} = get(uid);
|
|
4432
|
-
set(uid, newState, newState);
|
|
4444
|
+
set$1(uid, newState, newState);
|
|
4433
4445
|
const commands = applyRender(oldState, newState, diffResult);
|
|
4434
4446
|
return commands;
|
|
4435
4447
|
};
|
|
@@ -4913,7 +4925,7 @@ const listen = async () => {
|
|
|
4913
4925
|
const rpc = await WebWorkerRpcClient.create({
|
|
4914
4926
|
commandMap: commandMap
|
|
4915
4927
|
});
|
|
4916
|
-
set$
|
|
4928
|
+
set$2(rpc);
|
|
4917
4929
|
};
|
|
4918
4930
|
|
|
4919
4931
|
const main = async () => {
|