|
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 | /* eslint-disable @devtools/no-lit-render-outside-of-view */ |
5 | | -import '../../../ui/kit/kit.js'; |
6 | | - |
7 | | -import * as Common from '../../../core/common/common.js'; |
8 | | -import * as Host from '../../../core/host/host.js'; |
9 | | -import * as i18n from '../../../core/i18n/i18n.js'; |
10 | | -import * as Platform from '../../../core/platform/platform.js'; |
11 | | -import * as SDK from '../../../core/sdk/sdk.js'; |
12 | | -import * as Persistence from '../../../models/persistence/persistence.js'; |
13 | | -import * as Workspace from '../../../models/workspace/workspace.js'; |
14 | | -import * as NetworkForward from '../../../panels/network/forward/forward.js'; |
15 | | -import * as Buttons from '../../../ui/components/buttons/buttons.js'; |
16 | | -import * as Input from '../../../ui/components/input/input.js'; |
17 | | -import * as LegacyWrapper from '../../../ui/components/legacy_wrapper/legacy_wrapper.js'; |
18 | | -import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js'; |
19 | | -import * as UI from '../../../ui/legacy/legacy.js'; |
20 | | -import * as Lit from '../../../ui/lit/lit.js'; |
21 | | -import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js'; |
22 | | -import * as Sources from '../../sources/sources.js'; |
23 | | - |
24 | | -import {RequestHeaderSection} from './RequestHeaderSection.js'; |
25 | | -import requestHeadersViewStyles from './RequestHeadersView.css.js'; |
26 | | -import { |
27 | | - RESPONSE_HEADER_SECTION_DATA_KEY, |
28 | | - type ResponseHeaderSectionData, |
29 | | -} from './ResponseHeaderSection.js'; |
| 5 | +import '../../ui/kit/kit.js'; |
| 6 | + |
| 7 | +import * as Common from '../../core/common/common.js'; |
| 8 | +import * as Host from '../../core/host/host.js'; |
| 9 | +import * as i18n from '../../core/i18n/i18n.js'; |
| 10 | +import * as Platform from '../../core/platform/platform.js'; |
| 11 | +import * as SDK from '../../core/sdk/sdk.js'; |
| 12 | +import * as Persistence from '../../models/persistence/persistence.js'; |
| 13 | +import * as Workspace from '../../models/workspace/workspace.js'; |
| 14 | +import * as NetworkForward from '../../panels/network/forward/forward.js'; |
| 15 | +import * as Buttons from '../../ui/components/buttons/buttons.js'; |
| 16 | +import * as Input from '../../ui/components/input/input.js'; |
| 17 | +import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js'; |
| 18 | +import * as RenderCoordinator from '../../ui/components/render_coordinator/render_coordinator.js'; |
| 19 | +import * as UI from '../../ui/legacy/legacy.js'; |
| 20 | +import * as Lit from '../../ui/lit/lit.js'; |
| 21 | +import * as VisualLogging from '../../ui/visual_logging/visual_logging.js'; |
| 22 | +import * as Sources from '../sources/sources.js'; |
| 23 | + |
| 24 | +import * as NetworkComponents from './components/components.js'; |
30 | 25 |
|
31 | 26 | const RAW_HEADER_CUTOFF = 3000; |
32 | 27 | const {render, html} = Lit; |
@@ -105,7 +100,7 @@ const UIStrings = { |
105 | 100 | */ |
106 | 101 | statusCode: 'Status Code', |
107 | 102 | } as const; |
108 | | -const str_ = i18n.i18n.registerUIStrings('panels/network/components/RequestHeadersView.ts', UIStrings); |
| 103 | +const str_ = i18n.i18n.registerUIStrings('panels/network/RequestHeadersView.ts', UIStrings); |
109 | 104 | const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_); |
110 | 105 |
|
111 | 106 | export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableComponent { |
@@ -146,7 +141,7 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom |
146 | 141 | } |
147 | 142 |
|
148 | 143 | #resetAndRefreshHeadersView(): void { |
149 | | - this.#request.deleteAssociatedData(RESPONSE_HEADER_SECTION_DATA_KEY); |
| 144 | + this.#request.deleteAssociatedData(NetworkComponents.ResponseHeaderSection.RESPONSE_HEADER_SECTION_DATA_KEY); |
150 | 145 | void this.render(); |
151 | 146 | } |
152 | 147 |
|
@@ -194,7 +189,7 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom |
194 | 189 | // Disabled until https://crbug.com/1079231 is fixed. |
195 | 190 | // clang-format off |
196 | 191 | render(html` |
197 | | - <style>${requestHeadersViewStyles}</style> |
| 192 | + <style>${NetworkComponents.RequestHeaderSection.requestHeadersViewStyles}</style> |
198 | 193 | <style>${Input.checkboxStyles}</style> |
199 | 194 | ${this.#renderGeneralSection()} |
200 | 195 | ${this.#renderEarlyHintsHeaders()} |
@@ -230,7 +225,7 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom |
230 | 225 | <devtools-early-hints-header-section .data=${{ |
231 | 226 | request: this.#request, |
232 | 227 | toReveal: this.#toReveal, |
233 | | - } as ResponseHeaderSectionData}></devtools-early-hints-header-section> |
| 228 | + } as NetworkComponents.ResponseHeaderSection.ResponseHeaderSectionData}></devtools-early-hints-header-section> |
234 | 229 | ` |
235 | 230 | }); |
236 | 231 | } |
@@ -260,7 +255,7 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom |
260 | 255 | <devtools-response-header-section .data=${{ |
261 | 256 | request: this.#request, |
262 | 257 | toReveal: this.#toReveal, |
263 | | - } as ResponseHeaderSectionData} jslog=${ |
| 258 | + } as NetworkComponents.ResponseHeaderSection.ResponseHeaderSectionData} jslog=${ |
264 | 259 | VisualLogging.section('response-headers')}></devtools-response-header-section> |
265 | 260 | ` |
266 | 261 | }); |
@@ -344,10 +339,11 @@ export class RequestHeadersView extends LegacyWrapper.LegacyWrapper.WrappableCom |
344 | 339 | contents: (this.#showRequestHeadersText && requestHeadersText) ? |
345 | 340 | this.#renderRawHeaders(requestHeadersText, false) : |
346 | 341 | html` |
347 | | - <devtools-widget .widgetConfig=${UI.Widget.widgetConfig(RequestHeaderSection, { |
348 | | - request: this.#request, |
349 | | - toReveal: this.#toReveal, |
350 | | - })} jslog=${VisualLogging.section('request-headers')}></devtools-widget>` |
| 342 | + <devtools-widget .widgetConfig=${ |
| 343 | + UI.Widget.widgetConfig(NetworkComponents.RequestHeaderSection.RequestHeaderSection, { |
| 344 | + request: this.#request, |
| 345 | + toReveal: this.#toReveal, |
| 346 | + })} jslog=${VisualLogging.section('request-headers')}></devtools-widget>` |
351 | 347 | }); |
352 | 348 | } |
353 | 349 |
|
|
0 commit comments