ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / base / browser / ui / menu / menu.ts 1461 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
import { isFirefox } from '../../browser.js' ;
import { EventType as TouchEventType, Gesture } from '../../touch.js' ;
import { $, addDisposableListener, append, clearNode, Dimension, EventHelper, EventLike, EventType, getActiveElement, getWindow, IDomNodePagePosition, isAncestor, isInShadowDOM } from '../../dom.js' ;
import { createStyleSheet } from '../../domStylesheets.js' ;
import { StandardKeyboardEvent } from '../../keyboardEvent.js' ;
import StandardMouseEvent
ActionBar ActionsOrientation IActionViewItemProvider
ActionViewItem BaseActionViewItem IActionViewItemOptions
DomScrollableElement
EmptySubmenuAction IAction IActionRunner Separator SubmenuAction
RunOnceScheduler
Codicon
getCodiconFontCharacters
ThemeIcon
Event
stripIcons
KeyCode
ResolvedKeybinding
DisposableStore
isLinux isMacintosh
ScrollbarVisibility ScrollEvent
strings
AnchorAlignment layout LayoutAnchorPosition
HorizontalDirection
Right
Left
VerticalDirection
Above
Below
horizontal HorizontalDirection
vertical VerticalDirection
context
actionViewItemProvider IActionViewItemProvider
actionRunner IActionRunner
getKeyBinding action IAction ResolvedKeybinding
ariaLabel
enableMnemonics
anchorAlignment AnchorAlignment
expandDirection IMenuDirection
useEventAsContext
submenuIds Set
shadowColor
borderColor
foregroundColor
backgroundColor
selectionForegroundColor
selectionBackgroundColor
selectionBorderColor
separatorColor
scrollbarShadow
scrollbarSliderBackground
scrollbarSliderHoverBackground
scrollbarSliderActiveBackground
unthemedMenuStyles IMenuStyles
shadowColor
borderColor
foregroundColor
backgroundColor
selectionForegroundColor
selectionBackgroundColor
selectionBorderColor
separatorColor
scrollbarShadow
scrollbarSliderBackground
scrollbarSliderHoverBackground
scrollbarSliderActiveBackground
parent Menu
submenu Menu
mnemonics Map BaseMenuActionViewItem
scrollableElement DomScrollableElement
menuElement HTMLElement
globalStyleSheet HTMLStyleElement
styleSheet HTMLStyleElement
container HTMLElement actions ReadonlyArray IAction options IMenuOptions menuStyles IMenuStyles
container classList
container
menuElement document
menuElement classList
menuElement
menuElement
orientation ActionsOrientation
action action options parentData
context options context
actionRunner options actionRunner
ariaLabel options ariaLabel
ariaRole
focusOnlyEnabledItems
triggerKeys keys KeyCode Enter isMacintosh isLinux KeyCode Space keyDown
menuElement menuElement
actionsList tabIndex
container menuStyles
Gesture menuElement
menuElement EventType e
event e
event KeyCode Tab
e
options enableMnemonics
menuElement EventType e
key e key
actions mnemonics key
actions
EventHelper e
actions length
actions actions container
actions container
actions e
actions length
action actions
action action container
action container
actions action
mnemonics key actions
isLinux
menuElement EventType e
event e
event KeyCode Home event KeyCode PageUp
focusedItem viewItems length
EventHelper e
event KeyCode End event KeyCode PageDown
focusedItem
EventHelper e
domNode EventType e
relatedTarget e relatedTarget HTMLElement
relatedTarget domNode
focusedItem
e
actionsList EventType e
e movementX e movementY
target e target HTMLElement
target target actionsList target actionsList
target parentElement actionsList target parentElement
target target parentElement
target classList
lastFocusedItem focusedItem
lastFocusedItem actionsList children lastFocusedItem target
target
lastFocusedItem focusedItem
Gesture actionsList
actionsList TouchEventType Tap e
target e initialTarget HTMLElement
target target actionsList target actionsList
target parentElement actionsList target parentElement
target target parentElement
target classList
lastFocusedItem focusedItem
target
lastFocusedItem focusedItem
parentData ISubMenuData
parent
mnemonics
scrollableElement menuElement
alwaysConsumeMouseWheel
horizontal ScrollbarVisibility Hidden
vertical ScrollbarVisibility Visible
verticalScrollbarSize
handleMouseWheel
useShadows
scrollElement scrollableElement
scrollElement style position
scrollElement menuStyles
menuElement TouchEventType Change e
EventHelper e
scrollTop scrollableElement scrollTop
scrollableElement scrollTop scrollTop e translationY
scrollElement EventType e
e
window container
menuElement style maxHeight
actions actions a idx
options submenuIds a id
a
idx actions length idx
prevAction actions idx
prevAction
actions icon label isMenu
container scrollableElement
scrollableElement
viewItems item item item index array
item BaseMenuActionViewItem index array length
container HTMLElement style IMenuStyles
styleSheet
container
styleSheet container
Menu globalStyleSheet
Menu globalStyleSheet
styleSheet Menu globalStyleSheet
styleSheet textContent style container
scrollElement HTMLElement style IMenuStyles
fgColor style foregroundColor
bgColor style backgroundColor
borderRadius
scrollElement style borderRadius borderRadius
scrollElement style color fgColor
scrollElement style backgroundColor bgColor
override HTMLElement
scrollableElement
Event ScrollEvent
scrollableElement onScroll
menuElement scrollTop
index
index viewItems length index
item viewItems index
item
index
item
item
item _action item _context
element HTMLElement
lastFocusedItem focusedItem
element
lastFocusedItem focusedItem
element HTMLElement
i i actionsList children length i
elem actionsList children i
element elem
focusedItem i
override fromRight
fromRight
focusedItem
scrollableElement
scrollTop Math menuElement scrollTop
action IAction options IMenuOptions parentData ISubMenuData BaseActionViewItem
action
options context action icon menuStyles
action
menuActionViewItem action action actions parentData options submenuIds options submenuIds action id menuStyles
options enableMnemonics
mnemonic menuActionViewItem
mnemonic menuActionViewItem
actionViewItems mnemonics mnemonic
actionViewItems
actionViewItems menuActionViewItem
mnemonics mnemonic menuActionViewItem
menuActionViewItem
keybindingLabel options getKeyBinding action
menuItemOptions IMenuItemOptions
enableMnemonics options enableMnemonics
useEventAsContext options useEventAsContext
keybinding keybindingLabel
menuActionViewItem options context action menuItemOptions menuStyles
options enableMnemonics
mnemonic menuActionViewItem
mnemonic menuActionViewItem
actionViewItems mnemonics mnemonic
actionViewItems
actionViewItems menuActionViewItem
mnemonics mnemonic menuActionViewItem
menuActionViewItem
enableMnemonics
container HTMLElement
override options IMenuItemOptions
item HTMLElement
runOnceToEnableMouseUp RunOnceScheduler
label HTMLElement
check HTMLElement
mnemonic
cssClass
ctx action IAction options IMenuItemOptions menuStyle IMenuStyles
options
options
isMenu
icon options icon options icon
label options label options label
action action options
options options
cssClass
options label options enableMnemonics
label action label
label
matches label
matches
mnemonic matches matches matches
runOnceToEnableMouseUp
element
element EventType e
EventHelper e
isFirefox
mouseEvent element e
mouseEvent rightButton
e
e
element EventType e
EventHelper e
runOnceToEnableMouseUp
override container HTMLElement
container
element
container container
item element
_action id Separator
item
item
mnemonic
item
check item ThemeIcon Codicon menuSelection
check
label item
options label options keybinding
item textContent options keybinding
runOnceToEnableMouseUp
override
override
item
pos setSize
item
item
item
override
label
options label
label
label action label
label
cleanLabel label
options enableMnemonics
label cleanLabel
label cleanLabel
matches label
matches
label strings label
lastIndex
escMatch label
escMatch escMatch
escMatch label
str str
escMatch
label
strings label escMatch index
escMatch
strings label escMatch index escMatch length
label textContent label
item matches matches matches
label textContent label
override
override
cssClass item
item classList cssClass
options icon label
cssClass action class
label classList
cssClass
label classList cssClass
label
label classList
override
action enabled
element
element classList
element
item
item classList
item
item tabIndex
element
element classList
element
item
item classList
item
override
item
checked action checked
item classList checked
checked
item
item checked
item
item
mnemonic
isSelected element element classList
fgColor isSelected menuStyle selectionForegroundColor menuStyle selectionForegroundColor menuStyle foregroundColor
bgColor isSelected menuStyle selectionBackgroundColor menuStyle selectionBackgroundColor
outline isSelected menuStyle selectionBorderColor
outlineOffset isSelected menuStyle selectionBorderColor
item
item style color fgColor
item style backgroundColor bgColor
item style outline outline
item style outlineOffset outlineOffset
check
check style color fgColor
mysubmenu Menu
submenuContainer HTMLElement
submenuIndicator HTMLElement
submenuDisposables
mouseOver
showScheduler RunOnceScheduler
hideScheduler RunOnceScheduler
expandDirection IMenuDirection
action IAction
submenuActions ReadonlyArray IAction
parentData ISubMenuData
submenuOptions IMenuOptions
menuStyles IMenuStyles
action action submenuOptions menuStyles
expandDirection submenuOptions submenuOptions expandDirection submenuOptions expandDirection horizontal HorizontalDirection Right vertical VerticalDirection Below
showScheduler
mouseOver
hideScheduler
element element parentData submenu mysubmenu
parentData parent
override container HTMLElement
container
element
item
item classList
item tabIndex
item
submenuIndicator item ThemeIcon Codicon menuSubmenu
submenuIndicator
element EventType e
event e
event KeyCode RightArrow event KeyCode Enter
EventHelper e
element EventType e
event e
item
event KeyCode RightArrow event KeyCode Enter
EventHelper e
element EventType e
e movementX e movementY
mouseOver
mouseOver
showScheduler
element EventType e
mouseOver
element EventType e
element element
hideScheduler
parentData parent
parentData submenu mysubmenu
parentData parent
override
selectFirst
selectFirst
override e EventLike
EventHelper e
force
parentData submenu force parentData submenu mysubmenu
parentData submenu
parentData submenu
submenuContainer
submenuDisposables
submenuContainer
windowDimensions Dimension submenu Dimension entry IDomNodePagePosition expandDirection IMenuDirection top left
ret top left
ret left windowDimensions width submenu width position expandDirection horizontal HorizontalDirection Right LayoutAnchorPosition Before LayoutAnchorPosition After offset entry left size entry width position
ret left entry left ret left entry left entry width
entry left submenu width windowDimensions width
ret left entry left
entry top
entry height
ret top windowDimensions height submenu height position LayoutAnchorPosition Before offset entry top size position
ret top submenu height entry top ret top entry height submenu height windowDimensions height
ret top entry height
ret
selectFirstItem
element
parentData submenu
submenuContainer element
submenuContainer classList
computedStyles parentData parent domNode parentData parent domNode
paddingTop computedStyles paddingTop
submenuContainer style position
submenuContainer style top
submenuContainer style left
submenuContainer style zIndex
parentData submenu submenuContainer submenuActions length submenuActions submenuOptions menuStyle
entryBox element
entryBoxUpdated
top entryBox top paddingTop
left entryBox left
height entryBox height paddingTop
width entryBox width
viewBox submenuContainer
window element
top left window innerWidth window innerHeight Dimension viewBox entryBoxUpdated expandDirection
submenuContainer style left
submenuContainer style top
submenuDisposables submenuContainer EventType e
event e
event KeyCode LeftArrow
EventHelper e
parentData parent
submenuDisposables submenuContainer EventType e
event e
event KeyCode LeftArrow
EventHelper e
submenuDisposables parentData submenu
parentData parent
parentData submenu selectFirstItem
mysubmenu parentData submenu
parentData submenu
value
item
item value
override
isSelected element element classList
fgColor isSelected menuStyle selectionForegroundColor menuStyle selectionForegroundColor menuStyle foregroundColor
submenuIndicator
submenuIndicator style color fgColor
override
hideScheduler
mysubmenu
mysubmenu
mysubmenu
submenuContainer
submenuContainer
context action IAction options IActionViewItemOptions menuStyles IMenuStyles
context action options
override container HTMLElement
container
label
label style borderBottomColor menuStyles separatorColor
label
regex
matches regex label
matches
label
mnemonicInText matches
label regex mnemonicInText
c ThemeIcon
fontCharacter c id
style IMenuStyles isForShadowDom
borderColor style borderColor
menuShadow
result
isForShadowDom
result
scrollbarShadowColor style scrollbarShadow
scrollbarShadowColor
result
scrollbarSliderBackgroundColor style scrollbarSliderBackground
scrollbarSliderBackgroundColor
result
scrollbarSliderHoverBackgroundColor style scrollbarSliderHoverBackground
scrollbarSliderHoverBackgroundColor
result
scrollbarSliderActiveBackgroundColor style scrollbarSliderActiveBackground
scrollbarSliderActiveBackgroundColor
result
result
{
}
from
'../../mouseEvent.js'
;
import
{
,
,
}
from
'../actionbar/actionbar.js'
;
import
{
,
,
}
from
'../actionbar/actionViewItems.js'
;
import
{
}
from
'../scrollbar/scrollableElement.js'
;
import
{
,
,
,
,
}
from
'../../../common/actions.js'
;
import
{
}
from
'../../../common/async.js'
;
import
{
}
from
'../../../common/codicons.js'
;
import
{
}
from
'../../../common/codiconsUtil.js'
;
import
{
}
from
'../../../common/themables.js'
;
import
{
}
from
'../../../common/event.js'
;
import
{
}
from
'../../../common/iconLabels.js'
;
import
{
}
from
'../../../common/keyCodes.js'
;
import
{
}
from
'../../../common/keybindings.js'
;
import
{
}
from
'../../../common/lifecycle.js'
;
import
{
,
}
from
'../../../common/platform.js'
;
import
{
,
}
from
'../../../common/scrollable.js'
;
import
*
as
from
'../../../common/strings.js'
;
import
{
,
,
}
from
'../../../common/layout.js'
;
import
{
CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE
}
from
'../contextview/contextview.js'
;
export
const
MENU_MNEMONIC_REGEX
=
/ \( &( [ ^ \s &] ) \) | ( ^ | [ ^ &] ) &( [ ^ \s &] ) /
;
export
const
MENU_ESCAPED_MNEMONIC_REGEX
=
/ ( &) ? ( &) ( [ ^ \s &] ) / g
;
export
enum
{
,
}
export
enum
{
,
}
export
interface
IMenuDirection
{
:
;
:
;
}
export
interface
IMenuOptions
{
?
:
unknown
;
?
:
;
?
:
;
?
:
(
:
)
=>
|
undefined
;
?
:
string
;
?
:
boolean
;
?
:
;
?
:
;
?
:
boolean
;
?
:
<
string
>
;
}
export
interface
IMenuStyles
{
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
:
string
|
undefined
;
}
export
const
:
=
{
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
}
;
interface
ISubMenuData
{
:
;
?
:
;
}
export
class
Menu
extends
ActionBar
{
private
:
<
string
,
Array
<
>>
;
private
:
;
private
:
;
static
:
;
protected
:
|
undefined
;
constructor
(
:
,
:
<
>
,
:
,
private
readonly
:
)
{
.
.
add
(
'monaco-menu-container'
)
;
.
setAttribute
(
'role'
,
'presentation'
)
;
const
=
.
createElement
(
'div'
)
;
.
.
add
(
'monaco-menu'
)
;
.
setAttribute
(
'role'
,
'presentation'
)
;
super
(
,
{
:
.
VERTICAL
,
actionViewItemProvider
:
=>
this
.
doGetActionViewItem
(
,
,
)
,
:
.
,
:
.
,
:
.
,
:
'menu'
,
:
true
,
:
{
:
[
.
,
...
(
||
?
[
.
]
:
[
]
)
]
,
:
true
}
}
)
;
this
.
=
;
this
.
.
=
0
;
this
.
initializeOrUpdateStyleSheet
(
,
)
;
this
.
_register
(
.
addTarget
(
)
)
;
this
.
_register
(
addDisposableListener
(
,
.
KEY_DOWN
,
(
)
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
.
equals
(
.
)
)
{
.
preventDefault
(
)
;
}
}
)
)
;
if
(
.
)
{
this
.
_register
(
addDisposableListener
(
,
.
KEY_DOWN
,
(
)
=>
{
const
=
.
.
toLocaleLowerCase
(
)
;
const
=
this
.
.
get
(
)
;
if
(
!==
undefined
)
{
.
stop
(
,
true
)
;
if
(
.
===
1
)
{
if
(
[
0
]
instanceof
SubmenuMenuActionViewItem
&&
[
0
]
.
)
{
this
.
focusItemByElement
(
[
0
]
.
)
;
}
[
0
]
.
onClick
(
)
;
}
if
(
.
>
1
)
{
const
=
.
shift
(
)
;
if
(
&&
.
)
{
this
.
focusItemByElement
(
.
)
;
.
push
(
)
;
}
this
.
.
set
(
,
)
;
}
}
}
)
)
;
}
if
(
)
{
this
.
_register
(
addDisposableListener
(
,
.
KEY_DOWN
,
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
.
equals
(
.
)
||
.
equals
(
.
)
)
{
this
.
=
this
.
.
-
1
;
this
.
focusNext
(
)
;
.
stop
(
,
true
)
;
}
else
if
(
.
equals
(
.
)
||
.
equals
(
.
)
)
{
this
.
=
0
;
this
.
focusPrevious
(
)
;
.
stop
(
,
true
)
;
}
}
)
)
;
}
this
.
_register
(
addDisposableListener
(
this
.
,
.
MOUSE_OUT
,
=>
{
const
=
.
as
;
if
(
!
isAncestor
(
,
this
.
)
)
{
this
.
=
undefined
;
this
.
updateFocus
(
)
;
.
stopPropagation
(
)
;
}
}
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
MOUSE_MOVE
,
=>
{
if
(
.
===
0
&&
.
===
0
)
{
return
;
}
let
=
.
as
;
if
(
!
||
!
isAncestor
(
,
this
.
)
||
===
this
.
)
{
return
;
}
while
(
.
!==
this
.
&&
.
!==
null
)
{
=
.
;
}
if
(
.
.
contains
(
'action-item'
)
)
{
const
=
this
.
;
if
(
!==
undefined
&&
this
.
.
[
]
===
)
{
return
;
}
this
.
setFocusedItem
(
)
;
if
(
!==
this
.
)
{
this
.
updateFocus
(
)
;
}
}
}
)
)
;
this
.
_register
(
.
addTarget
(
this
.
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
,
=>
{
let
=
.
as
;
if
(
!
||
!
isAncestor
(
,
this
.
)
||
===
this
.
)
{
return
;
}
while
(
.
!==
this
.
&&
.
!==
null
)
{
=
.
;
}
if
(
.
.
contains
(
'action-item'
)
)
{
const
=
this
.
;
this
.
setFocusedItem
(
)
;
if
(
!==
this
.
)
{
this
.
updateFocus
(
)
;
}
}
}
)
)
;
const
:
=
{
:
this
}
;
this
.
=
new
Map< string , Array < BaseMenuActionViewItem>>
(
)
;
this
.
=
this
.
_register
(
new
DomScrollableElement
(
,
{
:
true
,
:
.
,
:
.
,
:
7
,
:
true
,
:
true
}
)
)
;
const
=
this
.
.
getDomNode
(
)
;
.
.
=
''
;
this
.
styleScrollElement
(
,
)
;
this
.
_register
(
addDisposableListener
(
,
.
,
=>
{
.
stop
(
,
true
)
;
const
=
this
.
.
getScrollPosition
(
)
.
;
this
.
.
setScrollPosition
(
{
:
-
.
}
)
;
}
)
)
;
this
.
_register
(
addDisposableListener
(
,
.
MOUSE_UP
,
=>
{
.
preventDefault
(
)
;
}
)
)
;
const
=
getWindow
(
)
;
.
.
=
` ${ Math. max ( 10 , window. innerHeight - container. getBoundingClientRect ( ) . top - 35 ) } px `
;
=
.
filter
(
(
,
)
=>
{
if
(
.
?.
has
(
.
)
)
{
console
.
warn
(
` Found submenu cycle: ${ a. id} `
)
;
return
false
;
}
if
(
instanceof
Separator
)
{
if
(
===
.
-
1
||
===
0
)
{
return
false
;
}
const
=
[
-
1
]
;
if
(
instanceof
Separator
)
{
return
false
;
}
}
return
true
;
}
)
;
this
.
push
(
,
{
:
true
,
:
true
,
:
true
}
)
;
.
appendChild
(
this
.
.
getDomNode
(
)
)
;
this
.
.
scanDomNode
(
)
;
this
.
.
filter
(
=>
!
(
instanceof
MenuSeparatorActionViewItem
)
)
.
forEach
(
(
,
,
)
=>
{
(
as
)
.
updatePositionInSet
(
+
1
,
.
)
;
}
)
;
}
private
initializeOrUpdateStyleSheet
(
:
,
:
)
:
void
{
if
(
!
this
.
)
{
if
(
isInShadowDOM
(
)
)
{
this
.
=
createStyleSheet
(
)
;
}
else
{
if
(
!
.
)
{
.
=
createStyleSheet
(
)
;
}
this
.
=
.
;
}
}
this
.
.
=
getMenuWidgetCSS
(
,
isInShadowDOM
(
)
)
;
}
private
styleScrollElement
(
:
,
:
)
:
void
{
const
=
.
??
''
;
const
=
.
??
''
;
const
=
'var(--vscode-cornerRadius-large)'
;
.
.
=
;
.
.
=
;
.
.
=
;
}
getContainer
(
)
:
{
return
this
.
.
getDomNode
(
)
;
}
get
onScroll
(
)
:
<
>
{
return
this
.
.
;
}
get
scrollOffset
(
)
:
number
{
return
this
.
.
;
}
trigger
(
:
number
)
:
void
{
if
(
<=
this
.
.
&&
>=
0
)
{
const
=
this
.
[
]
;
if
(
instanceof
SubmenuMenuActionViewItem
)
{
super
.
focus
(
)
;
.
open
(
true
)
;
}
else
if
(
instanceof
BaseMenuActionViewItem
)
{
super
.
run
(
.
,
.
)
;
}
else
{
return
;
}
}
}
private
focusItemByElement
(
:
)
{
const
=
this
.
;
this
.
setFocusedItem
(
)
;
if
(
!==
this
.
)
{
this
.
updateFocus
(
)
;
}
}
private
setFocusedItem
(
:
)
:
void
{
for
(
let
=
0
;
<
this
.
.
.
;
++
)
{
const
=
this
.
.
[
]
;
if
(
===
)
{
this
.
=
;
break
;
}
}
}
protected
updateFocus
(
?
:
boolean
)
:
void
{
super
.
updateFocus
(
,
true
,
true
)
;
if
(
typeof
this
.
!==
'undefined'
)
{
this
.
.
setScrollPosition
(
{
:
.
round
(
this
.
.
)
}
)
;
}
}
private
doGetActionViewItem
(
:
,
:
,
:
)
:
{
if
(
instanceof
Separator
)
{
return
new
MenuSeparatorActionViewItem
(
.
,
,
{
:
true
}
,
this
.
)
;
}
else
if
(
instanceof
SubmenuAction
)
{
const
=
new
SubmenuMenuActionViewItem
(
,
.
,
,
{
...
,
:
new
Set
(
[
...
(
.
||
[
]
)
,
.
]
)
}
,
this
.
)
;
if
(
.
)
{
const
=
.
getMnemonic
(
)
;
if
(
&&
.
isEnabled
(
)
)
{
const
=
this
.
.
get
(
)
;
if
(
!==
undefined
)
{
.
push
(
)
;
}
else
{
this
.
.
set
(
,
[
]
)
;
}
}
}
return
;
}
else
{
const
=
.
?.
(
)
?.
getLabel
(
)
;
const
:
=
{
:
.
,
:
.
,
:
,
}
;
const
=
new
BaseMenuActionViewItem
(
.
,
,
,
this
.
)
;
if
(
.
)
{
const
=
.
getMnemonic
(
)
;
if
(
&&
.
isEnabled
(
)
)
{
const
=
this
.
.
get
(
)
;
if
(
!==
undefined
)
{
.
push
(
)
;
}
else
{
this
.
.
set
(
,
[
]
)
;
}
}
}
return
;
}
}
}
interface
IMenuItemOptions
extends
IActionViewItemOptions
{
readonly
?
:
boolean
;
}
class
BaseMenuActionViewItem
extends
BaseActionViewItem
{
public
:
|
undefined
;
protected
:
;
protected
:
|
undefined
;
private
:
;
private
:
|
undefined
;
private
:
|
undefined
;
private
:
string
|
undefined
;
private
:
string
;
constructor
(
:
unknown
,
:
,
:
,
protected
readonly
:
)
{
=
{
...
,
:
true
,
:
.
!==
undefined
?
.
:
false
,
:
.
!==
undefined
?
.
:
true
,
}
;
super
(
,
,
)
;
this
.
=
;
this
.
=
''
;
if
(
this
.
.
&&
.
)
{
const
=
this
.
.
;
if
(
)
{
const
=
MENU_MNEMONIC_REGEX
.
exec
(
)
;
if
(
)
{
this
.
=
(
!
!
[
1
]
?
[
1
]
:
[
3
]
)
.
toLocaleLowerCase
(
)
;
}
}
}
this
.
=
new
RunOnceScheduler
(
(
)
=>
{
if
(
!
this
.
)
{
return
;
}
this
.
_register
(
addDisposableListener
(
this
.
,
.
MOUSE_UP
,
=>
{
.
stop
(
,
true
)
;
if
(
)
{
const
=
new
StandardMouseEvent
(
getWindow
(
this
.
)
,
)
;
if
(
.
)
{
return
;
}
this
.
onClick
(
)
;
}
else
{
setTimeout
(
(
)
=>
{
this
.
onClick
(
)
;
}
,
0
)
;
}
}
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
CONTEXT_MENU
,
=>
{
.
stop
(
,
true
)
;
}
)
)
;
}
,
100
)
;
this
.
_register
(
this
.
)
;
}
render
(
:
)
:
void
{
super
.
render
(
)
;
if
(
!
this
.
)
{
return
;
}
this
.
=
;
this
.
=
append
(
this
.
,
$
(
'a.action-menu-item'
)
)
;
if
(
this
.
.
===
.
ID
)
{
this
.
.
setAttribute
(
'role'
,
'presentation'
)
;
}
else
{
this
.
.
setAttribute
(
'role'
,
'menuitem'
)
;
if
(
this
.
)
{
this
.
.
setAttribute
(
'aria-keyshortcuts'
,
` ${ this . mnemonic} `
)
;
}
}
this
.
=
append
(
this
.
,
$
(
'span.menu-item-check'
+
.
asCSSSelector
(
.
)
)
)
;
this
.
.
setAttribute
(
'role'
,
'none'
)
;
this
.
=
append
(
this
.
,
$
(
'span.action-label'
)
)
;
if
(
this
.
.
&&
this
.
.
)
{
append
(
this
.
,
$
(
'span.keybinding'
)
)
.
=
this
.
.
;
}
this
.
.
schedule
(
)
;
this
.
updateClass
(
)
;
this
.
updateLabel
(
)
;
this
.
updateTooltip
(
)
;
this
.
updateEnabled
(
)
;
this
.
updateChecked
(
)
;
this
.
applyStyle
(
)
;
}
blur
(
)
:
void
{
super
.
blur
(
)
;
this
.
applyStyle
(
)
;
}
focus
(
)
:
void
{
super
.
focus
(
)
;
this
.
?.
focus
(
)
;
this
.
applyStyle
(
)
;
}
updatePositionInSet
(
:
number
,
:
number
)
:
void
{
if
(
this
.
)
{
this
.
.
setAttribute
(
'aria-posinset'
,
` ${ pos} `
)
;
this
.
.
setAttribute
(
'aria-setsize'
,
` ${ setSize} `
)
;
}
}
protected
updateLabel
(
)
:
void
{
if
(
!
this
.
)
{
return
;
}
if
(
this
.
.
)
{
clearNode
(
this
.
)
;
let
=
stripIcons
(
this
.
.
)
;
if
(
)
{
const
=
cleanMnemonic
(
)
;
if
(
!
this
.
.
)
{
=
;
}
this
.
.
setAttribute
(
'aria-label'
,
.
replace
(
/ && / g
,
'&'
)
)
;
const
=
MENU_MNEMONIC_REGEX
.
exec
(
)
;
if
(
)
{
=
.
escape
(
)
;
MENU_ESCAPED_MNEMONIC_REGEX
.
=
0
;
let
=
MENU_ESCAPED_MNEMONIC_REGEX
.
exec
(
)
;
while
(
&&
[
1
]
)
{
=
MENU_ESCAPED_MNEMONIC_REGEX
.
exec
(
)
;
}
const
replaceDoubleEscapes
=
(
:
string
)
=>
.
replace
(
/ && / g
,
'&'
)
;
if
(
)
{
this
.
.
append
(
.
ltrim
(
replaceDoubleEscapes
(
.
substr
(
0
,
.
)
)
,
' '
)
,
$
(
'u'
,
{
'aria-hidden'
:
'true'
}
,
[
3
]
)
,
.
rtrim
(
replaceDoubleEscapes
(
.
substr
(
.
+
[
0
]
.
)
)
,
' '
)
)
;
}
else
{
this
.
.
=
replaceDoubleEscapes
(
)
.
trim
(
)
;
}
this
.
?.
setAttribute
(
'aria-keyshortcuts'
,
(
!
!
[
1
]
?
[
1
]
:
[
3
]
)
.
toLocaleLowerCase
(
)
)
;
}
else
{
this
.
.
=
.
replace
(
/ && / g
,
'&'
)
.
trim
(
)
;
}
}
}
}
protected
updateTooltip
(
)
:
void
{
}
protected
updateClass
(
)
:
void
{
if
(
this
.
&&
this
.
)
{
this
.
.
.
remove
(
...
this
.
.
split
(
' '
)
)
;
}
if
(
this
.
.
&&
this
.
)
{
this
.
=
this
.
.
||
''
;
this
.
.
.
add
(
'icon'
)
;
if
(
this
.
)
{
this
.
.
.
add
(
...
this
.
.
split
(
' '
)
)
;
}
this
.
updateEnabled
(
)
;
}
else
if
(
this
.
)
{
this
.
.
.
remove
(
'icon'
)
;
}
}
protected
updateEnabled
(
)
:
void
{
if
(
this
.
.
)
{
if
(
this
.
)
{
this
.
.
.
remove
(
'disabled'
)
;
this
.
.
removeAttribute
(
'aria-disabled'
)
;
}
if
(
this
.
)
{
this
.
.
.
remove
(
'disabled'
)
;
this
.
.
removeAttribute
(
'aria-disabled'
)
;
this
.
.
=
0
;
}
}
else
{
if
(
this
.
)
{
this
.
.
.
add
(
'disabled'
)
;
this
.
.
setAttribute
(
'aria-disabled'
,
'true'
)
;
}
if
(
this
.
)
{
this
.
.
.
add
(
'disabled'
)
;
this
.
.
setAttribute
(
'aria-disabled'
,
'true'
)
;
}
}
}
protected
updateChecked
(
)
:
void
{
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
;
this
.
.
.
toggle
(
'checked'
,
!
!
)
;
if
(
!==
undefined
)
{
this
.
.
setAttribute
(
'role'
,
'menuitemcheckbox'
)
;
this
.
.
setAttribute
(
'aria-checked'
,
?
'true'
:
'false'
)
;
}
else
{
this
.
.
setAttribute
(
'role'
,
'menuitem'
)
;
this
.
.
setAttribute
(
'aria-checked'
,
''
)
;
}
}
getMnemonic
(
)
:
string
|
undefined
{
return
this
.
;
}
protected
applyStyle
(
)
:
void
{
const
=
this
.
&&
this
.
.
.
contains
(
'focused'
)
;
const
=
&&
this
.
.
?
this
.
.
:
this
.
.
;
const
=
&&
this
.
.
?
this
.
.
:
undefined
;
const
=
&&
this
.
.
?
` 1px solid ${ this . menuStyle. selectionBorderColor} `
:
''
;
const
=
&&
this
.
.
?
` -1px `
:
''
;
if
(
this
.
)
{
this
.
.
.
=
??
''
;
this
.
.
.
=
??
''
;
this
.
.
.
=
;
this
.
.
.
=
;
}
if
(
this
.
)
{
this
.
.
.
=
??
''
;
}
}
}
class
SubmenuMenuActionViewItem
extends
BaseMenuActionViewItem
{
private
:
|
null
=
null
;
private
:
|
undefined
;
private
:
|
undefined
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
private
:
boolean
=
false
;
private
:
;
private
:
;
private
:
;
constructor
(
:
,
private
:
<
>
,
private
:
,
private
:
,
:
)
{
super
(
,
,
,
)
;
this
.
=
&&
.
!==
undefined
?
.
:
{
:
.
,
:
.
}
;
this
.
=
new
RunOnceScheduler
(
(
)
=>
{
if
(
this
.
)
{
this
.
cleanupExistingSubmenu
(
false
)
;
this
.
createSubmenu
(
false
)
;
}
}
,
250
)
;
this
.
=
new
RunOnceScheduler
(
(
)
=>
{
if
(
this
.
&&
(
!
isAncestor
(
getActiveElement
(
)
,
this
.
)
&&
this
.
.
===
this
.
)
)
{
this
.
.
.
focus
(
false
)
;
this
.
cleanupExistingSubmenu
(
true
)
;
}
}
,
750
)
;
}
render
(
:
)
:
void
{
super
.
render
(
)
;
if
(
!
this
.
)
{
return
;
}
if
(
this
.
)
{
this
.
.
.
add
(
'monaco-submenu-item'
)
;
this
.
.
=
0
;
this
.
.
setAttribute
(
'aria-haspopup'
,
'true'
)
;
this
.
updateAriaExpanded
(
'false'
)
;
this
.
=
append
(
this
.
,
$
(
'span.submenu-indicator'
+
.
asCSSSelector
(
.
)
)
)
;
this
.
.
setAttribute
(
'aria-hidden'
,
'true'
)
;
}
this
.
_register
(
addDisposableListener
(
this
.
,
.
KEY_UP
,
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
.
equals
(
.
)
||
.
equals
(
.
)
)
{
.
stop
(
,
true
)
;
this
.
createSubmenu
(
true
)
;
}
}
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
KEY_DOWN
,
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
getActiveElement
(
)
===
this
.
)
{
if
(
.
equals
(
.
)
||
.
equals
(
.
)
)
{
.
stop
(
,
true
)
;
}
}
}
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
MOUSE_MOVE
,
=>
{
if
(
.
===
0
&&
.
===
0
)
{
return
;
}
if
(
!
this
.
)
{
this
.
=
true
;
this
.
.
schedule
(
)
;
}
}
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
MOUSE_LEAVE
,
=>
{
this
.
=
false
;
}
)
)
;
this
.
_register
(
addDisposableListener
(
this
.
,
.
FOCUS_OUT
,
=>
{
if
(
this
.
&&
!
isAncestor
(
getActiveElement
(
)
,
this
.
)
)
{
this
.
.
schedule
(
)
;
}
}
)
)
;
this
.
_register
(
this
.
.
.
onScroll
(
(
)
=>
{
if
(
this
.
.
===
this
.
)
{
this
.
.
.
focus
(
false
)
;
this
.
cleanupExistingSubmenu
(
true
)
;
}
}
)
)
;
}
protected
updateEnabled
(
)
:
void
{
}
open
(
?
:
boolean
)
:
void
{
this
.
cleanupExistingSubmenu
(
false
)
;
this
.
createSubmenu
(
)
;
}
onClick
(
:
)
:
void
{
.
stop
(
,
true
)
;
this
.
cleanupExistingSubmenu
(
false
)
;
this
.
createSubmenu
(
true
)
;
}
private
cleanupExistingSubmenu
(
:
boolean
)
:
void
{
if
(
this
.
.
&&
(
||
(
this
.
.
!==
this
.
)
)
)
{
try
{
this
.
.
.
dispose
(
)
;
}
catch
{
}
this
.
.
=
undefined
;
this
.
updateAriaExpanded
(
'false'
)
;
if
(
this
.
)
{
this
.
.
clear
(
)
;
this
.
=
undefined
;
}
}
}
private
calculateSubmenuMenuLayout
(
:
,
:
,
:
,
:
)
:
{
:
number
;
:
number
}
{
const
=
{
:
0
,
:
0
}
;
.
=
layout
(
.
,
.
,
{
:
.
===
.
?
.
:
.
,
:
.
,
:
.
}
)
.
;
if
(
.
>=
.
&&
.
<
.
+
.
)
{
if
(
.
+
10
+
.
<=
.
)
{
.
=
.
+
10
;
}
.
+=
10
;
.
=
0
;
}
.
=
layout
(
.
,
.
,
{
:
.
,
:
.
,
:
0
}
)
.
;
if
(
.
+
.
===
.
&&
.
+
.
+
.
<=
.
)
{
.
+=
.
;
}
return
;
}
private
createSubmenu
(
=
true
)
:
void
{
if
(
!
this
.
)
{
return
;
}
if
(
!
this
.
.
)
{
this
.
updateAriaExpanded
(
'true'
)
;
this
.
=
append
(
this
.
,
$
(
'div.monaco-submenu'
)
)
;
this
.
.
.
add
(
'menubar-menu-items-holder'
,
'context-view'
)
;
const
=
getWindow
(
this
.
.
.
)
.
getComputedStyle
(
this
.
.
.
)
;
const
=
parseFloat
(
.
||
'0'
)
||
0
;
this
.
.
.
=
'fixed'
;
this
.
.
.
=
'0'
;
this
.
.
.
=
'0'
;
this
.
.
.
=
'1'
;
this
.
.
=
new
Menu
(
this
.
,
this
.
.
?
this
.
:
[
new
EmptySubmenuAction
(
)
]
,
this
.
,
this
.
)
;
const
=
this
.
.
getBoundingClientRect
(
)
;
const
=
{
:
.
-
,
:
.
,
:
.
+
2
*
,
:
.
}
;
const
=
this
.
.
getBoundingClientRect
(
)
;
const
=
getWindow
(
this
.
)
;
const
{
,
}
=
this
.
calculateSubmenuMenuLayout
(
new
Dimension
(
.
,
.
)
,
.
lift
(
)
,
,
this
.
)
;
this
.
.
.
=
` ${ left - viewBox. left} px `
;
this
.
.
.
=
` ${ top - viewBox. top} px `
;
this
.
.
add
(
addDisposableListener
(
this
.
,
.
KEY_UP
,
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
.
equals
(
.
)
)
{
.
stop
(
,
true
)
;
this
.
.
.
focus
(
)
;
this
.
cleanupExistingSubmenu
(
true
)
;
}
}
)
)
;
this
.
.
add
(
addDisposableListener
(
this
.
,
.
KEY_DOWN
,
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
.
equals
(
.
)
)
{
.
stop
(
,
true
)
;
}
}
)
)
;
this
.
.
add
(
this
.
.
.
onDidCancel
(
(
)
=>
{
this
.
.
.
focus
(
)
;
this
.
cleanupExistingSubmenu
(
true
)
;
}
)
)
;
this
.
.
.
focus
(
)
;
this
.
=
this
.
.
;
}
else
{
this
.
.
.
focus
(
false
)
;
}
}
private
updateAriaExpanded
(
:
string
)
:
void
{
if
(
this
.
)
{
this
.
?.
setAttribute
(
'aria-expanded'
,
)
;
}
}
protected
applyStyle
(
)
:
void
{
super
.
applyStyle
(
)
;
const
=
this
.
&&
this
.
.
.
contains
(
'focused'
)
;
const
=
&&
this
.
.
?
this
.
.
:
this
.
.
;
if
(
this
.
)
{
this
.
.
.
=
??
''
;
}
}
dispose
(
)
:
void
{
super
.
dispose
(
)
;
this
.
.
dispose
(
)
;
if
(
this
.
)
{
this
.
.
dispose
(
)
;
this
.
=
null
;
}
if
(
this
.
)
{
this
.
=
undefined
;
}
}
}
class
MenuSeparatorActionViewItem
extends
ActionViewItem
{
constructor
(
:
unknown
,
:
,
:
,
private
readonly
:
)
{
super
(
,
,
)
;
}
render
(
:
)
:
void
{
super
.
render
(
)
;
if
(
this
.
)
{
this
.
.
.
=
this
.
.
?
` ${ this . menuStyles. separatorColor} `
:
''
;
}
}
}
export
function
cleanMnemonic
(
:
string
)
:
string
{
const
=
MENU_MNEMONIC_REGEX
;
const
=
.
exec
(
)
;
if
(
!
)
{
return
;
}
const
=
!
[
1
]
;
return
.
replace
(
,
?
'$2$3'
:
''
)
.
trim
(
)
;
}
export
function
formatRule
(
:
)
{
const
=
getCodiconFontCharacters
(
)
[
.
]
;
return
` .codicon- ${ c. id} :before { content: '\\ ${ fontCharacter. toString ( 16 ) } '; } `
;
}
export
function
getMenuWidgetCSS
(
:
,
:
boolean
)
:
string
{
const
=
.
??
'var(--vscode-menu-border)'
;
const
=
` var(--vscode-shadow-lg ${ style. shadowColor ? ` , 0 0 12px ${ style. shadowColor} ` : '' } ) `
;
let
=
`
.monaco-menu {
font-size: 13px;
border-radius: var(--vscode-cornerRadius-large);
border: var(--vscode-strokeThickness) solid ${ borderColor} ;
min-width: 160px;
}
${ formatRule ( Codicon. menuSelection) }
${ formatRule ( Codicon. menuSubmenu) }
.monaco-menu .monaco-action-bar {
text-align: right;
overflow: hidden;
white-space: nowrap;
}
.monaco-menu .monaco-action-bar .actions-container {
display: flex;
margin: 0 auto;
padding: 0;
width: 100%;
justify-content: flex-end;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: inline-block;
}
.monaco-menu .monaco-action-bar.reverse .actions-container {
flex-direction: row-reverse;
}
.monaco-menu .monaco-action-bar .action-item {
cursor: pointer;
display: inline-block;
transition: transform 50ms ease;
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}
.monaco-menu .monaco-action-bar .action-item.disabled {
cursor: default;
}
.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
display: inline-block;
}
.monaco-menu .monaco-action-bar .action-item .codicon {
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar .action-label {
font-size: 11px;
margin-right: 4px;
}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
color: var(--vscode-disabledForeground);
}
/* Vertical actions */
.monaco-menu .monaco-action-bar.vertical {
text-align: left;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
display: block;
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
padding-top: 1px;
padding: 30px;
}
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
margin-left: 6px;
}
/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
flex: 1;
max-width: 170px;
min-width: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.monaco-menu .monaco-action-bar.vertical {
margin-left: 0;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
padding: 0;
transform: none;
display: flex;
}
.monaco-menu .monaco-action-bar.vertical .action-item.active {
transform: none;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
flex: 1 1 auto;
display: flex;
height: 24px;
align-items: center;
position: relative;
margin: 0 4px;
border-radius: var(--vscode-cornerRadius-medium);
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
opacity: unset;
}
.monaco-menu .monaco-action-bar.vertical .action-label {
flex: 1 1 auto;
text-decoration: none;
padding: 0 1em;
background: none;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
display: inline-block;
flex: 2 1 auto;
padding: 0 1em;
text-align: right;
font-size: 12px;
line-height: 1;
opacity: 0.7;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
font-size: 16px !important;
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
margin-left: auto;
margin-right: -20px;
}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
opacity: 0.4;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
display: inline-block;
box-sizing: border-box;
margin: 0;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
position: static;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
position: absolute;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
width: 100%;
height: 0px !important;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
padding: 0.7em 1em 0.1em 1em;
font-weight: bold;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label:hover {
color: inherit;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
position: absolute;
visibility: hidden;
width: 1em;
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
visibility: visible;
display: flex;
align-items: center;
justify-content: center;
}
/* Context Menu */
.context-view.monaco-menu-container {
${ CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE } : ${ menuShadow} ;
outline: 0;
border: none;
animation: fadeIn 0.083s linear;
-webkit-app-region: no-drag;
box-shadow: var( ${ CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE } );
border-radius: var(--vscode-cornerRadius-large);
overflow: hidden;
}
.context-view.monaco-menu-container :focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
outline: 0;
}
.hc-black .context-view.monaco-menu-container,
.hc-light .context-view.monaco-menu-container,
:host-context(.hc-black) .context-view.monaco-menu-container,
:host-context(.hc-light) .context-view.monaco-menu-container {
${ CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE } : none;
box-shadow: none;
}
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
background: none;
}
/* Show the menu item selection border only for keyboard navigation. Pointer-driven focus typically does not set :focus-visible, so suppress the border in that case. */
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus:not(:focus-visible) {
outline: none !important;
outline-offset: 0 !important;
}
/* High contrast themes always show the selection border to indicate the focused item, regardless of input modality. The duplicated .monaco-menu raises specificity above the keyboard-only suppression rule above so this wins independent of declaration order. */
.hc-black .monaco-menu.monaco-menu .monaco-action-bar.vertical .action-item.focused > .action-menu-item,
.hc-light .monaco-menu.monaco-menu .monaco-action-bar.vertical .action-item.focused > .action-menu-item {
outline: 1px solid var(--vscode-menu-selectionBorder) !important;
outline-offset: -1px !important;
}
/* Keep :host-context separate because WebKit otherwise rejects the valid selectors above. */
:host-context(.hc-black) .monaco-menu.monaco-menu .monaco-action-bar.vertical .action-item.focused > .action-menu-item,
:host-context(.hc-light) .monaco-menu.monaco-menu .monaco-action-bar.vertical .action-item.focused > .action-menu-item {
outline: 1px solid var(--vscode-menu-selectionBorder) !important;
outline-offset: -1px !important;
}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical {
padding: 4px 0;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 24px;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
font-size: inherit;
padding: 0 2em;
max-height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
font-size: inherit;
width: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
font-size: inherit;
margin: 5px 0 !important;
padding: 0;
border-radius: 0;
}
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
margin-left: 0;
margin-right: 0;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
font-size: 60%;
padding: 0 1.8em;
}
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
mask-size: 10px 10px;
-webkit-mask-size: 10px 10px;
}
.monaco-menu .action-item {
cursor: default;
} `
;
if
(
)
{
+=
`
/* Arrows */
.monaco-scrollable-element > .scrollbar > .scra {
cursor: pointer;
font-size: 11px !important;
}
.monaco-scrollable-element > .visible {
opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */
background:rgba(0,0,0,0);
transition: opacity 100ms linear;
}
.monaco-scrollable-element > .invisible {
opacity: 0;
pointer-events: none;
}
.monaco-scrollable-element > .invisible.fade {
transition: opacity 800ms linear;
}
/* Scrollable Content Inset Shadow */
.monaco-scrollable-element > .shadow {
position: absolute;
display: none;
}
.monaco-scrollable-element > .shadow.top {
display: block;
top: 0;
left: 3px;
height: 3px;
width: 100%;
}
.monaco-scrollable-element > .shadow.left {
display: block;
top: 3px;
left: 0;
height: 100%;
width: 3px;
}
.monaco-scrollable-element > .shadow.top-left-corner {
display: block;
top: 0;
left: 0;
height: 3px;
width: 3px;
}
/* Fix for https://github.com/microsoft/vscode/issues/103170 */
.monaco-menu .action-item .monaco-submenu {
z-index: 1;
}
`
;
const
=
.
;
if
(
)
{
+=
`
.monaco-scrollable-element > .shadow.top {
box-shadow: ${ scrollbarShadowColor} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${ scrollbarShadowColor} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${ scrollbarShadowColor} 6px 6px 6px -6px inset;
}
`
;
}
const
=
.
;
if
(
)
{
+=
`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${ scrollbarSliderBackgroundColor} ;
}
`
;
}
const
=
.
;
if
(
)
{
+=
`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${ scrollbarSliderHoverBackgroundColor} ;
}
`
;
}
const
=
.
;
if
(
)
{
+=
`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${ scrollbarSliderActiveBackgroundColor} ;
}
`
;
}
}
return
;
}