chrome-devtools-frontend 1.0.1701636 → 1.0.1703574
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/eslint.config.mjs +3 -1
- package/front_end/core/common/ParsedURL.ts +5 -1
- package/front_end/core/host/UserMetricsEnums.ts +2 -1
- package/front_end/core/root/ExperimentNames.ts +1 -0
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -7
- package/front_end/core/text_utils/Markdown.ts +73 -0
- package/front_end/core/text_utils/text_utils.ts +2 -0
- package/front_end/devtools_compatibility.js +2 -1
- package/front_end/entrypoints/main/MainImpl.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +6 -4
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +6 -0
- package/front_end/generated/protocol.ts +22 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +13 -1
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +13 -19
- package/front_end/models/change_tracker/ChangeTracker.ts +5 -64
- package/front_end/models/comment_manager/CD4ABridge.ts +5 -0
- package/front_end/models/comment_manager/CommentManager.ts +3 -5
- package/front_end/models/comment_manager/CommentThread.ts +30 -13
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +6 -7
- package/front_end/models/issues_manager/DeprecationIssue.ts +1 -1
- package/front_end/models/issues_manager/MarkdownIssueDescription.ts +18 -52
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -4
- package/front_end/models/issues_manager/descriptions/cookieWarnMetadataGrantRead.md +0 -1
- package/front_end/models/issues_manager/descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
- package/front_end/models/issues_manager/descriptions/cookieWarnMetadataGrantSet.md +0 -1
- package/front_end/models/issues_manager/descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
- package/front_end/models/issues_manager/descriptions/deprecation.md +1 -1
- package/front_end/models/issues_manager/descriptions/sriValidationFailedIntegrityMismatch.md +2 -0
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +1 -1
- package/front_end/models/persistence/NetworkPersistenceManager.ts +14 -2
- package/front_end/panels/common/CommentThreadWidget.ts +29 -10
- package/front_end/panels/common/CommentsOverlayWidget.ts +50 -14
- package/front_end/panels/common/CommentsStatusBarPill.ts +40 -7
- package/front_end/panels/common/commentThreadWidget.css +11 -0
- package/front_end/panels/common/commentsStatusBarPill.css +13 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +10 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +101 -49
- package/front_end/panels/elements/components/CSSQuery.ts +1 -1
- package/front_end/panels/elements/components/cssQuery.css +4 -0
- package/front_end/panels/elements/elements.ts +0 -1
- package/front_end/panels/elements/stylesSidebarPane.css +6 -0
- package/front_end/panels/issues/IssueView.ts +5 -1
- package/front_end/panels/sources/ResourceOriginPlugin.ts +8 -3
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -4
- package/front_end/panels/sources/SourcesView.ts +127 -147
- package/front_end/panels/sources/TabbedEditorContainer.ts +518 -246
- package/front_end/panels/sources/UISourceCodeFrame.ts +9 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/chromium/client-variations/ClientVariations.js +25 -96
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +4 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/ui/comments/CommentOverlayManager.ts +11 -10
- package/front_end/ui/components/markdown_view/MarkdownPlaceholderLitRenderer.ts +59 -0
- package/front_end/ui/components/markdown_view/markdown_view.ts +2 -0
- package/front_end/ui/legacy/TabbedPane.ts +51 -40
- package/front_end/ui/legacy/Treeoutline.ts +28 -19
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +424 -570
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +2 -27
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +2 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2014 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
import '../../ui/legacy/legacy.js';
|
|
7
6
|
|
|
@@ -13,17 +12,17 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
13
12
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
13
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
15
14
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
15
|
+
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
16
16
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
17
17
|
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
18
18
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
19
|
-
import {Directives, html, render} from '../../ui/lit/lit.js';
|
|
19
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
20
20
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
21
21
|
|
|
22
22
|
import {EditingLocationHistoryManager} from './EditingLocationHistoryManager.js';
|
|
23
23
|
import sourcesViewStyles from './sourcesView.css.js';
|
|
24
24
|
import {
|
|
25
25
|
type EditorSelectedEvent,
|
|
26
|
-
Events as TabbedEditorContainerEvents,
|
|
27
26
|
type SerializedHistoryItem,
|
|
28
27
|
TabbedEditorContainer,
|
|
29
28
|
} from './TabbedEditorContainer.js';
|
|
@@ -70,20 +69,32 @@ const UIStrings = {
|
|
|
70
69
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/SourcesView.ts', UIStrings);
|
|
71
70
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
72
71
|
|
|
72
|
+
const {ref} = Directives;
|
|
73
73
|
const {widget, widgetRef} = UI.Widget;
|
|
74
74
|
|
|
75
75
|
export interface ViewInput {
|
|
76
76
|
searchProvider: UI.SearchableView.Searchable;
|
|
77
77
|
replaceProvider: UI.SearchableView.Replaceable;
|
|
78
78
|
searchableViewId: string;
|
|
79
|
-
scriptViewToolbarItems: UI.Toolbar.ToolbarItem[];
|
|
80
|
-
|
|
79
|
+
scriptViewToolbarItems: UI.Toolbar.ToolbarItem[]|LitTemplate;
|
|
80
|
+
isNavigatorSidebarOpen: boolean;
|
|
81
|
+
isDebuggerSidebarOpen: boolean;
|
|
82
|
+
isDebuggerSidebarButtonEnabled: boolean;
|
|
83
|
+
isVertical: boolean;
|
|
84
|
+
isInWrapper: boolean;
|
|
85
|
+
isTraceApp: boolean;
|
|
86
|
+
splitWidget?: UI.SplitWidget.SplitWidget;
|
|
87
|
+
onToggleNavigatorSidebar?: () => void;
|
|
88
|
+
onToggleDebuggerSidebar?: () => void;
|
|
89
|
+
breakpointsActive: boolean;
|
|
90
|
+
uiSourceCodes: ReadonlySet<Workspace.UISourceCode.UISourceCode>;
|
|
81
91
|
historyManager: EditingLocationHistoryManager;
|
|
82
92
|
previouslyViewedFilesSetting: Common.Settings.Setting<SerializedHistoryItem[]>;
|
|
93
|
+
onEditorSelected: (event: EditorSelectedEvent) => void;
|
|
94
|
+
onEditorClosed: (uiSourceCode: Workspace.UISourceCode.UISourceCode) => void;
|
|
83
95
|
}
|
|
84
96
|
|
|
85
97
|
export interface ViewOutput {
|
|
86
|
-
scriptViewToolbar?: UI.Toolbar.Toolbar;
|
|
87
98
|
editorContainer?: TabbedEditorContainer;
|
|
88
99
|
searchableView?: UI.SearchableView.SearchableView;
|
|
89
100
|
}
|
|
@@ -91,8 +102,52 @@ export interface ViewOutput {
|
|
|
91
102
|
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
92
103
|
|
|
93
104
|
export const DEFAULT_VIEW: View = (input, output, target): void => {
|
|
105
|
+
const renderNavigatorToggleButton = (): LitTemplate => {
|
|
106
|
+
const navHidden = !input.isNavigatorSidebarOpen;
|
|
107
|
+
const title = navHidden ? i18nString(UIStrings.showNavigator) : i18nString(UIStrings.hideNavigator);
|
|
108
|
+
// clang-format off
|
|
109
|
+
return html`
|
|
110
|
+
<devtools-button
|
|
111
|
+
class="toolbar-button"
|
|
112
|
+
title=${title}
|
|
113
|
+
aria-label=${title}
|
|
114
|
+
.iconName=${navHidden ? 'left-panel-open' : 'left-panel-close'}
|
|
115
|
+
.variant=${Buttons.Button.Variant.TOOLBAR}
|
|
116
|
+
jslog=${VisualLogging.toggleSubpane().track({click: true}).context('navigator')}
|
|
117
|
+
@click=${() => input.onToggleNavigatorSidebar?.()}
|
|
118
|
+
></devtools-button>`;
|
|
119
|
+
// clang-format on
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const renderDebuggerToggleButton = (): LitTemplate => {
|
|
123
|
+
const debuggerHidden = !input.isDebuggerSidebarOpen;
|
|
124
|
+
const title = debuggerHidden ? i18nString(UIStrings.showDebugger) : i18nString(UIStrings.hideDebugger);
|
|
125
|
+
const glyph = debuggerHidden ? (input.isVertical ? 'right-panel-open' : 'bottom-panel-open') :
|
|
126
|
+
(input.isVertical ? 'right-panel-close' : 'bottom-panel-close');
|
|
127
|
+
// clang-format off
|
|
128
|
+
return html`
|
|
129
|
+
<devtools-button
|
|
130
|
+
class="toolbar-button"
|
|
131
|
+
title=${title}
|
|
132
|
+
aria-label=${title}
|
|
133
|
+
.iconName=${glyph}
|
|
134
|
+
.variant=${Buttons.Button.Variant.TOOLBAR}
|
|
135
|
+
?disabled=${!input.isDebuggerSidebarButtonEnabled}
|
|
136
|
+
jslog=${VisualLogging.toggleSubpane().track({click: true}).context('debugger')}
|
|
137
|
+
@click=${() => input.onToggleDebuggerSidebar?.()}
|
|
138
|
+
></devtools-button>`;
|
|
139
|
+
// clang-format on
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const leftToolbarItems: LitTemplate[] = !input.isInWrapper ? [renderNavigatorToggleButton()] : [];
|
|
143
|
+
const rightToolbarItems: LitTemplate[] =
|
|
144
|
+
(!input.isInWrapper && !input.isTraceApp && input.isVertical) ? [renderDebuggerToggleButton()] : [];
|
|
145
|
+
const bottomToolbarContent: LitTemplate =
|
|
146
|
+
(!input.isInWrapper && !input.isTraceApp && !input.isVertical) ? renderDebuggerToggleButton() : nothing;
|
|
147
|
+
|
|
94
148
|
// clang-format off
|
|
95
149
|
render(html`
|
|
150
|
+
<style>${sourcesViewStyles}</style>
|
|
96
151
|
<devtools-widget class="vbox flex-auto"
|
|
97
152
|
${widget(element => {
|
|
98
153
|
const searchableView = new UI.SearchableView.SearchableView(input.searchProvider, input.replaceProvider, input.searchableViewId, element);
|
|
@@ -101,19 +156,39 @@ export const DEFAULT_VIEW: View = (input, output, target): void => {
|
|
|
101
156
|
})}
|
|
102
157
|
${widgetRef(UI.SearchableView.SearchableView, e => { output.searchableView = e; })}
|
|
103
158
|
>
|
|
104
|
-
<devtools-widget class="vbox flex-auto"
|
|
105
|
-
${widget(TabbedEditorContainer, {
|
|
159
|
+
<devtools-widget class="vbox flex-auto ${input.breakpointsActive ? '' : 'breakpoints-deactivated'}"
|
|
160
|
+
${widget(TabbedEditorContainer, {
|
|
161
|
+
historyManager: input.historyManager,
|
|
162
|
+
previouslyViewedFilesSetting: input.previouslyViewedFilesSetting,
|
|
163
|
+
leftToolbarItems,
|
|
164
|
+
rightToolbarItems,
|
|
165
|
+
uiSourceCodes: input.uiSourceCodes,
|
|
166
|
+
onEditorSelected: input.onEditorSelected,
|
|
167
|
+
onEditorClosed: input.onEditorClosed,
|
|
168
|
+
})}
|
|
106
169
|
${widgetRef(TabbedEditorContainer, e => { output.editorContainer = e; })}>
|
|
107
170
|
</devtools-widget>
|
|
108
171
|
</devtools-widget>
|
|
109
172
|
<div class="sources-toolbar" jslog=${VisualLogging.toolbar('bottom')}>
|
|
110
|
-
<devtools-toolbar class="script-view-toolbar" style="flex: auto;" ${
|
|
111
|
-
|
|
173
|
+
<devtools-toolbar class="script-view-toolbar" style="flex: auto;" ${ref(el => {
|
|
174
|
+
if (el && input.splitWidget) {
|
|
175
|
+
input.splitWidget.toggleResizer(el, !input.isVertical && !input.isInWrapper);
|
|
176
|
+
}
|
|
177
|
+
})}>
|
|
178
|
+
${Array.isArray(input.scriptViewToolbarItems)
|
|
179
|
+
? input.scriptViewToolbarItems.map(item => item.element)
|
|
180
|
+
: input.scriptViewToolbarItems}
|
|
112
181
|
</devtools-toolbar>
|
|
113
182
|
<devtools-toolbar class="bottom-toolbar">
|
|
114
|
-
${
|
|
183
|
+
${bottomToolbarContent}
|
|
115
184
|
</devtools-toolbar>
|
|
116
|
-
</div>`, target
|
|
185
|
+
</div>`, target, {
|
|
186
|
+
container: {
|
|
187
|
+
attributes: {
|
|
188
|
+
id: 'sources-panel-sources-view',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
});
|
|
117
192
|
// clang-format on
|
|
118
193
|
};
|
|
119
194
|
|
|
@@ -128,38 +203,33 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
128
203
|
editorContainer?: TabbedEditorContainer;
|
|
129
204
|
#uiSourceCodes = new Set<Workspace.UISourceCode.UISourceCode>();
|
|
130
205
|
private readonly historyManager: EditingLocationHistoryManager;
|
|
131
|
-
#
|
|
132
|
-
#scriptViewToolbarItems: UI.Toolbar.ToolbarItem[] = [];
|
|
133
|
-
#bottomToolbarItems: UI.Toolbar.ToolbarItem[] = [];
|
|
206
|
+
#scriptViewToolbarItems: UI.Toolbar.ToolbarItem[]|LitTemplate = [];
|
|
134
207
|
private toolbarChangedListener: Common.EventTarget.EventDescriptor|null;
|
|
135
208
|
private searchView?: UISourceCodeFrame;
|
|
136
209
|
private searchConfig?: UI.SearchableView.SearchConfig;
|
|
137
|
-
#view: View
|
|
210
|
+
readonly #view: View;
|
|
138
211
|
|
|
139
|
-
#toggleNavigatorSidebarButton: UI.Toolbar.ToolbarButton;
|
|
140
|
-
#toggleDebuggerSidebarButton: UI.Toolbar.ToolbarButton;
|
|
141
212
|
#onToggleNavigatorSidebar?: () => void;
|
|
142
213
|
#onToggleDebuggerSidebar?: () => void;
|
|
143
214
|
#isNavigatorSidebarOpen = false;
|
|
144
215
|
#isDebuggerSidebarOpen = false;
|
|
216
|
+
#isDebuggerSidebarButtonEnabled = true;
|
|
145
217
|
#navigatorSidebarInitialized = false;
|
|
146
218
|
#debuggerSidebarInitialized = false;
|
|
147
219
|
#isVertical = false;
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#breakpointsActive
|
|
220
|
+
#isInWrapper = true;
|
|
221
|
+
#splitWidget?: UI.SplitWidget.SplitWidget;
|
|
222
|
+
#breakpointsActive = true;
|
|
151
223
|
#editorContainerPromise: Promise<TabbedEditorContainer>;
|
|
152
224
|
#editorContainerResolve!: (container: TabbedEditorContainer) => void;
|
|
153
225
|
readonly previouslyViewedFilesSetting: Common.Settings.Setting<SerializedHistoryItem[]>;
|
|
154
226
|
|
|
155
|
-
constructor() {
|
|
156
|
-
super({jslog: `${VisualLogging.pane('editor').track({keydown: 'Escape'})}`});
|
|
227
|
+
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
228
|
+
super(element, {jslog: `${VisualLogging.pane('editor').track({keydown: 'Escape'})}`});
|
|
229
|
+
this.#view = view;
|
|
157
230
|
this.#editorContainerPromise = new Promise(resolve => {
|
|
158
231
|
this.#editorContainerResolve = resolve;
|
|
159
232
|
});
|
|
160
|
-
this.registerRequiredCSS(sourcesViewStyles);
|
|
161
|
-
|
|
162
|
-
this.element.id = 'sources-panel-sources-view';
|
|
163
233
|
this.setMinimumAndPreferredSizes(88, 52, 150, 100);
|
|
164
234
|
|
|
165
235
|
const workspace = Workspace.Workspace.WorkspaceImpl.instance();
|
|
@@ -168,22 +238,6 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
168
238
|
|
|
169
239
|
this.toolbarChangedListener = null;
|
|
170
240
|
|
|
171
|
-
this.#toggleNavigatorSidebarButton =
|
|
172
|
-
new UI.Toolbar.ToolbarButton(i18nString(UIStrings.showNavigator), 'left-panel-open');
|
|
173
|
-
this.#toggleNavigatorSidebarButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
|
|
174
|
-
this.#onToggleNavigatorSidebar?.();
|
|
175
|
-
});
|
|
176
|
-
this.#toggleNavigatorSidebarButton.element.setAttribute(
|
|
177
|
-
'jslog', `${VisualLogging.toggleSubpane().track({click: true}).context('navigator')}`);
|
|
178
|
-
|
|
179
|
-
this.#toggleDebuggerSidebarButton =
|
|
180
|
-
new UI.Toolbar.ToolbarButton(i18nString(UIStrings.showDebugger), 'right-panel-open');
|
|
181
|
-
this.#toggleDebuggerSidebarButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
|
|
182
|
-
this.#onToggleDebuggerSidebar?.();
|
|
183
|
-
});
|
|
184
|
-
this.#toggleDebuggerSidebarButton.element.setAttribute(
|
|
185
|
-
'jslog', `${VisualLogging.toggleSubpane().track({click: true}).context('debugger')}`);
|
|
186
|
-
|
|
187
241
|
this.previouslyViewedFilesSetting =
|
|
188
242
|
Common.Settings.Settings.instance().createLocalSetting('previously-viewed-files', []);
|
|
189
243
|
this.requestUpdate();
|
|
@@ -235,16 +289,25 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
235
289
|
replaceProvider: this,
|
|
236
290
|
searchableViewId: 'sources-view-search-config',
|
|
237
291
|
scriptViewToolbarItems: this.#scriptViewToolbarItems,
|
|
238
|
-
|
|
292
|
+
isNavigatorSidebarOpen: this.#isNavigatorSidebarOpen,
|
|
293
|
+
isDebuggerSidebarOpen: this.#isDebuggerSidebarOpen,
|
|
294
|
+
isDebuggerSidebarButtonEnabled: this.#isDebuggerSidebarButtonEnabled,
|
|
295
|
+
isVertical: this.#isVertical,
|
|
296
|
+
isInWrapper: this.#isInWrapper,
|
|
297
|
+
isTraceApp: Root.Runtime.Runtime.isTraceApp(),
|
|
298
|
+
splitWidget: this.#splitWidget,
|
|
299
|
+
onToggleNavigatorSidebar: this.#onToggleNavigatorSidebar,
|
|
300
|
+
onToggleDebuggerSidebar: this.#onToggleDebuggerSidebar,
|
|
301
|
+
breakpointsActive: this.#breakpointsActive,
|
|
302
|
+
uiSourceCodes: new Set(this.#uiSourceCodes),
|
|
239
303
|
historyManager: this.historyManager,
|
|
240
304
|
previouslyViewedFilesSetting: this.previouslyViewedFilesSetting,
|
|
305
|
+
onEditorSelected: this.editorSelected.bind(this),
|
|
306
|
+
onEditorClosed: this.editorClosed.bind(this),
|
|
241
307
|
};
|
|
242
308
|
|
|
243
309
|
const that = this;
|
|
244
310
|
const output: ViewOutput = {
|
|
245
|
-
set scriptViewToolbar(value: UI.Toolbar.Toolbar) {
|
|
246
|
-
that.#scriptViewToolbar = value;
|
|
247
|
-
},
|
|
248
311
|
set editorContainer(value: TabbedEditorContainer) {
|
|
249
312
|
that.setEditorContainer(value);
|
|
250
313
|
},
|
|
@@ -265,36 +328,9 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
265
328
|
if (this.editorContainer === editorContainer) {
|
|
266
329
|
return;
|
|
267
330
|
}
|
|
268
|
-
if (this.editorContainer) {
|
|
269
|
-
this.editorContainer.removeEventListener(TabbedEditorContainerEvents.EDITOR_SELECTED, this.editorSelected, this);
|
|
270
|
-
this.editorContainer.removeEventListener(TabbedEditorContainerEvents.EDITOR_CLOSED, this.editorClosed, this);
|
|
271
|
-
}
|
|
272
331
|
this.editorContainer = editorContainer;
|
|
273
332
|
if (this.editorContainer) {
|
|
274
|
-
if (this.#leftToolbarItems) {
|
|
275
|
-
this.editorContainer.leftToolbar().removeToolbarItems();
|
|
276
|
-
for (const item of this.#leftToolbarItems) {
|
|
277
|
-
this.editorContainer.leftToolbar().appendToolbarItem(item);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
if (this.#rightToolbarItems) {
|
|
281
|
-
this.editorContainer.rightToolbar().removeToolbarItems();
|
|
282
|
-
for (const item of this.#rightToolbarItems) {
|
|
283
|
-
this.editorContainer.rightToolbar().appendToolbarItem(item);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (this.#breakpointsActive !== undefined) {
|
|
287
|
-
this.editorContainer.element.classList.toggle('breakpoints-deactivated', !this.#breakpointsActive);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
333
|
this.#editorContainerResolve(editorContainer);
|
|
291
|
-
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EDITOR_SELECTED, this.editorSelected, this);
|
|
292
|
-
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EDITOR_CLOSED, this.editorClosed, this);
|
|
293
|
-
UI.UIUtils.startBatchUpdate();
|
|
294
|
-
for (const uiSourceCode of this.#uiSourceCodes) {
|
|
295
|
-
this.editorContainer.addUISourceCode(uiSourceCode);
|
|
296
|
-
}
|
|
297
|
-
UI.UIUtils.endBatchUpdate();
|
|
298
334
|
}
|
|
299
335
|
}
|
|
300
336
|
|
|
@@ -313,10 +349,12 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
313
349
|
|
|
314
350
|
set onToggleNavigatorSidebar(callback: () => void) {
|
|
315
351
|
this.#onToggleNavigatorSidebar = callback;
|
|
352
|
+
this.requestUpdate();
|
|
316
353
|
}
|
|
317
354
|
|
|
318
355
|
set onToggleDebuggerSidebar(callback: () => void) {
|
|
319
356
|
this.#onToggleDebuggerSidebar = callback;
|
|
357
|
+
this.requestUpdate();
|
|
320
358
|
}
|
|
321
359
|
|
|
322
360
|
set isNavigatorSidebarOpen(isOpen: boolean) {
|
|
@@ -326,7 +364,7 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
326
364
|
return;
|
|
327
365
|
}
|
|
328
366
|
this.#isNavigatorSidebarOpen = isOpen;
|
|
329
|
-
this
|
|
367
|
+
this.requestUpdate();
|
|
330
368
|
if (isInitialized) {
|
|
331
369
|
UI.ARIAUtils.LiveAnnouncer.alert(isOpen ? i18nString(UIStrings.navigatorShown) :
|
|
332
370
|
i18nString(UIStrings.navigatorHidden));
|
|
@@ -340,73 +378,22 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
340
378
|
return;
|
|
341
379
|
}
|
|
342
380
|
this.#isDebuggerSidebarOpen = isOpen;
|
|
343
|
-
this
|
|
381
|
+
this.requestUpdate();
|
|
344
382
|
if (isInitialized) {
|
|
345
383
|
UI.ARIAUtils.LiveAnnouncer.alert(isOpen ? i18nString(UIStrings.debuggerShown) :
|
|
346
384
|
i18nString(UIStrings.debuggerHidden));
|
|
347
385
|
}
|
|
348
386
|
}
|
|
349
387
|
|
|
350
|
-
#updateNavigatorSidebarButton(): void {
|
|
351
|
-
const navHidden = !this.#isNavigatorSidebarOpen;
|
|
352
|
-
this.#toggleNavigatorSidebarButton.setGlyph(navHidden ? 'left-panel-open' : 'left-panel-close');
|
|
353
|
-
this.#toggleNavigatorSidebarButton.setTitle(navHidden ? i18nString(UIStrings.showNavigator) :
|
|
354
|
-
i18nString(UIStrings.hideNavigator));
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
#updateDebuggerSidebarButton(): void {
|
|
358
|
-
const debuggerHidden = !this.#isDebuggerSidebarOpen;
|
|
359
|
-
const debuggerGlyph = debuggerHidden ? (this.#isVertical ? 'right-panel-open' : 'bottom-panel-open') :
|
|
360
|
-
(this.#isVertical ? 'right-panel-close' : 'bottom-panel-close');
|
|
361
|
-
this.#toggleDebuggerSidebarButton.setGlyph(debuggerGlyph);
|
|
362
|
-
this.#toggleDebuggerSidebarButton.setTitle(debuggerHidden ? i18nString(UIStrings.showDebugger) :
|
|
363
|
-
i18nString(UIStrings.hideDebugger));
|
|
364
|
-
}
|
|
365
|
-
|
|
366
388
|
toggleDebuggerSidebarButtonEnabled(enabled: boolean): void {
|
|
367
|
-
this.#
|
|
389
|
+
this.#isDebuggerSidebarButtonEnabled = enabled;
|
|
390
|
+
this.requestUpdate();
|
|
368
391
|
}
|
|
369
392
|
|
|
370
393
|
setLayoutMode(splitWidget: UI.SplitWidget.SplitWidget, isVertical: boolean, isInWrapper: boolean): void {
|
|
371
|
-
this.#
|
|
372
|
-
|
|
373
|
-
if (isVertical || isInWrapper) {
|
|
374
|
-
if (this.#scriptViewToolbar) {
|
|
375
|
-
splitWidget.uninstallResizer(this.#scriptViewToolbar);
|
|
376
|
-
}
|
|
377
|
-
} else if (this.#scriptViewToolbar) {
|
|
378
|
-
splitWidget.installResizer(this.#scriptViewToolbar);
|
|
379
|
-
}
|
|
380
|
-
|
|
394
|
+
this.#splitWidget = splitWidget;
|
|
381
395
|
this.#isVertical = isVertical;
|
|
382
|
-
this.#
|
|
383
|
-
this.#updateDebuggerSidebarButton();
|
|
384
|
-
|
|
385
|
-
const leftItems: UI.Toolbar.ToolbarItem[] = [];
|
|
386
|
-
const rightItems: UI.Toolbar.ToolbarItem[] = [];
|
|
387
|
-
|
|
388
|
-
if (!isInWrapper) {
|
|
389
|
-
leftItems.push(this.#toggleNavigatorSidebarButton);
|
|
390
|
-
if (!Root.Runtime.Runtime.isTraceApp()) {
|
|
391
|
-
if (isVertical) {
|
|
392
|
-
rightItems.push(this.#toggleDebuggerSidebarButton);
|
|
393
|
-
} else {
|
|
394
|
-
this.#bottomToolbarItems.push(this.#toggleDebuggerSidebarButton);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
this.#leftToolbarItems = leftItems;
|
|
400
|
-
this.#rightToolbarItems = rightItems;
|
|
401
|
-
|
|
402
|
-
if (this.editorContainer) {
|
|
403
|
-
const editorContainer = this.editorContainer;
|
|
404
|
-
editorContainer.leftToolbar().removeToolbarItems();
|
|
405
|
-
leftItems.forEach(item => editorContainer.leftToolbar().appendToolbarItem(item));
|
|
406
|
-
|
|
407
|
-
editorContainer.rightToolbar().removeToolbarItems();
|
|
408
|
-
rightItems.forEach(item => editorContainer.rightToolbar().appendToolbarItem(item));
|
|
409
|
-
}
|
|
396
|
+
this.#isInWrapper = isInWrapper;
|
|
410
397
|
this.requestUpdate();
|
|
411
398
|
}
|
|
412
399
|
|
|
@@ -500,7 +487,7 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
500
487
|
}
|
|
501
488
|
}
|
|
502
489
|
this.#uiSourceCodes.add(uiSourceCode);
|
|
503
|
-
this.
|
|
490
|
+
this.requestUpdate();
|
|
504
491
|
}
|
|
505
492
|
|
|
506
493
|
private uiSourceCodeRemoved(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
@@ -510,10 +497,10 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
510
497
|
|
|
511
498
|
private removeUISourceCodes(uiSourceCodes: Workspace.UISourceCode.UISourceCode[]): void {
|
|
512
499
|
uiSourceCodes.forEach(ui => this.#uiSourceCodes.delete(ui));
|
|
513
|
-
this.editorContainer?.removeUISourceCodes(uiSourceCodes);
|
|
514
500
|
for (let i = 0; i < uiSourceCodes.length; ++i) {
|
|
515
501
|
this.historyManager.removeHistoryForSourceCode(uiSourceCodes[i]);
|
|
516
502
|
}
|
|
503
|
+
this.requestUpdate();
|
|
517
504
|
}
|
|
518
505
|
|
|
519
506
|
private projectRemoved(event: Common.EventTarget.EventTargetEvent<Workspace.Workspace.Project>): void {
|
|
@@ -526,17 +513,12 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
526
513
|
const view = this.visibleView();
|
|
527
514
|
if (view instanceof UI.View.SimpleView) {
|
|
528
515
|
void view.toolbarItems().then(items => {
|
|
529
|
-
|
|
530
|
-
this.#scriptViewToolbarItems = items;
|
|
531
|
-
} else {
|
|
532
|
-
const wrapper = document.createElement('div');
|
|
533
|
-
wrapper.style.display = 'contents';
|
|
534
|
-
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
535
|
-
render(items, wrapper);
|
|
536
|
-
this.#scriptViewToolbarItems = [new UI.Toolbar.ToolbarItem(wrapper)];
|
|
537
|
-
}
|
|
516
|
+
this.#scriptViewToolbarItems = items;
|
|
538
517
|
this.requestUpdate();
|
|
539
518
|
});
|
|
519
|
+
} else {
|
|
520
|
+
this.#scriptViewToolbarItems = [];
|
|
521
|
+
this.requestUpdate();
|
|
540
522
|
}
|
|
541
523
|
}
|
|
542
524
|
|
|
@@ -570,8 +552,7 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
570
552
|
return this.editorContainer?.getCreatedSourceView(uiSourceCode);
|
|
571
553
|
}
|
|
572
554
|
|
|
573
|
-
private editorClosed(
|
|
574
|
-
const uiSourceCode = event.data;
|
|
555
|
+
private editorClosed(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
|
|
575
556
|
this.historyManager.removeHistoryForSourceCode(uiSourceCode);
|
|
576
557
|
|
|
577
558
|
let wasSelected = false;
|
|
@@ -591,12 +572,12 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
591
572
|
this.dispatchEventToListeners(Events.EDITOR_CLOSED, data);
|
|
592
573
|
}
|
|
593
574
|
|
|
594
|
-
private editorSelected(event:
|
|
595
|
-
const previousSourceFrame = event.
|
|
575
|
+
private editorSelected(event: EditorSelectedEvent): void {
|
|
576
|
+
const previousSourceFrame = event.previousView instanceof UISourceCodeFrame ? event.previousView : null;
|
|
596
577
|
if (previousSourceFrame) {
|
|
597
578
|
previousSourceFrame.setSearchableView(null);
|
|
598
579
|
}
|
|
599
|
-
const currentSourceFrame = event.
|
|
580
|
+
const currentSourceFrame = event.currentView instanceof UISourceCodeFrame ? event.currentView : null;
|
|
600
581
|
if (currentSourceFrame) {
|
|
601
582
|
currentSourceFrame.setSearchableView(this.searchableView());
|
|
602
583
|
}
|
|
@@ -738,7 +719,6 @@ export class SourcesView extends SourcesViewBase implements UI.SearchableView.Se
|
|
|
738
719
|
|
|
739
720
|
toggleBreakpointsActiveState(active: boolean): void {
|
|
740
721
|
this.#breakpointsActive = active;
|
|
741
|
-
this.editorContainer?.element.classList.toggle('breakpoints-deactivated', !active);
|
|
742
722
|
this.requestUpdate();
|
|
743
723
|
}
|
|
744
724
|
}
|