@lvce-editor/title-bar-worker 2.12.0 → 2.13.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.
@@ -2664,7 +2664,12 @@ const ifElse = (menuOpenFunction, menuClosedFunction) => {
2664
2664
  const handleMouseOut = ifElse(handleMouseOutMenuOpen, handleMouseOutMenuClosed);
2665
2665
 
2666
2666
  const handlePointerOut = (state, clientX, clientY) => {
2667
- const index = getTitleBarIndexFromPosition(state.titleBarEntries, clientX - state.x);
2667
+ const {
2668
+ x,
2669
+ iconWidth,
2670
+ titleBarEntries
2671
+ } = state;
2672
+ const index = getTitleBarIndexFromPosition(titleBarEntries, clientX - x - iconWidth);
2668
2673
  if (index === -1) {
2669
2674
  return state;
2670
2675
  }
@@ -2685,7 +2690,12 @@ const handleMouseOverMenuOpen = async (state, index) => {
2685
2690
  const handleMouseOver = ifElse(handleMouseOverMenuOpen, handleMouseOverMenuClosed);
2686
2691
 
2687
2692
  const handlePointerOver = (state, clientX, clientY) => {
2688
- const index = getTitleBarIndexFromPosition(state.titleBarEntries, clientX - state.x);
2693
+ const {
2694
+ titleBarEntries,
2695
+ x,
2696
+ iconWidth
2697
+ } = state;
2698
+ const index = getTitleBarIndexFromPosition(titleBarEntries, clientX - x - iconWidth);
2689
2699
  if (index === -1) {
2690
2700
  return state;
2691
2701
  }
@@ -2759,11 +2769,13 @@ const loadContent2 = async state => {
2759
2769
  const withWidths = addWidths(titleBarEntries, labelPadding, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
2760
2770
  const buttons = getTitleBarButtons(platform, controlsOverlayEnabled, titleBarStyleCustom);
2761
2771
  const title = 'test';
2772
+ const iconWidth = 30;
2762
2773
  return {
2763
2774
  ...state,
2764
2775
  titleBarEntries: withWidths,
2765
2776
  buttons,
2766
- title
2777
+ title,
2778
+ iconWidth
2767
2779
  };
2768
2780
  };
2769
2781
 
@@ -4043,6 +4055,7 @@ const commandMap = {
4043
4055
  'TitleBarMenuBar.focusNext': wrapCommand(focusNext),
4044
4056
  'TitleBarMenuBar.focusPrevious': wrapCommand(focusPrevious),
4045
4057
  'TitleBarMenuBar.getCommands': getCommandIds,
4058
+ 'TitleBarMenuBar.getCommandIds': getCommandIds,
4046
4059
  'TitleBarMenuBar.getKeyBindings': getKeyBindings$1,
4047
4060
  'TitleBarMenuBar.getMenus': getMenus,
4048
4061
  'TitleBarMenuBar.getTitleBarButtons': getTitleBarButtons,
@@ -4073,6 +4086,14 @@ const commandMap = {
4073
4086
  'TitleBarMenuBar.toggleIndex': wrapCommand(toggleIndex),
4074
4087
  'TitleBarMenuBar.toggleMenu': wrapCommand(toggleMenu)
4075
4088
  };
4089
+ for (const [key, value] of Object.entries(commandMap)) {
4090
+ const [prefix, name] = key.split('.');
4091
+ if (prefix === 'TitleBarMenuBar') {
4092
+ const alternate = `TitleBar.${name}`;
4093
+ // @ts-ignore
4094
+ commandMap[alternate] = value;
4095
+ }
4096
+ }
4076
4097
 
4077
4098
  const listen = async () => {
4078
4099
  registerCommands(commandMap);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",