@lvce-editor/title-bar-worker 3.17.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.
@@ -1041,10 +1041,21 @@ const createMockRpc = ({
1041
1041
  };
1042
1042
 
1043
1043
  const ContentInfo = 'contentinfo';
1044
+ const Menu$1 = 'menu';
1045
+ const MenuBar$1 = 'menubar';
1046
+ const MenuItem$1 = 'menuitem';
1047
+ const MenuItemCheckBox = 'menuitemcheckbox';
1048
+ const None$1 = 'none';
1049
+ const Separator$2 = 'separator';
1044
1050
 
1045
- const Div$1 = 4;
1051
+ const Button$1 = 1;
1052
+ const Div = 4;
1053
+ const Span = 8;
1054
+ const Text = 12;
1055
+ const I = 16;
1056
+ const Img = 17;
1046
1057
 
1047
- const Button$1 = 'event.button';
1058
+ const Button = 'event.button';
1048
1059
  const ClientX = 'event.clientX';
1049
1060
  const ClientY = 'event.clientY';
1050
1061
  const TargetName = 'event.target.name';
@@ -1052,16 +1063,16 @@ const TargetName = 'event.target.name';
1052
1063
  const Backspace$1 = 1;
1053
1064
  const Tab$1 = 2;
1054
1065
  const Enter$1 = 3;
1055
- const Escape$2 = 8;
1056
- const Space$2 = 9;
1066
+ const Escape$1 = 8;
1067
+ const Space$1 = 9;
1057
1068
  const PageUp$1 = 10;
1058
1069
  const PageDown$1 = 11;
1059
- const End$2 = 255;
1060
- const Home$2 = 12;
1061
- const LeftArrow$2 = 13;
1062
- const UpArrow$2 = 14;
1063
- const RightArrow$2 = 15;
1064
- const DownArrow$2 = 16;
1070
+ const End$1 = 255;
1071
+ const Home$1 = 12;
1072
+ const LeftArrow$1 = 13;
1073
+ const UpArrow$1 = 14;
1074
+ const RightArrow$1 = 15;
1075
+ const DownArrow$1 = 16;
1065
1076
  const Insert$1 = 17;
1066
1077
  const Delete$1 = 18;
1067
1078
  const Digit0$1 = 19;
@@ -1118,16 +1129,16 @@ const Unknown = 'Unknown';
1118
1129
  const Backspace = 'Backspace';
1119
1130
  const Tab = 'Tab';
1120
1131
  const Enter = 'Enter';
1121
- const Escape$1 = 'Escape';
1122
- const Space$1 = 'Space';
1132
+ const Escape = 'Escape';
1133
+ const Space = 'Space';
1123
1134
  const PageUp = 'PageUp';
1124
1135
  const PageDown = 'PageDown';
1125
- const End$1 = 'End';
1126
- const Home$1 = 'Home';
1127
- const LeftArrow$1 = 'LeftArrow';
1128
- const UpArrow$1 = 'UpArrow';
1129
- const RightArrow$1 = 'RightArrow';
1130
- const DownArrow$1 = 'DownArrow';
1136
+ const End = 'End';
1137
+ const Home = 'Home';
1138
+ const LeftArrow = 'LeftArrow';
1139
+ const UpArrow = 'UpArrow';
1140
+ const RightArrow = 'RightArrow';
1141
+ const DownArrow = 'DownArrow';
1131
1142
  const Insert = 'Insert';
1132
1143
  const Delete = 'Delete';
1133
1144
  const Digit0 = '0';
@@ -1212,16 +1223,16 @@ const getKeyCodeString = keyCode => {
1212
1223
  return Digit8;
1213
1224
  case Digit9$1:
1214
1225
  return Digit9;
1215
- case DownArrow$2:
1216
- return DownArrow$1;
1217
- case End$2:
1218
- return End$1;
1226
+ case DownArrow$1:
1227
+ return DownArrow;
1228
+ case End$1:
1229
+ return End;
1219
1230
  case Enter$1:
1220
1231
  return Enter;
1221
1232
  case Equal$1:
1222
1233
  return Equal;
1223
- case Escape$2:
1224
- return Escape$1;
1234
+ case Escape$1:
1235
+ return Escape;
1225
1236
  case F1$1:
1226
1237
  return F1;
1227
1238
  case F2$1:
@@ -1234,8 +1245,8 @@ const getKeyCodeString = keyCode => {
1234
1245
  return F5;
1235
1246
  case F6$1:
1236
1247
  return F6;
1237
- case Home$2:
1238
- return Home$1;
1248
+ case Home$1:
1249
+ return Home;
1239
1250
  case Insert$1:
1240
1251
  return Insert;
1241
1252
  case KeyA$1:
@@ -1290,8 +1301,8 @@ const getKeyCodeString = keyCode => {
1290
1301
  return KeyY;
1291
1302
  case KeyZ$1:
1292
1303
  return KeyZ;
1293
- case LeftArrow$2:
1294
- return LeftArrow$1;
1304
+ case LeftArrow$1:
1305
+ return LeftArrow;
1295
1306
  case Minus$1:
1296
1307
  return Minus;
1297
1308
  case PageDown$1:
@@ -1300,16 +1311,16 @@ const getKeyCodeString = keyCode => {
1300
1311
  return PageUp;
1301
1312
  case Plus$1:
1302
1313
  return Plus;
1303
- case RightArrow$2:
1304
- return RightArrow$1;
1305
- case Space$2:
1306
- return Space$1;
1314
+ case RightArrow$1:
1315
+ return RightArrow;
1316
+ case Space$1:
1317
+ return Space;
1307
1318
  case Star$1:
1308
1319
  return Star;
1309
1320
  case Tab$1:
1310
1321
  return Tab;
1311
- case UpArrow$2:
1312
- return UpArrow$1;
1322
+ case UpArrow$1:
1323
+ return UpArrow;
1313
1324
  default:
1314
1325
  return Unknown;
1315
1326
  }
@@ -1326,7 +1337,7 @@ const OpenRecent$1 = 9;
1326
1337
  const Run$2 = 10;
1327
1338
  const Selection$2 = 11;
1328
1339
  const Terminal$2 = 14;
1329
- const TitleBar$1 = 15;
1340
+ const TitleBar$2 = 15;
1330
1341
  const View$2 = 16;
1331
1342
  const TitleBarContextMenu = 90;
1332
1343
 
@@ -1412,24 +1423,22 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1412
1423
  number(menuId);
1413
1424
  number(x);
1414
1425
  number(y);
1415
- // @ts-ignore
1416
1426
  await invoke('ContextMenu.show2', uid, menuId, x, y, args);
1417
1427
  };
1418
1428
  const sendMessagePortToTextMeasurementWorker = async port => {
1419
1429
  const command = 'TextMeasurement.handleMessagePort';
1420
- // @ts-ignore
1421
1430
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
1422
1431
  };
1432
+ const getWindowId$1 = async () => {
1433
+ return invoke('GetWindowId.getWindowId');
1434
+ };
1423
1435
  const minimizeWindow = async () => {
1424
- // @ts-ignore
1425
1436
  return invoke('ElectronWindow.minimize');
1426
1437
  };
1427
1438
  const maximizeWindow = async () => {
1428
- // @ts-ignore
1429
1439
  return invoke('ElectronWindow.maximize');
1430
1440
  };
1431
1441
  const closeWindow = async () => {
1432
- // @ts-ignore
1433
1442
  return invoke('ElectronWindow.close');
1434
1443
  };
1435
1444
 
@@ -1594,7 +1603,8 @@ const CheckForUpdates = 'Check For Updates';
1594
1603
  const ClearRecentlyOpened = 'Clear Recently Opened';
1595
1604
  const Close = 'Close';
1596
1605
  const Exit = 'Exit';
1597
- const MenuBar$1 = 'Menu Bar';
1606
+ const TitleBar$1 = 'Title Bar';
1607
+ const MenuBar = 'Menu Bar';
1598
1608
  const CommandCenter = 'Command Center';
1599
1609
  const Edit$1 = 'Edit';
1600
1610
  const File$2 = 'File';
@@ -1665,8 +1675,11 @@ const maximize$1 = () => {
1665
1675
  const close$1 = () => {
1666
1676
  return i18nString(Close);
1667
1677
  };
1678
+ const titleBar = () => {
1679
+ return i18nString(TitleBar$1);
1680
+ };
1668
1681
  const menuBar = () => {
1669
- return i18nString(MenuBar$1);
1682
+ return i18nString(MenuBar);
1670
1683
  };
1671
1684
  const commandCenter = () => {
1672
1685
  return i18nString(CommandCenter);
@@ -1825,8 +1838,8 @@ const diff3 = uid => {
1825
1838
  return diffResult;
1826
1839
  };
1827
1840
 
1828
- const Separator$2 = 1;
1829
- const None$1 = 0;
1841
+ const Separator$1 = 1;
1842
+ const None = 0;
1830
1843
  const SubMenu$1 = 4;
1831
1844
  const Checked = 2;
1832
1845
  const Unchecked = 3;
@@ -1860,7 +1873,7 @@ const getMenuEntriesTitleBarContextMenu = async state => {
1860
1873
 
1861
1874
  const MenuIdTitleBarContextMenu = 50;
1862
1875
  const getMenuIds = () => {
1863
- 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];
1864
1877
  };
1865
1878
 
1866
1879
  const cut = () => {
@@ -1929,7 +1942,7 @@ const selectAllOccurrences = () => {
1929
1942
 
1930
1943
  const menuEntrySeparator = {
1931
1944
  command: '',
1932
- flags: Separator$2,
1945
+ flags: Separator$1,
1933
1946
  id: 'separator',
1934
1947
  label: ''
1935
1948
  };
@@ -1937,37 +1950,37 @@ const menuEntrySeparator = {
1937
1950
  const getMenuEntries$c = () => {
1938
1951
  return [{
1939
1952
  command: /* TODO */'-1',
1940
- flags: None$1,
1953
+ flags: None,
1941
1954
  id: 'undo',
1942
1955
  label: undo()
1943
1956
  }, {
1944
1957
  command: /* TODO */'-1',
1945
- flags: None$1,
1958
+ flags: None,
1946
1959
  id: 'redo',
1947
1960
  label: redo()
1948
1961
  }, menuEntrySeparator, {
1949
1962
  command: /* Editor.cut */'Editor.cut',
1950
- flags: None$1,
1963
+ flags: None,
1951
1964
  id: 'cut',
1952
1965
  label: cut()
1953
1966
  }, {
1954
1967
  command: /* Editor.copy */'Editor.copy',
1955
- flags: None$1,
1968
+ flags: None,
1956
1969
  id: 'copy',
1957
1970
  label: copy()
1958
1971
  }, {
1959
1972
  command: /* Editor.paste */'Editor.paste',
1960
- flags: None$1,
1973
+ flags: None,
1961
1974
  id: 'paste',
1962
1975
  label: paste()
1963
1976
  }, menuEntrySeparator, {
1964
1977
  command: /* Editor.toggleLineComment */'Editor.toggleLineComment',
1965
- flags: None$1,
1978
+ flags: None,
1966
1979
  id: 'toggle-line-comment',
1967
1980
  label: toggleLineComment()
1968
1981
  }, {
1969
1982
  command: /* Editor.toggleBlockComment */'Editor.toggleBlockComment',
1970
- flags: None$1,
1983
+ flags: None,
1971
1984
  id: 'toggle-block-comment',
1972
1985
  label: toggleBlockComment()
1973
1986
  }];
@@ -2023,18 +2036,18 @@ const View = 16;
2023
2036
 
2024
2037
  const getMenuEntries$b = platform => {
2025
2038
  const entries = [{
2026
- command: '-1',
2027
- flags: None$1,
2039
+ command: 'Main.newFile',
2040
+ flags: None,
2028
2041
  id: 'newFile',
2029
2042
  label: newFile()
2030
2043
  }, {
2031
2044
  command: 'Window.openNew',
2032
- flags: None$1,
2045
+ flags: None,
2033
2046
  id: 'newWindow',
2034
2047
  label: newWindow()
2035
2048
  }, menuEntrySeparator, {
2036
2049
  command: 'Dialog.openFile',
2037
- flags: None$1,
2050
+ flags: None,
2038
2051
  id: 'openFile',
2039
2052
  label: openFile()
2040
2053
  }, {
@@ -2049,12 +2062,12 @@ const getMenuEntries$b = platform => {
2049
2062
  label: openRecent()
2050
2063
  }, menuEntrySeparator, {
2051
2064
  command: 'Main.save',
2052
- flags: None$1,
2065
+ flags: None,
2053
2066
  id: 'save',
2054
2067
  label: save()
2055
2068
  }, {
2056
2069
  command: 'Main.saveAll',
2057
- flags: None$1,
2070
+ flags: None,
2058
2071
  id: 'saveAll',
2059
2072
  label: saveAll()
2060
2073
  }];
@@ -2099,7 +2112,7 @@ const getMenuEntries$9 = async platform => {
2099
2112
  if (platform !== Web) {
2100
2113
  entries.push({
2101
2114
  command: 'Developer.toggleDeveloperTools',
2102
- flags: None$1,
2115
+ flags: None,
2103
2116
  id: 'toggleDeveloperTools',
2104
2117
  label: toggleDeveloperTools()
2105
2118
  }, {
@@ -2122,7 +2135,7 @@ const getMenuEntries$9 = async platform => {
2122
2135
  }
2123
2136
  entries.push({
2124
2137
  command: 'About.showAbout',
2125
- flags: None$1,
2138
+ flags: None,
2126
2139
  id: 'about',
2127
2140
  label: about()
2128
2141
  });
@@ -2163,7 +2176,7 @@ const toMenuItem = folder => {
2163
2176
  return {
2164
2177
  args: [folder],
2165
2178
  command: 'Workspace.setPath',
2166
- flags: None$1,
2179
+ flags: None,
2167
2180
  label
2168
2181
  };
2169
2182
  };
@@ -2176,12 +2189,12 @@ const getMenuEntries$8 = async () => {
2176
2189
  }
2177
2190
  items.push({
2178
2191
  command: 'QuickPick.showRecent',
2179
- flags: None$1,
2192
+ flags: None,
2180
2193
  id: 'more',
2181
2194
  label: moreDot()
2182
2195
  }, menuEntrySeparator, {
2183
2196
  command: 'RecentlyOpened.clearRecentlyOpened',
2184
- flags: None$1,
2197
+ flags: None,
2185
2198
  id: 'clearRecentlyOpened',
2186
2199
  label: clearRecentlyOpened()
2187
2200
  });
@@ -2195,72 +2208,72 @@ const getMenuEntries$7 = () => {
2195
2208
  const getMenuEntries$6 = () => {
2196
2209
  return [{
2197
2210
  command: 'Editor.selectAll',
2198
- flags: None$1,
2211
+ flags: None,
2199
2212
  id: 'selectAll',
2200
2213
  label: selectAll()
2201
2214
  }, {
2202
2215
  command: 'Editor.expandSelection',
2203
- flags: None$1,
2216
+ flags: None,
2204
2217
  id: 'expandSelection',
2205
2218
  label: expandSelection()
2206
2219
  }, {
2207
2220
  command: 'Editor.shrinkSelection',
2208
- flags: None$1,
2221
+ flags: None,
2209
2222
  id: 'shrinkSelection',
2210
2223
  label: shrinkSelection()
2211
2224
  }, menuEntrySeparator, {
2212
2225
  command: 'Editor.copyLineUp',
2213
- flags: None$1,
2226
+ flags: None,
2214
2227
  id: 'copyLineUp',
2215
2228
  label: copyLineUp()
2216
2229
  }, {
2217
2230
  command: 'Editor.copyLineDown',
2218
- flags: None$1,
2231
+ flags: None,
2219
2232
  id: 'copyLineDown',
2220
2233
  label: copyLineDown()
2221
2234
  }, {
2222
2235
  command: 'Editor.moveLineUp',
2223
- flags: None$1,
2236
+ flags: None,
2224
2237
  id: 'moveLineUp',
2225
2238
  label: moveLineUp()
2226
2239
  }, {
2227
2240
  command: 'Editor.moveLineDown',
2228
- flags: None$1,
2241
+ flags: None,
2229
2242
  id: 'moveLineDown',
2230
2243
  label: moveLineDown()
2231
2244
  }, {
2232
2245
  command: 'Editor.duplicateSelection',
2233
- flags: None$1,
2246
+ flags: None,
2234
2247
  id: 'duplicateSelection',
2235
2248
  label: duplicateSelection()
2236
2249
  }, menuEntrySeparator, {
2237
2250
  command: 'Editor.addCursorAbove',
2238
- flags: None$1,
2251
+ flags: None,
2239
2252
  id: 'addCursorAbove',
2240
2253
  label: addCursorAbove()
2241
2254
  }, {
2242
2255
  command: 'Editor.addCursorBelow',
2243
- flags: None$1,
2256
+ flags: None,
2244
2257
  id: 'addCursorBelow',
2245
2258
  label: addCursorBelow()
2246
2259
  }, {
2247
2260
  command: 'Editor.addCursorsToLineEnds',
2248
- flags: None$1,
2261
+ flags: None,
2249
2262
  id: 'addCursorsToLineEnds',
2250
2263
  label: addCursorsToLineEnds()
2251
2264
  }, {
2252
2265
  command: 'Editor.addNextOccurrence',
2253
- flags: None$1,
2266
+ flags: None,
2254
2267
  id: 'addNextOccurrence',
2255
2268
  label: addNextOccurrence()
2256
2269
  }, {
2257
2270
  command: 'Editor.addPreviousOccurrence',
2258
- flags: None$1,
2271
+ flags: None,
2259
2272
  id: 'addPreviousOccurrence',
2260
2273
  label: addPreviousOccurrence()
2261
2274
  }, {
2262
2275
  command: 'Editor.selectAllOccurrences',
2263
- flags: None$1,
2276
+ flags: None,
2264
2277
  id: 'selectAllOccurrences',
2265
2278
  label: selectAllOccurrences()
2266
2279
  }];
@@ -2270,7 +2283,7 @@ const getMenuEntries$5 = () => {
2270
2283
  return [{
2271
2284
  args: ['Terminal'],
2272
2285
  command: 'Layout.togglePanel',
2273
- flags: None$1,
2286
+ flags: None,
2274
2287
  id: 'newTerminal',
2275
2288
  label: i18nString(NewTerminal)
2276
2289
  }];
@@ -2326,32 +2339,32 @@ const getMenuEntries$4 = () => {
2326
2339
  const getMenuEntries$3 = () => {
2327
2340
  return [{
2328
2341
  command: '',
2329
- flags: None$1,
2342
+ flags: None,
2330
2343
  id: File$1,
2331
2344
  label: file()
2332
2345
  }, {
2333
2346
  command: '',
2334
- flags: None$1,
2347
+ flags: None,
2335
2348
  id: Edit,
2336
2349
  label: edit()
2337
2350
  }, {
2338
2351
  command: '',
2339
- flags: None$1,
2352
+ flags: None,
2340
2353
  id: Selection,
2341
2354
  label: selection()
2342
2355
  }, {
2343
2356
  command: '',
2344
- flags: None$1,
2357
+ flags: None,
2345
2358
  id: View,
2346
2359
  label: view()
2347
2360
  }, {
2348
2361
  command: '',
2349
- flags: None$1,
2362
+ flags: None,
2350
2363
  id: Go,
2351
2364
  label: go()
2352
2365
  }, {
2353
2366
  command: '',
2354
- flags: None$1,
2367
+ flags: None,
2355
2368
  id: Help$1,
2356
2369
  label: help()
2357
2370
  }];
@@ -2392,7 +2405,7 @@ const getMenuEntries2 = async (state, props) => {
2392
2405
  return getMenuEntries$6();
2393
2406
  case Terminal$2:
2394
2407
  return getMenuEntries$5();
2395
- case TitleBar$1:
2408
+ case TitleBar$2:
2396
2409
  return getMenuEntries$2(props.platform);
2397
2410
  case TitleBarContextMenu:
2398
2411
  case MenuIdTitleBarContextMenu:
@@ -2420,7 +2433,7 @@ const getEntryMap = async (state, menuIds, platform) => {
2420
2433
  // TODO cache window id
2421
2434
 
2422
2435
  const getWindowId = async () => {
2423
- const windowId = await invoke('GetWindowId.getWindowId');
2436
+ const windowId = await getWindowId$1();
2424
2437
  return windowId;
2425
2438
  };
2426
2439
 
@@ -2439,7 +2452,7 @@ const FileMenu = 'fileMenu';
2439
2452
  const EditMenu = 'editMenu';
2440
2453
 
2441
2454
  // based on https://www.electronjs.org/docs/latest/api/menu-item#new-menuitemoptions
2442
- const Separator$1 = 'separator';
2455
+ const Separator = 'separator';
2443
2456
  const SubMenu = 'submenu';
2444
2457
 
2445
2458
  const toElectronMenuItem = entry => {
@@ -2504,9 +2517,9 @@ const toElectronMenuItem = entry => {
2504
2517
  };
2505
2518
  }
2506
2519
  switch (entry.flags) {
2507
- case Separator$2:
2520
+ case Separator$1:
2508
2521
  return {
2509
- type: Separator$1
2522
+ type: Separator
2510
2523
  };
2511
2524
  case SubMenu$1:
2512
2525
  return {
@@ -2581,29 +2594,6 @@ const hydrate = async state => {
2581
2594
  };
2582
2595
  };
2583
2596
 
2584
- const Menu$1 = 'menu';
2585
- const MenuBar = 'menubar';
2586
- const MenuItem$1 = 'menuitem';
2587
- const MenuItemCheckBox = 'menuitemcheckbox';
2588
- const None = 'none';
2589
- const Separator = 'separator';
2590
-
2591
- const Button = 1;
2592
- const Div = 4;
2593
- const Span = 8;
2594
- const Text = 12;
2595
- const I = 16;
2596
- const Img = 17;
2597
-
2598
- const Escape = 8;
2599
- const Space = 9;
2600
- const End = 255;
2601
- const Home = 12;
2602
- const LeftArrow = 13;
2603
- const UpArrow = 14;
2604
- const RightArrow = 15;
2605
- const DownArrow = 16;
2606
-
2607
2597
  const mergeClassNames = (...classNames) => {
2608
2598
  return classNames.filter(Boolean).join(' ');
2609
2599
  };
@@ -2623,35 +2613,35 @@ const text = data => {
2623
2613
  const getKeyBindings = () => {
2624
2614
  return [{
2625
2615
  command: 'TitleBar.handleKeyArrowDown',
2626
- key: DownArrow,
2616
+ key: DownArrow$1,
2627
2617
  when: FocusTitleBarMenuBar
2628
2618
  }, {
2629
2619
  command: 'TitleBar.handleKeyArrowUp',
2630
- key: UpArrow,
2620
+ key: UpArrow$1,
2631
2621
  when: FocusTitleBarMenuBar
2632
2622
  }, {
2633
2623
  command: 'TitleBar.handleKeyArrowRight',
2634
- key: RightArrow,
2624
+ key: RightArrow$1,
2635
2625
  when: FocusTitleBarMenuBar
2636
2626
  }, {
2637
2627
  command: 'TitleBar.handleKeyArrowLeft',
2638
- key: LeftArrow,
2628
+ key: LeftArrow$1,
2639
2629
  when: FocusTitleBarMenuBar
2640
2630
  }, {
2641
2631
  command: 'TitleBar.handleKeySpace',
2642
- key: Space,
2632
+ key: Space$1,
2643
2633
  when: FocusTitleBarMenuBar
2644
2634
  }, {
2645
2635
  command: 'TitleBar.handleKeyHome',
2646
- key: Home,
2636
+ key: Home$1,
2647
2637
  when: FocusTitleBarMenuBar
2648
2638
  }, {
2649
2639
  command: 'TitleBar.handleKeyEnd',
2650
- key: End,
2640
+ key: End$1,
2651
2641
  when: FocusTitleBarMenuBar
2652
2642
  }, {
2653
2643
  command: 'TitleBar.handleKeyEscape',
2654
- key: Escape,
2644
+ key: Escape$1,
2655
2645
  when: FocusTitleBarMenuBar
2656
2646
  }];
2657
2647
  };
@@ -2682,15 +2672,14 @@ const handleClickToggleMaximize = async state => {
2682
2672
  return state;
2683
2673
  };
2684
2674
 
2685
- // TODO use button name property
2686
- const handleClick$1 = async (state, className) => {
2687
- if (className.includes('Minimize')) {
2675
+ const handleClick$1 = async (state, buttonName) => {
2676
+ if (buttonName === 'Minimize') {
2688
2677
  return handleClickMinimize(state);
2689
2678
  }
2690
- if (className.includes('Maximize') || className.includes('Restore')) {
2679
+ if (buttonName === 'ToggleMaximize') {
2691
2680
  return handleClickToggleMaximize(state);
2692
2681
  }
2693
- if (className.includes('Close')) {
2682
+ if (buttonName === 'Close') {
2694
2683
  return handleClickClose(state);
2695
2684
  }
2696
2685
  return state;
@@ -2760,7 +2749,7 @@ const getMenuHeight = items => {
2760
2749
  let height = CONTEXT_MENU_PADDING;
2761
2750
  for (const item of items) {
2762
2751
  switch (item.flags) {
2763
- case Separator$2:
2752
+ case Separator$1:
2764
2753
  height += CONTEXT_MENU_SEPARATOR_HEIGHT;
2765
2754
  break;
2766
2755
  default:
@@ -2817,7 +2806,7 @@ const getIndexToFocusPrevious = menu => {
2817
2806
  const canBeFocused = item => {
2818
2807
  switch (item.flags) {
2819
2808
  case Disabled:
2820
- case Separator$2:
2809
+ case Separator$1:
2821
2810
  return false;
2822
2811
  default:
2823
2812
  return true;
@@ -3271,7 +3260,7 @@ const getMenuItemsNoopDom = () => {
3271
3260
  const separator = {
3272
3261
  childCount: 1,
3273
3262
  className: MenuItemSeparator,
3274
- role: Separator,
3263
+ role: Separator$2,
3275
3264
  type: Div
3276
3265
  };
3277
3266
  const separatorLine = {
@@ -3331,10 +3320,10 @@ const getMenuItemRenderer = flags => {
3331
3320
  case Disabled:
3332
3321
  return getMenuItemDisabledDom;
3333
3322
  case Ignore:
3334
- case None$1:
3323
+ case None:
3335
3324
  case RestoreFocus:
3336
3325
  return getMenuItemDefaultDom;
3337
- case Separator$2:
3326
+ case Separator$1:
3338
3327
  return getMenuItemSeparatorDom;
3339
3328
  case SubMenu$1:
3340
3329
  return getMenuItemSubMenuDom;
@@ -3429,7 +3418,7 @@ const getIconVirtualDom = (icon, type = Div) => {
3429
3418
  return {
3430
3419
  childCount: 0,
3431
3420
  className: `MaskIcon MaskIcon${icon}`,
3432
- role: None,
3421
+ role: None$1,
3433
3422
  type
3434
3423
  };
3435
3424
  };
@@ -3445,8 +3434,9 @@ const createTitleBarButton = button => {
3445
3434
  ariaLabel: label,
3446
3435
  childCount: 1,
3447
3436
  className: `TitleBarButton TitleBarButton${id}`,
3437
+ name: id,
3448
3438
  onClick,
3449
- type: Button
3439
+ type: Button$1
3450
3440
  }, getIconVirtualDom(icon, I)];
3451
3441
  return dom;
3452
3442
  };
@@ -3503,7 +3493,7 @@ const getItemVirtualDom = item => {
3503
3493
  name: label,
3504
3494
  // TODO have separate name attribute
3505
3495
  role: MenuItem$1,
3506
- type: Button
3496
+ type: Button$1
3507
3497
  }, ...(isFocused ? [{
3508
3498
  childCount: 1,
3509
3499
  className: TitleBarTopLevelEntryLabel,
@@ -3529,7 +3519,7 @@ const getTitleBarMenuBarVirtualDom = (menuBarEnabled, visibleItems, focusedIndex
3529
3519
  onMouseDown: HandleClick,
3530
3520
  onPointerOut: HandlePointerOut,
3531
3521
  onPointerOver: HandlePointerOver,
3532
- role: MenuBar,
3522
+ role: MenuBar$1,
3533
3523
  tabIndex: 0,
3534
3524
  type: Div
3535
3525
  }, ...getTitleBarMenuBarItemsVirtualDom(visibleItems)];
@@ -3538,7 +3528,7 @@ const getTitleBarMenuBarVirtualDom = (menuBarEnabled, visibleItems, focusedIndex
3538
3528
  const parentNode = {
3539
3529
  childCount: 1,
3540
3530
  className: 'TitleBarTitle',
3541
- type: Div$1
3531
+ type: Div
3542
3532
  };
3543
3533
  const getTitleVirtualDom = (titleBarTitleEnabled, title) => {
3544
3534
  if (!titleBarTitleEnabled) {
@@ -3606,19 +3596,18 @@ const getTitleBarVirtualDom = state => {
3606
3596
  if (platform === Electron$1 && !titleBarStyleCustom) {
3607
3597
  return [{
3608
3598
  childCount: 0,
3609
- type: Div$1
3599
+ type: Div
3610
3600
  }];
3611
3601
  }
3612
3602
  const iconSrc = getIcon(assetDir);
3613
3603
  const visibleEntries = getVisibleTitleBarEntries(titleBarEntries, width, focusedIndex, isMenuOpen);
3614
3604
  return [{
3615
- ariaLabel: 'Title Bar',
3616
- // TODO i18n string
3605
+ ariaLabel: titleBar(),
3617
3606
  childCount: 4,
3618
3607
  className: 'Viewlet TitleBar',
3619
3608
  id: 'TitleBar',
3620
3609
  role: ContentInfo,
3621
- type: Div$1
3610
+ type: Div
3622
3611
  }, ...getTitleBarIconVirtualDom(titleBarIconEnabled, iconSrc), ...getTitleBarMenuBarVirtualDom(titleBarMenuBarEnabled, visibleEntries, focusedIndex), ...getTitleVirtualDom(titleBarTitleEnabled, title), ...getTitleBarButtonsVirtualDom(titleBarButtonsEnabled, titleBarButtons)];
3623
3612
  };
3624
3613
 
@@ -3665,7 +3654,7 @@ const renderEventListeners = () => {
3665
3654
  params: ['handleClickMinimize']
3666
3655
  }, {
3667
3656
  name: HandleContextMenu,
3668
- params: ['handleContextMenu', Button$1, ClientX, ClientY]
3657
+ params: ['handleContextMenu', Button, ClientX, ClientY]
3669
3658
  }, {
3670
3659
  name: HandleClickClose,
3671
3660
  params: ['handleClickClose']
@@ -3683,7 +3672,7 @@ const renderEventListeners = () => {
3683
3672
  params: ['handleMenuMouseOver', ClientX, ClientY]
3684
3673
  }, {
3685
3674
  name: HandleClick,
3686
- params: ['handleClickAt', Button$1, ClientX, ClientY]
3675
+ params: ['handleClickAt', Button, ClientX, ClientY]
3687
3676
  }, {
3688
3677
  name: HandlePointerOut,
3689
3678
  params: ['handlePointerOut', ClientX, ClientY]
@@ -3983,7 +3972,7 @@ const getFn = id => {
3983
3972
  return getMenuEntries$6;
3984
3973
  case Terminal$2:
3985
3974
  return getMenuEntries$5;
3986
- case TitleBar$1:
3975
+ case TitleBar$2:
3987
3976
  return getMenuEntries$2;
3988
3977
  case View$2:
3989
3978
  return getMenuEntries$1;
@@ -4217,7 +4206,7 @@ const handleMenuClick = async (state, level, index) => {
4217
4206
  switch (item.flags) {
4218
4207
  case Ignore:
4219
4208
  return selectIndexIgnore(state, item);
4220
- case None$1:
4209
+ case None:
4221
4210
  return selectIndexNone(state, item);
4222
4211
  case RestoreFocus:
4223
4212
  return selectIndexRestoreFocus(state, item);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "3.17.0",
3
+ "version": "3.19.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",