chrome-devtools-frontend 1.0.1664496 → 1.0.1665921
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/.agents/skills/devtools-testing-guidance/SKILL.md +48 -0
- package/.agents/skills/devtools-ux-writing-refactor/SKILL.md +3 -3
- package/.agents/skills/repro-flaky-tests/SKILL.md +2 -2
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +2 -0
- package/.agents/skills/version-control/SKILL.md +4 -3
- package/docs/ui_engineering.md +89 -0
- package/eslint.config.mjs +9 -2
- package/front_end/Images/rollup.config.mjs +1 -1
- package/front_end/Tests.js +15 -16
- package/front_end/core/common/Gzip.ts +2 -2
- package/front_end/core/common/Settings.ts +4 -20
- package/front_end/core/common/Srcset.ts +1 -1
- package/front_end/core/common/VersionController.ts +1 -1
- package/front_end/core/host/AidaClient.ts +19 -4
- package/front_end/core/host/AidaGcaTranslation.ts +2 -2
- package/front_end/core/host/GcaClient.ts +2 -2
- package/front_end/core/host/GdpClient.ts +3 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +1 -1
- package/front_end/core/host/ResourceLoader.ts +15 -15
- package/front_end/core/protocol_client/DevToolsCDPConnection.ts +2 -2
- package/front_end/core/protocol_client/InspectorBackend.ts +1 -1
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSMatchedStyles.ts +78 -3
- package/front_end/core/sdk/CSSMetadata.ts +17 -12
- package/front_end/core/sdk/CSSProperty.ts +1 -1
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +2 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +3 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +1 -1
- package/front_end/core/sdk/Connections.ts +1 -1
- package/front_end/core/sdk/DebuggerModel.ts +13 -13
- package/front_end/core/sdk/NetworkManager.ts +19 -19
- package/front_end/core/sdk/NetworkRequest.ts +57 -57
- package/front_end/core/sdk/OverlayModel.ts +1 -1
- package/front_end/core/sdk/PageResourceLoader.ts +2 -2
- package/front_end/core/sdk/RehydratingConnection.ts +5 -5
- package/front_end/core/sdk/ScreenCaptureModel.ts +1 -1
- package/front_end/core/sdk/Script.ts +2 -2
- package/front_end/core/sdk/ServerTiming.ts +7 -7
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +1 -1
- package/front_end/core/sdk/ServiceWorkerManager.ts +11 -11
- package/front_end/core/sdk/SourceMapScopeChainEntry.ts +2 -2
- package/front_end/core/sdk/SourceMapScopesInfo.ts +1 -1
- package/front_end/core/sdk/StorageKeyManager.ts +1 -1
- package/front_end/core/sdk/sdk-meta.ts +98 -98
- package/front_end/devtools_compatibility.js +15 -13
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +4 -8
- package/front_end/entrypoints/main/MainImpl.ts +2 -3
- package/front_end/entrypoints/main/main-meta.ts +1 -16
- package/front_end/entrypoints/shell/shell.ts +1 -0
- package/front_end/entrypoints/trace_app/trace_app.ts +1 -0
- package/front_end/foundation/README.md +1 -1
- package/front_end/foundation/Universe.test.api.ts +73 -0
- package/front_end/foundation/Universe.ts +22 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/SupportedCSSProperties.js +1 -1
- package/front_end/generated/protocol.ts +19 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/BuiltInAi.ts +1 -1
- package/front_end/models/ai_assistance/ChangeManager.ts +0 -70
- package/front_end/models/ai_assistance/ExtensionScope.ts +2 -36
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +9 -9
- package/front_end/models/ai_assistance/agents/AiAgent.ts +10 -2
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +21 -21
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +4 -4
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +0 -5
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +11 -4
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +8 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +14 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +2 -2
- package/front_end/models/ai_assistance/performance/AICallTree.ts +2 -2
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +1 -1
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +9 -2
- package/front_end/models/ai_assistance/tools/GetStyles.ts +4 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +2 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -2
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -2
- package/front_end/models/badges/badges-meta.ts +27 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -3
- package/front_end/models/bindings/ContentProviderBasedProject.ts +1 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +6 -7
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +5 -4
- package/front_end/models/bindings/PresentationConsoleMessageHelper.ts +72 -29
- package/front_end/models/bindings/ResourceMapping.ts +38 -32
- package/front_end/models/bindings/ResourceScriptMapping.ts +5 -7
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -1
- package/front_end/models/har/Writer.ts +2 -2
- package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +1 -1
- package/front_end/models/issues_manager/GenericIssue.ts +1 -1
- package/front_end/models/issues_manager/IssuesManager.ts +14 -5
- package/front_end/models/issues_manager/PartitioningBlobURLIssue.ts +1 -1
- package/front_end/models/issues_manager/SRIMessageSignatureIssue.ts +2 -2
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +13 -2
- package/front_end/models/issues_manager/issues_manager.ts +0 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +22 -5
- package/front_end/models/live-metrics/web-vitals-injected/rollup.config.mjs +1 -1
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +10 -4
- package/front_end/models/logs/logs-meta.ts +23 -16
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +2 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +1 -1
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +1 -1
- package/front_end/models/source_map_scopes/NamesResolver.ts +104 -86
- package/front_end/models/source_map_scopes/ScopeChainModel.ts +6 -2
- package/front_end/models/stack_trace/StackTraceModel.ts +1 -1
- package/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +1 -1
- package/front_end/models/trace/handlers/UserTimingsHandler.ts +17 -6
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -1
- package/front_end/models/trace/helpers/Timing.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +1 -1
- package/front_end/models/trace/insights/DocumentLatency.ts +3 -3
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +2 -2
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +14 -9
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +2 -15
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -2
- package/front_end/panels/ai_assistance/components/ChatInput.ts +23 -19
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -18
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -35
- package/front_end/panels/ai_assistance/components/DisabledWidget.ts +1 -1
- package/front_end/panels/ai_assistance/components/ExploreWidget.ts +4 -4
- package/front_end/panels/ai_assistance/components/ImageResize.ts +74 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +2 -2
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +28 -29
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/animation/animationTimeline.css +0 -2
- package/front_end/panels/application/AppManifestView.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -1
- package/front_end/panels/application/CookieItemsView.ts +1 -1
- package/front_end/panels/application/CrashReportContextView.ts +3 -3
- package/front_end/panels/application/DeviceBoundSessionsModel.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +1 -1
- package/front_end/panels/application/DeviceBoundSessionsView.ts +1 -1
- package/front_end/panels/application/IndexedDBViews.ts +1 -1
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -1
- package/front_end/panels/application/OriginTrialTreeView.ts +1 -1
- package/front_end/panels/application/ServiceWorkersView.ts +6 -6
- package/front_end/panels/application/StorageBucketsTreeElement.ts +1 -1
- package/front_end/panels/application/StorageItemsToolbar.ts +3 -3
- package/front_end/panels/application/WebMCPView.ts +7 -5
- package/front_end/panels/application/components/AdsView.ts +21 -6
- package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
- package/front_end/panels/application/components/ProtocolHandlersView.ts +1 -1
- package/front_end/panels/application/components/StorageMetadataView.ts +1 -1
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +2 -1
- package/front_end/panels/application/preloading/components/PreloadingString.ts +3 -3
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -1
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +1 -1
- package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +2 -2
- package/front_end/panels/changes/ChangesSidebar.ts +2 -2
- package/front_end/panels/changes/ChangesView.ts +4 -5
- package/front_end/panels/changes/CombinedDiffView.ts +3 -3
- package/front_end/panels/changes/changes-meta.ts +2 -2
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +1 -1
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +3 -3
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/DOMLinkifier.ts +1 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +2 -2
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +1 -1
- package/front_end/panels/common/aiCodeCompletionDisclaimer.css +0 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +3 -3
- package/front_end/panels/console/ConsolePrompt.ts +6 -4
- package/front_end/panels/console/ConsoleSidebar.ts +8 -10
- package/front_end/panels/console_counters/WarningErrorCounter.ts +10 -11
- package/front_end/panels/coverage/CoverageView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +3 -3
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +1 -1
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +1 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +3 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +3 -3
- package/front_end/panels/elements/EventListenersWidget.ts +1 -3
- package/front_end/panels/elements/LayoutPane.ts +23 -13
- package/front_end/panels/elements/StandaloneStylesContainer.ts +7 -7
- package/front_end/panels/elements/StylePropertiesSection.ts +33 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -5
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +4 -3
- package/front_end/panels/elements/elements-meta.ts +18 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +100 -40
- package/front_end/panels/emulation/DeviceModeView.ts +5 -4
- package/front_end/panels/emulation/MediaQueryInspector.ts +35 -19
- package/front_end/panels/event_listeners/EventListenersView.ts +4 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +8 -9
- package/front_end/panels/explain/explain-meta.ts +3 -3
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +135 -167
- package/front_end/panels/layer_viewer/Layers3DView.ts +10 -23
- package/front_end/panels/layer_viewer/layer_viewer-meta.ts +27 -0
- package/front_end/panels/lighthouse/LighthouseController.ts +44 -55
- package/front_end/panels/lighthouse/LighthousePanel.ts +9 -9
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseStartView.ts +9 -12
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +33 -33
- package/front_end/panels/lighthouse/RadioSetting.ts +1 -1
- package/front_end/panels/lighthouse/lighthouse-meta.ts +131 -1
- package/front_end/panels/media/EventDisplayTable.ts +67 -94
- package/front_end/panels/media/PlayerListView.ts +1 -1
- package/front_end/panels/media/eventDisplayTable.css +9 -4
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +5 -5
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +1 -1
- package/front_end/panels/network/EventSourceMessagesView.ts +98 -107
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +1 -1
- package/front_end/panels/network/RequestConditionsDrawer.ts +2 -2
- package/front_end/panels/network/RequestCookiesView.ts +2 -2
- package/front_end/panels/network/RequestHeadersView.ts +5 -5
- package/front_end/panels/network/RequestPayloadView.ts +4 -4
- package/front_end/panels/network/RequestTimingView.ts +2 -2
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +1 -1
- package/front_end/panels/network/eventSourceMessagesView.css +12 -3
- package/front_end/panels/network/networkTimingTable.css +2 -2
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +1 -1
- package/front_end/panels/profiler/BottomUpProfileDataGrid.ts +25 -29
- package/front_end/panels/profiler/HeapProfileView.ts +308 -247
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +13 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +30 -10
- package/front_end/panels/profiler/HeapTimelineOverview.ts +5 -2
- package/front_end/panels/profiler/ProfileDataGrid.ts +128 -157
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +17 -5
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/profiler/TopDownProfileDataGrid.ts +17 -21
- package/front_end/panels/profiler/profilesPanel.css +9 -13
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/recorder/CreateRecordingView.ts +4 -4
- package/front_end/panels/recorder/RecorderPanel.ts +6 -6
- package/front_end/panels/recorder/RecordingView.ts +1 -1
- package/front_end/panels/recorder/ReplaySection.ts +1 -1
- package/front_end/panels/recorder/StepView.ts +1 -1
- package/front_end/panels/recorder/injected/rollup.config.mjs +1 -1
- package/front_end/panels/search/SearchView.ts +1 -1
- package/front_end/panels/security/SecurityPanel.ts +54 -41
- package/front_end/panels/sensors/LocationsSettingsTab.ts +246 -233
- package/front_end/panels/sensors/SensorsView.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +11 -10
- package/front_end/panels/settings/SettingsScreen.ts +29 -24
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +5 -5
- package/front_end/panels/sources/BreakpointEditDialog.ts +2 -2
- package/front_end/panels/sources/BreakpointsView.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +2 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +25 -22
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +3 -1
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -5
- package/front_end/panels/sources/sources-meta.ts +1 -1
- package/front_end/panels/timeline/CountersGraph.ts +1 -2
- package/front_end/panels/timeline/ExtensionTrackAppender.ts +1 -1
- package/front_end/panels/timeline/TimelineDetailsView.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -2
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +1 -1
- package/front_end/panels/timeline/TimelinePanel.ts +53 -81
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +10 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +18 -4
- package/front_end/panels/timeline/TrackConfigBanner.ts +1 -1
- package/front_end/panels/timeline/components/ExportTraceOptions.ts +1 -1
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +8 -9
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +1 -1
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +1 -1
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +2 -2
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +1 -1
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +1 -1
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +5 -0
- package/front_end/panels/timeline/overlays/components/TimespanBreakdownOverlay.ts +13 -8
- package/front_end/panels/timeline/overlays/components/timespanBreakdownOverlay.css +1 -0
- package/front_end/panels/timeline/timeline-meta.ts +169 -0
- package/front_end/panels/timeline/timelineFlameChartView.css +5 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +9 -9
- package/front_end/panels/whats_new/resources/WNDT.md +7 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/web-vitals/README.chromium +2 -2
- package/front_end/third_party/web-vitals/package/README.md +120 -19
- package/front_end/third_party/web-vitals/package/attribution.d.ts +16 -0
- package/front_end/third_party/web-vitals/package/attribution.js +18 -0
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +1 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +53 -32
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +43 -12
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +21 -3
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +30 -24
- package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.d.ts +3 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/FCPEntryManager.js +18 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +2 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +18 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.js +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getLoadState.js +7 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +4 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +7 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +20 -11
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.js +8 -3
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.d.ts +3 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +19 -4
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.d.ts +3 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/softNavs.js +38 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/whenIdleOrHidden.js +5 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +30 -11
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +36 -4
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +42 -22
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +109 -30
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +25 -7
- package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +24 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/fcp.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +14 -6
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/types/ttfb.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +26 -4
- package/front_end/third_party/web-vitals/package/package.json +21 -22
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +62 -39
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +52 -15
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +25 -7
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +43 -37
- package/front_end/third_party/web-vitals/package/src/lib/{polyfills/getFirstHiddenTimePolyfill.ts → FCPEntryManager.ts} +4 -14
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +22 -2
- package/front_end/third_party/web-vitals/package/src/lib/LCPEntryManager.ts +1 -0
- package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getLoadState.ts +11 -12
- package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +4 -1
- package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +24 -11
- package/front_end/third_party/web-vitals/package/src/lib/initUnique.ts +12 -4
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +26 -5
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/softNavs.ts +48 -0
- package/front_end/third_party/web-vitals/package/src/lib/whenIdleOrHidden.ts +12 -4
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +75 -18
- package/front_end/third_party/web-vitals/package/src/onFCP.ts +66 -7
- package/front_end/third_party/web-vitals/package/src/onINP.ts +100 -39
- package/front_end/third_party/web-vitals/package/src/onLCP.ts +169 -34
- package/front_end/third_party/web-vitals/package/src/onTTFB.ts +50 -13
- package/front_end/third_party/web-vitals/package/src/types/base.ts +31 -10
- package/front_end/third_party/web-vitals/package/src/types/fcp.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +14 -6
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/types/ttfb.ts +2 -2
- package/front_end/third_party/web-vitals/package/src/types.ts +32 -9
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +11 -11
- package/front_end/third_party/web-vitals/rebuild.sh +2 -2
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +2 -0
- package/front_end/ui/components/buttons/Button.ts +16 -0
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightManager.ts +6 -1
- package/front_end/ui/components/highlighting/highlighting.ts +1 -1
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +2 -2
- package/front_end/ui/components/settings/SettingCheckbox.ts +12 -7
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +2 -2
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +6 -6
- package/front_end/ui/components/text_editor/javascript.ts +3 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +12 -2
- package/front_end/ui/legacy/ListControl.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +17 -19
- package/front_end/ui/legacy/Toolbar.ts +4 -1
- package/front_end/ui/legacy/Treeoutline.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/spectrum.css +1 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -1
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +50 -4
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +4 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +8 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +14 -11
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +1 -1
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +15 -5
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +4 -4
- package/front_end/ui/legacy/components/utils/Linkifier.ts +5 -1
- package/front_end/ui/lit/render.ts +1 -1
- package/front_end/ui/settings/SettingUIRegistration.ts +8 -3
- package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/inspector_overlay/main.ts +1 -1
- package/mcp/mcp.ts +5 -4
- package/package.json +13 -13
- package/front_end/models/ai_assistance/AgentProject.ts +0 -261
- package/front_end/models/ai_assistance/agents/PatchAgent.ts +0 -306
- package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +0 -45
- package/front_end/models/text_utils/text_utils.ts +0 -5
- package/front_end/panels/ai_assistance/PatchWidget.ts +0 -867
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +0 -368
- package/front_end/panels/ai_assistance/selectWorkspaceDialog.css +0 -92
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2018 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
|
|
6
5
|
import '../../ui/kit/kit.js';
|
|
7
6
|
|
|
@@ -10,6 +9,7 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
10
9
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
11
10
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
12
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
|
+
import {html, type LitTemplate, render} from '../../ui/lit/lit.js';
|
|
13
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
14
14
|
|
|
15
15
|
import locationsSettingsTabStyles from './locationsSettingsTab.css.js';
|
|
@@ -114,31 +114,114 @@ const UIStrings = {
|
|
|
114
114
|
const str_ = i18n.i18n.registerUIStrings('panels/sensors/LocationsSettingsTab.ts', UIStrings);
|
|
115
115
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
116
116
|
|
|
117
|
+
function renderItemView(location: LocationDescription): LitTemplate {
|
|
118
|
+
// clang-format off
|
|
119
|
+
return html`
|
|
120
|
+
<div class="locations-list-item" role="row">
|
|
121
|
+
<div class="locations-list-text locations-list-title" role="cell">
|
|
122
|
+
<div class="locations-list-title-text" title=${location.title}>${location.title}</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="locations-list-separator"></div>
|
|
125
|
+
<div class="locations-list-text" role="cell">${location.lat}</div>
|
|
126
|
+
<div class="locations-list-separator"></div>
|
|
127
|
+
<div class="locations-list-text" role="cell">${location.long}</div>
|
|
128
|
+
<div class="locations-list-separator"></div>
|
|
129
|
+
<div class="locations-list-text" role="cell">${location.timezoneId}</div>
|
|
130
|
+
<div class="locations-list-separator"></div>
|
|
131
|
+
<div class="locations-list-text" role="cell">${location.locale}</div>
|
|
132
|
+
<div class="locations-list-separator"></div>
|
|
133
|
+
<div class="locations-list-text" role="cell">${
|
|
134
|
+
location.accuracy ?? SDK.EmulationModel.Location.DEFAULT_ACCURACY}</div>
|
|
135
|
+
</div>`;
|
|
136
|
+
// clang-format on
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface EditorInputControls {
|
|
140
|
+
titleInput: Element;
|
|
141
|
+
latInput: Element;
|
|
142
|
+
longInput: Element;
|
|
143
|
+
timezoneIdInput: Element;
|
|
144
|
+
localeInput: Element;
|
|
145
|
+
accuracyInput: Element;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function renderEditorView(controls: EditorInputControls): LitTemplate {
|
|
149
|
+
// clang-format off
|
|
150
|
+
return html`
|
|
151
|
+
<div class="locations-edit-row">
|
|
152
|
+
<div class="locations-list-text locations-list-title">${i18nString(UIStrings.locationName)}</div>
|
|
153
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
154
|
+
<div class="locations-list-text">${i18nString(UIStrings.lat)}</div>
|
|
155
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
156
|
+
<div class="locations-list-text">${i18nString(UIStrings.long)}</div>
|
|
157
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
158
|
+
<div class="locations-list-text">${i18nString(UIStrings.timezoneId)}</div>
|
|
159
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
160
|
+
<div class="locations-list-text">${i18nString(UIStrings.locale)}</div>
|
|
161
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
162
|
+
<div class="locations-list-text">${i18nString(UIStrings.accuracy)}</div>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="locations-edit-row">
|
|
165
|
+
<div class="locations-list-text locations-list-title locations-input-container">${controls.titleInput}</div>
|
|
166
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
167
|
+
<div class="locations-list-text locations-input-container">${controls.latInput}</div>
|
|
168
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
169
|
+
<div class="locations-list-text locations-list-text-longitude locations-input-container">${controls.longInput}</div>
|
|
170
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
171
|
+
<div class="locations-list-text locations-input-container">${controls.timezoneIdInput}</div>
|
|
172
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
173
|
+
<div class="locations-list-text locations-input-container">${controls.localeInput}</div>
|
|
174
|
+
<div class="locations-list-separator locations-list-separator-invisible"></div>
|
|
175
|
+
<div class="locations-list-text locations-input-container">${controls.accuracyInput}</div>
|
|
176
|
+
</div>`;
|
|
177
|
+
// clang-format on
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
interface LocationsViewInput {
|
|
181
|
+
onAddLocation: () => void;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export type ViewOutput = undefined;
|
|
185
|
+
|
|
186
|
+
export const DEFAULT_VIEW = (input: LocationsViewInput, _output: ViewOutput, target: HTMLElement): void => {
|
|
187
|
+
// clang-format off
|
|
188
|
+
render(html`
|
|
189
|
+
<style>${locationsSettingsTabStyles}</style>
|
|
190
|
+
<div class="settings-card-container-wrapper">
|
|
191
|
+
<div class="settings-card-container">
|
|
192
|
+
<devtools-card .heading=${i18nString(UIStrings.locations)}>
|
|
193
|
+
<div class="list-container"></div>
|
|
194
|
+
<devtools-button
|
|
195
|
+
class="add-locations-button"
|
|
196
|
+
.variant=${Buttons.Button.Variant.OUTLINED}
|
|
197
|
+
.iconName=${'plus'}
|
|
198
|
+
.jslogContext=${'emulation.add-location'}
|
|
199
|
+
@click=${input.onAddLocation}>
|
|
200
|
+
${i18nString(UIStrings.addLocation)}
|
|
201
|
+
</devtools-button>
|
|
202
|
+
</devtools-card>
|
|
203
|
+
</div>
|
|
204
|
+
</div>`, target);
|
|
205
|
+
// clang-format on
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export type View = typeof DEFAULT_VIEW;
|
|
117
209
|
export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidget.Delegate<LocationDescription> {
|
|
118
210
|
private readonly list: UI.ListWidget.ListWidget<LocationDescription>;
|
|
119
211
|
private readonly customSetting: Common.Settings.Setting<LocationDescription[]>;
|
|
120
212
|
private editor?: UI.ListWidget.Editor<LocationDescription>;
|
|
213
|
+
#view: View;
|
|
121
214
|
|
|
122
|
-
constructor() {
|
|
123
|
-
super({
|
|
215
|
+
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
216
|
+
super(element, {
|
|
124
217
|
jslog: `${VisualLogging.pane('emulation-locations')}`,
|
|
125
218
|
useShadowDom: true,
|
|
126
219
|
});
|
|
127
|
-
this
|
|
128
|
-
|
|
129
|
-
const settingsContent =
|
|
130
|
-
this.contentElement.createChild('div', 'settings-card-container-wrapper').createChild('div');
|
|
131
|
-
settingsContent.classList.add('settings-card-container');
|
|
132
|
-
|
|
133
|
-
const locationsCard = settingsContent.createChild('devtools-card');
|
|
134
|
-
locationsCard.heading = i18nString(UIStrings.locations);
|
|
135
|
-
|
|
136
|
-
const listContainer = locationsCard.createChild('div');
|
|
220
|
+
this.#view = view;
|
|
137
221
|
|
|
138
222
|
this.list = new UI.ListWidget.ListWidget(this, undefined, true);
|
|
139
223
|
this.list.element.classList.add('locations-list');
|
|
140
224
|
this.list.registerRequiredCSS(locationsSettingsTabStyles);
|
|
141
|
-
this.list.show(listContainer);
|
|
142
225
|
this.customSetting =
|
|
143
226
|
Common.Settings.Settings.instance().moduleSetting<LocationDescription[]>('emulation.locations');
|
|
144
227
|
const list =
|
|
@@ -165,17 +248,6 @@ export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidge
|
|
|
165
248
|
return location;
|
|
166
249
|
}
|
|
167
250
|
|
|
168
|
-
const addButton = new Buttons.Button.Button();
|
|
169
|
-
addButton.classList.add('add-locations-button');
|
|
170
|
-
addButton.data = {
|
|
171
|
-
variant: Buttons.Button.Variant.OUTLINED,
|
|
172
|
-
iconName: 'plus',
|
|
173
|
-
jslogContext: 'emulation.add-location',
|
|
174
|
-
};
|
|
175
|
-
addButton.textContent = i18nString(UIStrings.addLocation);
|
|
176
|
-
addButton.addEventListener('click', () => this.addButtonClicked());
|
|
177
|
-
locationsCard.append(addButton);
|
|
178
|
-
|
|
179
251
|
this.customSetting.set(list);
|
|
180
252
|
this.customSetting.addChangeListener(this.locationsUpdated, this);
|
|
181
253
|
}
|
|
@@ -185,6 +257,17 @@ export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidge
|
|
|
185
257
|
this.locationsUpdated();
|
|
186
258
|
}
|
|
187
259
|
|
|
260
|
+
override performUpdate(): void {
|
|
261
|
+
const viewInput = {
|
|
262
|
+
onAddLocation: () => this.addButtonClicked(),
|
|
263
|
+
};
|
|
264
|
+
this.#view(viewInput, undefined, this.contentElement as HTMLElement);
|
|
265
|
+
|
|
266
|
+
const listContainer = this.contentElement.querySelector('.list-container');
|
|
267
|
+
if (listContainer) {
|
|
268
|
+
this.list.show(listContainer);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
188
271
|
private locationsUpdated(): void {
|
|
189
272
|
this.list.clear();
|
|
190
273
|
|
|
@@ -194,6 +277,7 @@ export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidge
|
|
|
194
277
|
}
|
|
195
278
|
|
|
196
279
|
this.list.appendSeparator();
|
|
280
|
+
this.requestUpdate();
|
|
197
281
|
}
|
|
198
282
|
|
|
199
283
|
private addButtonClicked(): void {
|
|
@@ -203,39 +287,15 @@ export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidge
|
|
|
203
287
|
long: 0,
|
|
204
288
|
timezoneId: '',
|
|
205
289
|
locale: '',
|
|
206
|
-
accuracy: SDK.EmulationModel.Location.DEFAULT_ACCURACY
|
|
290
|
+
accuracy: SDK.EmulationModel.Location.DEFAULT_ACCURACY,
|
|
207
291
|
});
|
|
208
292
|
}
|
|
209
293
|
|
|
210
294
|
renderItem(location: LocationDescription, _editable: boolean): Element {
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
title.role = 'cell';
|
|
216
|
-
const titleText = title.createChild('div', 'locations-list-title-text');
|
|
217
|
-
titleText.textContent = location.title;
|
|
218
|
-
UI.Tooltip.Tooltip.install(titleText, location.title);
|
|
219
|
-
element.createChild('div', 'locations-list-separator');
|
|
220
|
-
const lat = element.createChild('div', 'locations-list-text');
|
|
221
|
-
lat.textContent = String(location.lat);
|
|
222
|
-
lat.role = 'cell';
|
|
223
|
-
element.createChild('div', 'locations-list-separator');
|
|
224
|
-
const long = element.createChild('div', 'locations-list-text');
|
|
225
|
-
long.textContent = String(location.long);
|
|
226
|
-
long.role = 'cell';
|
|
227
|
-
element.createChild('div', 'locations-list-separator');
|
|
228
|
-
const timezoneId = element.createChild('div', 'locations-list-text');
|
|
229
|
-
timezoneId.textContent = location.timezoneId;
|
|
230
|
-
timezoneId.role = 'cell';
|
|
231
|
-
element.createChild('div', 'locations-list-separator');
|
|
232
|
-
const locale = element.createChild('div', 'locations-list-text');
|
|
233
|
-
locale.textContent = location.locale;
|
|
234
|
-
locale.role = 'cell';
|
|
235
|
-
element.createChild('div', 'locations-list-separator');
|
|
236
|
-
element.createChild('div', 'locations-list-text').textContent =
|
|
237
|
-
String(location.accuracy || SDK.EmulationModel.Location.DEFAULT_ACCURACY);
|
|
238
|
-
return element;
|
|
295
|
+
const fragment = document.createDocumentFragment();
|
|
296
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
297
|
+
render(renderItemView(location), fragment);
|
|
298
|
+
return fragment.firstElementChild as Element;
|
|
239
299
|
}
|
|
240
300
|
|
|
241
301
|
removeItemRequested(_item: LocationDescription, index: number): void {
|
|
@@ -271,7 +331,7 @@ export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidge
|
|
|
271
331
|
editor.control('long').value = String(location.long);
|
|
272
332
|
editor.control('timezone-id').value = location.timezoneId;
|
|
273
333
|
editor.control('locale').value = location.locale;
|
|
274
|
-
editor.control('accuracy').value = String(location.accuracy
|
|
334
|
+
editor.control('accuracy').value = String(location.accuracy ?? SDK.EmulationModel.Location.DEFAULT_ACCURACY);
|
|
275
335
|
return editor;
|
|
276
336
|
}
|
|
277
337
|
|
|
@@ -284,196 +344,149 @@ export class LocationsSettingsTab extends UI.Widget.VBox implements UI.ListWidge
|
|
|
284
344
|
this.editor = editor;
|
|
285
345
|
const content = editor.contentElement();
|
|
286
346
|
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
titles.createChild('div', 'locations-list-text').textContent = i18nString(UIStrings.timezoneId);
|
|
296
|
-
titles.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
297
|
-
titles.createChild('div', 'locations-list-text').textContent = i18nString(UIStrings.locale);
|
|
298
|
-
titles.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
299
|
-
titles.createChild('div', 'locations-list-text').textContent = i18nString(UIStrings.accuracy);
|
|
300
|
-
|
|
301
|
-
const fields = content.createChild('div', 'locations-edit-row');
|
|
302
|
-
fields.createChild('div', 'locations-list-text locations-list-title locations-input-container')
|
|
303
|
-
.appendChild(editor.createInput('title', 'text', i18nString(UIStrings.locationName), titleValidator));
|
|
304
|
-
fields.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
305
|
-
|
|
306
|
-
let cell = fields.createChild('div', 'locations-list-text locations-input-container');
|
|
307
|
-
cell.appendChild(editor.createInput('lat', 'text', i18nString(UIStrings.latitude), latValidator));
|
|
308
|
-
fields.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
309
|
-
|
|
310
|
-
cell = fields.createChild('div', 'locations-list-text locations-list-text-longitude locations-input-container');
|
|
311
|
-
cell.appendChild(editor.createInput('long', 'text', i18nString(UIStrings.longitude), longValidator));
|
|
312
|
-
fields.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
313
|
-
|
|
314
|
-
cell = fields.createChild('div', 'locations-list-text locations-input-container');
|
|
315
|
-
cell.appendChild(editor.createInput('timezone-id', 'text', i18nString(UIStrings.timezoneId), timezoneIdValidator));
|
|
316
|
-
fields.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
317
|
-
|
|
318
|
-
cell = fields.createChild('div', 'locations-list-text locations-input-container');
|
|
319
|
-
cell.appendChild(editor.createInput('locale', 'text', i18nString(UIStrings.locale), localeValidator));
|
|
320
|
-
fields.createChild('div', 'locations-list-separator locations-list-separator-invisible');
|
|
321
|
-
|
|
322
|
-
cell = fields.createChild('div', 'locations-list-text locations-input-container');
|
|
323
|
-
cell.appendChild(editor.createInput('accuracy', 'text', i18nString(UIStrings.accuracy), accuracyValidator));
|
|
324
|
-
|
|
325
|
-
return editor;
|
|
326
|
-
|
|
327
|
-
function titleValidator(
|
|
328
|
-
_item: LocationDescription, _index: number, input: UI.ListWidget.EditorControl): UI.ListWidget.ValidatorResult {
|
|
329
|
-
const maxLength = 50;
|
|
330
|
-
const value = input.value.trim();
|
|
331
|
-
|
|
332
|
-
let errorMessage;
|
|
333
|
-
if (!value.length) {
|
|
334
|
-
errorMessage = i18nString(UIStrings.locationNameCannotBeEmpty);
|
|
335
|
-
} else if (value.length > maxLength) {
|
|
336
|
-
errorMessage = i18nString(UIStrings.locationNameMustBeLessThanS, {PH1: maxLength});
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
if (errorMessage) {
|
|
340
|
-
return {valid: false, errorMessage};
|
|
341
|
-
}
|
|
342
|
-
return {
|
|
343
|
-
valid: true,
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function latValidator(
|
|
348
|
-
_item: LocationDescription, _index: number, input: UI.ListWidget.EditorControl): UI.ListWidget.ValidatorResult {
|
|
349
|
-
const minLat = -90;
|
|
350
|
-
const maxLat = 90;
|
|
351
|
-
const value = input.value.trim();
|
|
352
|
-
const parsedValue = Number(value);
|
|
353
|
-
|
|
354
|
-
if (!value) {
|
|
355
|
-
return {
|
|
356
|
-
valid: true,
|
|
347
|
+
const createValidator = (validator: (value: string) => string | null) =>
|
|
348
|
+
(_item: LocationDescription, _index: number,
|
|
349
|
+
input: UI.ListWidget.EditorControl): UI.ListWidget.ValidatorResult => {
|
|
350
|
+
const errorMessage = validator(input.value);
|
|
351
|
+
if (errorMessage) {
|
|
352
|
+
return {valid: false, errorMessage};
|
|
353
|
+
}
|
|
354
|
+
return {valid: true};
|
|
357
355
|
};
|
|
358
|
-
}
|
|
359
356
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
357
|
+
const titleInput =
|
|
358
|
+
editor.createInput('title', 'text', i18nString(UIStrings.locationName), createValidator(validateTitle));
|
|
359
|
+
const latInput =
|
|
360
|
+
editor.createInput('lat', 'text', i18nString(UIStrings.latitude), createValidator(validateLatitude));
|
|
361
|
+
const longInput =
|
|
362
|
+
editor.createInput('long', 'text', i18nString(UIStrings.longitude), createValidator(validateLongitude));
|
|
363
|
+
const timezoneIdInput = editor.createInput('timezone-id', 'text', i18nString(UIStrings.timezoneId),
|
|
364
|
+
createValidator(validateTimezoneId));
|
|
365
|
+
const localeInput =
|
|
366
|
+
editor.createInput('locale', 'text', i18nString(UIStrings.locale), createValidator(validateLocale));
|
|
367
|
+
const accuracyInput =
|
|
368
|
+
editor.createInput('accuracy', 'text', i18nString(UIStrings.accuracy), createValidator(validateAccuracy));
|
|
369
|
+
|
|
370
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
371
|
+
render(renderEditorView({
|
|
372
|
+
titleInput,
|
|
373
|
+
latInput,
|
|
374
|
+
longInput,
|
|
375
|
+
timezoneIdInput,
|
|
376
|
+
localeInput,
|
|
377
|
+
accuracyInput,
|
|
378
|
+
}),
|
|
379
|
+
content as HTMLElement);
|
|
368
380
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
381
|
+
return editor;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
export interface LocationDescription {
|
|
385
|
+
title: string;
|
|
386
|
+
lat: number;
|
|
387
|
+
long: number;
|
|
388
|
+
timezoneId: string;
|
|
389
|
+
locale: string;
|
|
390
|
+
accuracy?: number;
|
|
391
|
+
}
|
|
376
392
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
const maxLong = 180;
|
|
381
|
-
const value = input.value.trim();
|
|
382
|
-
const parsedValue = Number(value);
|
|
393
|
+
export function validateTitle(value: string): string|null {
|
|
394
|
+
const maxLength = 50;
|
|
395
|
+
const trimmedValue = value.trim();
|
|
383
396
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
397
|
+
if (!trimmedValue.length) {
|
|
398
|
+
return i18nString(UIStrings.locationNameCannotBeEmpty);
|
|
399
|
+
}
|
|
400
|
+
if (trimmedValue.length > maxLength) {
|
|
401
|
+
return i18nString(UIStrings.locationNameMustBeLessThanS, {PH1: maxLength});
|
|
402
|
+
}
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
389
405
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
} else if (parseFloat(value) > maxLong) {
|
|
396
|
-
errorMessage = i18nString(UIStrings.longitudeMustBeLessThanOrEqualTo, {PH1: maxLong});
|
|
397
|
-
}
|
|
406
|
+
export function validateLatitude(value: string): string|null {
|
|
407
|
+
const minLat = -90;
|
|
408
|
+
const maxLat = 90;
|
|
409
|
+
const trimmedValue = value.trim();
|
|
410
|
+
const parsedValue = Number(trimmedValue);
|
|
398
411
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
412
|
+
if (!trimmedValue) {
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
if (Number.isNaN(parsedValue)) {
|
|
416
|
+
return i18nString(UIStrings.latitudeMustBeANumber);
|
|
417
|
+
}
|
|
418
|
+
if (parsedValue < minLat) {
|
|
419
|
+
return i18nString(UIStrings.latitudeMustBeGreaterThanOrEqual, {PH1: minLat});
|
|
420
|
+
}
|
|
421
|
+
if (parsedValue > maxLat) {
|
|
422
|
+
return i18nString(UIStrings.latitudeMustBeLessThanOrEqualToS, {PH1: maxLat});
|
|
423
|
+
}
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
406
426
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
// but instead tries to make sense of the input, even for
|
|
413
|
-
// weird-looking timezone IDs. There's not much point in validating
|
|
414
|
-
// the input other than checking if it contains at least one
|
|
415
|
-
// alphabetic character. The empty string resets the override,
|
|
416
|
-
// and is accepted as well.
|
|
417
|
-
if (value === '' || /[a-zA-Z]/.test(value)) {
|
|
418
|
-
return {
|
|
419
|
-
valid: true,
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
const errorMessage = i18nString(UIStrings.timezoneIdMustContainAlphabetic);
|
|
423
|
-
return {valid: false, errorMessage};
|
|
424
|
-
}
|
|
427
|
+
export function validateLongitude(value: string): string|null {
|
|
428
|
+
const minLong = -180;
|
|
429
|
+
const maxLong = 180;
|
|
430
|
+
const trimmedValue = value.trim();
|
|
431
|
+
const parsedValue = Number(trimmedValue);
|
|
425
432
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const errorMessage = i18nString(UIStrings.localeMustContainAlphabetic);
|
|
441
|
-
return {valid: false, errorMessage};
|
|
442
|
-
}
|
|
433
|
+
if (!trimmedValue) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
if (Number.isNaN(parsedValue)) {
|
|
437
|
+
return i18nString(UIStrings.longitudeMustBeANumber);
|
|
438
|
+
}
|
|
439
|
+
if (parsedValue < minLong) {
|
|
440
|
+
return i18nString(UIStrings.longitudeMustBeGreaterThanOr, {PH1: minLong});
|
|
441
|
+
}
|
|
442
|
+
if (parsedValue > maxLong) {
|
|
443
|
+
return i18nString(UIStrings.longitudeMustBeLessThanOrEqualTo, {PH1: maxLong});
|
|
444
|
+
}
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
443
447
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
448
|
+
export function validateTimezoneId(value: string): string|null {
|
|
449
|
+
const trimmedValue = value.trim();
|
|
450
|
+
// Chromium uses ICU's timezone implementation, which is very
|
|
451
|
+
// liberal in what it accepts. ICU does not simply use an allowlist
|
|
452
|
+
// but instead tries to make sense of the input, even for
|
|
453
|
+
// weird-looking timezone IDs. There's not much point in validating
|
|
454
|
+
// the input other than checking if it contains at least one
|
|
455
|
+
// alphabetic character. The empty string resets the override,
|
|
456
|
+
// and is accepted as well.
|
|
457
|
+
if (trimmedValue === '' || /[a-zA-Z]/.test(trimmedValue)) {
|
|
458
|
+
return null;
|
|
459
|
+
}
|
|
460
|
+
return i18nString(UIStrings.timezoneIdMustContainAlphabetic);
|
|
461
|
+
}
|
|
449
462
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
463
|
+
export function validateLocale(value: string): string|null {
|
|
464
|
+
const trimmedValue = value.trim();
|
|
465
|
+
// Similarly to timezone IDs, there's not much point in validating
|
|
466
|
+
// input locales other than checking if it contains at least two
|
|
467
|
+
// alphabetic characters.
|
|
468
|
+
// https://unicode.org/reports/tr35/#Unicode_language_identifier
|
|
469
|
+
// The empty string resets the override, and is accepted as
|
|
470
|
+
// well.
|
|
471
|
+
if (trimmedValue === '' || /[a-zA-Z]{2}/.test(trimmedValue)) {
|
|
472
|
+
return null;
|
|
473
|
+
}
|
|
474
|
+
return i18nString(UIStrings.localeMustContainAlphabetic);
|
|
475
|
+
}
|
|
455
476
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
errorMessage = i18nString(UIStrings.accuracyMustBeGreaterThanOrEqual, {PH1: minAccuracy});
|
|
461
|
-
}
|
|
477
|
+
export function validateAccuracy(value: string): string|null {
|
|
478
|
+
const minAccuracy = 0;
|
|
479
|
+
const trimmedValue = value.trim();
|
|
480
|
+
const parsedValue = Number(trimmedValue);
|
|
462
481
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
return {
|
|
467
|
-
valid: true,
|
|
468
|
-
};
|
|
469
|
-
}
|
|
482
|
+
if (!trimmedValue) {
|
|
483
|
+
return null;
|
|
470
484
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
accuracy?: number;
|
|
485
|
+
if (Number.isNaN(parsedValue)) {
|
|
486
|
+
return i18nString(UIStrings.accuracyMustBeANumber);
|
|
487
|
+
}
|
|
488
|
+
if (parsedValue < minAccuracy) {
|
|
489
|
+
return i18nString(UIStrings.accuracyMustBeGreaterThanOrEqual, {PH1: minAccuracy});
|
|
490
|
+
}
|
|
491
|
+
return null;
|
|
479
492
|
}
|
|
@@ -327,7 +327,7 @@ export const AI_SETTINGS_TAB_DEFAULT_VIEW: View = (input, _output, target): void
|
|
|
327
327
|
<div class="disclaimer-list">
|
|
328
328
|
${input.sharedDisclaimerBulletPoints.map(item =>
|
|
329
329
|
html`<div><devtools-icon .name=${item.icon} class="medium"></devtools-icon>
|
|
330
|
-
</div><div>${item.text}</div
|
|
330
|
+
</div><div>${item.text}</div>`,
|
|
331
331
|
)}
|
|
332
332
|
</div>
|
|
333
333
|
</div>
|
|
@@ -537,12 +537,12 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
537
537
|
enableSettingText: i18nString(UIStrings.enableConsoleInsights),
|
|
538
538
|
settingItems: [
|
|
539
539
|
{iconName: 'lightbulb', text: i18nString(UIStrings.explainConsole)},
|
|
540
|
-
{iconName: 'code', text: i18nString(UIStrings.receiveSuggestions)}
|
|
540
|
+
{iconName: 'code', text: i18nString(UIStrings.receiveSuggestions)},
|
|
541
541
|
],
|
|
542
542
|
toConsiderSettingItems: [{
|
|
543
543
|
iconName: 'google',
|
|
544
544
|
text: noLogging ? i18nString(UIStrings.consoleInsightsSendsDataNoLogging) :
|
|
545
|
-
i18nString(UIStrings.consoleInsightsSendsData)
|
|
545
|
+
i18nString(UIStrings.consoleInsightsSendsData),
|
|
546
546
|
}],
|
|
547
547
|
learnMoreLink: {
|
|
548
548
|
url: 'https://developer.chrome.com/docs/devtools/console/understand-messages',
|
|
@@ -605,11 +605,11 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
605
605
|
toConsiderSettingItems: [{
|
|
606
606
|
iconName: 'google',
|
|
607
607
|
text: noLogging ? i18nString(UIStrings.generatedAiAnnotationsSendDataNoLogging) :
|
|
608
|
-
i18nString(UIStrings.generatedAiAnnotationsSendData)
|
|
608
|
+
i18nString(UIStrings.generatedAiAnnotationsSendData),
|
|
609
609
|
}],
|
|
610
610
|
learnMoreLink: {
|
|
611
611
|
url: 'https://developer.chrome.com/docs/devtools/performance/annotations#auto-annotations',
|
|
612
|
-
linkJSLogContext: 'learn-more.auto-annotations'
|
|
612
|
+
linkJSLogContext: 'learn-more.auto-annotations',
|
|
613
613
|
},
|
|
614
614
|
settingExpandState: {
|
|
615
615
|
isSettingExpanded: false,
|
|
@@ -623,11 +623,12 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
623
623
|
if (this.#aiCodeCompletionSetting) {
|
|
624
624
|
const settingItems = Root.Runtime.hostConfig.devToolsAiCodeGeneration?.enabled ?
|
|
625
625
|
[
|
|
626
|
-
{iconName: 'code', text: i18nString(UIStrings.asYouTypeRelevantDataIsBeingSentToGoogle)},
|
|
626
|
+
{iconName: 'code', text: i18nString(UIStrings.asYouTypeRelevantDataIsBeingSentToGoogle)},
|
|
627
|
+
{
|
|
627
628
|
iconName: 'text-analysis',
|
|
628
629
|
text: Host.Platform.isMac() ? i18nString(UIStrings.describeCodeInCommentForMacOs) :
|
|
629
|
-
i18nString(UIStrings.describeCodeInComment)
|
|
630
|
-
}
|
|
630
|
+
i18nString(UIStrings.describeCodeInComment),
|
|
631
|
+
},
|
|
631
632
|
] :
|
|
632
633
|
[{iconName: 'code', text: i18nString(UIStrings.asYouTypeCodeSuggestions)}];
|
|
633
634
|
|
|
@@ -640,11 +641,11 @@ export class AISettingsTab extends UI.Widget.VBox {
|
|
|
640
641
|
toConsiderSettingItems: [{
|
|
641
642
|
iconName: 'google',
|
|
642
643
|
text: noLogging ? i18nString(UIStrings.codeSuggestionsSendDataNoLogging) :
|
|
643
|
-
i18nString(UIStrings.codeSuggestionsSendData)
|
|
644
|
+
i18nString(UIStrings.codeSuggestionsSendData),
|
|
644
645
|
}],
|
|
645
646
|
learnMoreLink: {
|
|
646
647
|
url: ' https://developers.chrome.com/docs/devtools/ai-assistance/code-completion',
|
|
647
|
-
linkJSLogContext: 'learn-more.code-completion'
|
|
648
|
+
linkJSLogContext: 'learn-more.code-completion',
|
|
648
649
|
},
|
|
649
650
|
settingExpandState: {
|
|
650
651
|
isSettingExpanded: false,
|