chrome-devtools-frontend 1.0.1601661 → 1.0.1602348
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/.agents/skills/version-control/SKILL.md +71 -0
- package/front_end/core/host/InspectorFrontendHostStub.ts +0 -5
- package/front_end/core/root/Runtime.ts +0 -8
- package/front_end/core/sdk/DOMModel.ts +5 -4
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +6 -5
- package/front_end/generated/protocol.ts +36 -3
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +167 -9
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
- package/front_end/models/live-metrics/LiveMetrics.ts +51 -31
- package/front_end/panels/accessibility/ARIAAttributesView.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatInput.ts +3 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +15 -19
- package/front_end/panels/application/KeyValueStorageItemsView.ts +4 -4
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +2 -1
- package/front_end/panels/console_counters/WarningErrorCounter.ts +7 -14
- package/front_end/panels/elements/NodeStackTraceWidget.ts +2 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
- package/front_end/panels/network/RequestPayloadView.ts +2 -2
- package/front_end/panels/recorder/RecorderController.ts +4 -3
- package/front_end/panels/recorder/components/CreateRecordingView.ts +2 -1
- package/front_end/panels/recorder/components/RecordingView.ts +2 -2
- package/front_end/panels/recorder/models/RecordingPlayer.ts +3 -0
- package/front_end/panels/security/SecurityPanel.ts +3 -3
- package/front_end/panels/sensors/SensorsView.ts +131 -88
- package/front_end/panels/timeline/TimelineDetailsView.ts +6 -37
- package/front_end/panels/timeline/TimelineUIUtils.ts +0 -118
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +1 -1
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +2 -2
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +162 -9
- package/front_end/panels/timeline/components/timelineRangeSummaryView.css +20 -8
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -10
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- 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/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.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/revisions.js.map +1 -1
- 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 +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.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/revisions.js.map +1 -1
- 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/node/ChromeLauncher.ts +8 -0
- 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/legacy/Toolbar.ts +25 -3
- package/front_end/ui/legacy/Widget.ts +35 -40
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ import {Events as TextPromptEvents, TextPrompt} from './TextPrompt.js';
|
|
|
22
22
|
import toolbarStyles from './toolbar.css.js';
|
|
23
23
|
import {Tooltip} from './Tooltip.js';
|
|
24
24
|
import {bindCheckbox, CheckboxLabel, LongClickController} from './UIUtils.js';
|
|
25
|
+
import {Widget} from './Widget.js';
|
|
25
26
|
|
|
26
27
|
const UIStrings = {
|
|
27
28
|
/**
|
|
@@ -343,7 +344,12 @@ export class Toolbar extends HTMLElement {
|
|
|
343
344
|
item.applyEnabledState(false);
|
|
344
345
|
}
|
|
345
346
|
if (item.element.parentElement !== this) {
|
|
346
|
-
|
|
347
|
+
const widget = Widget.get(item.element);
|
|
348
|
+
if (widget) {
|
|
349
|
+
widget.show(this);
|
|
350
|
+
} else {
|
|
351
|
+
this.appendChild(item.element);
|
|
352
|
+
}
|
|
347
353
|
}
|
|
348
354
|
this.hideSeparatorDupes();
|
|
349
355
|
}
|
|
@@ -359,7 +365,14 @@ export class Toolbar extends HTMLElement {
|
|
|
359
365
|
if (!this.enabled) {
|
|
360
366
|
item.applyEnabledState(false);
|
|
361
367
|
}
|
|
362
|
-
|
|
368
|
+
if (item.element.parentElement !== this) {
|
|
369
|
+
const widget = Widget.get(item.element);
|
|
370
|
+
if (widget) {
|
|
371
|
+
widget.show(this, this.firstChild);
|
|
372
|
+
} else {
|
|
373
|
+
this.prepend(item.element);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
363
376
|
this.hideSeparatorDupes();
|
|
364
377
|
}
|
|
365
378
|
|
|
@@ -379,7 +392,12 @@ export class Toolbar extends HTMLElement {
|
|
|
379
392
|
const updatedItems = [];
|
|
380
393
|
for (const item of this.items) {
|
|
381
394
|
if (item === itemToRemove) {
|
|
382
|
-
item.element
|
|
395
|
+
const widget = Widget.get(item.element);
|
|
396
|
+
if (widget) {
|
|
397
|
+
widget.detach();
|
|
398
|
+
} else {
|
|
399
|
+
item.element.remove();
|
|
400
|
+
}
|
|
383
401
|
} else {
|
|
384
402
|
updatedItems.push(item);
|
|
385
403
|
}
|
|
@@ -390,6 +408,10 @@ export class Toolbar extends HTMLElement {
|
|
|
390
408
|
removeToolbarItems(): void {
|
|
391
409
|
for (const item of this.items) {
|
|
392
410
|
item.toolbar = null;
|
|
411
|
+
const widget = Widget.get(item.element);
|
|
412
|
+
if (widget) {
|
|
413
|
+
widget.detach();
|
|
414
|
+
}
|
|
393
415
|
}
|
|
394
416
|
this.items = [];
|
|
395
417
|
this.removeChildren();
|
|
@@ -149,53 +149,34 @@ function runNextUpdate(): void {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
#widgetParams?: Partial<WidgetT>;
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
|
+
const widgetConfigs = new WeakMap<WidgetElement<any>, WidgetConfig<any>>();
|
|
155
154
|
|
|
155
|
+
export class WidgetElement<WidgetT extends Widget> extends HTMLElement {
|
|
156
156
|
createWidget(): WidgetT {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
const config = widgetConfigs.get(this) as WidgetConfig<WidgetT>;
|
|
158
|
+
const widget = this.#instantiateWidget(config.widgetClass);
|
|
159
|
+
if (config.widgetParams) {
|
|
160
|
+
Object.assign(widget, config.widgetParams);
|
|
160
161
|
}
|
|
161
162
|
widget.requestUpdate();
|
|
162
163
|
return widget;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
#instantiateWidget(): WidgetT {
|
|
166
|
-
if (!
|
|
166
|
+
#instantiateWidget(widgetClass: WidgetFactory<WidgetT>): WidgetT {
|
|
167
|
+
if (!widgetClass) {
|
|
167
168
|
throw new Error('No widgetClass defined');
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
if (Widget.isPrototypeOf(
|
|
171
|
-
const ctor =
|
|
171
|
+
if (Widget.isPrototypeOf(widgetClass)) {
|
|
172
|
+
const ctor = widgetClass as WidgetConstructor<WidgetT>;
|
|
172
173
|
return new ctor(this);
|
|
173
174
|
}
|
|
174
175
|
|
|
175
|
-
const factory =
|
|
176
|
+
const factory = widgetClass as WidgetProducer<WidgetT>;
|
|
176
177
|
return factory(this);
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
set widgetConfig(config: WidgetConfig<WidgetT>) {
|
|
180
|
-
const widget = Widget.get(this);
|
|
181
|
-
if (widget && config.widgetParams) {
|
|
182
|
-
let needsUpdate = false;
|
|
183
|
-
for (const key in config.widgetParams) {
|
|
184
|
-
if (Object.prototype.hasOwnProperty.call(config.widgetParams, key) &&
|
|
185
|
-
config.widgetParams[key] !== this.#widgetParams?.[key]) {
|
|
186
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
187
|
-
(widget as any)[key] = config.widgetParams[key];
|
|
188
|
-
needsUpdate = true;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (needsUpdate) {
|
|
192
|
-
widget.requestUpdate();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
this.#widgetClass = config.widgetClass;
|
|
196
|
-
this.#widgetParams = config.widgetParams;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
180
|
getWidget(): WidgetT|undefined {
|
|
200
181
|
return Widget.get(this) as WidgetT | undefined;
|
|
201
182
|
}
|
|
@@ -252,14 +233,12 @@ export class WidgetElement<WidgetT extends Widget> extends HTMLElement {
|
|
|
252
233
|
}
|
|
253
234
|
|
|
254
235
|
override cloneNode(deep: boolean): Node {
|
|
255
|
-
const clone = cloneCustomElement(this, deep)
|
|
256
|
-
|
|
236
|
+
const clone = cloneCustomElement(this, deep) as WidgetElement<WidgetT>;
|
|
237
|
+
const config = widgetConfigs.get(this);
|
|
238
|
+
if (!config?.widgetClass) {
|
|
257
239
|
throw new Error('No widgetClass defined');
|
|
258
240
|
}
|
|
259
|
-
clone
|
|
260
|
-
widgetClass: this.#widgetClass,
|
|
261
|
-
widgetParams: this.#widgetParams,
|
|
262
|
-
};
|
|
241
|
+
widgetConfigs.set(clone, config);
|
|
263
242
|
return clone;
|
|
264
243
|
}
|
|
265
244
|
|
|
@@ -290,7 +269,24 @@ export class WidgetDirective extends Lit.Directive.Directive {
|
|
|
290
269
|
if (!(element instanceof WidgetElement)) {
|
|
291
270
|
throw new Error('Widget directive must be used on a devtools-widget element.');
|
|
292
271
|
}
|
|
293
|
-
|
|
272
|
+
const config = widgetConfig(widgetClass, widgetParams);
|
|
273
|
+
const oldConfig = widgetConfigs.get(element);
|
|
274
|
+
const widget = Widget.get(element);
|
|
275
|
+
if (widget && config.widgetParams) {
|
|
276
|
+
let needsUpdate = false;
|
|
277
|
+
for (const key in config.widgetParams) {
|
|
278
|
+
if (Object.prototype.hasOwnProperty.call(config.widgetParams, key) &&
|
|
279
|
+
config.widgetParams[key] !== oldConfig?.widgetParams?.[key]) {
|
|
280
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
281
|
+
(widget as any)[key] = config.widgetParams[key];
|
|
282
|
+
needsUpdate = true;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (needsUpdate) {
|
|
286
|
+
widget.requestUpdate();
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
widgetConfigs.set(element, config);
|
|
294
290
|
return Lit.nothing;
|
|
295
291
|
}
|
|
296
292
|
return this.render(widgetClass, widgetParams);
|
|
@@ -309,8 +305,7 @@ export class WidgetDirective extends Lit.Directive.Directive {
|
|
|
309
305
|
// which does not properly recreate the widget instance.
|
|
310
306
|
return Lit.Directives.repeat(
|
|
311
307
|
[widgetClass], () => widgetClass,
|
|
312
|
-
() => html`<devtools-widget
|
|
313
|
-
widgetConfig<F, ParamKeys>(widgetClass, widgetParams)}></devtools-widget>`);
|
|
308
|
+
() => html`<devtools-widget ${widget<F, ParamKeys>(widgetClass, widgetParams)}></devtools-widget>`);
|
|
314
309
|
}
|
|
315
310
|
}
|
|
316
311
|
|
package/package.json
CHANGED