@lvce-editor/title-bar-worker 2.5.0 → 2.6.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.
@@ -1048,6 +1048,13 @@ const getCommandIds = () => {
1048
1048
  return commandsIds;
1049
1049
  };
1050
1050
 
1051
+ const Menu$1 = 'menu';
1052
+ const MenuBar = 'menubar';
1053
+ const MenuItem$1 = 'menuitem';
1054
+ const MenuItemCheckBox = 'menuitemcheckbox';
1055
+ const None$1 = 'none';
1056
+ const Separator$1 = 'separator';
1057
+
1051
1058
  const Button = 1;
1052
1059
  const Div = 4;
1053
1060
  const Span = 8;
@@ -1200,8 +1207,8 @@ const Terminal$1 = 14;
1200
1207
  const TitleBar = 15;
1201
1208
  const View$1 = 16;
1202
1209
 
1203
- const Separator$1 = 1;
1204
- const None$1 = 0;
1210
+ const Separator = 1;
1211
+ const None = 0;
1205
1212
  const SubMenu = 4;
1206
1213
  const Checked = 2;
1207
1214
  const Unchecked = 3;
@@ -1212,7 +1219,7 @@ const Ignore = 7;
1212
1219
  const menuEntrySeparator = {
1213
1220
  id: 'separator',
1214
1221
  label: '',
1215
- flags: Separator$1,
1222
+ flags: Separator,
1216
1223
  command: ''
1217
1224
  };
1218
1225
 
@@ -1231,27 +1238,27 @@ const getMenuEntries$d = () => {
1231
1238
  }, menuEntrySeparator, {
1232
1239
  id: 'cut',
1233
1240
  label: cut(),
1234
- flags: None$1,
1241
+ flags: None,
1235
1242
  command: /* Editor.cut */'Editor.cut'
1236
1243
  }, {
1237
1244
  id: 'copy',
1238
1245
  label: copy(),
1239
- flags: None$1,
1246
+ flags: None,
1240
1247
  command: /* Editor.copy */'Editor.copy'
1241
1248
  }, {
1242
1249
  id: 'paste',
1243
1250
  label: paste(),
1244
- flags: None$1,
1251
+ flags: None,
1245
1252
  command: /* Editor.paste */'Editor.paste'
1246
1253
  }, menuEntrySeparator, {
1247
1254
  id: 'toggle-line-comment',
1248
1255
  label: toggleLineComment(),
1249
- flags: None$1,
1256
+ flags: None,
1250
1257
  command: /* Editor.toggleLineComment */'Editor.toggleLineComment'
1251
1258
  }, {
1252
1259
  id: 'toggle-block-comment',
1253
1260
  label: toggleBlockComment(),
1254
- flags: None$1,
1261
+ flags: None,
1255
1262
  command: /* Editor.toggleBlockComment */'Editor.toggleBlockComment'
1256
1263
  }];
1257
1264
  };
