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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as CommentManager from '../../models/comment_manager/comment_manager.js';
|
|
6
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
|
7
|
+
import * as Lit from '../../ui/lit/lit.js';
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
type CommentOverlayManager,
|
|
11
|
+
Events as CommentOverlayManagerEvents,
|
|
12
|
+
type HighlightRectData,
|
|
13
|
+
type HoverHighlightData,
|
|
14
|
+
type PinPositionData,
|
|
15
|
+
} from './CommentOverlayManager.js';
|
|
16
|
+
import commentsOverlayStyles from './commentsOverlay.css.js';
|
|
17
|
+
|
|
18
|
+
const {html, render, nothing, Directives: {styleMap}} = Lit;
|
|
19
|
+
|
|
20
|
+
export interface ViewInput {
|
|
21
|
+
pins: PinPositionData[];
|
|
22
|
+
highlights: HighlightRectData[];
|
|
23
|
+
hoverHighlight: HoverHighlightData|null;
|
|
24
|
+
commentMode: boolean;
|
|
25
|
+
onPinClick: (threadId: string) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
29
|
+
|
|
30
|
+
// clang-format off
|
|
31
|
+
const DEFAULT_VIEW: View = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
|
|
32
|
+
render(html`
|
|
33
|
+
<style>${commentsOverlayStyles}</style>
|
|
34
|
+
<div class="comments-overlay-container">
|
|
35
|
+
${input.hoverHighlight && input.hoverHighlight.visible ? html`
|
|
36
|
+
<div
|
|
37
|
+
class="comment-hover-highlight"
|
|
38
|
+
style=${styleMap({
|
|
39
|
+
top: `${input.hoverHighlight.top}px`,
|
|
40
|
+
left: `${input.hoverHighlight.left}px`,
|
|
41
|
+
width: `${input.hoverHighlight.width}px`,
|
|
42
|
+
height: `${input.hoverHighlight.height}px`,
|
|
43
|
+
})}>
|
|
44
|
+
</div>
|
|
45
|
+
` : nothing}
|
|
46
|
+
${input.highlights.map(h => h.visible ? html`
|
|
47
|
+
<div
|
|
48
|
+
class="comment-anchor-highlight"
|
|
49
|
+
data-comment-id=${h.id}
|
|
50
|
+
style=${styleMap({
|
|
51
|
+
top: `${h.top}px`,
|
|
52
|
+
left: `${h.left}px`,
|
|
53
|
+
width: `${h.width}px`,
|
|
54
|
+
height: `${h.height}px`,
|
|
55
|
+
})}>
|
|
56
|
+
</div>
|
|
57
|
+
` : nothing)}
|
|
58
|
+
${input.pins.map(p => p.visible ? html`
|
|
59
|
+
<div
|
|
60
|
+
class="comment-pin"
|
|
61
|
+
data-comment-id=${p.id}
|
|
62
|
+
style=${styleMap({
|
|
63
|
+
top: `${p.top}px`,
|
|
64
|
+
left: `${p.left}px`,
|
|
65
|
+
})}
|
|
66
|
+
@click=${() => input.onPinClick(p.id)}>
|
|
67
|
+
💬
|
|
68
|
+
</div>
|
|
69
|
+
` : nothing)}
|
|
70
|
+
</div>
|
|
71
|
+
`, target);
|
|
72
|
+
};
|
|
73
|
+
// clang-format on
|
|
74
|
+
|
|
75
|
+
export class CommentsOverlayWidget extends UI.Widget.Widget {
|
|
76
|
+
readonly #view: View;
|
|
77
|
+
readonly #commentOverlayManager: CommentOverlayManager;
|
|
78
|
+
|
|
79
|
+
constructor(
|
|
80
|
+
commentOverlayManager: CommentOverlayManager,
|
|
81
|
+
element?: HTMLElement,
|
|
82
|
+
view: View = DEFAULT_VIEW,
|
|
83
|
+
) {
|
|
84
|
+
super(element);
|
|
85
|
+
this.#view = view;
|
|
86
|
+
this.#commentOverlayManager = commentOverlayManager;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
override wasShown(): void {
|
|
90
|
+
super.wasShown();
|
|
91
|
+
this.#commentOverlayManager.addEventListener(CommentOverlayManagerEvents.POSITIONS_UPDATED, this.#onStateChanged,
|
|
92
|
+
this);
|
|
93
|
+
this.#commentOverlayManager.addEventListener(CommentOverlayManagerEvents.HOVER_HIGHLIGHT_CHANGED,
|
|
94
|
+
this.#onStateChanged, this);
|
|
95
|
+
|
|
96
|
+
this.#commentOverlayManager.commentManager.addEventListener(
|
|
97
|
+
CommentManager.CommentManager.Events.COMMENT_THREADS_CHANGED, this.#onStateChanged, this);
|
|
98
|
+
this.#commentOverlayManager.commentManager.addEventListener(
|
|
99
|
+
CommentManager.CommentManager.Events.COMMENT_MODE_CHANGED, this.#onStateChanged, this);
|
|
100
|
+
|
|
101
|
+
this.requestUpdate();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
override willHide(): void {
|
|
105
|
+
this.#commentOverlayManager.removeEventListener(CommentOverlayManagerEvents.POSITIONS_UPDATED, this.#onStateChanged,
|
|
106
|
+
this);
|
|
107
|
+
this.#commentOverlayManager.removeEventListener(CommentOverlayManagerEvents.HOVER_HIGHLIGHT_CHANGED,
|
|
108
|
+
this.#onStateChanged, this);
|
|
109
|
+
|
|
110
|
+
this.#commentOverlayManager.commentManager.removeEventListener(
|
|
111
|
+
CommentManager.CommentManager.Events.COMMENT_THREADS_CHANGED, this.#onStateChanged, this);
|
|
112
|
+
this.#commentOverlayManager.commentManager.removeEventListener(
|
|
113
|
+
CommentManager.CommentManager.Events.COMMENT_MODE_CHANGED, this.#onStateChanged, this);
|
|
114
|
+
|
|
115
|
+
super.willHide();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
#onStateChanged(): void {
|
|
119
|
+
this.requestUpdate();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#handlePinClick = (_threadId: string): void => {};
|
|
123
|
+
|
|
124
|
+
override performUpdate(): void {
|
|
125
|
+
const viewInput: ViewInput = {
|
|
126
|
+
pins: this.#commentOverlayManager.getPinPositions(),
|
|
127
|
+
highlights: this.#commentOverlayManager.getHighlightRects(),
|
|
128
|
+
hoverHighlight: this.#commentOverlayManager.getHoverHighlight(),
|
|
129
|
+
commentMode: this.#commentOverlayManager.isCommentMode(),
|
|
130
|
+
onPinClick: this.#handlePinClick,
|
|
131
|
+
};
|
|
132
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as CommentAnchorResolver from './CommentAnchorResolver.js';
|
|
6
|
+
import * as CommentOverlayManager from './CommentOverlayManager.js';
|
|
7
|
+
import * as CommentsOverlayWidget from './CommentsOverlayWidget.js';
|
|
6
8
|
|
|
7
9
|
export {
|
|
8
10
|
CommentAnchorResolver,
|
|
11
|
+
CommentOverlayManager,
|
|
12
|
+
CommentsOverlayWidget,
|
|
9
13
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 The Chromium Authors
|
|
3
|
+
* Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
:scope,
|
|
9
|
+
.comments-overlay-container {
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: 0;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
z-index: 999990;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
width: 100vw;
|
|
16
|
+
height: 100vh;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.comment-pin {
|
|
20
|
+
position: absolute;
|
|
21
|
+
pointer-events: auto;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
font-size: 24px;
|
|
24
|
+
line-height: 24px;
|
|
25
|
+
filter: drop-shadow(0 2px 5px rgb(0 0 0 / 35%));
|
|
26
|
+
user-select: none;
|
|
27
|
+
transition: transform 0.1s ease;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.comment-pin:hover {
|
|
31
|
+
transform: scale(1.15);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.comment-anchor-highlight {
|
|
35
|
+
position: absolute;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
border: 2px dashed var(--sys-color-primary);
|
|
38
|
+
background-color: color-mix(in srgb, var(--sys-color-primary), transparent 90%);
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.comment-hover-highlight {
|
|
43
|
+
position: absolute;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
border: 2px solid var(--sys-color-primary);
|
|
46
|
+
background-color: color-mix(in srgb, var(--sys-color-primary), transparent 85%);
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -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 i18n from '
|
|
7
|
-
import type * as Platform from '
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
6
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
|
+
import type * as Platform from '../../../core/platform/platform.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 './freDialog.css.js';
|
|
13
13
|
|
|
@@ -32,7 +32,7 @@ const UIStrings = {
|
|
|
32
32
|
gotIt: 'Got it',
|
|
33
33
|
} as const;
|
|
34
34
|
|
|
35
|
-
const str_ = i18n.i18n.registerUIStrings('
|
|
35
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/FreDialog.ts', UIStrings);
|
|
36
36
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
37
37
|
|
|
38
38
|
export class FreDialog {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Copyright 2026 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
6
|
+
|
|
7
|
+
import * as Host from '../../../core/host/host.js';
|
|
8
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
|
+
import type * as Platform from '../../../core/platform/platform.js';
|
|
10
|
+
import * as Geometry from '../../../models/geometry/geometry.js';
|
|
11
|
+
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
12
|
+
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
|
+
|
|
14
|
+
import typeToAllowDialogStyles from './typeToAllowDialog.css.js';
|
|
15
|
+
|
|
16
|
+
const UIStrings = {
|
|
17
|
+
/**
|
|
18
|
+
* @description Text for the cancel button in the dialog.
|
|
19
|
+
*/
|
|
20
|
+
cancel: 'Cancel',
|
|
21
|
+
/**
|
|
22
|
+
* @description Text for the allow button in the "type to allow" dialog.
|
|
23
|
+
*/
|
|
24
|
+
allow: 'Allow',
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
const str_ = i18n.i18n.registerUIStrings('ui/components/dialogs/TypeToAllowDialog.ts', UIStrings);
|
|
28
|
+
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
29
|
+
|
|
30
|
+
export class TypeToAllowDialog {
|
|
31
|
+
static async show(options: {
|
|
32
|
+
jslogContext: {
|
|
33
|
+
dialog: string,
|
|
34
|
+
input: string,
|
|
35
|
+
},
|
|
36
|
+
header: Platform.UIString.LocalizedString,
|
|
37
|
+
message: Platform.UIString.LocalizedString,
|
|
38
|
+
typePhrase: Platform.UIString.LocalizedString,
|
|
39
|
+
inputPlaceholder: Platform.UIString.LocalizedString,
|
|
40
|
+
}): Promise<boolean> {
|
|
41
|
+
const dialog = new UI.Dialog.Dialog(options.jslogContext.dialog);
|
|
42
|
+
dialog.setMaxContentSize(new Geometry.Size(504, 340));
|
|
43
|
+
dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.SET_EXACT_WIDTH_MAX_HEIGHT);
|
|
44
|
+
dialog.setDimmed(true);
|
|
45
|
+
const shadowRoot =
|
|
46
|
+
UI.UIUtils.createShadowRootWithCoreStyles(dialog.contentElement, {cssFile: typeToAllowDialogStyles});
|
|
47
|
+
const content = shadowRoot.createChild('div', 'type-to-allow-dialog');
|
|
48
|
+
|
|
49
|
+
const result = await new Promise<boolean>(resolve => {
|
|
50
|
+
const header = content.createChild('div', 'header');
|
|
51
|
+
header.createChild('div', 'title').textContent = options.header;
|
|
52
|
+
|
|
53
|
+
const closeButton = header.createChild('dt-close-button', 'dialog-close-button');
|
|
54
|
+
closeButton.setTabbable(true);
|
|
55
|
+
self.onInvokeElement(closeButton, event => {
|
|
56
|
+
dialog.hide();
|
|
57
|
+
event.consume(true);
|
|
58
|
+
resolve(false);
|
|
59
|
+
});
|
|
60
|
+
closeButton.setSize(Buttons.Button.Size.SMALL);
|
|
61
|
+
|
|
62
|
+
content.createChild('div', 'message').textContent = options.message;
|
|
63
|
+
|
|
64
|
+
const input = UI.UIUtils.createInput('text-input', 'text', options.jslogContext.input);
|
|
65
|
+
input.placeholder = options.inputPlaceholder;
|
|
66
|
+
content.appendChild(input);
|
|
67
|
+
|
|
68
|
+
const buttonsBar = content.createChild('div', 'button');
|
|
69
|
+
const cancelButton =
|
|
70
|
+
UI.UIUtils.createTextButton(i18nString(UIStrings.cancel), () => resolve(false), {jslogContext: 'cancel'});
|
|
71
|
+
|
|
72
|
+
const allowButton = UI.UIUtils.createTextButton(i18nString(UIStrings.allow), () => {
|
|
73
|
+
resolve(input.value === options.typePhrase || input.value === `'${options.typePhrase}'`);
|
|
74
|
+
}, {jslogContext: 'confirm', variant: Buttons.Button.Variant.PRIMARY});
|
|
75
|
+
allowButton.disabled = true;
|
|
76
|
+
|
|
77
|
+
buttonsBar.appendChild(allowButton);
|
|
78
|
+
buttonsBar.appendChild(cancelButton);
|
|
79
|
+
|
|
80
|
+
input.addEventListener('input', () => {
|
|
81
|
+
allowButton.disabled = !Boolean(input.value);
|
|
82
|
+
}, false);
|
|
83
|
+
input.addEventListener('paste', e => e.preventDefault());
|
|
84
|
+
input.addEventListener('drop', e => e.preventDefault());
|
|
85
|
+
|
|
86
|
+
dialog.setOutsideClickCallback(event => {
|
|
87
|
+
event.consume();
|
|
88
|
+
resolve(false);
|
|
89
|
+
});
|
|
90
|
+
dialog.show();
|
|
91
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.SelfXssWarningDialogShown);
|
|
92
|
+
});
|
|
93
|
+
dialog.hide();
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as ButtonDialog from './ButtonDialog.js';
|
|
6
6
|
import * as Dialog from './Dialog.js';
|
|
7
|
+
import * as FreDialog from './FreDialog.js';
|
|
7
8
|
import * as ShortcutDialog from './ShortcutDialog.js';
|
|
9
|
+
import * as TypeToAllowDialog from './TypeToAllowDialog.js';
|
|
8
10
|
|
|
9
11
|
export {
|
|
10
12
|
ButtonDialog,
|
|
11
13
|
Dialog,
|
|
14
|
+
FreDialog,
|
|
12
15
|
ShortcutDialog,
|
|
16
|
+
TypeToAllowDialog,
|
|
13
17
|
};
|
|
@@ -66,7 +66,7 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(this.#setting.descriptor());
|
|
69
|
-
const learnMore = uiDescriptor?.learnMore
|
|
69
|
+
const learnMore = uiDescriptor?.learnMore;
|
|
70
70
|
if (learnMore) {
|
|
71
71
|
const jsLogContext = `${this.#setting.name}-documentation`;
|
|
72
72
|
const data: Buttons.Button.ButtonData = {
|
|
@@ -136,8 +136,8 @@ export class SettingCheckbox extends HTMLElement {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
const uiDescriptor = SettingUIRegistration.SettingUIRegistration.maybeResolve(this.#setting.descriptor());
|
|
139
|
-
const learnMore = uiDescriptor?.learnMore
|
|
140
|
-
const titleText = uiDescriptor?.title
|
|
139
|
+
const learnMore = uiDescriptor?.learnMore;
|
|
140
|
+
const titleText = uiDescriptor?.title ?? '';
|
|
141
141
|
|
|
142
142
|
const icon = this.icon();
|
|
143
143
|
const title = learnMore?.tooltip?.() ?? '';
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
5
|
+
import '../spinners/spinners.js';
|
|
6
|
+
import '../tooltips/tooltips.js';
|
|
7
7
|
|
|
8
|
-
import type * as Common from '
|
|
9
|
-
import * as Host from '
|
|
10
|
-
import * as i18n from '
|
|
11
|
-
import * as Root from '
|
|
12
|
-
import * as UI from '../../
|
|
13
|
-
import {Directives, html, nothing, render} from '../../
|
|
14
|
-
import * as VisualLogging from '../../
|
|
8
|
+
import type * as Common from '../../../core/common/common.js';
|
|
9
|
+
import * as Host from '../../../core/host/host.js';
|
|
10
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
|
+
import * as Root from '../../../core/root/root.js';
|
|
12
|
+
import * as UI from '../../legacy/legacy.js';
|
|
13
|
+
import {Directives, html, nothing, render} from '../../lit/lit.js';
|
|
14
|
+
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
15
15
|
|
|
16
16
|
import styles from './aiCodeCompletionDisclaimer.css.js';
|
|
17
17
|
|
|
@@ -293,8 +293,8 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
293
293
|
|
|
294
294
|
override wasShown(): void {
|
|
295
295
|
super.wasShown();
|
|
296
|
-
Host.AidaClient.HostConfigTracker.instance().addEventListener(
|
|
297
|
-
|
|
296
|
+
Host.AidaClient.HostConfigTracker.instance().addEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
297
|
+
this.#boundOnAidaAvailabilityChange);
|
|
298
298
|
const initialAvailability = Host.AidaClient.HostConfigTracker.instance().aidaAvailability;
|
|
299
299
|
if (initialAvailability !== undefined) {
|
|
300
300
|
this.#updateAidaAvailability(initialAvailability);
|
|
@@ -303,7 +303,7 @@ export class AiCodeCompletionDisclaimer extends UI.Widget.Widget {
|
|
|
303
303
|
|
|
304
304
|
override willHide(): void {
|
|
305
305
|
super.willHide();
|
|
306
|
-
Host.AidaClient.HostConfigTracker.instance().removeEventListener(
|
|
307
|
-
|
|
306
|
+
Host.AidaClient.HostConfigTracker.instance().removeEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
307
|
+
this.#boundOnAidaAvailabilityChange);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
@@ -8,12 +8,13 @@ import * as i18n from '../../../core/i18n/i18n.js';
|
|
|
8
8
|
import * as Root from '../../../core/root/root.js';
|
|
9
9
|
import * as AiCodeCompletion from '../../../models/ai_code_completion/ai_code_completion.js';
|
|
10
10
|
import * as AiCodeGeneration from '../../../models/ai_code_generation/ai_code_generation.js';
|
|
11
|
-
import * as PanelCommon from '../../../panels/common/common.js';
|
|
12
11
|
import * as CodeMirror from '../../../third_party/codemirror.next/codemirror.next.js';
|
|
13
12
|
import * as UI from '../../legacy/legacy.js';
|
|
14
13
|
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
15
14
|
|
|
16
15
|
import {AccessiblePlaceholder} from './AccessiblePlaceholder.js';
|
|
16
|
+
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
17
|
+
import {AiCodeCompletionTeaser} from './AiCodeCompletionTeaser.js';
|
|
17
18
|
import {type AiCodeGenerationConfig, AiCodeGenerationProvider} from './AiCodeGenerationProvider.js';
|
|
18
19
|
import {
|
|
19
20
|
acceptAiAutoCompleteSuggestion,
|
|
@@ -57,7 +58,7 @@ export interface AiCodeCompletionConfig {
|
|
|
57
58
|
onRequestTriggered: () => void;
|
|
58
59
|
onResponseReceived: () => void;
|
|
59
60
|
disclaimerTooltipId: string;
|
|
60
|
-
disclaimerTextVariant:
|
|
61
|
+
disclaimerTextVariant: DisclaimerTextVariant;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
export const DELAY_BEFORE_SHOWING_RESPONSE_MS = 500;
|
|
@@ -71,7 +72,7 @@ export class AiCodeCompletionProvider {
|
|
|
71
72
|
#aiCodeCompletionTeaserDismissedSetting =
|
|
72
73
|
Common.Settings.Settings.instance().createSetting('ai-code-completion-teaser-dismissed', false);
|
|
73
74
|
#teaserCompartment = new CodeMirror.Compartment();
|
|
74
|
-
#teaser?:
|
|
75
|
+
#teaser?: AiCodeCompletionTeaser;
|
|
75
76
|
#suggestionRenderingTimeout?: number;
|
|
76
77
|
#editor?: TextEditor;
|
|
77
78
|
#aiCodeCompletionCitations: Host.AidaClient.Citation[] = [];
|
|
@@ -143,7 +144,7 @@ export class AiCodeCompletionProvider {
|
|
|
143
144
|
editorInitialized(editor: TextEditor): void {
|
|
144
145
|
this.#editor = editor;
|
|
145
146
|
if (!this.#aiCodeCompletionSetting.get() && !this.#aiCodeCompletionTeaserDismissedSetting.get()) {
|
|
146
|
-
this.#teaser = new
|
|
147
|
+
this.#teaser = new AiCodeCompletionTeaser({
|
|
147
148
|
onDetach: () => this.#detachTeaser.bind(this),
|
|
148
149
|
disclaimerTextVariant: this.#aiCodeCompletionConfig?.disclaimerTextVariant,
|
|
149
150
|
});
|
|
@@ -486,9 +487,9 @@ export class AiCodeCompletionProvider {
|
|
|
486
487
|
}
|
|
487
488
|
}
|
|
488
489
|
|
|
489
|
-
function aiCodeCompletionTeaserExtension(teaser:
|
|
490
|
+
function aiCodeCompletionTeaserExtension(teaser: AiCodeCompletionTeaser): CodeMirror.Extension {
|
|
490
491
|
return CodeMirror.ViewPlugin.fromClass(class {
|
|
491
|
-
teaser:
|
|
492
|
+
teaser: AiCodeCompletionTeaser;
|
|
492
493
|
#teaserDecoration: CodeMirror.DecorationSet = CodeMirror.Decoration.none;
|
|
493
494
|
#teaserMode: AiCodeCompletionTeaserMode;
|
|
494
495
|
#teaserDisplayTimeout?: number;
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import '../../
|
|
5
|
+
import '../../kit/kit.js';
|
|
6
6
|
|
|
7
|
-
import * as Common from '
|
|
8
|
-
import * as Host from '
|
|
9
|
-
import * as i18n from '
|
|
10
|
-
import * as Root from '
|
|
11
|
-
import * as AIAssistance from '
|
|
12
|
-
import * as AiCodeGeneration from '
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import * as
|
|
7
|
+
import * as Common from '../../../core/common/common.js';
|
|
8
|
+
import * as Host from '../../../core/host/host.js';
|
|
9
|
+
import * as i18n from '../../../core/i18n/i18n.js';
|
|
10
|
+
import * as Root from '../../../core/root/root.js';
|
|
11
|
+
import * as AIAssistance from '../../../models/ai_assistance/ai_assistance.js';
|
|
12
|
+
import * as AiCodeGeneration from '../../../models/ai_code_generation/ai_code_generation.js';
|
|
13
|
+
import * as UI from '../../legacy/legacy.js';
|
|
14
|
+
import {html, type LitTemplate, nothing, render} from '../../lit/lit.js';
|
|
15
|
+
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
16
|
+
import * as Dialogs from '../dialogs/dialogs.js';
|
|
17
|
+
import * as Snackbars from '../snackbars/snackbars.js';
|
|
17
18
|
|
|
18
19
|
import type {DisclaimerTextVariant} from './AiCodeCompletionDisclaimer.js';
|
|
19
20
|
import styles from './aiCodeCompletionTeaser.css.js';
|
|
20
|
-
import {FreDialog} from './FreDialog.js';
|
|
21
21
|
|
|
22
22
|
const UIStringsNotTranslate = {
|
|
23
23
|
/**
|
|
@@ -243,35 +243,33 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
243
243
|
|
|
244
244
|
const devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance();
|
|
245
245
|
if (AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationEnabled(devtoolsLocale.locale)) {
|
|
246
|
-
reminderItems.push(
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
});
|
|
246
|
+
reminderItems.push({
|
|
247
|
+
iconName: 'code',
|
|
248
|
+
content: lockedString(UIStringsNotTranslate.freDisclaimerTextAsYouType),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
iconName: 'text-analysis',
|
|
252
|
+
content: Host.Platform.isMac() ?
|
|
253
|
+
lockedString(UIStringsNotTranslate.freDisclaimerDescribeCodeInCommentForMacOs) :
|
|
254
|
+
lockedString(UIStringsNotTranslate.freDisclaimerDescribeCodeInComment),
|
|
255
|
+
});
|
|
257
256
|
}
|
|
258
257
|
|
|
259
|
-
reminderItems.push(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
// clang-format off
|
|
258
|
+
reminderItems.push({
|
|
259
|
+
iconName: 'google',
|
|
260
|
+
content: this.#noLogging ? lockedString(UIStringsNotTranslate.freDisclaimerTextPrivacyNoLogging) :
|
|
261
|
+
lockedString(UIStringsNotTranslate.freDisclaimerTextPrivacy),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
iconName: 'warning',
|
|
265
|
+
// clang-format off
|
|
268
266
|
content: html`<devtools-link
|
|
269
267
|
href=${CODE_SNIPPET_WARNING_URL}
|
|
270
268
|
class="link devtools-link"
|
|
271
269
|
jslogcontext="code-snippets-explainer.ai-code-completion-teaser"
|
|
272
270
|
>${lockedString(UIStringsNotTranslate.freDisclaimerTextUseWithCaution)}</devtools-link>`,
|
|
273
|
-
|
|
274
|
-
|
|
271
|
+
// clang-format on
|
|
272
|
+
});
|
|
275
273
|
return reminderItems;
|
|
276
274
|
}
|
|
277
275
|
|
|
@@ -279,7 +277,7 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
279
277
|
event.preventDefault();
|
|
280
278
|
|
|
281
279
|
const iconName = AIAssistance.AiUtils.getIconName();
|
|
282
|
-
const result = await FreDialog.show({
|
|
280
|
+
const result = await Dialogs.FreDialog.FreDialog.show({
|
|
283
281
|
header: {iconName, text: lockedString(UIStringsNotTranslate.freDisclaimerHeader)},
|
|
284
282
|
reminderItems: this.#createReminderItems(),
|
|
285
283
|
onLearnMoreClick: () => {
|
|
@@ -311,19 +309,18 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
311
309
|
|
|
312
310
|
override performUpdate(): void {
|
|
313
311
|
const output = {};
|
|
314
|
-
this.#view(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
output, this.contentElement);
|
|
312
|
+
this.#view({
|
|
313
|
+
aidaAvailability: this.#aidaAvailability,
|
|
314
|
+
onAction: this.onAction,
|
|
315
|
+
onDismiss: this.onDismiss,
|
|
316
|
+
},
|
|
317
|
+
output, this.contentElement);
|
|
321
318
|
}
|
|
322
319
|
|
|
323
320
|
override wasShown(): void {
|
|
324
321
|
super.wasShown();
|
|
325
|
-
Host.AidaClient.HostConfigTracker.instance().addEventListener(
|
|
326
|
-
|
|
322
|
+
Host.AidaClient.HostConfigTracker.instance().addEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
323
|
+
this.#boundOnAidaAvailabilityChange);
|
|
327
324
|
this.#aiCodeCompletionFreCompletedSetting.addChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
328
325
|
this.#aiCodeCompletionTeaserDismissedSetting.addChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
329
326
|
const initialAvailability = Host.AidaClient.HostConfigTracker.instance().aidaAvailability;
|
|
@@ -334,8 +331,8 @@ export class AiCodeCompletionTeaser extends UI.Widget.Widget {
|
|
|
334
331
|
|
|
335
332
|
override willHide(): void {
|
|
336
333
|
super.willHide();
|
|
337
|
-
Host.AidaClient.HostConfigTracker.instance().removeEventListener(
|
|
338
|
-
|
|
334
|
+
Host.AidaClient.HostConfigTracker.instance().removeEventListener(Host.AidaClient.Events.AIDA_AVAILABILITY_CHANGED,
|
|
335
|
+
this.#boundOnAidaAvailabilityChange);
|
|
339
336
|
this.#aiCodeCompletionFreCompletedSetting.removeChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
340
337
|
this.#aiCodeCompletionTeaserDismissedSetting.removeChangeListener(this.#boundOnAiCodeCompletionSettingChanged);
|
|
341
338
|
}
|