chrome-devtools-frontend 1.0.921565 → 1.0.922782

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 (172) hide show
  1. package/front_end/core/common/Settings.ts +8 -1
  2. package/front_end/core/i18n/locales/af.json +53 -32
  3. package/front_end/core/i18n/locales/am.json +56 -35
  4. package/front_end/core/i18n/locales/ar.json +53 -32
  5. package/front_end/core/i18n/locales/as.json +63 -42
  6. package/front_end/core/i18n/locales/az.json +53 -32
  7. package/front_end/core/i18n/locales/be.json +52 -31
  8. package/front_end/core/i18n/locales/bg.json +51 -30
  9. package/front_end/core/i18n/locales/bn.json +63 -42
  10. package/front_end/core/i18n/locales/bs.json +57 -36
  11. package/front_end/core/i18n/locales/ca.json +55 -34
  12. package/front_end/core/i18n/locales/cs.json +51 -30
  13. package/front_end/core/i18n/locales/cy.json +63 -42
  14. package/front_end/core/i18n/locales/da.json +55 -34
  15. package/front_end/core/i18n/locales/de.json +52 -31
  16. package/front_end/core/i18n/locales/el.json +58 -37
  17. package/front_end/core/i18n/locales/en-GB.json +51 -30
  18. package/front_end/core/i18n/locales/es-419.json +53 -32
  19. package/front_end/core/i18n/locales/es.json +52 -31
  20. package/front_end/core/i18n/locales/et.json +54 -33
  21. package/front_end/core/i18n/locales/eu.json +71 -50
  22. package/front_end/core/i18n/locales/fa.json +54 -33
  23. package/front_end/core/i18n/locales/fi.json +55 -34
  24. package/front_end/core/i18n/locales/fil.json +59 -38
  25. package/front_end/core/i18n/locales/fr-CA.json +52 -31
  26. package/front_end/core/i18n/locales/fr.json +54 -33
  27. package/front_end/core/i18n/locales/gl.json +57 -36
  28. package/front_end/core/i18n/locales/gu.json +65 -44
  29. package/front_end/core/i18n/locales/he.json +56 -35
  30. package/front_end/core/i18n/locales/hi.json +61 -40
  31. package/front_end/core/i18n/locales/hr.json +55 -34
  32. package/front_end/core/i18n/locales/hu.json +53 -32
  33. package/front_end/core/i18n/locales/hy.json +54 -33
  34. package/front_end/core/i18n/locales/id.json +59 -38
  35. package/front_end/core/i18n/locales/is.json +51 -30
  36. package/front_end/core/i18n/locales/it.json +51 -30
  37. package/front_end/core/i18n/locales/ja.json +52 -31
  38. package/front_end/core/i18n/locales/ka.json +51 -30
  39. package/front_end/core/i18n/locales/kk.json +56 -35
  40. package/front_end/core/i18n/locales/km.json +59 -38
  41. package/front_end/core/i18n/locales/kn.json +63 -42
  42. package/front_end/core/i18n/locales/ko.json +59 -38
  43. package/front_end/core/i18n/locales/ky.json +54 -33
  44. package/front_end/core/i18n/locales/lo.json +59 -38
  45. package/front_end/core/i18n/locales/lt.json +52 -31
  46. package/front_end/core/i18n/locales/lv.json +60 -39
  47. package/front_end/core/i18n/locales/mk.json +51 -30
  48. package/front_end/core/i18n/locales/ml.json +65 -44
  49. package/front_end/core/i18n/locales/mn.json +59 -38
  50. package/front_end/core/i18n/locales/mr.json +61 -40
  51. package/front_end/core/i18n/locales/ms.json +59 -38
  52. package/front_end/core/i18n/locales/my.json +59 -38
  53. package/front_end/core/i18n/locales/ne.json +63 -42
  54. package/front_end/core/i18n/locales/nl.json +55 -34
  55. package/front_end/core/i18n/locales/no.json +54 -33
  56. package/front_end/core/i18n/locales/or.json +63 -42
  57. package/front_end/core/i18n/locales/pa.json +61 -40
  58. package/front_end/core/i18n/locales/pl.json +51 -30
  59. package/front_end/core/i18n/locales/pt-PT.json +52 -31
  60. package/front_end/core/i18n/locales/pt.json +59 -38
  61. package/front_end/core/i18n/locales/ro.json +52 -31
  62. package/front_end/core/i18n/locales/ru.json +52 -31
  63. package/front_end/core/i18n/locales/si.json +59 -38
  64. package/front_end/core/i18n/locales/sk.json +52 -31
  65. package/front_end/core/i18n/locales/sl.json +52 -31
  66. package/front_end/core/i18n/locales/sq.json +51 -30
  67. package/front_end/core/i18n/locales/sr-Latn.json +52 -31
  68. package/front_end/core/i18n/locales/sr.json +52 -31
  69. package/front_end/core/i18n/locales/sv.json +52 -31
  70. package/front_end/core/i18n/locales/sw.json +60 -39
  71. package/front_end/core/i18n/locales/ta.json +67 -46
  72. package/front_end/core/i18n/locales/te.json +62 -41
  73. package/front_end/core/i18n/locales/th.json +52 -31
  74. package/front_end/core/i18n/locales/tr.json +55 -34
  75. package/front_end/core/i18n/locales/uk.json +55 -34
  76. package/front_end/core/i18n/locales/ur.json +60 -39
  77. package/front_end/core/i18n/locales/uz.json +52 -31
  78. package/front_end/core/i18n/locales/vi.json +54 -33
  79. package/front_end/core/i18n/locales/zh-HK.json +52 -31
  80. package/front_end/core/i18n/locales/zh-TW.json +57 -36
  81. package/front_end/core/i18n/locales/zh.json +56 -35
  82. package/front_end/core/i18n/locales/zu.json +59 -38
  83. package/front_end/core/sdk/FrameManager.ts +2 -2
  84. package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
  85. package/front_end/entrypoints/js_app/JsMain.ts +1 -1
  86. package/front_end/entrypoints/node_main/NodeMain.ts +1 -1
  87. package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
  88. package/front_end/models/emulation/DeviceModeModel.ts +1 -1
  89. package/front_end/models/timeline_model/TimelineModel.ts +5 -1
  90. package/front_end/panels/application/ApplicationPanelSidebar.ts +8 -7
  91. package/front_end/panels/application/DatabaseQueryView.ts +7 -1
  92. package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
  93. package/front_end/panels/changes/ChangesSidebar.ts +6 -1
  94. package/front_end/panels/console/ConsolePrompt.ts +6 -1
  95. package/front_end/panels/console/ConsoleSidebar.ts +5 -1
  96. package/front_end/panels/console/ConsoleViewMessage.ts +2 -2
  97. package/front_end/panels/coverage/CoverageView.ts +5 -4
  98. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +59 -48
  99. package/front_end/panels/css_overview/CSSOverviewController.ts +48 -8
  100. package/front_end/panels/css_overview/CSSOverviewPanel.ts +1 -1
  101. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +8 -1
  102. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +14 -12
  103. package/front_end/panels/elements/ElementsPanel.ts +10 -8
  104. package/front_end/panels/elements/ElementsTreeOutline.ts +8 -1
  105. package/front_end/panels/elements/StylesSidebarPane.ts +12 -2
  106. package/front_end/panels/emulation/AdvancedApp.ts +2 -12
  107. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +14 -1
  108. package/front_end/panels/layer_viewer/LayerDetailsView.ts +7 -1
  109. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +4 -4
  110. package/front_end/panels/layer_viewer/Layers3DView.ts +7 -1
  111. package/front_end/panels/layer_viewer/PaintProfilerView.ts +7 -1
  112. package/front_end/panels/layers/LayersPanel.ts +1 -1
  113. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -2
  114. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +4 -0
  115. package/front_end/panels/network/NetworkDataGridNode.ts +46 -104
  116. package/front_end/panels/network/NetworkItemView.ts +2 -6
  117. package/front_end/panels/network/NetworkLogView.ts +4 -4
  118. package/front_end/panels/network/NetworkPanel.ts +12 -18
  119. package/front_end/panels/profiler/CPUProfileFlameChart.ts +26 -11
  120. package/front_end/panels/profiler/HeapProfileView.ts +5 -6
  121. package/front_end/panels/profiler/HeapSnapshotView.ts +6 -6
  122. package/front_end/panels/profiler/HeapTimelineOverview.ts +17 -3
  123. package/front_end/panels/profiler/ProfileLauncherView.ts +6 -1
  124. package/front_end/panels/profiler/ProfileView.ts +1 -1
  125. package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
  126. package/front_end/panels/settings/SettingsScreen.ts +2 -2
  127. package/front_end/panels/sources/CSSPlugin.ts +6 -6
  128. package/front_end/panels/sources/DebuggerPlugin.ts +4 -5
  129. package/front_end/panels/sources/EditingLocationHistoryManager.ts +7 -5
  130. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +5 -5
  131. package/front_end/panels/sources/OutlineQuickOpen.ts +7 -2
  132. package/front_end/panels/sources/ScriptFormatterEditorAction.ts +5 -6
  133. package/front_end/panels/sources/SourcesPanel.ts +2 -2
  134. package/front_end/panels/sources/SourcesView.ts +16 -3
  135. package/front_end/panels/sources/TabbedEditorContainer.ts +8 -13
  136. package/front_end/panels/sources/UISourceCodeFrame.ts +7 -1
  137. package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -7
  138. package/front_end/panels/timeline/TimelineDetailsView.ts +1 -1
  139. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
  140. package/front_end/panels/timeline/TimelineLayersView.ts +7 -7
  141. package/front_end/panels/timeline/TimelinePanel.ts +2 -1
  142. package/front_end/panels/timeline/TimelineTreeView.ts +6 -1
  143. package/front_end/ui/components/docs/toggle_fonts.ts +28 -1
  144. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +4 -5
  145. package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +14 -5
  146. package/front_end/ui/legacy/Dialog.ts +12 -2
  147. package/front_end/ui/legacy/FilterBar.ts +12 -8
  148. package/front_end/ui/legacy/InspectorView.ts +3 -3
  149. package/front_end/ui/legacy/SplitWidget.ts +6 -1
  150. package/front_end/ui/legacy/TabbedPane.ts +9 -1
  151. package/front_end/ui/legacy/TextEditor.ts +12 -1
  152. package/front_end/ui/legacy/Treeoutline.ts +19 -11
  153. package/front_end/ui/legacy/ViewManager.ts +8 -7
  154. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +6 -1
  155. package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +6 -1
  156. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +7 -1
  157. package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +12 -1
  158. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -6
  159. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +8 -1
  160. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +9 -1
  161. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +13 -3
  162. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +14 -3
  163. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -4
  164. package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +13 -3
  165. package/front_end/ui/legacy/components/quick_open/QuickInput.ts +4 -5
  166. package/front_end/ui/legacy/components/quick_open/QuickPick.ts +4 -5
  167. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +29 -19
  168. package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +18 -2
  169. package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +3 -1
  170. package/front_end/ui/legacy/splitWidget.css +2 -2
  171. package/package.json +1 -1
  172. package/scripts/build/generate_css_js_files.js +1 -0
