@lvce-editor/activity-bar-worker 1.17.0 → 1.19.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.
|
@@ -1020,7 +1020,9 @@ const create = (id, uri, x, y, width, height, args, parentUid, platform = 0) =>
|
|
|
1020
1020
|
sideBarVisible: false,
|
|
1021
1021
|
activityBarItems: [],
|
|
1022
1022
|
selectedIndex: -1,
|
|
1023
|
-
itemHeight: 48
|
|
1023
|
+
itemHeight: 48,
|
|
1024
|
+
updateState: '',
|
|
1025
|
+
updateProgress: 0
|
|
1024
1026
|
};
|
|
1025
1027
|
set(id, state, state);
|
|
1026
1028
|
return state;
|
|
@@ -1038,7 +1040,7 @@ const isEqual$1 = (oldState, newState) => {
|
|
|
1038
1040
|
};
|
|
1039
1041
|
|
|
1040
1042
|
const isEqual = (oldState, newState) => {
|
|
1041
|
-
return oldState.focusedIndex === newState.focusedIndex && oldState.activityBarItems === newState.activityBarItems;
|
|
1043
|
+
return oldState.focusedIndex === newState.focusedIndex && oldState.activityBarItems === newState.activityBarItems && oldState.updateProgress === newState.updateProgress && oldState.updateState === newState.updateState;
|
|
1042
1044
|
};
|
|
1043
1045
|
|
|
1044
1046
|
const RenderItems = 4;
|
|
@@ -1294,6 +1296,31 @@ const handleSideBarViewletChange = (state, id, ...args) => {
|
|
|
1294
1296
|
};
|
|
1295
1297
|
};
|
|
1296
1298
|
|
|
1299
|
+
const getNewItems = (items, state) => {
|
|
1300
|
+
return items.map(item => {
|
|
1301
|
+
if (item.id === 'Settings' && state === 1) {
|
|
1302
|
+
return {
|
|
1303
|
+
...item,
|
|
1304
|
+
badgeIcon: 'clock',
|
|
1305
|
+
flags: item.flags | Progress
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
return item;
|
|
1309
|
+
});
|
|
1310
|
+
};
|
|
1311
|
+
const handleUpdateStateChange = async (state, config) => {
|
|
1312
|
+
const {
|
|
1313
|
+
activityBarItems
|
|
1314
|
+
} = state;
|
|
1315
|
+
const newItems = getNewItems(activityBarItems, config.state);
|
|
1316
|
+
return {
|
|
1317
|
+
...state,
|
|
1318
|
+
updateState: config.state,
|
|
1319
|
+
updateProgress: config.progress,
|
|
1320
|
+
activityBarItems: newItems
|
|
1321
|
+
};
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1297
1324
|
const emptyObject = {};
|
|
1298
1325
|
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
1299
1326
|
const i18nString = (key, placeholders = emptyObject) => {
|
|
@@ -1482,7 +1509,7 @@ const getAriaSelected = (isTab, isSelected) => {
|
|
|
1482
1509
|
}
|
|
1483
1510
|
return Boolean(isSelected);
|
|
1484
1511
|
};
|
|
1485
|
-
const
|
|
1512
|
+
const getActivityBarItemVirtualDom = item => {
|
|
1486
1513
|
const {
|
|
1487
1514
|
flags,
|
|
1488
1515
|
title,
|
|
@@ -1549,8 +1576,9 @@ const createActivityBarItem = item => {
|
|
|
1549
1576
|
childCount: 0
|
|
1550
1577
|
}];
|
|
1551
1578
|
};
|
|
1579
|
+
|
|
1552
1580
|
const getVirtualDom = visibleItems => {
|
|
1553
|
-
const dom = visibleItems.flatMap(
|
|
1581
|
+
const dom = visibleItems.flatMap(getActivityBarItemVirtualDom);
|
|
1554
1582
|
return dom;
|
|
1555
1583
|
};
|
|
1556
1584
|
|
|
@@ -1668,6 +1696,7 @@ const commandMap = {
|
|
|
1668
1696
|
'ActivityBar.focusFirst': wrapCommand(focusFirst),
|
|
1669
1697
|
'ActivityBar.focusIndex': wrapCommand(focusIndex),
|
|
1670
1698
|
'ActivityBar.focusLast': wrapCommand(focusLast),
|
|
1699
|
+
'ActivityBar.handleUpdateStateChange': wrapCommand(handleUpdateStateChange),
|
|
1671
1700
|
'ActivityBar.focusNext': wrapCommand(focusNext),
|
|
1672
1701
|
'ActivityBar.focusNone': wrapCommand(focusNone),
|
|
1673
1702
|
'ActivityBar.getCommandIds': getCommandIds,
|