chrome-devtools-frontend 1.0.1660788 → 1.0.1662289

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 (177) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +143 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +104 -0
  3. package/.agents/skills/migrate-chromium-test/SKILL.md +7 -2
  4. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
  5. package/docs/ui_engineering.md +75 -42
  6. package/eslint.config.mjs +7 -0
  7. package/extension-api/ExtensionAPI.d.ts +88 -0
  8. package/front_end/core/common/SettingRegistration.ts +0 -5
  9. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  10. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  11. package/front_end/core/platform/ArrayUtilities.ts +10 -0
  12. package/front_end/core/platform/StringUtilities.ts +20 -4
  13. package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
  14. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
  15. package/front_end/core/sdk/DOMModel.ts +1 -0
  16. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  17. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  18. package/front_end/core/sdk/FrameManager.ts +1 -0
  19. package/front_end/core/sdk/IsolateManager.ts +1 -0
  20. package/front_end/core/sdk/NetworkManager.ts +2 -0
  21. package/front_end/core/sdk/NetworkRequest.ts +1 -0
  22. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  23. package/front_end/core/sdk/SourceMap.ts +5 -5
  24. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  25. package/front_end/core/sdk/TargetManager.ts +4 -0
  26. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  27. package/front_end/foundation/README.md +86 -0
  28. package/front_end/generated/InspectorBackendCommands.ts +4 -5
  29. package/front_end/generated/protocol.ts +20 -38
  30. package/front_end/models/bindings/CompilerScriptMapping.ts +5 -5
  31. package/front_end/models/bindings/ContentProviderBasedProject.ts +2 -3
  32. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -3
  33. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  34. package/front_end/models/bindings/ResourceMapping.ts +3 -3
  35. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -2
  36. package/front_end/models/bindings/SASSSourceMapping.ts +3 -3
  37. package/front_end/models/bindings/TempFile.ts +8 -3
  38. package/front_end/models/extensions/ExtensionAPI.ts +110 -46
  39. package/front_end/models/extensions/RecorderExtensionEndpoint.ts +7 -5
  40. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  41. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +14 -5
  42. package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +8 -9
  43. package/front_end/models/issues_manager/CookieIssue.ts +21 -9
  44. package/front_end/models/issues_manager/Issue.ts +3 -4
  45. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  46. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  47. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  48. package/front_end/models/issues_manager/RelatedIssue.ts +10 -8
  49. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  50. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  51. package/front_end/models/logs/RequestResolver.ts +2 -2
  52. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +12 -9
  53. package/front_end/models/trace/handlers/FramesHandler.ts +4 -7
  54. package/front_end/models/trace/handlers/ModelHandlers.ts +0 -1
  55. package/front_end/models/trace/handlers/RendererHandler.ts +2 -15
  56. package/front_end/models/trace/handlers/Threads.ts +4 -11
  57. package/front_end/models/trace/insights/DOMSize.ts +1 -1
  58. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  59. package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
  60. package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -44
  61. package/front_end/panels/application/CookieItemsView.ts +1 -1
  62. package/front_end/panels/application/ServiceWorkersView.ts +494 -411
  63. package/front_end/panels/application/WebMCPView.ts +38 -43
  64. package/front_end/panels/application/application.ts +0 -6
  65. package/front_end/panels/application/components/AdsView.ts +201 -30
  66. package/front_end/panels/application/components/adsView.css +25 -0
  67. package/front_end/panels/application/components/components.ts +0 -2
  68. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +1 -1
  69. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  70. package/front_end/panels/application/serviceWorkersView.css +40 -4
  71. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +147 -123
  72. package/front_end/panels/common/ExtensionServer.ts +3 -3
  73. package/front_end/panels/console/ConsoleView.ts +3 -2
  74. package/front_end/panels/console/PromptBuilder.ts +2 -1
  75. package/front_end/panels/emulation/DeviceModeView.ts +164 -113
  76. package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
  77. package/front_end/panels/issues/IssueView.ts +0 -2
  78. package/front_end/panels/issues/IssuesPane.ts +1 -8
  79. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  80. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +53 -12
  81. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  82. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  83. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  84. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  85. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  86. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  87. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  88. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  89. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  90. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  91. package/front_end/panels/network/RequestPayloadView.ts +92 -52
  92. package/front_end/panels/network/RequestTimingView.ts +95 -127
  93. package/front_end/panels/network/components/ResponseHeaderSection.ts +5 -3
  94. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -3
  95. package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
  96. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  97. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
  98. package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
  99. package/front_end/panels/recorder/RecorderController.ts +302 -127
  100. package/front_end/panels/recorder/RecorderPanel.ts +1 -1
  101. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
  102. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
  103. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
  104. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  105. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
  106. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
  107. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  108. package/front_end/panels/recorder/recorder.ts +23 -1
  109. package/front_end/panels/recorder/util/util.ts +113 -0
  110. package/front_end/panels/sources/SourcesView.ts +0 -17
  111. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  112. package/front_end/panels/sources/UISourceCodeFrame.ts +42 -0
  113. package/front_end/panels/sources/sources.ts +0 -2
  114. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +0 -17
  115. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  116. package/front_end/panels/timeline/ThreadAppender.ts +0 -106
  117. package/front_end/panels/timeline/TimelinePanel.ts +18 -7
  118. package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
  119. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  120. package/front_end/third_party/chromium/README.chromium +1 -1
  121. package/front_end/ui/components/report_view/ReportView.ts +11 -5
  122. package/front_end/ui/components/report_view/report.css +4 -1
  123. package/front_end/ui/legacy/TextPrompt.ts +49 -1
  124. package/front_end/ui/legacy/Treeoutline.ts +3 -0
  125. package/front_end/ui/legacy/UIUtils.ts +11 -1
  126. package/front_end/ui/legacy/Widget.ts +14 -15
  127. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -2
  128. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
  129. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  130. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  131. package/front_end/ui/legacy/textPrompt.css +10 -0
  132. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  133. package/package.json +1 -1
  134. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  135. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  136. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  137. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  138. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  139. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  140. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  141. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  142. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  143. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  144. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  145. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  146. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  147. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  148. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  149. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  150. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  151. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  152. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  153. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  154. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  155. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  156. package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
  157. package/front_end/panels/application/InterestGroupStorageModel.ts +0 -81
  158. package/front_end/panels/application/InterestGroupStorageView.ts +0 -151
  159. package/front_end/panels/application/InterestGroupTreeElement.ts +0 -65
  160. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +0 -135
  161. package/front_end/panels/application/components/interestGroupAccessGrid.css +0 -27
  162. package/front_end/panels/application/interestGroupStorageView.css +0 -9
  163. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  164. package/front_end/panels/recorder/components/components.ts +0 -25
  165. package/front_end/panels/recorder/components/util.ts +0 -116
  166. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +0 -149
  167. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  168. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  169. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  170. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  171. /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
  172. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  173. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  174. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  175. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  176. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  177. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -20,7 +20,7 @@ export class RecorderPanel extends UI.Panel.Panel {
20
20
  super(RecorderPanel.panelName);
21
21
  this.element.setAttribute('jslog', `${VisualLogging.panel('chrome-recorder').track({resize: true})}`);
22
22
  this.#controller = new RecorderController();
23
- this.contentElement.append(this.#controller);
23
+ this.#controller.show(this.contentElement);
24
24
  this.setHideOnDetach();
25
25
  }
26
26
 
@@ -2,16 +2,16 @@
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 '../../../ui/kit/kit.js';
5
+ import '../../ui/kit/kit.js';
6
6
 
7
- import * as i18n from '../../../core/i18n/i18n.js';
8
- import * as Buttons from '../../../ui/components/buttons/buttons.js';
9
- import * as UI from '../../../ui/legacy/legacy.js';
10
- import * as Lit from '../../../ui/lit/lit.js';
11
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
12
- import * as Models from '../models/models.js';
13
- import * as Actions from '../recorder-actions/recorder-actions.js';
7
+ import * as i18n from '../../core/i18n/i18n.js';
8
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
9
+ import * as UI from '../../ui/legacy/legacy.js';
10
+ import * as Lit from '../../ui/lit/lit.js';
11
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
14
12
 
13
+ import * as Models from './models/models.js';
14
+ import * as Actions from './recorder-actions/recorder-actions.js';
15
15
  import recordingListViewStyles from './recordingListView.css.js';
16
16
 
17
17
  const {html} = Lit;
@@ -39,7 +39,7 @@ const UIStrings = {
39
39
  openRecording: 'Open recording',
40
40
  } as const;
41
41
  const str_ = i18n.i18n.registerUIStrings(
42
- 'panels/recorder/components/RecordingListView.ts',
42
+ 'panels/recorder/RecordingListView.ts',
43
43
  UIStrings,
44
44
  );
45
45
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -238,17 +238,16 @@ export class RecordingListView extends UI.Widget.Widget {
238
238
  }
239
239
 
240
240
  override performUpdate(): void {
241
- this.#view(
242
- {
243
- recordings: this.#recordings,
244
- replayAllowed: this.#replayAllowed,
245
- onCreateClick: this.#onCreateClick.bind(this),
246
- onDeleteClick: this.#onDeleteClick.bind(this),
247
- onOpenClick: this.#onOpenClick.bind(this),
248
- onPlayRecordingClick: this.#onPlayRecordingClick.bind(this),
249
- onKeyDown: this.#onKeyDown.bind(this),
250
- },
251
- {}, this.contentElement);
241
+ this.#view({
242
+ recordings: this.#recordings,
243
+ replayAllowed: this.#replayAllowed,
244
+ onCreateClick: this.#onCreateClick.bind(this),
245
+ onDeleteClick: this.#onDeleteClick.bind(this),
246
+ onOpenClick: this.#onOpenClick.bind(this),
247
+ onPlayRecordingClick: this.#onPlayRecordingClick.bind(this),
248
+ onKeyDown: this.#onKeyDown.bind(this),
249
+ },
250
+ {}, this.contentElement);
252
251
  }
