chrome-devtools-frontend 1.0.1555174 → 1.0.1555430
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/front_end/core/protocol_client/InspectorBackend.ts +1 -1
- package/front_end/core/root/Runtime.ts +0 -4
- package/front_end/core/sdk/DOMModel.ts +101 -7
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -1
- package/front_end/{ui/components → models}/annotations/AnnotationRepository.ts +3 -3
- package/front_end/models/annotations/README.md +7 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/stack_trace/StackTrace.ts +13 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +81 -6
- package/front_end/models/stack_trace/StackTraceModel.ts +35 -3
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +45 -4
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +57 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +1 -0
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +10 -0
- package/front_end/panels/application/preloading/PreloadingView.ts +12 -6
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +230 -237
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +96 -79
- package/front_end/panels/application/preloading/components/preloadingGrid.css +26 -29
- package/front_end/panels/application/preloading/preloadingView.css +6 -0
- package/front_end/panels/common/Annotation.ts +1 -1
- package/front_end/panels/common/AnnotationManager.ts +1 -1
- package/front_end/panels/common/ExtensionView.ts +1 -0
- package/front_end/panels/console/ConsoleContextSelector.ts +74 -9
- package/front_end/panels/console/consoleContextSelector.css +31 -29
- package/front_end/panels/coverage/coverageListView.css +59 -57
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +39 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +23 -21
- package/front_end/panels/elements/TopLayerContainer.ts +26 -91
- package/front_end/panels/explain/components/ConsoleInsight.ts +3 -3
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/recorder/RecorderController.ts +0 -1
- package/front_end/panels/security/SecurityPanelSidebar.ts +5 -0
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -8
- package/front_end/panels/timeline/components/TimelineSummary.ts +75 -54
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +16 -25
- package/front_end/panels/timeline/components/insights/Cache.ts +12 -8
- package/front_end/panels/timeline/components/insights/DOMSize.ts +25 -21
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +7 -7
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +7 -5
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +11 -9
- package/front_end/panels/timeline/components/insights/INPBreakdown.ts +7 -6
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +7 -5
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +20 -18
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +12 -12
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +7 -7
- package/front_end/panels/timeline/components/insights/ModernHTTP.ts +7 -5
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +15 -13
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +2 -2
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +15 -14
- package/front_end/panels/timeline/components/insights/Table.ts +152 -130
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +11 -9
- package/front_end/panels/timeline/components/timelineSummary.css +58 -57
- package/front_end/panels/timeline/thirdPartyTreeView.css +109 -0
- package/front_end/panels/timeline/timelineDetailsView.css +2 -4
- package/front_end/panels/timeline/timelinePanel.css +0 -110
- package/front_end/ui/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/ViewManager.ts +2 -32
- package/package.json +1 -1
- /package/front_end/{ui/components → models}/annotations/AnnotationType.ts +0 -0
- /package/front_end/{ui/components → models}/annotations/annotations.ts +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2022 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
4
|
|
|
6
5
|
import '../../../../ui/legacy/components/data_grid/data_grid.js';
|
|
7
6
|
import '../../../../ui/kit/kit.js';
|
|
@@ -11,8 +10,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
11
10
|
import type * as Platform from '../../../../core/platform/platform.js';
|
|
12
11
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
13
12
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
14
|
-
import * as
|
|
15
|
-
import type * as UI from '../../../../ui/legacy/legacy.js';
|
|
13
|
+
import * as UI from '../../../../ui/legacy/legacy.js';
|
|
16
14
|
import * as Lit from '../../../../ui/lit/lit.js';
|
|
17
15
|
|
|
18
16
|
import preloadingGridStyles from './preloadingGrid.css.js';
|
|
@@ -41,11 +39,12 @@ const UIStrings = {
|
|
|
41
39
|
const str_ = i18n.i18n.registerUIStrings('panels/application/preloading/components/PreloadingGrid.ts', UIStrings);
|
|
42
40
|
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
43
41
|
|
|
44
|
-
const {render, html, Directives: {styleMap}} = Lit;
|
|
42
|
+
const {render, html, nothing, Directives: {styleMap}} = Lit;
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
// Shorten URL if a preloading attempt is same-origin.
|
|
45
|
+
function urlShort(row: PreloadingGridRow, securityOrigin: string|null): string {
|
|
46
|
+
const url = row.pipeline.getOriginallyTriggered().key.url;
|
|
47
|
+
return securityOrigin && url.startsWith(securityOrigin) ? url.slice(securityOrigin.length) : url;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
export interface PreloadingGridRow {
|
|
@@ -54,87 +53,105 @@ export interface PreloadingGridRow {
|
|
|
54
53
|
ruleSets: Protocol.Preload.RuleSet[];
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
export interface ViewInput {
|
|
57
|
+
rows?: PreloadingGridRow[];
|
|
58
|
+
pageURL?: Platform.DevToolsPath.UrlString;
|
|
59
|
+
onSelect?: ({rowId}: {rowId: string}) => void;
|
|
60
|
+
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
63
|
+
|
|
64
|
+
export const PRELOADING_GRID_DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
65
|
+
if (!input.rows || input.pageURL === undefined) {
|
|
66
|
+
render(nothing, target);
|
|
67
|
+
return;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
const {rows, pageURL} = input;
|
|
71
|
+
const securityOrigin = pageURL === '' ? null : (new Common.ParsedURL.ParsedURL(pageURL)).securityOrigin();
|
|
72
|
+
|
|
73
|
+
// Disabled until https://crbug.com/1079231 is fixed.
|
|
74
|
+
// clang-format off
|
|
75
|
+
render(html`
|
|
76
|
+
<style>${preloadingGridStyles}</style>
|
|
77
|
+
<div class="preloading-container">
|
|
78
|
+
<devtools-data-grid striped>
|
|
79
|
+
<table>
|
|
80
|
+
<tr>
|
|
81
|
+
<th id="url" weight="40" sortable>${i18n.i18n.lockedString('URL')}</th>
|
|
82
|
+
<th id="action" weight="15" sortable>${i18nString(UIStrings.action)}</th>
|
|
83
|
+
<th id="rule-set" weight="20" sortable>${i18nString(UIStrings.ruleSet)}</th>
|
|
84
|
+
<th id="status" weight="40" sortable>${i18nString(UIStrings.status)}</th>
|
|
85
|
+
</tr>
|
|
86
|
+
${rows.map(row => {
|
|
87
|
+
const attempt = row.pipeline.getOriginallyTriggered();
|
|
88
|
+
const prefetchStatus = row.pipeline.getPrefetch()?.status;
|
|
89
|
+
const prerenderStatus = row.pipeline.getPrerender()?.status;
|
|
90
|
+
const hasWarning =
|
|
91
|
+
(prerenderStatus === PreloadingStatus.FAILURE &&
|
|
92
|
+
(prefetchStatus === PreloadingStatus.READY || prefetchStatus === PreloadingStatus.SUCCESS));
|
|
93
|
+
const hasError = row.pipeline.getOriginallyTriggered().status === PreloadingStatus.FAILURE;
|
|
94
|
+
return html`<tr @select=${() => input.onSelect?.({rowId: row.id})}>
|
|
95
|
+
<td title=${attempt.key.url}>${urlShort(row, securityOrigin)}</td>
|
|
96
|
+
<td>${capitalizedAction(attempt.action)}</td>
|
|
97
|
+
<td>${row.ruleSets.length === 0 ? '' : ruleSetTagOrLocationShort(row.ruleSets[0], pageURL)}</td>
|
|
98
|
+
<td data-value=${sortOrder(attempt)}>
|
|
99
|
+
<div style=${styleMap({color: hasWarning ? 'var(--sys-color-orange-bright)'
|
|
100
|
+
: hasError ? 'var(--sys-color-error)'
|
|
101
|
+
: 'var(--sys-color-on-surface)'})}>
|
|
102
|
+
${(hasError || hasWarning) ? html`
|
|
103
|
+
<devtools-icon
|
|
104
|
+
name=${hasWarning ? 'warning-filled' : 'cross-circle-filled'}
|
|
105
|
+
class='medium'
|
|
106
|
+
style=${styleMap({
|
|
107
|
+
'vertical-align': 'sub',
|
|
108
|
+
})}
|
|
109
|
+
></devtools-icon>` : ''}
|
|
110
|
+
${hasWarning ? i18nString(UIStrings.prefetchFallbackReady) : composedStatus(attempt)}
|
|
111
|
+
</div>
|
|
112
|
+
</td>
|
|
113
|
+
</tr>`;
|
|
114
|
+
})}
|
|
115
|
+
</table>
|
|
116
|
+
</devtools-data-grid>
|
|
117
|
+
</div>
|
|
118
|
+
`, target);
|
|
119
|
+
}; // clang-format on
|
|
120
|
+
|
|
121
|
+
/** Grid component to show prerendering attempts. **/
|
|
122
|
+
export class PreloadingGrid extends UI.Widget.VBox {
|
|
123
|
+
#view: View;
|
|
124
|
+
#rows?: PreloadingGridRow[];
|
|
125
|
+
#pageURL?: Platform.DevToolsPath.UrlString;
|
|
126
|
+
#onSelect?: ({rowId}: {rowId: string}) => void;
|
|
127
|
+
|
|
128
|
+
constructor(view?: View) {
|
|
129
|
+
super();
|
|
130
|
+
this.#view = view ?? PRELOADING_GRID_DEFAULT_VIEW;
|
|
131
|
+
this.requestUpdate();
|
|
69
132
|
}
|
|
70
133
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
const {rows, pageURL} = this.#data;
|
|
76
|
-
const securityOrigin = pageURL === '' ? null : (new Common.ParsedURL.ParsedURL(pageURL)).securityOrigin();
|
|
77
|
-
|
|
78
|
-
// Disabled until https://crbug.com/1079231 is fixed.
|
|
79
|
-
// clang-format off
|
|
80
|
-
render(html`
|
|
81
|
-
<style>${preloadingGridStyles}</style>
|
|
82
|
-
<div class="preloading-container">
|
|
83
|
-
<devtools-data-grid striped>
|
|
84
|
-
<table>
|
|
85
|
-
<tr>
|
|
86
|
-
<th id="url" weight="40" sortable>${i18n.i18n.lockedString('URL')}</th>
|
|
87
|
-
<th id="action" weight="15" sortable>${i18nString(UIStrings.action)}</th>
|
|
88
|
-
<th id="rule-set" weight="20" sortable>${i18nString(UIStrings.ruleSet)}</th>
|
|
89
|
-
<th id="status" weight="40" sortable>${i18nString(UIStrings.status)}</th>
|
|
90
|
-
</tr>
|
|
91
|
-
${rows.map(row => {
|
|
92
|
-
const attempt = row.pipeline.getOriginallyTriggered();
|
|
93
|
-
const prefetchStatus = row.pipeline.getPrefetch()?.status;
|
|
94
|
-
const prerenderStatus = row.pipeline.getPrerender()?.status;
|
|
95
|
-
const hasWarning =
|
|
96
|
-
(prerenderStatus === PreloadingStatus.FAILURE &&
|
|
97
|
-
(prefetchStatus === PreloadingStatus.READY || prefetchStatus === PreloadingStatus.SUCCESS));
|
|
98
|
-
const hasError = row.pipeline.getOriginallyTriggered().status === PreloadingStatus.FAILURE;
|
|
99
|
-
return html`<tr @select=${() => this.dispatchEvent(new CustomEvent('select', {detail: row.id}))}>
|
|
100
|
-
<td title=${attempt.key.url}>${this.#urlShort(row, securityOrigin)}</td>
|
|
101
|
-
<td>${capitalizedAction(attempt.action)}</td>
|
|
102
|
-
<td>${row.ruleSets.length === 0 ? '' : ruleSetTagOrLocationShort(row.ruleSets[0], pageURL)}</td>
|
|
103
|
-
<td data-value=${sortOrder(attempt)}>
|
|
104
|
-
<div style=${styleMap({color: hasWarning ? 'var(--sys-color-orange-bright)'
|
|
105
|
-
: hasError ? 'var(--sys-color-error)'
|
|
106
|
-
: 'var(--sys-color-on-surface)'})}>
|
|
107
|
-
${(hasError || hasWarning) ? html`
|
|
108
|
-
<devtools-icon
|
|
109
|
-
name=${hasWarning ? 'warning-filled' : 'cross-circle-filled'}
|
|
110
|
-
class='medium'
|
|
111
|
-
style=${styleMap({
|
|
112
|
-
'vertical-align': 'sub',
|
|
113
|
-
})}
|
|
114
|
-
></devtools-icon>` : ''}
|
|
115
|
-
${hasWarning ? i18nString(UIStrings.prefetchFallbackReady) : composedStatus(attempt)}
|
|
116
|
-
</div>
|
|
117
|
-
</td>
|
|
118
|
-
</tr>`;
|
|
119
|
-
})}
|
|
120
|
-
</table>
|
|
121
|
-
</devtools-data-grid>
|
|
122
|
-
</div>
|
|
123
|
-
`, this.#shadow, {host: this});
|
|
124
|
-
// clang-format on
|
|
134
|
+
set rows(rows: PreloadingGridRow[]) {
|
|
135
|
+
this.#rows = rows;
|
|
136
|
+
this.requestUpdate();
|
|
125
137
|
}
|
|
126
138
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return securityOrigin && url.startsWith(securityOrigin) ? url.slice(securityOrigin.length) : url;
|
|
139
|
+
set pageURL(pageURL: Platform.DevToolsPath.UrlString) {
|
|
140
|
+
this.#pageURL = pageURL;
|
|
141
|
+
this.requestUpdate();
|
|
131
142
|
}
|
|
132
|
-
}
|
|
133
143
|
|
|
134
|
-
|
|
144
|
+
set onSelect(onSelect: ({rowId}: {rowId: string}) => void) {
|
|
145
|
+
this.#onSelect = onSelect;
|
|
146
|
+
this.requestUpdate();
|
|
147
|
+
}
|
|
135
148
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
149
|
+
override performUpdate(): void {
|
|
150
|
+
const viewInput: ViewInput = {
|
|
151
|
+
rows: this.#rows,
|
|
152
|
+
pageURL: this.#pageURL,
|
|
153
|
+
onSelect: this.#onSelect?.bind(this),
|
|
154
|
+
};
|
|
155
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
139
156
|
}
|
|
140
157
|
}
|
|
@@ -3,37 +3,34 @@
|
|
|
3
3
|
* Use of this source code is governed by a BSD-style license that can be
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
+
@scope to (devtools-widget > *){
|
|
7
|
+
.preloading-container {
|
|
8
|
+
overflow: auto;
|
|
9
|
+
height: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.preloading-container {
|
|
13
|
-
height: 100%;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
}
|
|
13
|
+
devtools-data-grid {
|
|
14
|
+
flex: auto;
|
|
15
|
+
}
|
|
17
16
|
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
17
|
+
.inline-icon {
|
|
18
|
+
vertical-align: text-bottom;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
23
21
|
|
|
24
|
-
.preloading-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
font-size: 13px;
|
|
30
|
-
color: var(--sys-color-token-subtle);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
devtools-data-grid {
|
|
34
|
-
flex: auto;
|
|
35
|
-
}
|
|
22
|
+
.preloading-header {
|
|
23
|
+
font-size: 15px;
|
|
24
|
+
background-color: var(--sys-color-cdt-base-container);
|
|
25
|
+
padding: 1px 4px;
|
|
26
|
+
}
|
|
36
27
|
|
|
37
|
-
.
|
|
38
|
-
|
|
28
|
+
.preloading-placeholder {
|
|
29
|
+
flex-grow: 1;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
font-size: 13px;
|
|
34
|
+
color: var(--sys-color-token-subtle);
|
|
35
|
+
}
|
|
39
36
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
5
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
6
|
|
|
7
|
-
import * as Annotations from '../../
|
|
7
|
+
import * as Annotations from '../../models/annotations/annotations.js';
|
|
8
8
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
9
|
import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
|
|
10
10
|
import {html, nothing, render} from '../../ui/lit/lit.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as Common from '../../core/common/common.js';
|
|
6
6
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
7
|
-
import * as Annotations from '../../
|
|
7
|
+
import * as Annotations from '../../models/annotations/annotations.js';
|
|
8
8
|
|
|
9
9
|
import {Annotation} from './Annotation.js';
|
|
10
10
|
|
|
@@ -25,6 +25,7 @@ const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement)
|
|
|
25
25
|
render(html`<iframe
|
|
26
26
|
${ref(element => {output.iframe = element as HTMLIFrameElement; })}
|
|
27
27
|
src=${input.src}
|
|
28
|
+
allow="language-model; summarizer; translator; language-detector; writer; rewriter; proofreader; clipboard-write; autoplay"
|
|
28
29
|
class=${input.className}
|
|
29
30
|
@load=${input.onLoad}></iframe>`, target);
|
|
30
31
|
// clang-format on
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// Copyright 2015 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
import * as Common from '../../core/common/common.js';
|
|
7
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
7
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
11
11
|
|
|
12
12
|
import consoleContextSelectorStyles from './consoleContextSelector.css.js';
|
|
13
13
|
|
|
14
|
+
const {render, nothing, html} = Lit;
|
|
14
15
|
const UIStrings = {
|
|
15
16
|
/**
|
|
16
17
|
* @description Title of toolbar item in console context selector of the console panel
|
|
@@ -211,14 +212,12 @@ export class ConsoleContextSelector implements SDK.TargetManager.SDKModelObserve
|
|
|
211
212
|
}
|
|
212
213
|
|
|
213
214
|
createElementForItem(item: SDK.RuntimeModel.ExecutionContext): Element {
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
element.style.paddingLeft = (8 + this.depthFor(item) * 15) + 'px';
|
|
221
|
-
return element;
|
|
215
|
+
const consoleContextSelectorElement = new ConsoleContextSelectorElement();
|
|
216
|
+
consoleContextSelectorElement.title = this.titleFor(item);
|
|
217
|
+
consoleContextSelectorElement.subtitle = this.subtitleFor(item);
|
|
218
|
+
consoleContextSelectorElement.itemDepth = this.depthFor(item);
|
|
219
|
+
consoleContextSelectorElement.markAsRoot();
|
|
220
|
+
return consoleContextSelectorElement.contentElement;
|
|
222
221
|
}
|
|
223
222
|
|
|
224
223
|
private subtitleFor(executionContext: SDK.RuntimeModel.ExecutionContext): string {
|
|
@@ -293,3 +292,69 @@ export class ConsoleContextSelector implements SDK.TargetManager.SDKModelObserve
|
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
294
|
}
|
|
295
|
+
|
|
296
|
+
interface ViewInput {
|
|
297
|
+
title?: string;
|
|
298
|
+
subtitle?: string;
|
|
299
|
+
itemDepth?: number;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
303
|
+
|
|
304
|
+
const DEFAULT_VIEW: View = (input, _output, target): void => {
|
|
305
|
+
if (!input.title || !input.subtitle) {
|
|
306
|
+
render(nothing, target);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const paddingLeft = input.itemDepth ? (8 + input.itemDepth * 15) + 'px' : undefined;
|
|
311
|
+
|
|
312
|
+
// clang-format off
|
|
313
|
+
render(
|
|
314
|
+
html`
|
|
315
|
+
<style>${consoleContextSelectorStyles}</style>
|
|
316
|
+
<div class="console-context-selector-element" style="padding-left: ${paddingLeft};">
|
|
317
|
+
<div class="title">${Platform.StringUtilities.trimEndWithMaxLength(input.title, 100)}</div>
|
|
318
|
+
<div class="subtitle">${input.subtitle}</div>
|
|
319
|
+
</div>
|
|
320
|
+
`,
|
|
321
|
+
target);
|
|
322
|
+
// clang-format on
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export class ConsoleContextSelectorElement extends UI.Widget.Widget {
|
|
326
|
+
#view: View;
|
|
327
|
+
#title?: string;
|
|
328
|
+
#subtitle?: string;
|
|
329
|
+
#itemDepth?: number;
|
|
330
|
+
|
|
331
|
+
constructor(element?: HTMLElement, view?: View) {
|
|
332
|
+
super(element, {useShadowDom: true});
|
|
333
|
+
this.#view = view ?? DEFAULT_VIEW;
|
|
334
|
+
this.requestUpdate();
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
set title(title: string) {
|
|
338
|
+
this.#title = title;
|
|
339
|
+
this.requestUpdate();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
set subtitle(subtitle: string) {
|
|
343
|
+
this.#subtitle = subtitle;
|
|
344
|
+
this.requestUpdate();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
set itemDepth(itemDepth: number) {
|
|
348
|
+
this.#itemDepth = itemDepth;
|
|
349
|
+
this.requestUpdate();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
override async performUpdate(): Promise<void> {
|
|
353
|
+
const viewInput: ViewInput = {
|
|
354
|
+
title: this.#title,
|
|
355
|
+
subtitle: this.#subtitle,
|
|
356
|
+
itemDepth: this.#itemDepth,
|
|
357
|
+
};
|
|
358
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
@@ -4,37 +4,39 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
.widget {
|
|
8
|
+
.console-context-selector-element{
|
|
9
|
+
padding: 2px 1px 2px 2px;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
height: 36px;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
overflow-y: auto;
|
|
16
16
|
|
|
17
|
-
.title {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
.title {
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
flex-grow: 0;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
.subtitle {
|
|
24
|
+
color: var(--sys-color-token-subtle);
|
|
25
|
+
margin-right: 3px;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
text-overflow: ellipsis;
|
|
28
|
+
flex-grow: 0;
|
|
29
|
+
}
|
|
29
30
|
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
31
|
+
.badge {
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
margin-right: 4px;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
height: 15px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
&.highlighted .console-context-selector-element .subtitle {
|
|
40
|
+
color: inherit;
|
|
41
|
+
}
|
|
40
42
|
}
|
|
@@ -4,80 +4,82 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.data-grid td .url-outer {
|
|
12
|
-
width: 100%;
|
|
13
|
-
display: inline-flex;
|
|
14
|
-
justify-content: flex-start;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.data-grid td .url-outer .filter-highlight {
|
|
18
|
-
font-weight: bold;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.data-grid td .url-prefix {
|
|
22
|
-
overflow-x: hidden;
|
|
23
|
-
text-overflow: ellipsis;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.data-grid td .url-suffix {
|
|
27
|
-
flex: none;
|
|
28
|
-
}
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
.data-grid {
|
|
9
|
+
border: none;
|
|
10
|
+
}
|
|
29
11
|
|
|
30
|
-
.data-grid td .
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
12
|
+
.data-grid td .url-outer {
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
justify-content: flex-start;
|
|
16
|
+
}
|
|
35
17
|
|
|
36
|
-
.data-grid td .
|
|
37
|
-
|
|
38
|
-
}
|
|
18
|
+
.data-grid td .url-outer .filter-highlight {
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
}
|
|
39
21
|
|
|
40
|
-
.data-grid td .
|
|
41
|
-
|
|
42
|
-
|
|
22
|
+
.data-grid td .url-prefix {
|
|
23
|
+
overflow-x: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
}
|
|
43
26
|
|
|
44
|
-
.data-grid td .
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color: var(--sys-color-on-surface-subtle);
|
|
48
|
-
}
|
|
27
|
+
.data-grid td .url-suffix {
|
|
28
|
+
flex: none;
|
|
29
|
+
}
|
|
49
30
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
31
|
+
.data-grid td .bar {
|
|
32
|
+
display: inline-block;
|
|
33
|
+
height: 8px;
|
|
34
|
+
border: 1px solid transparent;
|
|
53
35
|
}
|
|
54
36
|
|
|
55
37
|
.data-grid td .bar-unused-size {
|
|
56
|
-
background-color:
|
|
38
|
+
background-color: var(--app-color-coverage-unused);
|
|
57
39
|
}
|
|
58
40
|
|
|
59
41
|
.data-grid td .bar-used-size {
|
|
60
|
-
background-color:
|
|
42
|
+
background-color: var(--app-color-coverage-used);
|
|
61
43
|
}
|
|
62
44
|
|
|
63
|
-
.data-grid td .
|
|
64
|
-
|
|
45
|
+
.data-grid td .percent-value {
|
|
46
|
+
width: 7ex;
|
|
47
|
+
display: inline-block;
|
|
48
|
+
color: var(--sys-color-on-surface-subtle);
|
|
65
49
|
}
|
|
66
50
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
51
|
+
@media (forced-colors: active) {
|
|
52
|
+
.data-grid td .bar-container {
|
|
53
|
+
forced-color-adjust: none;
|
|
54
|
+
}
|
|
71
55
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
.data-grid td .bar-unused-size {
|
|
57
|
+
background-color: ButtonText;
|
|
58
|
+
}
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
.data-grid td .bar-used-size {
|
|
61
|
+
background-color: ButtonFace;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.data-grid td .bar {
|
|
65
|
+
border-color: ButtonText;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.data-grid .selected td .bar {
|
|
69
|
+
border-top-color: HighlightText;
|
|
70
|
+
border-bottom-color: HighlightText;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.data-grid .selected td .bar:last-child {
|
|
74
|
+
border-right-color: HighlightText;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.data-grid .selected td .bar:first-child {
|
|
78
|
+
border-left-color: HighlightText;
|
|
79
|
+
}
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
.data-grid:focus tr.selected span.percent-value {
|
|
82
|
+
color: HighlightText;
|
|
83
|
+
}
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -40,9 +40,9 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
40
40
|
import * as Root from '../../core/root/root.js';
|
|
41
41
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
42
42
|
import type * as Protocol from '../../generated/protocol.js';
|
|
43
|
+
import * as Annotations from '../../models/annotations/annotations.js';
|
|
43
44
|
import * as PanelCommon from '../../panels/common/common.js';
|
|
44
45
|
import type * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
45
|
-
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
46
46
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
47
47
|
import * as TreeOutline from '../../ui/components/tree_outline/tree_outline.js';
|
|
48
48
|
import * as UI from '../../ui/legacy/legacy.js';
|