chrome-devtools-frontend 1.0.941208 → 1.0.943182
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/WATCHLISTS +1 -1
- package/config/gni/all_devtools_files.gni +0 -64
- package/config/gni/devtools_grd_files.gni +54 -19
- package/config/gni/devtools_image_files.gni +1 -3
- package/front_end/.eslintrc.js +11 -1
- package/front_end/Images/src/{feedback_thin_16x16_icon.svg → survey_feedback_icon.svg} +1 -1
- package/front_end/Tests.js +1 -32
- package/front_end/core/common/Color.ts +5 -0
- package/front_end/core/i18n/locales/en-US.json +17 -29
- package/front_end/core/i18n/locales/en-XL.json +17 -29
- package/front_end/core/sdk/CPUProfilerModel.ts +7 -9
- package/front_end/core/sdk/ConsoleModel.ts +27 -33
- package/front_end/core/sdk/DebuggerModel.ts +4 -14
- package/front_end/core/sdk/sdk-meta.ts +17 -3
- package/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.ts +1 -1
- package/front_end/entrypoints/devtools_app/devtools_app.js +1 -1
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -12
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/inspector/inspector.js +1 -1
- package/front_end/entrypoints/inspector/inspector.json +1 -3
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +2 -3
- package/front_end/entrypoints/js_app/js_app.js +1 -1
- package/front_end/entrypoints/js_app/js_app.json +1 -3
- package/front_end/entrypoints/main/MainImpl.ts +26 -0
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/entrypoints/ndb_app/ndb_app.js +1 -1
- package/front_end/entrypoints/node_app/node_app-meta.ts +0 -2
- package/front_end/entrypoints/node_app/node_app.js +1 -1
- package/front_end/entrypoints/node_app/node_app.json +1 -3
- package/front_end/entrypoints/node_main/node_main-meta.ts +0 -1
- package/front_end/entrypoints/shell/shell.js +0 -11
- package/front_end/entrypoints/shell/shell.json +1 -5
- package/front_end/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.ts +1 -1
- package/front_end/entrypoints/worker_app/worker_app.js +1 -1
- package/front_end/entrypoints/worker_app/worker_app.json +1 -7
- package/front_end/generated/InspectorBackendCommands.js +19 -0
- package/front_end/generated/protocol-mapping.d.ts +31 -1
- package/front_end/generated/protocol-proxy-api.d.ts +34 -2
- package/front_end/generated/protocol.d.ts +81 -6
- 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 +5 -1
- package/front_end/legacy_test_runner/legacy_test_runner.ts +10 -1
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +3 -1
- package/front_end/models/formatter/SourceFormatter.ts +0 -10
- package/front_end/models/persistence/persistence-meta.ts +0 -1
- package/front_end/models/workspace/UISourceCode.ts +9 -42
- package/front_end/panels/accessibility/accessibility-meta.ts +0 -1
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animation-meta.ts +0 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +3 -3
- package/front_end/panels/application/BackForwardCacheStrings.ts +3 -1
- package/front_end/panels/application/application-meta.ts +0 -4
- package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
- package/front_end/panels/application/components/ReportsGrid.ts +1 -1
- package/front_end/panels/application/components/stackTraceRow.css +8 -0
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +1 -2
- package/front_end/panels/changes/changes-meta.ts +0 -1
- package/front_end/panels/console/ConsolePinPane.ts +23 -32
- package/front_end/panels/console/ConsoleViewMessage.ts +8 -1
- package/front_end/panels/console/console-meta.ts +0 -1
- package/front_end/panels/console_counters/console_counters-meta.ts +0 -1
- package/front_end/panels/coverage/CoverageDecorationManager.ts +4 -5
- package/front_end/panels/coverage/CoverageView.ts +2 -105
- package/front_end/panels/coverage/coverage-meta.ts +0 -1
- 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/css_overview/css_overview-meta.ts +0 -1
- package/front_end/panels/developer_resources/developer_resources-meta.ts +0 -1
- 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/elements/elements-meta.ts +0 -1
- 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 -5
- package/front_end/panels/help/help-meta.ts +0 -1
- package/front_end/panels/input/input-meta.ts +0 -1
- package/front_end/panels/issues/issues-meta.ts +0 -3
- package/front_end/panels/js_profiler/js_profiler-meta.ts +0 -4
- package/front_end/panels/layers/layers-meta.ts +0 -4
- package/front_end/panels/lighthouse/LighthousePanel.ts +2 -4
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -4
- package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -1
- package/front_end/panels/lighthouse/lighthouseStartView.css +4 -0
- package/front_end/panels/lighthouse/module.json +0 -6
- package/front_end/panels/media/media-meta.ts +0 -4
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +0 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -1
- package/front_end/panels/network/network-meta.ts +1 -5
- package/front_end/panels/performance_monitor/performance_monitor-meta.ts +0 -1
- package/front_end/panels/profiler/CPUProfileView.ts +10 -3
- package/front_end/panels/profiler/profiler-meta.ts +0 -3
- package/front_end/panels/protocol_monitor/protocol_monitor-meta.ts +0 -1
- package/front_end/panels/screencast/screencast-meta.ts +0 -4
- package/front_end/panels/security/security-meta.ts +0 -4
- package/front_end/panels/sensors/sensors-meta.ts +0 -1
- package/front_end/panels/settings/emulation/emulation-meta.ts +0 -1
- package/front_end/panels/settings/settings-meta.ts +0 -1
- 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 +6 -5
- 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-meta.ts +2 -6
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/timeline-meta.ts +2 -9
- package/front_end/panels/web_audio/web_audio-meta.ts +0 -1
- package/front_end/panels/webauthn/webauthn-meta.ts +0 -1
- 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/component_docs.ts +14 -0
- package/front_end/ui/components/docs/create_breadcrumbs.ts +1 -1
- 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/toggle_dark_mode.ts +1 -0
- package/front_end/ui/components/docs/toggle_fonts.ts +2 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +0 -15
- package/front_end/ui/components/linear_memory_inspector/linear_memory_inspector-meta.ts +1 -2
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
- 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/components/tree_outline/TreeOutline.ts +63 -8
- package/front_end/ui/components/tree_outline/TreeOutlineUtils.ts +8 -6
- 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 +3 -2
- 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 +4 -3
- package/front_end/ui/legacy/UIUtils.ts +17 -14
- package/front_end/ui/legacy/ViewManager.ts +2 -1
- package/front_end/ui/legacy/components/inline_editor/CSSAngle.ts +1 -2
- package/front_end/ui/legacy/components/inline_editor/cssAngle.css +4 -0
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +35 -131
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -3
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +2 -2
- package/front_end/ui/legacy/components/quick_open/quick_open-meta.ts +2 -3
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +3 -6
- package/front_end/ui/legacy/components/source_frame/FontView.ts +4 -1
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +4 -1
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +4 -1
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +21 -15
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +501 -252
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +7 -2
- 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/textButton.css +5 -4
- 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/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/check_gn.js +0 -35
- package/scripts/eslint_rules/lib/es_modules_import.js +15 -8
- package/scripts/eslint_rules/tests/es_modules_import_test.js +8 -0
- package/front_end/Images/radioDot-dark-theme.png +0 -0
- package/front_end/Images/radioDot.png +0 -0
- package/front_end/emulated_devices/module.json +0 -6
- package/front_end/panels/application/module.json +0 -6
- package/front_end/panels/emulation/module.json +0 -11
- package/front_end/panels/issues/module.json +0 -6
- package/front_end/panels/js_profiler/module.json +0 -5
- package/front_end/panels/layer_viewer/module.json +0 -5
- package/front_end/panels/layers/module.json +0 -5
- package/front_end/panels/media/module.json +0 -5
- package/front_end/panels/network/module.json +0 -5
- package/front_end/panels/profiler/module.json +0 -5
- package/front_end/panels/screencast/module.json +0 -6
- package/front_end/panels/security/module.json +0 -5
- package/front_end/panels/timeline/module.json +0 -7
- package/front_end/third_party/lighthouse/report-assets/report.css +0 -1774
- package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +0 -1030
- package/front_end/ui/legacy/components/source_frame/messagesPopover.css +0 -32
- package/front_end/ui/legacy/components/source_frame/module.json +0 -14
- package/front_end/ui/legacy/module.json +0 -41
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
9
|
+
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
8
10
|
import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
9
11
|
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
12
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
11
|
-
import type * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
12
|
-
import type * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
13
13
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
14
14
|
|
|
15
15
|
import consolePinPaneStyles from './consolePinPane.css.js';
|
|
@@ -164,23 +164,18 @@ export class ConsolePinPane extends UI.ThrottledWidget.ThrottledWidget {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
let consolePinNumber = 0;
|
|
168
|
-
|
|
169
167
|
export class ConsolePin {
|
|
170
168
|
private readonly pinElement: Element;
|
|
171
169
|
private readonly pinPreview: HTMLElement;
|
|
172
170
|
private lastResult: SDK.RuntimeModel.EvaluationResult|null;
|
|
173
171
|
private lastExecutionContext: SDK.RuntimeModel.ExecutionContext|null;
|
|
174
|
-
private editor: TextEditor.TextEditor.TextEditor
|
|
172
|
+
private editor: TextEditor.TextEditor.TextEditor;
|
|
175
173
|
private committedExpression: string;
|
|
176
174
|
private hovered: boolean;
|
|
177
175
|
private lastNode: SDK.RemoteObject.RemoteObject|null;
|
|
178
|
-
private readonly editorPromise: Promise<TextEditor.TextEditor.TextEditor>;
|
|
179
|
-
private consolePinNumber: number;
|
|
180
176
|
private deletePinIcon: UI.UIUtils.DevToolsCloseButton;
|
|
181
177
|
|
|
182
178
|
constructor(expression: string, private readonly pinPane: ConsolePinPane, private readonly focusOut: () => void) {
|
|
183
|
-
this.consolePinNumber = ++consolePinNumber;
|
|
184
179
|
this.deletePinIcon = document.createElement('div', {is: 'dt-close-button'}) as UI.UIUtils.DevToolsCloseButton;
|
|
185
180
|
this.deletePinIcon.gray = true;
|
|
186
181
|
this.deletePinIcon.classList.add('close-button');
|
|
@@ -209,10 +204,10 @@ export class ConsolePin {
|
|
|
209
204
|
|
|
210
205
|
this.lastResult = null;
|
|
211
206
|
this.lastExecutionContext = null;
|
|
212
|
-
this.editor = null;
|
|
213
207
|
this.committedExpression = expression;
|
|
214
208
|
this.hovered = false;
|
|
215
209
|
this.lastNode = null;
|
|
210
|
+
this.editor = this.createEditor(expression, nameElement);
|
|
216
211
|
|
|
217
212
|
this.pinPreview.addEventListener('mouseenter', this.setHovered.bind(this, true), false);
|
|
218
213
|
this.pinPreview.addEventListener('mouseleave', this.setHovered.bind(this, false), false);
|
|
@@ -229,22 +224,19 @@ export class ConsolePin {
|
|
|
229
224
|
event.consume();
|
|
230
225
|
}
|
|
231
226
|
});
|
|
232
|
-
this.editorPromise = this.createEditor(expression, nameElement);
|
|
233
227
|
}
|
|
234
228
|
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
const TE = await import('../../ui/components/text_editor/text_editor.js');
|
|
238
|
-
this.editor = new TE.TextEditor.TextEditor(CM.EditorState.create({
|
|
229
|
+
createEditor(expression: string, parent: HTMLElement): TextEditor.TextEditor.TextEditor {
|
|
230
|
+
const editor = new TextEditor.TextEditor.TextEditor(CodeMirror.EditorState.create({
|
|
239
231
|
doc: expression,
|
|
240
232
|
extensions: [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
233
|
+
CodeMirror.EditorView.contentAttributes.of({'aria-label': i18nString(UIStrings.liveExpressionEditor)}),
|
|
234
|
+
CodeMirror.EditorView.lineWrapping,
|
|
235
|
+
CodeMirror.javascript.javascriptLanguage,
|
|
236
|
+
TextEditor.JavaScript.completion(),
|
|
237
|
+
TextEditor.Config.showCompletionHint,
|
|
238
|
+
CodeMirror.placeholder(i18nString(UIStrings.expression)),
|
|
239
|
+
CodeMirror.keymap.of([
|
|
248
240
|
{
|
|
249
241
|
key: 'Escape',
|
|
250
242
|
run: (view: CodeMirror.EditorView): boolean => {
|
|
@@ -261,13 +253,13 @@ export class ConsolePin {
|
|
|
261
253
|
},
|
|
262
254
|
},
|
|
263
255
|
]),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
256
|
+
CodeMirror.EditorView.domEventHandlers({blur: (_e, view) => this.onBlur(view)}),
|
|
257
|
+
TextEditor.Config.baseConfiguration(expression),
|
|
258
|
+
TextEditor.Config.autocompletion,
|
|
267
259
|
],
|
|
268
260
|
}));
|
|
269
|
-
parent.appendChild(
|
|
270
|
-
return
|
|
261
|
+
parent.appendChild(editor);
|
|
262
|
+
return editor;
|
|
271
263
|
}
|
|
272
264
|
|
|
273
265
|
onBlur(editor: CodeMirror.EditorView): void {
|
|
@@ -305,9 +297,9 @@ export class ConsolePin {
|
|
|
305
297
|
}
|
|
306
298
|
|
|
307
299
|
async focus(): Promise<void> {
|
|
308
|
-
const editor = this.editor
|
|
300
|
+
const editor = this.editor;
|
|
309
301
|
editor.editor.focus();
|
|
310
|
-
editor.
|
|
302
|
+
editor.dispatch({selection: {anchor: editor.state.doc.length}});
|
|
311
303
|
}
|
|
312
304
|
|
|
313
305
|
appendToContextMenu(contextMenu: UI.ContextMenu.ContextMenu): void {
|
|
@@ -322,16 +314,15 @@ export class ConsolePin {
|
|
|
322
314
|
if (!this.editor) {
|
|
323
315
|
return;
|
|
324
316
|
}
|
|
325
|
-
const
|
|
326
|
-
const text = TE.Config.contentIncludingHint(this.editor.editor);
|
|
317
|
+
const text = TextEditor.Config.contentIncludingHint(this.editor.editor);
|
|
327
318
|
const isEditing = this.pinElement.hasFocus();
|
|
328
319
|
const throwOnSideEffect = isEditing && text !== this.committedExpression;
|
|
329
320
|
const timeout = throwOnSideEffect ? 250 : undefined;
|
|
330
321
|
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
|
331
322
|
const preprocessedExpression = ObjectUI.JavaScriptREPL.JavaScriptREPL.preprocessExpression(text);
|
|
332
323
|
const {preview, result} = await ObjectUI.JavaScriptREPL.JavaScriptREPL.evaluateAndBuildPreview(
|
|
333
|
-
|
|
334
|
-
|
|
324
|
+
preprocessedExpression, throwOnSideEffect, false /* replMode */, timeout, !isEditing /* allowErrors */,
|
|
325
|
+
'console', true /* awaitPromise */);
|
|
335
326
|
if (this.lastResult && this.lastExecutionContext) {
|
|
336
327
|
this.lastExecutionContext.runtimeModel.releaseEvaluationResult(this.lastResult);
|
|
337
328
|
}
|
|
@@ -50,9 +50,12 @@ import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
|
50
50
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
51
51
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
52
52
|
import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';
|
|
53
|
+
// eslint-disable-next-line rulesdir/es_modules_import
|
|
54
|
+
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
53
55
|
import type {Chrome} from '../../../extension-api/ExtensionAPI.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
54
56
|
|
|
55
57
|
import type {ConsoleViewportElement} from './ConsoleViewport.js';
|
|
58
|
+
import consoleViewStyles from './consoleView.css.js';
|
|
56
59
|
|
|
57
60
|
const UIStrings = {
|
|
58
61
|
/**
|
|
@@ -2067,7 +2070,11 @@ export class ConsoleTableMessageView extends ConsoleViewMessage {
|
|
|
2067
2070
|
const tableElement = formattedResult.createChild('div', 'console-message-formatted-table');
|
|
2068
2071
|
const dataGridContainer = tableElement.createChild('span');
|
|
2069
2072
|
tableElement.appendChild(this.formatParameter(actualTable, true, false));
|
|
2070
|
-
dataGridContainer.
|
|
2073
|
+
const shadowRoot = dataGridContainer.attachShadow({mode: 'open'});
|
|
2074
|
+
const dataGridWidget = this.dataGrid.asWidget();
|
|
2075
|
+
dataGridWidget.markAsRoot();
|
|
2076
|
+
dataGridWidget.show(shadowRoot as unknown as Element);
|
|
2077
|
+
dataGridWidget.registerCSSFiles([consoleViewStyles, objectValueStyles]);
|
|
2071
2078
|
formattedMessage.appendChild(formattedResult);
|
|
2072
2079
|
this.dataGrid.renderInline();
|
|
2073
2080
|
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
9
8
|
import type * as Console from './console.js';
|
|
10
9
|
|
|
11
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -24,7 +24,7 @@ export class CoverageDecorationManager {
|
|
|
24
24
|
this.uiSourceCodeByContentProvider = new Platform.MapUtilities.Multimap();
|
|
25
25
|
|
|
26
26
|
for (const uiSourceCode of Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodes()) {
|
|
27
|
-
uiSourceCode.
|
|
27
|
+
uiSourceCode.setDecorationData(decoratorType, this);
|
|
28
28
|
}
|
|
29
29
|
Workspace.Workspace.WorkspaceImpl.instance().addEventListener(
|
|
30
30
|
Workspace.Workspace.Events.UISourceCodeAdded, this.onUISourceCodeAdded, this);
|
|
@@ -32,7 +32,7 @@ export class CoverageDecorationManager {
|
|
|
32
32
|
|
|
33
33
|
reset(): void {
|
|
34
34
|
for (const uiSourceCode of Workspace.Workspace.WorkspaceImpl.instance().uiSourceCodes()) {
|
|
35
|
-
uiSourceCode.
|
|
35
|
+
uiSourceCode.setDecorationData(decoratorType, undefined);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -45,8 +45,7 @@ export class CoverageDecorationManager {
|
|
|
45
45
|
update(updatedEntries: CoverageInfo[]): void {
|
|
46
46
|
for (const entry of updatedEntries) {
|
|
47
47
|
for (const uiSourceCode of this.uiSourceCodeByContentProvider.get(entry.getContentProvider())) {
|
|
48
|
-
uiSourceCode.
|
|
49
|
-
uiSourceCode.addLineDecoration(0, decoratorType, this);
|
|
48
|
+
uiSourceCode.setDecorationData(decoratorType, this);
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
}
|
|
@@ -185,7 +184,7 @@ export class CoverageDecorationManager {
|
|
|
185
184
|
|
|
186
185
|
private onUISourceCodeAdded(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
187
186
|
const uiSourceCode = event.data;
|
|
188
|
-
uiSourceCode.
|
|
187
|
+
uiSourceCode.setDecorationData(decoratorType, this);
|
|
189
188
|
}
|
|
190
189
|
}
|
|
191
190
|
export interface RawLocation {
|
|
@@ -8,15 +8,12 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Platform from '../../core/platform/platform.js';
|
|
9
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
10
10
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
11
|
-
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
12
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
12
|
|
|
13
|
+
import {CoverageDecorationManager} from './CoverageDecorationManager.js';
|
|
14
|
+
import {CoverageListView} from './CoverageListView.js';
|
|
14
15
|
import coverageViewStyles from './coverageView.css.js';
|
|
15
16
|
|
|
16
|
-
import type * as Workspace from '../../models/workspace/workspace.js';
|
|
17
|
-
|
|
18
|
-
import {CoverageDecorationManager, decoratorType} from './CoverageDecorationManager.js';
|
|
19
|
-
import {CoverageListView} from './CoverageListView.js';
|
|
20
17
|
import type {CoverageInfo, URLCoverageInfo} from './CoverageModel.js';
|
|
21
18
|
import {CoverageModel, Events, CoverageType} from './CoverageModel.js';
|
|
22
19
|
|
|
@@ -564,103 +561,3 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
564
561
|
}
|
|
565
562
|
}
|
|
566
563
|
}
|
|
567
|
-
let lineDecoratorInstance: LineDecorator;
|
|
568
|
-
export class LineDecorator implements SourceFrame.SourceFrame.LineDecorator {
|
|
569
|
-
static instance({forceNew}: {forceNew: boolean} = {forceNew: false}): LineDecorator {
|
|
570
|
-
if (!lineDecoratorInstance || forceNew) {
|
|
571
|
-
lineDecoratorInstance = new LineDecorator();
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
return lineDecoratorInstance;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
private readonly listeners: WeakMap<
|
|
578
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
579
|
-
SourceFrame.SourcesTextEditor.SourcesTextEditor, (arg0: Common.EventTarget.EventTargetEvent<any>) => void>;
|
|
580
|
-
constructor() {
|
|
581
|
-
this.listeners = new WeakMap();
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
decorate(
|
|
585
|
-
uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
586
|
-
textEditor: SourceFrame.SourcesTextEditor.SourcesTextEditor): void {
|
|
587
|
-
const decorations = uiSourceCode.decorationsForType(decoratorType);
|
|
588
|
-
if (!decorations || !decorations.size) {
|
|
589
|
-
this.uninstallGutter(textEditor);
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
const decorationManager = decorations.values().next().value.data() as CoverageDecorationManager;
|
|
593
|
-
decorationManager.usageByLine(uiSourceCode).then(lineUsage => {
|
|
594
|
-
textEditor.operation(() => this.innerDecorate(uiSourceCode, textEditor, lineUsage));
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
private innerDecorate(
|
|
599
|
-
uiSourceCode: Workspace.UISourceCode.UISourceCode, textEditor: SourceFrame.SourcesTextEditor.SourcesTextEditor,
|
|
600
|
-
lineUsage: (boolean|undefined)[]): void {
|
|
601
|
-
const gutterType = LineDecorator.GUTTER_TYPE;
|
|
602
|
-
this.uninstallGutter(textEditor);
|
|
603
|
-
if (lineUsage.length) {
|
|
604
|
-
this.installGutter(textEditor, uiSourceCode.url());
|
|
605
|
-
}
|
|
606
|
-
for (let line = 0; line < lineUsage.length; ++line) {
|
|
607
|
-
// Do not decorate the line if we don't have data.
|
|
608
|
-
if (typeof lineUsage[line] !== 'boolean') {
|
|
609
|
-
continue;
|
|
610
|
-
}
|
|
611
|
-
const className = lineUsage[line] ? 'text-editor-coverage-used-marker' : 'text-editor-coverage-unused-marker';
|
|
612
|
-
const gutterElement = document.createElement('div');
|
|
613
|
-
gutterElement.classList.add(className);
|
|
614
|
-
textEditor.setGutterDecoration(line, gutterType, gutterElement);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
makeGutterClickHandler(url: string):
|
|
619
|
-
(arg0: Common.EventTarget.EventTargetEvent<SourceFrame.SourcesTextEditor.GutterClickEventData>) => void {
|
|
620
|
-
function handleGutterClick(
|
|
621
|
-
event: Common.EventTarget.EventTargetEvent<SourceFrame.SourcesTextEditor.GutterClickEventData>): void {
|
|
622
|
-
if (event.data.gutterType !== LineDecorator.GUTTER_TYPE) {
|
|
623
|
-
return;
|
|
624
|
-
}
|
|
625
|
-
const coverageViewId = 'coverage';
|
|
626
|
-
UI.ViewManager.ViewManager.instance()
|
|
627
|
-
.showView(coverageViewId)
|
|
628
|
-
.then(() => {
|
|
629
|
-
const view = UI.ViewManager.ViewManager.instance().view(coverageViewId);
|
|
630
|
-
return view && view.widget();
|
|
631
|
-
})
|
|
632
|
-
.then(widget => {
|
|
633
|
-
const matchFormattedSuffix = url.match(/(.*):formatted$/);
|
|
634
|
-
const urlWithoutFormattedSuffix = (matchFormattedSuffix && matchFormattedSuffix[1]) || url;
|
|
635
|
-
(widget as CoverageView).selectCoverageItemByUrl(urlWithoutFormattedSuffix);
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
return handleGutterClick;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
private installGutter(textEditor: SourceFrame.SourcesTextEditor.SourcesTextEditor, url: string): void {
|
|
642
|
-
let listener = this.listeners.get(textEditor);
|
|
643
|
-
if (!listener) {
|
|
644
|
-
listener = this.makeGutterClickHandler(url);
|
|
645
|
-
this.listeners.set(textEditor, listener);
|
|
646
|
-
}
|
|
647
|
-
textEditor.installGutter(LineDecorator.GUTTER_TYPE, false);
|
|
648
|
-
textEditor.addEventListener(SourceFrame.SourcesTextEditor.Events.GutterClick, listener, this);
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
private uninstallGutter(textEditor: SourceFrame.SourcesTextEditor.SourcesTextEditor): void {
|
|
652
|
-
textEditor.uninstallGutter(LineDecorator.GUTTER_TYPE);
|
|
653
|
-
const listener = this.listeners.get(textEditor);
|
|
654
|
-
if (listener) {
|
|
655
|
-
textEditor.removeEventListener(SourceFrame.SourcesTextEditor.Events.GutterClick, listener, this);
|
|
656
|
-
this.listeners.delete(textEditor);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
static readonly GUTTER_TYPE = 'CodeMirror-gutter-coverage';
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
SourceFrame.SourceFrame.registerLineDecorator({
|
|
664
|
-
lineDecorator: LineDecorator.instance,
|
|
665
|
-
decoratorType: SourceFrame.SourceFrame.DecoratorType.COVERAGE,
|
|
666
|
-
});
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
6
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
7
7
|
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
|
|
8
|
-
import * as
|
|
9
|
-
import * as Legacy from '../../../ui/legacy/legacy.js';
|
|
8
|
+
import * as PanelFeedback from '../../../ui/components/panel_feedback/panel_feedback.js';
|
|
10
9
|
import * as LitHtml from '../../../ui/lit-html/lit-html.js';
|
|
11
10
|
|
|
12
11
|
import cssOverviewStartViewStyles from './cssOverviewStartView.css.js';
|
|
@@ -34,30 +33,9 @@ const UIStrings = {
|
|
|
34
33
|
*/
|
|
35
34
|
locateAffectedElements: 'Locate the affected elements in the Elements panel',
|
|
36
35
|
/**
|
|
37
|
-
*@description Title of the "Preview feature" reminder box
|
|
38
|
-
*/
|
|
39
|
-
previewFeature: 'Preview feature',
|
|
40
|
-
/**
|
|
41
|
-
*@description Sentence to convey the feature is being actively worked on and we are looking for feedback
|
|
42
|
-
*@example {https://goo.gle/css-overview-feedback} PH1
|
|
43
|
-
*/
|
|
44
|
-
activelyWorkingAndLookingForS: 'Our team is actively working on this feature and we are looking for your {PH1}!',
|
|
45
|
-
/**
|
|
46
|
-
*@description Link text of the inline anchor to navigate to a feedback page
|
|
47
|
-
*/
|
|
48
|
-
feedbackInline: 'feedback',
|
|
49
|
-
/**
|
|
50
|
-
*@description Title of the section to the quick start video and documentation to CSS Overview panel
|
|
51
|
-
*/
|
|
52
|
-
videoAndDocumentation: 'Video and documentation',
|
|
53
|
-
/**
|
|
54
36
|
*@description Title of the link to the quick start video and documentation to CSS Overview panel
|
|
55
37
|
*/
|
|
56
38
|
quickStartWithCSSOverview: 'Quick start: get started with the new CSS Overview panel',
|
|
57
|
-
/**
|
|
58
|
-
*@description Link text of the standalone button to navigate to a feedback page
|
|
59
|
-
*/
|
|
60
|
-
feedbackStandalone: 'Feedback',
|
|
61
39
|
};
|
|
62
40
|
const str_ = i18n.i18n.registerUIStrings('panels/css_overview/components/CSSOverviewStartView.ts', UIStrings);
|
|
63
41
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -77,13 +55,6 @@ export class OverviewStartRequestedEvent extends Event {
|
|
|
77
55
|
export class CSSOverviewStartView extends HTMLElement {
|
|
78
56
|
static readonly litTagName = LitHtml.literal`devtools-css-overview-start-view`;
|
|
79
57
|
readonly #shadow = this.attachShadow({mode: 'open'});
|
|
80
|
-
#feedbackLink: HTMLElement;
|
|
81
|
-
|
|
82
|
-
constructor() {
|
|
83
|
-
super();
|
|
84
|
-
this.#feedbackLink =
|
|
85
|
-
Legacy.XLink.XLink.create(FEEDBACK_LINK, i18nString(UIStrings.feedbackInline), 'devtools-link');
|
|
86
|
-
}
|
|
87
58
|
|
|
88
59
|
connectedCallback(): void {
|
|
89
60
|
this.#shadow.adoptedStyleSheets = [cssOverviewStartViewStyles];
|
|
@@ -121,32 +92,16 @@ export class CSSOverviewStartView extends HTMLElement {
|
|
|
121
92
|
${i18nString(UIStrings.captureOverview)}
|
|
122
93
|
</${Buttons.Button.Button.litTagName}>
|
|
123
94
|
</div>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<div class="feedback-prompt">${i18n.i18n.getFormatLocalizedString(str_, UIStrings.activelyWorkingAndLookingForS, {PH1: this.#feedbackLink})}</div>
|
|
135
|
-
<div class="resources">
|
|
136
|
-
<div class="thumbnail-wrapper">
|
|
137
|
-
<${IconButton.Icon.Icon.litTagName} .data=${{
|
|
138
|
-
iconName: 'preview_feature_video_thumbnail',
|
|
139
|
-
width: '144px',
|
|
140
|
-
height: '92px',
|
|
141
|
-
} as IconButton.Icon.IconData}></${IconButton.Icon.Icon.litTagName}>
|
|
142
|
-
</div>
|
|
143
|
-
<div>
|
|
144
|
-
<h1 class="video-doc-header">${i18nString(UIStrings.videoAndDocumentation)}</h1>
|
|
145
|
-
<x-link class="devtools-link" href=${DOC_LINK}>${i18nString(UIStrings.quickStartWithCSSOverview)}</x-link>
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
</section>
|
|
149
|
-
<x-link class="feedback-standalone" href=${FEEDBACK_LINK}>${i18nString(UIStrings.feedbackStandalone)}</x-link>
|
|
95
|
+
<${PanelFeedback.PanelFeedback.PanelFeedback.litTagName} .data=${{
|
|
96
|
+
feedbackUrl: FEEDBACK_LINK,
|
|
97
|
+
quickStartUrl: DOC_LINK,
|
|
98
|
+
quickStartLinkText: i18nString(UIStrings.quickStartWithCSSOverview),
|
|
99
|
+
} as PanelFeedback.PanelFeedback.PanelFeedbackData}>
|
|
100
|
+
</${PanelFeedback.PanelFeedback.PanelFeedback.litTagName}>
|
|
101
|
+
<${PanelFeedback.FeedbackButton.FeedbackButton.litTagName} .data=${{
|
|
102
|
+
feedbackUrl: FEEDBACK_LINK,
|
|
103
|
+
} as PanelFeedback.FeedbackButton.FeedbackButtonData}>
|
|
104
|
+
</${PanelFeedback.FeedbackButton.FeedbackButton.litTagName}>
|
|
150
105
|
</div>
|
|
151
106
|
`, this.#shadow, {
|
|
152
107
|
host: this,
|
|
@@ -120,15 +120,8 @@ h1 {
|
|
|
120
120
|
margin-bottom: 2px;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
width: fit-content;
|
|
125
|
-
padding: 0.5em;
|
|
123
|
+
devtools-feedback-button {
|
|
126
124
|
align-self: flex-end;
|
|
127
|
-
color: var(--color-primary);
|
|
128
|
-
border: 1px solid var(--color-details-hairline);
|
|
129
|
-
border-radius: 2px;
|
|
130
|
-
text-decoration: none;
|
|
131
|
-
font-weight: bold;
|
|
132
125
|
}
|
|
133
126
|
|
|
134
127
|
.resources .devtools-link {
|
|
@@ -6,7 +6,6 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
10
9
|
import type * as DeveloperResources from './developer_resources.js';
|
|
11
10
|
|
|
12
11
|
const UIStrings = {
|
|
@@ -38,10 +38,10 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
38
38
|
import * as Platform from '../../core/platform/platform.js';
|
|
39
39
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
40
40
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
41
|
+
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
41
42
|
import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
42
43
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
43
|
-
|
|
44
|
-
import type * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
44
|
+
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
45
45
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
46
46
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
47
47
|
import * as Emulation from '../emulation/emulation.js';
|
|
@@ -679,8 +679,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
679
679
|
const isEditable = this.hasEditableNode();
|
|
680
680
|
// clang-format off
|
|
681
681
|
if (isEditable && !this.editing) {
|
|
682
|
-
// Eagerly load CodeMirror to avoid a delay when opening the "Edit as HTML" editor when the user actually clicks on it
|
|
683
|
-
import('../../ui/components/text_editor/text_editor.js');
|
|
684
682
|
contextMenu.editSection().appendItem(i18nString(UIStrings.editAsHtml), this.editAsHTML.bind(this));
|
|
685
683
|
}
|
|
686
684
|
// clang-format on
|
|
@@ -1026,9 +1024,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1026
1024
|
}
|
|
1027
1025
|
});
|
|
1028
1026
|
|
|
1029
|
-
const TextEditor = await import('../../ui/components/text_editor/text_editor.js');
|
|
1030
|
-
const CodeMirror = await import('../../third_party/codemirror.next/codemirror.next.js');
|
|
1031
|
-
const {html} = await CodeMirror.html();
|
|
1032
1027
|
const editor = new TextEditor.TextEditor.TextEditor(CodeMirror.EditorState.create({
|
|
1033
1028
|
doc: initialValue,
|
|
1034
1029
|
extensions: [
|
|
@@ -1050,8 +1045,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1050
1045
|
]),
|
|
1051
1046
|
TextEditor.Config.baseConfiguration(initialValue),
|
|
1052
1047
|
TextEditor.Config.autocompletion,
|
|
1053
|
-
html(),
|
|
1054
|
-
TextEditor.Config.domWordWrap,
|
|
1048
|
+
CodeMirror.html.html(),
|
|
1049
|
+
TextEditor.Config.domWordWrap.instance(),
|
|
1055
1050
|
CodeMirror.EditorView.theme({
|
|
1056
1051
|
'&.cm-editor': {maxHeight: '300px'},
|
|
1057
1052
|
'.cm-scroller': {overflowY: 'auto'},
|
|
@@ -7,7 +7,6 @@ import * as Root from '../../core/root/root.js';
|
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
8
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
9
|
|
|
10
|
-
// eslint-disable-next-line rulesdir/es_modules_import
|
|
11
10
|
import type * as Elements from './elements.js';
|
|
12
11
|
|
|
13
12
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -11,6 +11,8 @@ import * as UI from '../../ui/legacy/legacy.js';
|
|
|
11
11
|
import * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';
|
|
12
12
|
import * as EmulationComponents from './components/components.js';
|
|
13
13
|
|
|
14
|
+
import deviceModeToolbarStyles from './deviceModeToolbar.css.legacy.js';
|
|
15
|
+
|
|
14
16
|
const UIStrings = {
|
|
15
17
|
/**
|
|
16
18
|
* @description Title of the device dimensions selection iteam in the Device Mode Toolbar.
|
|
@@ -518,7 +520,7 @@ export class DeviceModeToolbar {
|
|
|
518
520
|
private wrapToolbarItem(element: Element): UI.Toolbar.ToolbarItem {
|
|
519
521
|
const container = document.createElement('div');
|
|
520
522
|
const shadowRoot = UI.Utils.createShadowRootWithCoreStyles(
|
|
521
|
-
container, {cssFile:
|
|
523
|
+
container, {cssFile: deviceModeToolbarStyles, delegatesFocus: undefined});
|
|
522
524
|
shadowRoot.appendChild(element);
|
|
523
525
|
return new UI.Toolbar.ToolbarItem(container);
|
|
524
526
|
}
|
|
@@ -12,6 +12,7 @@ import * as EmulationModel from '../../models/emulation/emulation.js';
|
|
|
12
12
|
|
|
13
13
|
import {DeviceModeToolbar} from './DeviceModeToolbar.js';
|
|
14
14
|
import {MediaQueryInspector} from './MediaQueryInspector.js';
|
|
15
|
+
import deviceModeViewStyles from './deviceModeView.css.legacy.js';
|
|
15
16
|
|
|
16
17
|
const UIStrings = {
|
|
17
18
|
/**
|
|
@@ -98,7 +99,7 @@ export class DeviceModeView extends UI.Widget.VBox {
|
|
|
98
99
|
|
|
99
100
|
this.setMinimumSize(150, 150);
|
|
100
101
|
this.element.classList.add('device-mode-view');
|
|
101
|
-
this.registerRequiredCSS(
|
|
102
|
+
this.registerRequiredCSS(deviceModeViewStyles);
|
|
102
103
|
|
|
103
104
|
this.model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
104
105
|
this.model.addEventListener(EmulationModel.DeviceModeModel.Events.Updated, this.updateUI, this);
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
7
|
|
|
8
|
+
import inspectedPagePlaceholderStyles from './inspectedPagePlaceholder.css.legacy.js';
|
|
9
|
+
|
|
8
10
|
let inspectedPagePlaceholderInstance: InspectedPagePlaceholder;
|
|
9
11
|
|
|
10
12
|
export class InspectedPagePlaceholder extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.Widget>(
|
|
@@ -12,7 +14,7 @@ export class InspectedPagePlaceholder extends Common.ObjectWrapper.eventMixin<Ev
|
|
|
12
14
|
private updateId?: number;
|
|
13
15
|
constructor() {
|
|
14
16
|
super(true);
|
|
15
|
-
this.registerRequiredCSS(
|
|
17
|
+
this.registerRequiredCSS(inspectedPagePlaceholderStyles);
|
|
16
18
|
UI.ZoomManager.ZoomManager.instance().addEventListener(UI.ZoomManager.Events.ZoomChanged, this.onResize, this);
|
|
17
19
|
this.restoreMinimumSize();
|
|
18
20
|
}
|
|
@@ -10,6 +10,8 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
10
10
|
import type * as Workspace from '../../models/workspace/workspace.js';
|
|
11
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
12
|
|
|
13
|
+
import mediaQueryInspectorStyles from './mediaQueryInspector.css.legacy.js';
|
|
14
|
+
|
|
13
15
|
const UIStrings = {
|
|
14
16
|
/**
|
|
15
17
|
* @description A context menu item/command in the Media Query Inspector of the Device Toolbar.
|
|
@@ -32,7 +34,7 @@ export class MediaQueryInspector extends UI.Widget.Widget implements
|
|
|
32
34
|
|
|
33
35
|
constructor(getWidthCallback: () => number, setWidthCallback: (arg0: number) => void) {
|
|
34
36
|
super(true);
|
|
35
|
-
this.registerRequiredCSS(
|
|
37
|
+
this.registerRequiredCSS(mediaQueryInspectorStyles);
|
|
36
38
|
this.contentElement.classList.add('media-inspector-view');
|
|
37
39
|
this.contentElement.addEventListener('click', this.onMediaQueryClicked.bind(this), false);
|
|
38
40
|
this.contentElement.addEventListener('contextmenu', this.onContextMenu.bind(this), false);
|