253
252
 
254
253
  override wasShown(): void {
@@ -2,32 +2,32 @@
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 '../../../ui/kit/kit.js';
6
-
7
- import * as Host from '../../../core/host/host.js';
8
- import * as i18n from '../../../core/i18n/i18n.js';
9
- import * as Platform from '../../../core/platform/platform.js';
10
- import * as SDK from '../../../core/sdk/sdk.js';
11
- import type * as PublicExtensions from '../../../models/extensions/extensions.js';
12
- import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
13
- import type * as PuppeteerReplay from '../../../third_party/puppeteer-replay/puppeteer-replay.js';
14
- import * as Buttons from '../../../ui/components/buttons/buttons.js';
15
- import * as CodeHighlighter from '../../../ui/components/code_highlighter/code_highlighter.js';
16
- import * as Dialogs from '../../../ui/components/dialogs/dialogs.js';
17
- import * as Input from '../../../ui/components/input/input.js';
18
- import type * as Menus from '../../../ui/components/menus/menus.js';
19
- import * as TextEditor from '../../../ui/components/text_editor/text_editor.js';
20
- import * as UI from '../../../ui/legacy/legacy.js';
21
- import * as Lit from '../../../ui/lit/lit.js';
22
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
23
- import type * as Converters from '../converters/converters.js';
24
- import type * as Extensions from '../extensions/extensions.js';
25
- import * as Models from '../models/models.js';
26
- import {PlayRecordingSpeed} from '../models/RecordingPlayer.js';
27
- import * as Actions from '../recorder-actions/recorder-actions.js';
5
+ import '../../ui/kit/kit.js';
6
+
7
+ import * as Host from '../../core/host/host.js';
8
+ import * as i18n from '../../core/i18n/i18n.js';
9
+ import * as Platform from '../../core/platform/platform.js';
10
+ import * as SDK from '../../core/sdk/sdk.js';
11
+ import type * as PublicExtensions from '../../models/extensions/extensions.js';
12
+ import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
13
+ import type * as PuppeteerReplay from '../../third_party/puppeteer-replay/puppeteer-replay.js';
14
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
15
+ import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
16
+ import * as Dialogs from '../../ui/components/dialogs/dialogs.js';
17
+ import * as Input from '../../ui/components/input/input.js';
18
+ import type * as Menus from '../../ui/components/menus/menus.js';
19
+ import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
20
+ import * as UI from '../../ui/legacy/legacy.js';
21
+ import * as Lit from '../../ui/lit/lit.js';
22
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
28
23
 
29
24
  import {ControlButton} from './ControlButton.js';
25
+ import type * as Converters from './converters/converters.js';
26
+ import type * as Extensions from './extensions/extensions.js';
30
27
  import {ExtensionView} from './ExtensionView.js';
28
+ import * as Models from './models/models.js';
29
+ import {PlayRecordingSpeed} from './models/RecordingPlayer.js';
30
+ import * as Actions from './recorder-actions/recorder-actions.js';
31
31
  import recordingViewStyles from './recordingView.css.js';
32
32
  import {ReplaySection} from './ReplaySection.js';
33
33
  import {
@@ -151,7 +151,7 @@ const UIStrings = {
151
151
  codeSidebarClosed: 'Code sidebar closed',
152
152
  } as const;
153
153
  const str_ = i18n.i18n.registerUIStrings(
154
- 'panels/recorder/components/RecordingView.ts',
154
+ 'panels/recorder/RecordingView.ts',
155
155
  UIStrings,
156
156
  );
157
157
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -648,7 +648,7 @@ function renderSections(input: ViewInput): Lit.LitTemplate {
648
648
  )}
649
649
  </div>
650
650
  `;
651
- // clang-format on
651
+ // clang-format on
652
652
  }
653
653
 
654
654
  function renderHeader(input: ViewInput): Lit.LitTemplate {
@@ -806,8 +806,9 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
806
806
  descriptor: input.extensionDescriptor,
807
807
  onClose: () => {
808
808
  target.dispatchEvent(new Event('recorderextensionviewclosed', {bubbles: true, composed: true}));
809
- }
810
- })}></devtools-widget>` : html`
809
+ },
810
+ })}>
811
+ </devtools-widget>` : html`
811
812
  ${renderSettings(input)}
812
813
  ${renderTimelineArea(input, output)}
813
814
  `}
