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
|
@@ -37,6 +37,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
|
|
|
37
37
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
38
38
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
39
39
|
import * as uiI18n from '../../../../ui/i18n/i18n.js';
|
|
40
|
+
import * as Highlighting from '../../../components/highlighting/highlighting.js';
|
|
40
41
|
import * as TextEditor from '../../../components/text_editor/text_editor.js';
|
|
41
42
|
import {Directives, html, type LitTemplate, nothing, render} from '../../../lit/lit.js';
|
|
42
43
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
@@ -992,7 +993,7 @@ export const TREE_ELEMENT_DEFAULT_VIEW: TreeElementView = (input, output, target
|
|
|
992
993
|
export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
993
994
|
property: ObjectTreeNode;
|
|
994
995
|
override toggleOnClick: boolean;
|
|
995
|
-
private highlightChanges:
|
|
996
|
+
private highlightChanges: Highlighting.HighlightChange[];
|
|
996
997
|
private linkifier: Components.Linkifier.Linkifier|undefined;
|
|
997
998
|
private readonly maxNumPropertiesToShow: number;
|
|
998
999
|
readOnly!: boolean;
|
|
@@ -1115,7 +1116,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1115
1116
|
}
|
|
1116
1117
|
|
|
1117
1118
|
setSearchRegex(regex: RegExp, additionalCssClassName?: string): boolean {
|
|
1118
|
-
let cssClasses =
|
|
1119
|
+
let cssClasses = Highlighting.highlightedSearchResultClassName;
|
|
1119
1120
|
if (additionalCssClassName) {
|
|
1120
1121
|
cssClasses += ' ' + additionalCssClassName;
|
|
1121
1122
|
}
|
|
@@ -1144,7 +1145,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1144
1145
|
match = regex.exec(content);
|
|
1145
1146
|
}
|
|
1146
1147
|
if (ranges.length) {
|
|
1147
|
-
|
|
1148
|
+
Highlighting.highlightRangesWithStyleClass(element, ranges, cssClassName, this.highlightChanges);
|
|
1148
1149
|
}
|
|
1149
1150
|
}
|
|
1150
1151
|
|
|
@@ -1171,7 +1172,7 @@ export class ObjectPropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1171
1172
|
}
|
|
1172
1173
|
|
|
1173
1174
|
revertHighlightChanges(): void {
|
|
1174
|
-
|
|
1175
|
+
Highlighting.revertDomChanges(this.highlightChanges);
|
|
1175
1176
|
this.highlightChanges = [];
|
|
1176
1177
|
}
|
|
1177
1178
|
|
|
@@ -2,6 +2,17 @@
|
|
|
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
|
+
// This file supports the gutter decorations visible in the Sources panel when a
|
|
6
|
+
// performance trace is active, showing either the runtime sample measures or the
|
|
7
|
+
// memory sampling (memory is behind the LiveHeapProfile experiment).
|
|
8
|
+
//
|
|
9
|
+
// When profiles are added, the associated UISourceCodes are given the profile data
|
|
10
|
+
// as decorations. The raw profile locations are mapped to original source files in
|
|
11
|
+
// this way.
|
|
12
|
+
//
|
|
13
|
+
// Note, while this is called "LineLevel", it's the profile data is actually granular
|
|
14
|
+
// to the column.
|
|
15
|
+
|
|
5
16
|
import type * as Platform from '../../../../core/platform/platform.js';
|
|
6
17
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
7
18
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
@@ -29,8 +40,12 @@ export class Performance {
|
|
|
29
40
|
return performanceInstance;
|
|
30
41
|
}
|
|
31
42
|
|
|
32
|
-
|
|
43
|
+
initialize(profiles: CPUProfile.CPUProfileDataModel.CPUProfileDataModel[], target: SDK.Target.Target|null): void {
|
|
33
44
|
this.helper.reset();
|
|
45
|
+
for (const profile of profiles) {
|
|
46
|
+
this.appendCPUProfile(profile, target);
|
|
47
|
+
}
|
|
48
|
+
void this.helper.update();
|
|
34
49
|
}
|
|
35
50
|
|
|
36
51
|
private appendLegacyCPUProfile(
|
|
@@ -56,12 +71,13 @@ export class Performance {
|
|
|
56
71
|
}
|
|
57
72
|
}
|
|
58
73
|
|
|
59
|
-
appendCPUProfile(profile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel, target: SDK.Target.Target|null):
|
|
74
|
+
private appendCPUProfile(profile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel, target: SDK.Target.Target|null):
|
|
75
|
+
void {
|
|
60
76
|
if (!profile.lines) {
|
|
61
77
|
this.appendLegacyCPUProfile(profile, target);
|
|
62
|
-
this.helper.scheduleUpdate();
|
|
63
78
|
return;
|
|
64
79
|
}
|
|
80
|
+
|
|
65
81
|
if (!profile.samples || !profile.columns) {
|
|
66
82
|
return;
|
|
67
83
|
}
|
|
@@ -83,12 +99,12 @@ export class Performance {
|
|
|
83
99
|
const time = profile.timestamps[i] - profile.timestamps[i - 1];
|
|
84
100
|
this.helper.addLocationData(target, scriptIdOrUrl, {line, column}, time);
|
|
85
101
|
}
|
|
86
|
-
this.helper.scheduleUpdate();
|
|
87
102
|
}
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
let memoryInstance: Memory;
|
|
91
106
|
|
|
107
|
+
// Note: this is used only by LiveHeapProfile (a drawer panel) if the experiment is enabled.
|
|
92
108
|
export class Memory {
|
|
93
109
|
private readonly helper: Helper;
|
|
94
110
|
private constructor() {
|
|
@@ -108,12 +124,23 @@ export class Memory {
|
|
|
108
124
|
|
|
109
125
|
reset(): void {
|
|
110
126
|
this.helper.reset();
|
|
127
|
+
void this.helper.update();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
initialize(profilesAndTargets: Array<{
|
|
131
|
+
profile: Protocol.HeapProfiler.SamplingHeapProfile,
|
|
132
|
+
target: SDK.Target.Target,
|
|
133
|
+
}>): void {
|
|
134
|
+
this.helper.reset();
|
|
135
|
+
for (const {profile, target} of profilesAndTargets) {
|
|
136
|
+
this.appendHeapProfile(profile, target);
|
|
137
|
+
}
|
|
138
|
+
void this.helper.update();
|
|
111
139
|
}
|
|
112
140
|
|
|
113
|
-
appendHeapProfile(profile: Protocol.HeapProfiler.SamplingHeapProfile, target: SDK.Target.Target|null): void {
|
|
141
|
+
private appendHeapProfile(profile: Protocol.HeapProfiler.SamplingHeapProfile, target: SDK.Target.Target|null): void {
|
|
114
142
|
const helper = this.helper;
|
|
115
143
|
processNode(profile.head);
|
|
116
|
-
helper.scheduleUpdate();
|
|
117
144
|
|
|
118
145
|
function processNode(node: Protocol.HeapProfiler.SamplingHeapProfileNode): void {
|
|
119
146
|
node.children.forEach(processNode);
|
|
@@ -125,8 +152,8 @@ export class Memory {
|
|
|
125
152
|
return;
|
|
126
153
|
}
|
|
127
154
|
const line = node.callFrame.lineNumber + 1;
|
|
128
|
-
|
|
129
|
-
helper.addLocationData(target, script, {line, column
|
|
155
|
+
const column = node.callFrame.columnNumber + 1;
|
|
156
|
+
helper.addLocationData(target, script, {line, column}, node.selfSize);
|
|
130
157
|
}
|
|
131
158
|
}
|
|
132
159
|
}
|
|
@@ -134,13 +161,14 @@ export class Memory {
|
|
|
134
161
|
export class Helper {
|
|
135
162
|
private readonly type: Workspace.UISourceCode.DecoratorType;
|
|
136
163
|
private readonly locationPool = new Bindings.LiveLocation.LiveLocationPool();
|
|
137
|
-
|
|
164
|
+
|
|
138
165
|
/**
|
|
139
166
|
* Given a location in a script (with line and column numbers being 1-based) stores
|
|
140
167
|
* the time spent at that location in a performance profile.
|
|
141
168
|
*/
|
|
142
|
-
private locationData =
|
|
143
|
-
|
|
169
|
+
private locationData = new Map<
|
|
170
|
+
SDK.Target.Target|null,
|
|
171
|
+
Map<Platform.DevToolsPath.UrlString|number, Workspace.UISourceCode.LineColumnProfileMap>>();
|
|
144
172
|
constructor(type: Workspace.UISourceCode.DecoratorType) {
|
|
145
173
|
this.type = type;
|
|
146
174
|
this.reset();
|
|
@@ -149,7 +177,6 @@ export class Helper {
|
|
|
149
177
|
reset(): void {
|
|
150
178
|
// The second map uses string keys for script URLs and numbers for scriptId.
|
|
151
179
|
this.locationData = new Map();
|
|
152
|
-
this.scheduleUpdate();
|
|
153
180
|
}
|
|
154
181
|
|
|
155
182
|
/**
|
|
@@ -176,20 +203,10 @@ export class Helper {
|
|
|
176
203
|
lineData.set(column, (lineData.get(column) || 0) + data);
|
|
177
204
|
}
|
|
178
205
|
|
|
179
|
-
|
|
180
|
-
if (this.updateTimer) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
this.updateTimer = window.setTimeout(() => {
|
|
184
|
-
this.updateTimer = null;
|
|
185
|
-
void this.doUpdate();
|
|
186
|
-
}, 0);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
private async doUpdate(): Promise<void> {
|
|
206
|
+
async update(): Promise<void> {
|
|
190
207
|
this.locationPool.disposeAll();
|
|
191
208
|
// Map from sources to line->value profile maps.
|
|
192
|
-
const decorationsBySource
|
|
209
|
+
const decorationsBySource: Workspace.UISourceCode.ProfileDataMap = new Map();
|
|
193
210
|
const pending: Array<Promise<void>> = [];
|
|
194
211
|
for (const [target, scriptToLineMap] of this.locationData) {
|
|
195
212
|
const debuggerModel = target ? target.model(SDK.DebuggerModel.DebuggerModel) : null;
|
|
@@ -211,18 +228,21 @@ export class Helper {
|
|
|
211
228
|
String(scriptIdOrUrl) as Protocol.Runtime.ScriptId, zeroBasedLine, zeroBasedColumn || 0);
|
|
212
229
|
if (rawLocation) {
|
|
213
230
|
pending.push(workspaceBinding.rawLocationToUILocation(rawLocation).then(uiLocation => {
|
|
214
|
-
if (uiLocation) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
231
|
+
if (!uiLocation) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
this.addLineColumnData(
|
|
236
|
+
decorationsBySource, uiLocation.uiSourceCode, uiLocation.lineNumber + 1,
|
|
237
|
+
(uiLocation.columnNumber ?? 0) + 1, data);
|
|
238
|
+
|
|
239
|
+
// If the above was a source mapped UILocation, then we also need to add it to the generated UILocation.
|
|
240
|
+
if (uiLocation.uiSourceCode.contentType().isFromSourceMap()) {
|
|
241
|
+
const script = rawLocation.script();
|
|
242
|
+
const uiSourceCode = script ? workspaceBinding.uiSourceCodeForScript(script) : null;
|
|
243
|
+
if (uiSourceCode) {
|
|
244
|
+
this.addLineColumnData(decorationsBySource, uiSourceCode, lineNumber, columnNumber, data);
|
|
224
245
|
}
|
|
225
|
-
columnMap.set((zeroBasedColumn || 0) + 1, data);
|
|
226
246
|
}
|
|
227
247
|
}));
|
|
228
248
|
}
|
|
@@ -247,4 +267,22 @@ export class Helper {
|
|
|
247
267
|
}
|
|
248
268
|
}
|
|
249
269
|
}
|
|
270
|
+
|
|
271
|
+
private addLineColumnData(
|
|
272
|
+
decorationsBySource: Workspace.UISourceCode.ProfileDataMap, uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
273
|
+
lineOneIndexed: number, columnOneIndexed: number, data: number): void {
|
|
274
|
+
let lineMap = decorationsBySource.get(uiSourceCode);
|
|
275
|
+
if (!lineMap) {
|
|
276
|
+
lineMap = new Map();
|
|
277
|
+
decorationsBySource.set(uiSourceCode, lineMap);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
let columnMap = lineMap.get(lineOneIndexed);
|
|
281
|
+
if (!columnMap) {
|
|
282
|
+
columnMap = new Map();
|
|
283
|
+
lineMap.set(lineOneIndexed, columnMap);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
columnMap.set(columnOneIndexed, (columnMap.get(columnOneIndexed) ?? 0) + data);
|
|
287
|
+
}
|
|
250
288
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../../../core/host/host.js';
|
|
7
7
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
8
|
+
import type * as Protocol from '../../../../generated/protocol.js';
|
|
8
9
|
|
|
9
10
|
import {Memory} from './LineLevelProfile.js';
|
|
10
11
|
|
|
@@ -64,15 +65,23 @@ export class LiveHeapProfile implements Common.Runnable.Runnable,
|
|
|
64
65
|
if (sessionId !== this.sessionId) {
|
|
65
66
|
break;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
|
|
69
|
+
const profilesAndTargets: Array<{
|
|
70
|
+
profile: Protocol.HeapProfiler.SamplingHeapProfile,
|
|
71
|
+
target: SDK.Target.Target,
|
|
72
|
+
}> = [];
|
|
68
73
|
for (let i = 0; i < profiles.length; ++i) {
|
|
69
74
|
const profile = profiles[i];
|
|
70
75
|
if (!profile) {
|
|
71
76
|
continue;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
const target = models[i].target();
|
|
80
|
+
profilesAndTargets.push({profile, target});
|
|
75
81
|
}
|
|
82
|
+
|
|
83
|
+
Memory.instance().initialize(profilesAndTargets);
|
|
84
|
+
|
|
76
85
|
await Promise.race([
|
|
77
86
|
new Promise(r => window.setTimeout(r, Host.InspectorFrontendHost.isUnderTest() ? 10 : 5000)),
|
|
78
87
|
new Promise(r => {
|
|
@@ -7,7 +7,7 @@ import * as Common from '../../../../core/common/common.js';
|
|
|
7
7
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
8
8
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
9
9
|
import type * as NetworkTimeCalculator from '../../../../models/network_time_calculator/network_time_calculator.js';
|
|
10
|
-
import
|
|
10
|
+
import {createIcon, type Icon} from '../../../kit/kit.js';
|
|
11
11
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
12
12
|
import * as UI from '../../legacy.js';
|
|
13
13
|
|
|
@@ -137,7 +137,7 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
137
137
|
private breadcrumbButtonContainerElement: HTMLElement;
|
|
138
138
|
private createBreadcrumbButton: HTMLElement;
|
|
139
139
|
private curtainsRange?: HTMLElement;
|
|
140
|
-
private breadcrumbZoomIcon?:
|
|
140
|
+
private breadcrumbZoomIcon?: Icon;
|
|
141
141
|
|
|
142
142
|
private overviewWindowSelector!: WindowSelector|undefined;
|
|
143
143
|
private offsetLeft!: number;
|
|
@@ -213,7 +213,7 @@ export class Window extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
213
213
|
|
|
214
214
|
enableCreateBreadcrumbsButton(): HTMLElement {
|
|
215
215
|
this.curtainsRange = this.createBreadcrumbButton.createChild('div');
|
|
216
|
-
this.breadcrumbZoomIcon =
|
|
216
|
+
this.breadcrumbZoomIcon = createIcon('zoom-in');
|
|
217
217
|
this.createBreadcrumbButton.appendChild(this.breadcrumbZoomIcon);
|
|
218
218
|
this.createBreadcrumbButton.addEventListener('click', () => {
|
|
219
219
|
this.#createBreadcrumb();
|
|
@@ -2,12 +2,15 @@
|
|
|
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 '../../../kit/kit.js';
|
|
6
|
+
import '../../../components/highlighting/highlighting.js';
|
|
7
|
+
|
|
5
8
|
import * as Common from '../../../../core/common/common.js';
|
|
6
9
|
import * as Host from '../../../../core/host/host.js';
|
|
7
10
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
8
11
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
9
12
|
import * as Diff from '../../../../third_party/diff/diff.js';
|
|
10
|
-
import
|
|
13
|
+
import {html, nothing, type TemplateResult} from '../../../lit/lit.js';
|
|
11
14
|
import * as UI from '../../legacy.js';
|
|
12
15
|
|
|
13
16
|
import {FilteredListWidget, Provider, registerProvider} from './FilteredListWidget.js';
|
|
@@ -201,7 +204,7 @@ export class CommandMenu {
|
|
|
201
204
|
locations.set(name, category);
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
|
-
const views = UI.ViewManager.getRegisteredViewExtensions();
|
|
207
|
+
const views = UI.ViewManager.ViewManager.instance().getRegisteredViewExtensions();
|
|
205
208
|
for (const view of views) {
|
|
206
209
|
const viewLocation = view.location();
|
|
207
210
|
const category = viewLocation && locations.get(viewLocation);
|
|
@@ -340,37 +343,26 @@ export class CommandMenuProvider extends Provider {
|
|
|
340
343
|
return score;
|
|
341
344
|
}
|
|
342
345
|
|
|
343
|
-
override renderItem(itemIndex: number, query: string
|
|
346
|
+
override renderItem(itemIndex: number, query: string): TemplateResult {
|
|
344
347
|
const command = this.commands[itemIndex];
|
|
345
|
-
|
|
346
|
-
titleElement.removeChildren();
|
|
347
|
-
const icon = IconButton.Icon.create(categoryIcons[command.category]);
|
|
348
|
-
titleElement.parentElement?.parentElement?.insertBefore(icon, titleElement.parentElement);
|
|
349
|
-
UI.UIUtils.createTextChild(titleElement, command.title);
|
|
350
|
-
FilteredListWidget.highlightRanges(titleElement, query, true);
|
|
351
|
-
|
|
352
|
-
if (command.featurePromotionId) {
|
|
353
|
-
const badge = UI.UIUtils.maybeCreateNewBadge(command.featurePromotionId);
|
|
354
|
-
if (badge) {
|
|
355
|
-
titleElement.parentElement?.insertBefore(badge, subtitleElement);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
subtitleElement.textContent = command.shortcut;
|
|
360
|
-
|
|
348
|
+
const badge = command.featurePromotionId ? UI.UIUtils.maybeCreateNewBadge(command.featurePromotionId) : undefined;
|
|
361
349
|
const deprecationWarning = command.deprecationWarning;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
350
|
+
// clang-format off
|
|
351
|
+
return html`
|
|
352
|
+
<devtools-icon name=${categoryIcons[command.category]}></devtools-icon>
|
|
353
|
+
<div>
|
|
354
|
+
<devtools-highlight type="markup" ranges=${FilteredListWidget.getHighlightRanges(command.title, query, true)}>
|
|
355
|
+
${command.title}
|
|
356
|
+
</devtools-highlight>
|
|
357
|
+
${badge ?? nothing}
|
|
358
|
+
<div>${command.shortcut}</div>
|
|
359
|
+
${deprecationWarning ? html`
|
|
360
|
+
<span class="deprecated-tag" title=${deprecationWarning}>
|
|
361
|
+
${i18nString(UIStrings.deprecated)}
|
|
362
|
+
</span>` : nothing}
|
|
363
|
+
</div>
|
|
364
|
+
<span class="tag">${command.category}</span>`;
|
|
365
|
+
// clang-format on
|
|
374
366
|
}
|
|
375
367
|
|
|
376
368
|
override jslogContextAt(itemIndex: number): string {
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
4
|
+
/* eslint-disable @devtools/no-imperative-dom-api, @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
6
|
import * as Common from '../../../../core/common/common.js';
|
|
7
7
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
@@ -10,6 +10,7 @@ import * as Geometry from '../../../../models/geometry/geometry.js';
|
|
|
10
10
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
11
11
|
import * as Diff from '../../../../third_party/diff/diff.js';
|
|
12
12
|
import * as TextPrompt from '../../../../ui/components/text_prompt/text_prompt.js';
|
|
13
|
+
import {type LitTemplate, nothing, render} from '../../../lit/lit.js';
|
|
13
14
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
14
15
|
import * as UI from '../../legacy.js';
|
|
15
16
|
|
|
@@ -117,9 +118,9 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
117
118
|
this.queryChangedCallback = queryChangedCallback;
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
static
|
|
121
|
+
static getHighlightRanges(text: string, query: string, caseInsensitive?: boolean): string {
|
|
121
122
|
if (!query) {
|
|
122
|
-
return
|
|
123
|
+
return '';
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
function rangesForMatch(text: string, query: string): TextUtils.TextRange.SourceRange[]|null {
|
|
@@ -138,19 +139,11 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
138
139
|
return ranges;
|
|
139
140
|
}
|
|
140
141
|
|
|
141
|
-
if (element.textContent === null) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
const text = element.textContent;
|
|
145
142
|
let ranges = rangesForMatch(text, query);
|
|
146
143
|
if (!ranges || caseInsensitive) {
|
|
147
144
|
ranges = rangesForMatch(text.toUpperCase(), query.toUpperCase());
|
|
148
145
|
}
|
|
149
|
-
|
|
150
|
-
UI.UIUtils.highlightRangesWithStyleClass(element, ranges, 'highlight');
|
|
151
|
-
return true;
|
|
152
|
-
}
|
|
153
|
-
return false;
|
|
146
|
+
return ranges?.map(range => `${range.offset},${range.length}`).join(' ') || '';
|
|
154
147
|
}
|
|
155
148
|
|
|
156
149
|
setCommandPrefix(commandPrefix: string): void {
|
|
@@ -282,20 +275,14 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
282
275
|
|
|
283
276
|
createElementForItem(item: number): Element {
|
|
284
277
|
const wrapperElement = document.createElement('div');
|
|
285
|
-
wrapperElement.className = 'filtered-list-widget-item
|
|
286
|
-
|
|
287
|
-
const itemElement = wrapperElement.createChild('div');
|
|
288
|
-
const renderAsTwoRows = this.provider?.renderAsTwoRows();
|
|
289
|
-
itemElement.className = 'filtered-list-widget-item ' + (renderAsTwoRows ? 'two-rows' : 'one-row');
|
|
290
|
-
const titleElement = itemElement.createChild('div', 'filtered-list-widget-title');
|
|
291
|
-
const subtitleElement = itemElement.createChild('div', 'filtered-list-widget-subtitle');
|
|
292
|
-
subtitleElement.textContent = '\u200B';
|
|
278
|
+
wrapperElement.className = 'filtered-list-widget-item';
|
|
279
|
+
|
|
293
280
|
if (this.provider) {
|
|
294
|
-
this.provider.renderItem(item, this.cleanValue(),
|
|
281
|
+
render(this.provider.renderItem(item, this.cleanValue()), wrapperElement);
|
|
295
282
|
wrapperElement.setAttribute(
|
|
296
283
|
'jslog', `${VisualLogging.item(this.provider.jslogContextAt(item)).track({click: true})}`);
|
|
297
284
|
}
|
|
298
|
-
UI.ARIAUtils.markAsOption(
|
|
285
|
+
UI.ARIAUtils.markAsOption(wrapperElement);
|
|
299
286
|
return wrapperElement;
|
|
300
287
|
}
|
|
301
288
|
|
|
@@ -627,17 +614,14 @@ export class Provider {
|
|
|
627
614
|
return 1;
|
|
628
615
|
}
|
|
629
616
|
|
|
630
|
-
renderItem(_itemIndex: number, _query: string
|
|
617
|
+
renderItem(_itemIndex: number, _query: string): LitTemplate {
|
|
618
|
+
return nothing;
|
|
631
619
|
}
|
|
632
620
|
|
|
633
621
|
jslogContextAt(_itemIndex: number): string {
|
|
634
622
|
return this.jslogContext;
|
|
635
623
|
}
|
|
636
624
|
|
|
637
|
-
renderAsTwoRows(): boolean {
|
|
638
|
-
return false;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
625
|
selectItem(_itemIndex: number|null, _promptValue: string): void {
|
|
642
626
|
}
|
|
643
627
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Copyright 2017 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
|
-
import
|
|
7
|
-
|
|
5
|
+
import '../../../kit/kit.js';
|
|
6
|
+
|
|
7
|
+
import {html, type TemplateResult} from '../../../lit/lit.js';
|
|
8
8
|
|
|
9
9
|
import {getRegisteredProviders, Provider, type ProviderRegistration, registerProvider} from './FilteredListWidget.js';
|
|
10
10
|
import {QuickOpenImpl} from './QuickOpen.js';
|
|
@@ -44,15 +44,15 @@ export class HelpQuickOpen extends Provider {
|
|
|
44
44
|
return -this.providers[itemIndex].prefix.length;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
override renderItem(itemIndex: number, _query: string
|
|
47
|
+
override renderItem(itemIndex: number, _query: string): TemplateResult {
|
|
48
48
|
const provider = this.providers[itemIndex];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
// clang-format off
|
|
50
|
+
return html`
|
|
51
|
+
<devtools-icon class="large" name=${provider.iconName}></devtools-icon>
|
|
52
|
+
<div>
|
|
53
|
+
<div>${provider.title}</div>
|
|
54
|
+
</div>`;
|
|
55
|
+
// clang-format on
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
override jslogContextAt(itemIndex: number): string {
|
|
@@ -64,10 +64,6 @@ export class HelpQuickOpen extends Provider {
|
|
|
64
64
|
QuickOpenImpl.show(this.providers[itemIndex].prefix);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
override renderAsTwoRows(): boolean {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
registerProvider({
|
|
@@ -58,16 +58,20 @@ devtools-text-prompt {
|
|
|
58
58
|
overflow: hidden auto;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.filtered-list-widget-item
|
|
61
|
+
.filtered-list-widget-item {
|
|
62
62
|
color: var(--sys-color-on-surface);
|
|
63
63
|
display: flex;
|
|
64
64
|
font-family: ".SFNSDisplay-Regular", "Helvetica Neue", "Lucida Grande", sans-serif;
|
|
65
65
|
padding: 0 var(--sys-size-7);
|
|
66
66
|
gap: var(--sys-size-7);
|
|
67
67
|
height: var(--sys-size-14);
|
|
68
|
+
white-space: break-spaces;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
font-size: var(--sys-typescale-body4-size);
|
|
68
72
|
}
|
|
69
73
|
|
|
70
|
-
.filtered-list-widget-item
|
|
74
|
+
.filtered-list-widget-item devtools-icon {
|
|
71
75
|
align-self: center;
|
|
72
76
|
flex: none;
|
|
73
77
|
width: 18px;
|
|
@@ -78,84 +82,38 @@ devtools-text-prompt {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
.filtered-list-widget-item
|
|
85
|
+
.filtered-list-widget-item.selected {
|
|
82
86
|
background-color: var(--sys-color-state-hover-on-subtle);
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
.filtered-list-widget-item {
|
|
86
|
-
white-space: break-spaces;
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
text-overflow: ellipsis;
|
|
89
|
-
align-self: center;
|
|
90
|
-
font-size: var(--sys-typescale-body4-size);
|
|
89
|
+
.filtered-list-widget-item > div {
|
|
91
90
|
flex: auto;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.filtered-list-widget-item.is-ignore-listed * {
|
|
95
|
-
color: var(--sys-color-state-disabled);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.filtered-list-widget-item span.highlight {
|
|
99
|
-
font-weight: var(--ref-typeface-weight-bold);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.filtered-list-widget-item .filtered-list-widget-title {
|
|
103
91
|
white-space: nowrap;
|
|
104
|
-
flex: initial;
|
|
105
92
|
overflow: hidden;
|
|
106
93
|
text-overflow: ellipsis;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
flex: none;
|
|
111
|
-
overflow: hidden;
|
|
112
|
-
text-overflow: ellipsis;
|
|
113
|
-
color: var(--sys-color-on-surface-subtle);
|
|
114
|
-
padding-left: var(--sys-size-3);
|
|
94
|
+
line-height: var(--sys-typescale-body3-line-height);
|
|
95
|
+
align-items: center;
|
|
96
|
+
align-content: center;
|
|
115
97
|
display: flex;
|
|
116
|
-
|
|
98
|
+
gap: var(--sys-size-4);
|
|
117
99
|
}
|
|
118
100
|
|
|
119
|
-
.filtered-list-widget-item .
|
|
120
|
-
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
text-overflow: ellipsis;
|
|
101
|
+
.filtered-list-widget-item span.highlight {
|
|
102
|
+
font-weight: var(--ref-typeface-weight-bold);
|
|
123
103
|
}
|
|
124
104
|
|
|
125
|
-
.filtered-list-widget-item
|
|
105
|
+
.filtered-list-widget-item .tag {
|
|
126
106
|
font-size: var(--sys-typescale-body5-size);
|
|
127
107
|
line-height: var(--sys-typescale-headline5-line-height);
|
|
128
108
|
align-self: center;
|
|
129
109
|
flex-shrink: 0;
|
|
130
110
|
}
|
|
131
111
|
|
|
132
|
-
.filtered-list-widget-item
|
|
112
|
+
.filtered-list-widget-item .deprecated-tag {
|
|
133
113
|
font-size: 11px;
|
|
134
114
|
color: var(--sys-color-token-subtle);
|
|
135
115
|
}
|
|
136
116
|
|
|
137
|
-
.filtered-list-widget-item.one-row {
|
|
138
|
-
line-height: var(--sys-typescale-body3-line-height);
|
|
139
|
-
align-items: center;
|
|
140
|
-
align-content: center;
|
|
141
|
-
display: flex;
|
|
142
|
-
gap: var(--sys-size-4);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.filtered-list-widget-item.one-row .filtered-list-widget-title {
|
|
146
|
-
display: inline;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.filtered-list-widget-item.two-rows {
|
|
150
|
-
display: grid;
|
|
151
|
-
align-content: center;
|
|
152
|
-
gap: var(--sys-size-2);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.filtered-list-widget-item-wrapper:not(.search-mode) .filtered-list-widget-item.two-rows .filtered-list-widget-title {
|
|
156
|
-
font-weight: var(--ref-typeface-weight-bold);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
117
|
.not-found-text {
|
|
160
118
|
height: 34px;
|
|
161
119
|
line-height: 34px;
|
|
@@ -179,18 +137,13 @@ devtools-text-prompt {
|
|
|
179
137
|
border-color: ButtonText;
|
|
180
138
|
}
|
|
181
139
|
|
|
182
|
-
.filtered-list-widget-item
|
|
183
|
-
.filtered-list-widget-item-wrapper .filtered-list-widget-subtitle,
|
|
140
|
+
.filtered-list-widget-item,
|
|
184
141
|
.quickpick-description {
|
|
185
142
|
color: ButtonText;
|
|
186
143
|
}
|
|
187
144
|
|
|
188
|
-
.filtered-list-widget-item
|
|
145
|
+
.filtered-list-widget-item.selected {
|
|
189
146
|
background-color: Highlight;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.filtered-list-widget-item-wrapper.selected .filtered-list-widget-item .filtered-list-widget-title,
|
|
193
|
-
.filtered-list-widget-item-wrapper.selected .filtered-list-widget-item .filtered-list-widget-subtitle {
|
|
194
147
|
color: HighlightText;
|
|
195
148
|
}
|
|
196
149
|
|