monaco-editor-core 0.57.0 → 0.58.0-dev-20261104

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.
Files changed (508) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +38 -6
  18. package/esm/vs/base/browser/browser.js +8 -0
  19. package/esm/vs/base/browser/browser.js.map +1 -1
  20. package/esm/vs/base/browser/contextmenu.js +8 -1
  21. package/esm/vs/base/browser/contextmenu.js.map +1 -1
  22. package/esm/vs/base/browser/dom.js +34 -5
  23. package/esm/vs/base/browser/dom.js.map +1 -1
  24. package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
  25. package/esm/vs/base/browser/markdownRenderer.js +48 -21
  26. package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
  27. package/esm/vs/base/browser/pixelRatio.js +3 -2
  28. package/esm/vs/base/browser/pixelRatio.js.map +1 -1
  29. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
  30. package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
  31. package/esm/vs/base/browser/ui/actionbar/actionbar.js +7 -2
  32. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  33. package/esm/vs/base/browser/ui/animations/animations.js +68 -40
  34. package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
  35. package/esm/vs/base/browser/ui/button/button.js +7 -0
  36. package/esm/vs/base/browser/ui/button/button.js.map +1 -1
  37. package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  38. package/esm/vs/base/browser/ui/contextview/contextview.css +15 -0
  39. package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
  40. package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
  41. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
  42. package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
  43. package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
  44. package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
  45. package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
  46. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
  47. package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
  48. package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
  49. package/esm/vs/base/browser/ui/list/listView.js +87 -15
  50. package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
  51. package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
  52. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  53. package/esm/vs/base/browser/ui/menu/menu.js +189 -52
  54. package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
  55. package/esm/vs/base/browser/ui/radio/radio.css +11 -0
  56. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
  57. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  58. package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
  59. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +14 -8
  60. package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
  61. package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
  62. package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
  63. package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
  64. package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
  65. package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
  66. package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
  67. package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
  68. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  69. package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
  70. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  71. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
  72. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  73. package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
  74. package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
  75. package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
  76. package/esm/vs/base/common/actions.js +8 -2
  77. package/esm/vs/base/common/actions.js.map +1 -1
  78. package/esm/vs/base/common/arrays.js +4 -4
  79. package/esm/vs/base/common/arrays.js.map +1 -1
  80. package/esm/vs/base/common/async.js +12 -8
  81. package/esm/vs/base/common/async.js.map +1 -1
  82. package/esm/vs/base/common/cancellation.js +25 -0
  83. package/esm/vs/base/common/cancellation.js.map +1 -1
  84. package/esm/vs/base/common/codicons.js +2 -0
  85. package/esm/vs/base/common/codicons.js.map +1 -1
  86. package/esm/vs/base/common/codiconsLibrary.js +2 -0
  87. package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
  88. package/esm/vs/base/common/color.js +1 -1
  89. package/esm/vs/base/common/color.js.map +1 -1
  90. package/esm/vs/base/common/diff/diff.js +60 -1
  91. package/esm/vs/base/common/diff/diff.js.map +1 -1
  92. package/esm/vs/base/common/event.js +1 -1
  93. package/esm/vs/base/common/event.js.map +1 -1
  94. package/esm/vs/base/common/glob.js +1 -0
  95. package/esm/vs/base/common/glob.js.map +1 -1
  96. package/esm/vs/base/common/htmlContent.js +74 -12
  97. package/esm/vs/base/common/htmlContent.js.map +1 -1
  98. package/esm/vs/base/common/json.js +19 -0
  99. package/esm/vs/base/common/json.js.map +1 -0
  100. package/esm/vs/base/common/network.js +16 -0
  101. package/esm/vs/base/common/network.js.map +1 -1
  102. package/esm/vs/base/common/resources.js +14 -2
  103. package/esm/vs/base/common/resources.js.map +1 -1
  104. package/esm/vs/base/common/strings.js +1 -1
  105. package/esm/vs/base/common/strings.js.map +1 -1
  106. package/esm/vs/base/common/uri.js +2 -2
  107. package/esm/vs/base/common/uri.js.map +1 -1
  108. package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
  109. package/esm/vs/editor/browser/config/fontMeasurements.js +19 -6
  110. package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
  111. package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
  112. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
  113. package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
  114. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
  115. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  116. package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
  117. package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
  118. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
  119. package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
  120. package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
  121. package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
  122. package/esm/vs/editor/browser/coreCommands.js +2 -2
  123. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  124. package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
  125. package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
  126. package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
  127. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
  128. package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
  129. package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
  130. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  131. package/esm/vs/editor/browser/services/openerService.js +6 -2
  132. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  133. package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
  134. package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
  135. package/esm/vs/editor/browser/view/viewController.js +7 -7
  136. package/esm/vs/editor/browser/view/viewController.js.map +1 -1
  137. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  138. package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
  139. package/esm/vs/editor/browser/view.js +5 -5
  140. package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
  141. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
  142. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  143. package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
  144. package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
  145. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
  146. package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
  147. package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
  148. package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
  149. package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
  150. package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
  151. package/esm/vs/editor/browser/viewParts/minimap/minimap.js +6 -6
  152. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
  153. package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
  154. package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
  155. package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
  156. package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
  157. package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
  158. package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
  159. package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
  160. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
  161. package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
  162. package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
  163. package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
  164. package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
  165. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
  166. package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
  167. package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
  168. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
  169. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  170. package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
  171. package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
  172. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
  173. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
  174. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
  175. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
  176. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
  177. package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
  178. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
  179. package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
  180. package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
  181. package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
  182. package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
  183. package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
  184. package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
  185. package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
  186. package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
  187. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
  188. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
  189. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
  190. package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
  191. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
  192. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
  193. package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
  194. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
  195. package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
  196. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
  197. package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
  198. package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
  199. package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
  200. package/esm/vs/editor/common/config/editorOptions.js +560 -500
  201. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  202. package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
  203. package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
  204. package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
  205. package/esm/vs/editor/common/cursor/cursor.js +20 -10
  206. package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
  207. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
  208. package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
  209. package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
  210. package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
  211. package/esm/vs/editor/common/cursorCommon.js +22 -21
  212. package/esm/vs/editor/common/cursorCommon.js.map +1 -1
  213. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
  214. package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
  215. package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
  216. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
  217. package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
  218. package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
  219. package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
  220. package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
  221. package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
  222. package/esm/vs/editor/common/editorContextKeys.js +53 -53
  223. package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
  224. package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
  225. package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
  226. package/esm/vs/editor/common/languages.js +56 -56
  227. package/esm/vs/editor/common/model/editStack.js +1 -1
  228. package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
  229. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  230. package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
  231. package/esm/vs/editor/common/services/languageService.js +6 -4
  232. package/esm/vs/editor/common/services/languageService.js.map +1 -1
  233. package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
  234. package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
  235. package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
  236. package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
  237. package/esm/vs/editor/common/standaloneStrings.js +11 -11
  238. package/esm/vs/editor/common/textModelEditSource.js +9 -0
  239. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  240. package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
  241. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
  242. package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
  243. package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
  244. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  245. package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
  246. package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
  247. package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
  248. package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
  249. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -20
  250. package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
  251. package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
  252. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
  253. package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
  254. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
  255. package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
  256. package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +1 -1
  257. package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
  258. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
  259. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +25 -10
  260. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  261. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
  262. package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
  263. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
  264. package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
  265. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
  266. package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
  267. package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
  268. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
  269. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  270. package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
  271. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
  272. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +39 -39
  273. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
  274. package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
  275. package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
  276. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js +19 -0
  277. package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
  278. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
  279. package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
  280. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
  281. package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
  282. package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
  283. package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
  284. package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
  285. package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
  286. package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
  287. package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
  288. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  289. package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  290. package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
  291. package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  292. package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  293. package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  294. package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
  295. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
  296. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
  297. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
  298. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  299. package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  300. package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  301. package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
  302. package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  303. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +9 -3
  304. package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
  305. package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
  306. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
  307. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
  308. package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  309. package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  310. package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
  311. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -8
  312. package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
  313. package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
  314. package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  315. package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
  316. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +5 -5
  317. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
  318. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
  319. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
  320. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
  321. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
  322. package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -7
  323. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  324. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
  325. package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
  326. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
  327. package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
  328. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
  329. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
  330. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
  331. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
  332. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
  333. package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  334. package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  335. package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
  336. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
  337. package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
  338. package/esm/vs/editor/contrib/links/browser/links.js +16 -15
  339. package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
  340. package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
  341. package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
  342. package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
  343. package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
  344. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
  345. package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
  346. package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  347. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
  348. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
  349. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
  350. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  351. package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
  352. package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  353. package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +1 -1
  354. package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
  355. package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
  356. package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
  357. package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
  358. package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
  359. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
  360. package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
  361. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
  362. package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
  363. package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
  364. package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
  365. package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
  366. package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  367. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  368. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +10 -8
  369. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
  370. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
  371. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
  372. package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
  373. package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
  374. package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
  375. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
  376. package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
  377. package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
  378. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
  379. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
  380. package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
  381. package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
  382. package/esm/vs/editor/contrib/suggest/browser/wordDistance.js +1 -1
  383. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  384. package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  385. package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  386. package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
  387. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -27
  388. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
  389. package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  390. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
  391. package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
  392. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
  393. package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
  394. package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
  395. package/esm/vs/editor/editor.api.d.ts +133 -98
  396. package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
  397. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
  398. package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
  399. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
  400. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  401. package/esm/vs/nls.js.map +1 -1
  402. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
  403. package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
  404. package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
  405. package/esm/vs/platform/actionWidget/browser/actionList.js +434 -136
  406. package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
  407. package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
  408. package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
  409. package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
  410. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
  411. package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
  412. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
  413. package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
  414. package/esm/vs/platform/actions/browser/toolbar.js +25 -12
  415. package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
  416. package/esm/vs/platform/actions/common/actions.js +4 -2
  417. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  418. package/esm/vs/platform/actions/common/menuService.js +15 -8
  419. package/esm/vs/platform/actions/common/menuService.js.map +1 -1
  420. package/esm/vs/platform/configuration/common/configuration.js +3 -1
  421. package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
  422. package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
  423. package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
  424. package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
  425. package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
  426. package/esm/vs/platform/configuration/common/configurations.js +13 -1
  427. package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
  428. package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
  429. package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
  430. package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
  431. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  432. package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
  433. package/esm/vs/platform/contextkey/common/scanner.js +5 -5
  434. package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
  435. package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
  436. package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
  437. package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
  438. package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
  439. package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
  440. package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
  441. package/esm/vs/platform/editor/common/editor.js +17 -0
  442. package/esm/vs/platform/editor/common/editor.js.map +1 -1
  443. package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  444. package/esm/vs/platform/hover/browser/hoverService.js +6 -3
  445. package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
  446. package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
  447. package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
  448. package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
  449. package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
  450. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
  451. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  452. package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  453. package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
  454. package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
  455. package/esm/vs/platform/list/browser/listService.js +27 -27
  456. package/esm/vs/platform/markers/common/markerService.js +11 -8
  457. package/esm/vs/platform/markers/common/markerService.js.map +1 -1
  458. package/esm/vs/platform/markers/common/markers.js +6 -6
  459. package/esm/vs/platform/markers/common/markers.js.map +1 -1
  460. package/esm/vs/platform/notification/common/notification.js.map +1 -1
  461. package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
  462. package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
  463. package/esm/vs/platform/opener/common/opener.js.map +1 -1
  464. package/esm/vs/platform/progress/common/progress.js.map +1 -1
  465. package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
  466. package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
  467. package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
  468. package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
  469. package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
  470. package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
  471. package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
  472. package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
  473. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  474. package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
  475. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  476. package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
  477. package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
  478. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  479. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
  480. package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
  481. package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
  482. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  483. package/esm/vs/platform/storage/common/storage.js.map +1 -1
  484. package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
  485. package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
  486. package/esm/vs/platform/theme/common/colorUtils.js +11 -3
  487. package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
  488. package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
  489. package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
  490. package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
  491. package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
  492. package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
  493. package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
  494. package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
  495. package/esm/vs/platform/theme/common/colors/inputColors.js.map +1 -1
  496. package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
  497. package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
  498. package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
  499. package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
  500. package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
  501. package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
  502. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  503. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  504. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  505. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  506. package/monaco.d.ts +133 -98
  507. package/package.json +3 -3
  508. package/version.txt +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/base/browser/ui/contextview/contextview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,cAAc,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I,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3F,CAAC;QACF,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,UAAU,CAAC,CAAU,EAAE,SAAkB;QAChD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBAC9B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAe,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YACnF,CAAC;iBAAM,IAAI,SAAS,IAAI,CAAC,GAAG,CAAC,UAAU,CAAc,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gBAChF,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,CAAC;QACF,CAAC;IACF,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE7B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;;AAGF,MAAM,eAAe,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuC/B,2BAA2B,CAAC,gDAAgD,CAAC;CAC/E,CAAC","file":"contextview.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\treadonly requiredAncestorClasses?: readonly string[];\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = ['modern-ui', 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\nconst CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nconst CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nconst CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nconst CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top * zoom,\n\t\t\tleft: elementPosition.left * zoom,\n\t\t\twidth: elementPosition.width * zoom,\n\t\t\theight: elementPosition.height * zoom\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\tif (container === this.container && usedShadowDOM === this.useShadowDOM) {\n\t\t\treturn; // container is the same and no shadow DOM usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tthis.delegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view), height: DOM.getTotalHeight(this.view) };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst { top, left } = layoutResult;\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\n\t\tthis.view.style.top = `${top - positioningOrigin.top}px`;\n\t\tthis.view.style.left = `${left - positioningOrigin.left}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && this.hasRequiredAncestorClasses(closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\ttoDispose.dispose();\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\thidingContextView.toDispose.dispose();\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate hasRequiredAncestorClasses(classNames: readonly string[] | undefined): boolean {\n\t\tif (!classNames?.length) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (let candidate: HTMLElement | null = this.view; candidate;) {\n\t\t\tconst current: HTMLElement = candidate;\n\t\t\tif (classNames.every(className => current.classList.contains(className))) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (current.parentElement) {\n\t\t\t\tcandidate = current.parentElement;\n\t\t\t} else {\n\t\t\t\tconst root = current.getRootNode();\n\t\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\treadonly requiredAncestorClasses?: readonly string[];\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = ['modern-ui', 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\nconst CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nconst CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nconst CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nconst CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top * zoom,\n\t\t\tleft: elementPosition.left * zoom,\n\t\t\twidth: elementPosition.width * zoom,\n\t\t\theight: elementPosition.height * zoom\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\tif (container === this.container && usedShadowDOM === this.useShadowDOM) {\n\t\t\treturn; // container is the same and no shadow DOM usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tthis.delegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view), height: DOM.getTotalHeight(this.view) };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst { top, left } = layoutResult;\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\n\t\tthis.view.style.top = `${top - positioningOrigin.top}px`;\n\t\tthis.view.style.left = `${left - positioningOrigin.left}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && this.hasRequiredAncestorClasses(closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\ttoDispose.dispose();\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\thidingContextView.toDispose.dispose();\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate hasRequiredAncestorClasses(classNames: readonly string[] | undefined): boolean {\n\t\tif (!classNames?.length) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (let candidate: HTMLElement | null = this.view; candidate;) {\n\t\t\tconst current: HTMLElement = candidate;\n\t\t\tif (classNames.every(className => current.classList.contains(className))) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (current.parentElement) {\n\t\t\t\tcandidate = current.parentElement;\n\t\t\t} else {\n\t\t\t\tconst root = current.getRootNode();\n\t\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/base/browser/ui/contextview/contextview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,EAA+D,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAClH,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,mBAAmB,CAAC;AAm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CAAC,EAAE,CAAC;QAChE,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzD,KAAK,CAAC,WAAW,GAAG,iBAAiB,CAAC;QACtC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC;AAED,MAAM,eAAe,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuC/B,2BAA2B,CAAC,gDAAgD,CAAC;CAC/E,CAAC","file":"contextview.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getVisibleWCOTitlebarAreaRect } from '../../browser.js';\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { onUnexpectedError } from '../../../common/errors.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport { avoidWindowControlsOverlay } from './windowControlsOverlay.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW,\n\t/**\n\t * Hosts the view inside the container (the owner) as a manual popover,\n\t * so focus stays inside the owner while the view renders in the top layer.\n\t */\n\tPOPOVER,\n\t/**\n\t * Like {@link ContextViewDOMPosition.POPOVER}, with the view in a shadow root.\n\t */\n\tPOPOVER_SHADOW\n}\n\nexport function isPopoverDOMPosition(domPosition: ContextViewDOMPosition): boolean {\n\treturn domPosition === ContextViewDOMPosition.POPOVER || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n}\n\nexport interface IContextViewRenderContext {\n\t/**\n\t * Where the view is actually hosted. A popover position can fall back\n\t * to a fixed position when the popover cannot be shown.\n\t */\n\treadonly domPosition: ContextViewDOMPosition;\n}\n\nexport interface IContextViewOptions {\n\t/**\n\t * Returns the container to use when a popover cannot be shown in its owner.\n\t * Defaults to the owner's document body.\n\t */\n\treadonly getFallbackContainer?: (owner: HTMLElement) => HTMLElement;\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement, context?: IContextViewRenderContext): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\t/** Requirements must match one ancestor; a nested array accepts any listed class. */\n\treadonly requiredAncestorClasses?: readonly (string | readonly string[])[];\n}\n\nexport function hasRequiredAncestorClasses(element: HTMLElement, classNames: IContextViewCloseAnimation['requiredAncestorClasses']): boolean {\n\tif (!classNames?.length) {\n\t\treturn true;\n\t}\n\n\tfor (let candidate: HTMLElement | null = element; candidate;) {\n\t\tconst current: HTMLElement = candidate;\n\t\tif (classNames.every(requirement => typeof requirement === 'string'\n\t\t\t? current.classList.contains(requirement)\n\t\t\t: requirement.some(className => current.classList.contains(className)))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (current.parentElement) {\n\t\t\tcandidate = current.parentElement;\n\t\t} else {\n\t\t\tconst root = current.getRootNode();\n\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = [['modern-ui', 'modern-ui-frosted-glass'], 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\n/** Inherited while an opacity animation isolates descendant menu backdrops. */\nexport const CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-backdrop-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nexport const CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nexport const CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top * zoom,\n\t\t\tleft: elementPosition.left * zoom,\n\t\t\twidth: elementPosition.width * zoom,\n\t\t\theight: elementPosition.height * zoom\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nfunction getDeepActiveElement(doc: Document): Element | null {\n\tlet result = doc.activeElement;\n\twhile (result?.shadowRoot?.activeElement) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\treturn result;\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\tprivate static readonly ISOLATED_KEY_EVENTS = ['keydown', 'keyup', 'keypress'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\tprivate domPosition: ContextViewDOMPosition = ContextViewDOMPosition.ABSOLUTE;\n\tprivate readonly toDisposeOnPopoverHide = this._register(new DisposableStore());\n\tprivate focusToRestore: HTMLElement | null = null;\n\tprivate showCount = 0;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition, private readonly options: IContextViewOptions = {}) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tconst previousDOMPosition = this.domPosition;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tconst useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n\t\tconst unchanged = container === this.container && usedShadowDOM === useShadowDOM && isPopoverDOMPosition(previousDOMPosition) === isPopoverDOMPosition(domPosition);\n\n\t\t// Tear down the previous popover while its position is still current, so\n\t\t// that its owner tracking is disposed and its top layer entry is closed\n\t\tif (this.container && !unchanged && isPopoverDOMPosition(previousDOMPosition)) {\n\t\t\tthis.hide(undefined, true);\n\t\t\tthis.completeHideAnimation();\n\t\t}\n\n\t\tthis.domPosition = domPosition;\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tthis.useShadowDOM = useShadowDOM;\n\n\t\tif (unchanged) {\n\t\t\treturn; // container is the same and neither shadow DOM nor popover usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tthis.view.removeAttribute('popover');\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tconst isPopover = isPopoverDOMPosition(domPosition);\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.shadowRootHostElement.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.view.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tif (isPopover) {\n\t\t\t\t// Keep keys pressed in the view from reaching the owner or\n\t\t\t\t// window-level keybinding listeners while the view is hosted.\n\t\t\t\tconst popoverElement = this.getPopoverElement();\n\t\t\t\tContextView.ISOLATED_KEY_EVENTS.forEach(event => {\n\t\t\t\t\ttoDisposeOnSetContainer.add(DOM.addDisposableListener(popoverElement, event, e => e.stopPropagation()));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.showCount++;\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\tconst ownerDocument = this.container?.ownerDocument ?? DOM.getActiveDocument();\n\t\tconst activeElement = getDeepActiveElement(ownerDocument);\n\t\tthis.focusToRestore = DOM.isHTMLElement(activeElement) ? activeElement : null;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.showPopover();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view, { domPosition: this.domPosition }) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.trackPopoverOwner();\n\t\t}\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Layout hides the view when its popover owner is hidden or removed,\n\t\t// for example by rendering; do not move focus into a hidden view\n\t\tif (this.delegate !== delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus\n\t\tdelegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tprivate getPopoverElement(): HTMLElement {\n\t\treturn this.shadowRootHostElement ?? this.view;\n\t}\n\n\tprivate showPopover(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fall back to a fixed position without the Popover API or a connected\n\t\t// owner; only report a failure to show a popover that should have shown\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (typeof popoverElement.showPopover === 'function' && owner.isConnected) {\n\t\t\ttry {\n\t\t\t\tif (popoverElement.parentElement !== owner) {\n\t\t\t\t\tadoptPopoverResetStyles(owner);\n\t\t\t\t\towner.appendChild(popoverElement);\n\t\t\t\t}\n\t\t\t\tif (!popoverElement.matches(':popover-open')) {\n\t\t\t\t\tpopoverElement.showPopover();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tpopoverElement.remove();\n\t\tconst fallbackContainer = this.options.getFallbackContainer?.(owner) ?? DOM.getWindow(owner).document.body;\n\t\tthis.setContainer(fallbackContainer, this.domPosition === ContextViewDOMPosition.POPOVER_SHADOW ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t}\n\n\tprivate trackPopoverOwner(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tconst targetWindow = DOM.getWindow(owner);\n\n\t\t// Dismiss on pointer presses outside both the view and its owner, without restoring focus\n\t\tthis.toDisposeOnPopoverHide.add(DOM.addDisposableListener(targetWindow, DOM.EventType.POINTER_DOWN, e => {\n\t\t\tconst path = e.composedPath();\n\t\t\tif (!path.includes(popoverElement) && !path.includes(owner)) {\n\t\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\t}\n\t\t}, true));\n\n\t\tconst ResizeObserverCtor = (targetWindow as Window & typeof globalThis).ResizeObserver;\n\t\tif (typeof ResizeObserverCtor === 'function') {\n\t\t\tconst observer = new ResizeObserverCtor(() => this.checkPopoverOwner());\n\t\t\tobserver.observe(owner);\n\t\t\tthis.toDisposeOnPopoverHide.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tprivate isPopoverOwnerLost(): boolean {\n\t\tconst owner = this.container;\n\t\treturn !owner || !owner.isConnected || owner.getClientRects().length === 0;\n\t}\n\n\tprivate checkPopoverOwner(): boolean {\n\t\tif (this.isVisible() && isPopoverDOMPosition(this.domPosition) && this.isPopoverOwnerLost()) {\n\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate hideWithoutRestoringFocus(): void {\n\t\tthis.focusToRestore = null;\n\t\tthis.hide(undefined, true);\n\t}\n\n\tprivate restorePopoverFocus(): void {\n\t\tconst focusToRestore = this.focusToRestore;\n\t\tthis.focusToRestore = null;\n\t\tif (!focusToRestore?.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getDeepActiveElement(focusToRestore.ownerDocument);\n\t\tif (activeElement && (activeElement === focusToRestore.ownerDocument.body || DOM.isAncestor(activeElement, this.view))) {\n\t\t\tfocusToRestore.focus();\n\t\t}\n\t}\n\n\tprivate hidePopover(): void {\n\t\tthis.toDisposeOnPopoverHide.clear();\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (popoverElement.hasAttribute('popover') && popoverElement.matches(':popover-open')) {\n\t\t\tpopoverElement.hidePopover();\n\t\t}\n\n\t\t// Leave nothing behind in the owner, which may be an arbitrary element such as an input's parent\n\t\tpopoverElement.remove();\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.checkPopoverOwner()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view), height: DOM.getTotalHeight(this.view) };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst adjusted = avoidWindowControlsOverlay(getVisibleWCOTitlebarAreaRect(containerWindow), viewport, view, layoutResult);\n\t\tconst { top, left } = adjusted;\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tif (adjusted === layoutResult) {\n\t\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\t} else {\n\t\t\tthis.view.classList.add(top >= anchor.top + anchor.height ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(left >= anchor.left ? 'left' : 'right');\n\t\t}\n\n\t\tthis.view.style.top = `${top - positioningOrigin.top}px`;\n\t\tthis.view.style.left = `${left - positioningOrigin.left}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst isPopover = isPopoverDOMPosition(this.domPosition);\n\t\tif (isPopover) {\n\t\t\t// Stop tracking the owner first, then restore focus before the view\n\t\t\t// becomes inert or hidden, so that focus never leaves the owner\n\t\t\tthis.toDisposeOnPopoverHide.clear();\n\t\t\tconst showCount = this.showCount;\n\t\t\tthis.restorePopoverFocus();\n\t\t\tif (this.showCount !== showCount) {\n\t\t\t\t// Restoring focus showed another view, for example an input box\n\t\t\t\t// message; it now owns the view, so only clean up this rendering\n\t\t\t\ttoDispose.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.focusToRestore = null;\n\t\t}\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && hasRequiredAncestorClasses(this.view, closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\tDOM.hide(this.view);\n\t\tif (isPopover) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\ttoDispose.dispose();\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\thidingContextView.toDispose.dispose();\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide(undefined, true);\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\n// Mirrors the popover reset in contextview.css, whose rules do not reach an\n// owner inside a shadow root\nconst POPOVER_RESET_CSS = /* css */ `\n\t.context-view[popover],\n\t.shadow-root-host[popover] {\n\t\tposition: fixed;\n\t\tinset: auto;\n\t\twidth: auto;\n\t\theight: auto;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\toverflow: visible;\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t}\n`;\n\nconst shadowRootsWithPopoverReset = new WeakSet<ShadowRoot>();\n\nfunction adoptPopoverResetStyles(owner: HTMLElement): void {\n\tconst shadowRoot = DOM.getShadowRoot(owner);\n\tif (shadowRoot && !shadowRootsWithPopoverReset.has(shadowRoot)) {\n\t\tshadowRootsWithPopoverReset.add(shadowRoot);\n\t\tconst style = owner.ownerDocument.createElement('style');\n\t\tstyle.textContent = POPOVER_RESET_CSS;\n\t\tshadowRoot.appendChild(style);\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { getVisibleWCOTitlebarAreaRect } from '../../browser.js';\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { createStyleSheet } from '../../domStylesheets.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { onUnexpectedError } from '../../../common/errors.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition, IRect, layout2d } from '../../../common/layout.js';\nimport * as platform from '../../../common/platform.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport { avoidWindowControlsOverlay } from './windowControlsOverlay.js';\nimport './contextview.css';\n\nexport { AnchorAlignment, AnchorAxisAlignment, AnchorPosition } from '../../../common/layout.js';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW,\n\t/**\n\t * Hosts the view inside the container (the owner) as a manual popover,\n\t * so focus stays inside the owner while the view renders in the top layer.\n\t */\n\tPOPOVER,\n\t/**\n\t * Like {@link ContextViewDOMPosition.POPOVER}, with the view in a shadow root.\n\t */\n\tPOPOVER_SHADOW\n}\n\nexport function isPopoverDOMPosition(domPosition: ContextViewDOMPosition): boolean {\n\treturn domPosition === ContextViewDOMPosition.POPOVER || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n}\n\nexport interface IContextViewRenderContext {\n\t/**\n\t * Where the view is actually hosted. A popover position can fall back\n\t * to a fixed position when the popover cannot be shown.\n\t */\n\treadonly domPosition: ContextViewDOMPosition;\n}\n\nexport interface IContextViewOptions {\n\t/**\n\t * Returns the container to use when a popover cannot be shown in its owner.\n\t * Defaults to the owner's document body.\n\t */\n\treadonly getFallbackContainer?: (owner: HTMLElement) => HTMLElement;\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement, context?: IContextViewRenderContext): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewCloseAnimation {\n\treadonly className: string;\n\treadonly duration: number;\n\t/** Requirements must match one ancestor; a nested array accepts any listed class. */\n\treadonly requiredAncestorClasses?: readonly (string | readonly string[])[];\n}\n\nexport function hasRequiredAncestorClasses(element: HTMLElement, classNames: IContextViewCloseAnimation['requiredAncestorClasses']): boolean {\n\tif (!classNames?.length) {\n\t\treturn true;\n\t}\n\n\tfor (let candidate: HTMLElement | null = element; candidate;) {\n\t\tconst current: HTMLElement = candidate;\n\t\tif (classNames.every(requirement => typeof requirement === 'string'\n\t\t\t? current.classList.contains(requirement)\n\t\t\t: requirement.some(className => current.classList.contains(className)))) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (current.parentElement) {\n\t\t\tcandidate = current.parentElement;\n\t\t} else {\n\t\t\tconst root = current.getRootNode();\n\t\t\tcandidate = root instanceof ShadowRoot && DOM.isHTMLElement(root.host) ? root.host : null;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport const CONTEXT_VIEW_MENU_MOTION_CLASS = 'context-view-menu-motion';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS = 'context-view-menu-motion-closing';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION = 150;\nexport const CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES = [['modern-ui', 'modern-ui-frosted-glass'], 'monaco-enable-motion'] as const;\nexport const CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE = '--vscode-context-view-close-animation-duration';\nexport const CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE = '--vscode-context-view-menu-motion-shadow';\n/** Inherited while an opacity animation isolates descendant menu backdrops. */\nexport const CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-backdrop-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE = '--vscode-context-view-menu-motion-close-start-opacity';\nexport const CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE = '--vscode-context-view-menu-motion-close-start-transform';\n\nexport const CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS = 250;\nexport const CONTEXT_VIEW_MENU_MOTION_EASING = 'cubic-bezier(0.22, 1, 0.36, 1)';\n\nexport const contextViewMenuCloseAnimation: IContextViewCloseAnimation = {\n\tclassName: CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS,\n\tduration: CONTEXT_VIEW_MENU_MOTION_CLOSE_ANIMATION_DURATION,\n\trequiredAncestorClasses: CONTEXT_VIEW_MENU_MOTION_ANCESTOR_CLASSES,\n};\n\nfunction getContextViewMenuMotionCss(enabledSelectorPrefix: string): string {\n\treturn /* css */ `\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} {\n\t\tanimation: none;\n\t\tbox-shadow: none;\n\t\toverflow: visible;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-open ${CONTEXT_VIEW_MENU_MOTION_OPEN_DURATION_MS}ms ${CONTEXT_VIEW_MENU_MOTION_EASING} backwards;\n\t\tbox-shadow: var(${CONTEXT_VIEW_MENU_MOTION_SHADOW_VARIABLE});\n\t\ttransform-origin: top left;\n\t\twill-change: opacity;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.right > .monaco-scrollable-element {\n\t\ttransform-origin: top right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top > .monaco-scrollable-element {\n\t\ttransform-origin: bottom left;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.top.right > .monaco-scrollable-element {\n\t\ttransform-origin: bottom right;\n\t}\n\n\t${enabledSelectorPrefix} .context-view.${CONTEXT_VIEW_MENU_MOTION_CLASS}.${CONTEXT_VIEW_MENU_MOTION_CLOSING_CLASS} > .monaco-scrollable-element {\n\t\tanimation: context-view-menu-motion-close var(${CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE}) ${CONTEXT_VIEW_MENU_MOTION_EASING} both;\n\t\tpointer-events: none;\n\t}\n\n\t@keyframes context-view-menu-motion-open {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.97);\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 1;\n\t\t\ttransform: scale(1);\n\t\t}\n\t}\n\n\t@keyframes context-view-menu-motion-close {\n\t\tfrom, to {\n\t\t\t${CONTEXT_VIEW_MENU_MOTION_BACKDROP_OPACITY_VARIABLE}: 100%;\n\t\t}\n\n\t\t0% {\n\t\t\topacity: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE}, 1);\n\t\t\ttransform: var(${CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE}, scale(1));\n\t\t}\n\n\t\t100% {\n\t\t\topacity: 0;\n\t\t\ttransform: scale(0.99);\n\t\t}\n\t}`;\n}\n\nlet contextViewMenuMotionStyleSheet: HTMLStyleElement | undefined;\n\nfunction ensureContextViewMenuMotionStyleSheet(): void {\n\tif (!contextViewMenuMotionStyleSheet) {\n\t\tcontextViewMenuMotionStyleSheet = createStyleSheet(undefined, style => {\n\t\t\tstyle.textContent = getContextViewMenuMotionCss('.modern-ui.monaco-enable-motion');\n\t\t});\n\t}\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport function getAnchorRect(anchor: HTMLElement | StandardMouseEvent | IAnchor): IRect {\n\t// Get the element's position and size (to anchor the view)\n\tif (DOM.isHTMLElement(anchor)) {\n\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\treturn {\n\t\t\ttop: elementPosition.top * zoom,\n\t\t\tleft: elementPosition.left * zoom,\n\t\t\twidth: elementPosition.width * zoom,\n\t\t\theight: elementPosition.height * zoom\n\t\t};\n\t} else if (isAnchor(anchor)) {\n\t\treturn {\n\t\t\ttop: anchor.y,\n\t\t\tleft: anchor.x,\n\t\t\twidth: anchor.width || 1,\n\t\t\theight: anchor.height || 2\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\ttop: anchor.posy,\n\t\t\tleft: anchor.posx,\n\t\t\t// We are about to position the context view where the mouse\n\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\twidth: 2,\n\t\t\theight: 2\n\t\t};\n\t}\n}\n\nfunction getDeepActiveElement(doc: Document): Element | null {\n\tlet result = doc.activeElement;\n\twhile (result?.shadowRoot?.activeElement) {\n\t\tresult = result.shadowRoot.activeElement;\n\t}\n\treturn result;\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\tprivate static readonly ISOLATED_KEY_EVENTS = ['keydown', 'keyup', 'keypress'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate hidingContextView: { readonly disposable: IDisposable; readonly toDispose: IDisposable; readonly className: string } | undefined;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\tprivate domPosition: ContextViewDOMPosition = ContextViewDOMPosition.ABSOLUTE;\n\tprivate readonly toDisposeOnPopoverHide = this._register(new DisposableStore());\n\tprivate focusToRestore: HTMLElement | null = null;\n\tprivate showCount = 0;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition, private readonly options: IContextViewOptions = {}) {\n\t\tsuper();\n\n\t\tensureContextViewMenuMotionStyleSheet();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tconst previousDOMPosition = this.domPosition;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tconst useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW || domPosition === ContextViewDOMPosition.POPOVER_SHADOW;\n\t\tconst unchanged = container === this.container && usedShadowDOM === useShadowDOM && isPopoverDOMPosition(previousDOMPosition) === isPopoverDOMPosition(domPosition);\n\n\t\t// Tear down the previous popover while its position is still current, so\n\t\t// that its owner tracking is disposed and its top layer entry is closed\n\t\tif (this.container && !unchanged && isPopoverDOMPosition(previousDOMPosition)) {\n\t\t\tthis.hide(undefined, true);\n\t\t\tthis.completeHideAnimation();\n\t\t}\n\n\t\tthis.domPosition = domPosition;\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tthis.useShadowDOM = useShadowDOM;\n\n\t\tif (unchanged) {\n\t\t\treturn; // container is the same and neither shadow DOM nor popover usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tthis.view.removeAttribute('popover');\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\t\t\tconst isPopover = isPopoverDOMPosition(domPosition);\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tObject.assign(this.shadowRootHostElement.style, {\n\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\ttop: '0',\n\t\t\t\t\tleft: '0',\n\t\t\t\t\twidth: '0',\n\t\t\t\t\theight: '0'\n\t\t\t\t});\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.shadowRootHostElement.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\t}\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tif (isPopover) {\n\t\t\t\t\t// Attached to the owner only while shown, see showPopover.\n\t\t\t\t\t// contextview.css resets the user agent popover styles\n\t\t\t\t\tthis.view.setAttribute('popover', 'manual');\n\t\t\t\t} else {\n\t\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tif (isPopover) {\n\t\t\t\t// Keep keys pressed in the view from reaching the owner or\n\t\t\t\t// window-level keybinding listeners while the view is hosted.\n\t\t\t\tconst popoverElement = this.getPopoverElement();\n\t\t\t\tContextView.ISOLATED_KEY_EVENTS.forEach(event => {\n\t\t\t\t\ttoDisposeOnSetContainer.add(DOM.addDisposableListener(popoverElement, event, e => e.stopPropagation()));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tthis.showCount++;\n\t\tthis.completeHideAnimation();\n\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide(undefined, true);\n\t\t}\n\n\t\tconst ownerDocument = this.container?.ownerDocument ?? DOM.getActiveDocument();\n\t\tconst activeElement = getDeepActiveElement(ownerDocument);\n\t\tthis.focusToRestore = DOM.isHTMLElement(activeElement) ? activeElement : null;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.showPopover();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.zIndex = zIndex;\n\t\tif (this.shadowRootHostElement) {\n\t\t\tthis.shadowRootHostElement.style.zIndex = zIndex;\n\t\t}\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view, { domPosition: this.domPosition }) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.trackPopoverOwner();\n\t\t}\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Layout hides the view when its popover owner is hidden or removed,\n\t\t// for example by rendering; do not move focus into a hidden view\n\t\tif (this.delegate !== delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus\n\t\tdelegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tprivate getPopoverElement(): HTMLElement {\n\t\treturn this.shadowRootHostElement ?? this.view;\n\t}\n\n\tprivate showPopover(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fall back to a fixed position without the Popover API or a connected\n\t\t// owner; only report a failure to show a popover that should have shown\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (typeof popoverElement.showPopover === 'function' && owner.isConnected) {\n\t\t\ttry {\n\t\t\t\tif (popoverElement.parentElement !== owner) {\n\t\t\t\t\tadoptPopoverResetStyles(owner);\n\t\t\t\t\towner.appendChild(popoverElement);\n\t\t\t\t}\n\t\t\t\tif (!popoverElement.matches(':popover-open')) {\n\t\t\t\t\tpopoverElement.showPopover();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\tonUnexpectedError(e);\n\t\t\t}\n\t\t}\n\n\t\tpopoverElement.remove();\n\t\tconst fallbackContainer = this.options.getFallbackContainer?.(owner) ?? DOM.getWindow(owner).document.body;\n\t\tthis.setContainer(fallbackContainer, this.domPosition === ContextViewDOMPosition.POPOVER_SHADOW ? ContextViewDOMPosition.FIXED_SHADOW : ContextViewDOMPosition.FIXED);\n\t}\n\n\tprivate trackPopoverOwner(): void {\n\t\tconst owner = this.container;\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tconst targetWindow = DOM.getWindow(owner);\n\n\t\t// Dismiss on pointer presses outside both the view and its owner, without restoring focus\n\t\tthis.toDisposeOnPopoverHide.add(DOM.addDisposableListener(targetWindow, DOM.EventType.POINTER_DOWN, e => {\n\t\t\tconst path = e.composedPath();\n\t\t\tif (!path.includes(popoverElement) && !path.includes(owner)) {\n\t\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\t}\n\t\t}, true));\n\n\t\tconst ResizeObserverCtor = (targetWindow as Window & typeof globalThis).ResizeObserver;\n\t\tif (typeof ResizeObserverCtor === 'function') {\n\t\t\tconst observer = new ResizeObserverCtor(() => this.checkPopoverOwner());\n\t\t\tobserver.observe(owner);\n\t\t\tthis.toDisposeOnPopoverHide.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tprivate isPopoverOwnerLost(): boolean {\n\t\tconst owner = this.container;\n\t\treturn !owner || !owner.isConnected || owner.getClientRects().length === 0;\n\t}\n\n\tprivate checkPopoverOwner(): boolean {\n\t\tif (this.isVisible() && isPopoverDOMPosition(this.domPosition) && this.isPopoverOwnerLost()) {\n\t\t\tthis.hideWithoutRestoringFocus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tprivate hideWithoutRestoringFocus(): void {\n\t\tthis.focusToRestore = null;\n\t\tthis.hide(undefined, true);\n\t}\n\n\tprivate restorePopoverFocus(): void {\n\t\tconst focusToRestore = this.focusToRestore;\n\t\tthis.focusToRestore = null;\n\t\tif (!focusToRestore?.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getDeepActiveElement(focusToRestore.ownerDocument);\n\t\tif (activeElement && (activeElement === focusToRestore.ownerDocument.body || DOM.isAncestor(activeElement, this.view))) {\n\t\t\tfocusToRestore.focus();\n\t\t}\n\t}\n\n\tprivate hidePopover(): void {\n\t\tthis.toDisposeOnPopoverHide.clear();\n\n\t\tconst popoverElement = this.getPopoverElement();\n\t\tif (popoverElement.hasAttribute('popover') && popoverElement.matches(':popover-open')) {\n\t\t\tpopoverElement.hidePopover();\n\t\t}\n\n\t\t// Leave nothing behind in the owner, which may be an arbitrary element such as an input's parent\n\t\tpopoverElement.remove();\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.checkPopoverOwner()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = getAnchorRect(this.delegate!.getAnchor());\n\t\tconst containerWindow = this.container ? DOM.getWindow(this.container) : DOM.getActiveWindow();\n\t\tconst viewport = { top: containerWindow.pageYOffset, left: containerWindow.pageXOffset, width: containerWindow.innerWidth, height: containerWindow.innerHeight };\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tconst positioningOrigin = DOM.getDomNodePagePosition(this.view);\n\t\tconst view = { width: DOM.getTotalWidth(this.view), height: DOM.getTotalHeight(this.view) };\n\t\tconst anchorPosition = this.delegate!.anchorPosition;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment;\n\t\tconst layoutResult = layout2d(viewport, view, anchor, { anchorAlignment, anchorPosition, anchorAxisAlignment });\n\t\tconst adjusted = avoidWindowControlsOverlay(getVisibleWCOTitlebarAreaRect(containerWindow), viewport, view, layoutResult);\n\t\tconst { top, left } = adjusted;\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tif (adjusted === layoutResult) {\n\t\t\tthis.view.classList.add(layoutResult.anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(layoutResult.anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\t} else {\n\t\t\tthis.view.classList.add(top >= anchor.top + anchor.height ? 'bottom' : 'top');\n\t\t\tthis.view.classList.add(left >= anchor.left ? 'left' : 'right');\n\t\t}\n\n\t\tthis.view.style.top = `${top - positioningOrigin.top}px`;\n\t\tthis.view.style.left = `${left - positioningOrigin.left}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown, skipAnimation = false): void {\n\t\tif (this.hidingContextView) {\n\t\t\tif (skipAnimation) {\n\t\t\t\tthis.completeHideAnimation();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (!delegate) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst toDispose = this.toDisposeOnClean;\n\t\tthis.toDisposeOnClean = Disposable.None;\n\n\t\tdelegate.onHide?.(data);\n\n\t\tconst isPopover = isPopoverDOMPosition(this.domPosition);\n\t\tif (isPopover) {\n\t\t\t// Stop tracking the owner first, then restore focus before the view\n\t\t\t// becomes inert or hidden, so that focus never leaves the owner\n\t\t\tthis.toDisposeOnPopoverHide.clear();\n\t\t\tconst showCount = this.showCount;\n\t\t\tthis.restorePopoverFocus();\n\t\t\tif (this.showCount !== showCount) {\n\t\t\t\t// Restoring focus showed another view, for example an input box\n\t\t\t\t// message; it now owns the view, so only clean up this rendering\n\t\t\t\ttoDispose.dispose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.focusToRestore = null;\n\t\t}\n\n\t\tconst closeAnimation = delegate.closeAnimation;\n\t\tif (!skipAnimation && closeAnimation && closeAnimation.duration > 0 && hasRequiredAncestorClasses(this.view, closeAnimation.requiredAncestorClasses)) {\n\t\t\tthis.view.style.setProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE, `${closeAnimation.duration}ms`);\n\t\t\tthis.prepareMenuCloseAnimation();\n\t\t\tthis.view.inert = true;\n\t\t\tthis.view.classList.add(closeAnimation.className);\n\t\t\tconst timeout = setTimeout(() => this.completeHideAnimation(), closeAnimation.duration);\n\t\t\tthis.hidingContextView = {\n\t\t\t\tdisposable: toDisposable(() => clearTimeout(timeout)),\n\t\t\t\ttoDispose,\n\t\t\t\tclassName: closeAnimation.className\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\n\t\tDOM.hide(this.view);\n\t\tif (isPopover) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\ttoDispose.dispose();\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate completeHideAnimation(): void {\n\t\tconst hidingContextView = this.hidingContextView;\n\t\tif (!hidingContextView) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hidingContextView = undefined;\n\t\thidingContextView.disposable.dispose();\n\t\tthis.view.classList.remove(hidingContextView.className);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_CLOSE_ANIMATION_DURATION_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE);\n\t\tthis.view.style.removeProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE);\n\t\tDOM.hide(this.view);\n\t\tthis.view.inert = false;\n\t\tif (isPopoverDOMPosition(this.domPosition)) {\n\t\t\tthis.hidePopover();\n\t\t}\n\t\thidingContextView.toDispose.dispose();\n\t}\n\n\tprivate prepareMenuCloseAnimation(): void {\n\t\tif (!this.view.classList.contains(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst surface = Array.from(this.view.children).find(element => DOM.isHTMLElement(element) && element.classList.contains('monaco-scrollable-element'));\n\t\tif (!DOM.isHTMLElement(surface)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst computedStyle = DOM.getWindow(surface).getComputedStyle(surface);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_OPACITY_VARIABLE, computedStyle.opacity);\n\t\tthis.view.style.setProperty(CONTEXT_VIEW_MENU_MOTION_CLOSE_START_TRANSFORM_VARIABLE, computedStyle.transform);\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide(undefined, true);\n\t\tthis.completeHideAnimation();\n\n\t\tsuper.dispose();\n\t}\n}\n\n// Mirrors the popover reset in contextview.css, whose rules do not reach an\n// owner inside a shadow root\nconst POPOVER_RESET_CSS = /* css */ `\n\t.context-view[popover],\n\t.shadow-root-host[popover] {\n\t\tposition: fixed;\n\t\tinset: auto;\n\t\twidth: auto;\n\t\theight: auto;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\toverflow: visible;\n\t\tcolor: inherit;\n\t\tbackground: transparent;\n\t}\n`;\n\nconst shadowRootsWithPopoverReset = new WeakSet<ShadowRoot>();\n\nfunction adoptPopoverResetStyles(owner: HTMLElement): void {\n\tconst shadowRoot = DOM.getShadowRoot(owner);\n\tif (shadowRoot && !shadowRootsWithPopoverReset.has(shadowRoot)) {\n\t\tshadowRootsWithPopoverReset.add(shadowRoot);\n\t\tconst style = owner.ownerDocument.createElement('style');\n\t\tstyle.textContent = POPOVER_RESET_CSS;\n\t\tshadowRoot.appendChild(style);\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n\t${getContextViewMenuMotionCss(':host-context(.modern-ui.monaco-enable-motion)')}\n`;\n"]}
@@ -0,0 +1,72 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Moves a view so that it does not cover the native window controls, which
7
+ * occupy the parts of the titlebar band to the left and right of the
8
+ * titlebar area rect of a visible window controls overlay.
9
+ *
10
+ * @param titlebarAreaRect The titlebar area rect, in client coordinates, or
11
+ * `undefined` when the overlay is not visible.
12
+ * @param viewport The viewport, where `top` and `left` are the coordinates of
13
+ * the client origin in the coordinate space of `position`.
14
+ * @param view The size of the view.
15
+ * @param position The position of the view.
16
+ * @returns The adjusted position, or `position` itself when no change is needed.
17
+ */
18
+ export function avoidWindowControlsOverlay(titlebarAreaRect, viewport, view, position) {
19
+ if (!titlebarAreaRect) {
20
+ return position;
21
+ }
22
+ const values = [
23
+ titlebarAreaRect.x, titlebarAreaRect.y, titlebarAreaRect.width, titlebarAreaRect.height,
24
+ viewport.top, viewport.left, viewport.width, viewport.height,
25
+ view.width, view.height,
26
+ position.top, position.left
27
+ ];
28
+ if (values.some(value => !Number.isFinite(value)) || titlebarAreaRect.height <= 0) {
29
+ return position;
30
+ }
31
+ const bandHeight = Math.min(titlebarAreaRect.height, viewport.height);
32
+ if (bandHeight <= 0) {
33
+ return position;
34
+ }
35
+ const areaStart = clamp(titlebarAreaRect.x, 0, viewport.width);
36
+ const areaEnd = clamp(titlebarAreaRect.x + titlebarAreaRect.width, areaStart, viewport.width);
37
+ const allStrips = [
38
+ { side: 'left', start: viewport.left, end: viewport.left + areaStart },
39
+ { side: 'right', start: viewport.left + areaEnd, end: viewport.left + viewport.width }
40
+ ];
41
+ const strips = allStrips.filter(strip => strip.end - strip.start > 0);
42
+ const bandTop = viewport.top;
43
+ const bandBottom = viewport.top + bandHeight;
44
+ const overlapsStrip = (top, left, strip) => overlaps(top, top + view.height, bandTop, bandBottom) && overlaps(left, left + view.width, strip.start, strip.end);
45
+ const overlapping = strips.filter(strip => overlapsStrip(position.top, position.left, strip));
46
+ if (overlapping.length === 0) {
47
+ return position;
48
+ }
49
+ // 1. Push the view below the titlebar band if it fits in the viewport
50
+ if (bandBottom + view.height <= viewport.top + viewport.height) {
51
+ return { top: bandBottom, left: position.left };
52
+ }
53
+ // 2. Shift the view horizontally inwards, clear of the strip it covers
54
+ if (overlapping.length === 1) {
55
+ const strip = overlapping[0];
56
+ const left = strip.side === 'left' ? strip.end : strip.start - view.width;
57
+ const fitsViewport = left >= viewport.left && left + view.width <= viewport.left + viewport.width;
58
+ if (fitsViewport && !strips.some(other => overlapsStrip(position.top, left, other))) {
59
+ return { top: position.top, left };
60
+ }
61
+ }
62
+ // 3. Move the view as far down as the viewport allows. A view too tall to
63
+ // clear the titlebar band still covers the controls, but is not clipped.
64
+ return { top: Math.max(viewport.top, viewport.top + viewport.height - view.height), left: position.left };
65
+ }
66
+ function clamp(value, min, max) {
67
+ return Math.min(Math.max(value, min), max);
68
+ }
69
+ function overlaps(start, end, otherStart, otherEnd) {
70
+ return start < otherEnd && otherStart < end;
71
+ }
72
+ //# sourceMappingURL=windowControlsOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/windowControlsOverlay.ts","vs/base/browser/ui/contextview/windowControlsOverlay.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAgChG;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,0BAA0B,CACzC,gBAAgE,EAChE,QAAwC,EACxC,IAAgC,EAChC,QAAwC;IAExC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvB,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,MAAM,MAAM,GAAG;QACd,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,MAAM;QACvF,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM;QAC5D,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM;QACvB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI;KAC3B,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,gBAAgB,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACnF,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,MAAM,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AQ,CAAC,GAAG,GAAG,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3G,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACrD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa,EAAE,GAAW,EAAE,UAAkB,EAAE,QAAgB;IACjF,OAAO,KAAK,GAAG,QAAQ,IAAI,UAAU,GAAG,GAAG,CAAC;AAC7C,CAAC","file":"windowControlsOverlay.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport interface IWindowControlsOverlayTitlebarRect {\n\treadonly x: number;\n\treadonly y: number;\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport interface IWindowControlsOverlayViewport {\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport interface IWindowControlsOverlaySize {\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport interface IWindowControlsOverlayPosition {\n\treadonly top: number;\n\treadonly left: number;\n}\n\ninterface IStrip {\n\treadonly side: 'left' | 'right';\n\treadonly start: number;\n\treadonly end: number;\n}\n\n/**\n * Moves a view so that it does not cover the native window controls, which\n * occupy the parts of the titlebar band to the left and right of the\n * titlebar area rect of a visible window controls overlay.\n *\n * @param titlebarAreaRect The titlebar area rect, in client coordinates, or\n * `undefined` when the overlay is not visible.\n * @param viewport The viewport, where `top` and `left` are the coordinates of\n * the client origin in the coordinate space of `position`.\n * @param view The size of the view.\n * @param position The position of the view.\n * @returns The adjusted position, or `position` itself when no change is needed.\n */\nexport function avoidWindowControlsOverlay(\n\ttitlebarAreaRect: IWindowControlsOverlayTitlebarRect | undefined,\n\tviewport: IWindowControlsOverlayViewport,\n\tview: IWindowControlsOverlaySize,\n\tposition: IWindowControlsOverlayPosition\n): IWindowControlsOverlayPosition {\n\tif (!titlebarAreaRect) {\n\t\treturn position;\n\t}\n\n\tconst values = [\n\t\ttitlebarAreaRect.x, titlebarAreaRect.y, titlebarAreaRect.width, titlebarAreaRect.height,\n\t\tviewport.top, viewport.left, viewport.width, viewport.height,\n\t\tview.width, view.height,\n\t\tposition.top, position.left\n\t];\n\tif (values.some(value => !Number.isFinite(value)) || titlebarAreaRect.height <= 0) {\n\t\treturn position;\n\t}\n\n\tconst bandHeight = Math.min(titlebarAreaRect.height, viewport.height);\n\tif (bandHeight <= 0) {\n\t\treturn position;\n\t}\n\n\tconst areaStart = clamp(titlebarAreaRect.x, 0, viewport.width);\n\tconst areaEnd = clamp(titlebarAreaRect.x + titlebarAreaRect.width, areaStart, viewport.width);\n\n\tconst allStrips: IStrip[] = [\n\t\t{ side: 'left', start: viewport.left, end: viewport.left + areaStart },\n\t\t{ side: 'right', start: viewport.left + areaEnd, end: viewport.left + viewport.width }\n\t];\n\tconst strips = allStrips.filter(strip => strip.end - strip.start > 0);\n\n\tconst bandTop = viewport.top;\n\tconst bandBottom = viewport.top + bandHeight;\n\n\tconst overlapsStrip = (top: number, left: number, strip: IStrip) =>\n\t\toverlaps(top, top + view.height, bandTop, bandBottom) && overlaps(left, left + view.width, strip.start, strip.end);\n\n\tconst overlapping = strips.filter(strip => overlapsStrip(position.top, position.left, strip));\n\tif (overlapping.length === 0) {\n\t\treturn position;\n\t}\n\n\t// 1. Push the view below the titlebar band if it fits in the viewport\n\tif (bandBottom + view.height <= viewport.top + viewport.height) {\n\t\treturn { top: bandBottom, left: position.left };\n\t}\n\n\t// 2. Shift the view horizontally inwards, clear of the strip it covers\n\tif (overlapping.length === 1) {\n\t\tconst strip = overlapping[0];\n\t\tconst left = strip.side === 'left' ? strip.end : strip.start - view.width;\n\t\tconst fitsViewport = left >= viewport.left && left + view.width <= viewport.left + viewport.width;\n\t\tif (fitsViewport && !strips.some(other => overlapsStrip(position.top, left, other))) {\n\t\t\treturn { top: position.top, left };\n\t\t}\n\t}\n\n\t// 3. Move the view as far down as the viewport allows. A view too tall to\n\t// clear the titlebar band still covers the controls, but is not clipped.\n\treturn { top: Math.max(viewport.top, viewport.top + viewport.height - view.height), left: position.left };\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n\treturn Math.min(Math.max(value, min), max);\n}\n\nfunction overlaps(start: number, end: number, otherStart: number, otherEnd: number): boolean {\n\treturn start < otherEnd && otherStart < end;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport interface IWindowControlsOverlayTitlebarRect {\n\treadonly x: number;\n\treadonly y: number;\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport interface IWindowControlsOverlayViewport {\n\treadonly top: number;\n\treadonly left: number;\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport interface IWindowControlsOverlaySize {\n\treadonly width: number;\n\treadonly height: number;\n}\n\nexport interface IWindowControlsOverlayPosition {\n\treadonly top: number;\n\treadonly left: number;\n}\n\ninterface IStrip {\n\treadonly side: 'left' | 'right';\n\treadonly start: number;\n\treadonly end: number;\n}\n\n/**\n * Moves a view so that it does not cover the native window controls, which\n * occupy the parts of the titlebar band to the left and right of the\n * titlebar area rect of a visible window controls overlay.\n *\n * @param titlebarAreaRect The titlebar area rect, in client coordinates, or\n * `undefined` when the overlay is not visible.\n * @param viewport The viewport, where `top` and `left` are the coordinates of\n * the client origin in the coordinate space of `position`.\n * @param view The size of the view.\n * @param position The position of the view.\n * @returns The adjusted position, or `position` itself when no change is needed.\n */\nexport function avoidWindowControlsOverlay(\n\ttitlebarAreaRect: IWindowControlsOverlayTitlebarRect | undefined,\n\tviewport: IWindowControlsOverlayViewport,\n\tview: IWindowControlsOverlaySize,\n\tposition: IWindowControlsOverlayPosition\n): IWindowControlsOverlayPosition {\n\tif (!titlebarAreaRect) {\n\t\treturn position;\n\t}\n\n\tconst values = [\n\t\ttitlebarAreaRect.x, titlebarAreaRect.y, titlebarAreaRect.width, titlebarAreaRect.height,\n\t\tviewport.top, viewport.left, viewport.width, viewport.height,\n\t\tview.width, view.height,\n\t\tposition.top, position.left\n\t];\n\tif (values.some(value => !Number.isFinite(value)) || titlebarAreaRect.height <= 0) {\n\t\treturn position;\n\t}\n\n\tconst bandHeight = Math.min(titlebarAreaRect.height, viewport.height);\n\tif (bandHeight <= 0) {\n\t\treturn position;\n\t}\n\n\tconst areaStart = clamp(titlebarAreaRect.x, 0, viewport.width);\n\tconst areaEnd = clamp(titlebarAreaRect.x + titlebarAreaRect.width, areaStart, viewport.width);\n\n\tconst allStrips: IStrip[] = [\n\t\t{ side: 'left', start: viewport.left, end: viewport.left + areaStart },\n\t\t{ side: 'right', start: viewport.left + areaEnd, end: viewport.left + viewport.width }\n\t];\n\tconst strips = allStrips.filter(strip => strip.end - strip.start > 0);\n\n\tconst bandTop = viewport.top;\n\tconst bandBottom = viewport.top + bandHeight;\n\n\tconst overlapsStrip = (top: number, left: number, strip: IStrip) =>\n\t\toverlaps(top, top + view.height, bandTop, bandBottom) && overlaps(left, left + view.width, strip.start, strip.end);\n\n\tconst overlapping = strips.filter(strip => overlapsStrip(position.top, position.left, strip));\n\tif (overlapping.length === 0) {\n\t\treturn position;\n\t}\n\n\t// 1. Push the view below the titlebar band if it fits in the viewport\n\tif (bandBottom + view.height <= viewport.top + viewport.height) {\n\t\treturn { top: bandBottom, left: position.left };\n\t}\n\n\t// 2. Shift the view horizontally inwards, clear of the strip it covers\n\tif (overlapping.length === 1) {\n\t\tconst strip = overlapping[0];\n\t\tconst left = strip.side === 'left' ? strip.end : strip.start - view.width;\n\t\tconst fitsViewport = left >= viewport.left && left + view.width <= viewport.left + viewport.width;\n\t\tif (fitsViewport && !strips.some(other => overlapsStrip(position.top, left, other))) {\n\t\t\treturn { top: position.top, left };\n\t\t}\n\t}\n\n\t// 3. Move the view as far down as the viewport allows. A view too tall to\n\t// clear the titlebar band still covers the controls, but is not clipped.\n\treturn { top: Math.max(viewport.top, viewport.top + viewport.height - view.height), left: position.left };\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n\treturn Math.min(Math.max(value, min), max);\n}\n\nfunction overlaps(start: number, end: number, otherStart: number, otherEnd: number): boolean {\n\treturn start < otherEnd && otherStart < end;\n}\n"]}
@@ -84,6 +84,11 @@
84
84
  align-self: baseline;
85
85
  }
86
86
 
87
+ .monaco-dialog-box .dialog-message-row > .dialog-icon.custom-icon {
88
+ display: flex;
89
+ flex: 0 0 auto;
90
+ }
91
+
87
92
  .monaco-dialog-box:not(.align-vertical) .dialog-message-row .dialog-message-container {
88
93
  align-self: stretch; /* fill row height so overflow-y scrolling works */
89
94
  }
@@ -136,7 +136,8 @@ export class DropdownMenu extends BaseDropdown {
136
136
  onHide: () => this.onHide(),
137
137
  actionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined,
138
138
  anchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : 0 /* AnchorAlignment.LEFT */,
139
- domForShadowRoot: this._options.menuAsChild ? this.element : undefined,
139
+ domForShadowRoot: this._options.menuAsChild || this._options.menuAsPopover ? this.element : undefined,
140
+ hostAsPopover: this._options.menuAsPopover,
140
141
  skipTelemetry: this._options.skipTelemetry
141
142
  });
