@lvce-editor/status-bar-worker 3.20.1 → 3.20.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.
@@ -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.2",
4
4
  "description": "Status Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",