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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/esm/nls.keys.json +1 -1
  2. package/esm/nls.messages.cs.js +2 -2
  3. package/esm/nls.messages.de.js +2 -2
  4. package/esm/nls.messages.es.js +2 -2
  5. package/esm/nls.messages.fr.js +2 -2
  6. package/esm/nls.messages.it.js +2 -2
  7. package/esm/nls.messages.ja.js +2 -2
  8. package/esm/nls.messages.js +1 -1
  9. package/esm/nls.messages.json +1 -1
  10. package/esm/nls.messages.ko.js +2 -2
  11. package/esm/nls.messages.pl.js +2 -2
  12. package/esm/nls.messages.pt-br.js +2 -2
  13. package/esm/nls.messages.ru.js +2 -2
  14. package/esm/nls.messages.tr.js +2 -2
  15. package/esm/nls.messages.zh-cn.js +2 -2
  16. package/esm/nls.messages.zh-tw.js +2 -2
  17. package/esm/nls.metadata.json +2 -0
  18. package/esm/vs/base/browser/ui/actionbar/actionbar.js +17 -0
  19. package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
  20. package/esm/vs/base/browser/ui/iconLabel/iconLabel.js +2 -1
  21. package/esm/vs/base/browser/ui/iconLabel/iconLabel.js.map +1 -1
  22. package/esm/vs/base/browser/ui/scrollbar/media/scrollbars.css +4 -0
  23. package/esm/vs/base/browser/ui/toolbar/toolbar.css +11 -0
  24. package/esm/vs/base/browser/ui/toolbar/toolbar.js +115 -2
  25. package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
  26. package/esm/vs/base/common/jsonSchema.js.map +1 -1
  27. package/esm/vs/editor/common/cursor/cursorWordOperations.js +14 -4
  28. package/esm/vs/editor/common/cursor/cursorWordOperations.js.map +1 -1
  29. package/esm/vs/editor/common/languages/textToHtmlTokenizer.js +21 -10
  30. package/esm/vs/editor/common/languages/textToHtmlTokenizer.js.map +1 -1
  31. package/esm/vs/editor/common/languages.js +5 -5
  32. package/esm/vs/editor/common/languages.js.map +1 -1
  33. package/esm/vs/editor/common/standalone/standaloneEnums.js +5 -5
  34. package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
  35. package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js.map +1 -1
  36. package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js.map +1 -1
  37. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +5 -5
  38. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  39. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +2 -2
  40. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  41. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +22 -24
  42. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
  43. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +16 -22
  44. package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
  45. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  46. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js.map +1 -1
  47. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -6
  48. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js.map +1 -1
  49. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +6 -2
  50. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
  51. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.js.map +1 -1
  52. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +6 -6
  53. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js.map +1 -1
  54. package/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js +6 -0
  55. package/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js.map +1 -1
  56. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
  57. package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js.map +1 -1
  58. package/esm/vs/editor/editor.api.d.ts +20 -18
  59. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +1 -1
  60. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  61. package/esm/vs/platform/theme/common/colorUtils.js +2 -2
  62. package/esm/vs/platform/theme/common/colors/miscColors.js +5 -4
  63. package/esm/vs/platform/theme/common/colors/miscColors.js.map +1 -1
  64. package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  65. package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
  66. package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
  67. package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  68. package/esm/vs/platform/workspace/common/workspace.js +1 -1
  69. package/monaco.d.ts +20 -18
  70. package/package.json +2 -2
@@ -8,10 +8,12 @@ import { Action, Separator, SubmenuAction } from '../../../common/actions.js';
8
8
  import { Codicon } from '../../../common/codicons.js';
9
9
  import { ThemeIcon } from '../../../common/themables.js';
10
10
  import { EventMultiplexer } from '../../../common/event.js';
11
- import { Disposable, DisposableStore } from '../../../common/lifecycle.js';
11
+ import { Disposable, DisposableStore, toDisposable } from '../../../common/lifecycle.js';
12
12
  import './toolbar.css';
13
13
  import * as nls from '../../../../nls.js';
