@lvce-editor/activity-bar-worker 7.27.3 → 7.27.4

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.
@@ -1404,7 +1404,7 @@ const toContextMenuItem$1 = activityBarItem => {
1404
1404
  };
1405
1405
  };
1406
1406
 
1407
- const getMenuEntriesActivityBar = state => {
1407
+ const getMenuEntriesActivityBar = (state, targetViewletId = '') => {
1408
1408
  const {
1409
1409
  activityBarItems,
1410
1410
  sideBarLocation
@@ -1412,10 +1412,21 @@ const getMenuEntriesActivityBar = state => {
1412
1412
  const topItems = activityBarItems.filter(item => !(item.flags & Button));
1413
1413
  const bottomItems = activityBarItems.filter(item => item.flags & Button);
1414
1414
  const entries = topItems.map(toContextMenuItem$1);
1415
+ const targetItem = activityBarItems.find(item => item.id === targetViewletId);
1415
1416
  if (bottomItems.length > 0) {
1416
1417
  entries.push(menuEntrySeparator, ...bottomItems.map(toContextMenuItem$1));
1417
1418
  }
1418
- return [...entries, menuEntrySeparator, menuEntryMoveSideBar(sideBarLocation), {
1419
+ return [...entries, ...(isMovableActivityBarItem(targetItem) ? [{
1420
+ args: [{
1421
+ action: 'moveTo',
1422
+ menuId: ActivityBarAdditionalViews,
1423
+ viewletId: targetViewletId
1424
+ }],
1425
+ command: '',
1426
+ flags: SubMenu,
1427
+ id: 'moveTo',
1428
+ label: 'Move To'
1429
+ }] : []), menuEntrySeparator, menuEntryMoveSideBar(sideBarLocation), {
1419
1430
  command: 'Layout.hideActivityBar',
1420
1431
  flags: None,
1421
1432
  id: 'hideActivityBar',
@@ -2703,7 +2714,16 @@ const toContextMenuItem = activityBarItem => {
2703
2714
  label: activityBarItem.title
2704
2715
  };
2705
2716
  };
2706
- const getMenuEntriesAdditionalViews = state => {
2717
+ const getMenuEntriesAdditionalViews = (state, options) => {
2718
+ if (options && 'action' in options && options.action === 'moveTo' && 'viewletId' in options && options.viewletId) {
2719
+ return [{
2720
+ args: [options.viewletId],
2721
+ command: 'Layout.moveViewletToSecondarySideBar',
2722
+ flags: None,
2723
+ id: 'moveToSecondarySideBar',
2724
+ label: 'Secondary Side Bar'
2725
+ }];
2726
+ }
2707
2727
  const hiddenActivityBarItems = getHiddenItems(state);
2708
2728
  return hiddenActivityBarItems.map(toContextMenuItem);
2709
2729
  };
@@ -2756,9 +2776,9 @@ const getMenuEntries = (state, options) => {
2756
2776
  case ACCOUNT_SUBMENU_ID:
2757
2777
  return getMenuEntriesAccountSubMenu(state);
2758
2778
  case ActivityBar$3:
2759
- return getMenuEntriesActivityBar(state);
2779
+ return getMenuEntriesActivityBar(state, 'targetViewletId' in options ? options.targetViewletId : '');
2760
2780
  case ActivityBarAdditionalViews:
2761
- return getMenuEntriesAdditionalViews(state);
2781
+ return getMenuEntriesAdditionalViews(state, options);
2762
2782
  case Settings$1:
2763
2783
  return getMenuEntriesSettings(state);
2764
2784
  default:
@@ -3129,7 +3149,7 @@ const getSideBarPosition = async () => {
3129
3149
  }
3130
3150
  };
3131
3151
 
3132
- const handleContextMenu = async (context, button, eventX, eventY) => {
3152
+ const handleContextMenu = async (context, button, eventX, eventY, targetName = '') => {
3133
3153
  const sideBarLocation = await getSideBarPosition();
3134
3154
  const state = await context.updateState(state => {
3135
3155
  return {
@@ -3141,7 +3161,8 @@ const handleContextMenu = async (context, button, eventX, eventY) => {
3141
3161
  uid
3142
3162
  } = state;
3143
3163
  await show2(uid, ActivityBar$3, eventX, eventY, {
3144
- menuId: ActivityBar$3
3164
+ menuId: ActivityBar$3,
3165
+ targetViewletId: targetName
3145
3166
  });
3146
3167
  };
3147
3168
 
@@ -3969,7 +3990,7 @@ const renderEventListeners = () => {
3969
3990
  params: ['handleFocus']
3970
3991
  }, {
3971
3992
  name: HandleContextMenu,
3972
- params: ['handleContextMenu', Button$1, ClientX, ClientY],
3993
+ params: ['handleContextMenu', Button$1, ClientX, ClientY, TargetName],
3973
3994
  preventDefault: true
3974
3995
  }, {
3975
3996
  name: HandleMouseDown,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "7.27.3",
3
+ "version": "7.27.4",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",