@@ -69,7 +69,7 @@ const UIStrings = {
69
69
  };
70
70
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/FilterBar.ts', UIStrings);
71
71
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
72
- export class FilterBar extends HBox implements Common.EventTarget.EventTarget<FilterBarEventTypes> {
72
+ export class FilterBar extends Common.ObjectWrapper.eventMixin<FilterBarEventTypes, typeof HBox>(HBox) {
73
73
  private enabled: boolean;
74
74
  private readonly stateSetting: Common.Settings.Setting<boolean>;
75
75
  private readonly filterButtonInternal: ToolbarSettingToggle;
@@ -185,7 +185,7 @@ export type FilterBarEventTypes = {
185
185
  [FilterBarEvents.Changed]: void,
186
186
  };
187
187
 
188
- export interface FilterUI extends Common.EventTarget.EventTarget {
188
+ export interface FilterUI extends Common.EventTarget.EventTarget<FilterUIEventTypes> {
189
189
  isActive(): boolean;
190
190
  element(): Element;
191
191
  }
@@ -194,7 +194,11 @@ export const enum FilterUIEvents {
194
194
  FilterChanged = 'FilterChanged',
195
195
  }
196
196
 
197
- export class TextFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {
197
+ export type FilterUIEventTypes = {
198
+ [FilterUIEvents.FilterChanged]: void,
199
+ };
200
+
201
+ export class TextFilterUI extends Common.ObjectWrapper.ObjectWrapper<FilterUIEventTypes> implements FilterUI {
198
202
  private readonly filterElement: HTMLDivElement;
199
203
  private readonly filterInputElement: HTMLElement;
200
204
  private prompt: TextPrompt;
@@ -261,7 +265,7 @@ export class TextFilterUI extends Common.ObjectWrapper.ObjectWrapper implements
261
265
  }
262
266
 
263
267
  private valueChanged(): void {
264
- this.dispatchEventToListeners(FilterUIEvents.FilterChanged, null);
268
+ this.dispatchEventToListeners(FilterUIEvents.FilterChanged);
265
269
  this.updateEmptyStyles();
266
270
  }
267
271
 
@@ -274,7 +278,7 @@ export class TextFilterUI extends Common.ObjectWrapper.ObjectWrapper implements
274
278
  }
275
279
  }
276
280
 
277
- export class NamedBitSetFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {
281
+ export class NamedBitSetFilterUI extends Common.ObjectWrapper.ObjectWrapper<FilterUIEventTypes> implements FilterUI {
278
282
  private readonly filtersElement: HTMLDivElement;
279
283
  private readonly typeFilterElementTypeNames: WeakMap<HTMLElement, string>;
280
284
  private allowedTypes: Set<string>;
@@ -350,7 +354,7 @@ export class NamedBitSetFilterUI extends Common.ObjectWrapper.ObjectWrapper impl
350
354
  element.classList.toggle('selected', active);
351
355
  ARIAUtils.setSelected(element, active);
352
356
  }
353
- this.dispatchEventToListeners(FilterUIEvents.FilterChanged, null);
357
+ this.dispatchEventToListeners(FilterUIEvents.FilterChanged);
354
358
  }
355
359
 
356
360
  private addBit(name: string, label: string, title?: string): void {
@@ -447,7 +451,7 @@ export class NamedBitSetFilterUI extends Common.ObjectWrapper.ObjectWrapper impl
447
451
  static readonly ALL_TYPES = 'all';
448
452
  }
449
453
 
450
- export class CheckboxFilterUI extends Common.ObjectWrapper.ObjectWrapper implements FilterUI {
454
+ export class CheckboxFilterUI extends Common.ObjectWrapper.ObjectWrapper<FilterUIEventTypes> implements FilterUI {
451
455
  private readonly filterElement: HTMLDivElement;
452
456
  private readonly activeWhenChecked: boolean;
453
457
  private label: CheckboxLabel;
@@ -490,7 +494,7 @@ export class CheckboxFilterUI extends Common.ObjectWrapper.ObjectWrapper impleme
490
494
  }
491
495
 
492
496
  private fireUpdated(): void {
493
- this.dispatchEventToListeners(FilterUIEvents.FilterChanged, null);
497
+ this.dispatchEventToListeners(FilterUIEvents.FilterChanged);
494
498
  }
495
499
 
496
500
  setColor(backgroundColor: string, borderColor: string): void {
@@ -45,7 +45,7 @@ import {KeyboardShortcut} from './KeyboardShortcut.js';
45
45
  import type {Panel} from './Panel.js';
46
46
  import {SplitWidget} from './SplitWidget.js';
47
47
  import {Events as TabbedPaneEvents} from './TabbedPane.js';
48
- import type {TabbedPane, TabbedPaneTabDelegate} from './TabbedPane.js';
48
+ import type {EventData, TabbedPane, TabbedPaneTabDelegate} from './TabbedPane.js';
49
49
  import {ToolbarButton} from './Toolbar.js';
50
50
  import type {TabbedViewLocation, View, ViewLocation, ViewLocationResolver} from './View.js';
51
51
  import {ViewManager} from './ViewManager.js';
@@ -381,8 +381,8 @@ export class InspectorView extends VBox implements ViewLocationResolver {
381
381
  this.tabbedPane.headerResized();
382
382
  }
383
383
 
384
- private tabSelected(event: Common.EventTarget.EventTargetEvent): void {
385
- const tabId = (event.data['tabId'] as string);
384
+ private tabSelected(event: Common.EventTarget.EventTargetEvent<EventData>): void {
385
+ const {tabId} = event.data;
386
386
  Host.userMetrics.panelShown(tabId);
387
387
  }
388
388
 
@@ -38,7 +38,7 @@ import {ToolbarButton} from './Toolbar.js';
38
38
  import {Widget} from './Widget.js';
39
39
  import {Events as ZoomManagerEvents, ZoomManager} from './ZoomManager.js';
40
40
 
41
- export class SplitWidget extends Widget {
41
+ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typeof Widget>(Widget) {
42
42
  private sidebarElementInternal: HTMLElement;
43
43
  private mainElement: HTMLElement;
44
44
  private resizerElementInternal: HTMLElement;
@@ -869,6 +869,11 @@ export enum Events {
869
869
  ShowModeChanged = 'ShowModeChanged',
870
870
  }
871
871
 
872
+ export type EventTypes = {
873
+ [Events.SidebarSizeChanged]: number,
874
+ [Events.ShowModeChanged]: string,
875
+ };
876
+
872
877
  const MinPadding = 20;
873
878
  export interface SettingForOrientation {
874
879
  showMode: string;
@@ -28,6 +28,7 @@
28
28
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
  */
30
30
 
31
+ import * as Common from '../../core/common/common.js';
31
32
  import * as i18n from '../../core/i18n/i18n.js';
32
33
  import * as Platform from '../../core/platform/platform.js';
33
34
  import * as IconButton from '../components/icon_button/icon_button.js';
@@ -72,7 +73,7 @@ const UIStrings = {
72
73
  };
73
74
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/TabbedPane.ts', UIStrings);
74
75
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
75
- export class TabbedPane extends VBox {
76
+ export class TabbedPane extends Common.ObjectWrapper.eventMixin<EventTypes, typeof VBox>(VBox) {
76
77
  private readonly headerElementInternal: HTMLElement;
77
78
  private readonly headerContentsElement: HTMLElement;
78
79
  tabSlider: HTMLDivElement;
@@ -956,6 +957,13 @@ export enum Events {
956
957
  TabOrderChanged = 'TabOrderChanged',
957
958
  }
958
959
 
960
+ export type EventTypes = {
961
+ [Events.TabInvoked]: EventData,
962
+ [Events.TabSelected]: EventData,
963
+ [Events.TabClosed]: EventData,
964
+ [Events.TabOrderChanged]: EventData,
965
+ };
966
+
959
967
  export class TabbedPaneTab {
960
968
  closeable: boolean;
961
969
  private readonly tabbedPane: TabbedPane;
@@ -13,7 +13,7 @@ export interface TextEditorFactory {
13
13
  createEditor(options: Options): TextEditor;
14
14
  }
15
15
 
16
- export interface TextEditor extends Common.EventTarget.EventTarget {
16
+ export interface TextEditor extends Common.EventTarget.EventTarget<EventTypes> {
17
17
  widget(): Widget;
18
18
  fullRange(): TextUtils.TextRange.TextRange;
19
19
  selection(): TextUtils.TextRange.TextRange;
@@ -46,6 +46,17 @@ export enum Events {
46
46
  SuggestionChanged = 'SuggestionChanged',
47
47
  }
48
48
 
49
+ export interface TextChangedEvent {
50
+ newRange: TextUtils.TextRange.TextRange;
51
+ oldRange: TextUtils.TextRange.TextRange;
52
+ }
53
+
54
+ export type EventTypes = {
55
+ [Events.CursorChanged]: void,
56
+ [Events.TextChanged]: TextChangedEvent,
57
+ [Events.SuggestionChanged]: void,
58
+ };
59
+
49
60
  export interface Options {
50
61
  bracketMatchingSetting?: Common.Settings.Setting<boolean>;
51
62
  devtoolsAccessibleName?: string;
@@ -48,7 +48,25 @@ import {deepElementFromPoint, enclosingNodeOrSelfWithNodeNameInArray, isEditing}
48
48
 
49
49
  const nodeToParentTreeElementMap = new WeakMap<Node, TreeElement>();
50
50
 
51
- export class TreeOutline extends Common.ObjectWrapper.ObjectWrapper {
51
+ // TODO(crbug.com/1167717): Make this a const enum again
52
+ // eslint-disable-next-line rulesdir/const_enum
53
+ export enum Events {
54
+ ElementAttached = 'ElementAttached',
55
+ ElementsDetached = 'ElementsDetached',
56
+ ElementExpanded = 'ElementExpanded',
57
+ ElementCollapsed = 'ElementCollapsed',
58
+ ElementSelected = 'ElementSelected',
59
+ }
60
+
61
+ export type EventTypes = {
62
+ [Events.ElementAttached]: TreeElement,
63
+ [Events.ElementsDetached]: void,
64
+ [Events.ElementExpanded]: TreeElement,
65
+ [Events.ElementCollapsed]: TreeElement,
66
+ [Events.ElementSelected]: TreeElement,
67
+ };
68
+
69
+ export class TreeOutline extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
52
70
  readonly rootElementInternal: TreeElement;
53
71
  renderSelection: boolean;
54
72
  selectedTreeElement: TreeElement|null;
@@ -360,16 +378,6 @@ export class TreeOutline extends Common.ObjectWrapper.ObjectWrapper {
360
378
  }
361
379
  }
362
380
 
363
- // TODO(crbug.com/1167717): Make this a const enum again
364
- // eslint-disable-next-line rulesdir/const_enum
365
- export enum Events {
366
- ElementAttached = 'ElementAttached',
367
- ElementsDetached = 'ElementsDetached',
368
- ElementExpanded = 'ElementExpanded',
369
- ElementCollapsed = 'ElementCollapsed',
370
- ElementSelected = 'ElementSelected',
371
- }
372
-
373
381
  export class TreeOutlineInShadow extends TreeOutline {
374
382
  element: HTMLElement;
375
383
  shadowRoot: ShadowRoot;
@@ -9,6 +9,7 @@ import * as i18n from '../../core/i18n/i18n.js';
9
9
  import * as ARIAUtils from './ARIAUtils.js';
10
10
  import type {ContextMenu} from './ContextMenu.js';
11
11
  import {Icon} from './Icon.js';
12
+ import type {EventData} from './TabbedPane.js';
12
13
  import {Events as TabbedPaneEvents, TabbedPane} from './TabbedPane.js';
13
14
  import type {ToolbarItem} from './Toolbar.js';
14
15
  import {Toolbar, ToolbarMenuButton} from './Toolbar.js';
@@ -771,21 +772,21 @@ export class _TabbedLocation extends Location implements TabbedViewLocation {
771
772
  this.views.delete(view.viewId());
772
773
  }
773
774
 
774
- private tabSelected(event: Common.EventTarget.EventTargetEvent): void {
775
- const tabId = (event.data.tabId as string);
775
+ private tabSelected(event: Common.EventTarget.EventTargetEvent<EventData>): void {
776
+ const {tabId} = event.data;
776
777
  if (this.lastSelectedTabSetting && event.data['isUserGesture']) {
777
778
  this.lastSelectedTabSetting.set(tabId);
778
779
  }
779
780
  }
780
781
 
781
- private tabClosed(event: Common.EventTarget.EventTargetEvent): void {
782
- const id = (event.data['tabId'] as string);
782
+ private tabClosed(event: Common.EventTarget.EventTargetEvent<EventData>): void {
783
+ const {tabId} = event.data;
783
784
  const tabs = this.closeableTabSetting.get();
784
- if (tabs[id]) {
785
- tabs[id] = false;
785
+ if (tabs[tabId]) {
786
+ tabs[tabId] = false;
786
787
  this.closeableTabSetting.set(tabs);
787
788
  }
788
- const view = this.views.get(id);
789
+ const view = this.views.get(tabId);
789
790
  if (view) {
790
791
  view.disposeView();
791
792
  }
@@ -125,7 +125,7 @@ const colorElementToMutable = new WeakMap<HTMLElement, boolean>();
125
125
 
126
126
  const colorElementToColor = new WeakMap<HTMLElement, string>();
127
127
 
128
- export class Spectrum extends UI.Widget.VBox {
128
+ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
129
129
  private colorElement: HTMLElement;
130
130
  private colorDragElement: HTMLElement;
131
131
  private dragX: number;
@@ -1212,6 +1212,11 @@ export enum Events {
1212
1212
  SizeChanged = 'SizeChanged',
1213
1213
  }
1214
1214
 
1215
+ export type EventTypes = {
1216
+ [Events.ColorChanged]: string,
1217
+ [Events.SizeChanged]: void,
1218
+ };
1219
+
1215
1220
  const COLOR_CHIP_SIZE = 24;
1216
1221
  const ITEMS_PER_PALETTE_ROW = 8;
1217
1222
  const GeneratedPaletteTitle = 'Page colors';
@@ -2,12 +2,13 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as Common from '../../../../core/common/common.js';
5
6
  import * as Platform from '../../../../core/platform/platform.js';
6
7
  import * as UI from '../../legacy.js';
7
8
 
8
9
  import {BezierUI} from './BezierUI.js';
9
10
 
10
- export class BezierEditor extends UI.Widget.VBox {
11
+ export class BezierEditor extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
11
12
  private bezierInternal: UI.Geometry.CubicBezier;
12
13
  private previewElement: HTMLElement;
13
14
  private readonly previewOnion: HTMLElement;
@@ -245,6 +246,10 @@ export enum Events {
245
246
  BezierChanged = 'BezierChanged',
246
247
  }
247
248
 
249
+ export type EventTypes = {
250
+ [Events.BezierChanged]: string,
251
+ };
252
+
248
253
  export const Presets = [
249
254
  [
250
255
  {name: 'ease-in-out', value: 'ease-in-out'},
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as Common from '../../../../core/common/common.js';
5
6
  import * as i18n from '../../../../core/i18n/i18n.js';
6
7
  import * as Platform from '../../../../core/platform/platform.js';
7
8
  import * as UI from '../../legacy.js';
@@ -40,7 +41,8 @@ const defaultUnit: string = 'px';
40
41
  const sliderThumbRadius: number = 6;
41
42
  const canvasSize: number = 88;
42
43
 
43
- export class CSSShadowEditor extends UI.Widget.VBox {
44
+ export class CSSShadowEditor extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
45
+ UI.Widget.VBox) {
44
46
  private readonly typeField: HTMLElement;
45
47
  private readonly outsetButton: HTMLElement;
46
48
  private readonly insetButton: HTMLElement;
@@ -429,3 +431,7 @@ export class CSSShadowEditor extends UI.Widget.VBox {
429
431
  export enum Events {
430
432
  ShadowChanged = 'ShadowChanged',
431
433
  }
434
+
435
+ export type EventTypes = {
436
+ [Events.ShadowChanged]: CSSShadowModel,
437
+ };
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as Common from '../../../../core/common/common.js';
5
6
  import * as i18n from '../../../../core/i18n/i18n.js';
6
7
  import * as SDK from '../../../../core/sdk/sdk.js';
7
8
  import * as IconButton from '../../../components/icon_button/icon_button.js';
@@ -113,7 +114,7 @@ const UIStrings = {
113
114
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/inline_editor/FontEditor.ts', UIStrings);
114
115
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
115
116
 
116
- export class FontEditor extends UI.Widget.VBox {
117
+ export class FontEditor extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
117
118
  private readonly selectedNode: SDK.DOMModel.DOMNode|null;
118
119
  private readonly propertyMap: Map<string, string>;
119
120
  private readonly fontSelectorSection: HTMLElement;
@@ -428,6 +429,16 @@ export enum Events {
428
429
  FontEditorResized = 'FontEditorResized',
429
430
  }
430
431
 
432
+ export interface FontChangedEvent {
433
+ propertyName: string;
434
+ value: string;
435
+ }
436
+
437
+ export type EventTypes = {
438
+ [Events.FontChanged]: FontChangedEvent,
439
+ [Events.FontEditorResized]: void,
440
+ };
441
+
431
442
  class FontPropertyInputs {
432
443
  private showSliderMode: boolean;
433
444
  private errorText: HTMLElement;
@@ -1547,20 +1547,20 @@ export class ObjectPropertiesSectionsTreeExpandController {
1547
1547
  }
1548
1548
  }
1549
1549
 
1550
- private elementAttached(event: Common.EventTarget.EventTargetEvent): void {
1551
- const element = (event.data as UI.TreeOutline.TreeElement);
1550
+ private elementAttached(event: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>): void {
1551
+ const element = event.data;
1552
1552
  if (element.isExpandable() && this.expandedProperties.has(this.propertyPath(element))) {
1553
1553
  element.expand();
1554
1554
  }
1555
1555
  }
1556
1556
 
1557
- private elementExpanded(event: Common.EventTarget.EventTargetEvent): void {
1558
- const element = (event.data as UI.TreeOutline.TreeElement);
1557
+ private elementExpanded(event: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>): void {
1558
+ const element = event.data;
1559
1559
  this.expandedProperties.add(this.propertyPath(element));
1560
1560
  }
1561
1561
 
1562
- private elementCollapsed(event: Common.EventTarget.EventTargetEvent): void {
1563
- const element = (event.data as UI.TreeOutline.TreeElement);
1562
+ private elementCollapsed(event: Common.EventTarget.EventTargetEvent<UI.TreeOutline.TreeElement>): void {
1563
+ const element = event.data;
1564
1564
  this.expandedProperties.delete(this.propertyPath(element));
1565
1565
  }
1566
1566
 
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import * as Common from '../../../../core/common/common.js';
5
6
  import * as Host from '../../../../core/host/host.js';
6
7
  import * as i18n from '../../../../core/i18n/i18n.js';
7
8
  import * as Platform from '../../../../core/platform/platform.js';
@@ -33,7 +34,7 @@ const UIStrings = {
33
34
  };
34
35
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/perf_ui/FilmStripView.ts', UIStrings);
35
36
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
36
- export class FilmStripView extends UI.Widget.HBox {
37
+ export class FilmStripView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.HBox>(UI.Widget.HBox) {
37
38
  private statusLabel: HTMLElement;
38
39
  private zeroTime!: number;
39
40
  private spanTime!: number;
@@ -195,6 +196,12 @@ export enum Events {
195
196
  FrameExit = 'FrameExit',
196
197
  }
197
198
 
199
+ export type EventTypes = {
200
+ [Events.FrameSelected]: number,
201
+ [Events.FrameEnter]: number,
202
+ [Events.FrameExit]: number,
203
+ };
204
+
198
205
  export const Modes = {
199
206
  TimeBased: 'TimeBased',
200
207
  FrameBased: 'FrameBased',
@@ -85,7 +85,8 @@ interface GroupExpansionState {
85
85
  [key: string]: boolean;
86
86
  }
87
87
 
88
- export class FlameChart extends UI.Widget.VBox implements Calculator, ChartViewportDelegate {
88
+ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox)
89
+ implements Calculator, ChartViewportDelegate {
89
90
  private readonly groupExpansionSetting?: Common.Settings.Setting<GroupExpansionState>;
90
91
  private groupExpansionState: GroupExpansionState;
91
92
  private readonly flameChartDelegate: FlameChartDelegate;
@@ -2321,6 +2322,13 @@ export enum Events {
2321
2322
  EntryHighlighted = 'EntryHighlighted',
2322
2323
  }
2323
2324
 
2325
+ export type EventTypes = {
2326
+ [Events.CanvasFocused]: number|void,
2327
+ [Events.EntryInvoked]: number,
2328
+ [Events.EntrySelected]: number,
2329
+ [Events.EntryHighlighted]: number,
2330
+ };
2331
+
2324
2332
  export const Colors = {
2325
2333
  SelectedGroupBackground: 'hsl(215, 85%, 98%)',
2326
2334
  SelectedGroupBorder: 'hsl(216, 68%, 54%)',
@@ -417,11 +417,10 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper {
417
417
  this.windowLeft = windowLeft;
418
418
  this.windowRight = windowRight;
419
419
  this.updateCurtains();
420
- let windowPosition;
421
420
  if (this.calculator) {
422
- windowPosition = this.calculateWindowPosition();
421
+ this.dispatchEventToListeners(Events.WindowChangedWithPosition, this.calculateWindowPosition());
423
422
  }
424
- this.dispatchEventToListeners(Events.WindowChanged, windowPosition);
423
+ this.dispatchEventToListeners(Events.WindowChanged);
425
424
  }
426
425
 
427
426
  private updateCurtains(): void {
@@ -523,8 +522,19 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper {
523
522
  // eslint-disable-next-line rulesdir/const_enum
524
523
  export enum Events {
525
524
  WindowChanged = 'WindowChanged',
525
+ WindowChangedWithPosition = 'WindowChangedWithPosition',
526
526
  }
527
527
 
528
+ export interface WindowChangedWithPositionEvent {
529
+ rawStartValue: number;
530
+ rawEndValue: number;
531
+ }
532
+
533
+ export type EventTypes = {
534
+ [Events.WindowChanged]: void,
535
+ [Events.WindowChangedWithPosition]: WindowChangedWithPositionEvent,
536
+ };
537
+
528
538
  export class WindowSelector {
529
539
  private startPosition: number;
530
540
  private width: number;
@@ -33,10 +33,12 @@ import type * as SDK from '../../../../core/sdk/sdk.js';
33
33
  import * as UI from '../../legacy.js';
34
34
  import * as i18n from '../../../../core/i18n/i18n.js';
35
35
 
36
+ import type {WindowChangedWithPositionEvent} from './OverviewGrid.js';
36
37
  import {Events as OverviewGridEvents, OverviewGrid} from './OverviewGrid.js';
37
38
  import type {Calculator} from './TimelineGrid.js';
38
39
 
39
- export class TimelineOverviewPane extends UI.Widget.VBox {
40
+ export class TimelineOverviewPane extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
41
+ UI.Widget.VBox) {
40
42
  private readonly overviewCalculator: TimelineOverviewCalculator;
41
43
  private readonly overviewGrid: OverviewGrid;
42
44
  private readonly cursorArea: HTMLElement;
@@ -65,7 +67,7 @@ export class TimelineOverviewPane extends UI.Widget.VBox {
65
67
  this.cursorArea.addEventListener('mouseleave', this.hideCursor.bind(this), true);
66
68
 
67
69
  this.overviewGrid.setResizeEnabled(false);
68
- this.overviewGrid.addEventListener(OverviewGridEvents.WindowChanged, this.onWindowChanged, this);
70
+ this.overviewGrid.addEventListener(OverviewGridEvents.WindowChangedWithPosition, this.onWindowChanged, this);
69
71
  this.overviewGrid.setClickHandler(this.onClick.bind(this));
70
72
  this.overviewControls = [];
71
73
  this.markers = new Map();
@@ -208,7 +210,7 @@ export class TimelineOverviewPane extends UI.Widget.VBox {
208
210
  return this.overviewControls.some(control => control.onClick(event));
209
211
  }
210
212
 
211
- private onWindowChanged(event: Common.EventTarget.EventTargetEvent): void {
213
+ private onWindowChanged(event: Common.EventTarget.EventTargetEvent<WindowChangedWithPositionEvent>): void {
212
214
  if (this.muteOnWindowChanged) {
213
215
  return;
214
216
  }
@@ -255,6 +257,15 @@ export enum Events {
255
257
  WindowChanged = 'WindowChanged',
256
258
  }
257
259
 
260
+ export interface WindowChangedEvent {
261
+ startTime: number;
262
+ endTime: number;
263
+ }
264
+
265
+ export type EventTypes = {
266
+ [Events.WindowChanged]: WindowChangedEvent,
267
+ };
268
+
258
269
  export class TimelineOverviewCalculator implements Calculator {
259
270
  private minimumBoundaryInternal!: number;
260
271
  private maximumBoundaryInternal!: number;
@@ -271,14 +271,21 @@ export class CommandMenuProvider extends Provider {
271
271
 
272
272
  renderItem(itemIndex: number, query: string, titleElement: Element, subtitleElement: Element): void {
273
273
  const command = this.commands[itemIndex];
274
+
274
275
  titleElement.removeChildren();
275
- const tagElement = (titleElement.createChild('span', 'tag') as HTMLElement);
276
- const index = Platform.StringUtilities.hashCode(command.category()) % MaterialPaletteColors.length;
277
- tagElement.style.backgroundColor = MaterialPaletteColors[index];
278
- tagElement.textContent = command.category();
279
276
  UI.UIUtils.createTextChild(titleElement, command.title());
280
277
  FilteredListWidget.highlightRanges(titleElement, query, true);
278
+
281
279
  subtitleElement.textContent = command.shortcut();
280
+
281
+ const tagElement = (titleElement.parentElement?.parentElement?.createChild('span', 'tag') as HTMLElement);
282
+ if (!tagElement) {
283
+ return;
284
+ }
285
+ const index = Platform.StringUtilities.hashCode(command.category()) % MaterialPaletteColors.length;
286
+ tagElement.style.backgroundColor = MaterialPaletteColors[index];
287
+ tagElement.style.color = 'var(--color-background)';
288
+ tagElement.textContent = command.category();
282
289
  }
283
290
 
284
291
  selectItem(itemIndex: number|null, _promptValue: string): void {
@@ -5,6 +5,7 @@
5
5
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
6
6
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
7
7
 
8
+ import * as Common from '../../../../core/common/common.js';
8
9
  import * as i18n from '../../../../core/i18n/i18n.js';
9
10
  import * as Platform from '../../../../core/platform/platform.js';
10
11
  import * as TextUtils from '../../../../models/text_utils/text_utils.js';
@@ -28,7 +29,8 @@ const UIStrings = {
28
29
  const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/quick_open/FilteredListWidget.ts', UIStrings);
29
30
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
30
31
 
31
- export class FilteredListWidget extends UI.Widget.VBox implements UI.ListControl.ListDelegate<number> {
32
+ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
33
+ UI.Widget.VBox) implements UI.ListControl.ListDelegate<number> {
32
34
  private promptHistory: string[];
33
35
  private scoringTimer: number;
34
36
  private filterTimer: number;
@@ -160,8 +162,8 @@ export class FilteredListWidget extends UI.Widget.VBox implements UI.ListControl
160
162
  this.dialog.contentElement.style.setProperty('border-radius', '4px');
161
163
  this.show(this.dialog.contentElement);
162
164
  UI.ARIAUtils.setExpanded(this.contentElement, true);
163
- this.dialog.once('hidden').then(() => {
164
- this.dispatchEventToListeners('hidden');
165
+ this.dialog.once(UI.Dialog.Events.Hidden).then(() => {
166
+ this.dispatchEventToListeners(Events.Hidden);
165
167
  });
166
168
  // @ts-ignore
167
169
  this.dialog.show();
@@ -529,6 +531,14 @@ export class FilteredListWidget extends UI.Widget.VBox implements UI.ListControl
529
531
  }
530
532
  }
531
533
 
534
+ export const enum Events {
535
+ Hidden = 'hidden',
536
+ }
537
+
538
+ export type EventTypes = {
539
+ [Events.Hidden]: void,
540
+ };
541
+
532
542
  export class Provider {
533
543
  private refreshCallback!: () => void;
534
544
  constructor() {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as i18n from '../../../../core/i18n/i18n.js';
6
6
 
7
- import {FilteredListWidget, Provider} from './FilteredListWidget.js';
7
+ import {Events as FilteredListWidgetEvents, FilteredListWidget, Provider} from './FilteredListWidget.js';
8
8
 
9
9
  const UIStrings = {
10
10
  /**
@@ -27,9 +27,8 @@ export class QuickInput {
27
27
  throw new ReferenceError('Instance type not implemented.');
28
28
  }
29
29
 
30
- static show(options: QuickInputOptions): Promise<string|undefined> {
31
- let canceledPromise: Promise<undefined> =
32
- new Promise<undefined>(_r => {}); // Intentionally creates an unresolved promise
30
+ static show(options: QuickInputOptions): Promise<string|void> {
31
+ let canceledPromise = new Promise<void>(_r => {}); // Intentionally creates an unresolved promise
33
32
  const fulfilledPromise = new Promise<string>(resolve => {
34
33
  const provider = new QuickInputProvider(options, resolve);
35
34
  const widget = new FilteredListWidget(provider);
@@ -40,7 +39,7 @@ export class QuickInput {
40
39
 
41
40
  widget.setPromptTitle(options.placeHolder || options.prompt);
42
41
  widget.showAsDialog(options.prompt);
43
- canceledPromise = (widget.once('hidden') as Promise<undefined>);
42
+ canceledPromise = widget.once(FilteredListWidgetEvents.Hidden);
44
43
 
45
44
  widget.setQuery(options.value || '');
46
45
  if (options.valueSelection) {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Diff from '../../../../third_party/diff/diff.js';
6
6
  import * as UI from '../../legacy.js';
7
- import {FilteredListWidget, Provider} from './FilteredListWidget.js';
7
+ import {Events as FilteredListWidgetEvents, FilteredListWidget, Provider} from './FilteredListWidget.js';
8
8
  export interface QuickPickItem {
9
9
  label: string;
10
10
  description?: string;
@@ -21,9 +21,8 @@ export class QuickPick {
21
21
  throw new ReferenceError('Instance type not implemented.');
22
22
  }
23
23
 
24
- static show(items: QuickPickItem[], options: QuickPickOptions): Promise<QuickPickItem|undefined> {
25
- let canceledPromise: Promise<undefined> =
26
- new Promise<undefined>(_r => {}); // Intentionally creates an unresolved promise
24
+ static show(items: QuickPickItem[], options: QuickPickOptions): Promise<QuickPickItem|void> {
25
+ let canceledPromise = new Promise<void>(_r => {}); // Intentionally creates an unresolved promise
27
26
  const fulfilledPromise = new Promise<QuickPickItem>(resolve => {
28
27
  const provider =
29
28
  new QuickPickProvider(items, resolve, options.matchOnDescription ? 0.5 : 0, options.matchOnDetail ? 0.25 : 0);
@@ -31,7 +30,7 @@ export class QuickPick {
31
30
  widget.setHintElement(options.placeHolder);
32
31
  widget.setPromptTitle(options.placeHolder);
33
32
  widget.showAsDialog(options.placeHolder);
34
- canceledPromise = (widget.once('hidden') as Promise<undefined>);
33
+ canceledPromise = widget.once(FilteredListWidgetEvents.Hidden);
35
34
  widget.setQuery('');
36
35
  });
37
36