monaco-editor-core 0.56.0-dev-20251227 → 0.56.0-dev-20251229

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/esm/nls.messages.cs.js +1 -1
  2. package/esm/nls.messages.de.js +1 -1
  3. package/esm/nls.messages.es.js +1 -1
  4. package/esm/nls.messages.fr.js +1 -1
  5. package/esm/nls.messages.it.js +1 -1
  6. package/esm/nls.messages.ja.js +1 -1
  7. package/esm/nls.messages.ko.js +1 -1
  8. package/esm/nls.messages.pl.js +1 -1
  9. package/esm/nls.messages.pt-br.js +1 -1
  10. package/esm/nls.messages.ru.js +1 -1
  11. package/esm/nls.messages.tr.js +1 -1
  12. package/esm/nls.messages.zh-cn.js +1 -1
  13. package/esm/nls.messages.zh-tw.js +1 -1
  14. package/esm/vs/base/browser/ui/toolbar/toolbar.js +3 -0
  15. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  16. package/esm/vs/nls.js +6 -4
  17. package/esm/vs/nls.js.map +1 -1
  18. package/esm/vs/platform/quickinput/browser/media/quickInput.css +5 -5
  19. package/esm/vs/platform/quickinput/browser/quickInput.js +7 -13
  20. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  21. package/esm/vs/platform/quickinput/browser/quickInputController.js +35 -20
  22. package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
  23. package/esm/vs/platform/quickinput/browser/quickInputList.js +34 -21
  24. package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
  25. package/esm/vs/platform/quickinput/browser/quickInputService.js +2 -0
  26. package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
  27. package/esm/vs/platform/quickinput/browser/quickInputUtils.js +24 -3
  28. package/esm/vs/platform/quickinput/browser/quickInputUtils.js.map +1 -1
  29. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js +16 -9
  30. package/esm/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.js.map +1 -1
  31. package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
  32. package/package.json +2 -2
  33. package/esm/vs/nls.messages.js +0 -17
  34. package/esm/vs/nls.messages.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.56.0-dev-20251227(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
3
+ * Version: 0.56.0-dev-20251229(ec78a33c7b34dba19e9d3cbe1b3b378465bbd8b8)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -115,6 +115,9 @@ export class ToolBar extends Disposable {
115
115
  getItemWidth(index) {
116
116
  return this.actionBar.getWidth(index);
117
117
  }
118
+ getItemsLength() {
119
+ return this.actionBar.length();
120
+ }
118
121
  setActions(primaryActions, secondaryActions) {
119
122
  this.clear();
120
123
  // Store primary and secondary actions as rendered initially
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/base/browser/ui/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,SAAS,EAA+C,MAAM,2BAA2B,CAAC;AAEnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,MAAM,EAA0B,SAAS,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,MAAM,gBAAgB,GAAG,EAAE,CAAC,CAAC,oCAAoC;AAwCjE;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,UAAU;IAUtC,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AE,CAAC;QACjC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD;AAED,MAAM,OAAO,gBAAiB,SAAQ,MAAM;aAE3B,OAAE,GAAG,qBAAqB,CAAC;IAK3C,YAAY,kBAA8B,EAAE,KAAc;QACzD,KAAK,GAAG,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAa,EAAE,iBAAiB,CAAC,CAAC;QAChE,KAAK,CAAC,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC9C,CAAC;IAEQ,KAAK,CAAC,GAAG;QACjB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED,IAAI,WAAW,CAAC,OAA+B;QAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;IAC7B,CAAC","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 { IContextMenuProvider } from '../../contextmenu.js';\nimport { ActionBar, ActionsOrientation, IActionViewItemProvider } from '../actionbar/actionbar.js';\nimport { AnchorAlignment } from '../contextview/contextview.js';\nimport { DropdownMenuActionViewItem } from '../dropdown/dropdownActionViewItem.js';\nimport { Action, IAction, IActionRunner, Separator, SubmenuAction } from '../../../common/actions.js';\nimport { Codicon } from '../../../common/codicons.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport { EventMultiplexer } from '../../../common/event.js';\nimport { ResolvedKeybinding } from '../../../common/keybindings.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../common/lifecycle.js';\nimport './toolbar.css';\nimport * as nls from '../../../../nls.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';\n\nconst ACTION_MIN_WIDTH = 24; /* 20px codicon + 4px left padding*/\n\nexport interface IToolBarOptions {\n\torientation?: ActionsOrientation;\n\tactionViewItemProvider?: IActionViewItemProvider;\n\tariaLabel?: string;\n\tgetKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;\n\tactionRunner?: IActionRunner;\n\ttoggleMenuTitle?: string;\n\tanchorAlignmentProvider?: () => AnchorAlignment;\n\trenderDropdownAsChildElement?: boolean;\n\tmoreIcon?: ThemeIcon;\n\tallowContextMenu?: boolean;\n\tskipTelemetry?: boolean;\n\thoverDelegate?: IHoverDelegate;\n\ttrailingSeparator?: boolean;\n\n\t/**\n\t * If true, toggled primary items are highlighted with a background color.\n\t */\n\thighlightToggledItems?: boolean;\n\n\t/**\n\t * Render action with icons (default: `true`)\n\t */\n\ticon?: boolean;\n\n\t/**\n\t * Render action with label (default: `false`)\n\t */\n\tlabel?: boolean;\n\n\t/**\n\t * Controls the responsive behavior of the primary group of the toolbar.\n\t * - `enabled`: Whether the responsive behavior is enabled.\n\t * - `minItems`: The minimum number of items that should always be visible.\n\t */\n\tresponsiveBehavior?: { enabled: boolean; minItems?: number };\n}\n\n/**\n * A widget that combines an action bar for primary actions and a dropdown for secondary actions.\n */\nexport class ToolBar extends Disposable {\n\tprivate options: IToolBarOptions;\n\tprotected readonly actionBar: ActionBar;\n\tprivate toggleMenuAction: ToggleMenuAction;\n\tprivate toggleMenuActionViewItem: DropdownMenuActionViewItem | undefined;\n\tprivate submenuActionViewItems: DropdownMenuActionViewItem[] = [];\n\tprivate hasSecondaryActions: boolean = false;\n\tprivate readonly element: HTMLElement;\n\n\tprivate _onDidChangeDropdownVisibility = this._register(new EventMultiplexer<boolean>());\n\tget onDidChangeDropdownVisibility() { return this._onDidChangeDropdownVisibility.event; }\n\tprivate originalPrimaryActions: ReadonlyArray<IAction> = [];\n\tprivate originalSecondaryActions: ReadonlyArray<IAction> = [];\n\tprivate hiddenActions: { action: IAction; size: number }[] = [];\n\tprivate readonly disposables = this._register(new DisposableStore());\n\n\tconstructor(private readonly container: HTMLElement, contextMenuProvider: IContextMenuProvider, options: IToolBarOptions = { orientation: ActionsOrientation.HORIZONTAL }) {\n\t\tsuper();\n\n\t\toptions.hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());\n\t\tthis.options = options;\n\n\t\tthis.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem?.show(), options.toggleMenuTitle));\n\n\t\tthis.element = document.createElement('div');\n\t\tthis.element.className = 'monaco-toolbar';\n\t\tcontainer.appendChild(this.element);\n\n\t\tthis.actionBar = this._register(new ActionBar(this.element, {\n\t\t\torientation: options.orientation,\n\t\t\tariaLabel: options.ariaLabel,\n\t\t\tactionRunner: options.actionRunner,\n\t\t\tallowContextMenu: options.allowContextMenu,\n\t\t\thighlightToggledItems: options.highlightToggledItems,\n\t\t\thoverDelegate: options.hoverDelegate,\n\t\t\tactionViewItemProvider: (action, viewItemOptions) => {\n\t\t\t\tif (action.id === ToggleMenuAction.ID) {\n\t\t\t\t\tthis.toggleMenuActionViewItem = new DropdownMenuActionViewItem(\n\t\t\t\t\t\taction,\n\t\t\t\t\t\t{ getActions: () => this.toggleMenuAction.menuActions },\n\t\t\t\t\t\tcontextMenuProvider,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tactionViewItemProvider: this.options.actionViewItemProvider,\n\t\t\t\t\t\t\tactionRunner: this.actionRunner,\n\t\t\t\t\t\t\tkeybindingProvider: this.options.getKeyBinding,\n\t\t\t\t\t\t\tclassNames: ThemeIcon.asClassNameArray(options.moreIcon ?? Codicon.toolBarMore),\n\t\t\t\t\t\t\tanchorAlignmentProvider: this.options.anchorAlignmentProvider,\n\t\t\t\t\t\t\tmenuAsChild: !!this.options.renderDropdownAsChildElement,\n\t\t\t\t\t\t\tskipTelemetry: this.options.skipTelemetry,\n\t\t\t\t\t\t\tisMenu: true,\n\t\t\t\t\t\t\thoverDelegate: this.options.hoverDelegate\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tthis.toggleMenuActionViewItem.setActionContext(this.actionBar.context);\n\t\t\t\t\tthis.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility));\n\n\t\t\t\t\treturn this.toggleMenuActionViewItem;\n\t\t\t\t}\n\n\t\t\t\tif (options.actionViewItemProvider) {\n\t\t\t\t\tconst result = options.actionViewItemProvider(action, viewItemOptions);\n\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (action instanceof SubmenuAction) {\n\t\t\t\t\tconst result = new DropdownMenuActionViewItem(\n\t\t\t\t\t\taction,\n\t\t\t\t\t\taction.actions,\n\t\t\t\t\t\tcontextMenuProvider,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tactionViewItemProvider: this.options.actionViewItemProvider,\n\t\t\t\t\t\t\tactionRunner: this.actionRunner,\n\t\t\t\t\t\t\tkeybindingProvider: this.options.getKeyBinding,\n\t\t\t\t\t\t\tclassNames: action.class,\n\t\t\t\t\t\t\tanchorAlignmentProvider: this.options.anchorAlignmentProvider,\n\t\t\t\t\t\t\tmenuAsChild: !!this.options.renderDropdownAsChildElement,\n\t\t\t\t\t\t\tskipTelemetry: this.options.skipTelemetry,\n\t\t\t\t\t\t\thoverDelegate: this.options.hoverDelegate\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tresult.setActionContext(this.actionBar.context);\n\t\t\t\t\tthis.submenuActionViewItems.push(result);\n\t\t\t\t\tthis.disposables.add(this._onDidChangeDropdownVisibility.add(result.onDidChangeVisibility));\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}));\n\n\t\t// Responsive support\n\t\tif (this.options.responsiveBehavior?.enabled) {\n\t\t\tthis.element.classList.add('responsive');\n\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tthis.updateActions(this.element.getBoundingClientRect().width);\n\t\t\t});\n\t\t\tobserver.observe(this.element);\n\t\t\tthis._store.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis.actionBar.actionRunner = actionRunner;\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this.actionBar.actionRunner;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis.actionBar.context = context;\n\t\tthis.toggleMenuActionViewItem?.setActionContext(context);\n\t\tfor (const actionViewItem of this.submenuActionViewItems) {\n\t\t\tactionViewItem.setActionContext(context);\n\t\t}\n\t}\n\n\tgetElement(): HTMLElement {\n\t\treturn this.element;\n\t}\n\n\tgetItemAction(indexOrElement: number | HTMLElement) {\n\t\treturn this.actionBar.getAction(indexOrElement);\n\t}\n\n\tgetItemWidth(index: number): number {\n\t\treturn this.actionBar.getWidth(index);\n\t}\n\n\tsetActions(primaryActions: ReadonlyArray<IAction>, secondaryActions?: ReadonlyArray<IAction>): void {\n\t\tthis.clear();\n\n\t\t// Store primary and secondary actions as rendered initially\n\t\tthis.originalPrimaryActions = primaryActions ? primaryActions.slice(0) : [];\n\t\tthis.originalSecondaryActions = secondaryActions ? secondaryActions.slice(0) : [];\n\n\t\tconst primaryActionsToSet = primaryActions ? primaryActions.slice(0) : [];\n\n\t\t// Inject additional action to open secondary actions if present\n\t\tthis.hasSecondaryActions = !!(secondaryActions && secondaryActions.length > 0);\n\t\tif (this.hasSecondaryActions && secondaryActions) {\n\t\t\tthis.toggleMenuAction.menuActions = secondaryActions.slice(0);\n\t\t\tprimaryActionsToSet.push(this.toggleMenuAction);\n\t\t}\n\n\t\tif (primaryActionsToSet.length > 0 && this.options.trailingSeparator) {\n\t\t\tprimaryActionsToSet.push(new Separator());\n\t\t}\n\n\t\tprimaryActionsToSet.forEach(action => {\n\t\t\tthis.actionBar.push(action, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(action) });\n\t\t});\n\n\t\tif (this.options.responsiveBehavior?.enabled) {\n\t\t\t// Reset hidden actions\n\t\t\tthis.hiddenActions.length = 0;\n\n\t\t\t// Set the minimum width\n\t\t\tif (this.options.responsiveBehavior?.minItems !== undefined) {\n\t\t\t\tlet itemCount = this.options.responsiveBehavior.minItems;\n\n\t\t\t\t// Account for overflow menu\n\t\t\t\tif (\n\t\t\t\t\tthis.originalSecondaryActions.length > 0 ||\n\t\t\t\t\titemCount < this.originalPrimaryActions.length\n\t\t\t\t) {\n\t\t\t\t\titemCount += 1;\n\t\t\t\t}\n\n\t\t\t\tthis.container.style.minWidth = `${itemCount * ACTION_MIN_WIDTH}px`;\n\t\t\t\tthis.element.style.minWidth = `${itemCount * ACTION_MIN_WIDTH}px`;\n\t\t\t} else {\n\t\t\t\tthis.container.style.minWidth = `${ACTION_MIN_WIDTH}px`;\n\t\t\t\tthis.element.style.minWidth = `${ACTION_MIN_WIDTH}px`;\n\t\t\t}\n\n\t\t\t// Update toolbar actions to fit with container width\n\t\t\tthis.updateActions(this.element.getBoundingClientRect().width);\n\t\t}\n\t}\n\n\tprivate getKeybindingLabel(action: IAction): string | undefined {\n\t\tconst key = this.options.getKeyBinding?.(action);\n\n\t\treturn key?.getLabel() ?? undefined;\n\t}\n\n\tprivate updateActions(containerWidth: number) {\n\t\t// Actions bar is empty\n\t\tif (this.actionBar.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure that the container width respects the minimum width of the\n\t\t// element which is set based on the `responsiveBehavior.minItems` option\n\t\tcontainerWidth = Math.max(containerWidth, parseInt(this.element.style.minWidth));\n\n\t\t// Each action is assumed to have a minimum width so that actions with a label\n\t\t// can shrink to the action's minimum width. We do this so that action visibility\n\t\t// takes precedence over the action label.\n\t\tconst actionBarWidth = () => this.actionBar.length() * ACTION_MIN_WIDTH;\n\n\t\t// Action bar fits and there are no hidden actions to show\n\t\tif (actionBarWidth() <= containerWidth && this.hiddenActions.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (actionBarWidth() > containerWidth) {\n\t\t\t// Check for max items limit\n\t\t\tif (this.options.responsiveBehavior?.minItems !== undefined) {\n\t\t\t\tconst primaryActionsCount = this.actionBar.hasAction(this.toggleMenuAction)\n\t\t\t\t\t? this.actionBar.length() - 1\n\t\t\t\t\t: this.actionBar.length();\n\n\t\t\t\tif (primaryActionsCount <= this.options.responsiveBehavior.minItems) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Hide actions from the right\n\t\t\twhile (actionBarWidth() > containerWidth && this.actionBar.length() > 0) {\n\t\t\t\tconst index = this.originalPrimaryActions.length - this.hiddenActions.length - 1;\n\t\t\t\tif (index < 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Store the action and its size\n\t\t\t\tconst size = Math.min(ACTION_MIN_WIDTH, this.getItemWidth(index));\n\t\t\t\tconst action = this.originalPrimaryActions[index];\n\t\t\t\tthis.hiddenActions.unshift({ action, size });\n\n\t\t\t\t// Remove the action\n\t\t\t\tthis.actionBar.pull(index);\n\n\t\t\t\t// There are no secondary actions, but we have actions that we need to hide so we\n\t\t\t\t// create the overflow menu. This will ensure that another primary action will be\n\t\t\t\t// removed making space for the overflow menu.\n\t\t\t\tif (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) {\n\t\t\t\t\tthis.actionBar.push(this.toggleMenuAction, {\n\t\t\t\t\t\ticon: this.options.icon ?? true,\n\t\t\t\t\t\tlabel: this.options.label ?? false,\n\t\t\t\t\t\tkeybinding: this.getKeybindingLabel(this.toggleMenuAction),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Show actions from the top of the toggle menu\n\t\t\twhile (this.hiddenActions.length > 0) {\n\t\t\t\tconst entry = this.hiddenActions.shift()!;\n\t\t\t\tif (actionBarWidth() + entry.size > containerWidth) {\n\t\t\t\t\t// Not enough space to show the action\n\t\t\t\t\tthis.hiddenActions.unshift(entry);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Add the action\n\t\t\t\tthis.actionBar.push(entry.action, {\n\t\t\t\t\ticon: this.options.icon ?? true,\n\t\t\t\t\tlabel: this.options.label ?? false,\n\t\t\t\t\tkeybinding: this.getKeybindingLabel(entry.action),\n\t\t\t\t\tindex: this.originalPrimaryActions.length - this.hiddenActions.length - 1\n\t\t\t\t});\n\n\t\t\t\t// There are no secondary actions, and there is only one hidden item left so we\n\t\t\t\t// remove the overflow menu making space for the last hidden action to be shown.\n\t\t\t\tif (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) {\n\t\t\t\t\tthis.toggleMenuAction.menuActions = [];\n\t\t\t\t\tthis.actionBar.pull(this.actionBar.length() - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update overflow menu\n\t\tconst hiddenActions = this.hiddenActions.map(entry => entry.action);\n\t\tif (this.originalSecondaryActions.length > 0 || hiddenActions.length > 0) {\n\t\t\tconst secondaryActions = this.originalSecondaryActions.slice(0);\n\t\t\tthis.toggleMenuAction.menuActions = Separator.join(hiddenActions, secondaryActions);\n\t\t}\n\t}\n\n\tprivate clear(): void {\n\t\tthis.submenuActionViewItems = [];\n\t\tthis.disposables.clear();\n\t\tthis.actionBar.clear();\n\t}\n\n\toverride dispose(): void {\n\t\tthis.clear();\n\t\tthis.disposables.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\nexport class ToggleMenuAction extends Action {\n\n\tstatic readonly ID = 'toolbar.toggle.more';\n\n\tprivate _menuActions: ReadonlyArray<IAction>;\n\tprivate toggleDropdownMenu: () => void;\n\n\tconstructor(toggleDropdownMenu: () => void, title?: string) {\n\t\ttitle = title || nls.localize('moreActions', \"More Actions...\");\n\t\tsuper(ToggleMenuAction.ID, title, undefined, true);\n\n\t\tthis._menuActions = [];\n\t\tthis.toggleDropdownMenu = toggleDropdownMenu;\n\t}\n\n\toverride async run(): Promise<void> {\n\t\tthis.toggleDropdownMenu();\n\t}\n\n\tget menuActions(): ReadonlyArray<IAction> {\n\t\treturn this._menuActions;\n\t}\n\n\tset menuActions(actions: ReadonlyArray<IAction>) {\n\t\tthis._menuActions = actions;\n\t}\n}\n"]}
1
+ {"version":3,"sources":["vs/base/browser/ui/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,SAAS,EAA+C,MAAM,2BAA2B,CAAC;AAEnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,MAAM,EAA0B,SAAS,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,MAAM,gBAAgB,GAAG,EAAE,CAAC,CAAC,oCAAoC;AAwCjE;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,UAAU;IAUtC,IAAI,6BAA6B,KAAK,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F,CAAC;IAEO,KAAK;QACZ,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD;AAED,MAAM,OAAO,gBAAiB,SAAQ,MAAM;aAE3B,OAAE,GAAG,qBAAqB,CAAC;IAK3C,YAAY,kBAA8B,EAAE,KAAc;QACzD,KAAK,GAAG,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAa,EAAE,iBAAiB,CAAC,CAAC;QAChE,KAAK,CAAC,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAEnD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC9C,CAAC;IAEQ,KAAK,CAAC,GAAG;QACjB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED,IAAI,WAAW,CAAC,OAA+B;QAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;IAC7B,CAAC","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 { IContextMenuProvider } from '../../contextmenu.js';\nimport { ActionBar, ActionsOrientation, IActionViewItemProvider } from '../actionbar/actionbar.js';\nimport { AnchorAlignment } from '../contextview/contextview.js';\nimport { DropdownMenuActionViewItem } from '../dropdown/dropdownActionViewItem.js';\nimport { Action, IAction, IActionRunner, Separator, SubmenuAction } from '../../../common/actions.js';\nimport { Codicon } from '../../../common/codicons.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport { EventMultiplexer } from '../../../common/event.js';\nimport { ResolvedKeybinding } from '../../../common/keybindings.js';\nimport { Disposable, DisposableStore, toDisposable } from '../../../common/lifecycle.js';\nimport './toolbar.css';\nimport * as nls from '../../../../nls.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';\n\nconst ACTION_MIN_WIDTH = 24; /* 20px codicon + 4px left padding*/\n\nexport interface IToolBarOptions {\n\torientation?: ActionsOrientation;\n\tactionViewItemProvider?: IActionViewItemProvider;\n\tariaLabel?: string;\n\tgetKeyBinding?: (action: IAction) => ResolvedKeybinding | undefined;\n\tactionRunner?: IActionRunner;\n\ttoggleMenuTitle?: string;\n\tanchorAlignmentProvider?: () => AnchorAlignment;\n\trenderDropdownAsChildElement?: boolean;\n\tmoreIcon?: ThemeIcon;\n\tallowContextMenu?: boolean;\n\tskipTelemetry?: boolean;\n\thoverDelegate?: IHoverDelegate;\n\ttrailingSeparator?: boolean;\n\n\t/**\n\t * If true, toggled primary items are highlighted with a background color.\n\t */\n\thighlightToggledItems?: boolean;\n\n\t/**\n\t * Render action with icons (default: `true`)\n\t */\n\ticon?: boolean;\n\n\t/**\n\t * Render action with label (default: `false`)\n\t */\n\tlabel?: boolean;\n\n\t/**\n\t * Controls the responsive behavior of the primary group of the toolbar.\n\t * - `enabled`: Whether the responsive behavior is enabled.\n\t * - `minItems`: The minimum number of items that should always be visible.\n\t */\n\tresponsiveBehavior?: { enabled: boolean; minItems?: number };\n}\n\n/**\n * A widget that combines an action bar for primary actions and a dropdown for secondary actions.\n */\nexport class ToolBar extends Disposable {\n\tprivate options: IToolBarOptions;\n\tprotected readonly actionBar: ActionBar;\n\tprivate toggleMenuAction: ToggleMenuAction;\n\tprivate toggleMenuActionViewItem: DropdownMenuActionViewItem | undefined;\n\tprivate submenuActionViewItems: DropdownMenuActionViewItem[] = [];\n\tprivate hasSecondaryActions: boolean = false;\n\tprivate readonly element: HTMLElement;\n\n\tprivate _onDidChangeDropdownVisibility = this._register(new EventMultiplexer<boolean>());\n\tget onDidChangeDropdownVisibility() { return this._onDidChangeDropdownVisibility.event; }\n\tprivate originalPrimaryActions: ReadonlyArray<IAction> = [];\n\tprivate originalSecondaryActions: ReadonlyArray<IAction> = [];\n\tprivate hiddenActions: { action: IAction; size: number }[] = [];\n\tprivate readonly disposables = this._register(new DisposableStore());\n\n\tconstructor(private readonly container: HTMLElement, contextMenuProvider: IContextMenuProvider, options: IToolBarOptions = { orientation: ActionsOrientation.HORIZONTAL }) {\n\t\tsuper();\n\n\t\toptions.hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());\n\t\tthis.options = options;\n\n\t\tthis.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem?.show(), options.toggleMenuTitle));\n\n\t\tthis.element = document.createElement('div');\n\t\tthis.element.className = 'monaco-toolbar';\n\t\tcontainer.appendChild(this.element);\n\n\t\tthis.actionBar = this._register(new ActionBar(this.element, {\n\t\t\torientation: options.orientation,\n\t\t\tariaLabel: options.ariaLabel,\n\t\t\tactionRunner: options.actionRunner,\n\t\t\tallowContextMenu: options.allowContextMenu,\n\t\t\thighlightToggledItems: options.highlightToggledItems,\n\t\t\thoverDelegate: options.hoverDelegate,\n\t\t\tactionViewItemProvider: (action, viewItemOptions) => {\n\t\t\t\tif (action.id === ToggleMenuAction.ID) {\n\t\t\t\t\tthis.toggleMenuActionViewItem = new DropdownMenuActionViewItem(\n\t\t\t\t\t\taction,\n\t\t\t\t\t\t{ getActions: () => this.toggleMenuAction.menuActions },\n\t\t\t\t\t\tcontextMenuProvider,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tactionViewItemProvider: this.options.actionViewItemProvider,\n\t\t\t\t\t\t\tactionRunner: this.actionRunner,\n\t\t\t\t\t\t\tkeybindingProvider: this.options.getKeyBinding,\n\t\t\t\t\t\t\tclassNames: ThemeIcon.asClassNameArray(options.moreIcon ?? Codicon.toolBarMore),\n\t\t\t\t\t\t\tanchorAlignmentProvider: this.options.anchorAlignmentProvider,\n\t\t\t\t\t\t\tmenuAsChild: !!this.options.renderDropdownAsChildElement,\n\t\t\t\t\t\t\tskipTelemetry: this.options.skipTelemetry,\n\t\t\t\t\t\t\tisMenu: true,\n\t\t\t\t\t\t\thoverDelegate: this.options.hoverDelegate\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tthis.toggleMenuActionViewItem.setActionContext(this.actionBar.context);\n\t\t\t\t\tthis.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility));\n\n\t\t\t\t\treturn this.toggleMenuActionViewItem;\n\t\t\t\t}\n\n\t\t\t\tif (options.actionViewItemProvider) {\n\t\t\t\t\tconst result = options.actionViewItemProvider(action, viewItemOptions);\n\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (action instanceof SubmenuAction) {\n\t\t\t\t\tconst result = new DropdownMenuActionViewItem(\n\t\t\t\t\t\taction,\n\t\t\t\t\t\taction.actions,\n\t\t\t\t\t\tcontextMenuProvider,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tactionViewItemProvider: this.options.actionViewItemProvider,\n\t\t\t\t\t\t\tactionRunner: this.actionRunner,\n\t\t\t\t\t\t\tkeybindingProvider: this.options.getKeyBinding,\n\t\t\t\t\t\t\tclassNames: action.class,\n\t\t\t\t\t\t\tanchorAlignmentProvider: this.options.anchorAlignmentProvider,\n\t\t\t\t\t\t\tmenuAsChild: !!this.options.renderDropdownAsChildElement,\n\t\t\t\t\t\t\tskipTelemetry: this.options.skipTelemetry,\n\t\t\t\t\t\t\thoverDelegate: this.options.hoverDelegate\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tresult.setActionContext(this.actionBar.context);\n\t\t\t\t\tthis.submenuActionViewItems.push(result);\n\t\t\t\t\tthis.disposables.add(this._onDidChangeDropdownVisibility.add(result.onDidChangeVisibility));\n\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}));\n\n\t\t// Responsive support\n\t\tif (this.options.responsiveBehavior?.enabled) {\n\t\t\tthis.element.classList.add('responsive');\n\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tthis.updateActions(this.element.getBoundingClientRect().width);\n\t\t\t});\n\t\t\tobserver.observe(this.element);\n\t\t\tthis._store.add(toDisposable(() => observer.disconnect()));\n\t\t}\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis.actionBar.actionRunner = actionRunner;\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\treturn this.actionBar.actionRunner;\n\t}\n\n\tset context(context: unknown) {\n\t\tthis.actionBar.context = context;\n\t\tthis.toggleMenuActionViewItem?.setActionContext(context);\n\t\tfor (const actionViewItem of this.submenuActionViewItems) {\n\t\t\tactionViewItem.setActionContext(context);\n\t\t}\n\t}\n\n\tgetElement(): HTMLElement {\n\t\treturn this.element;\n\t}\n\n\tgetItemAction(indexOrElement: number | HTMLElement) {\n\t\treturn this.actionBar.getAction(indexOrElement);\n\t}\n\n\tgetItemWidth(index: number): number {\n\t\treturn this.actionBar.getWidth(index);\n\t}\n\n\tgetItemsLength(): number {\n\t\treturn this.actionBar.length();\n\t}\n\n\tsetActions(primaryActions: ReadonlyArray<IAction>, secondaryActions?: ReadonlyArray<IAction>): void {\n\t\tthis.clear();\n\n\t\t// Store primary and secondary actions as rendered initially\n\t\tthis.originalPrimaryActions = primaryActions ? primaryActions.slice(0) : [];\n\t\tthis.originalSecondaryActions = secondaryActions ? secondaryActions.slice(0) : [];\n\n\t\tconst primaryActionsToSet = primaryActions ? primaryActions.slice(0) : [];\n\n\t\t// Inject additional action to open secondary actions if present\n\t\tthis.hasSecondaryActions = !!(secondaryActions && secondaryActions.length > 0);\n\t\tif (this.hasSecondaryActions && secondaryActions) {\n\t\t\tthis.toggleMenuAction.menuActions = secondaryActions.slice(0);\n\t\t\tprimaryActionsToSet.push(this.toggleMenuAction);\n\t\t}\n\n\t\tif (primaryActionsToSet.length > 0 && this.options.trailingSeparator) {\n\t\t\tprimaryActionsToSet.push(new Separator());\n\t\t}\n\n\t\tprimaryActionsToSet.forEach(action => {\n\t\t\tthis.actionBar.push(action, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(action) });\n\t\t});\n\n\t\tif (this.options.responsiveBehavior?.enabled) {\n\t\t\t// Reset hidden actions\n\t\t\tthis.hiddenActions.length = 0;\n\n\t\t\t// Set the minimum width\n\t\t\tif (this.options.responsiveBehavior?.minItems !== undefined) {\n\t\t\t\tlet itemCount = this.options.responsiveBehavior.minItems;\n\n\t\t\t\t// Account for overflow menu\n\t\t\t\tif (\n\t\t\t\t\tthis.originalSecondaryActions.length > 0 ||\n\t\t\t\t\titemCount < this.originalPrimaryActions.length\n\t\t\t\t) {\n\t\t\t\t\titemCount += 1;\n\t\t\t\t}\n\n\t\t\t\tthis.container.style.minWidth = `${itemCount * ACTION_MIN_WIDTH}px`;\n\t\t\t\tthis.element.style.minWidth = `${itemCount * ACTION_MIN_WIDTH}px`;\n\t\t\t} else {\n\t\t\t\tthis.container.style.minWidth = `${ACTION_MIN_WIDTH}px`;\n\t\t\t\tthis.element.style.minWidth = `${ACTION_MIN_WIDTH}px`;\n\t\t\t}\n\n\t\t\t// Update toolbar actions to fit with container width\n\t\t\tthis.updateActions(this.element.getBoundingClientRect().width);\n\t\t}\n\t}\n\n\tprivate getKeybindingLabel(action: IAction): string | undefined {\n\t\tconst key = this.options.getKeyBinding?.(action);\n\n\t\treturn key?.getLabel() ?? undefined;\n\t}\n\n\tprivate updateActions(containerWidth: number) {\n\t\t// Actions bar is empty\n\t\tif (this.actionBar.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Ensure that the container width respects the minimum width of the\n\t\t// element which is set based on the `responsiveBehavior.minItems` option\n\t\tcontainerWidth = Math.max(containerWidth, parseInt(this.element.style.minWidth));\n\n\t\t// Each action is assumed to have a minimum width so that actions with a label\n\t\t// can shrink to the action's minimum width. We do this so that action visibility\n\t\t// takes precedence over the action label.\n\t\tconst actionBarWidth = () => this.actionBar.length() * ACTION_MIN_WIDTH;\n\n\t\t// Action bar fits and there are no hidden actions to show\n\t\tif (actionBarWidth() <= containerWidth && this.hiddenActions.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (actionBarWidth() > containerWidth) {\n\t\t\t// Check for max items limit\n\t\t\tif (this.options.responsiveBehavior?.minItems !== undefined) {\n\t\t\t\tconst primaryActionsCount = this.actionBar.hasAction(this.toggleMenuAction)\n\t\t\t\t\t? this.actionBar.length() - 1\n\t\t\t\t\t: this.actionBar.length();\n\n\t\t\t\tif (primaryActionsCount <= this.options.responsiveBehavior.minItems) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Hide actions from the right\n\t\t\twhile (actionBarWidth() > containerWidth && this.actionBar.length() > 0) {\n\t\t\t\tconst index = this.originalPrimaryActions.length - this.hiddenActions.length - 1;\n\t\t\t\tif (index < 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Store the action and its size\n\t\t\t\tconst size = Math.min(ACTION_MIN_WIDTH, this.getItemWidth(index));\n\t\t\t\tconst action = this.originalPrimaryActions[index];\n\t\t\t\tthis.hiddenActions.unshift({ action, size });\n\n\t\t\t\t// Remove the action\n\t\t\t\tthis.actionBar.pull(index);\n\n\t\t\t\t// There are no secondary actions, but we have actions that we need to hide so we\n\t\t\t\t// create the overflow menu. This will ensure that another primary action will be\n\t\t\t\t// removed making space for the overflow menu.\n\t\t\t\tif (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) {\n\t\t\t\t\tthis.actionBar.push(this.toggleMenuAction, {\n\t\t\t\t\t\ticon: this.options.icon ?? true,\n\t\t\t\t\t\tlabel: this.options.label ?? false,\n\t\t\t\t\t\tkeybinding: this.getKeybindingLabel(this.toggleMenuAction),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Show actions from the top of the toggle menu\n\t\t\twhile (this.hiddenActions.length > 0) {\n\t\t\t\tconst entry = this.hiddenActions.shift()!;\n\t\t\t\tif (actionBarWidth() + entry.size > containerWidth) {\n\t\t\t\t\t// Not enough space to show the action\n\t\t\t\t\tthis.hiddenActions.unshift(entry);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Add the action\n\t\t\t\tthis.actionBar.push(entry.action, {\n\t\t\t\t\ticon: this.options.icon ?? true,\n\t\t\t\t\tlabel: this.options.label ?? false,\n\t\t\t\t\tkeybinding: this.getKeybindingLabel(entry.action),\n\t\t\t\t\tindex: this.originalPrimaryActions.length - this.hiddenActions.length - 1\n\t\t\t\t});\n\n\t\t\t\t// There are no secondary actions, and there is only one hidden item left so we\n\t\t\t\t// remove the overflow menu making space for the last hidden action to be shown.\n\t\t\t\tif (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) {\n\t\t\t\t\tthis.toggleMenuAction.menuActions = [];\n\t\t\t\t\tthis.actionBar.pull(this.actionBar.length() - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update overflow menu\n\t\tconst hiddenActions = this.hiddenActions.map(entry => entry.action);\n\t\tif (this.originalSecondaryActions.length > 0 || hiddenActions.length > 0) {\n\t\t\tconst secondaryActions = this.originalSecondaryActions.slice(0);\n\t\t\tthis.toggleMenuAction.menuActions = Separator.join(hiddenActions, secondaryActions);\n\t\t}\n\t}\n\n\tprivate clear(): void {\n\t\tthis.submenuActionViewItems = [];\n\t\tthis.disposables.clear();\n\t\tthis.actionBar.clear();\n\t}\n\n\toverride dispose(): void {\n\t\tthis.clear();\n\t\tthis.disposables.dispose();\n\t\tsuper.dispose();\n\t}\n}\n\nexport class ToggleMenuAction extends Action {\n\n\tstatic readonly ID = 'toolbar.toggle.more';\n\n\tprivate _menuActions: ReadonlyArray<IAction>;\n\tprivate toggleDropdownMenu: () => void;\n\n\tconstructor(toggleDropdownMenu: () => void, title?: string) {\n\t\ttitle = title || nls.localize('moreActions', \"More Actions...\");\n\t\tsuper(ToggleMenuAction.ID, title, undefined, true);\n\n\t\tthis._menuActions = [];\n\t\tthis.toggleDropdownMenu = toggleDropdownMenu;\n\t}\n\n\toverride async run(): Promise<void> {\n\t\tthis.toggleDropdownMenu();\n\t}\n\n\tget menuActions(): ReadonlyArray<IAction> {\n\t\treturn this._menuActions;\n\t}\n\n\tset menuActions(actions: ReadonlyArray<IAction>) {\n\t\tthis._menuActions = actions;\n\t}\n}\n"]}
package/esm/vs/nls.js CHANGED
@@ -2,10 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Licensed under the MIT License. See License.txt in the project root for license information.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- // eslint-disable-next-line local/code-import-patterns
6
- import { getNLSLanguage, getNLSMessages } from './nls.messages.js';
7
- // eslint-disable-next-line local/code-import-patterns
8
- export { getNLSLanguage, getNLSMessages } from './nls.messages.js';
5
+ export function getNLSMessages() {
6
+ return globalThis._VSCODE_NLS_MESSAGES;
7
+ }
8
+ export function getNLSLanguage() {
9
+ return globalThis._VSCODE_NLS_LANGUAGE;
10
+ }
9
11
  const isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);
10
12
  function _format(message, args) {
11
13
  let result;
package/esm/vs/nls.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/nls.ts","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AC;IAErC,OAAO;QACN,KAAK;QACL,QAAQ,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;KAC9E,CAAC;AACH,CAAC","file":"nls.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\n// eslint-disable-next-line local/code-import-patterns\nimport { getNLSLanguage, getNLSMessages } from './nls.messages.js';\n// eslint-disable-next-line local/code-import-patterns\nexport { getNLSLanguage, getNLSMessages } from './nls.messages.js';\n\ndeclare const document: { location?: { hash?: string } } | undefined;\nconst isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);\n\nexport interface ILocalizeInfo {\n\tkey: string;\n\tcomment: string[];\n}\n\nexport interface ILocalizedString {\n\toriginal: string;\n\tvalue: string;\n}\n\nfunction _format(message: string, args: (string | number | boolean | undefined | null)[]): string {\n\tlet result: string;\n\n\tif (args.length === 0) {\n\t\tresult = message;\n\t} else {\n\t\tresult = message.replace(/\\{(\\d+)\\}/g, (match, rest) => {\n\t\t\tconst index = rest[0];\n\t\t\tconst arg = args[index];\n\t\t\tlet result = match;\n\t\t\tif (typeof arg === 'string') {\n\t\t\t\tresult = arg;\n\t\t\t} else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {\n\t\t\t\tresult = String(arg);\n\t\t\t}\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tif (isPseudo) {\n\t\t// FF3B and FF3D is the Unicode zenkaku representation for [ and ]\n\t\tresult = '\\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\\uFF3D';\n\t}\n\n\treturn result;\n}\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example For example, `localize('sayHello', 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * @skipMangle\n */\nexport function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string {\n\tif (typeof data === 'number') {\n\t\treturn _format(lookupMessage(data, message), args);\n\t}\n\treturn _format(message, args);\n}\n\n/**\n * Only used when built: Looks up the message in the global NLS table.\n * This table is being made available as a global through bootstrapping\n * depending on the target context.\n */\nfunction lookupMessage(index: number, fallback: string | null): string {\n\tconst message = getNLSMessages()?.[index];\n\tif (typeof message !== 'string') {\n\t\tif (typeof fallback === 'string') {\n\t\t\treturn fallback;\n\t\t}\n\t\tthrow new Error(`!!! NLS MISSING: ${index} !!!`);\n\t}\n\treturn message;\n}\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize('sayHello', 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * @skipMangle\n */\nexport function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString {\n\tlet message: string;\n\tif (typeof data === 'number') {\n\t\tmessage = lookupMessage(data, originalMessage);\n\t} else {\n\t\tmessage = originalMessage;\n\t}\n\n\tconst value = _format(message, args);\n\n\treturn {\n\t\tvalue,\n\t\toriginal: originalMessage === message ? value : _format(originalMessage, args)\n\t};\n}\n\nexport interface INLSLanguagePackConfiguration {\n\n\t/**\n\t * The path to the translations config file that contains pointers to\n\t * all message bundles for `main` and extensions.\n\t */\n\treadonly translationsConfigFile: string;\n}\n\nexport interface INLSConfiguration {\n\n\t/**\n\t * Locale as defined in `argv.json` or `app.getLocale()`.\n\t */\n\treadonly userLocale: string;\n\n\t/**\n\t * Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`).\n\t */\n\treadonly osLocale: string;\n\n\t/**\n\t * The actual language of the UI that ends up being used considering `userLocale`\n\t * and `osLocale`.\n\t */\n\treadonly resolvedLanguage: string;\n\n\t/**\n\t * Defined if a language pack is used that is not the\n\t * default english language pack. This requires a language\n\t * pack to be installed as extension.\n\t */\n\treadonly languagePack?: INLSLanguagePackConfiguration;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n// eslint-disable-next-line local/code-import-patterns\nimport { getNLSLanguage, getNLSMessages } from './nls.messages.js';\n// eslint-disable-next-line local/code-import-patterns\nexport { getNLSLanguage, getNLSMessages } from './nls.messages.js';\n\ndeclare const document: { location?: { hash?: string } } | undefined;\nconst isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);\n\nexport interface ILocalizeInfo {\n\tkey: string;\n\tcomment: string[];\n}\n\nexport interface ILocalizedString {\n\toriginal: string;\n\tvalue: string;\n}\n\nfunction _format(message: string, args: (string | number | boolean | undefined | null)[]): string {\n\tlet result: string;\n\n\tif (args.length === 0) {\n\t\tresult = message;\n\t} else {\n\t\tresult = message.replace(/\\{(\\d+)\\}/g, (match, rest) => {\n\t\t\tconst index = rest[0];\n\t\t\tconst arg = args[index];\n\t\t\tlet result = match;\n\t\t\tif (typeof arg === 'string') {\n\t\t\t\tresult = arg;\n\t\t\t} else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {\n\t\t\t\tresult = String(arg);\n\t\t\t}\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tif (isPseudo) {\n\t\t// FF3B and FF3D is the Unicode zenkaku representation for [ and ]\n\t\tresult = '\\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\\uFF3D';\n\t}\n\n\treturn result;\n}\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example For example, `localize('sayHello', 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * @skipMangle\n */\nexport function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string {\n\tif (typeof data === 'number') {\n\t\treturn _format(lookupMessage(data, message), args);\n\t}\n\treturn _format(message, args);\n}\n\n/**\n * Only used when built: Looks up the message in the global NLS table.\n * This table is being made available as a global through bootstrapping\n * depending on the target context.\n */\nfunction lookupMessage(index: number, fallback: string | null): string {\n\tconst message = getNLSMessages()?.[index];\n\tif (typeof message !== 'string') {\n\t\tif (typeof fallback === 'string') {\n\t\t\treturn fallback;\n\t\t}\n\t\tthrow new Error(`!!! NLS MISSING: ${index} !!!`);\n\t}\n\treturn message;\n}\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize('sayHello', 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * @skipMangle\n */\nexport function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString {\n\tlet message: string;\n\tif (typeof data === 'number') {\n\t\tmessage = lookupMessage(data, originalMessage);\n\t} else {\n\t\tmessage = originalMessage;\n\t}\n\n\tconst value = _format(message, args);\n\n\treturn {\n\t\tvalue,\n\t\toriginal: originalMessage === message ? value : _format(originalMessage, args)\n\t};\n}\n\nexport interface INLSLanguagePackConfiguration {\n\n\t/**\n\t * The path to the translations config file that contains pointers to\n\t * all message bundles for `main` and extensions.\n\t */\n\treadonly translationsConfigFile: string;\n}\n\nexport interface INLSConfiguration {\n\n\t/**\n\t * Locale as defined in `argv.json` or `app.getLocale()`.\n\t */\n\treadonly userLocale: string;\n\n\t/**\n\t * Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`).\n\t */\n\treadonly osLocale: string;\n\n\t/**\n\t * The actual language of the UI that ends up being used considering `userLocale`\n\t * and `osLocale`.\n\t */\n\treadonly resolvedLanguage: string;\n\n\t/**\n\t * Defined if a language pack is used that is not the\n\t * default english language pack. This requires a language\n\t * pack to be installed as extension.\n\t */\n\treadonly languagePack?: INLSLanguagePackConfiguration;\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/nls.ts","vs/nls.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,MAAM,UAAU,cAAc;IAC7B,OAAO,UAAU,CAAC,oBAAoB,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,cAAc;IAC7B,OAAO,UAAU,CAAC,oBAAoB,CAAC;AACxC,CAAC;AAGD,MAAM,QAAQ,GAAG,cAAc,EAAE,KAAK,QAAQ,IAAI,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,QAAQ,IAAI,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC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AC,CAAC;IACpD,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,KAAa,EAAE,QAAuB;IAC5D,MAAM,OAAO,GAAG,cAAc,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,QAAQ,CAAC;QACjB,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAgCD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAA4B,CAAC,yBAAyB,EAAE,eAAuB,EAAE,GAAG,IAAsD;IACnK,IAAI,OAAe,CAAC;IACpB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,GAAG,aAAa,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACP,OAAO,GAAG,eAAe,CAAC;IAC3B,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAErC,OAAO;QACN,KAAK;QACL,QAAQ,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;KAC9E,CAAC;AACH,CAAC","file":"nls.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport function getNLSMessages(): string[] {\n\treturn globalThis._VSCODE_NLS_MESSAGES;\n}\n\nexport function getNLSLanguage(): string | undefined {\n\treturn globalThis._VSCODE_NLS_LANGUAGE;\n}\n\ndeclare const document: { location?: { hash?: string } } | undefined;\nconst isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);\n\nexport interface ILocalizeInfo {\n\tkey: string;\n\tcomment: string[];\n}\n\nexport interface ILocalizedString {\n\toriginal: string;\n\tvalue: string;\n}\n\nfunction _format(message: string, args: (string | number | boolean | undefined | null)[]): string {\n\tlet result: string;\n\n\tif (args.length === 0) {\n\t\tresult = message;\n\t} else {\n\t\tresult = message.replace(/\\{(\\d+)\\}/g, (match, rest) => {\n\t\t\tconst index = rest[0];\n\t\t\tconst arg = args[index];\n\t\t\tlet result = match;\n\t\t\tif (typeof arg === 'string') {\n\t\t\t\tresult = arg;\n\t\t\t} else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {\n\t\t\t\tresult = String(arg);\n\t\t\t}\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tif (isPseudo) {\n\t\t// FF3B and FF3D is the Unicode zenkaku representation for [ and ]\n\t\tresult = '\\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\\uFF3D';\n\t}\n\n\treturn result;\n}\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example For example, `localize('sayHello', 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * @skipMangle\n */\nexport function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string {\n\tif (typeof data === 'number') {\n\t\treturn _format(lookupMessage(data, message), args);\n\t}\n\treturn _format(message, args);\n}\n\n/**\n * Only used when built: Looks up the message in the global NLS table.\n * This table is being made available as a global through bootstrapping\n * depending on the target context.\n */\nfunction lookupMessage(index: number, fallback: string | null): string {\n\tconst message = getNLSMessages()?.[index];\n\tif (typeof message !== 'string') {\n\t\tif (typeof fallback === 'string') {\n\t\t\treturn fallback;\n\t\t}\n\t\tthrow new Error(`!!! NLS MISSING: ${index} !!!`);\n\t}\n\treturn message;\n}\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize('sayHello', 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * @skipMangle\n */\nexport function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString {\n\tlet message: string;\n\tif (typeof data === 'number') {\n\t\tmessage = lookupMessage(data, originalMessage);\n\t} else {\n\t\tmessage = originalMessage;\n\t}\n\n\tconst value = _format(message, args);\n\n\treturn {\n\t\tvalue,\n\t\toriginal: originalMessage === message ? value : _format(originalMessage, args)\n\t};\n}\n\nexport interface INLSLanguagePackConfiguration {\n\n\t/**\n\t * The path to the translations config file that contains pointers to\n\t * all message bundles for `main` and extensions.\n\t */\n\treadonly translationsConfigFile: string;\n}\n\nexport interface INLSConfiguration {\n\n\t/**\n\t * Locale as defined in `argv.json` or `app.getLocale()`.\n\t */\n\treadonly userLocale: string;\n\n\t/**\n\t * Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`).\n\t */\n\treadonly osLocale: string;\n\n\t/**\n\t * The actual language of the UI that ends up being used considering `userLocale`\n\t * and `osLocale`.\n\t */\n\treadonly resolvedLanguage: string;\n\n\t/**\n\t * Defined if a language pack is used that is not the\n\t * default english language pack. This requires a language\n\t * pack to be installed as extension.\n\t */\n\treadonly languagePack?: INLSLanguagePackConfiguration;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nexport function getNLSMessages(): string[] {\n\treturn globalThis._VSCODE_NLS_MESSAGES;\n}\n\nexport function getNLSLanguage(): string | undefined {\n\treturn globalThis._VSCODE_NLS_LANGUAGE;\n}\n\ndeclare const document: { location?: { hash?: string } } | undefined;\nconst isPseudo = getNLSLanguage() === 'pseudo' || (typeof document !== 'undefined' && document.location && typeof document.location.hash === 'string' && document.location.hash.indexOf('pseudo=true') >= 0);\n\nexport interface ILocalizeInfo {\n\tkey: string;\n\tcomment: string[];\n}\n\nexport interface ILocalizedString {\n\toriginal: string;\n\tvalue: string;\n}\n\nfunction _format(message: string, args: (string | number | boolean | undefined | null)[]): string {\n\tlet result: string;\n\n\tif (args.length === 0) {\n\t\tresult = message;\n\t} else {\n\t\tresult = message.replace(/\\{(\\d+)\\}/g, (match, rest) => {\n\t\t\tconst index = rest[0];\n\t\t\tconst arg = args[index];\n\t\t\tlet result = match;\n\t\t\tif (typeof arg === 'string') {\n\t\t\t\tresult = arg;\n\t\t\t} else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {\n\t\t\t\tresult = String(arg);\n\t\t\t}\n\t\t\treturn result;\n\t\t});\n\t}\n\n\tif (isPseudo) {\n\t\t// FF3B and FF3D is the Unicode zenkaku representation for [ and ]\n\t\tresult = '\\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\\uFF3D';\n\t}\n\n\treturn result;\n}\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * Marks a string to be localized. Returns the localized string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example For example, `localize('sayHello', 'hello {0}', name)`\n *\n * @returns string The localized string.\n */\nexport function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;\n\n/**\n * @skipMangle\n */\nexport function localize(data: ILocalizeInfo | string /* | number when built */, message: string /* | null when built */, ...args: (string | number | boolean | undefined | null)[]): string {\n\tif (typeof data === 'number') {\n\t\treturn _format(lookupMessage(data, message), args);\n\t}\n\treturn _format(message, args);\n}\n\n/**\n * Only used when built: Looks up the message in the global NLS table.\n * This table is being made available as a global through bootstrapping\n * depending on the target context.\n */\nfunction lookupMessage(index: number, fallback: string | null): string {\n\tconst message = getNLSMessages()?.[index];\n\tif (typeof message !== 'string') {\n\t\tif (typeof fallback === 'string') {\n\t\t\treturn fallback;\n\t\t}\n\t\tthrow new Error(`!!! NLS MISSING: ${index} !!!`);\n\t}\n\treturn message;\n}\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string.\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * Marks a string to be localized. Returns an {@linkcode ILocalizedString}\n * which contains the localized string and the original string.\n *\n * @param key The key to use for localizing the string\n * @param message The string to localize\n * @param args The arguments to the string\n *\n * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args`\n * @example `localize('sayHello', 'hello {0}', name)`\n *\n * @returns ILocalizedString which contains the localized string and the original string.\n */\nexport function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString;\n\n/**\n * @skipMangle\n */\nexport function localize2(data: ILocalizeInfo | string /* | number when built */, originalMessage: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString {\n\tlet message: string;\n\tif (typeof data === 'number') {\n\t\tmessage = lookupMessage(data, originalMessage);\n\t} else {\n\t\tmessage = originalMessage;\n\t}\n\n\tconst value = _format(message, args);\n\n\treturn {\n\t\tvalue,\n\t\toriginal: originalMessage === message ? value : _format(originalMessage, args)\n\t};\n}\n\nexport interface INLSLanguagePackConfiguration {\n\n\t/**\n\t * The path to the translations config file that contains pointers to\n\t * all message bundles for `main` and extensions.\n\t */\n\treadonly translationsConfigFile: string;\n}\n\nexport interface INLSConfiguration {\n\n\t/**\n\t * Locale as defined in `argv.json` or `app.getLocale()`.\n\t */\n\treadonly userLocale: string;\n\n\t/**\n\t * Locale as defined by the OS (e.g. `app.getPreferredSystemLanguages()`).\n\t */\n\treadonly osLocale: string;\n\n\t/**\n\t * The actual language of the UI that ends up being used considering `userLocale`\n\t * and `osLocale`.\n\t */\n\treadonly resolvedLanguage: string;\n\n\t/**\n\t * Defined if a language pack is used that is not the\n\t * default english language pack. This requires a language\n\t * pack to be installed as extension.\n\t */\n\treadonly languagePack?: INLSLanguagePackConfiguration;\n}\n"]}
@@ -36,12 +36,12 @@
36
36
  }
37
37
 
38
38
  /* give some space between input and action bar */
39
- .quick-input-inline-action-bar > .actions-container > .action-item:first-child {
39
+ .quick-input-inline-action-bar .actions-container > .action-item:first-child {
40
40
  margin-left: 5px;
41
41
  }
42
42
 
43
43
  /* center horizontally */
44
- .quick-input-inline-action-bar > .actions-container > .action-item {
44
+ .quick-input-inline-action-bar .actions-container > .action-item {
45
45
  margin-top: 2px;
46
46
  }
47
47
 
@@ -59,15 +59,15 @@
59
59
  margin-right: 4px;
60
60
  }
61
61
 
62
- .quick-input-right-action-bar > .actions-container {
62
+ .quick-input-right-action-bar .actions-container {
63
63
  justify-content: flex-end;
64
64
  }
65
65
 
66
- .quick-input-right-action-bar > .actions-container > .action-item {
66
+ .quick-input-right-action-bar .actions-container > .action-item {
67
67
  margin-left: 4px;
68
68
  }
69
69
 
70
- .quick-input-inline-action-bar > .actions-container > .action-item {
70
+ .quick-input-inline-action-bar .actions-container > .action-item {
71
71
  margin-left: 4px;
72
72
  }
73
73
 
@@ -24,7 +24,7 @@ import { ThemeIcon } from '../../../base/common/themables.js';
24
24
  import './media/quickInput.css';
25
25
  import { localize } from '../../../nls.js';
26
26
  import { ItemActivation, NO_KEY_MODS, QuickInputButtonLocation, QuickInputHideReason, QuickPickFocus } from '../common/quickInput.js';
27
- import { quickInputButtonToAction, renderQuickInputDescription } from './quickInputUtils.js';
27
+ import { quickInputButtonToAction, quickInputButtonsToActionArrays, renderQuickInputDescription } from './quickInputUtils.js';
28
28
  import { IConfigurationService } from '../../configuration/common/configuration.js';
29
29
  import { IHoverService, WorkbenchHoverDelegate } from '../../hover/browser/hover.js';
30
30
  import { ContextKeyExpr, RawContextKey } from '../../contextkey/common/contextkey.js';
@@ -259,18 +259,12 @@ export class QuickInput extends Disposable {
259
259
  }
260
260
  if (this.buttonsUpdated) {
261
261
  this.buttonsUpdated = false;
262
- this.ui.leftActionBar.clear();
263
- const leftButtons = this._leftButtons
264
- .map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button)));
265
- this.ui.leftActionBar.push(leftButtons, { icon: true, label: false });
266
- this.ui.rightActionBar.clear();
267
- const rightButtons = this._rightButtons
268
- .map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button)));
269
- this.ui.rightActionBar.push(rightButtons, { icon: true, label: false });
270
- this.ui.inlineActionBar.clear();
271
- const inlineButtons = this._inlineButtons
272
- .map((button, index) => quickInputButtonToAction(button, `id-${index}`, async () => this.onDidTriggerButtonEmitter.fire(button)));
273
- this.ui.inlineActionBar.push(inlineButtons, { icon: true, label: false });
262
+ const leftActions = quickInputButtonsToActionArrays(this._leftButtons, 'left-button', (button) => this.onDidTriggerButtonEmitter.fire(button));
263
+ this.ui.leftActionBar.setActions(leftActions.primary, leftActions.secondary);
264
+ const rightActions = quickInputButtonsToActionArrays(this._rightButtons, 'right-button', (button) => this.onDidTriggerButtonEmitter.fire(button));
265
+ this.ui.rightActionBar.setActions(rightActions.primary, rightActions.secondary);
266
+ const inlineActions = quickInputButtonsToActionArrays(this._inlineButtons, 'inline-button', (button) => this.onDidTriggerButtonEmitter.fire(button));
267
+ this.ui.inlineActionBar.setActions(inlineActions.primary, inlineActions.secondary);
274
268
  // Adjust count badge position based on input buttons (each button/toggle is ~22px wide)
275
269
  const inputButtonOffset = this._inputButtons.length * 22;
276
270
  this.ui.countContainer.style.right = inputButtonOffset > 0 ? `${4 + inputButtonOffset}px` : '4px';