chrome-devtools-frontend 1.0.1660788 → 1.0.1661063

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 (132) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +133 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +76 -0
  3. package/eslint.config.mjs +7 -0
  4. package/extension-api/ExtensionAPI.d.ts +88 -0
  5. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  6. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  7. package/front_end/core/platform/StringUtilities.ts +20 -4
  8. package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
  9. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
  10. package/front_end/core/sdk/DOMModel.ts +1 -0
  11. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  12. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  13. package/front_end/core/sdk/FrameManager.ts +1 -0
  14. package/front_end/core/sdk/IsolateManager.ts +1 -0
  15. package/front_end/core/sdk/NetworkManager.ts +2 -0
  16. package/front_end/core/sdk/NetworkRequest.ts +1 -0
  17. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  18. package/front_end/core/sdk/SourceMap.ts +5 -5
  19. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  20. package/front_end/core/sdk/TargetManager.ts +4 -0
  21. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  22. package/front_end/models/bindings/CompilerScriptMapping.ts +5 -6
  23. package/front_end/models/bindings/ContentProviderBasedProject.ts +4 -4
  24. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -4
  25. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  26. package/front_end/models/bindings/NetworkProject.ts +1 -10
  27. package/front_end/models/bindings/ResourceMapping.ts +3 -4
  28. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -3
  29. package/front_end/models/bindings/SASSSourceMapping.ts +3 -4
  30. package/front_end/models/bindings/StylesSourceMapping.ts +3 -3
  31. package/front_end/models/bindings/TempFile.ts +8 -3
  32. package/front_end/models/extensions/ExtensionAPI.ts +110 -46
  33. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  34. package/front_end/models/issues_manager/CookieIssue.ts +21 -9
  35. package/front_end/models/issues_manager/Issue.ts +3 -4
  36. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  37. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  38. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  39. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  40. package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +5 -0
  41. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +13 -10
  42. package/front_end/models/workspace/WorkspaceImpl.ts +10 -1
  43. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  44. package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
  45. package/front_end/panels/application/FrameDetailsView.ts +1 -1
  46. package/front_end/panels/application/WebMCPView.ts +38 -43
  47. package/front_end/panels/application/components/AdsView.ts +201 -30
  48. package/front_end/panels/application/components/adsView.css +25 -0
  49. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  50. package/front_end/panels/console/ConsoleView.ts +2 -1
  51. package/front_end/panels/console/PromptBuilder.ts +2 -1
  52. package/front_end/panels/emulation/DeviceModeView.ts +52 -70
  53. package/front_end/panels/issues/IssueView.ts +0 -2
  54. package/front_end/panels/issues/IssuesPane.ts +1 -8
  55. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  56. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  57. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  58. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  59. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  60. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  61. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  62. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  63. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  64. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  65. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  66. package/front_end/panels/network/RequestPayloadView.ts +15 -13
  67. package/front_end/panels/network/RequestTimingView.ts +95 -127
  68. package/front_end/panels/profiler/HeapSnapshotView.ts +1 -1
  69. package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
  70. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  71. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
  72. package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
  73. package/front_end/panels/recorder/RecorderController.ts +88 -77
  74. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
  75. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
  76. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
  77. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  78. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
  79. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
  80. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  81. package/front_end/panels/recorder/recorder.ts +23 -1
  82. package/front_end/panels/recorder/util/util.ts +113 -0
  83. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +2 -2
  84. package/front_end/panels/sources/SourcesNavigator.ts +2 -3
  85. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  86. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  87. package/front_end/panels/timeline/TimelinePanel.ts +18 -7
  88. package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
  89. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  90. package/front_end/third_party/chromium/README.chromium +1 -1
  91. package/front_end/ui/legacy/Treeoutline.ts +3 -0
  92. package/front_end/ui/legacy/Widget.ts +14 -15
  93. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
  94. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  95. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  96. package/package.json +1 -1
  97. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  98. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  99. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  100. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  101. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  102. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  103. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  104. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  105. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  106. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  107. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  108. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  109. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  110. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  111. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  112. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  113. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  114. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  115. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  116. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  117. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  118. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  119. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  120. package/front_end/panels/recorder/components/components.ts +0 -25
  121. package/front_end/panels/recorder/components/util.ts +0 -116
  122. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  123. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  124. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  125. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  126. /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
  127. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  128. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  129. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  130. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  131. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  132. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -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
