@lvce-editor/title-bar-worker 3.18.0 → 3.19.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.
@@ -1337,7 +1337,7 @@ const OpenRecent$1 = 9;
1337
1337
  const Run$2 = 10;
1338
1338
  const Selection$2 = 11;
1339
1339
  const Terminal$2 = 14;
1340
- const TitleBar$1 = 15;
1340
+ const TitleBar$2 = 15;
1341
1341
  const View$2 = 16;
1342
1342
  const TitleBarContextMenu = 90;
1343
1343
 
@@ -1423,24 +1423,22 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1423
1423
  number(menuId);
1424
1424
  number(x);
1425
1425
  number(y);
1426
- // @ts-ignore
1427
1426
  await invoke('ContextMenu.show2', uid, menuId, x, y, args);
1428
1427
  };
1429
1428
  const sendMessagePortToTextMeasurementWorker = async port => {
1430
1429
  const command = 'TextMeasurement.handleMessagePort';
1431
- // @ts-ignore
1432
1430
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
1433
1431
  };
1432
+ const getWindowId$1 = async () => {
1433
+ return invoke('GetWindowId.getWindowId');
1434
+ };
1434
1435
  const minimizeWindow = async () => {
1435
- // @ts-ignore
1436
1436
  return invoke('ElectronWindow.minimize');
1437
1437
  };
1438
1438
  const maximizeWindow = async () => {
1439
- // @ts-ignore
1440
1439
  return invoke('ElectronWindow.maximize');
1441
1440
  };
1442
1441
  const closeWindow = async () => {
1443
- // @ts-ignore
1444
1442
  return invoke('ElectronWindow.close');
1445
1443
  };
1446
1444
 
@@ -1605,6 +1603,7 @@ const CheckForUpdates = 'Check For Updates';
1605
1603
  const ClearRecentlyOpened = 'Clear Recently Opened';
1606
1604
  const Close = 'Close';
1607
1605
  const Exit = 'Exit';
1606
+ const TitleBar$1 = 'Title Bar';
1608
1607
  const MenuBar = 'Menu Bar';
1609
1608
  const CommandCenter = 'Command Center';
1610
1609
  const Edit$1 = 'Edit';
@@ -1676,6 +1675,9 @@ const maximize$1 = () => {
1676
1675
  const close$1 = () => {
1677
1676
  return i18nString(Close);
1678
1677
  };
1678
+ const titleBar = () => {
1679
+ return i18nString(TitleBar$1);
1680
+ };
1679
1681
  const menuBar = () => {
1680
1682
  return i18nString(MenuBar);
1681
1683
  };
@@ -1871,7 +1873,7 @@ const getMenuEntriesTitleBarContextMenu = async state => {
1871
1873
 
1872
1874
  const MenuIdTitleBarContextMenu = 50;
1873
1875
  const getMenuIds = () => {
1874
- return [Edit$2, File$3, Go$2, Help$3, OpenRecent$1, Run$2, Selection$2, Terminal$2, TitleBar$1, View$2, MenuIdTitleBarContextMenu, TitleBarContextMenu];
1876
+ return [Edit$2, File$3, Go$2, Help$3, OpenRecent$1, Run$2, Selection$2, Terminal$2, TitleBar$2, View$2, MenuIdTitleBarContextMenu, TitleBarContextMenu];
1875
1877
  };
1876
1878
 
1877
1879
  const cut = () => {
@@ -2403,7 +2405,7 @@ const getMenuEntries2 = async (state, props) => {
2403
2405
  return getMenuEntries$6();
2404
2406
  case Terminal$2:
2405
2407
  return getMenuEntries$5();
2406
- case TitleBar$1:
2408
+ case TitleBar$2:
2407
2409
  return getMenuEntries$2(props.platform);
2408
2410
  case TitleBarContextMenu:
2409
2411
  case MenuIdTitleBarContextMenu:
@@ -2431,7 +2433,7 @@ const getEntryMap = async (state, menuIds, platform) => {
2431
2433
  // TODO cache window id
2432
2434
 
2433
2435
  const getWindowId = async () => {
2434
- const windowId = await invoke('GetWindowId.getWindowId');
2436
+ const windowId = await getWindowId$1();
2435
2437
  return windowId;
2436
2438
  };
2437
2439
 
@@ -2670,15 +2672,14 @@ const handleClickToggleMaximize = async state => {
2670
2672
  return state;
2671
2673
  };
2672
2674
 
2673
- // TODO use button name property
2674
- const handleClick$1 = async (state, className) => {
2675
- if (className.includes('Minimize')) {
2675
+ const handleClick$1 = async (state, buttonName) => {
2676
+ if (buttonName === 'Minimize') {
2676
2677
  return handleClickMinimize(state);
2677
2678
  }
2678
- if (className.includes('Maximize') || className.includes('Restore')) {
2679
+ if (buttonName === 'ToggleMaximize') {
2679
2680
  return handleClickToggleMaximize(state);
2680
2681
  }
2681
- if (className.includes('Close')) {
2682
+ if (buttonName === 'Close') {
2682
2683
  return handleClickClose(state);
2683
2684
  }
2684
2685
  return state;
@@ -3433,6 +3434,7 @@ const createTitleBarButton = button => {
3433
3434
  ariaLabel: label,
3434
3435
  childCount: 1,
3435
3436
  className: `TitleBarButton TitleBarButton${id}`,
3437
+ name: id,
3436
3438
  onClick,
3437
3439
  type: Button$1
3438
3440
  }, getIconVirtualDom(icon, I)];
@@ -3600,8 +3602,7 @@ const getTitleBarVirtualDom = state => {
3600
3602
  const iconSrc = getIcon(assetDir);
3601
3603
  const visibleEntries = getVisibleTitleBarEntries(titleBarEntries, width, focusedIndex, isMenuOpen);
3602
3604
  return [{
3603
- ariaLabel: 'Title Bar',
3604
- // TODO i18n string
3605
+ ariaLabel: titleBar(),
3605
3606
  childCount: 4,
3606
3607
  className: 'Viewlet TitleBar',
3607
3608
  id: 'TitleBar',
@@ -3971,7 +3972,7 @@ const getFn = id => {
3971
3972
  return getMenuEntries$6;
3972
3973
  case Terminal$2:
3973
3974
  return getMenuEntries$5;
3974
- case TitleBar$1:
3975
+ case TitleBar$2:
3975
3976
  return getMenuEntries$2;
3976
3977
  case View$2:
3977
3978
  return getMenuEntries$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",