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
|
@@ -41,9 +41,8 @@ import * as Host from '../../core/host/host.js';
|
|
|
41
41
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
42
42
|
import * as Platform from '../../core/platform/platform.js';
|
|
43
43
|
import * as Geometry from '../../models/geometry/geometry.js';
|
|
44
|
-
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
45
44
|
import * as Buttons from '../components/buttons/buttons.js';
|
|
46
|
-
import
|
|
45
|
+
import {Icon, type IconData} from '../kit/kit.js';
|
|
47
46
|
import * as Lit from '../lit/lit.js';
|
|
48
47
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
49
48
|
|
|
@@ -125,9 +124,6 @@ const UIStrings = {
|
|
|
125
124
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/UIUtils.ts', UIStrings);
|
|
126
125
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
127
126
|
|
|
128
|
-
export const highlightedSearchResultClassName = 'highlighted-search-result';
|
|
129
|
-
export const highlightedCurrentSearchResultClassName = 'current-search-result';
|
|
130
|
-
|
|
131
127
|
export function installDragHandle(
|
|
132
128
|
element: Element, elementDragStart: ((arg0: MouseEvent) => boolean)|null, elementDrag: (arg0: MouseEvent) => void,
|
|
133
129
|
elementDragEnd: ((arg0: MouseEvent) => void)|null, cursor: string|null, hoverCursor?: string|null,
|
|
@@ -698,17 +694,6 @@ export class ElementFocusRestorer {
|
|
|
698
694
|
}
|
|
699
695
|
}
|
|
700
696
|
|
|
701
|
-
export function highlightSearchResult(
|
|
702
|
-
element: Element, offset: number, length: number, domChanges?: HighlightChange[]): Element|null {
|
|
703
|
-
const result = highlightSearchResults(element, [new TextUtils.TextRange.SourceRange(offset, length)], domChanges);
|
|
704
|
-
return result.length ? result[0] : null;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
export function highlightSearchResults(
|
|
708
|
-
element: Element, resultRanges: TextUtils.TextRange.SourceRange[], changes?: HighlightChange[]): Element[] {
|
|
709
|
-
return highlightRangesWithStyleClass(element, resultRanges, highlightedSearchResultClassName, changes);
|
|
710
|
-
}
|
|
711
|
-
|
|
712
697
|
export function runCSSAnimationOnce(element: Element, className: string): void {
|
|
713
698
|
function animationEndCallback(): void {
|
|
714
699
|
element.classList.remove(className);
|
|
@@ -725,166 +710,6 @@ export function runCSSAnimationOnce(element: Element, className: string): void {
|
|
|
725
710
|
element.classList.add(className);
|
|
726
711
|
}
|
|
727
712
|
|
|
728
|
-
export function highlightRangesWithStyleClass(
|
|
729
|
-
element: Element, resultRanges: TextUtils.TextRange.SourceRange[], styleClass: string,
|
|
730
|
-
changes?: HighlightChange[]): Element[] {
|
|
731
|
-
changes = changes || [];
|
|
732
|
-
const highlightNodes: Element[] = [];
|
|
733
|
-
const textNodes = element.childTextNodes();
|
|
734
|
-
const lineText = textNodes
|
|
735
|
-
.map(function(node) {
|
|
736
|
-
return node.textContent;
|
|
737
|
-
})
|
|
738
|
-
.join('');
|
|
739
|
-
const ownerDocument = element.ownerDocument;
|
|
740
|
-
|
|
741
|
-
if (textNodes.length === 0) {
|
|
742
|
-
return highlightNodes;
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
const nodeRanges: TextUtils.TextRange.SourceRange[] = [];
|
|
746
|
-
let rangeEndOffset = 0;
|
|
747
|
-
for (const textNode of textNodes) {
|
|
748
|
-
const range =
|
|
749
|
-
new TextUtils.TextRange.SourceRange(rangeEndOffset, textNode.textContent ? textNode.textContent.length : 0);
|
|
750
|
-
rangeEndOffset = range.offset + range.length;
|
|
751
|
-
nodeRanges.push(range);
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
let startIndex = 0;
|
|
755
|
-
for (let i = 0; i < resultRanges.length; ++i) {
|
|
756
|
-
const startOffset = resultRanges[i].offset;
|
|
757
|
-
const endOffset = startOffset + resultRanges[i].length;
|
|
758
|
-
|
|
759
|
-
while (startIndex < textNodes.length &&
|
|
760
|
-
nodeRanges[startIndex].offset + nodeRanges[startIndex].length <= startOffset) {
|
|
761
|
-
startIndex++;
|
|
762
|
-
}
|
|
763
|
-
let endIndex = startIndex;
|
|
764
|
-
while (endIndex < textNodes.length && nodeRanges[endIndex].offset + nodeRanges[endIndex].length < endOffset) {
|
|
765
|
-
endIndex++;
|
|
766
|
-
}
|
|
767
|
-
if (endIndex === textNodes.length) {
|
|
768
|
-
break;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
const highlightNode = ownerDocument.createElement('span');
|
|
772
|
-
highlightNode.className = styleClass;
|
|
773
|
-
highlightNode.textContent = lineText.substring(startOffset, endOffset);
|
|
774
|
-
|
|
775
|
-
const lastTextNode = textNodes[endIndex];
|
|
776
|
-
const lastText = lastTextNode.textContent || '';
|
|
777
|
-
lastTextNode.textContent = lastText.substring(endOffset - nodeRanges[endIndex].offset);
|
|
778
|
-
changes.push({
|
|
779
|
-
node: (lastTextNode as Element),
|
|
780
|
-
type: 'changed',
|
|
781
|
-
oldText: lastText,
|
|
782
|
-
newText: lastTextNode.textContent,
|
|
783
|
-
nextSibling: undefined,
|
|
784
|
-
parent: undefined,
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
if (startIndex === endIndex && lastTextNode.parentElement) {
|
|
788
|
-
lastTextNode.parentElement.insertBefore(highlightNode, lastTextNode);
|
|
789
|
-
changes.push({
|
|
790
|
-
node: highlightNode,
|
|
791
|
-
type: 'added',
|
|
792
|
-
nextSibling: lastTextNode,
|
|
793
|
-
parent: lastTextNode.parentElement,
|
|
794
|
-
oldText: undefined,
|
|
795
|
-
newText: undefined,
|
|
796
|
-
});
|
|
797
|
-
highlightNodes.push(highlightNode);
|
|
798
|
-
|
|
799
|
-
const prefixNode =
|
|
800
|
-
ownerDocument.createTextNode(lastText.substring(0, startOffset - nodeRanges[startIndex].offset));
|
|
801
|
-
lastTextNode.parentElement.insertBefore(prefixNode, highlightNode);
|
|
802
|
-
changes.push({
|
|
803
|
-
node: prefixNode,
|
|
804
|
-
type: 'added',
|
|
805
|
-
nextSibling: highlightNode,
|
|
806
|
-
parent: lastTextNode.parentElement,
|
|
807
|
-
oldText: undefined,
|
|
808
|
-
newText: undefined,
|
|
809
|
-
});
|
|
810
|
-
} else {
|
|
811
|
-
const firstTextNode = textNodes[startIndex];
|
|
812
|
-
const firstText = firstTextNode.textContent || '';
|
|
813
|
-
const anchorElement = firstTextNode.nextSibling;
|
|
814
|
-
|
|
815
|
-
if (firstTextNode.parentElement) {
|
|
816
|
-
firstTextNode.parentElement.insertBefore(highlightNode, anchorElement);
|
|
817
|
-
changes.push({
|
|
818
|
-
node: highlightNode,
|
|
819
|
-
type: 'added',
|
|
820
|
-
nextSibling: anchorElement || undefined,
|
|
821
|
-
parent: firstTextNode.parentElement,
|
|
822
|
-
oldText: undefined,
|
|
823
|
-
newText: undefined,
|
|
824
|
-
});
|
|
825
|
-
highlightNodes.push(highlightNode);
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
firstTextNode.textContent = firstText.substring(0, startOffset - nodeRanges[startIndex].offset);
|
|
829
|
-
changes.push({
|
|
830
|
-
node: (firstTextNode as Element),
|
|
831
|
-
type: 'changed',
|
|
832
|
-
oldText: firstText,
|
|
833
|
-
newText: firstTextNode.textContent,
|
|
834
|
-
nextSibling: undefined,
|
|
835
|
-
parent: undefined,
|
|
836
|
-
});
|
|
837
|
-
|
|
838
|
-
for (let j = startIndex + 1; j < endIndex; j++) {
|
|
839
|
-
const textNode = textNodes[j];
|
|
840
|
-
const text = textNode.textContent;
|
|
841
|
-
textNode.textContent = '';
|
|
842
|
-
changes.push({
|
|
843
|
-
node: (textNode as Element),
|
|
844
|
-
type: 'changed',
|
|
845
|
-
oldText: text || undefined,
|
|
846
|
-
newText: textNode.textContent,
|
|
847
|
-
nextSibling: undefined,
|
|
848
|
-
parent: undefined,
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
startIndex = endIndex;
|
|
853
|
-
nodeRanges[startIndex].offset = endOffset;
|
|
854
|
-
nodeRanges[startIndex].length = lastTextNode.textContent.length;
|
|
855
|
-
}
|
|
856
|
-
return highlightNodes;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
/** Used in chromium/src/third_party/blink/web_tests/http/tests/devtools/components/utilities-highlight-results.js **/
|
|
860
|
-
export function applyDomChanges(domChanges: HighlightChange[]): void {
|
|
861
|
-
for (let i = 0, size = domChanges.length; i < size; ++i) {
|
|
862
|
-
const entry = domChanges[i];
|
|
863
|
-
switch (entry.type) {
|
|
864
|
-
case 'added':
|
|
865
|
-
entry.parent?.insertBefore(entry.node, entry.nextSibling ?? null);
|
|
866
|
-
break;
|
|
867
|
-
case 'changed':
|
|
868
|
-
entry.node.textContent = entry.newText ?? null;
|
|
869
|
-
break;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
export function revertDomChanges(domChanges: HighlightChange[]): void {
|
|
875
|
-
for (let i = domChanges.length - 1; i >= 0; --i) {
|
|
876
|
-
const entry = domChanges[i];
|
|
877
|
-
switch (entry.type) {
|
|
878
|
-
case 'added':
|
|
879
|
-
entry.node.remove();
|
|
880
|
-
break;
|
|
881
|
-
case 'changed':
|
|
882
|
-
entry.node.textContent = entry.oldText ?? null;
|
|
883
|
-
break;
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
713
|
export function measurePreferredSize(element: Element, containerElement?: Element|null): Geometry.Size {
|
|
889
714
|
const oldParent = element.parentElement;
|
|
890
715
|
const oldNextSibling = element.nextSibling;
|
|
@@ -1456,19 +1281,19 @@ export class CheckboxLabel extends HTMLElement {
|
|
|
1456
1281
|
customElements.define('devtools-checkbox', CheckboxLabel);
|
|
1457
1282
|
|
|
1458
1283
|
export class DevToolsIconLabel extends HTMLElement {
|
|
1459
|
-
readonly #icon:
|
|
1284
|
+
readonly #icon: Icon;
|
|
1460
1285
|
|
|
1461
1286
|
constructor() {
|
|
1462
1287
|
super();
|
|
1463
1288
|
const root = createShadowRootWithCoreStyles(this);
|
|
1464
|
-
this.#icon = new
|
|
1289
|
+
this.#icon = new Icon();
|
|
1465
1290
|
this.#icon.style.setProperty('margin-right', '4px');
|
|
1466
1291
|
this.#icon.style.setProperty('vertical-align', 'baseline');
|
|
1467
1292
|
root.appendChild(this.#icon);
|
|
1468
1293
|
root.createChild('slot');
|
|
1469
1294
|
}
|
|
1470
1295
|
|
|
1471
|
-
set data(data:
|
|
1296
|
+
set data(data: IconData) {
|
|
1472
1297
|
this.#icon.data = data;
|
|
1473
1298
|
// TODO(crbug.com/1427397): Clean this up. This was necessary so `DevToolsIconLabel` can use Lit icon
|
|
1474
1299
|
// while being backwards-compatible with the legacy Icon while working for both small and large icons.
|
|
@@ -1802,15 +1627,6 @@ export interface Options {
|
|
|
1802
1627
|
expand?: boolean;
|
|
1803
1628
|
}
|
|
1804
1629
|
|
|
1805
|
-
export interface HighlightChange {
|
|
1806
|
-
node: Element|Text;
|
|
1807
|
-
type: string;
|
|
1808
|
-
oldText?: string;
|
|
1809
|
-
newText?: string;
|
|
1810
|
-
nextSibling?: Node;
|
|
1811
|
-
parent?: Node;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
1630
|
export const isScrolledToBottom = (element: Element): boolean => {
|
|
1815
1631
|
// This code works only for 0-width border.
|
|
1816
1632
|
// The scrollTop, clientHeight and scrollHeight are computed in double values internally.
|
|
@@ -10,7 +10,8 @@ import * as Host from '../../core/host/host.js';
|
|
|
10
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
11
11
|
import * as Platform from '../../core/platform/platform.js';
|
|
12
12
|
import * as Root from '../../core/root/root.js';
|
|
13
|
-
import * as
|
|
13
|
+
import type * as Foundation from '../../foundation/foundation.js';
|
|
14
|
+
import {createIcon, type Icon} from '../kit/kit.js';
|
|
14
15
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
15
16
|
|
|
16
17
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
@@ -52,10 +53,12 @@ export const defaultOptionsForTabs = {
|
|
|
52
53
|
|
|
53
54
|
export class PreRegisteredView implements View {
|
|
54
55
|
private readonly viewRegistration: ViewRegistration;
|
|
56
|
+
private readonly universe?: Foundation.Universe.Universe;
|
|
55
57
|
private widgetPromise: Promise<Widget>|null;
|
|
56
58
|
|
|
57
|
-
constructor(viewRegistration: ViewRegistration) {
|
|
59
|
+
constructor(viewRegistration: ViewRegistration, universe?: Foundation.Universe.Universe) {
|
|
58
60
|
this.viewRegistration = viewRegistration;
|
|
61
|
+
this.universe = universe;
|
|
59
62
|
this.widgetPromise = null;
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -124,7 +127,10 @@ export class PreRegisteredView implements View {
|
|
|
124
127
|
|
|
125
128
|
widget(): Promise<Widget> {
|
|
126
129
|
if (this.widgetPromise === null) {
|
|
127
|
-
|
|
130
|
+
if (!this.universe) {
|
|
131
|
+
throw new Error('Creating views via ViewManager requires a Foundation.Universe');
|
|
132
|
+
}
|
|
133
|
+
this.widgetPromise = this.viewRegistration.loadView(this.universe);
|
|
128
134
|
}
|
|
129
135
|
return this.widgetPromise;
|
|
130
136
|
}
|
|
@@ -168,7 +174,11 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
168
174
|
private readonly locationNameByViewId = new Map<string, string>();
|
|
169
175
|
private readonly locationOverrideSetting: Common.Settings.Setting<Record<string, string>>;
|
|
170
176
|
|
|
171
|
-
private
|
|
177
|
+
private readonly preRegisteredViews: PreRegisteredView[] = [];
|
|
178
|
+
|
|
179
|
+
// TODO(crbug.com/458180550): Pass the universe unconditionally once tests no longer rely
|
|
180
|
+
// on `instance()` to create ViewManagers lazily in after/afterEach blocks.
|
|
181
|
+
private constructor(universe?: Foundation.Universe.Universe) {
|
|
172
182
|
super();
|
|
173
183
|
|
|
174
184
|
// Read override setting for location
|
|
@@ -180,9 +190,9 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
180
190
|
|
|
181
191
|
const viewsByLocation = new Map<ViewLocationValues|'none', PreRegisteredView[]>();
|
|
182
192
|
for (const view of getRegisteredViewExtensions()) {
|
|
183
|
-
const location = view.location
|
|
193
|
+
const location = view.location || 'none';
|
|
184
194
|
const views = viewsByLocation.get(location) || [];
|
|
185
|
-
views.push(view);
|
|
195
|
+
views.push(new PreRegisteredView(view, universe));
|
|
186
196
|
viewsByLocation.set(location, views);
|
|
187
197
|
}
|
|
188
198
|
|
|
@@ -209,6 +219,7 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
209
219
|
throw new Error(`Invalid view ID '${viewId}'`);
|
|
210
220
|
}
|
|
211
221
|
this.views.set(viewId, view);
|
|
222
|
+
this.preRegisteredViews.push(view);
|
|
212
223
|
// Use the preferred user location if available
|
|
213
224
|
const locationName = preferredExtensionLocations[viewId] || location;
|
|
214
225
|
this.locationNameByViewId.set(viewId, locationName as string);
|
|
@@ -217,10 +228,11 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
217
228
|
|
|
218
229
|
static instance(opts: {
|
|
219
230
|
forceNew: boolean|null,
|
|
231
|
+
universe?: Foundation.Universe.Universe,
|
|
220
232
|
} = {forceNew: null}): ViewManager {
|
|
221
|
-
const {forceNew} = opts;
|
|
233
|
+
const {forceNew, universe} = opts;
|
|
222
234
|
if (!viewManagerInstance || forceNew) {
|
|
223
|
-
viewManagerInstance = new ViewManager();
|
|
235
|
+
viewManagerInstance = new ViewManager(universe);
|
|
224
236
|
}
|
|
225
237
|
|
|
226
238
|
return viewManagerInstance;
|
|
@@ -241,6 +253,10 @@ export class ViewManager extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
241
253
|
return toolbar;
|
|
242
254
|
}
|
|
243
255
|
|
|
256
|
+
getRegisteredViewExtensions(): PreRegisteredView[] {
|
|
257
|
+
return this.preRegisteredViews;
|
|
258
|
+
}
|
|
259
|
+
|
|
244
260
|
locationNameForViewId(viewId: string): string {
|
|
245
261
|
const locationName = this.locationNameByViewId.get(viewId);
|
|
246
262
|
if (!locationName) {
|
|
@@ -456,7 +472,7 @@ export class ContainerWidget extends VBox {
|
|
|
456
472
|
|
|
457
473
|
class ExpandableContainerWidget extends VBox {
|
|
458
474
|
private titleElement: HTMLDivElement;
|
|
459
|
-
private readonly titleExpandIcon:
|
|
475
|
+
private readonly titleExpandIcon: Icon;
|
|
460
476
|
private readonly view: View;
|
|
461
477
|
private widget?: Widget;
|
|
462
478
|
private materializePromise?: Promise<void>;
|
|
@@ -473,7 +489,7 @@ class ExpandableContainerWidget extends VBox {
|
|
|
473
489
|
keydown: 'Enter|Space|ArrowLeft|ArrowRight',
|
|
474
490
|
})}`);
|
|
475
491
|
ARIAUtils.markAsTreeitem(this.titleElement);
|
|
476
|
-
this.titleExpandIcon =
|
|
492
|
+
this.titleExpandIcon = createIcon('triangle-right', 'title-expand-icon');
|
|
477
493
|
this.titleElement.appendChild(this.titleExpandIcon);
|
|
478
494
|
const titleText = view.title();
|
|
479
495
|
createTextChild(this.titleElement, titleText);
|
|
@@ -793,7 +809,7 @@ class TabbedLocation extends Location implements TabbedViewLocation {
|
|
|
793
809
|
view.isCloseable() || view.isTransient(), view.isPreviewFeature(), index);
|
|
794
810
|
const iconName = view.iconName();
|
|
795
811
|
if (iconName) {
|
|
796
|
-
const icon =
|
|
812
|
+
const icon = createIcon(iconName);
|
|
797
813
|
this.#tabbedPane.setTabIcon(view.viewId(), icon);
|
|
798
814
|
}
|
|
799
815
|
}
|
|
@@ -1004,7 +1020,6 @@ class StackLocation extends Location implements ViewLocation {
|
|
|
1004
1020
|
export {
|
|
1005
1021
|
getLocalizedViewLocationCategory,
|
|
1006
1022
|
getRegisteredLocationResolvers,
|
|
1007
|
-
getRegisteredViewExtensions,
|
|
1008
1023
|
maybeRemoveViewExtension,
|
|
1009
1024
|
registerLocationResolver,
|
|
1010
1025
|
registerViewExtension,
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
6
|
import type * as Platform from '../../core/platform/platform.js';
|
|
7
7
|
import * as Root from '../../core/root/root.js';
|
|
8
|
+
import type * as Foundation from '../../foundation/foundation.js';
|
|
8
9
|
|
|
9
10
|
import type {ViewLocationResolver} from './View.js';
|
|
10
|
-
import {PreRegisteredView} from './ViewManager.js';
|
|
11
11
|
import type {Widget} from './Widget.js';
|
|
12
12
|
|
|
13
13
|
const UIStrings = {
|
|
@@ -43,8 +43,6 @@ const UIStrings = {
|
|
|
43
43
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/ViewRegistration.ts', UIStrings);
|
|
44
44
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
45
45
|
|
|
46
|
-
const registeredViewExtensions: PreRegisteredView[] = [];
|
|
47
|
-
|
|
48
46
|
export const enum ViewPersistence {
|
|
49
47
|
CLOSEABLE = 'closeable',
|
|
50
48
|
PERMANENT = 'permanent',
|
|
@@ -115,7 +113,11 @@ export interface ViewRegistration {
|
|
|
115
113
|
/**
|
|
116
114
|
* Returns an instance of the class that wraps the view.
|
|
117
115
|
* The common pattern for implementing this function is loading the module with the wrapping 'Widget'
|
|
118
|
-
* lazily loaded.
|
|
116
|
+
* lazily loaded.
|
|
117
|
+
* The DevTools universe is passed along, allowing `loadView` to retrieve necessary dependencies.
|
|
118
|
+
* Prefer passing individual dependencies one by one instead of forwarding the full universe. This
|
|
119
|
+
* makes testing easier.
|
|
120
|
+
* As an example:
|
|
119
121
|
*
|
|
120
122
|
* ```js
|
|
121
123
|
* let loadedElementsModule;
|
|
@@ -129,15 +131,16 @@ export interface ViewRegistration {
|
|
|
129
131
|
* }
|
|
130
132
|
* UI.ViewManager.registerViewExtension({
|
|
131
133
|
* <...>
|
|
132
|
-
* async loadView() {
|
|
134
|
+
* async loadView(universe) {
|
|
133
135
|
* const Elements = await loadElementsModule();
|
|
134
|
-
*
|
|
136
|
+
* const pageResourceLoader = universe.context.get(SDK.PageResourceLoader.PageResourceLoader);
|
|
137
|
+
* return new Elements.ElementsPanel.ElementsPanel(pageResourceLoader);
|
|
135
138
|
* },
|
|
136
139
|
* <...>
|
|
137
140
|
* });
|
|
138
141
|
* ```
|
|
139
142
|
*/
|
|
140
|
-
loadView: () => Promise<Widget>;
|
|
143
|
+
loadView: (universe: Foundation.Universe.Universe) => Promise<Widget>;
|
|
141
144
|
/**
|
|
142
145
|
* Used to sort the views that appear in a shared location.
|
|
143
146
|
*/
|
|
@@ -160,28 +163,25 @@ export interface ViewRegistration {
|
|
|
160
163
|
featurePromotionId?: string;
|
|
161
164
|
}
|
|
162
165
|
|
|
163
|
-
const
|
|
166
|
+
const registeredViewExtensions = new Map<string, ViewRegistration>();
|
|
167
|
+
|
|
164
168
|
export function registerViewExtension(registration: ViewRegistration): void {
|
|
165
169
|
const viewId = registration.id;
|
|
166
|
-
if (
|
|
170
|
+
if (registeredViewExtensions.has(viewId)) {
|
|
167
171
|
throw new Error(`Duplicate view id '${viewId}'`);
|
|
168
172
|
}
|
|
169
|
-
|
|
170
|
-
registeredViewExtensions.push(new PreRegisteredView(registration));
|
|
173
|
+
registeredViewExtensions.set(viewId, registration);
|
|
171
174
|
}
|
|
172
175
|
|
|
173
|
-
export function getRegisteredViewExtensions():
|
|
174
|
-
return registeredViewExtensions.
|
|
175
|
-
|
|
176
|
+
export function getRegisteredViewExtensions(): ViewRegistration[] {
|
|
177
|
+
return registeredViewExtensions.values()
|
|
178
|
+
.filter(
|
|
179
|
+
view => Root.Runtime.Runtime.isDescriptorEnabled({experiment: view.experiment, condition: view.condition}))
|
|
180
|
+
.toArray();
|
|
176
181
|
}
|
|
177
182
|
|
|
178
183
|
export function maybeRemoveViewExtension(viewId: string): boolean {
|
|
179
|
-
|
|
180
|
-
if (viewIndex < 0 || !viewIdSet.delete(viewId)) {
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
registeredViewExtensions.splice(viewIndex, 1);
|
|
184
|
-
return true;
|
|
184
|
+
return registeredViewExtensions.delete(viewId);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
const registeredLocationResolvers: LocationResolverRegistration[] = [];
|
|
@@ -202,10 +202,9 @@ export function getRegisteredLocationResolvers(): LocationResolverRegistration[]
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
export function resetViewRegistration(): void {
|
|
205
|
-
registeredViewExtensions.
|
|
205
|
+
registeredViewExtensions.clear();
|
|
206
206
|
registeredLocationResolvers.length = 0;
|
|
207
207
|
viewLocationNameSet.clear();
|
|
208
|
-
viewIdSet.clear();
|
|
209
208
|
}
|
|
210
209
|
|
|
211
210
|
export const enum ViewLocationCategory {
|
|
@@ -10,7 +10,7 @@ import * as Host from '../../../../core/host/host.js';
|
|
|
10
10
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
11
11
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
12
12
|
import * as Root from '../../../../core/root/root.js';
|
|
13
|
-
import
|
|
13
|
+
import {createIcon, Icon} from '../../../../ui/kit/kit.js';
|
|
14
14
|
import * as UIHelpers from '../../../helpers/helpers.js';
|
|
15
15
|
import * as UI from '../../legacy.js';
|
|
16
16
|
|
|
@@ -134,9 +134,9 @@ export class ContrastDetails extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
134
134
|
this.contrastValueBubble = contrastValueRowContents.createChild('span', 'contrast-details-value');
|
|
135
135
|
this.contrastValue = this.contrastValueBubble.createChild('span');
|
|
136
136
|
this.contrastValueBubbleIcons = [];
|
|
137
|
-
this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(
|
|
138
|
-
this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(
|
|
139
|
-
this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(
|
|
137
|
+
this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(createIcon('checkmark')));
|
|
138
|
+
this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(createIcon('check-double')));
|
|
139
|
+
this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(createIcon('clear')));
|
|
140
140
|
this.contrastValueBubbleIcons.forEach(button => button.addEventListener('click', (event: Event) => {
|
|
141
141
|
ContrastDetails.showHelp();
|
|
142
142
|
event.consume(false);
|
|
@@ -492,8 +492,8 @@ export class Swatch {
|
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
-
function createIconCheckmark():
|
|
496
|
-
const icon = new
|
|
495
|
+
function createIconCheckmark(): Icon {
|
|
496
|
+
const icon = new Icon();
|
|
497
497
|
icon.name = 'checkmark';
|
|
498
498
|
icon.style.color = 'var(--icon-checkmark-green)';
|
|
499
499
|
icon.style.width = 'var(--sys-size-9)';
|
|
@@ -501,8 +501,8 @@ function createIconCheckmark(): IconButton.Icon.Icon {
|
|
|
501
501
|
return icon;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
function createIconNo():
|
|
505
|
-
const icon = new
|
|
504
|
+
function createIconNo(): Icon {
|
|
505
|
+
const icon = new Icon();
|
|
506
506
|
icon.name = 'clear';
|
|
507
507
|
icon.style.color = 'var(--icon-error)';
|
|
508
508
|
icon.classList.add('small');
|
|
@@ -39,8 +39,8 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
39
39
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
40
40
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
41
41
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
42
|
-
import * as IconButton from '../../../components/icon_button/icon_button.js';
|
|
43
42
|
import * as SrgbOverlay from '../../../components/srgb_overlay/srgb_overlay.js';
|
|
43
|
+
import {createIcon, Icon} from '../../../kit/kit.js';
|
|
44
44
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
45
45
|
import * as UI from '../../legacy.js';
|
|
46
46
|
|
|
@@ -563,7 +563,7 @@ export class Spectrum extends Common.ObjectWrapper.eventMixin<EventTypes, typeof
|
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
function appendSwitcherIcon(parentElement: Element): void {
|
|
566
|
-
const switcherIcon = new
|
|
566
|
+
const switcherIcon = new Icon();
|
|
567
567
|
switcherIcon.name = 'fold-more';
|
|
568
568
|
switcherIcon.classList.add('medium');
|
|
569
569
|
parentElement.appendChild(switcherIcon);
|
|
@@ -1650,7 +1650,7 @@ export class Swatch {
|
|
|
1650
1650
|
private colorString!: string|null;
|
|
1651
1651
|
private swatchInnerElement: HTMLElement;
|
|
1652
1652
|
private swatchOverlayElement: HTMLElement;
|
|
1653
|
-
private readonly swatchCopyIcon:
|
|
1653
|
+
private readonly swatchCopyIcon: Icon;
|
|
1654
1654
|
constructor(parentElement: HTMLElement) {
|
|
1655
1655
|
const swatchElement = parentElement.createChild('span', 'swatch');
|
|
1656
1656
|
swatchElement.setAttribute('jslog', `${VisualLogging.action('copy-color').track({click: true})}`);
|
|
@@ -1662,7 +1662,7 @@ export class Swatch {
|
|
|
1662
1662
|
self.onInvokeElement(this.swatchOverlayElement, this.onCopyText.bind(this));
|
|
1663
1663
|
this.swatchOverlayElement.addEventListener('mouseout', this.onCopyIconMouseout.bind(this));
|
|
1664
1664
|
this.swatchOverlayElement.addEventListener('blur', this.onCopyIconMouseout.bind(this));
|
|
1665
|
-
this.swatchCopyIcon =
|
|
1665
|
+
this.swatchCopyIcon = createIcon('copy', 'copy-color-icon');
|
|
1666
1666
|
UI.Tooltip.Tooltip.install(this.swatchCopyIcon, i18nString(UIStrings.copyColorToClipboard));
|
|
1667
1667
|
this.swatchOverlayElement.appendChild(this.swatchCopyIcon);
|
|
1668
1668
|
UI.ARIAUtils.setLabel(this.swatchOverlayElement, this.swatchCopyIcon.title);
|
|
@@ -42,7 +42,7 @@ import * as SDK from '../../../../core/sdk/sdk.js';
|
|
|
42
42
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
43
43
|
import * as IssuesManager from '../../../../models/issues_manager/issues_manager.js';
|
|
44
44
|
import * as NetworkForward from '../../../../panels/network/forward/forward.js';
|
|
45
|
-
import
|
|
45
|
+
import {Icon} from '../../../kit/kit.js';
|
|
46
46
|
import {Directives, html, render} from '../../../lit/lit.js';
|
|
47
47
|
import * as UI from '../../legacy.js';
|
|
48
48
|
|
|
@@ -72,7 +72,7 @@ type CookieData = Partial<Record<SDK.Cookie.Attribute, string>>&{
|
|
|
72
72
|
}&{
|
|
73
73
|
key?: string,
|
|
74
74
|
flagged?: boolean,
|
|
75
|
-
icons?: Partial<Record<AttributeWithIcon,
|
|
75
|
+
icons?: Partial<Record<AttributeWithIcon, Icon>>,
|
|
76
76
|
priorityValue?: number,
|
|
77
77
|
expiresTooltip?: string,
|
|
78
78
|
dirty?: boolean,
|
|
@@ -513,7 +513,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
513
513
|
const attribute = (blockedReason.attribute || SDK.Cookie.Attribute.NAME) as AttributeWithIcon;
|
|
514
514
|
data.icons = data.icons || {};
|
|
515
515
|
if (!(attribute in data.icons)) {
|
|
516
|
-
data.icons[attribute] = new
|
|
516
|
+
data.icons[attribute] = new Icon();
|
|
517
517
|
if (attribute === SDK.Cookie.Attribute.NAME &&
|
|
518
518
|
IssuesManager.RelatedIssue.hasThirdPartyPhaseoutCookieIssue(cookie)) {
|
|
519
519
|
data.icons[attribute].name = 'warning-filled';
|
|
@@ -532,7 +532,7 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
532
532
|
if (exemptionReason) {
|
|
533
533
|
data.icons = data.icons || {};
|
|
534
534
|
data.flagged = true;
|
|
535
|
-
data.icons.name = new
|
|
535
|
+
data.icons.name = new Icon();
|
|
536
536
|
data.icons.name.name = 'info';
|
|
537
537
|
data.icons.name.classList.add('small');
|
|
538
538
|
data.icons.name.title = exemptionReason;
|
|
@@ -8,7 +8,7 @@ import '../../legacy.js';
|
|
|
8
8
|
import * as Common from '../../../../core/common/common.js';
|
|
9
9
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
10
10
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
11
|
-
import
|
|
11
|
+
import {Icon} from '../../../kit/kit.js';
|
|
12
12
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
13
13
|
import * as UI from '../../legacy.js';
|
|
14
14
|
|
|
@@ -733,7 +733,7 @@ class FontPropertyInputs {
|
|
|
733
733
|
|
|
734
734
|
private createTypeToggle(field: Element, jslogContext: string): void {
|
|
735
735
|
const displaySwitcher = field.createChild('div', 'spectrum-switcher');
|
|
736
|
-
const icon = new
|
|
736
|
+
const icon = new Icon();
|
|
737
737
|
icon.name = 'fold-more';
|
|
738
738
|
icon.classList.add('medium');
|
|
739
739
|
displaySwitcher.appendChild(icon);
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import '../../../
|
|
6
|
+
import '../../../kit/kit.js';
|
|
7
7
|
|
|
8
|
-
import type
|
|
8
|
+
import type {Icon} from '../../../kit/kit.js';
|
|
9
9
|
import {html, render} from '../../../lit/lit.js';
|
|
10
10
|
|
|
11
11
|
import type {CSSShadowModel} from './CSSShadowEditor.js';
|
|
12
12
|
import cssShadowSwatchStyles from './cssShadowSwatch.css.js';
|
|
13
13
|
|
|
14
14
|
export class CSSShadowSwatch extends HTMLElement {
|
|
15
|
-
readonly #icon:
|
|
15
|
+
readonly #icon: Icon;
|
|
16
16
|
readonly #model: CSSShadowModel;
|
|
17
17
|
|
|
18
18
|
constructor(model: CSSShadowModel) {
|
|
@@ -26,14 +26,14 @@ export class CSSShadowSwatch extends HTMLElement {
|
|
|
26
26
|
this, {host: this});
|
|
27
27
|
// clang-format on
|
|
28
28
|
|
|
29
|
-
this.#icon = this.querySelector('devtools-icon') as
|
|
29
|
+
this.#icon = this.querySelector('devtools-icon') as Icon;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
model(): CSSShadowModel {
|
|
33
33
|
return this.#model;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
iconElement():
|
|
36
|
+
iconElement(): Icon {
|
|
37
37
|
return this.#icon;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -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 type * as SDK from '../../../../core/sdk/sdk.js';
|
|
9
9
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
10
|
-
import
|
|
10
|
+
import {createIcon, type Icon} from '../../../kit/kit.js';
|
|
11
11
|
import * as UI from '../../legacy.js';
|
|
12
12
|
|
|
13
13
|
import customPreviewComponentStyles from './customPreviewComponent.css.js';
|
|
@@ -33,7 +33,7 @@ export class CustomPreviewSection {
|
|
|
33
33
|
private expanded: boolean;
|
|
34
34
|
private cachedContent: Node|null;
|
|
35
35
|
private readonly header: Node|undefined;
|
|
36
|
-
private readonly expandIcon:
|
|
36
|
+
private readonly expandIcon: Icon|undefined;
|
|
37
37
|
constructor(object: SDK.RemoteObject.RemoteObject) {
|
|
38
38
|
this.sectionElement = document.createElement('span');
|
|
39
39
|
this.sectionElement.classList.add('custom-expandable-section');
|
|
@@ -64,7 +64,7 @@ export class CustomPreviewSection {
|
|
|
64
64
|
this.header.classList.add('custom-expandable-section-header');
|
|
65
65
|
}
|
|
66
66
|
this.header.addEventListener('click', this.onClick.bind(this), false);
|
|
67
|
-
this.expandIcon =
|
|
67
|
+
this.expandIcon = createIcon('triangle-right', 'custom-expand-icon');
|
|
68
68
|
this.header.insertBefore(this.expandIcon, this.header.firstChild);
|
|
69
69
|
}
|
|
70
70
|
|