monaco-editor-core 0.53.0 → 0.54.0-dev-20250910
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +0 -2
- package/esm/vs/base/browser/domSanitize.js +18 -8
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/domStylesheets.js +3 -0
- package/esm/vs/base/browser/domStylesheets.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/dropdown/dropdown.js +1 -2
- package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
- package/esm/vs/base/common/async.js +6 -173
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/fuzzyScorer.js +6 -3
- package/esm/vs/base/common/fuzzyScorer.js.map +1 -1
- package/esm/vs/base/common/strings.js +0 -3
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +23 -13
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js.map +1 -1
- package/esm/vs/editor/browser/services/hoverService/hover.css +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +1 -1
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/viewModel/screenReaderSimpleModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +9 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +15 -10
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css +13 -4
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +5 -4
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js.map +1 -1
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +1 -1
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionList.js +2 -2
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +11 -12
- package/esm/vs/platform/actions/browser/actionViewItemService.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +3 -3
- package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkeys.js +1 -2
- package/esm/vs/platform/contextkey/common/contextkeys.js.map +1 -1
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +3 -3
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +15 -15
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
- package/version.txt +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/platform/actionWidget/browser/actionList.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAE9F,OAAO,EAA8B,IAAI,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAqB,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,kCA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,CAAC,CAAC,SAAS,CAAC;YAC7D,CAAC;YACD,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;gBACb,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;YAC1C,CAAC;QACF,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAEO,WAAW,CAAC,CAAsC;QACzD,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;CACD,CAAA;AAhNY,UAAU;IAoBpB,WAAA,mBAAmB,CAAA;IACnB,WAAA,kBAAkB,CAAA;IAClB,WAAA,cAAc,CAAA;GAtBJ,UAAU,CAgNtB;;AAED,SAAS,aAAa,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC","file":"actionList.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 *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../../../base/browser/dom.js';\nimport { KeybindingLabel } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js';\nimport { IListEvent, IListMouseEvent, IListRenderer, IListVirtualDelegate } from '../../../base/browser/ui/list/list.js';\nimport { IListAccessibilityProvider, List } from '../../../base/browser/ui/list/listWidget.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js';\nimport { Codicon } from '../../../base/common/codicons.js';\nimport { ResolvedKeybinding } from '../../../base/common/keybindings.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { OS } from '../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../base/common/themables.js';\nimport './actionWidget.css';\nimport { localize } from '../../../nls.js';\nimport { IContextViewService } from '../../contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { defaultListStyles } from '../../theme/browser/defaultStyles.js';\nimport { asCssVariable } from '../../theme/common/colorRegistry.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\n\nexport const acceptSelectedActionCommand = 'acceptSelectedCodeAction';\nexport const previewSelectedActionCommand = 'previewSelectedCodeAction';\n\nexport interface IActionListDelegate<T> {\n\tonHide(didCancel?: boolean): void;\n\tonSelect(action: T, preview?: boolean): void;\n\tonHover?(action: T, cancellationToken: CancellationToken): Promise<{ canPreview: boolean } | void>;\n\tonFocus?(action: T | undefined): void;\n}\n\nexport interface IActionListItem<T> {\n\treadonly item?: T;\n\treadonly kind: ActionListItemKind;\n\treadonly group?: { kind?: any; icon?: ThemeIcon; title: string };\n\treadonly disabled?: boolean;\n\treadonly label?: string;\n\treadonly description?: string;\n\treadonly keybinding?: ResolvedKeybinding;\n\tcanPreview?: boolean | undefined;\n\treadonly hideIcon?: boolean;\n\treadonly tooltip?: string;\n}\n\ninterface IActionMenuTemplateData {\n\treadonly container: HTMLElement;\n\treadonly icon: HTMLElement;\n\treadonly text: HTMLElement;\n\treadonly description?: HTMLElement;\n\treadonly keybinding: KeybindingLabel;\n}\n\nexport const enum ActionListItemKind {\n\tAction = 'action',\n\tHeader = 'header',\n\tSeparator = 'separator'\n}\n\ninterface IHeaderTemplateData {\n\treadonly container: HTMLElement;\n\treadonly text: HTMLElement;\n}\n\nclass HeaderRenderer<T> implements IListRenderer<IActionListItem<T>, IHeaderTemplateData> {\n\n\tget templateId(): string { return ActionListItemKind.Header; }\n\n\trenderTemplate(container: HTMLElement): IHeaderTemplateData {\n\t\tcontainer.classList.add('group-header');\n\n\t\tconst text = document.createElement('span');\n\t\tcontainer.append(text);\n\n\t\treturn { container, text };\n\t}\n\n\trenderElement(element: IActionListItem<T>, _index: number, templateData: IHeaderTemplateData): void {\n\t\ttemplateData.text.textContent = element.group?.title ?? element.label ?? '';\n\t}\n\n\tdisposeTemplate(_templateData: IHeaderTemplateData): void {\n\t\t// noop\n\t}\n}\n\ninterface ISeparatorTemplateData {\n\treadonly container: HTMLElement;\n\treadonly text: HTMLElement;\n}\n\nclass SeparatorRenderer<T> implements IListRenderer<IActionListItem<T>, ISeparatorTemplateData> {\n\n\tget templateId(): string { return ActionListItemKind.Separator; }\n\n\trenderTemplate(container: HTMLElement): ISeparatorTemplateData {\n\t\tcontainer.classList.add('separator');\n\n\t\tconst text = document.createElement('span');\n\t\tcontainer.append(text);\n\n\t\treturn { container, text };\n\t}\n\n\trenderElement(element: IActionListItem<T>, _index: number, templateData: ISeparatorTemplateData): void {\n\t\ttemplateData.text.textContent = element.label ?? '';\n\t}\n\n\tdisposeTemplate(_templateData: ISeparatorTemplateData): void {\n\t\t// noop\n\t}\n}\n\nclass ActionItemRenderer<T> implements IListRenderer<IActionListItem<T>, IActionMenuTemplateData> {\n\n\tget templateId(): string { return ActionListItemKind.Action; }\n\n\tconstructor(\n\t\tprivate readonly _supportsPreview: boolean,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) { }\n\n\trenderTemplate(container: HTMLElement): IActionMenuTemplateData {\n\t\tcontainer.classList.add(this.templateId);\n\n\t\tconst icon = document.createElement('div');\n\t\ticon.className = 'icon';\n\t\tcontainer.append(icon);\n\n\t\tconst text = document.createElement('span');\n\t\ttext.className = 'title';\n\t\tcontainer.append(text);\n\n\t\tconst description = document.createElement('span');\n\t\tdescription.className = 'description';\n\t\tcontainer.append(description);\n\n\t\tconst keybinding = new KeybindingLabel(container, OS);\n\n\t\treturn { container, icon, text, description, keybinding };\n\t}\n\n\trenderElement(element: IActionListItem<T>, _index: number, data: IActionMenuTemplateData): void {\n\t\tif (element.group?.icon) {\n\t\t\tdata.icon.className = ThemeIcon.asClassName(element.group.icon);\n\t\t\tif (element.group.icon.color) {\n\t\t\t\tdata.icon.style.color = asCssVariable(element.group.icon.color.id);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.icon.className = ThemeIcon.asClassName(Codicon.lightBulb);\n\t\t\tdata.icon.style.color = 'var(--vscode-editorLightBulb-foreground)';\n\t\t}\n\n\t\tif (!element.item || !element.label) {\n\t\t\treturn;\n\t\t}\n\n\t\tdom.setVisibility(!element.hideIcon, data.icon);\n\n\t\tdata.text.textContent = stripNewlines(element.label);\n\n\t\t// if there is a keybinding, prioritize over description for now\n\t\tif (element.keybinding) {\n\t\t\tdata.description!.textContent = element.keybinding.getLabel();\n\t\t\tdata.description!.style.display = 'inline';\n\t\t\tdata.description!.style.letterSpacing = '0.5px';\n\t\t} else if (element.description) {\n\t\t\tdata.description!.textContent = stripNewlines(element.description);\n\t\t\tdata.description!.style.display = 'inline';\n\t\t} else {\n\t\t\tdata.description!.textContent = '';\n\t\t\tdata.description!.style.display = 'none';\n\t\t}\n\n\t\tconst actionTitle = this._keybindingService.lookupKeybinding(acceptSelectedActionCommand)?.getLabel();\n\t\tconst previewTitle = this._keybindingService.lookupKeybinding(previewSelectedActionCommand)?.getLabel();\n\t\tdata.container.classList.toggle('option-disabled', element.disabled);\n\t\tif (element.tooltip) {\n\t\t\tdata.container.title = element.tooltip;\n\t\t} else if (element.disabled) {\n\t\t\tdata.container.title = element.label;\n\t\t} else if (actionTitle && previewTitle) {\n\t\t\tif (this._supportsPreview && element.canPreview) {\n\t\t\t\tdata.container.title = localize({ key: 'label-preview', comment: ['placeholders are keybindings, e.g \"F2 to Apply, Shift+F2 to Preview\"'] }, \"{0} to Apply, {1} to Preview\", actionTitle, previewTitle);\n\t\t\t} else {\n\t\t\t\tdata.container.title = localize({ key: 'label', comment: ['placeholder is a keybinding, e.g \"F2 to Apply\"'] }, \"{0} to Apply\", actionTitle);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.container.title = '';\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: IActionMenuTemplateData): void {\n\t\ttemplateData.keybinding.dispose();\n\t}\n}\n\nclass AcceptSelectedEvent extends UIEvent {\n\tconstructor() { super('acceptSelectedAction'); }\n}\n\nclass PreviewSelectedEvent extends UIEvent {\n\tconstructor() { super('previewSelectedAction'); }\n}\n\nfunction getKeyboardNavigationLabel<T>(item: IActionListItem<T>): string | undefined {\n\t// Filter out header vs. action vs. separator\n\tif (item.kind === 'action') {\n\t\treturn item.label;\n\t}\n\treturn undefined;\n}\n\nexport class ActionList<T> extends Disposable {\n\n\tpublic readonly domNode: HTMLElement;\n\n\tprivate readonly _list: List<IActionListItem<T>>;\n\n\tprivate readonly _actionLineHeight = 24;\n\tprivate readonly _headerLineHeight = 26;\n\tprivate readonly _separatorLineHeight = 8;\n\n\tprivate readonly _allMenuItems: readonly IActionListItem<T>[];\n\n\tprivate readonly cts = this._register(new CancellationTokenSource());\n\n\tconstructor(\n\t\tuser: string,\n\t\tpreview: boolean,\n\t\titems: readonly IActionListItem<T>[],\n\t\tprivate readonly _delegate: IActionListDelegate<T>,\n\t\taccessibilityProvider: Partial<IListAccessibilityProvider<IActionListItem<T>>> | undefined,\n\t\t@IContextViewService private readonly _contextViewService: IContextViewService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t) {\n\t\tsuper();\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.classList.add('actionList');\n\t\tconst virtualDelegate: IListVirtualDelegate<IActionListItem<T>> = {\n\t\t\tgetHeight: element => {\n\t\t\t\tswitch (element.kind) {\n\t\t\t\t\tcase ActionListItemKind.Header:\n\t\t\t\t\t\treturn this._headerLineHeight;\n\t\t\t\t\tcase ActionListItemKind.Separator:\n\t\t\t\t\t\treturn this._separatorLineHeight;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn this._actionLineHeight;\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetTemplateId: element => element.kind\n\t\t};\n\n\n\t\tthis._list = this._register(new List(user, this.domNode, virtualDelegate, [\n\t\t\tnew ActionItemRenderer<IActionListItem<T>>(preview, this._keybindingService),\n\t\t\tnew HeaderRenderer(),\n\t\t\tnew SeparatorRenderer(),\n\t\t], {\n\t\t\tkeyboardSupport: false,\n\t\t\ttypeNavigationEnabled: true,\n\t\t\tkeyboardNavigationLabelProvider: { getKeyboardNavigationLabel },\n\t\t\taccessibilityProvider: {\n\t\t\t\tgetAriaLabel: element => {\n\t\t\t\t\tif (element.kind === ActionListItemKind.Action) {\n\t\t\t\t\t\tlet label = element.label ? stripNewlines(element?.label) : '';\n\t\t\t\t\t\tif (element.disabled) {\n\t\t\t\t\t\t\tlabel = localize({ key: 'customQuickFixWidget.labels', comment: [`Action widget labels for accessibility.`] }, \"{0}, Disabled Reason: {1}\", label, element.disabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn label;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t},\n\t\t\t\tgetWidgetAriaLabel: () => localize({ key: 'customQuickFixWidget', comment: [`An action widget option`] }, \"Action Widget\"),\n\t\t\t\tgetRole: (e) => {\n\t\t\t\t\tswitch (e.kind) {\n\t\t\t\t\t\tcase ActionListItemKind.Action:\n\t\t\t\t\t\t\treturn 'option';\n\t\t\t\t\t\tcase ActionListItemKind.Separator:\n\t\t\t\t\t\t\treturn 'separator';\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn 'separator';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetWidgetRole: () => 'listbox',\n\t\t\t\t...accessibilityProvider\n\t\t\t},\n\t\t}));\n\n\t\tthis._list.style(defaultListStyles);\n\n\t\tthis._register(this._list.onMouseClick(e => this.onListClick(e)));\n\t\tthis._register(this._list.onMouseOver(e => this.onListHover(e)));\n\t\tthis._register(this._list.onDidChangeFocus(() => this.onFocus()));\n\t\tthis._register(this._list.onDidChangeSelection(e => this.onListSelection(e)));\n\n\t\tthis._allMenuItems = items;\n\t\tthis._list.splice(0, this._list.length, this._allMenuItems);\n\n\t\tif (this._list.length) {\n\t\t\tthis.focusNext();\n\t\t}\n\t}\n\n\tprivate focusCondition(element: IActionListItem<unknown>): boolean {\n\t\treturn !element.disabled && element.kind === ActionListItemKind.Action;\n\t}\n\n\thide(didCancel?: boolean): void {\n\t\tthis._delegate.onHide(didCancel);\n\t\tthis.cts.cancel();\n\t\tthis._contextViewService.hideContextView();\n\t}\n\n\tlayout(minWidth: number): number {\n\t\t// Updating list height, depending on how many separators and headers there are.\n\t\tconst numHeaders = this._allMenuItems.filter(item => item.kind === 'header').length;\n\t\tconst numSeparators = this._allMenuItems.filter(item => item.kind === 'separator').length;\n\t\tconst itemsHeight = this._allMenuItems.length * this._actionLineHeight;\n\t\tconst heightWithHeaders = itemsHeight + numHeaders * this._headerLineHeight - numHeaders * this._actionLineHeight;\n\t\tconst heightWithSeparators = heightWithHeaders + numSeparators * this._separatorLineHeight - numSeparators * this._actionLineHeight;\n\t\tthis._list.layout(heightWithSeparators);\n\t\tlet maxWidth = minWidth;\n\n\t\tif (this._allMenuItems.length >= 50) {\n\t\t\tmaxWidth = 380;\n\t\t} else {\n\t\t\t// For finding width dynamically (not using resize observer)\n\t\t\tconst itemWidths: number[] = this._allMenuItems.map((_, index): number => {\n\t\t\t\tconst element = this.domNode.ownerDocument.getElementById(this._list.getElementID(index));\n\t\t\t\tif (element) {\n\t\t\t\t\telement.style.width = 'auto';\n\t\t\t\t\tconst width = element.getBoundingClientRect().width;\n\t\t\t\t\telement.style.width = '';\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t});\n\n\t\t\t// resize observer - can be used in the future since list widget supports dynamic height but not width\n\t\t\tmaxWidth = Math.max(...itemWidths, minWidth);\n\t\t}\n\n\t\tconst maxVhPrecentage = 0.7;\n\t\tconst height = Math.min(heightWithSeparators, this._layoutService.getContainer(dom.getWindow(this.domNode)).clientHeight * maxVhPrecentage);\n\t\tthis._list.layout(height, maxWidth);\n\n\t\tthis.domNode.style.height = `${height}px`;\n\n\t\tthis._list.domFocus();\n\t\treturn maxWidth;\n\t}\n\n\tfocusPrevious() {\n\t\tthis._list.focusPrevious(1, true, undefined, this.focusCondition);\n\t}\n\n\tfocusNext() {\n\t\tthis._list.focusNext(1, true, undefined, this.focusCondition);\n\t}\n\n\tacceptSelected(preview?: boolean) {\n\t\tconst focused = this._list.getFocus();\n\t\tif (focused.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focusIndex = focused[0];\n\t\tconst element = this._list.element(focusIndex);\n\t\tif (!this.focusCondition(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst event = preview ? new PreviewSelectedEvent() : new AcceptSelectedEvent();\n\t\tthis._list.setSelection([focusIndex], event);\n\t}\n\n\tprivate onListSelection(e: IListEvent<IActionListItem<T>>): void {\n\t\tif (!e.elements.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst element = e.elements[0];\n\t\tif (element.item && this.focusCondition(element)) {\n\t\t\tthis._delegate.onSelect(element.item, e.browserEvent instanceof PreviewSelectedEvent);\n\t\t} else {\n\t\t\tthis._list.setSelection([]);\n\t\t}\n\t}\n\n\tprivate onFocus() {\n\t\tconst focused = this._list.getFocus();\n\t\tif (focused.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst focusIndex = focused[0];\n\t\tconst element = this._list.element(focusIndex);\n\t\tthis._delegate.onFocus?.(element.item);\n\t}\n\n\tprivate async onListHover(e: IListMouseEvent<IActionListItem<T>>) {\n\t\tconst element = e.element;\n\t\tif (element && element.item && this.focusCondition(element)) {\n\t\t\tif (this._delegate.onHover && !element.disabled && element.kind === ActionListItemKind.Action) {\n\t\t\t\tconst result = await this._delegate.onHover(element.item, this.cts.token);\n\t\t\t\telement.canPreview = result ? result.canPreview : undefined;\n\t\t\t}\n\t\t\tif (e.index) {\n\t\t\t\tthis._list.splice(e.index, 1, [element]);\n\t\t\t}\n\t\t}\n\n\t\tthis._list.setFocus(typeof e.index === 'number' ? [e.index] : []);\n\t}\n\n\tprivate onListClick(e: IListMouseEvent<IActionListItem<T>>): void {\n\t\tif (e.element && this.focusCondition(e.element)) {\n\t\t\tthis._list.setFocus([]);\n\t\t}\n\t}\n}\n\nfunction stripNewlines(str: string): string {\n\treturn str.replace(/\\r\\n|\\r|\\n/g, ' ');\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/platform/actionWidget/browser/actionList.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;gGAGgG;AAChG,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAE9F,OAAO,EAA8B,IAAI,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAqB,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,CAAC,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CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC;IACF,CAAC;CACD,CAAA;AAhNY,UAAU;IAoBpB,WAAA,mBAAmB,CAAA;IACnB,WAAA,kBAAkB,CAAA;IAClB,WAAA,cAAc,CAAA;GAtBJ,UAAU,CAgNtB;;AAED,SAAS,aAAa,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;AACxC,CAAC","file":"actionList.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 *--------------------------------------------------------------------------------------------*/\nimport * as dom from '../../../base/browser/dom.js';\nimport { KeybindingLabel } from '../../../base/browser/ui/keybindingLabel/keybindingLabel.js';\nimport { IListEvent, IListMouseEvent, IListRenderer, IListVirtualDelegate } from '../../../base/browser/ui/list/list.js';\nimport { IListAccessibilityProvider, List } from '../../../base/browser/ui/list/listWidget.js';\nimport { CancellationToken, CancellationTokenSource } from '../../../base/common/cancellation.js';\nimport { Codicon } from '../../../base/common/codicons.js';\nimport { ResolvedKeybinding } from '../../../base/common/keybindings.js';\nimport { Disposable } from '../../../base/common/lifecycle.js';\nimport { OS } from '../../../base/common/platform.js';\nimport { ThemeIcon } from '../../../base/common/themables.js';\nimport './actionWidget.css';\nimport { localize } from '../../../nls.js';\nimport { IContextViewService } from '../../contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { defaultListStyles } from '../../theme/browser/defaultStyles.js';\nimport { asCssVariable } from '../../theme/common/colorRegistry.js';\nimport { ILayoutService } from '../../layout/browser/layoutService.js';\n\nexport const acceptSelectedActionCommand = 'acceptSelectedCodeAction';\nexport const previewSelectedActionCommand = 'previewSelectedCodeAction';\n\nexport interface IActionListDelegate<T> {\n\tonHide(didCancel?: boolean): void;\n\tonSelect(action: T, preview?: boolean): void;\n\tonHover?(action: T, cancellationToken: CancellationToken): Promise<{ canPreview: boolean } | void>;\n\tonFocus?(action: T | undefined): void;\n}\n\nexport interface IActionListItem<T> {\n\treadonly item?: T;\n\treadonly kind: ActionListItemKind;\n\treadonly group?: { kind?: any; icon?: ThemeIcon; title: string };\n\treadonly disabled?: boolean;\n\treadonly label?: string;\n\treadonly description?: string;\n\treadonly keybinding?: ResolvedKeybinding;\n\tcanPreview?: boolean | undefined;\n\treadonly hideIcon?: boolean;\n\treadonly tooltip?: string;\n}\n\ninterface IActionMenuTemplateData {\n\treadonly container: HTMLElement;\n\treadonly icon: HTMLElement;\n\treadonly text: HTMLElement;\n\treadonly description?: HTMLElement;\n\treadonly keybinding: KeybindingLabel;\n}\n\nexport const enum ActionListItemKind {\n\tAction = 'action',\n\tHeader = 'header',\n\tSeparator = 'separator'\n}\n\ninterface IHeaderTemplateData {\n\treadonly container: HTMLElement;\n\treadonly text: HTMLElement;\n}\n\nclass HeaderRenderer<T> implements IListRenderer<IActionListItem<T>, IHeaderTemplateData> {\n\n\tget templateId(): string { return ActionListItemKind.Header; }\n\n\trenderTemplate(container: HTMLElement): IHeaderTemplateData {\n\t\tcontainer.classList.add('group-header');\n\n\t\tconst text = document.createElement('span');\n\t\tcontainer.append(text);\n\n\t\treturn { container, text };\n\t}\n\n\trenderElement(element: IActionListItem<T>, _index: number, templateData: IHeaderTemplateData): void {\n\t\ttemplateData.text.textContent = element.group?.title ?? element.label ?? '';\n\t}\n\n\tdisposeTemplate(_templateData: IHeaderTemplateData): void {\n\t\t// noop\n\t}\n}\n\ninterface ISeparatorTemplateData {\n\treadonly container: HTMLElement;\n\treadonly text: HTMLElement;\n}\n\nclass SeparatorRenderer<T> implements IListRenderer<IActionListItem<T>, ISeparatorTemplateData> {\n\n\tget templateId(): string { return ActionListItemKind.Separator; }\n\n\trenderTemplate(container: HTMLElement): ISeparatorTemplateData {\n\t\tcontainer.classList.add('separator');\n\n\t\tconst text = document.createElement('span');\n\t\tcontainer.append(text);\n\n\t\treturn { container, text };\n\t}\n\n\trenderElement(element: IActionListItem<T>, _index: number, templateData: ISeparatorTemplateData): void {\n\t\ttemplateData.text.textContent = element.label ?? '';\n\t}\n\n\tdisposeTemplate(_templateData: ISeparatorTemplateData): void {\n\t\t// noop\n\t}\n}\n\nclass ActionItemRenderer<T> implements IListRenderer<IActionListItem<T>, IActionMenuTemplateData> {\n\n\tget templateId(): string { return ActionListItemKind.Action; }\n\n\tconstructor(\n\t\tprivate readonly _supportsPreview: boolean,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService\n\t) { }\n\n\trenderTemplate(container: HTMLElement): IActionMenuTemplateData {\n\t\tcontainer.classList.add(this.templateId);\n\n\t\tconst icon = document.createElement('div');\n\t\ticon.className = 'icon';\n\t\tcontainer.append(icon);\n\n\t\tconst text = document.createElement('span');\n\t\ttext.className = 'title';\n\t\tcontainer.append(text);\n\n\t\tconst description = document.createElement('span');\n\t\tdescription.className = 'description';\n\t\tcontainer.append(description);\n\n\t\tconst keybinding = new KeybindingLabel(container, OS);\n\n\t\treturn { container, icon, text, description, keybinding };\n\t}\n\n\trenderElement(element: IActionListItem<T>, _index: number, data: IActionMenuTemplateData): void {\n\t\tif (element.group?.icon) {\n\t\t\tdata.icon.className = ThemeIcon.asClassName(element.group.icon);\n\t\t\tif (element.group.icon.color) {\n\t\t\t\tdata.icon.style.color = asCssVariable(element.group.icon.color.id);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.icon.className = ThemeIcon.asClassName(Codicon.lightBulb);\n\t\t\tdata.icon.style.color = 'var(--vscode-editorLightBulb-foreground)';\n\t\t}\n\n\t\tif (!element.item || !element.label) {\n\t\t\treturn;\n\t\t}\n\n\t\tdom.setVisibility(!element.hideIcon, data.icon);\n\n\t\tdata.text.textContent = stripNewlines(element.label);\n\n\t\t// if there is a keybinding, prioritize over description for now\n\t\tif (element.keybinding) {\n\t\t\tdata.description!.textContent = element.keybinding.getLabel();\n\t\t\tdata.description!.style.display = 'inline';\n\t\t\tdata.description!.style.letterSpacing = '0.5px';\n\t\t} else if (element.description) {\n\t\t\tdata.description!.textContent = stripNewlines(element.description);\n\t\t\tdata.description!.style.display = 'inline';\n\t\t} else {\n\t\t\tdata.description!.textContent = '';\n\t\t\tdata.description!.style.display = 'none';\n\t\t}\n\n\t\tconst actionTitle = this._keybindingService.lookupKeybinding(acceptSelectedActionCommand)?.getLabel();\n\t\tconst previewTitle = this._keybindingService.lookupKeybinding(previewSelectedActionCommand)?.getLabel();\n\t\tdata.container.classList.toggle('option-disabled', element.disabled);\n\t\tif (element.tooltip) {\n\t\t\tdata.container.title = element.tooltip;\n\t\t} else if (element.disabled) {\n\t\t\tdata.container.title = element.label;\n\t\t} else if (actionTitle && previewTitle) {\n\t\t\tif (this._supportsPreview && element.canPreview) {\n\t\t\t\tdata.container.title = localize({ key: 'label-preview', comment: ['placeholders are keybindings, e.g \"F2 to Apply, Shift+F2 to Preview\"'] }, \"{0} to Apply, {1} to Preview\", actionTitle, previewTitle);\n\t\t\t} else {\n\t\t\t\tdata.container.title = localize({ key: 'label', comment: ['placeholder is a keybinding, e.g \"F2 to Apply\"'] }, \"{0} to Apply\", actionTitle);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.container.title = '';\n\t\t}\n\t}\n\n\tdisposeTemplate(templateData: IActionMenuTemplateData): void {\n\t\ttemplateData.keybinding.dispose();\n\t}\n}\n\nclass AcceptSelectedEvent extends UIEvent {\n\tconstructor() { super('acceptSelectedAction'); }\n}\n\nclass PreviewSelectedEvent extends UIEvent {\n\tconstructor() { super('previewSelectedAction'); }\n}\n\nfunction getKeyboardNavigationLabel<T>(item: IActionListItem<T>): string | undefined {\n\t// Filter out header vs. action vs. separator\n\tif (item.kind === 'action') {\n\t\treturn item.label;\n\t}\n\treturn undefined;\n}\n\nexport class ActionList<T> extends Disposable {\n\n\tpublic readonly domNode: HTMLElement;\n\n\tprivate readonly _list: List<IActionListItem<T>>;\n\n\tprivate readonly _actionLineHeight = 28;\n\tprivate readonly _headerLineHeight = 28;\n\tprivate readonly _separatorLineHeight = 8;\n\n\tprivate readonly _allMenuItems: readonly IActionListItem<T>[];\n\n\tprivate readonly cts = this._register(new CancellationTokenSource());\n\n\tconstructor(\n\t\tuser: string,\n\t\tpreview: boolean,\n\t\titems: readonly IActionListItem<T>[],\n\t\tprivate readonly _delegate: IActionListDelegate<T>,\n\t\taccessibilityProvider: Partial<IListAccessibilityProvider<IActionListItem<T>>> | undefined,\n\t\t@IContextViewService private readonly _contextViewService: IContextViewService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ILayoutService private readonly _layoutService: ILayoutService,\n\t) {\n\t\tsuper();\n\t\tthis.domNode = document.createElement('div');\n\t\tthis.domNode.classList.add('actionList');\n\t\tconst virtualDelegate: IListVirtualDelegate<IActionListItem<T>> = {\n\t\t\tgetHeight: element => {\n\t\t\t\tswitch (element.kind) {\n\t\t\t\t\tcase ActionListItemKind.Header:\n\t\t\t\t\t\treturn this._headerLineHeight;\n\t\t\t\t\tcase ActionListItemKind.Separator:\n\t\t\t\t\t\treturn this._separatorLineHeight;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn this._actionLineHeight;\n\t\t\t\t}\n\t\t\t},\n\t\t\tgetTemplateId: element => element.kind\n\t\t};\n\n\n\t\tthis._list = this._register(new List(user, this.domNode, virtualDelegate, [\n\t\t\tnew ActionItemRenderer<IActionListItem<T>>(preview, this._keybindingService),\n\t\t\tnew HeaderRenderer(),\n\t\t\tnew SeparatorRenderer(),\n\t\t], {\n\t\t\tkeyboardSupport: false,\n\t\t\ttypeNavigationEnabled: true,\n\t\t\tkeyboardNavigationLabelProvider: { getKeyboardNavigationLabel },\n\t\t\taccessibilityProvider: {\n\t\t\t\tgetAriaLabel: element => {\n\t\t\t\t\tif (element.kind === ActionListItemKind.Action) {\n\t\t\t\t\t\tlet label = element.label ? stripNewlines(element?.label) : '';\n\t\t\t\t\t\tif (element.disabled) {\n\t\t\t\t\t\t\tlabel = localize({ key: 'customQuickFixWidget.labels', comment: [`Action widget labels for accessibility.`] }, \"{0}, Disabled Reason: {1}\", label, element.disabled);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn label;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t},\n\t\t\t\tgetWidgetAriaLabel: () => localize({ key: 'customQuickFixWidget', comment: [`An action widget option`] }, \"Action Widget\"),\n\t\t\t\tgetRole: (e) => {\n\t\t\t\t\tswitch (e.kind) {\n\t\t\t\t\t\tcase ActionListItemKind.Action:\n\t\t\t\t\t\t\treturn 'option';\n\t\t\t\t\t\tcase ActionListItemKind.Separator:\n\t\t\t\t\t\t\treturn 'separator';\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn 'separator';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tgetWidgetRole: () => 'listbox',\n\t\t\t\t...accessibilityProvider\n\t\t\t},\n\t\t}));\n\n\t\tthis._list.style(defaultListStyles);\n\n\t\tthis._register(this._list.onMouseClick(e => this.onListClick(e)));\n\t\tthis._register(this._list.onMouseOver(e => this.onListHover(e)));\n\t\tthis._register(this._list.onDidChangeFocus(() => this.onFocus()));\n\t\tthis._register(this._list.onDidChangeSelection(e => this.onListSelection(e)));\n\n\t\tthis._allMenuItems = items;\n\t\tthis._list.splice(0, this._list.length, this._allMenuItems);\n\n\t\tif (this._list.length) {\n\t\t\tthis.focusNext();\n\t\t}\n\t}\n\n\tprivate focusCondition(element: IActionListItem<unknown>): boolean {\n\t\treturn !element.disabled && element.kind === ActionListItemKind.Action;\n\t}\n\n\thide(didCancel?: boolean): void {\n\t\tthis._delegate.onHide(didCancel);\n\t\tthis.cts.cancel();\n\t\tthis._contextViewService.hideContextView();\n\t}\n\n\tlayout(minWidth: number): number {\n\t\t// Updating list height, depending on how many separators and headers there are.\n\t\tconst numHeaders = this._allMenuItems.filter(item => item.kind === 'header').length;\n\t\tconst numSeparators = this._allMenuItems.filter(item => item.kind === 'separator').length;\n\t\tconst itemsHeight = this._allMenuItems.length * this._actionLineHeight;\n\t\tconst heightWithHeaders = itemsHeight + numHeaders * this._headerLineHeight - numHeaders * this._actionLineHeight;\n\t\tconst heightWithSeparators = heightWithHeaders + numSeparators * this._separatorLineHeight - numSeparators * this._actionLineHeight;\n\t\tthis._list.layout(heightWithSeparators);\n\t\tlet maxWidth = minWidth;\n\n\t\tif (this._allMenuItems.length >= 50) {\n\t\t\tmaxWidth = 380;\n\t\t} else {\n\t\t\t// For finding width dynamically (not using resize observer)\n\t\t\tconst itemWidths: number[] = this._allMenuItems.map((_, index): number => {\n\t\t\t\tconst element = this.domNode.ownerDocument.getElementById(this._list.getElementID(index));\n\t\t\t\tif (element) {\n\t\t\t\t\telement.style.width = 'auto';\n\t\t\t\t\tconst width = element.getBoundingClientRect().width;\n\t\t\t\t\telement.style.width = '';\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t});\n\n\t\t\t// resize observer - can be used in the future since list widget supports dynamic height but not width\n\t\t\tmaxWidth = Math.max(...itemWidths, minWidth);\n\t\t}\n\n\t\tconst maxVhPrecentage = 0.7;\n\t\tconst height = Math.min(heightWithSeparators, this._layoutService.getContainer(dom.getWindow(this.domNode)).clientHeight * maxVhPrecentage);\n\t\tthis._list.layout(height, maxWidth);\n\n\t\tthis.domNode.style.height = `${height}px`;\n\n\t\tthis._list.domFocus();\n\t\treturn maxWidth;\n\t}\n\n\tfocusPrevious() {\n\t\tthis._list.focusPrevious(1, true, undefined, this.focusCondition);\n\t}\n\n\tfocusNext() {\n\t\tthis._list.focusNext(1, true, undefined, this.focusCondition);\n\t}\n\n\tacceptSelected(preview?: boolean) {\n\t\tconst focused = this._list.getFocus();\n\t\tif (focused.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focusIndex = focused[0];\n\t\tconst element = this._list.element(focusIndex);\n\t\tif (!this.focusCondition(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst event = preview ? new PreviewSelectedEvent() : new AcceptSelectedEvent();\n\t\tthis._list.setSelection([focusIndex], event);\n\t}\n\n\tprivate onListSelection(e: IListEvent<IActionListItem<T>>): void {\n\t\tif (!e.elements.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst element = e.elements[0];\n\t\tif (element.item && this.focusCondition(element)) {\n\t\t\tthis._delegate.onSelect(element.item, e.browserEvent instanceof PreviewSelectedEvent);\n\t\t} else {\n\t\t\tthis._list.setSelection([]);\n\t\t}\n\t}\n\n\tprivate onFocus() {\n\t\tconst focused = this._list.getFocus();\n\t\tif (focused.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst focusIndex = focused[0];\n\t\tconst element = this._list.element(focusIndex);\n\t\tthis._delegate.onFocus?.(element.item);\n\t}\n\n\tprivate async onListHover(e: IListMouseEvent<IActionListItem<T>>) {\n\t\tconst element = e.element;\n\t\tif (element && element.item && this.focusCondition(element)) {\n\t\t\tif (this._delegate.onHover && !element.disabled && element.kind === ActionListItemKind.Action) {\n\t\t\t\tconst result = await this._delegate.onHover(element.item, this.cts.token);\n\t\t\t\telement.canPreview = result ? result.canPreview : undefined;\n\t\t\t}\n\t\t\tif (e.index) {\n\t\t\t\tthis._list.splice(e.index, 1, [element]);\n\t\t\t}\n\t\t}\n\n\t\tthis._list.setFocus(typeof e.index === 'number' ? [e.index] : []);\n\t}\n\n\tprivate onListClick(e: IListMouseEvent<IActionListItem<T>>): void {\n\t\tif (e.element && this.focusCondition(e.element)) {\n\t\t\tthis._list.setFocus([]);\n\t\t}\n\t}\n}\n\nfunction stripNewlines(str: string): string {\n\treturn str.replace(/\\r\\n|\\r|\\n/g, ' ');\n}\n"]}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
z-index: 40;
|
|
12
12
|
display: block;
|
|
13
13
|
width: 100%;
|
|
14
|
-
border: 1px solid var(--vscode-
|
|
14
|
+
border: 1px solid var(--vscode-menu-border) !important;
|
|
15
15
|
border-radius: 5px;
|
|
16
|
-
background-color: var(--vscode-
|
|
17
|
-
color: var(--vscode-
|
|
16
|
+
background-color: var(--vscode-menu-background);
|
|
17
|
+
color: var(--vscode-menu-foreground);
|
|
18
18
|
padding: 4px;
|
|
19
19
|
box-shadow: 0 2px 8px var(--vscode-widget-shadow);
|
|
20
20
|
}
|
|
@@ -56,17 +56,17 @@
|
|
|
56
56
|
|
|
57
57
|
/** Styles for each row in the list element **/
|
|
58
58
|
.action-widget .monaco-list .monaco-list-row {
|
|
59
|
-
padding: 0
|
|
59
|
+
padding: 0 4px 0 4px;
|
|
60
60
|
white-space: nowrap;
|
|
61
61
|
cursor: pointer;
|
|
62
62
|
touch-action: none;
|
|
63
63
|
width: 100%;
|
|
64
|
-
border-radius:
|
|
64
|
+
border-radius: 3px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled) {
|
|
68
|
-
background-color: var(--vscode-
|
|
69
|
-
color: var(--vscode-
|
|
68
|
+
background-color: var(--vscode-list-activeSelectionBackground) !important;
|
|
69
|
+
color: var(--vscode-list-activeSelectionForeground);
|
|
70
70
|
outline: 1px solid var(--vscode-menu-selectionBorder, transparent);
|
|
71
71
|
outline-offset: -1px;
|
|
72
72
|
}
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
.action-widget .monaco-list-row.group-header {
|
|
75
75
|
color: var(--vscode-descriptionForeground) !important;
|
|
76
76
|
font-weight: 600;
|
|
77
|
-
font-size:
|
|
77
|
+
font-size: 13px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.action-widget .monaco-list-row.group-header:not(:first-of-type) {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
|
|
119
119
|
.action-widget .monaco-list-row.action {
|
|
120
120
|
display: flex;
|
|
121
|
-
gap:
|
|
121
|
+
gap: 4px;
|
|
122
122
|
align-items: center;
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -166,12 +166,12 @@
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
.action-widget .action-widget-action-bar .actions-container {
|
|
169
|
-
padding:
|
|
169
|
+
padding: 4px 8px 2px 24px;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
.action-widget-action-bar .action-label {
|
|
173
173
|
color: var(--vscode-textLink-activeForeground);
|
|
174
|
-
font-size:
|
|
174
|
+
font-size: 13px;
|
|
175
175
|
line-height: 22px;
|
|
176
176
|
padding: 0;
|
|
177
177
|
pointer-events: all;
|
|
@@ -194,5 +194,4 @@
|
|
|
194
194
|
.action-widget .monaco-list .monaco-list-row .description {
|
|
195
195
|
opacity: 0.7;
|
|
196
196
|
margin-left: 0.5em;
|
|
197
|
-
font-size: 0.9em;
|
|
198
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/actions/browser/actionViewItemService.ts","vs/platform/actions/browser/actionViewItemService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,OAAO,EAAE,OAAO,EAAS,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,eAAe,EAAyB,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAyB,wBAAwB,CAAC,CAAC;AAiBxG,MAAM,qBAAqB;IAA3B;QAIkB,eAAU,GAAG,IAAI,GAAG,EAAkC,CAAC;QAEvD,iBAAY,GAAG,IAAI,OAAO,EAAU,CAAC;QAC7C,gBAAW,GAAkB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IAa/D,CAAC;IAXA,OAAO;QACN,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,eAAgC;QACpD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAClE,CAAC;IAEO,QAAQ,CAAC,IAAY,EAAE,eAAgC;QAC9D,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,eAAe,YAAY,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC;IACnG,CAAC;CACD;AAED,iBAAiB,CAAC,sBAAsB,EAAE,qBAAqB,oCAA4B,CAAC","file":"actionViewItemService.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 { IActionViewItem } from '../../../base/browser/ui/actionbar/actionbar.js';\nimport { IActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js';\nimport { IAction } from '../../../base/common/actions.js';\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { MenuId } from '../common/actions.js';\n\n\nexport const IActionViewItemService = createDecorator<IActionViewItemService>('IActionViewItemService');\n\n\nexport interface IActionViewItemFactory {\n\t(action: IAction, options: IActionViewItemOptions,
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/actions/browser/actionViewItemService.ts","vs/platform/actions/browser/actionViewItemService.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,OAAO,EAAE,OAAO,EAAS,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAqB,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,eAAe,EAAyB,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAyB,wBAAwB,CAAC,CAAC;AAiBxG,MAAM,qBAAqB;IAA3B;QAIkB,eAAU,GAAG,IAAI,GAAG,EAAkC,CAAC;QAEvD,iBAAY,GAAG,IAAI,OAAO,EAAU,CAAC;QAC7C,gBAAW,GAAkB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IAa/D,CAAC;IAXA,OAAO;QACN,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,IAAY,EAAE,eAAgC;QACpD,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAClE,CAAC;IAEO,QAAQ,CAAC,IAAY,EAAE,eAAgC;QAC9D,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,eAAe,YAAY,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC;IACnG,CAAC;CACD;AAED,iBAAiB,CAAC,sBAAsB,EAAE,qBAAqB,oCAA4B,CAAC","file":"actionViewItemService.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 { IActionViewItem } from '../../../base/browser/ui/actionbar/actionbar.js';\nimport { IActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js';\nimport { IAction } from '../../../base/common/actions.js';\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { MenuId } from '../common/actions.js';\n\n\nexport const IActionViewItemService = createDecorator<IActionViewItemService>('IActionViewItemService');\n\n\nexport interface IActionViewItemFactory {\n\t(action: IAction, options: IActionViewItemOptions, instantiationService: IInstantiationService, windowId: number): IActionViewItem | undefined;\n}\n\nexport interface IActionViewItemService {\n\n\t_serviceBrand: undefined;\n\n\tonDidChange: Event<MenuId>;\n\n\tlookUp(menu: MenuId, submenu: MenuId): IActionViewItemFactory | undefined;\n\tlookUp(menu: MenuId, commandId: string): IActionViewItemFactory | undefined;\n}\n\nclass ActionViewItemService implements IActionViewItemService {\n\n\tdeclare _serviceBrand: undefined;\n\n\tprivate readonly _providers = new Map<string, IActionViewItemFactory>();\n\n\tprivate readonly _onDidChange = new Emitter<MenuId>();\n\treadonly onDidChange: Event<MenuId> = this._onDidChange.event;\n\n\tdispose(): void {\n\t\tthis._onDidChange.dispose();\n\t}\n\n\tlookUp(menu: MenuId, commandOrMenuId: string | MenuId): IActionViewItemFactory | undefined {\n\t\treturn this._providers.get(this._makeKey(menu, commandOrMenuId));\n\t}\n\n\tprivate _makeKey(menu: MenuId, commandOrMenuId: string | MenuId) {\n\t\treturn `${menu.id}/${(commandOrMenuId instanceof MenuId ? commandOrMenuId.id : commandOrMenuId)}`;\n\t}\n}\n\nregisterSingleton(IActionViewItemService, ActionViewItemService, InstantiationType.Delayed);\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 { IActionViewItem } from '../../../base/browser/ui/actionbar/actionbar.js';\nimport { IActionViewItemOptions } from '../../../base/browser/ui/actionbar/actionViewItems.js';\nimport { IAction } from '../../../base/common/actions.js';\nimport { Emitter, Event } from '../../../base/common/event.js';\nimport { InstantiationType, registerSingleton } from '../../instantiation/common/extensions.js';\nimport { createDecorator, IInstantiationService } from '../../instantiation/common/instantiation.js';\nimport { MenuId } from '../common/actions.js';\n\n\nexport const IActionViewItemService = createDecorator<IActionViewItemService>('IActionViewItemService');\n\n\nexport interface IActionViewItemFactory {\n\t(action: IAction, options: IActionViewItemOptions, instantiationService: IInstantiationService, windowId: number): IActionViewItem | undefined;\n}\n\nexport interface IActionViewItemService {\n\n\t_serviceBrand: undefined;\n\n\tonDidChange: Event<MenuId>;\n\n\tlookUp(menu: MenuId, submenu: MenuId): IActionViewItemFactory | undefined;\n\tlookUp(menu: MenuId, commandId: string): IActionViewItemFactory | undefined;\n}\n\nclass ActionViewItemService implements IActionViewItemService {\n\n\tdeclare _serviceBrand: undefined;\n\n\tprivate readonly _providers = new Map<string, IActionViewItemFactory>();\n\n\tprivate readonly _onDidChange = new Emitter<MenuId>();\n\treadonly onDidChange: Event<MenuId> = this._onDidChange.event;\n\n\tdispose(): void {\n\t\tthis._onDidChange.dispose();\n\t}\n\n\tlookUp(menu: MenuId, commandOrMenuId: string | MenuId): IActionViewItemFactory | undefined {\n\t\treturn this._providers.get(this._makeKey(menu, commandOrMenuId));\n\t}\n\n\tprivate _makeKey(menu: MenuId, commandOrMenuId: string | MenuId) {\n\t\treturn `${menu.id}/${(commandOrMenuId instanceof MenuId ? commandOrMenuId.id : commandOrMenuId)}`;\n\t}\n}\n\nregisterSingleton(IActionViewItemService, ActionViewItemService, InstantiationType.Delayed);\n"]}
|
|
@@ -224,7 +224,7 @@ export { WorkbenchToolBar };
|
|
|
224
224
|
*/
|
|
225
225
|
let MenuWorkbenchToolBar = class MenuWorkbenchToolBar extends WorkbenchToolBar {
|
|
226
226
|
get onDidChangeMenuItems() { return this._onDidChangeMenuItems.event; }
|
|
227
|
-
constructor(container, menuId, options, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService, actionViewService,
|
|
227
|
+
constructor(container, menuId, options, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService, actionViewService, instantiationService) {
|
|
228
228
|
super(container, {
|
|
229
229
|
resetMenu: menuId,
|
|
230
230
|
...options,
|
|
@@ -233,11 +233,11 @@ let MenuWorkbenchToolBar = class MenuWorkbenchToolBar extends WorkbenchToolBar {
|
|
|
233
233
|
if (!provider) {
|
|
234
234
|
provider = options?.actionViewItemProvider;
|
|
235
235
|
}
|
|
236
|
-
const viewItem = provider?.(action, opts,
|
|
236
|
+
const viewItem = provider?.(action, opts, instantiationService, getWindow(container).vscodeWindowId);
|
|
237
237
|
if (viewItem) {
|
|
238
238
|
return viewItem;
|
|
239
239
|
}
|
|
240
|
-
return createActionViewItem(
|
|
240
|
+
return createActionViewItem(instantiationService, action, opts);
|
|
241
241
|
}
|
|
242
242
|
}, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);
|
|
243
243
|
this._onDidChangeMenuItems = this._store.add(new Emitter());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/platform/actions/browser/toolbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAmB,gBAAgB,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,EAAW,SAAS,EAAiB,QAAQ,EAAuE,MAAM,iCAAiC,CAAC;AACnK,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAA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KAAK,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;YAC7F,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACtC,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YACrC,aAAa,EAAE,CAAC;YAChB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;YACjD,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;gBAClB,aAAa,EAAE,CAAC;YACjB,CAAC;QACF,CAAC,CAAC,CAAC,CAAC;QACJ,aAAa,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACM,UAAU;QAClB,MAAM,IAAI,kBAAkB,CAAC,wCAAwC,CAAC,CAAC;IACxE,CAAC;CACD,CAAA;AAlEY,oBAAoB;IAS9B,WAAA,YAAY,CAAA;IACZ,WAAA,kBAAkB,CAAA;IAClB,WAAA,mBAAmB,CAAA;IACnB,WAAA,kBAAkB,CAAA;IAClB,WAAA,eAAe,CAAA;IACf,WAAA,iBAAiB,CAAA;IACjB,WAAA,sBAAsB,CAAA;IACtB,YAAA,qBAAqB,CAAA;GAhBX,oBAAoB,CAkEhC","file":"toolbar.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 { addDisposableListener, getWindow } from '../../../base/browser/dom.js';\nimport { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';\nimport { IToolBarOptions, ToggleMenuAction, ToolBar } from '../../../base/browser/ui/toolbar/toolbar.js';\nimport { IAction, Separator, SubmenuAction, toAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js';\nimport { coalesceInPlace } from '../../../base/common/arrays.js';\nimport { intersection } from '../../../base/common/collections.js';\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { DisposableStore } from '../../../base/common/lifecycle.js';\nimport { localize } from '../../../nls.js';\nimport { createActionViewItem, getActionBarActions } from './menuEntryActionViewItem.js';\nimport { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from '../common/actions.js';\nimport { createConfigureKeybindingAction } from '../common/menuService.js';\nimport { ICommandService } from '../../commands/common/commands.js';\nimport { IContextKeyService } from '../../contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IActionViewItemService } from './actionViewItemService.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\n\nexport const enum HiddenItemStrategy {\n\t/** This toolbar doesn't support hiding*/\n\tNoHide = -1,\n\t/** Hidden items aren't shown anywhere */\n\tIgnore = 0,\n\t/** Hidden items move into the secondary group */\n\tRenderInSecondaryGroup = 1,\n}\n\nexport type IWorkbenchToolBarOptions = IToolBarOptions & {\n\n\t/**\n\t * Items of the primary group can be hidden. When this happens the item can\n\t * - move into the secondary popup-menu, or\n\t * - not be shown at all\n\t */\n\thiddenItemStrategy?: HiddenItemStrategy;\n\n\t/**\n\t * Optional menu id which is used for a \"Reset Menu\" command. This should be the\n\t * menu id that defines the contents of this workbench menu\n\t */\n\tresetMenu?: MenuId;\n\n\t/**\n\t * Optional menu id which items are used for the context menu of the toolbar.\n\t */\n\tcontextMenu?: MenuId;\n\n\t/**\n\t * Optional options how menu actions are created and invoked\n\t */\n\tmenuOptions?: IMenuActionOptions;\n\n\t/**\n\t * When set the `workbenchActionExecuted` is automatically send for each invoked action. The `from` property\n\t * of the event will the passed `telemetrySource`-value\n\t */\n\ttelemetrySource?: string;\n\n\t/** This is controlled by the WorkbenchToolBar */\n\tallowContextMenu?: never;\n\n\t/**\n\t * Controls the overflow behavior of the primary group of toolbar. This isthe maximum number of items and id of\n\t * items that should never overflow\n\t *\n\t */\n\toverflowBehavior?: { maxItems: number; exempted?: string[] };\n};\n\n/**\n * The `WorkbenchToolBar` does\n * - support hiding of menu items\n * - lookup keybindings for each actions automatically\n * - send `workbenchActionExecuted`-events for each action\n *\n * See {@link MenuWorkbenchToolBar} for a toolbar that is backed by a menu.\n */\nexport class WorkbenchToolBar extends ToolBar {\n\n\tprivate readonly _sessionDisposables = this._store.add(new DisposableStore());\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate _options: IWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t) {\n\t\tsuper(container, _contextMenuService, {\n\t\t\t// defaults\n\t\t\tgetKeyBinding: (action) => _keybindingService.lookupKeybinding(action.id) ?? undefined,\n\t\t\t// options (override defaults)\n\t\t\t..._options,\n\t\t\t// mandatory (overide options)\n\t\t\tallowContextMenu: true,\n\t\t\tskipTelemetry: typeof _options?.telemetrySource === 'string',\n\t\t});\n\n\t\t// telemetry logic\n\t\tconst telemetrySource = _options?.telemetrySource;\n\t\tif (telemetrySource) {\n\t\t\tthis._store.add(this.actionBar.onDidRun(e => telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>(\n\t\t\t\t'workbenchActionExecuted',\n\t\t\t\t{ id: e.action.id, from: telemetrySource })\n\t\t\t));\n\t\t}\n\t}\n\n\toverride setActions(_primary: readonly IAction[], _secondary: readonly IAction[] = [], menuIds?: readonly MenuId[]): void {\n\n\t\tthis._sessionDisposables.clear();\n\t\tconst primary: Array<IAction | undefined> = _primary.slice(); // for hiding and overflow we set some items to undefined\n\t\tconst secondary = _secondary.slice();\n\t\tconst toggleActions: IAction[] = [];\n\t\tlet toggleActionsCheckedCount: number = 0;\n\n\t\tconst extraSecondary: Array<IAction | undefined> = [];\n\n\t\tlet someAreHidden = false;\n\t\t// unless disabled, move all hidden items to secondary group or ignore them\n\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.NoHide) {\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) {\n\t\t\t\t\t// console.warn(`Action ${action.id}/${action.label} is not a MenuItemAction`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// collect all toggle actions\n\t\t\t\ttoggleActions.push(action.hideActions.toggle);\n\t\t\t\tif (action.hideActions.toggle.checked) {\n\t\t\t\t\ttoggleActionsCheckedCount++;\n\t\t\t\t}\n\n\t\t\t\t// hidden items move into overflow or ignore\n\t\t\t\tif (action.hideActions.isHidden) {\n\t\t\t\t\tsomeAreHidden = true;\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// count for max\n\t\tif (this._options?.overflowBehavior !== undefined) {\n\n\t\t\tconst exemptedIds = intersection(new Set(this._options.overflowBehavior.exempted), Iterable.map(primary, a => a?.id));\n\t\t\tconst maxItems = this._options.overflowBehavior.maxItems - exemptedIds.size;\n\n\t\t\tlet count = 0;\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!action) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t\tif (exemptedIds.has(action.id)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (count >= maxItems) {\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// coalesce turns Array<IAction|undefined> into IAction[]\n\t\tcoalesceInPlace(primary);\n\t\tcoalesceInPlace(extraSecondary);\n\t\tsuper.setActions(primary, Separator.join(extraSecondary, secondary));\n\n\t\t// add context menu for toggle and configure keybinding actions\n\t\tif (toggleActions.length > 0 || primary.length > 0) {\n\t\t\tthis._sessionDisposables.add(addDisposableListener(this.getElement(), 'contextmenu', e => {\n\t\t\t\tconst event = new StandardMouseEvent(getWindow(this.getElement()), e);\n\n\t\t\t\tconst action = this.getItemAction(event.target);\n\t\t\t\tif (!(action)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst primaryActions = [];\n\n\t\t\t\t// -- Configure Keybinding Action --\n\t\t\t\tif (action instanceof MenuItemAction && action.menuKeybinding) {\n\t\t\t\t\tprimaryActions.push(action.menuKeybinding);\n\t\t\t\t} else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) {\n\t\t\t\t\t// only enable the configure keybinding action for actions that support keybindings\n\t\t\t\t\tconst supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\tprimaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, supportsKeybindings));\n\t\t\t\t}\n\n\t\t\t\t// -- Hide Actions --\n\t\t\t\tif (toggleActions.length > 0) {\n\t\t\t\t\tlet noHide = false;\n\n\t\t\t\t\t// last item cannot be hidden when using ignore strategy\n\t\t\t\t\tif (toggleActionsCheckedCount === 1 && this._options?.hiddenItemStrategy === HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\tnoHide = true;\n\t\t\t\t\t\tfor (let i = 0; i < toggleActions.length; i++) {\n\t\t\t\t\t\t\tif (toggleActions[i].checked) {\n\t\t\t\t\t\t\t\ttoggleActions[i] = toAction({\n\t\t\t\t\t\t\t\t\tid: action.id,\n\t\t\t\t\t\t\t\t\tlabel: action.label,\n\t\t\t\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak; // there is only one\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// add \"hide foo\" actions\n\t\t\t\t\tif (!noHide && (action instanceof MenuItemAction || action instanceof SubmenuItemAction)) {\n\t\t\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\t\t\t// no context menu for MenuItemAction instances that support no hiding\n\t\t\t\t\t\t\t// those are fake actions and need to be cleaned up\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprimaryActions.push(action.hideActions.hide);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprimaryActions.push(toAction({\n\t\t\t\t\t\t\tid: 'label',\n\t\t\t\t\t\t\tlabel: localize('hide', \"Hide\"),\n\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst actions = Separator.join(primaryActions, toggleActions);\n\n\t\t\t\t// add \"Reset Menu\" action\n\t\t\t\tif (this._options?.resetMenu && !menuIds) {\n\t\t\t\t\tmenuIds = [this._options.resetMenu];\n\t\t\t\t}\n\t\t\t\tif (someAreHidden && menuIds) {\n\t\t\t\t\tactions.push(new Separator());\n\t\t\t\t\tactions.push(toAction({\n\t\t\t\t\t\tid: 'resetThisMenu',\n\t\t\t\t\t\tlabel: localize('resetThisMenu', \"Reset Menu\"),\n\t\t\t\t\t\trun: () => this._menuService.resetHiddenStates(menuIds)\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tif (actions.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\t\tgetAnchor: () => event,\n\t\t\t\t\tgetActions: () => actions,\n\t\t\t\t\t// add context menu actions (iff appicable)\n\t\t\t\t\tmenuId: this._options?.contextMenu,\n\t\t\t\t\tmenuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions },\n\t\t\t\t\tskipTelemetry: typeof this._options?.telemetrySource === 'string',\n\t\t\t\t\tcontextKeyService: this._contextKeyService,\n\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t}\n}\n\n// ---- MenuWorkbenchToolBar -------------------------------------------------\n\n\nexport interface IToolBarRenderOptions {\n\t/**\n\t * Determines what groups are considered primary. Defaults to `navigation`. Items of the primary\n\t * group are rendered with buttons and the rest is rendered in the secondary popup-menu.\n\t */\n\tprimaryGroup?: string | ((actionGroup: string) => boolean);\n\n\t/**\n\t * Inlinse submenus with just a single item\n\t */\n\tshouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean;\n\n\t/**\n\t * Should the primary group allow for separators.\n\t */\n\tuseSeparatorsInPrimaryActions?: boolean;\n}\n\nexport interface IMenuWorkbenchToolBarOptions extends IWorkbenchToolBarOptions {\n\n\t/**\n\t * Optional options to configure how the toolbar renderes items.\n\t */\n\ttoolbarOptions?: IToolBarRenderOptions;\n\n\t/**\n\t * Customize the debounce delay for menu updates\n\t */\n\teventDebounceDelay?: number;\n}\n\n/**\n * A {@link WorkbenchToolBar workbench toolbar} that is purely driven from a {@link MenuId menu}-identifier.\n *\n * *Note* that Manual updates via `setActions` are NOT supported.\n */\nexport class MenuWorkbenchToolBar extends WorkbenchToolBar {\n\n\tprivate readonly _onDidChangeMenuItems = this._store.add(new Emitter<this>());\n\tget onDidChangeMenuItems() { return this._onDidChangeMenuItems.event; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tmenuId: MenuId,\n\t\toptions: IMenuWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService menuService: IMenuService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IActionViewItemService actionViewService: IActionViewItemService,\n\t\t@IInstantiationService instaService: IInstantiationService,\n\t) {\n\t\tsuper(container, {\n\t\t\tresetMenu: menuId,\n\t\t\t...options,\n\t\t\tactionViewItemProvider: (action, opts) => {\n\t\t\t\tlet provider = actionViewService.lookUp(menuId, action instanceof SubmenuItemAction ? action.item.submenu.id : action.id);\n\t\t\t\tif (!provider) {\n\t\t\t\t\tprovider = options?.actionViewItemProvider;\n\t\t\t\t}\n\t\t\t\tconst viewItem = provider?.(action, opts, instaService);\n\t\t\t\tif (viewItem) {\n\t\t\t\t\treturn viewItem;\n\t\t\t\t}\n\t\t\t\treturn createActionViewItem(instaService, action, opts);\n\t\t\t}\n\t\t}, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);\n\n\t\t// update logic\n\t\tconst menu = this._store.add(menuService.createMenu(menuId, contextKeyService, { emitEventsForSubmenuChanges: true, eventDebounceDelay: options?.eventDebounceDelay }));\n\t\tconst updateToolbar = () => {\n\t\t\tconst { primary, secondary } = getActionBarActions(\n\t\t\t\tmenu.getActions(options?.menuOptions),\n\t\t\t\toptions?.toolbarOptions?.primaryGroup,\n\t\t\t\toptions?.toolbarOptions?.shouldInlineSubmenu,\n\t\t\t\toptions?.toolbarOptions?.useSeparatorsInPrimaryActions\n\t\t\t);\n\t\t\tcontainer.classList.toggle('has-no-actions', primary.length === 0 && secondary.length === 0);\n\t\t\tsuper.setActions(primary, secondary);\n\t\t};\n\n\t\tthis._store.add(menu.onDidChange(() => {\n\t\t\tupdateToolbar();\n\t\t\tthis._onDidChangeMenuItems.fire(this);\n\t\t}));\n\n\t\tthis._store.add(actionViewService.onDidChange(e => {\n\t\t\tif (e === menuId) {\n\t\t\t\tupdateToolbar();\n\t\t\t}\n\t\t}));\n\t\tupdateToolbar();\n\t}\n\n\t/**\n\t * @deprecated The WorkbenchToolBar does not support this method because it works with menus.\n\t */\n\toverride setActions(): void {\n\t\tthrow new BugIndicatingError('This toolbar is populated from a menu.');\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/platform/actions/browser/toolbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAmB,gBAAgB,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,EAAW,SAAS,EAAiB,QAAQ,EAAuE,MAAM,iCAAiC,CAAC;AACnK,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAsB,YAAY,EAAU,cAAc,EAAE,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MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YACrC,aAAa,EAAE,CAAC;YAChB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;YACjD,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;gBAClB,aAAa,EAAE,CAAC;YACjB,CAAC;QACF,CAAC,CAAC,CAAC,CAAC;QACJ,aAAa,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACM,UAAU;QAClB,MAAM,IAAI,kBAAkB,CAAC,wCAAwC,CAAC,CAAC;IACxE,CAAC;CACD,CAAA;AAlEY,oBAAoB;IAS9B,WAAA,YAAY,CAAA;IACZ,WAAA,kBAAkB,CAAA;IAClB,WAAA,mBAAmB,CAAA;IACnB,WAAA,kBAAkB,CAAA;IAClB,WAAA,eAAe,CAAA;IACf,WAAA,iBAAiB,CAAA;IACjB,WAAA,sBAAsB,CAAA;IACtB,YAAA,qBAAqB,CAAA;GAhBX,oBAAoB,CAkEhC","file":"toolbar.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 { addDisposableListener, getWindow } from '../../../base/browser/dom.js';\nimport { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';\nimport { IToolBarOptions, ToggleMenuAction, ToolBar } from '../../../base/browser/ui/toolbar/toolbar.js';\nimport { IAction, Separator, SubmenuAction, toAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js';\nimport { coalesceInPlace } from '../../../base/common/arrays.js';\nimport { intersection } from '../../../base/common/collections.js';\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { DisposableStore } from '../../../base/common/lifecycle.js';\nimport { localize } from '../../../nls.js';\nimport { createActionViewItem, getActionBarActions } from './menuEntryActionViewItem.js';\nimport { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from '../common/actions.js';\nimport { createConfigureKeybindingAction } from '../common/menuService.js';\nimport { ICommandService } from '../../commands/common/commands.js';\nimport { IContextKeyService } from '../../contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IActionViewItemService } from './actionViewItemService.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\n\nexport const enum HiddenItemStrategy {\n\t/** This toolbar doesn't support hiding*/\n\tNoHide = -1,\n\t/** Hidden items aren't shown anywhere */\n\tIgnore = 0,\n\t/** Hidden items move into the secondary group */\n\tRenderInSecondaryGroup = 1,\n}\n\nexport type IWorkbenchToolBarOptions = IToolBarOptions & {\n\n\t/**\n\t * Items of the primary group can be hidden. When this happens the item can\n\t * - move into the secondary popup-menu, or\n\t * - not be shown at all\n\t */\n\thiddenItemStrategy?: HiddenItemStrategy;\n\n\t/**\n\t * Optional menu id which is used for a \"Reset Menu\" command. This should be the\n\t * menu id that defines the contents of this workbench menu\n\t */\n\tresetMenu?: MenuId;\n\n\t/**\n\t * Optional menu id which items are used for the context menu of the toolbar.\n\t */\n\tcontextMenu?: MenuId;\n\n\t/**\n\t * Optional options how menu actions are created and invoked\n\t */\n\tmenuOptions?: IMenuActionOptions;\n\n\t/**\n\t * When set the `workbenchActionExecuted` is automatically send for each invoked action. The `from` property\n\t * of the event will the passed `telemetrySource`-value\n\t */\n\ttelemetrySource?: string;\n\n\t/** This is controlled by the WorkbenchToolBar */\n\tallowContextMenu?: never;\n\n\t/**\n\t * Controls the overflow behavior of the primary group of toolbar. This isthe maximum number of items and id of\n\t * items that should never overflow\n\t *\n\t */\n\toverflowBehavior?: { maxItems: number; exempted?: string[] };\n};\n\n/**\n * The `WorkbenchToolBar` does\n * - support hiding of menu items\n * - lookup keybindings for each actions automatically\n * - send `workbenchActionExecuted`-events for each action\n *\n * See {@link MenuWorkbenchToolBar} for a toolbar that is backed by a menu.\n */\nexport class WorkbenchToolBar extends ToolBar {\n\n\tprivate readonly _sessionDisposables = this._store.add(new DisposableStore());\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate _options: IWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t) {\n\t\tsuper(container, _contextMenuService, {\n\t\t\t// defaults\n\t\t\tgetKeyBinding: (action) => _keybindingService.lookupKeybinding(action.id) ?? undefined,\n\t\t\t// options (override defaults)\n\t\t\t..._options,\n\t\t\t// mandatory (overide options)\n\t\t\tallowContextMenu: true,\n\t\t\tskipTelemetry: typeof _options?.telemetrySource === 'string',\n\t\t});\n\n\t\t// telemetry logic\n\t\tconst telemetrySource = _options?.telemetrySource;\n\t\tif (telemetrySource) {\n\t\t\tthis._store.add(this.actionBar.onDidRun(e => telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>(\n\t\t\t\t'workbenchActionExecuted',\n\t\t\t\t{ id: e.action.id, from: telemetrySource })\n\t\t\t));\n\t\t}\n\t}\n\n\toverride setActions(_primary: readonly IAction[], _secondary: readonly IAction[] = [], menuIds?: readonly MenuId[]): void {\n\n\t\tthis._sessionDisposables.clear();\n\t\tconst primary: Array<IAction | undefined> = _primary.slice(); // for hiding and overflow we set some items to undefined\n\t\tconst secondary = _secondary.slice();\n\t\tconst toggleActions: IAction[] = [];\n\t\tlet toggleActionsCheckedCount: number = 0;\n\n\t\tconst extraSecondary: Array<IAction | undefined> = [];\n\n\t\tlet someAreHidden = false;\n\t\t// unless disabled, move all hidden items to secondary group or ignore them\n\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.NoHide) {\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) {\n\t\t\t\t\t// console.warn(`Action ${action.id}/${action.label} is not a MenuItemAction`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// collect all toggle actions\n\t\t\t\ttoggleActions.push(action.hideActions.toggle);\n\t\t\t\tif (action.hideActions.toggle.checked) {\n\t\t\t\t\ttoggleActionsCheckedCount++;\n\t\t\t\t}\n\n\t\t\t\t// hidden items move into overflow or ignore\n\t\t\t\tif (action.hideActions.isHidden) {\n\t\t\t\t\tsomeAreHidden = true;\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// count for max\n\t\tif (this._options?.overflowBehavior !== undefined) {\n\n\t\t\tconst exemptedIds = intersection(new Set(this._options.overflowBehavior.exempted), Iterable.map(primary, a => a?.id));\n\t\t\tconst maxItems = this._options.overflowBehavior.maxItems - exemptedIds.size;\n\n\t\t\tlet count = 0;\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!action) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t\tif (exemptedIds.has(action.id)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (count >= maxItems) {\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// coalesce turns Array<IAction|undefined> into IAction[]\n\t\tcoalesceInPlace(primary);\n\t\tcoalesceInPlace(extraSecondary);\n\t\tsuper.setActions(primary, Separator.join(extraSecondary, secondary));\n\n\t\t// add context menu for toggle and configure keybinding actions\n\t\tif (toggleActions.length > 0 || primary.length > 0) {\n\t\t\tthis._sessionDisposables.add(addDisposableListener(this.getElement(), 'contextmenu', e => {\n\t\t\t\tconst event = new StandardMouseEvent(getWindow(this.getElement()), e);\n\n\t\t\t\tconst action = this.getItemAction(event.target);\n\t\t\t\tif (!(action)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst primaryActions = [];\n\n\t\t\t\t// -- Configure Keybinding Action --\n\t\t\t\tif (action instanceof MenuItemAction && action.menuKeybinding) {\n\t\t\t\t\tprimaryActions.push(action.menuKeybinding);\n\t\t\t\t} else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) {\n\t\t\t\t\t// only enable the configure keybinding action for actions that support keybindings\n\t\t\t\t\tconst supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\tprimaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, supportsKeybindings));\n\t\t\t\t}\n\n\t\t\t\t// -- Hide Actions --\n\t\t\t\tif (toggleActions.length > 0) {\n\t\t\t\t\tlet noHide = false;\n\n\t\t\t\t\t// last item cannot be hidden when using ignore strategy\n\t\t\t\t\tif (toggleActionsCheckedCount === 1 && this._options?.hiddenItemStrategy === HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\tnoHide = true;\n\t\t\t\t\t\tfor (let i = 0; i < toggleActions.length; i++) {\n\t\t\t\t\t\t\tif (toggleActions[i].checked) {\n\t\t\t\t\t\t\t\ttoggleActions[i] = toAction({\n\t\t\t\t\t\t\t\t\tid: action.id,\n\t\t\t\t\t\t\t\t\tlabel: action.label,\n\t\t\t\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak; // there is only one\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// add \"hide foo\" actions\n\t\t\t\t\tif (!noHide && (action instanceof MenuItemAction || action instanceof SubmenuItemAction)) {\n\t\t\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\t\t\t// no context menu for MenuItemAction instances that support no hiding\n\t\t\t\t\t\t\t// those are fake actions and need to be cleaned up\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprimaryActions.push(action.hideActions.hide);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprimaryActions.push(toAction({\n\t\t\t\t\t\t\tid: 'label',\n\t\t\t\t\t\t\tlabel: localize('hide', \"Hide\"),\n\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst actions = Separator.join(primaryActions, toggleActions);\n\n\t\t\t\t// add \"Reset Menu\" action\n\t\t\t\tif (this._options?.resetMenu && !menuIds) {\n\t\t\t\t\tmenuIds = [this._options.resetMenu];\n\t\t\t\t}\n\t\t\t\tif (someAreHidden && menuIds) {\n\t\t\t\t\tactions.push(new Separator());\n\t\t\t\t\tactions.push(toAction({\n\t\t\t\t\t\tid: 'resetThisMenu',\n\t\t\t\t\t\tlabel: localize('resetThisMenu', \"Reset Menu\"),\n\t\t\t\t\t\trun: () => this._menuService.resetHiddenStates(menuIds)\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tif (actions.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\t\tgetAnchor: () => event,\n\t\t\t\t\tgetActions: () => actions,\n\t\t\t\t\t// add context menu actions (iff appicable)\n\t\t\t\t\tmenuId: this._options?.contextMenu,\n\t\t\t\t\tmenuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions },\n\t\t\t\t\tskipTelemetry: typeof this._options?.telemetrySource === 'string',\n\t\t\t\t\tcontextKeyService: this._contextKeyService,\n\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t}\n}\n\n// ---- MenuWorkbenchToolBar -------------------------------------------------\n\n\nexport interface IToolBarRenderOptions {\n\t/**\n\t * Determines what groups are considered primary. Defaults to `navigation`. Items of the primary\n\t * group are rendered with buttons and the rest is rendered in the secondary popup-menu.\n\t */\n\tprimaryGroup?: string | ((actionGroup: string) => boolean);\n\n\t/**\n\t * Inlinse submenus with just a single item\n\t */\n\tshouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean;\n\n\t/**\n\t * Should the primary group allow for separators.\n\t */\n\tuseSeparatorsInPrimaryActions?: boolean;\n}\n\nexport interface IMenuWorkbenchToolBarOptions extends IWorkbenchToolBarOptions {\n\n\t/**\n\t * Optional options to configure how the toolbar renderes items.\n\t */\n\ttoolbarOptions?: IToolBarRenderOptions;\n\n\t/**\n\t * Customize the debounce delay for menu updates\n\t */\n\teventDebounceDelay?: number;\n}\n\n/**\n * A {@link WorkbenchToolBar workbench toolbar} that is purely driven from a {@link MenuId menu}-identifier.\n *\n * *Note* that Manual updates via `setActions` are NOT supported.\n */\nexport class MenuWorkbenchToolBar extends WorkbenchToolBar {\n\n\tprivate readonly _onDidChangeMenuItems = this._store.add(new Emitter<this>());\n\tget onDidChangeMenuItems() { return this._onDidChangeMenuItems.event; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tmenuId: MenuId,\n\t\toptions: IMenuWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService menuService: IMenuService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IActionViewItemService actionViewService: IActionViewItemService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper(container, {\n\t\t\tresetMenu: menuId,\n\t\t\t...options,\n\t\t\tactionViewItemProvider: (action, opts) => {\n\t\t\t\tlet provider = actionViewService.lookUp(menuId, action instanceof SubmenuItemAction ? action.item.submenu.id : action.id);\n\t\t\t\tif (!provider) {\n\t\t\t\t\tprovider = options?.actionViewItemProvider;\n\t\t\t\t}\n\t\t\t\tconst viewItem = provider?.(action, opts, instantiationService, getWindow(container).vscodeWindowId);\n\t\t\t\tif (viewItem) {\n\t\t\t\t\treturn viewItem;\n\t\t\t\t}\n\t\t\t\treturn createActionViewItem(instantiationService, action, opts);\n\t\t\t}\n\t\t}, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);\n\n\t\t// update logic\n\t\tconst menu = this._store.add(menuService.createMenu(menuId, contextKeyService, { emitEventsForSubmenuChanges: true, eventDebounceDelay: options?.eventDebounceDelay }));\n\t\tconst updateToolbar = () => {\n\t\t\tconst { primary, secondary } = getActionBarActions(\n\t\t\t\tmenu.getActions(options?.menuOptions),\n\t\t\t\toptions?.toolbarOptions?.primaryGroup,\n\t\t\t\toptions?.toolbarOptions?.shouldInlineSubmenu,\n\t\t\t\toptions?.toolbarOptions?.useSeparatorsInPrimaryActions\n\t\t\t);\n\t\t\tcontainer.classList.toggle('has-no-actions', primary.length === 0 && secondary.length === 0);\n\t\t\tsuper.setActions(primary, secondary);\n\t\t};\n\n\t\tthis._store.add(menu.onDidChange(() => {\n\t\t\tupdateToolbar();\n\t\t\tthis._onDidChangeMenuItems.fire(this);\n\t\t}));\n\n\t\tthis._store.add(actionViewService.onDidChange(e => {\n\t\t\tif (e === menuId) {\n\t\t\t\tupdateToolbar();\n\t\t\t}\n\t\t}));\n\t\tupdateToolbar();\n\t}\n\n\t/**\n\t * @deprecated The WorkbenchToolBar does not support this method because it works with menus.\n\t */\n\toverride setActions(): void {\n\t\tthrow new BugIndicatingError('This toolbar is populated from a menu.');\n\t}\n}\n"]}
|
|
@@ -14,7 +14,6 @@ export const IsIOSContext = new RawContextKey('isIOS', isIOS, localize(1671, "Wh
|
|
|
14
14
|
export const IsMobileContext = new RawContextKey('isMobile', isMobile, localize(1672, "Whether the platform is a mobile web browser"));
|
|
15
15
|
export const IsDevelopmentContext = new RawContextKey('isDevelopment', false, true);
|
|
16
16
|
export const ProductQualityContext = new RawContextKey('productQualityType', '', localize(1673, "Quality type of VS Code"));
|
|
17
|
-
export const IsSimulationContext = new RawContextKey('isSimulation', false, localize(1674, "Whether the application runs in simulation mode"));
|
|
18
17
|
export const InputFocusedContextKey = 'inputFocus';
|
|
19
|
-
export const InputFocusedContext = new RawContextKey(InputFocusedContextKey, false, localize(
|
|
18
|
+
export const InputFocusedContext = new RawContextKey(InputFocusedContextKey, false, localize(1674, "Whether keyboard focus is inside an input box"));
|
|
20
19
|
//# sourceMappingURL=contextkeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/platform/contextkey/common/contextkeys.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,aAAa,CAAU,OAAO,EAAE,WAAW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C,CAAC;AAC7F,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,aAAa,CAAS,oBAAoB,EAAE,EAAE,EAAE,QAAQ,CAAC,IAAoB,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAEpJ,MAAM,CAAC,MAAM,sBAAsB,GAAG,YAAY,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,aAAa,CAAU,sBAAsB,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAY,EAAE,+CAA+C,CAAC,CAAC,CAAC","file":"contextkeys.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 { isIOS, isLinux, isMacintosh, isMobile, isWeb, isWindows } from '../../../base/common/platform.js';\nimport { localize } from '../../../nls.js';\nimport { RawContextKey } from './contextkey.js';\n\nexport const IsMacContext = new RawContextKey<boolean>('isMac', isMacintosh, localize('isMac', \"Whether the operating system is macOS\"));\nexport const IsLinuxContext = new RawContextKey<boolean>('isLinux', isLinux, localize('isLinux', \"Whether the operating system is Linux\"));\nexport const IsWindowsContext = new RawContextKey<boolean>('isWindows', isWindows, localize('isWindows', \"Whether the operating system is Windows\"));\n\nexport const IsWebContext = new RawContextKey<boolean>('isWeb', isWeb, localize('isWeb', \"Whether the platform is a web browser\"));\nexport const IsMacNativeContext = new RawContextKey<boolean>('isMacNative', isMacintosh && !isWeb, localize('isMacNative', \"Whether the operating system is macOS on a non-browser platform\"));\nexport const IsIOSContext = new RawContextKey<boolean>('isIOS', isIOS, localize('isIOS', \"Whether the operating system is iOS\"));\nexport const IsMobileContext = new RawContextKey<boolean>('isMobile', isMobile, localize('isMobile', \"Whether the platform is a mobile web browser\"));\n\nexport const IsDevelopmentContext = new RawContextKey<boolean>('isDevelopment', false, true);\nexport const ProductQualityContext = new RawContextKey<string>('productQualityType', '', localize('productQualityType', \"Quality type of VS Code\"));\n\nexport const InputFocusedContextKey = 'inputFocus';\nexport const InputFocusedContext = new RawContextKey<boolean>(InputFocusedContextKey, false, localize('inputFocus', \"Whether keyboard focus is inside an input box\"));\n"]}
|
|
@@ -7,17 +7,17 @@ import { localize } from '../../../nls.js';
|
|
|
7
7
|
function hintDidYouMean(...meant) {
|
|
8
8
|
switch (meant.length) {
|
|
9
9
|
case 1:
|
|
10
|
-
return localize(
|
|
10
|
+
return localize(1675, "Did you mean {0}?", meant[0]);
|
|
11
11
|
case 2:
|
|
12
|
-
return localize(
|
|
12
|
+
return localize(1676, "Did you mean {0} or {1}?", meant[0], meant[1]);
|
|
13
13
|
case 3:
|
|
14
|
-
return localize(
|
|
14
|
+
return localize(1677, "Did you mean {0}, {1} or {2}?", meant[0], meant[1], meant[2]);
|
|
15
15
|
default: // we just don't expect that many
|
|
16
16
|
return undefined;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const hintDidYouForgetToOpenOrCloseQuote = localize(
|
|
20
|
-
const hintDidYouForgetToEscapeSlash = localize(
|
|
19
|
+
const hintDidYouForgetToOpenOrCloseQuote = localize(1678, "Did you forget to open or close the quote?");
|
|
20
|
+
const hintDidYouForgetToEscapeSlash = localize(1679, "Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/\'.");
|
|
21
21
|
/**
|
|
22
22
|
* A simple scanner for context keys.
|
|
23
23
|
*
|
|
@@ -18,7 +18,7 @@ import { KeybindingsRegistry } from '../../keybinding/common/keybindingsRegistry
|
|
|
18
18
|
import { localize } from '../../../nls.js';
|
|
19
19
|
import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js';
|
|
20
20
|
import { isActiveElement } from '../../../base/browser/dom.js';
|
|
21
|
-
export const historyNavigationVisible = new RawContextKey('suggestWidgetVisible', false, localize(
|
|
21
|
+
export const historyNavigationVisible = new RawContextKey('suggestWidgetVisible', false, localize(1680, "Whether suggestion are visible"));
|
|
22
22
|
const HistoryNavigationWidgetFocusContext = 'historyNavigationWidgetFocus';
|
|
23
23
|
const HistoryNavigationForwardsEnablementContext = 'historyNavigationForwardsEnabled';
|
|
24
24
|
const HistoryNavigationBackwardsEnablementContext = 'historyNavigationBackwardsEnabled';
|
|
@@ -95,11 +95,11 @@ export class AbstractKeybindingService extends Disposable {
|
|
|
95
95
|
throw illegalState('impossible');
|
|
96
96
|
case 1:
|
|
97
97
|
// TODO@ulugbekna: revise this message and the one below (at least, fix terminology)
|
|
98
|
-
this._currentChordStatusMessage = this._notificationService.status(nls.localize(
|
|
98
|
+
this._currentChordStatusMessage = this._notificationService.status(nls.localize(1681, "({0}) was pressed. Waiting for second key of chord...", keypressLabel));
|
|
99
99
|
break;
|
|
100
100
|
default: {
|
|
101
101
|
const fullKeypressLabel = this._currentChords.map(({ label }) => label).join(', ');
|
|
102
|
-
this._currentChordStatusMessage = this._notificationService.status(nls.localize(
|
|
102
|
+
this._currentChordStatusMessage = this._notificationService.status(nls.localize(1682, "({0}) was pressed. Waiting for next key of chord...", fullKeypressLabel));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
this._scheduleLeaveChordMode();
|
|
@@ -198,7 +198,7 @@ export class AbstractKeybindingService extends Disposable {
|
|
|
198
198
|
if (this.inChordMode) {
|
|
199
199
|
const currentChordsLabel = this._currentChords.map(({ label }) => label).join(', ');
|
|
200
200
|
this._log(`+ Leaving multi-chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`);
|
|
201
|
-
this._notificationService.status(nls.localize(
|
|
201
|
+
this._notificationService.status(nls.localize(1683, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
|
|
202
202
|
this._leaveChordMode();
|
|
203
203
|
shouldPreventDefault = true;
|
|
204
204
|
}
|
|
@@ -217,7 +217,7 @@ export class AbstractKeybindingService extends Disposable {
|
|
|
217
217
|
if (this.inChordMode) {
|
|
218
218
|
const currentChordsLabel = this._currentChords.map(({ label }) => label).join(', ');
|
|
219
219
|
this._log(`+ Leaving chord mode: Nothing bound to "${currentChordsLabel}, ${keypressLabel}".`);
|
|
220
|
-
this._notificationService.status(nls.localize(
|
|
220
|
+
this._notificationService.status(nls.localize(1684, "The key combination ({0}, {1}) is not a command.", currentChordsLabel, keypressLabel), { hideAfter: 10 * 1000 /* 10s */ });
|
|
221
221
|
this._leaveChordMode();
|
|
222
222
|
shouldPreventDefault = true;
|
|
223
223
|
}
|