chrome-devtools-frontend 1.0.1581708 → 1.0.1583146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/root/Runtime.ts +0 -5
- package/front_end/core/sdk/NetworkManager.ts +63 -115
- package/front_end/core/sdk/RemoteObject.ts +7 -1
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +9 -24
- package/front_end/entrypoints/greendev_floaty/floaty.css +1 -1
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/SupportedCSSProperties.js +2 -0
- package/front_end/generated/protocol.ts +0 -6
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +17 -9
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +2 -6
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +66 -2
- package/front_end/models/greendev/Prototypes.ts +1 -10
- package/front_end/models/issues_manager/ConnectionAllowlistIssue.ts +75 -0
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +0 -30
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -4
- package/front_end/panels/ai_assistance/components/ChatInput.ts +7 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +4 -2
- package/front_end/panels/application/preloading/PreloadingView.ts +8 -1
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +4 -1
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingString.ts +12 -3
- package/front_end/panels/application/preloading/helper/PreloadingForward.ts +14 -0
- package/front_end/panels/autofill/AutofillView.ts +4 -8
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +37 -3
- package/front_end/panels/changes/ChangesSidebar.ts +2 -6
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +27 -8
- package/front_end/panels/console/ConsoleSidebar.ts +3 -11
- package/front_end/panels/elements/ComputedStyleWidget.ts +41 -29
- package/front_end/panels/elements/ElementStatePaneWidget.ts +1 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +487 -426
- package/front_end/panels/elements/EventListenersWidget.ts +2 -4
- package/front_end/panels/elements/PropertiesWidget.ts +1 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -2
- package/front_end/panels/elements/computedStyleWidget.css +30 -0
- package/front_end/panels/lighthouse/LighthouseStartView.ts +3 -5
- package/front_end/panels/lighthouse/lighthouseStartView.css +6 -0
- package/front_end/panels/network/NetworkLogView.ts +67 -108
- package/front_end/panels/network/RequestConditionsDrawer.ts +40 -131
- package/front_end/panels/network/RequestInitiatorView.ts +19 -8
- package/front_end/panels/network/network-meta.ts +4 -27
- package/front_end/panels/settings/AISettingsTab.ts +1 -5
- package/front_end/panels/settings/SettingsScreen.ts +0 -51
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +4 -1
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +13 -16
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +5 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +8 -0
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +8 -0
- package/front_end/ui/components/text_editor/config.ts +6 -0
- package/front_end/ui/legacy/Toolbar.ts +16 -8
- package/front_end/ui/legacy/Treeoutline.ts +4 -4
- package/front_end/ui/legacy/UIUtils.ts +35 -4
- package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +6 -11
- package/front_end/ui/legacy/components/utils/Linkifier.ts +4 -7
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/package.json +1 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataHttpNotFound.md +0 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataInvalidResponse.md +0 -1
- package/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataNoResponse.md +0 -1
- package/front_end/panels/elements/computedStyleSidebarPane.css +0 -18
|
@@ -134,6 +134,9 @@ interface ViewOutput {
|
|
|
134
134
|
interface ViewInput {
|
|
135
135
|
onFilterChanged: (filterText: string|null) => void;
|
|
136
136
|
onBreakpointChange: (breakpoint: SDK.CategorizedBreakpoint.CategorizedBreakpoint, enabled: boolean) => void;
|
|
137
|
+
onItemSelected: (item: SDK.CategorizedBreakpoint.Category|SDK.CategorizedBreakpoint.CategorizedBreakpoint|
|
|
138
|
+
null) => void;
|
|
139
|
+
onSpaceKeyDown: () => void;
|
|
137
140
|
|
|
138
141
|
filterText: string|null;
|
|
139
142
|
userExpandedCategories: Set<SDK.CategorizedBreakpoint.Category>;
|
|
@@ -200,6 +203,13 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
200
203
|
}
|
|
201
204
|
};
|
|
202
205
|
|
|
206
|
+
const onKeyDown = (e: KeyboardEvent): void => {
|
|
207
|
+
if (e.key === ' ') {
|
|
208
|
+
input.onSpaceKeyDown();
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
203
213
|
render(
|
|
204
214
|
// clang-format off
|
|
205
215
|
html`
|
|
@@ -210,10 +220,11 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
210
220
|
style="flex: 1;"
|
|
211
221
|
></devtools-toolbar-input>
|
|
212
222
|
</devtools-toolbar>
|
|
213
|
-
<devtools-tree autofocus .template=${html`
|
|
223
|
+
<devtools-tree autofocus @keydown=${onKeyDown} .template=${html`
|
|
214
224
|
<ul role="tree">
|
|
215
225
|
${filteredCategories.map(([category, breakpoints]) => html`
|
|
216
|
-
<li @
|
|
226
|
+
<li @select=${() => input.onItemSelected(category)}
|
|
227
|
+
@expand=${(e: UI.TreeOutline.TreeViewElement.ExpandEvent) => onExpand(category, e)}
|
|
217
228
|
role="treeitem"
|
|
218
229
|
jslog-context=${category}
|
|
219
230
|
aria-checked=${breakpoints.some(breakpoint => breakpoint.enabled())
|
|
@@ -233,7 +244,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
233
244
|
role="group"
|
|
234
245
|
?hidden=${!shouldExpandCategory(breakpoints) && !input.userExpandedCategories.has(category)}>
|
|
235
246
|
${breakpoints.map(breakpoint => html`
|
|
236
|
-
<li
|
|
247
|
+
<li @select=${() => input.onItemSelected(breakpoint)}
|
|
237
248
|
role="treeitem"
|
|
238
249
|
aria-checked=${breakpoint.enabled()}
|
|
239
250
|
jslog-context=${Platform.StringUtilities.toKebabCase(breakpoint.name)}>
|
|
@@ -265,6 +276,7 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
265
276
|
#filterText: string|null = null;
|
|
266
277
|
#view: View;
|
|
267
278
|
#userExpandedCategories = new Set<SDK.CategorizedBreakpoint.Category>();
|
|
279
|
+
#selectedItem: SDK.CategorizedBreakpoint.Category|SDK.CategorizedBreakpoint.CategorizedBreakpoint|null = null;
|
|
268
280
|
constructor(
|
|
269
281
|
breakpoints: SDK.CategorizedBreakpoint.CategorizedBreakpoint[], jslog: string, viewId: string,
|
|
270
282
|
view = DEFAULT_VIEW) {
|
|
@@ -321,6 +333,26 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
321
333
|
this.requestUpdate();
|
|
322
334
|
}
|
|
323
335
|
|
|
336
|
+
#onItemSelected(item: SDK.CategorizedBreakpoint.Category|SDK.CategorizedBreakpoint.CategorizedBreakpoint|null): void {
|
|
337
|
+
this.#selectedItem = item;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
#onSpaceKeyDown(): void {
|
|
341
|
+
const selected = this.#selectedItem;
|
|
342
|
+
if (!selected) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
if (selected instanceof SDK.CategorizedBreakpoint.CategorizedBreakpoint) {
|
|
346
|
+
this.onBreakpointChanged(selected, !selected.enabled());
|
|
347
|
+
} else {
|
|
348
|
+
const breakpoints = this.categories.get(selected);
|
|
349
|
+
if (breakpoints) {
|
|
350
|
+
const newEnabled = breakpoints.some(bp => !bp.enabled());
|
|
351
|
+
breakpoints.forEach(bp => this.onBreakpointChanged(bp, newEnabled));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
324
356
|
protected onBreakpointChanged(breakpoint: SDK.CategorizedBreakpoint.CategorizedBreakpoint, enabled: boolean): void {
|
|
325
357
|
breakpoint.setEnabled(enabled);
|
|
326
358
|
this.requestUpdate();
|
|
@@ -331,6 +363,8 @@ export abstract class CategorizedBreakpointsSidebarPane extends UI.Widget.VBox {
|
|
|
331
363
|
filterText: this.#filterText,
|
|
332
364
|
onFilterChanged: this.#onFilterChanged.bind(this),
|
|
333
365
|
onBreakpointChange: this.onBreakpointChanged.bind(this),
|
|
366
|
+
onItemSelected: this.#onItemSelected.bind(this),
|
|
367
|
+
onSpaceKeyDown: this.#onSpaceKeyDown.bind(this),
|
|
334
368
|
sortedCategoryNames: this.#sortedCategories,
|
|
335
369
|
categories: this.categories,
|
|
336
370
|
highlightedItem: this.#highlightedItem,
|
|
@@ -24,7 +24,7 @@ const UIStrings = {
|
|
|
24
24
|
} as const;
|
|
25
25
|
const str_ = i18n.i18n.registerUIStrings('panels/changes/ChangesSidebar.ts', UIStrings);
|
|
26
26
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
27
|
-
const {render, html
|
|
27
|
+
const {render, html} = Lit;
|
|
28
28
|
interface ViewInput {
|
|
29
29
|
selectedSourceCode: Workspace.UISourceCode.UISourceCode|null;
|
|
30
30
|
onSelect: (uiSourceCode: Workspace.UISourceCode.UISourceCode|null) => void;
|
|
@@ -38,20 +38,16 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
38
38
|
uiSourceCode.url();
|
|
39
39
|
const icon = (uiSourceCode: Workspace.UISourceCode.UISourceCode): string =>
|
|
40
40
|
Snippets.ScriptSnippetFileSystem.isSnippetsUISourceCode(uiSourceCode) ? 'snippet' : 'document';
|
|
41
|
-
const configElements = new WeakMap<HTMLLIElement, Workspace.UISourceCode.UISourceCode>();
|
|
42
|
-
const onSelect = (e: UI.TreeOutline.TreeViewElement.SelectEvent): void =>
|
|
43
|
-
input.onSelect(configElements.get(e.detail) ?? null);
|
|
44
41
|
render(
|
|
45
42
|
// clang-format off
|
|
46
43
|
html`<devtools-tree
|
|
47
|
-
@selected=${onSelect}
|
|
48
44
|
navigation-variant
|
|
49
45
|
hide-overflow .template=${html`
|
|
50
46
|
<ul role="tree">
|
|
51
47
|
${input.sourceCodes.values().map(uiSourceCode => html`
|
|
52
48
|
<li
|
|
53
49
|
role="treeitem"
|
|
54
|
-
|
|
50
|
+
@select=${() => input.onSelect(uiSourceCode)}
|
|
55
51
|
?selected=${uiSourceCode === input.selectedSourceCode}>
|
|
56
52
|
<style>${changesSidebarStyles}</style>
|
|
57
53
|
<div class=${'navigator-' + uiSourceCode.contentType().name() + '-tree-item'}>
|
|
@@ -23,6 +23,14 @@ const UIStringsNotTranslate = {
|
|
|
23
23
|
* @description Text for teaser to generate code in Mac.
|
|
24
24
|
*/
|
|
25
25
|
cmdItoGenerateCode: 'cmd+i to generate code',
|
|
26
|
+
/**
|
|
27
|
+
* @description Text for teaser to learn how data is being used.
|
|
28
|
+
*/
|
|
29
|
+
ctrlOneTimeDisclaimerToLearnHowYourDataIsBeingUsed: 'ctrl+. to learn how your data is being used.',
|
|
30
|
+
/**
|
|
31
|
+
* @description Text for teaser to learn how data is being used in Mac.
|
|
32
|
+
*/
|
|
33
|
+
cmdOneTimeDisclaimerToLearnHowYourDataIsBeingUsed: 'cmd+. to learn how your data is being used.',
|
|
26
34
|
/**
|
|
27
35
|
* @description Aria label for teaser to generate code.
|
|
28
36
|
*/
|
|
@@ -109,6 +117,7 @@ export interface ViewInput {
|
|
|
109
117
|
disclaimerTooltipId?: string;
|
|
110
118
|
noLogging: boolean;
|
|
111
119
|
onManageInSettingsTooltipClick: (event: Event) => void;
|
|
120
|
+
showDataUsageTeaser: boolean;
|
|
112
121
|
// TODO(b/472268298): Remove ContextFlavor explicitly and pass required values
|
|
113
122
|
panel?: AiCodeCompletion.AiCodeCompletion.ContextFlavor;
|
|
114
123
|
}
|
|
@@ -136,18 +145,23 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
136
145
|
}
|
|
137
146
|
const toGenerateCode = Host.Platform.isMac() ? lockedString(UIStringsNotTranslate.cmdItoGenerateCode) :
|
|
138
147
|
lockedString(UIStringsNotTranslate.ctrlItoGenerateCode);
|
|
139
|
-
const
|
|
148
|
+
const toLearnHowYourDataIsBeingUsedScreenReaderOnly = Host.Platform.isMac() ?
|
|
140
149
|
lockedString(UIStringsNotTranslate.pressCmdPeriodToLearnHowYourDataIsBeingUsed) :
|
|
141
150
|
lockedString(UIStringsNotTranslate.pressCtrlPeriodToLearnHowYourDataIsBeingUsed);
|
|
151
|
+
const toLearnHowYourDataIsBeingUsedVisible = Host.Platform.isMac() ?
|
|
152
|
+
lockedString(UIStringsNotTranslate.cmdOneTimeDisclaimerToLearnHowYourDataIsBeingUsed) :
|
|
153
|
+
lockedString(UIStringsNotTranslate.ctrlOneTimeDisclaimerToLearnHowYourDataIsBeingUsed);
|
|
142
154
|
const tooltipDisclaimerText = getTooltipDisclaimerText(input.noLogging, input.panel);
|
|
143
|
-
|
|
155
|
+
|
|
144
156
|
// clang-format off
|
|
145
157
|
teaserLabel = html`<div class="ai-code-generation-teaser-trigger">
|
|
146
|
-
<span aria-atomic="true" aria-live="assertive">${toGenerateCode}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
<span aria-atomic="true" aria-live="assertive">${toGenerateCode}</span>
|
|
159
|
+
${input.showDataUsageTeaser ?
|
|
160
|
+
html`<span aria-hidden="true">${'. ' + toLearnHowYourDataIsBeingUsedVisible}</span>` : nothing}
|
|
161
|
+
<span class="ai-code-generation-teaser-screen-reader-only" aria-atomic="true" aria-live="assertive">
|
|
162
|
+
${toLearnHowYourDataIsBeingUsedScreenReaderOnly}
|
|
163
|
+
</span>
|
|
164
|
+
<devtools-button
|
|
151
165
|
.data=${{
|
|
152
166
|
title: lockedString(UIStringsNotTranslate.learnMoreAboutHowYourDataIsBeingUsed),
|
|
153
167
|
size: Buttons.Button.Size.MICRO,
|
|
@@ -245,12 +259,13 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
245
259
|
readonly #view: View;
|
|
246
260
|
#viewOutput: ViewOutput = {};
|
|
247
261
|
|
|
248
|
-
#displayState = AiCodeGenerationTeaserDisplayState.
|
|
262
|
+
#displayState = AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
249
263
|
#disclaimerTooltipId?: string;
|
|
250
264
|
#noLogging: boolean; // Whether the enterprise setting is `ALLOW_WITHOUT_LOGGING` or not.
|
|
251
265
|
#panel?: AiCodeCompletion.AiCodeCompletion.ContextFlavor;
|
|
252
266
|
#timerIntervalId?: number;
|
|
253
267
|
#loadStartTime?: number;
|
|
268
|
+
static #showDataUsageTeaser = true;
|
|
254
269
|
|
|
255
270
|
constructor(view?: View) {
|
|
256
271
|
super();
|
|
@@ -268,6 +283,7 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
268
283
|
onManageInSettingsTooltipClick: this.#onManageInSettingsTooltipClick.bind(this),
|
|
269
284
|
disclaimerTooltipId: this.#disclaimerTooltipId,
|
|
270
285
|
noLogging: this.#noLogging,
|
|
286
|
+
showDataUsageTeaser: AiCodeGenerationTeaser.#showDataUsageTeaser,
|
|
271
287
|
panel: this.#panel,
|
|
272
288
|
},
|
|
273
289
|
this.#viewOutput, this.contentElement);
|
|
@@ -286,6 +302,9 @@ export class AiCodeGenerationTeaser extends UI.Widget.Widget {
|
|
|
286
302
|
if (displayState === this.#displayState) {
|
|
287
303
|
return;
|
|
288
304
|
}
|
|
305
|
+
if (this.#displayState === AiCodeGenerationTeaserDisplayState.TRIGGER) {
|
|
306
|
+
AiCodeGenerationTeaser.#showDataUsageTeaser = false;
|
|
307
|
+
}
|
|
289
308
|
this.#displayState = displayState;
|
|
290
309
|
this.requestUpdate();
|
|
291
310
|
if (this.#displayState === AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
@@ -50,7 +50,7 @@ const UIStrings = {
|
|
|
50
50
|
} as const;
|
|
51
51
|
const str_ = i18n.i18n.registerUIStrings('panels/console/ConsoleSidebar.ts', UIStrings);
|
|
52
52
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
53
|
-
const {render, html, nothing
|
|
53
|
+
const {render, html, nothing} = Lit;
|
|
54
54
|
|
|
55
55
|
export const enum GroupName {
|
|
56
56
|
CONSOLE_API = 'user message',
|
|
@@ -78,18 +78,10 @@ interface ViewInput {
|
|
|
78
78
|
|
|
79
79
|
export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
80
80
|
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
81
|
-
const nodeFilterMap = new WeakMap<Element, ConsoleFilter>();
|
|
82
|
-
const onSelectionChanged = (event: UI.TreeOutline.TreeViewElement.SelectEvent): void => {
|
|
83
|
-
const filter = nodeFilterMap.get(event.detail);
|
|
84
|
-
if (filter) {
|
|
85
|
-
input.onSelectionChanged(filter);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
81
|
render(
|
|
89
82
|
html`<devtools-tree
|
|
90
83
|
navigation-variant
|
|
91
84
|
hide-overflow
|
|
92
|
-
@select=${onSelectionChanged}
|
|
93
85
|
.template=${
|
|
94
86
|
html`
|
|
95
87
|
<ul role="tree">
|
|
@@ -98,7 +90,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
98
90
|
group => html`
|
|
99
91
|
<li
|
|
100
92
|
role="treeitem"
|
|
101
|
-
|
|
93
|
+
@select=${() => input.onSelectionChanged(group.filter)}
|
|
102
94
|
?selected=${group.filter === input.selectedFilter}>
|
|
103
95
|
<style>${consoleSidebarStyles}</style>
|
|
104
96
|
<devtools-icon name=${GROUP_ICONS[group.name].icon}></devtools-icon>
|
|
@@ -112,7 +104,7 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
112
104
|
<ul role="group" hidden>
|
|
113
105
|
${group.urlGroups.values().map(urlGroup => html`
|
|
114
106
|
<li
|
|
115
|
-
|
|
107
|
+
@select=${() => input.onSelectionChanged(urlGroup.filter)}
|
|
116
108
|
role="treeitem"
|
|
117
109
|
?selected=${urlGroup.filter === input.selectedFilter}
|
|
118
110
|
title=${urlGroup.url ?? ''}>
|
|
@@ -46,7 +46,7 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
46
46
|
import * as Lit from '../../ui/lit/lit.js';
|
|
47
47
|
|
|
48
48
|
import * as ElementsComponents from './components/components.js';
|
|
49
|
-
import
|
|
49
|
+
import computedStyleWidgetStyles from './computedStyleWidget.css.js';
|
|
50
50
|
import {ImagePreviewPopover} from './ImagePreviewPopover.js';
|
|
51
51
|
import {PlatformFontsWidget} from './PlatformFontsWidget.js';
|
|
52
52
|
import {categorizePropertyName, type Category, DefaultCategoryOrder} from './PropertyNameCategories.js';
|
|
@@ -54,6 +54,7 @@ import {Renderer, rendererBase, type RenderingContext, StringRenderer, URLRender
|
|
|
54
54
|
import {StylePropertiesSection} from './StylePropertiesSection.js';
|
|
55
55
|
|
|
56
56
|
const {html, render} = Lit;
|
|
57
|
+
const {bindToSetting} = UI.UIUtils;
|
|
57
58
|
|
|
58
59
|
const UIStrings = {
|
|
59
60
|
/**
|
|
@@ -263,9 +264,12 @@ type ComputedStyleData = {
|
|
|
263
264
|
|
|
264
265
|
interface ComputedStyleWidgetInput {
|
|
265
266
|
computedStylesTree: TreeOutline.TreeOutline.TreeOutline<ComputedStyleData>;
|
|
266
|
-
toolbar: HTMLElement;
|
|
267
267
|
hasMatches: boolean;
|
|
268
268
|
computedStyleModel: ComputedStyleModule.ComputedStyleModel.ComputedStyleModel;
|
|
269
|
+
showInheritedComputedStylePropertiesSetting: Common.Settings.Setting<boolean>;
|
|
270
|
+
groupComputedStylesSetting: Common.Settings.Setting<boolean>;
|
|
271
|
+
onFilterChanged: (event: CustomEvent<string>) => void;
|
|
272
|
+
filterText: string;
|
|
269
273
|
}
|
|
270
274
|
|
|
271
275
|
type View = (input: ComputedStyleWidgetInput, output: null, target: HTMLElement) => void;
|
|
@@ -273,14 +277,30 @@ type View = (input: ComputedStyleWidgetInput, output: null, target: HTMLElement)
|
|
|
273
277
|
export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
274
278
|
// clang-format off
|
|
275
279
|
render(html`
|
|
276
|
-
<
|
|
280
|
+
<style>${computedStyleWidgetStyles}</style>
|
|
281
|
+
<div class="styles-sidebar-pane-toolbar">
|
|
282
|
+
<devtools-toolbar class="styles-pane-toolbar" role="presentation">
|
|
283
|
+
<devtools-toolbar-input
|
|
284
|
+
type="filter"
|
|
285
|
+
autofocus
|
|
286
|
+
value=${input.filterText}
|
|
287
|
+
@change=${input.onFilterChanged}
|
|
288
|
+
></devtools-toolbar-input>
|
|
289
|
+
<devtools-checkbox
|
|
290
|
+
title=${i18nString(UIStrings.showAll)}
|
|
291
|
+
${bindToSetting(input.showInheritedComputedStylePropertiesSetting)}
|
|
292
|
+
>${i18nString(UIStrings.showAll)}</devtools-checkbox>
|
|
293
|
+
<devtools-checkbox
|
|
294
|
+
title=${i18nString(UIStrings.group)}
|
|
295
|
+
${bindToSetting(input.groupComputedStylesSetting)}
|
|
296
|
+
>${i18nString(UIStrings.group)}</devtools-checkbox>
|
|
297
|
+
</devtools-toolbar>
|
|
298
|
+
</div>
|
|
277
299
|
<div class="computed-style-tree-outline-container">
|
|
278
300
|
${input.computedStylesTree}
|
|
279
301
|
</div>
|
|
280
302
|
${!input.hasMatches ? html`<div class="gray-info-message">${i18nString(UIStrings.noMatchingProperty)}</div>` : ''}
|
|
281
|
-
<
|
|
282
|
-
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(PlatformFontsWidget, { sharedModel: input.computedStyleModel})}></devtools-widget>
|
|
283
|
-
</div>
|
|
303
|
+
<devtools-widget .widgetConfig=${UI.Widget.widgetConfig(PlatformFontsWidget, { sharedModel: input.computedStyleModel})}></devtools-widget>
|
|
284
304
|
`, target);
|
|
285
305
|
// clang-format on
|
|
286
306
|
};
|
|
@@ -289,7 +309,6 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
289
309
|
private computedStyleModel: ComputedStyleModule.ComputedStyleModel.ComputedStyleModel;
|
|
290
310
|
private readonly showInheritedComputedStylePropertiesSetting: Common.Settings.Setting<boolean>;
|
|
291
311
|
private readonly groupComputedStylesSetting: Common.Settings.Setting<boolean>;
|
|
292
|
-
input: UI.Toolbar.ToolbarInput;
|
|
293
312
|
private filterRegex: RegExp|null;
|
|
294
313
|
private readonly linkifier: Components.Linkifier.Linkifier;
|
|
295
314
|
private readonly imagePreviewPopover: ImagePreviewPopover;
|
|
@@ -297,12 +316,11 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
297
316
|
#computedStylesTree = new TreeOutline.TreeOutline.TreeOutline<ComputedStyleData>();
|
|
298
317
|
#treeData?: TreeOutline.TreeOutline.TreeOutlineData<ComputedStyleData>;
|
|
299
318
|
readonly #view: View;
|
|
300
|
-
|
|
319
|
+
#filterText = '';
|
|
301
320
|
|
|
302
321
|
constructor(computedStyleModel: ComputedStyleModule.ComputedStyleModel.ComputedStyleModel) {
|
|
303
322
|
super({useShadowDom: true});
|
|
304
323
|
this.#view = DEFAULT_VIEW;
|
|
305
|
-
this.registerRequiredCSS(computedStyleSidebarPaneStyles);
|
|
306
324
|
|
|
307
325
|
this.contentElement.classList.add('styles-sidebar-computed-style-widget');
|
|
308
326
|
|
|
@@ -321,23 +339,8 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
321
339
|
this.requestUpdate();
|
|
322
340
|
});
|
|
323
341
|
|
|
324
|
-
this.toolbarElement = document.createElement('div');
|
|
325
|
-
this.toolbarElement.classList.add('hbox', 'styles-sidebar-pane-toolbar');
|
|
326
|
-
const toolbar = document.createElement('devtools-toolbar');
|
|
327
|
-
toolbar.classList.add('styles-pane-toolbar');
|
|
328
|
-
this.toolbarElement.appendChild(toolbar);
|
|
329
|
-
|
|
330
|
-
const filterInput = new UI.Toolbar.ToolbarFilter(undefined, 1, 1, undefined, undefined, false);
|
|
331
|
-
filterInput.addEventListener(UI.Toolbar.ToolbarInput.Event.TEXT_CHANGED, this.onFilterChanged, this);
|
|
332
|
-
toolbar.appendToolbarItem(filterInput);
|
|
333
|
-
this.input = filterInput;
|
|
334
342
|
this.filterRegex = null;
|
|
335
343
|
|
|
336
|
-
toolbar.appendToolbarItem(new UI.Toolbar.ToolbarSettingCheckbox(
|
|
337
|
-
this.showInheritedComputedStylePropertiesSetting, undefined, i18nString(UIStrings.showAll)));
|
|
338
|
-
toolbar.appendToolbarItem(
|
|
339
|
-
new UI.Toolbar.ToolbarSettingCheckbox(this.groupComputedStylesSetting, undefined, i18nString(UIStrings.group)));
|
|
340
|
-
|
|
341
344
|
this.linkifier = new Components.Linkifier.Linkifier(maxLinkLength);
|
|
342
345
|
|
|
343
346
|
this.imagePreviewPopover = new ImagePreviewPopover(this.contentElement, event => {
|
|
@@ -373,9 +376,12 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
373
376
|
this.#view(
|
|
374
377
|
{
|
|
375
378
|
computedStylesTree: this.#computedStylesTree,
|
|
376
|
-
toolbar: this.toolbarElement,
|
|
377
379
|
hasMatches,
|
|
378
380
|
computedStyleModel: this.computedStyleModel,
|
|
381
|
+
showInheritedComputedStylePropertiesSetting: this.showInheritedComputedStylePropertiesSetting,
|
|
382
|
+
groupComputedStylesSetting: this.groupComputedStylesSetting,
|
|
383
|
+
onFilterChanged: this.onFilterChanged.bind(this),
|
|
384
|
+
filterText: this.#filterText,
|
|
379
385
|
},
|
|
380
386
|
null, this.contentElement);
|
|
381
387
|
}
|
|
@@ -628,13 +634,14 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
628
634
|
return result;
|
|
629
635
|
}
|
|
630
636
|
|
|
631
|
-
private async onFilterChanged(event:
|
|
637
|
+
private async onFilterChanged(event: CustomEvent<string>): Promise<void> {
|
|
638
|
+
this.#filterText = event.detail;
|
|
632
639
|
await this.filterComputedStyles(
|
|
633
|
-
event.
|
|
640
|
+
event.detail ? new RegExp(Platform.StringUtilities.escapeForRegExp(event.detail), 'i') : null);
|
|
634
641
|
|
|
635
|
-
if (event.
|
|
642
|
+
if (event.detail && this.#computedStylesTree.data && this.#computedStylesTree.data.tree) {
|
|
636
643
|
UI.ARIAUtils.LiveAnnouncer.alert(i18nString(
|
|
637
|
-
UIStrings.filterUpdateAriaText, {PH1: event.
|
|
644
|
+
UIStrings.filterUpdateAriaText, {PH1: event.detail, PH2: this.#computedStylesTree.data.tree.length}));
|
|
638
645
|
}
|
|
639
646
|
}
|
|
640
647
|
|
|
@@ -646,6 +653,11 @@ export class ComputedStyleWidget extends UI.Widget.VBox {
|
|
|
646
653
|
return this.filterAlphabeticalList();
|
|
647
654
|
}
|
|
648
655
|
|
|
656
|
+
setFilterInput(text: string): void {
|
|
657
|
+
this.#filterText = text;
|
|
658
|
+
this.requestUpdate();
|
|
659
|
+
}
|
|
660
|
+
|
|
649
661
|
private nodeFilter(node: TreeOutline.TreeOutlineUtils.TreeNode<ComputedStyleData>): boolean {
|
|
650
662
|
const regex = this.filterRegex;
|
|
651
663
|
const data = node.treeNodeData;
|
|
@@ -106,7 +106,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
106
106
|
jslog=${VisualLogging.pane('element-states')}>
|
|
107
107
|
<div class="page-state-checkbox">
|
|
108
108
|
<devtools-checkbox class="small" title=${i18nString(UIStrings.emulatesAFocusedPage)}
|
|
109
|
-
|
|
109
|
+
${bindToSetting('emulate-page-focus')}>${
|
|
110
110
|
i18nString(UIStrings.emulateFocusedPage)}</devtools-checkbox>
|
|
111
111
|
<devtools-button
|
|
112
112
|
@click=${() => UIHelpers.openInNewTab('https://developer.chrome.com/docs/devtools/rendering/apply-effects#emulate_a_focused_page')}
|