@@ -911,67 +912,66 @@ export class RecordingView extends UI.Widget.Widget {
911
912
  ].find(converter => converter.getId() === this.#converterId) ??
912
913
  this.builtInConverters[0];
913
914
 
914
- this.#view(
915
- {
916
- breakpointIndexes: this.breakpointIndexes,
917
- builtInConverters: this.builtInConverters,
918
- converterId: this.#converterId,
919
- converterName: converter?.getFormatName(),
920
- currentError: this.currentError ?? null,
921
- currentStep: this.currentStep ?? null,
922
- editorState: this.#editorState ?? null,
923
- extensionConverters: this.extensionConverters,
924
- extensionDescriptor: this.extensionDescriptor,
925
- isRecording: this.isRecording,
926
- isTitleInvalid: this.#isTitleInvalid,
927
- lastReplayResult: this.lastReplayResult ?? null,
928
- recorderSettings: this.#recorderSettings ?? null,
929
- recording: this.recording,
930
- recordingTogglingInProgress: this.recordingTogglingInProgress,
931
- replayAllowed: this.replayAllowed,
932
- replayExtensions: this.replayExtensions ?? [],
933
- replaySettingsExpanded: this.#replaySettingsExpanded,
934
- replayState: this.replayState,
935
- sections: this.sections,
936
- selectedStep: this.#selectedStep ?? null,
937
- settings: this.settings ?? null,
938
- showCodeView: this.#showCodeView,
939
-
940
- onAddAssertion: () => {
941
- this.addAssertion?.();
942
- },
943
- onRecordingFinished: () => {
944
- this.recordingFinished?.();
945
- },
946
- getSectionState: this.#getSectionState.bind(this),
947
- getStepState: this.#getStepState.bind(this),
948
- onAbortReplay: () => {
949
- this.abortReplay?.();
950
- },
951
- onMeasurePerformanceClick: this.#handleMeasurePerformanceClickEvent.bind(this),
952
- onTogglePlaying: (speed: PlayRecordingSpeed, extension?: Extensions.ExtensionManager.Extension) => {
953
- this.playRecording?.({
954
- targetPanel: TargetPanel.DEFAULT,
955
- speed,
956
- extension,
957
- });
958
- },
959
- onCodeFormatChange: this.#onCodeFormatChange.bind(this),
960
- onCopyStep: this.#onCopyStepEvent.bind(this),
961
- onEditTitleButtonClick: this.#onEditTitleButtonClick.bind(this),
962
- onNetworkConditionsChange: this.#onNetworkConditionsChange.bind(this),
963
- onReplaySettingsKeydown: this.#onReplaySettingsKeydown.bind(this),
964
- onSelectMenuLabelClick: this.#onSelectMenuLabelClick.bind(this),
965
- onStepClick: this.#onStepClick.bind(this),
966
- onStepHover: this.#onStepHover.bind(this),
967
- onTimeoutInput: this.#onTimeoutInput.bind(this),
968
- onTitleBlur: this.#onTitleBlur.bind(this),
969
- onTitleInputKeyDown: this.#onTitleInputKeyDown.bind(this),
970
- onToggleReplaySettings: this.#onToggleReplaySettings.bind(this),
971
- onWrapperClick: this.#onWrapperClick.bind(this),
972
- showCodeToggle: this.showCodeToggle.bind(this),
973
- },
974
- this.#viewOutput, this.contentElement);
915
+ this.#view({
916
+ breakpointIndexes: this.breakpointIndexes,
917
+ builtInConverters: this.builtInConverters,
918
+ converterId: this.#converterId,
919
+ converterName: converter?.getFormatName(),
920
+ currentError: this.currentError ?? null,
921
+ currentStep: this.currentStep ?? null,
922
+ editorState: this.#editorState ?? null,
923
+ extensionConverters: this.extensionConverters,
924
+ extensionDescriptor: this.extensionDescriptor,
925
+ isRecording: this.isRecording,
926
+ isTitleInvalid: this.#isTitleInvalid,
927
+ lastReplayResult: this.lastReplayResult ?? null,
928
+ recorderSettings: this.#recorderSettings ?? null,
929
+ recording: this.recording,
930
+ recordingTogglingInProgress: this.recordingTogglingInProgress,
931
+ replayAllowed: this.replayAllowed,
932
+ replayExtensions: this.replayExtensions ?? [],
933
+ replaySettingsExpanded: this.#replaySettingsExpanded,
934
+ replayState: this.replayState,
935
+ sections: this.sections,
936
+ selectedStep: this.#selectedStep ?? null,
937
+ settings: this.settings ?? null,
938
+ showCodeView: this.#showCodeView,
939
+
940
+ onAddAssertion: () => {
941
+ this.addAssertion?.();
942
+ },
943
+ onRecordingFinished: () => {
944
+ this.recordingFinished?.();
945
+ },
946
+ getSectionState: this.#getSectionState.bind(this),
947
+ getStepState: this.#getStepState.bind(this),
948
+ onAbortReplay: () => {
949
+ this.abortReplay?.();
950
+ },
951
+ onMeasurePerformanceClick: this.#handleMeasurePerformanceClickEvent.bind(this),
952
+ onTogglePlaying: (speed: PlayRecordingSpeed, extension?: Extensions.ExtensionManager.Extension) => {
953
+ this.playRecording?.({
954
+ targetPanel: TargetPanel.DEFAULT,
955
+ speed,
956
+ extension,
957
+ });
958
+ },
959
+ onCodeFormatChange: this.#onCodeFormatChange.bind(this),
960
+ onCopyStep: this.#onCopyStepEvent.bind(this),
961
+ onEditTitleButtonClick: this.#onEditTitleButtonClick.bind(this),
962
+ onNetworkConditionsChange: this.#onNetworkConditionsChange.bind(this),
963
+ onReplaySettingsKeydown: this.#onReplaySettingsKeydown.bind(this),
964
+ onSelectMenuLabelClick: this.#onSelectMenuLabelClick.bind(this),
965
+ onStepClick: this.#onStepClick.bind(this),
966
+ onStepHover: this.#onStepHover.bind(this),
967
+ onTimeoutInput: this.#onTimeoutInput.bind(this),
968
+ onTitleBlur: this.#onTitleBlur.bind(this),
969
+ onTitleInputKeyDown: this.#onTitleInputKeyDown.bind(this),
970
+ onToggleReplaySettings: this.#onToggleReplaySettings.bind(this),
971
+ onWrapperClick: this.#onWrapperClick.bind(this),
972
+ showCodeToggle: this.showCodeToggle.bind(this),
973
+ },
974
+ this.#viewOutput, this.contentElement);
975
975
  }
