chrome-devtools-frontend 1.0.1541169 → 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.
Files changed (36) hide show
  1. package/front_end/Tests.js +5 -1
  2. package/front_end/core/common/Settings.ts +106 -95
  3. package/front_end/entrypoints/main/MainImpl.ts +15 -7
  4. package/front_end/foundation/README.md +10 -0
  5. package/front_end/foundation/Universe.ts +29 -0
  6. package/front_end/foundation/foundation.ts +7 -0
  7. package/front_end/models/ai_assistance/BuiltInAi.ts +2 -1
  8. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +44 -34
  9. package/front_end/panels/ai_assistance/components/MarkdownRendererWithCodeBlock.ts +1 -1
  10. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +1 -1
  11. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -1
  12. package/front_end/third_party/puppeteer/README.chromium +2 -2
  13. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  14. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js +3 -1
  15. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/NetworkManager.js.map +1 -1
  16. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  17. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  18. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  19. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  20. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +4 -4
  21. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
  22. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js +3 -1
  23. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/NetworkManager.js.map +1 -1
  24. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  25. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  26. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  27. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  28. package/front_end/third_party/puppeteer/package/package.json +1 -1
  29. package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +3 -1
  30. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  31. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  32. package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -7
  33. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +43 -33
  34. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  35. package/mcp/mcp.ts +2 -0
  36. package/package.json +1 -1
@@ -159,7 +159,7 @@ export class MarkdownLitRenderer {
159
159
  return Lit.Directives.classMap(classInfo);
160
160
  }
161
161
 
