@lvce-editor/extension-detail-view 6.1.0 → 6.2.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.
|
@@ -100,7 +100,7 @@ const changelog = () => {
|
|
|
100
100
|
const details = () => {
|
|
101
101
|
return i18nString(Details$1);
|
|
102
102
|
};
|
|
103
|
-
const disable
|
|
103
|
+
const disable = () => {
|
|
104
104
|
return i18nString(Disable$1);
|
|
105
105
|
};
|
|
106
106
|
const features$1 = () => {
|
|
@@ -133,7 +133,7 @@ const status = () => {
|
|
|
133
133
|
const setColorTheme$2 = () => {
|
|
134
134
|
return i18nString(SetColorTheme$1);
|
|
135
135
|
};
|
|
136
|
-
const enable
|
|
136
|
+
const enable = () => {
|
|
137
137
|
return i18nString(Enable$1);
|
|
138
138
|
};
|
|
139
139
|
const theme = () => {
|
|
@@ -325,24 +325,9 @@ const Ul = 60;
|
|
|
325
325
|
const Code$2 = 65;
|
|
326
326
|
const Dt = 67;
|
|
327
327
|
|
|
328
|
-
const ClientX = 'event.clientX';
|
|
329
|
-
const ClientY = 'event.clientY';
|
|
330
|
-
const TargetHref = 'event.target.href';
|
|
331
|
-
const TargetName = 'event.target.name';
|
|
332
|
-
|
|
333
328
|
const LeftArrow = 13;
|
|
334
329
|
const RightArrow = 15;
|
|
335
330
|
|
|
336
|
-
const ExtensionDetailReadme = 20;
|
|
337
|
-
const ExtensionDetailIconContextMenu$3 = 4091;
|
|
338
|
-
|
|
339
|
-
const None$2 = 0;
|
|
340
|
-
|
|
341
|
-
const Web$1 = 1;
|
|
342
|
-
|
|
343
|
-
const FocusElementByName = 'Viewlet.focusElementByName';
|
|
344
|
-
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
345
|
-
|
|
346
331
|
const mergeClassNames = (...classNames) => {
|
|
347
332
|
return classNames.filter(Boolean).join(' ');
|
|
348
333
|
};
|
|
@@ -1029,14 +1014,29 @@ const getFeatureVirtualDomHandler = featureName => {
|
|
|
1029
1014
|
return feature.getVirtualDom;
|
|
1030
1015
|
};
|
|
1031
1016
|
|
|
1017
|
+
const ClientX = 'event.clientX';
|
|
1018
|
+
const ClientY = 'event.clientY';
|
|
1019
|
+
const TargetHref = 'event.target.href';
|
|
1020
|
+
const TargetName = 'event.target.name';
|
|
1021
|
+
|
|
1032
1022
|
const Script$1 = 2;
|
|
1033
1023
|
|
|
1024
|
+
const ExtensionDetailReadme = 20;
|
|
1025
|
+
const ExtensionDetailIconContextMenu$3 = 4091;
|
|
1026
|
+
|
|
1027
|
+
const None$2 = 0;
|
|
1028
|
+
|
|
1029
|
+
const Web$1 = 1;
|
|
1030
|
+
|
|
1034
1031
|
const ExtensionHostWorker = 44;
|
|
1035
1032
|
const ExtensionManagementWorker = 9006;
|
|
1036
1033
|
const FileSystemWorker$1 = 209;
|
|
1037
1034
|
const MarkdownWorker$1 = 300;
|
|
1038
1035
|
const RendererWorker = 1;
|
|
1039
1036
|
|
|
1037
|
+
const FocusElementByName = 'Viewlet.focusElementByName';
|
|
1038
|
+
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
1039
|
+
|
|
1040
1040
|
const rpcs = Object.create(null);
|
|
1041
1041
|
const set$b = (id, rpc) => {
|
|
1042
1042
|
rpcs[id] = rpc;
|
|
@@ -1302,8 +1302,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
1302
1302
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
1303
1303
|
const message = lines[messageIndex];
|
|
1304
1304
|
return {
|
|
1305
|
-
|
|
1306
|
-
|
|
1305
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
1306
|
+
message
|
|
1307
1307
|
};
|
|
1308
1308
|
};
|
|
1309
1309
|
const isModuleNotFoundError = stderr => {
|
|
@@ -1326,14 +1326,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
1326
1326
|
const getNativeModuleErrorMessage = stderr => {
|
|
1327
1327
|
const message = getMessageCodeBlock(stderr);
|
|
1328
1328
|
return {
|
|
1329
|
-
|
|
1330
|
-
|
|
1329
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
1330
|
+
message: `Incompatible native node module: ${message}`
|
|
1331
1331
|
};
|
|
1332
1332
|
};
|
|
1333
1333
|
const getModuleSyntaxError = () => {
|
|
1334
1334
|
return {
|
|
1335
|
-
|
|
1336
|
-
|
|
1335
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
1336
|
+
message: `ES Modules are not supported in electron`
|
|
1337
1337
|
};
|
|
1338
1338
|
};
|
|
1339
1339
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -1352,8 +1352,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
1352
1352
|
rest
|
|
1353
1353
|
} = getDetails(lines);
|
|
1354
1354
|
return {
|
|
1355
|
-
message: actualMessage,
|
|
1356
1355
|
code: '',
|
|
1356
|
+
message: actualMessage,
|
|
1357
1357
|
stack: rest
|
|
1358
1358
|
};
|
|
1359
1359
|
};
|
|
@@ -1363,8 +1363,8 @@ class IpcError extends VError {
|
|
|
1363
1363
|
if (stdout || stderr) {
|
|
1364
1364
|
// @ts-ignore
|
|
1365
1365
|
const {
|
|
1366
|
-
message,
|
|
1367
1366
|
code,
|
|
1367
|
+
message,
|
|
1368
1368
|
stack
|
|
1369
1369
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
1370
1370
|
const cause = new Error(message);
|
|
@@ -1425,8 +1425,8 @@ const wrap$f = global => {
|
|
|
1425
1425
|
};
|
|
1426
1426
|
const waitForFirstMessage = async port => {
|
|
1427
1427
|
const {
|
|
1428
|
-
|
|
1429
|
-
|
|
1428
|
+
promise,
|
|
1429
|
+
resolve
|
|
1430
1430
|
} = Promise.withResolvers();
|
|
1431
1431
|
port.addEventListener('message', resolve, {
|
|
1432
1432
|
once: true
|
|
@@ -1446,8 +1446,8 @@ const listen$6 = async () => {
|
|
|
1446
1446
|
const type = firstMessage.params[0];
|
|
1447
1447
|
if (type === 'message-port') {
|
|
1448
1448
|
parentIpc.send({
|
|
1449
|
-
jsonrpc: '2.0',
|
|
1450
1449
|
id: firstMessage.id,
|
|
1450
|
+
jsonrpc: '2.0',
|
|
1451
1451
|
result: null
|
|
1452
1452
|
});
|
|
1453
1453
|
parentIpc.dispose();
|
|
@@ -1504,8 +1504,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
1504
1504
|
};
|
|
1505
1505
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
1506
1506
|
const {
|
|
1507
|
-
|
|
1508
|
-
|
|
1507
|
+
promise,
|
|
1508
|
+
resolve
|
|
1509
1509
|
} = Promise.withResolvers();
|
|
1510
1510
|
const listenerMap = Object.create(null);
|
|
1511
1511
|
const cleanup = value => {
|
|
@@ -1517,8 +1517,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1517
1517
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
1518
1518
|
const listener = event => {
|
|
1519
1519
|
cleanup({
|
|
1520
|
-
|
|
1521
|
-
|
|
1520
|
+
event,
|
|
1521
|
+
type
|
|
1522
1522
|
});
|
|
1523
1523
|
};
|
|
1524
1524
|
addListener(eventEmitter, event, listener);
|
|
@@ -1528,8 +1528,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1528
1528
|
};
|
|
1529
1529
|
const Message$1 = 3;
|
|
1530
1530
|
const create$5$1 = async ({
|
|
1531
|
-
|
|
1532
|
-
|
|
1531
|
+
isMessagePortOpen,
|
|
1532
|
+
messagePort
|
|
1533
1533
|
}) => {
|
|
1534
1534
|
if (!isMessagePort(messagePort)) {
|
|
1535
1535
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -1542,8 +1542,8 @@ const create$5$1 = async ({
|
|
|
1542
1542
|
});
|
|
1543
1543
|
messagePort.start();
|
|
1544
1544
|
const {
|
|
1545
|
-
|
|
1546
|
-
|
|
1545
|
+
event,
|
|
1546
|
+
type
|
|
1547
1547
|
} = await eventPromise;
|
|
1548
1548
|
if (type !== Message$1) {
|
|
1549
1549
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -2146,12 +2146,6 @@ const {
|
|
|
2146
2146
|
invoke: invoke$4,
|
|
2147
2147
|
set: set$8
|
|
2148
2148
|
} = create$7(ExtensionManagementWorker);
|
|
2149
|
-
const enable = id => {
|
|
2150
|
-
return invoke$4(`Extensions.enable`, id);
|
|
2151
|
-
};
|
|
2152
|
-
const disable = id => {
|
|
2153
|
-
return invoke$4(`Extensions.disable`, id);
|
|
2154
|
-
};
|
|
2155
2149
|
|
|
2156
2150
|
const {
|
|
2157
2151
|
dispose: dispose$3,
|
|
@@ -3431,8 +3425,8 @@ const handleClickCategory = async (state, categoryId) => {
|
|
|
3431
3425
|
return state;
|
|
3432
3426
|
};
|
|
3433
3427
|
|
|
3434
|
-
const disableExtension = id => {
|
|
3435
|
-
return
|
|
3428
|
+
const disableExtension = (id, platform) => {
|
|
3429
|
+
return invoke$4('Extensions.disable2', id, platform);
|
|
3436
3430
|
};
|
|
3437
3431
|
|
|
3438
3432
|
const Web = 1;
|
|
@@ -3474,20 +3468,23 @@ const getExtension = async (id, platform) => {
|
|
|
3474
3468
|
}
|
|
3475
3469
|
};
|
|
3476
3470
|
|
|
3471
|
+
const isEnabled$1 = button => {
|
|
3472
|
+
return button.enabled;
|
|
3473
|
+
};
|
|
3477
3474
|
const getExtensionDetailButtons = (hasColorTheme, isBuiltin, isDisabled) => {
|
|
3478
3475
|
const allActions = [{
|
|
3479
|
-
enabled: hasColorTheme,
|
|
3476
|
+
enabled: hasColorTheme && !isDisabled,
|
|
3480
3477
|
label: setColorTheme$2(),
|
|
3481
3478
|
name: SetColorTheme,
|
|
3482
3479
|
onClick: HandleClickSetColorTheme
|
|
3483
3480
|
}, {
|
|
3484
3481
|
enabled: isDisabled,
|
|
3485
|
-
label: enable
|
|
3482
|
+
label: enable(),
|
|
3486
3483
|
name: Enable,
|
|
3487
3484
|
onClick: HandleClickEnable
|
|
3488
3485
|
}, {
|
|
3489
3486
|
enabled: !isDisabled,
|
|
3490
|
-
label: disable
|
|
3487
|
+
label: disable(),
|
|
3491
3488
|
name: Disable,
|
|
3492
3489
|
onClick: HandleClickDisable
|
|
3493
3490
|
}, {
|
|
@@ -3496,7 +3493,7 @@ const getExtensionDetailButtons = (hasColorTheme, isBuiltin, isDisabled) => {
|
|
|
3496
3493
|
name: Uninstall,
|
|
3497
3494
|
onClick: HandleClickUninstall
|
|
3498
3495
|
}];
|
|
3499
|
-
const filteredButtons = allActions.filter(
|
|
3496
|
+
const filteredButtons = allActions.filter(isEnabled$1);
|
|
3500
3497
|
return filteredButtons;
|
|
3501
3498
|
};
|
|
3502
3499
|
|
|
@@ -3506,7 +3503,7 @@ const updateExtensionStatus = async (state, updateFunction) => {
|
|
|
3506
3503
|
hasColorTheme,
|
|
3507
3504
|
platform
|
|
3508
3505
|
} = state;
|
|
3509
|
-
const error = await updateFunction(extensionId);
|
|
3506
|
+
const error = await updateFunction(extensionId, platform);
|
|
3510
3507
|
if (error) {
|
|
3511
3508
|
await confirm(`${error}`);
|
|
3512
3509
|
}
|
|
@@ -3524,8 +3521,8 @@ const handleClickDisable = async state => {
|
|
|
3524
3521
|
return updateExtensionStatus(state, disableExtension);
|
|
3525
3522
|
};
|
|
3526
3523
|
|
|
3527
|
-
const enableExtension = id => {
|
|
3528
|
-
return
|
|
3524
|
+
const enableExtension = (id, platform) => {
|
|
3525
|
+
return invoke$4('Extensions.enable2', id, platform);
|
|
3529
3526
|
};
|
|
3530
3527
|
|
|
3531
3528
|
const handleClickEnable = async state => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/extension-detail-view",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Extension Detail View Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/extensionDetailViewWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@lvce-editor/constants": "^1.
|
|
14
|
+
"@lvce-editor/constants": "^2.1.0"
|
|
15
15
|
}
|
|
16
16
|
}
|