@lvce-editor/menu-worker 4.13.0 → 4.14.1
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/menuWorkerMain.js +103 -162
- package/package.json +1 -1
package/dist/menuWorkerMain.js
CHANGED
|
@@ -139,7 +139,6 @@ const walkValue = (value, transferrables, isTransferrable) => {
|
|
|
139
139
|
for (const property of Object.values(value)) {
|
|
140
140
|
walkValue(property, transferrables, isTransferrable);
|
|
141
141
|
}
|
|
142
|
-
return;
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
144
|
const getTransferrables = value => {
|
|
@@ -293,7 +292,14 @@ class IpcError extends VError {
|
|
|
293
292
|
const cause = new Error(message);
|
|
294
293
|
// @ts-ignore
|
|
295
294
|
cause.code = code;
|
|
296
|
-
|
|
295
|
+
if (stack) {
|
|
296
|
+
Object.defineProperty(cause, 'stack', {
|
|
297
|
+
configurable: true,
|
|
298
|
+
enumerable: false,
|
|
299
|
+
value: stack,
|
|
300
|
+
writable: true
|
|
301
|
+
});
|
|
302
|
+
}
|
|
297
303
|
super(cause, betterMessage);
|
|
298
304
|
} else {
|
|
299
305
|
super(betterMessage);
|
|
@@ -1002,6 +1008,34 @@ const listen$1 = async (module, options) => {
|
|
|
1002
1008
|
return ipc;
|
|
1003
1009
|
};
|
|
1004
1010
|
|
|
1011
|
+
const createSharedLazyRpc = factory => {
|
|
1012
|
+
let rpcPromise;
|
|
1013
|
+
const getOrCreate = () => {
|
|
1014
|
+
if (!rpcPromise) {
|
|
1015
|
+
rpcPromise = factory();
|
|
1016
|
+
}
|
|
1017
|
+
return rpcPromise;
|
|
1018
|
+
};
|
|
1019
|
+
return {
|
|
1020
|
+
async dispose() {
|
|
1021
|
+
const rpc = await getOrCreate();
|
|
1022
|
+
await rpc.dispose();
|
|
1023
|
+
},
|
|
1024
|
+
async invoke(method, ...params) {
|
|
1025
|
+
const rpc = await getOrCreate();
|
|
1026
|
+
return rpc.invoke(method, ...params);
|
|
1027
|
+
},
|
|
1028
|
+
async invokeAndTransfer(method, ...params) {
|
|
1029
|
+
const rpc = await getOrCreate();
|
|
1030
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1031
|
+
},
|
|
1032
|
+
async send(method, ...params) {
|
|
1033
|
+
const rpc = await getOrCreate();
|
|
1034
|
+
rpc.send(method, ...params);
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1005
1039
|
const create$5 = async ({
|
|
1006
1040
|
commandMap,
|
|
1007
1041
|
isMessagePortOpen = true,
|
|
@@ -1037,34 +1071,6 @@ const create$4 = async ({
|
|
|
1037
1071
|
});
|
|
1038
1072
|
};
|
|
1039
1073
|
|
|
1040
|
-
const createSharedLazyRpc = factory => {
|
|
1041
|
-
let rpcPromise;
|
|
1042
|
-
const getOrCreate = () => {
|
|
1043
|
-
if (!rpcPromise) {
|
|
1044
|
-
rpcPromise = factory();
|
|
1045
|
-
}
|
|
1046
|
-
return rpcPromise;
|
|
1047
|
-
};
|
|
1048
|
-
return {
|
|
1049
|
-
async dispose() {
|
|
1050
|
-
const rpc = await getOrCreate();
|
|
1051
|
-
await rpc.dispose();
|
|
1052
|
-
},
|
|
1053
|
-
async invoke(method, ...params) {
|
|
1054
|
-
const rpc = await getOrCreate();
|
|
1055
|
-
return rpc.invoke(method, ...params);
|
|
1056
|
-
},
|
|
1057
|
-
async invokeAndTransfer(method, ...params) {
|
|
1058
|
-
const rpc = await getOrCreate();
|
|
1059
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
1060
|
-
},
|
|
1061
|
-
async send(method, ...params) {
|
|
1062
|
-
const rpc = await getOrCreate();
|
|
1063
|
-
rpc.send(method, ...params);
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
1074
|
const create$3 = async ({
|
|
1069
1075
|
commandMap,
|
|
1070
1076
|
isMessagePortOpen,
|
|
@@ -1296,139 +1302,74 @@ const Backslash = 'Backslash';
|
|
|
1296
1302
|
const Star = '*';
|
|
1297
1303
|
const Plus = '+';
|
|
1298
1304
|
|
|
1305
|
+
const keyCodeStringMap = {
|
|
1306
|
+
[Backquote$1]: Backquote,
|
|
1307
|
+
[Backslash$1]: Backslash,
|
|
1308
|
+
[Backspace$1]: Backspace,
|
|
1309
|
+
[Comma$1]: Comma,
|
|
1310
|
+
[Delete$1]: Delete,
|
|
1311
|
+
[Digit0$1]: Digit0,
|
|
1312
|
+
[Digit1$1]: Digit1,
|
|
1313
|
+
[Digit2$1]: Digit2,
|
|
1314
|
+
[Digit3$1]: Digit3,
|
|
1315
|
+
[Digit4$1]: Digit4,
|
|
1316
|
+
[Digit5$1]: Digit5,
|
|
1317
|
+
[Digit6$1]: Digit6,
|
|
1318
|
+
[Digit7$1]: Digit7,
|
|
1319
|
+
[Digit8$1]: Digit8,
|
|
1320
|
+
[Digit9$1]: Digit9,
|
|
1321
|
+
[DownArrow$1]: DownArrow,
|
|
1322
|
+
[End$1]: End,
|
|
1323
|
+
[Enter$1]: Enter,
|
|
1324
|
+
[Equal$1]: Equal,
|
|
1325
|
+
[Escape$1]: Escape,
|
|
1326
|
+
[F1$1]: F1,
|
|
1327
|
+
[F2$1]: F2,
|
|
1328
|
+
[F3$1]: F3,
|
|
1329
|
+
[F4$1]: F4,
|
|
1330
|
+
[F5$1]: F5,
|
|
1331
|
+
[F6$1]: F6,
|
|
1332
|
+
[Home$1]: Home,
|
|
1333
|
+
[Insert$1]: Insert,
|
|
1334
|
+
[KeyA$1]: KeyA,
|
|
1335
|
+
[KeyB$1]: KeyB,
|
|
1336
|
+
[KeyC$1]: KeyC,
|
|
1337
|
+
[KeyD$1]: KeyD,
|
|
1338
|
+
[KeyE$1]: KeyE,
|
|
1339
|
+
[KeyF$1]: KeyF,
|
|
1340
|
+
[KeyG$1]: KeyG,
|
|
1341
|
+
[KeyH$1]: KeyH,
|
|
1342
|
+
[KeyI$1]: KeyI,
|
|
1343
|
+
[KeyJ$1]: KeyJ,
|
|
1344
|
+
[KeyK$1]: KeyK,
|
|
1345
|
+
[KeyL$1]: KeyL,
|
|
1346
|
+
[KeyM$1]: KeyM,
|
|
1347
|
+
[KeyN$1]: KeyN,
|
|
1348
|
+
[KeyO$1]: KeyO,
|
|
1349
|
+
[KeyP$1]: KeyP,
|
|
1350
|
+
[KeyQ$1]: KeyQ,
|
|
1351
|
+
[KeyR$1]: KeyR,
|
|
1352
|
+
[KeyS$1]: KeyS,
|
|
1353
|
+
[KeyT$1]: KeyT,
|
|
1354
|
+
[KeyU$1]: KeyU,
|
|
1355
|
+
[KeyV$1]: KeyV,
|
|
1356
|
+
[KeyW$1]: KeyW,
|
|
1357
|
+
[KeyX$1]: KeyX,
|
|
1358
|
+
[KeyY$1]: KeyY,
|
|
1359
|
+
[KeyZ$1]: KeyZ,
|
|
1360
|
+
[LeftArrow$1]: LeftArrow,
|
|
1361
|
+
[Minus$1]: Minus,
|
|
1362
|
+
[PageDown$1]: PageDown,
|
|
1363
|
+
[PageUp$1]: PageUp,
|
|
1364
|
+
[Plus$1]: Plus,
|
|
1365
|
+
[RightArrow$1]: RightArrow,
|
|
1366
|
+
[Space$1]: Space,
|
|
1367
|
+
[Star$1]: Star,
|
|
1368
|
+
[Tab$1]: Tab,
|
|
1369
|
+
[UpArrow$1]: UpArrow
|
|
1370
|
+
};
|
|
1299
1371
|
const getKeyCodeString = keyCode => {
|
|
1300
|
-
|
|
1301
|
-
case Backquote$1:
|
|
1302
|
-
return Backquote;
|
|
1303
|
-
case Backslash$1:
|
|
1304
|
-
return Backslash;
|
|
1305
|
-
case Backspace$1:
|
|
1306
|
-
return Backspace;
|
|
1307
|
-
case Comma$1:
|
|
1308
|
-
return Comma;
|
|
1309
|
-
case Delete$1:
|
|
1310
|
-
return Delete;
|
|
1311
|
-
case Digit0$1:
|
|
1312
|
-
return Digit0;
|
|
1313
|
-
case Digit1$1:
|
|
1314
|
-
return Digit1;
|
|
1315
|
-
case Digit2$1:
|
|
1316
|
-
return Digit2;
|
|
1317
|
-
case Digit3$1:
|
|
1318
|
-
return Digit3;
|
|
1319
|
-
case Digit4$1:
|
|
1320
|
-
return Digit4;
|
|
1321
|
-
case Digit5$1:
|
|
1322
|
-
return Digit5;
|
|
1323
|
-
case Digit6$1:
|
|
1324
|
-
return Digit6;
|
|
1325
|
-
case Digit7$1:
|
|
1326
|
-
return Digit7;
|
|
1327
|
-
case Digit8$1:
|
|
1328
|
-
return Digit8;
|
|
1329
|
-
case Digit9$1:
|
|
1330
|
-
return Digit9;
|
|
1331
|
-
case DownArrow$1:
|
|
1332
|
-
return DownArrow;
|
|
1333
|
-
case End$1:
|
|
1334
|
-
return End;
|
|
1335
|
-
case Enter$1:
|
|
1336
|
-
return Enter;
|
|
1337
|
-
case Equal$1:
|
|
1338
|
-
return Equal;
|
|
1339
|
-
case Escape$1:
|
|
1340
|
-
return Escape;
|
|
1341
|
-
case F1$1:
|
|
1342
|
-
return F1;
|
|
1343
|
-
case F2$1:
|
|
1344
|
-
return F2;
|
|
1345
|
-
case F3$1:
|
|
1346
|
-
return F3;
|
|
1347
|
-
case F4$1:
|
|
1348
|
-
return F4;
|
|
1349
|
-
case F5$1:
|
|
1350
|
-
return F5;
|
|
1351
|
-
case F6$1:
|
|
1352
|
-
return F6;
|
|
1353
|
-
case Home$1:
|
|
1354
|
-
return Home;
|
|
1355
|
-
case Insert$1:
|
|
1356
|
-
return Insert;
|
|
1357
|
-
case KeyA$1:
|
|
1358
|
-
return KeyA;
|
|
1359
|
-
case KeyB$1:
|
|
1360
|
-
return KeyB;
|
|
1361
|
-
case KeyC$1:
|
|
1362
|
-
return KeyC;
|
|
1363
|
-
case KeyD$1:
|
|
1364
|
-
return KeyD;
|
|
1365
|
-
case KeyE$1:
|
|
1366
|
-
return KeyE;
|
|
1367
|
-
case KeyF$1:
|
|
1368
|
-
return KeyF;
|
|
1369
|
-
case KeyG$1:
|
|
1370
|
-
return KeyG;
|
|
1371
|
-
case KeyH$1:
|
|
1372
|
-
return KeyH;
|
|
1373
|
-
case KeyI$1:
|
|
1374
|
-
return KeyI;
|
|
1375
|
-
case KeyJ$1:
|
|
1376
|
-
return KeyJ;
|
|
1377
|
-
case KeyK$1:
|
|
1378
|
-
return KeyK;
|
|
1379
|
-
case KeyL$1:
|
|
1380
|
-
return KeyL;
|
|
1381
|
-
case KeyM$1:
|
|
1382
|
-
return KeyM;
|
|
1383
|
-
case KeyN$1:
|
|
1384
|
-
return KeyN;
|
|
1385
|
-
case KeyO$1:
|
|
1386
|
-
return KeyO;
|
|
1387
|
-
case KeyP$1:
|
|
1388
|
-
return KeyP;
|
|
1389
|
-
case KeyQ$1:
|
|
1390
|
-
return KeyQ;
|
|
1391
|
-
case KeyR$1:
|
|
1392
|
-
return KeyR;
|
|
1393
|
-
case KeyS$1:
|
|
1394
|
-
return KeyS;
|
|
1395
|
-
case KeyT$1:
|
|
1396
|
-
return KeyT;
|
|
1397
|
-
case KeyU$1:
|
|
1398
|
-
return KeyU;
|
|
1399
|
-
case KeyV$1:
|
|
1400
|
-
return KeyV;
|
|
1401
|
-
case KeyW$1:
|
|
1402
|
-
return KeyW;
|
|
1403
|
-
case KeyX$1:
|
|
1404
|
-
return KeyX;
|
|
1405
|
-
case KeyY$1:
|
|
1406
|
-
return KeyY;
|
|
1407
|
-
case KeyZ$1:
|
|
1408
|
-
return KeyZ;
|
|
1409
|
-
case LeftArrow$1:
|
|
1410
|
-
return LeftArrow;
|
|
1411
|
-
case Minus$1:
|
|
1412
|
-
return Minus;
|
|
1413
|
-
case PageDown$1:
|
|
1414
|
-
return PageDown;
|
|
1415
|
-
case PageUp$1:
|
|
1416
|
-
return PageUp;
|
|
1417
|
-
case Plus$1:
|
|
1418
|
-
return Plus;
|
|
1419
|
-
case RightArrow$1:
|
|
1420
|
-
return RightArrow;
|
|
1421
|
-
case Space$1:
|
|
1422
|
-
return Space;
|
|
1423
|
-
case Star$1:
|
|
1424
|
-
return Star;
|
|
1425
|
-
case Tab$1:
|
|
1426
|
-
return Tab;
|
|
1427
|
-
case UpArrow$1:
|
|
1428
|
-
return UpArrow;
|
|
1429
|
-
default:
|
|
1430
|
-
return Unknown;
|
|
1431
|
-
}
|
|
1372
|
+
return keyCodeStringMap[keyCode] || Unknown;
|
|
1432
1373
|
};
|
|
1433
1374
|
|
|
1434
1375
|
const CtrlCmd = 1 << 11 >>> 0;
|