@lvce-editor/status-bar-worker 3.31.4 → 3.32.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.
@@ -265,7 +265,7 @@ const {
265
265
  getCommandIds,
266
266
  getKeys,
267
267
  registerCommands,
268
- set: set$7,
268
+ set: set$8,
269
269
  wrapCommand,
270
270
  wrapGetter,
271
271
  wrapSerialAsyncCommand} = create$a();
@@ -281,7 +281,7 @@ const create$9 = (uid, uri, x, y, width, height, platform, assetDir) => {
281
281
  uid,
282
282
  warningCount: 0
283
283
  };
284
- set$7(uid, state, state);
284
+ set$8(uid, state, state);
285
285
  };
286
286
 
287
287
  const isEqual = (oldState, newState) => {
@@ -641,30 +641,30 @@ const getMatchingItem = (itemsLeft, itemsRight, name) => {
641
641
  return getMatchingItemInternal(itemsLeft, name) ?? getMatchingItemInternal(itemsRight, name);
642
642
  };
643
643
 
644
- const EditorEncoding = 'EditorEncoding';
645
- const EditorEndOfLine = 'EditorEndOfLine';
644
+ const EditorEncoding$1 = 'EditorEncoding';
645
+ const EditorEndOfLine$1 = 'EditorEndOfLine';
646
646
  const EditorIndentation = 'EditorIndentation';
647
- const EditorLanguage = 'EditorLanguage';
648
- const EditorPosition = 'EditorPosition';
649
- const Notifications = 'Notifications';
650
- const Problems = 'Problems';
647
+ const EditorLanguage$1 = 'EditorLanguage';
648
+ const EditorPosition$1 = 'EditorPosition';
649
+ const Notifications$1 = 'Notifications';
650
+ const Problems$1 = 'Problems';
651
651
  const isEditorStatus = name => {
652
- return [EditorEncoding, EditorEndOfLine, EditorIndentation, EditorLanguage, EditorPosition].includes(name);
652
+ return [EditorEncoding$1, EditorEndOfLine$1, EditorIndentation, EditorLanguage$1, EditorPosition$1].includes(name);
653
653
  };
654
654
  const isRight = name => {
655
- return name === Notifications || isEditorStatus(name);
655
+ return name === Notifications$1 || isEditorStatus(name);
656
656
  };
657
657
 
658
- const state$1 = {
658
+ const state$2 = {
659
659
  rpc: undefined
660
660
  };
661
- const set$6 = rpc => {
662
- state$1.rpc = rpc;
661
+ const set$7 = rpc => {
662
+ state$2.rpc = rpc;
663
663
  };
664
- const invoke$4 = (method, ...args) => {
664
+ const invoke$5 = (method, ...args) => {
665
665
  const {
666
666
  rpc
667
- } = state$1;
667
+ } = state$2;
668
668
  return rpc.invoke(method, ...args);
669
669
  };
670
670
 
@@ -673,17 +673,17 @@ const handleClickEditorStatus = async (name, status) => {
673
673
  return;
674
674
  }
675
675
  switch (name) {
676
- case EditorEndOfLine:
677
- await invoke$4('QuickPick.openStatusBarPicker', 'end-of-line');
676
+ case EditorEndOfLine$1:
677
+ await invoke$5('QuickPick.openStatusBarPicker', 'end-of-line');
678
678
  return;
679
679
  case EditorIndentation:
680
- await invoke$4('QuickPick.openStatusBarPicker', 'indentation');
680
+ await invoke$5('QuickPick.openStatusBarPicker', 'indentation');
681
681
  return;
682
- case EditorLanguage:
683
- await invoke$4('QuickPick.openStatusBarPicker', 'language-mode');
682
+ case EditorLanguage$1:
683
+ await invoke$5('QuickPick.openStatusBarPicker', 'language-mode');
684
684
  return;
685
- case EditorPosition:
686
- await invoke$4('QuickPick.openStatusBarPicker', 'go-to-line', status.line, status.column);
685
+ case EditorPosition$1:
686
+ await invoke$5('QuickPick.openStatusBarPicker', 'go-to-line', status.line, status.column);
687
687
  return;
688
688
  }
689
689
  };
@@ -744,49 +744,6 @@ class VError extends Error {
744
744
  }
745
745
  }
746
746
 
747
- class AssertionError extends Error {
748
- constructor(message) {
749
- super(message);
750
- this.name = 'AssertionError';
751
- }
752
- }
753
- const Object$1 = 1;
754
- const Number$1 = 2;
755
- const Array$1 = 3;
756
- const String$1 = 4;
757
- const Boolean$1 = 5;
758
- const Function = 6;
759
- const Null = 7;
760
- const Unknown = 8;
761
- const getType = value => {
762
- switch (typeof value) {
763
- case 'number':
764
- return Number$1;
765
- case 'function':
766
- return Function;
767
- case 'string':
768
- return String$1;
769
- case 'object':
770
- if (value === null) {
771
- return Null;
772
- }
773
- if (Array.isArray(value)) {
774
- return Array$1;
775
- }
776
- return Object$1;
777
- case 'boolean':
778
- return Boolean$1;
779
- default:
780
- return Unknown;
781
- }
782
- };
783
- const number = value => {
784
- const type = getType(value);
785
- if (type !== Number$1) {
786
- throw new AssertionError('expected value to be of type number');
787
- }
788
- };
789
-
790
747
  const isMessagePort = value => {
791
748
  return value && value instanceof MessagePort;
792
749
  };
@@ -1843,7 +1800,7 @@ const createMockRpc = ({
1843
1800
  };
1844
1801
 
1845
1802
  const rpcs = Object.create(null);
1846
- const set$5 = (id, rpc) => {
1803
+ const set$6 = (id, rpc) => {
1847
1804
  rpcs[id] = rpc;
1848
1805
  };
1849
1806
  const get$3 = id => {
@@ -1876,7 +1833,7 @@ const create = rpcId => {
1876
1833
  const mockRpc = createMockRpc({
1877
1834
  commandMap
1878
1835
  });
1879
- set$5(rpcId, mockRpc);
1836
+ set$6(rpcId, mockRpc);
1880
1837
  // @ts-ignore
1881
1838
  mockRpc[Symbol.dispose] = () => {
1882
1839
  remove(rpcId);
@@ -1885,52 +1842,45 @@ const create = rpcId => {
1885
1842
  return mockRpc;
1886
1843
  },
1887
1844
  set(rpc) {
1888
- set$5(rpcId, rpc);
1845
+ set$6(rpcId, rpc);
1889
1846
  }
1890
1847
  };
1891
1848
  };
1892
1849
 
1893
1850
  const {
1894
- invoke: invoke$3,
1895
- set: set$4
1851
+ invoke: invoke$4,
1852
+ set: set$5
1896
1853
  } = create(ExtensionManagementWorker);
1897
1854
 
1898
1855
  const {
1899
- invoke: invoke$2,
1900
- set: set$3
1856
+ invoke: invoke$3,
1857
+ set: set$4
1901
1858
  } = create(RendererProcess);
1902
1859
 
1903
1860
  const {
1904
- invoke: invoke$1,
1861
+ invoke: invoke$2,
1905
1862
  invokeAndTransfer,
1906
- set: set$2
1863
+ set: set$3
1907
1864
  } = create(RendererWorker);
1908
- const showContextMenu2 = async (uid, menuId, x, y, args) => {
1909
- number(uid);
1910
- number(menuId);
1911
- number(x);
1912
- number(y);
1913
- await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
1914
- };
1915
1865
  const getPreference = async key => {
1916
- return await invoke$1('Preferences.get', key);
1866
+ return await invoke$2('Preferences.get', key);
1917
1867
  };
1918
1868
 
1919
1869
  const handleClickExtensionStatusBarItem = async name => {
1920
1870
  try {
1921
- await invoke$3('Extensions.executeCommand', name);
1871
+ await invoke$4('Extensions.executeCommand', name);
1922
1872
  } catch (error) {
1923
1873
  console.error(new VError(error, `Failed to execute status bar command: ${name}`));
1924
1874
  }
1925
1875
  };
1926
1876
 
1927
1877
  const handleClickNotification = async () => {
1928
- await invoke$1('Viewlet.openWidget', 'NotificationCenter');
1878
+ await invoke$2('Viewlet.openWidget', 'NotificationCenter');
1929
1879
  };
1930
1880
 
1931
1881
  const handleClickProblems = async () => {
1932
1882
  // @ts-ignore
1933
- await invoke$1('Layout.showPanel', 'Problems');
1883
+ await invoke$2('Layout.showPanel', 'Problems');
1934
1884
  };
1935
1885
 
1936
1886
  const handleClick = async (state, name) => {
@@ -1946,9 +1896,9 @@ const handleClick = async (state, name) => {
1946
1896
  if (!item) {
1947
1897
  return state;
1948
1898
  }
1949
- if (item.name === Notifications) {
1899
+ if (item.name === Notifications$1) {
1950
1900
  await handleClickNotification();
1951
- } else if (item.name === Problems) {
1901
+ } else if (item.name === Problems$1) {
1952
1902
  await handleClickProblems();
1953
1903
  } else if (isEditorStatus(item.name)) {
1954
1904
  await handleClickEditorStatus(item.name, editorStatus);
@@ -1960,13 +1910,26 @@ const handleClick = async (state, name) => {
1960
1910
  return state;
1961
1911
  };
1962
1912
 
1913
+ const state$1 = {
1914
+ rpc: undefined
1915
+ };
1916
+ const set$2 = rpc => {
1917
+ state$1.rpc = rpc;
1918
+ };
1919
+ const invoke$1 = (method, ...args) => {
1920
+ const {
1921
+ rpc
1922
+ } = state$1;
1923
+ return rpc.invoke(method, ...args);
1924
+ };
1925
+
1963
1926
  const show2 = async (uid, menuId, x, y, args) => {
1964
- await showContextMenu2(uid, menuId, x, y, args);
1927
+ await invoke$1('Menu.show2', uid, menuId, x, y, args);
1965
1928
  };
1966
1929
 
1967
1930
  const getStatusBarItemContextMenuItems = async (extensionId, providerId) => {
1968
1931
  try {
1969
- return await invoke$3('Extensions.getStatusBarItemContextMenuItems', extensionId, providerId);
1932
+ return await invoke$4('Extensions.getStatusBarItemContextMenuItems', extensionId, providerId);
1970
1933
  } catch {
1971
1934
  return [];
1972
1935
  }
@@ -2011,6 +1974,125 @@ const setVisible = value => {
2011
1974
  visible = value;
2012
1975
  };
2013
1976
 
1977
+ const emptyObject = {};
1978
+ const i18nString = (key, placeholders = emptyObject) => {
1979
+ if (placeholders === emptyObject) {
1980
+ return key;
1981
+ }
1982
+ let result = key;
1983
+ for (const [placeholder, replacement] of Object.entries(placeholders)) {
1984
+ result = result.split(`{${placeholder}}`).join(String(replacement));
1985
+ }
1986
+ return result;
1987
+ };
1988
+
1989
+ const EditorPosition = 'Ln {PH1}, Col {PH2}';
1990
+ const EditorPositionWithSelection = 'Ln {PH1}, Col {PH2} ({PH3} selected)';
1991
+ const EditorPositionAriaLabel = 'Line {PH1}, Column {PH2}';
1992
+ const EditorPositionWithSelectionAriaLabel = 'Line {PH1}, Column {PH2}, {PH3} selected';
1993
+ const EditorIndentationSpaces = 'Spaces: {PH1}';
1994
+ const EditorIndentationTabs = 'Tab Size: {PH1}';
1995
+ const EditorEncoding = 'Encoding: {PH1}';
1996
+ const EditorEndOfLine = 'End of Line: {PH1}';
1997
+ const EditorLanguage = 'Language: {PH1}';
1998
+ const GoToLineColumn = 'Go to Line/Column';
1999
+ const SelectIndentation = 'Select Indentation';
2000
+ const SelectEncoding = 'Select Encoding';
2001
+ const SelectEndOfLineSequence = 'Select End of Line Sequence';
2002
+ const SelectLanguageMode = 'Select Language Mode';
2003
+ const Problem = '{PH1} Problem';
2004
+ const Problems = '{PH1} Problems';
2005
+ const Warning = '{PH1} Warning';
2006
+ const Warnings = '{PH1} Warnings';
2007
+ const ProblemsAriaLabel = '{PH1}, {PH2}';
2008
+ const NoProblems = 'No Problems';
2009
+ const ProblemsTooltip = 'Problems';
2010
+ const Notification = '{PH1} Notification';
2011
+ const Notifications = '{PH1} Notifications';
2012
+ const NoNotifications = 'No Notifications';
2013
+
2014
+ const editorPosition = (line, column) => {
2015
+ return i18nString(EditorPosition, {
2016
+ PH1: line,
2017
+ PH2: column
2018
+ });
2019
+ };
2020
+ const editorPositionWithSelection = (line, column, selectedChars) => {
2021
+ return i18nString(EditorPositionWithSelection, {
2022
+ PH1: line,
2023
+ PH2: column,
2024
+ PH3: selectedChars
2025
+ });
2026
+ };
2027
+ const editorPositionAriaLabel = (line, column) => {
2028
+ return i18nString(EditorPositionAriaLabel, {
2029
+ PH1: line,
2030
+ PH2: column
2031
+ });
2032
+ };
2033
+ const editorPositionWithSelectionAriaLabel = (line, column, selectedChars) => {
2034
+ return i18nString(EditorPositionWithSelectionAriaLabel, {
2035
+ PH1: line,
2036
+ PH2: column,
2037
+ PH3: selectedChars
2038
+ });
2039
+ };
2040
+ const editorIndentationSpaces = tabSize => {
2041
+ return i18nString(EditorIndentationSpaces, {
2042
+ PH1: tabSize
2043
+ });
2044
+ };
2045
+ const editorIndentationTabs = tabSize => {
2046
+ return i18nString(EditorIndentationTabs, {
2047
+ PH1: tabSize
2048
+ });
2049
+ };
2050
+ const editorEncoding = encoding => {
2051
+ return i18nString(EditorEncoding, {
2052
+ PH1: encoding
2053
+ });
2054
+ };
2055
+ const editorEndOfLine = endOfLine => {
2056
+ return i18nString(EditorEndOfLine, {
2057
+ PH1: endOfLine
2058
+ });
2059
+ };
2060
+ const editorLanguage = languageId => {
2061
+ return i18nString(EditorLanguage, {
2062
+ PH1: languageId
2063
+ });
2064
+ };
2065
+ const goToLineColumn = () => i18nString(GoToLineColumn);
2066
+ const selectIndentation = () => i18nString(SelectIndentation);
2067
+ const selectEncoding = () => i18nString(SelectEncoding);
2068
+ const selectEndOfLineSequence = () => i18nString(SelectEndOfLineSequence);
2069
+ const selectLanguageMode = () => i18nString(SelectLanguageMode);
2070
+ const problem = count => i18nString(Problem, {
2071
+ PH1: count
2072
+ });
2073
+ const problems = count => i18nString(Problems, {
2074
+ PH1: count
2075
+ });
2076
+ const warning = count => i18nString(Warning, {
2077
+ PH1: count
2078
+ });
2079
+ const warnings = count => i18nString(Warnings, {
2080
+ PH1: count
2081
+ });
2082
+ const problemsAriaLabel = (problemLabel, warningLabel) => i18nString(ProblemsAriaLabel, {
2083
+ PH1: problemLabel,
2084
+ PH2: warningLabel
2085
+ });
2086
+ const noProblems = () => i18nString(NoProblems);
2087
+ const problemsTooltip = () => i18nString(ProblemsTooltip);
2088
+ const notification = count => i18nString(Notification, {
2089
+ PH1: count
2090
+ });
2091
+ const notifications = count => i18nString(Notifications, {
2092
+ PH1: count
2093
+ });
2094
+ const noNotifications = () => i18nString(NoNotifications);
2095
+
2014
2096
  const textItem = (name, text, ariaLabel, tooltip) => ({
2015
2097
  ariaLabel,
2016
2098
  command: '',
@@ -2036,19 +2118,19 @@ const getEditorStatusBarItems = status => {
2036
2118
  tabSize
2037
2119
  } = status;
2038
2120
  const encodingLabel = encoding === 'utf8' ? ['UTF', '8'].join('-') : encoding;
2039
- const indentationLabel = insertSpaces ? `Spaces: ${tabSize}` : `Tab Size: ${tabSize}`;
2121
+ const indentationLabel = insertSpaces ? editorIndentationSpaces(tabSize) : editorIndentationTabs(tabSize);
2040
2122
  const endOfLineLabel = endOfLine.toUpperCase();
2041
- const positionLabel = selectedChars > 0 ? `Ln ${line}, Col ${column} (${selectedChars} selected)` : `Ln ${line}, Col ${column}`;
2042
- const positionAriaLabel = selectedChars > 0 ? `Line ${line}, Column ${column}, ${selectedChars} selected` : `Line ${line}, Column ${column}`;
2043
- return [textItem(EditorPosition, positionLabel, positionAriaLabel, 'Go to Line/Column'), textItem(EditorIndentation, indentationLabel, indentationLabel, 'Select Indentation'), textItem(EditorEncoding, encodingLabel, `Encoding: ${encodingLabel}`, 'Select Encoding'), textItem(EditorEndOfLine, endOfLineLabel, `End of Line: ${endOfLineLabel}`, 'Select End of Line Sequence'), textItem(EditorLanguage, languageId, `Language: ${languageId}`, 'Select Language Mode')];
2123
+ const positionLabel = selectedChars > 0 ? editorPositionWithSelection(line, column, selectedChars) : editorPosition(line, column);
2124
+ const positionAriaLabel = selectedChars > 0 ? editorPositionWithSelectionAriaLabel(line, column, selectedChars) : editorPositionAriaLabel(line, column);
2125
+ return [textItem(EditorPosition$1, positionLabel, positionAriaLabel, goToLineColumn()), textItem(EditorIndentation, indentationLabel, indentationLabel, selectIndentation()), textItem(EditorEncoding$1, encodingLabel, editorEncoding(encodingLabel), selectEncoding()), textItem(EditorEndOfLine$1, endOfLineLabel, editorEndOfLine(endOfLineLabel), selectEndOfLineSequence()), textItem(EditorLanguage$1, languageId, editorLanguage(languageId), selectLanguageMode())];
2044
2126
  };
2045
2127
 
2046
2128
  const dependencies = {
2047
- [EditorEncoding]: ['encoding'],
2048
- [EditorEndOfLine]: ['endOfLine'],
2129
+ [EditorEncoding$1]: ['encoding'],
2130
+ [EditorEndOfLine$1]: ['endOfLine'],
2049
2131
  [EditorIndentation]: ['insertSpaces', 'tabSize'],
2050
- [EditorLanguage]: ['languageId'],
2051
- [EditorPosition]: ['line', 'column', 'selectedChars']
2132
+ [EditorLanguage$1]: ['languageId'],
2133
+ [EditorPosition$1]: ['line', 'column', 'selectedChars']
2052
2134
  };
2053
2135
  const handleEditorStatusChanged = (state, editorStatus, previous = state) => {
2054
2136
  const {
@@ -2079,7 +2161,7 @@ const handleEditorStatusChanged = (state, editorStatus, previous = state) => {
2079
2161
  replacements.delete(item.name);
2080
2162
  return replacement || item;
2081
2163
  });
2082
- const notificationIndex = updatedItems.findIndex(item => item.name === Notifications);
2164
+ const notificationIndex = updatedItems.findIndex(item => item.name === Notifications$1);
2083
2165
  updatedItems.splice(notificationIndex === -1 ? updatedItems.length : notificationIndex, 0, ...replacements.values());
2084
2166
  return {
2085
2167
  ...state,
@@ -2125,10 +2207,10 @@ const isConnected = () => {
2125
2207
  return connected;
2126
2208
  };
2127
2209
  const invoke = (method, ...params) => {
2128
- return invoke$2(method, ...params);
2210
+ return invoke$3(method, ...params);
2129
2211
  };
2130
2212
  const set$1 = rpc => {
2131
- set$3(rpc);
2213
+ set$4(rpc);
2132
2214
  state.connected = true;
2133
2215
  };
2134
2216
 
@@ -2143,7 +2225,7 @@ const render2 = (uid, diffResult) => {
2143
2225
  newState,
2144
2226
  oldState
2145
2227
  } = get$5(uid);
2146
- set$7(uid, newState, newState);
2228
+ set$8(uid, newState, newState);
2147
2229
  const commands = applyRender(oldState, newState, diffResult);
2148
2230
  if (!isConnected()) {
2149
2231
  return commands;
@@ -2190,7 +2272,7 @@ const handleEditorStatusChangedAll = async update => {
2190
2272
  if (newState === newerState || oldState === newerState) {
2191
2273
  continue;
2192
2274
  }
2193
- set$7(uid, oldState, newerState);
2275
+ set$8(uid, oldState, newerState);
2194
2276
  changedUids.push(uid);
2195
2277
  }
2196
2278
  await Promise.all(changedUids.map(renderOutOfBand));
@@ -2231,7 +2313,7 @@ const handleEditorStatusVisibilityChangedAll = async visible => {
2231
2313
  if (newState === newerState || oldState === newerState) {
2232
2314
  continue;
2233
2315
  }
2234
- set$7(uid, oldState, newerState);
2316
+ set$8(uid, oldState, newerState);
2235
2317
  changedUids.push(uid);
2236
2318
  }
2237
2319
  await Promise.all(changedUids.map(renderOutOfBand));
@@ -2239,12 +2321,12 @@ const handleEditorStatusVisibilityChangedAll = async visible => {
2239
2321
 
2240
2322
  const getAriaLabel = count => {
2241
2323
  if (count === 0) {
2242
- return 'No Notifications';
2324
+ return noNotifications();
2243
2325
  }
2244
2326
  if (count === 1) {
2245
- return '1 Notification';
2327
+ return notification(count);
2246
2328
  }
2247
- return `${count} Notifications`;
2329
+ return notifications(count);
2248
2330
  };
2249
2331
  const getNotificationsStatusBarItem = (enabled, count = 0) => {
2250
2332
  if (!enabled) {
@@ -2260,7 +2342,7 @@ const getNotificationsStatusBarItem = (enabled, count = 0) => {
2260
2342
  type: 'text',
2261
2343
  value: String(count)
2262
2344
  }] : [])],
2263
- name: Notifications,
2345
+ name: Notifications$1,
2264
2346
  tooltip: getAriaLabel(count)
2265
2347
  }];
2266
2348
  };
@@ -2268,15 +2350,18 @@ const getNotificationsStatusBarItem = (enabled, count = 0) => {
2268
2350
  const getProblemsAriaLabel = (errorCount, warningCount) => {
2269
2351
  const parts = [];
2270
2352
  if (errorCount > 0) {
2271
- parts.push(`${errorCount} ${errorCount === 1 ? 'Problem' : 'Problems'}`);
2353
+ parts.push(errorCount === 1 ? problem(errorCount) : problems(errorCount));
2272
2354
  }
2273
2355
  if (warningCount > 0) {
2274
- parts.push(`${warningCount} ${warningCount === 1 ? 'Warning' : 'Warnings'}`);
2356
+ parts.push(warningCount === 1 ? warning(warningCount) : warnings(warningCount));
2275
2357
  }
2276
2358
  if (parts.length === 0) {
2277
- return 'No Problems';
2359
+ return noProblems();
2278
2360
  }
2279
- return parts.join(', ');
2361
+ if (parts.length === 1) {
2362
+ return parts[0];
2363
+ }
2364
+ return problemsAriaLabel(parts[0], parts[1]);
2280
2365
  };
2281
2366
 
2282
2367
  const getProblemsStatusBarItem = (errorCount, warningCount, enabled) => {
@@ -2300,8 +2385,8 @@ const getProblemsStatusBarItem = (errorCount, warningCount, enabled) => {
2300
2385
  type: 'text',
2301
2386
  value: String(warningCount)
2302
2387
  }],
2303
- name: Problems,
2304
- tooltip: 'Problems'
2388
+ name: Problems$1,
2389
+ tooltip: problemsTooltip()
2305
2390
  }];
2306
2391
  };
2307
2392
 
@@ -2315,8 +2400,8 @@ const getBuiltinStatusBarItems = async (errorCount, warningCount, {
2315
2400
  };
2316
2401
 
2317
2402
  const getExtensionStatusBarItems = async (assetDir, platform) => {
2318
- await invoke$3('Extensions.activateByEvent', 'onStatusBarItem', assetDir, platform);
2319
- return invoke$3('Extensions.getStatusBarItems');
2403
+ await invoke$4('Extensions.activateByEvent', 'onStatusBarItem', assetDir, platform);
2404
+ return invoke$4('Extensions.getStatusBarItems');
2320
2405
  };
2321
2406
 
2322
2407
  const toStatusBarItem = uiStatusBarItem => {
@@ -2394,7 +2479,7 @@ const toUiStatusBarItems = statusBarItems => {
2394
2479
 
2395
2480
  const getNotificationCount = async () => {
2396
2481
  try {
2397
- return await invoke$3('Extensions.getNotificationCount');
2482
+ return await invoke$4('Extensions.getNotificationCount');
2398
2483
  } catch {
2399
2484
  return 0;
2400
2485
  }
@@ -2449,7 +2534,7 @@ const handleExtensionsChanged = async state => {
2449
2534
  if (refreshVersions[uid] !== refreshVersion) {
2450
2535
  return state;
2451
2536
  }
2452
- const builtinProblemsItem = statusBarItemsLeft.find(item => item.name === Problems);
2537
+ const builtinProblemsItem = statusBarItemsLeft.find(item => item.name === Problems$1);
2453
2538
  return {
2454
2539
  ...state,
2455
2540
  statusBarItemsLeft: builtinProblemsItem ? [...statusBarItems, builtinProblemsItem] : [...statusBarItems]
@@ -2473,7 +2558,7 @@ const handleExtensionManagementChange = async () => {
2473
2558
  // Loading and other updates can finish while the provider query is pending.
2474
2559
  // Only replace the extension items; retain the current lifecycle and render baseline.
2475
2560
  const current = get$5(uid);
2476
- set$7(uid, current.oldState, {
2561
+ set$8(uid, current.oldState, {
2477
2562
  ...current.newState,
2478
2563
  statusBarItemsLeft: newerState.statusBarItemsLeft
2479
2564
  });
@@ -2485,7 +2570,7 @@ const handleNotificationCountChanged = (state, count) => {
2485
2570
  const {
2486
2571
  statusBarItemsRight
2487
2572
  } = state;
2488
- const notificationsEnabled = statusBarItemsRight.some(item => item.name === Notifications);
2573
+ const notificationsEnabled = statusBarItemsRight.some(item => item.name === Notifications$1);
2489
2574
  if (!notificationsEnabled) {
2490
2575
  return state;
2491
2576
  }
@@ -2495,7 +2580,7 @@ const handleNotificationCountChanged = (state, count) => {
2495
2580
  }
2496
2581
  return {
2497
2582
  ...state,
2498
- statusBarItemsRight: statusBarItemsRight.map(item => item.name === Notifications ? notificationItem : item)
2583
+ statusBarItemsRight: statusBarItemsRight.map(item => item.name === Notifications$1 ? notificationItem : item)
2499
2584
  };
2500
2585
  };
2501
2586
 
@@ -2518,7 +2603,7 @@ const handleNotificationCountChangedAll = async count => {
2518
2603
  if (newState === newerState || oldState === newerState) {
2519
2604
  continue;
2520
2605
  }
2521
- set$7(uid, oldState, newerState);
2606
+ set$8(uid, oldState, newerState);
2522
2607
  await renderOutOfBand(uid);
2523
2608
  }
2524
2609
  };
@@ -2533,7 +2618,7 @@ const handleExtensionManagementMessagePort = async port => {
2533
2618
  commandMap: commandMap$1,
2534
2619
  messagePort: port
2535
2620
  });
2536
- set$4(rpc);
2621
+ set$5(rpc);
2537
2622
  };
2538
2623
 
2539
2624
  const supportsEditorStatusDeltas = () => true;
@@ -2545,7 +2630,7 @@ const handleMessagePort = async (port, viewletCommandMap, setAsRendererProcess =
2545
2630
  throw new TypeError(`Viewlet command not found: ${command}`);
2546
2631
  }
2547
2632
  await fn(uid, ...args);
2548
- await invoke$1('Viewlet.requestRender', uid);
2633
+ await invoke$2('Viewlet.requestRender', uid);
2549
2634
  };
2550
2635
  const rpc = await create$4({
2551
2636
  commandMap: {
@@ -2573,7 +2658,7 @@ const handleProblemsSummaryChange = (state, summary) => {
2573
2658
  return state;
2574
2659
  }
2575
2660
  const problemsItem = getProblemsStatusBarItem(errorCount, warningCount, true)[0];
2576
- const statusBarItemsLeft = oldStatusBarItemsLeft.map(item => item.name === Problems ? problemsItem : item);
2661
+ const statusBarItemsLeft = oldStatusBarItemsLeft.map(item => item.name === Problems$1 ? problemsItem : item);
2577
2662
  return {
2578
2663
  ...state,
2579
2664
  errorCount,
@@ -2587,7 +2672,7 @@ const handleWorkspaceChange = async state => {
2587
2672
  assetDir,
2588
2673
  platform
2589
2674
  } = state;
2590
- await invoke$3('Extensions.activateByEvent', 'onStatusBarItem', assetDir, platform);
2675
+ await invoke$4('Extensions.activateByEvent', 'onStatusBarItem', assetDir, platform);
2591
2676
  return state;
2592
2677
  };
2593
2678
 
@@ -2808,6 +2893,16 @@ const commandMap = {
2808
2893
  'StatusBar.terminate': terminate
2809
2894
  };
2810
2895
 
2896
+ const initializeMenuWorker = async () => {
2897
+ const rpc = await create$2({
2898
+ commandMap: {},
2899
+ async send(port) {
2900
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMenuWorker', port);
2901
+ }
2902
+ });
2903
+ set$2(rpc);
2904
+ };
2905
+
2811
2906
  const initializeQuickPickWorker = async () => {
2812
2907
  const rpc = await create$2({
2813
2908
  commandMap: {},
@@ -2815,19 +2910,19 @@ const initializeQuickPickWorker = async () => {
2815
2910
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToQuickPickWorker', port, 'QuickPick.handleStatusBarMessagePort', 0);
2816
2911
  }
2817
2912
  });
2818
- set$6(rpc);
2913
+ set$7(rpc);
2819
2914
  };
2820
2915
 
2821
2916
  const initializeRenderWorker = async () => {
2822
2917
  const rpc = await create$1({
2823
2918
  commandMap: commandMap
2824
2919
  });
2825
- set$2(rpc);
2920
+ set$3(rpc);
2826
2921
  };
2827
2922
 
2828
2923
  const listen = async () => {
2829
2924
  registerCommands(commandMap);
2830
- await Promise.all([initializeRenderWorker(), initializeQuickPickWorker()]);
2925
+ await Promise.all([initializeRenderWorker(), initializeQuickPickWorker(), initializeMenuWorker()]);
2831
2926
  };
2832
2927
 
2833
2928
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/status-bar-worker",
3
- "version": "3.31.4",
3
+ "version": "3.32.0",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,5 +9,8 @@
9
9
  "license": "MIT",
10
10
  "author": "Lvce Editor",
11
11
  "type": "module",
12
- "main": "dist/statusBarWorkerMain.js"
12
+ "main": "dist/statusBarWorkerMain.js",
13
+ "dependencies": {
14
+ "@lvce-editor/i18n": "^2.10.0"
15
+ }
13
16
  }