chrome-devtools-frontend 1.0.940714 → 1.0.942529
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/all_devtools_files.gni +0 -57
- package/config/gni/devtools_grd_files.gni +55 -15
- package/config/gni/devtools_image_files.gni +2 -3
- package/front_end/.eslintrc.js +12 -1
- package/front_end/Images/src/feedback_button_icon.svg +3 -0
- package/front_end/Images/src/{feedback_thin_16x16_icon.svg → survey_feedback_icon.svg} +1 -1
- package/front_end/Tests.js +15 -0
- package/front_end/core/common/Color.ts +5 -0
- package/front_end/core/i18n/locales/en-US.json +31 -28
- package/front_end/core/i18n/locales/en-XL.json +31 -28
- package/front_end/core/sdk/DebuggerModel.ts +4 -14
- package/front_end/core/sdk/sdk-meta.ts +17 -3
- package/front_end/emulated_devices/module.json +1 -3
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -9
- package/front_end/entrypoints/main/MainImpl.ts +26 -0
- package/front_end/entrypoints/shell/shell.js +0 -11
- package/front_end/entrypoints/shell/shell.json +0 -2
- package/front_end/entrypoints/worker_app/worker_app.json +0 -4
- package/front_end/generated/InspectorBackendCommands.js +1 -0
- package/front_end/generated/protocol.d.ts +2 -0
- package/front_end/global_typings/global_defs.d.ts +5 -0
- package/front_end/legacy_test_runner/bindings_test_runner/IsolatedFilesystemTestRunner.js +2 -2
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +14 -2
- package/front_end/legacy_test_runner/legacy_test_runner.ts +10 -1
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +11 -0
- package/front_end/models/formatter/SourceFormatter.ts +0 -10
- package/front_end/models/workspace/UISourceCode.ts +9 -42
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/application/ApplicationPanelSidebar.ts +3 -3
- package/front_end/panels/application/application-meta.ts +0 -3
- package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
- package/front_end/panels/application/components/ReportsGrid.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +21 -26
- package/front_end/panels/coverage/CoverageDecorationManager.ts +4 -5
- package/front_end/panels/coverage/CoverageView.ts +2 -105
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +11 -56
- package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -8
- package/front_end/panels/elements/ElementsTreeElement.ts +4 -9
- package/front_end/panels/elements/components/StylePropertyEditor.ts +2 -0
- package/front_end/panels/elements/components/adornerSettingsPane.css +0 -4
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/emulation/DeviceModeView.ts +2 -1
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +3 -1
- package/front_end/panels/emulation/MediaQueryInspector.ts +3 -1
- package/front_end/panels/emulation/emulation-meta.ts +2 -4
- package/front_end/panels/issues/issues-meta.ts +0 -2
- package/front_end/panels/layers/module.json +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +2 -4
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -4
- package/front_end/panels/lighthouse/lighthouseStartView.css +4 -0
- package/front_end/panels/lighthouse/module.json +1 -4
- package/front_end/panels/media/media-meta.ts +0 -3
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -1
- package/front_end/panels/network/network-meta.ts +0 -3
- package/front_end/panels/profiler/module.json +1 -4
- package/front_end/panels/screencast/module.json +1 -4
- package/front_end/panels/security/security-meta.ts +0 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +16 -30
- package/front_end/panels/sources/CSSPlugin.ts +310 -331
- package/front_end/panels/sources/CallStackSidebarPane.ts +28 -34
- package/front_end/panels/sources/CoveragePlugin.ts +121 -6
- package/front_end/panels/sources/DebuggerPlugin.ts +1166 -1243
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +71 -101
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -3
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +26 -23
- package/front_end/panels/sources/Plugin.ts +20 -4
- package/front_end/panels/sources/ProfilePlugin.ts +185 -0
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/ScriptOriginPlugin.ts +0 -10
- package/front_end/panels/sources/SnippetsPlugin.ts +1 -10
- package/front_end/panels/sources/SourcesPanel.ts +15 -10
- package/front_end/panels/sources/SourcesView.ts +10 -8
- package/front_end/panels/sources/TabbedEditorContainer.ts +31 -27
- package/front_end/panels/sources/UISourceCodeFrame.ts +335 -470
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -2
- package/front_end/panels/sources/sources-legacy.ts +0 -6
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/module.json +0 -3
- package/front_end/third_party/codemirror.next/bundle.ts +9 -13
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/javascript.js +2 -2
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -6
- package/front_end/third_party/codemirror.next/chunk/php.js +2 -6
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +2 -2
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +279 -198
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +13 -11
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1128 -1158
- package/front_end/third_party/lighthouse/locales/ar-XB.json +211 -79
- package/front_end/third_party/lighthouse/locales/ar.json +213 -81
- package/front_end/third_party/lighthouse/locales/bg.json +211 -79
- package/front_end/third_party/lighthouse/locales/ca.json +212 -80
- package/front_end/third_party/lighthouse/locales/cs.json +211 -79
- package/front_end/third_party/lighthouse/locales/da.json +211 -79
- package/front_end/third_party/lighthouse/locales/de.json +211 -79
- package/front_end/third_party/lighthouse/locales/el.json +213 -81
- package/front_end/third_party/lighthouse/locales/en-GB.json +211 -79
- package/front_end/third_party/lighthouse/locales/en-US.json +186 -75
- package/front_end/third_party/lighthouse/locales/en-XA.json +211 -79
- package/front_end/third_party/lighthouse/locales/en-XL.json +186 -75
- package/front_end/third_party/lighthouse/locales/es-419.json +211 -79
- package/front_end/third_party/lighthouse/locales/es.json +212 -80
- package/front_end/third_party/lighthouse/locales/fi.json +211 -79
- package/front_end/third_party/lighthouse/locales/fil.json +211 -79
- package/front_end/third_party/lighthouse/locales/fr.json +211 -79
- package/front_end/third_party/lighthouse/locales/he.json +212 -80
- package/front_end/third_party/lighthouse/locales/hi.json +214 -82
- package/front_end/third_party/lighthouse/locales/hr.json +211 -79
- package/front_end/third_party/lighthouse/locales/hu.json +211 -79
- package/front_end/third_party/lighthouse/locales/id.json +211 -79
- package/front_end/third_party/lighthouse/locales/it.json +211 -79
- package/front_end/third_party/lighthouse/locales/ja.json +211 -79
- package/front_end/third_party/lighthouse/locales/ko.json +211 -79
- package/front_end/third_party/lighthouse/locales/lt.json +211 -79
- package/front_end/third_party/lighthouse/locales/lv.json +214 -82
- package/front_end/third_party/lighthouse/locales/nl.json +211 -79
- package/front_end/third_party/lighthouse/locales/no.json +211 -79
- package/front_end/third_party/lighthouse/locales/pl.json +211 -79
- package/front_end/third_party/lighthouse/locales/pt-PT.json +211 -79
- package/front_end/third_party/lighthouse/locales/pt.json +211 -79
- package/front_end/third_party/lighthouse/locales/ro.json +212 -80
- package/front_end/third_party/lighthouse/locales/ru.json +211 -79
- package/front_end/third_party/lighthouse/locales/sk.json +211 -79
- package/front_end/third_party/lighthouse/locales/sl.json +211 -79
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +211 -79
- package/front_end/third_party/lighthouse/locales/sr.json +211 -79
- package/front_end/third_party/lighthouse/locales/sv.json +211 -79
- package/front_end/third_party/lighthouse/locales/ta.json +218 -86
- package/front_end/third_party/lighthouse/locales/te.json +251 -119
- package/front_end/third_party/lighthouse/locales/th.json +211 -79
- package/front_end/third_party/lighthouse/locales/tr.json +211 -79
- package/front_end/third_party/lighthouse/locales/uk.json +212 -80
- package/front_end/third_party/lighthouse/locales/vi.json +211 -79
- package/front_end/third_party/lighthouse/locales/zh-HK.json +211 -79
- package/front_end/third_party/lighthouse/locales/zh-TW.json +211 -79
- package/front_end/third_party/lighthouse/locales/zh.json +211 -79
- package/front_end/third_party/lighthouse/report/bundle.d.ts +72 -34
- package/front_end/third_party/lighthouse/report/bundle.js +698 -492
- package/front_end/third_party/lighthouse/report-assets/report-generator.js +1 -2
- package/front_end/third_party/lighthouse/report-assets/report.js +40 -35
- package/front_end/third_party/lighthouse/report-assets/standalone-template.html +2 -4
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +60 -68
- package/front_end/ui/components/data_grid/dataGrid.css +12 -10
- package/front_end/ui/components/docs/css_overview/start_view.html +25 -0
- package/front_end/ui/components/docs/css_overview/start_view.ts +14 -0
- package/front_end/ui/components/docs/icon_button/basic.ts +3 -3
- package/front_end/ui/components/docs/panel_feedback/basic.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/basic.ts +20 -0
- package/front_end/ui/components/docs/panel_feedback/button.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/button.ts +18 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +0 -13
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +67 -0
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +100 -0
- package/front_end/ui/components/panel_feedback/panelFeedback.css +76 -0
- package/front_end/ui/components/panel_feedback/panel_feedback.ts +6 -0
- package/front_end/ui/components/report_view/reportValue.css +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +79 -36
- package/front_end/ui/components/text_editor/config.ts +42 -26
- package/front_end/ui/components/text_editor/javascript.ts +2 -3
- package/front_end/ui/components/text_editor/position.ts +17 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/components/text_editor/theme.ts +5 -1
- package/front_end/ui/legacy/Dialog.ts +3 -1
- package/front_end/ui/legacy/DropTarget.ts +2 -1
- package/front_end/ui/legacy/EmptyWidget.ts +2 -1
- package/front_end/ui/legacy/FilterBar.ts +2 -1
- package/front_end/ui/legacy/GlassPane.ts +4 -2
- package/front_end/ui/legacy/Infobar.ts +5 -8
- package/front_end/ui/legacy/InspectorView.ts +6 -1
- package/front_end/ui/legacy/ListWidget.ts +2 -1
- package/front_end/ui/legacy/PopoverHelper.ts +2 -1
- package/front_end/ui/legacy/ProgressIndicator.ts +2 -1
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -1
- package/front_end/ui/legacy/ReportView.ts +2 -1
- package/front_end/ui/legacy/RootView.ts +2 -1
- package/front_end/ui/legacy/SearchableView.ts +2 -1
- package/front_end/ui/legacy/ShortcutRegistry.ts +11 -7
- package/front_end/ui/legacy/SoftContextMenu.ts +2 -1
- package/front_end/ui/legacy/SoftDropDown.ts +4 -2
- package/front_end/ui/legacy/SplitWidget.ts +2 -1
- package/front_end/ui/legacy/SuggestBox.ts +2 -1
- package/front_end/ui/legacy/TabbedPane.ts +2 -1
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -1
- package/front_end/ui/legacy/TextPrompt.ts +2 -1
- package/front_end/ui/legacy/Toolbar.ts +3 -2
- package/front_end/ui/legacy/Treeoutline.ts +3 -2
- package/front_end/ui/legacy/UIUtils.ts +16 -13
- package/front_end/ui/legacy/ViewManager.ts +2 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +35 -131
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +2 -2
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +3 -6
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +19 -14
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +502 -252
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -0
- package/front_end/ui/legacy/components/source_frame/module.json +0 -3
- package/front_end/ui/legacy/components/source_frame/source_frame-legacy.ts +0 -11
- package/front_end/ui/legacy/components/source_frame/source_frame.ts +0 -2
- package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +2 -0
- package/front_end/ui/legacy/components/text_editor/cmdevtools.css +3 -1
- package/front_end/ui/legacy/components/text_editor/module.json +0 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -15
- package/front_end/ui/legacy/radioButton.css +1 -13
- package/front_end/ui/legacy/softContextMenu.css +1 -0
- package/front_end/ui/legacy/themeColors.css +36 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +7 -9
- package/front_end/ui/legacy/utils/append-style.ts +9 -4
- package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +2 -2
- package/front_end/ui/legacy/utils/inject-core-styles.ts +7 -4
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +23 -9
- package/scripts/build/ninja/generate_css.gni +10 -1
- package/scripts/eslint_rules/lib/check_css_import.js +2 -2
- package/scripts/eslint_rules/tests/check_css_import_test.js +12 -0
- package/front_end/Images/radioDot-dark-theme.png +0 -0
- package/front_end/Images/radioDot.png +0 -0
- package/front_end/panels/application/module.json +0 -7
- package/front_end/panels/emulation/module.json +0 -11
- package/front_end/panels/issues/module.json +0 -6
- package/front_end/panels/layer_viewer/module.json +0 -6
- package/front_end/panels/media/module.json +0 -6
- package/front_end/panels/network/module.json +0 -6
- package/front_end/panels/security/module.json +0 -5
- package/front_end/third_party/lighthouse/report-assets/report.css +0 -1774
- package/front_end/ui/legacy/components/perf_ui/module.json +0 -13
- package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +0 -1030
- package/front_end/ui/legacy/module.json +0 -41
|
@@ -21,13 +21,11 @@ limitations under the License.
|
|
|
21
21
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
22
22
|
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEhklEQVR4AWJxL/BhIAesev1U5tcflpncgNrKIsqNIwzC9feMpDUzs70kOczMzMzJJcxwCTMzncPMnOwtzBwzMzPb0vRfeZPp0VhPS5I39V5fdiXV1/VD+9QC7OVn9BsyH1XIoEI1PfmJvLFowVV564+34DFUHudbmfDh4kVXh//7XwE+WjS/YfXZe3yr4j2rqj1AIhSB7hZ8ZtPZu/zw8cK523U4wE1/rvPfWrz4zs0m9ZdC9yUJAlASdBAgocRegfF/f3/h/PuaFsxMdwjAR0vm1+06eMMfIrhLqTWqdH4EumU2SPfMhigJAlRQbZrgrRsl9U+Y2DYDFCz3ILC9kiAiqSrMwbWT0nceEnR+9Kggc2zjOJCASDENkg0a5HfZZgDP81CM3CrQs2Z1+o7DJ6ePr8sK0AOCHv5Jjdt3evyYSaZ351VIStIxPRAUtrBYbxC6w+BZ0ivVSBKkIhJhemSyZpfB00EiPO2VjzYkxhcqXQqCWCShGplvi3y0QxqbuBurMjyJeWnkHZuAEgIQGsUBqwrfjZ+IlBgKyRJzVVYF8O6qFWdh86YzQzMrZigYmxAyfvHgLZQ/LC1CbeniW2Hkqr/PH16SgvGuf2/uzNMBwJA/njxizGPtSyAf7EziJCMGRDRdhoAC4PL1A/SrKQMAAQkEfpJAcRQdrBJ7gNwjSpJsdwK+CANBkqa1LgQB4IicV9nYUct7gaxuDJUErQIiEAiMxLVOFlKzIktPpT0ggpdpC/8YAHnxbgkUY4tAAFSR7AAXNyAAWHJrA/kHGjzg5nleuwFO7Nd/IoDw4Pm58+4jNLmYG0wRA5bErc2Mr3Y+dXTDW1VvwqbJkzMCHQ4S1GTCBOIgUHJrGdEwqzR+jAp/o2qAZelUDoQnruEEdDclJI6576AlNVfc+22XN/+Y1vnJD0Yind6UpEEvn/Hqq15EYjCW7jZCJEpnNvDgkyelDjs106kuux2AAXCSobULOWP8mLhYlpoDMK4qAFXJGk+grtH8YXVz5KJblqaG1+VUdTc0I290bmUQAriGITRbdQnom0aoFj8kx1+wMD2ifncAXUQE4SkDqN1hE0jEophs1SUwZAOhUAiMCLwRtamtTZtbbmZErSAUHbSysaoEmnrsakiMiUAURi283gN6wans9oX8rOCrj7/JP35DFD+iQ7Au/K2KE1jzx6ujjUnXFH9KjEq6ZlhsTBICrNLJf47Pv/pkHzvup1w4dmUbEei0+bcXRqJuh5kVARQ8byyYxOwNGr7A87xh1tp8sGT+uMInrwi++Xj7TQz2d27NvwEkrOflAFQGIDA5khASBCGdO2/Z/MnLPwYfv5TFhjW7QhVKAB6afwe2LpFlFsCnlQEosgQgDsdOG1/LKeNqJS4JCSPJ/i+TakwEARor7gER1Iva5JmPOJK0RUqmoPnnlzFCtmIAhAAQEIQRgDaiYPIauNXcnDlRIrWNFY3hm7PG9YRqr7IV7HrCgAC17befjEvRq2nGhAHtBqDpOuI/I1diUUAMYIxEdyejBJqLnNoszGZtfiX/CztGv2mq+sdaAAAAAElFTkSuQmCC">
|
|
23
23
|
<title>Lighthouse Report</title>
|
|
24
|
-
<style
|
|
24
|
+
<style>body {margin: 0}</style>
|
|
25
25
|
</head>
|
|
26
|
-
<body
|
|
26
|
+
<body>
|
|
27
27
|
<noscript>Lighthouse report requires JavaScript. Please enable.</noscript>
|
|
28
28
|
|
|
29
|
-
<main><!-- report populated here --></main>
|
|
30
|
-
|
|
31
29
|
<div id="lh-log"></div>
|
|
32
30
|
|
|
33
31
|
<script>window.__LIGHTHOUSE_JSON__ = %%LIGHTHOUSE_JSON%%;</script>
|
|
@@ -2,56 +2,50 @@
|
|
|
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
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{tag: t.deleted, class: 'token-deleted'},
|
|
40
|
-
{tag: t.heading, class: 'token-heading'},
|
|
41
|
-
{tag: t.link, class: 'token-link'},
|
|
42
|
-
{tag: t.strikethrough, class: 'token-strikethrough'},
|
|
43
|
-
{tag: t.strong, class: 'token-strong'},
|
|
44
|
-
{tag: t.emphasis, class: 'token-emphasis'},
|
|
45
|
-
]);
|
|
46
|
-
}
|
|
47
|
-
return highlightStyle;
|
|
48
|
-
}
|
|
5
|
+
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
|
6
|
+
|
|
7
|
+
const t = CodeMirror.tags;
|
|
8
|
+
|
|
9
|
+
export const highlightStyle: CodeMirror.HighlightStyle = CodeMirror.HighlightStyle.define([
|
|
10
|
+
{tag: t.variableName, class: 'token-variable'},
|
|
11
|
+
{tag: t.propertyName, class: 'token-property'},
|
|
12
|
+
{tag: [t.typeName, t.className, t.namespace, t.macroName], class: 'token-type'},
|
|
13
|
+
{tag: [t.special(t.name), t.constant(t.className)], class: 'token-variable-special'},
|
|
14
|
+
{tag: t.definition(t.name), class: 'token-definition'},
|
|
15
|
+
{tag: t.standard(t.variableName), class: 'token-builtin'},
|
|
16
|
+
|
|
17
|
+
{tag: [t.number, t.literal, t.unit], class: 'token-number'},
|
|
18
|
+
{tag: t.string, class: 'token-string'},
|
|
19
|
+
{tag: [t.special(t.string), t.regexp, t.escape], class: 'token-string-special'},
|
|
20
|
+
{tag: [t.atom, t.labelName, t.bool], class: 'token-atom'},
|
|
21
|
+
|
|
22
|
+
{tag: t.keyword, class: 'token-keyword'},
|
|
23
|
+
{tag: [t.comment, t.quote], class: 'token-comment'},
|
|
24
|
+
{tag: t.meta, class: 'token-meta'},
|
|
25
|
+
{tag: t.invalid, class: 'token-invalid'},
|
|
26
|
+
|
|
27
|
+
{tag: t.tagName, class: 'token-tag'},
|
|
28
|
+
{tag: t.attributeName, class: 'token-attribute'},
|
|
29
|
+
{tag: t.attributeValue, class: 'token-attribute-value'},
|
|
30
|
+
|
|
31
|
+
{tag: t.inserted, class: 'token-inserted'},
|
|
32
|
+
{tag: t.deleted, class: 'token-deleted'},
|
|
33
|
+
{tag: t.heading, class: 'token-heading'},
|
|
34
|
+
{tag: t.link, class: 'token-link'},
|
|
35
|
+
{tag: t.strikethrough, class: 'token-strikethrough'},
|
|
36
|
+
{tag: t.strong, class: 'token-strong'},
|
|
37
|
+
{tag: t.emphasis, class: 'token-emphasis'},
|
|
38
|
+
]);
|
|
49
39
|
|
|
50
40
|
export async function create(code: string, mimeType: string): Promise<CodeHighlighter> {
|
|
51
|
-
const CM = await importCM();
|
|
52
41
|
const language = await languageFromMIME(mimeType);
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
let tree: CodeMirror.Tree;
|
|
43
|
+
if (language) {
|
|
44
|
+
tree = language.language.parser.parse(code);
|
|
45
|
+
} else {
|
|
46
|
+
tree = new CodeMirror.Tree(CodeMirror.NodeType.none, [], [], code.length);
|
|
47
|
+
}
|
|
48
|
+
return new CodeHighlighter(code, tree);
|
|
55
49
|
}
|
|
56
50
|
|
|
57
51
|
export async function highlightNode(node: Element, mimeType: string): Promise<void> {
|
|
@@ -71,57 +65,55 @@ export async function highlightNode(node: Element, mimeType: string): Promise<vo
|
|
|
71
65
|
}
|
|
72
66
|
|
|
73
67
|
export async function languageFromMIME(mimeType: string): Promise<CodeMirror.LanguageSupport|null> {
|
|
74
|
-
const CM = await importCM();
|
|
75
|
-
|
|
76
68
|
switch (mimeType) {
|
|
77
69
|
case 'text/javascript':
|
|
78
|
-
return
|
|
70
|
+
return CodeMirror.javascript.javascript();
|
|
79
71
|
case 'text/jsx':
|
|
80
|
-
return
|
|
72
|
+
return CodeMirror.javascript.javascript({jsx: true});
|
|
81
73
|
case 'text/typescript':
|
|
82
|
-
return
|
|
74
|
+
return CodeMirror.javascript.javascript({typescript: true});
|
|
83
75
|
case 'text/typescript-jsx':
|
|
84
|
-
return
|
|
76
|
+
return CodeMirror.javascript.javascript({typescript: true, jsx: true});
|
|
85
77
|
|
|
86
78
|
case 'text/css':
|
|
87
79
|
case 'text/x-scss':
|
|
88
|
-
return
|
|
80
|
+
return CodeMirror.css.css();
|
|
89
81
|
|
|
90
82
|
case 'text/html':
|
|
91
|
-
return
|
|
83
|
+
return CodeMirror.html.html();
|
|
92
84
|
|
|
93
85
|
case 'application/xml':
|
|
94
|
-
return (await
|
|
86
|
+
return (await CodeMirror.xml()).xml();
|
|
95
87
|
|
|
96
88
|
case 'text/webassembly':
|
|
97
|
-
return (await
|
|
89
|
+
return (await CodeMirror.wast()).wast();
|
|
98
90
|
|
|
99
91
|
case 'text/x-c++src':
|
|
100
|
-
return (await
|
|
92
|
+
return (await CodeMirror.cpp()).cpp();
|
|
101
93
|
|
|
102
94
|
case 'text/x-java':
|
|
103
|
-
return (await
|
|
95
|
+
return (await CodeMirror.java()).java();
|
|
104
96
|
|
|
105
97
|
case 'application/json':
|
|
106
|
-
return (await
|
|
98
|
+
return (await CodeMirror.json()).json();
|
|
107
99
|
|
|
108
100
|
case 'application/x-httpd-php':
|
|
109
|
-
return (await
|
|
101
|
+
return (await CodeMirror.php()).php();
|
|
110
102
|
|
|
111
103
|
case 'text/x-python':
|
|
112
|
-
return (await
|
|
104
|
+
return (await CodeMirror.python()).python();
|
|
113
105
|
|
|
114
106
|
case 'text/markdown':
|
|
115
|
-
return (await
|
|
107
|
+
return (await CodeMirror.markdown()).markdown();
|
|
116
108
|
|
|
117
109
|
case 'text/x-sh':
|
|
118
|
-
return new
|
|
110
|
+
return new CodeMirror.LanguageSupport(await CodeMirror.shell());
|
|
119
111
|
|
|
120
112
|
case 'text/x-coffeescript':
|
|
121
|
-
return new
|
|
113
|
+
return new CodeMirror.LanguageSupport(await CodeMirror.coffeescript());
|
|
122
114
|
|
|
123
115
|
case 'text/x-clojure':
|
|
124
|
-
return new
|
|
116
|
+
return new CodeMirror.LanguageSupport(await CodeMirror.clojure());
|
|
125
117
|
|
|
126
118
|
default:
|
|
127
119
|
return null;
|
|
@@ -129,7 +121,7 @@ export async function languageFromMIME(mimeType: string): Promise<CodeMirror.Lan
|
|
|
129
121
|
}
|
|
130
122
|
|
|
131
123
|
export class CodeHighlighter {
|
|
132
|
-
constructor(readonly code: string, readonly tree: CodeMirror.Tree
|
|
124
|
+
constructor(readonly code: string, readonly tree: CodeMirror.Tree) {
|
|
133
125
|
}
|
|
134
126
|
|
|
135
127
|
highlight(token: (text: string, style: string) => void): void {
|
|
@@ -144,7 +136,7 @@ export class CodeHighlighter {
|
|
|
144
136
|
pos = to;
|
|
145
137
|
}
|
|
146
138
|
};
|
|
147
|
-
|
|
139
|
+
CodeMirror.highlightTree(this.tree, highlightStyle.match, (from, to, style) => {
|
|
148
140
|
flush(from, '');
|
|
149
141
|
flush(to, style);
|
|
150
142
|
}, from, to);
|
|
@@ -120,21 +120,23 @@ th.firstVisibleColumn {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
[aria-sort="descending"]::after {
|
|
123
|
-
content: "
|
|
124
|
-
|
|
125
|
-
border-
|
|
126
|
-
border-
|
|
123
|
+
content: "";
|
|
124
|
+
width: 0;
|
|
125
|
+
border-left: 0.4em solid transparent;
|
|
126
|
+
border-right: 0.4em solid transparent;
|
|
127
|
+
border-top: 0.4em solid var(--color-text-secondary);
|
|
127
128
|
position: absolute;
|
|
128
129
|
right: 0.5em;
|
|
129
|
-
top: 0.
|
|
130
|
+
top: 0.85em;
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
[aria-sort="ascending"]::after {
|
|
133
|
-
content: "
|
|
134
|
-
|
|
135
|
-
border-
|
|
136
|
-
border-
|
|
134
|
+
content: "";
|
|
135
|
+
width: 0;
|
|
136
|
+
border-bottom: 0.4em solid var(--color-text-secondary);
|
|
137
|
+
border-left: 0.4em solid transparent;
|
|
138
|
+
border-right: 0.4em solid transparent;
|
|
137
139
|
position: absolute;
|
|
138
140
|
right: 0.5em;
|
|
139
|
-
top: 0.
|
|
141
|
+
top: 0.7em;
|
|
140
142
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
found in the LICENSE file.
|
|
5
|
+
-->
|
|
6
|
+
<!DOCTYPE html>
|
|
7
|
+
<html>
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="UTF-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width" />
|
|
11
|
+
<title>CSS Overview Start View</title>
|
|
12
|
+
<style>
|
|
13
|
+
#container {
|
|
14
|
+
width: 80%;
|
|
15
|
+
border: 1px solid black;
|
|
16
|
+
padding: 10px;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="container">
|
|
22
|
+
</div>
|
|
23
|
+
<script type="module" src="./start_view.js"></script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as FrontendHelpers from '../../../../../test/unittests/front_end/helpers/EnvironmentHelpers.js';
|
|
6
|
+
import * as CSSOverviewComponents from '../../../../panels/css_overview/components/components.js';
|
|
7
|
+
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
|
+
|
|
9
|
+
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
+
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
+
|
|
12
|
+
const component = new CSSOverviewComponents.CSSOverviewStartView.CSSOverviewStartView();
|
|
13
|
+
|
|
14
|
+
document.getElementById('container')?.appendChild(component);
|
|
@@ -12,18 +12,18 @@ function appendComponent(data: IconButton.IconButton.IconButtonData) {
|
|
|
12
12
|
|
|
13
13
|
appendComponent({
|
|
14
14
|
clickHandler: (): void => {},
|
|
15
|
-
groups: [{iconName: '
|
|
15
|
+
groups: [{iconName: 'survey_feedback_icon', iconColor: 'black', text: '1 item'}],
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
appendComponent({
|
|
19
19
|
clickHandler: (): void => {},
|
|
20
|
-
groups: [{iconName: '
|
|
20
|
+
groups: [{iconName: 'survey_feedback_icon', iconColor: 'black', text: '1 item'}],
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
appendComponent({
|
|
24
24
|
clickHandler: (): void => {},
|
|
25
25
|
groups: [
|
|
26
|
-
{iconName: '
|
|
26
|
+
{iconName: 'survey_feedback_icon', iconColor: 'blue', text: 'Test'},
|
|
27
27
|
{iconName: 'warning_icon', iconColor: '', text: '1'},
|
|
28
28
|
],
|
|
29
29
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
found in the LICENSE file.
|
|
5
|
+
-->
|
|
6
|
+
<!DOCTYPE html>
|
|
7
|
+
<html>
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="UTF-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width" />
|
|
11
|
+
<title>Panel Feedback</title>
|
|
12
|
+
<style>
|
|
13
|
+
#container {
|
|
14
|
+
width: 80%;
|
|
15
|
+
border: 1px solid black;
|
|
16
|
+
padding: 10px;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="container">
|
|
22
|
+
</div>
|
|
23
|
+
<script type="module" src="./basic.js"></script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as FrontendHelpers from '../../../../../test/unittests/front_end/helpers/EnvironmentHelpers.js';
|
|
6
|
+
import * as PanelFeedback from '../../../components/panel_feedback/panel_feedback.js';
|
|
7
|
+
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
|
+
|
|
9
|
+
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
+
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
+
|
|
12
|
+
const component = new PanelFeedback.PanelFeedback.PanelFeedback();
|
|
13
|
+
|
|
14
|
+
component.data = {
|
|
15
|
+
feedbackUrl: 'https://www.example.com',
|
|
16
|
+
quickStartUrl: 'https://www.example.com',
|
|
17
|
+
quickStartLinkText: 'Quick start: get started with the Recorder',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
document.getElementById('container')?.appendChild(component);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright 2021 The Chromium Authors. All rights reserved.
|
|
3
|
+
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
found in the LICENSE file.
|
|
5
|
+
-->
|
|
6
|
+
<!DOCTYPE html>
|
|
7
|
+
<html>
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="UTF-8" />
|
|
10
|
+
<meta name="viewport" content="width=device-width" />
|
|
11
|
+
<title>Feedback button</title>
|
|
12
|
+
<style>
|
|
13
|
+
#container {
|
|
14
|
+
width: 80%;
|
|
15
|
+
border: 1px solid black;
|
|
16
|
+
padding: 10px;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="container">
|
|
22
|
+
</div>
|
|
23
|
+
<script type="module" src="./button.js"></script>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as FrontendHelpers from '../../../../../test/unittests/front_end/helpers/EnvironmentHelpers.js';
|
|
6
|
+
import * as PanelFeedback from '../../../components/panel_feedback/panel_feedback.js';
|
|
7
|
+
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
8
|
+
|
|
9
|
+
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
+
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
+
|
|
12
|
+
const component = new PanelFeedback.FeedbackButton.FeedbackButton();
|
|
13
|
+
|
|
14
|
+
component.data = {
|
|
15
|
+
feedbackUrl: 'https://www.example.com',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
document.getElementById('container')?.appendChild(component);
|
|
@@ -41,19 +41,6 @@ export function legacyGetStyleSheets(path: string): CSSStyleSheet[] {
|
|
|
41
41
|
* them through to the right place, respecting Karma's ROOT_DIRECTORY setting.
|
|
42
42
|
*/
|
|
43
43
|
export const CSS_RESOURCES_TO_LOAD_INTO_RUNTIME = [
|
|
44
|
-
'ui/legacy/inspectorCommon.css',
|
|
45
|
-
'ui/legacy/textButton.css',
|
|
46
|
-
'ui/legacy/themeColors.css',
|
|
47
|
-
'ui/legacy/inspectorSyntaxHighlight.css',
|
|
48
|
-
'ui/legacy/progressIndicator.css',
|
|
49
44
|
'panels/application/serviceWorkerUpdateCycleView.css',
|
|
50
|
-
'ui/legacy/tabbedPane.css',
|
|
51
|
-
'ui/legacy/glassPane.css',
|
|
52
|
-
'ui/legacy/suggestBox.css',
|
|
53
|
-
'ui/legacy/treeoutline.css',
|
|
54
|
-
'ui/legacy/softContextMenu.css',
|
|
55
|
-
'ui/legacy/splitWidget.css',
|
|
56
45
|
'ui/legacy/components/source_frame/jsonView.css',
|
|
57
|
-
'ui/legacy/searchableView.css',
|
|
58
|
-
'ui/legacy/toolbar.css',
|
|
59
46
|
];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Host from '../../../core/host/host.js';
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import * as ComponentHelpers from '../../components/helpers/helpers.js';
|
|
8
|
+
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
9
|
+
import * as Buttons from '../buttons/buttons.js';
|
|
10
|
+
|
|
11
|
+
const UIStrings = {
|
|
12
|
+
/**
|
|
13
|
+
* @description The title of the button that leads to the feedback form.
|
|
14
|
+
*/
|
|
15
|
+
feedback: 'Feedback',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/panel_feedback/FeedbackButton.ts', UIStrings);
|
|
19
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
20
|
+
|
|
21
|
+
const feedbackIconUrl = new URL('../../../Images/feedback_button_icon.svg', import.meta.url).toString();
|
|
22
|
+
|
|
23
|
+
export interface FeedbackButtonData {
|
|
24
|
+
feedbackUrl: string;
|
|
25
|
+
}
|
|
26
|
+
export class FeedbackButton extends HTMLElement {
|
|
27
|
+
static readonly litTagName = LitHtml.literal`devtools-feedback-button`;
|
|
28
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
29
|
+
readonly #boundRender = this.render.bind(this);
|
|
30
|
+
|
|
31
|
+
#props: FeedbackButtonData = {
|
|
32
|
+
feedbackUrl: '',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
set data(data: FeedbackButtonData) {
|
|
36
|
+
this.#props = data;
|
|
37
|
+
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#onFeedbackClick(): void {
|
|
41
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(this.#props.feedbackUrl);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private render(): void {
|
|
45
|
+
if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {
|
|
46
|
+
throw new Error('FeedbackButton render was not scheduled');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// clang-format off
|
|
50
|
+
LitHtml.render(LitHtml.html`
|
|
51
|
+
<${Buttons.Button.Button.litTagName}
|
|
52
|
+
@click=${this.#onFeedbackClick}
|
|
53
|
+
.iconUrl=${feedbackIconUrl}
|
|
54
|
+
.variant=${Buttons.Button.Variant.SECONDARY}
|
|
55
|
+
>${i18nString(UIStrings.feedback)}</${Buttons.Button.Button.litTagName}>
|
|
56
|
+
`, this.#shadow, {host: this});
|
|
57
|
+
// clang-format on
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-feedback-button', FeedbackButton);
|
|
62
|
+
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'devtools-feedback-button': FeedbackButton;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
+
import * as ComponentHelpers from '../../components/helpers/helpers.js';
|
|
7
|
+
import * as LitHtml from '../../lit-html/lit-html.js';
|
|
8
|
+
import * as IconButton from '../icon_button/icon_button.js';
|
|
9
|
+
|
|
10
|
+
import panelFeedbackStyles from './panelFeedback.css.js';
|
|
11
|
+
|
|
12
|
+
const UIStrings = {
|
|
13
|
+
/**
|
|
14
|
+
*@description Introduction sentence to convey the feature is being actively worked on and we are looking for feedback.
|
|
15
|
+
*/
|
|
16
|
+
previewText: 'Our team is actively working on this feature and we would love to know what you think.',
|
|
17
|
+
/**
|
|
18
|
+
*@description Link text the user can click to provide feedback to the team.
|
|
19
|
+
*/
|
|
20
|
+
previewTextFeedbackLink: 'Send us your feedback.',
|
|
21
|
+
/**
|
|
22
|
+
*@description Title of the UI section that shows the user that this feature is in preview. Used as the main heading. Not a verb.
|
|
23
|
+
*/
|
|
24
|
+
previewFeature: 'Preview feature',
|
|
25
|
+
/**
|
|
26
|
+
*@description Title of the section to the quick start video and documentation on experimental panels.
|
|
27
|
+
*/
|
|
28
|
+
videoAndDocumentation: 'Video and documentation',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/panel_feedback/PanelFeedback.ts', UIStrings);
|
|
32
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
33
|
+
|
|
34
|
+
const previewFeatureUrl = new URL('../../../Images/ic_preview_feature.svg', import.meta.url).toString();
|
|
35
|
+
const videoThumbnailUrl = new URL('../../../Images/preview_feature_video_thumbnail.svg', import.meta.url).toString();
|
|
36
|
+
|
|
37
|
+
export interface PanelFeedbackData {
|
|
38
|
+
feedbackUrl: string;
|
|
39
|
+
quickStartUrl: string;
|
|
40
|
+
quickStartLinkText: string;
|
|
41
|
+
}
|
|
42
|
+
export class PanelFeedback extends HTMLElement {
|
|
43
|
+
static readonly litTagName = LitHtml.literal`devtools-panel-feedback`;
|
|
44
|
+
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
45
|
+
readonly #boundRender = this.render.bind(this);
|
|
46
|
+
|
|
47
|
+
#props: PanelFeedbackData = {
|
|
48
|
+
feedbackUrl: '',
|
|
49
|
+
quickStartUrl: '',
|
|
50
|
+
quickStartLinkText: '',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
connectedCallback(): void {
|
|
54
|
+
this.#shadow.adoptedStyleSheets = [panelFeedbackStyles];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
set data(data: PanelFeedbackData) {
|
|
58
|
+
this.#props = data;
|
|
59
|
+
ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private render(): void {
|
|
63
|
+
if (!ComponentHelpers.ScheduledRender.isScheduledRender(this)) {
|
|
64
|
+
throw new Error('PanelFeedback render was not scheduled');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// clang-format off
|
|
68
|
+
LitHtml.render(LitHtml.html`
|
|
69
|
+
<div class="preview">
|
|
70
|
+
<h2 class="flex">
|
|
71
|
+
<${IconButton.Icon.Icon.litTagName} .data=${{
|
|
72
|
+
iconPath: previewFeatureUrl,
|
|
73
|
+
width: '24px',
|
|
74
|
+
height: '24px',
|
|
75
|
+
color: 'var(--color-primary)',
|
|
76
|
+
} as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}> ${i18nString(UIStrings.previewFeature)}
|
|
77
|
+
</h2>
|
|
78
|
+
<p>${i18nString(UIStrings.previewText)} <x-link href=${this.#props.feedbackUrl}>${i18nString(UIStrings.previewTextFeedbackLink)}</x-link></p>
|
|
79
|
+
<div class="video">
|
|
80
|
+
<div class="thumbnail">
|
|
81
|
+
<img src=${videoThumbnailUrl} role="presentation" />
|
|
82
|
+
</div>
|
|
83
|
+
<div class="video-description">
|
|
84
|
+
<h3>${i18nString(UIStrings.videoAndDocumentation)}</h3>
|
|
85
|
+
<x-link class="quick-start-link" href=${this.#props.quickStartUrl}>${this.#props.quickStartLinkText}</x-link>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
`, this.#shadow, {host: this});
|
|
90
|
+
// clang-format on
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ComponentHelpers.CustomElements.defineComponent('devtools-panel-feedback', PanelFeedback);
|
|
95
|
+
|
|
96
|
+
declare global {
|
|
97
|
+
interface HTMLElementTagNameMap {
|
|
98
|
+
'devtools-panel-feedback': PanelFeedback;
|
|
99
|
+
}
|
|
100
|
+
}
|