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
|
@@ -50,8 +50,8 @@ import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
|
50
50
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
51
51
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
52
52
|
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
53
|
-
import * as IconButton from '../../ui/components/icon_button/icon_button.js';
|
|
54
53
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
54
|
+
import {createIcon, Icon} from '../../ui/kit/kit.js';
|
|
55
55
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
56
56
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
57
57
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -195,11 +195,14 @@ const UIStrings = {
|
|
|
195
195
|
/**
|
|
196
196
|
* @description ARIA label for Elements Tree adorners
|
|
197
197
|
*/
|
|
198
|
-
enableMasonryMode: 'Enable masonry mode',
|
|
199
198
|
/**
|
|
200
199
|
* @description ARIA label for Elements Tree adorners
|
|
201
200
|
*/
|
|
202
|
-
|
|
201
|
+
enableGridLanesMode: 'Enable grid-lanes mode',
|
|
202
|
+
/**
|
|
203
|
+
* @description ARIA label for Elements Tree adorners
|
|
204
|
+
*/
|
|
205
|
+
disableGridLanesMode: 'Disable grid-lanes mode',
|
|
203
206
|
/**
|
|
204
207
|
* @description ARIA label for an elements tree adorner
|
|
205
208
|
*/
|
|
@@ -226,6 +229,16 @@ const UIStrings = {
|
|
|
226
229
|
* the overlay showing CSS scroll snapping for the current element.
|
|
227
230
|
*/
|
|
228
231
|
disableScrollSnap: 'Disable scroll-snap overlay',
|
|
232
|
+
/**
|
|
233
|
+
* @description Label of an adorner in the Elements panel. When clicked, it enables
|
|
234
|
+
* the overlay showing the container overlay for the current element.
|
|
235
|
+
*/
|
|
236
|
+
enableContainer: 'Enable container overlay',
|
|
237
|
+
/**
|
|
238
|
+
* @description Label of an adorner in the Elements panel. When clicked, it disables
|
|
239
|
+
* the overlay showing container for the current element.
|
|
240
|
+
*/
|
|
241
|
+
disableContainer: 'Disable container overlay',
|
|
229
242
|
/**
|
|
230
243
|
* @description Label of an adorner in the Elements panel. When clicked, it forces
|
|
231
244
|
* the element into applying its starting-style rules.
|
|
@@ -354,13 +367,21 @@ export function isOpeningTag(context: TagTypeContext): context is OpeningTagCont
|
|
|
354
367
|
}
|
|
355
368
|
|
|
356
369
|
export interface ViewInput {
|
|
370
|
+
containerAdornerActive: boolean;
|
|
371
|
+
flexAdornerActive: boolean;
|
|
372
|
+
|
|
357
373
|
showAdAdorner: boolean;
|
|
374
|
+
showContainerAdorner: boolean;
|
|
375
|
+
showFlexAdorner: boolean;
|
|
376
|
+
|
|
358
377
|
adorners?: Set<Adorners.Adorner.Adorner>;
|
|
359
378
|
nodeInfo?: DocumentFragment;
|
|
360
379
|
|
|
361
380
|
onGutterClick: (e: Event) => void;
|
|
362
381
|
onAdornerAdded: (adorner: Adorners.Adorner.Adorner) => void;
|
|
363
382
|
onAdornerRemoved: (adorner: Adorners.Adorner.Adorner) => void;
|
|
383
|
+
onContainerAdornerClick: (e: Event) => void;
|
|
384
|
+
onFlexAdornerClick: (e: Event) => void;
|
|
364
385
|
}
|
|
365
386
|
|
|
366
387
|
export interface ViewOutput {
|
|
@@ -385,7 +406,12 @@ function adornerRef(input: ViewInput): DirectiveResult<typeof Lit.Directives.Ref
|
|
|
385
406
|
export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement): void => {
|
|
386
407
|
const adAdornerConfig =
|
|
387
408
|
ElementsComponents.AdornerManager.getRegisteredAdorner(ElementsComponents.AdornerManager.RegisteredAdorners.AD);
|
|
388
|
-
const
|
|
409
|
+
const containerAdornerConfig = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
410
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
411
|
+
const flexAdornerConfig =
|
|
412
|
+
ElementsComponents.AdornerManager.getRegisteredAdorner(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
413
|
+
const hasAdorners =
|
|
414
|
+
input.adorners?.size || input.showAdAdorner || input.showContainerAdorner || input.showFlexAdorner;
|
|
389
415
|
// clang-format off
|
|
390
416
|
render(html`
|
|
391
417
|
<div ${ref(el => { output.contentElement = el as HTMLElement; })}>
|
|
@@ -394,13 +420,51 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
394
420
|
<devtools-icon name="dots-horizontal"></devtools-icon>
|
|
395
421
|
<div class="hidden" ${ref(el => { output.decorationsElement = el as HTMLElement; })}></div>
|
|
396
422
|
</div>
|
|
397
|
-
${hasAdorners? html`<div class="adorner-container ${!hasAdorners ? 'hidden': ''}">
|
|
423
|
+
${hasAdorners ? html`<div class="adorner-container ${!hasAdorners ? 'hidden' : ''}">
|
|
398
424
|
${input.showAdAdorner ? html`<devtools-adorner
|
|
399
|
-
.data=${{name: adAdornerConfig.name, jslogContext: adAdornerConfig.name}}
|
|
400
425
|
aria-label=${i18nString(UIStrings.thisFrameWasIdentifiedAsAnAd)}
|
|
426
|
+
.data=${{name: adAdornerConfig.name, jslogContext: adAdornerConfig.name}}
|
|
401
427
|
${adornerRef(input)}>
|
|
402
428
|
<span>${adAdornerConfig.name}</span>
|
|
403
429
|
</devtools-adorner>` : nothing}
|
|
430
|
+
${input.showContainerAdorner ? html`<devtools-adorner
|
|
431
|
+
class=clickable
|
|
432
|
+
role=button
|
|
433
|
+
toggleable=true
|
|
434
|
+
tabindex=0
|
|
435
|
+
.data=${{name: containerAdornerConfig.name, jslogContext: containerAdornerConfig.name}}
|
|
436
|
+
jslog=${VisualLogging.adorner(containerAdornerConfig.name).track({click: true})}
|
|
437
|
+
active=${input.containerAdornerActive}
|
|
438
|
+
aria-label=${input.containerAdornerActive ? i18nString(UIStrings.enableContainer) : i18nString(UIStrings.disableContainer)}
|
|
439
|
+
@click=${input.onContainerAdornerClick}
|
|
440
|
+
@keydown=${(event: KeyboardEvent) => {
|
|
441
|
+
if (event.code === 'Enter' || event.code === 'Space') {
|
|
442
|
+
input.onContainerAdornerClick(event);
|
|
443
|
+
event.stopPropagation();
|
|
444
|
+
}
|
|
445
|
+
}}
|
|
446
|
+
${adornerRef(input)}>
|
|
447
|
+
<span>${containerAdornerConfig.name}</span>
|
|
448
|
+
</devtools-adorner>`: nothing}
|
|
449
|
+
${input.showFlexAdorner ? html`<devtools-adorner
|
|
450
|
+
class=clickable
|
|
451
|
+
role=button
|
|
452
|
+
toggleable=true
|
|
453
|
+
tabindex=0
|
|
454
|
+
.data=${{name: flexAdornerConfig.name, jslogContext: flexAdornerConfig.name}}
|
|
455
|
+
jslog=${VisualLogging.adorner(flexAdornerConfig.name).track({click: true})}
|
|
456
|
+
active=${input.flexAdornerActive}
|
|
457
|
+
aria-label=${input.flexAdornerActive ? i18nString(UIStrings.enableFlexMode) : i18nString(UIStrings.disableFlexMode)}
|
|
458
|
+
@click=${input.onFlexAdornerClick}
|
|
459
|
+
@keydown=${(event: KeyboardEvent) => {
|
|
460
|
+
if (event.code === 'Enter' || event.code === 'Space') {
|
|
461
|
+
input.onFlexAdornerClick(event);
|
|
462
|
+
event.stopPropagation();
|
|
463
|
+
}
|
|
464
|
+
}}
|
|
465
|
+
${adornerRef(input)}>
|
|
466
|
+
<span>${flexAdornerConfig.name}</span>
|
|
467
|
+
</devtools-adorner>`: nothing}
|
|
404
468
|
${repeat(Array.from((input.adorners ?? new Set()).values()).sort(adornerComparator), adorner => {
|
|
405
469
|
return adorner;
|
|
406
470
|
})}
|
|
@@ -439,6 +503,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
439
503
|
#adornersThrottler = new Common.Throttler.Throttler(100);
|
|
440
504
|
#adorners = new Set<Adorners.Adorner.Adorner>();
|
|
441
505
|
#nodeInfo?: DocumentFragment;
|
|
506
|
+
#containerAdornerActive = false;
|
|
507
|
+
#flexAdornerActive = false;
|
|
508
|
+
#layout: SDK.CSSModel.LayoutProperties|null = null;
|
|
442
509
|
|
|
443
510
|
constructor(node: SDK.DOMModel.DOMNode, isClosingTag?: boolean) {
|
|
444
511
|
// The title will be updated in onattach.
|
|
@@ -471,13 +538,14 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
471
538
|
void this.updateStyleAdorners();
|
|
472
539
|
|
|
473
540
|
void this.updateScrollAdorner();
|
|
541
|
+
|
|
542
|
+
void this.#updateAdorners();
|
|
474
543
|
}
|
|
475
544
|
this.expandAllButtonElement = null;
|
|
476
|
-
|
|
477
545
|
this.performUpdate();
|
|
478
546
|
|
|
479
547
|
if (this.nodeInternal.retained && !this.isClosingTag()) {
|
|
480
|
-
const icon = new
|
|
548
|
+
const icon = new Icon();
|
|
481
549
|
icon.name = 'small-status-dot';
|
|
482
550
|
icon.style.color = 'var(--icon-error)';
|
|
483
551
|
icon.classList.add('extra-small');
|
|
@@ -491,6 +559,25 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
491
559
|
if (this.nodeInternal.detached && !this.isClosingTag()) {
|
|
492
560
|
this.listItemNode.setAttribute('title', 'Detached Tree Node');
|
|
493
561
|
}
|
|
562
|
+
|
|
563
|
+
node.domModel().overlayModel().addEventListener(
|
|
564
|
+
SDK.OverlayModel.Events.PERSISTENT_CONTAINER_QUERY_OVERLAY_STATE_CHANGED, event => {
|
|
565
|
+
const {nodeId: eventNodeId, enabled} = event.data;
|
|
566
|
+
if (eventNodeId !== node.id) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
this.#containerAdornerActive = enabled;
|
|
570
|
+
this.performUpdate();
|
|
571
|
+
});
|
|
572
|
+
node.domModel().overlayModel().addEventListener(
|
|
573
|
+
SDK.OverlayModel.Events.PERSISTENT_FLEX_CONTAINER_OVERLAY_STATE_CHANGED, event => {
|
|
574
|
+
const {nodeId: eventNodeId, enabled} = event.data;
|
|
575
|
+
if (eventNodeId !== node.id) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
this.#flexAdornerActive = enabled;
|
|
579
|
+
this.performUpdate();
|
|
580
|
+
});
|
|
494
581
|
}
|
|
495
582
|
|
|
496
583
|
static animateOnDOMUpdate(treeElement: ElementsTreeElement): void {
|
|
@@ -553,10 +640,18 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
553
640
|
performUpdate(): void {
|
|
554
641
|
DEFAULT_VIEW(
|
|
555
642
|
{
|
|
643
|
+
containerAdornerActive: this.#containerAdornerActive,
|
|
556
644
|
adorners: !this.isClosingTag() ? this.#adorners : undefined,
|
|
557
645
|
showAdAdorner:
|
|
558
646
|
ElementsPanel.instance().isAdornerEnabled(ElementsComponents.AdornerManager.RegisteredAdorners.AD) &&
|
|
559
647
|
this.nodeInternal.isAdFrameNode(),
|
|
648
|
+
showContainerAdorner: ElementsPanel.instance().isAdornerEnabled(
|
|
649
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER) &&
|
|
650
|
+
Boolean(this.#layout?.isContainer) && !this.isClosingTag(),
|
|
651
|
+
showFlexAdorner:
|
|
652
|
+
ElementsPanel.instance().isAdornerEnabled(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX) &&
|
|
653
|
+
Boolean(this.#layout?.isFlex) && !this.isClosingTag(),
|
|
654
|
+
flexAdornerActive: this.#flexAdornerActive,
|
|
560
655
|
nodeInfo: this.#nodeInfo,
|
|
561
656
|
onGutterClick: this.showContextMenu.bind(this),
|
|
562
657
|
onAdornerAdded: adorner => {
|
|
@@ -565,10 +660,50 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
565
660
|
onAdornerRemoved: adorner => {
|
|
566
661
|
ElementsPanel.instance().deregisterAdorner(adorner);
|
|
567
662
|
},
|
|
663
|
+
onContainerAdornerClick: (event: Event) => this.#onContainerAdornerClick(event),
|
|
664
|
+
onFlexAdornerClick: (event: Event) => this.#onFlexAdornerClick(event),
|
|
568
665
|
},
|
|
569
666
|
this, this.listItemElement);
|
|
570
667
|
}
|
|
571
668
|
|
|
669
|
+
#onContainerAdornerClick(event: Event): void {
|
|
670
|
+
event.stopPropagation();
|
|
671
|
+
const node = this.node();
|
|
672
|
+
const nodeId = node.id;
|
|
673
|
+
if (!nodeId) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const model = node.domModel().overlayModel();
|
|
677
|
+
if (model.isHighlightedContainerQueryInPersistentOverlay(nodeId)) {
|
|
678
|
+
model.hideContainerQueryInPersistentOverlay(nodeId);
|
|
679
|
+
this.#containerAdornerActive = false;
|
|
680
|
+
} else {
|
|
681
|
+
model.highlightContainerQueryInPersistentOverlay(nodeId);
|
|
682
|
+
this.#containerAdornerActive = true;
|
|
683
|
+
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.MODERN_DOM_BADGE_CLICKED);
|
|
684
|
+
}
|
|
685
|
+
void this.updateAdorners();
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
#onFlexAdornerClick(event: Event): void {
|
|
689
|
+
event.stopPropagation();
|
|
690
|
+
const node = this.node();
|
|
691
|
+
const nodeId = node.id;
|
|
692
|
+
if (!nodeId) {
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
const model = node.domModel().overlayModel();
|
|
696
|
+
if (model.isHighlightedFlexContainerInPersistentOverlay(nodeId)) {
|
|
697
|
+
model.hideFlexContainerInPersistentOverlay(nodeId);
|
|
698
|
+
this.#flexAdornerActive = false;
|
|
699
|
+
} else {
|
|
700
|
+
model.highlightFlexContainerInPersistentOverlay(nodeId);
|
|
701
|
+
this.#flexAdornerActive = true;
|
|
702
|
+
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.MODERN_DOM_BADGE_CLICKED);
|
|
703
|
+
}
|
|
704
|
+
void this.updateAdorners();
|
|
705
|
+
}
|
|
706
|
+
|
|
572
707
|
highlightAttribute(attributeName: string): void {
|
|
573
708
|
// If the attribute is not found, we highlight the tag name instead.
|
|
574
709
|
let animationElement = this.listItemElement.querySelector('.webkit-html-tag-name') ?? this.listItemElement;
|
|
@@ -1015,7 +1150,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1015
1150
|
const isEditable = this.hasEditableNode();
|
|
1016
1151
|
// clang-format off
|
|
1017
1152
|
if (isEditable && !this.editing) {
|
|
1018
|
-
contextMenu.editSection().appendItem(i18nString(UIStrings.editAsHtml), this.editAsHTML.bind(this), {jslogContext: 'elements.edit-as-html'});
|
|
1153
|
+
contextMenu.editSection().appendItem(i18nString(UIStrings.editAsHtml), this.editAsHTML.bind(this), { jslogContext: 'elements.edit-as-html' });
|
|
1019
1154
|
}
|
|
1020
1155
|
// clang-format on
|
|
1021
1156
|
const isShadowRoot = this.nodeInternal.isShadowRoot();
|
|
@@ -2003,7 +2138,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2003
2138
|
++highlightIndex;
|
|
2004
2139
|
}
|
|
2005
2140
|
element.setTextContentTruncatedIfNeeded(value);
|
|
2006
|
-
|
|
2141
|
+
Highlighting.highlightRangesWithStyleClass(element, result.entityRanges, 'webkit-html-entity-value');
|
|
2007
2142
|
}
|
|
2008
2143
|
|
|
2009
2144
|
const hasText = (forceValue || value.length > 0);
|
|
@@ -2271,7 +2406,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2271
2406
|
}
|
|
2272
2407
|
const result = convertUnicodeCharsToHTMLEntities(firstChild.nodeValue());
|
|
2273
2408
|
textNodeElement.textContent = Platform.StringUtilities.collapseWhitespace(result.text);
|
|
2274
|
-
|
|
2409
|
+
Highlighting.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value');
|
|
2275
2410
|
UI.UIUtils.createTextChild(titleDOM, '\u200B');
|
|
2276
2411
|
this.buildTagDOM(titleDOM, tagName, true, false, updateRecord);
|
|
2277
2412
|
if (updateRecord?.hasChangedChildren()) {
|
|
@@ -2311,7 +2446,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2311
2446
|
'jslog', `${VisualLogging.value('text-node').track({change: true, dblclick: true})}`);
|
|
2312
2447
|
const result = convertUnicodeCharsToHTMLEntities(node.nodeValue());
|
|
2313
2448
|
textNodeElement.textContent = Platform.StringUtilities.collapseWhitespace(result.text);
|
|
2314
|
-
|
|
2449
|
+
Highlighting.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, 'webkit-html-entity-value');
|
|
2315
2450
|
UI.UIUtils.createTextChild(titleDOM, '"');
|
|
2316
2451
|
if (updateRecord?.isCharDataModified()) {
|
|
2317
2452
|
UI.UIUtils.runCSSAnimationOnce(textNodeElement, 'dom-update-highlight');
|
|
@@ -2534,7 +2669,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2534
2669
|
}
|
|
2535
2670
|
|
|
2536
2671
|
adornSlot({name}: {name: string}): Adorners.Adorner.Adorner {
|
|
2537
|
-
const linkIcon =
|
|
2672
|
+
const linkIcon = createIcon('select-element');
|
|
2538
2673
|
const slotText = document.createElement('span');
|
|
2539
2674
|
slotText.textContent = name;
|
|
2540
2675
|
const adornerContent = document.createElement('span');
|
|
@@ -2559,7 +2694,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2559
2694
|
adornerContent.textContent = name;
|
|
2560
2695
|
adornerContent.classList.add('adorner-with-icon');
|
|
2561
2696
|
|
|
2562
|
-
const linkIcon =
|
|
2697
|
+
const linkIcon = createIcon('select-element');
|
|
2563
2698
|
adornerContent.append(linkIcon);
|
|
2564
2699
|
|
|
2565
2700
|
const adorner = new Adorners.Adorner.Adorner();
|
|
@@ -2598,17 +2733,28 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2598
2733
|
}
|
|
2599
2734
|
}
|
|
2600
2735
|
|
|
2601
|
-
|
|
2736
|
+
updateAdorners(): void {
|
|
2602
2737
|
// TODO: remove adornersThrottler in favour of throttled updated (requestUpdate/performUpdate).
|
|
2603
2738
|
void this.#adornersThrottler.schedule(this.#updateAdorners.bind(this));
|
|
2604
2739
|
}
|
|
2605
2740
|
|
|
2606
|
-
#updateAdorners(): Promise<void> {
|
|
2607
|
-
|
|
2741
|
+
async #updateAdorners(): Promise<void> {
|
|
2742
|
+
if (this.isClosingTag()) {
|
|
2743
|
+
this.performUpdate();
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2746
|
+
const node = this.node();
|
|
2747
|
+
const nodeId = node.id;
|
|
2748
|
+
if (node.nodeType() !== Node.COMMENT_NODE && node.nodeType() !== Node.DOCUMENT_FRAGMENT_NODE &&
|
|
2749
|
+
node.nodeType() !== Node.TEXT_NODE && nodeId !== undefined) {
|
|
2750
|
+
this.#layout = await node.domModel().cssModel().getLayoutPropertiesFromComputedStyle(nodeId);
|
|
2751
|
+
} else {
|
|
2752
|
+
this.#layout = null;
|
|
2753
|
+
}
|
|
2608
2754
|
this.performUpdate();
|
|
2609
|
-
return Promise.resolve();
|
|
2610
2755
|
}
|
|
2611
2756
|
|
|
2757
|
+
// TODO: remove in favour of updateAdorners.
|
|
2612
2758
|
async updateStyleAdorners(): Promise<void> {
|
|
2613
2759
|
if (!isOpeningTag(this.tagTypeContext)) {
|
|
2614
2760
|
return;
|
|
@@ -2620,15 +2766,13 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2620
2766
|
node.nodeType() === Node.TEXT_NODE || nodeId === undefined) {
|
|
2621
2767
|
return;
|
|
2622
2768
|
}
|
|
2623
|
-
|
|
2624
2769
|
const layout = await node.domModel().cssModel().getLayoutPropertiesFromComputedStyle(nodeId);
|
|
2625
2770
|
// TODO: move this to the template.
|
|
2626
2771
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.SUBGRID);
|
|
2627
2772
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.GRID);
|
|
2628
|
-
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.
|
|
2773
|
+
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.GRID_LANES);
|
|
2629
2774
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
2630
2775
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.SCROLL_SNAP);
|
|
2631
|
-
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
2632
2776
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.MEDIA);
|
|
2633
2777
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.STARTING_STYLE);
|
|
2634
2778
|
this.removeAdornersByType(ElementsComponents.AdornerManager.RegisteredAdorners.POPOVER);
|
|
@@ -2636,18 +2780,12 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2636
2780
|
if (layout.isGrid) {
|
|
2637
2781
|
this.pushGridAdorner(layout.isSubgrid);
|
|
2638
2782
|
}
|
|
2639
|
-
if (layout.
|
|
2640
|
-
this.
|
|
2641
|
-
}
|
|
2642
|
-
if (layout.isFlex) {
|
|
2643
|
-
this.pushFlexAdorner();
|
|
2783
|
+
if (layout.isGridLanes) {
|
|
2784
|
+
this.pushGridLanesAdorner();
|
|
2644
2785
|
}
|
|
2645
2786
|
if (layout.hasScroll) {
|
|
2646
2787
|
this.pushScrollSnapAdorner();
|
|
2647
2788
|
}
|
|
2648
|
-
if (layout.isContainer) {
|
|
2649
|
-
this.pushContainerAdorner();
|
|
2650
|
-
}
|
|
2651
2789
|
}
|
|
2652
2790
|
|
|
2653
2791
|
if (node.isMediaNode()) {
|
|
@@ -2746,7 +2884,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2746
2884
|
}
|
|
2747
2885
|
}
|
|
2748
2886
|
|
|
2749
|
-
|
|
2887
|
+
pushGridLanesAdorner(): void {
|
|
2750
2888
|
const node = this.node();
|
|
2751
2889
|
const nodeId = node.id;
|
|
2752
2890
|
if (!nodeId) {
|
|
@@ -2754,9 +2892,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2754
2892
|
}
|
|
2755
2893
|
|
|
2756
2894
|
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
2757
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.
|
|
2895
|
+
ElementsComponents.AdornerManager.RegisteredAdorners.GRID_LANES);
|
|
2758
2896
|
const adorner = this.adorn(config);
|
|
2759
|
-
adorner.classList.add('
|
|
2897
|
+
adorner.classList.add('grid-lanes');
|
|
2760
2898
|
|
|
2761
2899
|
const onClick = ((() => {
|
|
2762
2900
|
if (adorner.isActive()) {
|
|
@@ -2769,8 +2907,8 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2769
2907
|
adorner.addInteraction(onClick, {
|
|
2770
2908
|
isToggle: true,
|
|
2771
2909
|
shouldPropagateOnKeydown: false,
|
|
2772
|
-
ariaLabelDefault: i18nString(UIStrings.
|
|
2773
|
-
ariaLabelActive: i18nString(UIStrings.
|
|
2910
|
+
ariaLabelDefault: i18nString(UIStrings.enableGridLanesMode),
|
|
2911
|
+
ariaLabelActive: i18nString(UIStrings.disableGridLanesMode),
|
|
2774
2912
|
});
|
|
2775
2913
|
|
|
2776
2914
|
node.domModel().overlayModel().addEventListener(
|
|
@@ -2861,93 +2999,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2861
2999
|
this.#adorners.add(adorner);
|
|
2862
3000
|
}
|
|
2863
3001
|
|
|
2864
|
-
pushFlexAdorner(): void {
|
|
2865
|
-
const node = this.node();
|
|
2866
|
-
const nodeId = node.id;
|
|
2867
|
-
if (!nodeId) {
|
|
2868
|
-
return;
|
|
2869
|
-
}
|
|
2870
|
-
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
2871
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.FLEX);
|
|
2872
|
-
const adorner = this.adorn(config);
|
|
2873
|
-
adorner.classList.add('flex');
|
|
2874
|
-
|
|
2875
|
-
const onClick = ((() => {
|
|
2876
|
-
const model = node.domModel().overlayModel();
|
|
2877
|
-
if (adorner.isActive()) {
|
|
2878
|
-
model.highlightFlexContainerInPersistentOverlay(nodeId);
|
|
2879
|
-
} else {
|
|
2880
|
-
model.hideFlexContainerInPersistentOverlay(nodeId);
|
|
2881
|
-
}
|
|
2882
|
-
}) as EventListener);
|
|
2883
|
-
|
|
2884
|
-
adorner.addInteraction(onClick, {
|
|
2885
|
-
isToggle: true,
|
|
2886
|
-
shouldPropagateOnKeydown: false,
|
|
2887
|
-
ariaLabelDefault: i18nString(UIStrings.enableFlexMode),
|
|
2888
|
-
ariaLabelActive: i18nString(UIStrings.disableFlexMode),
|
|
2889
|
-
});
|
|
2890
|
-
|
|
2891
|
-
node.domModel().overlayModel().addEventListener(
|
|
2892
|
-
SDK.OverlayModel.Events.PERSISTENT_FLEX_CONTAINER_OVERLAY_STATE_CHANGED, event => {
|
|
2893
|
-
const {nodeId: eventNodeId, enabled} = event.data;
|
|
2894
|
-
if (eventNodeId !== nodeId) {
|
|
2895
|
-
return;
|
|
2896
|
-
}
|
|
2897
|
-
|
|
2898
|
-
adorner.toggle(enabled);
|
|
2899
|
-
});
|
|
2900
|
-
|
|
2901
|
-
this.#adorners.add(adorner);
|
|
2902
|
-
|
|
2903
|
-
if (node.domModel().overlayModel().isHighlightedFlexContainerInPersistentOverlay(nodeId)) {
|
|
2904
|
-
adorner.toggle(true);
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
|
|
2908
|
-
pushContainerAdorner(): void {
|
|
2909
|
-
const node = this.node();
|
|
2910
|
-
const nodeId = node.id;
|
|
2911
|
-
if (!nodeId) {
|
|
2912
|
-
return;
|
|
2913
|
-
}
|
|
2914
|
-
const config = ElementsComponents.AdornerManager.getRegisteredAdorner(
|
|
2915
|
-
ElementsComponents.AdornerManager.RegisteredAdorners.CONTAINER);
|
|
2916
|
-
const adorner = this.adorn(config);
|
|
2917
|
-
adorner.classList.add('container');
|
|
2918
|
-
|
|
2919
|
-
const onClick = ((() => {
|
|
2920
|
-
const model = node.domModel().overlayModel();
|
|
2921
|
-
if (adorner.isActive()) {
|
|
2922
|
-
model.highlightContainerQueryInPersistentOverlay(nodeId);
|
|
2923
|
-
Badges.UserBadges.instance().recordAction(Badges.BadgeAction.MODERN_DOM_BADGE_CLICKED);
|
|
2924
|
-
} else {
|
|
2925
|
-
model.hideContainerQueryInPersistentOverlay(nodeId);
|
|
2926
|
-
}
|
|
2927
|
-
}) as EventListener);
|
|
2928
|
-
|
|
2929
|
-
adorner.addInteraction(onClick, {
|
|
2930
|
-
isToggle: true,
|
|
2931
|
-
shouldPropagateOnKeydown: false,
|
|
2932
|
-
ariaLabelDefault: i18nString(UIStrings.enableScrollSnap),
|
|
2933
|
-
ariaLabelActive: i18nString(UIStrings.disableScrollSnap),
|
|
2934
|
-
});
|
|
2935
|
-
|
|
2936
|
-
node.domModel().overlayModel().addEventListener(
|
|
2937
|
-
SDK.OverlayModel.Events.PERSISTENT_CONTAINER_QUERY_OVERLAY_STATE_CHANGED, event => {
|
|
2938
|
-
const {nodeId: eventNodeId, enabled} = event.data;
|
|
2939
|
-
if (eventNodeId !== nodeId) {
|
|
2940
|
-
return;
|
|
2941
|
-
}
|
|
2942
|
-
adorner.toggle(enabled);
|
|
2943
|
-
});
|
|
2944
|
-
|
|
2945
|
-
this.#adorners.add(adorner);
|
|
2946
|
-
if (node.domModel().overlayModel().isHighlightedContainerQueryInPersistentOverlay(nodeId)) {
|
|
2947
|
-
adorner.toggle(true);
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
|
|
2951
3002
|
pushMediaAdorner(): void {
|
|
2952
3003
|
const node = this.node();
|
|
2953
3004
|
const nodeId = node.id;
|
|
@@ -41,6 +41,7 @@ import * as Badges from '../../models/badges/badges.js';
|
|
|
41
41
|
import * as Elements from '../../models/elements/elements.js';
|
|
42
42
|
import * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
43
43
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
44
|
+
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
44
45
|
import * as IssueCounter from '../../ui/components/issue_counter/issue_counter.js';
|
|
45
46
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
46
47
|
import {html, nothing, render} from '../../ui/lit/lit.js';
|
|
@@ -262,7 +263,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
262
263
|
return;
|
|
263
264
|
}
|
|
264
265
|
this.#currentHighlightedNode = null;
|
|
265
|
-
this.
|
|
266
|
+
this.performUpdate();
|
|
266
267
|
}
|
|
267
268
|
|
|
268
269
|
selectDOMNode(node: SDK.DOMModel.DOMNode|null, focus?: boolean): void {
|
|
@@ -298,6 +299,10 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
298
299
|
return this.#viewOutput.elementsTreeOutline;
|
|
299
300
|
}
|
|
300
301
|
|
|
302
|
+
treeElementForNode(node: SDK.DOMModel.DOMNode): ElementsTreeElement|null {
|
|
303
|
+
return this.#viewOutput.elementsTreeOutline?.findTreeElement(node) || null;
|
|
304
|
+
}
|
|
305
|
+
|
|
301
306
|
override performUpdate(): void {
|
|
302
307
|
this.#view(
|
|
303
308
|
{
|
|
@@ -357,7 +362,9 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
357
362
|
* FIXME: adorners should be part of the view input.
|
|
358
363
|
*/
|
|
359
364
|
updateNodeAdorners(node: SDK.DOMModel.DOMNode): void {
|
|
360
|
-
|
|
365
|
+
const element = this.#viewOutput.elementsTreeOutline?.findTreeElement(node);
|
|
366
|
+
void element?.updateStyleAdorners();
|
|
367
|
+
void element?.updateAdorners();
|
|
361
368
|
}
|
|
362
369
|
|
|
363
370
|
highlightMatch(node: SDK.DOMModel.DOMNode, query?: string): void {
|
|
@@ -369,7 +376,7 @@ export class DOMTreeWidget extends UI.Widget.Widget {
|
|
|
369
376
|
treeElement.highlightSearchResults(query);
|
|
370
377
|
}
|
|
371
378
|
treeElement.reveal();
|
|
372
|
-
const matches = treeElement.listItemElement.getElementsByClassName(
|
|
379
|
+
const matches = treeElement.listItemElement.getElementsByClassName(Highlighting.highlightedSearchResultClassName);
|
|
373
380
|
if (matches.length) {
|
|
374
381
|
matches[0].scrollIntoViewIfNeeded(false);
|
|
375
382
|
}
|
|
@@ -2006,6 +2013,7 @@ export class ElementsTreeOutline extends
|
|
|
2006
2013
|
const treeElement = this.treeElementByNode.get(node);
|
|
2007
2014
|
if (treeElement && isOpeningTag(treeElement.tagTypeContext)) {
|
|
2008
2015
|
void treeElement.updateStyleAdorners();
|
|
2016
|
+
void treeElement.updateAdorners();
|
|
2009
2017
|
}
|
|
2010
2018
|
}
|
|
2011
2019
|
}
|
|
@@ -25,9 +25,9 @@ const UIStrings = {
|
|
|
25
25
|
*/
|
|
26
26
|
showElementInTheElementsPanel: 'Show element in the Elements panel',
|
|
27
27
|
/**
|
|
28
|
-
* @description Title of a section on CSS Grid/
|
|
28
|
+
* @description Title of a section on CSS Grid/Grid Lanes tooling
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
gridOrGridLanes: 'Grid / Grid Lanes',
|
|
31
31
|
/**
|
|
32
32
|
* @description Title of a section in the Layout Sidebar pane of the Elements panel
|
|
33
33
|
*/
|
|
@@ -35,11 +35,11 @@ const UIStrings = {
|
|
|
35
35
|
/**
|
|
36
36
|
* @description Title of a section in Layout sidebar pane
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
gridOrGridLanesOverlays: 'Grid / Grid Lanes overlays',
|
|
39
39
|
/**
|
|
40
|
-
* @description Message in the Layout panel informing users that no CSS Grid/
|
|
40
|
+
* @description Message in the Layout panel informing users that no CSS Grid/Grid Lanes layouts were found on the page
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
noGridOrGridLanesLayoutsFoundOnThisPage: 'No grid or grid lanes layouts found on this page',
|
|
43
43
|
/**
|
|
44
44
|
* @description Title of the Flexbox section in the Layout panel
|
|
45
45
|
*/
|
|
@@ -289,7 +289,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
289
289
|
<summary class="header"
|
|
290
290
|
@keydown=${input.onSummaryKeyDown}
|
|
291
291
|
jslog=${VisualLogging.sectionHeader('grid-settings').track({click: true})}>
|
|
292
|
-
${i18nString(UIStrings.
|
|
292
|
+
${i18nString(UIStrings.gridOrGridLanes)}
|
|
293
293
|
</summary>
|
|
294
294
|
<div class="content-section" jslog=${VisualLogging.section('grid-settings')}>
|
|
295
295
|
<h3 class="content-section-title">${i18nString(UIStrings.overlayDisplaySettings)}</h3>
|
|
@@ -327,8 +327,8 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
327
327
|
html`<div class="content-section" jslog=${VisualLogging.section('grid-overlays')}>
|
|
328
328
|
<h3 class="content-section-title">
|
|
329
329
|
${input.gridElements.length ?
|
|
330
|
-
i18nString(UIStrings.
|
|
331
|
-
i18nString(UIStrings.
|
|
330
|
+
i18nString(UIStrings.gridOrGridLanesOverlays) :
|
|
331
|
+
i18nString(UIStrings.noGridOrGridLanesLayoutsFoundOnThisPage)}
|
|
332
332
|
</h3>
|
|
333
333
|
${input.gridElements.length ?
|
|
334
334
|
html`<div class="elements">${input.gridElements.map(renderElement)}</div>` :
|
|
@@ -431,8 +431,10 @@ export class LayoutPane extends UI.Widget.Widget {
|
|
|
431
431
|
|
|
432
432
|
async #fetchGridNodes(): Promise<SDK.DOMModel.DOMNode[]> {
|
|
433
433
|
return await this.#fetchNodesByStyle([
|
|
434
|
-
{name: 'display', value: 'grid'},
|
|
435
|
-
{name: 'display', value: 'inline-
|
|
434
|
+
{name: 'display', value: 'grid'},
|
|
435
|
+
{name: 'display', value: 'inline-grid'},
|
|
436
|
+
{name: 'display', value: 'grid-lanes'},
|
|
437
|
+
{name: 'display', value: 'inline-grid-lanes'},
|
|
436
438
|
]);
|
|
437
439
|
}
|
|
438
440
|
|
|
@@ -37,7 +37,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
37
37
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
38
38
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
39
39
|
import * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
40
|
-
import
|
|
40
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
41
41
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
42
42
|
|
|
43
43
|
import * as ElementsComponents from './components/components.js';
|
|
@@ -77,7 +77,7 @@ export class ShortcutTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
77
77
|
ElementsComponents.AdornerManager.RegisteredAdorners.REVEAL);
|
|
78
78
|
const name = config.name;
|
|
79
79
|
const adornerContent = document.createElement('span');
|
|
80
|
-
const linkIcon =
|
|
80
|
+
const linkIcon = createIcon('select-element');
|
|
81
81
|
const slotText = document.createElement('span');
|
|
82
82
|
slotText.textContent = name;
|
|
83
83
|
adornerContent.append(linkIcon);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import {createIcon} from '../../ui/kit/kit.js';
|
|
7
7
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
8
|
|
|
9
9
|
import type * as ElementsComponents from './components/components.js';
|
|
@@ -120,7 +120,7 @@ export class StyleEditorWidget extends UI.Widget.VBox {
|
|
|
120
120
|
static createTriggerButton(
|
|
121
121
|
pane: StylesSidebarPane, section: StylePropertiesSection, editorClass: {new(): Editor}, buttonTitle: string,
|
|
122
122
|
triggerKey: string): HTMLElement {
|
|
123
|
-
const triggerButton =
|
|
123
|
+
const triggerButton = createIcon('flex-wrap', 'styles-pane-button');
|
|
124
124
|
triggerButton.title = buttonTitle;
|
|
125
125
|
triggerButton.role = 'button';
|
|
126
126
|
|