162
- renderChildTokens(token: Marked.Marked.Token): Lit.TemplateResult[] {
162
+ renderChildTokens(token: Marked.Marked.Token): Lit.LitTemplate[] {
163
163
  if ('tokens' in token && token.tokens) {
164
164
  return token.tokens.map(token => this.renderToken(token));
165
165
  }
@@ -222,7 +222,7 @@ export class MarkdownLitRenderer {
222
222
  // clang-format on
223
223
  }
224
224
 
225
- templateForToken(token: Marked.Marked.MarkedToken): Lit.TemplateResult|null {
225
+ templateForToken(token: Marked.Marked.MarkedToken): Lit.LitTemplate|null {
226
226
  switch (token.type) {
227
227
  case 'paragraph':
228
228
  return html`<p class=${this.customClassMapForToken('paragraph')}>${this.renderChildTokens(token)}</p>`;
@@ -239,8 +239,7 @@ export class MarkdownLitRenderer {
239
239
  case 'code':
240
240
  return this.renderCodeBlock(token);
241
241
  case 'space':
242
- // eslint-disable-next-line lit/prefer-nothing
243
- return html``;
242
+ return Lit.nothing;
244
243
  case 'link':
245
244
  return html`<devtools-markdown-link
246
245
  class=${this.customClassMapForToken('link')}
@@ -266,7 +265,7 @@ export class MarkdownLitRenderer {
266
265
  }
267
266
  }
268
267
 
269
- renderToken(token: Marked.Marked.Token): Lit.TemplateResult {
268
+ renderToken(token: Marked.Marked.Token): Lit.LitTemplate {
270
269
  const template = this.templateForToken(token as Marked.Marked.MarkedToken);
271
270
  if (template === null) {
272
271
  throw new Error(`Markdown token type '${token.type}' not supported.`);
@@ -287,7 +286,7 @@ export class MarkdownInsightRenderer extends MarkdownLitRenderer {
287
286
  this.addCustomClasses({heading: 'insight'});
288
287
  }
289
288
 
290
- override renderToken(token: Marked.Marked.Token): Lit.TemplateResult {
289
+ override renderToken(token: Marked.Marked.Token): Lit.LitTemplate {
291
290
  const template = this.templateForToken(token as Marked.Marked.MarkedToken);
292
291
  if (template === null) {
293
292
  return html`${token.raw}`;
@@ -322,7 +321,7 @@ export class MarkdownInsightRenderer extends MarkdownLitRenderer {
322
321
  return '';
323
322
  }
324
323
 
325
- override templateForToken(token: Marked.Marked.Token): Lit.TemplateResult|null {
324
+ override templateForToken(token: Marked.Marked.Token): Lit.LitTemplate|null {
326
325
  switch (token.type) {
327
326
  case 'heading':
328
327
  return this.renderHeading(token as Marked.Marked.Tokens.Heading);
@@ -320,6 +320,7 @@ class ArrayGroupTreeNode extends ObjectTreeNodeBase {
320
320
  }
321
321
 
322
322
  export class ObjectTreeNode extends ObjectTreeNodeBase {
323
+ #path?: string;
323
324
  constructor(
324
325
  readonly property: SDK.RemoteObject.RemoteObjectProperty,
325
326
  propertiesMode: ObjectPropertiesMode = ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
@@ -336,6 +337,31 @@ export class ObjectTreeNode extends ObjectTreeNodeBase {
336
337
  return this.property.name;
337
338
  }
338
339
 
340
+ get path(): string {
341
+ if (!this.#path) {
342
+ if (this.property.synthetic) {
343
+ this.#path = this.name;
344
+ return this.name;
345
+ }
346
+
347
+ // https://tc39.es/ecma262/#prod-IdentifierName
348
+ const useDotNotation = /^(?:[$_\p{ID_Start}])(?:[$_\u200C\u200D\p{ID_Continue}])*$/u;
349
+ const isInteger = /^(?:0|[1-9]\d*)$/;
350
+
351
+ const parentPath =
352
+ (this.parent instanceof ObjectTreeNode && !this.parent.property.synthetic) ? this.parent.path : '';
353
+
354
+ if (this.property.private || useDotNotation.test(this.name)) {
355
+ this.#path = parentPath ? `${parentPath}.${this.name}` : this.name;
356
+ } else if (isInteger.test(this.name)) {
357
+ this.#path = `${parentPath}[${this.name}]`;
358
+ } else {
359
+ this.#path = `${parentPath}[${JSON.stringify(this.name)}]`;
360
+ }
361
+ }
362
+ return this.#path;
363
+ }
364
+
339
365
  override selfOrParentIfInternal(): ObjectTreeNodeBase {
340
366
  return this.name === '[[Prototype]]' ? (this.parent ?? this) : this;
341
367
  }
@@ -830,6 +856,11 @@ export class RootElement extends UI.TreeOutline.TreeElement {
830
856
  this.listItemElement.addEventListener('contextmenu', this.onContextMenu.bind(this), false);
831
857
  }
832
858
 
859
+ override invalidateChildren(): void {
860
+ super.invalidateChildren();
861
+ this.object.removeChildren();
862
+ }
863
+
833
864
  override onexpand(): void {
834
865
  if (this.treeOutline) {
835
866
  this.treeOutline.element.classList.add('expanded');
@@ -1189,8 +1220,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
1189
1220
  if (this.property.property.synthetic) {
1190
1221
  this.nameElement.classList.add('synthetic-property');
1191
1222
  }
1192
-
1193
- this.updatePropertyPath();
1223
+ this.nameElement.title = this.property.path;
1194
1224
 
1195
1225
  const isInternalEntries = this.property.property.synthetic && this.property.name === '[[Entries]]';
1196
1226
  if (isInternalEntries) {
@@ -1200,7 +1230,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
1200
1230
  const showPreview = this.property.name !== '[[Prototype]]';
1201
1231
  this.propertyValue = ObjectPropertiesSection.createPropertyValueWithCustomSupport(
1202
1232
  this.property.object, this.property.property.wasThrown, showPreview, this.linkifier,
1203
- this.property.property.synthetic, this.path() /* variableName */);
1233
+ this.property.property.synthetic, this.property.path /* variableName */);
1204
1234
  this.valueElement = this.propertyValue;
1205
1235
  } else if (this.property.property.getter) {
1206
1236
  this.valueElement = document.createElement('span');
@@ -1254,36 +1284,6 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
1254
1284
  this.listItemElement.appendChild(this.rowContainer);
1255
1285
  }
1256
1286
 
1257
- private updatePropertyPath(): void {
1258
- if (this.nameElement.title) {
1259
- return;
1260
- }
1261
-
1262
- const name = this.property.name;
1263
-
1264
- if (this.property.property.synthetic) {
1265
- UI.Tooltip.Tooltip.install(this.nameElement, name);
1266
- return;
1267
- }
1268
-
1269
- // https://tc39.es/ecma262/#prod-IdentifierName
1270
- const useDotNotation = /^(?:[$_\p{ID_Start}])(?:[$_\u200C\u200D\p{ID_Continue}])*$/u;
1271
- const isInteger = /^(?:0|[1-9]\d*)$/;
1272
-
1273
- const parentPath = (this.parent instanceof ObjectPropertyTreeElement && this.parent.nameElement &&
1274
- !this.parent.property.property.synthetic) ?
1275
- this.parent.nameElement.title :
1276
- '';
1277
-
1278
- if (this.property.property.private || useDotNotation.test(name)) {
1279
- UI.Tooltip.Tooltip.install(this.nameElement, parentPath ? `${parentPath}.${name}` : name);
1280
- } else if (isInteger.test(name)) {
1281
- UI.Tooltip.Tooltip.install(this.nameElement, `${parentPath}[${name}]`);
1282
- } else {
1283
- UI.Tooltip.Tooltip.install(this.nameElement, `${parentPath}[${JSON.stringify(name)}]`);
1284
- }
1285
- }
1286
-
1287
1287
  getContextMenu(event: Event): UI.ContextMenu.ContextMenu {
1288
1288
  const contextMenu = new UI.ContextMenu.ContextMenu(event);
1289
1289
  contextMenu.appendApplicableItems(this);
@@ -1449,6 +1449,11 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
1449
1449
  }
1450
1450
  }
1451
1451
 
1452
+ override invalidateChildren(): void {
1453
+ super.invalidateChildren();
1454
+ this.property.removeChildren();
1455
+ }
1456
+
1452
1457
  private onInvokeGetterClick(result: SDK.RemoteObject.CallFunctionResult): void {
1453
1458
  if (!result.object) {
1454
1459
  return;
@@ -1642,6 +1647,11 @@ export class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
1642
1647
  ObjectPropertyTreeElement.populateWithProperties(treeNode, children, false, false, linkifier);
1643
1648
  }
1644
1649
 
1650
+ override invalidateChildren(): void {
1651
+ super.invalidateChildren();
1652
+ this.#child.removeChildren();
1653
+ }
1654
+
1645
1655
  override async onpopulate(): Promise<void> {
1646
1656
  this.removeChildren();
1647
1657
  this.#child.removeChildren();
@@ -3831,6 +3831,7 @@ export const knownContextValues = new Set([
3831
3831
  'timeline.annotation-sidebar.delete',
3832
3832
  'timeline.annotations-tab',
3833
3833
  'timeline.annotations.',
3834
+ 'timeline.annotations.ai-generate-label',
3834
3835
  'timeline.annotations.create-entries-link',
3835
3836
  'timeline.annotations.create-entry-label',
3836
3837
  'timeline.annotations.create-entry-link',
package/mcp/mcp.ts CHANGED
@@ -10,6 +10,7 @@
10
10
  export * as Common from '../front_end/core/common/common.js';
11
11
  export * as I18n from '../front_end/core/i18n/i18n.js';
12
12
  export {ConnectionTransport} from '../front_end/core/protocol_client/ConnectionTransport.js';
13
+ export * as Foundation from '../front_end/foundation/foundation.js';
13
14
  export {
14
15
  PerformanceInsightFormatter
15
16
  } from '../front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js';
@@ -30,4 +31,5 @@ export {
30
31
  IssuesManager
31
32
  } from '../front_end/models/issues_manager/IssuesManager.js';
32
33
  export {findTitleFromMarkdownAst} from '../front_end/models/issues_manager/MarkdownIssueDescription.js';
34
+ export * as TraceEngine from '../front_end/models/trace/trace.js';
33
35
  export * as Marked from '../front_end/third_party/marked/marked.js';
package/package.json CHANGED
@@ -103,5 +103,5 @@
103
103
  "flat-cache": "6.1.12"
104
104
  }
105
105
  },
106
- "version": "1.0.1541169"
106
+ "version": "1.0.1541552"
107
107
  }