@lvce-editor/title-bar-worker 2.5.0 → 2.7.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.
- package/dist/titleBarWorkerMain.js +91 -98
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -1139,7 +1146,7 @@ const i18nString = (key, placeholders = emptyObject) => {
|
|
|
1139
1146
|
/**
|
|
1140
1147
|
* @enum {string}
|
|
1141
1148
|
*/
|
|
1142
|
-
const UiStrings$
|
|
1149
|
+
const UiStrings$1 = {
|
|
1143
1150
|
Copy: 'Copy',
|
|
1144
1151
|
CopyLineDown: 'Copy Line Down',
|
|
1145
1152
|
CopyLineUp: 'Copy Line Up',
|
|
@@ -1153,40 +1160,40 @@ const UiStrings$2 = {
|
|
|
1153
1160
|
ToggleLineComment: 'Toggle Line Comment',
|
|
1154
1161
|
Undo: 'Undo'};
|
|
1155
1162
|
const cut = () => {
|
|
1156
|
-
return i18nString(UiStrings$
|
|
1163
|
+
return i18nString(UiStrings$1.Cut);
|
|
1157
1164
|
};
|
|
1158
1165
|
const copy = () => {
|
|
1159
|
-
return i18nString(UiStrings$
|
|
1166
|
+
return i18nString(UiStrings$1.Copy);
|
|
1160
1167
|
};
|
|
1161
1168
|
const paste = () => {
|
|
1162
|
-
return i18nString(UiStrings$
|
|
1169
|
+
return i18nString(UiStrings$1.Paste);
|
|
1163
1170
|
};
|
|
1164
1171
|
const undo = () => {
|
|
1165
|
-
return i18nString(UiStrings$
|
|
1172
|
+
return i18nString(UiStrings$1.Undo);
|
|
1166
1173
|
};
|
|
1167
1174
|
const redo = () => {
|
|
1168
|
-
return i18nString(UiStrings$
|
|
1175
|
+
return i18nString(UiStrings$1.Redo);
|
|
1169
1176
|
};
|
|
1170
1177
|
const toggleLineComment = () => {
|
|
1171
|
-
return i18nString(UiStrings$
|
|
1178
|
+
return i18nString(UiStrings$1.ToggleLineComment);
|
|
1172
1179
|
};
|
|
1173
1180
|
const toggleBlockComment = () => {
|
|
1174
|
-
return i18nString(UiStrings$
|
|
1181
|
+
return i18nString(UiStrings$1.ToggleBlockComment);
|
|
1175
1182
|
};
|
|
1176
1183
|
const selectAll = () => {
|
|
1177
|
-
return i18nString(UiStrings$
|
|
1184
|
+
return i18nString(UiStrings$1.SelectAll);
|
|
1178
1185
|
};
|
|
1179
1186
|
const copyLineUp = () => {
|
|
1180
|
-
return i18nString(UiStrings$
|
|
1187
|
+
return i18nString(UiStrings$1.CopyLineUp);
|
|
1181
1188
|
};
|
|
1182
1189
|
const copyLineDown = () => {
|
|
1183
|
-
return i18nString(UiStrings$
|
|
1190
|
+
return i18nString(UiStrings$1.CopyLineDown);
|
|
1184
1191
|
};
|
|
1185
1192
|
const moveLineUp = () => {
|
|
1186
|
-
return i18nString(UiStrings$
|
|
1193
|
+
return i18nString(UiStrings$1.MoveLineUp);
|
|
1187
1194
|
};
|
|
1188
1195
|
const moveLineDown = () => {
|
|
1189
|
-
return i18nString(UiStrings$
|
|
1196
|
+
return i18nString(UiStrings$1.MoveLineDown);
|
|
1190
1197
|
};
|
|
1191
1198
|
|
|
1192
1199
|
const Edit$1 = 2;
|
|
@@ -1200,8 +1207,8 @@ const Terminal$1 = 14;
|
|
|
1200
1207
|
const TitleBar = 15;
|
|
1201
1208
|
const View$1 = 16;
|
|
1202
1209
|
|
|
1203
|
-
const Separator
|
|
1204
|
-
const None
|
|
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
|
|
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
|
|
1241
|
+
flags: None,
|
|
1235
1242
|
command: /* Editor.cut */'Editor.cut'
|
|
1236
1243
|
}, {
|
|
1237
1244
|
id: 'copy',
|
|
1238
1245
|
label: copy(),
|
|
1239
|
-
flags: None
|
|
1246
|
+
flags: None,
|
|
1240
1247
|
command: /* Editor.copy */'Editor.copy'
|
|
1241
1248
|
}, {
|
|
1242
1249
|
id: 'paste',
|
|
1243
1250
|
label: paste(),
|
|
1244
|
-
flags: None
|
|
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
|
|
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
|
|
1261
|
+
flags: None,
|
|
1255
1262
|
command: /* Editor.toggleBlockComment */'Editor.toggleBlockComment'
|
|
1256
1263
|
}];
|
|
1257
1264
|
};
|
|
@@ -1265,7 +1272,7 @@ const MenuEntriesEdit = {
|
|
|
1265
1272
|
/**
|
|
1266
1273
|
* @enum {string}
|
|
1267
1274
|
*/
|
|
1268
|
-
const UiStrings
|
|
1275
|
+
const UiStrings = {
|
|
1269
1276
|
NewFile: 'New File',
|
|
1270
1277
|
NewWindow: 'New Window',
|
|
1271
1278
|
OpenFile: 'Open File',
|
|
@@ -1276,28 +1283,28 @@ const UiStrings$1 = {
|
|
|
1276
1283
|
SaveAll: 'Save All'
|
|
1277
1284
|
};
|
|
1278
1285
|
const newFile = () => {
|
|
1279
|
-
return i18nString(UiStrings
|
|
1286
|
+
return i18nString(UiStrings.NewFile);
|
|
1280
1287
|
};
|
|
1281
1288
|
const newWindow = () => {
|
|
1282
|
-
return i18nString(UiStrings
|
|
1289
|
+
return i18nString(UiStrings.NewWindow);
|
|
1283
1290
|
};
|
|
1284
1291
|
const openFile = () => {
|
|
1285
|
-
return i18nString(UiStrings
|
|
1292
|
+
return i18nString(UiStrings.OpenFile);
|
|
1286
1293
|
};
|
|
1287
1294
|
const openFolder = () => {
|
|
1288
|
-
return i18nString(UiStrings
|
|
1295
|
+
return i18nString(UiStrings.OpenFolder);
|
|
1289
1296
|
};
|
|
1290
1297
|
const openRecent = () => {
|
|
1291
|
-
return i18nString(UiStrings
|
|
1298
|
+
return i18nString(UiStrings.OpenRecent);
|
|
1292
1299
|
};
|
|
1293
1300
|
const save = () => {
|
|
1294
|
-
return i18nString(UiStrings
|
|
1301
|
+
return i18nString(UiStrings.Save);
|
|
1295
1302
|
};
|
|
1296
1303
|
const saveAll = () => {
|
|
1297
|
-
return i18nString(UiStrings
|
|
1304
|
+
return i18nString(UiStrings.SaveAll);
|
|
1298
1305
|
};
|
|
1299
1306
|
const exit = () => {
|
|
1300
|
-
return i18nString(UiStrings
|
|
1307
|
+
return i18nString(UiStrings.Exit);
|
|
1301
1308
|
};
|
|
1302
1309
|
|
|
1303
1310
|
const Web = 1;
|
|
@@ -1309,17 +1316,17 @@ const getMenuEntries$c = platform => {
|
|
|
1309
1316
|
const entries = [{
|
|
1310
1317
|
id: 'newFile',
|
|
1311
1318
|
label: newFile(),
|
|
1312
|
-
flags: None
|
|
1319
|
+
flags: None,
|
|
1313
1320
|
command: '-1'
|
|
1314
1321
|
}, {
|
|
1315
1322
|
id: 'newWindow',
|
|
1316
1323
|
label: newWindow(),
|
|
1317
|
-
flags: None
|
|
1324
|
+
flags: None,
|
|
1318
1325
|
command: /* Window.openNew */'Window.openNew'
|
|
1319
1326
|
}, menuEntrySeparator, {
|
|
1320
1327
|
id: 'openFile',
|
|
1321
1328
|
label: openFile(),
|
|
1322
|
-
flags: None
|
|
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
|
|
1344
|
+
flags: None,
|
|
1338
1345
|
command: 'Main.save'
|
|
1339
1346
|
}, {
|
|
1340
1347
|
id: 'saveAll',
|
|
1341
1348
|
label: saveAll(),
|
|
1342
|
-
flags: None
|
|
1349
|
+
flags: None,
|
|
1343
1350
|
command: 'Main.saveAll'
|
|
1344
1351
|
}];
|
|
1345
1352
|
if (platform === Electron) {
|
|
@@ -1381,6 +1388,7 @@ const Help = 'Help';
|
|
|
1381
1388
|
const Maximize = 'Maximize';
|
|
1382
1389
|
const Minimize = 'Minimize';
|
|
1383
1390
|
const MoreDot = 'More ...';
|
|
1391
|
+
const NewTerminal = 'New Terminal';
|
|
1384
1392
|
const OpenProcessExplorer = 'Open Process Explorer';
|
|
1385
1393
|
const Run = 'Run';
|
|
1386
1394
|
const Selection = 'Selection';
|
|
@@ -1416,7 +1424,7 @@ const getMenuEntries$a = async platform => {
|
|
|
1416
1424
|
entries.push({
|
|
1417
1425
|
id: 'toggleDeveloperTools',
|
|
1418
1426
|
label: toggleDeveloperTools(),
|
|
1419
|
-
flags: None
|
|
1427
|
+
flags: None,
|
|
1420
1428
|
command: 'Developer.toggleDeveloperTools'
|
|
1421
1429
|
}, {
|
|
1422
1430
|
id: 'openProcessExplorer',
|
|
@@ -1439,7 +1447,7 @@ const getMenuEntries$a = async platform => {
|
|
|
1439
1447
|
entries.push({
|
|
1440
1448
|
id: 'about',
|
|
1441
1449
|
label: about(),
|
|
1442
|
-
flags: None
|
|
1450
|
+
flags: None,
|
|
1443
1451
|
command: 'About.showAbout'
|
|
1444
1452
|
});
|
|
1445
1453
|
return entries;
|
|
@@ -1876,7 +1884,7 @@ const toMenuItem = folder => {
|
|
|
1876
1884
|
const label = getTitle(homeDir, folder);
|
|
1877
1885
|
return {
|
|
1878
1886
|
label,
|
|
1879
|
-
flags: None
|
|
1887
|
+
flags: None,
|
|
1880
1888
|
command: 'Workspace.setPath',
|
|
1881
1889
|
args: [folder]
|
|
1882
1890
|
};
|
|
@@ -1892,12 +1900,12 @@ const getMenuEntries$9 = async () => {
|
|
|
1892
1900
|
items.push({
|
|
1893
1901
|
id: 'more',
|
|
1894
1902
|
label: moreDot(),
|
|
1895
|
-
flags: None
|
|
1903
|
+
flags: None,
|
|
1896
1904
|
command: 'QuickPick.showRecent'
|
|
1897
1905
|
}, menuEntrySeparator, {
|
|
1898
1906
|
id: 'clearRecentlyOpened',
|
|
1899
1907
|
label: clearRecentlyOpened(),
|
|
1900
|
-
flags: None
|
|
1908
|
+
flags: None,
|
|
1901
1909
|
command: 'RecentlyOpened.clearRecentlyOpened'
|
|
1902
1910
|
});
|
|
1903
1911
|
return items;
|
|
@@ -1925,17 +1933,17 @@ const getMenuEntries$7 = () => {
|
|
|
1925
1933
|
return [{
|
|
1926
1934
|
id: 'selectAll',
|
|
1927
1935
|
label: selectAll(),
|
|
1928
|
-
flags: None
|
|
1936
|
+
flags: None,
|
|
1929
1937
|
command: 'Editor.selectAll'
|
|
1930
1938
|
}, {
|
|
1931
1939
|
id: 'copyLineUp',
|
|
1932
1940
|
label: copyLineUp(),
|
|
1933
|
-
flags: None
|
|
1941
|
+
flags: None,
|
|
1934
1942
|
command: 'Editor.copyLineUp'
|
|
1935
1943
|
}, {
|
|
1936
1944
|
id: 'copyLineDown',
|
|
1937
1945
|
label: copyLineDown(),
|
|
1938
|
-
flags: None
|
|
1946
|
+
flags: None,
|
|
1939
1947
|
command: 'Editor.copyLineDown'
|
|
1940
1948
|
}, {
|
|
1941
1949
|
id: 'moveLineUp',
|
|
@@ -1956,22 +1964,12 @@ const MenuEntriesSelection = {
|
|
|
1956
1964
|
id: id$3
|
|
1957
1965
|
};
|
|
1958
1966
|
|
|
1959
|
-
/**
|
|
1960
|
-
* @enum {string}
|
|
1961
|
-
*/
|
|
1962
|
-
const UiStrings = {
|
|
1963
|
-
NewTerminal: 'New Terminal'
|
|
1964
|
-
};
|
|
1965
|
-
const newTerminal = () => {
|
|
1966
|
-
return i18nString(UiStrings.NewTerminal);
|
|
1967
|
-
};
|
|
1968
|
-
|
|
1969
1967
|
const id$2 = Terminal$1;
|
|
1970
1968
|
const getMenuEntries$6 = () => {
|
|
1971
1969
|
return [{
|
|
1972
1970
|
id: 'newTerminal',
|
|
1973
|
-
label:
|
|
1974
|
-
flags: None
|
|
1971
|
+
label: i18nString(NewTerminal),
|
|
1972
|
+
flags: None,
|
|
1975
1973
|
command: 'Layout.togglePanel',
|
|
1976
1974
|
args: ['Terminal']
|
|
1977
1975
|
}];
|
|
@@ -2060,27 +2058,27 @@ const getMenuEntries$4 = () => {
|
|
|
2060
2058
|
return [{
|
|
2061
2059
|
id: File$2,
|
|
2062
2060
|
label: file(),
|
|
2063
|
-
flags: None
|
|
2061
|
+
flags: None
|
|
2064
2062
|
}, {
|
|
2065
2063
|
id: Edit$1,
|
|
2066
2064
|
label: edit(),
|
|
2067
|
-
flags: None
|
|
2065
|
+
flags: None
|
|
2068
2066
|
}, {
|
|
2069
2067
|
id: Selection$1,
|
|
2070
2068
|
label: selection(),
|
|
2071
|
-
flags: None
|
|
2069
|
+
flags: None
|
|
2072
2070
|
}, {
|
|
2073
2071
|
id: View$1,
|
|
2074
2072
|
label: view(),
|
|
2075
|
-
flags: None
|
|
2073
|
+
flags: None
|
|
2076
2074
|
}, {
|
|
2077
2075
|
id: Go$1,
|
|
2078
2076
|
label: go(),
|
|
2079
|
-
flags: None
|
|
2077
|
+
flags: None
|
|
2080
2078
|
}, {
|
|
2081
2079
|
id: Help$1,
|
|
2082
2080
|
label: help(),
|
|
2083
|
-
flags: None
|
|
2081
|
+
flags: None
|
|
2084
2082
|
}];
|
|
2085
2083
|
};
|
|
2086
2084
|
|
|
@@ -2128,12 +2126,6 @@ const getMenuEntries$1 = (id, platform) => {
|
|
|
2128
2126
|
return menu.getMenuEntries(platform);
|
|
2129
2127
|
};
|
|
2130
2128
|
|
|
2131
|
-
const getTitleBarButtonsWeb = () => {
|
|
2132
|
-
return [];
|
|
2133
|
-
};
|
|
2134
|
-
const getTitleBarButtonsRemote = () => {
|
|
2135
|
-
return [];
|
|
2136
|
-
};
|
|
2137
2129
|
const getTitleBarButtonsElectron = (controlsOverlayEnabled, titleBarStyleCustom) => {
|
|
2138
2130
|
if (controlsOverlayEnabled) {
|
|
2139
2131
|
return [];
|
|
@@ -2159,6 +2151,15 @@ const getTitleBarButtonsElectron = (controlsOverlayEnabled, titleBarStyleCustom)
|
|
|
2159
2151
|
}
|
|
2160
2152
|
return [];
|
|
2161
2153
|
};
|
|
2154
|
+
|
|
2155
|
+
const getTitleBarButtonsRemote = () => {
|
|
2156
|
+
return [];
|
|
2157
|
+
};
|
|
2158
|
+
|
|
2159
|
+
const getTitleBarButtonsWeb = () => {
|
|
2160
|
+
return [];
|
|
2161
|
+
};
|
|
2162
|
+
|
|
2162
2163
|
const getTitleBarButtons = (platform, controlsOverlayEnabled, titleBarStyleCustom) => {
|
|
2163
2164
|
switch (platform) {
|
|
2164
2165
|
case Electron:
|
|
@@ -2173,8 +2174,8 @@ const getTitleBarButtons = (platform, controlsOverlayEnabled, titleBarStyleCusto
|
|
|
2173
2174
|
};
|
|
2174
2175
|
|
|
2175
2176
|
const MaskIconCheck = 'MaskIconCheck';
|
|
2176
|
-
const Menu
|
|
2177
|
-
const MenuItem
|
|
2177
|
+
const Menu = 'Menu';
|
|
2178
|
+
const MenuItem = 'MenuItem';
|
|
2178
2179
|
const MenuItemCheckMark = 'MenuItemCheckMark';
|
|
2179
2180
|
const MenuItemCheckmarkIcon = 'MenuItemCheckmarkIcon';
|
|
2180
2181
|
const MenuItemFocused = 'MenuItemFocused';
|
|
@@ -2192,18 +2193,11 @@ const TitleBarTopLevelEntry = 'TitleBarTopLevelEntry';
|
|
|
2192
2193
|
const TitleBarTopLevelEntryLabel = 'TitleBarTopLevelEntryLabel';
|
|
2193
2194
|
const Viewlet = 'Viewlet';
|
|
2194
2195
|
|
|
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
2196
|
const getIconVirtualDom = (icon, type = Div) => {
|
|
2203
2197
|
return {
|
|
2204
2198
|
type,
|
|
2205
2199
|
className: `MaskIcon MaskIcon${icon}`,
|
|
2206
|
-
role: None,
|
|
2200
|
+
role: None$1,
|
|
2207
2201
|
childCount: 0
|
|
2208
2202
|
};
|
|
2209
2203
|
};
|
|
@@ -2226,12 +2220,11 @@ const createTitleBarButton = button => {
|
|
|
2226
2220
|
};
|
|
2227
2221
|
|
|
2228
2222
|
const getTitleBarButtonsVirtualDom = buttons => {
|
|
2229
|
-
|
|
2223
|
+
return [{
|
|
2230
2224
|
type: Div,
|
|
2231
2225
|
className: mergeClassNames(Viewlet, TitleBarButtons),
|
|
2232
2226
|
childCount: buttons.length
|
|
2233
2227
|
}, ...buttons.flatMap(createTitleBarButton)];
|
|
2234
|
-
return dom;
|
|
2235
2228
|
};
|
|
2236
2229
|
|
|
2237
2230
|
const parentNode = {
|
|
@@ -2275,7 +2268,7 @@ const getItemVirtualDom = item => {
|
|
|
2275
2268
|
className: TitleBarTopLevelEntry,
|
|
2276
2269
|
ariaHasPopup: true,
|
|
2277
2270
|
ariaExpanded: isOpen,
|
|
2278
|
-
role: MenuItem,
|
|
2271
|
+
role: MenuItem$1,
|
|
2279
2272
|
childCount: 1,
|
|
2280
2273
|
ariaKeyShortcuts: keyboardShortCut
|
|
2281
2274
|
});
|
|
@@ -2395,7 +2388,7 @@ const getMenuHeight = items => {
|
|
|
2395
2388
|
let height = CONTEXT_MENU_PADDING;
|
|
2396
2389
|
for (const item of items) {
|
|
2397
2390
|
switch (item.flags) {
|
|
2398
|
-
case Separator
|
|
2391
|
+
case Separator:
|
|
2399
2392
|
height += CONTEXT_MENU_SEPARATOR_HEIGHT;
|
|
2400
2393
|
break;
|
|
2401
2394
|
default:
|
|
@@ -2451,7 +2444,7 @@ const getIndexToFocusPrevious = menu => {
|
|
|
2451
2444
|
};
|
|
2452
2445
|
const canBeFocused = item => {
|
|
2453
2446
|
switch (item.flags) {
|
|
2454
|
-
case Separator
|
|
2447
|
+
case Separator:
|
|
2455
2448
|
case Disabled:
|
|
2456
2449
|
return false;
|
|
2457
2450
|
default:
|
|
@@ -2727,7 +2720,7 @@ const renderFocusedIndex = (oldState, newState) => {
|
|
|
2727
2720
|
|
|
2728
2721
|
const checkboxChecked = {
|
|
2729
2722
|
type: Div,
|
|
2730
|
-
className: mergeClassNames(MenuItem
|
|
2723
|
+
className: mergeClassNames(MenuItem, MenuItemCheckMark),
|
|
2731
2724
|
role: MenuItemCheckBox,
|
|
2732
2725
|
ariaChecked: true,
|
|
2733
2726
|
tabIndex: -1,
|
|
@@ -3035,12 +3028,12 @@ const parseKey = rawKey => {
|
|
|
3035
3028
|
};
|
|
3036
3029
|
};
|
|
3037
3030
|
|
|
3038
|
-
const classNameFocused = mergeClassNames(MenuItem
|
|
3031
|
+
const classNameFocused = mergeClassNames(MenuItem, MenuItemFocused);
|
|
3039
3032
|
const getMenuItemClassName = isFocused => {
|
|
3040
3033
|
if (isFocused) {
|
|
3041
3034
|
return classNameFocused;
|
|
3042
3035
|
}
|
|
3043
|
-
return MenuItem
|
|
3036
|
+
return MenuItem;
|
|
3044
3037
|
};
|
|
3045
3038
|
const getMenuItemDefaultDom = menuItem => {
|
|
3046
3039
|
const {
|
|
@@ -3053,7 +3046,7 @@ const getMenuItemDefaultDom = menuItem => {
|
|
|
3053
3046
|
dom.push({
|
|
3054
3047
|
type: Div,
|
|
3055
3048
|
className,
|
|
3056
|
-
role: MenuItem,
|
|
3049
|
+
role: MenuItem$1,
|
|
3057
3050
|
tabIndex: -1,
|
|
3058
3051
|
childCount: 1
|
|
3059
3052
|
}, text(label));
|
|
@@ -3072,8 +3065,8 @@ const getMenuItemDefaultDom = menuItem => {
|
|
|
3072
3065
|
|
|
3073
3066
|
const disabled = {
|
|
3074
3067
|
type: Div,
|
|
3075
|
-
className: MenuItem
|
|
3076
|
-
role: MenuItem,
|
|
3068
|
+
className: MenuItem,
|
|
3069
|
+
role: MenuItem$1,
|
|
3077
3070
|
tabIndex: -1,
|
|
3078
3071
|
disabled: true,
|
|
3079
3072
|
childCount: 1
|
|
@@ -3092,7 +3085,7 @@ const getMenuItemsNoopDom = () => {
|
|
|
3092
3085
|
const separator = {
|
|
3093
3086
|
type: Div,
|
|
3094
3087
|
className: MenuItemSeparator,
|
|
3095
|
-
role: Separator,
|
|
3088
|
+
role: Separator$1,
|
|
3096
3089
|
childCount: 1
|
|
3097
3090
|
};
|
|
3098
3091
|
const separatorLine = {
|
|
@@ -3116,7 +3109,7 @@ const getMenuItemSubMenuDom = menuItem => {
|
|
|
3116
3109
|
isExpanded,
|
|
3117
3110
|
level
|
|
3118
3111
|
} = menuItem;
|
|
3119
|
-
let className = MenuItem
|
|
3112
|
+
let className = MenuItem;
|
|
3120
3113
|
className += ' ' + MenuItemSubMenu;
|
|
3121
3114
|
if (isFocused) {
|
|
3122
3115
|
className += ' ' + MenuItemFocused;
|
|
@@ -3124,7 +3117,7 @@ const getMenuItemSubMenuDom = menuItem => {
|
|
|
3124
3117
|
return [{
|
|
3125
3118
|
type: Div,
|
|
3126
3119
|
className,
|
|
3127
|
-
role: MenuItem,
|
|
3120
|
+
role: MenuItem$1,
|
|
3128
3121
|
tabIndex: -1,
|
|
3129
3122
|
ariaHasPopup: true,
|
|
3130
3123
|
ariaExpanded: isExpanded,
|
|
@@ -3135,7 +3128,7 @@ const getMenuItemSubMenuDom = menuItem => {
|
|
|
3135
3128
|
|
|
3136
3129
|
const checkboxUnchecked = {
|
|
3137
3130
|
type: Div,
|
|
3138
|
-
className: MenuItem
|
|
3131
|
+
className: MenuItem,
|
|
3139
3132
|
role: MenuItemCheckBox,
|
|
3140
3133
|
ariaChecked: false,
|
|
3141
3134
|
tabIndex: -1,
|
|
@@ -3150,11 +3143,11 @@ const getMenuItemUncheckedDom = menuItem => {
|
|
|
3150
3143
|
|
|
3151
3144
|
const getMenuItemRenderer = flags => {
|
|
3152
3145
|
switch (flags) {
|
|
3153
|
-
case None
|
|
3146
|
+
case None:
|
|
3154
3147
|
case RestoreFocus:
|
|
3155
3148
|
case Ignore:
|
|
3156
3149
|
return getMenuItemDefaultDom;
|
|
3157
|
-
case Separator
|
|
3150
|
+
case Separator:
|
|
3158
3151
|
return getMenuItemSeparatorDom;
|
|
3159
3152
|
case Checked:
|
|
3160
3153
|
return getMenuItemCheckedDom;
|
|
@@ -3180,8 +3173,8 @@ const getMenuItemVirtualDom = menuItem => {
|
|
|
3180
3173
|
const getMenuVirtualDom = menuItems => {
|
|
3181
3174
|
const dom = [{
|
|
3182
3175
|
type: Div,
|
|
3183
|
-
className: Menu
|
|
3184
|
-
role: Menu,
|
|
3176
|
+
className: Menu,
|
|
3177
|
+
role: Menu$1,
|
|
3185
3178
|
tabIndex: -1,
|
|
3186
3179
|
childCount: menuItems.length
|
|
3187
3180
|
}, ...menuItems.flatMap(getMenuItemVirtualDom)];
|
|
@@ -3500,7 +3493,7 @@ const closeOneMenu = state => {
|
|
|
3500
3493
|
};
|
|
3501
3494
|
};
|
|
3502
3495
|
|
|
3503
|
-
const handleKeyArrowLeftMenuOpen = state => {
|
|
3496
|
+
const handleKeyArrowLeftMenuOpen = async state => {
|
|
3504
3497
|
const {
|
|
3505
3498
|
menus
|
|
3506
3499
|
} = state;
|
|
@@ -3717,7 +3710,7 @@ const handleMenuClick = async (state, level, index) => {
|
|
|
3717
3710
|
return state;
|
|
3718
3711
|
}
|
|
3719
3712
|
switch (item.flags) {
|
|
3720
|
-
case None
|
|
3713
|
+
case None:
|
|
3721
3714
|
return selectIndexNone(state, item);
|
|
3722
3715
|
case SubMenu:
|
|
3723
3716
|
return selectIndexSubMenu(state, menu, index);
|