@lvce-editor/extension-detail-view 6.0.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,25 +325,8 @@ const Ul = 60;
|
|
|
325
325
|
const Code$2 = 65;
|
|
326
326
|
const Dt = 67;
|
|
327
327
|
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
const TargetHref = 'event.target.href';
|
|
331
|
-
const TargetName = 'event.target.name';
|
|
332
|
-
|
|
333
|
-
const Script$1 = 2;
|
|
334
|
-
|
|
335
|
-
const ExtensionDetailReadme = 20;
|
|
336
|
-
const ExtensionDetailIconContextMenu$3 = 4091;
|
|
337
|
-
|
|
338
|
-
const None$2 = 0;
|
|
339
|
-
|
|
340
|
-
const Web$1 = 1;
|
|
341
|
-
|
|
342
|
-
const ExtensionHostWorker = 44;
|
|
343
|
-
const FileSystemWorker$1 = 209;
|
|
344
|
-
const MarkdownWorker$1 = 300;
|
|
345
|
-
const RendererWorker = 1;
|
|
346
|
-
const ExtensionManagementWorker = 9006;
|
|
328
|
+
const LeftArrow = 13;
|
|
329
|
+
const RightArrow = 15;
|
|
347
330
|
|
|
348
331
|
const mergeClassNames = (...classNames) => {
|
|
349
332
|
return classNames.filter(Boolean).join(' ');
|
|
@@ -1031,6 +1014,29 @@ const getFeatureVirtualDomHandler = featureName => {
|
|
|
1031
1014
|
return feature.getVirtualDom;
|
|
1032
1015
|
};
|
|
1033
1016
|
|
|
1017
|
+
const ClientX = 'event.clientX';
|
|
1018
|
+
const ClientY = 'event.clientY';
|
|
1019
|
+
const TargetHref = 'event.target.href';
|
|
1020
|
+
const TargetName = 'event.target.name';
|
|
1021
|
+
|
|
1022
|
+
const Script$1 = 2;
|
|
1023
|
+
|
|
1024
|
+
const ExtensionDetailReadme = 20;
|
|
1025
|
+
const ExtensionDetailIconContextMenu$3 = 4091;
|
|
1026
|
+
|
|
1027
|
+
const None$2 = 0;
|
|
1028
|
+
|
|
1029
|
+
const Web$1 = 1;
|
|
1030
|
+
|
|
1031
|
+
const ExtensionHostWorker = 44;
|
|
1032
|
+
const ExtensionManagementWorker = 9006;
|
|
1033
|
+
const FileSystemWorker$1 = 209;
|
|
1034
|
+
const MarkdownWorker$1 = 300;
|
|
1035
|
+
const RendererWorker = 1;
|
|
1036
|
+
|
|
1037
|
+
const FocusElementByName = 'Viewlet.focusElementByName';
|
|
1038
|
+
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
1039
|
+
|
|
1034
1040
|
const rpcs = Object.create(null);
|
|
1035
1041
|
const set$b = (id, rpc) => {
|
|
1036
1042
|
rpcs[id] = rpc;
|
|
@@ -1296,8 +1302,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
1296
1302
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
1297
1303
|
const message = lines[messageIndex];
|
|
1298
1304
|
return {
|
|
1299
|
-
|
|
1300
|
-
|
|
1305
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
1306
|
+
message
|
|
1301
1307
|
};
|
|
1302
1308
|
};
|
|
1303
1309
|
const isModuleNotFoundError = stderr => {
|
|
@@ -1320,14 +1326,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
1320
1326
|
const getNativeModuleErrorMessage = stderr => {
|
|
1321
1327
|
const message = getMessageCodeBlock(stderr);
|
|
1322
1328
|
return {
|
|
1323
|
-
|
|
1324
|
-
|
|
1329
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
1330
|
+
message: `Incompatible native node module: ${message}`
|
|
1325
1331
|
};
|
|
1326
1332
|
};
|
|
1327
1333
|
const getModuleSyntaxError = () => {
|
|
1328
1334
|
return {
|
|
1329
|
-
|
|
1330
|
-
|
|
1335
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
1336
|
+
message: `ES Modules are not supported in electron`
|
|
1331
1337
|
};
|
|
1332
1338
|
};
|
|
1333
1339
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -1346,8 +1352,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
1346
1352
|
rest
|
|
1347
1353
|
} = getDetails(lines);
|
|
1348
1354
|
return {
|
|
1349
|
-
message: actualMessage,
|
|
1350
1355
|
code: '',
|
|
1356
|
+
message: actualMessage,
|
|
1351
1357
|
stack: rest
|
|
1352
1358
|
};
|
|
1353
1359
|
};
|
|
@@ -1357,8 +1363,8 @@ class IpcError extends VError {
|
|
|
1357
1363
|
if (stdout || stderr) {
|
|
1358
1364
|
// @ts-ignore
|
|
1359
1365
|
const {
|
|
1360
|
-
message,
|
|
1361
1366
|
code,
|
|
1367
|
+
message,
|
|
1362
1368
|
stack
|
|
1363
1369
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
1364
1370
|
const cause = new Error(message);
|
|
@@ -1419,8 +1425,8 @@ const wrap$f = global => {
|
|
|
1419
1425
|
};
|
|
1420
1426
|
const waitForFirstMessage = async port => {
|
|
1421
1427
|
const {
|
|
1422
|
-
|
|
1423
|
-
|
|
1428
|
+
promise,
|
|
1429
|
+
resolve
|
|
1424
1430
|
} = Promise.withResolvers();
|
|
1425
1431
|
port.addEventListener('message', resolve, {
|
|
1426
1432
|
once: true
|
|
@@ -1440,8 +1446,8 @@ const listen$6 = async () => {
|
|
|
1440
1446
|
const type = firstMessage.params[0];
|
|
1441
1447
|
if (type === 'message-port') {
|
|
1442
1448
|
parentIpc.send({
|
|
1443
|
-
jsonrpc: '2.0',
|
|
1444
1449
|
id: firstMessage.id,
|
|
1450
|
+
jsonrpc: '2.0',
|
|
1445
1451
|
result: null
|
|
1446
1452
|
});
|
|
1447
1453
|
parentIpc.dispose();
|
|
@@ -1498,8 +1504,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
1498
1504
|
};
|
|
1499
1505
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
1500
1506
|
const {
|
|
1501
|
-
|
|
1502
|
-
|
|
1507
|
+
promise,
|
|
1508
|
+
resolve
|
|
1503
1509
|
} = Promise.withResolvers();
|
|
1504
1510
|
const listenerMap = Object.create(null);
|
|
1505
1511
|
const cleanup = value => {
|
|
@@ -1511,8 +1517,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1511
1517
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
1512
1518
|
const listener = event => {
|
|
1513
1519
|
cleanup({
|
|
1514
|
-
|
|
1515
|
-
|
|
1520
|
+
event,
|
|
1521
|
+
type
|
|
1516
1522
|
});
|
|
1517
1523
|
};
|
|
1518
1524
|
addListener(eventEmitter, event, listener);
|
|
@@ -1522,8 +1528,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1522
1528
|
};
|
|
1523
1529
|
const Message$1 = 3;
|
|
1524
1530
|
const create$5$1 = async ({
|
|
1525
|
-
|
|
1526
|
-
|
|
1531
|
+
isMessagePortOpen,
|
|
1532
|
+
messagePort
|
|
1527
1533
|
}) => {
|
|
1528
1534
|
if (!isMessagePort(messagePort)) {
|
|
1529
1535
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -1536,8 +1542,8 @@ const create$5$1 = async ({
|
|
|
1536
1542
|
});
|
|
1537
1543
|
messagePort.start();
|
|
1538
1544
|
const {
|
|
1539
|
-
|
|
1540
|
-
|
|
1545
|
+
event,
|
|
1546
|
+
type
|
|
1541
1547
|
} = await eventPromise;
|
|
1542
1548
|
if (type !== Message$1) {
|
|
1543
1549
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -2140,12 +2146,6 @@ const {
|
|
|
2140
2146
|
invoke: invoke$4,
|
|
2141
2147
|
set: set$8
|
|
2142
2148
|
} = create$7(ExtensionManagementWorker);
|
|
2143
|
-
const enable = id => {
|
|
2144
|
-
return invoke$4(`Extensions.enable`, id);
|
|
2145
|
-
};
|
|
2146
|
-
const disable = id => {
|
|
2147
|
-
return invoke$4(`Extensions.disable`, id);
|
|
2148
|
-
};
|
|
2149
2149
|
|
|
2150
2150
|
const {
|
|
2151
2151
|
dispose: dispose$3,
|
|
@@ -2542,6 +2542,7 @@ const HandleTabsClick = 14;
|
|
|
2542
2542
|
const HandleAdditionalDetailContextMenu = 15;
|
|
2543
2543
|
const HandleReadmeClick = 16;
|
|
2544
2544
|
const HandleSelectionChange = 17;
|
|
2545
|
+
const HandleTabFocus = 18;
|
|
2545
2546
|
|
|
2546
2547
|
const ActivationEvents = 'ActivationEvents';
|
|
2547
2548
|
const Changelog = 'Changelog';
|
|
@@ -3128,6 +3129,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
3128
3129
|
features: [],
|
|
3129
3130
|
featuresVirtualDom: [],
|
|
3130
3131
|
focus: 0,
|
|
3132
|
+
focusedTabIndex: 0,
|
|
3131
3133
|
folderSize: 0,
|
|
3132
3134
|
hasColorTheme: false,
|
|
3133
3135
|
hasReadme: false,
|
|
@@ -3176,7 +3178,7 @@ const isEqual$3 = (oldState, newState) => {
|
|
|
3176
3178
|
};
|
|
3177
3179
|
|
|
3178
3180
|
const isEqual$2 = (oldState, newState) => {
|
|
3179
|
-
return oldState.focus === newState.focus;
|
|
3181
|
+
return oldState.focus === newState.focus && oldState.focusedTabIndex === newState.focusedTabIndex;
|
|
3180
3182
|
};
|
|
3181
3183
|
|
|
3182
3184
|
const isEqual$1 = (oldState, newState) => {
|
|
@@ -3194,9 +3196,10 @@ const RenderFocus = 2;
|
|
|
3194
3196
|
const RenderItems = 3;
|
|
3195
3197
|
const RenderScrollTop = 4;
|
|
3196
3198
|
const RenderCss = 5;
|
|
3199
|
+
const RenderFocusContext = 6;
|
|
3197
3200
|
|
|
3198
|
-
const modules = [isEqual$1, isEqual$2, isEqual, isEqual$3];
|
|
3199
|
-
const numbers = [RenderItems, RenderFocus, RenderScrollTop, RenderCss];
|
|
3201
|
+
const modules = [isEqual$1, isEqual$2, isEqual, isEqual$3, isEqual$2];
|
|
3202
|
+
const numbers = [RenderItems, RenderFocus, RenderScrollTop, RenderCss, RenderFocusContext];
|
|
3200
3203
|
|
|
3201
3204
|
const diff2 = uid => {
|
|
3202
3205
|
const {
|
|
@@ -3224,6 +3227,41 @@ const executeCopy = async state => {
|
|
|
3224
3227
|
return state;
|
|
3225
3228
|
};
|
|
3226
3229
|
|
|
3230
|
+
const focusNextTab = state => {
|
|
3231
|
+
const {
|
|
3232
|
+
focusedTabIndex
|
|
3233
|
+
} = state;
|
|
3234
|
+
const newFocusedTabIndex = focusedTabIndex >= 1 ? 1 : focusedTabIndex + 1;
|
|
3235
|
+
return {
|
|
3236
|
+
...state,
|
|
3237
|
+
focusedTabIndex: newFocusedTabIndex
|
|
3238
|
+
};
|
|
3239
|
+
};
|
|
3240
|
+
|
|
3241
|
+
const focusPreviousTab = state => {
|
|
3242
|
+
const {
|
|
3243
|
+
focusedTabIndex
|
|
3244
|
+
} = state;
|
|
3245
|
+
const newFocusedTabIndex = focusedTabIndex <= 0 ? 0 : focusedTabIndex - 1;
|
|
3246
|
+
return {
|
|
3247
|
+
...state,
|
|
3248
|
+
focusedTabIndex: newFocusedTabIndex
|
|
3249
|
+
};
|
|
3250
|
+
};
|
|
3251
|
+
|
|
3252
|
+
const focusId$1 = 451;
|
|
3253
|
+
const getKeyBindings = () => {
|
|
3254
|
+
return [{
|
|
3255
|
+
command: 'ExtensionDetail.focusNextTab',
|
|
3256
|
+
key: RightArrow,
|
|
3257
|
+
when: focusId$1
|
|
3258
|
+
}, {
|
|
3259
|
+
command: 'ExtensionDetail.focusPreviousTab',
|
|
3260
|
+
key: LeftArrow,
|
|
3261
|
+
when: focusId$1
|
|
3262
|
+
}];
|
|
3263
|
+
};
|
|
3264
|
+
|
|
3227
3265
|
const getMenuEntriesImage = (state, props) => {
|
|
3228
3266
|
return [{
|
|
3229
3267
|
args: [],
|
|
@@ -3387,8 +3425,8 @@ const handleClickCategory = async (state, categoryId) => {
|
|
|
3387
3425
|
return state;
|
|
3388
3426
|
};
|
|
3389
3427
|
|
|
3390
|
-
const disableExtension = id => {
|
|
3391
|
-
return
|
|
3428
|
+
const disableExtension = (id, platform) => {
|
|
3429
|
+
return invoke$4('Extensions.disable2', id, platform);
|
|
3392
3430
|
};
|
|
3393
3431
|
|
|
3394
3432
|
const Web = 1;
|
|
@@ -3430,20 +3468,23 @@ const getExtension = async (id, platform) => {
|
|
|
3430
3468
|
}
|
|
3431
3469
|
};
|
|
3432
3470
|
|
|
3471
|
+
const isEnabled$1 = button => {
|
|
3472
|
+
return button.enabled;
|
|
3473
|
+
};
|
|
3433
3474
|
const getExtensionDetailButtons = (hasColorTheme, isBuiltin, isDisabled) => {
|
|
3434
3475
|
const allActions = [{
|
|
3435
|
-
enabled: hasColorTheme,
|
|
3476
|
+
enabled: hasColorTheme && !isDisabled,
|
|
3436
3477
|
label: setColorTheme$2(),
|
|
3437
3478
|
name: SetColorTheme,
|
|
3438
3479
|
onClick: HandleClickSetColorTheme
|
|
3439
3480
|
}, {
|
|
3440
3481
|
enabled: isDisabled,
|
|
3441
|
-
label: enable
|
|
3482
|
+
label: enable(),
|
|
3442
3483
|
name: Enable,
|
|
3443
3484
|
onClick: HandleClickEnable
|
|
3444
3485
|
}, {
|
|
3445
3486
|
enabled: !isDisabled,
|
|
3446
|
-
label: disable
|
|
3487
|
+
label: disable(),
|
|
3447
3488
|
name: Disable,
|
|
3448
3489
|
onClick: HandleClickDisable
|
|
3449
3490
|
}, {
|
|
@@ -3452,7 +3493,7 @@ const getExtensionDetailButtons = (hasColorTheme, isBuiltin, isDisabled) => {
|
|
|
3452
3493
|
name: Uninstall,
|
|
3453
3494
|
onClick: HandleClickUninstall
|
|
3454
3495
|
}];
|
|
3455
|
-
const filteredButtons = allActions.filter(
|
|
3496
|
+
const filteredButtons = allActions.filter(isEnabled$1);
|
|
3456
3497
|
return filteredButtons;
|
|
3457
3498
|
};
|
|
3458
3499
|
|
|
@@ -3462,7 +3503,7 @@ const updateExtensionStatus = async (state, updateFunction) => {
|
|
|
3462
3503
|
hasColorTheme,
|
|
3463
3504
|
platform
|
|
3464
3505
|
} = state;
|
|
3465
|
-
const error = await updateFunction(extensionId);
|
|
3506
|
+
const error = await updateFunction(extensionId, platform);
|
|
3466
3507
|
if (error) {
|
|
3467
3508
|
await confirm(`${error}`);
|
|
3468
3509
|
}
|
|
@@ -3480,8 +3521,8 @@ const handleClickDisable = async state => {
|
|
|
3480
3521
|
return updateExtensionStatus(state, disableExtension);
|
|
3481
3522
|
};
|
|
3482
3523
|
|
|
3483
|
-
const enableExtension = id => {
|
|
3484
|
-
return
|
|
3524
|
+
const enableExtension = (id, platform) => {
|
|
3525
|
+
return invoke$4('Extensions.enable2', id, platform);
|
|
3485
3526
|
};
|
|
3486
3527
|
|
|
3487
3528
|
const handleClickEnable = async state => {
|
|
@@ -4098,13 +4139,10 @@ const getIssuesLink = extension => {
|
|
|
4098
4139
|
};
|
|
4099
4140
|
|
|
4100
4141
|
const getResources = (isBuiltin, extension) => {
|
|
4101
|
-
if (isBuiltin) {
|
|
4102
|
-
return [];
|
|
4103
|
-
}
|
|
4104
4142
|
const repositoryLink = getRepositoryLink(extension);
|
|
4105
4143
|
const issueLink = getIssuesLink(extension);
|
|
4106
4144
|
const licenseLink = getLicenseLink();
|
|
4107
|
-
// TODO
|
|
4145
|
+
// TODO hide marketplace link for builtin extensions
|
|
4108
4146
|
return [{
|
|
4109
4147
|
icon: 'LinkExternal',
|
|
4110
4148
|
label: marketplace(),
|
|
@@ -4390,6 +4428,17 @@ const handleSelectionChange = async (state, selection) => {
|
|
|
4390
4428
|
return state;
|
|
4391
4429
|
};
|
|
4392
4430
|
|
|
4431
|
+
const focusId = 451;
|
|
4432
|
+
const handleTabFocus = (state, name) => {
|
|
4433
|
+
const tabIndex = state.tabs.findIndex(tab => tab.name === name);
|
|
4434
|
+
const newFocusedTabIndex = tabIndex === -1 ? state.focusedTabIndex : tabIndex;
|
|
4435
|
+
return {
|
|
4436
|
+
...state,
|
|
4437
|
+
focus: focusId,
|
|
4438
|
+
focusedTabIndex: newFocusedTabIndex
|
|
4439
|
+
};
|
|
4440
|
+
};
|
|
4441
|
+
|
|
4393
4442
|
const error = async error => {
|
|
4394
4443
|
// TODO send message to error worker or log worker
|
|
4395
4444
|
// @ts-ignore
|
|
@@ -4874,17 +4923,19 @@ const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, ent
|
|
|
4874
4923
|
if (!showAdditionalDetails) {
|
|
4875
4924
|
return [];
|
|
4876
4925
|
}
|
|
4926
|
+
const sections = [...getAdditionalDetailsEntryVirtualDom(firstHeading, entries, getMoreInfoVirtualDom), ...(secondEntries.length > 0 ? getAdditionalDetailsEntryVirtualDom(secondHeading, secondEntries, getMoreInfoVirtualDom) : []), ...getAdditionalDetailsEntryVirtualDom(thirdHeading, categories, getCategoriesDom), ...getAdditionalDetailsEntryVirtualDom(fourthHeading, resources, getResourcesVirtualDom)];
|
|
4927
|
+
const childCount = secondEntries.length > 0 ? 4 : 3;
|
|
4877
4928
|
return [{
|
|
4878
4929
|
childCount: 1,
|
|
4879
4930
|
className: Aside,
|
|
4880
4931
|
type: Aside$1
|
|
4881
4932
|
}, {
|
|
4882
|
-
childCount:
|
|
4933
|
+
childCount: childCount,
|
|
4883
4934
|
className: AdditionalDetails,
|
|
4884
4935
|
onContextMenu: HandleAdditionalDetailContextMenu,
|
|
4885
4936
|
tabIndex: 0,
|
|
4886
4937
|
type: Div
|
|
4887
|
-
}, ...
|
|
4938
|
+
}, ...sections];
|
|
4888
4939
|
};
|
|
4889
4940
|
|
|
4890
4941
|
const getNoReadmeVirtualDom = () => {
|
|
@@ -5085,7 +5136,7 @@ const getTabClassName = isSelected => {
|
|
|
5085
5136
|
return isSelected ? selectedClassName : defaultClassName;
|
|
5086
5137
|
};
|
|
5087
5138
|
|
|
5088
|
-
const getTabVirtualDom = tab => {
|
|
5139
|
+
const getTabVirtualDom = (tab, tabIndex, focusedTabIndex) => {
|
|
5089
5140
|
const {
|
|
5090
5141
|
label,
|
|
5091
5142
|
name,
|
|
@@ -5093,26 +5144,27 @@ const getTabVirtualDom = tab => {
|
|
|
5093
5144
|
} = tab;
|
|
5094
5145
|
const className = getTabClassName(selected);
|
|
5095
5146
|
const ariaSelected = selected;
|
|
5147
|
+
const tabIndexValue = tabIndex === focusedTabIndex ? 0 : -1;
|
|
5096
5148
|
return [{
|
|
5097
5149
|
ariaSelected,
|
|
5098
5150
|
childCount: 1,
|
|
5099
5151
|
className,
|
|
5100
5152
|
name,
|
|
5153
|
+
onFocus: HandleTabFocus,
|
|
5101
5154
|
role: Tab,
|
|
5102
|
-
tabIndex:
|
|
5155
|
+
tabIndex: tabIndexValue,
|
|
5103
5156
|
type: Button$1
|
|
5104
5157
|
}, text(label)];
|
|
5105
5158
|
};
|
|
5106
5159
|
|
|
5107
|
-
const getTabsVirtualDom = tabs => {
|
|
5160
|
+
const getTabsVirtualDom = (tabs, focusedTabIndex) => {
|
|
5108
5161
|
return [{
|
|
5109
5162
|
childCount: tabs.length,
|
|
5110
5163
|
className: ExtensionDetailTabs,
|
|
5111
5164
|
onClick: HandleTabsClick,
|
|
5112
5165
|
role: TabList,
|
|
5113
|
-
tabIndex: 0,
|
|
5114
5166
|
type: Div
|
|
5115
|
-
}, ...tabs.flatMap(getTabVirtualDom)];
|
|
5167
|
+
}, ...tabs.flatMap((tab, index) => getTabVirtualDom(tab, index, focusedTabIndex))];
|
|
5116
5168
|
};
|
|
5117
5169
|
|
|
5118
5170
|
const getClassNames = size => {
|
|
@@ -5141,6 +5193,7 @@ const getExtensionDetailVirtualDom = (newState, selectedTab) => {
|
|
|
5141
5193
|
changelogVirtualDom,
|
|
5142
5194
|
description,
|
|
5143
5195
|
detailsVirtualDom,
|
|
5196
|
+
focusedTabIndex,
|
|
5144
5197
|
iconSrc,
|
|
5145
5198
|
name,
|
|
5146
5199
|
resources,
|
|
@@ -5156,7 +5209,7 @@ const getExtensionDetailVirtualDom = (newState, selectedTab) => {
|
|
|
5156
5209
|
childCount: 3,
|
|
5157
5210
|
className: mergeClassNames(Viewlet, ExtensionDetail, sizeClass),
|
|
5158
5211
|
type: Div
|
|
5159
|
-
}, ...getExtensionDetailHeaderVirtualDom(name, iconSrc, description, badge, buttons, settingsButtonEnabled), ...getTabsVirtualDom(tabs), ...getExtensionDetailContentVirtualDom(detailsVirtualDom, selectedTab, width, scrollToTopButtonEnabled, categories, resources, showAdditionalDetailsBreakpoint, changelogVirtualDom, newState)];
|
|
5212
|
+
}, ...getExtensionDetailHeaderVirtualDom(name, iconSrc, description, badge, buttons, settingsButtonEnabled), ...getTabsVirtualDom(tabs, focusedTabIndex), ...getExtensionDetailContentVirtualDom(detailsVirtualDom, selectedTab, width, scrollToTopButtonEnabled, categories, resources, showAdditionalDetailsBreakpoint, changelogVirtualDom, newState)];
|
|
5160
5213
|
return dom;
|
|
5161
5214
|
};
|
|
5162
5215
|
|
|
@@ -5166,7 +5219,31 @@ const renderDom = (oldState, newState) => {
|
|
|
5166
5219
|
};
|
|
5167
5220
|
|
|
5168
5221
|
const renderFocus = (oldState, newState) => {
|
|
5169
|
-
|
|
5222
|
+
const {
|
|
5223
|
+
focus,
|
|
5224
|
+
focusedTabIndex,
|
|
5225
|
+
tabs,
|
|
5226
|
+
uid
|
|
5227
|
+
} = newState;
|
|
5228
|
+
if (focus === 451) {
|
|
5229
|
+
const {
|
|
5230
|
+
name
|
|
5231
|
+
} = tabs[focusedTabIndex];
|
|
5232
|
+
return [FocusElementByName, uid, name];
|
|
5233
|
+
}
|
|
5234
|
+
return [FocusElementByName, ''];
|
|
5235
|
+
};
|
|
5236
|
+
|
|
5237
|
+
const renderFocusContext = (oldState, newState) => {
|
|
5238
|
+
const {
|
|
5239
|
+
focus,
|
|
5240
|
+
uid
|
|
5241
|
+
} = newState;
|
|
5242
|
+
if (focus === 451) {
|
|
5243
|
+
return [SetFocusContext, uid, focus];
|
|
5244
|
+
}
|
|
5245
|
+
// TODO set focus context
|
|
5246
|
+
return [FocusElementByName, ''];
|
|
5170
5247
|
};
|
|
5171
5248
|
|
|
5172
5249
|
const getScrollTop = (selectedTab, readmeScrollTop, changelogScrollTop) => {
|
|
@@ -5200,6 +5277,8 @@ const getRenderer = diffType => {
|
|
|
5200
5277
|
return renderCss;
|
|
5201
5278
|
case RenderFocus:
|
|
5202
5279
|
return renderFocus;
|
|
5280
|
+
case RenderFocusContext:
|
|
5281
|
+
return renderFocusContext;
|
|
5203
5282
|
case RenderItems:
|
|
5204
5283
|
return renderDom;
|
|
5205
5284
|
case RenderScrollTop:
|
|
@@ -5288,6 +5367,9 @@ const renderEventListeners = () => {
|
|
|
5288
5367
|
}, {
|
|
5289
5368
|
name: HandleSelectionChange,
|
|
5290
5369
|
params: ['handleSelectionChange']
|
|
5370
|
+
}, {
|
|
5371
|
+
name: HandleTabFocus,
|
|
5372
|
+
params: ['handleTabFocus', TargetName]
|
|
5291
5373
|
}];
|
|
5292
5374
|
};
|
|
5293
5375
|
|
|
@@ -5328,7 +5410,10 @@ const commandMap = {
|
|
|
5328
5410
|
'ExtensionDetail.diff2': diff2,
|
|
5329
5411
|
'ExtensionDetail.dispose': dispose,
|
|
5330
5412
|
'ExtensionDetail.executeCopy': wrapCommand(executeCopy),
|
|
5413
|
+
'ExtensionDetail.focusNextTab': wrapCommand(focusNextTab),
|
|
5414
|
+
'ExtensionDetail.focusPreviousTab': wrapCommand(focusPreviousTab),
|
|
5331
5415
|
'ExtensionDetail.getCommandIds': getCommandIds,
|
|
5416
|
+
'ExtensionDetail.getKeyBindings': getKeyBindings,
|
|
5332
5417
|
'ExtensionDetail.getMenuEntries': getMenuEntries,
|
|
5333
5418
|
'ExtensionDetail.getMenuEntries2': wrapGetter(getMenuEntries2),
|
|
5334
5419
|
'ExtensionDetail.getMenuIds': getMenuIds,
|
|
@@ -5351,6 +5436,7 @@ const commandMap = {
|
|
|
5351
5436
|
'ExtensionDetail.handleReadmeContextMenu': wrapCommand(handleReadmeContextMenu),
|
|
5352
5437
|
'ExtensionDetail.handleScroll': wrapCommand(handleScroll),
|
|
5353
5438
|
'ExtensionDetail.handleSelectionChange': wrapCommand(handleSelectionChange),
|
|
5439
|
+
'ExtensionDetail.handleTabFocus': wrapCommand(handleTabFocus),
|
|
5354
5440
|
'ExtensionDetail.handleTabsClick': wrapCommand(handleTabsClick),
|
|
5355
5441
|
'ExtensionDetail.handleWheel': wrapCommand(handleScroll),
|
|
5356
5442
|
// deprecated
|
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
|
}
|