@@ -1309,17 +1316,17 @@ const getMenuEntries$c = platform => {
1309
1316
  const entries = [{
1310
1317
  id: 'newFile',
1311
1318
  label: newFile(),
1312
- flags: None$1,
1319
+ flags: None,
1313
1320
  command: '-1'
1314
1321
  }, {
1315
1322
  id: 'newWindow',
1316
1323
  label: newWindow(),
1317
- flags: None$1,
1324
+ flags: None,
1318
1325
  command: /* Window.openNew */'Window.openNew'
1319
1326
  }, menuEntrySeparator, {
1320
1327
  id: 'openFile',
1321
1328
  label: openFile(),
1322
- flags: None$1,
1329
+ flags: None,
1323
1330
  command: 'Dialog.openFile'
1324
1331
  }, {
1325
1332
  id: 'openFolder',
@@ -1334,12 +1341,12 @@ const getMenuEntries$c = platform => {
1334
1341
  }, menuEntrySeparator, {
1335
1342
  id: 'save',
1336
1343
  label: save(),
1337
- flags: None$1,
1344
+ flags: None,
1338
1345
  command: 'Main.save'
1339
1346
  }, {
1340
1347
  id: 'saveAll',
1341
1348
  label: saveAll(),
1342
- flags: None$1,
1349
+ flags: None,
1343
1350
  command: 'Main.saveAll'
1344
1351
  }];
1345
1352
  if (platform === Electron) {
@@ -1416,7 +1423,7 @@ const getMenuEntries$a = async platform => {
1416
1423
  entries.push({
1417
1424
  id: 'toggleDeveloperTools',
1418
1425
  label: toggleDeveloperTools(),
1419
- flags: None$1,
1426
+ flags: None,
1420
1427
  command: 'Developer.toggleDeveloperTools'
1421
1428
  }, {
1422
1429
  id: 'openProcessExplorer',
@@ -1439,7 +1446,7 @@ const getMenuEntries$a = async platform => {
1439
1446
  entries.push({
1440
1447
  id: 'about',
1441
1448
  label: about(),
1442
- flags: None$1,
1449
+ flags: None,
1443
1450
  command: 'About.showAbout'
1444
1451
  });
1445
1452
  return entries;
@@ -1876,7 +1883,7 @@ const toMenuItem = folder => {
1876
1883
  const label = getTitle(homeDir, folder);
1877
1884
  return {
1878
1885
  label,
1879
- flags: None$1,
1886
+ flags: None,
1880
1887
  command: 'Workspace.setPath',
1881
1888
  args: [folder]
1882
1889
  };
@@ -1892,12 +1899,12 @@ const getMenuEntries$9 = async () => {
1892
1899
  items.push({
1893
1900
  id: 'more',
1894
1901
  label: moreDot(),
1895
- flags: None$1,
1902
+ flags: None,
1896
1903
  command: 'QuickPick.showRecent'
1897
1904
  }, menuEntrySeparator, {
1898
1905
  id: 'clearRecentlyOpened',
1899
1906
  label: clearRecentlyOpened(),
1900
- flags: None$1,
1907
+ flags: None,
1901
1908
  command: 'RecentlyOpened.clearRecentlyOpened'
1902
1909
  });
1903
1910
  return items;
@@ -1925,17 +1932,17 @@ const getMenuEntries$7 = () => {
1925
1932
  return [{
1926
1933
  id: 'selectAll',
1927
1934
  label: selectAll(),
1928
- flags: None$1,
1935
+ flags: None,
1929
1936
  command: 'Editor.selectAll'
1930
1937
  }, {
1931
1938
  id: 'copyLineUp',
1932
1939
  label: copyLineUp(),
1933
- flags: None$1,
1940
+ flags: None,
1934
1941
  command: 'Editor.copyLineUp'
1935
1942
  }, {
1936
1943
  id: 'copyLineDown',
1937
1944
  label: copyLineDown(),
1938
- flags: None$1,
1945
+ flags: None,
1939
1946
  command: 'Editor.copyLineDown'
1940
1947
  }, {
1941
1948
  id: 'moveLineUp',
@@ -1971,7 +1978,7 @@ const getMenuEntries$6 = () => {
1971
1978
  return [{
1972
1979
  id: 'newTerminal',
1973
1980
  label: newTerminal(),
1974
- flags: None$1,
1981
+ flags: None,
1975
1982
  command: 'Layout.togglePanel',
1976
1983
  args: ['Terminal']
1977
1984
  }];
@@ -2060,27 +2067,27 @@ const getMenuEntries$4 = () => {
2060
2067
  return [{
2061
2068
  id: File$2,
2062
2069
  label: file(),
2063
- flags: None$1
2070
+ flags: None
2064
2071
  }, {
2065
2072
  id: Edit$1,
2066
2073
  label: edit(),
2067
- flags: None$1
2074
+ flags: None
2068
2075
  }, {
2069
2076
  id: Selection$1,
2070
2077
  label: selection(),
2071
- flags: None$1
2078
+ flags: None
2072
2079
  }, {
2073
2080
  id: View$1,
2074
2081
  label: view(),
2075
- flags: None$1
2082
+ flags: None
2076
2083
  }, {
2077
2084
  id: Go$1,
2078
2085
  label: go(),
2079
- flags: None$1
2086
+ flags: None
2080
2087
  }, {
2081
2088
  id: Help$1,
2082
2089
  label: help(),
2083
- flags: None$1
2090
+ flags: None
2084
2091
  }];
2085
2092
  };
2086
2093
 
@@ -2173,8 +2180,8 @@ const getTitleBarButtons = (platform, controlsOverlayEnabled, titleBarStyleCusto
2173
2180
  };
2174
2181
 
2175
2182
  const MaskIconCheck = 'MaskIconCheck';
2176
- const Menu$1 = 'Menu';
2177
- const MenuItem$1 = 'MenuItem';
2183
+ const Menu = 'Menu';
2184
+ const MenuItem = 'MenuItem';
2178
2185
  const MenuItemCheckMark = 'MenuItemCheckMark';
2179
2186
  const MenuItemCheckmarkIcon = 'MenuItemCheckmarkIcon';
2180
2187
  const MenuItemFocused = 'MenuItemFocused';
@@ -2192,18 +2199,11 @@ const TitleBarTopLevelEntry = 'TitleBarTopLevelEntry';
2192
2199
  const TitleBarTopLevelEntryLabel = 'TitleBarTopLevelEntryLabel';
2193
2200
  const Viewlet = 'Viewlet';
2194
2201
 
2195
- const Menu = 'menu';
2196
- const MenuBar = 'menubar';
2197
- const MenuItem = 'menuitem';
2198
- const MenuItemCheckBox = 'menuitemcheckbox';
2199
- const None = 'none';
2200
- const Separator = 'separator';
2201
-
2202
2202
  const getIconVirtualDom = (icon, type = Div) => {
2203
2203
  return {
2204
2204
  type,
2205
2205
  className: `MaskIcon MaskIcon${icon}`,
2206
- role: None,
2206
+ role: None$1,
2207
2207
  childCount: 0
2208
2208
  };
2209
2209
  };
@@ -2275,7 +2275,7 @@ const getItemVirtualDom = item => {
2275
2275
  className: TitleBarTopLevelEntry,
2276
2276
  ariaHasPopup: true,
2277
2277
  ariaExpanded: isOpen,
2278
- role: MenuItem,
2278
+ role: MenuItem$1,
2279
2279
  childCount: 1,
2280
2280
  ariaKeyShortcuts: keyboardShortCut
2281
2281
  });
@@ -2395,7 +2395,7 @@ const getMenuHeight = items => {
2395
2395
  let height = CONTEXT_MENU_PADDING;
2396
2396
  for (const item of items) {
2397
2397
  switch (item.flags) {
2398
- case Separator$1:
2398
+ case Separator:
2399
2399
  height += CONTEXT_MENU_SEPARATOR_HEIGHT;
2400
2400
  break;
2401
2401
  default:
@@ -2451,7 +2451,7 @@ const getIndexToFocusPrevious = menu => {
2451
2451
  };
2452
2452
  const canBeFocused = item => {
2453
2453
  switch (item.flags) {
2454
- case Separator$1:
2454
+ case Separator:
2455
2455
  case Disabled:
2456
2456
  return false;
2457
2457
  default:
@@ -2727,7 +2727,7 @@ const renderFocusedIndex = (oldState, newState) => {
2727
2727
 
2728
2728
  const checkboxChecked = {
2729
2729
  type: Div,
2730
- className: mergeClassNames(MenuItem$1, MenuItemCheckMark),
2730
+ className: mergeClassNames(MenuItem, MenuItemCheckMark),
2731
2731
  role: MenuItemCheckBox,
2732
2732
  ariaChecked: true,
2733
2733
  tabIndex: -1,
@@ -3035,12 +3035,12 @@ const parseKey = rawKey => {
3035
3035
  };
3036
3036
  };
3037
3037
 
3038
- const classNameFocused = mergeClassNames(MenuItem$1, MenuItemFocused);
3038
+ const classNameFocused = mergeClassNames(MenuItem, MenuItemFocused);
3039
3039
  const getMenuItemClassName = isFocused => {
3040
3040
  if (isFocused) {
3041
3041
  return classNameFocused;
3042
3042
  }
3043
- return MenuItem$1;
3043
+ return MenuItem;
3044
3044
  };
3045
3045
  const getMenuItemDefaultDom = menuItem => {
3046
3046
  const {
@@ -3053,7 +3053,7 @@ const getMenuItemDefaultDom = menuItem => {
3053
3053
  dom.push({
3054
3054
  type: Div,
3055
3055
  className,
3056
- role: MenuItem,
3056
+ role: MenuItem$1,
3057
3057
  tabIndex: -1,
3058
3058
  childCount: 1
3059
3059
  }, text(label));
@@ -3072,8 +3072,8 @@ const getMenuItemDefaultDom = menuItem => {
3072
3072
 
3073
3073
  const disabled = {
3074
3074
  type: Div,
3075
- className: MenuItem$1,
3076
- role: MenuItem,
3075
+ className: MenuItem,
3076
+ role: MenuItem$1,
3077
3077
  tabIndex: -1,
3078
3078
  disabled: true,
3079
3079
  childCount: 1
@@ -3092,7 +3092,7 @@ const getMenuItemsNoopDom = () => {
3092
3092
  const separator = {
3093
3093
  type: Div,
3094
3094
  className: MenuItemSeparator,
3095
- role: Separator,
3095
+ role: Separator$1,
3096
3096
  childCount: 1
3097
3097
  };
3098
3098
  const separatorLine = {
@@ -3116,7 +3116,7 @@ const getMenuItemSubMenuDom = menuItem => {
3116
3116
  isExpanded,
3117
3117
  level
3118
3118
  } = menuItem;
3119
- let className = MenuItem$1;
3119
+ let className = MenuItem;
3120
3120
  className += ' ' + MenuItemSubMenu;
3121
3121
  if (isFocused) {
3122
3122
  className += ' ' + MenuItemFocused;
@@ -3124,7 +3124,7 @@ const getMenuItemSubMenuDom = menuItem => {
3124
3124
  return [{
3125
3125
  type: Div,
3126
3126
  className,
3127
- role: MenuItem,
3127
+ role: MenuItem$1,
3128
3128
  tabIndex: -1,
3129
3129
  ariaHasPopup: true,
3130
3130
  ariaExpanded: isExpanded,
@@ -3135,7 +3135,7 @@ const getMenuItemSubMenuDom = menuItem => {
3135
3135
 
3136
3136
  const checkboxUnchecked = {
3137
3137
  type: Div,
3138
- className: MenuItem$1,
3138
+ className: MenuItem,
3139
3139
  role: MenuItemCheckBox,
3140
3140
  ariaChecked: false,
3141
3141
  tabIndex: -1,
@@ -3150,11 +3150,11 @@ const getMenuItemUncheckedDom = menuItem => {
3150
3150
 
3151
3151
  const getMenuItemRenderer = flags => {
3152
3152
  switch (flags) {
3153
- case None$1:
3153
+ case None:
3154
3154
  case RestoreFocus:
3155
3155
  case Ignore:
3156
3156
  return getMenuItemDefaultDom;
3157
- case Separator$1:
3157
+ case Separator:
3158
3158
  return getMenuItemSeparatorDom;
3159
3159
  case Checked:
3160
3160
  return getMenuItemCheckedDom;
@@ -3180,8 +3180,8 @@ const getMenuItemVirtualDom = menuItem => {
3180
3180
  const getMenuVirtualDom = menuItems => {
3181
3181
  const dom = [{
3182
3182
  type: Div,
3183
- className: Menu$1,
3184
- role: Menu,
3183
+ className: Menu,
3184
+ role: Menu$1,
3185
3185
  tabIndex: -1,
3186
3186
  childCount: menuItems.length
3187
3187
  }, ...menuItems.flatMap(getMenuItemVirtualDom)];
@@ -3500,7 +3500,7 @@ const closeOneMenu = state => {
3500
3500
  };
3501
3501
  };
3502
3502
 
3503
- const handleKeyArrowLeftMenuOpen = state => {
3503
+ const handleKeyArrowLeftMenuOpen = async state => {
3504
3504
  const {
3505
3505
  menus
3506
3506
  } = state;
@@ -3717,7 +3717,7 @@ const handleMenuClick = async (state, level, index) => {
3717
3717
  return state;
3718
3718
  }
3719
3719
  switch (item.flags) {
3720
- case None$1:
3720
+ case None:
3721
3721
  return selectIndexNone(state, item);
3722
3722
  case SubMenu:
3723
3723
  return selectIndexSubMenu(state, menu, index);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",