@lvce-editor/activity-bar-worker 7.14.0 → 7.14.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.
@@ -724,6 +724,7 @@ const Search$2 = 'Search';
724
724
  const SourceControl$2 = 'Source Control';
725
725
  const RunAndDebug$1 = 'Run and Debug';
726
726
  const Extensions$2 = 'Extensions';
727
+ const References$2 = 'References';
727
728
  const Settings = 'Settings';
728
729
  const AdditionalViews = 'Additional Views';
729
730
  const ActivityBar$2 = 'Activity Bar';
@@ -753,6 +754,9 @@ const runAndDebug = () => {
753
754
  const extensions = () => {
754
755
  return i18nString(Extensions$2);
755
756
  };
757
+ const references = () => {
758
+ return i18nString(References$2);
759
+ };
756
760
  const settings = () => {
757
761
  return i18nString(Settings);
758
762
  };
@@ -2293,6 +2297,7 @@ const Account = 'Account';
2293
2297
  const DebugAlt2 = 'DebugAlt2';
2294
2298
  const Extensions$1 = 'Extensions';
2295
2299
  const Files = 'Files';
2300
+ const References$1 = 'References';
2296
2301
  const Search$1 = 'Search';
2297
2302
  const SettingsGear = 'SettingsGear';
2298
2303
  const SourceControl$1 = 'SourceControl';
@@ -2497,6 +2502,7 @@ const isCustomIconUrl = icon => {
2497
2502
 
2498
2503
  const Explorer = 'Explorer';
2499
2504
  const Extensions = 'Extensions';
2505
+ const References = 'References';
2500
2506
  const RunAndDebug = 'Run And Debug';
2501
2507
  const Search = 'Search';
2502
2508
  const SourceControl = 'Source Control';
@@ -2523,8 +2529,10 @@ const toActivityBarItem = view => {
2523
2529
  };
2524
2530
  const getActivityBarItems = (state, contributedViews = []) => {
2525
2531
  const {
2526
- accountEnabled
2532
+ accountEnabled,
2533
+ activityBarItems
2527
2534
  } = state;
2535
+ const referencesEnabled = activityBarItems.some(item => item.id === References && Boolean(item.flags & Enabled));
2528
2536
  const settingsFlags = Button | Enabled | (accountEnabled ? 0 : MarginTop);
2529
2537
  const items = [
2530
2538
  // Top
@@ -2558,6 +2566,12 @@ const getActivityBarItems = (state, contributedViews = []) => {
2558
2566
  id: Extensions,
2559
2567
  keyShortcuts: 'Control+Shift+X',
2560
2568
  title: extensions()
2569
+ }, {
2570
+ flags: Tab | (referencesEnabled ? Enabled : 0),
2571
+ icon: References$1,
2572
+ id: References,
2573
+ keyShortcuts: '',
2574
+ title: references()
2561
2575
  }, ...contributedViews.map(toActivityBarItem)
2562
2576
  // Bottom
2563
2577
  ];
@@ -2710,6 +2724,12 @@ const clearItem = item => {
2710
2724
  const withoutSelected = setFlag(item, Selected, false);
2711
2725
  return setFlag(withoutSelected, Focused, false);
2712
2726
  };
2727
+ const enableReferencesItem = (items, id) => {
2728
+ if (id !== References) {
2729
+ return items;
2730
+ }
2731
+ return items.map(item => item.id === id ? setFlag(item, Enabled, true) : item);
2732
+ };
2713
2733
  const handleSideBarStateChange = async (state, id, sideBarVisibleOverride) => {
2714
2734
  const {
2715
2735
  activityBarItems,
@@ -2731,8 +2751,9 @@ const handleSideBarStateChange = async (state, id, sideBarVisibleOverride) => {
2731
2751
  sideBarVisible: false
2732
2752
  };
2733
2753
  }
2734
- const selectedIndex = findIndex(activityBarItems, resolvedId);
2735
- const newActivityBarItems = markSelected(activityBarItems, selectedIndex);
2754
+ const enabledItems = enableReferencesItem(activityBarItems, resolvedId);
2755
+ const selectedIndex = findIndex(enabledItems, resolvedId);
2756
+ const newActivityBarItems = markSelected(enabledItems, selectedIndex);
2736
2757
  const filteredItems = getFilteredActivityBarItems(newActivityBarItems, height, itemHeight);
2737
2758
  return {
2738
2759
  ...state,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "7.14.0",
3
+ "version": "7.14.1",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",