@lvce-editor/status-bar-worker 3.20.1 → 3.20.3

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.
@@ -1550,8 +1550,8 @@ const handleClick = async (state, name) => {
1550
1550
  await handleClickNotification();
1551
1551
  } else if (item.name === Problems) {
1552
1552
  await handleClickProblems();
1553
- } else if (!isEditorStatus(item.name)) {
1554
- await handleClickExtensionStatusBarItem(name);
1553
+ } else if (item.command && !isEditorStatus(item.name)) {
1554
+ await handleClickExtensionStatusBarItem(item.command);
1555
1555
  }
1556
1556
  // TODO
1557
1557
  // sendExtensionWorker([/* statusBarItemHandleClick */ 7657, /* name */ name])
@@ -1727,7 +1727,7 @@ const getActualIcon = extensionStatusBarItem => {
1727
1727
  const toUiStatusBarItem = extensionStatusBarItem => {
1728
1728
  return {
1729
1729
  ariaLabel: extensionStatusBarItem.ariaLabel || '',
1730
- command: extensionStatusBarItem.command || '',
1730
+ command: extensionStatusBarItem.onClick || extensionStatusBarItem.command || '',
1731
1731
  icon: getActualIcon(extensionStatusBarItem),
1732
1732
  name: extensionStatusBarItem.id || extensionStatusBarItem.name || '',
1733
1733
  ...(extensionStatusBarItem.spinning === true && {
@@ -1879,7 +1879,15 @@ const getStatusBarItemsVirtualDom = (items, className) => {
1879
1879
  }, ...items.flatMap(getStatusBarItemVirtualDom)];
1880
1880
  };
1881
1881
 
1882
+ const emptyStatusBarItemsLeftDom = [{
1883
+ childCount: 0,
1884
+ className: StatusBarItemsLeft,
1885
+ type: Div
1886
+ }];
1882
1887
  const getStatusBarItemsLeftDom = statusBarItemsLeft => {
1888
+ if (statusBarItemsLeft.length === 0) {
1889
+ return emptyStatusBarItemsLeftDom;
1890
+ }
1883
1891
  return getStatusBarItemsVirtualDom(statusBarItemsLeft, StatusBarItemsLeft);
1884
1892
  };
1885
1893
 
@@ -1887,19 +1895,12 @@ const getStatusBarItemsRightDom = statusBarItemsRight => {
1887
1895
  return getStatusBarItemsVirtualDom(statusBarItemsRight, StatusBarItemsRight);
1888
1896
  };
1889
1897
 
1890
- const getChildCount = (leftCount, rightCount) => {
1891
- let count = 0;
1892
- if (leftCount > 0) {
1893
- count++;
1894
- }
1895
- if (rightCount > 0) {
1896
- count++;
1897
- }
1898
- return count;
1898
+ const getChildCount = rightCount => {
1899
+ return rightCount > 0 ? 2 : 1;
1899
1900
  };
1900
1901
  const getStatusBarVirtualDom = (statusBarItemsLeft, statusBarItemsRight) => {
1901
1902
  const dom = [{
1902
- childCount: getChildCount(statusBarItemsLeft.length, statusBarItemsRight.length),
1903
+ childCount: getChildCount(statusBarItemsRight.length),
1903
1904
  className: 'StatusBar',
1904
1905
  onClick: HandleClick,
1905
1906
  onContextMenu: HandleContextMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/status-bar-worker",
3
- "version": "3.20.1",
3
+ "version": "3.20.3",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",