monaco-editor-core 0.55.0-dev-20251024 → 0.55.0-dev-20251025
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/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js +6 -7
- package/esm/vs/base/browser/ui/highlightedlabel/highlightedLabel.js.map +1 -1
- package/esm/vs/base/browser/ui/iconLabel/iconLabel.js +11 -6
- package/esm/vs/base/browser/ui/iconLabel/iconLabel.js.map +1 -1
- package/esm/vs/base/browser/ui/iconLabel/iconlabel.css +5 -2
- package/esm/vs/base/common/codiconsLibrary.js +3 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/editor/common/languages.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +13 -9
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +4 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +13 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js.map +1 -1
- package/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js +28 -1
- package/esm/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens.js.map +1 -1
- package/esm/vs/editor/editor.api.d.ts +1 -0
- package/monaco.d.ts +1 -0
- 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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
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.55.0-dev-
|
|
3
|
+
* Version: 0.55.0-dev-20251025(e8e70b31548071cc1ffbe4fd2834ceb03c8a82c3)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
|
|
6
6
|
*-----------------------------------------------------------*/
|
|
Binary file
|
|
@@ -25,7 +25,6 @@ export class HighlightedLabel extends Disposable {
|
|
|
25
25
|
this.title = '';
|
|
26
26
|
this.highlights = [];
|
|
27
27
|
this.didEverRender = false;
|
|
28
|
-
this.supportIcons = options?.supportIcons ?? false;
|
|
29
28
|
this.domNode = dom.append(container, dom.$('span.monaco-highlighted-label'));
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
@@ -43,7 +42,7 @@ export class HighlightedLabel extends Disposable {
|
|
|
43
42
|
* @param escapeNewLines Whether to escape new lines.
|
|
44
43
|
* @returns
|
|
45
44
|
*/
|
|
46
|
-
set(text, highlights = [], title = '', escapeNewLines) {
|
|
45
|
+
set(text, highlights = [], title = '', escapeNewLines, supportIcons) {
|
|
47
46
|
if (!text) {
|
|
48
47
|
text = '';
|
|
49
48
|
}
|
|
@@ -57,9 +56,9 @@ export class HighlightedLabel extends Disposable {
|
|
|
57
56
|
this.text = text;
|
|
58
57
|
this.title = title;
|
|
59
58
|
this.highlights = highlights;
|
|
60
|
-
this.render();
|
|
59
|
+
this.render(supportIcons);
|
|
61
60
|
}
|
|
62
|
-
render() {
|
|
61
|
+
render(supportIcons) {
|
|
63
62
|
const children = [];
|
|
64
63
|
let pos = 0;
|
|
65
64
|
for (const highlight of this.highlights) {
|
|
@@ -68,7 +67,7 @@ export class HighlightedLabel extends Disposable {
|
|
|
68
67
|
}
|
|
69
68
|
if (pos < highlight.start) {
|
|
70
69
|
const substring = this.text.substring(pos, highlight.start);
|
|
71
|
-
if (
|
|
70
|
+
if (supportIcons) {
|
|
72
71
|
children.push(...renderLabelWithIcons(substring));
|
|
73
72
|
}
|
|
74
73
|
else {
|
|
@@ -77,7 +76,7 @@ export class HighlightedLabel extends Disposable {
|
|
|
77
76
|
pos = highlight.start;
|
|
78
77
|
}
|
|
79
78
|
const substring = this.text.substring(pos, highlight.end);
|
|
80
|
-
const element = dom.$('span.highlight', undefined, ...
|
|
79
|
+
const element = dom.$('span.highlight', undefined, ...supportIcons ? renderLabelWithIcons(substring) : [substring]);
|
|
81
80
|
if (highlight.extraClasses) {
|
|
82
81
|
element.classList.add(...highlight.extraClasses);
|
|
83
82
|
}
|
|
@@ -86,7 +85,7 @@ export class HighlightedLabel extends Disposable {
|
|
|
86
85
|
}
|
|
87
86
|
if (pos < this.text.length) {
|
|
88
87
|
const substring = this.text.substring(pos);
|
|
89
|
-
if (
|
|
88
|
+
if (supportIcons) {
|
|
90
89
|
children.push(...renderLabelWithIcons(substring));
|
|
91
90
|
}
|
|
92
91
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts","vs/base/browser/ui/highlightedlabel/highlightedLabel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAqBtD;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAU/C;;;;OAIG;IACH,YAAY,SAAsB,EAAmB,OAAkC;QACtF,KAAK,EAAE,CAAC;QAD4C,YAAO,GAAP,OAAO,CAA2B;QAZ/E,SAAI,GAAW,EAAE,CAAC;QAClB,UAAK,GAAW,EAAE,CAAC;QACnB,eAAU,GAA0B,EAAE,CAAC;QAEvC,kBAAa,GAAY,KAAK,CAAC;QAWtC,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,KAAK,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACH,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED;;;;;;;;OAQG;IACH,GAAG,CAAC,IAAwB,EAAE,aAAoC,EAAE,EAAE,QAAgB,EAAE,EAAE,cAAwB;QACjH,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,IAAI,GAAG,EAAE,CAAC;QACX,CAAC;QAED,I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CAAC,CAAC;QAC3H,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC7B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,UAAiC;QACpE,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACpD,KAAK,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC;YAEhB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACpC,IAAI,SAAS,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;oBAC7B,SAAS;gBACV,CAAC;gBACD,IAAI,SAAS,CAAC,KAAK,IAAI,MAAM,EAAE,CAAC;oBAC/B,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC;gBAC1B,CAAC;gBACD,IAAI,SAAS,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;oBAC7B,SAAS,CAAC,GAAG,IAAI,KAAK,CAAC;gBACxB,CAAC;YACF,CAAC;YAED,KAAK,IAAI,KAAK,CAAC;YACf,OAAO,QAAQ,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","file":"highlightedLabel.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 * as dom from '../../dom.js';\nimport { IManagedHover } from '../hover/hover.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport * as objects from '../../../common/objects.js';\n\n/**\n * A range to be highlighted.\n */\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n\treadonly extraClasses?: readonly string[];\n}\n\nexport interface IHighlightedLabelOptions {\n\n\t/**\n\t * Whether the label supports rendering icons.\n\t */\n\treadonly supportIcons?: boolean;\n\n\treadonly hoverDelegate?: IHoverDelegate;\n}\n\n/**\n * A widget which can render a label with substring highlights, often\n * originating from a filter function like the fuzzy matcher.\n */\nexport class HighlightedLabel extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate text: string = '';\n\tprivate title: string = '';\n\tprivate highlights: readonly IHighlight[] = [];\n\tprivate supportIcons: boolean;\n\tprivate didEverRender: boolean = false;\n\tprivate customHover: IManagedHover | undefined;\n\n\t/**\n\t * Create a new {@link HighlightedLabel}.\n\t *\n\t * @param container The parent container to append to.\n\t */\n\tconstructor(container: HTMLElement, private readonly options?: IHighlightedLabelOptions) {\n\t\tsuper();\n\n\t\tthis.supportIcons = options?.supportIcons ?? false;\n\t\tthis.domNode = dom.append(container, dom.$('span.monaco-highlighted-label'));\n\t}\n\n\t/**\n\t * The label's DOM node.\n\t */\n\tget element(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\t/**\n\t * Set the label and highlights.\n\t *\n\t * @param text The label to display.\n\t * @param highlights The ranges to highlight.\n\t * @param title An optional title for the hover tooltip.\n\t * @param escapeNewLines Whether to escape new lines.\n\t * @returns\n\t */\n\tset(text: string | undefined, highlights: readonly IHighlight[] = [], title: string = '', escapeNewLines?: boolean) {\n\t\tif (!text) {\n\t\t\ttext = '';\n\t\t}\n\n\t\tif (escapeNewLines) {\n\t\t\t// adjusts highlights inplace\n\t\t\ttext = HighlightedLabel.escapeNewLines(text, highlights);\n\t\t}\n\n\t\tif (this.didEverRender && this.text === text && this.title === title && objects.equals(this.highlights, highlights)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.text = text;\n\t\tthis.title = title;\n\t\tthis.highlights = highlights;\n\t\tthis.render();\n\t}\n\n\tprivate render(): void {\n\n\t\tconst children: Array<HTMLSpanElement | string> = [];\n\t\tlet pos = 0;\n\n\t\tfor (const highlight of this.highlights) {\n\t\t\tif (highlight.end === highlight.start) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (pos < highlight.start) {\n\t\t\t\tconst substring = this.text.substring(pos, highlight.start);\n\t\t\t\tif (this.supportIcons) {\n\t\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t\t} else {\n\t\t\t\t\tchildren.push(substring);\n\t\t\t\t}\n\t\t\t\tpos = highlight.start;\n\t\t\t}\n\n\t\t\tconst substring = this.text.substring(pos, highlight.end);\n\t\t\tconst element = dom.$('span.highlight', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]);\n\n\t\t\tif (highlight.extraClasses) {\n\t\t\t\telement.classList.add(...highlight.extraClasses);\n\t\t\t}\n\n\t\t\tchildren.push(element);\n\t\t\tpos = highlight.end;\n\t\t}\n\n\t\tif (pos < this.text.length) {\n\t\t\tconst substring = this.text.substring(pos,);\n\t\t\tif (this.supportIcons) {\n\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t} else {\n\t\t\t\tchildren.push(substring);\n\t\t\t}\n\t\t}\n\n\t\tdom.reset(this.domNode, ...children);\n\n\t\tif (!this.customHover && this.title !== '') {\n\t\t\tconst hoverDelegate = this.options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t\t\tthis.customHover = this._register(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.domNode, this.title));\n\t\t} else if (this.customHover) {\n\t\t\tthis.customHover.update(this.title);\n\t\t}\n\n\t\tthis.didEverRender = true;\n\t}\n\n\tstatic escapeNewLines(text: string, highlights: readonly IHighlight[]): string {\n\t\tlet total = 0;\n\t\tlet extra = 0;\n\n\t\treturn text.replace(/\\r\\n|\\r|\\n/g, (match, offset) => {\n\t\t\textra = match === '\\r\\n' ? -1 : 0;\n\t\t\toffset += total;\n\n\t\t\tfor (const highlight of highlights) {\n\t\t\t\tif (highlight.end <= offset) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (highlight.start >= offset) {\n\t\t\t\t\thighlight.start += extra;\n\t\t\t\t}\n\t\t\t\tif (highlight.end >= offset) {\n\t\t\t\t\thighlight.end += extra;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttotal += extra;\n\t\t\treturn '\\u23CE';\n\t\t});\n\t}\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 * as dom from '../../dom.js';\nimport { IManagedHover } from '../hover/hover.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport * as objects from '../../../common/objects.js';\n\n/**\n * A range to be highlighted.\n */\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n\treadonly extraClasses?: readonly string[];\n}\n\nexport interface IHighlightedLabelOptions {\n\n\t/**\n\t * Whether the label supports rendering icons.\n\t */\n\treadonly supportIcons?: boolean;\n\n\treadonly hoverDelegate?: IHoverDelegate;\n}\n\n/**\n * A widget which can render a label with substring highlights, often\n * originating from a filter function like the fuzzy matcher.\n */\nexport class HighlightedLabel extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate text: string = '';\n\tprivate title: string = '';\n\tprivate highlights: readonly IHighlight[] = [];\n\tprivate supportIcons: boolean;\n\tprivate didEverRender: boolean = false;\n\tprivate customHover: IManagedHover | undefined;\n\n\t/**\n\t * Create a new {@link HighlightedLabel}.\n\t *\n\t * @param container The parent container to append to.\n\t */\n\tconstructor(container: HTMLElement, private readonly options?: IHighlightedLabelOptions) {\n\t\tsuper();\n\n\t\tthis.supportIcons = options?.supportIcons ?? false;\n\t\tthis.domNode = dom.append(container, dom.$('span.monaco-highlighted-label'));\n\t}\n\n\t/**\n\t * The label's DOM node.\n\t */\n\tget element(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\t/**\n\t * Set the label and highlights.\n\t *\n\t * @param text The label to display.\n\t * @param highlights The ranges to highlight.\n\t * @param title An optional title for the hover tooltip.\n\t * @param escapeNewLines Whether to escape new lines.\n\t * @returns\n\t */\n\tset(text: string | undefined, highlights: readonly IHighlight[] = [], title: string = '', escapeNewLines?: boolean) {\n\t\tif (!text) {\n\t\t\ttext = '';\n\t\t}\n\n\t\tif (escapeNewLines) {\n\t\t\t// adjusts highlights inplace\n\t\t\ttext = HighlightedLabel.escapeNewLines(text, highlights);\n\t\t}\n\n\t\tif (this.didEverRender && this.text === text && this.title === title && objects.equals(this.highlights, highlights)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.text = text;\n\t\tthis.title = title;\n\t\tthis.highlights = highlights;\n\t\tthis.render();\n\t}\n\n\tprivate render(): void {\n\n\t\tconst children: Array<HTMLSpanElement | string> = [];\n\t\tlet pos = 0;\n\n\t\tfor (const highlight of this.highlights) {\n\t\t\tif (highlight.end === highlight.start) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (pos < highlight.start) {\n\t\t\t\tconst substring = this.text.substring(pos, highlight.start);\n\t\t\t\tif (this.supportIcons) {\n\t\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t\t} else {\n\t\t\t\t\tchildren.push(substring);\n\t\t\t\t}\n\t\t\t\tpos = highlight.start;\n\t\t\t}\n\n\t\t\tconst substring = this.text.substring(pos, highlight.end);\n\t\t\tconst element = dom.$('span.highlight', undefined, ...this.supportIcons ? renderLabelWithIcons(substring) : [substring]);\n\n\t\t\tif (highlight.extraClasses) {\n\t\t\t\telement.classList.add(...highlight.extraClasses);\n\t\t\t}\n\n\t\t\tchildren.push(element);\n\t\t\tpos = highlight.end;\n\t\t}\n\n\t\tif (pos < this.text.length) {\n\t\t\tconst substring = this.text.substring(pos,);\n\t\t\tif (this.supportIcons) {\n\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t} else {\n\t\t\t\tchildren.push(substring);\n\t\t\t}\n\t\t}\n\n\t\tdom.reset(this.domNode, ...children);\n\n\t\tif (!this.customHover && this.title !== '') {\n\t\t\tconst hoverDelegate = this.options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t\t\tthis.customHover = this._register(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.domNode, this.title));\n\t\t} else if (this.customHover) {\n\t\t\tthis.customHover.update(this.title);\n\t\t}\n\n\t\tthis.didEverRender = true;\n\t}\n\n\tstatic escapeNewLines(text: string, highlights: readonly IHighlight[]): string {\n\t\tlet total = 0;\n\t\tlet extra = 0;\n\n\t\treturn text.replace(/\\r\\n|\\r|\\n/g, (match, offset) => {\n\t\t\textra = match === '\\r\\n' ? -1 : 0;\n\t\t\toffset += total;\n\n\t\t\tfor (const highlight of highlights) {\n\t\t\t\tif (highlight.end <= offset) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (highlight.start >= offset) {\n\t\t\t\t\thighlight.start += extra;\n\t\t\t\t}\n\t\t\t\tif (highlight.end >= offset) {\n\t\t\t\t\thighlight.end += extra;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttotal += extra;\n\t\t\treturn '\\u23CE';\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base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AI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,IAAY,EAAE,UAAiC;QACpE,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACpD,KAAK,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC;YAEhB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACpC,IAAI,SAAS,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;oBAC7B,SAAS;gBACV,CAAC;gBACD,IAAI,SAAS,CAAC,KAAK,IAAI,MAAM,EAAE,CAAC;oBAC/B,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC;gBAC1B,CAAC;gBACD,IAAI,SAAS,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;oBAC7B,SAAS,CAAC,GAAG,IAAI,KAAK,CAAC;gBACxB,CAAC;YACF,CAAC;YAED,KAAK,IAAI,KAAK,CAAC;YACf,OAAO,QAAQ,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","file":"highlightedLabel.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 * as dom from '../../dom.js';\nimport { IManagedHover } from '../hover/hover.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport * as objects from '../../../common/objects.js';\n\n/**\n * A range to be highlighted.\n */\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n\treadonly extraClasses?: readonly string[];\n}\n\nexport interface IHighlightedLabelOptions {\n\treadonly hoverDelegate?: IHoverDelegate;\n}\n\n/**\n * A widget which can render a label with substring highlights, often\n * originating from a filter function like the fuzzy matcher.\n */\nexport class HighlightedLabel extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate text: string = '';\n\tprivate title: string = '';\n\tprivate highlights: readonly IHighlight[] = [];\n\tprivate didEverRender: boolean = false;\n\tprivate customHover: IManagedHover | undefined;\n\n\t/**\n\t * Create a new {@link HighlightedLabel}.\n\t *\n\t * @param container The parent container to append to.\n\t */\n\tconstructor(container: HTMLElement, private readonly options?: IHighlightedLabelOptions) {\n\t\tsuper();\n\n\t\tthis.domNode = dom.append(container, dom.$('span.monaco-highlighted-label'));\n\t}\n\n\t/**\n\t * The label's DOM node.\n\t */\n\tget element(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\t/**\n\t * Set the label and highlights.\n\t *\n\t * @param text The label to display.\n\t * @param highlights The ranges to highlight.\n\t * @param title An optional title for the hover tooltip.\n\t * @param escapeNewLines Whether to escape new lines.\n\t * @returns\n\t */\n\tset(text: string | undefined, highlights: readonly IHighlight[] = [], title: string = '', escapeNewLines?: boolean, supportIcons?: boolean) {\n\t\tif (!text) {\n\t\t\ttext = '';\n\t\t}\n\n\t\tif (escapeNewLines) {\n\t\t\t// adjusts highlights inplace\n\t\t\ttext = HighlightedLabel.escapeNewLines(text, highlights);\n\t\t}\n\n\t\tif (this.didEverRender && this.text === text && this.title === title && objects.equals(this.highlights, highlights)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.text = text;\n\t\tthis.title = title;\n\t\tthis.highlights = highlights;\n\t\tthis.render(supportIcons);\n\t}\n\n\tprivate render(supportIcons?: boolean): void {\n\n\t\tconst children: Array<HTMLSpanElement | string> = [];\n\t\tlet pos = 0;\n\n\t\tfor (const highlight of this.highlights) {\n\t\t\tif (highlight.end === highlight.start) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (pos < highlight.start) {\n\t\t\t\tconst substring = this.text.substring(pos, highlight.start);\n\t\t\t\tif (supportIcons) {\n\t\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t\t} else {\n\t\t\t\t\tchildren.push(substring);\n\t\t\t\t}\n\t\t\t\tpos = highlight.start;\n\t\t\t}\n\n\t\t\tconst substring = this.text.substring(pos, highlight.end);\n\t\t\tconst element = dom.$('span.highlight', undefined, ...supportIcons ? renderLabelWithIcons(substring) : [substring]);\n\n\t\t\tif (highlight.extraClasses) {\n\t\t\t\telement.classList.add(...highlight.extraClasses);\n\t\t\t}\n\n\t\t\tchildren.push(element);\n\t\t\tpos = highlight.end;\n\t\t}\n\n\t\tif (pos < this.text.length) {\n\t\t\tconst substring = this.text.substring(pos,);\n\t\t\tif (supportIcons) {\n\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t} else {\n\t\t\t\tchildren.push(substring);\n\t\t\t}\n\t\t}\n\n\t\tdom.reset(this.domNode, ...children);\n\n\t\tif (!this.customHover && this.title !== '') {\n\t\t\tconst hoverDelegate = this.options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t\t\tthis.customHover = this._register(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.domNode, this.title));\n\t\t} else if (this.customHover) {\n\t\t\tthis.customHover.update(this.title);\n\t\t}\n\n\t\tthis.didEverRender = true;\n\t}\n\n\tstatic escapeNewLines(text: string, highlights: readonly IHighlight[]): string {\n\t\tlet total = 0;\n\t\tlet extra = 0;\n\n\t\treturn text.replace(/\\r\\n|\\r|\\n/g, (match, offset) => {\n\t\t\textra = match === '\\r\\n' ? -1 : 0;\n\t\t\toffset += total;\n\n\t\t\tfor (const highlight of highlights) {\n\t\t\t\tif (highlight.end <= offset) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (highlight.start >= offset) {\n\t\t\t\t\thighlight.start += extra;\n\t\t\t\t}\n\t\t\t\tif (highlight.end >= offset) {\n\t\t\t\t\thighlight.end += extra;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttotal += extra;\n\t\t\treturn '\\u23CE';\n\t\t});\n\t}\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 * as dom from '../../dom.js';\nimport { IManagedHover } from '../hover/hover.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { renderLabelWithIcons } from '../iconLabel/iconLabels.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport * as objects from '../../../common/objects.js';\n\n/**\n * A range to be highlighted.\n */\nexport interface IHighlight {\n\tstart: number;\n\tend: number;\n\treadonly extraClasses?: readonly string[];\n}\n\nexport interface IHighlightedLabelOptions {\n\treadonly hoverDelegate?: IHoverDelegate;\n}\n\n/**\n * A widget which can render a label with substring highlights, often\n * originating from a filter function like the fuzzy matcher.\n */\nexport class HighlightedLabel extends Disposable {\n\n\tprivate readonly domNode: HTMLElement;\n\tprivate text: string = '';\n\tprivate title: string = '';\n\tprivate highlights: readonly IHighlight[] = [];\n\tprivate didEverRender: boolean = false;\n\tprivate customHover: IManagedHover | undefined;\n\n\t/**\n\t * Create a new {@link HighlightedLabel}.\n\t *\n\t * @param container The parent container to append to.\n\t */\n\tconstructor(container: HTMLElement, private readonly options?: IHighlightedLabelOptions) {\n\t\tsuper();\n\n\t\tthis.domNode = dom.append(container, dom.$('span.monaco-highlighted-label'));\n\t}\n\n\t/**\n\t * The label's DOM node.\n\t */\n\tget element(): HTMLElement {\n\t\treturn this.domNode;\n\t}\n\n\t/**\n\t * Set the label and highlights.\n\t *\n\t * @param text The label to display.\n\t * @param highlights The ranges to highlight.\n\t * @param title An optional title for the hover tooltip.\n\t * @param escapeNewLines Whether to escape new lines.\n\t * @returns\n\t */\n\tset(text: string | undefined, highlights: readonly IHighlight[] = [], title: string = '', escapeNewLines?: boolean, supportIcons?: boolean) {\n\t\tif (!text) {\n\t\t\ttext = '';\n\t\t}\n\n\t\tif (escapeNewLines) {\n\t\t\t// adjusts highlights inplace\n\t\t\ttext = HighlightedLabel.escapeNewLines(text, highlights);\n\t\t}\n\n\t\tif (this.didEverRender && this.text === text && this.title === title && objects.equals(this.highlights, highlights)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.text = text;\n\t\tthis.title = title;\n\t\tthis.highlights = highlights;\n\t\tthis.render(supportIcons);\n\t}\n\n\tprivate render(supportIcons?: boolean): void {\n\n\t\tconst children: Array<HTMLSpanElement | string> = [];\n\t\tlet pos = 0;\n\n\t\tfor (const highlight of this.highlights) {\n\t\t\tif (highlight.end === highlight.start) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (pos < highlight.start) {\n\t\t\t\tconst substring = this.text.substring(pos, highlight.start);\n\t\t\t\tif (supportIcons) {\n\t\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t\t} else {\n\t\t\t\t\tchildren.push(substring);\n\t\t\t\t}\n\t\t\t\tpos = highlight.start;\n\t\t\t}\n\n\t\t\tconst substring = this.text.substring(pos, highlight.end);\n\t\t\tconst element = dom.$('span.highlight', undefined, ...supportIcons ? renderLabelWithIcons(substring) : [substring]);\n\n\t\t\tif (highlight.extraClasses) {\n\t\t\t\telement.classList.add(...highlight.extraClasses);\n\t\t\t}\n\n\t\t\tchildren.push(element);\n\t\t\tpos = highlight.end;\n\t\t}\n\n\t\tif (pos < this.text.length) {\n\t\t\tconst substring = this.text.substring(pos,);\n\t\t\tif (supportIcons) {\n\t\t\t\tchildren.push(...renderLabelWithIcons(substring));\n\t\t\t} else {\n\t\t\t\tchildren.push(substring);\n\t\t\t}\n\t\t}\n\n\t\tdom.reset(this.domNode, ...children);\n\n\t\tif (!this.customHover && this.title !== '') {\n\t\t\tconst hoverDelegate = this.options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t\t\tthis.customHover = this._register(getBaseLayerHoverDelegate().setupManagedHover(hoverDelegate, this.domNode, this.title));\n\t\t} else if (this.customHover) {\n\t\t\tthis.customHover.update(this.title);\n\t\t}\n\n\t\tthis.didEverRender = true;\n\t}\n\n\tstatic escapeNewLines(text: string, highlights: readonly IHighlight[]): string {\n\t\tlet total = 0;\n\t\tlet extra = 0;\n\n\t\treturn text.replace(/\\r\\n|\\r|\\n/g, (match, offset) => {\n\t\t\textra = match === '\\r\\n' ? -1 : 0;\n\t\t\toffset += total;\n\n\t\t\tfor (const highlight of highlights) {\n\t\t\t\tif (highlight.end <= offset) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (highlight.start >= offset) {\n\t\t\t\t\thighlight.start += extra;\n\t\t\t\t}\n\t\t\t\tif (highlight.end >= offset) {\n\t\t\t\t\thighlight.end += extra;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttotal += extra;\n\t\t\treturn '\\u23CE';\n\t\t});\n\t}\n}\n"]}
|
|
@@ -71,6 +71,9 @@ export class IconLabel extends Disposable {
|
|
|
71
71
|
if (options.extraClasses) {
|
|
72
72
|
labelClasses.push(...options.extraClasses);
|
|
73
73
|
}
|
|
74
|
+
if (options.bold) {
|
|
75
|
+
labelClasses.push('bold');
|
|
76
|
+
}
|
|
74
77
|
if (options.italic) {
|
|
75
78
|
labelClasses.push('italic');
|
|
76
79
|
}
|
|
@@ -116,7 +119,7 @@ export class IconLabel extends Disposable {
|
|
|
116
119
|
if (description || this.descriptionNode) {
|
|
117
120
|
const descriptionNode = this.getOrCreateDescriptionNode();
|
|
118
121
|
if (descriptionNode instanceof HighlightedLabel) {
|
|
119
|
-
descriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines);
|
|
122
|
+
descriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, options?.supportIcons);
|
|
120
123
|
this.setupHover(descriptionNode.element, options?.descriptionTitle);
|
|
121
124
|
}
|
|
122
125
|
else {
|
|
@@ -170,7 +173,7 @@ export class IconLabel extends Disposable {
|
|
|
170
173
|
if (!this.descriptionNode) {
|
|
171
174
|
const descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));
|
|
172
175
|
if (this.creationOptions?.supportDescriptionHighlights) {
|
|
173
|
-
this.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))
|
|
176
|
+
this.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));
|
|
174
177
|
}
|
|
175
178
|
else {
|
|
176
179
|
this.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));
|
|
@@ -243,13 +246,15 @@ class LabelWithHighlights extends Disposable {
|
|
|
243
246
|
}
|
|
244
247
|
this.label = label;
|
|
245
248
|
this.options = options;
|
|
249
|
+
// Determine supportIcons: use option if provided, otherwise use constructor value
|
|
250
|
+
const supportIcons = options?.supportIcons ?? this.supportIcons;
|
|
246
251
|
if (typeof label === 'string') {
|
|
247
252
|
if (!this.singleLabel) {
|
|
248
253
|
this.container.textContent = '';
|
|
249
254
|
this.container.classList.remove('multiple');
|
|
250
|
-
this.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))
|
|
255
|
+
this.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));
|
|
251
256
|
}
|
|
252
|
-
this.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines);
|
|
257
|
+
this.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);
|
|
253
258
|
}
|
|
254
259
|
else {
|
|
255
260
|
this.container.textContent = '';
|
|
@@ -262,8 +267,8 @@ class LabelWithHighlights extends Disposable {
|
|
|
262
267
|
const m = matches ? matches[i] : undefined;
|
|
263
268
|
const id = options?.domId && `${options?.domId}_${i}`;
|
|
264
269
|
const name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });
|
|
265
|
-
const highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)
|
|
266
|
-
highlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines);
|
|
270
|
+
const highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));
|
|
271
|
+
highlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);
|
|
267
272
|
if (i < label.length - 1) {
|
|
268
273
|
dom.append(name, dom.$('span.label-separator', undefined, separator));
|
|
269
274
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/iconLabel/iconLabel.ts","vs/base/browser/ui/iconLabel/iconLabel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,OAAO,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AA2BvE,MAAM,aAAa;IAMlB,YAAo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M,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC3C,MAAM,EAAE,GAAG,OAAO,EAAE,KAAK,IAAI,GAAG,OAAO,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;gBAEtD,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,uBAAuB,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAClI,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;gBACrI,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC;gBAEpE,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,sBAAsB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;gBACvE,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;CACD","file":"iconLabel.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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description')), { supportIcons: !!this.creationOptions.supportIcons }));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId })), { supportIcons: this.supportIcons }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name), { supportIcons: this.supportIcons }));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description')), { supportIcons: !!this.creationOptions.supportIcons }));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId })), { supportIcons: this.supportIcons }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name), { supportIcons: this.supportIcons }));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\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/iconLabel/iconLabel.ts","vs/base/browser/ui/iconLabel/iconLabel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAA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AAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,sBAAsB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;gBACvE,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;CACD","file":"iconLabel.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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\tbold?: boolean;\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n\tsupportIcons?: boolean;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.bold) {\n\t\t\t\tlabelClasses.push('bold');\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, options?.supportIcons);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\t// Determine supportIcons: use option if provided, otherwise use constructor value\n\t\tconst supportIcons = options?.supportIcons ?? this.supportIcons;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\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 './iconlabel.css';\nimport * as dom from '../../dom.js';\nimport * as css from '../../cssValue.js';\nimport { HighlightedLabel } from '../highlightedlabel/highlightedLabel.js';\nimport { IHoverDelegate } from '../hover/hoverDelegate.js';\nimport { IMatch } from '../../../common/filters.js';\nimport { Disposable, IDisposable } from '../../../common/lifecycle.js';\nimport { equals } from '../../../common/objects.js';\nimport { Range } from '../../../common/range.js';\nimport { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';\nimport { IManagedHoverTooltipMarkdownString } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport { URI } from '../../../common/uri.js';\n\nexport interface IIconLabelCreationOptions {\n\treadonly supportHighlights?: boolean;\n\treadonly supportDescriptionHighlights?: boolean;\n\treadonly supportIcons?: boolean;\n\treadonly hoverDelegate?: IHoverDelegate;\n\treadonly hoverTargetOverride?: HTMLElement;\n}\n\nexport interface IIconLabelValueOptions {\n\ttitle?: string | IManagedHoverTooltipMarkdownString;\n\tdescriptionTitle?: string | IManagedHoverTooltipMarkdownString;\n\tsuffix?: string;\n\textraClasses?: readonly string[];\n\tbold?: boolean;\n\titalic?: boolean;\n\tstrikethrough?: boolean;\n\tmatches?: readonly IMatch[];\n\tlabelEscapeNewLines?: boolean;\n\tdescriptionMatches?: readonly IMatch[];\n\tdisabledCommand?: boolean;\n\treadonly separator?: string;\n\treadonly domId?: string;\n\ticonPath?: URI;\n\tsupportIcons?: boolean;\n}\n\nclass FastLabelNode {\n\tprivate disposed: boolean | undefined;\n\tprivate _textContent: string | undefined;\n\tprivate _classNames: string[] | undefined;\n\tprivate _empty: boolean | undefined;\n\n\tconstructor(private _element: HTMLElement) {\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this._element;\n\t}\n\n\tset textContent(content: string) {\n\t\tif (this.disposed || content === this._textContent) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._textContent = content;\n\t\tthis._element.textContent = content;\n\t}\n\n\tset classNames(classNames: string[]) {\n\t\tif (this.disposed || equals(classNames, this._classNames)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._classNames = classNames;\n\t\tthis._element.classList.value = '';\n\t\tthis._element.classList.add(...classNames);\n\t}\n\n\tset empty(empty: boolean) {\n\t\tif (this.disposed || empty === this._empty) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._empty = empty;\n\t\tthis._element.style.marginLeft = empty ? '0' : '';\n\t}\n\n\tdispose(): void {\n\t\tthis.disposed = true;\n\t}\n}\n\nexport class IconLabel extends Disposable {\n\n\tprivate readonly creationOptions?: IIconLabelCreationOptions;\n\n\tprivate readonly domNode: FastLabelNode;\n\tprivate readonly nameContainer: HTMLElement;\n\tprivate readonly nameNode: Label | LabelWithHighlights;\n\n\tprivate descriptionNode: FastLabelNode | HighlightedLabel | undefined;\n\tprivate suffixNode: FastLabelNode | undefined;\n\n\tprivate readonly labelContainer: HTMLElement;\n\n\tprivate readonly hoverDelegate: IHoverDelegate;\n\tprivate readonly customHovers: Map<HTMLElement, IDisposable> = new Map();\n\n\tconstructor(container: HTMLElement, options?: IIconLabelCreationOptions) {\n\t\tsuper();\n\t\tthis.creationOptions = options;\n\n\t\tthis.domNode = this._register(new FastLabelNode(dom.append(container, dom.$('.monaco-icon-label'))));\n\n\t\tthis.labelContainer = dom.append(this.domNode.element, dom.$('.monaco-icon-label-container'));\n\n\t\tthis.nameContainer = dom.append(this.labelContainer, dom.$('span.monaco-icon-name-container'));\n\n\t\tif (options?.supportHighlights || options?.supportIcons) {\n\t\t\tthis.nameNode = this._register(new LabelWithHighlights(this.nameContainer, !!options.supportIcons));\n\t\t} else {\n\t\t\tthis.nameNode = new Label(this.nameContainer);\n\t\t}\n\n\t\tthis.hoverDelegate = options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');\n\t}\n\n\tget element(): HTMLElement {\n\t\treturn this.domNode.element;\n\t}\n\n\tsetLabel(label: string | string[], description?: string, options?: IIconLabelValueOptions): void {\n\t\tconst labelClasses = ['monaco-icon-label'];\n\t\tconst containerClasses = ['monaco-icon-label-container'];\n\t\tlet ariaLabel: string = '';\n\t\tif (options) {\n\t\t\tif (options.extraClasses) {\n\t\t\t\tlabelClasses.push(...options.extraClasses);\n\t\t\t}\n\n\t\t\tif (options.bold) {\n\t\t\t\tlabelClasses.push('bold');\n\t\t\t}\n\n\t\t\tif (options.italic) {\n\t\t\t\tlabelClasses.push('italic');\n\t\t\t}\n\n\t\t\tif (options.strikethrough) {\n\t\t\t\tlabelClasses.push('strikethrough');\n\t\t\t}\n\n\t\t\tif (options.disabledCommand) {\n\t\t\t\tcontainerClasses.push('disabled');\n\t\t\t}\n\t\t\tif (options.title) {\n\t\t\t\tif (typeof options.title === 'string') {\n\t\t\t\t\tariaLabel += options.title;\n\t\t\t\t} else {\n\t\t\t\t\tariaLabel += label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst existingIconNode = this.domNode.element.querySelector('.monaco-icon-label-iconpath');\n\t\tif (options?.iconPath) {\n\t\t\tlet iconNode;\n\t\t\tif (!existingIconNode || !(dom.isHTMLElement(existingIconNode))) {\n\t\t\t\ticonNode = dom.$('.monaco-icon-label-iconpath');\n\t\t\t\tthis.domNode.element.prepend(iconNode);\n\t\t\t} else {\n\t\t\t\ticonNode = existingIconNode;\n\t\t\t}\n\t\t\ticonNode.style.backgroundImage = css.asCSSUrl(options?.iconPath);\n\t\t\ticonNode.style.backgroundRepeat = 'no-repeat';\n\t\t\ticonNode.style.backgroundPosition = 'center';\n\t\t\ticonNode.style.backgroundSize = 'contain';\n\n\t\t} else if (existingIconNode) {\n\t\t\texistingIconNode.remove();\n\t\t}\n\n\t\tthis.domNode.classNames = labelClasses;\n\t\tthis.domNode.element.setAttribute('aria-label', ariaLabel);\n\t\tthis.labelContainer.classList.value = '';\n\t\tthis.labelContainer.classList.add(...containerClasses);\n\t\tthis.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title);\n\n\t\tthis.nameNode.setLabel(label, options);\n\n\t\tif (description || this.descriptionNode) {\n\t\t\tconst descriptionNode = this.getOrCreateDescriptionNode();\n\t\t\tif (descriptionNode instanceof HighlightedLabel) {\n\t\t\t\tdescriptionNode.set(description || '', options ? options.descriptionMatches : undefined, undefined, options?.labelEscapeNewLines, options?.supportIcons);\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle);\n\t\t\t} else {\n\t\t\t\tdescriptionNode.textContent = description && options?.labelEscapeNewLines ? HighlightedLabel.escapeNewLines(description, []) : (description || '');\n\t\t\t\tthis.setupHover(descriptionNode.element, options?.descriptionTitle || '');\n\t\t\t\tdescriptionNode.empty = !description;\n\t\t\t}\n\t\t}\n\n\t\tif (options?.suffix || this.suffixNode) {\n\t\t\tconst suffixNode = this.getOrCreateSuffixNode();\n\t\t\tsuffixNode.textContent = options?.suffix ?? '';\n\t\t}\n\t}\n\n\tprivate setupHover(htmlElement: HTMLElement, tooltip: string | IManagedHoverTooltipMarkdownString | undefined): void {\n\t\tconst previousCustomHover = this.customHovers.get(htmlElement);\n\t\tif (previousCustomHover) {\n\t\t\tpreviousCustomHover.dispose();\n\t\t\tthis.customHovers.delete(htmlElement);\n\t\t}\n\n\t\tif (!tooltip) {\n\t\t\thtmlElement.removeAttribute('title');\n\t\t\treturn;\n\t\t}\n\n\t\tlet hoverTarget = htmlElement;\n\t\tif (this.creationOptions?.hoverTargetOverride) {\n\t\t\tif (!dom.isAncestor(htmlElement, this.creationOptions.hoverTargetOverride)) {\n\t\t\t\tthrow new Error('hoverTargetOverrride must be an ancestor of the htmlElement');\n\t\t\t}\n\t\t\thoverTarget = this.creationOptions.hoverTargetOverride;\n\t\t}\n\n\t\tconst hoverDisposable = getBaseLayerHoverDelegate().setupManagedHover(this.hoverDelegate, hoverTarget, tooltip);\n\t\tif (hoverDisposable) {\n\t\t\tthis.customHovers.set(htmlElement, hoverDisposable);\n\t\t}\n\t}\n\n\tpublic override dispose() {\n\t\tsuper.dispose();\n\t\tfor (const disposable of this.customHovers.values()) {\n\t\t\tdisposable.dispose();\n\t\t}\n\t\tthis.customHovers.clear();\n\t}\n\n\tprivate getOrCreateSuffixNode() {\n\t\tif (!this.suffixNode) {\n\t\t\tconst suffixContainer = this._register(new FastLabelNode(dom.after(this.nameContainer, dom.$('span.monaco-icon-suffix-container'))));\n\t\t\tthis.suffixNode = this._register(new FastLabelNode(dom.append(suffixContainer.element, dom.$('span.label-suffix'))));\n\t\t}\n\n\t\treturn this.suffixNode;\n\t}\n\n\tprivate getOrCreateDescriptionNode() {\n\t\tif (!this.descriptionNode) {\n\t\t\tconst descriptionContainer = this._register(new FastLabelNode(dom.append(this.labelContainer, dom.$('span.monaco-icon-description-container'))));\n\t\t\tif (this.creationOptions?.supportDescriptionHighlights) {\n\t\t\t\tthis.descriptionNode = this._register(new HighlightedLabel(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t} else {\n\t\t\t\tthis.descriptionNode = this._register(new FastLabelNode(dom.append(descriptionContainer.element, dom.$('span.label-description'))));\n\t\t\t}\n\t\t}\n\n\t\treturn this.descriptionNode;\n\t}\n}\n\nclass Label {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HTMLElement | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement) { }\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = dom.append(this.container, dom.$('a.label-name', { id: options?.domId }));\n\t\t\t}\n\n\t\t\tthis.singleLabel.textContent = label;\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tdom.append(this.container, dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' }, l));\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(this.container, dom.$('span.label-separator', undefined, options?.separator || '/'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction splitMatches(labels: string[], separator: string, matches: readonly IMatch[] | undefined): IMatch[][] | undefined {\n\tif (!matches) {\n\t\treturn undefined;\n\t}\n\n\tlet labelStart = 0;\n\n\treturn labels.map(label => {\n\t\tconst labelRange = { start: labelStart, end: labelStart + label.length };\n\n\t\tconst result = matches\n\t\t\t.map(match => Range.intersect(labelRange, match))\n\t\t\t.filter(range => !Range.isEmpty(range))\n\t\t\t.map(({ start, end }) => ({ start: start - labelStart, end: end - labelStart }));\n\n\t\tlabelStart = labelRange.end + separator.length;\n\t\treturn result;\n\t});\n}\n\nclass LabelWithHighlights extends Disposable {\n\n\tprivate label: string | string[] | undefined = undefined;\n\tprivate singleLabel: HighlightedLabel | undefined = undefined;\n\tprivate options: IIconLabelValueOptions | undefined;\n\n\tconstructor(private container: HTMLElement, private supportIcons: boolean) {\n\t\tsuper();\n\t}\n\n\tsetLabel(label: string | string[], options?: IIconLabelValueOptions): void {\n\t\tif (this.label === label && equals(this.options, options)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.label = label;\n\t\tthis.options = options;\n\n\t\t// Determine supportIcons: use option if provided, otherwise use constructor value\n\t\tconst supportIcons = options?.supportIcons ?? this.supportIcons;\n\n\t\tif (typeof label === 'string') {\n\t\t\tif (!this.singleLabel) {\n\t\t\t\tthis.container.textContent = '';\n\t\t\t\tthis.container.classList.remove('multiple');\n\t\t\t\tthis.singleLabel = this._register(new HighlightedLabel(dom.append(this.container, dom.$('a.label-name', { id: options?.domId }))));\n\t\t\t}\n\n\t\t\tthis.singleLabel.set(label, options?.matches, undefined, options?.labelEscapeNewLines, supportIcons);\n\t\t} else {\n\t\t\tthis.container.textContent = '';\n\t\t\tthis.container.classList.add('multiple');\n\t\t\tthis.singleLabel = undefined;\n\n\t\t\tconst separator = options?.separator || '/';\n\t\t\tconst matches = splitMatches(label, separator, options?.matches);\n\n\t\t\tfor (let i = 0; i < label.length; i++) {\n\t\t\t\tconst l = label[i];\n\t\t\t\tconst m = matches ? matches[i] : undefined;\n\t\t\t\tconst id = options?.domId && `${options?.domId}_${i}`;\n\n\t\t\t\tconst name = dom.$('a.label-name', { id, 'data-icon-label-count': label.length, 'data-icon-label-index': i, 'role': 'treeitem' });\n\t\t\t\tconst highlightedLabel = this._register(new HighlightedLabel(dom.append(this.container, name)));\n\t\t\t\thighlightedLabel.set(l, m, undefined, options?.labelEscapeNewLines, supportIcons);\n\n\t\t\t\tif (i < label.length - 1) {\n\t\t\t\t\tdom.append(name, dom.$('span.label-separator', undefined, separator));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -46,8 +46,6 @@
|
|
|
46
46
|
overflow: hidden;
|
|
47
47
|
text-overflow: ellipsis;
|
|
48
48
|
flex: 1;
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
.monaco-icon-label > .monaco-icon-label-container > .monaco-icon-name-container > .label-name {
|
|
@@ -80,6 +78,11 @@
|
|
|
80
78
|
opacity: .95;
|
|
81
79
|
}
|
|
82
80
|
|
|
81
|
+
.monaco-icon-label.bold > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,
|
|
82
|
+
.monaco-icon-label.bold > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}
|
|
85
|
+
|
|
83
86
|
.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-name-container > .label-name,
|
|
84
87
|
.monaco-icon-label.italic > .monaco-icon-label-container > .monaco-icon-description-container > .label-description {
|
|
85
88
|
font-style: italic;
|
|
@@ -628,5 +628,8 @@ export const codiconsLibrary = {
|
|
|
628
628
|
indexZero: register('index-zero', 0xec66),
|
|
629
629
|
agent: register('agent', 0xec67),
|
|
630
630
|
editCode: register('edit-code', 0xec68),
|
|
631
|
+
repoSelected: register('repo-selected', 0xec69),
|
|
632
|
+
skip: register('skip', 0xec6a),
|
|
633
|
+
mergeInto: register('merge-into', 0xec6b),
|
|
631
634
|
};
|
|
632
635
|
//# sourceMappingURL=codiconsLibrary.js.map
|