chrome-devtools-frontend 1.0.1675430 → 1.0.1678416
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/AUTHORS +1 -0
- package/WATCHLISTS +0 -4
- package/front_end/core/common/EventTarget.ts +0 -5
- package/front_end/core/common/Settings.ts +0 -66
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +5 -0
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSMetadata.ts +5 -9
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +16 -34
- package/front_end/core/sdk/DebuggerModel.ts +92 -57
- package/front_end/core/sdk/EmulationModel.ts +2 -1
- package/front_end/core/sdk/NetworkManager.ts +16 -2
- package/front_end/core/sdk/OverlayModel.ts +19 -9
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +10 -4
- package/front_end/core/sdk/ResourceTreeModel.ts +20 -1
- package/front_end/core/sdk/SDKSettings.ts +117 -0
- package/front_end/core/sdk/Script.ts +9 -53
- package/front_end/core/sdk/sdk-meta.ts +0 -431
- package/front_end/devtools_compatibility.js +1 -0
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +213 -23
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +6 -5
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +14 -15
- package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +157 -0
- package/front_end/entrypoints/main/MainImpl.ts +32 -0
- package/front_end/entrypoints/shell/shell.ts +0 -1
- package/front_end/foundation/Universe.ts +8 -0
- package/front_end/generated/InspectorBackendCommands.ts +8 -8
- package/front_end/generated/SupportedCSSProperties.ts +53 -4
- package/front_end/generated/protocol-mapping.d.ts +27 -21
- package/front_end/generated/protocol-proxy-api.d.ts +22 -17
- package/front_end/generated/protocol.ts +43 -18
- package/front_end/models/ai_assistance/AiAgent2.ts +47 -2
- package/front_end/models/ai_assistance/AiConversation.ts +22 -5
- package/front_end/models/ai_assistance/README.md +52 -26
- package/front_end/models/ai_assistance/agents/AiAgent.ts +54 -8
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +7 -194
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +21 -87
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +24 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +124 -0
- package/front_end/models/ai_assistance/contexts/StorageContext.ts +100 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +69 -1
- package/front_end/models/ai_assistance/skills/README.md +63 -1
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +4 -0
- package/front_end/models/ai_assistance/skills/accessibility.md +7 -0
- package/front_end/models/ai_assistance/skills/performance.md +15 -1
- package/front_end/models/ai_assistance/skills/sources.md +16 -0
- package/front_end/models/ai_assistance/skills/storage.md +31 -0
- package/front_end/models/ai_assistance/tools/GetDetailedCallTree.ts +107 -0
- package/front_end/models/ai_assistance/tools/GetFunctionCode.ts +122 -0
- package/front_end/models/ai_assistance/tools/GetResourceContent.ts +127 -0
- package/front_end/models/ai_assistance/tools/GetSourceContent.ts +101 -0
- package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +83 -0
- package/front_end/models/ai_assistance/tools/GetTraceMainThreadSummary.ts +106 -0
- package/front_end/models/ai_assistance/tools/GetTraceNetworkSummary.ts +104 -0
- package/front_end/models/ai_assistance/tools/ListPageOrigins.ts +95 -0
- package/front_end/models/ai_assistance/tools/ListSources.ts +116 -0
- package/front_end/models/ai_assistance/tools/RunLighthouse.ts +89 -0
- package/front_end/models/ai_assistance/tools/SelectTraceEventByKey.ts +90 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +26 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +22 -0
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +4 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +4 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +8 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +3 -201
- package/front_end/models/bindings/SASSSourceMapping.ts +6 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -49
- package/front_end/models/comment_manager/CommentManager.ts +141 -0
- package/front_end/models/comment_manager/comment_manager.ts +9 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +27 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +10 -2
- package/front_end/models/issues_manager/descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/front_end/models/issues_manager/descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +6 -6
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -8
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +2 -2
- package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
- package/front_end/models/persistence/persistence-meta.ts +9 -9
- package/front_end/models/trace/types/TraceEvents.ts +36 -0
- package/front_end/panels/accessibility/ARIAAttributesView.ts +3 -3
- package/front_end/panels/accessibility/AccessibilityAnnouncementRecordingView.ts +25 -0
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +36 -36
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +9 -0
- package/front_end/panels/accessibility/AccessibilityStrings.ts +168 -168
- package/front_end/panels/accessibility/SourceOrderView.ts +7 -7
- package/front_end/panels/accessibility/accessibility-meta.ts +2 -2
- package/front_end/panels/accessibility/accessibility.ts +2 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +5 -5
- package/front_end/panels/ai_assistance/components/AIv2MarkdownRenderer.ts +2 -3
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +92 -12
- package/front_end/panels/ai_assistance/components/chatMessage.css +6 -0
- package/front_end/panels/application/ApplicationPanelSidebar.ts +10 -4
- package/front_end/panels/application/IndexedDBViews.ts +65 -63
- package/front_end/panels/application/StorageView.ts +116 -45
- package/front_end/panels/application/WebMCPView.ts +16 -7
- package/front_end/panels/application/application-meta.ts +11 -0
- package/front_end/panels/application/components/AdsView.ts +1 -1
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +5 -5
- package/front_end/panels/common/BadgeNotification.ts +8 -8
- package/front_end/panels/common/ExtensionPanel.ts +9 -8
- package/front_end/panels/common/ExtensionServer.ts +21 -1
- package/front_end/panels/common/GdpSignUpDialog.ts +16 -16
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +5 -6
- package/front_end/panels/common/PersistenceUtils.ts +2 -2
- package/front_end/panels/common/common.ts +0 -97
- package/front_end/panels/console/ConsoleInsightTeaser.ts +2 -2
- package/front_end/panels/console/ConsolePanel.ts +4 -0
- package/front_end/panels/console/ConsolePinPane.ts +2 -2
- package/front_end/panels/console/ConsolePrompt.ts +12 -0
- package/front_end/panels/console/ConsoleView.ts +31 -20
- package/front_end/panels/console/ConsoleViewMessage.ts +37 -13
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewModel.ts +1 -1
- package/front_end/panels/elements/ElementStatePaneWidget.ts +2 -1
- package/front_end/panels/elements/ElementsTreeElement.ts +455 -372
- package/front_end/panels/elements/LayoutPane.ts +2 -8
- package/front_end/panels/elements/StylePropertyTreeElement.ts +16 -15
- package/front_end/panels/elements/elements-meta.ts +152 -10
- package/front_end/panels/elements/elements.ts +0 -2
- package/front_end/panels/emulation/DeviceModeView.ts +9 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +8 -4
- package/front_end/panels/issues/AffectedTrackingSitesView.ts +25 -14
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -2
- package/front_end/panels/media/PlayerMessagesView.ts +149 -68
- package/front_end/panels/network/BinaryResourceView.ts +134 -81
- package/front_end/panels/network/EventSourceMessagesView.ts +10 -10
- package/front_end/panels/network/FetchHeaderCommenting.ts +291 -0
- package/front_end/panels/network/NetworkConfigView.ts +10 -10
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -14
- package/front_end/panels/network/NetworkItemView.ts +27 -28
- package/front_end/panels/network/NetworkLogView.ts +137 -38
- package/front_end/panels/network/NetworkLogViewColumns.ts +35 -35
- package/front_end/panels/network/NetworkManageCustomHeadersView.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +2 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/RequestCookiesView.ts +4 -4
- package/front_end/panels/network/RequestHeadersView.ts +5 -5
- package/front_end/panels/network/RequestPayloadView.ts +4 -3
- package/front_end/panels/network/RequestTimingView.ts +8 -8
- package/front_end/panels/network/ResourceChunkView.ts +1 -1
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -1
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +16 -16
- package/front_end/panels/network/binaryResourceView.css +14 -12
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +2 -2
- package/front_end/panels/network/components/HeaderSectionRow.ts +1 -1
- package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -2
- package/front_end/panels/network/network-meta.ts +1 -1
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +0 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -2
- package/front_end/panels/profiler/heapProfiler.css +0 -9
- package/front_end/panels/recorder/RecorderPanel.ts +2 -3
- package/front_end/panels/screencast/ScreencastView.ts +148 -138
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -2
- package/front_end/panels/sources/BreakpointsView.ts +2 -2
- package/front_end/panels/sources/DebuggerPlugin.ts +10 -59
- package/front_end/panels/sources/NavigatorView.ts +2 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/SourcesPanel.ts +23 -73
- package/front_end/panels/sources/SourcesView.ts +248 -157
- package/front_end/panels/sources/TabbedEditorContainer.ts +118 -23
- package/front_end/panels/sources/UISourceCodeFrame.ts +5 -9
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +4 -2
- package/front_end/panels/sources/sources-meta.ts +52 -0
- package/front_end/panels/timeline/TimelineController.ts +36 -64
- package/front_end/panels/timeline/TimelinePanel.ts +11 -8
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -2
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +2 -2
- package/front_end/panels/timeline/timelinePanel.css +0 -10
- package/front_end/panels/utils/utils.ts +7 -7
- package/front_end/services/tracing/PerformanceTracing.ts +5 -17
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/package.json +2 -2
- package/front_end/third_party/codemirror.next/rebuild.sh +4 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +430 -35
- package/front_end/ui/comments/CommentOverlayManager.ts +635 -0
- package/front_end/ui/comments/CommentsOverlayWidget.ts +134 -0
- package/front_end/ui/comments/comments.ts +4 -0
- package/front_end/ui/comments/commentsOverlay.css +49 -0
- package/front_end/{panels/common → ui/components/dialogs}/FreDialog.ts +6 -6
- package/front_end/ui/components/dialogs/TypeToAllowDialog.ts +96 -0
- package/front_end/ui/components/dialogs/dialogs.ts +4 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +3 -3
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionDisclaimer.ts +13 -13
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +7 -6
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeCompletionTeaser.ts +43 -46
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +22 -26
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationTeaser.ts +10 -10
- package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts +5 -5
- package/front_end/ui/components/text_editor/text_editor.ts +4 -0
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +0 -56
- package/front_end/ui/legacy/View.ts +10 -4
- package/front_end/ui/legacy/Widget.ts +10 -1
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +2 -1
- package/front_end/ui/legacy/components/color_picker/ContrastOverlay.ts +5 -4
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +11 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +507 -209
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +5 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -16
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +5 -12
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +38 -20
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +12 -2
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +3 -3
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +37 -6
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +22 -4
- package/front_end/ui/settings/SettingUIRegistration.ts +55 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/mcp/mcp.ts +6 -1
- package/package.json +6 -6
- package/front_end/Images/toolbarResizerVertical.png +0 -0
- package/front_end/emulated_devices/MotoG4-landscape.svg +0 -155
- package/front_end/emulated_devices/MotoG4-portrait.svg +0 -155
- package/front_end/emulated_devices/Nexus5X-landscape.svg +0 -19
- package/front_end/emulated_devices/Nexus5X-portrait.svg +0 -19
- package/front_end/emulated_devices/Nexus6P-landscape.svg +0 -50
- package/front_end/emulated_devices/Nexus6P-portrait.svg +0 -54
- package/front_end/emulated_devices/google-nest-hub-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nest-hub-max-horizontal.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-horizontal-navigation-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-default-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-keyboard-2x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-1x.png +0 -0
- package/front_end/emulated_devices/google-nexus-5x-vertical-navigation-2x.png +0 -0
- package/front_end/emulated_devices/iPad-landscape.svg +0 -73
- package/front_end/emulated_devices/iPad-portrait.svg +0 -76
- package/front_end/emulated_devices/iPhone5-landscape.svg +0 -99
- package/front_end/emulated_devices/iPhone5-portrait.svg +0 -83
- package/front_end/emulated_devices/iPhone6-landscape.svg +0 -111
- package/front_end/emulated_devices/iPhone6-portrait.svg +0 -116
- package/front_end/emulated_devices/iPhone6Plus-landscape.svg +0 -118
- package/front_end/emulated_devices/iPhone6Plus-portrait.svg +0 -116
- package/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/README.md +0 -9
- package/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
- package/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
- package/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
- package/front_end/emulated_devices/optimized/optimized_images.gni +0 -53
- package/front_end/models/ai_assistance/agents/README.md +0 -136
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +0 -89
- package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -27
- /package/front_end/{panels/common → ui/components/dialogs}/freDialog.css +0 -0
- /package/front_end/{panels/common/common.css → ui/components/dialogs/typeToAllowDialog.css} +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionDisclaimer.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeCompletionTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationTeaser.css +0 -0
- /package/front_end/{panels/common → ui/components/text_editor}/aiCodeGenerationUpgradeDialog.css +0 -0
|
@@ -7,13 +7,15 @@ import * as Host from '../../../core/host/host.js';
|
|
|
7
7
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as AiCodeGeneration from '../../../models/ai_code_generation/ai_code_generation.js';
|
|
10
|
-
import * as PanelCommon from '../../../panels/common/common.js';
|
|
11
10
|
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
|
12
11
|
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
12
|
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
14
13
|
|
|
15
14
|
import {AccessiblePlaceholder} from './AccessiblePlaceholder.js';
|
|
15
|
+
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
16
16
|
import {AiCodeGenerationParser} from './AiCodeGenerationParser.js';
|
|
17
|
+
import {AiCodeGenerationTeaser, AiCodeGenerationTeaserDisplayState, PROMOTION_ID} from './AiCodeGenerationTeaser.js';
|
|
18
|
+
import {AiCodeGenerationUpgradeDialog} from './AiCodeGenerationUpgradeDialog.js';
|
|
17
19
|
import {
|
|
18
20
|
acceptAiAutoCompleteSuggestion,
|
|
19
21
|
aiAutoCompleteSuggestion,
|
|
@@ -47,7 +49,7 @@ export interface AiCodeGenerationConfig {
|
|
|
47
49
|
onRequestTriggered: () => void;
|
|
48
50
|
onResponseReceived: () => void;
|
|
49
51
|
disclaimerTooltipId: string;
|
|
50
|
-
disclaimerTextVariant:
|
|
52
|
+
disclaimerTextVariant: DisclaimerTextVariant;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export class AiCodeGenerationProvider {
|
|
@@ -60,7 +62,7 @@ export class AiCodeGenerationProvider {
|
|
|
60
62
|
Common.Settings.Settings.instance().createSetting('ai-code-generation-onboarding-completed', false);
|
|
61
63
|
#aiCodeGenerationUsedSetting = Common.Settings.Settings.instance().createSetting('ai-code-generation-used', false);
|
|
62
64
|
#generationTeaserCompartment = new CodeMirror.Compartment();
|
|
63
|
-
#generationTeaser:
|
|
65
|
+
#generationTeaser: AiCodeGenerationTeaser;
|
|
64
66
|
#editor?: TextEditor;
|
|
65
67
|
#aiCodeGenerationConfig: AiCodeGenerationConfig;
|
|
66
68
|
#aiCodeGeneration?: AiCodeGeneration.AiCodeGeneration.AiCodeGeneration;
|
|
@@ -83,7 +85,7 @@ export class AiCodeGenerationProvider {
|
|
|
83
85
|
if (!AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationAvailable()) {
|
|
84
86
|
throw new Error('AI code generation feature is not available.');
|
|
85
87
|
}
|
|
86
|
-
this.#generationTeaser = new
|
|
88
|
+
this.#generationTeaser = new AiCodeGenerationTeaser();
|
|
87
89
|
this.#generationTeaser.disclaimerTooltipId = aiCodeGenerationConfig.disclaimerTooltipId;
|
|
88
90
|
this.#generationTeaser.disclaimerTextVariant = aiCodeGenerationConfig.disclaimerTextVariant;
|
|
89
91
|
this.#aiCodeGenerationConfig = aiCodeGenerationConfig;
|
|
@@ -186,8 +188,8 @@ export class AiCodeGenerationProvider {
|
|
|
186
188
|
this.#dismissTeaserAndSuggestion();
|
|
187
189
|
return true;
|
|
188
190
|
}
|
|
189
|
-
const generationTeaserIsLoading =
|
|
190
|
-
|
|
191
|
+
const generationTeaserIsLoading =
|
|
192
|
+
this.#generationTeaser.displayState === AiCodeGenerationTeaserDisplayState.LOADING;
|
|
191
193
|
if (this.#generationTeaser.isShowing() && generationTeaserIsLoading) {
|
|
192
194
|
this.#controller.abort();
|
|
193
195
|
this.#controller = new AbortController();
|
|
@@ -248,13 +250,13 @@ export class AiCodeGenerationProvider {
|
|
|
248
250
|
|
|
249
251
|
const noLogging = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
|
|
250
252
|
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
|
|
251
|
-
const resolved = await
|
|
253
|
+
const resolved = await AiCodeGenerationUpgradeDialog.show({noLogging});
|
|
252
254
|
this.#aiCodeGenerationOnboardingCompletedSetting.set(resolved);
|
|
253
255
|
return resolved;
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
#dismissTeaserAndSuggestion(): void {
|
|
257
|
-
this.#generationTeaser.displayState =
|
|
259
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.TRIGGER;
|
|
258
260
|
this.#editor?.dispatch({
|
|
259
261
|
effects: [
|
|
260
262
|
setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.DISMISSED),
|
|
@@ -305,18 +307,15 @@ export class AiCodeGenerationProvider {
|
|
|
305
307
|
if (currentTeaserMode === AiCodeGenerationTeaserMode.DISMISSED) {
|
|
306
308
|
return;
|
|
307
309
|
}
|
|
308
|
-
if (this.#generationTeaser.displayState ===
|
|
309
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
310
|
+
if (this.#generationTeaser.displayState === AiCodeGenerationTeaserDisplayState.LOADING) {
|
|
310
311
|
this.#controller.abort();
|
|
311
312
|
this.#controller = new AbortController();
|
|
312
313
|
this.#dismissTeaserAndSuggestion();
|
|
313
314
|
return;
|
|
314
315
|
}
|
|
315
|
-
if (this.#generationTeaser.displayState ===
|
|
316
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.GENERATED) {
|
|
316
|
+
if (this.#generationTeaser.displayState === AiCodeGenerationTeaserDisplayState.GENERATED) {
|
|
317
317
|
update.view.dispatch({effects: setAiAutoCompleteSuggestion.of(null)});
|
|
318
|
-
this.#generationTeaser.displayState =
|
|
319
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
318
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
320
319
|
return;
|
|
321
320
|
}
|
|
322
321
|
}
|
|
@@ -342,7 +341,7 @@ export class AiCodeGenerationProvider {
|
|
|
342
341
|
return;
|
|
343
342
|
}
|
|
344
343
|
|
|
345
|
-
this.#generationTeaser.displayState =
|
|
344
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.LOADING;
|
|
346
345
|
try {
|
|
347
346
|
const startTime = performance.now();
|
|
348
347
|
this.#aiCodeGenerationConfig.onRequestTriggered();
|
|
@@ -386,8 +385,7 @@ export class AiCodeGenerationProvider {
|
|
|
386
385
|
setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.ACTIVE),
|
|
387
386
|
],
|
|
388
387
|
});
|
|
389
|
-
this.#generationTeaser.displayState =
|
|
390
|
-
PanelCommon.AiCodeGenerationTeaser.AiCodeGenerationTeaserDisplayState.GENERATED;
|
|
388
|
+
this.#generationTeaser.displayState = AiCodeGenerationTeaserDisplayState.GENERATED;
|
|
391
389
|
|
|
392
390
|
AiCodeGeneration.debugLog('Suggestion dispatched to the editor', suggestionText);
|
|
393
391
|
const citations = topSample.attributionMetadata?.citations ?? [];
|
|
@@ -409,8 +407,7 @@ export class AiCodeGenerationProvider {
|
|
|
409
407
|
}
|
|
410
408
|
}
|
|
411
409
|
|
|
412
|
-
function aiCodeGenerationTeaserExtension(teaser:
|
|
413
|
-
CodeMirror.Extension {
|
|
410
|
+
function aiCodeGenerationTeaserExtension(teaser: AiCodeGenerationTeaser): CodeMirror.Extension {
|
|
414
411
|
return CodeMirror.ViewPlugin.fromClass(class {
|
|
415
412
|
#view: CodeMirror.EditorView;
|
|
416
413
|
|
|
@@ -436,8 +433,7 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
|
|
|
436
433
|
const line = this.#view.state.doc.lineAt(cursorPosition);
|
|
437
434
|
|
|
438
435
|
const isEmptyLine = line.length === 0;
|
|
439
|
-
const canShowDiscoveryState =
|
|
440
|
-
UI.UIUtils.PromotionManager.instance().canShowPromotion(PanelCommon.AiCodeGenerationTeaser.PROMOTION_ID);
|
|
436
|
+
const canShowDiscoveryState = UI.UIUtils.PromotionManager.instance().canShowPromotion(PROMOTION_ID);
|
|
441
437
|
|
|
442
438
|
if ((isEmptyLine && canShowDiscoveryState)) {
|
|
443
439
|
return CodeMirror.Decoration.set([
|
|
@@ -461,17 +457,17 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
|
|
|
461
457
|
#updateTeaserState(state: CodeMirror.EditorState): void {
|
|
462
458
|
// Only handle non loading and non generated states, as updates during and after generation are handled by
|
|
463
459
|
// #abortOrDismissGenerationDuringUpdate in AiCodeGenerationProvider
|
|
464
|
-
if (teaser.displayState ===
|
|
465
|
-
teaser.displayState ===
|
|
460
|
+
if (teaser.displayState === AiCodeGenerationTeaserDisplayState.LOADING ||
|
|
461
|
+
teaser.displayState === AiCodeGenerationTeaserDisplayState.GENERATED) {
|
|
466
462
|
return;
|
|
467
463
|
}
|
|
468
464
|
const cursorPosition = state.selection.main.head;
|
|
469
465
|
const line = state.doc.lineAt(cursorPosition);
|
|
470
466
|
const isEmptyLine = line.length === 0;
|
|
471
467
|
if (isEmptyLine) {
|
|
472
|
-
teaser.displayState =
|
|
468
|
+
teaser.displayState = AiCodeGenerationTeaserDisplayState.DISCOVERY;
|
|
473
469
|
} else {
|
|
474
|
-
teaser.displayState =
|
|
470
|
+
teaser.displayState = AiCodeGenerationTeaserDisplayState.TRIGGER;
|
|
475
471
|
}
|
|
476
472
|
}
|
|
477
473
|
}, {
|
|
@@ -497,7 +493,7 @@ function aiCodeGenerationTeaserExtension(teaser: PanelCommon.AiCodeGenerationTea
|
|
|
497
493
|
},
|
|
498
494
|
keydown(event: KeyboardEvent): boolean {
|
|
499
495
|
if (!UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(event) ||
|
|
500
|
-
teaser.displayState !==
|
|
496
|
+
teaser.displayState !== AiCodeGenerationTeaserDisplayState.TRIGGER) {
|
|
501
497
|
return false;
|
|
502
498
|
}
|
|
503
499
|
if (event.key === '.') {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Copyright 2025 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
|
-
import '
|
|
5
|
-
|
|
6
|
-
import * as Common from '
|
|
7
|
-
import * as Host from '
|
|
8
|
-
import * as i18n from '
|
|
9
|
-
import * as Root from '
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
4
|
+
import '../tooltips/tooltips.js';
|
|
5
|
+
|
|
6
|
+
import * as Common from '../../../core/common/common.js';
|
|
7
|
+
import * as Host from '../../../core/host/host.js';
|
|
8
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
|
+
import * as Root from '../../../core/root/root.js';
|
|
10
|
+
import * as UI from '../../legacy/legacy.js';
|
|
11
|
+
import {Directives, html, nothing, render} from '../../lit/lit.js';
|
|
12
|
+
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
13
|
+
import * as Buttons from '../buttons/buttons.js';
|
|
14
14
|
|
|
15
15
|
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
16
16
|
import styles from './aiCodeGenerationTeaser.css.js';
|
package/front_end/{panels/common → ui/components/text_editor}/AiCodeGenerationUpgradeDialog.ts
RENAMED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
5
|
|
|
6
|
-
import * as Host from '
|
|
7
|
-
import * as i18n from '
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
6
|
+
import * as Host from '../../../core/host/host.js';
|
|
7
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
8
|
+
import * as UI from '../../legacy/legacy.js';
|
|
9
|
+
import * as Lit from '../../lit/lit.js';
|
|
10
|
+
import * as Buttons from '../buttons/buttons.js';
|
|
11
11
|
|
|
12
12
|
import styles from './aiCodeGenerationUpgradeDialog.css.js';
|
|
13
13
|
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
export * as AccessiblePlaceholder from './AccessiblePlaceholder.js';
|
|
6
|
+
export * as AiCodeCompletionDisclaimer from './AiCodeCompletionDisclaimer.js';
|
|
6
7
|
export * as AiCodeCompletionProvider from './AiCodeCompletionProvider.js';
|
|
8
|
+
export * as AiCodeCompletionTeaser from './AiCodeCompletionTeaser.js';
|
|
7
9
|
export * as AiCodeGenerationParser from './AiCodeGenerationParser.js';
|
|
8
10
|
export * as AiCodeGenerationProvider from './AiCodeGenerationProvider.js';
|
|
11
|
+
export * as AiCodeGenerationTeaser from './AiCodeGenerationTeaser.js';
|
|
12
|
+
export * as AiCodeGenerationUpgradeDialog from './AiCodeGenerationUpgradeDialog.js';
|
|
9
13
|
export * as AutocompleteHistory from './AutocompleteHistory.js';
|
|
10
14
|
export * as Config from './config.js';
|
|
11
15
|
export * as ExecutionPositionHighlighter from './ExecutionPositionHighlighter.js';
|
|
@@ -1431,7 +1431,7 @@ export class ToolbarSettingCheckbox extends ToolbarCheckbox {
|
|
|
1431
1431
|
setting: Common.Settings.Setting<boolean>, tooltip?: Common.UIString.LocalizedString,
|
|
1432
1432
|
alternateTitle?: Common.UIString.LocalizedString) {
|
|
1433
1433
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(setting.descriptor());
|
|
1434
|
-
const title = alternateTitle
|
|
1434
|
+
const title = alternateTitle ?? uiDescriptor?.title ?? ('' as Common.UIString.LocalizedString);
|
|
1435
1435
|
super(title, tooltip, undefined, setting.name);
|
|
1436
1436
|
bindCheckbox(this.element as CheckboxLabel, setting);
|
|
1437
1437
|
}
|
|
@@ -1643,27 +1643,6 @@ export class ConfirmDialog {
|
|
|
1643
1643
|
}
|
|
1644
1644
|
}
|
|
1645
1645
|
|
|
1646
|
-
export interface RenderedObject {
|
|
1647
|
-
element: HTMLElement;
|
|
1648
|
-
forceSelect(): void;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
export abstract class Renderer {
|
|
1652
|
-
abstract render(object: Object, options?: Options): Promise<RenderedObject|null>;
|
|
1653
|
-
|
|
1654
|
-
static async render(object: Object, options?: Options): Promise<RenderedObject|null> {
|
|
1655
|
-
if (!object) {
|
|
1656
|
-
throw new Error('Can\'t render ' + object);
|
|
1657
|
-
}
|
|
1658
|
-
const extension = getApplicableRegisteredRenderers(object)[0];
|
|
1659
|
-
if (!extension) {
|
|
1660
|
-
return null;
|
|
1661
|
-
}
|
|
1662
|
-
const renderer = await extension.loadRenderer();
|
|
1663
|
-
return await renderer.render(object, options);
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
1646
|
export function formatTimestamp(timestamp: number, full: boolean): string {
|
|
1668
1647
|
const date = new Date(timestamp);
|
|
1669
1648
|
const yymmdd = date.getFullYear() + '-' + leadZero(date.getMonth() + 1, 2) + '-' + leadZero(date.getDate(), 2);
|
|
@@ -1677,15 +1656,6 @@ export function formatTimestamp(timestamp: number, full: boolean): string {
|
|
|
1677
1656
|
}
|
|
1678
1657
|
}
|
|
1679
1658
|
|
|
1680
|
-
export interface Options {
|
|
1681
|
-
title?: string|Element;
|
|
1682
|
-
editable?: boolean;
|
|
1683
|
-
/**
|
|
1684
|
-
* Should the resulting object be expanded.
|
|
1685
|
-
*/
|
|
1686
|
-
expand?: boolean;
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
1659
|
export const isScrolledToBottom = (element: Element): boolean => {
|
|
1690
1660
|
// This code works only for 0-width border.
|
|
1691
1661
|
// The scrollTop, clientHeight and scrollHeight are computed in double values internally.
|
|
@@ -1749,32 +1719,6 @@ export const deepElementFromEvent = (ev: Event): Node|null => {
|
|
|
1749
1719
|
return root ? deepElementFromPoint((root as Document | ShadowRoot), event.pageX, event.pageY) : null;
|
|
1750
1720
|
};
|
|
1751
1721
|
|
|
1752
|
-
const registeredRenderers: RendererRegistration[] = [];
|
|
1753
|
-
|
|
1754
|
-
export function registerRenderer(registration: RendererRegistration): void {
|
|
1755
|
-
registeredRenderers.push(registration);
|
|
1756
|
-
}
|
|
1757
|
-
export function getApplicableRegisteredRenderers(object: Object): RendererRegistration[] {
|
|
1758
|
-
return registeredRenderers.filter(isRendererApplicableToContextTypes);
|
|
1759
|
-
|
|
1760
|
-
function isRendererApplicableToContextTypes(rendererRegistration: RendererRegistration): boolean {
|
|
1761
|
-
if (!rendererRegistration.contextTypes) {
|
|
1762
|
-
return true;
|
|
1763
|
-
}
|
|
1764
|
-
for (const contextType of rendererRegistration.contextTypes()) {
|
|
1765
|
-
if (object instanceof contextType) {
|
|
1766
|
-
return true;
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
return false;
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
export interface RendererRegistration {
|
|
1774
|
-
loadRenderer: () => Promise<Renderer>;
|
|
1775
|
-
contextTypes: () => Array<Platform.Constructor.ConstructorOrAbstract<unknown>>;
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
1722
|
export interface ConfirmDialogOptions {
|
|
1779
1723
|
okButtonLabel?: string;
|
|
1780
1724
|
cancelButtonLabel?: string;
|
|
@@ -61,10 +61,16 @@ export class SimpleView<ContentTypeT extends HTMLElement|DocumentFragment = HTML
|
|
|
61
61
|
* @param options the settings for the resulting view.
|
|
62
62
|
* @throws TypeError - if `options.viewId` is not in extended kebab case.
|
|
63
63
|
*/
|
|
64
|
-
constructor(options: SimpleViewOptions<ContentTypeT>)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
constructor(options: SimpleViewOptions<ContentTypeT>);
|
|
65
|
+
constructor(element: HTMLElement, options: SimpleViewOptions<ContentTypeT>);
|
|
66
|
+
constructor(elementOrOptions: HTMLElement|SimpleViewOptions<ContentTypeT>,
|
|
67
|
+
options?: SimpleViewOptions<ContentTypeT>) {
|
|
68
|
+
// @ts-expect-error
|
|
69
|
+
super(elementOrOptions, options);
|
|
70
|
+
const optionsObj =
|
|
71
|
+
(elementOrOptions instanceof HTMLElement ? options : elementOrOptions) as SimpleViewOptions<ContentTypeT>;
|
|
72
|
+
this.#title = optionsObj.title;
|
|
73
|
+
this.#viewId = optionsObj.viewId;
|
|
68
74
|
if (!Platform.StringUtilities.isExtendedKebabCase(this.#viewId)) {
|
|
69
75
|
throw new TypeError(`Invalid view ID '${this.#viewId}'`);
|
|
70
76
|
}
|
|
@@ -378,6 +378,8 @@ customElements.define('devtools-widget', WidgetElement);
|
|
|
378
378
|
|
|
379
379
|
export class WidgetDirective extends Lit.Directive.Directive {
|
|
380
380
|
#partType: Lit.Directive.PartType;
|
|
381
|
+
#lastWidgetClass?: unknown;
|
|
382
|
+
#lastKey?: unknown;
|
|
381
383
|
|
|
382
384
|
constructor(partInfo: Lit.Directive.PartInfo) {
|
|
383
385
|
super(partInfo);
|
|
@@ -420,13 +422,20 @@ export class WidgetDirective extends Lit.Directive.Directive {
|
|
|
420
422
|
if (this.#partType === Lit.Directive.PartType.ELEMENT) {
|
|
421
423
|
return Lit.nothing;
|
|
422
424
|
}
|
|
425
|
+
if (this.#lastWidgetClass !== widgetClass) {
|
|
426
|
+
this.#lastWidgetClass = widgetClass;
|
|
427
|
+
this.#lastKey = Widget.isPrototypeOf(widgetClass) ? widgetClass : widgetClass.toString();
|
|
428
|
+
}
|
|
423
429
|
// We use `repeat` to force Lit to recreate the `<devtools-widget>` DOM node when the `widgetClass` changes.
|
|
424
430
|
// If we didn't use `repeat` and used `html` directly, Lit would reuse the same `<devtools-widget>` instance
|
|
425
431
|
// even if `widgetClass` changed (for example, in a ternary operator `condition ? widget(A) : widget(B)`).
|
|
426
432
|
// This is because the template string is the same, so Lit reuses the DOM node and only updates `.widgetConfig`,
|
|
427
433
|
// which does not properly recreate the widget instance.
|
|
434
|
+
// We use `#lastKey` (and stringify factory functions) instead of just using `widgetClass` as the key
|
|
435
|
+
// so that we intentionally ignore reference changes for identical inline factories. This prevents accidental
|
|
436
|
+
// recreation of the DOM node on every render when an anonymous inline arrow function is passed.
|
|
428
437
|
return Lit.Directives.repeat(
|
|
429
|
-
[widgetClass], () =>
|
|
438
|
+
[widgetClass], () => this.#lastKey,
|
|
430
439
|
() => html`<devtools-widget ${widget<F, ParamKeys>(widgetClass, widgetParams)}></devtools-widget>`);
|
|
431
440
|
}
|
|
432
441
|
}
|
|
@@ -9,6 +9,7 @@ import * as Common from '../../../../core/common/common.js';
|
|
|
9
9
|
import * as Host from '../../../../core/host/host.js';
|
|
10
10
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
11
11
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
12
|
+
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
12
13
|
import {createIcon, Icon} from '../../../../ui/kit/kit.js';
|
|
13
14
|
import * as UIHelpers from '../../../helpers/helpers.js';
|
|
14
15
|
import * as UI from '../../legacy.js';
|
|
@@ -241,7 +242,7 @@ export class ContrastDetails extends Common.ObjectWrapper.ObjectWrapper<EventTyp
|
|
|
241
242
|
this.setVisible(true);
|
|
242
243
|
this.hideNoContrastInfoAvailableMessage();
|
|
243
244
|
|
|
244
|
-
const isAPCAEnabled = Common.Settings.Settings.instance().
|
|
245
|
+
const isAPCAEnabled = Common.Settings.Settings.instance().resolve(SDK.SDKSettings.apcaSettingDescriptor).get();
|
|
245
246
|
|
|
246
247
|
const fgColor = this.contrastInfo.color();
|
|
247
248
|
const bgColor = this.contrastInfo.bgColor();
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../../../core/common/common.js';
|
|
6
|
+
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
6
7
|
import * as UI from '../../legacy.js';
|
|
7
8
|
|
|
8
9
|
import {type ContrastInfo, Events} from './ContrastInfo.js';
|
|
@@ -24,7 +25,7 @@ export class ContrastOverlay {
|
|
|
24
25
|
|
|
25
26
|
this.contrastRatioSVG = UI.UIUtils.createSVGChild(colorElement, 'svg', 'spectrum-contrast-container fill');
|
|
26
27
|
this.contrastRatioLines = new Map();
|
|
27
|
-
if (Common.Settings.Settings.instance().
|
|
28
|
+
if (Common.Settings.Settings.instance().resolve(SDK.SDKSettings.apcaSettingDescriptor).get()) {
|
|
28
29
|
this.contrastRatioLines.set(
|
|
29
30
|
'APCA', UI.UIUtils.createSVGChild(this.contrastRatioSVG, 'path', 'spectrum-contrast-line'));
|
|
30
31
|
} else {
|
|
@@ -49,7 +50,7 @@ export class ContrastOverlay {
|
|
|
49
50
|
if (!this.visible || this.contrastInfo.isNull()) {
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
|
-
if (Common.Settings.Settings.instance().
|
|
53
|
+
if (Common.Settings.Settings.instance().resolve(SDK.SDKSettings.apcaSettingDescriptor).get() &&
|
|
53
54
|
this.contrastInfo.contrastRatioAPCA() === null) {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
@@ -90,7 +91,7 @@ export class ContrastRatioLineBuilder {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
drawContrastRatioLine(width: number, height: number, level: string): string|null {
|
|
93
|
-
const isAPCA = Common.Settings.Settings.instance().
|
|
94
|
+
const isAPCA = Common.Settings.Settings.instance().resolve(SDK.SDKSettings.apcaSettingDescriptor).get();
|
|
94
95
|
const requiredContrast =
|
|
95
96
|
isAPCA ? this.contrastInfo.contrastRatioAPCAThreshold() : this.contrastInfo.contrastRatioThreshold(level);
|
|
96
97
|
if (!width || !height || requiredContrast === null) {
|
|
@@ -139,7 +140,7 @@ export class ContrastRatioLineBuilder {
|
|
|
139
140
|
Common.ColorUtils.blendColors(Common.Color.Legacy.fromHSVA(candidateHSVA).rgba(), bgRGBA));
|
|
140
141
|
};
|
|
141
142
|
|
|
142
|
-
if (Common.Settings.Settings.instance().
|
|
143
|
+
if (Common.Settings.Settings.instance().resolve(SDK.SDKSettings.apcaSettingDescriptor).get()) {
|
|
143
144
|
candidateLuminance = (candidateHSVA: Common.ColorUtils.Color4D) => {
|
|
144
145
|
return Common.ColorUtils.luminanceAPCA(
|
|
145
146
|
Common.ColorUtils.blendColors(Common.Color.Legacy.fromHSVA(candidateHSVA).rgba(), bgRGBA));
|
|
@@ -8,13 +8,14 @@ import * as i18n from '../../../../core/i18n/i18n.js';
|
|
|
8
8
|
import type * as SDK from '../../../../core/sdk/sdk.js';
|
|
9
9
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
10
10
|
import {createIcon, type Icon} from '../../../kit/kit.js';
|
|
11
|
+
import {render} from '../../../lit/lit.js';
|
|
11
12
|
import * as UI from '../../legacy.js';
|
|
12
13
|
|
|
13
14
|
import {sanitizeStyle} from './CSSStyleSanitizer.js';
|
|
14
15
|
import customPreviewComponentStyles from './customPreviewComponent.css.js';
|
|
15
16
|
import {
|
|
17
|
+
defaultObjectPresentation as defaultObjectPresentationTemplate,
|
|
16
18
|
ObjectPropertiesMode,
|
|
17
|
-
ObjectPropertiesSection,
|
|
18
19
|
ObjectPropertiesSectionsTreeOutline,
|
|
19
20
|
ObjectPropertyTreeElement,
|
|
20
21
|
ObjectTree,
|
|
@@ -129,7 +130,7 @@ export class CustomPreviewSection {
|
|
|
129
130
|
return (new CustomPreviewSection(remoteObject)).element();
|
|
130
131
|
}
|
|
131
132
|
|
|
132
|
-
const sectionElement =
|
|
133
|
+
const sectionElement = defaultObjectPresentation(remoteObject);
|
|
133
134
|
sectionElement.classList.toggle('custom-expandable-section-standard-section', remoteObject.hasChildren);
|
|
134
135
|
return sectionElement;
|
|
135
136
|
}
|
|
@@ -239,7 +240,14 @@ export class CustomPreviewComponent {
|
|
|
239
240
|
if (this.element.shadowRoot) {
|
|
240
241
|
this.element.shadowRoot.textContent = '';
|
|
241
242
|
this.customPreviewSection = null;
|
|
242
|
-
this.element.shadowRoot.appendChild(
|
|
243
|
+
this.element.shadowRoot.appendChild(defaultObjectPresentation(this.object));
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
}
|
|
247
|
+
|
|
248
|
+
function defaultObjectPresentation(object: SDK.RemoteObject.RemoteObject): Element {
|
|
249
|
+
const element = document.createElement('span');
|
|
250
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
251
|
+
render(defaultObjectPresentationTemplate(object), element);
|
|
252
|
+
return element;
|
|
253
|
+
}
|