@lvce-editor/text-search-worker 4.11.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 +19 -10
- 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
|
|
@@ -1174,6 +1174,7 @@ const create$3 = rpcId => {
|
|
|
1174
1174
|
};
|
|
1175
1175
|
};
|
|
1176
1176
|
const RendererWorker$1 = 1;
|
|
1177
|
+
const SearchProcess$1 = 77;
|
|
1177
1178
|
const {
|
|
1178
1179
|
invoke: invoke$3,
|
|
1179
1180
|
invokeAndTransfer: invokeAndTransfer$3,
|
|
@@ -1184,12 +1185,17 @@ const RendererWorker = {
|
|
|
1184
1185
|
invokeAndTransfer: invokeAndTransfer$3,
|
|
1185
1186
|
set: set$3
|
|
1186
1187
|
};
|
|
1188
|
+
const {
|
|
1189
|
+
set: set$2$1} = create$3(SearchProcess$1);
|
|
1190
|
+
const SearchProcess = {
|
|
1191
|
+
__proto__: null,
|
|
1192
|
+
set: set$2$1
|
|
1193
|
+
};
|
|
1187
1194
|
|
|
1188
1195
|
const {
|
|
1189
1196
|
invoke: invoke$2,
|
|
1190
1197
|
invokeAndTransfer,
|
|
1191
|
-
set: set$
|
|
1192
|
-
} = RendererWorker;
|
|
1198
|
+
set: set$2} = RendererWorker;
|
|
1193
1199
|
|
|
1194
1200
|
const copy = async state => {
|
|
1195
1201
|
const {
|
|
@@ -1267,7 +1273,7 @@ const create$2 = () => {
|
|
|
1267
1273
|
|
|
1268
1274
|
const {
|
|
1269
1275
|
get,
|
|
1270
|
-
set,
|
|
1276
|
+
set: set$1,
|
|
1271
1277
|
wrapCommand
|
|
1272
1278
|
} = create$2();
|
|
1273
1279
|
|
|
@@ -1344,7 +1350,7 @@ const create = (uid, x, y, width, height, workspacePath, assetDir, itemHeight, v
|
|
|
1344
1350
|
incrementalSearch: false,
|
|
1345
1351
|
searchId: ''
|
|
1346
1352
|
};
|
|
1347
|
-
set(uid, state, state);
|
|
1353
|
+
set$1(uid, state, state);
|
|
1348
1354
|
return state;
|
|
1349
1355
|
};
|
|
1350
1356
|
|
|
@@ -2153,6 +2159,8 @@ const invoke$1 = async (method, ...params) => {
|
|
|
2153
2159
|
const rpc = await getOrCreate$1();
|
|
2154
2160
|
return rpc.invoke(method, ...params);
|
|
2155
2161
|
};
|
|
2162
|
+
const {
|
|
2163
|
+
set} = SearchProcess;
|
|
2156
2164
|
|
|
2157
2165
|
const getPortTuple = () => {
|
|
2158
2166
|
const {
|
|
@@ -2178,6 +2186,7 @@ const launchSearchProcessElectron = async () => {
|
|
|
2178
2186
|
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port1, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
2179
2187
|
port2.start();
|
|
2180
2188
|
const rpc = await rpcPromise;
|
|
2189
|
+
set(rpc);
|
|
2181
2190
|
return rpc;
|
|
2182
2191
|
};
|
|
2183
2192
|
|
|
@@ -2373,7 +2382,7 @@ const textSearchIncremental = async (root, query, options, assetDir, platform, s
|
|
|
2373
2382
|
minLineY: 0,
|
|
2374
2383
|
maxLineY: visible.length
|
|
2375
2384
|
};
|
|
2376
|
-
set(uid, latest2.oldState, updatedState2);
|
|
2385
|
+
set$1(uid, latest2.oldState, updatedState2);
|
|
2377
2386
|
// @ts-ignore
|
|
2378
2387
|
await invoke$2('Search.rerender');
|
|
2379
2388
|
await waitForNextFrame();
|
|
@@ -2405,7 +2414,7 @@ const handleUpdateIncremental = async (state, update) => {
|
|
|
2405
2414
|
...partialNewState,
|
|
2406
2415
|
searchId
|
|
2407
2416
|
};
|
|
2408
|
-
set(uid, latest1.oldState, updatedState1);
|
|
2417
|
+
set$1(uid, latest1.oldState, updatedState1);
|
|
2409
2418
|
|
|
2410
2419
|
// TODO await promise?
|
|
2411
2420
|
void textSearchIncremental(root, value, {
|
|
@@ -4432,7 +4441,7 @@ const render2 = (uid, diffResult) => {
|
|
|
4432
4441
|
oldState,
|
|
4433
4442
|
newState
|
|
4434
4443
|
} = get(uid);
|
|
4435
|
-
set(uid, newState, newState);
|
|
4444
|
+
set$1(uid, newState, newState);
|
|
4436
4445
|
const commands = applyRender(oldState, newState, diffResult);
|
|
4437
4446
|
return commands;
|
|
4438
4447
|
};
|
|
@@ -4916,7 +4925,7 @@ const listen = async () => {
|
|
|
4916
4925
|
const rpc = await WebWorkerRpcClient.create({
|
|
4917
4926
|
commandMap: commandMap
|
|
4918
4927
|
});
|
|
4919
|
-
set$
|
|
4928
|
+
set$2(rpc);
|
|
4920
4929
|
};
|
|
4921
4930
|
|
|
4922
4931
|
const main = async () => {
|