chrome-devtools-frontend 1.0.930109 → 1.0.930993

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 (61) hide show
  1. package/config/gni/devtools_grd_files.gni +2 -1
  2. package/front_end/core/host/InspectorFrontendHost.ts +8 -1
  3. package/front_end/core/host/InspectorFrontendHostAPI.ts +12 -0
  4. package/front_end/core/i18n/locales/en-US.json +3 -0
  5. package/front_end/core/i18n/locales/en-XL.json +3 -0
  6. package/front_end/core/protocol_client/InspectorBackend.ts +71 -71
  7. package/front_end/core/sdk/NetworkManager.ts +6 -2
  8. package/front_end/devtools_compatibility.js +8 -0
  9. package/front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js +2 -2
  10. package/front_end/legacy_test_runner/test_runner/TestRunner.js +2 -3
  11. package/front_end/models/bindings/BreakpointManager.ts +158 -154
  12. package/front_end/models/bindings/CSSWorkspaceBinding.ts +64 -56
  13. package/front_end/models/bindings/CompilerScriptMapping.ts +70 -70
  14. package/front_end/models/bindings/ContentProviderBasedProject.ts +20 -20
  15. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +132 -132
  16. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +73 -72
  17. package/front_end/models/bindings/DefaultScriptMapping.ts +22 -22
  18. package/front_end/models/bindings/FileUtils.ts +81 -81
  19. package/front_end/models/bindings/IgnoreListManager.ts +17 -17
  20. package/front_end/models/bindings/LiveLocation.ts +21 -21
  21. package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +28 -28
  22. package/front_end/models/bindings/ResourceMapping.ts +50 -50
  23. package/front_end/models/bindings/ResourceScriptMapping.ts +71 -71
  24. package/front_end/models/bindings/SASSSourceMapping.ts +32 -32
  25. package/front_end/models/bindings/StylesSourceMapping.ts +57 -57
  26. package/front_end/models/bindings/TempFile.ts +34 -34
  27. package/front_end/models/emulation/DeviceModeModel.ts +208 -203
  28. package/front_end/models/emulation/EmulatedDevices.ts +34 -34
  29. package/front_end/panels/console/ConsoleView.ts +2 -1
  30. package/front_end/panels/console/ConsoleViewMessage.ts +3 -3
  31. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +133 -133
  32. package/front_end/panels/css_overview/CSSOverviewModel.ts +16 -16
  33. package/front_end/panels/css_overview/CSSOverviewPanel.ts +77 -77
  34. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +5 -5
  35. package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
  36. package/front_end/panels/elements/ElementsTreeElement.ts +6 -10
  37. package/front_end/panels/elements/ElementsTreeOutline.ts +3 -1
  38. package/front_end/panels/elements/components/LayoutPane.ts +6 -0
  39. package/front_end/panels/elements/elementsPanel.css +0 -1
  40. package/front_end/panels/elements/elementsTreeOutline.css +0 -4
  41. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +7 -2
  42. package/front_end/panels/network/BlockedURLsPane.ts +8 -5
  43. package/front_end/panels/network/blockedURLsPane.css +0 -1
  44. package/front_end/panels/search/SearchView.ts +0 -2
  45. package/front_end/panels/sources/BreakpointEditDialog.ts +98 -81
  46. package/front_end/panels/sources/DebuggerPlugin.ts +15 -14
  47. package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +18 -2
  48. package/front_end/ui/components/text_editor/config.ts +6 -0
  49. package/front_end/ui/components/text_editor/cursor_tooltip.ts +70 -0
  50. package/front_end/ui/components/text_editor/javascript.ts +590 -0
  51. package/front_end/ui/components/text_editor/text_editor.ts +1 -0
  52. package/front_end/ui/components/text_editor/theme.ts +11 -0
  53. package/front_end/ui/components/tree_outline/TreeOutline.ts +3 -1
  54. package/front_end/ui/legacy/ARIAUtils.ts +24 -8
  55. package/front_end/ui/legacy/components/text_editor/cmdevtools.css +1 -0
  56. package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -3
  57. package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -2
  58. package/package.json +1 -1
  59. package/scripts/migration/class-fields/migrate.js +15 -2
  60. package/scripts/migration/class-fields/migrate.sh +10 -0
  61. package/front_end/ui/legacy/components/text_editor/SyntaxHighlighter.ts +0 -62
