@lvce-editor/title-bar-worker 4.25.2 → 4.25.4

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.
@@ -1908,7 +1908,7 @@ const DEFAULT_UID = 1;
1908
1908
  const DEFAULT_APP_NAME = 'Lvce Editor';
1909
1909
  const DEFAULT_MAIN_AREA_UID = 2;
1910
1910
  const createDefaultState = (uid = DEFAULT_UID) => ({
1911
- appName: DEFAULT_APP_NAME,
1911
+ applicationName: DEFAULT_APP_NAME,
1912
1912
  assetDir: '',
1913
1913
  buttons: [],
1914
1914
  commandCenterEnabled: false,
@@ -4406,7 +4406,7 @@ const measureTitleWidth = async (title, fontWeight, fontSize, fontFamily, letter
4406
4406
  // TODO in the future, it could also be a multi-root workspace
4407
4407
  const handleWorkspaceChange = async (state, uri) => {
4408
4408
  const {
4409
- appName,
4409
+ applicationName,
4410
4410
  labelFontFamily,
4411
4411
  labelFontSize,
4412
4412
  labelFontWeight,
@@ -4415,7 +4415,7 @@ const handleWorkspaceChange = async (state, uri) => {
4415
4415
  titleWidth: oldTitleWidth,
4416
4416
  width
4417
4417
  } = state;
4418
- const title = getTitle(uri, titleTemplate, appName);
4418
+ const title = getTitle(uri, titleTemplate, applicationName);
4419
4419
  const titleWidth = await measureTitleWidth(title, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
4420
4420
  return {
4421
4421
  ...state,
@@ -4487,7 +4487,7 @@ const loadContent2 = async state => {
4487
4487
  const withWidths = await addWidths(titleBarEntries, labelPadding, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
4488
4488
  const buttons = getTitleBarButtons(platform, controlsOverlayEnabled, titleBarStyleCustom);
4489
4489
  const workspaceUri = await getWorkspaceUri();
4490
- const title = getTitle(workspaceUri, state.titleTemplate, state.appName);
4490
+ const title = getTitle(workspaceUri, state.titleTemplate, state.applicationName);
4491
4491
  const titleWidth = await measureTitleWidth(title, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
4492
4492
  const iconWidth = 30;
4493
4493
  const width = getTitleBarMenuBarWidth(state.width, state.x, iconWidth, titleWidth);
@@ -4971,7 +4971,7 @@ const setPlatform = (state, platform) => {
4971
4971
 
4972
4972
  const setTitleTemplate = async (state, titleTemplate) => {
4973
4973
  const {
4974
- appName,
4974
+ applicationName,
4975
4975
  labelFontFamily,
4976
4976
  labelFontSize,
4977
4977
  labelFontWeight,
@@ -4980,7 +4980,7 @@ const setTitleTemplate = async (state, titleTemplate) => {
4980
4980
  width,
4981
4981
  workspaceUri
4982
4982
  } = state;
4983
- const title = getTitle(workspaceUri, titleTemplate, appName);
4983
+ const title = getTitle(workspaceUri, titleTemplate, applicationName);
4984
4984
  const titleWidth = await measureTitleWidth(title, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
4985
4985
  return {
4986
4986
  ...state,
@@ -5510,6 +5510,23 @@ const handleKeySpaceMenuOpen = state => handleKeyEnterMenuOpen(state);
5510
5510
  // TODO this is same as handle key enter -> merge the functions
5511
5511
  const handleKeySpace = ifElse(handleKeySpaceMenuOpen, handleKeySpaceMenuClosed);
5512
5512
 
5513
+ const handleMenuMouseLeave = state => {
5514
+ object(state);
5515
+ const {
5516
+ menus
5517
+ } = state;
5518
+ if (menus.every(menu => menu.focusedIndex === -1)) {
5519
+ return state;
5520
+ }
5521
+ return {
5522
+ ...state,
5523
+ menus: menus.map(menu => ({
5524
+ ...menu,
5525
+ focusedIndex: -1
5526
+ }))
5527
+ };
5528
+ };
5529
+
5513
5530
  const getNewMenus = async (menus, level, index, flags) => {
5514
5531
  const menu = menus[level];
5515
5532
  if (!menu) {
@@ -5663,6 +5680,7 @@ const commandMap = {
5663
5680
  'TitleBar.handleKeyHome': wrapCommand(handleKeyHome),
5664
5681
  'TitleBar.handleKeySpace': wrapCommand(handleKeySpace),
5665
5682
  'TitleBar.handleMenuClick': wrapCommand(handleMenuClick),
5683
+ 'TitleBar.handleMenuMouseLeave': wrapCommand(handleMenuMouseLeave),
5666
5684
  'TitleBar.handleMenuMouseOver': wrapCommand(handleMenuMouseOver),
5667
5685
  'TitleBar.handleMessagePort': handleDirectMessagePort,
5668
5686
  'TitleBar.handleMouseOut': wrapCommand(handleMouseOut),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "4.25.2",
3
+ "version": "4.25.4",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",