@lvce-editor/activity-bar-worker 1.18.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.
|
@@ -1040,7 +1040,7 @@ const isEqual$1 = (oldState, newState) => {
|
|
|
1040
1040
|
};
|
|
1041
1041
|
|
|
1042
1042
|
const isEqual = (oldState, newState) => {
|
|
1043
|
-
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;
|
|
1044
1044
|
};
|
|
1045
1045
|
|
|
1046
1046
|
const RenderItems = 4;
|
|
@@ -1296,6 +1296,31 @@ const handleSideBarViewletChange = (state, id, ...args) => {
|
|
|
1296
1296
|
};
|
|
1297
1297
|
};
|
|
1298
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
|
+
|
|
1299
1324
|
const emptyObject = {};
|
|
1300
1325
|
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
1301
1326
|
const i18nString = (key, placeholders = emptyObject) => {
|
|
@@ -1484,7 +1509,7 @@ const getAriaSelected = (isTab, isSelected) => {
|
|
|
1484
1509
|
}
|
|
1485
1510
|
return Boolean(isSelected);
|
|
1486
1511
|
};
|
|
1487
|
-
const
|
|
1512
|
+
const getActivityBarItemVirtualDom = item => {
|
|
1488
1513
|
const {
|
|
1489
1514
|
flags,
|
|
1490
1515
|
title,
|
|
@@ -1551,8 +1576,9 @@ const createActivityBarItem = item => {
|
|
|
1551
1576
|
childCount: 0
|
|
1552
1577
|
}];
|
|
1553
1578
|
};
|
|
1579
|
+
|
|
1554
1580
|
const getVirtualDom = visibleItems => {
|
|
1555
|
-
const dom = visibleItems.flatMap(
|
|
1581
|
+
const dom = visibleItems.flatMap(getActivityBarItemVirtualDom);
|
|
1556
1582
|
return dom;
|
|
1557
1583
|
};
|
|
1558
1584
|
|
|
@@ -1670,6 +1696,7 @@ const commandMap = {
|
|
|
1670
1696
|
'ActivityBar.focusFirst': wrapCommand(focusFirst),
|
|
1671
1697
|
'ActivityBar.focusIndex': wrapCommand(focusIndex),
|
|
1672
1698
|
'ActivityBar.focusLast': wrapCommand(focusLast),
|
|
1699
|
+
'ActivityBar.handleUpdateStateChange': wrapCommand(handleUpdateStateChange),
|
|
1673
1700
|
'ActivityBar.focusNext': wrapCommand(focusNext),
|
|
1674
1701
|
'ActivityBar.focusNone': wrapCommand(focusNone),
|
|
1675
1702
|
'ActivityBar.getCommandIds': getCommandIds,
|