monaco-editor-core 0.55.0-dev-20251026 → 0.55.0-dev-20251028

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 (70) 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 +2 -0
  18. package/esm/vs/base/browser/ui/actionbar/actionbar.js +17 -0
  19. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  20. package/esm/vs/base/browser/ui/iconLabel/iconLabel.js +2 -1
  21. package/esm/vs/base/browser/ui/iconLabel/iconLabel.js.map +1 -1
  22. package/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css +4 -0
  23. package/esm/vs/base/browser/ui/toolbar/toolbar.css +11 -0
  24. package/esm/vs/base/browser/ui/toolbar/toolbar.js +115 -2
  25. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  26. package/esm/vs/base/common/jsonSchema.js.map +1 -1
  27. package/esm/vs/editor/common/cursor/cursorWordOperations.js +14 -4
  28. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  29. package/esm/vs/editor/common/languages/textToHtmlTokenizer.js +21 -10
  30. package/esm/vs/editor/common/languages/textToHtmlTokenizer.js.map +1 -1
  31. package/esm/vs/editor/common/languages.js +5 -5
  32. package/esm/vs/editor/common/languages.js.map +1 -1
  33. package/esm/vs/editor/common/standalone/standaloneEnums.js +5 -5
  34. package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
  35. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js.map +1 -1
  36. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js.map +1 -1
  37. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +5 -5
  38. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  39. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +2 -2
  40. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  41. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +22 -24
  42. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  43. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +16 -22
  44. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  45. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  46. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  47. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -6
  48. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  49. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +6 -2
  50. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  51. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  52. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -6
  53. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  54. package/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js +6 -0
  55. package/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js.map +1 -1
  56. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
  57. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  58. package/esm/vs/editor/editor.api.d.ts +20 -18
  59. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +1 -1
  60. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  61. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  62. package/esm/vs/platform/theme/common/colors/miscColors.js +5 -4
  63. package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
  64. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  65. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  66. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  67. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  68. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  69. package/monaco.d.ts +20 -18
  70. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/actionbar/actionbar.ts","vs/base/browser/ui/actionbar/actionbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAA0B,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAqC,SAAS,EAAE,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C,cAAc,CAAC,QAAQ,CAAC;YAC9H,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAe,EAAE,OAAiB;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC;QAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD","file":"actionbar.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 * as DOM from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from './actionViewItems.js';\nimport { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { ActionRunner, IAction, IActionRunner, IRunEvent, Separator } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode, KeyMod } from '../../../common/keyCodes.js';\nimport { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';\nimport * as types from '../../../common/types.js';\nimport './actionbar.css';\n\nexport interface IActionViewItem extends IDisposable {\n\taction: IAction;\n\tactionRunner: IActionRunner;\n\tsetActionContext(context: unknown): void;\n\trender(element: HTMLElement): void;\n\tisEnabled(): boolean;\n\tfocus(fromRight?: boolean): void; // TODO@isidorn what is this?\n\tblur(): void;\n\tshowHover?(): void;\n}\n\nexport interface IActionViewItemProvider {\n\t(action: IAction, options: IActionViewItemOptions): IActionViewItem | undefined;\n}\n\nexport const enum ActionsOrientation {\n\tHORIZONTAL,\n\tVERTICAL,\n}\n\nexport interface ActionTrigger {\n\tkeys?: KeyCode[];\n\tkeyDown: boolean;\n}\n\nexport interface IActionBarOptions {\n\treadonly orientation?: ActionsOrientation;\n\treadonly context?: unknown;\n\treadonly actionViewItemProvider?: IActionViewItemProvider;\n\treadonly actionRunner?: IActionRunner;\n\treadonly ariaLabel?: string;\n\treadonly ariaRole?: string;\n\treadonly triggerKeys?: ActionTrigger;\n\treadonly allowContextMenu?: boolean;\n\treadonly preventLoopNavigation?: boolean;\n\treadonly focusOnlyEnabledItems?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\t/**\n\t * If true, toggled primary items are highlighted with a background color.\n\t * Some action bars exclusively use icon states, we don't want to enable this for them.\n\t * Thus, this is opt-in.\n\t */\n\treadonly highlightToggledItems?: boolean;\n}\n\nexport interface IActionOptions extends IActionViewItemOptions {\n\tindex?: number;\n}\n\nexport class ActionBar extends Disposable implements IActionRunner {\n\n\tprivate readonly options: IActionBarOptions;\n\tprivate readonly _hoverDelegate: IHoverDelegate;\n\n\tprivate _actionRunner: IActionRunner;\n\tprivate readonly _actionRunnerDisposables = this._register(new DisposableStore());\n\tprivate _context: unknown;\n\tprivate readonly _orientation: ActionsOrientation;\n\tprivate readonly _triggerKeys: {\n\t\tkeys: KeyCode[];\n\t\tkeyDown: boolean;\n\t};\n\n\t// View Items\n\tviewItems: IActionViewItem[];\n\tprivate readonly viewItemDisposables = this._register(new DisposableMap<IActionViewItem>());\n\tprivate previouslyFocusedItem?: number;\n\tprotected focusedItem?: number;\n\tprivate focusTracker: DOM.IFocusTracker;\n\n\t// Trigger Key Tracking\n\tprivate triggerKeyDown: boolean = false;\n\n\tprivate focusable: boolean = true;\n\n\t// Elements\n\tdomNode: HTMLElement;\n\tprotected readonly actionsList: HTMLElement;\n\n\tprivate readonly _onDidBlur = this._register(new Emitter<void>());\n\tget onDidBlur() { return this._onDidBlur.event; }\n\n\tprivate readonly _onDidCancel = this._register(new Emitter<void>({ onWillAddFirstListener: () => this.cancelHasListener = true }));\n\tget onDidCancel() { return this._onDidCancel.event; }\n\tprivate cancelHasListener = false;\n\n\tprivate readonly _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun() { return this._onDidRun.event; }\n\n\tprivate readonly _onWillRun = this._register(new Emitter<IRunEvent>());\n\tget onWillRun() { return this._onWillRun.event; }\n\n\tconstructor(container: HTMLElement, options: IActionBarOptions = {}) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis._context = options.context ?? null;\n\t\tthis._orientation = this.options.orientation ?? ActionsOrientation.HORIZONTAL;\n\t\tthis._triggerKeys = {\n\t\t\tkeyDown: this.options.triggerKeys?.keyDown ?? false,\n\t\t\tkeys: this.options.triggerKeys?.keys ?? [KeyCode.Enter, KeyCode.Space]\n\t\t};\n\n\t\tthis._hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());\n\n\t\tif (this.options.actionRunner) {\n\t\t\tthis._actionRunner = this.options.actionRunner;\n\t\t} else {\n\t\t\tthis._actionRunner = new ActionRunner();\n\t\t\tthis._actionRunnerDisposables.add(this._actionRunner);\n\t\t}\n\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\n\t\tthis.viewItems = [];\n\t\tthis.focusedItem = undefined;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'monaco-action-bar';\n\n\t\tlet previousKeys: KeyCode[];\n\t\tlet nextKeys: KeyCode[];\n\n\t\tswitch (this._orientation) {\n\t\t\tcase ActionsOrientation.HORIZONTAL:\n\t\t\t\tpreviousKeys = [KeyCode.LeftArrow];\n\t\t\t\tnextKeys = [KeyCode.RightArrow];\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL:\n\t\t\t\tpreviousKeys = [KeyCode.UpArrow];\n\t\t\t\tnextKeys = [KeyCode.DownArrow];\n\t\t\t\tthis.domNode.className += ' vertical';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = true;\n\t\t\tconst focusedItem = typeof this.focusedItem === 'number' ? this.viewItems[this.focusedItem] : undefined;\n\n\t\t\tif (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) {\n\t\t\t\teventHandled = this.focusPrevious();\n\t\t\t} else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) {\n\t\t\t\teventHandled = this.focusNext();\n\t\t\t} else if (event.equals(KeyCode.Escape) && this.cancelHasListener) {\n\t\t\t\tthis._onDidCancel.fire();\n\t\t\t} else if (event.equals(KeyCode.Home)) {\n\t\t\t\teventHandled = this.focusFirst();\n\t\t\t} else if (event.equals(KeyCode.End)) {\n\t\t\t\teventHandled = this.focusLast();\n\t\t\t} else if (event.equals(KeyCode.Tab) && focusedItem instanceof BaseActionViewItem && focusedItem.trapsArrowNavigation) {\n\t\t\t\t// Tab, so forcibly focus next #219199\n\t\t\t\teventHandled = this.focusNext(undefined, true);\n\t\t\t} else if (this.isTriggerKeyEvent(event)) {\n\t\t\t\t// Staying out of the else branch even if not triggered\n\t\t\t\tif (this._triggerKeys.keyDown) {\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerKeyDown = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\teventHandled = false;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t// Run action on Enter/Space\n\t\t\tif (this.isTriggerKeyEvent(event)) {\n\t\t\t\tif (!this._triggerKeys.keyDown && this.triggerKeyDown) {\n\t\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\n\t\t\t// Recompute focused item\n\t\t\telse if (event.equals(KeyCode.Tab) || event.equals(KeyMod.Shift | KeyCode.Tab) || event.equals(KeyCode.UpArrow) || event.equals(KeyCode.DownArrow) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow)) {\n\t\t\t\tthis.updateFocusedItem();\n\t\t\t}\n\t\t}));\n\n\t\tthis.focusTracker = this._register(DOM.trackFocus(this.domNode));\n\t\tthis._register(this.focusTracker.onDidBlur(() => {\n\t\t\tif (DOM.getActiveElement() === this.domNode || !DOM.isAncestor(DOM.getActiveElement(), this.domNode)) {\n\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t\tthis.focusedItem = undefined;\n\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem()));\n\n\t\tthis.actionsList = document.createElement('ul');\n\t\tthis.actionsList.className = 'actions-container';\n\t\tif (this.options.highlightToggledItems) {\n\t\t\tthis.actionsList.classList.add('highlight-toggled');\n\t\t}\n\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\n\t\tif (this.options.ariaLabel) {\n\t\t\tthis.actionsList.setAttribute('aria-label', this.options.ariaLabel);\n\t\t}\n\n\t\tthis.domNode.appendChild(this.actionsList);\n\n\t\tcontainer.appendChild(this.domNode);\n\t}\n\n\tprivate refreshRole(): void {\n\t\tif (this.length() >= 1) {\n\t\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\t\t} else {\n\t\t\tthis.actionsList.setAttribute('role', 'presentation');\n\t\t}\n\t}\n\n\t// Some action bars should not be focusable at times\n\t// When an action bar is not focusable make sure to make all the elements inside it not focusable\n\t// When an action bar is focusable again, make sure the first item can be focused\n\tsetFocusable(focusable: boolean): void {\n\t\tthis.focusable = focusable;\n\t\tif (this.focusable) {\n\t\t\tconst firstEnabled = this.viewItems.find(vi => vi instanceof BaseActionViewItem && vi.isEnabled());\n\t\t\tif (firstEnabled instanceof BaseActionViewItem) {\n\t\t\t\tfirstEnabled.setFocusable(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.viewItems.forEach(vi => {\n\t\t\t\tif (vi instanceof BaseActionViewItem) {\n\t\t\t\t\tvi.setFocusable(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate isTriggerKeyEvent(event: StandardKeyboardEvent): boolean {\n\t\tlet ret = false;\n\t\tthis._triggerKeys.keys.forEach(keyCode => {\n\t\t\tret = ret || event.equals(keyCode);\n\t\t});\n\n\t\treturn ret;\n\t}\n\n\tprivate updateFocusedItem(): void {\n\t\tfor (let i = 0; i < this.actionsList.children.length; i++) {\n\t\t\tconst elem = this.actionsList.children[i];\n\t\t\tif (DOM.isAncestor(DOM.getActiveElement(), elem)) {\n\t\t\t\tthis.focusedItem = i;\n\t\t\t\tthis.viewItems[this.focusedItem]?.showHover?.();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tget context(): unknown {\n\t\treturn this._context;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis._context = context;\n\t\tthis.viewItems.forEach(i => i.setActionContext(context));\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\n\t\t// when setting a new `IActionRunner` make sure to dispose old listeners and\n\t\t// start to forward events from the new listener\n\t\tthis._actionRunnerDisposables.clear();\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\t\tthis.viewItems.forEach(item => item.actionRunner = actionRunner);\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetAction(indexOrElement: number | HTMLElement): IAction | undefined {\n\n\t\t// by index\n\t\tif (typeof indexOrElement === 'number') {\n\t\t\treturn this.viewItems[indexOrElement]?.action;\n\t\t}\n\n\t\t// by element\n\t\tif (DOM.isHTMLElement(indexOrElement)) {\n\t\t\twhile (indexOrElement.parentElement !== this.actionsList) {\n\t\t\t\tif (!indexOrElement.parentElement) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tindexOrElement = indexOrElement.parentElement;\n\t\t\t}\n\t\t\tfor (let i = 0; i < this.actionsList.childNodes.length; i++) {\n\t\t\t\tif (this.actionsList.childNodes[i] === indexOrElement) {\n\t\t\t\t\treturn this.viewItems[i].action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpush(arg: IAction | ReadonlyArray<IAction>, options: IActionOptions = {}): void {\n\t\tconst actions: ReadonlyArray<IAction> = Array.isArray(arg) ? arg : [arg];\n\n\t\tlet index = types.isNumber(options.index) ? options.index : null;\n\n\t\tactions.forEach((action: IAction) => {\n\t\t\tconst actionViewItemElement = document.createElement('li');\n\t\t\tactionViewItemElement.className = 'action-item';\n\t\t\tactionViewItemElement.setAttribute('role', 'presentation');\n\n\t\t\tlet item: IActionViewItem | undefined;\n\n\t\t\tconst viewItemOptions: IActionViewItemOptions = { hoverDelegate: this._hoverDelegate, ...options, isTabList: this.options.ariaRole === 'tablist' };\n\t\t\tif (this.options.actionViewItemProvider) {\n\t\t\t\titem = this.options.actionViewItemProvider(action, viewItemOptions);\n\t\t\t}\n\n\t\t\tif (!item) {\n\t\t\t\titem = new ActionViewItem(this.context, action, viewItemOptions);\n\t\t\t}\n\n\t\t\t// Prevent native context menu on actions\n\t\t\tif (!this.options.allowContextMenu) {\n\t\t\t\tthis.viewItemDisposables.set(item, DOM.addDisposableListener(actionViewItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\titem.actionRunner = this._actionRunner;\n\t\t\titem.setActionContext(this.context);\n\t\t\titem.render(actionViewItemElement);\n\n\t\t\tif (index === null || index < 0 || index >= this.actionsList.children.length) {\n\t\t\t\tthis.actionsList.appendChild(actionViewItemElement);\n\t\t\t\tthis.viewItems.push(item);\n\t\t\t} else {\n\t\t\t\tthis.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]);\n\t\t\t\tthis.viewItems.splice(index, 0, item);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\n\t\t// We need to allow for the first enabled item to be focused on using tab navigation #106441\n\t\tif (this.focusable) {\n\t\t\tlet didFocus = false;\n\t\t\tfor (const item of this.viewItems) {\n\t\t\t\tif (!(item instanceof BaseActionViewItem)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet focus: boolean;\n\t\t\t\tif (didFocus) {\n\t\t\t\t\tfocus = false; // already focused an item\n\t\t\t\t} else if (item.action.id === Separator.ID) {\n\t\t\t\t\tfocus = false; // never focus a separator\n\t\t\t\t} else if (!item.isEnabled() && this.options.focusOnlyEnabledItems) {\n\t\t\t\t\tfocus = false; // never focus a disabled item\n\t\t\t\t} else {\n\t\t\t\t\tfocus = true;\n\t\t\t\t}\n\n\t\t\t\tif (focus) {\n\t\t\t\t\titem.setFocusable(true);\n\t\t\t\t\tdidFocus = true;\n\t\t\t\t} else {\n\t\t\t\t\titem.setFocusable(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof this.focusedItem === 'number') {\n\t\t\t// After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128\n\t\t\tthis.focus(this.focusedItem);\n\t\t}\n\t\tthis.refreshRole();\n\t}\n\n\tclear(): void {\n\t\tif (this.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.viewItemDisposables.clearAndDisposeAll();\n\t\tDOM.clearNode(this.actionsList);\n\t\tthis.refreshRole();\n\t}\n\n\tlength(): number {\n\t\treturn this.viewItems.length;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.viewItems.length === 0;\n\t}\n\n\tfocus(index?: number): void;\n\tfocus(selectFirst?: boolean): void;\n\tfocus(arg?: number | boolean): void {\n\t\tlet selectFirst: boolean = false;\n\t\tlet index: number | undefined = undefined;\n\t\tif (arg === undefined) {\n\t\t\tselectFirst = true;\n\t\t} else if (typeof arg === 'number') {\n\t\t\tindex = arg;\n\t\t} else if (typeof arg === 'boolean') {\n\t\t\tselectFirst = arg;\n\t\t}\n\n\t\tif (selectFirst && typeof this.focusedItem === 'undefined') {\n\t\t\tconst firstEnabled = this.viewItems.findIndex(item => item.isEnabled());\n\t\t\t// Focus the first enabled item\n\t\t\tthis.focusedItem = firstEnabled === -1 ? undefined : firstEnabled;\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t} else {\n\t\t\tif (index !== undefined) {\n\t\t\t\tthis.focusedItem = index;\n\t\t\t}\n\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t}\n\t}\n\n\tprivate focusFirst(): boolean {\n\t\tthis.focusedItem = this.length() - 1;\n\t\treturn this.focusNext(true);\n\t}\n\n\tprivate focusLast(): boolean {\n\t\tthis.focusedItem = 0;\n\t\treturn this.focusPrevious(true);\n\t}\n\n\tprotected focusNext(forceLoop?: boolean, forceFocus?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\t\tdo {\n\n\t\t\tif (!forceLoop && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) {\n\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.focusedItem = (this.focusedItem + 1) % this.viewItems.length;\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\t\tthis.updateFocus(undefined, undefined, forceFocus);\n\t\treturn true;\n\t}\n\n\tprotected focusPrevious(forceLoop?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = 0;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = this.focusedItem - 1;\n\t\t\tif (this.focusedItem < 0) {\n\t\t\t\tif (!forceLoop && this.options.preventLoopNavigation) {\n\t\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t\t}\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\n\t\tthis.updateFocus(true);\n\t\treturn true;\n\t}\n\n\tprotected updateFocus(fromRight?: boolean, preventScroll?: boolean, forceFocus: boolean = false): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t}\n\n\t\tif (this.previouslyFocusedItem !== undefined && this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\tthis.viewItems[this.previouslyFocusedItem]?.blur();\n\t\t}\n\t\tconst actionViewItem = this.focusedItem !== undefined ? this.viewItems[this.focusedItem] : undefined;\n\t\tif (actionViewItem) {\n\t\t\tlet focusItem = true;\n\n\t\t\tif (!types.isFunction(actionViewItem.focus)) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (this.options.focusOnlyEnabledItems && types.isFunction(actionViewItem.isEnabled) && !actionViewItem.isEnabled()) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (actionViewItem.action.id === Separator.ID) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\t\t\tif (!focusItem) {\n\t\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t\t\tthis.previouslyFocusedItem = undefined;\n\t\t\t} else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\t\tactionViewItem.focus(fromRight);\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t}\n\t\t\tif (focusItem) {\n\t\t\t\tactionViewItem.showHover?.();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate doTrigger(event: StandardKeyboardEvent): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\treturn; //nothing to focus\n\t\t}\n\n\t\t// trigger action\n\t\tconst actionViewItem = this.viewItems[this.focusedItem];\n\t\tif (actionViewItem instanceof BaseActionViewItem) {\n\t\t\tconst context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context;\n\t\t\tthis.run(actionViewItem._action, context);\n\t\t}\n\t}\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tawait this._actionRunner.run(action, context);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._context = undefined;\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.getContainer().remove();\n\t\tsuper.dispose();\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 * as DOM from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from './actionViewItems.js';\nimport { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { ActionRunner, IAction, IActionRunner, IRunEvent, Separator } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode, KeyMod } from '../../../common/keyCodes.js';\nimport { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';\nimport * as types from '../../../common/types.js';\nimport './actionbar.css';\n\nexport interface IActionViewItem extends IDisposable {\n\taction: IAction;\n\tactionRunner: IActionRunner;\n\tsetActionContext(context: unknown): void;\n\trender(element: HTMLElement): void;\n\tisEnabled(): boolean;\n\tfocus(fromRight?: boolean): void; // TODO@isidorn what is this?\n\tblur(): void;\n\tshowHover?(): void;\n}\n\nexport interface IActionViewItemProvider {\n\t(action: IAction, options: IActionViewItemOptions): IActionViewItem | undefined;\n}\n\nexport const enum ActionsOrientation {\n\tHORIZONTAL,\n\tVERTICAL,\n}\n\nexport interface ActionTrigger {\n\tkeys?: KeyCode[];\n\tkeyDown: boolean;\n}\n\nexport interface IActionBarOptions {\n\treadonly orientation?: ActionsOrientation;\n\treadonly context?: unknown;\n\treadonly actionViewItemProvider?: IActionViewItemProvider;\n\treadonly actionRunner?: IActionRunner;\n\treadonly ariaLabel?: string;\n\treadonly ariaRole?: string;\n\treadonly triggerKeys?: ActionTrigger;\n\treadonly allowContextMenu?: boolean;\n\treadonly preventLoopNavigation?: boolean;\n\treadonly focusOnlyEnabledItems?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\t/**\n\t * If true, toggled primary items are highlighted with a background color.\n\t * Some action bars exclusively use icon states, we don't want to enable this for them.\n\t * Thus, this is opt-in.\n\t */\n\treadonly highlightToggledItems?: boolean;\n}\n\nexport interface IActionOptions extends IActionViewItemOptions {\n\tindex?: number;\n}\n\nexport class ActionBar extends Disposable implements IActionRunner {\n\n\tprivate readonly options: IActionBarOptions;\n\tprivate readonly _hoverDelegate: IHoverDelegate;\n\n\tprivate _actionRunner: IActionRunner;\n\tprivate readonly _actionRunnerDisposables = this._register(new DisposableStore());\n\tprivate _context: unknown;\n\tprivate readonly _orientation: ActionsOrientation;\n\tprivate readonly _triggerKeys: {\n\t\tkeys: KeyCode[];\n\t\tkeyDown: boolean;\n\t};\n\n\t// View Items\n\tviewItems: IActionViewItem[];\n\tprivate readonly viewItemDisposables = this._register(new DisposableMap<IActionViewItem>());\n\tprivate previouslyFocusedItem?: number;\n\tprotected focusedItem?: number;\n\tprivate focusTracker: DOM.IFocusTracker;\n\n\t// Trigger Key Tracking\n\tprivate triggerKeyDown: boolean = false;\n\n\tprivate focusable: boolean = true;\n\n\t// Elements\n\tdomNode: HTMLElement;\n\tprotected readonly actionsList: HTMLElement;\n\n\tprivate readonly _onDidBlur = this._register(new Emitter<void>());\n\tget onDidBlur() { return this._onDidBlur.event; }\n\n\tprivate readonly _onDidCancel = this._register(new Emitter<void>({ onWillAddFirstListener: () => this.cancelHasListener = true }));\n\tget onDidCancel() { return this._onDidCancel.event; }\n\tprivate cancelHasListener = false;\n\n\tprivate readonly _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun() { return this._onDidRun.event; }\n\n\tprivate readonly _onWillRun = this._register(new Emitter<IRunEvent>());\n\tget onWillRun() { return this._onWillRun.event; }\n\n\tconstructor(container: HTMLElement, options: IActionBarOptions = {}) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis._context = options.context ?? null;\n\t\tthis._orientation = this.options.orientation ?? ActionsOrientation.HORIZONTAL;\n\t\tthis._triggerKeys = {\n\t\t\tkeyDown: this.options.triggerKeys?.keyDown ?? false,\n\t\t\tkeys: this.options.triggerKeys?.keys ?? [KeyCode.Enter, KeyCode.Space]\n\t\t};\n\n\t\tthis._hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());\n\n\t\tif (this.options.actionRunner) {\n\t\t\tthis._actionRunner = this.options.actionRunner;\n\t\t} else {\n\t\t\tthis._actionRunner = new ActionRunner();\n\t\t\tthis._actionRunnerDisposables.add(this._actionRunner);\n\t\t}\n\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\n\t\tthis.viewItems = [];\n\t\tthis.focusedItem = undefined;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'monaco-action-bar';\n\n\t\tlet previousKeys: KeyCode[];\n\t\tlet nextKeys: KeyCode[];\n\n\t\tswitch (this._orientation) {\n\t\t\tcase ActionsOrientation.HORIZONTAL:\n\t\t\t\tpreviousKeys = [KeyCode.LeftArrow];\n\t\t\t\tnextKeys = [KeyCode.RightArrow];\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL:\n\t\t\t\tpreviousKeys = [KeyCode.UpArrow];\n\t\t\t\tnextKeys = [KeyCode.DownArrow];\n\t\t\t\tthis.domNode.className += ' vertical';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = true;\n\t\t\tconst focusedItem = typeof this.focusedItem === 'number' ? this.viewItems[this.focusedItem] : undefined;\n\n\t\t\tif (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) {\n\t\t\t\teventHandled = this.focusPrevious();\n\t\t\t} else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) {\n\t\t\t\teventHandled = this.focusNext();\n\t\t\t} else if (event.equals(KeyCode.Escape) && this.cancelHasListener) {\n\t\t\t\tthis._onDidCancel.fire();\n\t\t\t} else if (event.equals(KeyCode.Home)) {\n\t\t\t\teventHandled = this.focusFirst();\n\t\t\t} else if (event.equals(KeyCode.End)) {\n\t\t\t\teventHandled = this.focusLast();\n\t\t\t} else if (event.equals(KeyCode.Tab) && focusedItem instanceof BaseActionViewItem && focusedItem.trapsArrowNavigation) {\n\t\t\t\t// Tab, so forcibly focus next #219199\n\t\t\t\teventHandled = this.focusNext(undefined, true);\n\t\t\t} else if (this.isTriggerKeyEvent(event)) {\n\t\t\t\t// Staying out of the else branch even if not triggered\n\t\t\t\tif (this._triggerKeys.keyDown) {\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerKeyDown = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\teventHandled = false;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t// Run action on Enter/Space\n\t\t\tif (this.isTriggerKeyEvent(event)) {\n\t\t\t\tif (!this._triggerKeys.keyDown && this.triggerKeyDown) {\n\t\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\n\t\t\t// Recompute focused item\n\t\t\telse if (event.equals(KeyCode.Tab) || event.equals(KeyMod.Shift | KeyCode.Tab) || event.equals(KeyCode.UpArrow) || event.equals(KeyCode.DownArrow) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow)) {\n\t\t\t\tthis.updateFocusedItem();\n\t\t\t}\n\t\t}));\n\n\t\tthis.focusTracker = this._register(DOM.trackFocus(this.domNode));\n\t\tthis._register(this.focusTracker.onDidBlur(() => {\n\t\t\tif (DOM.getActiveElement() === this.domNode || !DOM.isAncestor(DOM.getActiveElement(), this.domNode)) {\n\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t\tthis.focusedItem = undefined;\n\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem()));\n\n\t\tthis.actionsList = document.createElement('ul');\n\t\tthis.actionsList.className = 'actions-container';\n\t\tif (this.options.highlightToggledItems) {\n\t\t\tthis.actionsList.classList.add('highlight-toggled');\n\t\t}\n\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\n\t\tif (this.options.ariaLabel) {\n\t\t\tthis.actionsList.setAttribute('aria-label', this.options.ariaLabel);\n\t\t}\n\n\t\tthis.domNode.appendChild(this.actionsList);\n\n\t\tcontainer.appendChild(this.domNode);\n\t}\n\n\tprivate refreshRole(): void {\n\t\tif (this.length() >= 1) {\n\t\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\t\t} else {\n\t\t\tthis.actionsList.setAttribute('role', 'presentation');\n\t\t}\n\t}\n\n\t// Some action bars should not be focusable at times\n\t// When an action bar is not focusable make sure to make all the elements inside it not focusable\n\t// When an action bar is focusable again, make sure the first item can be focused\n\tsetFocusable(focusable: boolean): void {\n\t\tthis.focusable = focusable;\n\t\tif (this.focusable) {\n\t\t\tconst firstEnabled = this.viewItems.find(vi => vi instanceof BaseActionViewItem && vi.isEnabled());\n\t\t\tif (firstEnabled instanceof BaseActionViewItem) {\n\t\t\t\tfirstEnabled.setFocusable(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.viewItems.forEach(vi => {\n\t\t\t\tif (vi instanceof BaseActionViewItem) {\n\t\t\t\t\tvi.setFocusable(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate isTriggerKeyEvent(event: StandardKeyboardEvent): boolean {\n\t\tlet ret = false;\n\t\tthis._triggerKeys.keys.forEach(keyCode => {\n\t\t\tret = ret || event.equals(keyCode);\n\t\t});\n\n\t\treturn ret;\n\t}\n\n\tprivate updateFocusedItem(): void {\n\t\tfor (let i = 0; i < this.actionsList.children.length; i++) {\n\t\t\tconst elem = this.actionsList.children[i];\n\t\t\tif (DOM.isAncestor(DOM.getActiveElement(), elem)) {\n\t\t\t\tthis.focusedItem = i;\n\t\t\t\tthis.viewItems[this.focusedItem]?.showHover?.();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tget context(): unknown {\n\t\treturn this._context;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis._context = context;\n\t\tthis.viewItems.forEach(i => i.setActionContext(context));\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\n\t\t// when setting a new `IActionRunner` make sure to dispose old listeners and\n\t\t// start to forward events from the new listener\n\t\tthis._actionRunnerDisposables.clear();\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\t\tthis.viewItems.forEach(item => item.actionRunner = actionRunner);\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetAction(indexOrElement: number | HTMLElement): IAction | undefined {\n\n\t\t// by index\n\t\tif (typeof indexOrElement === 'number') {\n\t\t\treturn this.viewItems[indexOrElement]?.action;\n\t\t}\n\n\t\t// by element\n\t\tif (DOM.isHTMLElement(indexOrElement)) {\n\t\t\twhile (indexOrElement.parentElement !== this.actionsList) {\n\t\t\t\tif (!indexOrElement.parentElement) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tindexOrElement = indexOrElement.parentElement;\n\t\t\t}\n\t\t\tfor (let i = 0; i < this.actionsList.childNodes.length; i++) {\n\t\t\t\tif (this.actionsList.childNodes[i] === indexOrElement) {\n\t\t\t\t\treturn this.viewItems[i].action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpush(arg: IAction | ReadonlyArray<IAction>, options: IActionOptions = {}): void {\n\t\tconst actions: ReadonlyArray<IAction> = Array.isArray(arg) ? arg : [arg];\n\n\t\tlet index = types.isNumber(options.index) ? options.index : null;\n\n\t\tactions.forEach((action: IAction) => {\n\t\t\tconst actionViewItemElement = document.createElement('li');\n\t\t\tactionViewItemElement.className = 'action-item';\n\t\t\tactionViewItemElement.setAttribute('role', 'presentation');\n\n\t\t\tlet item: IActionViewItem | undefined;\n\n\t\t\tconst viewItemOptions: IActionViewItemOptions = { hoverDelegate: this._hoverDelegate, ...options, isTabList: this.options.ariaRole === 'tablist' };\n\t\t\tif (this.options.actionViewItemProvider) {\n\t\t\t\titem = this.options.actionViewItemProvider(action, viewItemOptions);\n\t\t\t}\n\n\t\t\tif (!item) {\n\t\t\t\titem = new ActionViewItem(this.context, action, viewItemOptions);\n\t\t\t}\n\n\t\t\t// Prevent native context menu on actions\n\t\t\tif (!this.options.allowContextMenu) {\n\t\t\t\tthis.viewItemDisposables.set(item, DOM.addDisposableListener(actionViewItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\titem.actionRunner = this._actionRunner;\n\t\t\titem.setActionContext(this.context);\n\t\t\titem.render(actionViewItemElement);\n\n\t\t\tif (index === null || index < 0 || index >= this.actionsList.children.length) {\n\t\t\t\tthis.actionsList.appendChild(actionViewItemElement);\n\t\t\t\tthis.viewItems.push(item);\n\t\t\t} else {\n\t\t\t\tthis.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]);\n\t\t\t\tthis.viewItems.splice(index, 0, item);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\n\t\t// We need to allow for the first enabled item to be focused on using tab navigation #106441\n\t\tif (this.focusable) {\n\t\t\tlet didFocus = false;\n\t\t\tfor (const item of this.viewItems) {\n\t\t\t\tif (!(item instanceof BaseActionViewItem)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet focus: boolean;\n\t\t\t\tif (didFocus) {\n\t\t\t\t\tfocus = false; // already focused an item\n\t\t\t\t} else if (item.action.id === Separator.ID) {\n\t\t\t\t\tfocus = false; // never focus a separator\n\t\t\t\t} else if (!item.isEnabled() && this.options.focusOnlyEnabledItems) {\n\t\t\t\t\tfocus = false; // never focus a disabled item\n\t\t\t\t} else {\n\t\t\t\t\tfocus = true;\n\t\t\t\t}\n\n\t\t\t\tif (focus) {\n\t\t\t\t\titem.setFocusable(true);\n\t\t\t\t\tdidFocus = true;\n\t\t\t\t} else {\n\t\t\t\t\titem.setFocusable(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof this.focusedItem === 'number') {\n\t\t\t// After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128\n\t\t\tthis.focus(this.focusedItem);\n\t\t}\n\t\tthis.refreshRole();\n\t}\n\n\tclear(): void {\n\t\tif (this.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.viewItemDisposables.clearAndDisposeAll();\n\t\tDOM.clearNode(this.actionsList);\n\t\tthis.refreshRole();\n\t}\n\n\tlength(): number {\n\t\treturn this.viewItems.length;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.viewItems.length === 0;\n\t}\n\n\tfocus(index?: number): void;\n\tfocus(selectFirst?: boolean): void;\n\tfocus(arg?: number | boolean): void {\n\t\tlet selectFirst: boolean = false;\n\t\tlet index: number | undefined = undefined;\n\t\tif (arg === undefined) {\n\t\t\tselectFirst = true;\n\t\t} else if (typeof arg === 'number') {\n\t\t\tindex = arg;\n\t\t} else if (typeof arg === 'boolean') {\n\t\t\tselectFirst = arg;\n\t\t}\n\n\t\tif (selectFirst && typeof this.focusedItem === 'undefined') {\n\t\t\tconst firstEnabled = this.viewItems.findIndex(item => item.isEnabled());\n\t\t\t// Focus the first enabled item\n\t\t\tthis.focusedItem = firstEnabled === -1 ? undefined : firstEnabled;\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t} else {\n\t\t\tif (index !== undefined) {\n\t\t\t\tthis.focusedItem = index;\n\t\t\t}\n\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t}\n\t}\n\n\tprivate focusFirst(): boolean {\n\t\tthis.focusedItem = this.length() - 1;\n\t\treturn this.focusNext(true);\n\t}\n\n\tprivate focusLast(): boolean {\n\t\tthis.focusedItem = 0;\n\t\treturn this.focusPrevious(true);\n\t}\n\n\tprotected focusNext(forceLoop?: boolean, forceFocus?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\t\tdo {\n\n\t\t\tif (!forceLoop && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) {\n\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.focusedItem = (this.focusedItem + 1) % this.viewItems.length;\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\t\tthis.updateFocus(undefined, undefined, forceFocus);\n\t\treturn true;\n\t}\n\n\tprotected focusPrevious(forceLoop?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = 0;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = this.focusedItem - 1;\n\t\t\tif (this.focusedItem < 0) {\n\t\t\t\tif (!forceLoop && this.options.preventLoopNavigation) {\n\t\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t\t}\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\n\t\tthis.updateFocus(true);\n\t\treturn true;\n\t}\n\n\tprotected updateFocus(fromRight?: boolean, preventScroll?: boolean, forceFocus: boolean = false): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t}\n\n\t\tif (this.previouslyFocusedItem !== undefined && this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\tthis.viewItems[this.previouslyFocusedItem]?.blur();\n\t\t}\n\t\tconst actionViewItem = this.focusedItem !== undefined ? this.viewItems[this.focusedItem] : undefined;\n\t\tif (actionViewItem) {\n\t\t\tlet focusItem = true;\n\n\t\t\tif (!types.isFunction(actionViewItem.focus)) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (this.options.focusOnlyEnabledItems && types.isFunction(actionViewItem.isEnabled) && !actionViewItem.isEnabled()) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (actionViewItem.action.id === Separator.ID) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\t\t\tif (!focusItem) {\n\t\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t\t\tthis.previouslyFocusedItem = undefined;\n\t\t\t} else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\t\tactionViewItem.focus(fromRight);\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t}\n\t\t\tif (focusItem) {\n\t\t\t\tactionViewItem.showHover?.();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate doTrigger(event: StandardKeyboardEvent): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\treturn; //nothing to focus\n\t\t}\n\n\t\t// trigger action\n\t\tconst actionViewItem = this.viewItems[this.focusedItem];\n\t\tif (actionViewItem instanceof BaseActionViewItem) {\n\t\t\tconst context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context;\n\t\t\tthis.run(actionViewItem._action, context);\n\t\t}\n\t}\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tawait this._actionRunner.run(action, context);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._context = undefined;\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.getContainer().remove();\n\t\tsuper.dispose();\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/actionbar/actionbar.ts","vs/base/browser/ui/actionbar/actionbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAA0B,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAqC,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAe,MAAM,8BAA8B,CAAC;AAChH,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,iBAAiB,CAAC;AAmDzB,MAAM,OAAO,SAAU,SAAQ,UAAU;IA+BxC,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAA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,EAAE,CAAC;YAC9B,CAAC;QACF,CAAC;IACF,CAAC;IAEO,SAAS,CAAC,KAA4B;QAC7C,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;YAC7C,OAAO,CAAC,kBAAkB;QAC3B,CAAC;QAED,iBAAiB;QACjB,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,cAAc,YAAY,kBAAkB,EAAE,CAAC;YAClD,MAAM,OAAO,GAAG,CAAC,cAAc,CAAC,QAAQ,KAAK,IAAI,IAAI,cAAc,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC9H,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,MAAe,EAAE,OAAiB;QAC3C,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAC;QAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD","file":"actionbar.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 * as DOM from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from './actionViewItems.js';\nimport { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { ActionRunner, IAction, IActionRunner, IRunEvent, Separator } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode, KeyMod } from '../../../common/keyCodes.js';\nimport { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';\nimport * as types from '../../../common/types.js';\nimport './actionbar.css';\n\nexport interface IActionViewItem extends IDisposable {\n\taction: IAction;\n\tactionRunner: IActionRunner;\n\tsetActionContext(context: unknown): void;\n\trender(element: HTMLElement): void;\n\tisEnabled(): boolean;\n\tfocus(fromRight?: boolean): void; // TODO@isidorn what is this?\n\tblur(): void;\n\tshowHover?(): void;\n}\n\nexport interface IActionViewItemProvider {\n\t(action: IAction, options: IActionViewItemOptions): IActionViewItem | undefined;\n}\n\nexport const enum ActionsOrientation {\n\tHORIZONTAL,\n\tVERTICAL,\n}\n\nexport interface ActionTrigger {\n\tkeys?: KeyCode[];\n\tkeyDown: boolean;\n}\n\nexport interface IActionBarOptions {\n\treadonly orientation?: ActionsOrientation;\n\treadonly context?: unknown;\n\treadonly actionViewItemProvider?: IActionViewItemProvider;\n\treadonly actionRunner?: IActionRunner;\n\treadonly ariaLabel?: string;\n\treadonly ariaRole?: string;\n\treadonly triggerKeys?: ActionTrigger;\n\treadonly allowContextMenu?: boolean;\n\treadonly preventLoopNavigation?: boolean;\n\treadonly focusOnlyEnabledItems?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\t/**\n\t * If true, toggled primary items are highlighted with a background color.\n\t * Some action bars exclusively use icon states, we don't want to enable this for them.\n\t * Thus, this is opt-in.\n\t */\n\treadonly highlightToggledItems?: boolean;\n}\n\nexport interface IActionOptions extends IActionViewItemOptions {\n\tindex?: number;\n}\n\nexport class ActionBar extends Disposable implements IActionRunner {\n\n\tprivate readonly options: IActionBarOptions;\n\tprivate readonly _hoverDelegate: IHoverDelegate;\n\n\tprivate _actionRunner: IActionRunner;\n\tprivate readonly _actionRunnerDisposables = this._register(new DisposableStore());\n\tprivate _context: unknown;\n\tprivate readonly _orientation: ActionsOrientation;\n\tprivate readonly _triggerKeys: {\n\t\tkeys: KeyCode[];\n\t\tkeyDown: boolean;\n\t};\n\n\t// View Items\n\tviewItems: IActionViewItem[];\n\tprivate readonly viewItemDisposables = this._register(new DisposableMap<IActionViewItem>());\n\tprivate previouslyFocusedItem?: number;\n\tprotected focusedItem?: number;\n\tprivate focusTracker: DOM.IFocusTracker;\n\n\t// Trigger Key Tracking\n\tprivate triggerKeyDown: boolean = false;\n\n\tprivate focusable: boolean = true;\n\n\t// Elements\n\tdomNode: HTMLElement;\n\tprotected readonly actionsList: HTMLElement;\n\n\tprivate readonly _onDidBlur = this._register(new Emitter<void>());\n\tget onDidBlur() { return this._onDidBlur.event; }\n\n\tprivate readonly _onDidCancel = this._register(new Emitter<void>({ onWillAddFirstListener: () => this.cancelHasListener = true }));\n\tget onDidCancel() { return this._onDidCancel.event; }\n\tprivate cancelHasListener = false;\n\n\tprivate readonly _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun() { return this._onDidRun.event; }\n\n\tprivate readonly _onWillRun = this._register(new Emitter<IRunEvent>());\n\tget onWillRun() { return this._onWillRun.event; }\n\n\tconstructor(container: HTMLElement, options: IActionBarOptions = {}) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis._context = options.context ?? null;\n\t\tthis._orientation = this.options.orientation ?? ActionsOrientation.HORIZONTAL;\n\t\tthis._triggerKeys = {\n\t\t\tkeyDown: this.options.triggerKeys?.keyDown ?? false,\n\t\t\tkeys: this.options.triggerKeys?.keys ?? [KeyCode.Enter, KeyCode.Space]\n\t\t};\n\n\t\tthis._hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());\n\n\t\tif (this.options.actionRunner) {\n\t\t\tthis._actionRunner = this.options.actionRunner;\n\t\t} else {\n\t\t\tthis._actionRunner = new ActionRunner();\n\t\t\tthis._actionRunnerDisposables.add(this._actionRunner);\n\t\t}\n\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\n\t\tthis.viewItems = [];\n\t\tthis.focusedItem = undefined;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'monaco-action-bar';\n\n\t\tlet previousKeys: KeyCode[];\n\t\tlet nextKeys: KeyCode[];\n\n\t\tswitch (this._orientation) {\n\t\t\tcase ActionsOrientation.HORIZONTAL:\n\t\t\t\tpreviousKeys = [KeyCode.LeftArrow];\n\t\t\t\tnextKeys = [KeyCode.RightArrow];\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL:\n\t\t\t\tpreviousKeys = [KeyCode.UpArrow];\n\t\t\t\tnextKeys = [KeyCode.DownArrow];\n\t\t\t\tthis.domNode.className += ' vertical';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = true;\n\t\t\tconst focusedItem = typeof this.focusedItem === 'number' ? this.viewItems[this.focusedItem] : undefined;\n\n\t\t\tif (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) {\n\t\t\t\teventHandled = this.focusPrevious();\n\t\t\t} else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) {\n\t\t\t\teventHandled = this.focusNext();\n\t\t\t} else if (event.equals(KeyCode.Escape) && this.cancelHasListener) {\n\t\t\t\tthis._onDidCancel.fire();\n\t\t\t} else if (event.equals(KeyCode.Home)) {\n\t\t\t\teventHandled = this.focusFirst();\n\t\t\t} else if (event.equals(KeyCode.End)) {\n\t\t\t\teventHandled = this.focusLast();\n\t\t\t} else if (event.equals(KeyCode.Tab) && focusedItem instanceof BaseActionViewItem && focusedItem.trapsArrowNavigation) {\n\t\t\t\t// Tab, so forcibly focus next #219199\n\t\t\t\teventHandled = this.focusNext(undefined, true);\n\t\t\t} else if (this.isTriggerKeyEvent(event)) {\n\t\t\t\t// Staying out of the else branch even if not triggered\n\t\t\t\tif (this._triggerKeys.keyDown) {\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerKeyDown = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\teventHandled = false;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t// Run action on Enter/Space\n\t\t\tif (this.isTriggerKeyEvent(event)) {\n\t\t\t\tif (!this._triggerKeys.keyDown && this.triggerKeyDown) {\n\t\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\n\t\t\t// Recompute focused item\n\t\t\telse if (event.equals(KeyCode.Tab) || event.equals(KeyMod.Shift | KeyCode.Tab) || event.equals(KeyCode.UpArrow) || event.equals(KeyCode.DownArrow) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow)) {\n\t\t\t\tthis.updateFocusedItem();\n\t\t\t}\n\t\t}));\n\n\t\tthis.focusTracker = this._register(DOM.trackFocus(this.domNode));\n\t\tthis._register(this.focusTracker.onDidBlur(() => {\n\t\t\tif (DOM.getActiveElement() === this.domNode || !DOM.isAncestor(DOM.getActiveElement(), this.domNode)) {\n\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t\tthis.focusedItem = undefined;\n\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem()));\n\n\t\tthis.actionsList = document.createElement('ul');\n\t\tthis.actionsList.className = 'actions-container';\n\t\tif (this.options.highlightToggledItems) {\n\t\t\tthis.actionsList.classList.add('highlight-toggled');\n\t\t}\n\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\n\t\tif (this.options.ariaLabel) {\n\t\t\tthis.actionsList.setAttribute('aria-label', this.options.ariaLabel);\n\t\t}\n\n\t\tthis.domNode.appendChild(this.actionsList);\n\n\t\tcontainer.appendChild(this.domNode);\n\t}\n\n\tprivate refreshRole(): void {\n\t\tif (this.length() >= 1) {\n\t\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\t\t} else {\n\t\t\tthis.actionsList.setAttribute('role', 'presentation');\n\t\t}\n\t}\n\n\t// Some action bars should not be focusable at times\n\t// When an action bar is not focusable make sure to make all the elements inside it not focusable\n\t// When an action bar is focusable again, make sure the first item can be focused\n\tsetFocusable(focusable: boolean): void {\n\t\tthis.focusable = focusable;\n\t\tif (this.focusable) {\n\t\t\tconst firstEnabled = this.viewItems.find(vi => vi instanceof BaseActionViewItem && vi.isEnabled());\n\t\t\tif (firstEnabled instanceof BaseActionViewItem) {\n\t\t\t\tfirstEnabled.setFocusable(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.viewItems.forEach(vi => {\n\t\t\t\tif (vi instanceof BaseActionViewItem) {\n\t\t\t\t\tvi.setFocusable(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate isTriggerKeyEvent(event: StandardKeyboardEvent): boolean {\n\t\tlet ret = false;\n\t\tthis._triggerKeys.keys.forEach(keyCode => {\n\t\t\tret = ret || event.equals(keyCode);\n\t\t});\n\n\t\treturn ret;\n\t}\n\n\tprivate updateFocusedItem(): void {\n\t\tfor (let i = 0; i < this.actionsList.children.length; i++) {\n\t\t\tconst elem = this.actionsList.children[i];\n\t\t\tif (DOM.isAncestor(DOM.getActiveElement(), elem)) {\n\t\t\t\tthis.focusedItem = i;\n\t\t\t\tthis.viewItems[this.focusedItem]?.showHover?.();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tget context(): unknown {\n\t\treturn this._context;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis._context = context;\n\t\tthis.viewItems.forEach(i => i.setActionContext(context));\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\n\t\t// when setting a new `IActionRunner` make sure to dispose old listeners and\n\t\t// start to forward events from the new listener\n\t\tthis._actionRunnerDisposables.clear();\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\t\tthis.viewItems.forEach(item => item.actionRunner = actionRunner);\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetAction(indexOrElement: number | HTMLElement): IAction | undefined {\n\n\t\t// by index\n\t\tif (typeof indexOrElement === 'number') {\n\t\t\treturn this.viewItems[indexOrElement]?.action;\n\t\t}\n\n\t\t// by element\n\t\tif (DOM.isHTMLElement(indexOrElement)) {\n\t\t\twhile (indexOrElement.parentElement !== this.actionsList) {\n\t\t\t\tif (!indexOrElement.parentElement) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tindexOrElement = indexOrElement.parentElement;\n\t\t\t}\n\t\t\tfor (let i = 0; i < this.actionsList.childNodes.length; i++) {\n\t\t\t\tif (this.actionsList.childNodes[i] === indexOrElement) {\n\t\t\t\t\treturn this.viewItems[i].action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpush(arg: IAction | ReadonlyArray<IAction>, options: IActionOptions = {}): void {\n\t\tconst actions: ReadonlyArray<IAction> = Array.isArray(arg) ? arg : [arg];\n\n\t\tlet index = types.isNumber(options.index) ? options.index : null;\n\n\t\tactions.forEach((action: IAction) => {\n\t\t\tconst actionViewItemElement = document.createElement('li');\n\t\t\tactionViewItemElement.className = 'action-item';\n\t\t\tactionViewItemElement.setAttribute('role', 'presentation');\n\n\t\t\tlet item: IActionViewItem | undefined;\n\n\t\t\tconst viewItemOptions: IActionViewItemOptions = { hoverDelegate: this._hoverDelegate, ...options, isTabList: this.options.ariaRole === 'tablist' };\n\t\t\tif (this.options.actionViewItemProvider) {\n\t\t\t\titem = this.options.actionViewItemProvider(action, viewItemOptions);\n\t\t\t}\n\n\t\t\tif (!item) {\n\t\t\t\titem = new ActionViewItem(this.context, action, viewItemOptions);\n\t\t\t}\n\n\t\t\t// Prevent native context menu on actions\n\t\t\tif (!this.options.allowContextMenu) {\n\t\t\t\tthis.viewItemDisposables.set(item, DOM.addDisposableListener(actionViewItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\titem.actionRunner = this._actionRunner;\n\t\t\titem.setActionContext(this.context);\n\t\t\titem.render(actionViewItemElement);\n\n\t\t\tif (index === null || index < 0 || index >= this.actionsList.children.length) {\n\t\t\t\tthis.actionsList.appendChild(actionViewItemElement);\n\t\t\t\tthis.viewItems.push(item);\n\t\t\t} else {\n\t\t\t\tthis.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]);\n\t\t\t\tthis.viewItems.splice(index, 0, item);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\n\t\t// We need to allow for the first enabled item to be focused on using tab navigation #106441\n\t\tif (this.focusable) {\n\t\t\tlet didFocus = false;\n\t\t\tfor (const item of this.viewItems) {\n\t\t\t\tif (!(item instanceof BaseActionViewItem)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet focus: boolean;\n\t\t\t\tif (didFocus) {\n\t\t\t\t\tfocus = false; // already focused an item\n\t\t\t\t} else if (item.action.id === Separator.ID) {\n\t\t\t\t\tfocus = false; // never focus a separator\n\t\t\t\t} else if (!item.isEnabled() && this.options.focusOnlyEnabledItems) {\n\t\t\t\t\tfocus = false; // never focus a disabled item\n\t\t\t\t} else {\n\t\t\t\t\tfocus = true;\n\t\t\t\t}\n\n\t\t\t\tif (focus) {\n\t\t\t\t\titem.setFocusable(true);\n\t\t\t\t\tdidFocus = true;\n\t\t\t\t} else {\n\t\t\t\t\titem.setFocusable(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof this.focusedItem === 'number') {\n\t\t\t// After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128\n\t\t\tthis.focus(this.focusedItem);\n\t\t}\n\t\tthis.refreshRole();\n\t}\n\n\tgetWidth(index: number): number {\n\t\tif (index >= 0 && index < this.actionsList.children.length) {\n\t\t\tconst item = this.actionsList.children.item(index);\n\t\t\tif (item) {\n\t\t\t\treturn item.clientWidth;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tpull(index: number): void {\n\t\tif (index >= 0 && index < this.viewItems.length) {\n\t\t\tthis.actionsList.childNodes[index].remove();\n\t\t\tthis.viewItemDisposables.deleteAndDispose(this.viewItems[index]);\n\t\t\tdispose(this.viewItems.splice(index, 1));\n\t\t\tthis.refreshRole();\n\t\t}\n\t}\n\n\tclear(): void {\n\t\tif (this.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.viewItemDisposables.clearAndDisposeAll();\n\t\tDOM.clearNode(this.actionsList);\n\t\tthis.refreshRole();\n\t}\n\n\tlength(): number {\n\t\treturn this.viewItems.length;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.viewItems.length === 0;\n\t}\n\n\tfocus(index?: number): void;\n\tfocus(selectFirst?: boolean): void;\n\tfocus(arg?: number | boolean): void {\n\t\tlet selectFirst: boolean = false;\n\t\tlet index: number | undefined = undefined;\n\t\tif (arg === undefined) {\n\t\t\tselectFirst = true;\n\t\t} else if (typeof arg === 'number') {\n\t\t\tindex = arg;\n\t\t} else if (typeof arg === 'boolean') {\n\t\t\tselectFirst = arg;\n\t\t}\n\n\t\tif (selectFirst && typeof this.focusedItem === 'undefined') {\n\t\t\tconst firstEnabled = this.viewItems.findIndex(item => item.isEnabled());\n\t\t\t// Focus the first enabled item\n\t\t\tthis.focusedItem = firstEnabled === -1 ? undefined : firstEnabled;\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t} else {\n\t\t\tif (index !== undefined) {\n\t\t\t\tthis.focusedItem = index;\n\t\t\t}\n\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t}\n\t}\n\n\tprivate focusFirst(): boolean {\n\t\tthis.focusedItem = this.length() - 1;\n\t\treturn this.focusNext(true);\n\t}\n\n\tprivate focusLast(): boolean {\n\t\tthis.focusedItem = 0;\n\t\treturn this.focusPrevious(true);\n\t}\n\n\tprotected focusNext(forceLoop?: boolean, forceFocus?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\t\tdo {\n\n\t\t\tif (!forceLoop && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) {\n\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.focusedItem = (this.focusedItem + 1) % this.viewItems.length;\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\t\tthis.updateFocus(undefined, undefined, forceFocus);\n\t\treturn true;\n\t}\n\n\tprotected focusPrevious(forceLoop?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = 0;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = this.focusedItem - 1;\n\t\t\tif (this.focusedItem < 0) {\n\t\t\t\tif (!forceLoop && this.options.preventLoopNavigation) {\n\t\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t\t}\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\n\t\tthis.updateFocus(true);\n\t\treturn true;\n\t}\n\n\tprotected updateFocus(fromRight?: boolean, preventScroll?: boolean, forceFocus: boolean = false): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t}\n\n\t\tif (this.previouslyFocusedItem !== undefined && this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\tthis.viewItems[this.previouslyFocusedItem]?.blur();\n\t\t}\n\t\tconst actionViewItem = this.focusedItem !== undefined ? this.viewItems[this.focusedItem] : undefined;\n\t\tif (actionViewItem) {\n\t\t\tlet focusItem = true;\n\n\t\t\tif (!types.isFunction(actionViewItem.focus)) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (this.options.focusOnlyEnabledItems && types.isFunction(actionViewItem.isEnabled) && !actionViewItem.isEnabled()) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (actionViewItem.action.id === Separator.ID) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\t\t\tif (!focusItem) {\n\t\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t\t\tthis.previouslyFocusedItem = undefined;\n\t\t\t} else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\t\tactionViewItem.focus(fromRight);\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t}\n\t\t\tif (focusItem) {\n\t\t\t\tactionViewItem.showHover?.();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate doTrigger(event: StandardKeyboardEvent): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\treturn; //nothing to focus\n\t\t}\n\n\t\t// trigger action\n\t\tconst actionViewItem = this.viewItems[this.focusedItem];\n\t\tif (actionViewItem instanceof BaseActionViewItem) {\n\t\t\tconst context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context;\n\t\t\tthis.run(actionViewItem._action, context);\n\t\t}\n\t}\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tawait this._actionRunner.run(action, context);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._context = undefined;\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.getContainer().remove();\n\t\tsuper.dispose();\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 * as DOM from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { ActionViewItem, BaseActionViewItem, IActionViewItemOptions } from './actionViewItems.js';\nimport { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { ActionRunner, IAction, IActionRunner, IRunEvent, Separator } from '../../../common/actions.js';\nimport { Emitter } from '../../../common/event.js';\nimport { KeyCode, KeyMod } from '../../../common/keyCodes.js';\nimport { Disposable, DisposableMap, DisposableStore, dispose, IDisposable } from '../../../common/lifecycle.js';\nimport * as types from '../../../common/types.js';\nimport './actionbar.css';\n\nexport interface IActionViewItem extends IDisposable {\n\taction: IAction;\n\tactionRunner: IActionRunner;\n\tsetActionContext(context: unknown): void;\n\trender(element: HTMLElement): void;\n\tisEnabled(): boolean;\n\tfocus(fromRight?: boolean): void; // TODO@isidorn what is this?\n\tblur(): void;\n\tshowHover?(): void;\n}\n\nexport interface IActionViewItemProvider {\n\t(action: IAction, options: IActionViewItemOptions): IActionViewItem | undefined;\n}\n\nexport const enum ActionsOrientation {\n\tHORIZONTAL,\n\tVERTICAL,\n}\n\nexport interface ActionTrigger {\n\tkeys?: KeyCode[];\n\tkeyDown: boolean;\n}\n\nexport interface IActionBarOptions {\n\treadonly orientation?: ActionsOrientation;\n\treadonly context?: unknown;\n\treadonly actionViewItemProvider?: IActionViewItemProvider;\n\treadonly actionRunner?: IActionRunner;\n\treadonly ariaLabel?: string;\n\treadonly ariaRole?: string;\n\treadonly triggerKeys?: ActionTrigger;\n\treadonly allowContextMenu?: boolean;\n\treadonly preventLoopNavigation?: boolean;\n\treadonly focusOnlyEnabledItems?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\t/**\n\t * If true, toggled primary items are highlighted with a background color.\n\t * Some action bars exclusively use icon states, we don't want to enable this for them.\n\t * Thus, this is opt-in.\n\t */\n\treadonly highlightToggledItems?: boolean;\n}\n\nexport interface IActionOptions extends IActionViewItemOptions {\n\tindex?: number;\n}\n\nexport class ActionBar extends Disposable implements IActionRunner {\n\n\tprivate readonly options: IActionBarOptions;\n\tprivate readonly _hoverDelegate: IHoverDelegate;\n\n\tprivate _actionRunner: IActionRunner;\n\tprivate readonly _actionRunnerDisposables = this._register(new DisposableStore());\n\tprivate _context: unknown;\n\tprivate readonly _orientation: ActionsOrientation;\n\tprivate readonly _triggerKeys: {\n\t\tkeys: KeyCode[];\n\t\tkeyDown: boolean;\n\t};\n\n\t// View Items\n\tviewItems: IActionViewItem[];\n\tprivate readonly viewItemDisposables = this._register(new DisposableMap<IActionViewItem>());\n\tprivate previouslyFocusedItem?: number;\n\tprotected focusedItem?: number;\n\tprivate focusTracker: DOM.IFocusTracker;\n\n\t// Trigger Key Tracking\n\tprivate triggerKeyDown: boolean = false;\n\n\tprivate focusable: boolean = true;\n\n\t// Elements\n\tdomNode: HTMLElement;\n\tprotected readonly actionsList: HTMLElement;\n\n\tprivate readonly _onDidBlur = this._register(new Emitter<void>());\n\tget onDidBlur() { return this._onDidBlur.event; }\n\n\tprivate readonly _onDidCancel = this._register(new Emitter<void>({ onWillAddFirstListener: () => this.cancelHasListener = true }));\n\tget onDidCancel() { return this._onDidCancel.event; }\n\tprivate cancelHasListener = false;\n\n\tprivate readonly _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun() { return this._onDidRun.event; }\n\n\tprivate readonly _onWillRun = this._register(new Emitter<IRunEvent>());\n\tget onWillRun() { return this._onWillRun.event; }\n\n\tconstructor(container: HTMLElement, options: IActionBarOptions = {}) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\t\tthis._context = options.context ?? null;\n\t\tthis._orientation = this.options.orientation ?? ActionsOrientation.HORIZONTAL;\n\t\tthis._triggerKeys = {\n\t\t\tkeyDown: this.options.triggerKeys?.keyDown ?? false,\n\t\t\tkeys: this.options.triggerKeys?.keys ?? [KeyCode.Enter, KeyCode.Space]\n\t\t};\n\n\t\tthis._hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());\n\n\t\tif (this.options.actionRunner) {\n\t\t\tthis._actionRunner = this.options.actionRunner;\n\t\t} else {\n\t\t\tthis._actionRunner = new ActionRunner();\n\t\t\tthis._actionRunnerDisposables.add(this._actionRunner);\n\t\t}\n\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\n\t\tthis.viewItems = [];\n\t\tthis.focusedItem = undefined;\n\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.className = 'monaco-action-bar';\n\n\t\tlet previousKeys: KeyCode[];\n\t\tlet nextKeys: KeyCode[];\n\n\t\tswitch (this._orientation) {\n\t\t\tcase ActionsOrientation.HORIZONTAL:\n\t\t\t\tpreviousKeys = [KeyCode.LeftArrow];\n\t\t\t\tnextKeys = [KeyCode.RightArrow];\n\t\t\t\tbreak;\n\t\t\tcase ActionsOrientation.VERTICAL:\n\t\t\t\tpreviousKeys = [KeyCode.UpArrow];\n\t\t\t\tnextKeys = [KeyCode.DownArrow];\n\t\t\t\tthis.domNode.className += ' vertical';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = true;\n\t\t\tconst focusedItem = typeof this.focusedItem === 'number' ? this.viewItems[this.focusedItem] : undefined;\n\n\t\t\tif (previousKeys && (event.equals(previousKeys[0]) || event.equals(previousKeys[1]))) {\n\t\t\t\teventHandled = this.focusPrevious();\n\t\t\t} else if (nextKeys && (event.equals(nextKeys[0]) || event.equals(nextKeys[1]))) {\n\t\t\t\teventHandled = this.focusNext();\n\t\t\t} else if (event.equals(KeyCode.Escape) && this.cancelHasListener) {\n\t\t\t\tthis._onDidCancel.fire();\n\t\t\t} else if (event.equals(KeyCode.Home)) {\n\t\t\t\teventHandled = this.focusFirst();\n\t\t\t} else if (event.equals(KeyCode.End)) {\n\t\t\t\teventHandled = this.focusLast();\n\t\t\t} else if (event.equals(KeyCode.Tab) && focusedItem instanceof BaseActionViewItem && focusedItem.trapsArrowNavigation) {\n\t\t\t\t// Tab, so forcibly focus next #219199\n\t\t\t\teventHandled = this.focusNext(undefined, true);\n\t\t\t} else if (this.isTriggerKeyEvent(event)) {\n\t\t\t\t// Staying out of the else branch even if not triggered\n\t\t\t\tif (this._triggerKeys.keyDown) {\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerKeyDown = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\teventHandled = false;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(DOM.addDisposableListener(this.domNode, DOM.EventType.KEY_UP, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\n\t\t\t// Run action on Enter/Space\n\t\t\tif (this.isTriggerKeyEvent(event)) {\n\t\t\t\tif (!this._triggerKeys.keyDown && this.triggerKeyDown) {\n\t\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t\t\tthis.doTrigger(event);\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t}\n\n\t\t\t// Recompute focused item\n\t\t\telse if (event.equals(KeyCode.Tab) || event.equals(KeyMod.Shift | KeyCode.Tab) || event.equals(KeyCode.UpArrow) || event.equals(KeyCode.DownArrow) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow)) {\n\t\t\t\tthis.updateFocusedItem();\n\t\t\t}\n\t\t}));\n\n\t\tthis.focusTracker = this._register(DOM.trackFocus(this.domNode));\n\t\tthis._register(this.focusTracker.onDidBlur(() => {\n\t\t\tif (DOM.getActiveElement() === this.domNode || !DOM.isAncestor(DOM.getActiveElement(), this.domNode)) {\n\t\t\t\tthis._onDidBlur.fire();\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t\tthis.focusedItem = undefined;\n\t\t\t\tthis.triggerKeyDown = false;\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this.focusTracker.onDidFocus(() => this.updateFocusedItem()));\n\n\t\tthis.actionsList = document.createElement('ul');\n\t\tthis.actionsList.className = 'actions-container';\n\t\tif (this.options.highlightToggledItems) {\n\t\t\tthis.actionsList.classList.add('highlight-toggled');\n\t\t}\n\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\n\t\tif (this.options.ariaLabel) {\n\t\t\tthis.actionsList.setAttribute('aria-label', this.options.ariaLabel);\n\t\t}\n\n\t\tthis.domNode.appendChild(this.actionsList);\n\n\t\tcontainer.appendChild(this.domNode);\n\t}\n\n\tprivate refreshRole(): void {\n\t\tif (this.length() >= 1) {\n\t\t\tthis.actionsList.setAttribute('role', this.options.ariaRole || 'toolbar');\n\t\t} else {\n\t\t\tthis.actionsList.setAttribute('role', 'presentation');\n\t\t}\n\t}\n\n\t// Some action bars should not be focusable at times\n\t// When an action bar is not focusable make sure to make all the elements inside it not focusable\n\t// When an action bar is focusable again, make sure the first item can be focused\n\tsetFocusable(focusable: boolean): void {\n\t\tthis.focusable = focusable;\n\t\tif (this.focusable) {\n\t\t\tconst firstEnabled = this.viewItems.find(vi => vi instanceof BaseActionViewItem && vi.isEnabled());\n\t\t\tif (firstEnabled instanceof BaseActionViewItem) {\n\t\t\t\tfirstEnabled.setFocusable(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.viewItems.forEach(vi => {\n\t\t\t\tif (vi instanceof BaseActionViewItem) {\n\t\t\t\t\tvi.setFocusable(false);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate isTriggerKeyEvent(event: StandardKeyboardEvent): boolean {\n\t\tlet ret = false;\n\t\tthis._triggerKeys.keys.forEach(keyCode => {\n\t\t\tret = ret || event.equals(keyCode);\n\t\t});\n\n\t\treturn ret;\n\t}\n\n\tprivate updateFocusedItem(): void {\n\t\tfor (let i = 0; i < this.actionsList.children.length; i++) {\n\t\t\tconst elem = this.actionsList.children[i];\n\t\t\tif (DOM.isAncestor(DOM.getActiveElement(), elem)) {\n\t\t\t\tthis.focusedItem = i;\n\t\t\t\tthis.viewItems[this.focusedItem]?.showHover?.();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tget context(): unknown {\n\t\treturn this._context;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis._context = context;\n\t\tthis.viewItems.forEach(i => i.setActionContext(context));\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\n\t\t// when setting a new `IActionRunner` make sure to dispose old listeners and\n\t\t// start to forward events from the new listener\n\t\tthis._actionRunnerDisposables.clear();\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onDidRun(e => this._onDidRun.fire(e)));\n\t\tthis._actionRunnerDisposables.add(this._actionRunner.onWillRun(e => this._onWillRun.fire(e)));\n\t\tthis.viewItems.forEach(item => item.actionRunner = actionRunner);\n\t}\n\n\tgetContainer(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\tgetAction(indexOrElement: number | HTMLElement): IAction | undefined {\n\n\t\t// by index\n\t\tif (typeof indexOrElement === 'number') {\n\t\t\treturn this.viewItems[indexOrElement]?.action;\n\t\t}\n\n\t\t// by element\n\t\tif (DOM.isHTMLElement(indexOrElement)) {\n\t\t\twhile (indexOrElement.parentElement !== this.actionsList) {\n\t\t\t\tif (!indexOrElement.parentElement) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tindexOrElement = indexOrElement.parentElement;\n\t\t\t}\n\t\t\tfor (let i = 0; i < this.actionsList.childNodes.length; i++) {\n\t\t\t\tif (this.actionsList.childNodes[i] === indexOrElement) {\n\t\t\t\t\treturn this.viewItems[i].action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpush(arg: IAction | ReadonlyArray<IAction>, options: IActionOptions = {}): void {\n\t\tconst actions: ReadonlyArray<IAction> = Array.isArray(arg) ? arg : [arg];\n\n\t\tlet index = types.isNumber(options.index) ? options.index : null;\n\n\t\tactions.forEach((action: IAction) => {\n\t\t\tconst actionViewItemElement = document.createElement('li');\n\t\t\tactionViewItemElement.className = 'action-item';\n\t\t\tactionViewItemElement.setAttribute('role', 'presentation');\n\n\t\t\tlet item: IActionViewItem | undefined;\n\n\t\t\tconst viewItemOptions: IActionViewItemOptions = { hoverDelegate: this._hoverDelegate, ...options, isTabList: this.options.ariaRole === 'tablist' };\n\t\t\tif (this.options.actionViewItemProvider) {\n\t\t\t\titem = this.options.actionViewItemProvider(action, viewItemOptions);\n\t\t\t}\n\n\t\t\tif (!item) {\n\t\t\t\titem = new ActionViewItem(this.context, action, viewItemOptions);\n\t\t\t}\n\n\t\t\t// Prevent native context menu on actions\n\t\t\tif (!this.options.allowContextMenu) {\n\t\t\t\tthis.viewItemDisposables.set(item, DOM.addDisposableListener(actionViewItemElement, DOM.EventType.CONTEXT_MENU, (e: DOM.EventLike) => {\n\t\t\t\t\tDOM.EventHelper.stop(e, true);\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\titem.actionRunner = this._actionRunner;\n\t\t\titem.setActionContext(this.context);\n\t\t\titem.render(actionViewItemElement);\n\n\t\t\tif (index === null || index < 0 || index >= this.actionsList.children.length) {\n\t\t\t\tthis.actionsList.appendChild(actionViewItemElement);\n\t\t\t\tthis.viewItems.push(item);\n\t\t\t} else {\n\t\t\t\tthis.actionsList.insertBefore(actionViewItemElement, this.actionsList.children[index]);\n\t\t\t\tthis.viewItems.splice(index, 0, item);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\n\t\t// We need to allow for the first enabled item to be focused on using tab navigation #106441\n\t\tif (this.focusable) {\n\t\t\tlet didFocus = false;\n\t\t\tfor (const item of this.viewItems) {\n\t\t\t\tif (!(item instanceof BaseActionViewItem)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet focus: boolean;\n\t\t\t\tif (didFocus) {\n\t\t\t\t\tfocus = false; // already focused an item\n\t\t\t\t} else if (item.action.id === Separator.ID) {\n\t\t\t\t\tfocus = false; // never focus a separator\n\t\t\t\t} else if (!item.isEnabled() && this.options.focusOnlyEnabledItems) {\n\t\t\t\t\tfocus = false; // never focus a disabled item\n\t\t\t\t} else {\n\t\t\t\t\tfocus = true;\n\t\t\t\t}\n\n\t\t\t\tif (focus) {\n\t\t\t\t\titem.setFocusable(true);\n\t\t\t\t\tdidFocus = true;\n\t\t\t\t} else {\n\t\t\t\t\titem.setFocusable(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (typeof this.focusedItem === 'number') {\n\t\t\t// After a clear actions might be re-added to simply toggle some actions. We should preserve focus #97128\n\t\t\tthis.focus(this.focusedItem);\n\t\t}\n\t\tthis.refreshRole();\n\t}\n\n\tgetWidth(index: number): number {\n\t\tif (index >= 0 && index < this.actionsList.children.length) {\n\t\t\tconst item = this.actionsList.children.item(index);\n\t\t\tif (item) {\n\t\t\t\treturn item.clientWidth;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n\n\tpull(index: number): void {\n\t\tif (index >= 0 && index < this.viewItems.length) {\n\t\t\tthis.actionsList.childNodes[index].remove();\n\t\t\tthis.viewItemDisposables.deleteAndDispose(this.viewItems[index]);\n\t\t\tdispose(this.viewItems.splice(index, 1));\n\t\t\tthis.refreshRole();\n\t\t}\n\t}\n\n\tclear(): void {\n\t\tif (this.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.viewItemDisposables.clearAndDisposeAll();\n\t\tDOM.clearNode(this.actionsList);\n\t\tthis.refreshRole();\n\t}\n\n\tlength(): number {\n\t\treturn this.viewItems.length;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.viewItems.length === 0;\n\t}\n\n\tfocus(index?: number): void;\n\tfocus(selectFirst?: boolean): void;\n\tfocus(arg?: number | boolean): void {\n\t\tlet selectFirst: boolean = false;\n\t\tlet index: number | undefined = undefined;\n\t\tif (arg === undefined) {\n\t\t\tselectFirst = true;\n\t\t} else if (typeof arg === 'number') {\n\t\t\tindex = arg;\n\t\t} else if (typeof arg === 'boolean') {\n\t\t\tselectFirst = arg;\n\t\t}\n\n\t\tif (selectFirst && typeof this.focusedItem === 'undefined') {\n\t\t\tconst firstEnabled = this.viewItems.findIndex(item => item.isEnabled());\n\t\t\t// Focus the first enabled item\n\t\t\tthis.focusedItem = firstEnabled === -1 ? undefined : firstEnabled;\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t} else {\n\t\t\tif (index !== undefined) {\n\t\t\t\tthis.focusedItem = index;\n\t\t\t}\n\n\t\t\tthis.updateFocus(undefined, undefined, true);\n\t\t}\n\t}\n\n\tprivate focusFirst(): boolean {\n\t\tthis.focusedItem = this.length() - 1;\n\t\treturn this.focusNext(true);\n\t}\n\n\tprivate focusLast(): boolean {\n\t\tthis.focusedItem = 0;\n\t\treturn this.focusPrevious(true);\n\t}\n\n\tprotected focusNext(forceLoop?: boolean, forceFocus?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\t\tdo {\n\n\t\t\tif (!forceLoop && this.options.preventLoopNavigation && this.focusedItem + 1 >= this.viewItems.length) {\n\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tthis.focusedItem = (this.focusedItem + 1) % this.viewItems.length;\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\t\tthis.updateFocus(undefined, undefined, forceFocus);\n\t\treturn true;\n\t}\n\n\tprotected focusPrevious(forceLoop?: boolean): boolean {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.focusedItem = 0;\n\t\t} else if (this.viewItems.length <= 1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst startIndex = this.focusedItem;\n\t\tlet item: IActionViewItem;\n\n\t\tdo {\n\t\t\tthis.focusedItem = this.focusedItem - 1;\n\t\t\tif (this.focusedItem < 0) {\n\t\t\t\tif (!forceLoop && this.options.preventLoopNavigation) {\n\t\t\t\t\tthis.focusedItem = startIndex;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tthis.focusedItem = this.viewItems.length - 1;\n\t\t\t}\n\t\t\titem = this.viewItems[this.focusedItem];\n\t\t} while (this.focusedItem !== startIndex && ((this.options.focusOnlyEnabledItems && !item.isEnabled()) || item.action.id === Separator.ID));\n\n\n\t\tthis.updateFocus(true);\n\t\treturn true;\n\t}\n\n\tprotected updateFocus(fromRight?: boolean, preventScroll?: boolean, forceFocus: boolean = false): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t}\n\n\t\tif (this.previouslyFocusedItem !== undefined && this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\tthis.viewItems[this.previouslyFocusedItem]?.blur();\n\t\t}\n\t\tconst actionViewItem = this.focusedItem !== undefined ? this.viewItems[this.focusedItem] : undefined;\n\t\tif (actionViewItem) {\n\t\t\tlet focusItem = true;\n\n\t\t\tif (!types.isFunction(actionViewItem.focus)) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (this.options.focusOnlyEnabledItems && types.isFunction(actionViewItem.isEnabled) && !actionViewItem.isEnabled()) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\n\t\t\tif (actionViewItem.action.id === Separator.ID) {\n\t\t\t\tfocusItem = false;\n\t\t\t}\n\t\t\tif (!focusItem) {\n\t\t\t\tthis.actionsList.focus({ preventScroll });\n\t\t\t\tthis.previouslyFocusedItem = undefined;\n\t\t\t} else if (forceFocus || this.previouslyFocusedItem !== this.focusedItem) {\n\t\t\t\tactionViewItem.focus(fromRight);\n\t\t\t\tthis.previouslyFocusedItem = this.focusedItem;\n\t\t\t}\n\t\t\tif (focusItem) {\n\t\t\t\tactionViewItem.showHover?.();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate doTrigger(event: StandardKeyboardEvent): void {\n\t\tif (typeof this.focusedItem === 'undefined') {\n\t\t\treturn; //nothing to focus\n\t\t}\n\n\t\t// trigger action\n\t\tconst actionViewItem = this.viewItems[this.focusedItem];\n\t\tif (actionViewItem instanceof BaseActionViewItem) {\n\t\t\tconst context = (actionViewItem._context === null || actionViewItem._context === undefined) ? event : actionViewItem._context;\n\t\t\tthis.run(actionViewItem._action, context);\n\t\t}\n\t}\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tawait this._actionRunner.run(action, context);\n\t}\n\n\toverride dispose(): void {\n\t\tthis._context = undefined;\n\t\tthis.viewItems = dispose(this.viewItems);\n\t\tthis.getContainer().remove();\n\t\tsuper.dispose();\n\t}\n}\n"]}
@@ -119,7 +119,8 @@ export class IconLabel extends Disposable {
119
119
  if (description || this.descriptionNode) {
120
120
  const descriptionNode = this.getOrCreateDescriptionNode();
121
121
  if (descriptionNode instanceof HighlightedLabel) {
122
- descriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, options?.supportIcons);
122
+ const supportIcons = options?.supportIcons ?? this.creationOptions?.supportIcons;
123
+ descriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, supportIcons);
123
124
  this.setupHover(descriptionNode.element, options?.descriptionTitle);
124
125
  }
125
126
  else {
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabel.ts","vs/base/browser/ui/iconLabel/iconLabel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,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nt/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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\tbold?: boolean;\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n\tsupportIcons?: boolean;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.bold) {\n\t\t\t\tlabelClasses.push('bold');\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, options?.supportIcons);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\t// Determine supportIcons: use option if provided, otherwise use constructor value\n\t\tconst supportIcons = options?.supportIcons ?? this.supportIcons;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\tbold?: boolean;\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n\tsupportIcons?: boolean;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.bold) {\n\t\t\t\tlabelClasses.push('bold');\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, options?.supportIcons);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\t// Determine supportIcons: use option if provided, otherwise use constructor value\n\t\tconst supportIcons = options?.supportIcons ?? this.supportIcons;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabel.ts","vs/base/browser/ui/iconLabel/iconLabel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AA6BvE,MAAM,aAAa;IAMlB,YAAoB,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;IACzC,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,IAAI,WAAW,CAAC,OAAe;QAC9B,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;YAC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CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC3C,MAAM,EAAE,GAAG,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;gBAEtD,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,uBAAuB,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAClI,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChG,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,YAAY,CAAC,CAAC;gBAElF,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,sBAAsB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;gBACvE,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;CACD","file":"iconLabel.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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\tbold?: boolean;\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n\tsupportIcons?: boolean;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.bold) {\n\t\t\t\tlabelClasses.push('bold');\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tconst supportIcons = options?.supportIcons ?? this.creationOptions?.supportIcons;\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\t// Determine supportIcons: use option if provided, otherwise use constructor value\n\t\tconst supportIcons = options?.supportIcons ?? this.supportIcons;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\tbold?: boolean;\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n\tsupportIcons?: boolean;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.bold) {\n\t\t\t\tlabelClasses.push('bold');\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tconst supportIcons = options?.supportIcons ?? this.creationOptions?.supportIcons;\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\t// Determine supportIcons: use option if provided, otherwise use constructor value\n\t\tconst supportIcons = options?.supportIcons ?? this.supportIcons;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -59,6 +59,10 @@
59
59
  box-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;
60
60
  }
61
61
 
62
+ .monaco-scrollable-element > .scrollbar {
63
+ background: var(--vscode-scrollbar-background);
64
+ }
65
+
62
66
  .monaco-scrollable-element > .scrollbar > .slider {
63
67
  background: var(--vscode-scrollbarSlider-background);
64
68
  }
@@ -11,3 +11,14 @@
11
11
  display: inline-block;
12
12
  padding: 0;
13
13
  }
14
+
15
+ .monaco-toolbar.responsive {
16
+ .monaco-action-bar > .actions-container > .action-item {
17
+ flex-shrink: 0;
18
+ min-width: 20px;
19
+ }
20
+
21
+ .monaco-action-bar > .actions-container > .action-item.responsive {
22
+ flex-shrink: 10000 !important;
23
+ }
24
+ }