@@ -49,8 +49,8 @@ export class EmulatedDevice {
49
49
  isDualScreen: boolean;
50
50
  verticalSpanned: Orientation;
51
51
  horizontalSpanned: Orientation;
52
- private showInternal: string;
53
- private showByDefault: boolean;
52
+ #showInternal: string;
53
+ #showByDefault: boolean;
54
54
 
55
55
  constructor() {
56
56
  this.title = '';
@@ -67,8 +67,8 @@ export class EmulatedDevice {
67
67
  this.verticalSpanned = {width: 0, height: 0, outlineInsets: null, outlineImage: null, hinge: null};
68
68
  this.horizontalSpanned = {width: 0, height: 0, outlineInsets: null, outlineImage: null, hinge: null};
69
69
 
70
- this.showInternal = _Show.Default;
71
- this.showByDefault = true;
70
+ this.#showInternal = _Show.Default;
71
+ this.#showByDefault = true;
72
72
  }
73
73
 
74
74
  static fromJSONV1(json: any): EmulatedDevice|null {
@@ -251,8 +251,8 @@ export class EmulatedDevice {
251
251
  mode.image = (parseValue(modes[i], 'image', 'string', null) as string);
252
252
  result.modes.push(mode);
253
253
  }
254
- result.showByDefault = (parseValue(json, 'show-by-default', 'boolean', undefined) as boolean);
255
- result.showInternal = (parseValue(json, 'show', 'string', _Show.Default) as string);
254
+ result.#showByDefault = (parseValue(json, 'show-by-default', 'boolean', undefined) as boolean);
255
+ result.#showInternal = (parseValue(json, 'show', 'string', _Show.Default) as string);
256
256
 
257
257
  return result;
258
258
  } catch (e) {
@@ -350,9 +350,9 @@ export class EmulatedDevice {
350
350
  json['modes'].push(mode);
351
351
  }
352
352
 
353
- json['show-by-default'] = this.showByDefault;
353
+ json['show-by-default'] = this.#showByDefault;
354
354
  json['dual-screen'] = this.isDualScreen;
355
- json['show'] = this.showInternal;
355
+ json['show'] = this.#showInternal;
356
356
 
357
357
  if (this.userAgentMetadata) {
358
358
  json['user-agent-metadata'] = this.userAgentMetadata;
@@ -441,18 +441,18 @@ export class EmulatedDevice {
441
441
  }
442
442
  }
443
443
  show(): boolean {
444
- if (this.showInternal === _Show.Default) {
445
- return this.showByDefault;
444
+ if (this.#showInternal === _Show.Default) {
445
+ return this.#showByDefault;
446
446
  }
447
- return this.showInternal === _Show.Always;
447
+ return this.#showInternal === _Show.Always;
448
448
  }
449
449
 
450
450
  setShow(show: boolean): void {
451
- this.showInternal = show ? _Show.Always : _Show.Never;
451
+ this.#showInternal = show ? _Show.Always : _Show.Never;
452
452
  }
453
453
 
454
454
  copyShowFrom(other: EmulatedDevice): void {
455
- this.showInternal = other.showInternal;
455
+ this.#showInternal = other.#showInternal;
456
456
  }
457
457
 
458
458
  touch(): boolean {
@@ -495,21 +495,21 @@ export const _Show = {
495
495
  let _instance: EmulatedDevicesList;
496
496
 
497
497
  export class EmulatedDevicesList extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
498
- private readonly standardSetting: Common.Settings.Setting<any[]>;
499
- private standardInternal: Set<EmulatedDevice>;
500
- private readonly customSetting: Common.Settings.Setting<any[]>;
501
- private readonly customInternal: Set<EmulatedDevice>;
498
+ readonly #standardSetting: Common.Settings.Setting<any[]>;
499
+ #standardInternal: Set<EmulatedDevice>;
500
+ readonly #customSetting: Common.Settings.Setting<any[]>;
501
+ readonly #customInternal: Set<EmulatedDevice>;
502
502
  constructor() {
503
503
  super();
504
504
 
505
- this.standardSetting = Common.Settings.Settings.instance().createSetting('standardEmulatedDeviceList', []);
506
- this.standardInternal = new Set();
507
- this.listFromJSONV1(this.standardSetting.get(), this.standardInternal);
505
+ this.#standardSetting = Common.Settings.Settings.instance().createSetting('standardEmulatedDeviceList', []);
506
+ this.#standardInternal = new Set();
507
+ this.listFromJSONV1(this.#standardSetting.get(), this.#standardInternal);
508
508
  this.updateStandardDevices();
509
509
 
510
- this.customSetting = Common.Settings.Settings.instance().createSetting('customEmulatedDeviceList', []);
511
- this.customInternal = new Set();
512
- if (!this.listFromJSONV1(this.customSetting.get(), this.customInternal)) {
510
+ this.#customSetting = Common.Settings.Settings.instance().createSetting('customEmulatedDeviceList', []);
511
+ this.#customInternal = new Set();
512
+ if (!this.listFromJSONV1(this.#customSetting.get(), this.#customInternal)) {
513
513
  this.saveCustomDevices();
514
514
  }
515
515
  }
@@ -529,8 +529,8 @@ export class EmulatedDevicesList extends Common.ObjectWrapper.ObjectWrapper<Even
529
529
  devices.add(device);
530
530
  }
531
531
  }
532
- this.copyShowValues(this.standardInternal, devices);
533
- this.standardInternal = devices;
532
+ this.copyShowValues(this.#standardInternal, devices);
533
+ this.#standardInternal = devices;
534
534
  this.saveStandardDevices();
535
535
  }
536
536
 
@@ -555,40 +555,40 @@ export class EmulatedDevicesList extends Common.ObjectWrapper.ObjectWrapper<Even
555
555
  }
556
556
 
557
557
  standard(): EmulatedDevice[] {
558
- return [...this.standardInternal];
558
+ return [...this.#standardInternal];
559
559
  }
560
560
 
561
561
  custom(): EmulatedDevice[] {
562
- return [...this.customInternal];
562
+ return [...this.#customInternal];
563
563
  }
564
564
 
565
565
  revealCustomSetting(): void {
566
- Common.Revealer.reveal(this.customSetting);
566
+ Common.Revealer.reveal(this.#customSetting);
567
567
  }
568
568
 
569
569
  addCustomDevice(device: EmulatedDevice): void {
570
- this.customInternal.add(device);
570
+ this.#customInternal.add(device);
571
571
  this.saveCustomDevices();
572
572
  }
573
573
 
574
574
  removeCustomDevice(device: EmulatedDevice): void {
575
- this.customInternal.delete(device);
575
+ this.#customInternal.delete(device);
576
576
  this.saveCustomDevices();
577
577
  }
578
578
 
579
579
  saveCustomDevices(): void {
580
580
  const json: any[] = [];
581
- this.customInternal.forEach(device => json.push(device.toJSON()));
581
+ this.#customInternal.forEach(device => json.push(device.toJSON()));
582
582
 
583
- this.customSetting.set(json);
583
+ this.#customSetting.set(json);
584
584
  this.dispatchEventToListeners(Events.CustomDevicesUpdated);
585
585
  }
586
586
 
587
587
  saveStandardDevices(): void {
588
588
  const json: any[] = [];
589
- this.standardInternal.forEach(device => json.push(device.toJSON()));
589
+ this.#standardInternal.forEach(device => json.push(device.toJSON()));
590
590
 
591
- this.standardSetting.set(json);
591
+ this.#standardSetting.set(json);
592
592
  this.dispatchEventToListeners(Events.StandardDevicesUpdated);
593
593
  }
594
594
 
@@ -41,6 +41,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
41
41
  import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
42
42
  import * as Logs from '../../models/logs/logs.js';
43
43
  import * as TextUtils from '../../models/text_utils/text_utils.js';
44
+ import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
44
45
  import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
45
46
  // eslint-disable-next-line rulesdir/es_modules_import
46
47
  import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
@@ -676,7 +677,7 @@ export class ConsoleView extends UI.Widget.VBox implements UI.SearchableView.Sea
676
677
  super.wasShown();
677
678
  this.updateIssuesToolbarItem();
678
679
  this.viewport.refresh();
679
- this.registerCSSFiles([consoleViewStyles, objectValueStyles]);
680
+ this.registerCSSFiles([consoleViewStyles, objectValueStyles, CodeHighlighter.Style.default]);
680
681
  }
681
682
 
682
683
  focus(): void {
@@ -42,11 +42,11 @@ import type * as IssuesManager from '../../models/issues_manager/issues_manager.
42
42
  import * as Logs from '../../models/logs/logs.js';
43
43
  import * as TextUtils from '../../models/text_utils/text_utils.js';
44
44
  import * as Workspace from '../../models/workspace/workspace.js';
45
+ import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
45
46
  import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
46
47
  import * as RequestLinkIcon from '../../ui/components/request_link_icon/request_link_icon.js';
47
48
  import * as DataGrid from '../../ui/legacy/components/data_grid/data_grid.js';
48
49
  import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
49
- import * as TextEditor from '../../ui/legacy/components/text_editor/text_editor.js';
50
50
  import * as Components from '../../ui/legacy/components/utils/utils.js';
51
51
  import * as UI from '../../ui/legacy/legacy.js';
52
52
  import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
@@ -1925,8 +1925,8 @@ export class ConsoleCommand extends ConsoleViewMessage {
1925
1925
  newContentElement.appendChild(this.formattedCommand);
1926
1926
 
1927
1927
  if (this.formattedCommand.textContent.length < MaxLengthToIgnoreHighlighter) {
1928
- const javascriptSyntaxHighlighter = new TextEditor.SyntaxHighlighter.SyntaxHighlighter('text/javascript', true);
1929
- javascriptSyntaxHighlighter.syntaxHighlightNode(this.formattedCommand).then(this.updateSearch.bind(this));
1928
+ CodeHighlighter.CodeHighlighter.highlightNode(this.formattedCommand, 'text/javascript')
1929
+ .then(this.updateSearch.bind(this));
1930
1930
  } else {
1931
1931
  this.updateSearch();
1932
1932
  }