@lvce-editor/renderer-process 23.0.0 → 23.1.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/rendererProcessMain.js +40 -44
- package/package.json +1 -1
|
@@ -973,14 +973,6 @@ const getEventListenerArg = (param, event) => {
|
|
|
973
973
|
return event.target.checked;
|
|
974
974
|
case 'event.target.className':
|
|
975
975
|
return event.target.className;
|
|
976
|
-
case 'event.target.dataset.groupIndex':
|
|
977
|
-
return event.target.dataset.groupIndex;
|
|
978
|
-
case 'event.target.dataset.id':
|
|
979
|
-
return event.target.dataset.id;
|
|
980
|
-
case 'event.target.dataset.index':
|
|
981
|
-
return event.target.dataset.index;
|
|
982
|
-
case 'event.target.dataset.name':
|
|
983
|
-
return event.target.dataset.name;
|
|
984
976
|
case 'event.target.href':
|
|
985
977
|
return event.target.href;
|
|
986
978
|
case 'event.target.name':
|
|
@@ -1002,6 +994,10 @@ const getEventListenerArg = (param, event) => {
|
|
|
1002
994
|
case 'event.y':
|
|
1003
995
|
return event.y;
|
|
1004
996
|
default:
|
|
997
|
+
if (param.startsWith('event.target.dataset')) {
|
|
998
|
+
const rest = param.slice('event.target.dataset.'.length);
|
|
999
|
+
return event.target.dataset[rest];
|
|
1000
|
+
}
|
|
1005
1001
|
return param;
|
|
1006
1002
|
}
|
|
1007
1003
|
};
|
|
@@ -2247,12 +2243,12 @@ const getErrorConstructor = (message, type) => {
|
|
|
2247
2243
|
switch (type) {
|
|
2248
2244
|
case DomException:
|
|
2249
2245
|
return DOMException;
|
|
2250
|
-
case TypeError$1:
|
|
2251
|
-
return TypeError;
|
|
2252
|
-
case SyntaxError$1:
|
|
2253
|
-
return SyntaxError;
|
|
2254
2246
|
case ReferenceError$1:
|
|
2255
2247
|
return ReferenceError;
|
|
2248
|
+
case SyntaxError$1:
|
|
2249
|
+
return SyntaxError;
|
|
2250
|
+
case TypeError$1:
|
|
2251
|
+
return TypeError;
|
|
2256
2252
|
default:
|
|
2257
2253
|
return Error;
|
|
2258
2254
|
}
|
|
@@ -2408,27 +2404,27 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
2408
2404
|
if (error && error.code === E_COMMAND_NOT_FOUND) {
|
|
2409
2405
|
return {
|
|
2410
2406
|
code: MethodNotFound,
|
|
2411
|
-
|
|
2412
|
-
|
|
2407
|
+
data: error.stack,
|
|
2408
|
+
message: error.message
|
|
2413
2409
|
};
|
|
2414
2410
|
}
|
|
2415
2411
|
return {
|
|
2416
2412
|
code: Custom,
|
|
2417
|
-
message: prettyError.message,
|
|
2418
2413
|
data: {
|
|
2419
|
-
stack: getStack(prettyError),
|
|
2420
|
-
codeFrame: prettyError.codeFrame,
|
|
2421
|
-
type: getErrorType(prettyError),
|
|
2422
2414
|
code: prettyError.code,
|
|
2423
|
-
|
|
2424
|
-
|
|
2415
|
+
codeFrame: prettyError.codeFrame,
|
|
2416
|
+
name: prettyError.name,
|
|
2417
|
+
stack: getStack(prettyError),
|
|
2418
|
+
type: getErrorType(prettyError)
|
|
2419
|
+
},
|
|
2420
|
+
message: prettyError.message
|
|
2425
2421
|
};
|
|
2426
2422
|
};
|
|
2427
2423
|
const create$1$1 = (id, error) => {
|
|
2428
2424
|
return {
|
|
2429
|
-
|
|
2425
|
+
error,
|
|
2430
2426
|
id,
|
|
2431
|
-
|
|
2427
|
+
jsonrpc: Two$1
|
|
2432
2428
|
};
|
|
2433
2429
|
};
|
|
2434
2430
|
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
@@ -2439,8 +2435,8 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
2439
2435
|
};
|
|
2440
2436
|
const create$J = (message, result) => {
|
|
2441
2437
|
return {
|
|
2442
|
-
jsonrpc: Two$1,
|
|
2443
2438
|
id: message.id,
|
|
2439
|
+
jsonrpc: Two$1,
|
|
2444
2440
|
result: result ?? null
|
|
2445
2441
|
};
|
|
2446
2442
|
};
|
|
@@ -2450,14 +2446,14 @@ const getSuccessResponse = (message, result) => {
|
|
|
2450
2446
|
};
|
|
2451
2447
|
const getErrorResponseSimple = (id, error) => {
|
|
2452
2448
|
return {
|
|
2453
|
-
jsonrpc: Two$1,
|
|
2454
|
-
id,
|
|
2455
2449
|
error: {
|
|
2456
2450
|
code: Custom,
|
|
2451
|
+
data: error,
|
|
2457
2452
|
// @ts-ignore
|
|
2458
|
-
message: error.message
|
|
2459
|
-
|
|
2460
|
-
|
|
2453
|
+
message: error.message
|
|
2454
|
+
},
|
|
2455
|
+
id,
|
|
2456
|
+
jsonrpc: Two$1
|
|
2461
2457
|
};
|
|
2462
2458
|
};
|
|
2463
2459
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
@@ -2487,35 +2483,35 @@ const normalizeParams = args => {
|
|
|
2487
2483
|
if (args.length === 1) {
|
|
2488
2484
|
const options = args[0];
|
|
2489
2485
|
return {
|
|
2486
|
+
execute: options.execute,
|
|
2490
2487
|
ipc: options.ipc,
|
|
2488
|
+
logError: options.logError || defaultLogError,
|
|
2491
2489
|
message: options.message,
|
|
2492
|
-
execute: options.execute,
|
|
2493
|
-
resolve: options.resolve || defaultResolve,
|
|
2494
2490
|
preparePrettyError: options.preparePrettyError || defaultPreparePrettyError,
|
|
2495
|
-
|
|
2496
|
-
|
|
2491
|
+
requiresSocket: options.requiresSocket || defaultRequiresSocket,
|
|
2492
|
+
resolve: options.resolve || defaultResolve
|
|
2497
2493
|
};
|
|
2498
2494
|
}
|
|
2499
2495
|
return {
|
|
2496
|
+
execute: args[2],
|
|
2500
2497
|
ipc: args[0],
|
|
2498
|
+
logError: args[5],
|
|
2501
2499
|
message: args[1],
|
|
2502
|
-
execute: args[2],
|
|
2503
|
-
resolve: args[3],
|
|
2504
2500
|
preparePrettyError: args[4],
|
|
2505
|
-
|
|
2506
|
-
|
|
2501
|
+
requiresSocket: args[6],
|
|
2502
|
+
resolve: args[3]
|
|
2507
2503
|
};
|
|
2508
2504
|
};
|
|
2509
2505
|
const handleJsonRpcMessage = async (...args) => {
|
|
2510
2506
|
const options = normalizeParams(args);
|
|
2511
2507
|
const {
|
|
2512
|
-
message,
|
|
2513
|
-
ipc,
|
|
2514
2508
|
execute,
|
|
2515
|
-
|
|
2516
|
-
preparePrettyError,
|
|
2509
|
+
ipc,
|
|
2517
2510
|
logError,
|
|
2518
|
-
|
|
2511
|
+
message,
|
|
2512
|
+
preparePrettyError,
|
|
2513
|
+
requiresSocket,
|
|
2514
|
+
resolve
|
|
2519
2515
|
} = options;
|
|
2520
2516
|
if ('id' in message) {
|
|
2521
2517
|
if ('method' in message) {
|
|
@@ -2576,7 +2572,6 @@ const registerPromise = map => {
|
|
|
2576
2572
|
};
|
|
2577
2573
|
};
|
|
2578
2574
|
|
|
2579
|
-
// @ts-ignore
|
|
2580
2575
|
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
2581
2576
|
const {
|
|
2582
2577
|
id,
|
|
@@ -3807,7 +3802,8 @@ const querySelectorByText = (root, text) => {
|
|
|
3807
3802
|
return elements;
|
|
3808
3803
|
};
|
|
3809
3804
|
const querySelectorByCss = selector => {
|
|
3810
|
-
|
|
3805
|
+
// @ts-ignore
|
|
3806
|
+
return [...document.querySelectorAll(selector)];
|
|
3811
3807
|
};
|
|
3812
3808
|
const isElement = selector => {
|
|
3813
3809
|
return htmlElements.includes(selector);
|
|
@@ -10002,7 +9998,7 @@ const RE_PATH_3 = /@(.*):(\d+):(\d+)$/; // Firefox
|
|
|
10002
9998
|
*/
|
|
10003
9999
|
const getFile = lines => {
|
|
10004
10000
|
for (const line of lines) {
|
|
10005
|
-
if (
|
|
10001
|
+
if (RE_PATH_1.test(line) || RE_PATH_2.test(line) || RE_PATH_3.test(line)) {
|
|
10006
10002
|
return line;
|
|
10007
10003
|
}
|
|
10008
10004
|
}
|