chrome-devtools-frontend 1.0.1539972 → 1.0.1541552
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 +167 -151
- package/front_end/Tests.js +5 -1
- package/front_end/core/common/Revealer.ts +5 -0
- package/front_end/core/common/Settings.ts +106 -95
- package/front_end/core/host/InspectorFrontendHost.ts +10 -10
- package/front_end/core/sdk/NetworkManager.ts +16 -11
- package/front_end/core/sdk/sdk-meta.ts +0 -35
- package/front_end/entrypoints/main/MainImpl.ts +15 -7
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/foundation/README.md +10 -0
- package/front_end/foundation/Universe.ts +29 -0
- package/front_end/foundation/foundation.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +6 -3
- package/front_end/generated/SupportedCSSProperties.js +13 -0
- package/front_end/generated/protocol.ts +58 -2
- package/front_end/models/ai_assistance/BuiltInAi.ts +2 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +44 -34
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +121 -56
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +104 -62
- package/front_end/models/ai_assistance/performance/AIQueries.ts +56 -2
- package/front_end/{panels/issues → models/issues_manager}/IssueAggregator.ts +83 -65
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/trace/Processor.ts +5 -4
- package/front_end/models/trace/insights/types.ts +1 -1
- package/front_end/models/trace/types/TraceEvents.ts +1 -1
- package/front_end/models/workspace/IgnoreListManager.ts +41 -47
- package/front_end/models/workspace/workspace-meta.ts +40 -0
- package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +1 -1
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +4 -4
- package/front_end/panels/animation/AnimationUI.ts +28 -34
- package/front_end/panels/elements/ElementsTreeElement.ts +37 -9
- package/front_end/panels/elements/LayoutPane.ts +2 -2
- package/front_end/panels/elements/components/AdornerManager.ts +9 -9
- package/front_end/panels/elements/layoutPane.css +5 -9
- package/front_end/panels/event_listeners/EventListenersView.ts +1 -1
- package/front_end/panels/explain/components/ConsoleInsight.ts +498 -449
- package/front_end/panels/issues/AffectedResourcesView.ts +3 -4
- package/front_end/panels/issues/CorsIssueDetailsView.ts +1 -2
- package/front_end/panels/issues/IssueView.ts +1 -1
- package/front_end/panels/issues/IssuesPane.ts +12 -15
- package/front_end/panels/issues/issues.ts +0 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +2 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +149 -46
- package/front_end/panels/network/RequestTimingView.ts +13 -8
- package/front_end/panels/network/network-meta.ts +11 -0
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +1 -1
- package/front_end/panels/sources/breakpointsView.css +1 -1
- package/front_end/panels/sources/sourcesPanel.css +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +3 -3
- package/front_end/panels/timeline/TimelinePanel.ts +3 -3
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +16 -10
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +2 -0
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +46 -0
- package/front_end/ui/{components/docs/context_menu/basic.ts → legacy/ContextMenu.docs.ts} +58 -25
- package/front_end/ui/legacy/UIUtils.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +148 -125
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/mcp/mcp.ts +16 -0
- package/package.json +2 -1
- package/front_end/ui/components/docs/context_menu/basic.html +0 -45
- package/front_end/ui/components/docs/linkifier/simple-url.html +0 -25
- package/front_end/ui/components/docs/linkifier/simple-url.ts +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/basic.ts +0 -21
- package/front_end/ui/components/docs/panel_feedback/button.html +0 -25
- package/front_end/ui/components/docs/panel_feedback/button.ts +0 -19
- package/front_end/ui/components/docs/panel_introduction_steps/basic.html +0 -25
- package/front_end/ui/components/docs/panel_introduction_steps/basic.ts +0 -28
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-with-legend.ts +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.html +0 -20
- package/front_end/ui/components/docs/perf_piechart/basic-without-legend.ts +0 -18
- package/front_end/ui/components/docs/snackbars/basic.html +0 -17
- package/front_end/ui/components/docs/snackbars/basic.ts +0 -50
|
@@ -219,6 +219,8 @@ const DEFAULT_TOOLBAR_VIEW: ToolbarView = (input: ToolbarViewInput, output: unde
|
|
|
219
219
|
};
|
|
220
220
|
// clang-format on
|
|
221
221
|
|
|
222
|
+
const DEFAULT_DURATION = 100;
|
|
223
|
+
|
|
222
224
|
let animationTimelineInstance: AnimationTimeline;
|
|
223
225
|
export class AnimationTimeline extends UI.Widget.VBox implements
|
|
224
226
|
SDK.TargetManager.SDKModelObserver<SDK.AnimationModel.AnimationModel> {
|
|
@@ -233,7 +235,6 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
|
233
235
|
#clearButton!: UI.Toolbar.ToolbarButton;
|
|
234
236
|
#selectedGroup!: SDK.AnimationModel.AnimationGroup|null;
|
|
235
237
|
#renderQueue!: AnimationUI[];
|
|
236
|
-
#defaultDuration: number;
|
|
237
238
|
#duration: number;
|
|
238
239
|
#timelineControlsWidth: number;
|
|
239
240
|
readonly #nodesMap: Map<number, NodeUI>;
|
|
@@ -297,8 +298,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
|
297
298
|
i18nString(UIStrings.noEffectSelected), i18nString(UIStrings.selectAnEffectAboveToInspectAnd));
|
|
298
299
|
noEffectSelectedPlaceholder.show(timelineHint);
|
|
299
300
|
|
|
300
|
-
|
|
301
|
-
this.#duration = this.#defaultDuration;
|
|
301
|
+
this.#duration = DEFAULT_DURATION;
|
|
302
302
|
this.#nodesMap = new Map();
|
|
303
303
|
this.#uiAnimations = [];
|
|
304
304
|
this.#groupBuffer = [];
|
|
@@ -614,7 +614,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements
|
|
|
614
614
|
this.#nodesMap.clear();
|
|
615
615
|
this.#animationsMap.clear();
|
|
616
616
|
this.#animationsContainer.removeChildren();
|
|
617
|
-
this.#duration =
|
|
617
|
+
this.#duration = DEFAULT_DURATION;
|
|
618
618
|
this.#timelineScrubber.classList.add('hidden');
|
|
619
619
|
this.#gridHeader.classList.remove('scrubber-enabled');
|
|
620
620
|
this.#selectedGroup = null;
|
|
@@ -32,10 +32,10 @@ const str_ = i18n.i18n.registerUIStrings('panels/animation/AnimationUI.ts', UISt
|
|
|
32
32
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
33
33
|
|
|
34
34
|
interface CachedElement {
|
|
35
|
-
group:
|
|
36
|
-
animationLine:
|
|
37
|
-
keyframePoints: Record<number,
|
|
38
|
-
keyframeRender: Record<number,
|
|
35
|
+
group: SVGElement|null;
|
|
36
|
+
animationLine: SVGElement|null;
|
|
37
|
+
keyframePoints: Record<number, SVGElement>;
|
|
38
|
+
keyframeRender: Record<number, SVGElement>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export class AnimationUI {
|
|
@@ -43,15 +43,15 @@ export class AnimationUI {
|
|
|
43
43
|
#timeline: AnimationTimeline;
|
|
44
44
|
#keyframes?: SDK.AnimationModel.KeyframeStyle[];
|
|
45
45
|
#nameElement: HTMLElement;
|
|
46
|
-
readonly #svg:
|
|
47
|
-
#activeIntervalGroup:
|
|
48
|
-
#cachedElements: CachedElement[];
|
|
49
|
-
#movementInMs
|
|
50
|
-
#keyboardMovementRateMs
|
|
46
|
+
readonly #svg: SVGElement;
|
|
47
|
+
#activeIntervalGroup: SVGGElement;
|
|
48
|
+
#cachedElements: CachedElement[] = [];
|
|
49
|
+
#movementInMs = 0;
|
|
50
|
+
#keyboardMovementRateMs = 50;
|
|
51
51
|
#color: string;
|
|
52
52
|
#node?: SDK.DOMModel.DOMNode|null;
|
|
53
|
-
#delayLine?:
|
|
54
|
-
#endDelayLine?:
|
|
53
|
+
#delayLine?: SVGLineElement;
|
|
54
|
+
#endDelayLine?: SVGLineElement;
|
|
55
55
|
#tailGroup?: Element;
|
|
56
56
|
#mouseEventType?: Events;
|
|
57
57
|
#keyframeMoved?: number|null;
|
|
@@ -73,7 +73,7 @@ export class AnimationUI {
|
|
|
73
73
|
|
|
74
74
|
this.#svg = UI.UIUtils.createSVGChild(parentElement, 'svg', 'animation-ui');
|
|
75
75
|
this.#svg.setAttribute('height', Options.AnimationSVGHeight.toString());
|
|
76
|
-
|
|
76
|
+
this.#svg.style.marginLeft = '-' + Options.AnimationMargin + 'px';
|
|
77
77
|
this.#svg.addEventListener('contextmenu', this.onContextMenu.bind(this));
|
|
78
78
|
this.#activeIntervalGroup = UI.UIUtils.createSVGChild(this.#svg, 'g');
|
|
79
79
|
this.#activeIntervalGroup.setAttribute('jslog', `${VisualLogging.animationClip().track({drag: true})}`);
|
|
@@ -86,10 +86,6 @@ export class AnimationUI {
|
|
|
86
86
|
this.#activeIntervalGroup, this.keydownMove.bind(this, Events.ANIMATION_DRAG, null));
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
this.#cachedElements = [];
|
|
90
|
-
|
|
91
|
-
this.#movementInMs = 0;
|
|
92
|
-
this.#keyboardMovementRateMs = 50;
|
|
93
89
|
this.#color = AnimationUI.colorForAnimation(this.#animation);
|
|
94
90
|
}
|
|
95
91
|
|
|
@@ -125,19 +121,19 @@ export class AnimationUI {
|
|
|
125
121
|
this.#node = node;
|
|
126
122
|
}
|
|
127
123
|
|
|
128
|
-
private createLine(parentElement:
|
|
124
|
+
private createLine(parentElement: SVGElement, className: string): SVGLineElement {
|
|
129
125
|
const line = UI.UIUtils.createSVGChild(parentElement, 'line', className);
|
|
130
126
|
line.setAttribute('x1', Options.AnimationMargin.toString());
|
|
131
127
|
line.setAttribute('y1', Options.AnimationHeight.toString());
|
|
132
128
|
line.setAttribute('y2', Options.AnimationHeight.toString());
|
|
133
|
-
|
|
129
|
+
line.style.stroke = this.#color;
|
|
134
130
|
return line;
|
|
135
131
|
}
|
|
136
132
|
|
|
137
|
-
private drawAnimationLine(iteration: number, parentElement:
|
|
133
|
+
private drawAnimationLine(iteration: number, parentElement: SVGElement): void {
|
|
138
134
|
const cache = this.#cachedElements[iteration];
|
|
139
135
|
if (!cache.animationLine) {
|
|
140
|
-
cache.animationLine =
|
|
136
|
+
cache.animationLine = this.createLine(parentElement, 'animation-line');
|
|
141
137
|
}
|
|
142
138
|
if (!cache.animationLine) {
|
|
143
139
|
return;
|
|
@@ -147,7 +143,7 @@ export class AnimationUI {
|
|
|
147
143
|
'x2', (this.duration() * this.#timeline.pixelTimeRatio() + Options.AnimationMargin).toFixed(2));
|
|
148
144
|
}
|
|
149
145
|
|
|
150
|
-
private drawDelayLine(parentElement:
|
|
146
|
+
private drawDelayLine(parentElement: SVGElement): void {
|
|
151
147
|
if (!this.#delayLine || !this.#endDelayLine) {
|
|
152
148
|
this.#delayLine = this.createLine(parentElement, 'animation-delay-line');
|
|
153
149
|
this.#endDelayLine = this.createLine(parentElement, 'animation-delay-line');
|
|
@@ -164,7 +160,7 @@ export class AnimationUI {
|
|
|
164
160
|
this.#timeline.width(),
|
|
165
161
|
(this.delayOrStartTime() + this.duration() * this.#animation.source().iterations()) *
|
|
166
162
|
this.#timeline.pixelTimeRatio());
|
|
167
|
-
|
|
163
|
+
this.#endDelayLine.style.transform = 'translateX(' + leftMargin.toFixed(2) + 'px)';
|
|
168
164
|
this.#endDelayLine.setAttribute('x1', margin.toString());
|
|
169
165
|
this.#endDelayLine.setAttribute(
|
|
170
166
|
'x2',
|
|
@@ -179,10 +175,8 @@ export class AnimationUI {
|
|
|
179
175
|
return;
|
|
180
176
|
}
|
|
181
177
|
|
|
182
|
-
const circle =
|
|
183
|
-
|
|
184
|
-
parentElement, 'circle', keyframeIndex <= 0 ? 'animation-endpoint' : 'animation-keyframe-point') as
|
|
185
|
-
HTMLElement);
|
|
178
|
+
const circle = UI.UIUtils.createSVGChild(
|
|
179
|
+
parentElement, 'circle', keyframeIndex <= 0 ? 'animation-endpoint' : 'animation-keyframe-point');
|
|
186
180
|
circle.setAttribute('cx', x.toFixed(2));
|
|
187
181
|
circle.setAttribute('cy', Options.AnimationHeight.toString());
|
|
188
182
|
circle.style.stroke = this.#color;
|
|
@@ -221,10 +215,10 @@ export class AnimationUI {
|
|
|
221
215
|
}
|
|
222
216
|
|
|
223
217
|
private renderKeyframe(
|
|
224
|
-
iteration: number, keyframeIndex: number, parentElement:
|
|
218
|
+
iteration: number, keyframeIndex: number, parentElement: SVGElement, leftDistance: number, width: number,
|
|
225
219
|
easing: string): void {
|
|
226
|
-
function createStepLine(parentElement:
|
|
227
|
-
const line =
|
|
220
|
+
function createStepLine(parentElement: SVGElement, x: number, strokeColor: string): void {
|
|
221
|
+
const line = UI.UIUtils.createSVGChild(parentElement, 'line');
|
|
228
222
|
line.setAttribute('x1', x.toString());
|
|
229
223
|
line.setAttribute('x2', x.toString());
|
|
230
224
|
line.setAttribute('y1', Options.AnimationMargin.toString());
|
|
@@ -237,7 +231,7 @@ export class AnimationUI {
|
|
|
237
231
|
if (!cache[keyframeIndex]) {
|
|
238
232
|
const svg = bezier ? UI.UIUtils.createSVGChild(parentElement, 'path', 'animation-keyframe') :
|
|
239
233
|
UI.UIUtils.createSVGChild(parentElement, 'g', 'animation-keyframe-step');
|
|
240
|
-
cache[keyframeIndex] =
|
|
234
|
+
cache[keyframeIndex] = svg;
|
|
241
235
|
}
|
|
242
236
|
const group = cache[keyframeIndex];
|
|
243
237
|
group.tabIndex = 0;
|
|
@@ -269,14 +263,14 @@ export class AnimationUI {
|
|
|
269
263
|
const maxWidth = this.#timeline.width() - Options.AnimationMargin;
|
|
270
264
|
|
|
271
265
|
this.#svg.setAttribute('width', (maxWidth + 2 * Options.AnimationMargin).toFixed(2));
|
|
272
|
-
|
|
266
|
+
this.#activeIntervalGroup.style.transform =
|
|
273
267
|
'translateX(' + (this.delayOrStartTime() * this.#timeline.pixelTimeRatio()).toFixed(2) + 'px)';
|
|
274
268
|
|
|
275
269
|
this.#nameElement.style.transform = 'translateX(' +
|
|
276
270
|
(Math.max(this.delayOrStartTime(), 0) * this.#timeline.pixelTimeRatio() + Options.AnimationMargin).toFixed(2) +
|
|
277
271
|
'px)';
|
|
278
272
|
this.#nameElement.style.width = (this.duration() * this.#timeline.pixelTimeRatio()).toFixed(2) + 'px';
|
|
279
|
-
this.drawDelayLine(
|
|
273
|
+
this.drawDelayLine(this.#svg);
|
|
280
274
|
|
|
281
275
|
if (this.#animation.type() === 'CSSTransition') {
|
|
282
276
|
this.renderTransition();
|
|
@@ -307,7 +301,7 @@ export class AnimationUI {
|
|
|
307
301
|
}
|
|
308
302
|
|
|
309
303
|
private renderTransition(): void {
|
|
310
|
-
const activeIntervalGroup =
|
|
304
|
+
const activeIntervalGroup = this.#activeIntervalGroup;
|
|
311
305
|
if (!this.#cachedElements[0]) {
|
|
312
306
|
this.#cachedElements[0] = {animationLine: null, keyframePoints: {}, keyframeRender: {}, group: null};
|
|
313
307
|
}
|
|
@@ -326,7 +320,7 @@ export class AnimationUI {
|
|
|
326
320
|
animationLine: null,
|
|
327
321
|
keyframePoints: {},
|
|
328
322
|
keyframeRender: {},
|
|
329
|
-
group:
|
|
323
|
+
group: UI.UIUtils.createSVGChild(parentElement, 'g'),
|
|
330
324
|
};
|
|
331
325
|
}
|
|
332
326
|
const group = this.#cachedElements[iteration].group;
|
|
@@ -45,6 +45,7 @@ import type * as Elements from '../../models/elements/elements.js';
|
|
|
45
45
|
import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
46
46
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
47
47
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
48
|
+
import type {DirectiveResult} from '../../third_party/lit/lib/directive.js';
|
|
48
49
|
import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
49
50
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
50
51
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
@@ -351,10 +352,13 @@ export function isOpeningTag(context: TagTypeContext): context is OpeningTagCont
|
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
export interface ViewInput {
|
|
355
|
+
showAdAdorner: boolean;
|
|
354
356
|
adorners?: Set<Adorners.Adorner.Adorner>;
|
|
355
357
|
nodeInfo?: DocumentFragment;
|
|
356
358
|
|
|
357
359
|
onGutterClick: (e: Event) => void;
|
|
360
|
+
onAdornerAdded: (adorner: Adorners.Adorner.Adorner) => void;
|
|
361
|
+
onAdornerRemoved: (adorner: Adorners.Adorner.Adorner) => void;
|
|
358
362
|
}
|
|
359
363
|
|
|
360
364
|
export interface ViewOutput {
|
|
@@ -363,7 +367,23 @@ export interface ViewOutput {
|
|
|
363
367
|
contentElement?: HTMLElement;
|
|
364
368
|
}
|
|
365
369
|
|
|
370
|
+
function adornerRef(input: ViewInput): DirectiveResult<typeof Lit.Directives.RefDirective> {
|
|
371
|
+
let adorner: Adorners.Adorner.Adorner|undefined;
|
|
372
|
+
return ref((el?: Element) => {
|
|
373
|
+
if (adorner) {
|
|
374
|
+
input.onAdornerRemoved(adorner);
|
|
375
|
+
}
|
|
376
|
+
adorner = el as Adorners.Adorner.Adorner;
|
|
377
|
+
if (adorner) {
|
|
378
|
+
input.onAdornerAdded(adorner);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
|
|
366
383
|
export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement): void => {
|
|
384
|
+
const adAdornerConfig =
|
|
385
|
+
ElementsComponents.AdornerManager.getRegisteredAdorner(ElementsComponents.AdornerManager.RegisteredAdorners.AD);
|
|
386
|
+
const hasAdorners = input.adorners || input.showAdAdorner;
|
|
367
387
|
// clang-format off
|
|
368
388
|
render(html`
|
|
369
389
|
<div ${ref(el => { output.contentElement = el as HTMLElement; })}>
|
|
@@ -372,8 +392,14 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
372
392
|
<devtools-icon name="dots-horizontal"></devtools-icon>
|
|
373
393
|
<div class="hidden" ${ref(el => { output.decorationsElement = el as HTMLElement; })}></div>
|
|
374
394
|
</div>
|
|
375
|
-
${
|
|
376
|
-
${
|
|
395
|
+
${hasAdorners? html`<div class="adorner-container ${!hasAdorners ? 'hidden': ''}">
|
|
396
|
+
${input.showAdAdorner ? html`<devtools-adorner
|
|
397
|
+
.data=${{name: adAdornerConfig.name, jslogContext: adAdornerConfig.name}}
|
|
398
|
+
aria-label=${i18nString(UIStrings.thisFrameWasIdentifiedAsAnAd)}
|
|
399
|
+
${adornerRef(input)}>
|
|
400
|
+
<span>${adAdornerConfig.name}</span>
|
|
401
|
+
</devtools-adorner>` : nothing}
|
|
402
|
+
${repeat(Array.from((input.adorners ?? new Set()).values()).sort(adornerComparator), adorner => {
|
|
377
403
|
return adorner;
|
|
378
404
|
})}
|
|
379
405
|
</div>`: nothing}
|
|
@@ -442,13 +468,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
442
468
|
};
|
|
443
469
|
void this.updateStyleAdorners();
|
|
444
470
|
|
|
445
|
-
if (node.isAdFrameNode()) {
|
|
446
|
-
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
447
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.AD);
|
|
448
|
-
const adorner = this.adorn(config);
|
|
449
|
-
UI.Tooltip.Tooltip.install(adorner, i18nString(UIStrings.thisFrameWasIdentifiedAsAnAd));
|
|
450
|
-
}
|
|
451
|
-
|
|
452
471
|
void this.updateScrollAdorner();
|
|
453
472
|
}
|
|
454
473
|
this.expandAllButtonElement = null;
|
|
@@ -533,8 +552,17 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
533
552
|
DEFAULT_VIEW(
|
|
534
553
|
{
|
|
535
554
|
adorners: !this.isClosingTag() ? this.#adorners : undefined,
|
|
555
|
+
showAdAdorner:
|
|
556
|
+
ElementsPanel.instance().isAdornerEnabled(ElementsComponents.AdornerManager.RegisteredAdorners.AD) &&
|
|
557
|
+
this.nodeInternal.isAdFrameNode(),
|
|
536
558
|
nodeInfo: this.#nodeInfo,
|
|
537
559
|
onGutterClick: this.showContextMenu.bind(this),
|
|
560
|
+
onAdornerAdded: adorner => {
|
|
561
|
+
ElementsPanel.instance().registerAdorner(adorner);
|
|
562
|
+
},
|
|
563
|
+
onAdornerRemoved: adorner => {
|
|
564
|
+
ElementsPanel.instance().deregisterAdorner(adorner);
|
|
565
|
+
},
|
|
538
566
|
},
|
|
539
567
|
this, this.listItemElement);
|
|
540
568
|
}
|
|
@@ -312,7 +312,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
312
312
|
</div>
|
|
313
313
|
<div class="checkbox-settings">
|
|
314
314
|
${input.booleanSettings.map(setting =>
|
|
315
|
-
html`<devtools-checkbox
|
|
315
|
+
html`<div><devtools-checkbox
|
|
316
316
|
data-boolean-setting="true"
|
|
317
317
|
class="checkbox-label"
|
|
318
318
|
title=${setting.title}
|
|
@@ -320,7 +320,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
320
320
|
@change=${(e: Event) => input.onBooleanSettingChange(setting, e)}
|
|
321
321
|
jslog=${VisualLogging.toggle().track({click: true}).context(setting.name)}>
|
|
322
322
|
${setting.title}
|
|
323
|
-
</devtools-checkbox>`)}
|
|
323
|
+
</devtools-checkbox></div>`)}
|
|
324
324
|
</div>
|
|
325
325
|
</div>
|
|
326
326
|
${input.gridElements ?
|
|
@@ -22,20 +22,20 @@ export interface RegisteredAdorner {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export enum RegisteredAdorners {
|
|
25
|
+
AD = 'ad',
|
|
26
|
+
CONTAINER = 'container',
|
|
27
|
+
FLEX = 'flex',
|
|
25
28
|
GRID = 'grid',
|
|
26
|
-
SUBGRID = 'subgrid',
|
|
27
29
|
MASONRY = 'masonry',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
MEDIA = 'media',
|
|
31
|
+
POPOVER = 'popover',
|
|
32
|
+
REVEAL = 'reveal',
|
|
33
|
+
SCROLL = 'scroll',
|
|
30
34
|
SCROLL_SNAP = 'scroll-snap',
|
|
31
|
-
STARTING_STYLE = 'starting-style',
|
|
32
|
-
CONTAINER = 'container',
|
|
33
35
|
SLOT = 'slot',
|
|
36
|
+
STARTING_STYLE = 'starting-style',
|
|
37
|
+
SUBGRID = 'subgrid',
|
|
34
38
|
TOP_LAYER = 'top-layer',
|
|
35
|
-
REVEAL = 'reveal',
|
|
36
|
-
MEDIA = 'media',
|
|
37
|
-
SCROLL = 'scroll',
|
|
38
|
-
POPOVER = 'popover',
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -44,18 +44,14 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.checkbox-settings {
|
|
47
|
-
margin-top:
|
|
47
|
+
margin-top: var(--sys-size-5);
|
|
48
48
|
display: grid;
|
|
49
49
|
grid-template-columns: 1fr;
|
|
50
|
-
gap:
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.checkbox-settings devtools-checkbox {
|
|
54
|
-
margin-bottom: 8px;
|
|
55
|
-
}
|
|
50
|
+
gap: var(--sys-size-4);
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
> div {
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
devtools-checkbox {
|
|
@@ -315,7 +315,7 @@ export class ObjectEventListenerBar extends UI.TreeOutline.TreeElement {
|
|
|
315
315
|
|
|
316
316
|
const propertyValue = ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.createPropertyValue(
|
|
317
317
|
object, /* wasThrown */ false, /* showPreview */ false);
|
|
318
|
-
this.valueTitle = propertyValue
|
|
318
|
+
this.valueTitle = propertyValue;
|
|
319
319
|
title.appendChild(this.valueTitle);
|
|
320
320
|
|
|
321
321
|
if (this.#eventListener.canRemove()) {
|