@lvce-editor/activity-bar-worker 1.11.0 → 1.13.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.
@@ -842,6 +842,8 @@ const None = 'none';
842
842
  const Tab$1 = 'tab';
843
843
  const ToolBar = 'toolbar';
844
844
 
845
+ const Div = 4;
846
+
845
847
  const Button$1 = 'event.button';
846
848
  const ClientX = 'event.clientX';
847
849
  const ClientY = 'event.clientY';
@@ -1249,15 +1251,25 @@ const findIndex = (activityBarItems, id) => {
1249
1251
  return -1;
1250
1252
  };
1251
1253
 
1254
+ const getNewItems = (items, selectedIndex) => {
1255
+ return items.map(item => {
1256
+ return {
1257
+ ...item
1258
+ // TODO set selected property if it matches the selected index
1259
+ };
1260
+ });
1261
+ };
1252
1262
  const handleSideBarViewletChange = (state, id, ...args) => {
1253
1263
  const {
1254
1264
  activityBarItems
1255
1265
  } = state;
1256
1266
  const index = findIndex(activityBarItems, id);
1267
+ const newActivityBarItems = getNewItems(activityBarItems);
1257
1268
  return {
1258
1269
  ...state,
1259
1270
  selectedIndex: index,
1260
- currentViewletId: id
1271
+ currentViewletId: id,
1272
+ activityBarItems: newActivityBarItems
1261
1273
  };
1262
1274
  };
1263
1275
 
@@ -1418,10 +1430,10 @@ const Icon = 'Icon';
1418
1430
  const MarginTopAuto = 'MarginTopAuto';
1419
1431
  const Viewlet = 'Viewlet';
1420
1432
 
1421
- const HandleBlur = 'handleBlur';
1422
- const HandleContextMenu = 'handleContextMenu';
1423
- const HandleFocus = 'handleFocus';
1424
- const HandleMouseDown = 'handleMouseDown';
1433
+ const HandleBlur = 1;
1434
+ const HandleContextMenu = 2;
1435
+ const HandleFocus = 3;
1436
+ const HandleMouseDown = 4;
1425
1437
 
1426
1438
  const ActivityBar = 'ActivityBar';
1427
1439
 
@@ -1439,8 +1451,6 @@ const getClassName = (isFocused, marginTop, isSelected) => {
1439
1451
  return mergeClassNames(...classNames);
1440
1452
  };
1441
1453
 
1442
- const Div = 4;
1443
-
1444
1454
  const getIconVirtualDom = (icon, type = Div) => {
1445
1455
  return {
1446
1456
  type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",