monaco-editor-core 0.53.0-dev-20250908 → 0.53.0-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.messages.de.js +1 -1
- package/esm/nls.messages.es.js +1 -1
- package/esm/nls.messages.fr.js +1 -1
- package/esm/nls.messages.it.js +1 -1
- package/esm/nls.messages.ja.js +1 -1
- package/esm/nls.messages.ko.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.zh-cn.js +1 -1
- package/esm/nls.messages.zh-tw.js +1 -1
- package/esm/vs/base/browser/domSanitize.js +8 -18
- package/esm/vs/base/browser/domSanitize.js.map +1 -1
- package/esm/vs/base/browser/domStylesheets.js +0 -3
- package/esm/vs/base/browser/domStylesheets.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
- package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
- package/esm/vs/base/common/async.js +0 -6
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/platform/actions/browser/actionViewItemService.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +3 -3
- package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
- package/package.json +2 -2
|
@@ -224,7 +224,7 @@ export { WorkbenchToolBar };
|
|
|
224
224
|
*/
|
|
225
225
|
let MenuWorkbenchToolBar = class MenuWorkbenchToolBar extends WorkbenchToolBar {
|
|
226
226
|
get onDidChangeMenuItems() { return this._onDidChangeMenuItems.event; }
|
|
227
|
-
constructor(container, menuId, options, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService, actionViewService,
|
|
227
|
+
constructor(container, menuId, options, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService, actionViewService, instaService) {
|
|
228
228
|
super(container, {
|
|
229
229
|
resetMenu: menuId,
|
|
230
230
|
...options,
|
|
@@ -233,11 +233,11 @@ let MenuWorkbenchToolBar = class MenuWorkbenchToolBar extends WorkbenchToolBar {
|
|
|
233
233
|
if (!provider) {
|
|
234
234
|
provider = options?.actionViewItemProvider;
|
|
235
235
|
}
|
|
236
|
-
const viewItem = provider?.(action, opts,
|
|
236
|
+
const viewItem = provider?.(action, opts, instaService);
|
|
237
237
|
if (viewItem) {
|
|
238
238
|
return viewItem;
|
|
239
239
|
}
|
|
240
|
-
return createActionViewItem(
|
|
240
|
+
return createActionViewItem(instaService, action, opts);
|
|
241
241
|
}
|
|
242
242
|
}, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);
|
|
243
243
|
this._onDidChangeMenuItems = this._store.add(new Emitter());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/platform/actions/browser/toolbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAmB,gBAAgB,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,EAAW,SAAS,EAAiB,QAAQ,EAAuE,MAAM,iCAAiC,CAAC;AACnK,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,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,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YACrC,aAAa,EAAE,CAAC;YAChB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;YACjD,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;gBAClB,aAAa,EAAE,CAAC;YACjB,CAAC;QACF,CAAC,CAAC,CAAC,CAAC;QACJ,aAAa,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACM,UAAU;QAClB,MAAM,IAAI,kBAAkB,CAAC,wCAAwC,CAAC,CAAC;IACxE,CAAC;CACD,CAAA;AAlEY,oBAAoB;IAS9B,WAAA,YAAY,CAAA;IACZ,WAAA,kBAAkB,CAAA;IAClB,WAAA,mBAAmB,CAAA;IACnB,WAAA,kBAAkB,CAAA;IAClB,WAAA,eAAe,CAAA;IACf,WAAA,iBAAiB,CAAA;IACjB,WAAA,sBAAsB,CAAA;IACtB,YAAA,qBAAqB,CAAA;GAhBX,oBAAoB,CAkEhC","file":"toolbar.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableListener, getWindow } from '../../../base/browser/dom.js';\nimport { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';\nimport { IToolBarOptions, ToggleMenuAction, ToolBar } from '../../../base/browser/ui/toolbar/toolbar.js';\nimport { IAction, Separator, SubmenuAction, toAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js';\nimport { coalesceInPlace } from '../../../base/common/arrays.js';\nimport { intersection } from '../../../base/common/collections.js';\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { DisposableStore } from '../../../base/common/lifecycle.js';\nimport { localize } from '../../../nls.js';\nimport { createActionViewItem, getActionBarActions } from './menuEntryActionViewItem.js';\nimport { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from '../common/actions.js';\nimport { createConfigureKeybindingAction } from '../common/menuService.js';\nimport { ICommandService } from '../../commands/common/commands.js';\nimport { IContextKeyService } from '../../contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IActionViewItemService } from './actionViewItemService.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\n\nexport const enum HiddenItemStrategy {\n\t/** This toolbar doesn't support hiding*/\n\tNoHide = -1,\n\t/** Hidden items aren't shown anywhere */\n\tIgnore = 0,\n\t/** Hidden items move into the secondary group */\n\tRenderInSecondaryGroup = 1,\n}\n\nexport type IWorkbenchToolBarOptions = IToolBarOptions & {\n\n\t/**\n\t * Items of the primary group can be hidden. When this happens the item can\n\t * - move into the secondary popup-menu, or\n\t * - not be shown at all\n\t */\n\thiddenItemStrategy?: HiddenItemStrategy;\n\n\t/**\n\t * Optional menu id which is used for a \"Reset Menu\" command. This should be the\n\t * menu id that defines the contents of this workbench menu\n\t */\n\tresetMenu?: MenuId;\n\n\t/**\n\t * Optional menu id which items are used for the context menu of the toolbar.\n\t */\n\tcontextMenu?: MenuId;\n\n\t/**\n\t * Optional options how menu actions are created and invoked\n\t */\n\tmenuOptions?: IMenuActionOptions;\n\n\t/**\n\t * When set the `workbenchActionExecuted` is automatically send for each invoked action. The `from` property\n\t * of the event will the passed `telemetrySource`-value\n\t */\n\ttelemetrySource?: string;\n\n\t/** This is controlled by the WorkbenchToolBar */\n\tallowContextMenu?: never;\n\n\t/**\n\t * Controls the overflow behavior of the primary group of toolbar. This isthe maximum number of items and id of\n\t * items that should never overflow\n\t *\n\t */\n\toverflowBehavior?: { maxItems: number; exempted?: string[] };\n};\n\n/**\n * The `WorkbenchToolBar` does\n * - support hiding of menu items\n * - lookup keybindings for each actions automatically\n * - send `workbenchActionExecuted`-events for each action\n *\n * See {@link MenuWorkbenchToolBar} for a toolbar that is backed by a menu.\n */\nexport class WorkbenchToolBar extends ToolBar {\n\n\tprivate readonly _sessionDisposables = this._store.add(new DisposableStore());\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate _options: IWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t) {\n\t\tsuper(container, _contextMenuService, {\n\t\t\t// defaults\n\t\t\tgetKeyBinding: (action) => _keybindingService.lookupKeybinding(action.id) ?? undefined,\n\t\t\t// options (override defaults)\n\t\t\t..._options,\n\t\t\t// mandatory (overide options)\n\t\t\tallowContextMenu: true,\n\t\t\tskipTelemetry: typeof _options?.telemetrySource === 'string',\n\t\t});\n\n\t\t// telemetry logic\n\t\tconst telemetrySource = _options?.telemetrySource;\n\t\tif (telemetrySource) {\n\t\t\tthis._store.add(this.actionBar.onDidRun(e => telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>(\n\t\t\t\t'workbenchActionExecuted',\n\t\t\t\t{ id: e.action.id, from: telemetrySource })\n\t\t\t));\n\t\t}\n\t}\n\n\toverride setActions(_primary: readonly IAction[], _secondary: readonly IAction[] = [], menuIds?: readonly MenuId[]): void {\n\n\t\tthis._sessionDisposables.clear();\n\t\tconst primary: Array<IAction | undefined> = _primary.slice(); // for hiding and overflow we set some items to undefined\n\t\tconst secondary = _secondary.slice();\n\t\tconst toggleActions: IAction[] = [];\n\t\tlet toggleActionsCheckedCount: number = 0;\n\n\t\tconst extraSecondary: Array<IAction | undefined> = [];\n\n\t\tlet someAreHidden = false;\n\t\t// unless disabled, move all hidden items to secondary group or ignore them\n\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.NoHide) {\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) {\n\t\t\t\t\t// console.warn(`Action ${action.id}/${action.label} is not a MenuItemAction`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// collect all toggle actions\n\t\t\t\ttoggleActions.push(action.hideActions.toggle);\n\t\t\t\tif (action.hideActions.toggle.checked) {\n\t\t\t\t\ttoggleActionsCheckedCount++;\n\t\t\t\t}\n\n\t\t\t\t// hidden items move into overflow or ignore\n\t\t\t\tif (action.hideActions.isHidden) {\n\t\t\t\t\tsomeAreHidden = true;\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// count for max\n\t\tif (this._options?.overflowBehavior !== undefined) {\n\n\t\t\tconst exemptedIds = intersection(new Set(this._options.overflowBehavior.exempted), Iterable.map(primary, a => a?.id));\n\t\t\tconst maxItems = this._options.overflowBehavior.maxItems - exemptedIds.size;\n\n\t\t\tlet count = 0;\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!action) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t\tif (exemptedIds.has(action.id)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (count >= maxItems) {\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// coalesce turns Array<IAction|undefined> into IAction[]\n\t\tcoalesceInPlace(primary);\n\t\tcoalesceInPlace(extraSecondary);\n\t\tsuper.setActions(primary, Separator.join(extraSecondary, secondary));\n\n\t\t// add context menu for toggle and configure keybinding actions\n\t\tif (toggleActions.length > 0 || primary.length > 0) {\n\t\t\tthis._sessionDisposables.add(addDisposableListener(this.getElement(), 'contextmenu', e => {\n\t\t\t\tconst event = new StandardMouseEvent(getWindow(this.getElement()), e);\n\n\t\t\t\tconst action = this.getItemAction(event.target);\n\t\t\t\tif (!(action)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst primaryActions = [];\n\n\t\t\t\t// -- Configure Keybinding Action --\n\t\t\t\tif (action instanceof MenuItemAction && action.menuKeybinding) {\n\t\t\t\t\tprimaryActions.push(action.menuKeybinding);\n\t\t\t\t} else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) {\n\t\t\t\t\t// only enable the configure keybinding action for actions that support keybindings\n\t\t\t\t\tconst supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\tprimaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, supportsKeybindings));\n\t\t\t\t}\n\n\t\t\t\t// -- Hide Actions --\n\t\t\t\tif (toggleActions.length > 0) {\n\t\t\t\t\tlet noHide = false;\n\n\t\t\t\t\t// last item cannot be hidden when using ignore strategy\n\t\t\t\t\tif (toggleActionsCheckedCount === 1 && this._options?.hiddenItemStrategy === HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\tnoHide = true;\n\t\t\t\t\t\tfor (let i = 0; i < toggleActions.length; i++) {\n\t\t\t\t\t\t\tif (toggleActions[i].checked) {\n\t\t\t\t\t\t\t\ttoggleActions[i] = toAction({\n\t\t\t\t\t\t\t\t\tid: action.id,\n\t\t\t\t\t\t\t\t\tlabel: action.label,\n\t\t\t\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak; // there is only one\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// add \"hide foo\" actions\n\t\t\t\t\tif (!noHide && (action instanceof MenuItemAction || action instanceof SubmenuItemAction)) {\n\t\t\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\t\t\t// no context menu for MenuItemAction instances that support no hiding\n\t\t\t\t\t\t\t// those are fake actions and need to be cleaned up\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprimaryActions.push(action.hideActions.hide);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprimaryActions.push(toAction({\n\t\t\t\t\t\t\tid: 'label',\n\t\t\t\t\t\t\tlabel: localize('hide', \"Hide\"),\n\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst actions = Separator.join(primaryActions, toggleActions);\n\n\t\t\t\t// add \"Reset Menu\" action\n\t\t\t\tif (this._options?.resetMenu && !menuIds) {\n\t\t\t\t\tmenuIds = [this._options.resetMenu];\n\t\t\t\t}\n\t\t\t\tif (someAreHidden && menuIds) {\n\t\t\t\t\tactions.push(new Separator());\n\t\t\t\t\tactions.push(toAction({\n\t\t\t\t\t\tid: 'resetThisMenu',\n\t\t\t\t\t\tlabel: localize('resetThisMenu', \"Reset Menu\"),\n\t\t\t\t\t\trun: () => this._menuService.resetHiddenStates(menuIds)\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tif (actions.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\t\tgetAnchor: () => event,\n\t\t\t\t\tgetActions: () => actions,\n\t\t\t\t\t// add context menu actions (iff appicable)\n\t\t\t\t\tmenuId: this._options?.contextMenu,\n\t\t\t\t\tmenuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions },\n\t\t\t\t\tskipTelemetry: typeof this._options?.telemetrySource === 'string',\n\t\t\t\t\tcontextKeyService: this._contextKeyService,\n\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t}\n}\n\n// ---- MenuWorkbenchToolBar -------------------------------------------------\n\n\nexport interface IToolBarRenderOptions {\n\t/**\n\t * Determines what groups are considered primary. Defaults to `navigation`. Items of the primary\n\t * group are rendered with buttons and the rest is rendered in the secondary popup-menu.\n\t */\n\tprimaryGroup?: string | ((actionGroup: string) => boolean);\n\n\t/**\n\t * Inlinse submenus with just a single item\n\t */\n\tshouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean;\n\n\t/**\n\t * Should the primary group allow for separators.\n\t */\n\tuseSeparatorsInPrimaryActions?: boolean;\n}\n\nexport interface IMenuWorkbenchToolBarOptions extends IWorkbenchToolBarOptions {\n\n\t/**\n\t * Optional options to configure how the toolbar renderes items.\n\t */\n\ttoolbarOptions?: IToolBarRenderOptions;\n\n\t/**\n\t * Customize the debounce delay for menu updates\n\t */\n\teventDebounceDelay?: number;\n}\n\n/**\n * A {@link WorkbenchToolBar workbench toolbar} that is purely driven from a {@link MenuId menu}-identifier.\n *\n * *Note* that Manual updates via `setActions` are NOT supported.\n */\nexport class MenuWorkbenchToolBar extends WorkbenchToolBar {\n\n\tprivate readonly _onDidChangeMenuItems = this._store.add(new Emitter<this>());\n\tget onDidChangeMenuItems() { return this._onDidChangeMenuItems.event; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tmenuId: MenuId,\n\t\toptions: IMenuWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService menuService: IMenuService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IActionViewItemService actionViewService: IActionViewItemService,\n\t\t@IInstantiationService instantiationService: IInstantiationService,\n\t) {\n\t\tsuper(container, {\n\t\t\tresetMenu: menuId,\n\t\t\t...options,\n\t\t\tactionViewItemProvider: (action, opts) => {\n\t\t\t\tlet provider = actionViewService.lookUp(menuId, action instanceof SubmenuItemAction ? action.item.submenu.id : action.id);\n\t\t\t\tif (!provider) {\n\t\t\t\t\tprovider = options?.actionViewItemProvider;\n\t\t\t\t}\n\t\t\t\tconst viewItem = provider?.(action, opts, instantiationService, getWindow(container).vscodeWindowId);\n\t\t\t\tif (viewItem) {\n\t\t\t\t\treturn viewItem;\n\t\t\t\t}\n\t\t\t\treturn createActionViewItem(instantiationService, action, opts);\n\t\t\t}\n\t\t}, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);\n\n\t\t// update logic\n\t\tconst menu = this._store.add(menuService.createMenu(menuId, contextKeyService, { emitEventsForSubmenuChanges: true, eventDebounceDelay: options?.eventDebounceDelay }));\n\t\tconst updateToolbar = () => {\n\t\t\tconst { primary, secondary } = getActionBarActions(\n\t\t\t\tmenu.getActions(options?.menuOptions),\n\t\t\t\toptions?.toolbarOptions?.primaryGroup,\n\t\t\t\toptions?.toolbarOptions?.shouldInlineSubmenu,\n\t\t\t\toptions?.toolbarOptions?.useSeparatorsInPrimaryActions\n\t\t\t);\n\t\t\tcontainer.classList.toggle('has-no-actions', primary.length === 0 && secondary.length === 0);\n\t\t\tsuper.setActions(primary, secondary);\n\t\t};\n\n\t\tthis._store.add(menu.onDidChange(() => {\n\t\t\tupdateToolbar();\n\t\t\tthis._onDidChangeMenuItems.fire(this);\n\t\t}));\n\n\t\tthis._store.add(actionViewService.onDidChange(e => {\n\t\t\tif (e === menuId) {\n\t\t\t\tupdateToolbar();\n\t\t\t}\n\t\t}));\n\t\tupdateToolbar();\n\t}\n\n\t/**\n\t * @deprecated The WorkbenchToolBar does not support this method because it works with menus.\n\t */\n\toverride setActions(): void {\n\t\tthrow new BugIndicatingError('This toolbar is populated from a menu.');\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/platform/actions/browser/toolbar.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;AAEhG,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAmB,gBAAgB,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,EAAW,SAAS,EAAiB,QAAQ,EAAuE,MAAM,iCAAiC,CAAC;AACnK,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAsB,YAAY,EAAU,cAAc,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO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QACvC,CAAC,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;YACjD,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;gBAClB,aAAa,EAAE,CAAC;YACjB,CAAC;QACF,CAAC,CAAC,CAAC,CAAC;QACJ,aAAa,EAAE,CAAC;IACjB,CAAC;IAED;;OAEG;IACM,UAAU;QAClB,MAAM,IAAI,kBAAkB,CAAC,wCAAwC,CAAC,CAAC;IACxE,CAAC;CACD,CAAA;AAlEY,oBAAoB;IAS9B,WAAA,YAAY,CAAA;IACZ,WAAA,kBAAkB,CAAA;IAClB,WAAA,mBAAmB,CAAA;IACnB,WAAA,kBAAkB,CAAA;IAClB,WAAA,eAAe,CAAA;IACf,WAAA,iBAAiB,CAAA;IACjB,WAAA,sBAAsB,CAAA;IACtB,YAAA,qBAAqB,CAAA;GAhBX,oBAAoB,CAkEhC","file":"toolbar.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableListener, getWindow } from '../../../base/browser/dom.js';\nimport { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';\nimport { IToolBarOptions, ToggleMenuAction, ToolBar } from '../../../base/browser/ui/toolbar/toolbar.js';\nimport { IAction, Separator, SubmenuAction, toAction, WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from '../../../base/common/actions.js';\nimport { coalesceInPlace } from '../../../base/common/arrays.js';\nimport { intersection } from '../../../base/common/collections.js';\nimport { BugIndicatingError } from '../../../base/common/errors.js';\nimport { Emitter } from '../../../base/common/event.js';\nimport { Iterable } from '../../../base/common/iterator.js';\nimport { DisposableStore } from '../../../base/common/lifecycle.js';\nimport { localize } from '../../../nls.js';\nimport { createActionViewItem, getActionBarActions } from './menuEntryActionViewItem.js';\nimport { IMenuActionOptions, IMenuService, MenuId, MenuItemAction, SubmenuItemAction } from '../common/actions.js';\nimport { createConfigureKeybindingAction } from '../common/menuService.js';\nimport { ICommandService } from '../../commands/common/commands.js';\nimport { IContextKeyService } from '../../contextkey/common/contextkey.js';\nimport { IContextMenuService } from '../../contextview/browser/contextView.js';\nimport { IKeybindingService } from '../../keybinding/common/keybinding.js';\nimport { ITelemetryService } from '../../telemetry/common/telemetry.js';\nimport { IActionViewItemService } from './actionViewItemService.js';\nimport { IInstantiationService } from '../../instantiation/common/instantiation.js';\n\nexport const enum HiddenItemStrategy {\n\t/** This toolbar doesn't support hiding*/\n\tNoHide = -1,\n\t/** Hidden items aren't shown anywhere */\n\tIgnore = 0,\n\t/** Hidden items move into the secondary group */\n\tRenderInSecondaryGroup = 1,\n}\n\nexport type IWorkbenchToolBarOptions = IToolBarOptions & {\n\n\t/**\n\t * Items of the primary group can be hidden. When this happens the item can\n\t * - move into the secondary popup-menu, or\n\t * - not be shown at all\n\t */\n\thiddenItemStrategy?: HiddenItemStrategy;\n\n\t/**\n\t * Optional menu id which is used for a \"Reset Menu\" command. This should be the\n\t * menu id that defines the contents of this workbench menu\n\t */\n\tresetMenu?: MenuId;\n\n\t/**\n\t * Optional menu id which items are used for the context menu of the toolbar.\n\t */\n\tcontextMenu?: MenuId;\n\n\t/**\n\t * Optional options how menu actions are created and invoked\n\t */\n\tmenuOptions?: IMenuActionOptions;\n\n\t/**\n\t * When set the `workbenchActionExecuted` is automatically send for each invoked action. The `from` property\n\t * of the event will the passed `telemetrySource`-value\n\t */\n\ttelemetrySource?: string;\n\n\t/** This is controlled by the WorkbenchToolBar */\n\tallowContextMenu?: never;\n\n\t/**\n\t * Controls the overflow behavior of the primary group of toolbar. This isthe maximum number of items and id of\n\t * items that should never overflow\n\t *\n\t */\n\toverflowBehavior?: { maxItems: number; exempted?: string[] };\n};\n\n/**\n * The `WorkbenchToolBar` does\n * - support hiding of menu items\n * - lookup keybindings for each actions automatically\n * - send `workbenchActionExecuted`-events for each action\n *\n * See {@link MenuWorkbenchToolBar} for a toolbar that is backed by a menu.\n */\nexport class WorkbenchToolBar extends ToolBar {\n\n\tprivate readonly _sessionDisposables = this._store.add(new DisposableStore());\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tprivate _options: IWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService private readonly _menuService: IMenuService,\n\t\t@IContextKeyService private readonly _contextKeyService: IContextKeyService,\n\t\t@IContextMenuService private readonly _contextMenuService: IContextMenuService,\n\t\t@IKeybindingService private readonly _keybindingService: IKeybindingService,\n\t\t@ICommandService private readonly _commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t) {\n\t\tsuper(container, _contextMenuService, {\n\t\t\t// defaults\n\t\t\tgetKeyBinding: (action) => _keybindingService.lookupKeybinding(action.id) ?? undefined,\n\t\t\t// options (override defaults)\n\t\t\t..._options,\n\t\t\t// mandatory (overide options)\n\t\t\tallowContextMenu: true,\n\t\t\tskipTelemetry: typeof _options?.telemetrySource === 'string',\n\t\t});\n\n\t\t// telemetry logic\n\t\tconst telemetrySource = _options?.telemetrySource;\n\t\tif (telemetrySource) {\n\t\t\tthis._store.add(this.actionBar.onDidRun(e => telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>(\n\t\t\t\t'workbenchActionExecuted',\n\t\t\t\t{ id: e.action.id, from: telemetrySource })\n\t\t\t));\n\t\t}\n\t}\n\n\toverride setActions(_primary: readonly IAction[], _secondary: readonly IAction[] = [], menuIds?: readonly MenuId[]): void {\n\n\t\tthis._sessionDisposables.clear();\n\t\tconst primary: Array<IAction | undefined> = _primary.slice(); // for hiding and overflow we set some items to undefined\n\t\tconst secondary = _secondary.slice();\n\t\tconst toggleActions: IAction[] = [];\n\t\tlet toggleActionsCheckedCount: number = 0;\n\n\t\tconst extraSecondary: Array<IAction | undefined> = [];\n\n\t\tlet someAreHidden = false;\n\t\t// unless disabled, move all hidden items to secondary group or ignore them\n\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.NoHide) {\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!(action instanceof MenuItemAction) && !(action instanceof SubmenuItemAction)) {\n\t\t\t\t\t// console.warn(`Action ${action.id}/${action.label} is not a MenuItemAction`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// collect all toggle actions\n\t\t\t\ttoggleActions.push(action.hideActions.toggle);\n\t\t\t\tif (action.hideActions.toggle.checked) {\n\t\t\t\t\ttoggleActionsCheckedCount++;\n\t\t\t\t}\n\n\t\t\t\t// hidden items move into overflow or ignore\n\t\t\t\tif (action.hideActions.isHidden) {\n\t\t\t\t\tsomeAreHidden = true;\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\tif (this._options?.hiddenItemStrategy !== HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// count for max\n\t\tif (this._options?.overflowBehavior !== undefined) {\n\n\t\t\tconst exemptedIds = intersection(new Set(this._options.overflowBehavior.exempted), Iterable.map(primary, a => a?.id));\n\t\t\tconst maxItems = this._options.overflowBehavior.maxItems - exemptedIds.size;\n\n\t\t\tlet count = 0;\n\t\t\tfor (let i = 0; i < primary.length; i++) {\n\t\t\t\tconst action = primary[i];\n\t\t\t\tif (!action) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t\tif (exemptedIds.has(action.id)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (count >= maxItems) {\n\t\t\t\t\tprimary[i] = undefined;\n\t\t\t\t\textraSecondary[i] = action;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// coalesce turns Array<IAction|undefined> into IAction[]\n\t\tcoalesceInPlace(primary);\n\t\tcoalesceInPlace(extraSecondary);\n\t\tsuper.setActions(primary, Separator.join(extraSecondary, secondary));\n\n\t\t// add context menu for toggle and configure keybinding actions\n\t\tif (toggleActions.length > 0 || primary.length > 0) {\n\t\t\tthis._sessionDisposables.add(addDisposableListener(this.getElement(), 'contextmenu', e => {\n\t\t\t\tconst event = new StandardMouseEvent(getWindow(this.getElement()), e);\n\n\t\t\t\tconst action = this.getItemAction(event.target);\n\t\t\t\tif (!(action)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\tconst primaryActions = [];\n\n\t\t\t\t// -- Configure Keybinding Action --\n\t\t\t\tif (action instanceof MenuItemAction && action.menuKeybinding) {\n\t\t\t\t\tprimaryActions.push(action.menuKeybinding);\n\t\t\t\t} else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) {\n\t\t\t\t\t// only enable the configure keybinding action for actions that support keybindings\n\t\t\t\t\tconst supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id);\n\t\t\t\t\tprimaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, supportsKeybindings));\n\t\t\t\t}\n\n\t\t\t\t// -- Hide Actions --\n\t\t\t\tif (toggleActions.length > 0) {\n\t\t\t\t\tlet noHide = false;\n\n\t\t\t\t\t// last item cannot be hidden when using ignore strategy\n\t\t\t\t\tif (toggleActionsCheckedCount === 1 && this._options?.hiddenItemStrategy === HiddenItemStrategy.Ignore) {\n\t\t\t\t\t\tnoHide = true;\n\t\t\t\t\t\tfor (let i = 0; i < toggleActions.length; i++) {\n\t\t\t\t\t\t\tif (toggleActions[i].checked) {\n\t\t\t\t\t\t\t\ttoggleActions[i] = toAction({\n\t\t\t\t\t\t\t\t\tid: action.id,\n\t\t\t\t\t\t\t\t\tlabel: action.label,\n\t\t\t\t\t\t\t\t\tchecked: true,\n\t\t\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak; // there is only one\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// add \"hide foo\" actions\n\t\t\t\t\tif (!noHide && (action instanceof MenuItemAction || action instanceof SubmenuItemAction)) {\n\t\t\t\t\t\tif (!action.hideActions) {\n\t\t\t\t\t\t\t// no context menu for MenuItemAction instances that support no hiding\n\t\t\t\t\t\t\t// those are fake actions and need to be cleaned up\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprimaryActions.push(action.hideActions.hide);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprimaryActions.push(toAction({\n\t\t\t\t\t\t\tid: 'label',\n\t\t\t\t\t\t\tlabel: localize('hide', \"Hide\"),\n\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t\trun() { }\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst actions = Separator.join(primaryActions, toggleActions);\n\n\t\t\t\t// add \"Reset Menu\" action\n\t\t\t\tif (this._options?.resetMenu && !menuIds) {\n\t\t\t\t\tmenuIds = [this._options.resetMenu];\n\t\t\t\t}\n\t\t\t\tif (someAreHidden && menuIds) {\n\t\t\t\t\tactions.push(new Separator());\n\t\t\t\t\tactions.push(toAction({\n\t\t\t\t\t\tid: 'resetThisMenu',\n\t\t\t\t\t\tlabel: localize('resetThisMenu', \"Reset Menu\"),\n\t\t\t\t\t\trun: () => this._menuService.resetHiddenStates(menuIds)\n\t\t\t\t\t}));\n\t\t\t\t}\n\n\t\t\t\tif (actions.length === 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._contextMenuService.showContextMenu({\n\t\t\t\t\tgetAnchor: () => event,\n\t\t\t\t\tgetActions: () => actions,\n\t\t\t\t\t// add context menu actions (iff appicable)\n\t\t\t\t\tmenuId: this._options?.contextMenu,\n\t\t\t\t\tmenuActionOptions: { renderShortTitle: true, ...this._options?.menuOptions },\n\t\t\t\t\tskipTelemetry: typeof this._options?.telemetrySource === 'string',\n\t\t\t\t\tcontextKeyService: this._contextKeyService,\n\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t}\n}\n\n// ---- MenuWorkbenchToolBar -------------------------------------------------\n\n\nexport interface IToolBarRenderOptions {\n\t/**\n\t * Determines what groups are considered primary. Defaults to `navigation`. Items of the primary\n\t * group are rendered with buttons and the rest is rendered in the secondary popup-menu.\n\t */\n\tprimaryGroup?: string | ((actionGroup: string) => boolean);\n\n\t/**\n\t * Inlinse submenus with just a single item\n\t */\n\tshouldInlineSubmenu?: (action: SubmenuAction, group: string, groupSize: number) => boolean;\n\n\t/**\n\t * Should the primary group allow for separators.\n\t */\n\tuseSeparatorsInPrimaryActions?: boolean;\n}\n\nexport interface IMenuWorkbenchToolBarOptions extends IWorkbenchToolBarOptions {\n\n\t/**\n\t * Optional options to configure how the toolbar renderes items.\n\t */\n\ttoolbarOptions?: IToolBarRenderOptions;\n\n\t/**\n\t * Customize the debounce delay for menu updates\n\t */\n\teventDebounceDelay?: number;\n}\n\n/**\n * A {@link WorkbenchToolBar workbench toolbar} that is purely driven from a {@link MenuId menu}-identifier.\n *\n * *Note* that Manual updates via `setActions` are NOT supported.\n */\nexport class MenuWorkbenchToolBar extends WorkbenchToolBar {\n\n\tprivate readonly _onDidChangeMenuItems = this._store.add(new Emitter<this>());\n\tget onDidChangeMenuItems() { return this._onDidChangeMenuItems.event; }\n\n\tconstructor(\n\t\tcontainer: HTMLElement,\n\t\tmenuId: MenuId,\n\t\toptions: IMenuWorkbenchToolBarOptions | undefined,\n\t\t@IMenuService menuService: IMenuService,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IContextMenuService contextMenuService: IContextMenuService,\n\t\t@IKeybindingService keybindingService: IKeybindingService,\n\t\t@ICommandService commandService: ICommandService,\n\t\t@ITelemetryService telemetryService: ITelemetryService,\n\t\t@IActionViewItemService actionViewService: IActionViewItemService,\n\t\t@IInstantiationService instaService: IInstantiationService,\n\t) {\n\t\tsuper(container, {\n\t\t\tresetMenu: menuId,\n\t\t\t...options,\n\t\t\tactionViewItemProvider: (action, opts) => {\n\t\t\t\tlet provider = actionViewService.lookUp(menuId, action instanceof SubmenuItemAction ? action.item.submenu.id : action.id);\n\t\t\t\tif (!provider) {\n\t\t\t\t\tprovider = options?.actionViewItemProvider;\n\t\t\t\t}\n\t\t\t\tconst viewItem = provider?.(action, opts, instaService);\n\t\t\t\tif (viewItem) {\n\t\t\t\t\treturn viewItem;\n\t\t\t\t}\n\t\t\t\treturn createActionViewItem(instaService, action, opts);\n\t\t\t}\n\t\t}, menuService, contextKeyService, contextMenuService, keybindingService, commandService, telemetryService);\n\n\t\t// update logic\n\t\tconst menu = this._store.add(menuService.createMenu(menuId, contextKeyService, { emitEventsForSubmenuChanges: true, eventDebounceDelay: options?.eventDebounceDelay }));\n\t\tconst updateToolbar = () => {\n\t\t\tconst { primary, secondary } = getActionBarActions(\n\t\t\t\tmenu.getActions(options?.menuOptions),\n\t\t\t\toptions?.toolbarOptions?.primaryGroup,\n\t\t\t\toptions?.toolbarOptions?.shouldInlineSubmenu,\n\t\t\t\toptions?.toolbarOptions?.useSeparatorsInPrimaryActions\n\t\t\t);\n\t\t\tcontainer.classList.toggle('has-no-actions', primary.length === 0 && secondary.length === 0);\n\t\t\tsuper.setActions(primary, secondary);\n\t\t};\n\n\t\tthis._store.add(menu.onDidChange(() => {\n\t\t\tupdateToolbar();\n\t\t\tthis._onDidChangeMenuItems.fire(this);\n\t\t}));\n\n\t\tthis._store.add(actionViewService.onDidChange(e => {\n\t\t\tif (e === menuId) {\n\t\t\t\tupdateToolbar();\n\t\t\t}\n\t\t}));\n\t\tupdateToolbar();\n\t}\n\n\t/**\n\t * @deprecated The WorkbenchToolBar does not support this method because it works with menus.\n\t */\n\toverride setActions(): void {\n\t\tthrow new BugIndicatingError('This toolbar is populated from a menu.');\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monaco-editor-core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.53.0-
|
|
4
|
+
"version": "0.53.0-rc2",
|
|
5
5
|
"description": "A browser based code editor",
|
|
6
6
|
"author": "Microsoft Corporation",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"bugs": {
|
|
15
15
|
"url": "https://github.com/microsoft/vscode/issues"
|
|
16
16
|
},
|
|
17
|
-
"vscodeCommitId": "
|
|
17
|
+
"vscodeCommitId": "e296bdfe0313d571a6f58399b22afd199f6da454"
|
|
18
18
|
}
|