chrome-devtools-frontend 1.0.1548980 → 1.0.1550444
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/docs/contributing/settings-experiments-features.md +35 -0
- package/docs/styleguide/ux/components.md +53 -12
- package/docs/styleguide/ux/images/cards.png +0 -0
- package/docs/styleguide/ux/patterns.md +27 -0
- package/docs/ui_engineering.md +2 -2
- package/eslint.config.mjs +1 -0
- package/front_end/Tests.js +2 -0
- package/front_end/core/host/InspectorFrontendHost.ts +26 -558
- package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
- package/front_end/core/host/ResourceLoader.ts +9 -23
- package/front_end/core/host/UserMetrics.ts +4 -4
- package/front_end/core/root/DevToolsContext.ts +4 -0
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +24 -24
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +2 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +41 -41
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/OverlayModel.ts +2 -2
- package/front_end/core/sdk/PageResourceLoader.ts +71 -38
- package/front_end/core/sdk/SourceMap.ts +6 -0
- package/front_end/core/sdk/SourceMapCache.ts +21 -0
- package/front_end/core/sdk/SourceMapManager.ts +14 -7
- package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
- package/front_end/core/sdk/TargetManager.ts +14 -2
- package/front_end/core/sdk/sdk-meta.ts +13 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +5 -4
- package/front_end/foundation/Universe.ts +8 -1
- package/front_end/generated/Deprecation.ts +18 -4
- package/front_end/generated/InspectorBackendCommands.ts +38 -33
- package/front_end/generated/SupportedCSSProperties.js +41 -41
- package/front_end/generated/protocol-mapping.d.ts +20 -0
- package/front_end/generated/protocol-proxy-api.d.ts +17 -0
- package/front_end/generated/protocol.ts +146 -35
- package/front_end/models/ai_assistance/AiConversation.ts +5 -4
- package/front_end/models/ai_assistance/BuiltInAi.ts +79 -5
- package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
- package/front_end/models/bindings/ResourceMapping.ts +73 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
- package/front_end/models/issues_manager/AttributionReportingIssue.ts +6 -8
- package/front_end/models/issues_manager/BounceTrackingIssue.ts +4 -14
- package/front_end/models/issues_manager/ClientHintIssue.ts +5 -12
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +5 -12
- package/front_end/models/issues_manager/CookieDeprecationMetadataIssue.ts +7 -14
- package/front_end/models/issues_manager/CookieIssue.ts +27 -30
- package/front_end/models/issues_manager/CorsIssue.ts +8 -17
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -8
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -14
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +7 -14
- package/front_end/models/issues_manager/FederatedAuthRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.ts +4 -11
- package/front_end/models/issues_manager/GenericIssue.ts +28 -16
- package/front_end/models/issues_manager/HeavyAdIssue.ts +4 -11
- package/front_end/models/issues_manager/Issue.ts +12 -4
- package/front_end/models/issues_manager/IssueAggregator.ts +8 -2
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +3 -10
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -13
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +4 -11
- package/front_end/models/issues_manager/PropertyRuleIssue.ts +6 -12
- package/front_end/models/issues_manager/QuirksModeIssue.ts +3 -10
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +7 -13
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +4 -11
- package/front_end/models/issues_manager/SharedDictionaryIssue.ts +6 -13
- package/front_end/models/issues_manager/StylesheetLoadingIssue.ts +8 -13
- package/front_end/models/issues_manager/UnencodedDigestIssue.ts +2 -9
- package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -16
- package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
- package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +51 -44
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
- package/front_end/panels/application/AppManifestView.ts +7 -6
- package/front_end/panels/application/ApplicationPanelSidebar.ts +21 -21
- package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -6
- package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -2
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/PreloadingTreeElement.ts +3 -3
- package/front_end/panels/application/ReportingApiTreeElement.ts +2 -2
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +3 -3
- package/front_end/panels/application/ServiceWorkersView.ts +2 -2
- package/front_end/panels/application/SharedStorageListTreeElement.ts +2 -2
- package/front_end/panels/application/StorageBucketsTreeElement.ts +3 -3
- package/front_end/panels/application/StorageView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +4 -8
- package/front_end/panels/application/components/PermissionsPolicySection.ts +202 -158
- package/front_end/panels/application/components/ProtocolHandlersView.ts +118 -81
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
- package/front_end/panels/application/components/TrustTokensView.ts +77 -69
- package/front_end/panels/application/preloading/components/PreloadingGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +1 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +2 -0
- package/front_end/panels/changes/CombinedDiffView.ts +2 -0
- package/front_end/panels/common/AnnotationManager.ts +71 -0
- package/front_end/panels/common/PersistenceUtils.ts +6 -7
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsolePrompt.ts +4 -4
- package/front_end/panels/console/ConsoleView.ts +5 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +16 -15
- package/front_end/panels/console/console-meta.ts +0 -13
- package/front_end/panels/console_counters/WarningErrorCounter.ts +2 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +3 -3
- package/front_end/panels/elements/ElementsPanel.ts +49 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +172 -121
- package/front_end/panels/elements/ElementsTreeOutline.ts +11 -3
- package/front_end/panels/elements/LayoutPane.ts +12 -10
- package/front_end/panels/elements/ShortcutTreeElement.ts +2 -2
- package/front_end/panels/elements/StyleEditorWidget.ts +2 -2
- package/front_end/panels/elements/StylePropertyTreeElement.ts +18 -18
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -5
- package/front_end/panels/elements/TopLayerContainer.ts +2 -2
- package/front_end/panels/elements/components/AdornerManager.ts +3 -3
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
- package/front_end/panels/elements/components/ElementsTreeExpandButton.ts +1 -1
- package/front_end/panels/elements/components/QueryContainer.ts +1 -1
- package/front_end/panels/elements/components/StylePropertyEditor.ts +7 -7
- package/front_end/panels/emulation/DeviceModeWrapper.ts +48 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +6 -4
- package/front_end/panels/issues/AffectedResourcesView.ts +2 -2
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +2 -2
- package/front_end/panels/issues/IssueKindView.ts +2 -2
- package/front_end/panels/issues/IssueView.ts +4 -4
- package/front_end/panels/js_timeline/js_timeline-meta.ts +4 -2
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +28 -50
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +1 -1
- package/front_end/panels/media/PlayerListView.ts +100 -73
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +2 -2
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -5
- package/front_end/panels/network/NetworkDataGridNode.ts +3 -3
- package/front_end/panels/network/NetworkFrameGrouper.ts +2 -2
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/SignedExchangeInfoView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
- package/front_end/panels/network/components/RequestTrustTokensView.ts +5 -6
- package/front_end/panels/network/resourceChunkView.css +4 -0
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +3 -3
- package/front_end/panels/profiler/ProfileDataGrid.ts +2 -2
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/protocol_monitor/JSONEditor.ts +1 -1
- package/front_end/panels/recorder/components/CreateRecordingView.ts +1 -1
- package/front_end/panels/recorder/components/ExtensionView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingListView.ts +1 -1
- package/front_end/panels/recorder/components/RecordingView.ts +1 -1
- package/front_end/panels/recorder/components/StepView.ts +1 -1
- package/front_end/panels/screencast/ScreencastView.ts +8 -8
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/CookieControlsTreeElement.ts +2 -2
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/security/CookieReportTreeElement.ts +2 -2
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/security/SecurityPanelSidebar.ts +3 -4
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +7 -8
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +16 -6
- package/front_end/panels/sources/BreakpointEditDialog.ts +3 -3
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CSSPlugin.ts +4 -4
- package/front_end/panels/sources/CallStackSidebarPane.ts +4 -4
- package/front_end/panels/sources/DebuggerPausedMessage.ts +3 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +40 -23
- package/front_end/panels/sources/GoToLineQuickOpen.ts +11 -5
- package/front_end/panels/sources/NavigatorView.ts +4 -4
- package/front_end/panels/sources/OpenFileQuickOpen.ts +11 -16
- package/front_end/panels/sources/OutlineQuickOpen.ts +23 -23
- package/front_end/panels/sources/ProfilePlugin.ts +21 -12
- package/front_end/panels/sources/SourcesView.ts +2 -2
- package/front_end/panels/sources/TabbedEditorContainer.ts +4 -5
- package/front_end/panels/sources/ThreadsSidebarPane.ts +2 -2
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -6
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
- package/front_end/panels/timeline/TimelineHistoryManager.ts +2 -2
- package/front_end/panels/timeline/TimelinePanel.ts +29 -25
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +1 -1
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +1 -1
- package/front_end/panels/timeline/components/OriginMap.ts +1 -1
- package/front_end/panels/timeline/components/insights/Checklist.ts +1 -1
- package/front_end/panels/timeline/components/insights/DOMSize.ts +1 -1
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -1
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
- package/front_end/panels/timeline/overlays/components/EntriesLinkOverlay.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +1 -1
- package/front_end/panels/timeline/timeline-meta.ts +3 -2
- package/front_end/panels/utils/utils.ts +18 -3
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
- package/front_end/panels/whats_new/resources/WNDT.md +8 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
- package/front_end/ui/components/adorners/Adorner.ts +21 -1
- package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
- package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
- package/front_end/ui/components/annotations/annotations.ts +6 -0
- package/front_end/ui/components/buttons/Button.ts +2 -2
- package/front_end/ui/components/buttons/FloatingButton.ts +2 -2
- package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +16 -2
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
- package/front_end/ui/components/highlighting/highlighting.ts +7 -0
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +2 -2
- package/front_end/ui/components/icon_button/IconButton.ts +2 -2
- package/front_end/ui/components/icon_button/icon_button.ts +0 -2
- package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +2 -2
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/list/List.ts +184 -0
- package/front_end/ui/components/list/list.css +90 -0
- package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +1 -1
- package/front_end/ui/components/node_text/NodeText.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +2 -2
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +2 -2
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +2 -2
- package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
- package/front_end/ui/components/text_editor/config.ts +2 -2
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/kit/cards/Card.docs.ts +43 -0
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.docs.ts +3 -4
- package/front_end/ui/{components/icon_button → kit/icons}/Icon.ts +6 -4
- package/front_end/ui/kit/kit.ts +6 -0
- package/front_end/ui/legacy/Infobar.ts +3 -3
- package/front_end/ui/legacy/InspectorView.ts +3 -3
- package/front_end/ui/legacy/SearchableView.ts +2 -2
- package/front_end/ui/legacy/SoftContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftDropDown.ts +2 -2
- package/front_end/ui/legacy/TabbedPane.ts +106 -8
- package/front_end/ui/legacy/Toolbar.ts +3 -3
- package/front_end/ui/legacy/Treeoutline.ts +2 -2
- package/front_end/ui/legacy/UIUtils.ts +4 -188
- package/front_end/ui/legacy/ViewManager.ts +27 -12
- package/front_end/ui/legacy/ViewRegistration.ts +21 -22
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +8 -8
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +4 -4
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +4 -4
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +2 -2
- package/front_end/ui/legacy/components/inline_editor/Swatches.ts +5 -5
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +3 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +23 -31
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +11 -27
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +11 -15
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
- package/front_end/ui/legacy/components/utils/Linkifier.ts +3 -3
- package/front_end/ui/legacy/tabbedPane.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/README.md +3 -3
- package/mcp/HostBindings.ts +310 -0
- package/mcp/mcp.ts +18 -0
- package/mcp/tsconfig.json +6 -1
- package/package.json +26 -24
- /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
- /package/front_end/ui/{components → kit}/cards/card.css +0 -0
- /package/front_end/ui/{components/icon_button → kit/icons}/icon.css +0 -0
|
@@ -13,7 +13,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
13
13
|
import * as Geometry from '../../models/geometry/geometry.js';
|
|
14
14
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
15
15
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
16
|
-
import
|
|
16
|
+
import {createIcon, type Icon} from '../../ui/kit/kit.js';
|
|
17
17
|
import * as ColorPicker from '../../ui/legacy/components/color_picker/color_picker.js';
|
|
18
18
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
19
19
|
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
@@ -61,7 +61,7 @@ function findPropertyAt(node: CodeMirror.SyntaxNode, pos: number): CodeMirror.Sy
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function getCurrentStyleSheet(
|
|
64
|
-
url: Platform.DevToolsPath.UrlString, cssModel: SDK.CSSModel.CSSModel): Protocol.
|
|
64
|
+
url: Platform.DevToolsPath.UrlString, cssModel: SDK.CSSModel.CSSModel): Protocol.DOM.StyleSheetId {
|
|
65
65
|
const currentStyleSheet = cssModel.getStyleSheetIdsForURL(url);
|
|
66
66
|
if (currentStyleSheet.length === 0) {
|
|
67
67
|
throw new Error('Can\'t find style sheet ID for current URL');
|
|
@@ -211,7 +211,7 @@ class CurveSwatchWidget extends CodeMirror.WidgetType {
|
|
|
211
211
|
toDOM(view: CodeMirror.EditorView): HTMLElement {
|
|
212
212
|
const container = document.createElement('span');
|
|
213
213
|
const bezierText = container.createChild('span');
|
|
214
|
-
const icon =
|
|
214
|
+
const icon = createIcon('bezier-curve-filled', 'bezier-swatch-icon');
|
|
215
215
|
icon.setAttribute('jslog', `${VisualLogging.showStyleEditor('bezier')}`);
|
|
216
216
|
bezierText.append(this.text);
|
|
217
217
|
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.openCubicBezierEditor));
|
|
@@ -251,7 +251,7 @@ type ActiveTooltip = {
|
|
|
251
251
|
pos: number,
|
|
252
252
|
text: string,
|
|
253
253
|
curve: Geometry.CubicBezier,
|
|
254
|
-
swatch:
|
|
254
|
+
swatch: Icon,
|
|
255
255
|
};
|
|
256
256
|
|
|
257
257
|
function createCSSTooltip(active: ActiveTooltip): CodeMirror.Tooltip {
|
|
@@ -38,7 +38,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
38
38
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
39
39
|
import * as SourceMapScopes from '../../models/source_map_scopes/source_map_scopes.js';
|
|
40
40
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
41
|
-
import
|
|
41
|
+
import {Icon} from '../../ui/kit/kit.js';
|
|
42
42
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
43
43
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
44
44
|
|
|
@@ -126,7 +126,7 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
126
126
|
this.notPausedMessageElement.tabIndex = -1;
|
|
127
127
|
|
|
128
128
|
this.callFrameWarningsElement = this.contentElement.createChild('div', 'call-frame-warnings-message');
|
|
129
|
-
const icon = new
|
|
129
|
+
const icon = new Icon();
|
|
130
130
|
icon.name = 'warning-filled';
|
|
131
131
|
icon.classList.add('call-frame-warning-icon', 'small');
|
|
132
132
|
this.callFrameWarningsElement.appendChild(icon);
|
|
@@ -330,14 +330,14 @@ export class CallStackSidebarPane extends UI.View.SimpleView implements UI.Conte
|
|
|
330
330
|
element.classList.toggle('selected', isSelected);
|
|
331
331
|
UI.ARIAUtils.setSelected(element, isSelected);
|
|
332
332
|
element.classList.toggle('hidden', !this.showIgnoreListed && item.isIgnoreListed);
|
|
333
|
-
const icon = new
|
|
333
|
+
const icon = new Icon();
|
|
334
334
|
icon.name = 'large-arrow-right-filled';
|
|
335
335
|
icon.classList.add('selected-call-frame-icon', 'small');
|
|
336
336
|
element.appendChild(icon);
|
|
337
337
|
element.tabIndex = item === this.list.selectedItem() ? 0 : -1;
|
|
338
338
|
|
|
339
339
|
if (callframe?.missingDebugInfoDetails) {
|
|
340
|
-
const icon = new
|
|
340
|
+
const icon = new Icon();
|
|
341
341
|
icon.name = 'warning-filled';
|
|
342
342
|
icon.classList.add('call-frame-warning-icon', 'small');
|
|
343
343
|
const messages = callframe.missingDebugInfoDetails.resources.map(
|
|
@@ -9,8 +9,8 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
9
9
|
import * as Protocol from '../../generated/protocol.js';
|
|
10
10
|
import type * as Bindings from '../../models/bindings/bindings.js';
|
|
11
11
|
import type * as BreakpointManager from '../../models/breakpoints/breakpoints.js';
|
|
12
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
13
12
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
13
|
+
import {Icon} from '../../ui/kit/kit.js';
|
|
14
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
15
15
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
16
16
|
import * as PanelsCommon from '../common/common.js';
|
|
@@ -158,7 +158,7 @@ export class DebuggerPausedMessage {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
const mainElement = messageWrapper.createChild('div', 'status-main');
|
|
161
|
-
const mainIcon = new
|
|
161
|
+
const mainIcon = new Icon();
|
|
162
162
|
mainIcon.name = 'info';
|
|
163
163
|
mainIcon.style.color = 'var(--sys-color-on-yellow-container)';
|
|
164
164
|
mainIcon.classList.add('medium');
|
|
@@ -290,7 +290,7 @@ export class DebuggerPausedMessage {
|
|
|
290
290
|
function buildWrapper(mainText: string, subText?: string, title?: string): Element {
|
|
291
291
|
const messageWrapper = document.createElement('span');
|
|
292
292
|
const mainElement = messageWrapper.createChild('div', 'status-main');
|
|
293
|
-
const mainIcon = new
|
|
293
|
+
const mainIcon = new Icon();
|
|
294
294
|
mainIcon.name = errorLike ? 'cross-circle-filled' : 'info';
|
|
295
295
|
mainIcon.style.color = errorLike ? 'var(--icon-error)' : 'var(--sys-color-on-yellow-container)';
|
|
296
296
|
mainIcon.classList.add('medium');
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../ui/components/highlighting/highlighting.js';
|
|
6
|
+
|
|
5
7
|
import type * as Common from '../../core/common/common.js';
|
|
6
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
9
|
import * as Root from '../../core/root/root.js';
|
|
8
10
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
9
11
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
10
12
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
11
|
-
import
|
|
13
|
+
import {Directives, html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
12
14
|
|
|
13
15
|
import {FilePathScoreFunction} from './FilePathScoreFunction.js';
|
|
16
|
+
import filteredUISourceCodeListProviderStyles from './filteredUISourceCodeListProvider.css.js';
|
|
14
17
|
|
|
15
18
|
const UIStrings = {
|
|
16
19
|
/**
|
|
@@ -23,8 +26,11 @@ const UIStrings = {
|
|
|
23
26
|
*/
|
|
24
27
|
sIgnoreListed: '{PH1} (ignore listed)',
|
|
25
28
|
} as const;
|
|
29
|
+
|
|
26
30
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/FilteredUISourceCodeListProvider.ts', UIStrings);
|
|
27
31
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
32
|
+
const {classMap} = Directives;
|
|
33
|
+
|
|
28
34
|
export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidget.Provider {
|
|
29
35
|
private queryLineNumberAndColumnNumber: string;
|
|
30
36
|
private defaultScores: Map<Workspace.UISourceCode.UISourceCode, number>|null;
|
|
@@ -143,8 +149,7 @@ export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidg
|
|
|
143
149
|
return score + multiplier * (contentTypeBonus + this.scorer.calculateScore(fullDisplayName, null));
|
|
144
150
|
}
|
|
145
151
|
|
|
146
|
-
override renderItem(itemIndex: number, query: string
|
|
147
|
-
titleElement.parentElement?.parentElement?.classList.toggle('search-mode', Boolean(query));
|
|
152
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
148
153
|
query = this.rewriteQuery(query);
|
|
149
154
|
const uiSourceCode = this.uiSourceCodes[itemIndex];
|
|
150
155
|
const fullDisplayName = uiSourceCode.fullDisplayName();
|
|
@@ -157,41 +162,53 @@ export class FilteredUISourceCodeListProvider extends QuickOpen.FilteredListWidg
|
|
|
157
162
|
let tooltipText = fullDisplayName;
|
|
158
163
|
|
|
159
164
|
if (isIgnoreListed) {
|
|
160
|
-
titleElement.parentElement?.classList.add('is-ignore-listed');
|
|
161
165
|
tooltipText = i18nString(UIStrings.sIgnoreListed, {PH1: tooltipText});
|
|
162
166
|
}
|
|
163
167
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
UI.Tooltip.Tooltip.install((subtitleElement as HTMLElement), tooltipText);
|
|
167
|
-
|
|
168
|
-
const ranges = [];
|
|
169
|
-
for (let i = 0; i < indexes.length; ++i) {
|
|
170
|
-
ranges.push({offset: indexes[i], length: 1});
|
|
171
|
-
}
|
|
168
|
+
const titleRanges = [];
|
|
169
|
+
const subtitleRanges = [];
|
|
172
170
|
|
|
173
171
|
if (indexes[0] > fileNameIndex) {
|
|
174
|
-
for (let i = 0; i <
|
|
175
|
-
|
|
172
|
+
for (let i = 0; i < indexes.length; ++i) {
|
|
173
|
+
titleRanges.push({offset: indexes[i] - (fileNameIndex + 1), length: 1});
|
|
176
174
|
}
|
|
177
|
-
UI.UIUtils.highlightRangesWithStyleClass(titleElement, ranges, 'highlight');
|
|
178
175
|
} else {
|
|
179
|
-
|
|
176
|
+
for (let i = 0; i < indexes.length; ++i) {
|
|
177
|
+
subtitleRanges.push({offset: indexes[i], length: 1});
|
|
178
|
+
}
|
|
180
179
|
}
|
|
180
|
+
// clang-format off
|
|
181
|
+
return html`
|
|
182
|
+
<style>${filteredUISourceCodeListProviderStyles}</style>
|
|
183
|
+
<div class="filtered-ui-source-code-list-item
|
|
184
|
+
${classMap({'is-ignore-listed': isIgnoreListed})}">
|
|
185
|
+
<devtools-highlight
|
|
186
|
+
type="markup"
|
|
187
|
+
ranges=${titleRanges.map(r => `${r.offset},${r.length}`).join(' ')}
|
|
188
|
+
class="filtered-ui-source-code-title ${classMap({'search-mode': Boolean(query)})}">
|
|
189
|
+
${uiSourceCode.displayName() + (this.queryLineNumberAndColumnNumber || '')}
|
|
190
|
+
</devtools-highlight>
|
|
191
|
+
<devtools-highlight
|
|
192
|
+
type="markup"
|
|
193
|
+
ranges=${subtitleRanges.map(r => `${r.offset},${r.length}`).join(' ')}
|
|
194
|
+
class="filtered-ui-source-code-subtitle" title=${tooltipText}>
|
|
195
|
+
${this.renderSubtitleElement(fullDisplayName.substring(0, fileNameIndex + 1))}
|
|
196
|
+
</devtools-highlight>
|
|
197
|
+
</div>`;
|
|
198
|
+
// clang-format on
|
|
181
199
|
}
|
|
182
200
|
|
|
183
|
-
private renderSubtitleElement(
|
|
184
|
-
element.removeChildren();
|
|
201
|
+
private renderSubtitleElement(text: string): TemplateResult {
|
|
185
202
|
let splitPosition = text.lastIndexOf('/');
|
|
186
203
|
const maxTextLength = 43;
|
|
187
204
|
if (text.length > maxTextLength) {
|
|
188
205
|
splitPosition = text.length - maxTextLength;
|
|
189
206
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
207
|
+
// clang-format off
|
|
208
|
+
return html`
|
|
209
|
+
<div class="first-part">${text.substring(0, splitPosition)}</div>
|
|
210
|
+
<div class="second-part">${text.substring(splitPosition)}</div>`;
|
|
211
|
+
// clang-format on
|
|
195
212
|
}
|
|
196
213
|
|
|
197
214
|
override selectItem(itemIndex: number|null, promptValue: string): void {
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
|
+
|
|
5
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
7
8
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
8
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
+
import {html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
9
11
|
|
|
10
12
|
import {SourcesView} from './SourcesView.js';
|
|
11
13
|
import type {UISourceCodeFrame} from './UISourceCodeFrame.js';
|
|
@@ -77,10 +79,14 @@ export class GoToLineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
|
|
|
77
79
|
return this.#goToLineStrings.length;
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
override renderItem(itemIndex: number, _query: string
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
override renderItem(itemIndex: number, _query: string): TemplateResult {
|
|
83
|
+
// clang-format off
|
|
84
|
+
return html`
|
|
85
|
+
<devtools-icon name="colon"></devtools-icon>
|
|
86
|
+
<div>
|
|
87
|
+
<div>${this.#goToLineStrings[itemIndex]}</div>
|
|
88
|
+
</div>`;
|
|
89
|
+
// clang-format on
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
override rewriteQuery(_query: string): string {
|
|
@@ -15,8 +15,8 @@ import * as Persistence from '../../models/persistence/persistence.js';
|
|
|
15
15
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
16
16
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
17
17
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
18
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
19
18
|
import * as Spinners from '../../ui/components/spinners/spinners.js';
|
|
19
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
20
20
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
21
21
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
22
22
|
import * as Snippets from '../snippets/snippets.js';
|
|
@@ -819,9 +819,9 @@ export class NavigatorView extends UI.Widget.VBox implements SDK.TargetManager.O
|
|
|
819
819
|
}
|
|
820
820
|
if (this.scriptsTree.selectedTreeElement) {
|
|
821
821
|
// If the tree outline is being marked as "being edited" (i.e. we're renaming a file
|
|
822
|
-
// or
|
|
822
|
+
// or choosing the name for a new snippet), we shall not proceed with revealing here,
|
|
823
823
|
// as that will steal focus from the input widget and thus cancel editing. The
|
|
824
|
-
// test/e2e/snippets/
|
|
824
|
+
// test/e2e/snippets/breakpoint.test.ts exercises this.
|
|
825
825
|
if (UI.UIUtils.isBeingEdited(this.scriptsTree.selectedTreeElement.treeOutline?.element)) {
|
|
826
826
|
return null;
|
|
827
827
|
}
|
|
@@ -1287,7 +1287,7 @@ export class NavigatorFolderTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1287
1287
|
iconType = 'folder-asterisk';
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
|
-
const icon =
|
|
1290
|
+
const icon = createIcon(iconType);
|
|
1291
1291
|
this.setLeadingIcons([icon]);
|
|
1292
1292
|
}
|
|
1293
1293
|
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
// Copyright 2012 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
5
6
|
|
|
6
7
|
import * as Common from '../../core/common/common.js';
|
|
7
8
|
import * as Host from '../../core/host/host.js';
|
|
8
9
|
import type * as Workspace from '../../models/workspace/workspace.js';
|
|
9
10
|
import {PanelUtils} from '../../panels/utils/utils.js';
|
|
10
|
-
import
|
|
11
|
+
import {Directives, html, type TemplateResult} from '../../ui/lit/lit.js';
|
|
11
12
|
|
|
12
13
|
import {FilteredUISourceCodeListProvider} from './FilteredUISourceCodeListProvider.js';
|
|
13
14
|
import {SourcesView} from './SourcesView.js';
|
|
14
15
|
|
|
16
|
+
const {styleMap} = Directives;
|
|
17
|
+
|
|
15
18
|
export class OpenFileQuickOpen extends FilteredUISourceCodeListProvider {
|
|
16
19
|
constructor() {
|
|
17
20
|
super('source-file');
|
|
@@ -40,20 +43,12 @@ export class OpenFileQuickOpen extends FilteredUISourceCodeListProvider {
|
|
|
40
43
|
return !project.isServiceProject();
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
override renderItem(itemIndex: number, query: string
|
|
44
|
-
super.renderItem(itemIndex, query, titleElement, subtitleElement);
|
|
45
|
-
|
|
46
|
-
const iconElement = new IconButton.Icon.Icon();
|
|
46
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
47
47
|
const {iconName, color} = PanelUtils.iconDataForResourceType(this.itemContentTypeAt(itemIndex));
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
titleElement.parentElement?.parentElement?.insertBefore(iconElement, titleElement.parentElement);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
override renderAsTwoRows(): boolean {
|
|
57
|
-
return true;
|
|
48
|
+
// clang-format off
|
|
49
|
+
return html`
|
|
50
|
+
<devtools-icon class="large" name=${iconName} style=${styleMap({color})}></devtools-icon>
|
|
51
|
+
${super.renderItem(itemIndex, query)}`;
|
|
52
|
+
// clang-format on
|
|
58
53
|
}
|
|
59
54
|
}
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../ui/kit/kit.js';
|
|
6
|
+
import '../../ui/components/highlighting/highlighting.js';
|
|
7
|
+
|
|
5
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
9
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
7
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
8
10
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
9
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
|
+
import {html, nothing, type TemplateResult} from '../../ui/lit/lit.js';
|
|
10
13
|
|
|
11
14
|
import {SourcesView} from './SourcesView.js';
|
|
12
15
|
import type {UISourceCodeFrame} from './UISourceCodeFrame.js';
|
|
@@ -317,31 +320,28 @@ export class OutlineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
|
|
|
317
320
|
return -item.lineNumber - 1;
|
|
318
321
|
}
|
|
319
322
|
|
|
320
|
-
override renderItem(itemIndex: number, query: string
|
|
323
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
321
324
|
const item = this.items[itemIndex];
|
|
322
|
-
|
|
323
|
-
titleElement.parentElement?.parentElement?.insertBefore(icon, titleElement.parentElement);
|
|
324
|
-
titleElement.textContent = item.title + (item.subtitle ? item.subtitle : '');
|
|
325
|
-
QuickOpen.FilteredListWidget.FilteredListWidget.highlightRanges(titleElement, query);
|
|
326
|
-
|
|
325
|
+
let location: string|undefined;
|
|
327
326
|
const sourceFrame = this.currentSourceFrame();
|
|
328
|
-
if (
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const disassembly = sourceFrame.wasmDisassembly;
|
|
338
|
-
if (disassembly) {
|
|
339
|
-
const lastBytecodeOffset = disassembly.lineNumberToBytecodeOffset(disassembly.lineNumbers - 1);
|
|
340
|
-
const bytecodeOffsetDigits = lastBytecodeOffset.toString(16).length;
|
|
341
|
-
tagElement.textContent = `:0x${item.columnNumber.toString(16).padStart(bytecodeOffsetDigits, '0')}`;
|
|
342
|
-
} else {
|
|
343
|
-
tagElement.textContent = `:${item.lineNumber + 1}`;
|
|
327
|
+
if (sourceFrame) {
|
|
328
|
+
const disassembly = sourceFrame.wasmDisassembly;
|
|
329
|
+
if (disassembly) {
|
|
330
|
+
const lastBytecodeOffset = disassembly.lineNumberToBytecodeOffset(disassembly.lineNumbers - 1);
|
|
331
|
+
const bytecodeOffsetDigits = lastBytecodeOffset.toString(16).length;
|
|
332
|
+
location = `:0x${item.columnNumber.toString(16).padStart(bytecodeOffsetDigits, '0')}`;
|
|
333
|
+
} else {
|
|
334
|
+
location = `:${item.lineNumber + 1}`;
|
|
335
|
+
}
|
|
344
336
|
}
|
|
337
|
+
const title = item.title + (item.subtitle ? item.subtitle : '');
|
|
338
|
+
const highlightRanges = QuickOpen.FilteredListWidget.FilteredListWidget.getHighlightRanges(title, query, true);
|
|
339
|
+
// clang-format off
|
|
340
|
+
return html`
|
|
341
|
+
<devtools-icon name="deployed"></devtools-icon>
|
|
342
|
+
<div><devtools-highlight type="markup" ranges=${highlightRanges}>${title}</devtools-highlight></div>
|
|
343
|
+
${location ? html`<span class="tag">${location}</span>` : nothing}`;
|
|
344
|
+
// clang-format on
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
override selectItem(itemIndex: number|null, _promptValue: string): void {
|
|
@@ -8,6 +8,7 @@ import * as Platform from '../../core/platform/platform.js';
|
|
|
8
8
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
9
9
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
10
10
|
import type * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
11
|
+
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
11
12
|
|
|
12
13
|
import {Plugin} from './Plugin.js';
|
|
13
14
|
|
|
@@ -89,20 +90,16 @@ class PerformanceMarker extends CodeMirror.GutterMarker {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
function markersFromProfileData(
|
|
92
|
-
map:
|
|
93
|
+
map: Workspace.UISourceCode.LineColumnProfileMap, state: CodeMirror.EditorState,
|
|
93
94
|
type: Workspace.UISourceCode.DecoratorType): CodeMirror.RangeSet<CodeMirror.GutterMarker> {
|
|
94
95
|
const markerType = type === Workspace.UISourceCode.DecoratorType.PERFORMANCE ? PerformanceMarker : MemoryMarker;
|
|
95
96
|
const markers: Array<CodeMirror.Range<CodeMirror.GutterMarker>> = [];
|
|
96
97
|
const aggregatedByLine = new Map<number, number>();
|
|
97
98
|
for (const [line, value] of map) {
|
|
98
99
|
if (line <= state.doc.lines) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
aggregatedByLine.set(line, (aggregatedByLine.get(line) || 0) + data);
|
|
102
|
-
}
|
|
103
|
-
continue;
|
|
100
|
+
for (const [, data] of value) {
|
|
101
|
+
aggregatedByLine.set(line, (aggregatedByLine.get(line) || 0) + data);
|
|
104
102
|
}
|
|
105
|
-
aggregatedByLine.set(line, value);
|
|
106
103
|
}
|
|
107
104
|
}
|
|
108
105
|
for (const [line, value] of aggregatedByLine) {
|
|
@@ -112,13 +109,15 @@ function markersFromProfileData(
|
|
|
112
109
|
return CodeMirror.RangeSet.of(markers, true);
|
|
113
110
|
}
|
|
114
111
|
|
|
115
|
-
const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType): typeof Plugin =>
|
|
116
|
-
|
|
112
|
+
const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType): typeof Plugin =>
|
|
113
|
+
class ProfilePlugin extends Plugin {
|
|
114
|
+
updateEffect = CodeMirror.StateEffect.define<Workspace.UISourceCode.LineColumnProfileMap>();
|
|
117
115
|
field: CodeMirror.StateField<CodeMirror.RangeSet<CodeMirror.GutterMarker>>;
|
|
118
116
|
gutter: CodeMirror.Extension;
|
|
119
117
|
compartment: CodeMirror.Compartment = new CodeMirror.Compartment();
|
|
118
|
+
readonly #transformer: SourceFrame.SourceFrame.Transformer;
|
|
120
119
|
|
|
121
|
-
constructor(uiSourceCode: Workspace.UISourceCode.UISourceCode) {
|
|
120
|
+
constructor(uiSourceCode: Workspace.UISourceCode.UISourceCode, transformer: SourceFrame.SourceFrame.Transformer) {
|
|
122
121
|
super(uiSourceCode);
|
|
123
122
|
|
|
124
123
|
this.field = CodeMirror.StateField.define<CodeMirror.RangeSet<CodeMirror.GutterMarker>>({
|
|
@@ -136,14 +135,24 @@ const makeLineLevelProfilePlugin = (type: Workspace.UISourceCode.DecoratorType):
|
|
|
136
135
|
markers: view => view.state.field(this.field),
|
|
137
136
|
class: `cm-${type}Gutter`,
|
|
138
137
|
});
|
|
138
|
+
|
|
139
|
+
this.#transformer = transformer;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
static override accepts(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
|
|
142
143
|
return uiSourceCode.contentType().hasScripts();
|
|
143
144
|
}
|
|
144
145
|
|
|
145
|
-
private getLineMap():
|
|
146
|
-
|
|
146
|
+
private getLineMap(): Workspace.UISourceCode.LineColumnProfileMap|undefined {
|
|
147
|
+
const uiSourceCodeProfileMap = this.uiSourceCode.getDecorationData(type);
|
|
148
|
+
if (!uiSourceCodeProfileMap) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return Workspace.UISourceCode.createMappedProfileData(uiSourceCodeProfileMap, (line, column) => {
|
|
153
|
+
const editorLocation = this.#transformer.uiLocationToEditorLocation(line, column);
|
|
154
|
+
return [editorLocation.lineNumber, editorLocation.columnNumber];
|
|
155
|
+
});
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
override editorExtension(): CodeMirror.Extension {
|
|
@@ -13,7 +13,7 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
13
13
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
14
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
15
15
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
16
|
-
import
|
|
16
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
17
17
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
18
18
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
19
19
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -149,7 +149,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
149
149
|
const workspaceElement = placeholder.createChild('div', 'tabbed-pane-placeholder-row');
|
|
150
150
|
workspaceElement.classList.add('workspace');
|
|
151
151
|
|
|
152
|
-
const icon =
|
|
152
|
+
const icon = createIcon('sync', 'sync-icon');
|
|
153
153
|
workspaceElement.createChild('span', 'icon-container').appendChild(icon);
|
|
154
154
|
const text = workspaceElement.createChild('span');
|
|
155
155
|
text.textContent = UIStrings.workspaceDropInAFolderToSyncSources;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2011 The Chromium Authors
|
|
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
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
import * as Common from '../../core/common/common.js';
|
|
7
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -10,9 +9,9 @@ import * as Persistence from '../../models/persistence/persistence.js';
|
|
|
10
9
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
11
10
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
12
11
|
import type * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
13
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
14
12
|
import * as Tooltips from '../../ui/components/tooltips/tooltips.js';
|
|
15
13
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
14
|
+
import {Icon} from '../../ui/kit/kit.js';
|
|
16
15
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
17
16
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
18
17
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -527,7 +526,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
527
526
|
}
|
|
528
527
|
|
|
529
528
|
private addLoadErrorIcon(tabId: string): void {
|
|
530
|
-
const icon = new
|
|
529
|
+
const icon = new Icon();
|
|
531
530
|
icon.name = 'cross-circle-filled';
|
|
532
531
|
icon.classList.add('small');
|
|
533
532
|
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.unableToLoadThisContent));
|
|
@@ -606,7 +605,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
606
605
|
const tooltip = this.tooltipForFile(uiSourceCode);
|
|
607
606
|
this.tabbedPane.changeTabTitle(tabId, title, tooltip);
|
|
608
607
|
if (uiSourceCode.loadError()) {
|
|
609
|
-
const icon = new
|
|
608
|
+
const icon = new Icon();
|
|
610
609
|
icon.name = 'cross-circle-filled';
|
|
611
610
|
icon.classList.add('small');
|
|
612
611
|
UI.Tooltip.Tooltip.install(icon, i18nString(UIStrings.unableToLoadThisContent));
|
|
@@ -617,7 +616,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
617
616
|
* and we will use a toast instead once available.
|
|
618
617
|
**/
|
|
619
618
|
const suffixElement = document.createElement('div');
|
|
620
|
-
const icon = new
|
|
619
|
+
const icon = new Icon();
|
|
621
620
|
icon.name = 'warning-filled';
|
|
622
621
|
icon.classList.add('small');
|
|
623
622
|
const id = `tab-tooltip-${nextTooltipId++}`;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type * as Common from '../../core/common/common.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
|
-
import
|
|
9
|
+
import {Icon} from '../../ui/kit/kit.js';
|
|
10
10
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
11
11
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
12
12
|
|
|
@@ -54,7 +54,7 @@ export class ThreadsSidebarPane extends UI.Widget.VBox implements
|
|
|
54
54
|
element.classList.add('thread-item');
|
|
55
55
|
const title = element.createChild('div', 'thread-item-title');
|
|
56
56
|
const pausedState = element.createChild('div', 'thread-item-paused-state');
|
|
57
|
-
const icon = new
|
|
57
|
+
const icon = new Icon();
|
|
58
58
|
icon.name = 'large-arrow-right-filled';
|
|
59
59
|
icon.classList.add('selected-thread-icon', 'small');
|
|
60
60
|
element.appendChild(icon);
|
|
@@ -14,9 +14,9 @@ import * as Persistence from '../../models/persistence/persistence.js';
|
|
|
14
14
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
15
15
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
16
16
|
import * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
17
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
18
17
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
19
18
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
19
|
+
import {Icon, type IconWithName} from '../../ui/kit/kit.js';
|
|
20
20
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
21
21
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
22
22
|
|
|
@@ -238,7 +238,6 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
override async setContent(content: string): Promise<void> {
|
|
241
|
-
this.#uiSourceCode.formatChanged(this.formattedMap);
|
|
242
241
|
this.disposePlugins();
|
|
243
242
|
this.loadPlugins();
|
|
244
243
|
await super.setContent(content);
|
|
@@ -529,7 +528,7 @@ export class UISourceCodeFrame extends Common.ObjectWrapper
|
|
|
529
528
|
}
|
|
530
529
|
}
|
|
531
530
|
|
|
532
|
-
function getIconDataForLevel(level: Workspace.UISourceCode.Message.Level):
|
|
531
|
+
function getIconDataForLevel(level: Workspace.UISourceCode.Message.Level): IconWithName {
|
|
533
532
|
if (level === Workspace.UISourceCode.Message.Level.ERROR) {
|
|
534
533
|
return {color: 'var(--icon-error)', width: '16px', height: '14px', iconName: 'cross-circle-filled'};
|
|
535
534
|
}
|
|
@@ -562,7 +561,7 @@ function messageLevelComparator(a: RowMessage, b: RowMessage): number {
|
|
|
562
561
|
return messageLevelPriority[a.level()] - messageLevelPriority[b.level()];
|
|
563
562
|
}
|
|
564
563
|
|
|
565
|
-
function getIconDataForMessage(message: RowMessage):
|
|
564
|
+
function getIconDataForMessage(message: RowMessage): IconWithName {
|
|
566
565
|
if (message.origin instanceof IssuesManager.SourceFrameIssuesManager.IssueMessage) {
|
|
567
566
|
return {iconName: IssueCounter.IssueCounter.getIssueKindIconName(message.origin.getIssueKind())};
|
|
568
567
|
}
|
|
@@ -743,8 +742,8 @@ class RowMessageDecorations {
|
|
|
743
742
|
}
|
|
744
743
|
}
|
|
745
744
|
|
|
746
|
-
function createIconFromIconData(data:
|
|
747
|
-
const icon = new
|
|
745
|
+
function createIconFromIconData(data: IconWithName): Icon {
|
|
746
|
+
const icon = new Icon();
|
|
748
747
|
icon.name = data.iconName;
|
|
749
748
|
if (data.width) {
|
|
750
749
|
icon.style.width = data.width;
|