@lvce-editor/status-bar-worker 3.30.1 → 3.30.2

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.
@@ -1906,6 +1906,12 @@ const applyUpdate = update => {
1906
1906
  return editorStatus;
1907
1907
  };
1908
1908
 
1909
+ let visible = true;
1910
+ const isVisible = () => visible;
1911
+ const setVisible = value => {
1912
+ visible = value;
1913
+ };
1914
+
1909
1915
  const textItem = (name, text, ariaLabel, tooltip) => ({
1910
1916
  ariaLabel,
1911
1917
  command: '',
@@ -2078,7 +2084,48 @@ const handleEditorStatusChangedAll = async update => {
2078
2084
  newState,
2079
2085
  oldState
2080
2086
  } = get$5(uid);
2081
- const newerState = handleEditorStatusChanged(newState, editorStatus, previous);
2087
+ const newerState = isVisible() ? handleEditorStatusChanged(newState, editorStatus, previous) : {
2088
+ ...newState,
2089
+ editorStatus
2090
+ };
2091
+ if (newState === newerState || oldState === newerState) {
2092
+ continue;
2093
+ }
2094
+ set$6(uid, oldState, newerState);
2095
+ changedUids.push(uid);
2096
+ }
2097
+ await Promise.all(changedUids.map(renderOutOfBand));
2098
+ };
2099
+
2100
+ const handleEditorStatusVisibilityChanged = (state, visible) => {
2101
+ const {
2102
+ statusBarItemsRight
2103
+ } = state;
2104
+ setVisible(visible);
2105
+ if (!visible) {
2106
+ const editorItems = statusBarItemsRight.filter(item => isEditorStatus(item.name));
2107
+ if (editorItems.length === 0) {
2108
+ return state;
2109
+ }
2110
+ return {
2111
+ ...state,
2112
+ statusBarItemsRight: statusBarItemsRight.filter(item => !isEditorStatus(item.name))
2113
+ };
2114
+ }
2115
+ return handleEditorStatusChanged(state, get$2(), {
2116
+ editorStatus: undefined
2117
+ });
2118
+ };
2119
+
2120
+ const handleEditorStatusVisibilityChangedAll = async visible => {
2121
+ setVisible(visible);
2122
+ const changedUids = [];
2123
+ for (const uid of getKeys()) {
2124
+ const {
2125
+ newState,
2126
+ oldState
2127
+ } = get$5(uid);
2128
+ const newerState = handleEditorStatusVisibilityChanged(newState, visible);
2082
2129
  if (newState === newerState || oldState === newerState) {
2083
2130
  continue;
2084
2131
  }
@@ -2384,6 +2431,7 @@ const handleMessagePort = async (port, viewletCommandMap, setAsRendererProcess =
2384
2431
  const rpc = await create$2({
2385
2432
  commandMap: {
2386
2433
  'StatusBar.handleEditorStatusChanged': handleEditorStatusChangedAll,
2434
+ 'StatusBar.handleEditorStatusVisibilityChanged': handleEditorStatusVisibilityChangedAll,
2387
2435
  'StatusBar.supportsEditorStatusDeltas': supportsEditorStatusDeltas,
2388
2436
  'Viewlet.executeViewletCommand': executeViewletCommand
2389
2437
  },
@@ -2520,7 +2568,14 @@ const loadContent = async state => {
2520
2568
  statusBarItemsRight: statusBarItems.filter(item => isRight(item.name)),
2521
2569
  warningCount: 0
2522
2570
  };
2523
- const currentState = itemsVisible ? handleEditorStatusChanged(loadedState, get$2()) : loadedState;
2571
+ let currentState = loadedState;
2572
+ if (itemsVisible) {
2573
+ if (isVisible()) {
2574
+ currentState = handleEditorStatusChanged(loadedState, get$2());
2575
+ } else {
2576
+ currentState = handleEditorStatusVisibilityChanged(loadedState, false);
2577
+ }
2578
+ }
2524
2579
  const latestNotificationCount = get$1();
2525
2580
  if (latestNotificationCount === undefined) {
2526
2581
  return currentState;
@@ -2610,6 +2665,7 @@ const commandMap = {
2610
2665
  'StatusBar.handleClick': wrapCommand(handleClick),
2611
2666
  'StatusBar.handleContextMenu': wrapCommand(handleContextMenu),
2612
2667
  'StatusBar.handleEditorStatusChanged': handleEditorStatusChangedAll,
2668
+ 'StatusBar.handleEditorStatusVisibilityChanged': handleEditorStatusVisibilityChangedAll,
2613
2669
  'StatusBar.handleExtensionManagementMessagePort': handleExtensionManagementMessagePort,
2614
2670
  'StatusBar.handleExtensionsChanged': refreshExtensionItems,
2615
2671
  'StatusBar.handleItemsChanged': refreshExtensionItems,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/status-bar-worker",
3
- "version": "3.30.1",
3
+ "version": "3.30.2",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",