monaco-editor-core 0.56.0-dev-20260114 → 0.56.0-dev-20260115
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/domStylesheets.js +9 -18
- package/esm/vs/base/browser/domStylesheets.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.css +13 -5
- package/esm/vs/base/browser/ui/button/button.js +1 -0
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/dialog/dialog.css +2 -8
- package/esm/vs/base/browser/ui/inputbox/inputBox.css +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.css +2 -2
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.css +1 -1
- package/esm/vs/base/common/validation.js +11 -0
- package/esm/vs/base/common/validation.js.map +1 -1
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +4 -0
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/common/languages/supports/tokenization.js +12 -1
- package/esm/vs/editor/common/languages/supports/tokenization.js.map +1 -1
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js +4 -4
- package/esm/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.js.map +1 -1
- package/esm/vs/editor/common/textModelEvents.js +2 -2
- package/esm/vs/editor/common/textModelEvents.js.map +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +3 -3
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +3 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +7 -4
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/rename/browser/renameWidget.css +1 -1
- package/esm/vs/editor/editor.api.d.ts +23 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +3 -11
- package/monaco.d.ts +23 -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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
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-20260115(c9e76adb9a0a0a2c7ec65a539e36464192dac072)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
@@ -2,20 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { DisposableStore, toDisposable } from '../common/lifecycle.js';
|
|
5
|
+
import { DisposableStore, toDisposable, Disposable } from '../common/lifecycle.js';
|
|
6
6
|
import { autorun } from '../common/observable.js';
|
|
7
7
|
import { isFirefox } from './browser.js';
|
|
8
8
|
import { getWindows, sharedMutationObserver } from './dom.js';
|
|
9
9
|
import { mainWindow } from './window.js';
|
|
10
10
|
const globalStylesheets = new Map();
|
|
11
|
-
|
|
12
|
-
* A version of createStyleSheet which has a unified API to initialize/set the style content.
|
|
13
|
-
*/
|
|
14
|
-
export function createStyleSheet2() {
|
|
15
|
-
return new WrappedStyleElement();
|
|
16
|
-
}
|
|
17
|
-
class WrappedStyleElement {
|
|
11
|
+
class WrappedStyleElement extends Disposable {
|
|
18
12
|
constructor() {
|
|
13
|
+
super(...arguments);
|
|
19
14
|
this._currentCssStyle = '';
|
|
20
15
|
this._styleSheet = undefined;
|
|
21
16
|
}
|
|
@@ -25,17 +20,15 @@ class WrappedStyleElement {
|
|
|
25
20
|
}
|
|
26
21
|
this._currentCssStyle = cssStyle;
|
|
27
22
|
if (!this._styleSheet) {
|
|
28
|
-
this._styleSheet = createStyleSheet(mainWindow.document.head,
|
|
23
|
+
this._styleSheet = createStyleSheet(mainWindow.document.head, s => s.textContent = cssStyle, this._store);
|
|
29
24
|
}
|
|
30
25
|
else {
|
|
31
26
|
this._styleSheet.textContent = cssStyle;
|
|
32
27
|
}
|
|
33
28
|
}
|
|
34
29
|
dispose() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this._styleSheet = undefined;
|
|
38
|
-
}
|
|
30
|
+
super.dispose();
|
|
31
|
+
this._styleSheet = undefined;
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
34
|
export function createStyleSheet(container = mainWindow.document.head, beforeAppend, disposableStore) {
|
|
@@ -89,12 +82,10 @@ function getSharedStyleSheet() {
|
|
|
89
82
|
}
|
|
90
83
|
function getDynamicStyleSheetRules(style) {
|
|
91
84
|
if (style?.sheet?.rules) {
|
|
92
|
-
// Chrome, IE
|
|
93
|
-
return style.sheet.rules;
|
|
85
|
+
return style.sheet.rules; // Chrome, IE
|
|
94
86
|
}
|
|
95
87
|
if (style?.sheet?.cssRules) {
|
|
96
|
-
// FF
|
|
97
|
-
return style.sheet.cssRules;
|
|
88
|
+
return style.sheet.cssRules; // FF
|
|
98
89
|
}
|
|
99
90
|
return [];
|
|
100
91
|
}
|
|
@@ -133,7 +124,7 @@ function isCSSStyleRule(rule) {
|
|
|
133
124
|
}
|
|
134
125
|
export function createStyleSheetFromObservable(css) {
|
|
135
126
|
const store = new DisposableStore();
|
|
136
|
-
const w = store.add(
|
|
127
|
+
const w = store.add(new WrappedStyleElement());
|
|
137
128
|
store.add(autorun(reader => {
|
|
138
129
|
w.setStyle(css.read(reader));
|
|
139
130
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/domStylesheets.ts","vs/base/browser/domStylesheets.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,YAAY,EAAe,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,OAAO,EAAe,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAwH,CAAC;AAE1J;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAChC,OAAO,IAAI,mBAAmB,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,mBAAmB;IAAzB;QACS,qBAAgB,GAAG,EAAE,CAAC;QACtB,gBAAW,GAAiC,SAAS,CAAC;IAqB/D,CAAC;IAnBO,QAAQ,CAAC,QAAgB;QAC/B,IAAI,QAAQ,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxC,OAAO;QACR,CAAC;QACD,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QAEjC,IAAI,CA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,EAAE,CAAC,CAAC;IACzC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,KAAK,CAAC;AACd,CAAC","file":"domStylesheets.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 { DisposableStore, toDisposable, IDisposable } from '../common/lifecycle.js';\nimport { autorun, IObservable } from '../common/observable.js';\nimport { isFirefox } from './browser.js';\nimport { getWindows, sharedMutationObserver } from './dom.js';\nimport { mainWindow } from './window.js';\n\nconst globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>();\n\n/**\n * A version of createStyleSheet which has a unified API to initialize/set the style content.\n */\nexport function createStyleSheet2(): WrappedStyleElement {\n\treturn new WrappedStyleElement();\n}\n\nclass WrappedStyleElement {\n\tprivate _currentCssStyle = '';\n\tprivate _styleSheet: HTMLStyleElement | undefined = undefined;\n\n\tpublic setStyle(cssStyle: string): void {\n\t\tif (cssStyle === this._currentCssStyle) {\n\t\t\treturn;\n\t\t}\n\t\tthis._currentCssStyle = cssStyle;\n\n\t\tif (!this._styleSheet) {\n\t\t\tthis._styleSheet = createStyleSheet(mainWindow.document.head, (s) => s.textContent = cssStyle);\n\t\t} else {\n\t\t\tthis._styleSheet.textContent = cssStyle;\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._styleSheet) {\n\t\t\tthis._styleSheet.remove();\n\t\t\tthis._styleSheet = undefined;\n\t\t}\n\t}\n}\n\nexport function createStyleSheet(container: HTMLElement = mainWindow.document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement {\n\tconst style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.media = 'screen';\n\tbeforeAppend?.(style);\n\tcontainer.appendChild(style);\n\n\tif (disposableStore) {\n\t\tdisposableStore.add(toDisposable(() => style.remove()));\n\t}\n\n\t// With <head> as container, the stylesheet becomes global and is tracked\n\t// to support auxiliary windows to clone the stylesheet.\n\tif (container === mainWindow.document.head) {\n\t\tconst globalStylesheetClones = new Set<HTMLStyleElement>();\n\t\tglobalStylesheets.set(style, globalStylesheetClones);\n\t\tif (disposableStore) {\n\t\t\tdisposableStore.add(toDisposable(() => globalStylesheets.delete(style)));\n\t\t}\n\n\t\tfor (const { window: targetWindow, disposables } of getWindows()) {\n\t\t\tif (targetWindow === mainWindow) {\n\t\t\t\tcontinue; // main window is already tracked\n\t\t\t}\n\n\t\t\tconst cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow));\n\t\t\tdisposableStore?.add(cloneDisposable);\n\t\t}\n\t}\n\n\treturn style;\n}\n\nfunction cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, globalStylesheetClones: Set<HTMLStyleElement>, targetWindow: Window): IDisposable {\n\tconst disposables = new DisposableStore();\n\n\tconst clone = globalStylesheet.cloneNode(true) as HTMLStyleElement;\n\ttargetWindow.document.head.appendChild(clone);\n\tdisposables.add(toDisposable(() => clone.remove()));\n\n\tfor (const rule of getDynamicStyleSheetRules(globalStylesheet)) {\n\t\tclone.sheet?.insertRule(rule.cssText, clone.sheet?.cssRules.length);\n\t}\n\n\tdisposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true, subtree: isFirefox, characterData: isFirefox })(() => {\n\t\tclone.textContent = globalStylesheet.textContent;\n\t}));\n\n\tglobalStylesheetClones.add(clone);\n\tdisposables.add(toDisposable(() => globalStylesheetClones.delete(clone)));\n\n\treturn disposables;\n}\n\nlet _sharedStyleSheet: HTMLStyleElement | null = null;\nfunction getSharedStyleSheet(): HTMLStyleElement {\n\tif (!_sharedStyleSheet) {\n\t\t_sharedStyleSheet = createStyleSheet();\n\t}\n\treturn _sharedStyleSheet;\n}\n\nfunction getDynamicStyleSheetRules(style: HTMLStyleElement) {\n\tif (style?.sheet?.rules) {\n\t\t// Chrome, IE\n\t\treturn style.sheet.rules;\n\t}\n\tif (style?.sheet?.cssRules) {\n\t\t// FF\n\t\treturn style.sheet.cssRules;\n\t}\n\treturn [];\n}\n\nexport function createCSSRule(selector: string, cssText: string, style = getSharedStyleSheet()): void {\n\tif (!style || !cssText) {\n\t\treturn;\n\t}\n\n\tstyle.sheet?.insertRule(`${selector} {${cssText}}`, 0);\n\n\t// Apply rule also to all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tcreateCSSRule(selector, cssText, clonedGlobalStylesheet);\n\t}\n}\n\nexport function removeCSSRulesContainingSelector(ruleName: string, style = getSharedStyleSheet()): void {\n\tif (!style) {\n\t\treturn;\n\t}\n\n\tconst rules = getDynamicStyleSheetRules(style);\n\tconst toDelete: number[] = [];\n\tfor (let i = 0; i < rules.length; i++) {\n\t\tconst rule = rules[i];\n\t\tif (isCSSStyleRule(rule) && rule.selectorText.indexOf(ruleName) !== -1) {\n\t\t\ttoDelete.push(i);\n\t\t}\n\t}\n\n\tfor (let i = toDelete.length - 1; i >= 0; i--) {\n\t\tstyle.sheet?.deleteRule(toDelete[i]);\n\t}\n\n\t// Remove rules also from all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tremoveCSSRulesContainingSelector(ruleName, clonedGlobalStylesheet);\n\t}\n}\n\nfunction isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule {\n\treturn typeof (rule as CSSStyleRule).selectorText === 'string';\n}\n\nexport function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {\n\tconst store = new DisposableStore();\n\tconst w = store.add(createStyleSheet2());\n\tstore.add(autorun(reader => {\n\t\tw.setStyle(css.read(reader));\n\t}));\n\treturn store;\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 { DisposableStore, toDisposable, IDisposable } from '../common/lifecycle.js';\nimport { autorun, IObservable } from '../common/observable.js';\nimport { isFirefox } from './browser.js';\nimport { getWindows, sharedMutationObserver } from './dom.js';\nimport { mainWindow } from './window.js';\n\nconst globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>();\n\n/**\n * A version of createStyleSheet which has a unified API to initialize/set the style content.\n */\nexport function createStyleSheet2(): WrappedStyleElement {\n\treturn new WrappedStyleElement();\n}\n\nclass WrappedStyleElement {\n\tprivate _currentCssStyle = '';\n\tprivate _styleSheet: HTMLStyleElement | undefined = undefined;\n\n\tpublic setStyle(cssStyle: string): void {\n\t\tif (cssStyle === this._currentCssStyle) {\n\t\t\treturn;\n\t\t}\n\t\tthis._currentCssStyle = cssStyle;\n\n\t\tif (!this._styleSheet) {\n\t\t\tthis._styleSheet = createStyleSheet(mainWindow.document.head, (s) => s.textContent = cssStyle);\n\t\t} else {\n\t\t\tthis._styleSheet.textContent = cssStyle;\n\t\t}\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this._styleSheet) {\n\t\t\tthis._styleSheet.remove();\n\t\t\tthis._styleSheet = undefined;\n\t\t}\n\t}\n}\n\nexport function createStyleSheet(container: HTMLElement = mainWindow.document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement {\n\tconst style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.media = 'screen';\n\tbeforeAppend?.(style);\n\tcontainer.appendChild(style);\n\n\tif (disposableStore) {\n\t\tdisposableStore.add(toDisposable(() => style.remove()));\n\t}\n\n\t// With <head> as container, the stylesheet becomes global and is tracked\n\t// to support auxiliary windows to clone the stylesheet.\n\tif (container === mainWindow.document.head) {\n\t\tconst globalStylesheetClones = new Set<HTMLStyleElement>();\n\t\tglobalStylesheets.set(style, globalStylesheetClones);\n\t\tif (disposableStore) {\n\t\t\tdisposableStore.add(toDisposable(() => globalStylesheets.delete(style)));\n\t\t}\n\n\t\tfor (const { window: targetWindow, disposables } of getWindows()) {\n\t\t\tif (targetWindow === mainWindow) {\n\t\t\t\tcontinue; // main window is already tracked\n\t\t\t}\n\n\t\t\tconst cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow));\n\t\t\tdisposableStore?.add(cloneDisposable);\n\t\t}\n\t}\n\n\treturn style;\n}\n\nfunction cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, globalStylesheetClones: Set<HTMLStyleElement>, targetWindow: Window): IDisposable {\n\tconst disposables = new DisposableStore();\n\n\tconst clone = globalStylesheet.cloneNode(true) as HTMLStyleElement;\n\ttargetWindow.document.head.appendChild(clone);\n\tdisposables.add(toDisposable(() => clone.remove()));\n\n\tfor (const rule of getDynamicStyleSheetRules(globalStylesheet)) {\n\t\tclone.sheet?.insertRule(rule.cssText, clone.sheet?.cssRules.length);\n\t}\n\n\tdisposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true, subtree: isFirefox, characterData: isFirefox })(() => {\n\t\tclone.textContent = globalStylesheet.textContent;\n\t}));\n\n\tglobalStylesheetClones.add(clone);\n\tdisposables.add(toDisposable(() => globalStylesheetClones.delete(clone)));\n\n\treturn disposables;\n}\n\nlet _sharedStyleSheet: HTMLStyleElement | null = null;\nfunction getSharedStyleSheet(): HTMLStyleElement {\n\tif (!_sharedStyleSheet) {\n\t\t_sharedStyleSheet = createStyleSheet();\n\t}\n\treturn _sharedStyleSheet;\n}\n\nfunction getDynamicStyleSheetRules(style: HTMLStyleElement) {\n\tif (style?.sheet?.rules) {\n\t\t// Chrome, IE\n\t\treturn style.sheet.rules;\n\t}\n\tif (style?.sheet?.cssRules) {\n\t\t// FF\n\t\treturn style.sheet.cssRules;\n\t}\n\treturn [];\n}\n\nexport function createCSSRule(selector: string, cssText: string, style = getSharedStyleSheet()): void {\n\tif (!style || !cssText) {\n\t\treturn;\n\t}\n\n\tstyle.sheet?.insertRule(`${selector} {${cssText}}`, 0);\n\n\t// Apply rule also to all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tcreateCSSRule(selector, cssText, clonedGlobalStylesheet);\n\t}\n}\n\nexport function removeCSSRulesContainingSelector(ruleName: string, style = getSharedStyleSheet()): void {\n\tif (!style) {\n\t\treturn;\n\t}\n\n\tconst rules = getDynamicStyleSheetRules(style);\n\tconst toDelete: number[] = [];\n\tfor (let i = 0; i < rules.length; i++) {\n\t\tconst rule = rules[i];\n\t\tif (isCSSStyleRule(rule) && rule.selectorText.indexOf(ruleName) !== -1) {\n\t\t\ttoDelete.push(i);\n\t\t}\n\t}\n\n\tfor (let i = toDelete.length - 1; i >= 0; i--) {\n\t\tstyle.sheet?.deleteRule(toDelete[i]);\n\t}\n\n\t// Remove rules also from all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tremoveCSSRulesContainingSelector(ruleName, clonedGlobalStylesheet);\n\t}\n}\n\nfunction isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule {\n\treturn typeof (rule as CSSStyleRule).selectorText === 'string';\n}\n\nexport function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {\n\tconst store = new DisposableStore();\n\tconst w = store.add(createStyleSheet2());\n\tstore.add(autorun(reader => {\n\t\tw.setStyle(css.read(reader));\n\t}));\n\treturn store;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/domStylesheets.ts","vs/base/browser/domStylesheets.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,eAAe,EAAE,YA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AC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,KAAK,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,uDAAuD;IACvD,KAAK,MAAM,sBAAsB,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;QACzE,gCAAgC,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;IACpE,CAAC;AACF,CAAC;AAED,SAAS,cAAc,CAAC,IAAa;IACpC,OAAO,OAAQ,IAAqB,CAAC,YAAY,KAAK,QAAQ,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,GAAwB;IACtE,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IACpC,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;IAC/C,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,KAAK,CAAC;AACd,CAAC","file":"domStylesheets.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 { DisposableStore, toDisposable, IDisposable, Disposable } from '../common/lifecycle.js';\nimport { autorun, IObservable } from '../common/observable.js';\nimport { isFirefox } from './browser.js';\nimport { getWindows, sharedMutationObserver } from './dom.js';\nimport { mainWindow } from './window.js';\n\nconst globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>();\n\nclass WrappedStyleElement extends Disposable {\n\tprivate _currentCssStyle = '';\n\tprivate _styleSheet: HTMLStyleElement | undefined = undefined;\n\n\tsetStyle(cssStyle: string): void {\n\t\tif (cssStyle === this._currentCssStyle) {\n\t\t\treturn;\n\t\t}\n\t\tthis._currentCssStyle = cssStyle;\n\n\t\tif (!this._styleSheet) {\n\t\t\tthis._styleSheet = createStyleSheet(mainWindow.document.head, s => s.textContent = cssStyle, this._store);\n\t\t} else {\n\t\t\tthis._styleSheet.textContent = cssStyle;\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\n\t\tthis._styleSheet = undefined;\n\t}\n}\n\nexport function createStyleSheet(container: HTMLElement = mainWindow.document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement {\n\tconst style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.media = 'screen';\n\tbeforeAppend?.(style);\n\tcontainer.appendChild(style);\n\n\tif (disposableStore) {\n\t\tdisposableStore.add(toDisposable(() => style.remove()));\n\t}\n\n\t// With <head> as container, the stylesheet becomes global and is tracked\n\t// to support auxiliary windows to clone the stylesheet.\n\tif (container === mainWindow.document.head) {\n\t\tconst globalStylesheetClones = new Set<HTMLStyleElement>();\n\t\tglobalStylesheets.set(style, globalStylesheetClones);\n\t\tif (disposableStore) {\n\t\t\tdisposableStore.add(toDisposable(() => globalStylesheets.delete(style)));\n\t\t}\n\n\t\tfor (const { window: targetWindow, disposables } of getWindows()) {\n\t\t\tif (targetWindow === mainWindow) {\n\t\t\t\tcontinue; // main window is already tracked\n\t\t\t}\n\n\t\t\tconst cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow));\n\t\t\tdisposableStore?.add(cloneDisposable);\n\t\t}\n\t}\n\n\treturn style;\n}\n\nfunction cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, globalStylesheetClones: Set<HTMLStyleElement>, targetWindow: Window): IDisposable {\n\tconst disposables = new DisposableStore();\n\n\tconst clone = globalStylesheet.cloneNode(true) as HTMLStyleElement;\n\ttargetWindow.document.head.appendChild(clone);\n\tdisposables.add(toDisposable(() => clone.remove()));\n\n\tfor (const rule of getDynamicStyleSheetRules(globalStylesheet)) {\n\t\tclone.sheet?.insertRule(rule.cssText, clone.sheet?.cssRules.length);\n\t}\n\n\tdisposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true, subtree: isFirefox, characterData: isFirefox })(() => {\n\t\tclone.textContent = globalStylesheet.textContent;\n\t}));\n\n\tglobalStylesheetClones.add(clone);\n\tdisposables.add(toDisposable(() => globalStylesheetClones.delete(clone)));\n\n\treturn disposables;\n}\n\nlet _sharedStyleSheet: HTMLStyleElement | null = null;\nfunction getSharedStyleSheet(): HTMLStyleElement {\n\tif (!_sharedStyleSheet) {\n\t\t_sharedStyleSheet = createStyleSheet();\n\t}\n\treturn _sharedStyleSheet;\n}\n\nfunction getDynamicStyleSheetRules(style: HTMLStyleElement) {\n\tif (style?.sheet?.rules) {\n\t\treturn style.sheet.rules; // Chrome, IE\n\t}\n\tif (style?.sheet?.cssRules) {\n\t\treturn style.sheet.cssRules; // FF\n\t}\n\treturn [];\n}\n\nexport function createCSSRule(selector: string, cssText: string, style = getSharedStyleSheet()): void {\n\tif (!style || !cssText) {\n\t\treturn;\n\t}\n\n\tstyle.sheet?.insertRule(`${selector} {${cssText}}`, 0);\n\n\t// Apply rule also to all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tcreateCSSRule(selector, cssText, clonedGlobalStylesheet);\n\t}\n}\n\nexport function removeCSSRulesContainingSelector(ruleName: string, style = getSharedStyleSheet()): void {\n\tif (!style) {\n\t\treturn;\n\t}\n\n\tconst rules = getDynamicStyleSheetRules(style);\n\tconst toDelete: number[] = [];\n\tfor (let i = 0; i < rules.length; i++) {\n\t\tconst rule = rules[i];\n\t\tif (isCSSStyleRule(rule) && rule.selectorText.indexOf(ruleName) !== -1) {\n\t\t\ttoDelete.push(i);\n\t\t}\n\t}\n\n\tfor (let i = toDelete.length - 1; i >= 0; i--) {\n\t\tstyle.sheet?.deleteRule(toDelete[i]);\n\t}\n\n\t// Remove rules also from all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tremoveCSSRulesContainingSelector(ruleName, clonedGlobalStylesheet);\n\t}\n}\n\nfunction isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule {\n\treturn typeof (rule as CSSStyleRule).selectorText === 'string';\n}\n\nexport function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {\n\tconst store = new DisposableStore();\n\tconst w = store.add(new WrappedStyleElement());\n\tstore.add(autorun(reader => {\n\t\tw.setStyle(css.read(reader));\n\t}));\n\treturn store;\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 { DisposableStore, toDisposable, IDisposable, Disposable } from '../common/lifecycle.js';\nimport { autorun, IObservable } from '../common/observable.js';\nimport { isFirefox } from './browser.js';\nimport { getWindows, sharedMutationObserver } from './dom.js';\nimport { mainWindow } from './window.js';\n\nconst globalStylesheets = new Map<HTMLStyleElement /* main stylesheet */, Set<HTMLStyleElement /* aux window clones that track the main stylesheet */>>();\n\nclass WrappedStyleElement extends Disposable {\n\tprivate _currentCssStyle = '';\n\tprivate _styleSheet: HTMLStyleElement | undefined = undefined;\n\n\tsetStyle(cssStyle: string): void {\n\t\tif (cssStyle === this._currentCssStyle) {\n\t\t\treturn;\n\t\t}\n\t\tthis._currentCssStyle = cssStyle;\n\n\t\tif (!this._styleSheet) {\n\t\t\tthis._styleSheet = createStyleSheet(mainWindow.document.head, s => s.textContent = cssStyle, this._store);\n\t\t} else {\n\t\t\tthis._styleSheet.textContent = cssStyle;\n\t\t}\n\t}\n\n\toverride dispose(): void {\n\t\tsuper.dispose();\n\n\t\tthis._styleSheet = undefined;\n\t}\n}\n\nexport function createStyleSheet(container: HTMLElement = mainWindow.document.head, beforeAppend?: (style: HTMLStyleElement) => void, disposableStore?: DisposableStore): HTMLStyleElement {\n\tconst style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tstyle.media = 'screen';\n\tbeforeAppend?.(style);\n\tcontainer.appendChild(style);\n\n\tif (disposableStore) {\n\t\tdisposableStore.add(toDisposable(() => style.remove()));\n\t}\n\n\t// With <head> as container, the stylesheet becomes global and is tracked\n\t// to support auxiliary windows to clone the stylesheet.\n\tif (container === mainWindow.document.head) {\n\t\tconst globalStylesheetClones = new Set<HTMLStyleElement>();\n\t\tglobalStylesheets.set(style, globalStylesheetClones);\n\t\tif (disposableStore) {\n\t\t\tdisposableStore.add(toDisposable(() => globalStylesheets.delete(style)));\n\t\t}\n\n\t\tfor (const { window: targetWindow, disposables } of getWindows()) {\n\t\t\tif (targetWindow === mainWindow) {\n\t\t\t\tcontinue; // main window is already tracked\n\t\t\t}\n\n\t\t\tconst cloneDisposable = disposables.add(cloneGlobalStyleSheet(style, globalStylesheetClones, targetWindow));\n\t\t\tdisposableStore?.add(cloneDisposable);\n\t\t}\n\t}\n\n\treturn style;\n}\n\nfunction cloneGlobalStyleSheet(globalStylesheet: HTMLStyleElement, globalStylesheetClones: Set<HTMLStyleElement>, targetWindow: Window): IDisposable {\n\tconst disposables = new DisposableStore();\n\n\tconst clone = globalStylesheet.cloneNode(true) as HTMLStyleElement;\n\ttargetWindow.document.head.appendChild(clone);\n\tdisposables.add(toDisposable(() => clone.remove()));\n\n\tfor (const rule of getDynamicStyleSheetRules(globalStylesheet)) {\n\t\tclone.sheet?.insertRule(rule.cssText, clone.sheet?.cssRules.length);\n\t}\n\n\tdisposables.add(sharedMutationObserver.observe(globalStylesheet, disposables, { childList: true, subtree: isFirefox, characterData: isFirefox })(() => {\n\t\tclone.textContent = globalStylesheet.textContent;\n\t}));\n\n\tglobalStylesheetClones.add(clone);\n\tdisposables.add(toDisposable(() => globalStylesheetClones.delete(clone)));\n\n\treturn disposables;\n}\n\nlet _sharedStyleSheet: HTMLStyleElement | null = null;\nfunction getSharedStyleSheet(): HTMLStyleElement {\n\tif (!_sharedStyleSheet) {\n\t\t_sharedStyleSheet = createStyleSheet();\n\t}\n\treturn _sharedStyleSheet;\n}\n\nfunction getDynamicStyleSheetRules(style: HTMLStyleElement) {\n\tif (style?.sheet?.rules) {\n\t\treturn style.sheet.rules; // Chrome, IE\n\t}\n\tif (style?.sheet?.cssRules) {\n\t\treturn style.sheet.cssRules; // FF\n\t}\n\treturn [];\n}\n\nexport function createCSSRule(selector: string, cssText: string, style = getSharedStyleSheet()): void {\n\tif (!style || !cssText) {\n\t\treturn;\n\t}\n\n\tstyle.sheet?.insertRule(`${selector} {${cssText}}`, 0);\n\n\t// Apply rule also to all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tcreateCSSRule(selector, cssText, clonedGlobalStylesheet);\n\t}\n}\n\nexport function removeCSSRulesContainingSelector(ruleName: string, style = getSharedStyleSheet()): void {\n\tif (!style) {\n\t\treturn;\n\t}\n\n\tconst rules = getDynamicStyleSheetRules(style);\n\tconst toDelete: number[] = [];\n\tfor (let i = 0; i < rules.length; i++) {\n\t\tconst rule = rules[i];\n\t\tif (isCSSStyleRule(rule) && rule.selectorText.indexOf(ruleName) !== -1) {\n\t\t\ttoDelete.push(i);\n\t\t}\n\t}\n\n\tfor (let i = toDelete.length - 1; i >= 0; i--) {\n\t\tstyle.sheet?.deleteRule(toDelete[i]);\n\t}\n\n\t// Remove rules also from all cloned global stylesheets\n\tfor (const clonedGlobalStylesheet of globalStylesheets.get(style) ?? []) {\n\t\tremoveCSSRulesContainingSelector(ruleName, clonedGlobalStylesheet);\n\t}\n}\n\nfunction isCSSStyleRule(rule: CSSRule): rule is CSSStyleRule {\n\treturn typeof (rule as CSSStyleRule).selectorText === 'string';\n}\n\nexport function createStyleSheetFromObservable(css: IObservable<string>): IDisposable {\n\tconst store = new DisposableStore();\n\tconst w = store.add(new WrappedStyleElement());\n\tstore.add(autorun(reader => {\n\t\tw.setStyle(css.read(reader));\n\t}));\n\treturn store;\n}\n"]}
|
|
@@ -7,14 +7,21 @@
|
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
display: flex;
|
|
9
9
|
width: 100%;
|
|
10
|
-
padding: 4px;
|
|
11
|
-
border-radius:
|
|
10
|
+
padding: 4px 8px;
|
|
11
|
+
border-radius: 4px;
|
|
12
12
|
text-align: center;
|
|
13
13
|
cursor: pointer;
|
|
14
14
|
justify-content: center;
|
|
15
15
|
align-items: center;
|
|
16
16
|
border: 1px solid var(--vscode-button-border, transparent);
|
|
17
|
-
line-height:
|
|
17
|
+
line-height: 16px;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.monaco-text-button.small {
|
|
22
|
+
line-height: 14px;
|
|
23
|
+
font-size: 11px;
|
|
24
|
+
padding: 3px 6px;
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
.monaco-text-button:focus {
|
|
@@ -61,6 +68,7 @@
|
|
|
61
68
|
align-items: center;
|
|
62
69
|
font-weight: normal;
|
|
63
70
|
font-style: inherit;
|
|
71
|
+
line-height: 18px;
|
|
64
72
|
padding: 4px 0;
|
|
65
73
|
}
|
|
66
74
|
|
|
@@ -100,13 +108,13 @@
|
|
|
100
108
|
.monaco-button-dropdown > .monaco-button.monaco-dropdown-button {
|
|
101
109
|
border: 1px solid var(--vscode-button-border, transparent);
|
|
102
110
|
border-left-width: 0 !important;
|
|
103
|
-
border-radius: 0
|
|
111
|
+
border-radius: 0 4px 4px 0;
|
|
104
112
|
display: flex;
|
|
105
113
|
align-items: center;
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
.monaco-button-dropdown > .monaco-button.monaco-text-button {
|
|
109
|
-
border-radius:
|
|
117
|
+
border-radius: 4px 0 0 4px;
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
.monaco-description-button {
|
|
@@ -44,6 +44,7 @@ export class Button extends Disposable {
|
|
|
44
44
|
this._element.tabIndex = 0;
|
|
45
45
|
this._element.setAttribute('role', 'button');
|
|
46
46
|
this._element.classList.toggle('secondary', !!options.secondary);
|
|
47
|
+
this._element.classList.toggle('small', !!options.small);
|
|
47
48
|
const background = options.secondary ? options.buttonSecondaryBackground : options.buttonBackground;
|
|
48
49
|
const foreground = options.secondary ? options.buttonSecondaryForeground : options.buttonForeground;
|
|
49
50
|
this._element.style.color = foreground || '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/button/button.ts","vs/base/browser/ui/button/button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAiB,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAsB,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAmB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAExG,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAA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,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,SAAS,CAAC,KAAc;QAC3B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,OAAmC,CAAC,SAAS,GAAG,KAAK,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QACrK,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;CACD","file":"button.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { addDisposableListener, EventHelper, EventType, IFocusTracker, reset, trackFocus } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { renderMarkdown, renderAsPlaintext } from '../../markdownRenderer.js';\nimport { Gesture, EventType as TouchEventType } from '../../touch.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Color } from '../../../common/color.js';\nimport { Event as BaseEvent, Emitter } from '../../../common/event.js';\nimport { IMarkdownString, isMarkdownString, markdownStringEqual } from '../../../common/htmlContent.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport './button.css';\nimport { IManagedHover } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { safeSetInnerHtml, DomSanitizerConfig } from '../../domSanitize.js';\n\nexport interface IButtonOptions extends Partial<IButtonStyles> {\n\treadonly title?: boolean | string;\n\t/**\n\t * Will fallback to `title` if not set.\n\t */\n\treadonly ariaLabel?: string;\n\treadonly supportIcons?: boolean;\n\treadonly supportShortLabel?: boolean;\n\treadonly secondary?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly disabled?: boolean;\n}\n\nexport interface IButtonStyles {\n\treadonly buttonBackground: string | undefined;\n\treadonly buttonHoverBackground: string | undefined;\n\treadonly buttonForeground: string | undefined;\n\treadonly buttonSeparator: string | undefined;\n\treadonly buttonSecondaryBackground: string | undefined;\n\treadonly buttonSecondaryHoverBackground: string | undefined;\n\treadonly buttonSecondaryForeground: string | undefined;\n\treadonly buttonBorder: string | undefined;\n}\n\nexport const unthemedButtonStyles: IButtonStyles = {\n\tbuttonBackground: '#0E639C',\n\tbuttonHoverBackground: '#006BB3',\n\tbuttonSeparator: Color.white.toString(),\n\tbuttonForeground: Color.white.toString(),\n\tbuttonBorder: undefined,\n\tbuttonSecondaryBackground: undefined,\n\tbuttonSecondaryForeground: undefined,\n\tbuttonSecondaryHoverBackground: undefined\n};\n\nexport interface IButton extends IDisposable {\n\n\tset label(value: string | IMarkdownString);\n\tset icon(value: ThemeIcon);\n\tset enabled(value: boolean);\n}\n\n// Only allow a very limited set of inline html tags\nconst buttonSanitizerConfig = Object.freeze<DomSanitizerConfig>({\n\tallowedTags: {\n\t\toverride: ['b', 'i', 'u', 'code', 'span'],\n\t},\n\tallowedAttributes: {\n\t\toverride: ['class'],\n\t},\n});\n\nexport class Button extends Disposable implements IButton {\n\n\tprotected options: IButtonOptions;\n\tprotected _element: HTMLElement;\n\tprotected _label: string | IMarkdownString = '';\n\tprotected _labelElement: HTMLElement | undefined;\n\tprotected _labelShortElement: HTMLElement | undefined;\n\tprivate _hover: IManagedHover | undefined;\n\n\tprivate _onDidClick = this._register(new Emitter<Event>());\n\tget onDidClick(): BaseEvent<Event> { return this._onDidClick.event; }\n\n\tprivate _onDidEscape = this._register(new Emitter<Event>());\n\n\tprivate focusTracker: IFocusTracker;\n\n\tconstructor(container: HTMLElement, options: IButtonOptions) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\n\t\tthis._element = document.createElement('a');\n\t\tthis._element.classList.add('monaco-button');\n\t\tthis._element.tabIndex = 0;\n\t\tthis._element.setAttribute('role', 'button');\n\n\t\tthis._element.classList.toggle('secondary', !!options.secondary);\n\t\tconst background = options.secondary ? options.buttonSecondaryBackground : options.buttonBackground;\n\t\tconst foreground = options.secondary ? options.buttonSecondaryForeground : options.buttonForeground;\n\n\t\tthis._element.style.color = foreground || '';\n\t\tthis._element.style.backgroundColor = background || '';\n\n\t\tif (options.supportShortLabel) {\n\t\t\tthis._labelShortElement = document.createElement('div');\n\t\t\tthis._labelShortElement.classList.add('monaco-button-label-short');\n\t\t\tthis._element.appendChild(this._labelShortElement);\n\n\t\t\tthis._labelElement = document.createElement('div');\n\t\t\tthis._labelElement.classList.add('monaco-button-label');\n\t\t\tthis._element.appendChild(this._labelElement);\n\n\t\t\tthis._element.classList.add('monaco-text-button-with-short-label');\n\t\t}\n\n\t\tif (typeof options.title === 'string') {\n\t\t\tthis.setTitle(options.title);\n\t\t}\n\n\t\tif (typeof options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', options.ariaLabel);\n\t\t}\n\t\tcontainer.appendChild(this._element);\n\t\tthis.enabled = !options.disabled;\n\n\t\tthis._register(Gesture.addTarget(this._element));\n\n\t\t[EventType.CLICK, TouchEventType.Tap].forEach(eventType => {\n\t\t\tthis._register(addDisposableListener(this._element, eventType, e => {\n\t\t\t\tif (!this.enabled) {\n\t\t\t\t\tEventHelper.stop(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t}));\n\t\t});\n\n\t\tthis._register(addDisposableListener(this._element, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = false;\n\t\t\tif (this.enabled && (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space))) {\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t\teventHandled = true;\n\t\t\t} else if (event.equals(KeyCode.Escape)) {\n\t\t\t\tthis._onDidEscape.fire(e);\n\t\t\t\tthis._element.blur();\n\t\t\t\teventHandled = true;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tEventHelper.stop(event, true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OVER, e => {\n\t\t\tif (!this._element.classList.contains('disabled')) {\n\t\t\t\tthis.updateStyles(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OUT, e => {\n\t\t\tthis.updateStyles(false); // restore standard styles\n\t\t}));\n\n\t\t// Also set hover background when button is focused for feedback\n\t\tthis.focusTracker = this._register(trackFocus(this._element));\n\t\tthis._register(this.focusTracker.onDidFocus(() => { if (this.enabled) { this.updateStyles(true); } }));\n\t\tthis._register(this.focusTracker.onDidBlur(() => { if (this.enabled) { this.updateStyles(false); } }));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._element.remove();\n\t}\n\n\tprotected getContentElements(content: string): HTMLElement[] {\n\t\tconst elements: HTMLSpanElement[] = [];\n\t\tfor (let segment of renderLabelWithIcons(content)) {\n\t\t\tif (typeof (segment) === 'string') {\n\t\t\t\tsegment = segment.trim();\n\n\t\t\t\t// Ignore empty segment\n\t\t\t\tif (segment === '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Convert string segments to <span> nodes\n\t\t\t\tconst node = document.createElement('span');\n\t\t\t\tnode.textContent = segment;\n\t\t\t\telements.push(node);\n\t\t\t} else {\n\t\t\t\telements.push(segment);\n\t\t\t}\n\t\t}\n\n\t\treturn elements;\n\t}\n\n\tprivate updateStyles(hover: boolean): void {\n\t\tlet background;\n\t\tlet foreground;\n\t\tif (this.options.secondary) {\n\t\t\tbackground = hover ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground;\n\t\t\tforeground = this.options.buttonSecondaryForeground;\n\t\t} else {\n\t\t\tbackground = hover ? this.options.buttonHoverBackground : this.options.buttonBackground;\n\t\t\tforeground = this.options.buttonForeground;\n\t\t}\n\n\t\tthis._element.style.backgroundColor = background || '';\n\t\tthis._element.style.color = foreground || '';\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset label(value: string | IMarkdownString) {\n\t\tif (this._label === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMarkdownString(this._label) && isMarkdownString(value) && markdownStringEqual(this._label, value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._element.classList.add('monaco-text-button');\n\t\tconst labelElement = this.options.supportShortLabel ? this._labelElement! : this._element;\n\n\t\tif (isMarkdownString(value)) {\n\t\t\tconst rendered = renderMarkdown(value, undefined, document.createElement('span'));\n\t\t\trendered.dispose();\n\n\t\t\t// Don't include outer `<p>`\n\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\tconst root = rendered.element.querySelector('p')?.innerHTML;\n\t\t\tif (root) {\n\t\t\t\tsafeSetInnerHtml(labelElement, root, buttonSanitizerConfig);\n\t\t\t} else {\n\t\t\t\treset(labelElement);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.options.supportIcons) {\n\t\t\t\treset(labelElement, ...this.getContentElements(value));\n\t\t\t} else {\n\t\t\t\tlabelElement.textContent = value;\n\t\t\t}\n\t\t}\n\n\t\tlet title: string = '';\n\t\tif (typeof this.options.title === 'string') {\n\t\t\ttitle = this.options.title;\n\t\t} else if (this.options.title) {\n\t\t\ttitle = renderAsPlaintext(value);\n\t\t}\n\n\t\tthis.setTitle(title);\n\n\t\tthis._setAriaLabel();\n\n\t\tthis._label = value;\n\t}\n\n\tget label(): string | IMarkdownString {\n\t\treturn this._label;\n\t}\n\n\tprotected _setAriaLabel(): void {\n\t\tif (typeof this.options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.ariaLabel);\n\t\t} else if (typeof this.options.title === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.title);\n\t\t}\n\t}\n\n\tset icon(icon: ThemeIcon) {\n\t\tthis._setAriaLabel();\n\n\t\tconst oldIcons = Array.from(this._element.classList).filter(item => item.startsWith('codicon-'));\n\t\tthis._element.classList.remove(...oldIcons);\n\t\tthis._element.classList.add(...ThemeIcon.asClassNameArray(icon));\n\t}\n\n\tset enabled(value: boolean) {\n\t\tif (value) {\n\t\t\tthis._element.classList.remove('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(false));\n\t\t\tthis._element.tabIndex = 0;\n\t\t} else {\n\t\t\tthis._element.classList.add('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(true));\n\t\t}\n\t}\n\n\tget enabled() {\n\t\treturn !this._element.classList.contains('disabled');\n\t}\n\n\tset secondary(value: boolean) {\n\t\tthis._element.classList.toggle('secondary', value);\n\t\t(this.options as { secondary?: boolean }).secondary = value;\n\t\tthis.updateStyles(false);\n\t}\n\n\tsetTitle(title: string) {\n\t\tif (!this._hover && title !== '') {\n\t\t\tthis._hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('element'), this._element, title));\n\t\t} else if (this._hover) {\n\t\t\tthis._hover.update(title);\n\t\t}\n\t}\n}\n","\nimport { addDisposableListener, EventHelper, EventType, IFocusTracker, reset, trackFocus } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { renderMarkdown, renderAsPlaintext } from '../../markdownRenderer.js';\nimport { Gesture, EventType as TouchEventType } from '../../touch.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Color } from '../../../common/color.js';\nimport { Event as BaseEvent, Emitter } from '../../../common/event.js';\nimport { IMarkdownString, isMarkdownString, markdownStringEqual } from '../../../common/htmlContent.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport './button.css';\nimport { IManagedHover } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { safeSetInnerHtml, DomSanitizerConfig } from '../../domSanitize.js';\n\nexport interface IButtonOptions extends Partial<IButtonStyles> {\n\treadonly title?: boolean | string;\n\t/**\n\t * Will fallback to `title` if not set.\n\t */\n\treadonly ariaLabel?: string;\n\treadonly supportIcons?: boolean;\n\treadonly supportShortLabel?: boolean;\n\treadonly secondary?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly disabled?: boolean;\n}\n\nexport interface IButtonStyles {\n\treadonly buttonBackground: string | undefined;\n\treadonly buttonHoverBackground: string | undefined;\n\treadonly buttonForeground: string | undefined;\n\treadonly buttonSeparator: string | undefined;\n\treadonly buttonSecondaryBackground: string | undefined;\n\treadonly buttonSecondaryHoverBackground: string | undefined;\n\treadonly buttonSecondaryForeground: string | undefined;\n\treadonly buttonBorder: string | undefined;\n}\n\nexport const unthemedButtonStyles: IButtonStyles = {\n\tbuttonBackground: '#0E639C',\n\tbuttonHoverBackground: '#006BB3',\n\tbuttonSeparator: Color.white.toString(),\n\tbuttonForeground: Color.white.toString(),\n\tbuttonBorder: undefined,\n\tbuttonSecondaryBackground: undefined,\n\tbuttonSecondaryForeground: undefined,\n\tbuttonSecondaryHoverBackground: undefined\n};\n\nexport interface IButton extends IDisposable {\n\n\tset label(value: string | IMarkdownString);\n\tset icon(value: ThemeIcon);\n\tset enabled(value: boolean);\n}\n\n// Only allow a very limited set of inline html tags\nconst buttonSanitizerConfig = Object.freeze<DomSanitizerConfig>({\n\tallowedTags: {\n\t\toverride: ['b', 'i', 'u', 'code', 'span'],\n\t},\n\tallowedAttributes: {\n\t\toverride: ['class'],\n\t},\n});\n\nexport class Button extends Disposable implements IButton {\n\n\tprotected options: IButtonOptions;\n\tprotected _element: HTMLElement;\n\tprotected _label: string | IMarkdownString = '';\n\tprotected _labelElement: HTMLElement | undefined;\n\tprotected _labelShortElement: HTMLElement | undefined;\n\tprivate _hover: IManagedHover | undefined;\n\n\tprivate _onDidClick = this._register(new Emitter<Event>());\n\tget onDidClick(): BaseEvent<Event> { return this._onDidClick.event; }\n\n\tprivate _onDidEscape = this._register(new Emitter<Event>());\n\n\tprivate focusTracker: IFocusTracker;\n\n\tconstructor(container: HTMLElement, options: IButtonOptions) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\n\t\tthis._element = document.createElement('a');\n\t\tthis._element.classList.add('monaco-button');\n\t\tthis._element.tabIndex = 0;\n\t\tthis._element.setAttribute('role', 'button');\n\n\t\tthis._element.classList.toggle('secondary', !!options.secondary);\n\t\tconst background = options.secondary ? options.buttonSecondaryBackground : options.buttonBackground;\n\t\tconst foreground = options.secondary ? options.buttonSecondaryForeground : options.buttonForeground;\n\n\t\tthis._element.style.color = foreground || '';\n\t\tthis._element.style.backgroundColor = background || '';\n\n\t\tif (options.supportShortLabel) {\n\t\t\tthis._labelShortElement = document.createElement('div');\n\t\t\tthis._labelShortElement.classList.add('monaco-button-label-short');\n\t\t\tthis._element.appendChild(this._labelShortElement);\n\n\t\t\tthis._labelElement = document.createElement('div');\n\t\t\tthis._labelElement.classList.add('monaco-button-label');\n\t\t\tthis._element.appendChild(this._labelElement);\n\n\t\t\tthis._element.classList.add('monaco-text-button-with-short-label');\n\t\t}\n\n\t\tif (typeof options.title === 'string') {\n\t\t\tthis.setTitle(options.title);\n\t\t}\n\n\t\tif (typeof options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', options.ariaLabel);\n\t\t}\n\t\tcontainer.appendChild(this._element);\n\t\tthis.enabled = !options.disabled;\n\n\t\tthis._register(Gesture.addTarget(this._element));\n\n\t\t[EventType.CLICK, TouchEventType.Tap].forEach(eventType => {\n\t\t\tthis._register(addDisposableListener(this._element, eventType, e => {\n\t\t\t\tif (!this.enabled) {\n\t\t\t\t\tEventHelper.stop(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t}));\n\t\t});\n\n\t\tthis._register(addDisposableListener(this._element, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = false;\n\t\t\tif (this.enabled && (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space))) {\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t\teventHandled = true;\n\t\t\t} else if (event.equals(KeyCode.Escape)) {\n\t\t\t\tthis._onDidEscape.fire(e);\n\t\t\t\tthis._element.blur();\n\t\t\t\teventHandled = true;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tEventHelper.stop(event, true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OVER, e => {\n\t\t\tif (!this._element.classList.contains('disabled')) {\n\t\t\t\tthis.updateStyles(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OUT, e => {\n\t\t\tthis.updateStyles(false); // restore standard styles\n\t\t}));\n\n\t\t// Also set hover background when button is focused for feedback\n\t\tthis.focusTracker = this._register(trackFocus(this._element));\n\t\tthis._register(this.focusTracker.onDidFocus(() => { if (this.enabled) { this.updateStyles(true); } }));\n\t\tthis._register(this.focusTracker.onDidBlur(() => { if (this.enabled) { this.updateStyles(false); } }));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._element.remove();\n\t}\n\n\tprotected getContentElements(content: string): HTMLElement[] {\n\t\tconst elements: HTMLSpanElement[] = [];\n\t\tfor (let segment of renderLabelWithIcons(content)) {\n\t\t\tif (typeof (segment) === 'string') {\n\t\t\t\tsegment = segment.trim();\n\n\t\t\t\t// Ignore empty segment\n\t\t\t\tif (segment === '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Convert string segments to <span> nodes\n\t\t\t\tconst node = document.createElement('span');\n\t\t\t\tnode.textContent = segment;\n\t\t\t\telements.push(node);\n\t\t\t} else {\n\t\t\t\telements.push(segment);\n\t\t\t}\n\t\t}\n\n\t\treturn elements;\n\t}\n\n\tprivate updateStyles(hover: boolean): void {\n\t\tlet background;\n\t\tlet foreground;\n\t\tif (this.options.secondary) {\n\t\t\tbackground = hover ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground;\n\t\t\tforeground = this.options.buttonSecondaryForeground;\n\t\t} else {\n\t\t\tbackground = hover ? this.options.buttonHoverBackground : this.options.buttonBackground;\n\t\t\tforeground = this.options.buttonForeground;\n\t\t}\n\n\t\tthis._element.style.backgroundColor = background || '';\n\t\tthis._element.style.color = foreground || '';\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset label(value: string | IMarkdownString) {\n\t\tif (this._label === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMarkdownString(this._label) && isMarkdownString(value) && markdownStringEqual(this._label, value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._element.classList.add('monaco-text-button');\n\t\tconst labelElement = this.options.supportShortLabel ? this._labelElement! : this._element;\n\n\t\tif (isMarkdownString(value)) {\n\t\t\tconst rendered = renderMarkdown(value, undefined, document.createElement('span'));\n\t\t\trendered.dispose();\n\n\t\t\t// Don't include outer `<p>`\n\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\tconst root = rendered.element.querySelector('p')?.innerHTML;\n\t\t\tif (root) {\n\t\t\t\tsafeSetInnerHtml(labelElement, root, buttonSanitizerConfig);\n\t\t\t} else {\n\t\t\t\treset(labelElement);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.options.supportIcons) {\n\t\t\t\treset(labelElement, ...this.getContentElements(value));\n\t\t\t} else {\n\t\t\t\tlabelElement.textContent = value;\n\t\t\t}\n\t\t}\n\n\t\tlet title: string = '';\n\t\tif (typeof this.options.title === 'string') {\n\t\t\ttitle = this.options.title;\n\t\t} else if (this.options.title) {\n\t\t\ttitle = renderAsPlaintext(value);\n\t\t}\n\n\t\tthis.setTitle(title);\n\n\t\tthis._setAriaLabel();\n\n\t\tthis._label = value;\n\t}\n\n\tget label(): string | IMarkdownString {\n\t\treturn this._label;\n\t}\n\n\tprotected _setAriaLabel(): void {\n\t\tif (typeof this.options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.ariaLabel);\n\t\t} else if (typeof this.options.title === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.title);\n\t\t}\n\t}\n\n\tset icon(icon: ThemeIcon) {\n\t\tthis._setAriaLabel();\n\n\t\tconst oldIcons = Array.from(this._element.classList).filter(item => item.startsWith('codicon-'));\n\t\tthis._element.classList.remove(...oldIcons);\n\t\tthis._element.classList.add(...ThemeIcon.asClassNameArray(icon));\n\t}\n\n\tset enabled(value: boolean) {\n\t\tif (value) {\n\t\t\tthis._element.classList.remove('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(false));\n\t\t\tthis._element.tabIndex = 0;\n\t\t} else {\n\t\t\tthis._element.classList.add('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(true));\n\t\t}\n\t}\n\n\tget enabled() {\n\t\treturn !this._element.classList.contains('disabled');\n\t}\n\n\tset secondary(value: boolean) {\n\t\tthis._element.classList.toggle('secondary', value);\n\t\t(this.options as { secondary?: boolean }).secondary = value;\n\t\tthis.updateStyles(false);\n\t}\n\n\tsetTitle(title: string) {\n\t\tif (!this._hover && title !== '') {\n\t\t\tthis._hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('element'), this._element, title));\n\t\t} else if (this._hover) {\n\t\t\tthis._hover.update(title);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/button/button.ts","vs/base/browser/ui/button/button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAiB,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAsB,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAmB,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAExG,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AA2B5E,MAAM,CAAC,MAAM,oBAAoB,GAAkB;IAClD,gBAAgB,EAAE,SAAS;IAC3B,qBAAqB,EAAE,SAAS;IAChC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C;IACtD,CAAC;IAED,IAAI,SAAS,CAAC,KAAc;QAC3B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,OAAmC,CAAC,SAAS,GAAG,KAAK,CAAC;QAC5D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QACrK,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC;CACD","file":"button.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { addDisposableListener, EventHelper, EventType, IFocusTracker, reset, trackFocus } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { renderMarkdown, renderAsPlaintext } from '../../markdownRenderer.js';\nimport { Gesture, EventType as TouchEventType } from '../../touch.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Color } from '../../../common/color.js';\nimport { Event as BaseEvent, Emitter } from '../../../common/event.js';\nimport { IMarkdownString, isMarkdownString, markdownStringEqual } from '../../../common/htmlContent.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport './button.css';\nimport { IManagedHover } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { safeSetInnerHtml, DomSanitizerConfig } from '../../domSanitize.js';\n\nexport interface IButtonOptions extends Partial<IButtonStyles> {\n\treadonly title?: boolean | string;\n\t/**\n\t * Will fallback to `title` if not set.\n\t */\n\treadonly ariaLabel?: string;\n\treadonly supportIcons?: boolean;\n\treadonly supportShortLabel?: boolean;\n\treadonly secondary?: boolean;\n\treadonly small?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly disabled?: boolean;\n}\n\nexport interface IButtonStyles {\n\treadonly buttonBackground: string | undefined;\n\treadonly buttonHoverBackground: string | undefined;\n\treadonly buttonForeground: string | undefined;\n\treadonly buttonSeparator: string | undefined;\n\treadonly buttonSecondaryBackground: string | undefined;\n\treadonly buttonSecondaryHoverBackground: string | undefined;\n\treadonly buttonSecondaryForeground: string | undefined;\n\treadonly buttonBorder: string | undefined;\n}\n\nexport const unthemedButtonStyles: IButtonStyles = {\n\tbuttonBackground: '#0E639C',\n\tbuttonHoverBackground: '#006BB3',\n\tbuttonSeparator: Color.white.toString(),\n\tbuttonForeground: Color.white.toString(),\n\tbuttonBorder: undefined,\n\tbuttonSecondaryBackground: undefined,\n\tbuttonSecondaryForeground: undefined,\n\tbuttonSecondaryHoverBackground: undefined\n};\n\nexport interface IButton extends IDisposable {\n\n\tset label(value: string | IMarkdownString);\n\tset icon(value: ThemeIcon);\n\tset enabled(value: boolean);\n}\n\n// Only allow a very limited set of inline html tags\nconst buttonSanitizerConfig = Object.freeze<DomSanitizerConfig>({\n\tallowedTags: {\n\t\toverride: ['b', 'i', 'u', 'code', 'span'],\n\t},\n\tallowedAttributes: {\n\t\toverride: ['class'],\n\t},\n});\n\nexport class Button extends Disposable implements IButton {\n\n\tprotected options: IButtonOptions;\n\tprotected _element: HTMLElement;\n\tprotected _label: string | IMarkdownString = '';\n\tprotected _labelElement: HTMLElement | undefined;\n\tprotected _labelShortElement: HTMLElement | undefined;\n\tprivate _hover: IManagedHover | undefined;\n\n\tprivate _onDidClick = this._register(new Emitter<Event>());\n\tget onDidClick(): BaseEvent<Event> { return this._onDidClick.event; }\n\n\tprivate _onDidEscape = this._register(new Emitter<Event>());\n\n\tprivate focusTracker: IFocusTracker;\n\n\tconstructor(container: HTMLElement, options: IButtonOptions) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\n\t\tthis._element = document.createElement('a');\n\t\tthis._element.classList.add('monaco-button');\n\t\tthis._element.tabIndex = 0;\n\t\tthis._element.setAttribute('role', 'button');\n\n\t\tthis._element.classList.toggle('secondary', !!options.secondary);\n\t\tthis._element.classList.toggle('small', !!options.small);\n\t\tconst background = options.secondary ? options.buttonSecondaryBackground : options.buttonBackground;\n\t\tconst foreground = options.secondary ? options.buttonSecondaryForeground : options.buttonForeground;\n\n\t\tthis._element.style.color = foreground || '';\n\t\tthis._element.style.backgroundColor = background || '';\n\n\t\tif (options.supportShortLabel) {\n\t\t\tthis._labelShortElement = document.createElement('div');\n\t\t\tthis._labelShortElement.classList.add('monaco-button-label-short');\n\t\t\tthis._element.appendChild(this._labelShortElement);\n\n\t\t\tthis._labelElement = document.createElement('div');\n\t\t\tthis._labelElement.classList.add('monaco-button-label');\n\t\t\tthis._element.appendChild(this._labelElement);\n\n\t\t\tthis._element.classList.add('monaco-text-button-with-short-label');\n\t\t}\n\n\t\tif (typeof options.title === 'string') {\n\t\t\tthis.setTitle(options.title);\n\t\t}\n\n\t\tif (typeof options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', options.ariaLabel);\n\t\t}\n\t\tcontainer.appendChild(this._element);\n\t\tthis.enabled = !options.disabled;\n\n\t\tthis._register(Gesture.addTarget(this._element));\n\n\t\t[EventType.CLICK, TouchEventType.Tap].forEach(eventType => {\n\t\t\tthis._register(addDisposableListener(this._element, eventType, e => {\n\t\t\t\tif (!this.enabled) {\n\t\t\t\t\tEventHelper.stop(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t}));\n\t\t});\n\n\t\tthis._register(addDisposableListener(this._element, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = false;\n\t\t\tif (this.enabled && (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space))) {\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t\teventHandled = true;\n\t\t\t} else if (event.equals(KeyCode.Escape)) {\n\t\t\t\tthis._onDidEscape.fire(e);\n\t\t\t\tthis._element.blur();\n\t\t\t\teventHandled = true;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tEventHelper.stop(event, true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OVER, e => {\n\t\t\tif (!this._element.classList.contains('disabled')) {\n\t\t\t\tthis.updateStyles(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OUT, e => {\n\t\t\tthis.updateStyles(false); // restore standard styles\n\t\t}));\n\n\t\t// Also set hover background when button is focused for feedback\n\t\tthis.focusTracker = this._register(trackFocus(this._element));\n\t\tthis._register(this.focusTracker.onDidFocus(() => { if (this.enabled) { this.updateStyles(true); } }));\n\t\tthis._register(this.focusTracker.onDidBlur(() => { if (this.enabled) { this.updateStyles(false); } }));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._element.remove();\n\t}\n\n\tprotected getContentElements(content: string): HTMLElement[] {\n\t\tconst elements: HTMLSpanElement[] = [];\n\t\tfor (let segment of renderLabelWithIcons(content)) {\n\t\t\tif (typeof (segment) === 'string') {\n\t\t\t\tsegment = segment.trim();\n\n\t\t\t\t// Ignore empty segment\n\t\t\t\tif (segment === '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Convert string segments to <span> nodes\n\t\t\t\tconst node = document.createElement('span');\n\t\t\t\tnode.textContent = segment;\n\t\t\t\telements.push(node);\n\t\t\t} else {\n\t\t\t\telements.push(segment);\n\t\t\t}\n\t\t}\n\n\t\treturn elements;\n\t}\n\n\tprivate updateStyles(hover: boolean): void {\n\t\tlet background;\n\t\tlet foreground;\n\t\tif (this.options.secondary) {\n\t\t\tbackground = hover ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground;\n\t\t\tforeground = this.options.buttonSecondaryForeground;\n\t\t} else {\n\t\t\tbackground = hover ? this.options.buttonHoverBackground : this.options.buttonBackground;\n\t\t\tforeground = this.options.buttonForeground;\n\t\t}\n\n\t\tthis._element.style.backgroundColor = background || '';\n\t\tthis._element.style.color = foreground || '';\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset label(value: string | IMarkdownString) {\n\t\tif (this._label === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMarkdownString(this._label) && isMarkdownString(value) && markdownStringEqual(this._label, value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._element.classList.add('monaco-text-button');\n\t\tconst labelElement = this.options.supportShortLabel ? this._labelElement! : this._element;\n\n\t\tif (isMarkdownString(value)) {\n\t\t\tconst rendered = renderMarkdown(value, undefined, document.createElement('span'));\n\t\t\trendered.dispose();\n\n\t\t\t// Don't include outer `<p>`\n\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\tconst root = rendered.element.querySelector('p')?.innerHTML;\n\t\t\tif (root) {\n\t\t\t\tsafeSetInnerHtml(labelElement, root, buttonSanitizerConfig);\n\t\t\t} else {\n\t\t\t\treset(labelElement);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.options.supportIcons) {\n\t\t\t\treset(labelElement, ...this.getContentElements(value));\n\t\t\t} else {\n\t\t\t\tlabelElement.textContent = value;\n\t\t\t}\n\t\t}\n\n\t\tlet title: string = '';\n\t\tif (typeof this.options.title === 'string') {\n\t\t\ttitle = this.options.title;\n\t\t} else if (this.options.title) {\n\t\t\ttitle = renderAsPlaintext(value);\n\t\t}\n\n\t\tthis.setTitle(title);\n\n\t\tthis._setAriaLabel();\n\n\t\tthis._label = value;\n\t}\n\n\tget label(): string | IMarkdownString {\n\t\treturn this._label;\n\t}\n\n\tprotected _setAriaLabel(): void {\n\t\tif (typeof this.options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.ariaLabel);\n\t\t} else if (typeof this.options.title === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.title);\n\t\t}\n\t}\n\n\tset icon(icon: ThemeIcon) {\n\t\tthis._setAriaLabel();\n\n\t\tconst oldIcons = Array.from(this._element.classList).filter(item => item.startsWith('codicon-'));\n\t\tthis._element.classList.remove(...oldIcons);\n\t\tthis._element.classList.add(...ThemeIcon.asClassNameArray(icon));\n\t}\n\n\tset enabled(value: boolean) {\n\t\tif (value) {\n\t\t\tthis._element.classList.remove('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(false));\n\t\t\tthis._element.tabIndex = 0;\n\t\t} else {\n\t\t\tthis._element.classList.add('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(true));\n\t\t}\n\t}\n\n\tget enabled() {\n\t\treturn !this._element.classList.contains('disabled');\n\t}\n\n\tset secondary(value: boolean) {\n\t\tthis._element.classList.toggle('secondary', value);\n\t\t(this.options as { secondary?: boolean }).secondary = value;\n\t\tthis.updateStyles(false);\n\t}\n\n\tsetTitle(title: string) {\n\t\tif (!this._hover && title !== '') {\n\t\t\tthis._hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('element'), this._element, title));\n\t\t} else if (this._hover) {\n\t\t\tthis._hover.update(title);\n\t\t}\n\t}\n}\n","\nimport { addDisposableListener, EventHelper, EventType, IFocusTracker, reset, trackFocus } from '../../dom.js';\nimport { StandardKeyboardEvent } from '../../keyboardEvent.js';\nimport { renderMarkdown, renderAsPlaintext } from '../../markdownRenderer.js';\nimport { Gesture, EventType as TouchEventType } from '../../touch.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Color } from '../../../common/color.js';\nimport { Event as BaseEvent, Emitter } from '../../../common/event.js';\nimport { IMarkdownString, isMarkdownString, markdownStringEqual } from '../../../common/htmlContent.js';\nimport { KeyCode } from '../../../common/keyCodes.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { ThemeIcon } from '../../../common/themables.js';\nimport './button.css';\nimport { IManagedHover } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { safeSetInnerHtml, DomSanitizerConfig } from '../../domSanitize.js';\n\nexport interface IButtonOptions extends Partial<IButtonStyles> {\n\treadonly title?: boolean | string;\n\t/**\n\t * Will fallback to `title` if not set.\n\t */\n\treadonly ariaLabel?: string;\n\treadonly supportIcons?: boolean;\n\treadonly supportShortLabel?: boolean;\n\treadonly secondary?: boolean;\n\treadonly small?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly disabled?: boolean;\n}\n\nexport interface IButtonStyles {\n\treadonly buttonBackground: string | undefined;\n\treadonly buttonHoverBackground: string | undefined;\n\treadonly buttonForeground: string | undefined;\n\treadonly buttonSeparator: string | undefined;\n\treadonly buttonSecondaryBackground: string | undefined;\n\treadonly buttonSecondaryHoverBackground: string | undefined;\n\treadonly buttonSecondaryForeground: string | undefined;\n\treadonly buttonBorder: string | undefined;\n}\n\nexport const unthemedButtonStyles: IButtonStyles = {\n\tbuttonBackground: '#0E639C',\n\tbuttonHoverBackground: '#006BB3',\n\tbuttonSeparator: Color.white.toString(),\n\tbuttonForeground: Color.white.toString(),\n\tbuttonBorder: undefined,\n\tbuttonSecondaryBackground: undefined,\n\tbuttonSecondaryForeground: undefined,\n\tbuttonSecondaryHoverBackground: undefined\n};\n\nexport interface IButton extends IDisposable {\n\n\tset label(value: string | IMarkdownString);\n\tset icon(value: ThemeIcon);\n\tset enabled(value: boolean);\n}\n\n// Only allow a very limited set of inline html tags\nconst buttonSanitizerConfig = Object.freeze<DomSanitizerConfig>({\n\tallowedTags: {\n\t\toverride: ['b', 'i', 'u', 'code', 'span'],\n\t},\n\tallowedAttributes: {\n\t\toverride: ['class'],\n\t},\n});\n\nexport class Button extends Disposable implements IButton {\n\n\tprotected options: IButtonOptions;\n\tprotected _element: HTMLElement;\n\tprotected _label: string | IMarkdownString = '';\n\tprotected _labelElement: HTMLElement | undefined;\n\tprotected _labelShortElement: HTMLElement | undefined;\n\tprivate _hover: IManagedHover | undefined;\n\n\tprivate _onDidClick = this._register(new Emitter<Event>());\n\tget onDidClick(): BaseEvent<Event> { return this._onDidClick.event; }\n\n\tprivate _onDidEscape = this._register(new Emitter<Event>());\n\n\tprivate focusTracker: IFocusTracker;\n\n\tconstructor(container: HTMLElement, options: IButtonOptions) {\n\t\tsuper();\n\n\t\tthis.options = options;\n\n\t\tthis._element = document.createElement('a');\n\t\tthis._element.classList.add('monaco-button');\n\t\tthis._element.tabIndex = 0;\n\t\tthis._element.setAttribute('role', 'button');\n\n\t\tthis._element.classList.toggle('secondary', !!options.secondary);\n\t\tthis._element.classList.toggle('small', !!options.small);\n\t\tconst background = options.secondary ? options.buttonSecondaryBackground : options.buttonBackground;\n\t\tconst foreground = options.secondary ? options.buttonSecondaryForeground : options.buttonForeground;\n\n\t\tthis._element.style.color = foreground || '';\n\t\tthis._element.style.backgroundColor = background || '';\n\n\t\tif (options.supportShortLabel) {\n\t\t\tthis._labelShortElement = document.createElement('div');\n\t\t\tthis._labelShortElement.classList.add('monaco-button-label-short');\n\t\t\tthis._element.appendChild(this._labelShortElement);\n\n\t\t\tthis._labelElement = document.createElement('div');\n\t\t\tthis._labelElement.classList.add('monaco-button-label');\n\t\t\tthis._element.appendChild(this._labelElement);\n\n\t\t\tthis._element.classList.add('monaco-text-button-with-short-label');\n\t\t}\n\n\t\tif (typeof options.title === 'string') {\n\t\t\tthis.setTitle(options.title);\n\t\t}\n\n\t\tif (typeof options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', options.ariaLabel);\n\t\t}\n\t\tcontainer.appendChild(this._element);\n\t\tthis.enabled = !options.disabled;\n\n\t\tthis._register(Gesture.addTarget(this._element));\n\n\t\t[EventType.CLICK, TouchEventType.Tap].forEach(eventType => {\n\t\t\tthis._register(addDisposableListener(this._element, eventType, e => {\n\t\t\t\tif (!this.enabled) {\n\t\t\t\t\tEventHelper.stop(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t}));\n\t\t});\n\n\t\tthis._register(addDisposableListener(this._element, EventType.KEY_DOWN, e => {\n\t\t\tconst event = new StandardKeyboardEvent(e);\n\t\t\tlet eventHandled = false;\n\t\t\tif (this.enabled && (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space))) {\n\t\t\t\tthis._onDidClick.fire(e);\n\t\t\t\teventHandled = true;\n\t\t\t} else if (event.equals(KeyCode.Escape)) {\n\t\t\t\tthis._onDidEscape.fire(e);\n\t\t\t\tthis._element.blur();\n\t\t\t\teventHandled = true;\n\t\t\t}\n\n\t\t\tif (eventHandled) {\n\t\t\t\tEventHelper.stop(event, true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OVER, e => {\n\t\t\tif (!this._element.classList.contains('disabled')) {\n\t\t\t\tthis.updateStyles(true);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(addDisposableListener(this._element, EventType.MOUSE_OUT, e => {\n\t\t\tthis.updateStyles(false); // restore standard styles\n\t\t}));\n\n\t\t// Also set hover background when button is focused for feedback\n\t\tthis.focusTracker = this._register(trackFocus(this._element));\n\t\tthis._register(this.focusTracker.onDidFocus(() => { if (this.enabled) { this.updateStyles(true); } }));\n\t\tthis._register(this.focusTracker.onDidBlur(() => { if (this.enabled) { this.updateStyles(false); } }));\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t\tthis._element.remove();\n\t}\n\n\tprotected getContentElements(content: string): HTMLElement[] {\n\t\tconst elements: HTMLSpanElement[] = [];\n\t\tfor (let segment of renderLabelWithIcons(content)) {\n\t\t\tif (typeof (segment) === 'string') {\n\t\t\t\tsegment = segment.trim();\n\n\t\t\t\t// Ignore empty segment\n\t\t\t\tif (segment === '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Convert string segments to <span> nodes\n\t\t\t\tconst node = document.createElement('span');\n\t\t\t\tnode.textContent = segment;\n\t\t\t\telements.push(node);\n\t\t\t} else {\n\t\t\t\telements.push(segment);\n\t\t\t}\n\t\t}\n\n\t\treturn elements;\n\t}\n\n\tprivate updateStyles(hover: boolean): void {\n\t\tlet background;\n\t\tlet foreground;\n\t\tif (this.options.secondary) {\n\t\t\tbackground = hover ? this.options.buttonSecondaryHoverBackground : this.options.buttonSecondaryBackground;\n\t\t\tforeground = this.options.buttonSecondaryForeground;\n\t\t} else {\n\t\t\tbackground = hover ? this.options.buttonHoverBackground : this.options.buttonBackground;\n\t\t\tforeground = this.options.buttonForeground;\n\t\t}\n\n\t\tthis._element.style.backgroundColor = background || '';\n\t\tthis._element.style.color = foreground || '';\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset label(value: string | IMarkdownString) {\n\t\tif (this._label === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMarkdownString(this._label) && isMarkdownString(value) && markdownStringEqual(this._label, value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._element.classList.add('monaco-text-button');\n\t\tconst labelElement = this.options.supportShortLabel ? this._labelElement! : this._element;\n\n\t\tif (isMarkdownString(value)) {\n\t\t\tconst rendered = renderMarkdown(value, undefined, document.createElement('span'));\n\t\t\trendered.dispose();\n\n\t\t\t// Don't include outer `<p>`\n\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\tconst root = rendered.element.querySelector('p')?.innerHTML;\n\t\t\tif (root) {\n\t\t\t\tsafeSetInnerHtml(labelElement, root, buttonSanitizerConfig);\n\t\t\t} else {\n\t\t\t\treset(labelElement);\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.options.supportIcons) {\n\t\t\t\treset(labelElement, ...this.getContentElements(value));\n\t\t\t} else {\n\t\t\t\tlabelElement.textContent = value;\n\t\t\t}\n\t\t}\n\n\t\tlet title: string = '';\n\t\tif (typeof this.options.title === 'string') {\n\t\t\ttitle = this.options.title;\n\t\t} else if (this.options.title) {\n\t\t\ttitle = renderAsPlaintext(value);\n\t\t}\n\n\t\tthis.setTitle(title);\n\n\t\tthis._setAriaLabel();\n\n\t\tthis._label = value;\n\t}\n\n\tget label(): string | IMarkdownString {\n\t\treturn this._label;\n\t}\n\n\tprotected _setAriaLabel(): void {\n\t\tif (typeof this.options.ariaLabel === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.ariaLabel);\n\t\t} else if (typeof this.options.title === 'string') {\n\t\t\tthis._element.setAttribute('aria-label', this.options.title);\n\t\t}\n\t}\n\n\tset icon(icon: ThemeIcon) {\n\t\tthis._setAriaLabel();\n\n\t\tconst oldIcons = Array.from(this._element.classList).filter(item => item.startsWith('codicon-'));\n\t\tthis._element.classList.remove(...oldIcons);\n\t\tthis._element.classList.add(...ThemeIcon.asClassNameArray(icon));\n\t}\n\n\tset enabled(value: boolean) {\n\t\tif (value) {\n\t\t\tthis._element.classList.remove('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(false));\n\t\t\tthis._element.tabIndex = 0;\n\t\t} else {\n\t\t\tthis._element.classList.add('disabled');\n\t\t\tthis._element.setAttribute('aria-disabled', String(true));\n\t\t}\n\t}\n\n\tget enabled() {\n\t\treturn !this._element.classList.contains('disabled');\n\t}\n\n\tset secondary(value: boolean) {\n\t\tthis._element.classList.toggle('secondary', value);\n\t\t(this.options as { secondary?: boolean }).secondary = value;\n\t\tthis.updateStyles(false);\n\t}\n\n\tsetTitle(title: string) {\n\t\tif (!this._hover && title !== '') {\n\t\t\tthis._hover = this._register(getBaseLayerHoverDelegate().setupManagedHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('element'), this._element, title));\n\t\t} else if (this._hover) {\n\t\t\tthis._hover.update(title);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -194,7 +194,6 @@
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
.monaco-dialog-box > .dialog-buttons-row > .dialog-buttons > .monaco-button {
|
|
197
|
-
padding: 4px 10px;
|
|
198
197
|
overflow: hidden;
|
|
199
198
|
text-overflow: ellipsis;
|
|
200
199
|
margin: 4px 5px; /* allows button focus outline to be visible */
|
|
@@ -228,19 +227,14 @@
|
|
|
228
227
|
outline-width: 1px;
|
|
229
228
|
outline-style: solid;
|
|
230
229
|
outline-color: var(--vscode-focusBorder);
|
|
231
|
-
border-radius:
|
|
230
|
+
border-radius: 4px;
|
|
232
231
|
}
|
|
233
232
|
|
|
234
|
-
.monaco-dialog-box > .dialog-buttons-row > .dialog-buttons > .monaco-button-dropdown > .monaco-text-button {
|
|
235
|
-
padding-left: 10px;
|
|
236
|
-
padding-right: 10px;
|
|
237
|
-
}
|
|
238
233
|
|
|
239
234
|
.monaco-dialog-box.align-vertical > .dialog-buttons-row > .dialog-buttons > .monaco-button-dropdown > .monaco-text-button {
|
|
240
235
|
width: 100%;
|
|
241
236
|
}
|
|
242
237
|
|
|
243
238
|
.monaco-dialog-box > .dialog-buttons-row > .dialog-buttons > .monaco-button-dropdown > .monaco-dropdown-button {
|
|
244
|
-
padding
|
|
245
|
-
padding-right: 5px;
|
|
239
|
+
padding: 0 4px;
|
|
246
240
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
.monaco-select-box {
|
|
7
7
|
width: 100%;
|
|
8
8
|
cursor: pointer;
|
|
9
|
-
border-radius:
|
|
9
|
+
border-radius: 4px;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.monaco-select-box-dropdown-container {
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
|
|
31
31
|
.mac .monaco-action-bar .action-item .monaco-select-box {
|
|
32
32
|
font-size: 11px;
|
|
33
|
-
border-radius:
|
|
33
|
+
border-radius: 4px;
|
|
34
34
|
min-height: 24px;
|
|
35
35
|
}
|
|
@@ -33,6 +33,17 @@ const vNumberValidator = new TypeofValidator('number');
|
|
|
33
33
|
const vBooleanValidator = new TypeofValidator('boolean');
|
|
34
34
|
export function vBoolean() { return vBooleanValidator; }
|
|
35
35
|
const vObjAnyValidator = new TypeofValidator('object');
|
|
36
|
+
class UncheckedValidator extends ValidatorBase {
|
|
37
|
+
validate(content) {
|
|
38
|
+
return { content: content, error: undefined };
|
|
39
|
+
}
|
|
40
|
+
getJSONSchema() {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export function vUnchecked() {
|
|
45
|
+
return new UncheckedValidator();
|
|
46
|
+
}
|
|
36
47
|
class UndefinedValidator extends ValidatorBase {
|
|
37
48
|
validate(content) {
|
|
38
49
|
if (content !== undefined) {
|