chrome-devtools-frontend 1.0.1603822 → 1.0.1605219
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/front_end/Tests.js +23 -7
- package/front_end/core/host/AidaClient.ts +153 -525
- package/front_end/core/host/AidaClientTypes.ts +470 -0
- package/front_end/core/host/AidaGcaTranslation.ts +231 -122
- package/front_end/core/host/GcaClient.ts +112 -0
- package/front_end/core/host/GcaTypes.ts +107 -155
- package/front_end/core/host/UserMetrics.ts +0 -1
- package/front_end/core/host/host.ts +2 -0
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +1 -1
- package/front_end/core/root/ExperimentNames.ts +0 -1
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/AutofillModel.ts +3 -2
- package/front_end/core/sdk/CSSModel.ts +3 -4
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/ConsoleModel.ts +15 -13
- package/front_end/core/sdk/CookieModel.ts +5 -4
- package/front_end/core/sdk/DOMDebuggerModel.ts +20 -14
- package/front_end/core/sdk/DOMModel.ts +24 -22
- package/front_end/core/sdk/DebuggerModel.ts +21 -36
- package/front_end/core/sdk/EmulationModel.ts +21 -23
- package/front_end/core/sdk/EventBreakpointsModel.ts +16 -6
- package/front_end/core/sdk/HeapProfilerModel.ts +4 -7
- package/front_end/core/sdk/IsolateManager.ts +12 -7
- package/front_end/core/sdk/NetworkManager.ts +35 -28
- package/front_end/core/sdk/OverlayModel.ts +10 -10
- package/front_end/core/sdk/PreloadingModel.ts +3 -4
- package/front_end/core/sdk/ServiceWorkerManager.ts +2 -3
- package/front_end/core/sdk/SourceMapScopesInfo.ts +93 -63
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +1 -3
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +22 -48
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +0 -4
- package/front_end/generated/InspectorBackendCommands.ts +4 -0
- package/front_end/generated/SupportedCSSProperties.js +68 -2
- package/front_end/generated/protocol-mapping.d.ts +7 -0
- package/front_end/generated/protocol-proxy-api.d.ts +14 -0
- package/front_end/generated/protocol.ts +22 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +31 -17
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +1 -1
- package/front_end/models/bindings/TempFile.ts +1 -4
- package/front_end/models/emulation/DeviceModeModel.ts +21 -26
- package/front_end/models/extensions/ExtensionAPI.ts +1 -1
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +34 -47
- package/front_end/models/javascript_metadata/NativeFunctions.js +6 -6
- package/front_end/models/trace/insights/LCPDiscovery.ts +14 -6
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +85 -31
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +50 -40
- package/front_end/panels/ai_assistance/components/ChatView.ts +3 -2
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +35 -7
- package/front_end/panels/ai_assistance/components/chatMessage.css +5 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +6 -0
- package/front_end/panels/application/IndexedDBViews.ts +0 -9
- package/front_end/panels/application/WebMCPTreeElement.ts +35 -0
- package/front_end/panels/application/WebMCPView.ts +118 -0
- package/front_end/panels/application/application.ts +4 -0
- package/front_end/panels/application/webMCPView.css +65 -0
- package/front_end/panels/common/aiCodeCompletionSummaryToolbar.css +1 -1
- package/front_end/panels/console/consoleView.css +4 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +91 -13
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +23 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +85 -20
- package/front_end/panels/elements/elementsPanel.css +14 -0
- package/front_end/panels/elements/elementsTreeOutline.css +18 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +15 -19
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +4 -2
- package/front_end/panels/profiler/HeapSnapshotProxy.ts +12 -16
- package/front_end/panels/profiler/HeapSnapshotView.ts +3 -10
- package/front_end/panels/profiler/ProfilesPanel.ts +5 -7
- package/front_end/panels/recorder/components/recordingView.css +0 -6
- package/front_end/panels/sensors/SensorsView.ts +28 -61
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +2 -2
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +35 -36
- package/front_end/panels/timeline/TimelineDetailsView.ts +47 -41
- package/front_end/panels/timeline/TimelinePanel.ts +1 -3
- package/front_end/panels/timeline/TimelineTreeView.ts +13 -13
- package/front_end/panels/timeline/components/LiveMetricsView.ts +852 -824
- package/front_end/panels/timeline/components/liveMetricsView.css +4 -0
- package/front_end/panels/timeline/thirdPartyTreeView.css +2 -2
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/buttons/button.css +2 -2
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +0 -11
- package/front_end/ui/legacy/InspectorDrawerView.ts +206 -0
- package/front_end/ui/legacy/InspectorView.ts +41 -91
- package/front_end/ui/legacy/ViewManager.ts +14 -5
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +5 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
:host {
|
|
8
8
|
.background-bar-container {
|
|
9
9
|
/* Dont need the bars in 3p table */
|
|
10
10
|
display: none;
|
|
@@ -85,7 +85,7 @@ devtools-performance-third-party-tree-view {
|
|
|
85
85
|
border-left: var(--sys-size-1) solid var(--sys-color-divider);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
.has-max-rows {
|
|
89
89
|
/* 21px for header + max-rows * 22px rows */
|
|
90
90
|
max-height: calc(21px + (var(--max-rows) * 22px));
|
|
91
91
|
padding: var(--sys-size-3);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Name: Dependencies sourced from the upstream `chromium` repository
|
|
2
2
|
URL: Internal
|
|
3
3
|
Version: N/A
|
|
4
|
-
Revision:
|
|
4
|
+
Revision: c9e49d7cdbbc11a6a70bb2573f5a18cb23c1789b
|
|
5
5
|
Update Mechanism: Manual (https://crbug.com/428069060)
|
|
6
6
|
License: BSD-3-Clause
|
|
7
7
|
License File: LICENSE
|
|
@@ -56,17 +56,6 @@ export interface AiCodeCompletionConfig {
|
|
|
56
56
|
onRequestTriggered: () => void;
|
|
57
57
|
onResponseReceived: () => void;
|
|
58
58
|
panel: AiCodeCompletion.AiCodeCompletion.ContextFlavor;
|
|
59
|
-
getCompletionHint?: () => string | null;
|
|
60
|
-
getCurrentText?: () => string;
|
|
61
|
-
setAiAutoCompletion?: (args: {
|
|
62
|
-
text: string,
|
|
63
|
-
from: number,
|
|
64
|
-
startTime: number,
|
|
65
|
-
onImpression: (rpcGlobalId: Host.AidaClient.RpcGlobalId, latency: number, sampleId?: number) => void,
|
|
66
|
-
clearCachedRequest: () => void,
|
|
67
|
-
rpcGlobalId?: Host.AidaClient.RpcGlobalId,
|
|
68
|
-
sampleId?: number,
|
|
69
|
-
}|null) => void;
|
|
70
59
|
}
|
|
71
60
|
|
|
72
61
|
export const DELAY_BEFORE_SHOWING_RESPONSE_MS = 500;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import type * as Common from '../../core/common/common.js';
|
|
6
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
|
+
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
8
|
+
|
|
9
|
+
import * as ARIAUtils from './ARIAUtils.js';
|
|
10
|
+
import drawerTabbedPaneStyles from './inspectorDrawerTabbedPane.css.js';
|
|
11
|
+
import {ShowMode, type SplitWidget} from './SplitWidget.js';
|
|
12
|
+
import {type EventData, Events as TabbedPaneEvents, TabbedPane, type TabbedPaneTabDelegate} from './TabbedPane.js';
|
|
13
|
+
import {ToolbarButton, type ToolbarMenuButton} from './Toolbar.js';
|
|
14
|
+
import type {TabbedViewLocation} from './View.js';
|
|
15
|
+
import {ViewManager} from './ViewManager.js';
|
|
16
|
+
|
|
17
|
+
class DrawerTabbedPane extends TabbedPane {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.registerRequiredCSS(drawerTabbedPaneStyles);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const UIStrings = {
|
|
25
|
+
/**
|
|
26
|
+
* @description Title of more tabs button in the drawer view.
|
|
27
|
+
*/
|
|
28
|
+
moreTools: 'More Tools',
|
|
29
|
+
/**
|
|
30
|
+
* @description Text that appears when hover over the close button on the drawer view.
|
|
31
|
+
*/
|
|
32
|
+
closeDrawer: 'Close drawer',
|
|
33
|
+
/**
|
|
34
|
+
* @description Text that appears when hover the toggle orientation button.
|
|
35
|
+
*/
|
|
36
|
+
toggleDrawerOrientation: 'Toggle drawer orientation',
|
|
37
|
+
} as const;
|
|
38
|
+
|
|
39
|
+
const str_ = i18n.i18n.registerUIStrings('ui/legacy/InspectorDrawerView.ts', UIStrings);
|
|
40
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
41
|
+
|
|
42
|
+
interface InspectorDrawerViewOptions {
|
|
43
|
+
splitWidget: SplitWidget;
|
|
44
|
+
revealDrawer: () => void;
|
|
45
|
+
isVisible: () => boolean;
|
|
46
|
+
drawerLabel: string;
|
|
47
|
+
onHide: () => void;
|
|
48
|
+
onToggleOrientation: () => void;
|
|
49
|
+
onTabSelected: (tabId: string) => void;
|
|
50
|
+
tabDelegate: TabbedPaneTabDelegate;
|
|
51
|
+
enableOrientationToggle: boolean;
|
|
52
|
+
isVertical: boolean;
|
|
53
|
+
verticalExpandedMinimumWidth: number;
|
|
54
|
+
minimumSizes: {
|
|
55
|
+
inspectorWidthWhenVertical: number,
|
|
56
|
+
inspectorWidthWhenHorizontal: number,
|
|
57
|
+
inspectorHeight: number,
|
|
58
|
+
};
|
|
59
|
+
setInspectorMinimumSize: (width: number, height: number) => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export class InspectorDrawerView {
|
|
63
|
+
readonly tabbedLocation: TabbedViewLocation;
|
|
64
|
+
readonly tabbedPane: DrawerTabbedPane;
|
|
65
|
+
readonly #splitWidget: SplitWidget;
|
|
66
|
+
readonly #verticalExpandedMinimumWidth: number;
|
|
67
|
+
readonly #minimumSizes: {
|
|
68
|
+
inspectorWidthWhenVertical: number,
|
|
69
|
+
inspectorWidthWhenHorizontal: number,
|
|
70
|
+
inspectorHeight: number,
|
|
71
|
+
};
|
|
72
|
+
readonly #setInspectorMinimumSize: (width: number, height: number) => void;
|
|
73
|
+
readonly #toggleOrientationButton: ToolbarButton;
|
|
74
|
+
readonly #closeDrawerButton: ToolbarButton;
|
|
75
|
+
readonly #moreTabsButton: ToolbarMenuButton|null;
|
|
76
|
+
readonly #onTabSelected: (tabId: string) => void;
|
|
77
|
+
|
|
78
|
+
constructor(options: InspectorDrawerViewOptions) {
|
|
79
|
+
this.#splitWidget = options.splitWidget;
|
|
80
|
+
this.#verticalExpandedMinimumWidth = options.verticalExpandedMinimumWidth;
|
|
81
|
+
this.#minimumSizes = options.minimumSizes;
|
|
82
|
+
this.#setInspectorMinimumSize = options.setInspectorMinimumSize;
|
|
83
|
+
this.#onTabSelected = options.onTabSelected;
|
|
84
|
+
this.tabbedLocation = ViewManager.instance().createTabbedLocation(
|
|
85
|
+
options.revealDrawer, 'drawer-view', true, true, undefined, options.isVisible, () => new DrawerTabbedPane());
|
|
86
|
+
this.#moreTabsButton = this.tabbedLocation.enableMoreTabsButton();
|
|
87
|
+
this.#moreTabsButton.setTitle(i18nString(UIStrings.moreTools));
|
|
88
|
+
this.tabbedPane = this.tabbedLocation.tabbedPane() as DrawerTabbedPane;
|
|
89
|
+
this.tabbedPane.element.classList.add('drawer-tabbed-pane');
|
|
90
|
+
this.tabbedPane.element.setAttribute('jslog', `${VisualLogging.drawer()}`);
|
|
91
|
+
|
|
92
|
+
this.#closeDrawerButton = new ToolbarButton(i18nString(UIStrings.closeDrawer), 'cross');
|
|
93
|
+
this.#closeDrawerButton.element.setAttribute('jslog', `${VisualLogging.close().track({click: true})}`);
|
|
94
|
+
this.#closeDrawerButton.addEventListener(ToolbarButton.Events.CLICK, options.onHide);
|
|
95
|
+
|
|
96
|
+
this.#toggleOrientationButton = new ToolbarButton(
|
|
97
|
+
i18nString(UIStrings.toggleDrawerOrientation), options.isVertical ? 'dock-bottom' : 'dock-right');
|
|
98
|
+
this.#toggleOrientationButton.element.setAttribute(
|
|
99
|
+
'jslog', `${VisualLogging.toggle('toggle-drawer-orientation').track({click: true})}`);
|
|
100
|
+
this.#toggleOrientationButton.addEventListener(ToolbarButton.Events.CLICK, options.onToggleOrientation);
|
|
101
|
+
|
|
102
|
+
if (options.enableOrientationToggle) {
|
|
103
|
+
this.tabbedPane.rightToolbar().appendToolbarItem(this.#toggleOrientationButton);
|
|
104
|
+
}
|
|
105
|
+
this.tabbedPane.rightToolbar().appendToolbarItem(this.#closeDrawerButton);
|
|
106
|
+
this.tabbedPane.addEventListener(TabbedPaneEvents.TabSelected, this.#drawerTabSelected, this);
|
|
107
|
+
this.tabbedPane.setTabDelegate(options.tabDelegate);
|
|
108
|
+
const selectedDrawerTab = this.tabbedPane.selectedTabId;
|
|
109
|
+
if (this.#splitWidget.showMode() !== ShowMode.ONLY_MAIN && selectedDrawerTab) {
|
|
110
|
+
this.#onTabSelected(selectedDrawerTab);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const drawerElement = this.tabbedPane.element;
|
|
114
|
+
ARIAUtils.markAsComplementary(drawerElement);
|
|
115
|
+
ARIAUtils.setLabel(drawerElement, options.drawerLabel);
|
|
116
|
+
this.#splitWidget.installResizer(this.tabbedPane.headerElement());
|
|
117
|
+
this.#splitWidget.setSidebarWidget(this.tabbedPane);
|
|
118
|
+
|
|
119
|
+
this.tabbedPane.headerElement().setAttribute('jslog', `${VisualLogging.toolbar('drawer').track({
|
|
120
|
+
drag: true,
|
|
121
|
+
keydown: 'ArrowUp|ArrowLeft|ArrowDown|ArrowRight|Enter|Space',
|
|
122
|
+
})}`);
|
|
123
|
+
this.#updatePresentation();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
setVertical(shouldBeVertical: boolean): void {
|
|
127
|
+
if (shouldBeVertical === this.#splitWidget.isVertical()) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const previousShowMode = this.#splitWidget.showMode();
|
|
132
|
+
this.#splitWidget.setVertical(shouldBeVertical);
|
|
133
|
+
this.#updatePresentation();
|
|
134
|
+
this.applyState(previousShowMode);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
applyState(showMode: ShowMode): void {
|
|
138
|
+
if (this.#splitWidget.showMode() !== showMode) {
|
|
139
|
+
switch (showMode) {
|
|
140
|
+
case ShowMode.BOTH:
|
|
141
|
+
this.#splitWidget.showBoth();
|
|
142
|
+
break;
|
|
143
|
+
case ShowMode.ONLY_MAIN:
|
|
144
|
+
this.#splitWidget.hideSidebar();
|
|
145
|
+
break;
|
|
146
|
+
case ShowMode.ONLY_SIDEBAR:
|
|
147
|
+
this.#splitWidget.hideMain();
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.#updatePresentation();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
show(hasTargetDrawer: boolean): void {
|
|
155
|
+
this.tabbedPane.setAutoSelectFirstItemOnShow(!hasTargetDrawer);
|
|
156
|
+
this.#splitWidget.showBoth();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
hide(): void {
|
|
160
|
+
this.#splitWidget.hideSidebar(true);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
drawerVisible(): boolean {
|
|
164
|
+
return this.tabbedPane.isShowing();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
drawerSize(): number {
|
|
168
|
+
return this.#splitWidget.sidebarSize();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
setDrawerSize(size: number): void {
|
|
172
|
+
this.#splitWidget.setSidebarSize(size);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
totalSize(): number {
|
|
176
|
+
return this.#splitWidget.totalSize();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
isVertical(): boolean {
|
|
180
|
+
return this.#splitWidget.isVertical();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
updatePresentation(isVertical: boolean): void {
|
|
184
|
+
this.#toggleOrientationButton.setGlyph(isVertical ? 'dock-bottom' : 'dock-right');
|
|
185
|
+
|
|
186
|
+
if (isVertical) {
|
|
187
|
+
this.tabbedPane.setMinimumSize(this.#verticalExpandedMinimumWidth, 27);
|
|
188
|
+
} else {
|
|
189
|
+
this.tabbedPane.setMinimumSize(0, 27);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
#updatePresentation(): void {
|
|
194
|
+
const drawerIsVertical = this.#splitWidget.isVertical();
|
|
195
|
+
this.#setInspectorMinimumSize(
|
|
196
|
+
drawerIsVertical ? this.#minimumSizes.inspectorWidthWhenVertical :
|
|
197
|
+
this.#minimumSizes.inspectorWidthWhenHorizontal,
|
|
198
|
+
this.#minimumSizes.inspectorHeight);
|
|
199
|
+
this.updatePresentation(drawerIsVertical);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#drawerTabSelected(event: Common.EventTarget.EventTargetEvent<EventData>): void {
|
|
203
|
+
const {tabId} = event.data;
|
|
204
|
+
this.#onTabSelected(tabId);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -21,25 +21,17 @@ import {Dialog} from './Dialog.js';
|
|
|
21
21
|
import {DockController, DockState, Events as DockControllerEvents} from './DockController.js';
|
|
22
22
|
import {GlassPane} from './GlassPane.js';
|
|
23
23
|
import {Infobar, Type as InfobarType} from './Infobar.js';
|
|
24
|
+
import {InspectorDrawerView} from './InspectorDrawerView.js';
|
|
24
25
|
import {KeyboardShortcut} from './KeyboardShortcut.js';
|
|
25
26
|
import type {Panel} from './Panel.js';
|
|
26
|
-
import {
|
|
27
|
+
import {SplitWidget} from './SplitWidget.js';
|
|
27
28
|
import {type EventData, Events as TabbedPaneEvents, type TabbedPane, type TabbedPaneTabDelegate} from './TabbedPane.js';
|
|
28
|
-
import {ToolbarButton} from './Toolbar.js';
|
|
29
29
|
import {Tooltip} from './Tooltip.js';
|
|
30
30
|
import type {TabbedViewLocation, View, ViewLocation, ViewLocationResolver} from './View.js';
|
|
31
31
|
import {ViewManager} from './ViewManager.js';
|
|
32
32
|
import {VBox, type Widget, WidgetFocusRestorer} from './Widget.js';
|
|
33
33
|
|
|
34
34
|
const UIStrings = {
|
|
35
|
-
/**
|
|
36
|
-
* @description Title of more tabs button in inspector view
|
|
37
|
-
*/
|
|
38
|
-
moreTools: 'More Tools',
|
|
39
|
-
/**
|
|
40
|
-
* @description Text that appears when hovor over the close button on the drawer view
|
|
41
|
-
*/
|
|
42
|
-
closeDrawer: 'Close drawer',
|
|
43
35
|
/**
|
|
44
36
|
* @description The ARIA label for the main tab bar that contains the DevTools panels
|
|
45
37
|
*/
|
|
@@ -113,10 +105,6 @@ const UIStrings = {
|
|
|
113
105
|
* @description Label for a button which opens a file picker.
|
|
114
106
|
*/
|
|
115
107
|
selectFolder: 'Select folder',
|
|
116
|
-
/**
|
|
117
|
-
* @description Text that appears when hover the toggle orientation button
|
|
118
|
-
*/
|
|
119
|
-
toggleDrawerOrientation: 'Toggle drawer orientation',
|
|
120
108
|
} as const;
|
|
121
109
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/InspectorView.ts', UIStrings);
|
|
122
110
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -150,6 +138,7 @@ export interface DrawerOrientationByDockMode {
|
|
|
150
138
|
export class InspectorView extends VBox implements ViewLocationResolver {
|
|
151
139
|
private readonly drawerOrientationByDockSetting: Common.Settings.Setting<DrawerOrientationByDockMode>;
|
|
152
140
|
private readonly drawerSplitWidget: SplitWidget;
|
|
141
|
+
readonly #drawerView: InspectorDrawerView;
|
|
153
142
|
private readonly tabDelegate: InspectorViewTabDelegate;
|
|
154
143
|
private readonly drawerTabbedLocation: TabbedViewLocation;
|
|
155
144
|
private drawerTabbedPane: TabbedPane;
|
|
@@ -165,7 +154,6 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
165
154
|
#debuggedTabReloadRequiredInfobar?: Infobar;
|
|
166
155
|
#selectOverrideFolderInfobar?: Infobar;
|
|
167
156
|
#resizeObserver: ResizeObserver;
|
|
168
|
-
#toggleOrientationButton: ToolbarButton;
|
|
169
157
|
|
|
170
158
|
constructor() {
|
|
171
159
|
super();
|
|
@@ -189,51 +177,30 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
189
177
|
this.tabDelegate = new InspectorViewTabDelegate();
|
|
190
178
|
|
|
191
179
|
// Create drawer tabbed pane.
|
|
192
|
-
this
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
this.
|
|
215
|
-
|
|
216
|
-
(event: Common.EventTarget.EventTargetEvent<EventData>) => this.tabSelected(event.data.tabId), this);
|
|
217
|
-
const selectedDrawerTab = this.drawerTabbedPane.selectedTabId;
|
|
218
|
-
if (this.drawerSplitWidget.showMode() !== ShowMode.ONLY_MAIN && selectedDrawerTab) {
|
|
219
|
-
Host.userMetrics.panelShown(selectedDrawerTab, true);
|
|
220
|
-
}
|
|
221
|
-
this.drawerTabbedPane.setTabDelegate(this.tabDelegate);
|
|
222
|
-
|
|
223
|
-
const drawerElement = this.drawerTabbedPane.element;
|
|
224
|
-
ARIAUtils.markAsComplementary(drawerElement);
|
|
225
|
-
ARIAUtils.setLabel(drawerElement, i18nString(UIStrings.drawer));
|
|
226
|
-
|
|
227
|
-
this.drawerSplitWidget.installResizer(this.drawerTabbedPane.headerElement());
|
|
228
|
-
this.drawerSplitWidget.setSidebarWidget(this.drawerTabbedPane);
|
|
229
|
-
if (Root.Runtime.hostConfig.devToolsFlexibleLayout?.verticalDrawerEnabled) {
|
|
230
|
-
this.drawerTabbedPane.rightToolbar().appendToolbarItem(this.#toggleOrientationButton);
|
|
231
|
-
}
|
|
232
|
-
this.drawerTabbedPane.rightToolbar().appendToolbarItem(closeDrawerButton);
|
|
233
|
-
this.drawerTabbedPane.headerElement().setAttribute('jslog', `${VisualLogging.toolbar('drawer').track({
|
|
234
|
-
drag: true,
|
|
235
|
-
keydown: 'ArrowUp|ArrowLeft|ArrowDown|ArrowRight|Enter|Space',
|
|
236
|
-
})}`);
|
|
180
|
+
this.#drawerView = new InspectorDrawerView({
|
|
181
|
+
splitWidget: this.drawerSplitWidget,
|
|
182
|
+
revealDrawer: this.showDrawer.bind(this, {
|
|
183
|
+
focus: false,
|
|
184
|
+
hasTargetDrawer: true,
|
|
185
|
+
}),
|
|
186
|
+
isVisible: () => this.drawerSplitWidget.sidebarIsShowing(),
|
|
187
|
+
drawerLabel: i18nString(UIStrings.drawer),
|
|
188
|
+
onHide: this.closeDrawer.bind(this),
|
|
189
|
+
onToggleOrientation: this.toggleDrawerOrientation.bind(this),
|
|
190
|
+
onTabSelected: this.tabSelected.bind(this),
|
|
191
|
+
tabDelegate: this.tabDelegate,
|
|
192
|
+
enableOrientationToggle: Boolean(Root.Runtime.hostConfig.devToolsFlexibleLayout?.verticalDrawerEnabled),
|
|
193
|
+
isVertical,
|
|
194
|
+
verticalExpandedMinimumWidth: MIN_VERTICAL_DRAWER_WIDTH,
|
|
195
|
+
minimumSizes: {
|
|
196
|
+
inspectorWidthWhenVertical: MIN_INSPECTOR_WIDTH_VERTICAL_DRAWER,
|
|
197
|
+
inspectorWidthWhenHorizontal: MIN_INSPECTOR_WIDTH_HORIZONTAL_DRAWER,
|
|
198
|
+
inspectorHeight: MIN_INSPECTOR_HEIGHT,
|
|
199
|
+
},
|
|
200
|
+
setInspectorMinimumSize: this.setMinimumSize.bind(this),
|
|
201
|
+
});
|
|
202
|
+
this.drawerTabbedLocation = this.#drawerView.tabbedLocation;
|
|
203
|
+
this.drawerTabbedPane = this.#drawerView.tabbedPane;
|
|
237
204
|
|
|
238
205
|
// Create main area tabbed pane.
|
|
239
206
|
this.tabbedLocation = ViewManager.instance().createTabbedLocation(
|
|
@@ -291,6 +258,8 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
291
258
|
this.attachInfobar(infobar);
|
|
292
259
|
}
|
|
293
260
|
this.#resizeObserver = new ResizeObserver(this.#observedResize.bind(this));
|
|
261
|
+
DockController.instance().addEventListener(
|
|
262
|
+
DockControllerEvents.DOCK_SIDE_CHANGED, this.#applyDrawerOrientationForDockSide, this);
|
|
294
263
|
}
|
|
295
264
|
|
|
296
265
|
static instance(opts: {
|
|
@@ -351,14 +320,12 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
351
320
|
|
|
352
321
|
#applyDrawerOrientation(orientation: Omit<DrawerOrientation, DrawerOrientation.UNSET>): void {
|
|
353
322
|
const shouldBeVertical = orientation === DrawerOrientation.VERTICAL;
|
|
354
|
-
const isVertical = this.
|
|
323
|
+
const isVertical = this.#drawerView.isVertical();
|
|
355
324
|
if (shouldBeVertical === isVertical) {
|
|
356
325
|
return;
|
|
357
326
|
}
|
|
358
327
|
|
|
359
|
-
this.#
|
|
360
|
-
this.drawerSplitWidget.setVertical(shouldBeVertical);
|
|
361
|
-
this.setDrawerRelatedMinimumSizes();
|
|
328
|
+
this.#drawerView.setVertical(shouldBeVertical);
|
|
362
329
|
}
|
|
363
330
|
|
|
364
331
|
#observedResize(): void {
|
|
@@ -376,8 +343,6 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
376
343
|
this.#resizeObserver.observe(this.element);
|
|
377
344
|
this.#observedResize();
|
|
378
345
|
this.element.ownerDocument.addEventListener('keydown', this.keyDownBound, false);
|
|
379
|
-
DockController.instance().addEventListener(
|
|
380
|
-
DockControllerEvents.DOCK_SIDE_CHANGED, this.#applyDrawerOrientationForDockSide, this);
|
|
381
346
|
this.#applyDrawerOrientationForDockSide();
|
|
382
347
|
}
|
|
383
348
|
|
|
@@ -470,12 +435,10 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
470
435
|
}
|
|
471
436
|
|
|
472
437
|
showDrawer({focus, hasTargetDrawer}: {focus: boolean, hasTargetDrawer: boolean}): void {
|
|
473
|
-
if (this.
|
|
438
|
+
if (this.#drawerView.drawerVisible()) {
|
|
474
439
|
return;
|
|
475
440
|
}
|
|
476
|
-
|
|
477
|
-
this.drawerTabbedPane.setAutoSelectFirstItemOnShow(!hasTargetDrawer);
|
|
478
|
-
this.drawerSplitWidget.showBoth();
|
|
441
|
+
this.#drawerView.show(hasTargetDrawer);
|
|
479
442
|
if (focus) {
|
|
480
443
|
this.focusRestorer = new WidgetFocusRestorer(this.drawerTabbedPane);
|
|
481
444
|
} else {
|
|
@@ -486,18 +449,18 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
486
449
|
}
|
|
487
450
|
|
|
488
451
|
drawerVisible(): boolean {
|
|
489
|
-
return this.
|
|
452
|
+
return this.#drawerView.drawerVisible();
|
|
490
453
|
}
|
|
491
454
|
|
|
492
455
|
closeDrawer(): void {
|
|
493
|
-
if (!this.
|
|
456
|
+
if (!this.#drawerView.drawerVisible()) {
|
|
494
457
|
return;
|
|
495
458
|
}
|
|
496
459
|
if (this.focusRestorer) {
|
|
497
460
|
this.focusRestorer.restore();
|
|
498
461
|
}
|
|
499
|
-
this.
|
|
500
|
-
|
|
462
|
+
this.focusRestorer = null;
|
|
463
|
+
this.#drawerView.hide();
|
|
501
464
|
ARIAUtils.LiveAnnouncer.alert(i18nString(UIStrings.drawerHidden));
|
|
502
465
|
}
|
|
503
466
|
|
|
@@ -530,34 +493,21 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
530
493
|
return orientationSetting[dockMode] !== DrawerOrientation.UNSET;
|
|
531
494
|
}
|
|
532
495
|
|
|
533
|
-
setDrawerRelatedMinimumSizes(): void {
|
|
534
|
-
const drawerIsVertical = this.drawerSplitWidget.isVertical();
|
|
535
|
-
if (drawerIsVertical) {
|
|
536
|
-
// Set minimum size when the drawer is vertical to ensure the buttons will always be
|
|
537
|
-
// visible during resizing.
|
|
538
|
-
this.drawerTabbedPane.setMinimumSize(MIN_VERTICAL_DRAWER_WIDTH, 27);
|
|
539
|
-
this.setMinimumSize(MIN_INSPECTOR_WIDTH_VERTICAL_DRAWER, MIN_INSPECTOR_HEIGHT);
|
|
540
|
-
} else {
|
|
541
|
-
this.drawerTabbedPane.setMinimumSize(0, 27);
|
|
542
|
-
this.setMinimumSize(MIN_INSPECTOR_WIDTH_HORIZONTAL_DRAWER, MIN_INSPECTOR_HEIGHT);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
|
|
546
496
|
setDrawerMinimized(minimized: boolean): void {
|
|
547
497
|
this.drawerSplitWidget.setSidebarMinimized(minimized);
|
|
548
498
|
this.drawerSplitWidget.setResizable(!minimized);
|
|
549
499
|
}
|
|
550
500
|
|
|
551
501
|
drawerSize(): number {
|
|
552
|
-
return this.
|
|
502
|
+
return this.#drawerView.drawerSize();
|
|
553
503
|
}
|
|
554
504
|
|
|
555
505
|
setDrawerSize(size: number): void {
|
|
556
|
-
this.
|
|
506
|
+
this.#drawerView.setDrawerSize(size);
|
|
557
507
|
}
|
|
558
508
|
|
|
559
509
|
totalSize(): number {
|
|
560
|
-
return this.
|
|
510
|
+
return this.#drawerView.totalSize();
|
|
561
511
|
}
|
|
562
512
|
|
|
563
513
|
isDrawerMinimized(): boolean {
|
|
@@ -565,7 +515,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
565
515
|
}
|
|
566
516
|
|
|
567
517
|
isDrawerOrientationVertical(): boolean {
|
|
568
|
-
return this.
|
|
518
|
+
return this.#drawerView.isVertical();
|
|
569
519
|
}
|
|
570
520
|
|
|
571
521
|
private keyDown(event: KeyboardEvent): void {
|
|
@@ -51,6 +51,8 @@ export const defaultOptionsForTabs = {
|
|
|
51
51
|
freestyler: true,
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
type TabbedPaneFactory = () => TabbedPane;
|
|
55
|
+
|
|
54
56
|
export class PreRegisteredView implements View {
|
|
55
57
|
private readonly viewRegistration: ViewRegistration;
|
|
56
58
|
private readonly universe?: Foundation.Universe.Universe;
|
|
@@ -389,8 +391,11 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
389
391
|
|
|
390
392
|
createTabbedLocation(
|
|
391
393
|
revealCallback: (() => void), location: string, restoreSelection?: boolean, allowReorder?: boolean,
|
|
392
|
-
defaultTab?: string|null)
|
|
393
|
-
|
|
394
|
+
defaultTab?: string|null, isLocationVisible?: (() => boolean),
|
|
395
|
+
tabbedPaneFactory?: TabbedPaneFactory): TabbedViewLocation {
|
|
396
|
+
return new TabbedLocation(
|
|
397
|
+
this, revealCallback, location, restoreSelection, allowReorder, defaultTab, isLocationVisible,
|
|
398
|
+
tabbedPaneFactory);
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
createStackLocation(revealCallback?: (() => void), location?: string, jslogContext?: string): ViewLocation {
|
|
@@ -645,12 +650,14 @@ class TabbedLocation extends Location implements TabbedViewLocation {
|
|
|
645
650
|
private readonly tabOrderSetting: Common.Settings.Setting<TabOrderSetting>;
|
|
646
651
|
private readonly lastSelectedTabSetting?: Common.Settings.Setting<string>;
|
|
647
652
|
private readonly defaultTab: string|null|undefined;
|
|
653
|
+
private readonly isLocationVisible: (() => boolean)|undefined;
|
|
648
654
|
private readonly views = new Map<string, View>();
|
|
649
655
|
|
|
650
656
|
constructor(
|
|
651
657
|
manager: ViewManager, revealCallback: (() => void), location: string, restoreSelection?: boolean,
|
|
652
|
-
allowReorder?: boolean, defaultTab?: string|null)
|
|
653
|
-
|
|
658
|
+
allowReorder?: boolean, defaultTab?: string|null, isLocationVisible?: (() => boolean),
|
|
659
|
+
tabbedPaneFactory?: TabbedPaneFactory) {
|
|
660
|
+
const tabbedPane = tabbedPaneFactory ? tabbedPaneFactory() : new TabbedPane();
|
|
654
661
|
if (allowReorder) {
|
|
655
662
|
tabbedPane.setAllowTabReorder(true);
|
|
656
663
|
}
|
|
@@ -675,6 +682,7 @@ class TabbedLocation extends Location implements TabbedViewLocation {
|
|
|
675
682
|
this.lastSelectedTabSetting = Common.Settings.Settings.instance().createSetting(location + '-selected-tab', '');
|
|
676
683
|
}
|
|
677
684
|
this.defaultTab = defaultTab;
|
|
685
|
+
this.isLocationVisible = isLocationVisible;
|
|
678
686
|
|
|
679
687
|
if (location) {
|
|
680
688
|
this.appendApplicableItems(location);
|
|
@@ -853,7 +861,8 @@ class TabbedLocation extends Location implements TabbedViewLocation {
|
|
|
853
861
|
}
|
|
854
862
|
|
|
855
863
|
override isViewVisible(view: View): boolean {
|
|
856
|
-
|
|
864
|
+
const locationVisible = this.isLocationVisible ? this.isLocationVisible() : this.#tabbedPane.isShowing();
|
|
865
|
+
return locationVisible && this.#tabbedPane.selectedTabId === view.viewId();
|
|
857
866
|
}
|
|
858
867
|
|
|
859
868
|
private tabbedPaneVisibilityChanged(event: Common.EventTarget.EventTargetEvent<{isVisible: boolean}>): void {
|
|
@@ -793,6 +793,7 @@ export const knownContextValues = new Set([
|
|
|
793
793
|
'close',
|
|
794
794
|
'close-all',
|
|
795
795
|
'close-dev-tools',
|
|
796
|
+
'close-drawer',
|
|
796
797
|
'close-others',
|
|
797
798
|
'close-search',
|
|
798
799
|
'close-tabs-to-the-right',
|
|
@@ -1568,7 +1569,6 @@ export const knownContextValues = new Set([
|
|
|
1568
1569
|
'exclude-folder-confirmation',
|
|
1569
1570
|
'expand',
|
|
1570
1571
|
'expand-recursively',
|
|
1571
|
-
'experimental-cookie-features',
|
|
1572
1572
|
'experimental-item',
|
|
1573
1573
|
'experiments',
|
|
1574
1574
|
'experiments-filter',
|
|
@@ -4317,6 +4317,7 @@ export const knownContextValues = new Set([
|
|
|
4317
4317
|
'web+coffee',
|
|
4318
4318
|
'web+pwinter',
|
|
4319
4319
|
'web-audio',
|
|
4320
|
+
'web-mcp',
|
|
4320
4321
|
'web-socket-frames',
|
|
4321
4322
|
'web-socket-messages',
|
|
4322
4323
|
'web-workers',
|
package/package.json
CHANGED