chrome-devtools-frontend 1.0.944427 → 1.0.945677
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.
- package/config/gni/devtools_grd_files.gni +4 -0
- package/config/gni/devtools_image_files.gni +1 -0
- package/front_end/Images/src/circled_exclamation_icon.svg +3 -0
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/i18n/i18nImpl.ts +7 -4
- package/front_end/core/i18n/locales/en-US.json +3 -60
- package/front_end/core/i18n/locales/en-XL.json +15 -72
- package/front_end/core/protocol_client/NodeURL.ts +1 -0
- package/front_end/core/sdk/CSSMetadata.ts +0 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
- package/front_end/core/sdk/Cookie.ts +17 -0
- package/front_end/core/sdk/CookieModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -4
- package/front_end/core/sdk/NetworkManager.ts +4 -1
- package/front_end/core/sdk/NetworkRequest.ts +2 -2
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/Script.ts +2 -3
- package/front_end/entrypoints/main/MainImpl.ts +6 -0
- package/front_end/generated/protocol.d.ts +0 -4
- package/front_end/models/bindings/BreakpointManager.ts +3 -4
- package/front_end/models/bindings/ResourceMapping.ts +1 -2
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
- package/front_end/models/emulation/EmulatedDevices.ts +2 -4
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
- package/front_end/models/persistence/PersistenceActions.ts +4 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
- package/front_end/models/text_utils/ContentProvider.ts +1 -2
- package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
- package/front_end/models/timeline_model/TimelineJSProfile.ts +16 -3
- package/front_end/models/timeline_model/TimelineModel.ts +1 -0
- package/front_end/models/workspace/UISourceCode.ts +2 -2
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +20 -6
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/animationTimeline.css +2 -0
- package/front_end/panels/application/BackForwardCacheStrings.ts +15 -75
- package/front_end/panels/application/BackForwardCacheView.ts +8 -1
- package/front_end/panels/application/ReportingApiView.ts +15 -1
- package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
- package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
- package/front_end/panels/changes/ChangesView.ts +8 -7
- package/front_end/panels/elements/StyleEditorWidget.ts +7 -7
- package/front_end/panels/elements/StylePropertyTreeElement.ts +8 -15
- package/front_end/panels/elements/StylesSidebarPane.ts +35 -9
- package/front_end/panels/emulation/DeviceModeView.ts +3 -0
- package/front_end/panels/help/ReleaseNoteText.ts +3 -1
- package/front_end/panels/network/NetworkItemView.ts +7 -1
- package/front_end/panels/profiler/heapProfiler.css +2 -5
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/timeline/TimelineController.ts +3 -0
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
- package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
- package/front_end/panels/webauthn/WebauthnPane.ts +31 -32
- package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
- package/front_end/services/window_bounds/window_bounds.ts +9 -0
- package/front_end/third_party/acorn/README.chromium +2 -2
- package/front_end/third_party/acorn/acorn.ts +1 -1
- package/front_end/third_party/acorn/package/CHANGELOG.md +31 -1
- package/front_end/third_party/acorn/package/README.md +1 -1
- package/front_end/third_party/acorn/package/dist/acorn.d.ts +3 -0
- package/front_end/third_party/acorn/package/dist/acorn.js +772 -708
- package/front_end/third_party/acorn/package/dist/acorn.mjs +767 -703
- package/front_end/third_party/acorn/package/dist/bin.js +47 -21
- package/front_end/third_party/acorn/package/package.json +1 -1
- package/front_end/third_party/acorn-loose/README.chromium +2 -2
- package/front_end/third_party/acorn-loose/package/CHANGELOG.md +12 -0
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.js +27 -7
- package/front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs +28 -8
- package/front_end/third_party/acorn-loose/package/package.json +2 -2
- package/front_end/third_party/codemirror.next/bundle.ts +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +8 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/i18n/i18n-impl.ts +1 -1
- package/front_end/third_party/lit-html/README.chromium +2 -2
- package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
- package/front_end/third_party/lit-html/package/LICENSE +9 -9
- package/front_end/third_party/lit-html/package/README.md +12 -162
- package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/async-directive.js +2 -7
- package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
- package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
- package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.js +6 -1
- package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
- package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
- package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
- package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
- package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
- package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
- package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
- package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
- package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.js +6 -5
- package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
- package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive.js +1 -1
- package/front_end/third_party/lit-html/package/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
- package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
- package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
- package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
- package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.js +1 -4
- package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
- package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
- package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
- package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.js +2 -6
- package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
- package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/package.json +75 -24
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
- package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/static.js +1 -1
- package/front_end/third_party/lit-html/package/static.js.map +1 -1
- package/front_end/third_party/marked/README.chromium +2 -2
- package/front_end/third_party/marked/marked.ts +2 -2
- package/front_end/third_party/marked/package/README.md +7 -1
- package/front_end/third_party/marked/package/bin/marked.js +214 -0
- package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
- package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
- package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
- package/front_end/third_party/marked/package/man/marked.1 +5 -24
- package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
- package/front_end/third_party/marked/package/marked.min.js +1 -1
- package/front_end/third_party/marked/package/package.json +41 -32
- package/front_end/third_party/marked/package/src/Lexer.js +109 -108
- package/front_end/third_party/marked/package/src/Parser.js +38 -15
- package/front_end/third_party/marked/package/src/Renderer.js +5 -5
- package/front_end/third_party/marked/package/src/Slugger.js +2 -2
- package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
- package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
- package/front_end/third_party/marked/package/src/defaults.js +6 -9
- package/front_end/third_party/marked/package/src/helpers.js +16 -27
- package/front_end/third_party/marked/package/src/marked.js +146 -63
- package/front_end/third_party/marked/package/src/rules.js +20 -45
- package/front_end/third_party/wasmparser/README.chromium +2 -2
- package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
- package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/package.json +1 -1
- package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
- package/front_end/ui/components/adorners/Adorner.ts +14 -14
- package/front_end/ui/components/buttons/Button.ts +133 -42
- package/front_end/ui/components/buttons/button.css +31 -0
- package/front_end/ui/components/data_grid/DataGrid.ts +131 -122
- package/front_end/ui/components/data_grid/DataGridController.ts +42 -42
- package/front_end/ui/components/diff_view/DiffView.ts +4 -4
- package/front_end/ui/components/docs/button/basic.html +3 -0
- package/front_end/ui/components/docs/button/basic.ts +58 -0
- package/front_end/ui/components/expandable_list/ExpandableList.ts +11 -11
- package/front_end/ui/components/icon_button/Icon.ts +24 -21
- package/front_end/ui/components/icon_button/IconButton.ts +31 -31
- package/front_end/ui/components/issue_counter/IssueCounter.ts +52 -52
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +42 -42
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +67 -67
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +22 -22
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +36 -36
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +19 -19
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +25 -25
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +52 -52
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +21 -21
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +14 -14
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +8 -8
- package/front_end/ui/components/markdown_view/MarkdownView.ts +6 -6
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +33 -33
- package/front_end/ui/components/report_view/ReportView.ts +18 -18
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +53 -53
- package/front_end/ui/components/settings/SettingCheckbox.ts +15 -15
- package/front_end/ui/components/survey_link/SurveyLink.ts +28 -28
- package/front_end/ui/components/text_editor/TextEditor.ts +68 -36
- package/front_end/ui/components/text_editor/config.ts +4 -2
- package/front_end/ui/components/text_editor/javascript.ts +6 -6
- package/front_end/ui/components/text_prompt/TextPrompt.ts +19 -19
- package/front_end/ui/components/tree_outline/TreeOutline.ts +56 -56
- package/front_end/ui/legacy/Infobar.ts +9 -0
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/ListWidget.ts +2 -2
- package/front_end/ui/legacy/ViewManager.ts +6 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
- package/front_end/ui/legacy/tabbedPane.css +1 -1
- package/inspector_overlay/main.ts +3 -0
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/l10n_filename_matches.js +17 -4
- package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +21 -0
|
@@ -90,20 +90,20 @@ export class RenderCoordinator extends EventTarget {
|
|
|
90
90
|
// This does not affect logging frames or queue empty events.
|
|
91
91
|
observeOnlyNamed = true;
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
readonly #logInternal: CoordinatorLogEntry[] = [];
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
readonly #pendingWorkFrames: CoordinatorFrame[] = [];
|
|
96
|
+
readonly #resolvers = new WeakMap<CoordinatorCallback, RenderCoordinatorResolverCallback>();
|
|
97
|
+
readonly #rejectors = new WeakMap<CoordinatorCallback, RenderCoordinatorRejectorCallback>();
|
|
98
|
+
readonly #labels = new WeakMap<CoordinatorCallback, string>();
|
|
99
|
+
#scheduledWorkId = 0;
|
|
100
100
|
|
|
101
101
|
pendingFramesCount(): number {
|
|
102
|
-
return this
|
|
102
|
+
return this.#pendingWorkFrames.length;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
done(): Promise<void> {
|
|
106
|
-
if (this
|
|
106
|
+
if (this.#pendingWorkFrames.length === 0) {
|
|
107
107
|
this.logIfEnabled('[Queue empty]');
|
|
108
108
|
return Promise.resolve();
|
|
109
109
|
}
|
|
@@ -139,8 +139,8 @@ export class RenderCoordinator extends EventTarget {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
takeRecords(): CoordinatorLogEntry[] {
|
|
142
|
-
const logs = [...this
|
|
143
|
-
this
|
|
142
|
+
const logs = [...this.#logInternal];
|
|
143
|
+
this.#logInternal.length = 0;
|
|
144
144
|
return logs;
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -165,16 +165,16 @@ export class RenderCoordinator extends EventTarget {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
private enqueueHandler<T = unknown>(callback: CoordinatorCallback, action: ACTION, label = ''): Promise<T> {
|
|
168
|
-
this
|
|
168
|
+
this.#labels.set(callback, `${action === ACTION.READ ? '[Read]' : '[Write]'}: ${label}`);
|
|
169
169
|
|
|
170
|
-
if (this
|
|
171
|
-
this
|
|
170
|
+
if (this.#pendingWorkFrames.length === 0) {
|
|
171
|
+
this.#pendingWorkFrames.push({
|
|
172
172
|
readers: [],
|
|
173
173
|
writers: [],
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
const frame = this
|
|
177
|
+
const frame = this.#pendingWorkFrames[0];
|
|
178
178
|
if (!frame) {
|
|
179
179
|
throw new Error('No frame available');
|
|
180
180
|
}
|
|
@@ -193,8 +193,8 @@ export class RenderCoordinator extends EventTarget {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
const resolverPromise = new Promise((resolve, reject) => {
|
|
196
|
-
this
|
|
197
|
-
this
|
|
196
|
+
this.#resolvers.set(callback, resolve);
|
|
197
|
+
this.#rejectors.set(callback, reject);
|
|
198
198
|
});
|
|
199
199
|
|
|
200
200
|
this.scheduleWork();
|
|
@@ -203,24 +203,24 @@ export class RenderCoordinator extends EventTarget {
|
|
|
203
203
|
|
|
204
204
|
private async handleWork(handler: CoordinatorCallback): Promise<void> {
|
|
205
205
|
const data = await handler.call(undefined);
|
|
206
|
-
const resolver = this
|
|
206
|
+
const resolver = this.#resolvers.get(handler);
|
|
207
207
|
if (!resolver) {
|
|
208
208
|
throw new Error('Unable to locate resolver');
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
resolver.call(undefined, data);
|
|
212
|
-
this
|
|
213
|
-
this
|
|
212
|
+
this.#resolvers.delete(handler);
|
|
213
|
+
this.#rejectors.delete(handler);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
private scheduleWork(): void {
|
|
217
|
-
const hasScheduledWork = this
|
|
217
|
+
const hasScheduledWork = this.#scheduledWorkId !== 0;
|
|
218
218
|
if (hasScheduledWork) {
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
this
|
|
223
|
-
const hasPendingFrames = this
|
|
222
|
+
this.#scheduledWorkId = requestAnimationFrame(async () => {
|
|
223
|
+
const hasPendingFrames = this.#pendingWorkFrames.length > 0;
|
|
224
224
|
if (!hasPendingFrames) {
|
|
225
225
|
// No pending frames means all pending work has completed.
|
|
226
226
|
// The events dispatched below are mostly for testing contexts.
|
|
@@ -231,14 +231,14 @@ export class RenderCoordinator extends EventTarget {
|
|
|
231
231
|
window.dispatchEvent(new RenderCoordinatorQueueEmptyEvent());
|
|
232
232
|
|
|
233
233
|
this.logIfEnabled('[Queue empty]');
|
|
234
|
-
this
|
|
234
|
+
this.#scheduledWorkId = 0;
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
this.dispatchEvent(new RenderCoordinatorNewFrameEvent());
|
|
239
239
|
this.logIfEnabled('[New frame]');
|
|
240
240
|
|
|
241
|
-
const frame = this
|
|
241
|
+
const frame = this.#pendingWorkFrames.shift();
|
|
242
242
|
if (!frame) {
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
@@ -247,7 +247,7 @@ export class RenderCoordinator extends EventTarget {
|
|
|
247
247
|
// to proceed together.
|
|
248
248
|
const readers: Promise<unknown>[] = [];
|
|
249
249
|
for (const reader of frame.readers) {
|
|
250
|
-
this.logIfEnabled(this
|
|
250
|
+
this.logIfEnabled(this.#labels.get(reader));
|
|
251
251
|
readers.push(this.handleWork(reader));
|
|
252
252
|
}
|
|
253
253
|
|
|
@@ -268,7 +268,7 @@ export class RenderCoordinator extends EventTarget {
|
|
|
268
268
|
// Next do all the writers as a block.
|
|
269
269
|
const writers: Promise<unknown>[] = [];
|
|
270
270
|
for (const writer of frame.writers) {
|
|
271
|
-
this.logIfEnabled(this
|
|
271
|
+
this.logIfEnabled(this.#labels.get(writer));
|
|
272
272
|
writers.push(this.handleWork(writer));
|
|
273
273
|
}
|
|
274
274
|
|
|
@@ -289,22 +289,22 @@ export class RenderCoordinator extends EventTarget {
|
|
|
289
289
|
// Since there may have been more work requested in
|
|
290
290
|
// the callback of a reader / writer, we attempt to schedule
|
|
291
291
|
// it at this point.
|
|
292
|
-
this
|
|
292
|
+
this.#scheduledWorkId = 0;
|
|
293
293
|
this.scheduleWork();
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
private rejectAll(handlers: CoordinatorCallback[], error: Error): void {
|
|
298
298
|
for (const handler of handlers) {
|
|
299
|
-
const rejector = this
|
|
299
|
+
const rejector = this.#rejectors.get(handler);
|
|
300
300
|
if (!rejector) {
|
|
301
301
|
console.warn('Unable to locate rejector');
|
|
302
302
|
continue;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
rejector.call(undefined, error);
|
|
306
|
-
this
|
|
307
|
-
this
|
|
306
|
+
this.#resolvers.delete(handler);
|
|
307
|
+
this.#rejectors.delete(handler);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
|
|
@@ -317,11 +317,11 @@ export class RenderCoordinator extends EventTarget {
|
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
this
|
|
320
|
+
this.#logInternal.push({time: performance.now(), value});
|
|
321
321
|
|
|
322
322
|
// Keep the log at the log size.
|
|
323
|
-
while (this
|
|
324
|
-
this
|
|
323
|
+
while (this.#logInternal.length > this.recordStorageLimit) {
|
|
324
|
+
this.#logInternal.shift();
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
}
|
|
@@ -36,16 +36,16 @@ export interface ReportData {
|
|
|
36
36
|
export class Report extends HTMLElement {
|
|
37
37
|
static readonly litTagName = LitHtml.literal`devtools-report`;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
40
|
+
#reportTitle: string = '';
|
|
41
41
|
|
|
42
42
|
set data({reportTitle}: ReportData) {
|
|
43
|
-
this
|
|
43
|
+
this.#reportTitle = reportTitle;
|
|
44
44
|
this.render();
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
connectedCallback(): void {
|
|
48
|
-
this
|
|
48
|
+
this.#shadow.adoptedStyleSheets = [reportStyles];
|
|
49
49
|
this.render();
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -54,10 +54,10 @@ export class Report extends HTMLElement {
|
|
|
54
54
|
// clang-format off
|
|
55
55
|
LitHtml.render(LitHtml.html`
|
|
56
56
|
<div class="content">
|
|
57
|
-
${this
|
|
57
|
+
${this.#reportTitle ? LitHtml.html`<div class="report-title">${this.#reportTitle}</div>` : LitHtml.nothing}
|
|
58
58
|
<slot></slot>
|
|
59
59
|
</div>
|
|
60
|
-
`, this
|
|
60
|
+
`, this.#shadow, {host: this});
|
|
61
61
|
// clang-format on
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -69,9 +69,9 @@ export interface ReportSectionData {
|
|
|
69
69
|
export class ReportSectionHeader extends HTMLElement {
|
|
70
70
|
static readonly litTagName = LitHtml.literal`devtools-report-section-header`;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
73
73
|
connectedCallback(): void {
|
|
74
|
-
this
|
|
74
|
+
this.#shadow.adoptedStyleSheets = [reportSectionHeaderStyles];
|
|
75
75
|
this.render();
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -82,7 +82,7 @@ export class ReportSectionHeader extends HTMLElement {
|
|
|
82
82
|
<div class="section-header">
|
|
83
83
|
<slot></slot>
|
|
84
84
|
</div>
|
|
85
|
-
`, this
|
|
85
|
+
`, this.#shadow, {host: this});
|
|
86
86
|
// clang-format on
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -90,9 +90,9 @@ export class ReportSectionHeader extends HTMLElement {
|
|
|
90
90
|
export class ReportSectionDivider extends HTMLElement {
|
|
91
91
|
static readonly litTagName = LitHtml.literal`devtools-report-divider`;
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
94
94
|
connectedCallback(): void {
|
|
95
|
-
this
|
|
95
|
+
this.#shadow.adoptedStyleSheets = [reportSectionDividerStyles];
|
|
96
96
|
this.render();
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -102,7 +102,7 @@ export class ReportSectionDivider extends HTMLElement {
|
|
|
102
102
|
LitHtml.render(LitHtml.html`
|
|
103
103
|
<div class="section-divider">
|
|
104
104
|
</div>
|
|
105
|
-
`, this
|
|
105
|
+
`, this.#shadow, {host: this});
|
|
106
106
|
// clang-format on
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -110,9 +110,9 @@ export class ReportSectionDivider extends HTMLElement {
|
|
|
110
110
|
export class ReportKey extends HTMLElement {
|
|
111
111
|
static readonly litTagName = LitHtml.literal`devtools-report-key`;
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
114
114
|
connectedCallback(): void {
|
|
115
|
-
this
|
|
115
|
+
this.#shadow.adoptedStyleSheets = [reportKeyStyles];
|
|
116
116
|
this.render();
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -121,7 +121,7 @@ export class ReportKey extends HTMLElement {
|
|
|
121
121
|
// clang-format off
|
|
122
122
|
LitHtml.render(LitHtml.html`
|
|
123
123
|
<div class="key"><slot></slot></div>
|
|
124
|
-
`, this
|
|
124
|
+
`, this.#shadow, {host: this});
|
|
125
125
|
// clang-format on
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -129,9 +129,9 @@ export class ReportKey extends HTMLElement {
|
|
|
129
129
|
export class ReportValue extends HTMLElement {
|
|
130
130
|
static readonly litTagName = LitHtml.literal`devtools-report-value`;
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
133
133
|
connectedCallback(): void {
|
|
134
|
-
this
|
|
134
|
+
this.#shadow.adoptedStyleSheets = [reportValueStyles];
|
|
135
135
|
this.render();
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -140,7 +140,7 @@ export class ReportValue extends HTMLElement {
|
|
|
140
140
|
// clang-format off
|
|
141
141
|
LitHtml.render(LitHtml.html`
|
|
142
142
|
<div class="value"><slot></slot></div>
|
|
143
|
-
`, this
|
|
143
|
+
`, this.#shadow, {host: this});
|
|
144
144
|
// clang-format on
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -55,73 +55,73 @@ const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
|
|
|
55
55
|
|
|
56
56
|
export class RequestLinkIcon extends HTMLElement {
|
|
57
57
|
static readonly litTagName = LitHtml.literal`devtools-request-link-icon`;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
59
|
+
#linkToPreflight?: boolean;
|
|
60
60
|
// The value `null` indicates that the request is not available,
|
|
61
61
|
// `undefined` that it is still being resolved.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
#request?: SDK.NetworkRequest.NetworkRequest|null;
|
|
63
|
+
#highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};
|
|
64
|
+
#requestResolver?: Logs.RequestResolver.RequestResolver;
|
|
65
|
+
#displayURL: boolean = false;
|
|
66
|
+
#networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;
|
|
67
|
+
#affectedRequest?: {requestId: Protocol.Network.RequestId, url?: string};
|
|
68
|
+
#additionalOnClickAction?: () => void;
|
|
69
|
+
#reveal = Common.Revealer.reveal;
|
|
70
|
+
#requestResolvedPromise = Promise.resolve<void>(undefined);
|
|
71
71
|
|
|
72
72
|
set data(data: RequestLinkIconData) {
|
|
73
|
-
this
|
|
74
|
-
this
|
|
73
|
+
this.#linkToPreflight = data.linkToPreflight;
|
|
74
|
+
this.#request = data.request;
|
|
75
75
|
if (data.affectedRequest) {
|
|
76
|
-
this
|
|
76
|
+
this.#affectedRequest = {...data.affectedRequest};
|
|
77
77
|
}
|
|
78
|
-
this
|
|
79
|
-
this
|
|
80
|
-
this
|
|
81
|
-
this
|
|
82
|
-
this
|
|
78
|
+
this.#highlightHeader = data.highlightHeader;
|
|
79
|
+
this.#networkTab = data.networkTab;
|
|
80
|
+
this.#requestResolver = data.requestResolver;
|
|
81
|
+
this.#displayURL = data.displayURL ?? false;
|
|
82
|
+
this.#additionalOnClickAction = data.additionalOnClickAction;
|
|
83
83
|
if (data.revealOverride) {
|
|
84
|
-
this
|
|
84
|
+
this.#reveal = data.revealOverride;
|
|
85
85
|
}
|
|
86
|
-
if (!this
|
|
87
|
-
this
|
|
86
|
+
if (!this.#request && data.affectedRequest) {
|
|
87
|
+
this.#requestResolvedPromise = this.resolveRequest(data.affectedRequest.requestId);
|
|
88
88
|
}
|
|
89
89
|
this.render();
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
connectedCallback(): void {
|
|
93
|
-
this
|
|
93
|
+
this.#shadow.adoptedStyleSheets = [requestLinkIconStyles];
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
private resolveRequest(requestId: Protocol.Network.RequestId): Promise<void> {
|
|
97
|
-
if (!this
|
|
97
|
+
if (!this.#requestResolver) {
|
|
98
98
|
throw new Error('A `RequestResolver` must be provided if an `affectedRequest` is provided.');
|
|
99
99
|
}
|
|
100
|
-
return this
|
|
100
|
+
return this.#requestResolver.waitFor(requestId)
|
|
101
101
|
.then(request => {
|
|
102
|
-
this
|
|
102
|
+
this.#request = request;
|
|
103
103
|
})
|
|
104
104
|
.catch(() => {
|
|
105
|
-
this
|
|
105
|
+
this.#request = null;
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
get data(): RequestLinkIconData {
|
|
110
110
|
return {
|
|
111
|
-
linkToPreflight: this
|
|
112
|
-
request: this
|
|
113
|
-
affectedRequest: this
|
|
114
|
-
highlightHeader: this
|
|
115
|
-
networkTab: this
|
|
116
|
-
requestResolver: this
|
|
117
|
-
displayURL: this
|
|
118
|
-
additionalOnClickAction: this
|
|
119
|
-
revealOverride: this
|
|
111
|
+
linkToPreflight: this.#linkToPreflight,
|
|
112
|
+
request: this.#request,
|
|
113
|
+
affectedRequest: this.#affectedRequest,
|
|
114
|
+
highlightHeader: this.#highlightHeader,
|
|
115
|
+
networkTab: this.#networkTab,
|
|
116
|
+
requestResolver: this.#requestResolver,
|
|
117
|
+
displayURL: this.#displayURL,
|
|
118
|
+
additionalOnClickAction: this.#additionalOnClickAction,
|
|
119
|
+
revealOverride: this.#reveal !== Common.Revealer.reveal ? this.#reveal : undefined,
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
private iconColor(): string {
|
|
124
|
-
if (!this
|
|
124
|
+
if (!this.#request) {
|
|
125
125
|
return '--issue-color-yellow';
|
|
126
126
|
}
|
|
127
127
|
return '--color-link';
|
|
@@ -140,38 +140,38 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
140
140
|
if (event.button !== 0) {
|
|
141
141
|
return; // Only handle left-click for now.
|
|
142
142
|
}
|
|
143
|
-
const linkedRequest = this
|
|
143
|
+
const linkedRequest = this.#linkToPreflight ? this.#request?.preflightRequest() : this.#request;
|
|
144
144
|
if (!linkedRequest) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
if (this
|
|
147
|
+
if (this.#highlightHeader) {
|
|
148
148
|
const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.header(
|
|
149
|
-
linkedRequest, this
|
|
150
|
-
this
|
|
149
|
+
linkedRequest, this.#highlightHeader.section, this.#highlightHeader.name);
|
|
150
|
+
this.#reveal(requestLocation);
|
|
151
151
|
} else {
|
|
152
152
|
const requestLocation = NetworkForward.UIRequestLocation.UIRequestLocation.tab(
|
|
153
|
-
linkedRequest, this
|
|
154
|
-
this
|
|
153
|
+
linkedRequest, this.#networkTab ?? NetworkForward.UIRequestLocation.UIRequestTabs.Headers);
|
|
154
|
+
this.#reveal(requestLocation);
|
|
155
155
|
}
|
|
156
|
-
this
|
|
156
|
+
this.#additionalOnClickAction?.();
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
private getTooltip(): Platform.UIString.LocalizedString {
|
|
160
|
-
if (this
|
|
161
|
-
return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this
|
|
160
|
+
if (this.#request) {
|
|
161
|
+
return i18nString(UIStrings.clickToShowRequestInTheNetwork, {url: this.#request.url()});
|
|
162
162
|
}
|
|
163
163
|
return i18nString(UIStrings.requestUnavailableInTheNetwork);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
private getUrlForDisplaying(): string|undefined {
|
|
167
|
-
if (!this
|
|
168
|
-
return this
|
|
167
|
+
if (!this.#request) {
|
|
168
|
+
return this.#affectedRequest?.url;
|
|
169
169
|
}
|
|
170
|
-
return this
|
|
170
|
+
return this.#request.url();
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
private maybeRenderURL(): LitHtml.TemplateResult|{} {
|
|
174
|
-
if (!this
|
|
174
|
+
if (!this.#displayURL) {
|
|
175
175
|
return LitHtml.nothing;
|
|
176
176
|
}
|
|
177
177
|
const url = this.getUrlForDisplaying();
|
|
@@ -186,9 +186,9 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
186
186
|
return coordinator.write(() => {
|
|
187
187
|
// clang-format off
|
|
188
188
|
LitHtml.render(LitHtml.html`
|
|
189
|
-
${LitHtml.Directives.until(this
|
|
189
|
+
${LitHtml.Directives.until(this.#requestResolvedPromise.then(() => this.renderComponent()), this.renderComponent())}
|
|
190
190
|
`,
|
|
191
|
-
this
|
|
191
|
+
this.#shadow, {host: this});
|
|
192
192
|
// clang-format on
|
|
193
193
|
});
|
|
194
194
|
}
|
|
@@ -196,7 +196,7 @@ export class RequestLinkIcon extends HTMLElement {
|
|
|
196
196
|
private renderComponent(): LitHtml.TemplateResult {
|
|
197
197
|
// clang-format off
|
|
198
198
|
return LitHtml.html`
|
|
199
|
-
<span class=${LitHtml.Directives.classMap({'link': Boolean(this
|
|
199
|
+
<span class=${LitHtml.Directives.classMap({'link': Boolean(this.#request)})}
|
|
200
200
|
tabindex="0"
|
|
201
201
|
@click=${this.handleClick}>
|
|
202
202
|
<${IconButton.Icon.Icon.litTagName} .data=${this.iconData() as IconButton.Icon.IconData}
|
|
@@ -22,32 +22,32 @@ export interface SettingCheckboxData {
|
|
|
22
22
|
*/
|
|
23
23
|
export class SettingCheckbox extends HTMLElement {
|
|
24
24
|
static readonly litTagName = LitHtml.literal`setting-checkbox`;
|
|
25
|
-
|
|
25
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
#setting?: Common.Settings.Setting<boolean>;
|
|
28
|
+
#disabled: boolean = false;
|
|
29
|
+
#changeListenerDescriptor?: Common.EventTarget.EventDescriptor;
|
|
30
30
|
|
|
31
31
|
connectedCallback(): void {
|
|
32
|
-
this
|
|
32
|
+
this.#shadow.adoptedStyleSheets = [settingCheckboxStyles];
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
set data(data: SettingCheckboxData) {
|
|
36
|
-
if (this
|
|
37
|
-
this
|
|
36
|
+
if (this.#changeListenerDescriptor && this.#setting) {
|
|
37
|
+
this.#setting.removeChangeListener(this.#changeListenerDescriptor.listener);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
this
|
|
41
|
-
this
|
|
40
|
+
this.#setting = data.setting;
|
|
41
|
+
this.#disabled = Boolean(data.disabled);
|
|
42
42
|
|
|
43
|
-
this
|
|
43
|
+
this.#changeListenerDescriptor = this.#setting.addChangeListener(() => {
|
|
44
44
|
this.render();
|
|
45
45
|
});
|
|
46
46
|
this.render();
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
private render(): void {
|
|
50
|
-
if (!this
|
|
50
|
+
if (!this.#setting) {
|
|
51
51
|
throw new Error('No "Setting" object provided for rendering');
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -55,15 +55,15 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
55
55
|
LitHtml.html`
|
|
56
56
|
<p>
|
|
57
57
|
<label>
|
|
58
|
-
<input type="checkbox" ?checked=${this
|
|
59
|
-
this.checkboxChanged}" aria-label="${this
|
|
58
|
+
<input type="checkbox" ?checked=${this.#setting.get()} ?disabled=${this.#disabled} @change="${
|
|
59
|
+
this.checkboxChanged}" aria-label="${this.#setting.title()}" /> ${this.#setting.title()}
|
|
60
60
|
</label>
|
|
61
61
|
</p>`,
|
|
62
|
-
this
|
|
62
|
+
this.#shadow, {host: this});
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
private checkboxChanged(e: Event): void {
|
|
66
|
-
this
|
|
66
|
+
this.#setting?.set((e.target as HTMLInputElement).checked);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -51,74 +51,74 @@ const enum State {
|
|
|
51
51
|
export class SurveyLink extends HTMLElement {
|
|
52
52
|
static readonly litTagName = LitHtml.literal`devtools-survey-link`;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
55
|
+
#trigger = '';
|
|
56
|
+
#promptText = Common.UIString.LocalizedEmptyString;
|
|
57
|
+
#canShowSurvey: (trigger: string, callback: CanShowSurveyCallback) => void = () => {};
|
|
58
|
+
#showSurvey: (trigger: string, callback: ShowSurveyCallback) => void = () => {};
|
|
59
|
+
#state: State = State.Checking;
|
|
60
60
|
|
|
61
61
|
connectedCallback(): void {
|
|
62
|
-
this
|
|
62
|
+
this.#shadow.adoptedStyleSheets = [surveyLinkStyles];
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// Re-setting data will cause the state to go back to 'Checking' which hides the link.
|
|
66
66
|
set data(data: SurveyLinkData) {
|
|
67
|
-
this
|
|
68
|
-
this
|
|
69
|
-
this
|
|
70
|
-
this
|
|
67
|
+
this.#trigger = data.trigger;
|
|
68
|
+
this.#promptText = data.promptText;
|
|
69
|
+
this.#canShowSurvey = data.canShowSurvey;
|
|
70
|
+
this.#showSurvey = data.showSurvey;
|
|
71
71
|
|
|
72
72
|
this.checkSurvey();
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
private checkSurvey(): void {
|
|
76
|
-
this
|
|
77
|
-
this
|
|
76
|
+
this.#state = State.Checking;
|
|
77
|
+
this.#canShowSurvey(this.#trigger, ({canShowSurvey}) => {
|
|
78
78
|
if (!canShowSurvey) {
|
|
79
|
-
this
|
|
79
|
+
this.#state = State.DontShowLink;
|
|
80
80
|
} else {
|
|
81
|
-
this
|
|
81
|
+
this.#state = State.ShowLink;
|
|
82
82
|
}
|
|
83
83
|
this.render();
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
private sendSurvey(): void {
|
|
88
|
-
this
|
|
88
|
+
this.#state = State.Sending;
|
|
89
89
|
this.render();
|
|
90
|
-
this
|
|
90
|
+
this.#showSurvey(this.#trigger, ({surveyShown}) => {
|
|
91
91
|
if (!surveyShown) {
|
|
92
|
-
this
|
|
92
|
+
this.#state = State.Failed;
|
|
93
93
|
} else {
|
|
94
|
-
this
|
|
94
|
+
this.#state = State.SurveyShown;
|
|
95
95
|
}
|
|
96
96
|
this.render();
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
private render(): void {
|
|
101
|
-
if (this
|
|
101
|
+
if (this.#state === State.Checking || this.#state === State.DontShowLink) {
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
let linkText = this
|
|
106
|
-
if (this
|
|
105
|
+
let linkText = this.#promptText;
|
|
106
|
+
if (this.#state === State.Sending) {
|
|
107
107
|
linkText = i18nString(UIStrings.openingSurvey);
|
|
108
|
-
} else if (this
|
|
108
|
+
} else if (this.#state === State.SurveyShown) {
|
|
109
109
|
linkText = i18nString(UIStrings.thankYouForYourFeedback);
|
|
110
|
-
} else if (this
|
|
110
|
+
} else if (this.#state === State.Failed) {
|
|
111
111
|
linkText = i18nString(UIStrings.anErrorOccurredWithTheSurvey);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
let linkState = '';
|
|
115
|
-
if (this
|
|
115
|
+
if (this.#state === State.Sending) {
|
|
116
116
|
linkState = 'pending-link';
|
|
117
|
-
} else if (this
|
|
117
|
+
} else if (this.#state === State.Failed || this.#state === State.SurveyShown) {
|
|
118
118
|
linkState = 'disabled-link';
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
const ariaDisabled = this
|
|
121
|
+
const ariaDisabled = this.#state !== State.ShowLink;
|
|
122
122
|
|
|
123
123
|
// clang-format off
|
|
124
124
|
// eslint-disable-next-line rulesdir/ban_style_tags_in_lit_html
|
|
@@ -129,7 +129,7 @@ export class SurveyLink extends HTMLElement {
|
|
|
129
129
|
</button>
|
|
130
130
|
`;
|
|
131
131
|
// clang-format on
|
|
132
|
-
LitHtml.render(output, this
|
|
132
|
+
LitHtml.render(output, this.#shadow, {host: this});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|