@lvce-editor/title-bar-worker 4.9.1 → 4.9.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.
@@ -3968,6 +3968,7 @@ const renderFocusedIndex = (oldState, newState) => {
3968
3968
  };
3969
3969
 
3970
3970
  const MaskIconCheck = 'MaskIconCheck';
3971
+ const MaskIcon = 'MaskIcon';
3971
3972
  const Menu = 'Menu';
3972
3973
  const MenuItem = 'MenuItem';
3973
3974
  const MenuItemCheckMark = 'MenuItemCheckMark';
@@ -3979,6 +3980,7 @@ const MenuItemSeparatorLine = 'MenuItemSeparatorLine';
3979
3980
  const MenuItemSubMenu = 'MenuItemSubMenu';
3980
3981
  const MenuItemSubMenuArrowRight = 'MenuItemSubMenuArrowRight';
3981
3982
  const TitleBar = 'TitleBar';
3983
+ const TitleBarButton = 'TitleBarButton';
3982
3984
  const TitleBarButtons = 'TitleBarButtons';
3983
3985
  const TitleBarEntryActive = 'TitleBarEntryActive';
3984
3986
  const TitleBarIcon = 'TitleBarIcon';
@@ -4273,7 +4275,7 @@ const getIcon = assetDir => {
4273
4275
  const getIconVirtualDom = (icon, type = Div) => {
4274
4276
  return {
4275
4277
  childCount: 0,
4276
- className: `MaskIcon MaskIcon${icon}`,
4278
+ className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
4277
4279
  role: None$1,
4278
4280
  type
4279
4281
  };
@@ -4289,7 +4291,7 @@ const createTitleBarButton = button => {
4289
4291
  const dom = [{
4290
4292
  ariaLabel: label,
4291
4293
  childCount: 1,
4292
- className: `TitleBarButton TitleBarButton${id}`,
4294
+ className: mergeClassNames(TitleBarButton, `TitleBarButton${id}`),
4293
4295
  name: id,
4294
4296
  onClick,
4295
4297
  type: Button$1
@@ -4617,12 +4619,17 @@ const create = (id, uri, x, y, width, height) => {
4617
4619
 
4618
4620
  const closeMenu = (state, keepFocus) => {
4619
4621
  const {
4620
- focusedIndex
4622
+ focusedIndex,
4623
+ isMenuOpen,
4624
+ menus
4621
4625
  } = state;
4622
4626
  // TODO send to renderer process
4623
4627
  // 1. close menu
4624
4628
  // 2. focus top level entry
4625
4629
  const newFocusedIndex = keepFocus ? focusedIndex : -1;
4630
+ if (!isMenuOpen && menus.length === 0 && focusedIndex === newFocusedIndex) {
4631
+ return state;
4632
+ }
4626
4633
  return {
4627
4634
  ...state,
4628
4635
  focusedIndex: newFocusedIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "4.9.1",
3
+ "version": "4.9.2",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",