monaco-editor-core 0.56.0-dev-20260119 → 0.56.0-dev-20260120
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.cs.js +1 -1
- 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.pl.js +1 -1
- package/esm/nls.messages.pt-br.js +1 -1
- package/esm/nls.messages.ru.js +1 -1
- package/esm/nls.messages.tr.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/ui/actionbar/actionViewItems.js +4 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.css +8 -5
- package/esm/vs/base/browser/ui/contextview/contextview.js +1 -1
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/list.js +1 -0
- package/esm/vs/base/browser/ui/list/list.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +62 -5
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/common/defaultAccount.js +0 -4
- package/esm/vs/base/common/defaultAccount.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +14 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +16 -1
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/common/model/textModel.js +3 -1
- package/esm/vs/editor/common/model/textModel.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +19 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +2 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/defaultAccount/common/defaultAccount.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +1 -0
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/product/common/product.js +16 -1
- package/esm/vs/platform/product/common/product.js.map +1 -1
- package/package.json +2 -2
package/esm/nls.messages.cs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.de.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.fr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.it.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ja.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ko.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.pl.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.ru.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
package/esm/nls.messages.tr.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Version: 0.56.0-dev-
|
|
3
|
+
* Version: 0.56.0-dev-20260120(3f26219a3c6e5b21b6b5725327da71fbf25fbf12)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -282,7 +282,10 @@ export class ActionViewItem extends BaseActionViewItem {
|
|
|
282
282
|
if (this.cssClass && this.label) {
|
|
283
283
|
this.label.classList.remove(...this.cssClass.split(' '));
|
|
284
284
|
}
|
|
285
|
-
if (this.
|
|
285
|
+
if (this.action.id === Separator.ID && this.action.class) {
|
|
286
|
+
this.label?.classList.add(this.action.class);
|
|
287
|
+
}
|
|
288
|
+
else if (this.options.icon) {
|
|
286
289
|
this.cssClass = this.getClass();
|
|
287
290
|
if (this.label) {
|
|
288
291
|
this.label.classList.add('codicon');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/base/browser/ui/actionbar/actionViewItems.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAa,SAAS,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAA0D,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE9G,OAAO,EAAE,MAAM,EAAE,YAAY,EAA8C,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACzH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAUvE,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IASjD,IAAI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AS,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;IAES,SAAS,CAAC,MAAc,EAAE,KAAa;QAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAC3E,CAAC;IAES,gBAAgB,CAAC,MAAc,EAAE,KAAa;QACvD,OAAO,MAAM,CAAC;IACf,CAAC;IAEQ,YAAY,CAAC,SAAkB;QACvC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAEQ,KAAK;QACb,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IAEQ,IAAI;QACZ,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;IACxB,CAAC;IAEQ,MAAM,CAAC,SAAsB;QACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;CACD","file":"actionViewItems.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 { isFirefox } from '../../browser.js';\nimport { DataTransfers } from '../../dnd.js';\nimport { addDisposableListener, EventHelper, EventLike, EventType } from '../../dom.js';\nimport { EventType as TouchEventType, Gesture } from '../../touch.js';\nimport { IActionViewItem } from './actionbar.js';\nimport { IContextViewProvider } from '../contextview/contextview.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { ISelectBoxOptions, ISelectBoxStyles, ISelectOptionItem, SelectBox } from '../selectBox/selectBox.js';\nimport { IToggleStyles } from '../toggle/toggle.js';\nimport { Action, ActionRunner, IAction, IActionChangeEvent, IActionRunner, Separator } from '../../../common/actions.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport * as types from '../../../common/types.js';\nimport './actionbar.css';\nimport * as nls from '../../../../nls.js';\nimport { IManagedHover, IManagedHoverContent } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\n\nexport interface IBaseActionViewItemOptions {\n\treadonly draggable?: boolean;\n\treadonly isMenu?: boolean;\n\treadonly isTabList?: boolean;\n\treadonly useEventAsContext?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n}\n\nexport class BaseActionViewItem extends Disposable implements IActionViewItem {\n\n\telement: HTMLElement | undefined;\n\n\t_context: unknown;\n\treadonly _action: IAction;\n\n\tprivate customHover?: IManagedHover;\n\n\tget action() {\n\t\treturn this._action;\n\t}\n\n\tprivate _actionRunner: IActionRunner | undefined;\n\n\tconstructor(\n\t\tcontext: unknown,\n\t\taction: IAction,\n\t\tprotected readonly options: IBaseActionViewItemOptions = {}\n\t) {\n\t\tsuper();\n\n\t\tthis._context = context || this;\n\t\tthis._action = action;\n\n\t\tif (action instanceof Action) {\n\t\t\tthis._register(action.onDidChange(event => {\n\t\t\t\tif (!this.element) {\n\t\t\t\t\t// we have not been rendered yet, so there\n\t\t\t\t\t// is no point in updating the UI\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.handleActionChangeEvent(event);\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate handleActionChangeEvent(event: IActionChangeEvent): void {\n\t\tif (event.enabled !== undefined) {\n\t\t\tthis.updateEnabled();\n\t\t}\n\n\t\tif (event.checked !== undefined) {\n\t\t\tthis.updateChecked();\n\t\t}\n\n\t\tif (event.class !== undefined) {\n\t\t\tthis.updateClass();\n\t\t}\n\n\t\tif (event.label !== undefined) {\n\t\t\tthis.updateLabel();\n\t\t\tthis.updateTooltip();\n\t\t}\n\n\t\tif (event.tooltip !== undefined) {\n\t\t\tthis.updateTooltip();\n\t\t}\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\tif (!this._actionRunner) {\n\t\t\tthis._actionRunner = this._register(new ActionRunner());\n\t\t}\n\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\t}\n\n\tisEnabled(): boolean {\n\t\treturn this._action.enabled;\n\t}\n\n\tsetActionContext(newContext: unknown): void {\n\t\tthis._context = newContext;\n\t}\n\n\trender(container: HTMLElement): void {\n\t\tconst element = this.element = container;\n\t\tthis._register(Gesture.addTarget(container));\n\n\t\tconst enableDragging = this.options && this.options.draggable;\n\t\tif (enableDragging) {\n\t\t\tcontainer.draggable = true;\n\n\t\t\tif (isFirefox) {\n\t\t\t\t// Firefox: requires to set a text data transfer to get going\n\t\t\t\tthis._register(addDisposableListener(container, EventType.DRAG_START, e => e.dataTransfer?.setData(DataTransfers.TEXT, this._action.label)));\n\t\t\t}\n\t\t}\n\n\t\tthis._register(addDisposableListener(element, TouchEventType.Tap, e => this.onClick(e, true))); // Preserve focus on tap #125470\n\n\t\tthis._register(addDisposableListener(element, EventType.MOUSE_DOWN, e => {\n\t\t\tif (!enableDragging) {\n\t\t\t\tEventHelper.stop(e, true); // do not run when dragging is on because that would disable it\n\t\t\t}\n\n\t\t\tif (this._action.enabled && e.button === 0) {\n\t\t\t\telement.classList.add('active');\n\t\t\t}\n\t\t}));\n\n\t\tif (platform.isMacintosh) {\n\t\t\t// macOS: allow to trigger the button when holding Ctrl+key and pressing the\n\t\t\t// main mouse button. This is for scenarios where e.g. some interaction forces\n\t\t\t// the Ctrl+key to be pressed and hold but the user still wants to interact\n\t\t\t// with the actions (for example quick access in quick navigation mode).\n\t\t\tthis._register(addDisposableListener(element, EventType.CONTEXT_MENU, e => {\n\t\t\t\tif (e.button === 0 && e.ctrlKey === true) {\n\t\t\t\t\tthis.onClick(e);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(element, EventType.CLICK, e => {\n\t\t\tEventHelper.stop(e, true);\n\n\t\t\t// menus do not use the click event\n\t\t\tif (!(this.options && this.options.isMenu)) {\n\t\t\t\tthis.onClick(e);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(element, EventType.DBLCLICK, e => {\n\t\t\tEventHelper.stop(e, true);\n\t\t}));\n\n\t\t[EventType.MOUSE_UP, EventType.MOUSE_OUT].forEach(event => {\n\t\t\tthis._register(addDisposableListener(element, event, e => {\n\t\t\t\tEventHelper.stop(e);\n\t\t\t\telement.classList.remove('active');\n\t\t\t}));\n\t\t});\n\t}\n\n\tonClick(event: EventLike, preserveFocus = false): void {\n\t\tEventHelper.stop(event, true);\n\n\t\tconst context = types.isUndefinedOrNull(this._context) ? this.options?.useEventAsContext ? event : { preserveFocus } : this._context;\n\t\tthis.actionRunner.run(this._action, context);\n\t}\n\n\t// Only set the tabIndex on the element once it is about to get focused\n\t// That way this element wont be a tab stop when it is not needed #106441\n\tfocus(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.tabIndex = 0;\n\t\t\tthis.element.focus();\n\t\t\tthis.element.classList.add('focused');\n\t\t}\n\t}\n\n\tblur(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.blur();\n\t\t\tthis.element.tabIndex = -1;\n\t\t\tthis.element.classList.remove('focused');\n\t\t}\n\t}\n\n\tsetFocusable(focusable: boolean): void {\n\t\tif (this.element) {\n\t\t\tthis.element.tabIndex = focusable ? 0 : -1;\n\t\t}\n\t}\n\n\tget trapsArrowNavigation(): boolean {\n\t\treturn false;\n\t}\n\n\tprotected updateEnabled(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateLabel(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected getClass(): string | undefined {\n\t\treturn this.action.class;\n\t}\n\n\tprotected getTooltip(): string | undefined {\n\t\treturn this.action.tooltip;\n\t}\n\n\tprotected getHoverContents(): IManagedHoverContent | undefined {\n\t\treturn this.getTooltip();\n\t}\n\n\tprotected updateTooltip(): void {\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\t\tconst title = this.getHoverContents() ?? '';\n\t\tthis.updateAriaLabel();\n\n\t\tif (!this.customHover && title !== '') {\n\t\t\tconst hoverDelegate = this.options.hoverDelegate ?? getDefaultHoverDelegate('element');\n\t\t\tthis.customHover = this._store.add(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.element, title));\n\t\t} else if (this.customHover) {\n\t\t\tthis.customHover.update(title);\n\t\t}\n\t}\n\n\tprotected updateAriaLabel(): void {\n\t\tif (this.element) {\n\t\t\tconst title = this.getTooltip() ?? '';\n\t\t\tthis.element.setAttribute('aria-label', title);\n\t\t}\n\t}\n\n\tprotected updateClass(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateChecked(): void {\n\t\t// implement in subclass\n\t}\n\n\toverride dispose(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.remove();\n\t\t\tthis.element = undefined;\n\t\t}\n\t\tthis._context = undefined;\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IActionViewItemOptions extends IBaseActionViewItemOptions {\n\ticon?: boolean;\n\tlabel?: boolean;\n\treadonly keybinding?: string | null;\n\treadonly keybindingNotRenderedWithLabel?: boolean;\n\treadonly toggleStyles?: IToggleStyles;\n}\n\nexport class ActionViewItem extends BaseActionViewItem {\n\n\tprotected label: HTMLElement | undefined;\n\tprotected override readonly options: IActionViewItemOptions;\n\n\tprivate cssClass?: string;\n\n\tconstructor(context: unknown, action: IAction, options: IActionViewItemOptions) {\n\t\toptions = {\n\t\t\t...options,\n\t\t\ticon: options.icon !== undefined ? options.icon : false,\n\t\t\tlabel: options.label !== undefined ? options.label : true,\n\t\t};\n\t\tsuper(context, action, options);\n\n\t\tthis.options = options;\n\t\tthis.cssClass = '';\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\t\ttypes.assertType(this.element);\n\n\t\tconst label = document.createElement('a');\n\t\tlabel.classList.add('action-label');\n\t\tlabel.setAttribute('role', this.getDefaultAriaRole());\n\n\t\tthis.label = label;\n\t\tthis.element.appendChild(label);\n\n\t\tif (this.options.label && this.options.keybinding && !this.options.keybindingNotRenderedWithLabel) {\n\t\t\tconst kbLabel = document.createElement('span');\n\t\t\tkbLabel.classList.add('keybinding');\n\t\t\tkbLabel.textContent = this.options.keybinding;\n\t\t\tthis.element.appendChild(kbLabel);\n\t\t}\n\n\t\tthis.updateClass();\n\t\tthis.updateLabel();\n\t\tthis.updateTooltip();\n\t\tthis.updateEnabled();\n\t\tthis.updateChecked();\n\t}\n\n\tprivate getDefaultAriaRole(): 'presentation' | 'menuitem' | 'tab' | 'button' {\n\t\tif (this._action.id === Separator.ID) {\n\t\t\treturn 'presentation'; // A separator is a presentation item\n\t\t} else {\n\t\t\tif (this.options.isMenu) {\n\t\t\t\treturn 'menuitem';\n\t\t\t} else if (this.options.isTabList) {\n\t\t\t\treturn 'tab';\n\t\t\t} else {\n\t\t\t\treturn 'button';\n\t\t\t}\n\t\t}\n\t}\n\n\t// Only set the tabIndex on the element once it is about to get focused\n\t// That way this element wont be a tab stop when it is not needed #106441\n\toverride focus(): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = 0;\n\t\t\tthis.label.focus();\n\t\t}\n\t}\n\n\toverride blur(): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = -1;\n\t\t}\n\t}\n\n\toverride setFocusable(focusable: boolean): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = focusable ? 0 : -1;\n\t\t}\n\t}\n\n\tprotected override updateLabel(): void {\n\t\tif (this.options.label && this.label) {\n\t\t\tthis.label.textContent = this.action.label;\n\t\t}\n\t}\n\n\tprotected override getTooltip() {\n\t\tlet title: string | null = null;\n\n\t\tif (this.action.tooltip) {\n\t\t\ttitle = this.action.tooltip;\n\n\t\t} else if (this.action.label) {\n\t\t\ttitle = this.action.label;\n\t\t\tif (this.options.keybinding) {\n\t\t\t\ttitle = nls.localize({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, \"{0} ({1})\", title, this.options.keybinding);\n\t\t\t}\n\t\t}\n\t\treturn title ?? undefined;\n\t}\n\n\tprotected override updateClass(): void {\n\t\tif (this.cssClass && this.label) {\n\t\t\tthis.label.classList.remove(...this.cssClass.split(' '));\n\t\t}\n\t\tif (this.options.icon) {\n\t\t\tthis.cssClass = this.getClass();\n\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.classList.add('codicon');\n\t\t\t\tif (this.cssClass) {\n\t\t\t\t\tthis.label.classList.add(...this.cssClass.split(' '));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.updateEnabled();\n\t\t} else {\n\t\t\tthis.label?.classList.remove('codicon');\n\t\t}\n\t}\n\n\tprotected override updateEnabled(): void {\n\t\tif (this.action.enabled) {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.removeAttribute('aria-disabled');\n\t\t\t\tthis.label.classList.remove('disabled');\n\t\t\t}\n\n\t\t\tthis.element?.classList.remove('disabled');\n\t\t} else {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.setAttribute('aria-disabled', 'true');\n\t\t\t\tthis.label.classList.add('disabled');\n\t\t\t}\n\n\t\t\tthis.element?.classList.add('disabled');\n\t\t}\n\t}\n\n\tprotected override updateAriaLabel(): void {\n\t\tif (this.label) {\n\t\t\tconst title = this.getTooltip() ?? '';\n\t\t\tthis.label.setAttribute('aria-label', title);\n\t\t}\n\t}\n\n\tprotected override updateChecked(): void {\n\t\tif (this.label) {\n\t\t\tif (this.action.checked !== undefined) {\n\t\t\t\tthis.label.classList.toggle('checked', this.action.checked);\n\t\t\t\tif (this.options.isTabList) {\n\t\t\t\t\tthis.label.setAttribute('aria-selected', this.action.checked ? 'true' : 'false');\n\t\t\t\t} else {\n\t\t\t\t\tthis.label.setAttribute('aria-checked', this.action.checked ? 'true' : 'false');\n\t\t\t\t\tthis.label.setAttribute('role', 'checkbox');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.label.classList.remove('checked');\n\t\t\t\tthis.label.removeAttribute(this.options.isTabList ? 'aria-selected' : 'aria-checked');\n\t\t\t\tthis.label.setAttribute('role', this.getDefaultAriaRole());\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SelectActionViewItem<T = string> extends BaseActionViewItem {\n\tprotected selectBox: SelectBox;\n\n\tconstructor(ctx: unknown, action: IAction, options: ISelectOptionItem[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles, selectBoxOptions?: ISelectBoxOptions) {\n\t\tsuper(ctx, action);\n\n\t\tthis.selectBox = new SelectBox(options, selected, contextViewProvider, styles, selectBoxOptions);\n\t\tthis.selectBox.setFocusable(false);\n\n\t\tthis._register(this.selectBox);\n\t\tthis.registerListeners();\n\t}\n\n\tselect(index: number): void {\n\t\tthis.selectBox.select(index);\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.selectBox.onDidSelect(e => this.runAction(e.selected, e.index)));\n\t}\n\n\tprotected runAction(option: string, index: number): void {\n\t\tthis.actionRunner.run(this._action, this.getActionContext(option, index));\n\t}\n\n\tprotected getActionContext(option: string, index: number): T | string {\n\t\treturn option;\n\t}\n\n\toverride setFocusable(focusable: boolean): void {\n\t\tthis.selectBox.setFocusable(focusable);\n\t}\n\n\toverride focus(): void {\n\t\tthis.selectBox?.focus();\n\t}\n\n\toverride blur(): void {\n\t\tthis.selectBox?.blur();\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tthis.selectBox.render(container);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/base/browser/ui/actionbar/actionViewItems.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,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AgB,CAAC,MAAc,EAAE,KAAa;QACvD,OAAO,MAAM,CAAC;IACf,CAAC;IAEQ,YAAY,CAAC,SAAkB;QACvC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAEQ,KAAK;QACb,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IAEQ,IAAI;QACZ,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;IACxB,CAAC;IAEQ,MAAM,CAAC,SAAsB;QACrC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;CACD","file":"actionViewItems.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 { isFirefox } from '../../browser.js';\nimport { DataTransfers } from '../../dnd.js';\nimport { addDisposableListener, EventHelper, EventLike, EventType } from '../../dom.js';\nimport { EventType as TouchEventType, Gesture } from '../../touch.js';\nimport { IActionViewItem } from './actionbar.js';\nimport { IContextViewProvider } from '../contextview/contextview.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { ISelectBoxOptions, ISelectBoxStyles, ISelectOptionItem, SelectBox } from '../selectBox/selectBox.js';\nimport { IToggleStyles } from '../toggle/toggle.js';\nimport { Action, ActionRunner, IAction, IActionChangeEvent, IActionRunner, Separator } from '../../../common/actions.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport * as types from '../../../common/types.js';\nimport './actionbar.css';\nimport * as nls from '../../../../nls.js';\nimport { IManagedHover, IManagedHoverContent } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\n\nexport interface IBaseActionViewItemOptions {\n\treadonly draggable?: boolean;\n\treadonly isMenu?: boolean;\n\treadonly isTabList?: boolean;\n\treadonly useEventAsContext?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n}\n\nexport class BaseActionViewItem extends Disposable implements IActionViewItem {\n\n\telement: HTMLElement | undefined;\n\n\t_context: unknown;\n\treadonly _action: IAction;\n\n\tprivate customHover?: IManagedHover;\n\n\tget action() {\n\t\treturn this._action;\n\t}\n\n\tprivate _actionRunner: IActionRunner | undefined;\n\n\tconstructor(\n\t\tcontext: unknown,\n\t\taction: IAction,\n\t\tprotected readonly options: IBaseActionViewItemOptions = {}\n\t) {\n\t\tsuper();\n\n\t\tthis._context = context || this;\n\t\tthis._action = action;\n\n\t\tif (action instanceof Action) {\n\t\t\tthis._register(action.onDidChange(event => {\n\t\t\t\tif (!this.element) {\n\t\t\t\t\t// we have not been rendered yet, so there\n\t\t\t\t\t// is no point in updating the UI\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.handleActionChangeEvent(event);\n\t\t\t}));\n\t\t}\n\t}\n\n\tprivate handleActionChangeEvent(event: IActionChangeEvent): void {\n\t\tif (event.enabled !== undefined) {\n\t\t\tthis.updateEnabled();\n\t\t}\n\n\t\tif (event.checked !== undefined) {\n\t\t\tthis.updateChecked();\n\t\t}\n\n\t\tif (event.class !== undefined) {\n\t\t\tthis.updateClass();\n\t\t}\n\n\t\tif (event.label !== undefined) {\n\t\t\tthis.updateLabel();\n\t\t\tthis.updateTooltip();\n\t\t}\n\n\t\tif (event.tooltip !== undefined) {\n\t\t\tthis.updateTooltip();\n\t\t}\n\t}\n\n\tget actionRunner(): IActionRunner {\n\t\tif (!this._actionRunner) {\n\t\t\tthis._actionRunner = this._register(new ActionRunner());\n\t\t}\n\n\t\treturn this._actionRunner;\n\t}\n\n\tset actionRunner(actionRunner: IActionRunner) {\n\t\tthis._actionRunner = actionRunner;\n\t}\n\n\tisEnabled(): boolean {\n\t\treturn this._action.enabled;\n\t}\n\n\tsetActionContext(newContext: unknown): void {\n\t\tthis._context = newContext;\n\t}\n\n\trender(container: HTMLElement): void {\n\t\tconst element = this.element = container;\n\t\tthis._register(Gesture.addTarget(container));\n\n\t\tconst enableDragging = this.options && this.options.draggable;\n\t\tif (enableDragging) {\n\t\t\tcontainer.draggable = true;\n\n\t\t\tif (isFirefox) {\n\t\t\t\t// Firefox: requires to set a text data transfer to get going\n\t\t\t\tthis._register(addDisposableListener(container, EventType.DRAG_START, e => e.dataTransfer?.setData(DataTransfers.TEXT, this._action.label)));\n\t\t\t}\n\t\t}\n\n\t\tthis._register(addDisposableListener(element, TouchEventType.Tap, e => this.onClick(e, true))); // Preserve focus on tap #125470\n\n\t\tthis._register(addDisposableListener(element, EventType.MOUSE_DOWN, e => {\n\t\t\tif (!enableDragging) {\n\t\t\t\tEventHelper.stop(e, true); // do not run when dragging is on because that would disable it\n\t\t\t}\n\n\t\t\tif (this._action.enabled && e.button === 0) {\n\t\t\t\telement.classList.add('active');\n\t\t\t}\n\t\t}));\n\n\t\tif (platform.isMacintosh) {\n\t\t\t// macOS: allow to trigger the button when holding Ctrl+key and pressing the\n\t\t\t// main mouse button. This is for scenarios where e.g. some interaction forces\n\t\t\t// the Ctrl+key to be pressed and hold but the user still wants to interact\n\t\t\t// with the actions (for example quick access in quick navigation mode).\n\t\t\tthis._register(addDisposableListener(element, EventType.CONTEXT_MENU, e => {\n\t\t\t\tif (e.button === 0 && e.ctrlKey === true) {\n\t\t\t\t\tthis.onClick(e);\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\n\t\tthis._register(addDisposableListener(element, EventType.CLICK, e => {\n\t\t\tEventHelper.stop(e, true);\n\n\t\t\t// menus do not use the click event\n\t\t\tif (!(this.options && this.options.isMenu)) {\n\t\t\t\tthis.onClick(e);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(element, EventType.DBLCLICK, e => {\n\t\t\tEventHelper.stop(e, true);\n\t\t}));\n\n\t\t[EventType.MOUSE_UP, EventType.MOUSE_OUT].forEach(event => {\n\t\t\tthis._register(addDisposableListener(element, event, e => {\n\t\t\t\tEventHelper.stop(e);\n\t\t\t\telement.classList.remove('active');\n\t\t\t}));\n\t\t});\n\t}\n\n\tonClick(event: EventLike, preserveFocus = false): void {\n\t\tEventHelper.stop(event, true);\n\n\t\tconst context = types.isUndefinedOrNull(this._context) ? this.options?.useEventAsContext ? event : { preserveFocus } : this._context;\n\t\tthis.actionRunner.run(this._action, context);\n\t}\n\n\t// Only set the tabIndex on the element once it is about to get focused\n\t// That way this element wont be a tab stop when it is not needed #106441\n\tfocus(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.tabIndex = 0;\n\t\t\tthis.element.focus();\n\t\t\tthis.element.classList.add('focused');\n\t\t}\n\t}\n\n\tblur(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.blur();\n\t\t\tthis.element.tabIndex = -1;\n\t\t\tthis.element.classList.remove('focused');\n\t\t}\n\t}\n\n\tsetFocusable(focusable: boolean): void {\n\t\tif (this.element) {\n\t\t\tthis.element.tabIndex = focusable ? 0 : -1;\n\t\t}\n\t}\n\n\tget trapsArrowNavigation(): boolean {\n\t\treturn false;\n\t}\n\n\tprotected updateEnabled(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateLabel(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected getClass(): string | undefined {\n\t\treturn this.action.class;\n\t}\n\n\tprotected getTooltip(): string | undefined {\n\t\treturn this.action.tooltip;\n\t}\n\n\tprotected getHoverContents(): IManagedHoverContent | undefined {\n\t\treturn this.getTooltip();\n\t}\n\n\tprotected updateTooltip(): void {\n\t\tif (!this.element) {\n\t\t\treturn;\n\t\t}\n\t\tconst title = this.getHoverContents() ?? '';\n\t\tthis.updateAriaLabel();\n\n\t\tif (!this.customHover && title !== '') {\n\t\t\tconst hoverDelegate = this.options.hoverDelegate ?? getDefaultHoverDelegate('element');\n\t\t\tthis.customHover = this._store.add(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.element, title));\n\t\t} else if (this.customHover) {\n\t\t\tthis.customHover.update(title);\n\t\t}\n\t}\n\n\tprotected updateAriaLabel(): void {\n\t\tif (this.element) {\n\t\t\tconst title = this.getTooltip() ?? '';\n\t\t\tthis.element.setAttribute('aria-label', title);\n\t\t}\n\t}\n\n\tprotected updateClass(): void {\n\t\t// implement in subclass\n\t}\n\n\tprotected updateChecked(): void {\n\t\t// implement in subclass\n\t}\n\n\toverride dispose(): void {\n\t\tif (this.element) {\n\t\t\tthis.element.remove();\n\t\t\tthis.element = undefined;\n\t\t}\n\t\tthis._context = undefined;\n\t\tsuper.dispose();\n\t}\n}\n\nexport interface IActionViewItemOptions extends IBaseActionViewItemOptions {\n\ticon?: boolean;\n\tlabel?: boolean;\n\treadonly keybinding?: string | null;\n\treadonly keybindingNotRenderedWithLabel?: boolean;\n\treadonly toggleStyles?: IToggleStyles;\n}\n\nexport class ActionViewItem extends BaseActionViewItem {\n\n\tprotected label: HTMLElement | undefined;\n\tprotected override readonly options: IActionViewItemOptions;\n\n\tprivate cssClass?: string;\n\n\tconstructor(context: unknown, action: IAction, options: IActionViewItemOptions) {\n\t\toptions = {\n\t\t\t...options,\n\t\t\ticon: options.icon !== undefined ? options.icon : false,\n\t\t\tlabel: options.label !== undefined ? options.label : true,\n\t\t};\n\t\tsuper(context, action, options);\n\n\t\tthis.options = options;\n\t\tthis.cssClass = '';\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tsuper.render(container);\n\t\ttypes.assertType(this.element);\n\n\t\tconst label = document.createElement('a');\n\t\tlabel.classList.add('action-label');\n\t\tlabel.setAttribute('role', this.getDefaultAriaRole());\n\n\t\tthis.label = label;\n\t\tthis.element.appendChild(label);\n\n\t\tif (this.options.label && this.options.keybinding && !this.options.keybindingNotRenderedWithLabel) {\n\t\t\tconst kbLabel = document.createElement('span');\n\t\t\tkbLabel.classList.add('keybinding');\n\t\t\tkbLabel.textContent = this.options.keybinding;\n\t\t\tthis.element.appendChild(kbLabel);\n\t\t}\n\n\t\tthis.updateClass();\n\t\tthis.updateLabel();\n\t\tthis.updateTooltip();\n\t\tthis.updateEnabled();\n\t\tthis.updateChecked();\n\t}\n\n\tprivate getDefaultAriaRole(): 'presentation' | 'menuitem' | 'tab' | 'button' {\n\t\tif (this._action.id === Separator.ID) {\n\t\t\treturn 'presentation'; // A separator is a presentation item\n\t\t} else {\n\t\t\tif (this.options.isMenu) {\n\t\t\t\treturn 'menuitem';\n\t\t\t} else if (this.options.isTabList) {\n\t\t\t\treturn 'tab';\n\t\t\t} else {\n\t\t\t\treturn 'button';\n\t\t\t}\n\t\t}\n\t}\n\n\t// Only set the tabIndex on the element once it is about to get focused\n\t// That way this element wont be a tab stop when it is not needed #106441\n\toverride focus(): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = 0;\n\t\t\tthis.label.focus();\n\t\t}\n\t}\n\n\toverride blur(): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = -1;\n\t\t}\n\t}\n\n\toverride setFocusable(focusable: boolean): void {\n\t\tif (this.label) {\n\t\t\tthis.label.tabIndex = focusable ? 0 : -1;\n\t\t}\n\t}\n\n\tprotected override updateLabel(): void {\n\t\tif (this.options.label && this.label) {\n\t\t\tthis.label.textContent = this.action.label;\n\t\t}\n\t}\n\n\tprotected override getTooltip() {\n\t\tlet title: string | null = null;\n\n\t\tif (this.action.tooltip) {\n\t\t\ttitle = this.action.tooltip;\n\n\t\t} else if (this.action.label) {\n\t\t\ttitle = this.action.label;\n\t\t\tif (this.options.keybinding) {\n\t\t\t\ttitle = nls.localize({ key: 'titleLabel', comment: ['action title', 'action keybinding'] }, \"{0} ({1})\", title, this.options.keybinding);\n\t\t\t}\n\t\t}\n\t\treturn title ?? undefined;\n\t}\n\n\tprotected override updateClass(): void {\n\t\tif (this.cssClass && this.label) {\n\t\t\tthis.label.classList.remove(...this.cssClass.split(' '));\n\t\t}\n\t\tif (this.action.id === Separator.ID && this.action.class) {\n\t\t\tthis.label?.classList.add(this.action.class);\n\n\t\t} else if (this.options.icon) {\n\t\t\tthis.cssClass = this.getClass();\n\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.classList.add('codicon');\n\t\t\t\tif (this.cssClass) {\n\t\t\t\t\tthis.label.classList.add(...this.cssClass.split(' '));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.updateEnabled();\n\t\t} else {\n\t\t\tthis.label?.classList.remove('codicon');\n\t\t}\n\t}\n\n\tprotected override updateEnabled(): void {\n\t\tif (this.action.enabled) {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.removeAttribute('aria-disabled');\n\t\t\t\tthis.label.classList.remove('disabled');\n\t\t\t}\n\n\t\t\tthis.element?.classList.remove('disabled');\n\t\t} else {\n\t\t\tif (this.label) {\n\t\t\t\tthis.label.setAttribute('aria-disabled', 'true');\n\t\t\t\tthis.label.classList.add('disabled');\n\t\t\t}\n\n\t\t\tthis.element?.classList.add('disabled');\n\t\t}\n\t}\n\n\tprotected override updateAriaLabel(): void {\n\t\tif (this.label) {\n\t\t\tconst title = this.getTooltip() ?? '';\n\t\t\tthis.label.setAttribute('aria-label', title);\n\t\t}\n\t}\n\n\tprotected override updateChecked(): void {\n\t\tif (this.label) {\n\t\t\tif (this.action.checked !== undefined) {\n\t\t\t\tthis.label.classList.toggle('checked', this.action.checked);\n\t\t\t\tif (this.options.isTabList) {\n\t\t\t\t\tthis.label.setAttribute('aria-selected', this.action.checked ? 'true' : 'false');\n\t\t\t\t} else {\n\t\t\t\t\tthis.label.setAttribute('aria-checked', this.action.checked ? 'true' : 'false');\n\t\t\t\t\tthis.label.setAttribute('role', 'checkbox');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.label.classList.remove('checked');\n\t\t\t\tthis.label.removeAttribute(this.options.isTabList ? 'aria-selected' : 'aria-checked');\n\t\t\t\tthis.label.setAttribute('role', this.getDefaultAriaRole());\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class SelectActionViewItem<T = string> extends BaseActionViewItem {\n\tprotected selectBox: SelectBox;\n\n\tconstructor(ctx: unknown, action: IAction, options: ISelectOptionItem[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles, selectBoxOptions?: ISelectBoxOptions) {\n\t\tsuper(ctx, action);\n\n\t\tthis.selectBox = new SelectBox(options, selected, contextViewProvider, styles, selectBoxOptions);\n\t\tthis.selectBox.setFocusable(false);\n\n\t\tthis._register(this.selectBox);\n\t\tthis.registerListeners();\n\t}\n\n\tselect(index: number): void {\n\t\tthis.selectBox.select(index);\n\t}\n\n\tprivate registerListeners(): void {\n\t\tthis._register(this.selectBox.onDidSelect(e => this.runAction(e.selected, e.index)));\n\t}\n\n\tprotected runAction(option: string, index: number): void {\n\t\tthis.actionRunner.run(this._action, this.getActionContext(option, index));\n\t}\n\n\tprotected getActionContext(option: string, index: number): T | string {\n\t\treturn option;\n\t}\n\n\toverride setFocusable(focusable: boolean): void {\n\t\tthis.selectBox.setFocusable(focusable);\n\t}\n\n\toverride focus(): void {\n\t\tthis.selectBox?.focus();\n\t}\n\n\toverride blur(): void {\n\t\tthis.selectBox?.blur();\n\t}\n\n\toverride render(container: HTMLElement): void {\n\t\tthis.selectBox.render(container);\n\t}\n}\n"]}
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
height: 16px;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.monaco-action-bar .action-label
|
|
48
|
+
.monaco-action-bar .action-label,
|
|
49
|
+
.monaco-action-bar .action-item .keybinding {
|
|
49
50
|
display: flex;
|
|
50
51
|
font-size: 11px;
|
|
51
52
|
padding: 3px;
|
|
@@ -75,12 +76,14 @@
|
|
|
75
76
|
display: block;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
.monaco-action-bar.vertical .action-label.separator {
|
|
79
|
+
.monaco-action-bar.vertical .action-item .action-label.separator {
|
|
79
80
|
display: block;
|
|
80
|
-
border-bottom: 1px solid var(--vscode-disabledForeground);
|
|
81
|
+
border-bottom: 1px solid var(--vscode-menu-separatorBackground, var(--vscode-disabledForeground));
|
|
81
82
|
padding-top: 1px;
|
|
82
|
-
margin
|
|
83
|
-
|
|
83
|
+
margin: 4px .8em;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 0;
|
|
86
|
+
background-color: transparent;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
.monaco-action-bar .action-item .action-label.separator {
|
|
@@ -38,7 +38,7 @@ export function layout(viewportSize, viewSize, anchor) {
|
|
|
38
38
|
if (viewSize <= layoutBeforeAnchorBoundary) {
|
|
39
39
|
return layoutBeforeAnchorBoundary - viewSize; // happy case, lay it out before the anchor
|
|
40
40
|
}
|
|
41
|
-
if (viewSize <= viewportSize - layoutAfterAnchorBoundary) {
|
|
41
|
+
if (viewSize <= viewportSize - layoutAfterAnchorBoundary && layoutBeforeAnchorBoundary < viewSize / 2) {
|
|
42
42
|
return layoutAfterAnchorBoundary; // ok case, lay it out after the anchor
|
|
43
43
|
}
|
|
44
44
|
return 0; // sad case, lay it over the anchor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/base/browser/ui/contextview/contextview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,OAAO,mBAAmB,CAAC;AAe3B,MAAM,UAAU,QAAQ,CAAC,GAAY;IACpC,MAAM,MAAM,GAAG,GAAkD,CAAC;IAElE,OAAO,CAAC,CAA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AAC,OAAO,EAAE,CAAC;QAEhC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAEO,SAAS;QAChB,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IACxB,CAAC;IAEO,UAAU,CAAC,CAAU,EAAE,SAAkB;QAChD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBAC9B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAe,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;YACnF,CAAC;iBAAM,IAAI,SAAS,IAAI,CAAC,GAAG,CAAC,UAAU,CAAc,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gBAChF,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,CAAC;QACF,CAAC;IACF,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,IAAI,EAAE,CAAC;QAEZ,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;;AAGF,MAAM,eAAe,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCjC,CAAC","file":"contextview.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 { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport { Range } from '../../../common/range.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport './contextview.css';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport const enum AnchorAlignment {\n\tLEFT, RIGHT\n}\n\nexport const enum AnchorPosition {\n\tBELOW, ABOVE\n}\n\nexport const enum AnchorAxisAlignment {\n\tVERTICAL, HORIZONTAL\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport interface IPosition {\n\ttop: number;\n\tleft: number;\n}\n\nexport interface ISize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface IView extends IPosition, ISize { }\n\nexport const enum LayoutAnchorPosition {\n\tBefore,\n\tAfter\n}\n\nexport enum LayoutAnchorMode {\n\tAVOID,\n\tALIGN\n}\n\nexport interface ILayoutAnchor {\n\toffset: number;\n\tsize: number;\n\tmode?: LayoutAnchorMode; // default: AVOID\n\tposition: LayoutAnchorPosition;\n}\n\n/**\n * Lays out a one dimensional view next to an anchor in a viewport.\n *\n * @returns The view offset within the viewport.\n */\nexport function layout(viewportSize: number, viewSize: number, anchor: ILayoutAnchor): number {\n\tconst layoutAfterAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset : anchor.offset + anchor.size;\n\tconst layoutBeforeAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset + anchor.size : anchor.offset;\n\n\tif (anchor.position === LayoutAnchorPosition.Before) {\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // happy case, lay it out after the anchor\n\t\t}\n\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // ok case, lay it out before the anchor\n\t\t}\n\n\t\treturn Math.max(viewportSize - viewSize, 0); // sad case, lay it over the anchor\n\t} else {\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // happy case, lay it out before the anchor\n\t\t}\n\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // ok case, lay it out after the anchor\n\t\t}\n\n\t\treturn 0; // sad case, lay it over the anchor\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\tif (container === this.container && usedShadowDOM === this.useShadowDOM) {\n\t\t\treturn; // container is the same and no shadow DOM usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tthis.view.style.zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tthis.delegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = this.delegate!.getAnchor();\n\n\t\t// Compute around\n\t\tlet around: IView;\n\n\t\t// Get the element's position and size (to anchor the view)\n\t\tif (DOM.isHTMLElement(anchor)) {\n\t\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\t\taround = {\n\t\t\t\ttop: elementPosition.top * zoom,\n\t\t\t\tleft: elementPosition.left * zoom,\n\t\t\t\twidth: elementPosition.width * zoom,\n\t\t\t\theight: elementPosition.height * zoom\n\t\t\t};\n\t\t} else if (isAnchor(anchor)) {\n\t\t\taround = {\n\t\t\t\ttop: anchor.y,\n\t\t\t\tleft: anchor.x,\n\t\t\t\twidth: anchor.width || 1,\n\t\t\t\theight: anchor.height || 2\n\t\t\t};\n\t\t} else {\n\t\t\taround = {\n\t\t\t\ttop: anchor.posy,\n\t\t\t\tleft: anchor.posx,\n\t\t\t\t// We are about to position the context view where the mouse\n\t\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\t\twidth: 2,\n\t\t\t\theight: 2\n\t\t\t};\n\t\t}\n\n\t\tconst viewSizeWidth = DOM.getTotalWidth(this.view);\n\t\tconst viewSizeHeight = DOM.getTotalHeight(this.view);\n\n\t\tconst anchorPosition = this.delegate!.anchorPosition ?? AnchorPosition.BELOW;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment ?? AnchorAlignment.LEFT;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment ?? AnchorAxisAlignment.VERTICAL;\n\n\t\tlet top: number;\n\t\tlet left: number;\n\n\t\tconst activeWindow = DOM.getActiveWindow();\n\t\tif (anchorAxisAlignment === AnchorAxisAlignment.VERTICAL) {\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top - activeWindow.pageYOffset, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\n\t\t\t// if view intersects vertically with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) {\n\t\t\t\thorizontalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\t\t} else {\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\n\t\t\t// if view intersects horizontally with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: left, end: left + viewSizeWidth }, { start: horizontalAnchor.offset, end: horizontalAnchor.offset + horizontalAnchor.size })) {\n\t\t\t\tverticalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\t\t}\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\n\t\tconst containerPosition = DOM.getDomNodePagePosition(this.container!);\n\n\t\t// Account for container scroll when positioning the context view\n\t\tconst containerScrollTop = this.container!.scrollTop || 0;\n\t\tconst containerScrollLeft = this.container!.scrollLeft || 0;\n\n\t\tthis.view.style.top = `${top - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).top : containerPosition.top) + containerScrollTop}px`;\n\t\tthis.view.style.left = `${left - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).left : containerPosition.left) + containerScrollLeft}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown): void {\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (delegate?.onHide) {\n\t\t\tdelegate.onHide(data);\n\t\t}\n\n\t\tthis.toDisposeOnClean.dispose();\n\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\n\t\tsuper.dispose();\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n`;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport { Range } from '../../../common/range.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport './contextview.css';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport const enum AnchorAlignment {\n\tLEFT, RIGHT\n}\n\nexport const enum AnchorPosition {\n\tBELOW, ABOVE\n}\n\nexport const enum AnchorAxisAlignment {\n\tVERTICAL, HORIZONTAL\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport interface IPosition {\n\ttop: number;\n\tleft: number;\n}\n\nexport interface ISize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface IView extends IPosition, ISize { }\n\nexport const enum LayoutAnchorPosition {\n\tBefore,\n\tAfter\n}\n\nexport enum LayoutAnchorMode {\n\tAVOID,\n\tALIGN\n}\n\nexport interface ILayoutAnchor {\n\toffset: number;\n\tsize: number;\n\tmode?: LayoutAnchorMode; // default: AVOID\n\tposition: LayoutAnchorPosition;\n}\n\n/**\n * Lays out a one dimensional view next to an anchor in a viewport.\n *\n * @returns The view offset within the viewport.\n */\nexport function layout(viewportSize: number, viewSize: number, anchor: ILayoutAnchor): number {\n\tconst layoutAfterAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset : anchor.offset + anchor.size;\n\tconst layoutBeforeAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset + anchor.size : anchor.offset;\n\n\tif (anchor.position === LayoutAnchorPosition.Before) {\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // happy case, lay it out after the anchor\n\t\t}\n\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // ok case, lay it out before the anchor\n\t\t}\n\n\t\treturn Math.max(viewportSize - viewSize, 0); // sad case, lay it over the anchor\n\t} else {\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // happy case, lay it out before the anchor\n\t\t}\n\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // ok case, lay it out after the anchor\n\t\t}\n\n\t\treturn 0; // sad case, lay it over the anchor\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\tif (container === this.container && usedShadowDOM === this.useShadowDOM) {\n\t\t\treturn; // container is the same and no shadow DOM usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tthis.view.style.zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tthis.delegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = this.delegate!.getAnchor();\n\n\t\t// Compute around\n\t\tlet around: IView;\n\n\t\t// Get the element's position and size (to anchor the view)\n\t\tif (DOM.isHTMLElement(anchor)) {\n\t\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\t\taround = {\n\t\t\t\ttop: elementPosition.top * zoom,\n\t\t\t\tleft: elementPosition.left * zoom,\n\t\t\t\twidth: elementPosition.width * zoom,\n\t\t\t\theight: elementPosition.height * zoom\n\t\t\t};\n\t\t} else if (isAnchor(anchor)) {\n\t\t\taround = {\n\t\t\t\ttop: anchor.y,\n\t\t\t\tleft: anchor.x,\n\t\t\t\twidth: anchor.width || 1,\n\t\t\t\theight: anchor.height || 2\n\t\t\t};\n\t\t} else {\n\t\t\taround = {\n\t\t\t\ttop: anchor.posy,\n\t\t\t\tleft: anchor.posx,\n\t\t\t\t// We are about to position the context view where the mouse\n\t\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\t\twidth: 2,\n\t\t\t\theight: 2\n\t\t\t};\n\t\t}\n\n\t\tconst viewSizeWidth = DOM.getTotalWidth(this.view);\n\t\tconst viewSizeHeight = DOM.getTotalHeight(this.view);\n\n\t\tconst anchorPosition = this.delegate!.anchorPosition ?? AnchorPosition.BELOW;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment ?? AnchorAlignment.LEFT;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment ?? AnchorAxisAlignment.VERTICAL;\n\n\t\tlet top: number;\n\t\tlet left: number;\n\n\t\tconst activeWindow = DOM.getActiveWindow();\n\t\tif (anchorAxisAlignment === AnchorAxisAlignment.VERTICAL) {\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top - activeWindow.pageYOffset, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\n\t\t\t// if view intersects vertically with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) {\n\t\t\t\thorizontalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\t\t} else {\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\n\t\t\t// if view intersects horizontally with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: left, end: left + viewSizeWidth }, { start: horizontalAnchor.offset, end: horizontalAnchor.offset + horizontalAnchor.size })) {\n\t\t\t\tverticalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\t\t}\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\n\t\tconst containerPosition = DOM.getDomNodePagePosition(this.container!);\n\n\t\t// Account for container scroll when positioning the context view\n\t\tconst containerScrollTop = this.container!.scrollTop || 0;\n\t\tconst containerScrollLeft = this.container!.scrollLeft || 0;\n\n\t\tthis.view.style.top = `${top - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).top : containerPosition.top) + containerScrollTop}px`;\n\t\tthis.view.style.left = `${left - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).left : containerPosition.left) + containerScrollLeft}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown): void {\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (delegate?.onHide) {\n\t\t\tdelegate.onHide(data);\n\t\t}\n\n\t\tthis.toDisposeOnClean.dispose();\n\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\n\t\tsuper.dispose();\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n`;\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/contextview/contextview.ts","vs/base/browser/ui/contextview/contextview.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtG,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,OAAO,mBAAmB,CAAC;AAe3B,MAAM,UAAU,QAAQ,CAAC,GAAY;IACpC,MAAM,MAAM,GAAG,GAAkD,CAAC;IAElE,OAAO,CAAC,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,QAAQ,CAAC;AACjF,CAAC;AA6DD,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC3B,yDAAK,CAAA;IACL,yDAAK,CAAA;AACN,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AASD;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,YAAoB,EAAE,QAAgB,EAAE,MAAqB;IACnF,MAAM,yBAAyB,GAAG,MAAM,CAAC,IAAI,KAAK,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IACvH,MAAM,0BAA0B,GAAG,MAAM,CAAC,IAAI,KAAK,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IAExH,IAAI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;QACf,IAAI,CAAC,IAAI,EAAE,CAAC;QAEZ,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;;AAGF,MAAM,eAAe,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCjC,CAAC","file":"contextview.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 { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport { Range } from '../../../common/range.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport './contextview.css';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport const enum AnchorAlignment {\n\tLEFT, RIGHT\n}\n\nexport const enum AnchorPosition {\n\tBELOW, ABOVE\n}\n\nexport const enum AnchorAxisAlignment {\n\tVERTICAL, HORIZONTAL\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport interface IPosition {\n\ttop: number;\n\tleft: number;\n}\n\nexport interface ISize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface IView extends IPosition, ISize { }\n\nexport const enum LayoutAnchorPosition {\n\tBefore,\n\tAfter\n}\n\nexport enum LayoutAnchorMode {\n\tAVOID,\n\tALIGN\n}\n\nexport interface ILayoutAnchor {\n\toffset: number;\n\tsize: number;\n\tmode?: LayoutAnchorMode; // default: AVOID\n\tposition: LayoutAnchorPosition;\n}\n\n/**\n * Lays out a one dimensional view next to an anchor in a viewport.\n *\n * @returns The view offset within the viewport.\n */\nexport function layout(viewportSize: number, viewSize: number, anchor: ILayoutAnchor): number {\n\tconst layoutAfterAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset : anchor.offset + anchor.size;\n\tconst layoutBeforeAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset + anchor.size : anchor.offset;\n\n\tif (anchor.position === LayoutAnchorPosition.Before) {\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // happy case, lay it out after the anchor\n\t\t}\n\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // ok case, lay it out before the anchor\n\t\t}\n\n\t\treturn Math.max(viewportSize - viewSize, 0); // sad case, lay it over the anchor\n\t} else {\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // happy case, lay it out before the anchor\n\t\t}\n\n\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary && layoutBeforeAnchorBoundary < viewSize / 2) {\n\t\t\treturn layoutAfterAnchorBoundary; // ok case, lay it out after the anchor\n\t\t}\n\n\n\t\treturn 0; // sad case, lay it over the anchor\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\tif (container === this.container && usedShadowDOM === this.useShadowDOM) {\n\t\t\treturn; // container is the same and no shadow DOM usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tthis.view.style.zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tthis.delegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = this.delegate!.getAnchor();\n\n\t\t// Compute around\n\t\tlet around: IView;\n\n\t\t// Get the element's position and size (to anchor the view)\n\t\tif (DOM.isHTMLElement(anchor)) {\n\t\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\t\taround = {\n\t\t\t\ttop: elementPosition.top * zoom,\n\t\t\t\tleft: elementPosition.left * zoom,\n\t\t\t\twidth: elementPosition.width * zoom,\n\t\t\t\theight: elementPosition.height * zoom\n\t\t\t};\n\t\t} else if (isAnchor(anchor)) {\n\t\t\taround = {\n\t\t\t\ttop: anchor.y,\n\t\t\t\tleft: anchor.x,\n\t\t\t\twidth: anchor.width || 1,\n\t\t\t\theight: anchor.height || 2\n\t\t\t};\n\t\t} else {\n\t\t\taround = {\n\t\t\t\ttop: anchor.posy,\n\t\t\t\tleft: anchor.posx,\n\t\t\t\t// We are about to position the context view where the mouse\n\t\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\t\twidth: 2,\n\t\t\t\theight: 2\n\t\t\t};\n\t\t}\n\n\t\tconst viewSizeWidth = DOM.getTotalWidth(this.view);\n\t\tconst viewSizeHeight = DOM.getTotalHeight(this.view);\n\n\t\tconst anchorPosition = this.delegate!.anchorPosition ?? AnchorPosition.BELOW;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment ?? AnchorAlignment.LEFT;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment ?? AnchorAxisAlignment.VERTICAL;\n\n\t\tlet top: number;\n\t\tlet left: number;\n\n\t\tconst activeWindow = DOM.getActiveWindow();\n\t\tif (anchorAxisAlignment === AnchorAxisAlignment.VERTICAL) {\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top - activeWindow.pageYOffset, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\n\t\t\t// if view intersects vertically with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) {\n\t\t\t\thorizontalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\t\t} else {\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\n\t\t\t// if view intersects horizontally with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: left, end: left + viewSizeWidth }, { start: horizontalAnchor.offset, end: horizontalAnchor.offset + horizontalAnchor.size })) {\n\t\t\t\tverticalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\t\t}\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\n\t\tconst containerPosition = DOM.getDomNodePagePosition(this.container!);\n\n\t\t// Account for container scroll when positioning the context view\n\t\tconst containerScrollTop = this.container!.scrollTop || 0;\n\t\tconst containerScrollLeft = this.container!.scrollLeft || 0;\n\n\t\tthis.view.style.top = `${top - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).top : containerPosition.top) + containerScrollTop}px`;\n\t\tthis.view.style.left = `${left - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).left : containerPosition.left) + containerScrollLeft}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown): void {\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (delegate?.onHide) {\n\t\t\tdelegate.onHide(data);\n\t\t}\n\n\t\tthis.toDisposeOnClean.dispose();\n\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\n\t\tsuper.dispose();\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n`;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { BrowserFeatures } from '../../canIUse.js';\nimport * as DOM from '../../dom.js';\nimport { StandardMouseEvent } from '../../mouseEvent.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../common/lifecycle.js';\nimport * as platform from '../../../common/platform.js';\nimport { Range } from '../../../common/range.js';\nimport { OmitOptional } from '../../../common/types.js';\nimport './contextview.css';\n\nexport const enum ContextViewDOMPosition {\n\tABSOLUTE = 1,\n\tFIXED,\n\tFIXED_SHADOW\n}\n\nexport interface IAnchor {\n\tx: number;\n\ty: number;\n\twidth?: number;\n\theight?: number;\n}\n\nexport function isAnchor(obj: unknown): obj is IAnchor | OmitOptional<IAnchor> {\n\tconst anchor = obj as IAnchor | OmitOptional<IAnchor> | undefined;\n\n\treturn !!anchor && typeof anchor.x === 'number' && typeof anchor.y === 'number';\n}\n\nexport const enum AnchorAlignment {\n\tLEFT, RIGHT\n}\n\nexport const enum AnchorPosition {\n\tBELOW, ABOVE\n}\n\nexport const enum AnchorAxisAlignment {\n\tVERTICAL, HORIZONTAL\n}\n\nexport interface IDelegate {\n\t/**\n\t * The anchor where to position the context view.\n\t * Use a `HTMLElement` to position the view at the element,\n\t * a `StandardMouseEvent` to position it at the mouse position\n\t * or an `IAnchor` to position it at a specific location.\n\t */\n\tgetAnchor(): HTMLElement | StandardMouseEvent | IAnchor;\n\trender(container: HTMLElement): IDisposable | null;\n\tfocus?(): void;\n\tlayout?(): void;\n\tanchorAlignment?: AnchorAlignment; // default: left\n\tanchorPosition?: AnchorPosition; // default: below\n\tanchorAxisAlignment?: AnchorAxisAlignment; // default: vertical\n\tcanRelayout?: boolean; // default: true\n\tonDOMEvent?(e: Event, activeElement: HTMLElement): void;\n\tonHide?(data?: unknown): void;\n\n\t/**\n\t * context views with higher layers are rendered higher in z-index order\n\t */\n\tlayer?: number; // Default: 0\n}\n\nexport interface IContextViewProvider {\n\tshowContextView(delegate: IDelegate, container?: HTMLElement): void;\n\thideContextView(): void;\n\tlayout(): void;\n}\n\nexport interface IPosition {\n\ttop: number;\n\tleft: number;\n}\n\nexport interface ISize {\n\twidth: number;\n\theight: number;\n}\n\nexport interface IView extends IPosition, ISize { }\n\nexport const enum LayoutAnchorPosition {\n\tBefore,\n\tAfter\n}\n\nexport enum LayoutAnchorMode {\n\tAVOID,\n\tALIGN\n}\n\nexport interface ILayoutAnchor {\n\toffset: number;\n\tsize: number;\n\tmode?: LayoutAnchorMode; // default: AVOID\n\tposition: LayoutAnchorPosition;\n}\n\n/**\n * Lays out a one dimensional view next to an anchor in a viewport.\n *\n * @returns The view offset within the viewport.\n */\nexport function layout(viewportSize: number, viewSize: number, anchor: ILayoutAnchor): number {\n\tconst layoutAfterAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset : anchor.offset + anchor.size;\n\tconst layoutBeforeAnchorBoundary = anchor.mode === LayoutAnchorMode.ALIGN ? anchor.offset + anchor.size : anchor.offset;\n\n\tif (anchor.position === LayoutAnchorPosition.Before) {\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary) {\n\t\t\treturn layoutAfterAnchorBoundary; // happy case, lay it out after the anchor\n\t\t}\n\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // ok case, lay it out before the anchor\n\t\t}\n\n\t\treturn Math.max(viewportSize - viewSize, 0); // sad case, lay it over the anchor\n\t} else {\n\t\tif (viewSize <= layoutBeforeAnchorBoundary) {\n\t\t\treturn layoutBeforeAnchorBoundary - viewSize; // happy case, lay it out before the anchor\n\t\t}\n\n\n\t\tif (viewSize <= viewportSize - layoutAfterAnchorBoundary && layoutBeforeAnchorBoundary < viewSize / 2) {\n\t\t\treturn layoutAfterAnchorBoundary; // ok case, lay it out after the anchor\n\t\t}\n\n\n\t\treturn 0; // sad case, lay it over the anchor\n\t}\n}\n\nexport class ContextView extends Disposable {\n\n\tprivate static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur'];\n\tprivate static readonly BUBBLE_DOWN_EVENTS = ['click'];\n\n\tprivate container: HTMLElement | null = null;\n\tprivate view: HTMLElement;\n\tprivate useFixedPosition = false;\n\tprivate useShadowDOM = false;\n\tprivate delegate: IDelegate | null = null;\n\tprivate toDisposeOnClean: IDisposable = Disposable.None;\n\tprivate toDisposeOnSetContainer: IDisposable = Disposable.None;\n\tprivate shadowRoot: ShadowRoot | null = null;\n\tprivate shadowRootHostElement: HTMLElement | null = null;\n\n\tconstructor(container: HTMLElement, domPosition: ContextViewDOMPosition) {\n\t\tsuper();\n\n\t\tthis.view = DOM.$('.context-view');\n\t\tDOM.hide(this.view);\n\n\t\tthis.setContainer(container, domPosition);\n\t\tthis._register(toDisposable(() => this.setContainer(null, ContextViewDOMPosition.ABSOLUTE)));\n\t}\n\n\tsetContainer(container: HTMLElement | null, domPosition: ContextViewDOMPosition): void {\n\t\tthis.useFixedPosition = domPosition !== ContextViewDOMPosition.ABSOLUTE;\n\t\tconst usedShadowDOM = this.useShadowDOM;\n\t\tthis.useShadowDOM = domPosition === ContextViewDOMPosition.FIXED_SHADOW;\n\n\t\tif (container === this.container && usedShadowDOM === this.useShadowDOM) {\n\t\t\treturn; // container is the same and no shadow DOM usage has changed\n\t\t}\n\n\t\tif (this.container) {\n\t\t\tthis.toDisposeOnSetContainer.dispose();\n\n\t\t\tthis.view.remove();\n\t\t\tif (this.shadowRoot) {\n\t\t\t\tthis.shadowRoot = null;\n\t\t\t\tthis.shadowRootHostElement?.remove();\n\t\t\t\tthis.shadowRootHostElement = null;\n\t\t\t}\n\n\t\t\tthis.container = null;\n\t\t}\n\n\t\tif (container) {\n\t\t\tthis.container = container;\n\n\t\t\tif (this.useShadowDOM) {\n\t\t\t\tthis.shadowRootHostElement = DOM.$('.shadow-root-host');\n\t\t\t\tthis.container.appendChild(this.shadowRootHostElement);\n\t\t\t\tthis.shadowRoot = this.shadowRootHostElement.attachShadow({ mode: 'open' });\n\t\t\t\tconst style = document.createElement('style');\n\t\t\t\tstyle.textContent = SHADOW_ROOT_CSS;\n\t\t\t\tthis.shadowRoot.appendChild(style);\n\t\t\t\tthis.shadowRoot.appendChild(this.view);\n\t\t\t\tthis.shadowRoot.appendChild(DOM.$('slot'));\n\t\t\t} else {\n\t\t\t\tthis.container.appendChild(this.view);\n\t\t\t}\n\n\t\t\tconst toDisposeOnSetContainer = new DisposableStore();\n\n\t\t\tContextView.BUBBLE_UP_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, false);\n\t\t\t\t}));\n\t\t\t});\n\n\t\t\tContextView.BUBBLE_DOWN_EVENTS.forEach(event => {\n\t\t\t\ttoDisposeOnSetContainer.add(DOM.addStandardDisposableListener(this.container!, event, e => {\n\t\t\t\t\tthis.onDOMEvent(e, true);\n\t\t\t\t}, true));\n\t\t\t});\n\n\t\t\tthis.toDisposeOnSetContainer = toDisposeOnSetContainer;\n\t\t}\n\t}\n\n\tshow(delegate: IDelegate): void {\n\t\tif (this.isVisible()) {\n\t\t\tthis.hide();\n\t\t}\n\n\t\t// Show static box\n\t\tDOM.clearNode(this.view);\n\t\tthis.view.className = 'context-view monaco-component';\n\t\tthis.view.style.top = '0px';\n\t\tthis.view.style.left = '0px';\n\t\tthis.view.style.zIndex = `${2575 + (delegate.layer ?? 0)}`;\n\t\tthis.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';\n\t\tDOM.show(this.view);\n\n\t\t// Render content\n\t\tthis.toDisposeOnClean = delegate.render(this.view) || Disposable.None;\n\n\t\t// Set active delegate\n\t\tthis.delegate = delegate;\n\n\t\t// Layout\n\t\tthis.doLayout();\n\n\t\t// Focus\n\t\tthis.delegate.focus?.();\n\t}\n\n\tgetViewElement(): HTMLElement {\n\t\treturn this.view;\n\t}\n\n\tlayout(): void {\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.delegate!.canRelayout === false && !(platform.isIOS && BrowserFeatures.pointerEvents)) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.delegate?.layout?.();\n\n\t\tthis.doLayout();\n\t}\n\n\tprivate doLayout(): void {\n\t\t// Check that we still have a delegate - this.delegate.layout may have hidden\n\t\tif (!this.isVisible()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get anchor\n\t\tconst anchor = this.delegate!.getAnchor();\n\n\t\t// Compute around\n\t\tlet around: IView;\n\n\t\t// Get the element's position and size (to anchor the view)\n\t\tif (DOM.isHTMLElement(anchor)) {\n\t\t\tconst elementPosition = DOM.getDomNodePagePosition(anchor);\n\n\t\t\t// In areas where zoom is applied to the element or its ancestors, we need to adjust the size of the element\n\t\t\t// e.g. The title bar has counter zoom behavior meaning it applies the inverse of zoom level.\n\t\t\t// Window Zoom Level: 1.5, Title Bar Zoom: 1/1.5, Size Multiplier: 1.5\n\t\t\tconst zoom = DOM.getDomNodeZoomLevel(anchor);\n\n\t\t\taround = {\n\t\t\t\ttop: elementPosition.top * zoom,\n\t\t\t\tleft: elementPosition.left * zoom,\n\t\t\t\twidth: elementPosition.width * zoom,\n\t\t\t\theight: elementPosition.height * zoom\n\t\t\t};\n\t\t} else if (isAnchor(anchor)) {\n\t\t\taround = {\n\t\t\t\ttop: anchor.y,\n\t\t\t\tleft: anchor.x,\n\t\t\t\twidth: anchor.width || 1,\n\t\t\t\theight: anchor.height || 2\n\t\t\t};\n\t\t} else {\n\t\t\taround = {\n\t\t\t\ttop: anchor.posy,\n\t\t\t\tleft: anchor.posx,\n\t\t\t\t// We are about to position the context view where the mouse\n\t\t\t\t// cursor is. To prevent the view being exactly under the mouse\n\t\t\t\t// when showing and thus potentially triggering an action within,\n\t\t\t\t// we treat the mouse location like a small sized block element.\n\t\t\t\twidth: 2,\n\t\t\t\theight: 2\n\t\t\t};\n\t\t}\n\n\t\tconst viewSizeWidth = DOM.getTotalWidth(this.view);\n\t\tconst viewSizeHeight = DOM.getTotalHeight(this.view);\n\n\t\tconst anchorPosition = this.delegate!.anchorPosition ?? AnchorPosition.BELOW;\n\t\tconst anchorAlignment = this.delegate!.anchorAlignment ?? AnchorAlignment.LEFT;\n\t\tconst anchorAxisAlignment = this.delegate!.anchorAxisAlignment ?? AnchorAxisAlignment.VERTICAL;\n\n\t\tlet top: number;\n\t\tlet left: number;\n\n\t\tconst activeWindow = DOM.getActiveWindow();\n\t\tif (anchorAxisAlignment === AnchorAxisAlignment.VERTICAL) {\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top - activeWindow.pageYOffset, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\n\t\t\t// if view intersects vertically with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: top, end: top + viewSizeHeight }, { start: verticalAnchor.offset, end: verticalAnchor.offset + verticalAnchor.size })) {\n\t\t\t\thorizontalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\t\t} else {\n\t\t\tconst horizontalAnchor: ILayoutAnchor = { offset: around.left, size: around.width, position: anchorAlignment === AnchorAlignment.LEFT ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After };\n\t\t\tconst verticalAnchor: ILayoutAnchor = { offset: around.top, size: around.height, position: anchorPosition === AnchorPosition.BELOW ? LayoutAnchorPosition.Before : LayoutAnchorPosition.After, mode: LayoutAnchorMode.ALIGN };\n\n\t\t\tleft = layout(activeWindow.innerWidth, viewSizeWidth, horizontalAnchor);\n\n\t\t\t// if view intersects horizontally with anchor, we must avoid the anchor\n\t\t\tif (Range.intersects({ start: left, end: left + viewSizeWidth }, { start: horizontalAnchor.offset, end: horizontalAnchor.offset + horizontalAnchor.size })) {\n\t\t\t\tverticalAnchor.mode = LayoutAnchorMode.AVOID;\n\t\t\t}\n\n\t\t\ttop = layout(activeWindow.innerHeight, viewSizeHeight, verticalAnchor) + activeWindow.pageYOffset;\n\t\t}\n\n\t\tthis.view.classList.remove('top', 'bottom', 'left', 'right');\n\t\tthis.view.classList.add(anchorPosition === AnchorPosition.BELOW ? 'bottom' : 'top');\n\t\tthis.view.classList.add(anchorAlignment === AnchorAlignment.LEFT ? 'left' : 'right');\n\t\tthis.view.classList.toggle('fixed', this.useFixedPosition);\n\n\t\tconst containerPosition = DOM.getDomNodePagePosition(this.container!);\n\n\t\t// Account for container scroll when positioning the context view\n\t\tconst containerScrollTop = this.container!.scrollTop || 0;\n\t\tconst containerScrollLeft = this.container!.scrollLeft || 0;\n\n\t\tthis.view.style.top = `${top - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).top : containerPosition.top) + containerScrollTop}px`;\n\t\tthis.view.style.left = `${left - (this.useFixedPosition ? DOM.getDomNodePagePosition(this.view).left : containerPosition.left) + containerScrollLeft}px`;\n\t\tthis.view.style.width = 'initial';\n\t}\n\n\thide(data?: unknown): void {\n\t\tconst delegate = this.delegate;\n\t\tthis.delegate = null;\n\n\t\tif (delegate?.onHide) {\n\t\t\tdelegate.onHide(data);\n\t\t}\n\n\t\tthis.toDisposeOnClean.dispose();\n\n\t\tDOM.hide(this.view);\n\t}\n\n\tprivate isVisible(): boolean {\n\t\treturn !!this.delegate;\n\t}\n\n\tprivate onDOMEvent(e: UIEvent, onCapture: boolean): void {\n\t\tif (this.delegate) {\n\t\t\tif (this.delegate.onDOMEvent) {\n\t\t\t\tthis.delegate.onDOMEvent(e, <HTMLElement>DOM.getWindow(e).document.activeElement);\n\t\t\t} else if (onCapture && !DOM.isAncestor(<HTMLElement>e.target, this.container)) {\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tthis.hide();\n\n\t\tsuper.dispose();\n\t}\n}\n\nconst SHADOW_ROOT_CSS = /* css */ `\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*='codicon-'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe WPC\", \"Segoe UI\", \"HelveticaNeue-Light\", system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang SC\", \"Hiragino Sans GB\", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, \"PingFang TC\", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, \"Hiragino Kaku Gothic Pro\", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, \"Apple SD Gothic Neo\", \"Nanum Gothic\", \"AppleGothic\", sans-serif; }\n\n\t:host-context(.windows) { font-family: \"Segoe WPC\", \"Segoe UI\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft YaHei\", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Microsoft Jhenghei\", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Yu Gothic UI\", \"Meiryo UI\", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: \"Segoe WPC\", \"Segoe UI\", \"Malgun Gothic\", \"Dotom\", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans SC\", \"Source Han Sans CN\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans TC\", \"Source Han Sans TW\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ja)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans J\", \"Source Han Sans JP\", \"Source Han Sans\", sans-serif; }\n\t:host-context(.linux:lang(ko)) { font-family: system-ui, \"Ubuntu\", \"Droid Sans\", \"Source Han Sans K\", \"Source Han Sans JR\", \"Source Han Sans\", \"UnDotum\", \"FBaekmuk Gulim\", sans-serif; }\n`;\n"]}
|