142
143
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/dropdown/dropdown.ts","vs/base/browser/ui/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EA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AC,QAAQ,CAAC,aAAa;SAC1C,CAAC,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACvB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACnF,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE,CAAC;YAC1D,UAAU,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEQ,IAAI;QACZ,KAAK,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAEO,MAAM;QACb,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACD","file":"dropdown.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IContextMenuProvider } from '../../contextmenu.js';\nimport { $, addDisposableListener, append, EventHelper, EventType, isMouseEvent } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { EventType as GestureEventType, Gesture } from '../../touch.js';\nimport { AnchorAlignment, contextViewMenuCloseAnimation, CONTEXT_VIEW_MENU_MOTION_CLASS, IContextViewCloseAnimation } from '../contextview/contextview.js';\nimport { IMenuOptions } from '../menu/menu.js';\nimport { ActionRunner, IAction } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\nimport './dropdown.css';\n\nexport interface ILabelRenderer {\n\t(container: HTMLElement): IDisposable | null;\n}\n\nexport interface IBaseDropdownOptions {\n\tlabel?: string;\n\tlabelRenderer?: ILabelRenderer;\n\tisEnabled?: () => boolean;\n}\n\nexport class BaseDropdown extends ActionRunner {\n\tprivate _element: HTMLElement;\n\tprivate boxContainer?: HTMLElement;\n\tprivate _label?: HTMLElement;\n\tprivate contents?: HTMLElement;\n\n\tprivate visible: boolean | undefined;\n\tprivate _onDidChangeVisibility = this._register(new Emitter<boolean>());\n\treadonly onDidChangeVisibility = this._onDidChangeVisibility.event;\n\n\tconstructor(container: HTMLElement, private readonly baseOptions: IBaseDropdownOptions) {\n\t\tsuper();\n\n\t\tthis._element = append(container, $('.monaco-dropdown'));\n\n\t\tthis._label = append(this._element, $('.dropdown-label'));\n\n\t\tlet labelRenderer = baseOptions.labelRenderer;\n\t\tif (!labelRenderer) {\n\t\t\tlabelRenderer = (container: HTMLElement): IDisposable | null => {\n\t\t\t\tcontainer.textContent = baseOptions.label || '';\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\tfor (const event of [EventType.CLICK, EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this.element, event, e => EventHelper.stop(e, true))); // prevent default click behaviour to trigger\n\t\t}\n\n\t\tfor (const event of [EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this._label, event, e => {\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isMouseEvent(e) && e.button !== 0) {\n\t\t\t\t\t// prevent right click trigger to allow separate context menu (https://github.com/microsoft/vscode/issues/151064)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(this._label, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {\n\t\t\t\tEventHelper.stop(e, true); // https://github.com/microsoft/vscode/issues/57997\n\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst cleanupFn = labelRenderer(this._label);\n\t\tif (cleanupFn) {\n\t\t\tthis._register(cleanupFn);\n\t\t}\n\n\t\tthis._register(Gesture.addTarget(this._label));\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tshow(): void {\n\t\tif (!this.visible && this.baseOptions.isEnabled?.() !== false) {\n\t\t\tthis.visible = true;\n\t\t\tthis._onDidChangeVisibility.fire(true);\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis._onDidChangeVisibility.fire(false);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.hide();\n\n\t\tif (this.boxContainer) {\n\t\t\tthis.boxContainer.remove();\n\t\t\tthis.boxContainer = undefined;\n\t\t}\n\n\t\tif (this.contents) {\n\t\t\tthis.contents.remove();\n\t\t\tthis.contents = undefined;\n\t\t}\n\n\t\tif (this._label) {\n\t\t\tthis._label.remove();\n\t\t\tthis._label = undefined;\n\t\t}\n\t}\n}\n\nexport interface IActionProvider {\n\tgetActions(): readonly IAction[];\n}\n\nexport interface IDropdownMenuOptions extends IBaseDropdownOptions {\n\tcontextMenuProvider: IContextMenuProvider;\n\treadonly actions?: IAction[];\n\treadonly actionProvider?: IActionProvider;\n\tmenuClassName?: string;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\tgetAnchor?: () => HTMLElement;\n\tmenuAsChild?: boolean; // scope down for #99448\n\treadonly skipTelemetry?: boolean;\n}\n\nexport class DropdownMenu extends BaseDropdown {\n\tprivate _menuOptions: IMenuOptions | undefined;\n\tprivate _actions: readonly IAction[] = [];\n\n\tconstructor(container: HTMLElement, private readonly _options: IDropdownMenuOptions) {\n\t\tsuper(container, _options);\n\n\t\tthis.actions = _options.actions || [];\n\t}\n\n\tset menuOptions(options: IMenuOptions | undefined) {\n\t\tthis._menuOptions = options;\n\t}\n\n\tget menuOptions(): IMenuOptions | undefined {\n\t\treturn this._menuOptions;\n\t}\n\n\tprivate get actions(): readonly IAction[] {\n\t\tif (this._options.actionProvider) {\n\t\t\treturn this._options.actionProvider.getActions();\n\t\t}\n\n\t\treturn this._actions;\n\t}\n\n\tprivate set actions(actions: readonly IAction[]) {\n\t\tthis._actions = actions;\n\t}\n\n\toverride show(): void {\n\t\tif (this._options.isEnabled?.() === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.show();\n\n\t\tthis.element.classList.add('active');\n\n\t\tthis._options.contextMenuProvider.showContextMenu({\n\t\t\tgetAnchor: () => this._options.getAnchor?.() ?? this.element,\n\t\t\tgetActions: () => this.actions,\n\t\t\tgetActionsContext: () => this.menuOptions ? this.menuOptions.context : null,\n\t\t\tgetActionViewItem: (action, options) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action, options) : undefined,\n\t\t\tgetKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined,\n\t\t\tgetMenuClassName: () => this.getMenuClassName(),\n\t\t\tcloseAnimation: this._options.closeAnimation ?? contextViewMenuCloseAnimation,\n\t\t\tonHide: () => this.onHide(),\n\t\t\tactionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined,\n\t\t\tanchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : AnchorAlignment.LEFT,\n\t\t\tdomForShadowRoot: this._options.menuAsChild ? this.element : undefined,\n\t\t\tskipTelemetry: this._options.skipTelemetry\n\t\t});\n\t}\n\n\tprivate getMenuClassName(): string {\n\t\tconst classNames = this._options.menuClassName?.split(/\\s+/).filter(Boolean) ?? [];\n\t\tif (!classNames.includes(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\tclassNames.push(CONTEXT_VIEW_MENU_MOTION_CLASS);\n\t\t}\n\t\treturn classNames.join(' ');\n\t}\n\n\toverride hide(): void {\n\t\tsuper.hide();\n\t}\n\n\tprivate onHide(): void {\n\t\tthis.hide();\n\t\tthis.element.classList.remove('active');\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IContextMenuProvider } from '../../contextmenu.js';\nimport { $, addDisposableListener, append, EventHelper, EventType, isMouseEvent } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { EventType as GestureEventType, Gesture } from '../../touch.js';\nimport { AnchorAlignment, contextViewMenuCloseAnimation, CONTEXT_VIEW_MENU_MOTION_CLASS, IContextViewCloseAnimation } from '../contextview/contextview.js';\nimport { IMenuOptions } from '../menu/menu.js';\nimport { ActionRunner, IAction } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\nimport './dropdown.css';\n\nexport interface ILabelRenderer {\n\t(container: HTMLElement): IDisposable | null;\n}\n\nexport interface IBaseDropdownOptions {\n\tlabel?: string;\n\tlabelRenderer?: ILabelRenderer;\n\tisEnabled?: () => boolean;\n}\n\nexport class BaseDropdown extends ActionRunner {\n\tprivate _element: HTMLElement;\n\tprivate boxContainer?: HTMLElement;\n\tprivate _label?: HTMLElement;\n\tprivate contents?: HTMLElement;\n\n\tprivate visible: boolean | undefined;\n\tprivate _onDidChangeVisibility = this._register(new Emitter<boolean>());\n\treadonly onDidChangeVisibility = this._onDidChangeVisibility.event;\n\n\tconstructor(container: HTMLElement, private readonly baseOptions: IBaseDropdownOptions) {\n\t\tsuper();\n\n\t\tthis._element = append(container, $('.monaco-dropdown'));\n\n\t\tthis._label = append(this._element, $('.dropdown-label'));\n\n\t\tlet labelRenderer = baseOptions.labelRenderer;\n\t\tif (!labelRenderer) {\n\t\t\tlabelRenderer = (container: HTMLElement): IDisposable | null => {\n\t\t\t\tcontainer.textContent = baseOptions.label || '';\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\tfor (const event of [EventType.CLICK, EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this.element, event, e => EventHelper.stop(e, true))); // prevent default click behaviour to trigger\n\t\t}\n\n\t\tfor (const event of [EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this._label, event, e => {\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isMouseEvent(e) && e.button !== 0) {\n\t\t\t\t\t// prevent right click trigger to allow separate context menu (https://github.com/microsoft/vscode/issues/151064)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(this._label, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {\n\t\t\t\tEventHelper.stop(e, true); // https://github.com/microsoft/vscode/issues/57997\n\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst cleanupFn = labelRenderer(this._label);\n\t\tif (cleanupFn) {\n\t\t\tthis._register(cleanupFn);\n\t\t}\n\n\t\tthis._register(Gesture.addTarget(this._label));\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tshow(): void {\n\t\tif (!this.visible && this.baseOptions.isEnabled?.() !== false) {\n\t\t\tthis.visible = true;\n\t\t\tthis._onDidChangeVisibility.fire(true);\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis._onDidChangeVisibility.fire(false);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.hide();\n\n\t\tif (this.boxContainer) {\n\t\t\tthis.boxContainer.remove();\n\t\t\tthis.boxContainer = undefined;\n\t\t}\n\n\t\tif (this.contents) {\n\t\t\tthis.contents.remove();\n\t\t\tthis.contents = undefined;\n\t\t}\n\n\t\tif (this._label) {\n\t\t\tthis._label.remove();\n\t\t\tthis._label = undefined;\n\t\t}\n\t}\n}\n\nexport interface IActionProvider {\n\tgetActions(): readonly IAction[];\n}\n\nexport interface IDropdownMenuOptions extends IBaseDropdownOptions {\n\tcontextMenuProvider: IContextMenuProvider;\n\treadonly actions?: IAction[];\n\treadonly actionProvider?: IActionProvider;\n\tmenuClassName?: string;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\tgetAnchor?: () => HTMLElement;\n\tmenuAsChild?: boolean; // scope down for #99448\n\treadonly skipTelemetry?: boolean;\n}\n\nexport class DropdownMenu extends BaseDropdown {\n\tprivate _menuOptions: IMenuOptions | undefined;\n\tprivate _actions: readonly IAction[] = [];\n\n\tconstructor(container: HTMLElement, private readonly _options: IDropdownMenuOptions) {\n\t\tsuper(container, _options);\n\n\t\tthis.actions = _options.actions || [];\n\t}\n\n\tset menuOptions(options: IMenuOptions | undefined) {\n\t\tthis._menuOptions = options;\n\t}\n\n\tget menuOptions(): IMenuOptions | undefined {\n\t\treturn this._menuOptions;\n\t}\n\n\tprivate get actions(): readonly IAction[] {\n\t\tif (this._options.actionProvider) {\n\t\t\treturn this._options.actionProvider.getActions();\n\t\t}\n\n\t\treturn this._actions;\n\t}\n\n\tprivate set actions(actions: readonly IAction[]) {\n\t\tthis._actions = actions;\n\t}\n\n\toverride show(): void {\n\t\tif (this._options.isEnabled?.() === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.show();\n\n\t\tthis.element.classList.add('active');\n\n\t\tthis._options.contextMenuProvider.showContextMenu({\n\t\t\tgetAnchor: () => this._options.getAnchor?.() ?? this.element,\n\t\t\tgetActions: () => this.actions,\n\t\t\tgetActionsContext: () => this.menuOptions ? this.menuOptions.context : null,\n\t\t\tgetActionViewItem: (action, options) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action, options) : undefined,\n\t\t\tgetKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined,\n\t\t\tgetMenuClassName: () => this.getMenuClassName(),\n\t\t\tcloseAnimation: this._options.closeAnimation ?? contextViewMenuCloseAnimation,\n\t\t\tonHide: () => this.onHide(),\n\t\t\tactionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined,\n\t\t\tanchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : AnchorAlignment.LEFT,\n\t\t\tdomForShadowRoot: this._options.menuAsChild ? this.element : undefined,\n\t\t\tskipTelemetry: this._options.skipTelemetry\n\t\t});\n\t}\n\n\tprivate getMenuClassName(): string {\n\t\tconst classNames = this._options.menuClassName?.split(/\\s+/).filter(Boolean) ?? [];\n\t\tif (!classNames.includes(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\tclassNames.push(CONTEXT_VIEW_MENU_MOTION_CLASS);\n\t\t}\n\t\treturn classNames.join(' ');\n\t}\n\n\toverride hide(): void {\n\t\tsuper.hide();\n\t}\n\n\tprivate onHide(): void {\n\t\tthis.hide();\n\t\tthis.element.classList.remove('active');\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/dropdown/dropdown.ts","vs/base/browser/ui/dropdown/dropdown.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,CAAC,EAAE,qBAAqB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAmB,6BAA6B,EAAE,8BAA8B,EAA8B,MAAM,+BAA+B,CAAC;AAE3J,OAAO,EAAE,YAAY,EAAW,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,gBAAgB,CAAC;AAYxB,MAAM,OAAO,YAAa,SAAQ,YAAY;IAU7C,YAAY,SAAsB,EAAmB,WAAiC;QACrF,KAAK,EAAE,CAAC;QAD4C,gBAAW,GAAX,WAAW,CAAsB;QAH9E,2BAAsB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,EAAW,CAAC,CAAC;QAC/D,0BAAqB,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;QAKlE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAEzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAE1D,IAAI,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,aAAa,EAAE,CAAC;YACpB,aAAa,GAAG,CAAC,SAAsB,EAAsB,EAAE;gBAC9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AC,CAAC,SAAS;YAC1E,eAAe,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,6BAAqB;YAC3F,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YACrG,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa;YAC1C,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa;SAC1C,CAAC,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACvB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACnF,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE,CAAC;YAC1D,UAAU,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEQ,IAAI;QACZ,KAAK,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAEO,MAAM;QACb,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACD","file":"dropdown.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IContextMenuProvider } from '../../contextmenu.js';\nimport { $, addDisposableListener, append, EventHelper, EventType, isMouseEvent } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { EventType as GestureEventType, Gesture } from '../../touch.js';\nimport { AnchorAlignment, contextViewMenuCloseAnimation, CONTEXT_VIEW_MENU_MOTION_CLASS, IContextViewCloseAnimation } from '../contextview/contextview.js';\nimport { IMenuOptions } from '../menu/menu.js';\nimport { ActionRunner, IAction } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\nimport './dropdown.css';\n\nexport interface ILabelRenderer {\n\t(container: HTMLElement): IDisposable | null;\n}\n\nexport interface IBaseDropdownOptions {\n\tlabel?: string;\n\tlabelRenderer?: ILabelRenderer;\n\tisEnabled?: () => boolean;\n}\n\nexport class BaseDropdown extends ActionRunner {\n\tprivate _element: HTMLElement;\n\tprivate boxContainer?: HTMLElement;\n\tprivate _label?: HTMLElement;\n\tprivate contents?: HTMLElement;\n\n\tprivate visible: boolean | undefined;\n\tprivate _onDidChangeVisibility = this._register(new Emitter<boolean>());\n\treadonly onDidChangeVisibility = this._onDidChangeVisibility.event;\n\n\tconstructor(container: HTMLElement, private readonly baseOptions: IBaseDropdownOptions) {\n\t\tsuper();\n\n\t\tthis._element = append(container, $('.monaco-dropdown'));\n\n\t\tthis._label = append(this._element, $('.dropdown-label'));\n\n\t\tlet labelRenderer = baseOptions.labelRenderer;\n\t\tif (!labelRenderer) {\n\t\t\tlabelRenderer = (container: HTMLElement): IDisposable | null => {\n\t\t\t\tcontainer.textContent = baseOptions.label || '';\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\tfor (const event of [EventType.CLICK, EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this.element, event, e => EventHelper.stop(e, true))); // prevent default click behaviour to trigger\n\t\t}\n\n\t\tfor (const event of [EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this._label, event, e => {\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isMouseEvent(e) && e.button !== 0) {\n\t\t\t\t\t// prevent right click trigger to allow separate context menu (https://github.com/microsoft/vscode/issues/151064)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(this._label, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {\n\t\t\t\tEventHelper.stop(e, true); // https://github.com/microsoft/vscode/issues/57997\n\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst cleanupFn = labelRenderer(this._label);\n\t\tif (cleanupFn) {\n\t\t\tthis._register(cleanupFn);\n\t\t}\n\n\t\tthis._register(Gesture.addTarget(this._label));\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tshow(): void {\n\t\tif (!this.visible && this.baseOptions.isEnabled?.() !== false) {\n\t\t\tthis.visible = true;\n\t\t\tthis._onDidChangeVisibility.fire(true);\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis._onDidChangeVisibility.fire(false);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.hide();\n\n\t\tif (this.boxContainer) {\n\t\t\tthis.boxContainer.remove();\n\t\t\tthis.boxContainer = undefined;\n\t\t}\n\n\t\tif (this.contents) {\n\t\t\tthis.contents.remove();\n\t\t\tthis.contents = undefined;\n\t\t}\n\n\t\tif (this._label) {\n\t\t\tthis._label.remove();\n\t\t\tthis._label = undefined;\n\t\t}\n\t}\n}\n\nexport interface IActionProvider {\n\tgetActions(): readonly IAction[];\n}\n\nexport interface IDropdownMenuOptions extends IBaseDropdownOptions {\n\tcontextMenuProvider: IContextMenuProvider;\n\treadonly actions?: IAction[];\n\treadonly actionProvider?: IActionProvider;\n\tmenuClassName?: string;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\tgetAnchor?: () => HTMLElement;\n\tmenuAsChild?: boolean; // scope down for #99448\n\tmenuAsPopover?: boolean; // host the menu as a popover inside the dropdown element\n\treadonly skipTelemetry?: boolean;\n}\n\nexport class DropdownMenu extends BaseDropdown {\n\tprivate _menuOptions: IMenuOptions | undefined;\n\tprivate _actions: readonly IAction[] = [];\n\n\tconstructor(container: HTMLElement, private readonly _options: IDropdownMenuOptions) {\n\t\tsuper(container, _options);\n\n\t\tthis.actions = _options.actions || [];\n\t}\n\n\tset menuOptions(options: IMenuOptions | undefined) {\n\t\tthis._menuOptions = options;\n\t}\n\n\tget menuOptions(): IMenuOptions | undefined {\n\t\treturn this._menuOptions;\n\t}\n\n\tprivate get actions(): readonly IAction[] {\n\t\tif (this._options.actionProvider) {\n\t\t\treturn this._options.actionProvider.getActions();\n\t\t}\n\n\t\treturn this._actions;\n\t}\n\n\tprivate set actions(actions: readonly IAction[]) {\n\t\tthis._actions = actions;\n\t}\n\n\toverride show(): void {\n\t\tif (this._options.isEnabled?.() === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.show();\n\n\t\tthis.element.classList.add('active');\n\n\t\tthis._options.contextMenuProvider.showContextMenu({\n\t\t\tgetAnchor: () => this._options.getAnchor?.() ?? this.element,\n\t\t\tgetActions: () => this.actions,\n\t\t\tgetActionsContext: () => this.menuOptions ? this.menuOptions.context : null,\n\t\t\tgetActionViewItem: (action, options) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action, options) : undefined,\n\t\t\tgetKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined,\n\t\t\tgetMenuClassName: () => this.getMenuClassName(),\n\t\t\tcloseAnimation: this._options.closeAnimation ?? contextViewMenuCloseAnimation,\n\t\t\tonHide: () => this.onHide(),\n\t\t\tactionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined,\n\t\t\tanchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : AnchorAlignment.LEFT,\n\t\t\tdomForShadowRoot: this._options.menuAsChild || this._options.menuAsPopover ? this.element : undefined,\n\t\t\thostAsPopover: this._options.menuAsPopover,\n\t\t\tskipTelemetry: this._options.skipTelemetry\n\t\t});\n\t}\n\n\tprivate getMenuClassName(): string {\n\t\tconst classNames = this._options.menuClassName?.split(/\\s+/).filter(Boolean) ?? [];\n\t\tif (!classNames.includes(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\tclassNames.push(CONTEXT_VIEW_MENU_MOTION_CLASS);\n\t\t}\n\t\treturn classNames.join(' ');\n\t}\n\n\toverride hide(): void {\n\t\tsuper.hide();\n\t}\n\n\tprivate onHide(): void {\n\t\tthis.hide();\n\t\tthis.element.classList.remove('active');\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IContextMenuProvider } from '../../contextmenu.js';\nimport { $, addDisposableListener, append, EventHelper, EventType, isMouseEvent } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { EventType as GestureEventType, Gesture } from '../../touch.js';\nimport { AnchorAlignment, contextViewMenuCloseAnimation, CONTEXT_VIEW_MENU_MOTION_CLASS, IContextViewCloseAnimation } from '../contextview/contextview.js';\nimport { IMenuOptions } from '../menu/menu.js';\nimport { ActionRunner, IAction } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { IDisposable } from '../../../common/lifecycle.js';\nimport './dropdown.css';\n\nexport interface ILabelRenderer {\n\t(container: HTMLElement): IDisposable | null;\n}\n\nexport interface IBaseDropdownOptions {\n\tlabel?: string;\n\tlabelRenderer?: ILabelRenderer;\n\tisEnabled?: () => boolean;\n}\n\nexport class BaseDropdown extends ActionRunner {\n\tprivate _element: HTMLElement;\n\tprivate boxContainer?: HTMLElement;\n\tprivate _label?: HTMLElement;\n\tprivate contents?: HTMLElement;\n\n\tprivate visible: boolean | undefined;\n\tprivate _onDidChangeVisibility = this._register(new Emitter<boolean>());\n\treadonly onDidChangeVisibility = this._onDidChangeVisibility.event;\n\n\tconstructor(container: HTMLElement, private readonly baseOptions: IBaseDropdownOptions) {\n\t\tsuper();\n\n\t\tthis._element = append(container, $('.monaco-dropdown'));\n\n\t\tthis._label = append(this._element, $('.dropdown-label'));\n\n\t\tlet labelRenderer = baseOptions.labelRenderer;\n\t\tif (!labelRenderer) {\n\t\t\tlabelRenderer = (container: HTMLElement): IDisposable | null => {\n\t\t\t\tcontainer.textContent = baseOptions.label || '';\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t\tfor (const event of [EventType.CLICK, EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this.element, event, e => EventHelper.stop(e, true))); // prevent default click behaviour to trigger\n\t\t}\n\n\t\tfor (const event of [EventType.MOUSE_DOWN, GestureEventType.Tap]) {\n\t\t\tthis._register(addDisposableListener(this._label, event, e => {\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (isMouseEvent(e) && e.button !== 0) {\n\t\t\t\t\t// prevent right click trigger to allow separate context menu (https://github.com/microsoft/vscode/issues/151064)\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(this._label, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tif (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {\n\t\t\t\tEventHelper.stop(e, true); // https://github.com/microsoft/vscode/issues/57997\n\n\t\t\t\tif (baseOptions.isEnabled?.() === false) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (this.visible) {\n\t\t\t\t\tthis.hide();\n\t\t\t\t} else {\n\t\t\t\t\tthis.show();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\tconst cleanupFn = labelRenderer(this._label);\n\t\tif (cleanupFn) {\n\t\t\tthis._register(cleanupFn);\n\t\t}\n\n\t\tthis._register(Gesture.addTarget(this._label));\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tshow(): void {\n\t\tif (!this.visible && this.baseOptions.isEnabled?.() !== false) {\n\t\t\tthis.visible = true;\n\t\t\tthis._onDidChangeVisibility.fire(true);\n\t\t}\n\t}\n\n\thide(): void {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\t\t\tthis._onDidChangeVisibility.fire(false);\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\t\tthis.hide();\n\n\t\tif (this.boxContainer) {\n\t\t\tthis.boxContainer.remove();\n\t\t\tthis.boxContainer = undefined;\n\t\t}\n\n\t\tif (this.contents) {\n\t\t\tthis.contents.remove();\n\t\t\tthis.contents = undefined;\n\t\t}\n\n\t\tif (this._label) {\n\t\t\tthis._label.remove();\n\t\t\tthis._label = undefined;\n\t\t}\n\t}\n}\n\nexport interface IActionProvider {\n\tgetActions(): readonly IAction[];\n}\n\nexport interface IDropdownMenuOptions extends IBaseDropdownOptions {\n\tcontextMenuProvider: IContextMenuProvider;\n\treadonly actions?: IAction[];\n\treadonly actionProvider?: IActionProvider;\n\tmenuClassName?: string;\n\tcloseAnimation?: IContextViewCloseAnimation;\n\tgetAnchor?: () => HTMLElement;\n\tmenuAsChild?: boolean; // scope down for #99448\n\tmenuAsPopover?: boolean; // host the menu as a popover inside the dropdown element\n\treadonly skipTelemetry?: boolean;\n}\n\nexport class DropdownMenu extends BaseDropdown {\n\tprivate _menuOptions: IMenuOptions | undefined;\n\tprivate _actions: readonly IAction[] = [];\n\n\tconstructor(container: HTMLElement, private readonly _options: IDropdownMenuOptions) {\n\t\tsuper(container, _options);\n\n\t\tthis.actions = _options.actions || [];\n\t}\n\n\tset menuOptions(options: IMenuOptions | undefined) {\n\t\tthis._menuOptions = options;\n\t}\n\n\tget menuOptions(): IMenuOptions | undefined {\n\t\treturn this._menuOptions;\n\t}\n\n\tprivate get actions(): readonly IAction[] {\n\t\tif (this._options.actionProvider) {\n\t\t\treturn this._options.actionProvider.getActions();\n\t\t}\n\n\t\treturn this._actions;\n\t}\n\n\tprivate set actions(actions: readonly IAction[]) {\n\t\tthis._actions = actions;\n\t}\n\n\toverride show(): void {\n\t\tif (this._options.isEnabled?.() === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.show();\n\n\t\tthis.element.classList.add('active');\n\n\t\tthis._options.contextMenuProvider.showContextMenu({\n\t\t\tgetAnchor: () => this._options.getAnchor?.() ?? this.element,\n\t\t\tgetActions: () => this.actions,\n\t\t\tgetActionsContext: () => this.menuOptions ? this.menuOptions.context : null,\n\t\t\tgetActionViewItem: (action, options) => this.menuOptions && this.menuOptions.actionViewItemProvider ? this.menuOptions.actionViewItemProvider(action, options) : undefined,\n\t\t\tgetKeyBinding: action => this.menuOptions && this.menuOptions.getKeyBinding ? this.menuOptions.getKeyBinding(action) : undefined,\n\t\t\tgetMenuClassName: () => this.getMenuClassName(),\n\t\t\tcloseAnimation: this._options.closeAnimation ?? contextViewMenuCloseAnimation,\n\t\t\tonHide: () => this.onHide(),\n\t\t\tactionRunner: this.menuOptions ? this.menuOptions.actionRunner : undefined,\n\t\t\tanchorAlignment: this.menuOptions ? this.menuOptions.anchorAlignment : AnchorAlignment.LEFT,\n\t\t\tdomForShadowRoot: this._options.menuAsChild || this._options.menuAsPopover ? this.element : undefined,\n\t\t\thostAsPopover: this._options.menuAsPopover,\n\t\t\tskipTelemetry: this._options.skipTelemetry\n\t\t});\n\t}\n\n\tprivate getMenuClassName(): string {\n\t\tconst classNames = this._options.menuClassName?.split(/\\s+/).filter(Boolean) ?? [];\n\t\tif (!classNames.includes(CONTEXT_VIEW_MENU_MOTION_CLASS)) {\n\t\t\tclassNames.push(CONTEXT_VIEW_MENU_MOTION_CLASS);\n\t\t}\n\t\treturn classNames.join(' ');\n\t}\n\n\toverride hide(): void {\n\t\tsuper.hide();\n\t}\n\n\tprivate onHide(): void {\n\t\tthis.hide();\n\t\tthis.element.classList.remove('active');\n\t}\n}\n"]}
@@ -31,6 +31,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
31
31
  labelRenderer: labelRenderer,
32
32
  isEnabled: () => this.action.enabled,
33
33
  menuAsChild: this.options.menuAsChild,
34
+ menuAsPopover: this.options.menuAsPopover,
34
35
  actions: isActionsArray ? this.menuActionsOrProvider : undefined,
35
36
  actionProvider: isActionsArray ? undefined : this.menuActionsOrProvider,
36
37
  menuClassName: this.options.menuClassName,