976
976
 
977
977
  override wasShown(): void {
@@ -2,17 +2,17 @@
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 i18n from '../../../core/i18n/i18n.js';
6
- import * as Platform from '../../../core/platform/platform.js';
7
- import * as Buttons from '../../../ui/components/buttons/buttons.js';
8
- import * as UI from '../../../ui/legacy/legacy.js';
9
- import * as Lit from '../../../ui/lit/lit.js';
10
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
11
- import type * as Extensions from '../extensions/extensions.js';
12
- import * as Models from '../models/models.js';
13
- import {PlayRecordingSpeed} from '../models/RecordingPlayer.js';
14
- import * as Actions from '../recorder-actions/recorder-actions.js';
5
+ import * as i18n from '../../core/i18n/i18n.js';
6
+ import * as Platform from '../../core/platform/platform.js';
7
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
8
+ import * as UI from '../../ui/legacy/legacy.js';
9
+ import * as Lit from '../../ui/lit/lit.js';
10
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
15
11
 
12
+ import type * as Extensions from './extensions/extensions.js';
13
+ import * as Models from './models/models.js';
14
+ import {PlayRecordingSpeed} from './models/RecordingPlayer.js';
15
+ import * as Actions from './recorder-actions/recorder-actions.js';
16
16
  import replaySectionStyles from './replaySection.css.js';
17
17
 
18
18
  const {html, Directives: {ifDefined, repeat}} = Lit;
@@ -65,7 +65,7 @@ const UIStrings = {
65
65
  } as const;
66
66
 
67
67
  const str_ = i18n.i18n.registerUIStrings(
68
- 'panels/recorder/components/ReplaySection.ts',
68
+ 'panels/recorder/ReplaySection.ts',
69
69
  UIStrings,
70
70
  );
71
71
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -2,19 +2,19 @@
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';
6
- import * as i18n from '../../../core/i18n/i18n.js';
7
- import * as Platform from '../../../core/platform/platform.js';
8
- import * as SDK from '../../../core/sdk/sdk.js';
9
- import type * as Protocol from '../../../generated/protocol.js';
10
- import * as Buttons from '../../../ui/components/buttons/buttons.js';
11
- import * as UI from '../../../ui/legacy/legacy.js';
12
- import * as Lit from '../../../ui/lit/lit.js';
13
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
14
- import * as Models from '../models/models.js';
15
- import * as Util from '../util/util.js';
16
-
5
+ import * as Common from '../../core/common/common.js';
6
+ import * as i18n from '../../core/i18n/i18n.js';
7
+ import * as Platform from '../../core/platform/platform.js';
8
+ import * as SDK from '../../core/sdk/sdk.js';
9
+ import type * as Protocol from '../../generated/protocol.js';
10
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
11
+ import * as UI from '../../ui/legacy/legacy.js';
12
+ import * as Lit from '../../ui/lit/lit.js';
13
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
14
+
15
+ import * as Models from './models/models.js';
17
16
  import selectorPickerStyles from './selectorPicker.css.js';
17
+ import * as Util from './util/util.js';
18
18
 
19
19
  const {html} = Lit;
20
20
 
@@ -39,7 +39,7 @@ const UIStrings = {
39
39
  */
40
40
  selectorPicker: 'Select an element in the page to update selectors',
41
41
  } as const;
42
- const str_ = i18n.i18n.registerUIStrings('panels/recorder/components/SelectorPicker.ts', UIStrings);
42
+ const str_ = i18n.i18n.registerUIStrings('panels/recorder/SelectorPicker.ts', UIStrings);
43
43
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
44
44
 
45
45
  export interface ViewInput {
@@ -2,17 +2,16 @@
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 i18n from '../../../core/i18n/i18n.js';
6
- import * as Platform from '../../../core/platform/platform.js';
7
- import type * as Puppeteer from '../../../third_party/puppeteer/puppeteer.js';
8
- import * as Buttons from '../../../ui/components/buttons/buttons.js';
9
- import * as SuggestionInput from '../../../ui/components/suggestion_input/suggestion_input.js';
10
- import * as UI from '../../../ui/legacy/legacy.js';
11
- import * as Lit from '../../../ui/lit/lit.js';
12
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
13
- import * as Models from '../models/models.js';
14
- import * as Util from '../util/util.js';
5
+ import * as i18n from '../../core/i18n/i18n.js';
6
+ import * as Platform from '../../core/platform/platform.js';
7
+ import type * as Puppeteer from '../../third_party/puppeteer/puppeteer.js';
8
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
9
+ import * as SuggestionInput from '../../ui/components/suggestion_input/suggestion_input.js';
10
+ import * as UI from '../../ui/legacy/legacy.js';
11
+ import * as Lit from '../../ui/lit/lit.js';
12
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
15
13
 
14
+ import * as Models from './models/models.js';
16
15
  import {RequestSelectorAttributeEvent, SelectorPicker} from './SelectorPicker.js';
17
16
  import stepEditorStyles from './stepEditor.css.js';
18
17
  import {
@@ -27,7 +26,8 @@ import {
27
26
  type Keys,
28
27
  type OptionalKeys,
29
28
  type RequiredKeys,
30
- } from './util.js';
29
+ SharedObject,
30
+ } from './util/util.js';
31
31
 
32
32
  const {html, render, Directives} = Lit;
33
33
  const {live} = Directives;
@@ -267,7 +267,7 @@ const UIStrings = {
267
267
  */
268
268
  unknownActionType: 'Enter a valid action type',
269
269
  } as const;
270
- const str_ = i18n.i18n.registerUIStrings('panels/recorder/components/StepEditor.ts', UIStrings);
270
+ const str_ = i18n.i18n.registerUIStrings('panels/recorder/StepEditor.ts', UIStrings);
271
271
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
272
272
 
273
273
  export class StepEditedEvent extends Event {
@@ -328,9 +328,9 @@ interface Puppeteer {
328
328
  }
329
329
 
330
330
  export class EditorState {
331
- static #puppeteer: Util.SharedObject.SharedObject<Puppeteer> = new Util.SharedObject.SharedObject(
332
- () => Models.RecordingPlayer.RecordingPlayer.connectPuppeteer(),
333
- ({browser}) => Models.RecordingPlayer.RecordingPlayer.disconnectPuppeteer(browser));
331
+ static #puppeteer: SharedObject.SharedObject<Puppeteer> =
332
+ new SharedObject.SharedObject(() => Models.RecordingPlayer.RecordingPlayer.connectPuppeteer(),
333
+ ({browser}) => Models.RecordingPlayer.RecordingPlayer.disconnectPuppeteer(browser));
334
334
 
335
335
  static async default(type: Models.Schema.StepType): Promise<DeepImmutable<EditorState>> {
336
336
  const state = {type};
@@ -2,17 +2,17 @@
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 '../../../ui/kit/kit.js';
5
+ import '../../ui/kit/kit.js';
6
6
 
7
- import * as i18n from '../../../core/i18n/i18n.js';
8
- import * as Platform from '../../../core/platform/platform.js';
9
- import * as Menus from '../../../ui/components/menus/menus.js';
10
- import * as UI from '../../../ui/legacy/legacy.js';
11
- import * as Lit from '../../../ui/lit/lit.js';
12
- import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
13
- import type * as Converters from '../converters/converters.js';
14
- import * as Models from '../models/models.js';
7
+ import * as i18n from '../../core/i18n/i18n.js';
8
+ import * as Platform from '../../core/platform/platform.js';
9
+ import * as Menus from '../../ui/components/menus/menus.js';
10
+ import * as UI from '../../ui/legacy/legacy.js';
11
+ import * as Lit from '../../ui/lit/lit.js';
12
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
15
13
 
14
+ import type * as Converters from './converters/converters.js';
15
+ import * as Models from './models/models.js';
16
16
  import {type StepEditedEvent, StepEditor} from './StepEditor.js';
17
17
  import stepViewStyles from './stepView.css.js';
18
18
  import {TimelineSection} from './TimelineSection.js';
@@ -128,7 +128,7 @@ const UIStrings = {
128
128
  breakpoints: 'Breakpoints',
129
129
  } as const;
130
130
  const str_ = i18n.i18n.registerUIStrings(
131
- 'panels/recorder/components/StepView.ts',
131
+ 'panels/recorder/StepView.ts',
132
132
  UIStrings,
133
133
  );
134
134
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
@@ -2,8 +2,8 @@
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 UI from '../../../ui/legacy/legacy.js';
6
- import * as Lit from '../../../ui/lit/lit.js';
5
+ import * as UI from '../../ui/legacy/legacy.js';
6
+ import * as Lit from '../../ui/lit/lit.js';
7
7
 
8
8
  import timelineSectionStyles from './timelineSection.css.js';
9
9
 
@@ -2,8 +2,30 @@
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 ControlButton from './ControlButton.js';
6
+ import * as CreateRecordingView from './CreateRecordingView.js';
5
7
  import * as RecorderController from './RecorderController.js';
6
8
  import * as RecorderEvents from './RecorderEvents.js';
7
9
  import * as RecorderPanel from './RecorderPanel.js';
10
+ import * as RecordingListView from './RecordingListView.js';
11
+ import * as RecordingView from './RecordingView.js';
12
+ import * as ReplaySection from './ReplaySection.js';
13
+ import * as SelectorPicker from './SelectorPicker.js';
14
+ import * as StepEditor from './StepEditor.js';
15
+ import * as StepView from './StepView.js';
16
+ import * as TimelineSection from './TimelineSection.js';
8
17
 
9
- export {RecorderController, RecorderEvents, RecorderPanel};
18
+ export {
19
+ ControlButton,
20
+ CreateRecordingView,
21
+ RecorderController,
22
+ RecorderEvents,
23
+ RecorderPanel,
24
+ RecordingListView,
25
+ RecordingView,
26
+ ReplaySection,
27
+ SelectorPicker,
28
+ StepEditor,
29
+ StepView,
30
+ TimelineSection,
31
+ };
@@ -23,3 +23,116 @@ class InjectedScript {
23
23
  }
24
24
 
25
25
  export {DEVTOOLS_RECORDER_WORLD_NAME, InjectedScript, isDebugBuild, SharedObject};
26
+
27
+ export const mod = (a: number, n: number): number => {
28
+ return ((a % n) + n) % n;
29
+ };
30
+
31
+ export function assert<T>(
32
+ predicate: T,
33
+ message = 'Assertion failed!',
34
+ ): asserts predicate {
35
+ if (!predicate) {
36
+ throw new Error(message);
37
+ }
38
+ }
39
+
40
+ export type Keys<T> = T extends T ? keyof T : never;
41
+
42
+ export type RequiredKeys<T> = {
43
+ [K in keyof T] -?: Record<string|number|symbol, unknown> extends Pick<T, K>? never : K;
44
+ }[keyof T];
45
+
46
+ export type OptionalKeys<T> = {
47
+ [K in keyof T] -?: Record<string|number|symbol, unknown> extends Pick<T, K>? K : never;
48
+ }[keyof T];
49
+
50
+ export type DeepImmutable<T> = {
51
+ readonly[K in keyof T]: DeepImmutable<T[K]>;
52
+ };
53
+
54
+ export type DeepMutable<T> = {
55
+ -readonly[K in keyof T]: DeepMutable<T[K]>;
56
+ };
57
+
58
+ export type DeepPartial<T> = {
59
+ [K in keyof T]?: DeepPartial<Exclude<T[K], undefined>>;
60
+ };
61
+
62
+ export type Mutable<T> = {
63
+ -readonly[K in keyof T]: T[K];
64
+ };
65
+
66
+ export const deepFreeze = <T extends object>(object: T): DeepImmutable<T> => {
67
+ for (const name of Reflect.ownKeys(object)) {
68
+ const value = object[name as keyof T];
69
+ if ((value && typeof value === 'object') || typeof value === 'function') {
70
+ deepFreeze(value);
71
+ }
72
+ }
73
+ return Object.freeze(object);
74
+ };
75
+
76
+ export class InsertAssignment<T> {
77
+ value: T;
78
+ constructor(value: T) {
79
+ this.value = value;
80
+ }
81
+ }
82
+
83
+ export class ArrayAssignments<T> {
84
+ value: Record<number, T>;
85
+ constructor(value: Record<number, T>) {
86
+ this.value = value;
87
+ }
88
+ }
89
+
90
+ export type Assignments<T> = T extends Readonly<Array<infer R>>?
91
+ R[]|ArrayAssignments<Assignments<R>|InsertAssignment<R>>:
92
+ {[K in keyof T]: Assignments<T[K]>};
93
+
94
+ export const immutableDeepAssign = <T>(
95
+ object: DeepImmutable<T>,
96
+ assignments: DeepImmutable<DeepPartial<Assignments<T>>>,
97
+ ): DeepImmutable<T> => {
98
+ if (assignments instanceof ArrayAssignments) {
99
+ assert(Array.isArray(object), `Expected an array. Got ${typeof object}.`);
100
+ const updatedObject = [...object] as Mutable<typeof object>;
101
+ const keys = Object.keys(assignments.value)
102
+ .sort(
103
+ (a, b) => Number(b) - Number(a),
104
+ ) as Array<keyof typeof updatedObject>;
105
+ for (const key of keys) {
106
+ const update = assignments.value[Number(key)];
107
+ if (update === undefined) {
108
+ updatedObject.splice(Number(key), 1);
109
+ } else if (update instanceof InsertAssignment) {
110
+ updatedObject.splice(Number(key), 0, update.value);
111
+ } else {
112
+ updatedObject[Number(key)] = immutableDeepAssign(
113
+ updatedObject[key],
114
+ update,
115
+ );
116
+ }
117
+ }
118
+ return Object.freeze(updatedObject);
119
+ }
120
+ if (typeof assignments === 'object' && !Array.isArray(assignments)) {
121
+ assert(!Array.isArray(object), 'Expected an object. Got an array.');
122
+ const updatedObject = {...object} as Mutable<typeof object>;
123
+ const keys = Object.keys(assignments) as Array<keyof typeof assignments&keyof typeof updatedObject>;
124
+ for (const key of keys) {
125
+ const update = assignments[key];
126
+ if (update === undefined) {
127
+ delete updatedObject[key];
128
+ } else {
129
+ updatedObject[key] = immutableDeepAssign(
130
+ updatedObject[key],
131
+ update as typeof updatedObject[typeof key],
132
+ );
133
+ }
134
+ }
135
+ return Object.freeze(updatedObject);
136
+ }
137
+ return assignments as DeepImmutable<T>;
138
+ };