@lvce-editor/activity-bar-worker 7.14.2 → 7.15.1

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.
@@ -846,79 +846,6 @@ const getMenuEntriesActivityBar = state => {
846
846
  }];
847
847
  };
848
848
 
849
- const getNumberOfVisibleItems = state => {
850
- const {
851
- height,
852
- itemHeight
853
- } = state;
854
- const numberOfVisibleItemsTop = Math.floor(height / itemHeight);
855
- return numberOfVisibleItemsTop;
856
- };
857
- const getHiddenItems = state => {
858
- const {
859
- activityBarItems
860
- } = state;
861
- const numberOfVisibleItems = getNumberOfVisibleItems(state);
862
- const items = activityBarItems.filter(item => item.flags & Enabled);
863
- if (numberOfVisibleItems >= items.length) {
864
- return [];
865
- }
866
- return items.slice(numberOfVisibleItems - 2, -1);
867
- };
868
-
869
- const toContextMenuItem = activityBarItem => {
870
- return {
871
- command: '-1',
872
- // TODO
873
- flags: None,
874
- id: '8000',
875
- // TODO
876
- label: activityBarItem.title
877
- };
878
- };
879
- const getMenuEntriesAdditionalViews = state => {
880
- const hiddenActivityBarItems = getHiddenItems(state);
881
- return hiddenActivityBarItems.map(toContextMenuItem);
882
- };
883
-
884
- const keyBindingsUri = 'app://keybindings';
885
- const getMenuEntriesSettings = state => {
886
- const {
887
- platform
888
- } = state;
889
- const items = [{
890
- command: 'QuickPick.showEverything',
891
- flags: None,
892
- id: 'commandPalette',
893
- label: commandPalette()
894
- }, menuEntrySeparator, {
895
- command: 'Preferences.openSettingsJson',
896
- flags: None,
897
- id: 'settings',
898
- label: settings()
899
- }, {
900
- args: [keyBindingsUri],
901
- command: 'Main.openUri',
902
- flags: None,
903
- id: 'keyboardShortcuts',
904
- label: keyboardShortcuts()
905
- }, {
906
- command: 'QuickPick.showColorTheme',
907
- flags: None,
908
- id: 'colorTheme',
909
- label: colorTheme()
910
- }];
911
- if (platform === Electron) {
912
- items.push(menuEntrySeparator, {
913
- command: 'AutoUpdater.checkForUpdates',
914
- flags: None,
915
- id: 'checkForUpdates',
916
- label: checkForUpdates()
917
- });
918
- }
919
- return items;
920
- };
921
-
922
849
  const normalizeLine = line => {
923
850
  if (line.startsWith('Error: ')) {
924
851
  return line.slice('Error: '.length);
@@ -2129,6 +2056,89 @@ const handleClickAccount = async (state, eventX, eventY, viewletId) => {
2129
2056
  return state;
2130
2057
  };
2131
2058
 
2059
+ const getNumberOfVisibleItems = state => {
2060
+ const {
2061
+ height,
2062
+ itemHeight
2063
+ } = state;
2064
+ const numberOfVisibleItemsTop = Math.floor(height / itemHeight);
2065
+ return numberOfVisibleItemsTop;
2066
+ };
2067
+ const getHiddenItems = state => {
2068
+ const {
2069
+ activityBarItems
2070
+ } = state;
2071
+ const numberOfVisibleItems = getNumberOfVisibleItems(state);
2072
+ const items = activityBarItems.filter(item => item.flags & Enabled);
2073
+ if (numberOfVisibleItems >= items.length) {
2074
+ return [];
2075
+ }
2076
+ return items.slice(numberOfVisibleItems - 2, -1);
2077
+ };
2078
+
2079
+ const toContextMenuItem = activityBarItem => {
2080
+ if (activityBarItem.id === 'Account') {
2081
+ return {
2082
+ args: [{
2083
+ menuId: ACCOUNT_MENU_ID
2084
+ }],
2085
+ command: '',
2086
+ flags: SubMenu,
2087
+ id: ACCOUNT_MENU_ID,
2088
+ label: activityBarItem.title
2089
+ };
2090
+ }
2091
+ return {
2092
+ args: [activityBarItem.id],
2093
+ command: 'ActivityBar.handleClickOther',
2094
+ flags: None,
2095
+ id: `open-${activityBarItem.id}`,
2096
+ label: activityBarItem.title
2097
+ };
2098
+ };
2099
+ const getMenuEntriesAdditionalViews = state => {
2100
+ const hiddenActivityBarItems = getHiddenItems(state);
2101
+ return hiddenActivityBarItems.map(toContextMenuItem);
2102
+ };
2103
+
2104
+ const keyBindingsUri = 'app://keybindings';
2105
+ const getMenuEntriesSettings = state => {
2106
+ const {
2107
+ platform
2108
+ } = state;
2109
+ const items = [{
2110
+ command: 'QuickPick.showEverything',
2111
+ flags: None,
2112
+ id: 'commandPalette',
2113
+ label: commandPalette()
2114
+ }, menuEntrySeparator, {
2115
+ command: 'Preferences.openSettingsJson',
2116
+ flags: None,
2117
+ id: 'settings',
2118
+ label: settings()
2119
+ }, {
2120
+ args: [keyBindingsUri],
2121
+ command: 'Main.openUri',
2122
+ flags: None,
2123
+ id: 'keyboardShortcuts',
2124
+ label: keyboardShortcuts()
2125
+ }, {
2126
+ command: 'QuickPick.showColorTheme',
2127
+ flags: None,
2128
+ id: 'colorTheme',
2129
+ label: colorTheme()
2130
+ }];
2131
+ if (platform === Electron) {
2132
+ items.push(menuEntrySeparator, {
2133
+ command: 'AutoUpdater.checkForUpdates',
2134
+ flags: None,
2135
+ id: 'checkForUpdates',
2136
+ label: checkForUpdates()
2137
+ });
2138
+ }
2139
+ return items;
2140
+ };
2141
+
2132
2142
  const getMenuEntries = (state, options) => {
2133
2143
  const {
2134
2144
  menuId
@@ -2275,10 +2285,12 @@ const getIndexFromPosition = (y, _eventX, eventY, itemHeight, items, height) =>
2275
2285
 
2276
2286
  const handleClickAdditionalViews = async (state, eventX, eventY, viewletId) => {
2277
2287
  const {
2288
+ sideBarLocation,
2278
2289
  uid
2279
2290
  } = state;
2280
2291
  await show2(uid, ActivityBarAdditionalViews, eventX, eventY, {
2281
2292
  menuId: ActivityBarAdditionalViews,
2293
+ openSubMenuToLeft: sideBarLocation === Right,
2282
2294
  viewletId
2283
2295
  });
2284
2296
  return state;
@@ -3693,6 +3705,7 @@ const commandMap = {
3693
3705
  'ActivityBar.handleClickAccount': wrapCommand(handleClickAccount),
3694
3706
  'ActivityBar.handleClickAdditionalViews': wrapCommand(handleClickAdditionalViews),
3695
3707
  'ActivityBar.handleClickIndex': wrapCommand(handleClickIndex),
3708
+ 'ActivityBar.handleClickOther': wrapCommand(handleClickOther),
3696
3709
  'ActivityBar.handleClickSettings': wrapCommand(handleClickSettings),
3697
3710
  'ActivityBar.handleClickSignIn': wrapCommand(handleClickSignIn),
3698
3711
  'ActivityBar.handleClickSignOut': wrapCommand(handleClickSignOut),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "7.14.2",
3
+ "version": "7.15.1",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",