chrome-devtools-frontend 1.0.927127 → 1.0.928589
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/AUTHORS +1 -0
- package/config/gni/all_devtools_files.gni +0 -1
- package/config/gni/devtools_grd_files.gni +30 -4
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/ic_preview_feature.svg +3 -0
- package/front_end/Tests.js +2 -3
- package/front_end/core/common/Settings.ts +26 -45
- package/front_end/core/host/UserMetrics.ts +2 -2
- package/front_end/core/i18n/locales/en-US.json +60 -15
- package/front_end/core/i18n/locales/en-XL.json +60 -15
- package/front_end/core/platform/keyboard-utilities.ts +1 -0
- package/front_end/core/root/Runtime.ts +62 -61
- package/front_end/core/sdk/AccessibilityModel.ts +73 -73
- package/front_end/core/sdk/CPUProfileDataModel.ts +14 -14
- package/front_end/core/sdk/CPUProfilerModel.ts +33 -33
- package/front_end/core/sdk/CPUThrottlingManager.ts +8 -8
- package/front_end/core/sdk/CSSFontFace.ts +10 -10
- package/front_end/core/sdk/CSSMatchedStyles.ts +114 -114
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSMetadata.ts +53 -49
- package/front_end/core/sdk/CSSModel.ts +139 -135
- package/front_end/core/sdk/CSSProperty.ts +18 -18
- package/front_end/core/sdk/CSSRule.ts +15 -15
- package/front_end/core/sdk/CSSStyleDeclaration.ts +49 -47
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +12 -12
- package/front_end/core/sdk/ChildTargetManager.ts +41 -40
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +10 -10
- package/front_end/core/sdk/Connections.ts +81 -81
- package/front_end/core/sdk/ConsoleModel.ts +68 -68
- package/front_end/core/sdk/Cookie.ts +48 -48
- package/front_end/core/sdk/CookieModel.ts +13 -13
- package/front_end/core/sdk/CookieParser.ts +45 -45
- package/front_end/core/sdk/DOMDebuggerModel.ts +131 -131
- package/front_end/core/sdk/DOMModel.ts +264 -252
- package/front_end/core/sdk/DebuggerModel.ts +209 -205
- package/front_end/core/sdk/EmulationModel.ts +76 -76
- package/front_end/core/sdk/FilmStripModel.ts +29 -29
- package/front_end/core/sdk/FrameManager.ts +43 -42
- package/front_end/core/sdk/HeapProfilerModel.ts +36 -36
- package/front_end/core/sdk/IsolateManager.ts +82 -82
- package/front_end/core/sdk/IssuesModel.ts +6 -6
- package/front_end/core/sdk/LayerTreeBase.ts +37 -37
- package/front_end/core/sdk/LogModel.ts +5 -5
- package/front_end/core/sdk/NetworkManager.ts +229 -225
- package/front_end/core/sdk/NetworkRequest.ts +368 -360
- package/front_end/core/sdk/OverlayColorGenerator.ts +9 -9
- package/front_end/core/sdk/OverlayModel.ts +155 -153
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +100 -101
- package/front_end/core/sdk/PageResourceLoader.ts +30 -30
- package/front_end/core/sdk/PaintProfiler.ts +16 -16
- package/front_end/core/sdk/PerformanceMetricsModel.ts +12 -12
- package/front_end/core/sdk/ProfileTreeModel.ts +3 -3
- package/front_end/core/sdk/RemoteObject.ts +108 -104
- package/front_end/core/sdk/Resource.ts +85 -84
- package/front_end/core/sdk/ResourceTreeModel.ts +150 -145
- package/front_end/core/sdk/RuntimeModel.ts +38 -34
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/ScreenCaptureModel.ts +19 -19
- package/front_end/core/sdk/Script.ts +29 -29
- package/front_end/core/sdk/SecurityOriginManager.ts +19 -19
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +43 -43
- package/front_end/core/sdk/ServiceWorkerManager.ts +72 -68
- package/front_end/core/sdk/SourceMap.ts +40 -36
- package/front_end/core/sdk/SourceMapManager.ts +57 -57
- package/front_end/core/sdk/Target.ts +64 -63
- package/front_end/core/sdk/TargetManager.ts +60 -56
- package/front_end/core/sdk/TracingManager.ts +39 -39
- package/front_end/core/sdk/TracingModel.ts +125 -125
- package/front_end/core/sdk/WebAuthnModel.ts +9 -9
- package/front_end/entrypoints/lighthouse_worker/{LighthouseService.js → LighthouseService.ts} +20 -45
- package/front_end/entrypoints/lighthouse_worker/{lighthouse_worker.js → lighthouse_worker.ts} +0 -0
- package/front_end/entrypoints/main/MainImpl.ts +7 -2
- package/front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js +4 -4
- package/front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js +1 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -6
- package/front_end/models/issues_manager/GenericIssue.ts +86 -0
- package/front_end/models/issues_manager/Issue.ts +24 -0
- package/front_end/models/issues_manager/IssuesManager.ts +18 -6
- package/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +5422 -1
- package/front_end/panels/console/ConsoleSidebar.ts +0 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +53 -61
- package/front_end/panels/elements/ElementsTreeOutline.ts +0 -1
- package/front_end/panels/elements/components/LayoutPane.ts +5 -1
- package/front_end/panels/issues/GenericIssueDetailsView.ts +68 -0
- package/front_end/panels/issues/IssueAggregator.ts +16 -0
- package/front_end/panels/issues/IssueKindView.ts +95 -0
- package/front_end/panels/issues/IssueView.ts +6 -0
- package/front_end/panels/issues/IssuesPane.ts +81 -18
- package/front_end/panels/issues/issuesTree.css +8 -3
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -1
- package/front_end/panels/network/NetworkItemView.ts +1 -1
- package/front_end/panels/network/networkLogView.css +5 -0
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +1 -0
- package/front_end/panels/settings/settingsScreen.css +24 -0
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +8 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +22 -7
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -4
- 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/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/issue_counter/IssueLinkIcon.ts +1 -0
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +17 -0
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -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/{panels/console/components/components.ts → ui/components/text_editor/text_editor.ts} +2 -5
- 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/ARIAUtils.ts +14 -11
- package/front_end/ui/legacy/TabbedPane.ts +32 -3
- package/front_end/ui/legacy/UIUtils.ts +3 -1
- package/front_end/ui/legacy/View.ts +6 -0
- package/front_end/ui/legacy/ViewManager.ts +5 -1
- package/front_end/ui/legacy/ViewRegistration.ts +5 -0
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/closeButton.css +6 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +8 -3
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +38 -38
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +10 -4
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +23 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +14 -16
- package/front_end/ui/legacy/filter.css +1 -0
- package/front_end/ui/legacy/tabbedPane.css +24 -0
- package/front_end/ui/legacy/toolbar.css +5 -0
- package/inspector_overlay/main.ts +2 -1
- package/inspector_overlay/tool_screenshot.ts +8 -1
- package/package.json +1 -1
- package/scripts/build/rollup.config.js +9 -0
- package/scripts/migration/class-fields/migrate.js +56 -0
- package/scripts/migration/class-fields/package.json +5 -0
- package/front_end/panels/console/components/SidebarDeprecation.ts +0 -58
- package/front_end/panels/console/components/sidebarDeprecation.css +0 -17
|
@@ -344,7 +344,9 @@ export function isEditing(): boolean {
|
|
|
344
344
|
if (!focused) {
|
|
345
345
|
return false;
|
|
346
346
|
}
|
|
347
|
-
return focused.classList.contains('text-prompt') || focused.nodeName === 'INPUT' || focused.nodeName === 'TEXTAREA'
|
|
347
|
+
return focused.classList.contains('text-prompt') || focused.nodeName === 'INPUT' || focused.nodeName === 'TEXTAREA' ||
|
|
348
|
+
((focused as HTMLElement).contentEditable === 'true' ||
|
|
349
|
+
(focused as HTMLElement).contentEditable === 'plaintext-only');
|
|
348
350
|
}
|
|
349
351
|
|
|
350
352
|
export function markBeingEdited(element: Element, value: boolean): boolean {
|
|
@@ -14,6 +14,8 @@ export interface View {
|
|
|
14
14
|
|
|
15
15
|
isCloseable(): boolean;
|
|
16
16
|
|
|
17
|
+
isPreviewFeature(): boolean;
|
|
18
|
+
|
|
17
19
|
isTransient(): boolean;
|
|
18
20
|
|
|
19
21
|
toolbarItems(): Promise<ToolbarItem[]>;
|
|
@@ -60,6 +62,10 @@ export class SimpleView extends VBox implements View {
|
|
|
60
62
|
|
|
61
63
|
disposeView(): void {
|
|
62
64
|
}
|
|
65
|
+
|
|
66
|
+
isPreviewFeature(): boolean {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
export interface ViewLocation {
|
|
@@ -48,6 +48,10 @@ export class PreRegisteredView implements View {
|
|
|
48
48
|
return this.viewRegistration.persistence === ViewPersistence.CLOSEABLE;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
isPreviewFeature(): boolean {
|
|
52
|
+
return Boolean(this.viewRegistration.isPreviewFeature);
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
isTransient(): boolean {
|
|
52
56
|
return this.viewRegistration.persistence === ViewPersistence.TRANSIENT;
|
|
53
57
|
}
|
|
@@ -701,7 +705,7 @@ export class _TabbedLocation extends Location implements TabbedViewLocation {
|
|
|
701
705
|
private appendTab(view: View, index?: number): void {
|
|
702
706
|
this.tabbedPaneInternal.appendTab(
|
|
703
707
|
view.viewId(), view.title(), new ContainerWidget(view), undefined, false,
|
|
704
|
-
view.isCloseable() || view.isTransient(), index);
|
|
708
|
+
view.isCloseable() || view.isTransient(), view.isPreviewFeature(), index);
|
|
705
709
|
}
|
|
706
710
|
|
|
707
711
|
appendView(view: View, insertBefore?: View|null): void {
|
|
@@ -61,6 +61,11 @@ export interface ViewRegistration {
|
|
|
61
61
|
* Whether the view is permanently visible or can be opened temporarily.
|
|
62
62
|
*/
|
|
63
63
|
persistence?: ViewPersistence;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Whether the view is a preview feature (a corresponding icon is shown then).
|
|
67
|
+
*/
|
|
68
|
+
isPreviewFeature?: boolean;
|
|
64
69
|
/**
|
|
65
70
|
* Unique identifier of the view.
|
|
66
71
|
*/
|
|
@@ -29,7 +29,7 @@ export class XLink extends XElement {
|
|
|
29
29
|
// clang-format off
|
|
30
30
|
// TODO(dgozman): migrate css from 'devtools-link' to 'x-link'.
|
|
31
31
|
const element = html `
|
|
32
|
-
<x-link href='${url}' class='${className} devtools-link' ${preventClick ? 'no-click' : ''}
|
|
32
|
+
<x-link href='${url}' tabindex="0" class='${className} devtools-link' ${preventClick ? 'no-click' : ''}
|
|
33
33
|
>${Platform.StringUtilities.trimMiddle(linkText, MaxLengthForDisplayedURLs)}</x-link>`;
|
|
34
34
|
// clang-format on
|
|
35
35
|
return /** @type {!HTMLElement} */ element as HTMLElement;
|
|
@@ -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
475
|
private async queryChanged(): Promise<void> {
|
|
477
476
|
if (this.queryChangedCallback) {
|
|
478
|
-
await 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
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,8 +80,13 @@ 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
|
}
|
|
@@ -27,20 +27,22 @@
|
|
|
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 {
|
|
40
39
|
width: 100%;
|
|
41
40
|
flex: 0 0 30px;
|
|
42
41
|
font-size: 12px;
|
|
43
|
-
|
|
42
|
+
line-height: 30px;
|
|
43
|
+
padding: 0 12px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
44
46
|
color: var(--color-text-secondary);
|
|
45
47
|
background: var(--color-background-elevation-1);
|
|
46
48
|
border-top: 1px solid var(--color-details-hairline);
|
|
@@ -85,6 +87,7 @@
|
|
|
85
87
|
|
|
86
88
|
.filtered-list-widget-item-wrapper devtools-icon {
|
|
87
89
|
align-self: center;
|
|
90
|
+
flex: none;
|
|
88
91
|
padding-right: 8px;
|
|
89
92
|
}
|
|
90
93
|
|
|
@@ -94,11 +97,11 @@
|
|
|
94
97
|
|
|
95
98
|
.filtered-list-widget-item {
|
|
96
99
|
white-space: nowrap;
|
|
97
|
-
text-overflow: ellipsis;
|
|
98
100
|
overflow: hidden;
|
|
101
|
+
text-overflow: ellipsis;
|
|
99
102
|
align-self: center;
|
|
100
|
-
max-width: 446px;
|
|
101
103
|
font-size: 12px;
|
|
104
|
+
flex: auto;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
.filtered-list-widget-item.two-rows span.highlight {
|
|
@@ -187,17 +190,12 @@
|
|
|
187
190
|
padding-top: 8px;
|
|
188
191
|
padding-bottom: 8px;
|
|
189
192
|
display: flex;
|
|
190
|
-
flex: auto;
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
.filtered-list-widget-item.one-row .filtered-list-widget-title {
|
|
194
196
|
flex: none;
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
.filtered-list-widget-item.one-row .filtered-list-widget-subtitle::before {
|
|
198
|
-
content: ' ';
|
|
199
|
-
}
|
|
200
|
-
|
|
201
199
|
.filtered-list-widget-item.two-rows {
|
|
202
200
|
height: 45px;
|
|
203
201
|
padding-top: 8px;
|
|
@@ -246,7 +244,7 @@
|
|
|
246
244
|
color: HighlightText;
|
|
247
245
|
}
|
|
248
246
|
|
|
249
|
-
|
|
247
|
+
devtools-text-prompt {
|
|
250
248
|
border-color: ButtonText;
|
|
251
249
|
}
|
|
252
250
|
}
|
|
@@ -127,6 +127,10 @@
|
|
|
127
127
|
padding-right: 4px;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
.tabbed-pane-header-tab.preview.closeable {
|
|
131
|
+
padding-right: 5px;
|
|
132
|
+
}
|
|
133
|
+
|
|
130
134
|
.tabbed-pane-header-tab:hover,
|
|
131
135
|
.tabbed-pane-shadow .tabbed-pane-header-tab:focus-visible {
|
|
132
136
|
color: var(--color-text-primary);
|
|
@@ -316,6 +320,22 @@
|
|
|
316
320
|
flex: none;
|
|
317
321
|
}
|
|
318
322
|
|
|
323
|
+
.preview-icon {
|
|
324
|
+
--override-tabbed-pane-preview-icon-color: rgb(110 110 110);
|
|
325
|
+
|
|
326
|
+
width: 14px;
|
|
327
|
+
height: 14px;
|
|
328
|
+
display: flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
justify-content: center;
|
|
331
|
+
margin-left: 3px;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.-theme-with-dark-background .preview-icon,
|
|
335
|
+
:host-context(.-theme-with-dark-background) .preview-icon {
|
|
336
|
+
--override-tabbed-pane-preview-icon-color: rgb(145 145 145);
|
|
337
|
+
}
|
|
338
|
+
|
|
319
339
|
.close-button {
|
|
320
340
|
--tabbed-pane-close-icon-color: var(--color-text-primary);
|
|
321
341
|
|
|
@@ -333,6 +353,10 @@
|
|
|
333
353
|
background-color: var(--color-details-hairline);
|
|
334
354
|
}
|
|
335
355
|
|
|
356
|
+
.tabbed-pane-header-tab.preview.closeable .close-button {
|
|
357
|
+
margin-left: 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
336
360
|
@media (forced-colors: active) {
|
|
337
361
|
.tabbed-pane-tab-slider {
|
|
338
362
|
forced-color-adjust: none;
|
|
@@ -417,6 +417,7 @@ devtools-icon.leading-issue-icon {
|
|
|
417
417
|
@media (forced-colors: active) {
|
|
418
418
|
.toolbar-button:disabled {
|
|
419
419
|
opacity: 100%;
|
|
420
|
+
color: Graytext;
|
|
420
421
|
}
|
|
421
422
|
|
|
422
423
|
.toolbar-item,
|
|
@@ -424,6 +425,10 @@ devtools-icon.leading-issue-icon {
|
|
|
424
425
|
color: ButtonText;
|
|
425
426
|
}
|
|
426
427
|
|
|
428
|
+
.toolbar-button:disabled .toolbar-text {
|
|
429
|
+
color: Graytext;
|
|
430
|
+
}
|
|
431
|
+
|
|
427
432
|
select.toolbar-item:disabled,
|
|
428
433
|
select.toolbar-item:disabled + .toolbar-dropdown-arrow {
|
|
429
434
|
opacity: 100%;
|
|
@@ -21,6 +21,7 @@ import {PersistentOverlay} from './tool_persistent.js';
|
|
|
21
21
|
// @ts-ignore Importing CSS is handled in Rollup.
|
|
22
22
|
import screenshotStyle from './tool_screenshot.css'; // eslint-disable-line rulesdir/es_modules_import
|
|
23
23
|
import {ScreenshotOverlay} from './tool_screenshot.js';
|
|
24
|
+
import type {ScreenshotToolMessage} from './tool_screenshot.js';
|
|
24
25
|
// @ts-ignore Importing CSS is handled in Rollup.
|
|
25
26
|
import sourceOrderStyle from './tool_source_order.css'; // eslint-disable-line rulesdir/es_modules_import
|
|
26
27
|
import {SourceOrderOverlay} from './tool_source_order.js';
|
|
@@ -30,7 +31,7 @@ declare global {
|
|
|
30
31
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
32
|
interface Window {
|
|
32
33
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
33
|
-
InspectorOverlayHost: {send(data: PausedToolMessage|PersistentToolMessage|string): void};
|
|
34
|
+
InspectorOverlayHost: {send(data: PausedToolMessage|PersistentToolMessage|ScreenshotToolMessage|string): void};
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import {Overlay} from './common.js';
|
|
6
6
|
|
|
7
|
+
export type ScreenshotToolMessage = {
|
|
8
|
+
x: number,
|
|
9
|
+
y: number,
|
|
10
|
+
width: number,
|
|
11
|
+
height: number,
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
let anchor: {x: number, y: number}|null = null;
|
|
8
15
|
let position: {x: number, y: number}|null = null;
|
|
9
16
|
|
|
@@ -56,7 +63,7 @@ export class ScreenshotOverlay extends Overlay {
|
|
|
56
63
|
if (anchor && position) {
|
|
57
64
|
const rect = currentRect();
|
|
58
65
|
if (rect.width >= 5 && rect.height >= 5) {
|
|
59
|
-
this.window.InspectorOverlayHost.send(
|
|
66
|
+
this.window.InspectorOverlayHost.send(rect);
|
|
60
67
|
}
|
|
61
68
|
}
|
|
62
69
|
cancel();
|
package/package.json
CHANGED
|
@@ -131,6 +131,15 @@ export default commandLineArgs => ({
|
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// The LightHouse bundle shouldn't be processed by `terser` again, as it is uniquely built
|
|
135
|
+
if (importedFilelocation.includes(
|
|
136
|
+
path.join('front_end', 'third_party', 'lighthouse', 'lighthouse-dt-bundle.js'))) {
|
|
137
|
+
return {
|
|
138
|
+
id: importedFilelocation,
|
|
139
|
+
external: true,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
134
143
|
const importedFileName = path.basename(importedFilelocation, '.js');
|
|
135
144
|
const importedFileParentDirectory = path.basename(path.dirname(importedFilelocation));
|
|
136
145
|
const isExternal = importedFileName === importedFileParentDirectory;
|