+ };
@@ -133,8 +133,8 @@ export class InplaceFormatterEditorAction implements EditorAction {
133
133
  private async contentLoaded(
134
134
  uiSourceCode: Workspace.UISourceCode.UISourceCode, sourceFrame: UISourceCodeFrame,
135
135
  content: string): Promise<void> {
136
- const {formattedContent, formattedMapping} =
137
- await Formatter.ScriptFormatter.format(uiSourceCode.contentType(), sourceFrame.contentType, content);
136
+ const {formattedContent, formattedMapping} = await Formatter.ScriptFormatter.format(
137
+ Common.Settings.Settings.instance(), uiSourceCode.contentType(), sourceFrame.contentType, content);
138
138
  if (uiSourceCode.workingCopy() === formattedContent) {
139
139
  return;
140
140
  }
@@ -11,7 +11,7 @@ import * as Host from '../../core/host/host.js';
11
11
  import * as i18n from '../../core/i18n/i18n.js';
12
12
  import * as Platform from '../../core/platform/platform.js';
13
13
  import * as SDK from '../../core/sdk/sdk.js';
14
- import * as Bindings from '../../models/bindings/bindings.js';
14
+ import type * as Bindings from '../../models/bindings/bindings.js';
15
15
  import * as Persistence from '../../models/persistence/persistence.js';
16
16
  import * as TextUtils from '../../models/text_utils/text_utils.js';
17
17
  import * as Workspace from '../../models/workspace/workspace.js';
@@ -135,8 +135,7 @@ export class NetworkNavigatorView extends NavigatorView {
135
135
 
136
136
  override acceptProject(project: Workspace.Workspace.Project): boolean {
137
137
  return project.type() === Workspace.Workspace.projectTypes.Network &&
138
- SDK.TargetManager.TargetManager.instance().isInScope(
139
- Bindings.NetworkProject.NetworkProject.getTargetForProject(project));
138
+ SDK.TargetManager.TargetManager.instance().isInScope(project.target());
140
139
  }
141
140
 
142
141
  onScopeChange(): void {
@@ -718,7 +718,7 @@ export interface EventTypes {
718
718
  const MAX_PREVIOUSLY_VIEWED_FILES_COUNT = 30;
719
719
  const MAX_SERIALIZABLE_URL_LENGTH = 4096;
720
720
 
721
- interface SerializedHistoryItem {
721
+ export interface SerializedHistoryItem {
722
722
  url: string;
723
723
  resourceTypeName: string;
724
724
  selectionRange?: TextUtils.TextRange.SerializedTextRange;
@@ -26,10 +26,14 @@ export class IsolateSelector extends UI.Toolbar.ToolbarItem implements SDK.Isola
26
26
  options?: Array<{index: number, isolate: SDK.IsolateManager.Isolate}>;
27
27
  items?: Menus.Menu.MenuItem[];
28
28
  readonly itemByIsolate = new Map<SDK.IsolateManager.Isolate, Menus.Menu.MenuItem>();
29
+ readonly #targetManager: SDK.TargetManager.TargetManager;
30
+ readonly #isolateManager: SDK.IsolateManager.IsolateManager;
29
31
 
30
- constructor() {
32
+ constructor(targetManager: SDK.TargetManager.TargetManager, isolateManager: SDK.IsolateManager.IsolateManager) {
31
33
  const menu = new Menus.SelectMenu.SelectMenu();
32
34
  super(menu);
35
+ this.#targetManager = targetManager;
36
+ this.#isolateManager = isolateManager;
33
37
 
34
38
  this.menu = menu;
35
39
  menu.buttonTitle = i18nString(UIStrings.selectJavascriptVmInstance);
@@ -38,18 +42,16 @@ export class IsolateSelector extends UI.Toolbar.ToolbarItem implements SDK.Isola
38
42
 
39
43
  menu.addEventListener('selectmenuselected', this.#onSelectMenuSelected.bind(this));
40
44
 
41
- SDK.IsolateManager.IsolateManager.instance().observeIsolates(this);
42
- SDK.TargetManager.TargetManager.instance().addEventListener(
43
- SDK.TargetManager.Events.NAME_CHANGED, this.targetChanged, this);
44
- SDK.TargetManager.TargetManager.instance().addEventListener(
45
- SDK.TargetManager.Events.INSPECTED_URL_CHANGED, this.targetChanged, this);
45
+ this.#isolateManager.observeIsolates(this);
46
+ this.#targetManager.addEventListener(SDK.TargetManager.Events.NAME_CHANGED, this.targetChanged, this);
47
+ this.#targetManager.addEventListener(SDK.TargetManager.Events.INSPECTED_URL_CHANGED, this.targetChanged, this);
46
48
  }
47
49
 
48
50
  #updateIsolateItem(isolate: SDK.IsolateManager.Isolate, itemForIsolate: Menus.Menu.MenuItem): void {
49
51
  const modelCountByName = new Map<string, number>();
50
52
  for (const model of isolate.models()) {
51
53
  const target = model.target();
52
- const name = SDK.TargetManager.TargetManager.instance().rootTarget() !== target ? target.name() : '';
54
+ const name = this.#targetManager.rootTarget() !== target ? target.name() : '';
53
55
  const parsedURL = new Common.ParsedURL.ParsedURL(target.inspectedURL());
54
56
  const domain = parsedURL.isValid ? parsedURL.domain() : '';
55
57
  const title =
@@ -117,7 +119,7 @@ export class IsolateSelector extends UI.Toolbar.ToolbarItem implements SDK.Isola
117
119
  if (!model) {
118
120
  return;
119
121
  }
120
- const isolate = SDK.IsolateManager.IsolateManager.instance().isolateByModel(model);
122
+ const isolate = this.#isolateManager.isolateByModel(model);
121
123
  if (isolate) {
122
124
  this.isolateChanged(isolate);
123
125
  }