14
14
  import { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';
15
+ import { BaseActionViewItem } from '../actionbar/actionViewItems.js';
16
+ const ACTION_MIN_WIDTH = 24; /* 20px codicon + 4px left padding*/
15
17
  /**
16
18
  * A widget that combines an action bar for primary actions and a dropdown for secondary actions.
17
19
  */
@@ -22,6 +24,9 @@ export class ToolBar extends Disposable {
22
24
  this.submenuActionViewItems = [];
23
25
  this.hasSecondaryActions = false;
24
26
  this._onDidChangeDropdownVisibility = this._register(new EventMultiplexer());
27
+ this.originalPrimaryActions = [];
28
+ this.originalSecondaryActions = [];
29
+ this.hiddenActions = [];
25
30
  this.disposables = this._register(new DisposableStore());
26
31
  options.hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());
27
32
  this.options = options;
@@ -38,7 +43,7 @@ export class ToolBar extends Disposable {
38
43
  hoverDelegate: options.hoverDelegate,
39
44
  actionViewItemProvider: (action, viewItemOptions) => {
40
45
  if (action.id === ToggleMenuAction.ID) {
41
- this.toggleMenuActionViewItem = new DropdownMenuActionViewItem(action, action.menuActions, contextMenuProvider, {
46
+ this.toggleMenuActionViewItem = new DropdownMenuActionViewItem(action, { getActions: () => this.toggleMenuAction.menuActions }, contextMenuProvider, {
42
47
  actionViewItemProvider: this.options.actionViewItemProvider,
43
48
  actionRunner: this.actionRunner,
44
49
  keybindingProvider: this.options.getKeyBinding,
@@ -78,6 +83,15 @@ export class ToolBar extends Disposable {
78
83
  return undefined;
79
84
  }
80
85
  }));
86
+ // Responsive support
87
+ if (this.options.responsive) {
88
+ this.element.classList.add('responsive');
89
+ const observer = new ResizeObserver(() => {
90
+ this.setToolbarMaxWidth(this.element.getBoundingClientRect().width);
91
+ });
92
+ observer.observe(this.element);
93
+ this._store.add(toDisposable(() => observer.disconnect()));
94
+ }
81
95
  }
82
96
  set actionRunner(actionRunner) {
83
97
  this.actionBar.actionRunner = actionRunner;
@@ -98,8 +112,14 @@ export class ToolBar extends Disposable {
98
112
  getItemAction(indexOrElement) {
99
113
  return this.actionBar.getAction(indexOrElement);
100
114
  }
115
+ getItemWidth(index) {
116
+ return this.actionBar.getWidth(index);
117
+ }
101
118
  setActions(primaryActions, secondaryActions) {
102
119
  this.clear();
120
+ // Store primary and secondary actions as rendered initially
121
+ this.originalPrimaryActions = primaryActions ? primaryActions.slice(0) : [];
122
+ this.originalSecondaryActions = secondaryActions ? secondaryActions.slice(0) : [];
103
123
  const primaryActionsToSet = primaryActions ? primaryActions.slice(0) : [];
104
124
  // Inject additional action to open secondary actions if present
105
125
  this.hasSecondaryActions = !!(secondaryActions && secondaryActions.length > 0);
@@ -113,11 +133,104 @@ export class ToolBar extends Disposable {
113
133
  primaryActionsToSet.forEach(action => {
114
134
  this.actionBar.push(action, { icon: this.options.icon ?? true, label: this.options.label ?? false, keybinding: this.getKeybindingLabel(action) });
115
135
  });
136
+ if (this.options.responsive) {
137
+ // Reset hidden actions
138
+ this.hiddenActions.length = 0;
139
+ // Set `responsive` class
140
+ this.setToolbarResponsiveAction();
141
+ // Update toolbar to fit with container width
142
+ this.setToolbarMaxWidth(this.element.getBoundingClientRect().width);
143
+ }
116
144
  }
117
145
  getKeybindingLabel(action) {
118
146
  const key = this.options.getKeyBinding?.(action);
119
147
  return key?.getLabel() ?? undefined;
120
148
  }
149
+ getItemsWidthResponsive() {
150
+ let itemsWidth = 0;
151
+ for (let index = 0; index < this.actionBar.length(); index++) {
152
+ // If the last visible primary action is wider than 24px, it means that it has a label. We
153
+ // need to return the minimum width (24px) for this action so that we allow it to shrink to
154
+ // the minimum width.
155
+ const width = index === this.originalPrimaryActions.length - this.hiddenActions.length - 1
156
+ ? Math.min(ACTION_MIN_WIDTH, this.actionBar.getWidth(index))
157
+ : this.actionBar.getWidth(index);
158
+ itemsWidth += width;
159
+ }
160
+ return itemsWidth;
161
+ }
162
+ setToolbarMaxWidth(maxWidth) {
163
+ if (this.actionBar.isEmpty() ||
164
+ (this.getItemsWidthResponsive() <= maxWidth && this.hiddenActions.length === 0)) {
165
+ return;
166
+ }
167
+ if (this.getItemsWidthResponsive() > maxWidth) {
168
+ // Hide actions from the right
169
+ while (this.getItemsWidthResponsive() > maxWidth && this.actionBar.length() > 0) {
170
+ const index = this.originalPrimaryActions.length - this.hiddenActions.length - 1;
171
+ if (index < 0) {
172
+ break;
173
+ }
174
+ // Store the action and its size
175
+ const size = Math.min(ACTION_MIN_WIDTH, this.getItemWidth(index));
176
+ const action = this.originalPrimaryActions[index];
177
+ this.hiddenActions.unshift({ action, size });
178
+ // Remove the action
179
+ this.actionBar.pull(index);
180
+ // There are no secondary actions, but we have actions that we need to hide so we
181
+ // create the overflow menu. This will ensure that another primary action will be
182
+ // removed making space for the overflow menu.
183
+ if (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) {
184
+ this.actionBar.push(this.toggleMenuAction, {
185
+ icon: this.options.icon ?? true,
186
+ label: this.options.label ?? false,
187
+ keybinding: this.getKeybindingLabel(this.toggleMenuAction),
188
+ });
189
+ }
190
+ }
191
+ }
192
+ else {
193
+ // Show actions from the top of the toggle menu
194
+ while (this.hiddenActions.length > 0) {
195
+ const entry = this.hiddenActions.shift();
196
+ if (this.getItemsWidthResponsive() + entry.size > maxWidth) {
197
+ // Not enough space to show the action
198
+ this.hiddenActions.unshift(entry);
199
+ break;
200
+ }
201
+ // Add the action
202
+ this.actionBar.push(entry.action, {
203
+ icon: this.options.icon ?? true,
204
+ label: this.options.label ?? false,
205
+ keybinding: this.getKeybindingLabel(entry.action),
206
+ index: this.originalPrimaryActions.length - this.hiddenActions.length - 1
207
+ });
208
+ // There are no secondary actions, and there is only one hidden item left so we
209
+ // remove the overflow menu making space for the last hidden action to be shown.
210
+ if (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 1) {
211
+ this.toggleMenuAction.menuActions = [];
212
+ this.actionBar.pull(this.actionBar.length() - 1);
213
+ }
214
+ }
215
+ }
216
+ // Update `responsive` class
217
+ this.setToolbarResponsiveAction();
218
+ // Update overflow menu
219
+ const hiddenActions = this.hiddenActions.map(entry => entry.action);
220
+ if (this.originalSecondaryActions.length > 0 || hiddenActions.length > 0) {
221
+ const secondaryActions = this.originalSecondaryActions.slice(0);
222
+ this.toggleMenuAction.menuActions = Separator.join(hiddenActions, secondaryActions);
223
+ }
224
+ }
225
+ setToolbarResponsiveAction() {
226
+ // Set the `responsive` class on the last visible primary action
227
+ for (let index = 0; index < this.actionBar.viewItems.length; index++) {
228
+ if (this.actionBar.viewItems[index] instanceof BaseActionViewItem) {
229
+ const isLastVisiblePrimaryAction = index === this.originalPrimaryActions.length - this.hiddenActions.length - 1;
230
+ this.actionBar.viewItems[index].element?.classList.toggle('responsive', isLastVisiblePrimaryAction);
231
+ }
232
+ }
233
+ }
121
234
  clear() {
122
235
  this.submenuActionViewItems = [];
123
236
  this.disposables.clear();
@@ -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,MAAM,8BAA8B,CAAC;AAC3E,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAiC9E;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,UAAU;IAUtC,IAAI,6BAA6B,KAAK,OAAO,IAAI,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC,CAAC;IAGzF,YAAY,SAAsB,EAAE,mBAAyC,EAAE,UAA2B,EAAE,WAAW,uCAA+B,EAAE;QACvJ,KAAK,EAAE,CAAC;QATD,2BAA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CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjD,OAAO,GAAG,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;IACrC,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 } 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\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\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 readonly disposables = this._register(new DisposableStore());\n\n\tconstructor(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(<ToggleMenuAction>action).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\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\tsetActions(primaryActions: ReadonlyArray<IAction>, secondaryActions?: ReadonlyArray<IAction>): void {\n\t\tthis.clear();\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\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 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;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,gBAAgB,GAAG,EAAE,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C3B,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';\nimport { BaseActionViewItem } from '../actionbar/actionViewItems.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 * Hiding actions that are not visible\n\t */\n\tresponsive?: boolean;\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(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.responsive) {\n\t\t\tthis.element.classList.add('responsive');\n\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tthis.setToolbarMaxWidth(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.responsive) {\n\t\t\t// Reset hidden actions\n\t\t\tthis.hiddenActions.length = 0;\n\n\t\t\t// Set `responsive` class\n\t\t\tthis.setToolbarResponsiveAction();\n\n\t\t\t// Update toolbar to fit with container width\n\t\t\tthis.setToolbarMaxWidth(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 getItemsWidthResponsive(): number {\n\t\tlet itemsWidth = 0;\n\t\tfor (let index = 0; index < this.actionBar.length(); index++) {\n\t\t\t// If the last visible primary action is wider than 24px, it means that it has a label. We\n\t\t\t// need to return the minimum width (24px) for this action so that we allow it to shrink to\n\t\t\t// the minimum width.\n\t\t\tconst width = index === this.originalPrimaryActions.length - this.hiddenActions.length - 1\n\t\t\t\t? Math.min(ACTION_MIN_WIDTH, this.actionBar.getWidth(index))\n\t\t\t\t: this.actionBar.getWidth(index);\n\n\t\t\titemsWidth += width;\n\t\t}\n\n\t\treturn itemsWidth;\n\t}\n\n\tprivate setToolbarMaxWidth(maxWidth: number) {\n\t\tif (\n\t\t\tthis.actionBar.isEmpty() ||\n\t\t\t(this.getItemsWidthResponsive() <= maxWidth && this.hiddenActions.length === 0)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.getItemsWidthResponsive() > maxWidth) {\n\t\t\t// Hide actions from the right\n\t\t\twhile (this.getItemsWidthResponsive() > maxWidth && 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 (this.getItemsWidthResponsive() + entry.size > maxWidth) {\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 `responsive` class\n\t\tthis.setToolbarResponsiveAction();\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 setToolbarResponsiveAction(): void {\n\t\t// Set the `responsive` class on the last visible primary action\n\t\tfor (let index = 0; index < this.actionBar.viewItems.length; index++) {\n\t\t\tif (this.actionBar.viewItems[index] instanceof BaseActionViewItem) {\n\t\t\t\tconst isLastVisiblePrimaryAction = index === this.originalPrimaryActions.length - this.hiddenActions.length - 1;\n\t\t\t\t(this.actionBar.viewItems[index] as BaseActionViewItem).element?.classList.toggle('responsive', isLastVisiblePrimaryAction);\n\t\t\t}\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 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/jsonSchema.ts","vs/base/common/jsonSchema.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","file":"jsonSchema.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 type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';\n\nexport interface IJSONSchema {\n\ttype?: JSONSchemaType | JSONSchemaType[];\n\tdefault?: any;\n\tdefinitions?: IJSONSchemaMap;\n\tdescription?: string;\n\tproperties?: IJSONSchemaMap;\n\tpatternProperties?: IJSONSchemaMap;\n\tadditionalProperties?: boolean | IJSONSchema;\n\titems?: IJSONSchema | IJSONSchema[];\n\tpattern?: string;\n\tminimum?: number;\n\tmaximum?: number;\n\trequired?: string[];\n\t$ref?: string;\n\tanyOf?: IJSONSchema[];\n\toneOf?: IJSONSchema[];\n\tenum?: any[];\n\tformat?: string;\n\n\t// schema draft 06\n\tconst?: any;\n\tdeprecated?: boolean;\n\n\t// VSCode extensions\n\n\tdefaultSnippets?: IJSONSchemaSnippet[];\n\terrorMessage?: string;\n\tpatternErrorMessage?: string;\n\tdeprecationMessage?: string;\n\tmarkdownDeprecationMessage?: string;\n\tenumDescriptions?: string[];\n\tmarkdownEnumDescriptions?: string[];\n\tmarkdownDescription?: string;\n\tallowComments?: boolean;\n\tallowTrailingCommas?: boolean;\n}\n\nexport interface IJSONSchemaMap {\n\t[name: string]: IJSONSchema;\n}\n\nexport interface IJSONSchemaSnippet {\n\tbody?: any; // an already stringified JSON object that can contain new lines (\\n) and tabs (\\t)\n}\n\n/**\n * Converts a basic JSON schema to a TypeScript type.\n *\n * TODO: only supports basic schemas. Doesn't support all JSON schema features.\n */\nexport type SchemaToType<T> = T extends { type: 'string' }\n\t? string\n\t: T extends { type: 'number' }\n\t? number\n\t: T extends { type: 'boolean' }\n\t? boolean\n\t: T extends { type: 'null' }\n\t? null\n\t// Object\n\t: T extends { type: 'object'; properties: infer P }\n\t? { [K in keyof P]: SchemaToType<P[K]> }\n\t// Array\n\t: T extends { type: 'array'; items: infer I }\n\t? Array<SchemaToType<I>>\n\t// OneOf\n\t: T extends { oneOf: infer I }\n\t? MapSchemaToType<I>\n\t// Fallthrough\n\t: never;\n\ntype MapSchemaToType<T> = T extends [infer First, ...infer Rest]\n\t? SchemaToType<First> | MapSchemaToType<Rest>\n\t: never;\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 type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';\n\nexport interface IJSONSchema {\n\ttype?: JSONSchemaType | JSONSchemaType[];\n\tdefault?: any;\n\tdefinitions?: IJSONSchemaMap;\n\tdescription?: string;\n\tproperties?: IJSONSchemaMap;\n\tpatternProperties?: IJSONSchemaMap;\n\tadditionalProperties?: boolean | IJSONSchema;\n\titems?: IJSONSchema | IJSONSchema[];\n\tpattern?: string;\n\tminimum?: number;\n\tmaximum?: number;\n\trequired?: string[];\n\t$ref?: string;\n\tanyOf?: IJSONSchema[];\n\toneOf?: IJSONSchema[];\n\tenum?: any[];\n\tformat?: string;\n\n\t// schema draft 06\n\tconst?: any;\n\tdeprecated?: boolean;\n\n\t// VSCode extensions\n\n\tdefaultSnippets?: IJSONSchemaSnippet[];\n\terrorMessage?: string;\n\tpatternErrorMessage?: string;\n\tdeprecationMessage?: string;\n\tmarkdownDeprecationMessage?: string;\n\tenumDescriptions?: string[];\n\tmarkdownEnumDescriptions?: string[];\n\tmarkdownDescription?: string;\n\tallowComments?: boolean;\n\tallowTrailingCommas?: boolean;\n}\n\nexport interface IJSONSchemaMap {\n\t[name: string]: IJSONSchema;\n}\n\nexport interface IJSONSchemaSnippet {\n\tbody?: any; // an already stringified JSON object that can contain new lines (\\n) and tabs (\\t)\n}\n\n/**\n * Converts a basic JSON schema to a TypeScript type.\n *\n * TODO: only supports basic schemas. Doesn't support all JSON schema features.\n */\nexport type SchemaToType<T> = T extends { type: 'string' }\n\t? string\n\t: T extends { type: 'number' }\n\t? number\n\t: T extends { type: 'boolean' }\n\t? boolean\n\t: T extends { type: 'null' }\n\t? null\n\t// Object\n\t: T extends { type: 'object'; properties: infer P }\n\t? { [K in keyof P]: SchemaToType<P[K]> }\n\t// Array\n\t: T extends { type: 'array'; items: infer I }\n\t? Array<SchemaToType<I>>\n\t// OneOf\n\t: T extends { oneOf: infer I }\n\t? MapSchemaToType<I>\n\t// Fallthrough\n\t: never;\n\ntype MapSchemaToType<T> = T extends [infer First, ...infer Rest]\n\t? SchemaToType<First> | MapSchemaToType<Rest>\n\t: never;\n\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/common/jsonSchema.ts","vs/base/common/jsonSchema.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","file":"jsonSchema.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 type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';\n\nexport interface IJSONSchema {\n\ttype?: JSONSchemaType | JSONSchemaType[];\n\tdefault?: any;\n\tdefinitions?: IJSONSchemaMap;\n\tdescription?: string;\n\tproperties?: IJSONSchemaMap;\n\tpatternProperties?: IJSONSchemaMap;\n\tadditionalProperties?: boolean | IJSONSchema;\n\titems?: IJSONSchema | IJSONSchema[];\n\tpattern?: string;\n\tminimum?: number;\n\tmaximum?: number;\n\trequired?: string[];\n\t$ref?: string;\n\tanyOf?: IJSONSchema[];\n\toneOf?: IJSONSchema[];\n\tenum?: any[];\n\tformat?: string;\n\n\t// schema draft 06\n\tconst?: any;\n\tdeprecated?: boolean;\n\n\t// VSCode extensions\n\n\tdefaultSnippets?: IJSONSchemaSnippet[];\n\terrorMessage?: string;\n\tpatternErrorMessage?: string;\n\tdeprecationMessage?: string;\n\tmarkdownDeprecationMessage?: string;\n\tenumDescriptions?: string[];\n\tmarkdownEnumDescriptions?: string[];\n\tmarkdownDescription?: string;\n\tallowComments?: boolean;\n\tallowTrailingCommas?: boolean;\n}\n\nexport interface IJSONSchemaMap {\n\t[name: string]: IJSONSchema;\n}\n\nexport interface IJSONSchemaSnippet {\n\tbody?: any; // an already stringified JSON object that can contain new lines (\\n) and tabs (\\t)\n}\n\n/**\n * Converts a basic JSON schema to a TypeScript type.\n */\nexport type TypeFromJsonSchema<T> =\n\t// enum\n\tT extends { enum: infer EnumValues }\n\t? UnionOf<EnumValues>\n\n\t// Object with list of required properties.\n\t// Values are required or optional based on `required` list.\n\t: T extends { type: 'object'; properties: infer P; required: infer RequiredList }\n\t? {\n\t\t[K in keyof P]: IsRequired<K, RequiredList> extends true ? TypeFromJsonSchema<P[K]> : TypeFromJsonSchema<P[K]> | undefined;\n\t} & AdditionalPropertiesType<T>\n\n\t// Object with no required properties.\n\t// All values are optional\n\t: T extends { type: 'object'; properties: infer P }\n\t? { [K in keyof P]: TypeFromJsonSchema<P[K]> | undefined } & AdditionalPropertiesType<T>\n\n\t// Array\n\t: T extends { type: 'array'; items: infer Items }\n\t? Items extends [...infer R]\n\t// If items is an array, we treat it like a tuple\n\t? { [K in keyof R]: TypeFromJsonSchema<Items[K]> }\n\t: Array<TypeFromJsonSchema<Items>>\n\n\t// oneOf / anyof\n\t// These are handled the same way as they both represent a union type.\n\t// However at the validation level, they have different semantics.\n\t: T extends { oneOf: infer I }\n\t? MapSchemaToType<I>\n\t: T extends { anyOf: infer I }\n\t? MapSchemaToType<I>\n\n\t// Primitive types\n\t: T extends { type: infer Type }\n\t// Basic type\n\t? Type extends 'string' | 'number' | 'integer' | 'boolean' | 'null'\n\t? SchemaPrimitiveTypeNameToType<Type>\n\t// Union of primitive types\n\t: Type extends [...infer R]\n\t? UnionOf<{ [K in keyof R]: SchemaPrimitiveTypeNameToType<R[K]> }>\n\t: never\n\n\t// Fallthrough\n\t: never;\n\ntype SchemaPrimitiveTypeNameToType<T> =\n\tT extends 'string' ? string :\n\tT extends 'number' | 'integer' ? number :\n\tT extends 'boolean' ? boolean :\n\tT extends 'null' ? null :\n\tnever;\n\ntype UnionOf<T> =\n\tT extends [infer First, ...infer Rest]\n\t? First | UnionOf<Rest>\n\t: never;\n\ntype IsRequired<K, RequiredList> =\n\tRequiredList extends []\n\t? false\n\n\t: RequiredList extends [K, ...infer _]\n\t? true\n\n\t: RequiredList extends [infer _, ...infer R]\n\t? IsRequired<K, R>\n\n\t: false;\n\ntype AdditionalPropertiesType<Schema> =\n\tSchema extends { additionalProperties: infer AP }\n\t? AP extends false ? {} : { [key: string]: TypeFromJsonSchema<Schema['additionalProperties']> }\n\t: {};\n\ntype MapSchemaToType<T> = T extends [infer First, ...infer Rest]\n\t? TypeFromJsonSchema<First> | MapSchemaToType<Rest>\n\t: never;\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 type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'array' | 'object';\n\nexport interface IJSONSchema {\n\ttype?: JSONSchemaType | JSONSchemaType[];\n\tdefault?: any;\n\tdefinitions?: IJSONSchemaMap;\n\tdescription?: string;\n\tproperties?: IJSONSchemaMap;\n\tpatternProperties?: IJSONSchemaMap;\n\tadditionalProperties?: boolean | IJSONSchema;\n\titems?: IJSONSchema | IJSONSchema[];\n\tpattern?: string;\n\tminimum?: number;\n\tmaximum?: number;\n\trequired?: string[];\n\t$ref?: string;\n\tanyOf?: IJSONSchema[];\n\toneOf?: IJSONSchema[];\n\tenum?: any[];\n\tformat?: string;\n\n\t// schema draft 06\n\tconst?: any;\n\tdeprecated?: boolean;\n\n\t// VSCode extensions\n\n\tdefaultSnippets?: IJSONSchemaSnippet[];\n\terrorMessage?: string;\n\tpatternErrorMessage?: string;\n\tdeprecationMessage?: string;\n\tmarkdownDeprecationMessage?: string;\n\tenumDescriptions?: string[];\n\tmarkdownEnumDescriptions?: string[];\n\tmarkdownDescription?: string;\n\tallowComments?: boolean;\n\tallowTrailingCommas?: boolean;\n}\n\nexport interface IJSONSchemaMap {\n\t[name: string]: IJSONSchema;\n}\n\nexport interface IJSONSchemaSnippet {\n\tbody?: any; // an already stringified JSON object that can contain new lines (\\n) and tabs (\\t)\n}\n\n/**\n * Converts a basic JSON schema to a TypeScript type.\n */\nexport type TypeFromJsonSchema<T> =\n\t// enum\n\tT extends { enum: infer EnumValues }\n\t? UnionOf<EnumValues>\n\n\t// Object with list of required properties.\n\t// Values are required or optional based on `required` list.\n\t: T extends { type: 'object'; properties: infer P; required: infer RequiredList }\n\t? {\n\t\t[K in keyof P]: IsRequired<K, RequiredList> extends true ? TypeFromJsonSchema<P[K]> : TypeFromJsonSchema<P[K]> | undefined;\n\t} & AdditionalPropertiesType<T>\n\n\t// Object with no required properties.\n\t// All values are optional\n\t: T extends { type: 'object'; properties: infer P }\n\t? { [K in keyof P]: TypeFromJsonSchema<P[K]> | undefined } & AdditionalPropertiesType<T>\n\n\t// Array\n\t: T extends { type: 'array'; items: infer Items }\n\t? Items extends [...infer R]\n\t// If items is an array, we treat it like a tuple\n\t? { [K in keyof R]: TypeFromJsonSchema<Items[K]> }\n\t: Array<TypeFromJsonSchema<Items>>\n\n\t// oneOf / anyof\n\t// These are handled the same way as they both represent a union type.\n\t// However at the validation level, they have different semantics.\n\t: T extends { oneOf: infer I }\n\t? MapSchemaToType<I>\n\t: T extends { anyOf: infer I }\n\t? MapSchemaToType<I>\n\n\t// Primitive types\n\t: T extends { type: infer Type }\n\t// Basic type\n\t? Type extends 'string' | 'number' | 'integer' | 'boolean' | 'null'\n\t? SchemaPrimitiveTypeNameToType<Type>\n\t// Union of primitive types\n\t: Type extends [...infer R]\n\t? UnionOf<{ [K in keyof R]: SchemaPrimitiveTypeNameToType<R[K]> }>\n\t: never\n\n\t// Fallthrough\n\t: never;\n\ntype SchemaPrimitiveTypeNameToType<T> =\n\tT extends 'string' ? string :\n\tT extends 'number' | 'integer' ? number :\n\tT extends 'boolean' ? boolean :\n\tT extends 'null' ? null :\n\tnever;\n\ntype UnionOf<T> =\n\tT extends [infer First, ...infer Rest]\n\t? First | UnionOf<Rest>\n\t: never;\n\ntype IsRequired<K, RequiredList> =\n\tRequiredList extends []\n\t? false\n\n\t: RequiredList extends [K, ...infer _]\n\t? true\n\n\t: RequiredList extends [infer _, ...infer R]\n\t? IsRequired<K, R>\n\n\t: false;\n\ntype AdditionalPropertiesType<Schema> =\n\tSchema extends { additionalProperties: infer AP }\n\t? AP extends false ? {} : { [key: string]: TypeFromJsonSchema<Schema['additionalProperties']> }\n\t: {};\n\ntype MapSchemaToType<T> = T extends [infer First, ...infer Rest]\n\t? TypeFromJsonSchema<First> | MapSchemaToType<Rest>\n\t: never;\n\n"]}
@@ -601,12 +601,22 @@ export class WordOperations {
601
601
  let startColumn;
602
602
  let endColumn;
603
603
  if (prevWord && prevWord.wordType === 1 /* WordType.Regular */ && prevWord.start <= position.column - 1 && position.column - 1 <= prevWord.end) {
604
- // isTouchingPrevWord
604
+ // isTouchingPrevWord (Regular word)
605
+ startColumn = prevWord.start + 1;
606
+ endColumn = prevWord.end + 1;
607
+ }
608
+ else if (prevWord && prevWord.wordType === 2 /* WordType.Separator */ && prevWord.start <= position.column - 1 && position.column - 1 < prevWord.end) {
609
+ // isTouchingPrevWord (Separator word) - stricter check, don't include end boundary
605
610
  startColumn = prevWord.start + 1;
606
611
  endColumn = prevWord.end + 1;
607
612
  }
608
613
  else if (nextWord && nextWord.wordType === 1 /* WordType.Regular */ && nextWord.start <= position.column - 1 && position.column - 1 <= nextWord.end) {
609
- // isTouchingNextWord
614
+ // isTouchingNextWord (Regular word)
615
+ startColumn = nextWord.start + 1;
616
+ endColumn = nextWord.end + 1;
617
+ }
618
+ else if (nextWord && nextWord.wordType === 2 /* WordType.Separator */ && nextWord.start <= position.column - 1 && position.column - 1 < nextWord.end) {
619
+ // isTouchingNextWord (Separator word) - stricter check, don't include end boundary
610
620
  startColumn = nextWord.start + 1;
611
621
  endColumn = nextWord.end + 1;
612
622
  }
@@ -629,12 +639,12 @@ export class WordOperations {
629
639
  let startColumn;
630
640
  let endColumn;
631
641
  if (prevWord && prevWord.wordType === 1 /* WordType.Regular */ && prevWord.start < position.column - 1 && position.column - 1 < prevWord.end) {
632
- // isInsidePrevWord
642
+ // isInsidePrevWord (Regular word)
633
643
  startColumn = prevWord.start + 1;
634
644
  endColumn = prevWord.end + 1;
635
645
  }
636
646
  else if (nextWord && nextWord.wordType === 1 /* WordType.Regular */ && nextWord.start < position.column - 1 && position.column - 1 < nextWord.end) {
637
- // isInsideNextWord
647
+ // isInsideNextWord (Regular word)
638
648
  startColumn = nextWord.start + 1;
639
649
  endColumn = nextWord.end + 1;
640
650
  }