chrome-devtools-frontend 1.0.925655 → 1.0.927419
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/.stylelintignore +1 -0
- package/AUTHORS +1 -0
- package/config/gni/devtools_grd_files.gni +10 -3
- package/front_end/core/common/Color.ts +6 -0
- package/front_end/core/common/SettingRegistration.ts +8 -0
- package/front_end/core/host/InspectorFrontendHost.ts +3 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +3 -0
- package/front_end/core/host/UserMetrics.ts +7 -3
- package/front_end/core/i18n/locales/en-US.json +71 -14
- package/front_end/core/i18n/locales/en-XL.json +71 -14
- package/front_end/core/platform/keyboard-utilities.ts +1 -0
- package/front_end/core/root/Runtime.ts +1 -0
- package/front_end/core/sdk/ConsoleModel.ts +3 -0
- package/front_end/core/sdk/DebuggerModel.ts +2 -0
- package/front_end/core/sdk/NetworkManager.ts +12 -2
- package/front_end/core/sdk/NetworkRequest.ts +20 -5
- package/front_end/core/sdk/OverlayModel.ts +21 -0
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +55 -3
- package/front_end/devtools_compatibility.js +11 -1
- package/front_end/entrypoints/main/MainImpl.ts +4 -2
- package/front_end/entrypoints/main/main-meta.ts +16 -0
- package/front_end/generated/InspectorBackendCommands.js +8 -7
- package/front_end/generated/SupportedCSSProperties.js +7 -1
- package/front_end/generated/protocol-mapping.d.ts +5 -24
- package/front_end/generated/protocol-proxy-api.d.ts +6 -29
- package/front_end/generated/protocol.d.ts +51 -46
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
- package/front_end/models/issues_manager/CorsIssue.ts +4 -0
- package/front_end/models/logs/LogManager.ts +1 -0
- package/front_end/models/persistence/WorkspaceSettingsTab.ts +6 -4
- package/front_end/models/persistence/workspaceSettingsTab.css +18 -18
- package/front_end/models/timeline_model/TimelineFrameModel.ts +107 -28
- package/front_end/panels/application/ReportingApiReportsView.ts +89 -0
- package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiView.ts +27 -0
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/EndpointsGrid.ts +55 -0
- package/front_end/panels/application/components/ReportsGrid.ts +144 -0
- package/front_end/panels/application/components/components.ts +4 -2
- package/front_end/panels/application/components/reportingApiGrid.css +35 -0
- package/front_end/panels/application/reportingApiReportsView.css +13 -0
- package/front_end/panels/console/ConsoleView.ts +17 -0
- package/front_end/panels/console/console-meta.ts +26 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +19 -0
- package/front_end/panels/elements/PropertiesWidget.ts +1 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +28 -0
- package/front_end/panels/elements/StylePropertyUtils.ts +13 -0
- package/front_end/panels/elements/components/nodeText.css +4 -4
- package/front_end/panels/elements/elements.ts +2 -0
- package/front_end/panels/elements/layoutPane.css +1 -1
- package/front_end/panels/issues/CorsIssueDetailsView.ts +4 -2
- package/front_end/panels/network/RequestCookiesView.ts +13 -4
- package/front_end/panels/screencast/screencastView.css +2 -6
- package/front_end/panels/search/SearchResultsPane.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +3 -0
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +1 -10
- package/front_end/panels/sources/GoToLineQuickOpen.ts +50 -10
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -13
- package/front_end/panels/sources/sources-legacy.ts +0 -11
- package/front_end/panels/sources/sources-meta.ts +22 -20
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/third_party/codemirror.next/LICENSE +21 -0
- package/front_end/third_party/codemirror.next/README.chromium +18 -0
- package/front_end/third_party/codemirror.next/bundle-tsconfig.json +21 -0
- package/front_end/third_party/codemirror.next/bundle.ts +87 -0
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -0
- package/front_end/third_party/codemirror.next/chunk/cpp.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/css.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/html.js +4 -0
- package/front_end/third_party/codemirror.next/chunk/java.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/javascript.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/json.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -0
- package/front_end/third_party/codemirror.next/chunk/markdown.js +6 -0
- package/front_end/third_party/codemirror.next/chunk/php.js +6 -0
- package/front_end/third_party/codemirror.next/chunk/python.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/wast.js +2 -0
- package/front_end/third_party/codemirror.next/chunk/xml.js +2 -0
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +5467 -0
- package/front_end/third_party/codemirror.next/codemirror.next.js +2 -0
- package/front_end/third_party/codemirror.next/package.json +39 -0
- package/front_end/third_party/codemirror.next/rebuild.sh +6 -0
- package/front_end/third_party/codemirror.next/rollup.config.js +45 -0
- package/front_end/ui/components/buttons/Button.ts +33 -5
- package/front_end/ui/components/buttons/button.css +32 -2
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +137 -0
- package/front_end/ui/components/code_highlighter/codeHighlighter.css +51 -0
- package/front_end/ui/components/code_highlighter/code_highlighter.ts +11 -0
- package/front_end/ui/components/docs/button/basic.html +1 -0
- package/front_end/ui/components/docs/button/basic.ts +47 -4
- package/front_end/ui/components/docs/text_editor/basic.html +28 -0
- package/front_end/ui/components/docs/text_editor/basic.ts +14 -0
- package/front_end/ui/components/docs/text_prompt/basic.html +35 -0
- package/front_end/ui/components/docs/text_prompt/basic.ts +19 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +161 -0
- package/front_end/ui/components/text_editor/config.ts +264 -0
- package/front_end/ui/components/text_editor/text_editor.ts +6 -0
- package/front_end/ui/components/text_editor/theme.ts +113 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +144 -0
- package/front_end/ui/components/text_prompt/textPrompt.css +33 -0
- package/front_end/ui/components/text_prompt/text_prompt.ts +9 -0
- package/front_end/ui/legacy/UIUtils.ts +9 -1
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +39 -39
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +31 -14
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +7 -8
- package/front_end/ui/legacy/components/source_frame/source_frame-legacy.ts +0 -6
- package/front_end/ui/legacy/components/source_frame/source_frame.ts +0 -2
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +11 -9
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/inspectorSyntaxHighlight.css +3 -8
- package/front_end/ui/legacy/inspectorSyntaxHighlightDark.css +11 -16
- package/front_end/ui/legacy/themeColors.css +60 -0
- package/inspector_overlay/debug/tool_persistent_isolated_element.html +75 -0
- package/inspector_overlay/drag_resize_handler.ts +142 -0
- package/inspector_overlay/highlight_isolated_element.ts +62 -0
- package/inspector_overlay/main.ts +4 -1
- package/inspector_overlay/tool_highlight.ts +6 -0
- package/inspector_overlay/tool_paused.ts +2 -0
- package/inspector_overlay/tool_persistent.ts +110 -0
- package/inspector_overlay/tool_screenshot.ts +8 -1
- package/package.json +1 -1
- package/front_end/panels/application/components/ReportingApiView.ts +0 -24
- package/front_end/panels/sources/GutterDiffPlugin.ts +0 -282
- package/front_end/ui/legacy/components/source_frame/SourceCodeDiff.ts +0 -140
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
white-space: pre;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.prefix {
|
|
14
|
+
color: var(--color-primary);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
input {
|
|
18
|
+
width: 0;
|
|
19
|
+
border: none;
|
|
20
|
+
outline: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.text-prompt-input {
|
|
24
|
+
border: none;
|
|
25
|
+
outline: none;
|
|
26
|
+
display: inline;
|
|
27
|
+
flex: 1 0 auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.text-prompt-input::after {
|
|
31
|
+
content: attr(suggestion);
|
|
32
|
+
color: var(--color-background-highlight);
|
|
33
|
+
}
|
|
@@ -602,7 +602,8 @@ export function anotherProfilerActiveLabel(): string {
|
|
|
602
602
|
return i18nString(UIStrings.anotherProfilerIsAlreadyActive);
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
export function asyncStackTraceLabel(
|
|
605
|
+
export function asyncStackTraceLabel(
|
|
606
|
+
description: string|undefined, previousCallFrames: {functionName: string}[]): string {
|
|
606
607
|
if (description) {
|
|
607
608
|
if (description === 'Promise.resolve') {
|
|
608
609
|
return i18nString(UIStrings.promiseResolvedAsync);
|
|
@@ -610,6 +611,13 @@ export function asyncStackTraceLabel(description: string|undefined): string {
|
|
|
610
611
|
if (description === 'Promise.reject') {
|
|
611
612
|
return i18nString(UIStrings.promiseRejectedAsync);
|
|
612
613
|
}
|
|
614
|
+
// TODO(crbug.com/1254259): Remove the check for 'async function'
|
|
615
|
+
// once the relevant V8 inspector CL rolls into Node LTS.
|
|
616
|
+
if ((description === 'await' || description === 'async function') && previousCallFrames.length !== 0) {
|
|
617
|
+
const lastPreviousFrame = previousCallFrames[previousCallFrames.length - 1];
|
|
618
|
+
const lastPreviousFrameName = beautifyFunctionName(lastPreviousFrame.functionName);
|
|
619
|
+
description = `await in ${lastPreviousFrameName}`;
|
|
620
|
+
}
|
|
613
621
|
return i18nString(UIStrings.sAsync, {PH1: description});
|
|
614
622
|
}
|
|
615
623
|
return i18nString(UIStrings.asyncCall);
|
|
@@ -22,9 +22,13 @@ const UIStrings = {
|
|
|
22
22
|
*/
|
|
23
23
|
noCommandsFound: 'No commands found',
|
|
24
24
|
/**
|
|
25
|
-
* @description Text
|
|
25
|
+
* @description Text for command prefix of run a command
|
|
26
|
+
*/
|
|
27
|
+
run: 'Run',
|
|
28
|
+
/**
|
|
29
|
+
* @description Text for command suggestion of run a command
|
|
26
30
|
*/
|
|
27
|
-
|
|
31
|
+
command: 'Command',
|
|
28
32
|
};
|
|
29
33
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/quick_open/CommandMenu.ts', UIStrings);
|
|
30
34
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -388,6 +392,7 @@ export class ShowActionDelegate implements UI.ActionRegistration.ActionDelegate
|
|
|
388
392
|
registerProvider({
|
|
389
393
|
prefix: '>',
|
|
390
394
|
iconName: 'ic_command_run_command',
|
|
391
|
-
title: (): Common.UIString.LocalizedString => i18nString(UIStrings.runCommand),
|
|
392
395
|
provider: () => Promise.resolve(CommandMenuProvider.instance()),
|
|
396
|
+
titlePrefix: (): Common.UIString.LocalizedString => i18nString(UIStrings.run),
|
|
397
|
+
titleSuggestion: (): Common.UIString.LocalizedString => i18nString(UIStrings.command),
|
|
393
398
|
});
|
|
@@ -10,6 +10,7 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
10
10
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
11
11
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
12
12
|
import * as Diff from '../../../../third_party/diff/diff.js';
|
|
13
|
+
import * as TextPrompt from '../../../../ui/components/text_prompt/text_prompt.js';
|
|
13
14
|
import * as UI from '../../legacy.js';
|
|
14
15
|
|
|
15
16
|
const UIStrings = {
|
|
@@ -37,9 +38,8 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
37
38
|
private loadTimeout: number;
|
|
38
39
|
private refreshListWithCurrentResult!: (() => void)|undefined;
|
|
39
40
|
private dialog!: UI.Dialog.Dialog|undefined;
|
|
40
|
-
private query
|
|
41
|
-
private readonly
|
|
42
|
-
private readonly prompt: UI.TextPrompt.TextPrompt;
|
|
41
|
+
private query = '';
|
|
42
|
+
private readonly inputBoxElement: TextPrompt.TextPrompt.TextPrompt;
|
|
43
43
|
private readonly hintElement: HTMLElement;
|
|
44
44
|
private readonly bottomElementsContainer: HTMLElement;
|
|
45
45
|
private readonly progressElement: HTMLElement;
|
|
@@ -48,7 +48,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
48
48
|
private list: UI.ListControl.ListControl<number>;
|
|
49
49
|
private readonly itemElementsContainer: HTMLDivElement;
|
|
50
50
|
private notFoundElement: HTMLElement;
|
|
51
|
-
private prefix
|
|
51
|
+
private prefix = '';
|
|
52
52
|
private provider: Provider|null;
|
|
53
53
|
private readonly queryChangedCallback?: (arg0: string) => void;
|
|
54
54
|
|
|
@@ -66,15 +66,11 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
66
66
|
UI.ARIAUtils.markAsCombobox(this.contentElement);
|
|
67
67
|
this.registerRequiredCSS('ui/legacy/components/quick_open/filteredListWidget.css');
|
|
68
68
|
|
|
69
|
-
this.
|
|
70
|
-
|
|
71
|
-
this.
|
|
72
|
-
|
|
73
|
-
this.
|
|
74
|
-
this.prompt.initialize(() => Promise.resolve([]));
|
|
75
|
-
const promptProxy = this.prompt.attach(this.promptElement);
|
|
76
|
-
promptProxy.addEventListener('input', this.onInput.bind(this), false);
|
|
77
|
-
promptProxy.classList.add('filtered-list-widget-prompt-element');
|
|
69
|
+
this.inputBoxElement = new TextPrompt.TextPrompt.TextPrompt();
|
|
70
|
+
this.inputBoxElement.data = {ariaLabel: i18nString(UIStrings.quickOpenPrompt), prefix: '', suggestion: ''};
|
|
71
|
+
this.inputBoxElement.addEventListener(
|
|
72
|
+
TextPrompt.TextPrompt.PromptInputEvent.eventName, this.onInput.bind(this), false);
|
|
73
|
+
this.contentElement.appendChild(this.inputBoxElement);
|
|
78
74
|
|
|
79
75
|
this.hintElement = this.contentElement.createChild('div', 'filtered-list-widget-hint');
|
|
80
76
|
|
|
@@ -89,15 +85,14 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
89
85
|
this.bottomElementsContainer.appendChild(this.itemElementsContainer);
|
|
90
86
|
this.itemElementsContainer.addEventListener('click', this.onClick.bind(this), false);
|
|
91
87
|
UI.ARIAUtils.markAsListBox(this.itemElementsContainer);
|
|
92
|
-
UI.ARIAUtils.setControls(this.
|
|
93
|
-
UI.ARIAUtils.setAutocomplete(this.
|
|
88
|
+
UI.ARIAUtils.setControls(this.inputBoxElement, this.itemElementsContainer);
|
|
89
|
+
UI.ARIAUtils.setAutocomplete(this.inputBoxElement, UI.ARIAUtils.AutocompleteInteractionModel.list);
|
|
94
90
|
|
|
95
91
|
this.notFoundElement = this.bottomElementsContainer.createChild('div', 'not-found-text');
|
|
96
92
|
this.notFoundElement.classList.add('hidden');
|
|
97
93
|
|
|
98
|
-
this.setDefaultFocusedElement(this.
|
|
94
|
+
this.setDefaultFocusedElement(this.inputBoxElement);
|
|
99
95
|
|
|
100
|
-
this.prefix = '';
|
|
101
96
|
this.provider = provider;
|
|
102
97
|
this.queryChangedCallback = queryChangedCallback;
|
|
103
98
|
}
|
|
@@ -138,6 +133,14 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
138
133
|
return false;
|
|
139
134
|
}
|
|
140
135
|
|
|
136
|
+
setCommandPrefix(commandPrefix: string): void {
|
|
137
|
+
this.inputBoxElement.setPrefix(commandPrefix);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setCommandSuggestion(suggestion: string): void {
|
|
141
|
+
this.inputBoxElement.setSuggestion(suggestion);
|
|
142
|
+
}
|
|
143
|
+
|
|
141
144
|
setHintElement(hint: string): void {
|
|
142
145
|
this.hintElement.textContent = hint;
|
|
143
146
|
}
|
|
@@ -146,7 +149,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
146
149
|
* Sets the text prompt's accessible title. By default, it is "Quick open prompt".
|
|
147
150
|
*/
|
|
148
151
|
setPromptTitle(title: string): void {
|
|
149
|
-
UI.ARIAUtils.setAccessibleName(this.
|
|
152
|
+
UI.ARIAUtils.setAccessibleName(this.inputBoxElement, title);
|
|
150
153
|
}
|
|
151
154
|
|
|
152
155
|
showAsDialog(dialogTitle?: string): void {
|
|
@@ -190,7 +193,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
setQuerySelectedRange(startIndex: number, endIndex: number): void {
|
|
193
|
-
this.
|
|
196
|
+
this.inputBoxElement.setSelectedRange(startIndex, endIndex);
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
private attachProvider(): void {
|
|
@@ -203,12 +206,8 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
203
206
|
this.itemsLoaded(this.provider);
|
|
204
207
|
}
|
|
205
208
|
|
|
206
|
-
private value(): string {
|
|
207
|
-
return this.prompt.text().trim();
|
|
208
|
-
}
|
|
209
|
-
|
|
210
209
|
private cleanValue(): string {
|
|
211
|
-
return this.
|
|
210
|
+
return this.query.substring(this.prefix.length);
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
wasShown(): void {
|
|
@@ -290,7 +289,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
290
289
|
if (toElement) {
|
|
291
290
|
toElement.classList.add('selected');
|
|
292
291
|
}
|
|
293
|
-
UI.ARIAUtils.setActiveDescendant(this.
|
|
292
|
+
UI.ARIAUtils.setActiveDescendant(this.inputBoxElement, toElement);
|
|
294
293
|
}
|
|
295
294
|
|
|
296
295
|
private onClick(event: Event): void {
|
|
@@ -307,15 +306,15 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
307
306
|
}
|
|
308
307
|
|
|
309
308
|
setQuery(query: string): void {
|
|
310
|
-
this.
|
|
311
|
-
this.
|
|
309
|
+
this.query = query;
|
|
310
|
+
this.inputBoxElement.focus();
|
|
311
|
+
this.inputBoxElement.setText(query);
|
|
312
312
|
this.queryChanged();
|
|
313
|
-
this.prompt.autoCompleteSoon(true);
|
|
314
313
|
this.scheduleFilter();
|
|
315
314
|
}
|
|
316
315
|
|
|
317
316
|
private tabKeyPressed(): boolean {
|
|
318
|
-
const userEnteredText = this.
|
|
317
|
+
const userEnteredText = this.query;
|
|
319
318
|
let completion;
|
|
320
319
|
for (let i = this.promptHistory.length - 1; i >= 0; i--) {
|
|
321
320
|
if (this.promptHistory[i] !== userEnteredText && this.promptHistory[i].startsWith(userEnteredText)) {
|
|
@@ -326,9 +325,9 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
326
325
|
if (!completion) {
|
|
327
326
|
return false;
|
|
328
327
|
}
|
|
329
|
-
this.
|
|
330
|
-
this.
|
|
331
|
-
this.
|
|
328
|
+
this.inputBoxElement.focus();
|
|
329
|
+
this.inputBoxElement.setText(completion);
|
|
330
|
+
this.inputBoxElement.setSelectedRange(userEnteredText.length, completion.length);
|
|
332
331
|
this.scheduleFilter();
|
|
333
332
|
return true;
|
|
334
333
|
}
|
|
@@ -360,7 +359,6 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
360
359
|
this.progressBarElement.classList.remove('filtered-widget-progress-fade', 'hidden');
|
|
361
360
|
|
|
362
361
|
const query = this.provider.rewriteQuery(this.cleanValue());
|
|
363
|
-
this.query = query;
|
|
364
362
|
|
|
365
363
|
const filterRegex = query ? Platform.StringUtilities.filterRegex(query) : null;
|
|
366
364
|
|
|
@@ -468,14 +466,15 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
468
466
|
}
|
|
469
467
|
}
|
|
470
468
|
|
|
471
|
-
private onInput(): void {
|
|
469
|
+
private onInput(event: TextPrompt.TextPrompt.PromptInputEvent): void {
|
|
470
|
+
this.query = event.data;
|
|
472
471
|
this.queryChanged();
|
|
473
472
|
this.scheduleFilter();
|
|
474
473
|
}
|
|
475
474
|
|
|
476
|
-
private queryChanged(): void {
|
|
475
|
+
private async queryChanged(): Promise<void> {
|
|
477
476
|
if (this.queryChangedCallback) {
|
|
478
|
-
this.queryChangedCallback(this.
|
|
477
|
+
await this.queryChangedCallback(this.query);
|
|
479
478
|
}
|
|
480
479
|
if (this.provider) {
|
|
481
480
|
this.provider.queryChanged(this.cleanValue());
|
|
@@ -521,7 +520,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
521
520
|
}
|
|
522
521
|
|
|
523
522
|
private selectItem(itemIndex: number|null): void {
|
|
524
|
-
this.promptHistory.push(this.
|
|
523
|
+
this.promptHistory.push(this.query);
|
|
525
524
|
if (this.promptHistory.length > 100) {
|
|
526
525
|
this.promptHistory.shift();
|
|
527
526
|
}
|
|
@@ -603,8 +602,9 @@ export function getRegisteredProviders(): ProviderRegistration[] {
|
|
|
603
602
|
return registeredProviders;
|
|
604
603
|
}
|
|
605
604
|
export interface ProviderRegistration {
|
|
606
|
-
provider: () => Promise<Provider>;
|
|
607
|
-
title?: (() => string);
|
|
608
605
|
prefix: string;
|
|
609
606
|
iconName: string;
|
|
607
|
+
provider: () => Promise<Provider>;
|
|
608
|
+
titlePrefix: (() => string);
|
|
609
|
+
titleSuggestion?: (() => string);
|
|
610
610
|
}
|
|
@@ -36,10 +36,15 @@ export class HelpQuickOpen extends Provider {
|
|
|
36
36
|
private addProvider(extension: {
|
|
37
37
|
prefix: string,
|
|
38
38
|
iconName: string,
|
|
39
|
-
|
|
39
|
+
titlePrefix: () => string,
|
|
40
|
+
titleSuggestion?: () => string,
|
|
40
41
|
}): void {
|
|
41
|
-
if (extension.
|
|
42
|
-
this.providers.push({
|
|
42
|
+
if (extension.titleSuggestion) {
|
|
43
|
+
this.providers.push({
|
|
44
|
+
prefix: extension.prefix || '',
|
|
45
|
+
iconName: extension.iconName,
|
|
46
|
+
title: extension.titlePrefix() + ' ' + extension.titleSuggestion(),
|
|
47
|
+
});
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
|
|
@@ -84,6 +89,7 @@ export class HelpQuickOpen extends Provider {
|
|
|
84
89
|
registerProvider({
|
|
85
90
|
prefix: '?',
|
|
86
91
|
iconName: 'ic_command_help',
|
|
87
|
-
title: undefined,
|
|
88
92
|
provider: () => Promise.resolve(HelpQuickOpen.instance()),
|
|
93
|
+
titlePrefix: () => 'Help',
|
|
94
|
+
titleSuggestion: undefined,
|
|
89
95
|
});
|
|
@@ -21,15 +21,18 @@ export const history: string[] = [];
|
|
|
21
21
|
|
|
22
22
|
export class QuickOpenImpl {
|
|
23
23
|
private prefix: string|null;
|
|
24
|
-
private readonly query: string;
|
|
25
|
-
private readonly providers: Map<string, () => Promise<Provider>>;
|
|
26
24
|
private readonly prefixes: string[];
|
|
25
|
+
private providers: Map<string, {
|
|
26
|
+
provider: () => Promise<Provider>,
|
|
27
|
+
titlePrefix: (() => string),
|
|
28
|
+
titleSuggestion?: (() => string),
|
|
29
|
+
}>;
|
|
27
30
|
private filteredListWidget: FilteredListWidget|null;
|
|
31
|
+
|
|
28
32
|
constructor() {
|
|
29
33
|
this.prefix = null;
|
|
30
|
-
this.query = '';
|
|
31
|
-
this.providers = new Map();
|
|
32
34
|
this.prefixes = [];
|
|
35
|
+
this.providers = new Map();
|
|
33
36
|
this.filteredListWidget = null;
|
|
34
37
|
|
|
35
38
|
getRegisteredProviders().forEach(this.addProvider.bind(this));
|
|
@@ -48,18 +51,27 @@ export class QuickOpenImpl {
|
|
|
48
51
|
private addProvider(extension: {
|
|
49
52
|
prefix: string,
|
|
50
53
|
provider: () => Promise<Provider>,
|
|
54
|
+
titlePrefix: () => string,
|
|
55
|
+
titleSuggestion?: (() => string),
|
|
51
56
|
}): void {
|
|
52
57
|
const prefix = extension.prefix;
|
|
53
58
|
if (prefix === null) {
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
61
|
this.prefixes.push(prefix);
|
|
57
|
-
this.providers.set(prefix,
|
|
62
|
+
this.providers.set(prefix, {
|
|
63
|
+
provider: extension.provider,
|
|
64
|
+
titlePrefix: extension.titlePrefix,
|
|
65
|
+
titleSuggestion: extension.titleSuggestion,
|
|
66
|
+
});
|
|
58
67
|
}
|
|
59
68
|
|
|
60
|
-
private queryChanged(query: string): void {
|
|
69
|
+
private async queryChanged(query: string): Promise<void> {
|
|
61
70
|
const prefix = this.prefixes.find(prefix => query.startsWith(prefix));
|
|
62
71
|
if (typeof prefix !== 'string' || this.prefix === prefix) {
|
|
72
|
+
if (query !== prefix && this.filteredListWidget) {
|
|
73
|
+
this.filteredListWidget.setCommandSuggestion('');
|
|
74
|
+
}
|
|
63
75
|
return;
|
|
64
76
|
}
|
|
65
77
|
|
|
@@ -68,18 +80,23 @@ export class QuickOpenImpl {
|
|
|
68
80
|
return;
|
|
69
81
|
}
|
|
70
82
|
this.filteredListWidget.setPrefix(prefix);
|
|
83
|
+
const titlePrefixFunction = this.providers.get(prefix)?.titlePrefix;
|
|
84
|
+
this.filteredListWidget.setCommandPrefix(titlePrefixFunction ? titlePrefixFunction() : '');
|
|
85
|
+
const titleSuggestionFunction = this.providers.get(prefix)?.titleSuggestion;
|
|
86
|
+
this.filteredListWidget.setCommandSuggestion(titleSuggestionFunction ? titleSuggestionFunction() : '');
|
|
87
|
+
|
|
71
88
|
this.filteredListWidget.setProvider(null);
|
|
72
|
-
const providerFunction = this.providers.get(prefix);
|
|
89
|
+
const providerFunction = this.providers.get(prefix)?.provider;
|
|
73
90
|
if (!providerFunction) {
|
|
74
91
|
return;
|
|
75
92
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
93
|
+
|
|
94
|
+
const provider = await providerFunction();
|
|
95
|
+
if (this.prefix !== prefix || !this.filteredListWidget) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.filteredListWidget.setProvider(provider);
|
|
99
|
+
this.providerLoadedForTest(provider);
|
|
83
100
|
}
|
|
84
101
|
|
|
85
102
|
private providerLoadedForTest(_provider: Provider): void {
|
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
font-size: inherit;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
border: 1px solid transparent;
|
|
30
|
+
devtools-text-prompt {
|
|
31
|
+
flex: 0 0 40px;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
font-family: '.SFNSDisplay-Regular', 'Helvetica Neue', 'Lucida Grande', sans-serif;
|
|
34
|
+
line-height: 16px;
|
|
35
|
+
padding: 12px;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
.filtered-list-widget-hint {
|
|
@@ -246,7 +245,7 @@
|
|
|
246
245
|
color: HighlightText;
|
|
247
246
|
}
|
|
248
247
|
|
|
249
|
-
|
|
248
|
+
devtools-text-prompt {
|
|
250
249
|
border-color: ButtonText;
|
|
251
250
|
}
|
|
252
251
|
}
|
|
@@ -33,12 +33,6 @@ SourceFrame.ResourceSourceFrame = SourceFrameModule.ResourceSourceFrame.Resource
|
|
|
33
33
|
/** @constructor */
|
|
34
34
|
SourceFrame.ResourceSourceFrame.SearchableContainer = SourceFrameModule.ResourceSourceFrame.SearchableContainer;
|
|
35
35
|
|
|
36
|
-
/** @constructor */
|
|
37
|
-
SourceFrame.SourceCodeDiff = SourceFrameModule.SourceCodeDiff.SourceCodeDiff;
|
|
38
|
-
|
|
39
|
-
/** @enum {symbol} */
|
|
40
|
-
SourceFrame.SourceCodeDiff.EditType = SourceFrameModule.SourceCodeDiff.EditType;
|
|
41
|
-
|
|
42
36
|
/** @constructor */
|
|
43
37
|
SourceFrame.SourceFrame = SourceFrameModule.SourceFrame.SourceFrameImpl;
|
|
44
38
|
|
|
@@ -8,7 +8,6 @@ import * as ImageView from './ImageView.js';
|
|
|
8
8
|
import * as JSONView from './JSONView.js';
|
|
9
9
|
import * as PreviewFactory from './PreviewFactory.js';
|
|
10
10
|
import * as ResourceSourceFrame from './ResourceSourceFrame.js';
|
|
11
|
-
import * as SourceCodeDiff from './SourceCodeDiff.js';
|
|
12
11
|
import * as SourceFrame from './SourceFrame.js';
|
|
13
12
|
import * as SourcesTextEditor from './SourcesTextEditor.js';
|
|
14
13
|
import * as XMLView from './XMLView.js';
|
|
@@ -20,7 +19,6 @@ export {
|
|
|
20
19
|
JSONView,
|
|
21
20
|
PreviewFactory,
|
|
22
21
|
ResourceSourceFrame,
|
|
23
|
-
SourceCodeDiff,
|
|
24
22
|
SourceFrame,
|
|
25
23
|
SourcesTextEditor,
|
|
26
24
|
XMLView,
|
|
@@ -102,11 +102,13 @@ export function buildStackTraceRows(
|
|
|
102
102
|
() => throttler.schedule(async () => updateHiddenRows(updateCallback, stackTraceRows)));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
function buildStackTraceRowsHelper(
|
|
105
|
+
function buildStackTraceRowsHelper(
|
|
106
|
+
stackTrace: Protocol.Runtime.StackTrace,
|
|
107
|
+
previousCallFrames: Protocol.Runtime.CallFrame[]|undefined = undefined): void {
|
|
106
108
|
let asyncRow: StackTraceAsyncRow|null = null;
|
|
107
|
-
if (
|
|
109
|
+
if (previousCallFrames) {
|
|
108
110
|
asyncRow = {
|
|
109
|
-
asyncDescription: UI.UIUtils.asyncStackTraceLabel(stackTrace.description),
|
|
111
|
+
asyncDescription: UI.UIUtils.asyncStackTraceLabel(stackTrace.description, previousCallFrames),
|
|
110
112
|
ignoreListHide: false,
|
|
111
113
|
rowCountHide: false,
|
|
112
114
|
};
|
|
@@ -141,18 +143,18 @@ export function buildStackTraceRows(
|
|
|
141
143
|
}
|
|
142
144
|
stackTraceRows.push({functionName, link, ignoreListHide, rowCountHide});
|
|
143
145
|
}
|
|
144
|
-
if (
|
|
146
|
+
if (asyncRow && hiddenCallFrames > 0 && hiddenCallFrames === stackTrace.callFrames.length) {
|
|
145
147
|
stackTraceRows[1].rowCountHide ? asyncRow.rowCountHide = true : asyncRow.ignoreListHide = true;
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
|
|
149
|
-
buildStackTraceRowsHelper(stackTrace
|
|
150
|
-
let
|
|
151
|
-
|
|
151
|
+
buildStackTraceRowsHelper(stackTrace);
|
|
152
|
+
let previousCallFrames = stackTrace.callFrames;
|
|
153
|
+
for (let asyncStackTrace = stackTrace.parent; asyncStackTrace; asyncStackTrace = asyncStackTrace.parent) {
|
|
152
154
|
if (asyncStackTrace.callFrames.length) {
|
|
153
|
-
buildStackTraceRowsHelper(asyncStackTrace,
|
|
155
|
+
buildStackTraceRowsHelper(asyncStackTrace, previousCallFrames);
|
|
154
156
|
}
|
|
155
|
-
|
|
157
|
+
previousCallFrames = asyncStackTrace.callFrames;
|
|
156
158
|
}
|
|
157
159
|
return stackTraceRows;
|
|
158
160
|
}
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.cm-xml-tag {
|
|
132
|
-
color: var(--
|
|
132
|
+
color: var(--color-token-tag);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
.cm-xml-attribute {
|
|
@@ -140,11 +140,6 @@
|
|
|
140
140
|
color: #00e; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
:root {
|
|
144
|
-
--override-dom-tag-name-color: rgb(136 18 128);
|
|
145
|
-
--override-dom-attribute-name-color: rgb(153 69 0);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
143
|
.webkit-html-comment {
|
|
149
144
|
/* Keep this in sync with view-source.css (.webkit-html-comment) */
|
|
150
145
|
color: rgb(35 110 37); /* stylelint-disable-line plugin/use_theme_colors */
|
|
@@ -159,7 +154,7 @@
|
|
|
159
154
|
.webkit-html-tag-name,
|
|
160
155
|
.webkit-html-close-tag-name {
|
|
161
156
|
/* Keep this in sync with view-source.css (.webkit-html-tag) */
|
|
162
|
-
color: var(--
|
|
157
|
+
color: var(--color-token-tag);
|
|
163
158
|
}
|
|
164
159
|
|
|
165
160
|
.webkit-html-pseudo-element {
|
|
@@ -192,7 +187,7 @@
|
|
|
192
187
|
|
|
193
188
|
.webkit-html-attribute-name {
|
|
194
189
|
/* Keep this in sync with view-source.css (.webkit-html-attribute-name) */
|
|
195
|
-
color: var(--
|
|
190
|
+
color: var(--color-token-attribute); /* stylelint-disable-line plugin/use_theme_colors */
|
|
196
191
|
/* See: crbug.com/1152736 for color variable migration. */
|
|
197
192
|
unicode-bidi: -webkit-isolate;
|
|
198
193
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.cm-js-def {
|
|
24
|
-
color: var(--
|
|
24
|
+
color: var(--color-token-tag);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.cm-js-keyword {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.cm-js-tag {
|
|
60
|
-
color: var(--
|
|
60
|
+
color: var(--color-token-tag);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.cm-js-variable {
|
|
@@ -161,11 +161,11 @@
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
.cm-xml-tag {
|
|
164
|
-
color: var(--
|
|
164
|
+
color: var(--color-token-tag);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
.cm-xml-attribute {
|
|
168
|
-
color: var(--
|
|
168
|
+
color: var(--color-token-attribute);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
.cm-xml-link {
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
.webkit-html-attribute-name {
|
|
176
|
-
color: var(--
|
|
176
|
+
color: var(--color-token-attribute);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
.webkit-html-attribute-value {
|
|
@@ -185,15 +185,15 @@
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
.webkit-html-tag {
|
|
188
|
-
color: var(--
|
|
188
|
+
color: var(--color-token-tag);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
.webkit-html-tag-name {
|
|
192
|
-
color: var(--
|
|
192
|
+
color: var(--color-token-tag);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
.webkit-html-close-tag-name {
|
|
196
|
-
color: var(--
|
|
196
|
+
color: var(--color-token-tag);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
.webkit-html-text-node {
|
|
@@ -217,11 +217,11 @@
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
.cm-def {
|
|
220
|
-
color: var(--
|
|
220
|
+
color: var(--color-token-tag);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
.cm-header {
|
|
224
|
-
color: var(--
|
|
224
|
+
color: var(--color-token-tag);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
.cm-variable-2 {
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
.cm-tag {
|
|
257
|
-
color: var(--
|
|
257
|
+
color: var(--color-token-tag);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
.cm-attribute {
|
|
@@ -268,8 +268,3 @@
|
|
|
268
268
|
.cm-link {
|
|
269
269
|
color: rgb(159 180 214); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
|
|
270
270
|
}
|
|
271
|
-
|
|
272
|
-
:root {
|
|
273
|
-
--override-dom-tag-name-color: rgb(93 176 215);
|
|
274
|
-
--override-dom-attribute-name-color: rgb(155 187 220);
|
|
275
|
-
}
|