@lvce-editor/activity-bar-worker 3.3.0 → 4.0.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.
@@ -1661,6 +1661,13 @@ const handleContextMenu = async (state, button, eventX, eventY) => {
1661
1661
  return state;
1662
1662
  };
1663
1663
 
1664
+ const handleFocus = state => {
1665
+ return {
1666
+ ...state,
1667
+ focused: true
1668
+ };
1669
+ };
1670
+
1664
1671
  const Account = 'Account';
1665
1672
  const DebugAlt2 = 'DebugAlt2';
1666
1673
  const Extensions$1 = 'Extensions';
@@ -1904,13 +1911,25 @@ const getActiveView = async () => {
1904
1911
  }
1905
1912
  };
1906
1913
 
1914
+ const getSideBarVisible = async () => {
1915
+ try {
1916
+ const visible = await invoke('Layout.getSideBarVisible');
1917
+ return visible;
1918
+ } catch {
1919
+ return true;
1920
+ }
1921
+ };
1922
+
1907
1923
  const loadContent = async state => {
1908
1924
  const {
1909
1925
  height,
1910
1926
  itemHeight
1911
1927
  } = state;
1912
1928
  const items = getActivityBarItems(state);
1929
+ // TODO parallelize async calls
1930
+ // or add one function that returns all needed data
1913
1931
  const activeView = await getActiveView();
1932
+ const sideBarVisible = await getSideBarVisible();
1914
1933
  const index = items.findIndex(item => item.id === activeView);
1915
1934
  const itemsWithSelected = markSelected(items, index);
1916
1935
  const filteredItems = getFilteredActivityBarItems(itemsWithSelected, height, itemHeight);
@@ -1924,7 +1943,7 @@ const loadContent = async state => {
1924
1943
  initial: false,
1925
1944
  selectedIndex: index,
1926
1945
  sideBarLocation: sidebarLocation,
1927
- sideBarVisible: true
1946
+ sideBarVisible
1928
1947
  };
1929
1948
  };
1930
1949
 
@@ -2601,6 +2620,7 @@ const commandMap = {
2601
2620
  'ActivityBar.handleClick': wrapCommand(handleClick),
2602
2621
  'ActivityBar.handleClickIndex': wrapCommand(handleClickIndex),
2603
2622
  'ActivityBar.handleContextMenu': wrapCommand(handleContextMenu),
2623
+ 'ActivityBar.handleFocus': wrapCommand(handleFocus),
2604
2624
  'ActivityBar.handleSettingsChanged': wrapCommand(handleSettingsChanged),
2605
2625
  'ActivityBar.handleSideBarHidden': wrapCommand(handleSideBarHidden),
2606
2626
  'ActivityBar.handleSideBarViewletChange': wrapCommand(handleSideBarViewletChange),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "3.3.0",
3
+ "version": "4.0.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",